Microsoft Cloud 列印事件

本文說明 Microsoft Cloud 列印事件的屬性和結構描述,這些事件是由 Microsoft Graph API 所發佈。 如需事件結構描述簡介,請參閱 CloudEvents 結構描述

可用的事件類型

使用 Microsoft Graph API 操作這些資源來建立或更新 Cloud 列印作業printTaskDefinition 時,即會觸發這些事件。

事件名稱 描述
Microsoft.Graph.PrinterUpdated 當印表機的列印作業進入 JobFetchable 狀態 (擷取列印就緒) 時觸發。
Microsoft.Graph.PrintTaskDefinitionCreated 在通用列印中啟動列印工作時觸發。

事件範例

觸發事件時,事件格線服務會將該事件的相關資料傳送至訂閱目的地。 本節包含每個 Microsoft 安全性警示事件的資料顯示範例。

Microsoft.Graph.PrinterUpdated 事件

{
  "id": "00d8a100-2e92-4bfa-86e1-0056dacd0fce",
  "type": "Microsoft.Graph.PrinterUpdated",
  "source": "print/printers/<printer-Id>/jobs/<job-id>",
  "subject": "print/printers/<printer-Id>/jobs/<job-id>",
  "time": "2022-05-24T22:24:31.3062901Z",
  "datacontenttype": "application/json",
  "specversion": "1.0",
  "data": {
    "subscriptionId": "<guid>",
    "changeType": "updated",
    "clientState": "<user provided secret>",
    "subscriptionExpirationDateTime": "2022-05-24T23:21:19.3554403+00:00",
    "resource": "print/printers/<printer-Id>/jobs/<job-id>",
    "resourceData": {
      "@odata.type": "#microsoft.graph.todoTask",
      "@odata.id": "print/printers/<printer-Id>/jobs/<job-id>",
      "id": "<job-id>"
    },
    "subscriptionId": "<microsoft-graph-subscription-id>",
    "tenantId": "<tenant-id>
  }
}

事件屬性

事件具有下列的最高層級資料:

屬性 類型​ 描述
source string 租用戶事件來源。 此欄位無法寫入。 Microsoft 圖形 API 提供此值。
subject string 發行者定義事件主旨的路徑。
type string 此事件來源的其中一種事件類型。
time string 事件產生的時間,以提供者之 UTC 時間為準
id string 事件的唯一識別碼。
data object 提供關於資源狀態變更之資料的事件承載。
specversion string CloudEvents 結構描述規格版本。

資料物件具有下列屬性:

屬性 類型​ 描述
changeType string 資源狀態變更的類型。
resource string 引起事件的資源識別碼。
tenantId string 引發警示的組織識別碼。
clientState string 使用者在建立圖形 API 訂用帳戶時所提供的祕密。
@odata.type string 圖形 API 變更類型。
@odata.id string 引起事件的圖形 API 資源識別碼。
id string 引起事件的資源識別碼。
subscriptionExpirationDateTime string 圖形 API 訂用帳戶到期的時間 (格式為 RFC 3339)。
subscriptionId string 圖形 API 訂用帳戶識別碼。
tenantId string Microsoft Entra 租用戶識別碼。

下一步