全部產品
Search
文件中心

Microservices Engine:GetGatewayConfig

更新時間:Jul 15, 2026

取得閘道器參數設定。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

mse:GetGatewayConfig

get

*Gateway

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

請求參數

名稱

類型

必填

描述

樣本值

GatewayUniqueId

string

閘道器唯一 ID。

gw-61f465fa2dd044069e2208c4912*****

AcceptLanguage

string

返回結果顯示的語言。取值:zh(預設值):中文,en:英文。

zh

返回參數

名稱

類型

描述

樣本值

object

RestResult

RequestId

string

請求 ID。

F6092602-C357-4750-89D9-E572FBEA****

Success

boolean

請求結果,取值如下:

  • true:請求成功。

  • false:請求失敗。

true

Code

integer

code 僅用來與 success 同步。

200

ErrorCode

string

錯誤碼。

Success

HttpStatusCode

integer

HTTP 狀態碼。

200

Message

string

回應資訊。

OK

DynamicCode

string

尚未使用,請忽略。

code

DynamicMessage

string

尚未使用,請忽略。

The specified parameter is invalid.

Data

object

資料概覽。

GatewayUniqueId

string

閘道器唯一 ID。

gw-61f465fa2dd044069e2208c4912*****

EnableGenerateRequestId

boolean

作用於請求範圍,根據設定會在請求標頭中產生 requestId,以便追蹤請求。

true

EnableGzip

boolean

作用於請求與回應環節,啟用 gzip 會對請求回應進行壓縮,會減少閘道器流量,增加閘道器 CPU 消耗。

false

EnableSlashMerge

boolean

作用於請求環節,是否合併請求中多餘的「/」,開啟後 www.a.com//b 多餘的「/」會被合併,將會與 www.a.com/b 一致。

true

DownstreamIdleTime

integer

作用於閘道器連線,用戶端到閘道器處於指定的時間內沒有請求,則會斷開連結。

180

PreserveHeaderFormat

boolean

作用於請求和回應環節,是否保持請求標頭大小寫,http1.1 規範中标頭不區分大小寫進行識別,為了保證與 http2 規範相容,預設會統一轉換為小寫。

true

DownstreamConnectionBufferLimits

integer

作用於閘道器連線,單條連結的緩衝區大小,設定後會影響吞吐量和閘道器的記憶體使用量(單位:Byte)。

32768

EnableHardwareAccelerate

boolean

是否開啟硬體加速(若您的地域處於底層不支援地域,或購買時未指定硬體加速會生效失敗)。

true

XffTrustedNum

integer

作用於請求環節,閘道器前可信任的代理個數,會影響閘道器是否會使用用戶端產生的 x-forwarded-for 和 x-request-id 等請求標頭。

0

EnableHttp2

boolean

作用於請求環節,伺服器端與用戶端協商時是否使用 http2(修改後 1~2 分鐘後生效)。

false

DownstreamHttp2MaxConcurrentStream

integer

作用於請求環節,用戶端使用 http2 時一條連結上最大並行數。

100

InitialStreamWindowSize

integer

作用於請求環節,閘道器同用戶端使用 http2 時協商的 stream 初始視窗大小(單位:Byte)。

65535

InitialConnectionWindowSize

integer

作用於請求環節,閘道器同用戶端使用 http2 時連線層級初始視窗大小(單位:Byte)。

1048576

XtraceDetails

object

鏈路追蹤資訊。

TraceOn

boolean

是否開啟鏈路追蹤。

true

Id

integer

鏈路追蹤資訊 ID。

255

Sample

integer

採樣率(%)。

100

GatewayId

integer

網關 ID。

500

GatewayUniqueId

string

網關唯一 ID。

gw-61f465fa2dd044069e2208c4912*****

GmtCreate

string

鏈路追蹤資訊建立時間。

2024-08-12T09:39:07.000+0000

GmtModified

string

鏈路追蹤資訊修改時間。

2024-08-12T09:39:07.000+0000

TraceType

string

鏈路追蹤類型:

  • XTRACE:可觀測鏈路 OpenTelemetry 版,鏈路追蹤協議 Zipkin

  • SKYWALKING:自建 Skywalking

  • OPENTELEMETRY:可觀測鏈路 OpenTelemetry 版,鏈路追蹤協議 OpenTelemetry

  • OTSKYWALKING:可觀測鏈路 OpenTelemetry 版,鏈路追蹤協議 Skywalking

OPENTELEMETRY

ServiceId

integer

自建 Skywalking,Skywalking 服務 ID。

333

ServicePort

string

自建 Skywalking,Skywalking 服務連接埠。

8888

SlsConfigDetails

object

日誌投遞資訊。

LogOn

boolean

是否開啟日誌投遞。

true

Id

integer

未開放使用。

0

ProjectName

string

日誌投遞目標 Project

test

LogStoreName

string

日誌投遞目標 Logstore,取值:

  • 未開啟相容 Nginx Ingress:mse_gw_access_log

  • 開啟相容 Nginx Ingress:nginx-ingress

mse_gw_access_log

GatewayUniqueId

string

網關唯一 ID。

gw-61f465fa2dd044069e2208c4912*****

GatewayId

integer

網關 ID。

500

GmtCreate

string

未開放使用。

""

GmtModified

string

未開放使用。

""

NginxCompatible

boolean

是否開啟相容 Nginx Ingress

false

SupportWaf

boolean

閘道器是否支援 WAF。

true

EnableWaf

boolean

是否開啟 WAF。

true

AccessLogHeader

string

自訂日誌格式。

{"requestMetadata":[],"responseHeaders":[],"requestHeaders":["x-test"],"responseMetadata":[]}

EnableHttp3

boolean

是否支援 http3 協定。

false

UpstreamIdleTimeout

integer

預設到上游的 idle 時間。

30

ZipAlgorithm

string

開啟壓縮後使用的演算法,可以選擇 brotli、gzip,如果此時 EnableGzip 未開啟,將自動開啟 EnableGzip 選項。

["gzip"]

PathWithEscapedSlashes

string

確定 URI 路徑中包含 %2F、%2f、%5C 或 %5c 這些逸出字元的請求的操作,預設為 KEEP_UNCHANGED(保持不變)

取值:

  • KEEP_UNCHANGED

  • REJECT_REQUEST

  • UNESCAPE_AND_REDIRECT

  • UNESCAPE_AND_FORWARD

KEEP_UNCHANGED

NoSupportedConfigList

string

不支援的設定清單。

"EnableProxyProtocol,EnableCustomAuthConfigPush"

LogFilterConfig

string

未開放使用。

""

EnableProxyProtocol

boolean

是否開啟 Proxy 協定,如果閘道器入口流量使用 NLB 接入,如果不開啟則無法取得用戶端的真實 IP,開啟後對於非 Proxy 協定請求沒有影響。

true

EnableCustomAuthConfigPush

string

作用於使用自建的驗證服務的場景,開啟後驗證規則變更不會引起連線中斷,適用於 WebSocket 和線上業務場景。

false

KeepaliveHeaderTimeout

integer

用於產生 Keep-Alive 回應標頭返回給用戶端,告知連線的保活時間。例如設定為 10 時,會返回回應標頭:keep-alive: timeout=10。設定為 0 時,不會返回該回應標頭。

0

WebsocketTermGracePeriod

integer

當閘道器執行個體升級、重新啟動等需要關閉連線的場景下,為 Websocket 連線維持的保活時間(單位:s)。

30

EnableK8sSourceWorkloadFilter

object

Enable

boolean

LabelKey

string

LabelValue

string

FilterOpt

string

EnableXffTrustedCidrs

object

Enable

boolean

IpListContent

string

EnableGzipHardwareAccelerate

boolean

PreserveExternalRequestID

boolean

LiteMetrics

boolean

LogRequestResponseConfig

string

樣本

正常返回樣本

JSON格式

{
  "RequestId": "F6092602-C357-4750-89D9-E572FBEA****",
  "Success": true,
  "Code": 200,
  "ErrorCode": "Success",
  "HttpStatusCode": 200,
  "Message": "OK",
  "DynamicCode": "code",
  "DynamicMessage": "The specified parameter is invalid.",
  "Data": {
    "GatewayUniqueId": "gw-61f465fa2dd044069e2208c4912*****",
    "EnableGenerateRequestId": true,
    "EnableGzip": false,
    "EnableSlashMerge": true,
    "DownstreamIdleTime": 180,
    "PreserveHeaderFormat": true,
    "DownstreamConnectionBufferLimits": 32768,
    "EnableHardwareAccelerate": true,
    "XffTrustedNum": 0,
    "EnableHttp2": false,
    "DownstreamHttp2MaxConcurrentStream": 100,
    "InitialStreamWindowSize": 65535,
    "InitialConnectionWindowSize": 1048576,
    "XtraceDetails": {
      "TraceOn": true,
      "Id": 255,
      "Sample": 100,
      "GatewayId": 500,
      "GatewayUniqueId": "gw-61f465fa2dd044069e2208c4912*****",
      "GmtCreate": "2024-08-12T09:39:07.000+0000",
      "GmtModified": "2024-08-12T09:39:07.000+0000",
      "TraceType": "OPENTELEMETRY",
      "ServiceId": 333,
      "ServicePort": "8888"
    },
    "SlsConfigDetails": {
      "LogOn": true,
      "Id": 0,
      "ProjectName": "test",
      "LogStoreName": "mse_gw_access_log",
      "GatewayUniqueId": "gw-61f465fa2dd044069e2208c4912*****\n",
      "GatewayId": 500,
      "GmtCreate": "\"\"",
      "GmtModified": " \"\"",
      "NginxCompatible": false
    },
    "SupportWaf": true,
    "EnableWaf": true,
    "AccessLogHeader": "{\"requestMetadata\":[],\"responseHeaders\":[],\"requestHeaders\":[\"x-test\"],\"responseMetadata\":[]}",
    "EnableHttp3": false,
    "UpstreamIdleTimeout": 30,
    "ZipAlgorithm": "[\"gzip\"]",
    "PathWithEscapedSlashes": "KEEP_UNCHANGED",
    "NoSupportedConfigList": "\"EnableProxyProtocol,EnableCustomAuthConfigPush\"",
    "LogFilterConfig": " \"\"",
    "EnableProxyProtocol": true,
    "EnableCustomAuthConfigPush": "false",
    "KeepaliveHeaderTimeout": 0,
    "WebsocketTermGracePeriod": 30,
    "EnableK8sSourceWorkloadFilter": {
      "Enable": false,
      "LabelKey": "",
      "LabelValue": "",
      "FilterOpt": ""
    },
    "EnableXffTrustedCidrs": {
      "Enable": false,
      "IpListContent": ""
    },
    "EnableGzipHardwareAccelerate": false,
    "PreserveExternalRequestID": false,
    "LiteMetrics": false,
    "LogRequestResponseConfig": ""
  }
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 IllegalRequest Invalid request:%s
400 InvalidParameter Parameter error:%s
500 InternalError Console error. Try again later:%s
403 NoPermission You are not authorized to perform this operation:%s
404 NotFound Not found:%s

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情