Share via


Job Router Operations - Upsert Job

ルーター ジョブを作成または更新します。

PATCH {endpoint}/routing/jobs/{jobId}?api-version=2023-11-01

URI パラメーター

名前 / 必須 説明
endpoint
path True

string

Communication リソースの URI

jobId
path True

string

ジョブの ID。

api-version
query True

string

この操作に使用する API バージョン。

要求ヘッダー

Media Types: "application/merge-patch+json"

名前 必須 説明
If-Match

string

要求は、エンティティがこの文字列と一致する場合にのみ続行する必要があります。

If-Unmodified-Since

string

date-time-rfc7231

要求は、この時点以降にエンティティが変更されなかった場合にのみ続行する必要があります。

要求本文

Media Types: "application/merge-patch+json"

名前 説明
channelId

string

チャネル識別子。例えば。音声、チャットなど

channelReference

string

たとえば、外部の親コンテキストへの参照。呼び出し ID。

classificationPolicyId

string

このジョブの分類に使用される分類ポリシーの ID。

dispositionCode

string

取り消されたジョブまたは終了したジョブの理由コード。

labels

ルール エンジンが決定を下すために使用する属性を識別するキーと値のペアのセット。 値はプリミティブ値 (数値、文字列、ブール値) である必要があります。

matchingMode JobMatchingModeCreateOrUpdate:

指定した場合、ジョブマッチングの実行方法が決定されます。既定のモード: QueueAndMatchMode。

notes

RouterJobNote[]

ジョブに添付され、タイムスタンプで並べ替えられたメモ。

priority

integer

このジョブの優先度。 値は -100 から 100 の間である必要があります。

queueId

string

このジョブがキューに入っているキューの ID。

requestedWorkerSelectors

RouterWorkerSelector[]

このジョブを処理するためにワーカーが満たす必要がある、手動で指定されたワーカー セレクターのコレクション。

tags

このジョブにアタッチされている非識別属性のセット。 値はプリミティブ値 (数値、文字列、ブール値) である必要があります。

応答

名前 説明
200 OK

RouterJob

要求は成功しました。

Headers

  • ETag: string
  • Last-Modified: string
201 Created

RouterJob

要求が成功し、結果として新しいリソースが作成されました。

Headers

  • ETag: string
  • Last-Modified: string
Other Status Codes

Azure.Core.Foundations.ErrorResponse

予期しないエラー応答。

Headers

x-ms-error-code: string

Creates a new job
Creates a new scheduled router job
Updates a router job

Creates a new job

Sample Request

PATCH https://contoso.westus.communications.azure.com/routing/jobs/JobId?api-version=2023-11-01

{
  "channelId": "CustomChatChannel",
  "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af",
  "queueId": "MainQueue",
  "priority": 5,
  "requestedWorkerSelectors": [
    {
      "key": "Sales",
      "labelOperator": "equal",
      "value": true
    }
  ],
  "labels": {},
  "matchingMode": {
    "kind": "queueAndMatch"
  }
}

Sample Response

{
  "id": "JobId",
  "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af",
  "status": "queued",
  "enqueuedAt": "2021-09-30T23:59:04.5311999+00:00",
  "channelId": "CustomChatChannel",
  "classificationPolicyId": null,
  "queueId": "MainQueue",
  "priority": 5,
  "dispositionCode": null,
  "requestedWorkerSelectors": [
    {
      "key": "Sales",
      "labelOperator": "equal",
      "value": true,
      "expiresAfterSeconds": null
    }
  ],
  "attachedWorkerSelectors": [],
  "labels": {},
  "assignments": {},
  "notes": [],
  "matchingMode": {
    "kind": "queueAndMatch"
  },
  "etag": "etag"
}
{
  "id": "JobId",
  "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af",
  "status": "queued",
  "enqueuedAt": "2021-09-30T23:59:04.5311999+00:00",
  "channelId": "CustomChatChannel",
  "classificationPolicyId": null,
  "queueId": "MainQueue",
  "priority": 5,
  "dispositionCode": null,
  "requestedWorkerSelectors": [
    {
      "key": "Sales",
      "labelOperator": "equal",
      "value": true,
      "expiresAfterSeconds": null
    }
  ],
  "attachedWorkerSelectors": [],
  "labels": {},
  "assignments": {},
  "notes": [],
  "matchingMode": {
    "kind": "queueAndMatch"
  },
  "etag": "etag"
}

Creates a new scheduled router job

Sample Request

PATCH https://contoso.westus.communications.azure.com/routing/jobs/JobId?api-version=2023-11-01

{
  "channelId": "CustomChatChannel",
  "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af",
  "queueId": "MainQueue",
  "priority": 5,
  "requestedWorkerSelectors": [
    {
      "key": "Sales",
      "labelOperator": "equal",
      "value": true
    }
  ],
  "labels": {},
  "matchingMode": {
    "kind": "scheduleAndSuspend",
    "scheduleAt": "2023-05-26T23:22:12.0774222+00:00"
  }
}

Sample Response

{
  "id": "JobId",
  "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af",
  "status": "queued",
  "enqueuedAt": "2021-09-30T23:59:04.5311999+00:00",
  "channelId": "CustomChatChannel",
  "classificationPolicyId": null,
  "queueId": "MainQueue",
  "priority": 5,
  "dispositionCode": null,
  "requestedWorkerSelectors": [
    {
      "key": "Sales",
      "labelOperator": "equal",
      "value": true,
      "expiresAfterSeconds": null
    }
  ],
  "attachedWorkerSelectors": [],
  "labels": {},
  "assignments": {},
  "notes": [],
  "matchingMode": {
    "kind": "scheduleAndSuspend",
    "scheduleAt": "2023-05-26T23:22:12.0774222+00:00"
  },
  "scheduledAt": null,
  "etag": "etag"
}
{
  "id": "JobId",
  "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af",
  "status": "queued",
  "enqueuedAt": "2021-09-30T23:59:04.5311999+00:00",
  "channelId": "CustomChatChannel",
  "classificationPolicyId": null,
  "queueId": "MainQueue",
  "priority": 5,
  "dispositionCode": null,
  "requestedWorkerSelectors": [
    {
      "key": "Sales",
      "labelOperator": "equal",
      "value": true,
      "expiresAfterSeconds": null
    }
  ],
  "attachedWorkerSelectors": [],
  "labels": {},
  "assignments": {},
  "notes": [],
  "matchingMode": {
    "kind": "scheduleAndSuspend",
    "scheduleAt": "2023-05-26T23:22:12.0774222+00:00"
  },
  "scheduledAt": null,
  "etag": "etag"
}

Updates a router job

Sample Request

PATCH https://contoso.westus.communications.azure.com/routing/jobs/8780b28c-7079-4de1-9143-4d369289e958?api-version=2023-11-01

{
  "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af"
}

Sample Response

{
  "id": "383541b3-5637-4af6-8aac-3391da8a578a",
  "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af",
  "status": "queued",
  "enqueuedAt": "2021-09-30T23:59:04.5311999+00:00",
  "channelId": "CustomVoiceChannel",
  "classificationPolicyId": null,
  "queueId": "MainQueue",
  "priority": 5,
  "dispositionCode": null,
  "requestedWorkerSelectors": [
    {
      "key": "Sales",
      "labelOperator": "equal",
      "value": true,
      "expiresAfterSeconds": null
    }
  ],
  "attachedWorkerSelectors": [],
  "labels": {},
  "assignments": {},
  "notes": [],
  "matchingMode": {
    "kind": "queueAndMatch"
  },
  "etag": "etag"
}
{
  "id": "383541b3-5637-4af6-8aac-3391da8a578a",
  "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af",
  "status": "queued",
  "enqueuedAt": "2021-09-30T23:59:04.5311999+00:00",
  "channelId": "CustomVoiceChannel",
  "classificationPolicyId": null,
  "queueId": "MainQueue",
  "priority": 5,
  "dispositionCode": null,
  "requestedWorkerSelectors": [
    {
      "key": "Sales",
      "labelOperator": "equal",
      "value": true,
      "expiresAfterSeconds": null
    }
  ],
  "attachedWorkerSelectors": [],
  "labels": {},
  "assignments": {},
  "notes": [],
  "matchingMode": {
    "kind": "queueAndMatch"
  },
  "etag": "etag"
}

定義

名前 説明
Azure.Core.Foundations.Error

error オブジェクト。

Azure.Core.Foundations.ErrorResponse

エラーの詳細を含む応答。

Azure.Core.Foundations.InnerError

エラーに関するより具体的な情報を含むオブジェクト。 Microsoft One API のガイドラインに従って - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses

JobMatchingModeKind

サポートされている一致モードの種類の識別子。

LabelOperator

ラベル値に対してサポートされている操作について説明します。

QueueAndMatchMode

ジョブが正常にキューに入った後に、ジョブへの一致ワーカーが自動的に開始される一致モードについて説明します。

QueueAndMatchModeCreateOrUpdate

ジョブが正常にキューに登録された後に、ジョブに一致するワーカーが自動的に開始される一致モードについて説明します。

RouterJob

ルーティングする作業単位

RouterJobAssignment

ワーカーへのジョブの割り当ての詳細。

RouterJobCreateOrUpdate

ルーティングする作業単位

RouterJobNote

ジョブにアタッチされたメモ。

RouterJobStatus

ジョブのさまざまな状態について説明します。

RouterWorkerSelector

ワーカー選択の一連のラベルに対して満たす必要がある条件について説明します。

RouterWorkerSelectorStatus

ワーカー セレクターの状態について説明します。

ScheduleAndSuspendMode

将来キューに入るジョブをスケジュールするために使用される一致モードについて説明します。 指定した時刻に、ワーカーとジョブの照合は自動的に開始されません。

ScheduleAndSuspendModeCreateOrUpdate

将来キューに登録されるジョブをスケジュールするために使用される一致モードについて説明します。 指定した時刻に、ジョブに一致するワーカーは自動的に開始されません。

SuspendMode

ジョブへのワーカーの一致が中断される一致モードについて説明します。

SuspendModeCreateOrUpdate

ジョブへのワーカーの照合が中断される一致モードについて説明します。

Azure.Core.Foundations.Error

error オブジェクト。

名前 説明
code

string

サーバー定義のエラー コードのセットの 1 つ。

details

Azure.Core.Foundations.Error[]

この報告されたエラーの原因となった特定のエラーに関する詳細の配列。

innererror

Azure.Core.Foundations.InnerError

エラーに関する現在のオブジェクトよりも具体的な情報を含む オブジェクト。

message

string

エラーの人間が判読できる表現。

target

string

エラーのターゲット。

Azure.Core.Foundations.ErrorResponse

エラーの詳細を含む応答。

名前 説明
error

Azure.Core.Foundations.Error

error オブジェクト。

Azure.Core.Foundations.InnerError

エラーに関するより具体的な情報を含むオブジェクト。 Microsoft One API のガイドラインに従って - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses

名前 説明
code

string

サーバー定義のエラー コードのセットの 1 つ。

innererror

Azure.Core.Foundations.InnerError

内部エラー。

JobMatchingModeKind

サポートされている一致モードの種類の識別子。

名前 説明
queueAndMatch

string

QueueAndMatchMode の識別子の値。

scheduleAndSuspend

string

ScheduleAndSuspendMode の識別子の値。

suspend

string

SuspendMode の識別子の値。

LabelOperator

ラベル値に対してサポートされている操作について説明します。

名前 説明
equal

string

等しい。

greaterThan

string

より大きい。

greaterThanOrEqual

string

以上。

lessThan

string

より小さい。

lessThanOrEqual

string

以下。

notEqual

string

等しくない。

QueueAndMatchMode

ジョブが正常にキューに入った後に、ジョブへの一致ワーカーが自動的に開始される一致モードについて説明します。

名前 説明
kind string:

queueAndMatch

JobMatchingMode のサブタイプを記述する型判別子。

QueueAndMatchModeCreateOrUpdate

ジョブが正常にキューに登録された後に、ジョブに一致するワーカーが自動的に開始される一致モードについて説明します。

名前 説明
kind string:

queueAndMatch

JobMatchingMode のサブタイプを記述する型識別子。

RouterJob

ルーティングする作業単位

名前 説明
assignments

<string,  RouterJobAssignment>

ジョブの割り当てのコレクション。 キーは AssignmentId です。

attachedWorkerSelectors

RouterWorkerSelector[]

分類ポリシーによってアタッチされたワーカー セレクターのコレクション。このジョブを処理するには、ワーカーが満たす必要があります。

channelId

string

チャネル識別子。例えば。音声、チャットなど

channelReference

string

外部親コンテキストへの参照 (例: )呼び出し ID。

classificationPolicyId

string

このジョブの分類に使用される分類ポリシーの ID。

dispositionCode

string

取り消されたジョブまたは終了したジョブの理由コード。

enqueuedAt

string

ジョブが UTC でキューに登録されたタイムスタンプ。

etag

string

このリソースのエンティティ タグ。

id

string

ジョブの ID。

labels

ルール エンジンによって決定を行うために使用される属性を識別するキーと値のペアのセット。 値はプリミティブ値 (数値、文字列、ブール値) である必要があります。

matchingMode JobMatchingMode:

指定した場合、ジョブマッチングの実行方法が決まります。既定のモード: QueueAndMatchMode。

notes

RouterJobNote[]

ジョブにアタッチされたメモ。タイムスタンプで並べ替えられます。

priority

integer

このジョブの優先度。 値は -100 から 100 の間である必要があります。

queueId

string

このジョブがキューに登録されているキューの ID。

requestedWorkerSelectors

RouterWorkerSelector[]

このジョブを処理するためにワーカーが満たす必要がある、手動で指定されたワーカー セレクターのコレクション。

scheduledAt

string

設定されている場合、ジョブは特定の時刻にエンキューされるようにスケジュールされます。

status

RouterJobStatus

ジョブの状態。

tags

このジョブにアタッチされている非識別属性のセット。 値はプリミティブ値 (数値、文字列、ブール値) である必要があります。

RouterJobAssignment

ワーカーへのジョブの割り当ての詳細。

名前 説明
assignedAt

string

ジョブが UTC でワーカーに割り当てられたタイムスタンプ。

assignmentId

string

ジョブ割り当ての ID。

closedAt

string

ジョブが UTC で完了した後に閉じられたとマークされたときのタイムスタンプ。

completedAt

string

ジョブが UTC で割り当てられた後に完了としてマークされたときのタイムスタンプ。

workerId

string

ジョブに割り当てられた Worker の ID。

RouterJobCreateOrUpdate

ルーティングする作業単位

名前 説明
channelId

string

チャネル識別子。例えば。音声、チャットなど

channelReference

string

外部親コンテキストへの参照 (例: )呼び出し ID。

classificationPolicyId

string

このジョブの分類に使用される分類ポリシーの ID。

dispositionCode

string

取り消されたジョブまたは終了したジョブの理由コード。

labels

ルール エンジンによって決定を行うために使用される属性を識別するキーと値のペアのセット。 値はプリミティブ値 (数値、文字列、ブール値) である必要があります。

matchingMode JobMatchingModeCreateOrUpdate:

指定した場合、ジョブマッチングの実行方法が決まります。既定のモード: QueueAndMatchMode。

notes

RouterJobNote[]

ジョブにアタッチされたメモ。タイムスタンプで並べ替えられます。

priority

integer

このジョブの優先度。 値は -100 から 100 の間である必要があります。

queueId

string

このジョブがキューに登録されているキューの ID。

requestedWorkerSelectors

RouterWorkerSelector[]

このジョブを処理するためにワーカーが満たす必要がある、手動で指定されたワーカー セレクターのコレクション。

tags

このジョブにアタッチされている非識別属性のセット。 値はプリミティブ値 (数値、文字列、ブール値) である必要があります。

RouterJobNote

ジョブにアタッチされたメモ。

名前 説明
addedAt

string

ノートが UTC で追加された時刻。 指定しない場合、 は既定で現在の時刻になります。

message

string

メモに含まれるメッセージ。

RouterJobStatus

ジョブのさまざまな状態について説明します。

名前 説明
assigned

string

ジョブがワーカーに割り当てられている。

cancelled

string

ジョブが取り消されました。

classificationFailed

string

ジョブの分類プロセスが失敗しました。

closed

string

ジョブがワーカーによって閉じられました。

completed

string

ジョブはワーカーによって完了しました。

created

string

ジョブが作成されました。

pendingClassification

string

ジョブが分類されるのを待っています。

pendingSchedule

string

ジョブは作成されましたが、まだスケジュールされていません。

queued

string

ジョブがキューに登録されました。

scheduleFailed

string

ジョブのスケジュール設定に失敗しました。

scheduled

string

ジョブが正常にスケジュールされました。

waitingForActivation

string

ジョブが中断状態で、更新を待機しています。

RouterWorkerSelector

ワーカー選択の一連のラベルに対して満たす必要がある条件について説明します。

名前 説明
expedite

boolean

このセレクターがアクティブである限り、キューの先頭にジョブをプッシュします。

expiresAfterSeconds

number

このラベル セレクターが有効な時間 (秒単位) について説明します。

expiresAt

string

このワーカー セレクターが UTC で期限切れになる時刻。

key

string

クエリの対象となるラベル キー。

labelOperator

LabelOperator

ラベルの値をワーカー セレクターで定義された値と比較する方法について説明します。

status

RouterWorkerSelectorStatus

ワーカー セレクターの状態。

value

指定された演算子と実際のラベル値と比較する値。 値はプリミティブ値 (数値、文字列、ブール値) である必要があります。

RouterWorkerSelectorStatus

ワーカー セレクターの状態について説明します。

名前 説明
active

string

ワーカー セレクターは有効です。

expired

string

ワーカー セレクターが無効です。

ScheduleAndSuspendMode

将来キューに入るジョブをスケジュールするために使用される一致モードについて説明します。 指定した時刻に、ワーカーとジョブの照合は自動的に開始されません。

名前 説明
kind string:

scheduleAndSuspend

JobMatchingMode のサブタイプを記述する型判別子。

scheduleAt

string

要求されたスケジュール時刻。

ScheduleAndSuspendModeCreateOrUpdate

将来キューに登録されるジョブをスケジュールするために使用される一致モードについて説明します。 指定した時刻に、ジョブに一致するワーカーは自動的に開始されません。

名前 説明
kind string:

scheduleAndSuspend

JobMatchingMode のサブタイプを記述する型識別子。

scheduleAt

string

要求されたスケジュール時刻。

SuspendMode

ジョブへのワーカーの一致が中断される一致モードについて説明します。

名前 説明
kind string:

suspend

JobMatchingMode のサブタイプを記述する型判別子。

SuspendModeCreateOrUpdate

ジョブへのワーカーの照合が中断される一致モードについて説明します。

名前 説明
kind string:

suspend

JobMatchingMode のサブタイプを記述する型識別子。