擷取網關參數配置。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
mse:GetGatewayConfig |
get |
*Gateway
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| GatewayUniqueId |
string |
是 |
網關唯一 ID |
gw-61f465fa2dd044069e2208c4912***** |
| AcceptLanguage |
string |
否 |
返回結果顯示的語言。取值:zh(預設值):中文,en:英文 |
zh |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
RestResult |
||
| RequestId |
string |
請求 ID。 |
F6092602-C357-4750-89D9-E572FBEA**** |
| Success |
boolean |
請求結果,取值如下:
|
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 |
作用於請求和響應環節,是否保持請求 header 頭大小寫, http1.1 規範中 header 頭不區分大小寫進行識別,為了保證與 http2 規範相容,預設會統一轉化為小寫。 |
true |
| DownstreamConnectionBufferLimits |
integer |
作用於網關串連,單條連結的 buffer 大小,配置後會影響吞吐和網關的記憶體使用量(單位: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 |
鏈路追蹤類型:
|
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,取值:
|
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 |
| NoSupportedConfigList |
string |
不支援的配置列表。 |
"EnableProxyProtocol,EnableCustomAuthConfigPush" |
| LogFilterConfig |
string |
未開放使用。 |
"" |
| EnableProxyProtocol |
boolean |
是否開啟 Proxy 協議,如果網關入口流量使用 NLB 接入,如果不開啟則無法擷取用戶端的真實 IP,開啟後對於非 Proxy 協議請求沒有影響。 |
true |
| EnableCustomAuthConfigPush |
string |
作用於使用自建的鑒權服務的情境,開啟後鑒權規則變更不會引起串連中斷,適用於 WebSocket 和線上業務情境。 |
false |
| KeepaliveHeaderTimeout |
integer |
用於產生 Keep-Alive 回應標頭返回給用戶端,告知串連的保活時間。例如配置為 10 時,會返迴響應頭: |
0 |
| WebsocketTermGracePeriod |
integer |
當網關執行個體升級、重啟等需要關閉串連的情境下,為 Websocket 串連維持的保活時間(單位:s)。 |
30 |
| EnableK8sSourceWorkloadFilter |
object |
||
| Enable |
boolean |
||
| LabelKey |
string |
||
| LabelValue |
string |
||
| FilterOpt |
string |
||
| EnableXffTrustedCidrs |
object |
||
| Enable |
boolean |
||
| IpListContent |
string |
||
| EnableGzipHardwareAccelerate |
boolean |
樣本
正常返回樣本
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": true,
"LabelKey": "",
"LabelValue": "",
"FilterOpt": ""
},
"EnableXffTrustedCidrs": {
"Enable": true,
"IpListContent": ""
},
"EnableGzipHardwareAccelerate": true
}
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | IllegalRequest | Invalid request:%s | 非法請求: %s |
| 400 | InvalidParameter | Parameter error:%s | 請求參數錯誤:%s |
| 500 | InternalError | Console error. Try again later:%s | 控制台錯誤.稍後重試:%s |
| 403 | NoPermission | You are not authorized to perform this operation:%s | 沒有許可權使用此介面:%s |
| 404 | NotFound | Not found:%s | 資源不存在:%s |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。