All Products
Search
Document Center

Microservices Engine:ListGatewayRoute

Last Updated:Nov 13, 2024

Queries the routes of a gateway.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:ListGatewayRouteget
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
PageNumberintegerNo

The number of the page to return.

1
PageSizeintegerNo

The number of entries to return on each page.

10
OrderItemstringNo

The item based on which entries are sorted.

GmtCreate
DescSortbooleanNo

Specifies whether to enable sorting. This parameter is unavailable.

false
FilterParamsobjectNo

The parameters that specify filter conditions. The parameters are in the format of {"key1":"value1"}.

GatewayIdlongNo

The ID of the gateway.

81
NamestringNo

The name of the gateway.

test
StatusintegerNo

The status.

1
DefaultServiceIdlongNo

The default service ID.

1
RouteOrderintegerNo

The order.

1
DomainIdlongNo

The domain ID.

284
GatewayUniqueIdstringYes

The unique ID of the gateway.

gw-30a0106924c94bca8712ec4e79fc5acc
DomainNamestringNo

The associated domain name.

*.alites.com
AcceptLanguagestringNo

The language of the response. Valid values:

  • zh: Chinese
  • en: English
zh

Response parameters

ParameterTypeDescriptionExample
object

The data structure.

RequestIdstring

The ID of the request.

83F02EAB-ECDF-55C6-B332-8649E5E7AF2C
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 code returned.

200
Successboolean

Indicates whether the request was successful. Valid values:

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

The data returned.

TotalSizelong

The total number of entries returned.

36
PageNumberinteger

The page number of the returned page.

11
PageSizeinteger

The number of entries returned per page.

10
Resultarray<object>

The data structure.

Routesobject

The returned information.

Idlong

The ID.

47
Namestring

The name.

test
GatewayUniqueIdstring

The unique ID of the gateway.

gw-cf0e7f52ecc7429dbc7ba4d5e3656100
GatewayIdlong

The ID of the gateway.

496
Statusinteger

The status.

2
RouteOrderinteger

The order.

1
DefaultServiceNamestring

The default service name.

test
DefaultServiceIdlong

The default service ID.

1
Predicatesstring

The matching rules.

{\"PathPredicates\":{\"Path\":\"/rpc/compute \",\"Type\":\"PRE\",\"IgnoreCase\":true}}
RoutePredicatesobject

The matching rules.

PathPredicatesobject

The path used for route matching.

Pathstring

The path of the node.

/getIp
Typestring

The matching type.

PRE
IgnoreCaseboolean

Indicates whether case sensitivity is ignored.

true
MethodPredicatesarray

The HTTP methods used for route matching.

MethodPredicatesstring

The method.

GET
HeaderPredicatesarray<object>

The headers used for route matching.

HeaderPredicatesobject

The header list.

Keystring

The header key.

userid
Valuestring

The value.

test
Typestring

The matching type.

PRE
QueryPredicatesarray<object>

The parameters used for route matching.

QueryPredicatesobject

The list of parameters.

Keystring

The key.

userid
Valuestring

The value.

test
Typestring

The matching type.

PRE
GmtCreatestring

The creation time.

2022-01-25T07:14:01.817+0000
GmtModifiedstring

The modification time.

2022-01-07 18:07:57
Servicesstring

The information about services.

[]
RouteServicesarray<object>

The information about services.

RouteServicesobject

The list of services.

ServiceIdlong

The ID of the service.

1563
ServiceNamestring

The name of the service.

hu
Percentinteger

The weight in the form of a percentage value.

11
Versionstring

The version of the service.

v1
Namestring

The name.

test
SourceTypestring

The source type.

MSE
Namespacestring

The namespace.

default
GroupNamestring

The name of the group to which the service belongs.

api
AgreementTypestring

The type of the protocol.

DUBBO
HttpDubboTranscoderobject

The transcoder of the Dubbo protocol.

DubboServiceNamestring

The name of the Dubbo service.

org.apache.dubbo.samples.basic.api.DemoService
DubboServiceVersionstring

The version of the Dubbo service.

0.0.0
MothedMapListarray<object>

The forwarding rules of the Dubbo service.

MothedMapListobject

The method mapping object.

DubboMothedNamestring

The method name of the Dubbo service.

sayHello
HttpMothedstring

The HTTP method.

Note Valid values:
  • ALL_GET

  • ALL_POST

  • ALL_PUT

  • ALL_DELETE

  • ALL_PATCH

ALL_GET
Mothedpathstring

The path used for method matching.

/mytestzbk/sayhello
PassThroughAllHeadersstring

The pass-through type of the header.

Note Valid values:
  • PASS_ALL: All headers are passed through.

  • PASS_NOT: All headers are not passed through.

  • PASS_ASSIGN: Specified headers are passed through.

PASS_NOT
PassThroughListarray

The list of headers to be passed through.

PassThroughListstring

The value of the header to be passed through.

x-forward
ParamMapsListarray<object>

The information about parameter mappings.

ParamMapsListobject

The parameter mapping object.

ExtractKeySpecstring

The position of the input parameter.

Note Valid values:
  • ALL_QUERY_PARAMETER: request parameter

  • ALL_HEADER: request header

  • ALL_PATH: request path

  • ALL_BODY: request body

ALL_QUERY_PARAMETER
ExtractKeystring

The key extracted from the input parameter.

name
MappingTypestring

The type of the backend service parameter.

java.lang.String
DubboServiceGroupstring

The Dubbo service group.

service group
ServicePortinteger

The Dubbo port number.

20880
DomainIdlong

The domain ID.

265
DomainNamestring

The domain name.

y.com
DestinationTypestring

The destination service type.

Single
DirectResponseobject

The information about service mocking.

Codeinteger

The response code returned.

200
Bodystring

The return value for service mocking.

hello
DomainIdListarray

The domain IDs.

DomainIdListlong

The domain IDs.

123
DomainNameListarray

The domain names.

DomainNameListstring

The domain names.

test.com
Redirectobject

The information about redirection.

Codeinteger

The response code returned.

200
Hoststring

The hostname to be redirected to.

test.com
Pathstring

The path.

/test
Typestring

The route type.

Op
Commentobject

The route comment (ingress).

Statusstring

The status.

error
EnableWafstring

Indicates whether Web Application Firewall (WAF) is activated.

false
Fallbackboolean

Indicates whether the Fallback service is enabled.

true
FallbackServicesarray<object>

The information about the Fallback service.

FallbackServicesobject
ServiceIdlong

The ID of the service.

353
ServiceNamestring

The name of the service.

service name
Percentinteger

The weight in the form of a percentage value.

100
Versionstring

The version of the service.

v1
Namestring

The name.

name
SourceTypestring

The source type.

MSE
Namespacestring

The namespace to which the service belongs.

Namespace
GroupNamestring

The name of the group to which the service belongs.

test
AgreementTypestring

The type of the protocol.

DUBBO
ServicePortinteger

The service port number.

8848

Examples

Sample success responses

JSONformat

{
  "RequestId": "83F02EAB-ECDF-55C6-B332-8649E5E7AF2C",
  "HttpStatusCode": 200,
  "Message": "You are not authorized to perform this operation.",
  "Code": 200,
  "Success": true,
  "Data": {
    "TotalSize": 36,
    "PageNumber": 11,
    "PageSize": 10,
    "Result": [
      {
        "Id": 47,
        "Name": "test",
        "GatewayUniqueId": "gw-cf0e7f52ecc7429dbc7ba4d5e3656100",
        "GatewayId": 496,
        "Status": 2,
        "RouteOrder": 1,
        "DefaultServiceName": "test",
        "DefaultServiceId": 1,
        "Predicates": "{\\\"PathPredicates\\\":{\\\"Path\\\":\\\"/rpc/compute \\\",\\\"Type\\\":\\\"PRE\\\",\\\"IgnoreCase\\\":true}}",
        "RoutePredicates": {
          "PathPredicates": {
            "Path": "/getIp",
            "Type": "PRE",
            "IgnoreCase": true
          },
          "MethodPredicates": [
            "GET"
          ],
          "HeaderPredicates": [
            {
              "Key": "userid",
              "Value": "test",
              "Type": "PRE"
            }
          ],
          "QueryPredicates": [
            {
              "Key": "userid",
              "Value": "test",
              "Type": "PRE"
            }
          ]
        },
        "GmtCreate": "2022-01-25T07:14:01.817+0000",
        "GmtModified": "2022-01-07 18:07:57",
        "Services": "[]",
        "RouteServices": [
          {
            "ServiceId": 1563,
            "ServiceName": "hu",
            "Percent": 11,
            "Version": "v1",
            "Name": "test",
            "SourceType": "MSE",
            "Namespace": "default",
            "GroupName": "api",
            "AgreementType": "DUBBO",
            "HttpDubboTranscoder": {
              "DubboServiceName": "org.apache.dubbo.samples.basic.api.DemoService",
              "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
          }
        ],
        "DomainId": 265,
        "DomainName": "y.com",
        "DestinationType": "Single",
        "DirectResponse": {
          "Code": 200,
          "Body": "hello"
        },
        "DomainIdList": [
          123
        ],
        "DomainNameList": [
          "test.com"
        ],
        "Redirect": {
          "Code": 200,
          "Host": "test.com",
          "Path": "/test"
        },
        "Type": "Op",
        "Comment": {
          "Status": "error"
        },
        "EnableWaf": "false",
        "Fallback": true,
        "FallbackServices": [
          {
            "ServiceId": 353,
            "ServiceName": "service name",
            "Percent": 100,
            "Version": "v1",
            "Name": "name",
            "SourceType": "MSE\n",
            "Namespace": "Namespace",
            "GroupName": "test",
            "AgreementType": "DUBBO",
            "ServicePort": 8848
          }
        ]
      }
    ]
  }
}

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-09-10The response structure of the API has changedView Change Details
2024-01-18The response structure of the API has changedView Change Details
2022-07-28The response structure of the API has changedView Change Details
2022-02-18Add OperationView Change Details