All Products
Search
Document Center

Microservices Engine:UpdateGatewayRouteWafStatus

Last Updated:Aug 12, 2024

Updates the WAF status of a route.

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:UpdateGatewayRouteWafStatusupdate
  • Gateway
    acs:mse:{#regionId}:{#accountId}:instance/{#GatewayUniqueId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RouteIdlongYes

The ID of the route.

645
GatewayUniqueIdstringYes

The unique ID of the gateway.

gw-86575c0bc9f04ecfbacb92b8e392****
AcceptLanguagestringNo

The language of the response. Valid values:

  • zh: Chinese
  • en: English
zh
EnableWafbooleanYes

Specifies whether to activate Web Application Firewall (WAF).

true

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The ID of the request.

7466566F-F30F-4A29-965D-3E0AF21D****
HttpStatusCodeinteger

The HTTP status code returned.

200
Messagestring

The message returned.

success
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 returned data.

Idlong

The ID of the route.

12
Namestring

The name of the route.

test
GatewayUniqueIdstring

The unique ID of the gateway.

gw-7ea3da97b96543e19f6c597cd4a9****
GatewayIdlong

The ID of the gateway.

102
DefaultServiceIdlong

The default service ID.

1
DefaultServiceNamestring

The default service name.

test
Statusinteger

The status of the route.

1
GmtCreatestring

The creation time.

2022-01-26T09:52:41.000+0000
GmtModifiedstring

The modification time.

2022-02-24T06:08:29.230+0000
RouteOrderinteger

The sequence number of the route.

1
Predicatesstring

The matching rule.

{\"PathPredicates\":{\"Path\":\"/metas\",\"Type\":\"PRE\",\"IgnoreCase\":false}}
RoutePredicatesobject

The information about route matching.

PathPredicatesobject

The information about route matching.

Pathstring

The path.

/zookeeper/mmgw/unlogined/common.getBu
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 matching based on request headers.

object

The request header.

Keystring

The key of the request header.

alibo
Valuestring

The value of the request header.

200
Typestring

The matching type.

PRE
QueryPredicatesarray<object>

The parameter matching rules.

object

The parameter.

Keystring

The name of the parameter.

instanceId
Valuestring

The value of the parameter.

test
Typestring

The type.

PRE
DomainIdlong

The domain ID.

235
DomainNamestring

The domain name.

nbhamster.com
Servicesstring

The information about services.

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

The information about services.

object

The information about services.

ServiceIdlong

The ID of the service.

547
ServiceNamestring

The name of the service.

b-service
Percentinteger

The weight.

80
Versionstring

The version of the service.

v1
Namestring

The name of the service.

test-aixue-gray
SourceTypestring

The source type of the service.

K8s
Namespacestring

The namespace.

default
GroupNamestring

The name of the group to which the service belongs.

DEFAULT_GROUP
HTTPRewriteobject

The information about the rewrite policy.

Statusstring

The HTTP status.

off
Pathstring

The HTTP request path.

/test/client
Hoststring

The domain name.

aliyuncs.com
PathTypestring

The path type of the HTTP request.

PRE
Patternstring

The matching pattern.

/test
Substitutionstring

The replacement.

test
HeaderOpobject

The header settings.

Statusstring

The status.

off
HeaderOpItemsarray<object>

The policy.

object

The policy.

DirectionTypestring

The request or response.

Response
OpTypestring

The operation type.

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 return value.

200
Bodystring

The mock return value.

[{\"key\":\"h68d13466.sqa.eu95\",\"dims\":\"groupName=All}]
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.

s
UnitNumlong

The unit number.

1
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 for a request.

1
RetryOnarray

The retry condition.

string

The retry condition.

5xx
HttpCodesarray

The HTTP status code.

string

The HTTP status code.

500
Statusstring

The retry status.

on
DomainIdListarray

The list of domain IDs.

long

The list of domain IDs.

1
DomainNameListarray

The domain names.

string

The domain names.

test.com
Redirectobject

The configuration of the redirection.

Codeinteger

The response code returned.

200
Hoststring

The hostname.

ww.al.c
Pathstring

The path.

/
EnableWafboolean

Indicates whether WAF is activated.

0

Examples

Sample success responses

JSONformat

{
  "RequestId": "7466566F-F30F-4A29-965D-3E0AF21D****",
  "HttpStatusCode": 200,
  "Message": "success",
  "Code": 200,
  "Success": true,
  "Data": {
    "Id": 12,
    "Name": "test",
    "GatewayUniqueId": "gw-7ea3da97b96543e19f6c597cd4a9****",
    "GatewayId": 102,
    "DefaultServiceId": 1,
    "DefaultServiceName": "test",
    "Status": 1,
    "GmtCreate": "2022-01-26T09:52:41.000+0000",
    "GmtModified": "2022-02-24T06:08:29.230+0000",
    "RouteOrder": 1,
    "Predicates": "{\\\"PathPredicates\\\":{\\\"Path\\\":\\\"/metas\\\",\\\"Type\\\":\\\"PRE\\\",\\\"IgnoreCase\\\":false}}",
    "RoutePredicates": {
      "PathPredicates": {
        "Path": "/zookeeper/mmgw/unlogined/common.getBu",
        "Type": "PRE",
        "IgnoreCase": true
      },
      "MethodPredicates": [
        "GET"
      ],
      "HeaderPredicates": [
        {
          "Key": "alibo",
          "Value": "200",
          "Type": "PRE"
        }
      ],
      "QueryPredicates": [
        {
          "Key": "instanceId",
          "Value": "test",
          "Type": "PRE"
        }
      ]
    },
    "DomainId": 235,
    "DomainName": "nbhamster.com",
    "Services": "[{\\\"Percent\\\":100,\\\"ServiceId\\\":126}]",
    "RouteServices": [
      {
        "ServiceId": 547,
        "ServiceName": "b-service",
        "Percent": 80,
        "Version": "v1",
        "Name": "test-aixue-gray",
        "SourceType": "K8s",
        "Namespace": "default",
        "GroupName": "DEFAULT_GROUP"
      }
    ],
    "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": "[{\\\"key\\\":\\\"h68d13466.sqa.eu95\\\",\\\"dims\\\":\\\"groupName=All}]"
    },
    "Cors": {
      "Status": "off",
      "AllowOrigins": "*",
      "AllowMethods": "GET,POST,PUT,DELETE,HEAD,OPTIONS,PATCH",
      "AllowHeaders": "*",
      "ExposeHeaders": "*",
      "TimeUnit": "s",
      "UnitNum": 1,
      "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": "ww.al.c",
      "Path": "/"
    },
    "EnableWaf": true
  }
}

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.