CreateGatewayLogging - 创建网关日志监控

创建网关日志监控。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

hcs-sgw:CreateGatewayLogging

create

*全部资源

*

请求参数

名称

类型

必填

描述

示例值

GatewayId

string

网关 ID。

gw-000eg44nmxbsfw****

SlsProject

string

日志服务(SLS) Project。

alex****

SlsLogstore

string

日志服务(SLS) Logstore。

logs****

返回参数

名称

类型

描述

示例值

object

Message

string

请求结果描述。

successful

RequestId

string

请求 ID。

76109369-5729-467D-D4A3-1131A8DA****

Code

string

状态码。状态码为 200 表示请求成功。

200

Success

boolean

调用结果,返回值如下:

  • true:请求成功。

  • false:请求失败。

true

示例

正常返回示例

JSON格式

{
  "Message": "successful",
  "RequestId": "76109369-5729-467D-D4A3-1131A8DA****",
  "Code": "200",
  "Success": true
}

错误码

HTTP status code

错误码

错误信息

描述

400 EmptyGatewayId You must enter a valid ID for the gateway. 网关ID不能为空。
400 EmptySlsProject You must specify a valid project of Log Service. 日志服务(SLS)项目Project不能为空。
400 EmptySlsLogstore You must specify a valid Logstore of Log Service. 日志服务(SLS)日志库Logstore不能为空。
400 GatewayVersionNotAllowed The specified version for the gateway is invalid. You must specify a valid version. 网关版本不支持,请确认输入参数是否正确。
400 GatewayLoggingStatusNotAllowed Failed to perform the operation because log monitoring is not enabled. 网关日志监控状态不支持此操作,请检查后重试。
400 GatewayNotExist The specified gateway does not exist. You must specify a valid parameter. 网关不存在,请确认输入参数是否正确。
400 InvalidLogstore You must specify a valid project and Logstore of Log Service. The project and Logstore must reside in the same region as the gateway. You can use the project and Logstore to monitor logs. 请正确输入您在该网关所在地域用于日志监控的日志服务(SLS) project 和 logstore。
403 NoPermission Insufficient permissions. We recommend that you contact the administrator of the Alibaba Cloud account to grant the required permissions to you. 没有足够的权限,请联系云账号管理员授予您相应权限。
403 AssumeRoleFail Failed to perform cross-service authorization. Try again later. If the error persists after several tries, we recommend that you submit a ticket. 跨服务授权失败,请重试,如果多次尝试失败,请提交工单。
404 StorageBundleNotExist The name you specified for the gateway cluster does not exist. You must specify a valid parameter. 网关集群不存在,请确认输入参数是否正确。
404 RoleNotExist The role that Cloud Storage Gateway needs to obtain cross-service authorization does not exist. You must grant the required permissions to Cloud Storage Gateway. 云存储网关需要的跨服务授权角色不存在,请授予云存储网关服务相应权限。

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情