All Products
Search
Document Center

Microservices Engine:GetGatewayRouteDetail

Last Updated:Aug 12, 2024

Queries the details of a route for a gateway.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
mse:GetGatewayRouteDetailget
  • Gateway
    acs:mse:{#regionId}:{#accountId}:instance/{#GatewayUniqueId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RouteIdlongYes

The ID of the route.

1050
GatewayUniqueIdstringYes

The unique ID of the gateway.

gw-5d3a78a53ec947aa928212d671d400ac
AcceptLanguagestringNo

The language of the response. Valid values:

  • zh: Chinese
  • en: English
zh

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The ID of the request.

FDF2D16C-5D28-5FAA-A56B-30BDE3559880
HttpStatusCodeinteger

The HTTP status code returned.

200
Messagestring

The error message returned if the request failed.

You are not authorized to perform this operation.
Codeinteger

The status code returned. A value of 200 indicates that the request is successful.

200
Successboolean

Indicates whether the request was successful. Valid values:

  • true: The request was successful.
  • false: The request failed.
true
Dataobject

The data returned.

Idlong

The ID.

1050
Namestring

The name.

test
GatewayUniqueIdstring

The unique ID of the gateway.

gw-7ea3da97b96543e19f6c597c****
GatewayIdlong

The ID of the gateway.

1
DefaultServiceIdlong

The default service ID.

3
DefaultServiceNamestring

The default service name.

test
Statusinteger

The status of the route. Valid values:

  • 0: unpublished
  • 2: publishing
  • 3: published
  • 4: editing (updated but not published)
  • 5: unpublishing
  • 6: unavailable
0
GmtCreatestring

The creation time.

2022-01-07 18:07:57
GmtModifiedstring

The last modification time.

2022-01-07T10:07:57.000+0000
RouteOrderinteger

The sequence number of the route.

1
Predicatesstring

The matching conditions.

{}
RoutePredicatesobject

The information about route matching.

PathPredicatesobject

The information about route matching.

Pathstring

The path.

/api
Typestring

The matching type.

PRE
IgnoreCaseboolean

Indicates whether case sensitivity is ignored.

true
MethodPredicatesarray

The information about method matching.

string

The method.

GET
HeaderPredicatesarray<object>

The information about header matching.

object

The request header.

Keystring

The key of the request header.

id
Valuestring

The value of the request header.

200
Typestring

The route type.

PRE
QueryPredicatesarray<object>

The information about parameter matching.

object

The parameter.

Keystring

The parameter name.

userid
Valuestring

The value of the parameter.

test
Typestring

The route type.

PRE
DomainIdlong

The domain ID.

235
DomainNamestring

The domain name.

123.com
Servicesstring

The configurations of services.

[{\"Percent\":100,\"ServiceId\":126}]
RouteServicesarray<object>

The services.

object

The services.

ServiceIdlong

The service ID.

782
ServiceNamestring

The service name.

xkc-crm
Percentinteger

The weight.

80
Versionstring

The service version.

v1
Namestring

The service name.

dubbo4
SourceTypestring

The source type of the service.

MSE
Namespacestring

The namespace.

acs_ecs_dashboard
GroupNamestring

The name of the group to which the service belongs.

api
AgreementTypestring

The protocol type.

DUBBO
ServicePortinteger

The port number of the service.

20880
HTTPRewriteobject

The information about the rewrite policy.

Statusstring

The status of the policy.

off
Pathstring

The path of the node.

/test/client
Hoststring

The hostname of the gateway.

aliyuncs.com
PathTypestring

The rewrite type.

PRE
Patternstring

The matching pattern.

/test
Substitutionstring

The replacement.

test
HeaderOpobject

The header settings.

Statusstring

The status.

off
HeaderOpItemsarray<object>

The information about headers.

object

The policy.

DirectionTypestring

The request or response.

Response
OpTypestring

The type of the operation.

Add
Keystring

The header key.

debug
Valuestring

The header value.

test
DestinationTypestring

The destination service type.

Single
DirectResponseobject

The information about service mocking.

Codeinteger

The response code returned.

200
Bodystring

The mock return value.

{}
Corsobject

The configuration for cross-origin resource sharing (CORS).

Statusstring

The status.

off
AllowOriginsstring

The origins allowed.

*
AllowMethodsstring

The methods allowed.

GET,POST,PUT,DELETE,HEAD,OPTIONS,PATCH
AllowHeadersstring

The headers allowed.

*
ExposeHeadersstring

The response headers.

*
TimeUnitstring

The time unit.

h
UnitNumlong

The unit number.

24
AllowCredentialsboolean

The credentials allowed.

true
Timeoutobject

The timeout configuration.

UnitNuminteger

The unit number.

10
TimeUnitstring

The time unit.

s
Statusstring

The status.

off
Retryobject

The retry configuration.

Attemptsinteger

The number of retries allowed.

1
RetryOnarray

The retry condition.

string

The retry condition.

5xx
HttpCodesarray

The HTTP status codes.

string

The HTTP status code returned.

500
Statusstring

The retry status.

on
DomainIdListarray

The IDs of domains.

long

The IDs of domains.

1
DomainNameListarray

The list of domain names.

string

The list of domain names.

test.com
Redirectobject

The configuration of the redirection.

Codeinteger

The response code returned.

200
Hoststring

The hostname.

16
Pathstring

The path.

10111
EnableWafboolean

Indicates whether Web Application Firewall (WAF) is activated.

true
AhasStatusinteger

The status of Application High Availability Service (AHAS).

1
Fallbackboolean

Indicates whether the Fallback service is enabled.

true
FallbackServicesarray<object>

The information of the Fallback service.

object

The data object.

ServiceIdlong

The service ID.

1
ServiceNamestring

The service name.

name
Percentinteger

The weight in the form of a percentage value.

80
Versionstring

The service version.

v1
Namestring

The name.

name
SourceTypestring

The source type of the service.

MSE
Namespacestring

The namespace to which the service belongs.

namespace
GroupNamestring

The name of the group to which the service belongs.

test
AgreementTypestring

The protocol type.

DUBBO
ServicePortinteger

The port number of the service.

8848
Policiesstring

The routing policy in a JSON string.

{ "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\"}]}" }

Examples

Sample success responses

JSONformat

{
  "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",
        "ServicePort": 20880
      }
    ],
    "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}"
  }
}

Error codes

HTTP status codeError codeError messageDescription
400IllegalRequestInvalid request:%sInvalid request: %s
400InvalidParameterParameter error:%sRequest parameter error: %s
403NoPermissionYou are not authorized to perform this operation:%sYou do not have the permission to use this interface:%s
404NotFoundNot found:%sThe resource does not exist:%s
500InternalErrorConsole error. Try again later:%sConsole error. Try again later: %s

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-01-29The response structure of the API has changedView Change Details
2024-01-18The response structure of the API has changedView Change Details
2023-08-22The response structure of the API has changedView Change Details
2023-03-02The response structure of the API has changedView Change Details
2022-02-18Add OperationView Change Details