You need to enable JavaScript to run this app.
文档中心
API 网关

API 网关

复制全文
下载 pdf
网关管理
UpdateGatewayLog - 更新网关日志配置
复制全文
下载 pdf
UpdateGatewayLog - 更新网关日志配置
更新网关日志配置。​
请求说明​
API 网关已在全球多个地域部署服务,旨在为您提供更稳定、低延迟的访问体验。您可以通过查阅 服务地址 文档,根据业务所在地域,选择最合适的接入点。​
  • 请求方式:POST​
  • 请求地址:https://apig.cn-beijing.volcengineapi.com?Action=UpdateGatewayLog&Version=2021-03-03​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
​
参数​
类型​
是否必选​
示例值​
描述​
Action​
String​
是​
UpdateGatewayLog​
接口名称。当前 API 的名称为 UpdateGatewayLog。​
Version​
String​
是​
2021-03-03​
接口版本。当前 API 的版本为 2021-03-03。​
Id​
String​
是​
gd8****​
网关实例 ID。​
LogSpec​
Object of LogSpec​
是​
-​
日志配置。​
​
LogSpec​
​
参数​
类型​
是否必选​
示例值​
描述​
Enable​
Boolean​
是​
true​
是否开启日志服务。取值:​
  • true:开启。​
  • false:不开启。​
ProjectId​
String​
是​
fc69****​
日志项目 ID。详情请参见 创建日志项目。​
说明​
当LogSpec.Enable值为 true 时,需要配置本参数。​
TopicId​
String​
否​
b****​
日志主题 ID,取值为空时会在当前项目中生成名称为“网关实例 ID - accessLog”的主题。详情请参见 创建日志主题。​
说明​
当LogSpec.Enable值为 true 时,需要配置本参数。​
SamplingSpec​
Object of LogSamplingSpec​
否​
-​
日志采样配置。​
​
LogSamplingSpec​
​
参数​
类型​
是否必选​
示例值​
描述​
Enabled​
Boolean​
是​
false​
是否开启日志采样。取值:​
  • true:开启。​
  • false:(默认值)不开启。​
Rules​
Array of LogSamplingRule​
否​
-​
按顺序生效的日志采样规则列表。最多支持配置 5 条。​
说明​
当LogSamplingSpec.Enable值为 true 时,需要配置本参数。​
​
LogSamplingRule​
​
参数​
类型​
是否必选​
示例值​
描述​
StatusCodes​
Array of Integer​
是​
[200, 201]​
命中的 HTTP 状态码列表。取值范围为 100~599。​
SamplingRatePermille​
Integer​
是​
100​
日志采样率,单位为 ‰。取值范围为 0~1000,当取值为 0 时不进行采集,取值为 1000 时进行全采集。​
​
请求示例​
​
POST https://apig.cn-beijing.volcengineapi.com?Action=UpdateGatewayLog&Version=2021-03-03​
Content-Type: application/json​
{​
"Id": "gd8****",​
"LogSpec": {​
"Enable": true,​
"TopicId": "b****",​
"ProjectId": "fc69****",​
"SamplingSpec": {​
"Rules": [​
{​
"StatusCodes": [​
200,​
201​
],​
"SamplingRatePermille": 100​
}​
],​
"Enabled": true​
}​
}​
}​
​
返回参数​
​
参数​
类型​
示例值​
描述​
Id​
String​
gd8****​
网关实例 ID。​
​
返回示例​
​
Content-Type: application/json​
{​
"ResponseMetadata": {​
"RequestId": "20230604110420****100232280022D31",​
"Action": "UpdateGatewayLog",​
"Version": "2021-03-03",​
"Service": "apig",​
"Region": "cn-beijing"​
},​
"Result": {​
"Id": "gd8****"​
}​
}​
​
错误码​
本接口无特有的错误码。更多信息请参见 公共错误码。​
最近更新时间:2026.09.02 10:02:49
这个页面对您有帮助吗?
有用
有用
无用
无用