GetConsumerAuthorizationRule
Retrieves the details of a specific consumer authorization rule.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
apig:GetConsumerAuthorizationRule |
none |
*Domain
|
None | None |
Request syntax
GET /v1/consumers/{consumerId}/authorization-rules/{consumerAuthorizationRuleId} HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| consumerAuthorizationRuleId |
string |
No |
The ID of the consumer authorization rule. |
car-ctgdn8em1hko5krqq03g |
| consumerId |
string |
No |
The ID of the consumer. |
cs-ctgdn2um1hkossul8gvg |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
No parameters required.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response data. |
||
| requestId |
string |
The request ID. |
53102737-1E4E-5A8B-8E0A-4184B0959B84 |
| consumerId |
string |
The ID of the consumer. |
cs-ctgdn2um1hkossul8gvg |
| consumerAuthorizationRuleId |
string |
The ID of the consumer authorization rule. |
car-ctgdn8em1hko5krqq03g |
| apiInfo | HttpApiApiInfo |
API information. |
|
| environmentInfo | EnvironmentInfo |
Environment information. |
|
| gatewayInfo | GatewayInfo |
Gateway information. |
|
| resourceType |
string |
The resource type. |
API |
| expireStatus |
string |
Indicates whether the authorization has expired. |
true |
| expireMode |
string |
The expiration mode. Valid values: |
LongTerm |
| expireTimestamp |
integer |
The expiration timestamp, in milliseconds. |
1750852089975 |
| createTimestamp |
integer |
The creation timestamp, in milliseconds. |
1750852089975 |
| updateTimestamp |
integer |
The update timestamp, in milliseconds. |
1750852089975 |
| deployStatus |
string |
The deployment status of the API in the current environment. |
"" |
Examples
Success response
JSON format
{
"requestId": "53102737-1E4E-5A8B-8E0A-4184B0959B84",
"consumerId": "cs-ctgdn2um1hkossul8gvg",
"consumerAuthorizationRuleId": "car-ctgdn8em1hko5krqq03g",
"apiInfo": {
"httpApiId": "api-xxx",
"name": "test",
"basePath": "/v1",
"description": "测试专用API",
"versionInfo": {
"enable": true,
"scheme": "Query",
"headerName": "my-version",
"queryName": "myVersion",
"version": "v1"
},
"ingressInfo": {
"sourceId": "src-xxx",
"ingressClass": "mse",
"watchNamespace": "default",
"environmentInfo": {
"environmentId": "env-xxx"
},
"k8sClusterInfo": {
"clusterId": "ca435c77cba1547cca9311957bcxxxxxx"
},
"overrideIngressIp": true
},
"type": "Rest",
"resourceGroupId": "rg-xxx",
"enableAuth": false,
"authConfig": {
"authType": "Jwt",
"authMode": "NoAuth"
},
"gatewayId": "gw-cpv4sqdl****",
"modelCategory": "Text",
"protocols": [
"HTTP"
],
"environments": [
{
"environmentId": "env-xxx",
"backendScene": "SingleService",
"backendType": "Service",
"serviceConfigs": [
{
"gatewayServiceId": "gs-xxx",
"name": "demo-service",
"protocol": "HTTP",
"port": "8080",
"weight": 100,
"version": "v1",
"match": {
"default": true,
"conditions": [
{
"type": "Query",
"key": "color",
"value": "gray",
"operator": "equal"
}
]
},
"serviceId": "svc-xxx"
}
],
"customDomains": [
{
"domainId": "d-xxx",
"name": "www.example.com",
"protocol": "HTTP"
}
],
"name": "test",
"alias": "test",
"gatewayInfo": {
"gatewayId": "gw-xxx",
"name": "test",
"gatewayEdition": "MultiTenantServerless"
},
"deployStatus": "Deployed",
"subDomains": [
{
"domainId": "d-xxx",
"name": "www.example.com",
"protocol": "HTTP",
"networkType": "Internet"
}
]
}
],
"aiProtocols": [
"OpenAI/v1"
],
"deployConfigs": [
{
"environmentId": "env-xxx",
"backendScene": "SingleService",
"autoDeploy": true,
"gatewayId": "gw-xx",
"routeBackend": {
"scene": "Single",
"services": [
{
"serviceId": "service-cq2bmmdlhtgj***",
"name": "item-service",
"protocol": "HTTP",
"port": 0,
"weight": 49,
"version": "v1"
}
]
},
"gatewayInfo": {
"gatewayId": "gw-cq7og15lhtgi6qasrj60",
"name": "apitest-gw",
"vpcInfo": {
"vpcId": "vpc-uf664nyle5kh***",
"name": "商品中心预发环境专有网络"
},
"engineVersion": "2.0.7",
"gatewayEdition": "MultiTenantServerless"
},
"mock": {
"enable": false,
"responseCode": 200,
"responseContent": "Mock测试"
},
"gatewayType": "API",
"customDomainIds": [
"d-xxx"
],
"envDomainIds": [
"d-xxx"
],
"serviceConfigs": [
{
"serviceId": "svc-xxx",
"weight": 100,
"modelNamePattern": "qwen-*",
"modelName": "qwen-max",
"intentCode": "INQUIRY",
"match": {
"default": true,
"conditions": [
{
"type": "Query",
"key": "color",
"value": "gray",
"operator": "equal"
}
]
},
"port": 80,
"protocol": "HTTP",
"gatewayServiceId": "gw-svc-abc123",
"name": "Qwen-Max-Service",
"version": "V2",
"multiServiceRouteStrategy": "ByWeight",
"observabilityRouteConfig": {
"mode": "LeastBusy",
"rateLimit": 0.8,
"queueSize": 100
}
}
],
"policyConfigs": [
{
"type": "AiFallback",
"enable": true,
"aiFallbackConfig": {
"serviceConfigs": [
{
"serviceId": "svc-******",
"targetModelName": "gpt-4/llama3-70b"
}
]
},
"aiSecurityGuardConfig": {
"serviceAddress": "https://api.example.com/v1",
"checkRequest": true,
"checkResponse": true,
"checkRequestImage": true,
"checkResponseImage": true,
"requestCheckService": "https://checker.example.com/validate-request",
"responseCheckService": "https://checker.example.com/validate-response",
"requestImageCheckService": "https://image-checker.example.com/scan",
"responseImageCheckService": "https://image-checker.example.com/scan-response",
"riskAlertLevel": "low/medium/high",
"riskConfig": [
{
"type": "K8S",
"level": "Critical",
"consumerRules": {
"pattern": "first",
"matchType": "term"
}
}
],
"bufferLimit": 50,
"consumerRequestCheckService": [
{
"name": "API",
"requestCheckService": "https://checker.example.com/validate",
"requestImageCheckService": "https://image-check.example.com/scan",
"matchType": "exact/prefix",
"modalityType": "text/image"
}
],
"consumerResponseCheckService": [
{
"name": "AI_API",
"responseCheckService": "https://checker.example.com/validate-response",
"responseImageCheckService": "https://image-check.example.com/scan-response",
"matchType": "term",
"modalityType": "text/image"
}
],
"consumerRiskLevel": [
{
"name": "APIG-UI",
"matchType": "term",
"type": "K8S",
"level": "Critical"
}
]
},
"aiTokenRateLimitConfig": {
"rules": [
{
"limitType": "request/token",
"matchKey": "user_id/api_path",
"matchType": "term",
"matchValue": "user123",
"limitMode": "local",
"limitValue": 100
}
],
"globalRules": [
{
"limitType": "request",
"matchKey": "user_id",
"matchType": "term",
"matchValue": "user123",
"limitMode": "local",
"limitValue": 100
}
],
"enableGlobalRules": true
},
"aiStatisticsConfig": {
"logRequestContent": false,
"logResponseContent": false
}
}
],
"customDomainInfos": [
{
"domainId": "d-cshee6dlhtgk******",
"name": "hello-server.com",
"protocol": "HTTP"
}
],
"envDomainInfos": [
{
"domainId": "",
"name": "",
"protocol": ""
}
],
"subDomains": [
{
"domainId": "d-csmn42um******",
"name": "test",
"protocol": "HTTP",
"networkType": "Intranet"
}
],
"builtinRouteNames": [
""
]
}
],
"deployCntMap": {
"key": {
"deployedCnt": 3,
"cnt": 0
}
},
"agentProtocols": [
"DashScope"
]
},
"environmentInfo": {
"environmentId": "env-cq7l5s5lhtgi6qasrdc0",
"name": "test",
"alias": "测试环境",
"description": "这是xxx的xx项目测试环境",
"gatewayInfo": {
"gatewayId": "gw-cq7og15lhtgi6qasrj60",
"name": "apitest-gw",
"vpcInfo": {
"vpcId": "vpc-uf664nyle5kh***",
"name": "商品中心预发环境专有网络"
},
"engineVersion": "2.0.7",
"gatewayEdition": "MultiTenantServerless"
},
"subDomainInfos": [
{
"domainId": "d-cpudb0llhtgl2djvq2sg",
"name": "abc.com",
"protocol": "HTTP",
"networkType": "Intranet"
}
],
"default": false,
"createTimestamp": 1721116090326,
"updateTimestamp": 1721116090326,
"resourceGroupId": "rg-xxxx"
},
"gatewayInfo": {
"gatewayId": "gw-cq7og15lhtgi6qasrj60",
"name": "apitest-gw",
"vpcInfo": {
"vpcId": "vpc-uf664nyle5kh***",
"name": "商品中心预发环境专有网络"
},
"engineVersion": "2.0.7",
"gatewayEdition": "MultiTenantServerless"
},
"resourceType": "API",
"expireStatus": "true",
"expireMode": "LongTerm",
"expireTimestamp": 1750852089975,
"createTimestamp": 1750852089975,
"updateTimestamp": 1750852089975,
"deployStatus": "\"\""
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.