你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Job Router Administration Operations - Upsert Exception Policy
创建或更新异常策略。
PATCH {endpoint}/routing/exceptionPolicies/{exceptionPolicyId}?api-version=2023-11-01
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
endpoint
|
path | True |
string |
通信资源的 URI |
exception
|
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"
名称 | 类型 | 说明 |
---|---|---|
exceptionRules |
异常策略上的异常规则集合。 |
|
name |
string |
此策略的友好名称。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
请求已成功。 标头
|
|
201 Created |
请求已成功,因此创建了一个新资源。 标头
|
|
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 |
示例
Creates an exception policy |
Updates an exception policy |
Creates an exception policy
示例请求
PATCH https://contoso.westus.communications.azure.com/routing/exceptionPolicies/cf1cda69-6f41-45ac-b252-213293f1b1cb?api-version=2023-11-01
{
"name": "Main",
"exceptionRules": [
{
"id": "MaxWaitTimeExceeded",
"actions": [
{
"kind": "reclassify",
"classificationPolicyId": "Main",
"labelsToUpsert": {
"escalated": true
}
}
],
"trigger": {
"kind": "waitTime",
"thresholdSeconds": 20
}
}
]
}
示例响应
{
"id": "cf1cda69-6f41-45ac-b252-213293f1b1cb",
"name": "Main",
"exceptionRules": [
{
"id": "MaxWaitTimeExceeded",
"trigger": {
"kind": "waitTime",
"thresholdSeconds": 20
},
"actions": [
{
"id": "babd4f6f-916e-4e91-9c89-e0bb05a2c425",
"kind": "reclassify",
"classificationPolicyId": "Main",
"labelsToUpsert": {
"escalated": true
}
}
]
}
],
"etag": "etag"
}
{
"id": "cf1cda69-6f41-45ac-b252-213293f1b1cb",
"name": "Main",
"exceptionRules": [
{
"id": "MaxWaitTimeExceeded",
"trigger": {
"kind": "waitTime",
"thresholdSeconds": 20
},
"actions": [
{
"id": "babd4f6f-916e-4e91-9c89-e0bb05a2c425",
"kind": "reclassify",
"classificationPolicyId": "Main",
"labelsToUpsert": {
"escalated": true
}
}
]
}
],
"etag": "etag"
}
Updates an exception policy
示例请求
PATCH https://contoso.westus.communications.azure.com/routing/exceptionPolicies/cf1cda69-6f41-45ac-b252-213293f1b1cb?api-version=2023-11-01
{
"name": "Main test",
"exceptionRules": [
{
"id": "MaxWaitTimeExceeded",
"actions": [
{
"kind": "reclassify",
"classificationPolicyId": "Main",
"labelsToUpsert": {
"escalated": true
}
}
],
"trigger": {
"kind": "waitTime",
"thresholdSeconds": 20
}
}
]
}
示例响应
{
"id": "cf1cda69-6f41-45ac-b252-213293f1b1cb",
"name": "Main test",
"exceptionRules": [
{
"id": "MaxWaitTimeExceeded",
"trigger": {
"kind": "waitTime",
"thresholdSeconds": 20
},
"actions": [
{
"id": "babd4f6f-916e-4e91-9c89-e0bb05a2c425",
"kind": "reclassify",
"classificationPolicyId": "Main",
"labelsToUpsert": {
"escalated": true
}
}
]
}
],
"etag": "etag"
}
{
"id": "cf1cda69-6f41-45ac-b252-213293f1b1cb",
"name": "Main test",
"exceptionRules": [
{
"id": "MaxWaitTimeExceeded",
"trigger": {
"kind": "waitTime",
"thresholdSeconds": 20
},
"actions": [
{
"id": "babd4f6f-916e-4e91-9c89-e0bb05a2c425",
"kind": "reclassify",
"classificationPolicyId": "Main",
"labelsToUpsert": {
"escalated": true
}
}
]
}
],
"etag": "etag"
}
定义
名称 | 说明 |
---|---|
Azure. |
错误对象。 |
Azure. |
包含错误详细信息的响应。 |
Azure. |
包含有关错误的更具体信息的对象。 根据Microsoft一个 API 指南 - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses。 |
Cancel |
将作业标记为已取消的操作。 |
Exception |
支持的异常操作类型的鉴别器。 |
Exception |
定义在触发异常时要执行的操作的策略。 |
Exception |
定义在触发异常时要执行的操作的策略。 |
Exception |
定义在特定触发器上执行的操作的规则。 |
Exception |
支持的异常触发器类型的鉴别器。 |
Label |
介绍标签值上支持的操作。 |
Manual |
通过提供队列、优先级和辅助角色选择器来手动重新分类作业的操作。 |
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
包含有关错误的更具体信息的对象。 根据Microsoft一个 API 指南 - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
服务器定义的错误代码集之一。 |
innererror |
内部错误。 |
CancelExceptionAction
将作业标记为已取消的操作。
名称 | 类型 | 说明 |
---|---|---|
dispositionCode |
string |
指示作业的结果,用自己的自定义值填充此字段。 |
id |
string |
异常操作的唯一 ID。 |
kind |
string:
cancel |
描述 ExceptionAction 子类型的类型鉴别器。 |
note |
string |
将追加到具有当前时间戳的作业笔记集合中的注释。 |
ExceptionActionKind
支持的异常操作类型的鉴别器。
名称 | 类型 | 说明 |
---|---|---|
cancel |
string |
CancelExceptionAction 的鉴别器值。 |
manualReclassify |
string |
ManualReclassifyExceptionAction 的鉴别器值。 |
reclassify |
string |
ReclassifyExceptionAction 的鉴别器值。 |
ExceptionPolicy
定义在触发异常时要执行的操作的策略。
名称 | 类型 | 说明 |
---|---|---|
etag |
string |
此资源的实体标记。 |
exceptionRules |
异常策略上的异常规则集合。 |
|
id |
string |
异常策略的 ID。 |
name |
string |
此策略的友好名称。 |
ExceptionPolicyCreateOrUpdate
定义在触发异常时要执行的操作的策略。
名称 | 类型 | 说明 |
---|---|---|
exceptionRules |
异常策略上的异常规则集合。 |
|
name |
string |
此策略的友好名称。 |
ExceptionRule
定义在特定触发器上执行的操作的规则。
名称 | 类型 | 说明 |
---|---|---|
actions | ExceptionAction[]: |
触发异常后要执行的操作集合。 |
id |
string |
异常规则的 ID。 |
trigger | ExceptionTrigger: |
此异常规则的触发器。 |
ExceptionTriggerKind
支持的异常触发器类型的鉴别器。
名称 | 类型 | 说明 |
---|---|---|
queueLength |
string |
QueueLengthExceptionTrigger 的鉴别器值。 |
waitTime |
string |
WaitTimeExceptionTrigger 的鉴别器值。 |
LabelOperator
介绍标签值上支持的操作。
名称 | 类型 | 说明 |
---|---|---|
equal |
string |
平等。 |
greaterThan |
string |
大于。 |
greaterThanOrEqual |
string |
大于或等于。 |
lessThan |
string |
小于。 |
lessThanOrEqual |
string |
小于或等于。 |
notEqual |
string |
不等于。 |
ManualReclassifyExceptionAction
通过提供队列、优先级和辅助角色选择器来手动重新分类作业的操作。
名称 | 类型 | 说明 |
---|---|---|
id |
string |
异常操作的唯一 ID。 |
kind |
string:
manual |
描述 ExceptionAction 子类型的类型鉴别器。 |
priority |
integer |
更新了优先级。 |
queueId |
string |
更新了 QueueId。 |
workerSelectors |
更新了 WorkerSelectors。 |
QueueLengthExceptionTrigger
超出队列长度的异常操作的触发器。
名称 | 类型 | 说明 |
---|---|---|
kind |
string:
queue |
描述 ExceptionTrigger 子类型的类型鉴别器。 |
threshold |
integer |
队列中提前启动的作业数阈值,以便触发此触发器。 |
ReclassifyExceptionAction
修改作业上的标签并重新分类的操作。
名称 | 类型 | 说明 |
---|---|---|
classificationPolicyId |
string |
用于确定队列、优先级和辅助角色选择器的新分类策略。 |
id |
string |
异常操作的唯一 ID。 |
kind |
string:
reclassify |
描述 ExceptionAction 子类型的类型鉴别器。 |
labelsToUpsert |
包含要在键值对中更新(或添加(如果不存在)的标签的字典。 值必须是基元值 - number、string、boolean 类型的值。 |
RouterWorkerSelector
描述一个条件,该条件必须针对一组标签进行辅助角色选择。
名称 | 类型 | 说明 |
---|---|---|
expedite |
boolean |
只要此选择器处于活动状态,就将作业推送到队列的前面。 |
expiresAfterSeconds |
number |
描述此标签选择器的有效时间(以秒为单位)。 |
expiresAt |
string |
此工作器选择器过期的时间(UTC)。 |
key |
string |
要查询的标签键。 |
labelOperator |
描述标签的值与工作器选择器上定义的值进行比较的方式。 |
|
status |
辅助角色选择器的状态。 |
|
value |
要与给定运算符的实际标签值进行比较的值。 值必须是基元值 - number、string、boolean 类型的值。 |
RouterWorkerSelectorStatus
描述辅助角色选择器的状态。
名称 | 类型 | 说明 |
---|---|---|
active |
string |
辅助角色选择器有效。 |
expired |
string |
辅助角色选择器无效。 |
WaitTimeExceptionTrigger
触发超出等待时间的异常操作。
名称 | 类型 | 说明 |
---|---|---|
kind |
string:
wait |
描述 ExceptionTrigger 子类型的类型鉴别器。 |
thresholdSeconds |
number |
此触发器的等待时间阈值。 |