事件网格 EG-发布官方事件到事件通道:请求参数

时间:2023-12-12 17:25:43

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

用户Token。通过调用 IAM 服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

最小长度:1

最大长度:16384

表3 请求Body参数

参数

是否必选

参数类型

描述

events

Array of CloudEvents objects

CloudEvents事件格式定义,参考https://github.com/cloudevents/spec/blob/v1.0.1/spec.md

表4 CloudEvents

参数

是否必选

参数类型

描述

id

String

事件唯一标识串,同一个事件来源里必须唯一

source

String

事件来源上下文标识串,source+id可以唯一确定一个事件。采用URI-Reference格式,参考https://tools.ietf.org/html/rfc3986#section-4.1

specversion

String

CloudEvents协议版本,格式为major.minor

type

String

事件类型

datacontenttype

String

事件内容格式,采用MIME格式,遵循RFC2046,参考https://tools.ietf.org/html/rfc2046

dataschema

String

事件内容模型定义的URI,遵循RFC3986,参考https://tools.ietf.org/html/rfc3986#section-4.3

data

Object

事件的负载内容,采用datacontenttype字段指定的格式,内容字段遵循dataschema字段的描述

time

String

事件发生UTC日期时间,相同来源的事件格式相同,遵循RFC3339,格式需满足2018-04-05T17:31:00Z,参考https://tools.ietf.org/html/rfc3339

subject

String

事件发生的主题或对象,用以标识哪个具体对象发生了当前事件

support.huaweicloud.com/api-eg/PutOfficialEvents.html