All Products
Search
Document Center

Microservices Engine:UpdateGatewayRoute

Last Updated:Aug 12, 2024

Updates a routing rule 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:UpdateGatewayRoute
  • Gateway
    acs:mse:{#regionId}:{#accountId}:instance/{#GatewayUniqueId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
GatewayIdlongNo

The ID of the gateway.

501
NamestringNo

The name of the route.

route-web
RouteOrderintegerNo

The sequence number of the route.

1
PredicatesobjectYes

The route matching conditions.

PathPredicatesobjectYes

The information about path matching.

PathstringNo

The path used for route matching.

/test
TypestringNo

The matching type.

PRE
IgnoreCasebooleanNo

Specifies whether to perform case-insensitive matching.

true
MethodPredicatesarrayNo

The information about method matching.

stringNo

The method.

GET
HeaderPredicatesarray<object>No

The information about header matching.

objectNo

The request header.

KeystringNo

The key of the request header.

debug
ValuestringNo

The value of the request header.

on
TypestringNo

The matching type.

PRE
QueryPredicatesarray<object>No

The information about parameter matching.

objectNo

The information about a URL parameter.

KeystringNo

The name of the parameter.

userid
ValuestringNo

The value of the parameter.

test
TypestringNo

The matching type.

PRE
Servicesarray<object>No

The information about destination services.

objectNo

The services.

ServiceIdlongNo

The ID of the service.

1
PercentintegerNo

The percentage.

80
VersionstringNo

The version of the service.

v1
NamestringNo

The name.

web
SourceTypestringNo

The source type.

MSE
NamespacestringNo

The namespace in which the service resides.

default
GroupNamestringNo

The name of the group to which the service belongs.

test
AgreementTypestringNo

The type of the protocol. Valid values:

DUBBO
HttpDubboTranscoderobjectNo

The transcoder of the Dubbo protocol.

DubboServiceNamestringNo

The name of the Dubbo service.

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

The version of the Dubbo service.

0.0.0
DubboServiceGroupstringNo

The Dubbo service group.

service name
MothedMapListarray<object>No

The forwarding rules of the Dubbo service.

objectNo

The method mapping object.

DubboMothedNamestringNo

The method name of the Dubbo service.

sayHello
HttpMothedstringNo

The HTTP method.

Note Valid values:
  • ALL_GET

  • ALL_POST

  • ALL_PUT

  • ALL_DELETE

  • ALL_PATCH

ALL_GET
MothedpathstringNo

The path that is used to match a method.

/mytestzbk/sayhello
PassThroughAllHeadersstringNo

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
PassThroughListarrayNo

The list of headers to be passed through.

stringNo

The value of the header to be passed through.

x-forward
ParamMapsListarray<object>No

The information of parameter mappings.

objectNo

The parameter mapping object.

ExtractKeySpecstringNo

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
ExtractKeystringNo

The key extracted from the input parameter.

name
MappingTypestringNo

The type of the backend service parameter.

java.lang.String
ServicePortintegerNo

The Dubbo port number.

20880
IdlongNo

The ID of the route.

139
DestinationTypestringNo

The destination service type.

Mock
DirectResponseJSONobjectNo

The information about service mocking.

CodelongNo

The mock return code.

200
BodystringNo

The mock return value.

hello
GatewayUniqueIdstringYes

The unique ID of the gateway.

gw-86575c0bc9f04ecfbacb92b8e392a2c4
DomainIdListJSONstringYes

The associated domain name.

[90]
RedirectJSONobjectNo

The information about redirection.

CodeintegerNo

The status code returned.

302
HoststringNo

The hostname to be redirected to.

test.com
PathstringNo

The path to be redirected to.

/test
EnableWafbooleanNo

Specifies whether to activate Web Application Firewall (WAF).

false
FallbackbooleanNo

Specifies whether to enable the Fallback service.

true
FallbackServicesarray<object>No

The information about the Fallback service.

objectNo

The data object.

ServiceIdlongNo

The ID of the service.

1
PercentintegerNo

The weight in the form of a percentage value.

80
VersionstringNo

The version of the service.

v1
NamestringNo

The name.

name
SourceTypestringNo

The source type.

MSE
NamespacestringNo

The namespace in which the service resides.

Namespace
GroupNamestringNo

The name of the group to which the service belongs.

test
AgreementTypestringNo

The type of the protocol. Valid values:

DUBBO
ServicePortintegerNo

The service port number.

8848
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.

73785414-2C5B-5E28-BD91-B2C742269C48
HttpStatusCodeinteger

The HTTP status code returned.

200
Messagestring

The message returned.

The request is successfully processed.
Codeinteger

The status code returned.

200
Successboolean

Indicates whether the request was successful. Valid values:

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

The data returned.

337
ErrorCodestring

The error code returned if the request failed.

NoPermission

Examples

Sample success responses

JSONformat

{
  "RequestId": "73785414-2C5B-5E28-BD91-B2C742269C48",
  "HttpStatusCode": 200,
  "Message": "The request is successfully processed.\n",
  "Code": 200,
  "Success": true,
  "Data": 337,
  "ErrorCode": "NoPermission"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParameterParameter error : %s-
400IllegalRequestIllegal request : %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-18The request parameters of the API has changedView Change Details
2023-04-25The Error code has changedView Change Details
2022-07-28The internal configuration of the API is changed, but the call is not affectedView Change Details
2022-02-18Add OperationView Change Details