你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Job Router Administration Operations - Get Classification Policy
按 ID 检索现有分类策略。
GET {endpoint}/routing/classificationPolicies/{classificationPolicyId}?api-version=2023-11-01
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
classification
|
path | True |
string |
分类策略的 ID。 |
endpoint
|
path | True |
string |
通信资源的 URI |
api-version
|
query | True |
string |
用于此操作的 API 版本。 |
响应
名称 | 类型 | 说明 |
---|---|---|
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 an existing classification policy by Id
示例请求
GET https://contoso.westus.communications.azure.com/routing/classificationPolicies/MainClassificationPolicy?api-version=2023-11-01
示例响应
{
"id": "MainClassificationPolicy",
"name": "Main",
"fallbackQueueId": "MainQueue",
"queueSelectorAttachments": [
{
"kind": "conditional",
"condition": {
"kind": "expression",
"language": "powerFx",
"expression": "1 = 1"
},
"queueSelectors": [
{
"key": "foo",
"labelOperator": "equal",
"value": "bar"
}
]
}
],
"prioritizationRule": {
"kind": "static",
"value": "2"
},
"workerSelectorAttachments": [
{
"kind": "passThrough",
"key": "language",
"labelOperator": "equal"
}
],
"etag": "etag"
}
定义
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 |
内部错误。 |
ClassificationPolicy
用于控制作业分类方式的规则的容器。
名称 | 类型 | 说明 |
---|---|---|
etag |
string |
此资源的实体标记。 |
fallbackQueueId |
string |
用于选择队列选择器附件是否找不到匹配项的回退队列的 ID。 |
id |
string |
分类策略的 ID。 |
name |
string |
此策略的友好名称。 |
prioritizationRule | RouterRule: |
用于确定作业的优先级分数的规则。 |
queueSelectorAttachments | QueueSelectorAttachment[]: |
用于解析作业队列的队列选择器附件。 |
workerSelectorAttachments | WorkerSelectorAttachment[]: |
用于将辅助角色选择器附加到作业的工作器选择器附件。 |
ConditionalQueueSelectorAttachment
描述一组队列选择器,如果给定条件解析为 true,则会附加这些选择器。
名称 | 类型 | 说明 |
---|---|---|
condition | RouterRule: |
要附加队列选择器必须为 true 的条件。 |
kind |
string:
conditional |
描述 QueueSelectorAttachment 子类型的类型鉴别器。 |
queueSelectors |
要附加的队列选择器。 |
ConditionalWorkerSelectorAttachment
描述一组工作器选择器,如果给定条件解析为 true,则会附加这些选择器。
名称 | 类型 | 说明 |
---|---|---|
condition | RouterRule: |
要附加的工作器选择器必须为 true 的条件。 |
kind |
string:
conditional |
描述 WorkerSelectorAttachment 子类型的类型鉴别器。 |
workerSelectors |
要附加的工作器选择器。 |
DirectMapRouterRule
返回与输入标签相同的标签的规则。
名称 | 类型 | 说明 |
---|---|---|
kind |
string:
direct |
描述 RouterRule 子类型的类型鉴别器 |
ExpressionRouterRule
提供内联表达式规则的规则。
名称 | 类型 | 说明 |
---|---|---|
expression |
string |
要计算的表达式。 应包含包含计算值的 return 语句。 |
kind |
string:
expression |
描述 RouterRule 子类型的类型鉴别器 |
language |
要编译到和执行的表达式语言。 |
ExpressionRouterRuleLanguage
可配置的可用表达式语言。
名称 | 类型 | 说明 |
---|---|---|
powerFx |
string |
PowerFx |
FunctionRouterRule
提供对 HTTP 触发的 Azure 函数的绑定的规则。
名称 | 类型 | 说明 |
---|---|---|
credential |
用于访问 Azure 函数规则的凭据。 |
|
functionUri |
string |
Azure 函数的 URL。 |
kind |
string:
function |
描述 RouterRule 子类型的类型鉴别器 |
FunctionRouterRuleCredential
用于访问 Azure 函数规则的凭据。
名称 | 类型 | 说明 |
---|---|---|
appKey |
string |
访问作用域为 Azure 函数应用的密钥。 此密钥授予对应用下的所有函数的访问权限。 |
clientId |
string |
客户端 ID,在 Azure 函数的上下文中提供 AppKey 时,这通常是密钥的名称。 |
functionKey |
string |
访问范围限定为特定函数的密钥。 |
LabelOperator
介绍标签值上支持的操作。
名称 | 类型 | 说明 |
---|---|---|
equal |
string |
平等。 |
greaterThan |
string |
大于。 |
greaterThanOrEqual |
string |
大于或等于。 |
lessThan |
string |
小于。 |
lessThanOrEqual |
string |
小于或等于。 |
notEqual |
string |
不等于。 |
OAuth2WebhookClientCredential
用于 Contoso 授权服务器的 OAuth2.0 凭据。 参考:https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/
名称 | 类型 | 说明 |
---|---|---|
clientId |
string |
Contoso 授权服务器的 ClientId。 |
clientSecret |
string |
Contoso 授权服务器的客户端密码。 |
PassThroughQueueSelectorAttachment
附加队列选择器,其中值从具有相同键的作业标签传递。
名称 | 类型 | 说明 |
---|---|---|
key |
string |
要查询的标签键。 |
kind |
string:
pass |
描述 QueueSelectorAttachment 子类型的类型鉴别器。 |
labelOperator |
描述标签的值与传递的值的比较方式。 |
PassThroughWorkerSelectorAttachment
附加工作器选择器,其中值从具有相同键的作业标签传递。
名称 | 类型 | 说明 |
---|---|---|
expiresAfterSeconds |
number |
描述附加标签选择器的有效时长(以秒为单位)。 |
key |
string |
要查询的标签键。 |
kind |
string:
pass |
描述 WorkerSelectorAttachment 子类型的类型鉴别器。 |
labelOperator |
描述标签的值与传递的值的比较方式。 |
QueueSelectorAttachmentKind
支持的队列选择器附件类型的鉴别器。
名称 | 类型 | 说明 |
---|---|---|
conditional |
string |
ConditionalQueueSelectorAttachment 的鉴别器值。 |
passThrough |
string |
PassThroughQueueSelectorAttachment 的鉴别器值。 |
ruleEngine |
string |
RuleEngineQueueSelectorAttachment 的鉴别器值。 |
static |
string |
StaticQueueSelectorAttachment 的鉴别器值。 |
weightedAllocation |
string |
WeightedAllocationQueueSelectorAttachment 的鉴别器值。 |
QueueWeightedAllocation
包含为加权分布选择时要应用的权重百分比和队列选择器。
名称 | 类型 | 说明 |
---|---|---|
queueSelectors |
如果选中此分配,将应用队列选择器的集合。 |
|
weight |
number |
此权重的百分比,以 1 的分数表示。 |
RouterQueueSelector
描述必须针对队列选择的一组标签满足的条件。
名称 | 类型 | 说明 |
---|---|---|
key |
string |
要查询的标签键。 |
labelOperator |
描述标签的值与标签选择器上定义的值进行比较的方式。 |
|
value |
要与给定运算符的实际标签值进行比较的值。 值必须是基元值 - number、string、boolean 类型的值。 |
RouterRuleKind
支持的路由器规则类型的鉴别器。
名称 | 类型 | 说明 |
---|---|---|
directMap |
string |
DirectMapRouterRule 的鉴别器值。 |
expression |
string |
ExpressionRouterRule 的鉴别器值。 |
function |
string |
FunctionRouterRule 的鉴别器值。 |
static |
string |
StaticRouterRule 的鉴别器值。 |
webhook |
string |
WebhookRouterRule 的鉴别器值。 |
RouterWorkerSelector
描述一个条件,该条件必须针对一组标签进行辅助角色选择。
名称 | 类型 | 说明 |
---|---|---|
expedite |
boolean |
只要此选择器处于活动状态,就将作业推送到队列的前面。 |
expiresAfterSeconds |
number |
描述此标签选择器的有效时间(以秒为单位)。 |
expiresAt |
string |
此工作器选择器过期的时间(UTC)。 |
key |
string |
要查询的标签键。 |
labelOperator |
描述标签的值与工作器选择器上定义的值进行比较的方式。 |
|
status |
辅助角色选择器的状态。 |
|
value |
要与给定运算符的实际标签值进行比较的值。 值必须是基元值 - number、string、boolean 类型的值。 |
RouterWorkerSelectorStatus
描述辅助角色选择器的状态。
名称 | 类型 | 说明 |
---|---|---|
active |
string |
辅助角色选择器有效。 |
expired |
string |
辅助角色选择器无效。 |
RuleEngineQueueSelectorAttachment
解析 RouterRule 时,将队列选择器附加到作业。
名称 | 类型 | 说明 |
---|---|---|
kind |
string:
rule |
描述 QueueSelectorAttachment 子类型的类型鉴别器。 |
rule | RouterRule: |
一个 RouterRule,用于解析要附加的队列选择器集合。 |
RuleEngineWorkerSelectorAttachment
解析 RouterRule 时,将辅助角色选择器附加到作业。
名称 | 类型 | 说明 |
---|---|---|
kind |
string:
rule |
描述 WorkerSelectorAttachment 子类型的类型鉴别器。 |
rule | RouterRule: |
一个 RouterRule,用于解析要附加的工作器选择器的集合。 |
StaticQueueSelectorAttachment
描述将附加到作业的队列选择器。
名称 | 类型 | 说明 |
---|---|---|
kind |
string:
static |
描述 QueueSelectorAttachment 子类型的类型鉴别器。 |
queueSelector |
要附加的队列选择器。 |
StaticRouterRule
提供始终返回相同结果的静态规则的规则,而不考虑输入。
名称 | 类型 | 说明 |
---|---|---|
kind |
string:
static |
描述 RouterRule 子类型的类型鉴别器 |
value |
此规则始终返回的静态值。 值必须是基元值 - number、string、boolean 类型的值。 |
StaticWorkerSelectorAttachment
描述将附加到作业的工作器选择器。
名称 | 类型 | 说明 |
---|---|---|
kind |
string:
static |
描述 WorkerSelectorAttachment 子类型的类型鉴别器。 |
workerSelector |
要附加的工作器选择器。 |
WebhookRouterRule
提供对外部 Web 服务器的绑定的规则。
名称 | 类型 | 说明 |
---|---|---|
authorizationServerUri |
string |
授权服务器的 URI。 |
clientCredential |
用于 Contoso 授权服务器的 OAuth2.0 凭据。 参考:https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/ |
|
kind |
string:
webhook |
描述 RouterRule 子类型的类型鉴别器 |
webhookUri |
string |
Contoso 的 Web 服务器的 URI。 |
WeightedAllocationQueueSelectorAttachment
描述多个队列选择器集,其中一组将根据权重选择并附加。
名称 | 类型 | 说明 |
---|---|---|
allocations |
基于百分比的加权分配的集合。 |
|
kind |
string:
weighted |
描述 QueueSelectorAttachment 子类型的类型鉴别器。 |
WeightedAllocationWorkerSelectorAttachment
描述多个辅助角色选择器集,其中一组将根据权重选择和附加。
名称 | 类型 | 说明 |
---|---|---|
allocations |
基于百分比的加权分配的集合。 |
|
kind |
string:
weighted |
描述 WorkerSelectorAttachment 子类型的类型鉴别器。 |
WorkerSelectorAttachmentKind
支持的辅助角色选择器附件类型的鉴别器。
名称 | 类型 | 说明 |
---|---|---|
conditional |
string |
ConditionalWorkerSelectorAttachment 的鉴别器值。 |
passThrough |
string |
PassThroughWorkerSelectorAttachment 的鉴别器值。 |
ruleEngine |
string |
RuleEngineWorkerSelectorAttachment 的鉴别器值。 |
static |
string |
StaticWorkerSelectorAttachment 的鉴别器值。 |
weightedAllocation |
string |
WeightedAllocationWorkerSelectorAttachment 的鉴别器值。 |
WorkerWeightedAllocation
包含为加权分布选择时要应用的权重百分比和工作器选择器。
名称 | 类型 | 说明 |
---|---|---|
weight |
number |
此权重的百分比,以 1 的分数表示。 |
workerSelectors |
选择此分配时将应用的辅助角色选择器的集合。 |