获取网关参数配置。
调试
您可以在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 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。