事件网格 EG-事件:事件批量发送

时间:2025-02-12 15:03:24

事件批量发送

事件批量发送请求体的示例如下:

{    "events":[{"id": "eg-test-001",    "specversion": "1.0","source": "HC.OBS","type": "object:put","datacontenttype": "application/json","subject": "xxx.jpg","time": "2022-01-17T12:07:48.955Z","data": {"name": "test01","state": "enable"}    },{"id": "eg-test-002","specversion": "1.0","source": "HC.OBS","type": "object:put","datacontenttype": "application/json","subject": "xxx.jpg","time": "2022-01-17T12:07:48.955Z","data": {"name": "test01","state": "enable"}    },{"id": "eg-test-003","specversion": "1.0","source": "HC.OBS","type": "object:put","datacontenttype": "application/json","subject": "xxx.jpg","time": "2022-01-17T12:07:48.955Z","data": {"name": "test01","state": "enable"}    },...]}

全部成功的返回体:

{"failed_count":0,"events":[{"error_code":null,"error_msg":null,"event_id":"eg-test-003"},{"error_code":null,"error_msg":null,"event_id":"eg-test-003"},{"error_code":null,"error_msg":null,"event_id":"eg-test-002"}]}

状态码:200

单条请求的事件数量超出限制的返回体:

{"failed_count":1,"events":[{"error_code":"00533013","error_msg":"Too many events for a request.","event_id":"eg-test-003"},{"error_code":null,"error_msg":null,"event_id":"eg-test-003"},{"error_code":null,"error_msg":null,"event_id":"eg-test-002"}]} 

状态码:400

单条事件的大小超出限制的返回体:

{"failed_count":3,"events":[{"error_code":00533012,"error_msg":An event is too large."event_id":"eg-test-003"},{"error_code":00533012,"error_msg":the number of events exceeds the limit,"event_id":"eg-test-003"},{"error_code":00533012,"error_msg":the number of events exceeds the limit,"event_id":"eg-test-002"}]}  

状态码:400

单条请求所有事件的总大小超出了限制

{"error_code":"00533007","error_msg":"The total size of a request's all events is too large.","error_detail":"The total size of a request's all events is too large."}{"error_code":"00533012","error_msg":"An event is too large.","error_detail":"An event is too large."}{"error_code":"00533013","error_msg":"Too many events for a request.","error_detail":"Too many events for a request."} 

状态码:400

状态码为400的情况:

  • 单条请求所有事件的总大小超出了限制。(错误码:EG.00533007;错误信息:The total size of a request's all events is too large)
  • 单条请求的事件数量超出了限制。(错误码:EG.00533013;错误信息:Too many events for a request)
support.huaweicloud.com/usermanual-eg/eg-ug-015.html