ジョブ ルーター イベントのサブスクライブ

このガイドでは、Job Router イベントのサブスクリプションを設定する手順と、それらを受信する方法について説明します。

詳細については、Event Grid のドキュメントに関するページを参照してください。

前提条件

Event Grid のサブスクリプションを作成する

このテンプレートには、EventGrid サブスクリプションを Job Router イベントのストレージ キューにデプロイします。 ストレージ アカウント、キュー、またはシステム トピックが存在しない場合は、それらも作成されます。

Azure にデプロイする

パラメーター

  • Azure Communication Services リソース名: Azure Communication Services リソースの名前。 たとえば、リソースのエンドポイントが https://contoso.communication.azure.net の場合は、contoso を設定します。
  • Storage Name: Azure Storage アカウントの名前。 存在しない場合は作成されます。
  • Event Sub Name: 作成するイベント サブスクリプションの名前。
  • System Topic Name: Azure Communication Services リソースに既存のイベント サブスクリプションがある場合は、Azure Communication Services リソースの Events タブで System Topic の名前を見つけます。 それ以外の場合は、Azure Communication Services リソース名自体などの一意の名前を指定します。
  • Queue Name: 自分のストレージ アカウント内のキューの名前。 存在しない場合は作成されます。

デプロイされるリソース

次のリソースは、ソリューションの一部としてデプロイされます

  • ストレージ アカウント: ストレージ アカウント名が存在しない場合。
  • ストレージ キュー: ストレージ アカウント内にキューが存在しない場合。
  • Event Grid システム トピック: トピックが存在しない場合。
  • Event Grid サブスクリプション: ストレージ キュー上のすべての Job Router イベントのサブスクリプション。

クイック スタート: Azure Storage キューを介して Event Grid イベントを受け取る

新しい C# アプリケーションを作成する

コンソール ウィンドウ (cmd、PowerShell、Bash など) で、dotnet new コマンドを使用し、EventReceiver という名前で新しいコンソール アプリを作成します。 このコマンドにより、1 つのソース ファイルを使用する単純な "Hello World" C# プロジェクトが作成されます。Program.cs

dotnet new console -o EventReceiver

新しく作成したアプリ フォルダーにディレクトリを変更し、dotnet build コマンドを使用してアプリケーションをコンパイルします。

cd EventReceiver
dotnet build

パッケージのインストール

Azure Storage キューと Event Grid パッケージをインストールします。

dotnet add package Azure.Storage.Queues
dotnet add package Azure.Messaging.EventGrid

キューからメッセージを受け取る

次のコード スニペットをコピーして、ソース ファイル Program.cs に貼り付けます

using Azure.Storage.Queues;
using Azure.Messaging.EventGrid;

// For more detailed tutorials on storage queues, see: https://video2.skills-academy.com/azure/storage/queues/storage-tutorial-queues

var queueClient = new QueueClient("<Storage Account Connection String>", "router-events");

while (true)
{
    var msg = await queueClient.ReceiveMessageAsync();
    if (msg.Value == null)
    {
        await Task.Delay(TimeSpan.FromSeconds(1));
        continue;
    }
    var json = Convert.FromBase64String(msg.Value.Body.ToString());
    var evt = EventGridEvent.Parse(BinaryData.FromBytes(json));

    Console.WriteLine($"Received event: {evt.EventType} - {evt.Subject} - {evt.Data}");

    await queueClient.DeleteMessageAsync(msg.Value.MessageId, msg.Value.PopReceipt);
}

コードの実行

アプリケーション ディレクトリから dotnet run コマンドを使用してアプリケーションを実行します。

dotnet run

イベント カタログ

ルーター イベント

イベント Subdomain 説明
RouterJobReceived Job ルーティング用に新しいジョブが作成されました
RouterJobClassified Job 分類ポリシーがジョブに適用されました
RouterJobQueued Job ジョブが正常にエンキューされました
RouterJobClassificationFailed Job ルーターは分類ポリシーを使用してジョブを分類できませんでした
RouterJobCompleted Job ジョブが完了し、ラップアップに入ります
RouterJobClosed Job ジョブが閉じ、ラップアップが完了しました
RouterJobCancelled Job ジョブがキャンセルされました
RouterJobExceptionTriggered Job ジョブの例外がトリガーされました
RouterJobWorkerSelectorsExpired Job ジョブで 1 つ以上 worker セレクターの有効期限が切れています
RouterJobUnassigned Job 既に割り当て済みのジョブがワーカーから割り当てられていません
RouterJobWaitingForActivation Job スケジュールされたジョブの要求された予定時刻となり、ルーターは contoso でジョブに対して動作を待機しています
RouterJobSchedulingFailed Job スケジュールされたジョブが要求されましたが、ルーターはジョブを作成できませんでした
RouterWorkerOfferIssued Worker ジョブがワーカーに提供されました
RouterWorkerOfferAccepted Worker ワーカーに対するオファーが受理されました
RouterWorkerOfferDeclined Worker ワーカーに対するオファーが拒否されました
RouterWorkerOfferRevoked Worker ワーカーに対するオファーが取り消されました
RouterWorkerOfferExpired Worker ワーカーに対するオファーの有効期限が切れました
RouterWorkerRegistered Worker ワーカーが登録されました (状態が非アクティブ/ドレインからアクティブに変更されました)
RouterWorkerUpdated Worker worker プロパティ AvailableForOffersTotalCapacityQueueAssignmentsChannelConfigurationsLabelsTags のいずれかが更新されました。
RouterWorkerDeregistered Worker ワーカーが登録解除されました (状態がアクティブから非アクティブ/ドレインに変更されました)

Microsoft.Communication.RouterJobReceived

イベント カタログに戻る

{
  "id": "acdf8fa5-8ab4-4a65-874a-c1d2a4a97f2e",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}",
  "data": {
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "jobStatus": "PendingClassification",
    "channelId": "FooVoiceChannelId",
    "classificationPolicyId": "test-policy",
    "queueId": "queue-id",
    "priority": 0,
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "requestedWorkerSelectors": [
      {
        "key": "string",
        "labelOperator": "equal",
        "value": 5,
        "ttlSeconds": 50,
        "expirationTime": "2022-02-17T00:58:25.1736293Z"
      }
    ],
    "scheduledOn": "3/28/2007 7:13:50 PM +00:00",
    "unavailableForMatching": false
  },
  "eventType": "Microsoft.Communication.RouterJobReceived",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

属性の一覧

属性 Type Nullable 説明 メモ
jobId string
channelReference string
jobStatus enum 使用可能な値: PendingClassification、Queued このイベントが送信される場合、分類プロセスがまだ実行されていないか、関連付けられた queueId を使用してジョブが作成されています。
channelId string
classificationPolicyId string ✔️ nullジョブに対して queueId が指定されている場合
queueId string ✔️ nullジョブに対して classificationPolicyId が指定されている場合
priority int ✔️ classificationPolicyId が指定されている場合は null。 直接キュー割り当ての場合は、null 以外の値。
labels Dictionary<string, object> ✔️ ユーザー入力に基づく
tags Dictionary<string, object> ✔️ ユーザー入力に基づく
requestedWorkerSelectors List<WorkerSelector> ✔️ ユーザー入力に基づく
scheduledOn DateTimeOffset ✔️ ユーザー入力に基づく
unavailableForMatching bool ✔️ ユーザー入力に基づく

Microsoft.Communication.RouterJobClassified

イベント カタログに戻る

{
  "id": "b6d8687a-5a1a-42ae-b8b5-ff7ec338c872",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}/queue/{queue-id}",
  "data": {
    "queueDetails": {
      "id": "625fec06-ab81-4e60-b780-f364ed96ade1",
      "name": "Queue 1",
      "labels": {
        "Language": "en",
        "Product": "Office",
        "Geo": "NA"
      }
    },
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "classificationPolicyId": "test-policy",
    "queueId": "625fec06-ab81-4e60-b780-f364ed96ade1",
    "priority": 5,
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "attachedWorkerSelectors": [
      {
        "key": "string",
        "labelOperator": "equal",
        "value": 5,
        "ttl": "P3Y6M4DT12H30M5S"
      }
    ]
  },
  "eventType": "Microsoft.Communication.RouterJobClassified",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

属性の一覧

属性 Type Nullable 説明 メモ
queueDetails QueueDetails
jobId string
channelReference string
channelId string
classificationPolicyId string
queueId string ✔️ nullclassificationPolicy がキューの選択に使用されない場合
priority int ✔️ nullclassificationPolicy がジョブに優先順位を適用するために使用されない場合
labels Dictionary<string, object> ✔️ ユーザー入力に基づく
tags Dictionary<string, object> ✔️ ユーザー入力に基づく
attachedWorkerSelectors List<WorkerSelector> ✔️ 分類ポリシーによってアタッチされたワーカー セレクターの一覧

Microsoft.Communication.RouterJobQueued

イベント カタログに戻る

{
  "id": "b6d8687a-5a1a-42ae-b8b5-ff7ec338c872",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}/queue/{queue-id}",
  "data": {
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "queueId": "625fec06-ab81-4e60-b780-f364ed96ade1",
    "priority": 1,
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "requestedWorkerSelectors": [
      {
        "key": "string",
        "labelOperator": "equal",
        "value": 5,
        "ttl": "P3Y6M4DT12H30M5S"
      }
    ],
    "attachedWorkerSelectors": [
      {
        "key": "string",
        "labelOperator": "equal",
        "value": 5,
        "ttl": "P3Y6M4DT12H30M5S"
      }
    ]
  },
  "eventType": "Microsoft.Communication.RouterJobQueued",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

属性の一覧

属性 Type Nullable 説明 メモ
jobId string
channelReference string ✔️
channelId string
queueId string
priority int
labels Dictionary<string, object> ✔️ ユーザー入力に基づく
tags Dictionary<string, object> ✔️ ユーザー入力に基づく
requestedWorkerSelectors List<WorkerSelector> ✔️ ジョブの作成時のユーザー入力に基づく
attachedWorkerSelectors List<WorkerSelector> ✔️ 分類ポリシーによってアタッチされたワーカー セレクターの一覧

Microsoft.Communication.RouterJobClassificationFailed

イベント カタログに戻る

{
  "id": "b6d8687a-5a1a-42ae-b8b5-ff7ec338c872",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}/classificationpolicy/{classificationpolicy-id}",
  "data": {
    "errors": [
      {
        "code": null,
        "message": "Classification failed due to <reason>",
        "target": null,
        "innerError": null,
        "details": null
      }
    ],
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "classificationPolicyId": "test-policy",
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    }
  },
  "eventType": "Microsoft.Communication.RouterJobClassificationFailed",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

属性の一覧

属性 Type Nullable 説明 メモ
エラー List<CommunicationError>
jobId string
channelReference string
channelId string
classificationPolicyId string
labels Dictionary<string, object> ✔️ ユーザー入力に基づく
tags Dictionary<string, object> ✔️ ユーザー入力に基づく

Microsoft.Communication.RouterJobCompleted

イベント カタログに戻る

{
  "id": "b6d8687a-5a1a-42ae-b8b5-ff7ec338c872",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}/assignment/{assignment-id}",
  "data": {
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "queueId": "queue-id",
    "assignmentId": "6f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "workerId": "e3a3f2f9-3582-4bfe-9c5a-aa57831a0f88"
  },
  "eventType": "Microsoft.Communication.RouterJobCompleted",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

属性の一覧

属性 Type Nullable 説明 メモ
jobId string
channelReference string
channelId string
queueId string
labels Dictionary<string, object> ✔️ ユーザー入力に基づく
tags Dictionary<string, object> ✔️ ユーザー入力に基づく
assignmentId string
workerId string

Microsoft.Communication.RouterJobClosed

イベント カタログに戻る

{
  "id": "b6d8687a-5a1a-42ae-b8b5-ff7ec338c872",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}/assignment/{assignment-id}",
  "data": {
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "queueId": "",
    "dispositionCode": "",
    "workerId": "",
    "assignmentId": "",
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    }
  },
  "eventType": "Microsoft.Communication.RouterJobClosed",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

属性の一覧

属性 Type Nullable 説明 メモ
jobId string
channelReference string
channelId string
queueId string
labels Dictionary<string, object> ✔️ ユーザー入力に基づく
tags Dictionary<string, object> ✔️ ユーザー入力に基づく
dispositionCode string ✔️ ユーザー入力に基づく
workerId string
assignmentId string

Microsoft.Communication.RouterJobCancelled

イベント カタログに戻る

{
  "id": "b6d8687a-5a1a-42ae-b8b5-ff7ec338c872",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}/disposition/{disposition-code}",
  "data": {
    "note": "Cancelled due to <reason>",
    "dispositionCode": "100",
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "queueId": ""
  },
  "eventType": "Microsoft.Communication.RouterJobCancelled",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

属性の一覧

属性 Type Nullable 説明 メモ
note string ✔️ ユーザー入力に基づく
dispositionCode string
jobId string
channelReference string
channelId string
labels Dictionary<string, object> ✔️ ユーザー入力に基づく
tags Dictionary<string, object> ✔️ ユーザー入力に基づく
queueId string ✔️

Microsoft.Communication.RouterJobExceptionTriggered

イベント カタログに戻る

{
  "id": "1027db4a-17fe-4a7f-ae67-276c3120a29f",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}/exceptionrule/{rulekey}",
  "data": {
    "ruleKey": "r100",
    "exceptionRuleId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    }
  },
  "eventType": "Microsoft.Communication.RouterJobExceptionTriggered",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

属性の一覧

属性 Type Nullable 説明 メモ
ruleKey string
exceptionRuleId string
jobId string
channelReference string
channelId string
labels Dictionary<string, object> ✔️ ユーザー入力に基づく
tags Dictionary<string, object> ✔️ ユーザー入力に基づく

Microsoft.Communication.RouterJobWorkerSelectorsExpired

イベント カタログに戻る

{
  "id": "b6d8687a-5a1a-42ae-b8b5-ff7ec338c872",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}/queue/{queue-id}",
  "data": {
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "queueId": "625fec06-ab81-4e60-b780-f364ed96ade1",
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "requestedWorkerSelectorsExpired": [
      {
        "key": "string",
        "labelOperator": "equal",
        "value": 5,
        "ttl": "P3Y6M4DT12H30M5S"
      }
    ],
    "attachedWorkerSelectorsExpired": [
      {
        "key": "string",
        "labelOperator": "equal",
        "value": 5,
        "ttl": "P3Y6M4DT12H30M5S"
      }
    ]
  },
  "eventType": "Microsoft.Communication.RouterJobWorkerSelectorsExpired",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

属性の一覧

属性 Type Nullable 説明 メモ
jobId string
channelReference string ✔️
queueId string
channelId string
labels Dictionary<string, object> ✔️ ユーザー入力に基づく
tags Dictionary<string, object> ✔️ ユーザー入力に基づく
requestedWorkerSelectorsExpired List<WorkerSelector> ✔️ ジョブの作成時のユーザー入力に基づく
attachedWorkerSelectorsExpired List<WorkerSelector> ✔️ 分類ポリシーによってアタッチされたワーカー セレクターの一覧

Microsoft.Communication.RouterJobUnassigned

イベント カタログに戻る

{
  "id": "acdf8fa5-8ab4-4a65-874a-c1d2a4a97f2e",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}/assignment/{assignment-id}",
  "data": {
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "assignmentId": "",
    "workerId": "",
    "channelId": "FooVoiceChannelId",
    "channelReference": "test-abc",
    "queueId": "queue-id",    
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    }
  },
  "eventType": "Microsoft.Communication.RouterJobUnassigned",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

属性の一覧

属性 Type Nullable 説明 メモ
jobId string
assignmentId string
workerId string
channelId string
channelReference string
queueId string ✔️ nullジョブに対して classificationPolicyId が指定されている場合
labels Dictionary<string, object> ✔️ ユーザー入力に基づく
tags Dictionary<string, object> ✔️ ユーザー入力に基づく

Microsoft.Communication.RouterJobWaitingForActivation

イベント カタログに戻る

{
  "id": "acdf8fa5-8ab4-4a65-874a-c1d2a4a97f2e",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}",
  "data": {
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelId": "FooVoiceChannelId",
    "channelReference": "test-abc",
    "queueId": "queue-id",    
    "priority": 1,
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "requestedWorkerSelectors": [
      {
        "key": "string",
        "labelOperator": "equal",
        "value": 5,
        "ttl": "P3Y6M4DT12H30M5S"
      }
    ],
    "attachedWorkerSelectors": [
      {
        "key": "string",
        "labelOperator": "equal",
        "value": 5,
        "ttl": "P3Y6M4DT12H30M5S"
      }
    ],
    "scheduledOn": "2022-02-17T00:55:25.1736293Z",
    "unavailableForMatching": false
  },
  "eventType": "Microsoft.Communication.RouterJobWaitingForActivation",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

属性の一覧

属性 Type Nullable 説明 メモ
jobId string
channelId string
channelReference string
queueId string ✔️ nullジョブに対して classificationPolicyId が指定されている場合
labels Dictionary<string, object> ✔️ ユーザー入力に基づく
tags Dictionary<string, object> ✔️ ユーザー入力に基づく
requestedWorkerSelectorsExpired List<WorkerSelector> ✔️ ジョブの作成時のユーザー入力に基づく
attachedWorkerSelectorsExpired List<WorkerSelector> ✔️ 分類ポリシーによってアタッチされたワーカー セレクターの一覧
scheduledOn DateTimeOffset ✔️ ジョブの作成時のユーザー入力に基づく
unavailableForMatching bool ✔️ ジョブの作成時のユーザー入力に基づく
priority int ジョブの作成時のユーザー入力に基づく

Microsoft.Communication.RouterJobSchedulingFailed

イベント カタログに戻る

{
  "id": "acdf8fa5-8ab4-4a65-874a-c1d2a4a97f2e",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}",
  "data": {
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelId": "FooVoiceChannelId",
    "channelReference": "test-abc",
    "queueId": "queue-id",    
    "priority": 1,
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "requestedWorkerSelectors": [
      {
        "key": "string",
        "labelOperator": "equal",
        "value": 5,
        "ttl": "P3Y6M4DT12H30M5S"
      }
    ],
    "attachedWorkerSelectors": [
      {
        "key": "string",
        "labelOperator": "equal",
        "value": 5,
        "ttl": "P3Y6M4DT12H30M5S"
      }
    ],
    "scheduledOn": "2022-02-17T00:55:25.1736293Z",
    "failureReason": "Error"
  },
  "eventType": "Microsoft.Communication.RouterJobSchedulingFailed",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

属性の一覧

属性 Type Nullable 説明 メモ
jobId string
channelId string
channelReference string
queueId string ✔️ nullジョブに対して classificationPolicyId が指定されている場合
labels Dictionary<string, object> ✔️ ユーザー入力に基づく
tags Dictionary<string, object> ✔️ ユーザー入力に基づく
requestedWorkerSelectorsExpired List<WorkerSelector> ✔️ ジョブの作成時のユーザー入力に基づく
attachedWorkerSelectorsExpired List<WorkerSelector> ✔️ 分類ポリシーによってアタッチされたワーカー セレクターの一覧
scheduledOn DateTimeOffset ✔️ ジョブの作成時のユーザー入力に基づく
failureReason string ✔️ システムによって決定
priority int ジョブの作成時のユーザー入力に基づく

ワーカー イベント

Microsoft.Communication.RouterWorkerOfferIssued

イベント カタログに戻る

{
  "id": "1027db4a-17fe-4a7f-ae67-276c3120a29f",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "worker/{worker-id}/job/{job-id}",
  "data": {
    "workerId": "w100",
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "queueId": "625fec06-ab81-4e60-b780-f364ed96ade1",
    "offerId": "525fec06-ab81-4e60-b780-f364ed96ade1",
    "offeredOn": "2021-06-23T02:43:30.3847144Z",
    "expiresOn": "2021-06-23T02:44:30.3847674Z",
    "jobPriority": 5,
    "jobLabels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "jobTags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    }
  },
  "eventType": "Microsoft.Communication.RouterWorkerOfferIssued",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

属性の一覧

属性 Type Nullable 説明 メモ
workerId string
jobId string
channelReference string
channelId string
queueId string
offerId string
offeredOn DateTimeOffset
expiresOn DateTimeOffset
jobPriority int
jobLabels Dictionary<string, object> ✔️ ユーザー入力に基づく
jobTags Dictionary<string, object> ✔️ ユーザー入力に基づく

Microsoft.Communication.RouterWorkerOfferAccepted

イベント カタログに戻る

{
  "id": "1027db4a-17fe-4a7f-ae67-276c3120a29f",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "worker/{worker-id}/job/{job-id}",
  "data": {
    "workerId": "w100",
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "jobPriority": 5,
    "jobLabels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "jobTags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "queueId": "625fec06-ab81-4e60-b780-f364ed96ade1",
    "offerId": "565fec06-ab81-4e60-b780-f364ed96ade1",
    "assignmentId": "765fec06-ab81-4e60-b780-f364ed96ade1"
  },
  "eventType": "Microsoft.Communication.RouterWorkerOfferAccepted",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

属性の一覧

属性 Type Nullable 説明 メモ
workerId string
jobId string
jobPriority int
jobLabels Dictionary<string, object> ✔️ ユーザー入力に基づく
jobTags Dictionary<string, object> ✔️ ユーザー入力に基づく
channelReference string
channelId string
queueId string
offerId string
assignmentId string

Microsoft.Communication.RouterWorkerOfferDeclined

イベント カタログに戻る

{
  "id": "1027db4a-17fe-4a7f-ae67-276c3120a29f",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "worker/{worker-id}/job/{job-id}",
  "data": {
    "workerId": "w100",
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "queueId": "625fec06-ab81-4e60-b780-f364ed96ade1",
    "offerId": "565fec06-ab81-4e60-b780-f364ed96ade1",
  },
  "eventType": "Microsoft.Communication.RouterWorkerOfferDeclined",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

属性の一覧

属性 Type Nullable 説明 メモ
workerId string
jobId string
channelReference string
channelId string
queueId string
offerId string

Microsoft.Communication.RouterWorkerOfferRevoked

イベント カタログに戻る

{
  "id": "1027db4a-17fe-4a7f-ae67-276c3120a29f",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "worker/{worker-id}/job/{job-id}",
  "data": {
    "offerId": "565fec06-ab81-4e60-b780-f364ed96ade1",
    "workerId": "w100",
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "queueId": "625fec06-ab81-4e60-b780-f364ed96ade1"
  },
  "eventType": "Microsoft.Communication.RouterWorkerOfferRevoked",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

属性の一覧

属性 Type Nullable 説明 メモ
offerId string
workerId string
jobId string
channelReference string
channelId string
queueId string

Microsoft.Communication.RouterWorkerOfferExpired

イベント カタログに戻る

{
  "id": "1027db4a-17fe-4a7f-ae67-276c3120a29f",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "worker/{worker-id}/job/{job-id}",
  "data": {
    "offerId": "565fec06-ab81-4e60-b780-f364ed96ade1",
    "workerId": "w100",
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "queueId": "625fec06-ab81-4e60-b780-f364ed96ade1"
  },
  "eventType": "Microsoft.Communication.RouterWorkerOfferExpired",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

属性の一覧

属性 Type Nullable 説明 メモ
workerId string
offerId string
jobId string
channelReference string
channelId string
queueId string

Microsoft.Communication.RouterWorkerRegistered

イベント カタログに戻る

{
  "id": "1027db4a-17fe-4a7f-ae67-276c3120a29f",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "worker/{worker-id}",
  "data": {
    "workerId": "worker3",
    "totalCapacity": 100,
    "queueAssignments": [
      {
        "id": "MyQueueId2",
        "name": "Queue 3",
        "labels": {
          "Language": "en",
          "Product": "Office",
          "Geo": "NA"
        }
      }
    ],
    "labels": {
      "x": "111",
      "y": "111"
    },
    "channelConfigurations": [
      {
        "channelId": "FooVoiceChannelId",
        "capacityCostPerJob": 10,
        "maxNumberOfJobs": 5
      }
    ],
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    }
  },
  "eventType": "Microsoft.Communication.RouterWorkerRegistered",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

属性の一覧

属性 Type Nullable 説明 メモ
workerId string
totalCapacity int
queueAssignments List<QueueDetails>
labels Dictionary<string, object> ✔️ ユーザー入力に基づく
channelConfigurations List<ChannelConfiguration>
tags Dictionary<string, object> ✔️ ユーザー入力に基づく

Microsoft.Communication.RouterWorkerUpdated

イベント カタログに戻る

{
  "id": "1027db4a-17fe-4a7f-ae67-276c3120a29f",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "worker/{worker-id}",
  "data": {
    "workerId": "worker3",
    "availableForOffers": true,
    "totalCapacity": 100,
    "queueAssignments": [
      {
        "id": "MyQueueId2",
        "name": "Queue 3",
        "labels": {
          "Language": "en",
          "Product": "Office",
          "Geo": "NA"
        }
      }
    ],
    "labels": {
      "x": "111",
      "y": "111"
    },
    "channelConfigurations": [
      {
        "channelId": "FooVoiceChannelId",
        "capacityCostPerJob": 10,
        "maxNumberOfJobs": 5
      }
    ],
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "updatedWorkerProperties": [
      "TotalCapacity",
      "Labels",
      "Tags",
      "ChannelConfigurations",
      "AvailableForOffers",
      "QueueAssignments"
    ]
  },
  "eventType": "Microsoft.Communication.RouterWorkerUpdated",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

属性の一覧

属性 Type Nullable 説明 メモ
workerId string
totalCapacity int
queueAssignments List<QueueDetails>
labels Dictionary<string, object> ✔️ ユーザー入力に基づく
channelConfigurations List<ChannelConfiguration>
tags Dictionary<string, object> ✔️ ユーザー入力に基づく
updatedWorkerProperties List<UpdateWorkerProperty> AvailableForOffers、QueueAssignments、ChannelConfigurations、TotalCapacity、Labels、Tags など、worker プロパティが更新されました

Microsoft.Communication.RouterWorkerDeregistered

イベント カタログに戻る

{
  "id": "1027db4a-17fe-4a7f-ae67-276c3120a29f",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "worker/{worker-id}",
  "data": {
    "workerId": "worker3"
  },
  "eventType": "Microsoft.Communication.RouterWorkerDeregistered",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

属性の一覧

属性 Type Nullable 説明 メモ
workerId string

モデルの定義

QueueDetails

public class QueueDetails
{
    public string Id { get; set; }
    public string Name { get; set; }
    public Dictionary<string, object>? Labels { get; set; }
}

CommunicationError

public class CommunicationError
{
    public string? Code { get; init; }
    public string Message { get; init; }
    public string? Target { get; init; }
    public CommunicationError? InnerError { get; init; }
    public IEnumerable<CommunicationError>? Details { get; init; }
}

ChannelConfiguration

public class ChannelConfiguration
{
    public string ChannelId { get; set; }
    public int CapacityCostPerJob { get; set; }
    public int? MaxNumberOfJobs { get; set; }
}

UpdatedWorkerProperty

public enum UpdatedWorkerProperty
{
    AvailableForOffers,
    Capacity,
    QueueAssignments,
    Labels,
    Tags,
    ChannelConfigurations
}

WorkerSelector

public class WorkerSelector
{
    public string Key { get; set; }
    public LabelOperator LabelOperator { get; set; }
    public object Value { get; set; }
    public double? TTLSeconds { get; set; }
    public WorkerSelectorState State { get; set; }
    public DateTimeOffset? ExpireTime { get; set; }
}

public enum WorkerSelectorState
{
    Active = 0,
    Expired = 1
}

public enum LabelOperator
{
    Equal,
    NotEqual,
    LessThan,
    LessThanEqual,
    GreaterThan,
    GreaterThanEqual,
}