All Products
Search
Document Center

AddGatewayRoute

Last Updated: Aug 04, 2022

Creates a route for a gateway.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
GatewayIdLongNo

The ID of the gateway.

526
NamestringNo

The name of the route.

test
RouteOrderintegerNo

The sequence number of the route.

1
PredicatesobjectNo

The information about matching rules.

PathPredicatesobjectNo

The information about route matching.

PathstringNo

The path.

/test
TypestringNo

The matching mode.

PRE
IgnoreCasebooleanNo

Specifies whether to perform case-insensitive matches.

true
MethodPredicatesarrayNo

The information about method matching.

stringNo

The method.

GET
HeaderPredicatesarrayNo

The information about header matching.

objectNo

The information about a request header.

KeystringNo

The key of the request header.

debug
ValuestringNo

The value of the request header.

test
TypestringNo

The matching mode.

PRE
QueryPredicatesarrayNo

The information about URL 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 mode.

PRE
ServicesarrayNo

The information about services.

objectNo

The information about a service.

ServiceIdLongNo

The ID of the service.

353
PercentintegerNo

The weight in the form of a percentage value.

80
VersionstringNo

The version of the service.

v1
NamestringNo

The name of the service.

user
SourceTypestringNo

The source type of the service.

MSE
NamespacestringNo

The namespace in which the service resides.

default
GroupNamestringNo

The name of the group to which the service belongs.

test
DomainIdLongNo

The ID of the domain name.

20
DestinationTypestringNo

The destination service type.

Multiple
DirectResponseJSONobjectNo

The mock response configuration.

CodeLongNo

The mock return code.

403
BodystringNo

The mock return value.

hello
GatewayUniqueIdstringNo

The unique ID of the gateway.

gw-492af9b04bb4474cae9d645be850e3d7
DomainIdListJSONstringNo

The domain names.

[]
RedirectJSONobjectNo

The configuration of the redirect action.

CodeintegerNo

The return code.

302
HoststringNo

The hostname to be redirected to.

test.com
PathstringNo

The path to be redirected to.

/test
EnableWafbooleanNo
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.

03A3E2F4-6804-5663-9D5D-2EC47A1291C5
HttpStatusCodeinteger

The HTTP status code returned.

200
Messagestring

The message returned.

The request is processed successfully.
Codeinteger

The status code returned.

200
Successboolean

Indicates whether the request is successful. Valid values:

  • true: The request is successful.
  • false: The request fails.
true
DataLong

The returned data.

555

Error codes

For a list of error codes, visit the API error center.

Change history

Change timeSummary of changesOperate
2022-02-18Add Operation