查詢網關路由詳情。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
mse:GetGatewayRouteDetail |
get |
*Gateway
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| RouteId |
integer |
是 |
路由 ID。 |
1050 |
| GatewayUniqueId |
string |
是 |
網關唯一標識 ID。 |
gw-5d3a78a53ec947aa928212d671d400ac |
| AcceptLanguage |
string |
否 |
返回資訊的語言類型:
|
zh |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
資料結構。 |
||
| RequestId |
string |
請求 ID。 |
FDF2D16C-5D28-5FAA-A56B-30BDE3559880 |
| HttpStatusCode |
integer |
HTTP 狀態代碼。 |
200 |
| Message |
string |
錯誤資訊。 |
You are not authorized to perform this operation. |
| Code |
integer |
狀態代碼。說明 200 表示成功。 |
200 |
| Success |
boolean |
請求結果,取值如下:
|
true |
| Data |
object |
返回資料。 |
|
| Id |
integer |
ID。 |
1050 |
| Name |
string |
名稱。 |
test |
| GatewayUniqueId |
string |
網關唯一標識 ID。 |
gw-7ea3da97b96543e19f6c597c**** |
| GatewayId |
integer |
網關 ID。 |
1 |
| DefaultServiceId |
integer |
預設服務 ID。 |
3 |
| DefaultServiceName |
string |
預設服務名稱。 |
test |
| Status |
integer |
路由狀態。
|
0 |
| GmtCreate |
string |
建立時間。 |
2022-01-07 18:07:57 |
| GmtModified |
string |
最後修改時間。 |
2022-01-07T10:07:57.000+0000 |
| RouteOrder |
integer |
路由順序。 |
1 |
| Predicates |
string |
匹配條件。 |
{} |
| RoutePredicates |
object |
路由匹配。 |
|
| PathPredicates |
object |
路由匹配。 |
|
| Path |
string |
路徑。 |
/api |
| Type |
string |
匹配類型。 |
PRE |
| IgnoreCase |
boolean |
是否忽略大小寫。 |
true |
| MethodPredicates |
array |
方法匹配。 |
|
|
string |
方法。 |
GET |
|
| HeaderPredicates |
array |
頭匹配。 |
|
|
object |
要求標頭。 |
||
| Key |
string |
要求標頭 KEY。 |
id |
| Value |
string |
匹配值。 |
200 |
| Type |
string |
類型。 |
PRE |
| QueryPredicates |
array |
參數匹配。 |
|
|
object |
參數。 |
||
| Key |
string |
參數名稱。 |
userid |
| Value |
string |
匹配值。 |
test |
| Type |
string |
類型。 |
PRE |
| DomainId |
integer |
網域名稱 ID。 |
235 |
| DomainName |
string |
網域名稱。 |
123.com |
| Services |
string |
服務的配置資訊。 |
[{\"Percent\":100,\"ServiceId\":126}] |
| RouteServices |
array |
服務。 |
|
|
object |
服務。 |
||
| ServiceId |
integer |
服務 ID。 |
782 |
| ServiceName |
string |
服務名稱。 |
xkc-crm |
| Percent |
integer |
權重。 |
80 |
| Version |
string |
服務版本。 |
v1 |
| Name |
string |
服務名稱。 |
dubbo4 |
| SourceType |
string |
服務來源。 |
MSE |
| Namespace |
string |
命名空間。 |
acs_ecs_dashboard |
| GroupName |
string |
服務組名稱。 |
api |
| AgreementType |
string |
協議類型。 |
DUBBO |
| HttpDubboTranscoder |
object |
Dubbo 協議轉換體。 |
|
| DubboServiceName |
string |
Dubbo 服務名稱。 |
org.apache.dubbo.samples.basic.api.DemoService |
| DubboServiceVersion |
string |
Dubbo 服務版本。 |
0.0.0 |
| MothedMapList |
array |
Dubbo 轉寄規則列表。 |
|
|
object |
|||
| DubboMothedName |
string |
Dubbo 方法名。 |
sayHello |
| HttpMothed |
string |
Http 方法。 說明
支援 http 方法參數值。
|
ALL_GET |
| Mothedpath |
string |
方法匹配路徑。 |
/mytestzbk/sayhello |
| PassThroughAllHeaders |
string |
Header 透傳類型。 說明
透傳類型枚舉值。
|
PASS_NOT |
| PassThroughList |
array |
指定 Header 透傳列表。 |
|
|
string |
指定 Header 透傳值。 |
x-forward |
|
| ParamMapsList |
array |
參數映射列表。 |
|
|
object |
|||
| ExtractKeySpec |
string |
入參位置。 說明
入參位置枚舉值。
|
ALL_QUERY_PARAMETER |
| ExtractKey |
string |
入參位提取 Key。 |
name |
| MappingType |
string |
後端參數類型。 |
java.lang.String |
| DubboServiceGroup |
string |
Dubbo 服務組。 |
service group |
| ServicePort |
integer |
服務連接埠。 |
20880 |
| HealthStatus |
string |
健康狀態
|
Health |
| UnhealthyEndpoints |
array |
非健康 Endpoint 列表 |
|
|
string |
非健康 Endpoint |
192.168.1.2 |
|
| HTTPRewrite |
object |
重寫策略資訊。 |
|
| Status |
string |
開啟狀態。 |
off |
| Path |
string |
節點路徑。 |
/test/client |
| Host |
string |
執行個體地址。 |
aliyuncs.com |
| PathType |
string |
重寫類型。 |
PRE |
| Pattern |
string |
匹配 Pattern。 |
/test |
| Substitution |
string |
替換。 |
test |
| HeaderOp |
object |
Header 設定資訊。 |
|
| Status |
string |
狀態。 |
off |
| HeaderOpItems |
array |
頭欄位對象。 |
|
|
object |
設定策略。 |
||
| DirectionType |
string |
請求或響應。 |
Response |
| OpType |
string |
操作類型。 |
Add |
| Key |
string |
Header Key。 |
debug |
| Value |
string |
設定值。 |
test |
| DestinationType |
string |
目標服務類型。 |
Single |
| DirectResponse |
object |
Mock 資訊。 |
|
| Code |
integer |
響應碼。 |
200 |
| Body |
string |
Mock 傳回值。 |
{} |
| Cors |
object |
跨網域設定。 |
|
| Status |
string |
狀態。 |
off |
| AllowOrigins |
string |
跨域。 |
* |
| AllowMethods |
string |
跨域方法。 |
GET,POST,PUT,DELETE,HEAD,OPTIONS,PATCH |
| AllowHeaders |
string |
跨域 Header。 |
* |
| ExposeHeaders |
string |
回應標頭。 |
* |
| TimeUnit |
string |
時間單位。 |
h |
| UnitNum |
integer |
時間數。 |
24 |
| AllowCredentials |
boolean |
允許攜帶憑證。 |
true |
| Timeout |
object |
逾時配置。 |
|
| UnitNum |
integer |
時間數。 |
10 |
| TimeUnit |
string |
時間單位。 |
s |
| Status |
string |
狀態。 |
off |
| Retry |
object |
重試配置。 |
|
| Attempts |
integer |
重試次數。 |
1 |
| RetryOn |
array |
重試條件。 |
|
|
string |
重試條件。 |
5xx |
|
| HttpCodes |
array |
HTTP 狀態代碼。 |
|
|
string |
HTTP 狀態代碼。 |
500 |
|
| Status |
string |
重試狀態。 |
on |
| DomainIdList |
array |
網域名稱列表 |
|
|
integer |
網域名稱 ID 列表。 |
1 |
|
| DomainNameList |
array |
網域名稱列表 |
|
|
string |
網域名稱列表。 |
test.com |
|
| Redirect |
object |
重新導向配置 |
|
| Code |
integer |
響應碼。 |
200 |
| Host |
string |
主機。 |
16 |
| Path |
string |
路徑。 |
10111 |
| FlowMirror |
object |
流量鏡像配置。 |
|
| TargetServiceId |
integer |
目標服務 ID。 |
21 |
| TargetServiceName |
string |
目標服務名稱。 |
test |
| Port |
integer |
目標服務連接埠。 |
8790 |
| Percentage |
integer |
流量複製比例(%),取值 0-100。 |
90 |
| Status |
string |
開啟狀態,取值:
|
on |
| EnableWaf |
boolean |
是否開啟 Waf。 |
true |
| AhasStatus |
integer |
Ahas 狀態。 |
1 |
| Fallback |
boolean |
是否開啟 Fallback 服務。 |
true |
| FallbackServices |
array |
Fallback 服務。 |
|
|
object |
資料對象。 |
||
| ServiceId |
integer |
服務 ID。 |
1 |
| ServiceName |
string |
服務名稱。 |
name |
| Percent |
integer |
權重百分比。 |
80 |
| Version |
string |
服務版本。 |
v1 |
| Name |
string |
名稱。 |
name |
| SourceType |
string |
來源類型。 |
MSE |
| Namespace |
string |
服務所在命名空間。 |
namespace |
| GroupName |
string |
服務分組名稱。 |
test |
| AgreementType |
string |
協議類型。 |
DUBBO |
| ServicePort |
integer |
服務連接埠。 |
8848 |
| Policies |
string |
路由策略 Json 字串。 |
{ "CORS": "{\"allowMethods\":\"GET,POST,PUT,DELETE,HEAD,OPTIONS,PATCH\",\"allowHeaders\":\"*\",\"exposeHeaders\":\"*\",\"unitNum\":12,\"allowCredentials\":true,\"status\":\"off\",\"allowOrigins\":\"*\",\"timeUnit\":\"h\"}", "Timeout": "{\"unitNum\":10,\"timeUnit\":\"s\",\"status\":\"off\"}", "Retry": "{\"attempts\":2,\"retryOn\":[\"5xx\"],\"status\":\"off\"}", "HTTPRewrite": "{\"pathType\":\"EQUAL\",\"path\":\"/o\",\"status\":\"off\"}", "Waf": "{\"enabled\":false}", "HeaderOp": "{\"status\":\"off\",\"headerOpItems\":[{\"directionType\":\"Request\",\"opType\":\"Add\",\"key\":\"kkk\",\"value\":\"ll\"}]}" } |
| Description |
string |
路由描述 |
a route for xxx |
樣本
正常返回樣本
JSON格式
{
"RequestId": "FDF2D16C-5D28-5FAA-A56B-30BDE3559880",
"HttpStatusCode": 200,
"Message": "You are not authorized to perform this operation.",
"Code": 200,
"Success": true,
"Data": {
"Id": 1050,
"Name": "test",
"GatewayUniqueId": "gw-7ea3da97b96543e19f6c597c****",
"GatewayId": 1,
"DefaultServiceId": 3,
"DefaultServiceName": "test",
"Status": 0,
"GmtCreate": "2022-01-07 18:07:57",
"GmtModified": "2022-01-07T10:07:57.000+0000",
"RouteOrder": 1,
"Predicates": "{}",
"RoutePredicates": {
"PathPredicates": {
"Path": "/api",
"Type": "PRE",
"IgnoreCase": true
},
"MethodPredicates": [
"GET"
],
"HeaderPredicates": [
{
"Key": "id",
"Value": "200",
"Type": "PRE"
}
],
"QueryPredicates": [
{
"Key": "userid",
"Value": "test",
"Type": "PRE"
}
]
},
"DomainId": 235,
"DomainName": "123.com",
"Services": "[{\\\"Percent\\\":100,\\\"ServiceId\\\":126}]",
"RouteServices": [
{
"ServiceId": 782,
"ServiceName": "xkc-crm",
"Percent": 80,
"Version": "v1",
"Name": "dubbo4",
"SourceType": "MSE",
"Namespace": "acs_ecs_dashboard",
"GroupName": "api",
"AgreementType": "DUBBO",
"HttpDubboTranscoder": {
"DubboServiceName": "org.apache.dubbo.samples.basic.api.DemoService\n",
"DubboServiceVersion": "0.0.0",
"MothedMapList": [
{
"DubboMothedName": "sayHello",
"HttpMothed": "ALL_GET",
"Mothedpath": "/mytestzbk/sayhello",
"PassThroughAllHeaders": "PASS_NOT",
"PassThroughList": [
"x-forward"
],
"ParamMapsList": [
{
"ExtractKeySpec": "ALL_QUERY_PARAMETER",
"ExtractKey": "name",
"MappingType": "java.lang.String"
}
]
}
],
"DubboServiceGroup": "service group"
},
"ServicePort": 20880,
"HealthStatus": "Health",
"UnhealthyEndpoints": [
"192.168.1.2"
]
}
],
"HTTPRewrite": {
"Status": "off",
"Path": "/test/client",
"Host": "aliyuncs.com",
"PathType": "PRE",
"Pattern": "/test",
"Substitution": "test"
},
"HeaderOp": {
"Status": "off",
"HeaderOpItems": [
{
"DirectionType": "Response",
"OpType": "Add",
"Key": "debug",
"Value": "test"
}
]
},
"DestinationType": "Single",
"DirectResponse": {
"Code": 200,
"Body": "{}"
},
"Cors": {
"Status": "off",
"AllowOrigins": "*",
"AllowMethods": "GET,POST,PUT,DELETE,HEAD,OPTIONS,PATCH",
"AllowHeaders": "*",
"ExposeHeaders": "*",
"TimeUnit": "h",
"UnitNum": 24,
"AllowCredentials": true
},
"Timeout": {
"UnitNum": 10,
"TimeUnit": "s",
"Status": "off"
},
"Retry": {
"Attempts": 1,
"RetryOn": [
"5xx"
],
"HttpCodes": [
"500"
],
"Status": "on"
},
"DomainIdList": [
1
],
"DomainNameList": [
"test.com"
],
"Redirect": {
"Code": 200,
"Host": "16",
"Path": "10111"
},
"FlowMirror": {
"TargetServiceId": 21,
"TargetServiceName": "test",
"Port": 8790,
"Percentage": 90,
"Status": "on"
},
"EnableWaf": true,
"AhasStatus": 1,
"Fallback": true,
"FallbackServices": [
{
"ServiceId": 1,
"ServiceName": "name",
"Percent": 80,
"Version": "v1",
"Name": "name",
"SourceType": "MSE",
"Namespace": "namespace",
"GroupName": "test",
"AgreementType": "DUBBO",
"ServicePort": 8848
}
],
"Policies": "{\n \"CORS\": \"{\\\"allowMethods\\\":\\\"GET,POST,PUT,DELETE,HEAD,OPTIONS,PATCH\\\",\\\"allowHeaders\\\":\\\"*\\\",\\\"exposeHeaders\\\":\\\"*\\\",\\\"unitNum\\\":12,\\\"allowCredentials\\\":true,\\\"status\\\":\\\"off\\\",\\\"allowOrigins\\\":\\\"*\\\",\\\"timeUnit\\\":\\\"h\\\"}\",\n \"Timeout\": \"{\\\"unitNum\\\":10,\\\"timeUnit\\\":\\\"s\\\",\\\"status\\\":\\\"off\\\"}\",\n \"Retry\": \"{\\\"attempts\\\":2,\\\"retryOn\\\":[\\\"5xx\\\"],\\\"status\\\":\\\"off\\\"}\",\n \"HTTPRewrite\": \"{\\\"pathType\\\":\\\"EQUAL\\\",\\\"path\\\":\\\"/o\\\",\\\"status\\\":\\\"off\\\"}\",\n \"Waf\": \"{\\\"enabled\\\":false}\",\n \"HeaderOp\": \"{\\\"status\\\":\\\"off\\\",\\\"headerOpItems\\\":[{\\\"directionType\\\":\\\"Request\\\",\\\"opType\\\":\\\"Add\\\",\\\"key\\\":\\\"kkk\\\",\\\"value\\\":\\\"ll\\\"}]}\"\n}",
"Description": "a route for xxx"
}
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | IllegalRequest | Invalid request:%s | 非法請求: %s |
| 400 | InvalidParameter | Parameter error:%s | 請求參數錯誤:%s |
| 500 | InternalError | Console error. Try again later:%s | 控制台錯誤.稍後重試:%s |
| 403 | NoPermission | You are not authorized to perform this operation:%s | 沒有許可權使用此介面:%s |
| 404 | NotFound | Not found:%s | 資源不存在:%s |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。