Job Router Administration Operations - List Exception Policies
检索现有异常策略。
GET {endpoint}/routing/exceptionPolicies?api-version=2023-11-01
GET {endpoint}/routing/exceptionPolicies?api-version=2023-11-01&maxpagesize={maxpagesize}
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
endpoint
|
path | True |
string |
通信资源的 URI |
|
api-version
|
query | True |
string minLength: 1 |
用于此操作的 API 版本。 |
|
maxpagesize
|
query |
integer (int32) |
每个页面要返回的对象数。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
请求已成功。 |
|
| Other Status Codes |
意外的错误响应。 标头 x-ms-error-code: string |
安全性
AadOauth2Auth
Azure Active Directory OAuth2 流
类型:
oauth2
流向:
accessCode
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
令牌 URL:
https://login.microsoftonline.com/common/oauth2/token
作用域
| 名称 | 说明 |
|---|---|
| https://communication.azure.com/.default |
示例
Retrieves existing exception policies
示例请求
GET https://contoso.westus.communications.azure.com/routing/exceptionPolicies?api-version=2023-11-01&maxpagesize=2
示例响应
{
"value": [
{
"id": "MainExceptionPolicy",
"name": "Main",
"exceptionRules": [
{
"id": "MaxWaitTimeExceeded",
"trigger": {
"kind": "waitTime",
"thresholdSeconds": 20
},
"actions": [
{
"id": "MoveJobToEscalatedQueue",
"kind": "reclassify",
"classificationPolicyId": "Main",
"labelsToUpsert": {
"escalated": true
}
}
]
}
],
"etag": "etag"
},
{
"id": "SecondaryExceptionPolicy",
"name": "Secondary",
"exceptionRules": [
{
"id": "MaxWaitTimeExceeded",
"trigger": {
"kind": "waitTime",
"thresholdSeconds": 50
},
"actions": [
{
"id": "MoveJobToVIPQueue",
"kind": "reclassify",
"classificationPolicyId": "Main",
"labelsToUpsert": {
"VIP": true
}
}
]
}
],
"etag": "etag"
}
],
"nextLink": null
}
定义
| 名称 | 说明 |
|---|---|
|
Azure. |
错误对象。 |
|
Azure. |
包含错误详细信息的响应。 |
|
Azure. |
包含有关错误的更具体信息的对象。 根据 Azure REST API 准则 - https://aka.ms/AzureRestApiGuidelines#handling-errors。 |
|
Cancel |
将作业标记为已取消的操作。 |
|
Exception |
支持的异常操作类型的鉴别器。 |
|
Exception |
定义在触发异常时要执行的操作的策略。 |
|
Exception |
定义在特定触发器上执行的操作的规则。 |
|
Exception |
支持的异常触发器类型的鉴别器。 |
|
Label |
介绍标签值上支持的操作。 |
|
Manual |
通过提供队列、优先级和辅助角色选择器来手动重新分类作业的操作。 |
|
Paged |
ExceptionPolicy 项的分页集合 |
|
Queue |
超出队列长度的异常操作的触发器。 |
|
Reclassify |
修改作业上的标签并重新分类的操作。 |
|
Router |
描述一个条件,该条件必须针对一组标签进行辅助角色选择。 |
|
Router |
描述辅助角色选择器的状态。 |
|
Wait |
触发超出等待时间的异常操作。 |
Azure.Core.Foundations.Error
错误对象。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
服务器定义的错误代码集之一。 |
| details |
导致此报告错误的特定错误的详细信息数组。 |
|
| innererror |
包含与当前对象有关错误的更具体信息的对象。 |
|
| message |
string |
错误的人工可读表示形式。 |
| target |
string |
错误的目标。 |
Azure.Core.Foundations.ErrorResponse
包含错误详细信息的响应。
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误对象。 |
Azure.Core.Foundations.InnerError
包含有关错误的更具体信息的对象。 根据 Azure REST API 准则 - https://aka.ms/AzureRestApiGuidelines#handling-errors。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
服务器定义的错误代码集之一。 |
| innererror |
内部错误。 |
CancelExceptionAction
将作业标记为已取消的操作。
| 名称 | 类型 | 说明 |
|---|---|---|
| dispositionCode |
string |
指示作业的结果,用自己的自定义值填充此字段。 |
| id |
string |
异常操作的唯一 ID。 |
| kind |
string:
cancel |
描述 ExceptionAction 子类型的类型鉴别器。 |
| note |
string |
将追加到具有当前时间戳的作业笔记集合中的注释。 |
ExceptionActionKind
支持的异常操作类型的鉴别器。
| 值 | 说明 |
|---|---|
| cancel |
CancelExceptionAction 的鉴别器值。 |
| manualReclassify |
ManualReclassifyExceptionAction 的鉴别器值。 |
| reclassify |
ReclassifyExceptionAction 的鉴别器值。 |
ExceptionPolicy
定义在触发异常时要执行的操作的策略。
| 名称 | 类型 | 说明 |
|---|---|---|
| etag |
string |
此资源的实体标记。 |
| exceptionRules |
异常策略上的异常规则集合。 |
|
| id |
string |
异常策略的 ID。 |
| name |
string |
此策略的友好名称。 |
ExceptionRule
定义在特定触发器上执行的操作的规则。
| 名称 | 类型 | 说明 |
|---|---|---|
| actions | ExceptionAction[]: |
触发异常后要执行的操作集合。 |
| id |
string |
异常规则的 ID。 |
| trigger | ExceptionTrigger: |
此异常规则的触发器。 |
ExceptionTriggerKind
支持的异常触发器类型的鉴别器。
| 值 | 说明 |
|---|---|
| queueLength |
QueueLengthExceptionTrigger 的鉴别器值。 |
| waitTime |
WaitTimeExceptionTrigger 的鉴别器值。 |
LabelOperator
介绍标签值上支持的操作。
| 值 | 说明 |
|---|---|
| equal |
平等。 |
| notEqual |
不等于。 |
| lessThan |
小于。 |
| lessThanOrEqual |
小于或等于。 |
| greaterThan |
大于。 |
| greaterThanOrEqual |
大于或等于。 |
ManualReclassifyExceptionAction
通过提供队列、优先级和辅助角色选择器来手动重新分类作业的操作。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
异常操作的唯一 ID。 |
| kind |
string:
manual |
描述 ExceptionAction 子类型的类型鉴别器。 |
| priority |
integer (int32) |
更新了优先级。 |
| queueId |
string |
更新了 QueueId。 |
| workerSelectors |
更新了 WorkerSelectors。 |
PagedExceptionPolicy
ExceptionPolicy 项的分页集合
| 名称 | 类型 | 说明 |
|---|---|---|
| nextLink |
string (uri) |
指向下一页项的链接 |
| value |
此页上的 ExceptionPolicy 项 |
QueueLengthExceptionTrigger
超出队列长度的异常操作的触发器。
| 名称 | 类型 | 说明 |
|---|---|---|
| kind |
string:
queue |
描述 ExceptionTrigger 子类型的类型鉴别器。 |
| threshold |
integer (int32) |
队列中提前启动的作业数阈值,以便触发此触发器。 |
ReclassifyExceptionAction
修改作业上的标签并重新分类的操作。
| 名称 | 类型 | 说明 |
|---|---|---|
| classificationPolicyId |
string |
用于确定队列、优先级和辅助角色选择器的新分类策略。 |
| id |
string |
异常操作的唯一 ID。 |
| kind |
string:
reclassify |
描述 ExceptionAction 子类型的类型鉴别器。 |
| labelsToUpsert |
包含要在键值对中更新(或添加(如果不存在)的标签的字典。 值必须是基元值 - number、string、boolean 类型的值。 |
RouterWorkerSelector
描述一个条件,该条件必须针对一组标签进行辅助角色选择。
| 名称 | 类型 | 说明 |
|---|---|---|
| expedite |
boolean |
只要此选择器处于活动状态,就将作业推送到队列的前面。 |
| expiresAfterSeconds |
number (double) |
描述此标签选择器的有效时间(以秒为单位)。 |
| expiresAt |
string (date-time) |
此工作器选择器过期的时间(UTC)。 |
| key |
string |
要查询的标签键。 |
| labelOperator |
描述标签的值与工作器选择器上定义的值进行比较的方式。 |
|
| status |
辅助角色选择器的状态。 |
|
| value |
要与给定运算符的实际标签值进行比较的值。 值必须是基元值 - number、string、boolean 类型的值。 |
RouterWorkerSelectorStatus
描述辅助角色选择器的状态。
| 值 | 说明 |
|---|---|
| active |
辅助角色选择器有效。 |
| expired |
辅助角色选择器无效。 |
WaitTimeExceptionTrigger
触发超出等待时间的异常操作。
| 名称 | 类型 | 说明 |
|---|---|---|
| kind |
string:
wait |
描述 ExceptionTrigger 子类型的类型鉴别器。 |
| thresholdSeconds |
number (double) |
此触发器的等待时间阈值。 |