云服务器内容精选
-
请求示例 创建自定义事件通道 POST https://{endpoint}/v1/{project_id}/channels { "name" : "channel", "description" : "first channel", "enterprise_project_id" : "string", "cross_account" : true, "policy" : { "additionalProp1" : { "Sid" : "allow_account_to_put_events", "Effect" : "Allow", "Principal" : { "additionalProp1" : { " IAM " : [ "domainID" ] }, "additionalProp2" : { "IAM" : [ "domainID" ] }, "additionalProp3" : { "IAM" : [ "domainID" ] } }, "Action" : "eg:channels:putEvents", "Resource" : "urn:eg:cn-east-2:07d52e5245000fef0f08c008b20dc5c0:channel:testChannel" }, "additionalProp2" : { "Sid" : "allow_account_to_put_events", "Effect" : "Allow", "Principal" : { "additionalProp1" : { "IAM" : [ "domainID" ] }, "additionalProp2" : { "IAM" : [ "domainID" ] }, "additionalProp3" : { "IAM" : [ "domainID" ] } }, "Action" : "eg:channels:putEvents", "Resource" : "urn:eg:cn-east-2:07d52e5245000fef0f08c008b20dc5c0:channel:testChannel" }, "additionalProp3" : { "Sid" : "allow_account_to_put_events", "Effect" : "Allow", "Principal" : { "additionalProp1" : { "IAM" : [ "domainID" ] }, "additionalProp2" : { "IAM" : [ "domainID" ] }, "additionalProp3" : { "IAM" : [ "domainID" ] } }, "Action" : "eg:channels:putEvents", "Resource" : "urn:eg:cn-east-2:07d52e5245000fef0f08c008b20dc5c0:channel:testChannel" } } }
-
请求参数 表3 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 表4 请求Body参数 参数 是否必选 参数类型 描述 name 是 String 通道名称,租户下唯一,由字母,数字,点,下划线和中划线组成,必须字母或数字开头,不能是default description 否 String 通道描述 enterprise_project_id 否 String 企业项目id cross_account 否 Boolean 跨账号开关 policy 否 Object 策略
-
响应参数 状态码:200 表5 响应Header参数 参数 参数类型 描述 X-Request-Id String This field is the request ID number for task tracking. Format is request_uuid-timestamp-hostname. 表6 响应Body参数 参数 参数类型 描述 id String 通道ID name String 通道名称 description String 通道描述 provider_type String 通道提供方类型,OFFICIAL:官方事件通道;CUSTOM:自定义事件通道;PARTNER:伙伴事件通道 created_time String 创建UTC时间 updated_time String 更新UTC时间 enterprise_project_id String 企业项目id
-
响应示例 状态码:200 Demo Information { "id" : "bd14144e-8f3c-43d6-bdfd-bf09b52c2b96", "name" : "channel", "description" : "first channel", "provider_type" : "CUSTOM", "created_time" : "2021-12-09 09:00:00", "updated_time" : "2021-12-09 09:00:00", "enterprise_project_id" : "string" }
-
响应示例 状态码: 400 { "error_code" : "EG.00014000", "error_msg" : "Bad request"} 状态码: 401 { "error_code" : "EG.00014010", "error_msg" : "Incorrect token or token resolution failed"} 状态码: 403 { "error_code" : "EG.00014030", "error_msg" : "No permissions to request this method"} 状态码: 404 { "error_code" : "EG.00014040", "error_msg" : "Not request resource found"} 状态码: 500 { "error_code" : "EG.00015000", "error_msg" : "Internal Server Error"}
-
响应参数 状态码: 400 表4 响应Body参数 参数 参数类型 描述 error_code String 错误码 最小长度:1 最大长度:128 error_msg String 错误消息 最小长度:1 最大长度:512 error_details String 具体错误消息 最小长度:1 最大长度:1024 request_id String 请求处理ID 最小长度:1 最大长度:128 状态码: 401 表5 响应Body参数 参数 参数类型 描述 error_code String 错误码 最小长度:1 最大长度:128 error_msg String 错误消息 最小长度:1 最大长度:512 error_details String 具体错误消息 最小长度:1 最大长度:1024 request_id String 请求处理ID 最小长度:1 最大长度:128 状态码: 403 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 最小长度:1 最大长度:128 error_msg String 错误消息 最小长度:1 最大长度:512 error_details String 具体错误消息 最小长度:1 最大长度:1024 request_id String 请求处理ID 最小长度:1 最大长度:128 状态码: 404 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码 最小长度:1 最大长度:128 error_msg String 错误消息 最小长度:1 最大长度:512 error_details String 具体错误消息 最小长度:1 最大长度:1024 request_id String 请求处理ID 最小长度:1 最大长度:128 状态码: 500 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码 最小长度:1 最大长度:128 error_msg String 错误消息 最小长度:1 最大长度:512 error_details String 具体错误消息 最小长度:1 最大长度:1024 request_id String 请求处理ID 最小长度:1 最大长度:128