All Products
Search
Document Center

Microservices Engine:UpdateGatewayRouteWafStatus

Last Updated:Jun 10, 2026

Memperbarui status WAF rute.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

mse:UpdateGatewayRouteWafStatus

update

*Gateway

acs:mse:{#regionId}:{#accountId}:instance/{#GatewayUniqueId}

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

RouteId

integer

Yes

ID rute.

645

GatewayUniqueId

string

Yes

ID unik gateway.

gw-86575c0bc9f04ecfbacb92b8e392****

AcceptLanguage

string

No

Bahasa respons. Nilai yang valid:

  • zh: Mandarin

  • en: Inggris

zh

EnableWaf

boolean

Yes

Menentukan apakah akan mengaktifkan Web Application Firewall (WAF).

true

Elemen respons

Element

Type

Description

Example

object

Parameter respons.

RequestId

string

ID permintaan.

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

HttpStatusCode

integer

Kode status HTTP yang dikembalikan.

200

Message

string

Pesan yang dikembalikan.

success

Code

integer

Kode status yang dikembalikan. Nilai 200 menunjukkan bahwa permintaan berhasil.

200

Success

boolean

Menunjukkan apakah permintaan berhasil. Nilai yang valid:

  • true: Permintaan berhasil.

  • false: Permintaan gagal.

true

Data

object

Data yang dikembalikan.

Id

integer

ID rute.

12

Name

string

Nama rute.

test

GatewayUniqueId

string

ID unik gateway.

gw-7ea3da97b96543e19f6c597cd4a9****

GatewayId

integer

ID gateway.

102

DefaultServiceId

integer

ID layanan default.

1

DefaultServiceName

string

Nama layanan default.

test

Status

integer

Status rute.

1

GmtCreate

string

Waktu pembuatan.

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

GmtModified

string

Waktu modifikasi.

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

RouteOrder

integer

Nomor urut rute.

1

Predicates

string

Aturan pencocokan.

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

RoutePredicates

object

Informasi tentang pencocokan rute.

PathPredicates

object

The information about route matching.

Path

string

The path.

/zookeeper/mmgw/unlogined/common.getBu

Type

string

The matching type.

PRE

IgnoreCase

boolean

Indicates whether case sensitivity is ignored.

true

MethodPredicates

array

The information about method matching.

string

The method.

GET

HeaderPredicates

array<object>

The information about matching based on request headers.

object

The request header.

Key

string

The key of the request header.

alibo

Value

string

The value of the request header.

200

Type

string

The matching type.

PRE

QueryPredicates

array<object>

The parameter matching rules.

object

The parameter.

Key

string

The name of the parameter.

instanceId

Value

string

The value of the parameter.

test

Type

string

The type.

PRE

DomainId

integer

ID domain.

235

DomainName

string

Nama domain.

nbhamster.com

Services

string

Informasi tentang layanan.

[{\"Percent\":100,\"ServiceId\":126}]

RouteServices

array<object>

Informasi tentang layanan.

object

Informasi tentang layanan.

ServiceId

integer

The ID of the service.

547

ServiceName

string

The name of the service.

b-service

Percent

integer

The weight.

80

Version

string

The version of the service.

v1

Name

string

The name of the service.

test-aixue-gray

SourceType

string

The source type of the service.

K8s

Namespace

string

The namespace.

default

GroupName

string

The name of the group to which the service belongs.

DEFAULT_GROUP

HTTPRewrite

object

Informasi tentang kebijakan penulisan ulang.

Status

string

The HTTP status.

off

Path

string

The HTTP request path.

/test/client

Host

string

The domain name.

aliyuncs.com

PathType

string

The path type of the HTTP request.

PRE

Pattern

string

The matching pattern.

/test

Substitution

string

The replacement.

test

HeaderOp

object

Pengaturan header.

Status

string

The status.

off

HeaderOpItems

array<object>

The policy.

object

The policy.

DirectionType

string

The request or response.

Response

OpType

string

The operation type.

Add

Key

string

The header key.

debug

Value

string

The header value.

test

DestinationType

string

Tipe layanan tujuan.

Single

DirectResponse

object

Informasi tentang mocking layanan.

Code

integer

The return value.

200

Body

string

The mock return value.

[{\"key\":\"h68d13466.sqa.eu95\",\"dims\":\"groupName=All}]

Cors

object

Konfigurasi untuk cross-origin resource sharing (CORS).

Status

string

The status.

off

AllowOrigins

string

The origins allowed.

*

AllowMethods

string

The methods allowed.

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

AllowHeaders

string

The headers allowed.

*

ExposeHeaders

string

The response headers.

*

TimeUnit

string

The time unit.

s

UnitNum

integer

The unit number.

1

AllowCredentials

boolean

The credentials allowed.

true

Timeout

object

Konfigurasi waktu habis.

UnitNum

integer

The unit number.

10

TimeUnit

string

The time unit.

s

Status

string

The status.

off

Retry

object

Konfigurasi percobaan ulang.

Attempts

integer

The number of retries allowed for a request.

1

RetryOn

array

The retry condition.

string

The retry condition.

5xx

HttpCodes

array

The HTTP status code.

string

The HTTP status code.

500

Status

string

The retry status.

on

DomainIdList

array

Daftar ID domain.

integer

Daftar ID domain.

1

DomainNameList

array

Nama domain.

string

Nama domain.

test.com

Redirect

object

Konfigurasi pengalihan.

Code

integer

The response code returned.

200

Host

string

The hostname.

ww.al.c

Path

string

The path.

/

EnableWaf

boolean

Menunjukkan apakah WAF diaktifkan.

0

Contoh

Respons sukses

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
  }
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 IllegalRequest Invalid request:%s Invalid request: %s
400 InvalidParameter Parameter error:%s Request parameter error: %s
500 InternalError Console error. Try again later:%s Console error. Try again later: %s
403 NoPermission You are not authorized to perform this operation:%s You do not have the permission to use this interface:%s
404 NotFound Not found:%s The resource does not exist:%s

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.