获取Bucket的通知规则
更新时间:2021-12-29
接口说明
本接口用于获取指定bucket上的通知规则。
请求URI
GET /v1/{bucketName}/?notification
参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 | 参数位置 |
---|---|---|---|---|---|
bucketName | String | 是 | bucket的名称 | "bucketName_example" | Path |
请求体参数
请求体字段数据结构说明
响应体参数
响应体字段数据结构说明
参数名称 | 参数类型 | 描述 | 示例值 |
---|---|---|---|
notifications | List<Notifications> |
Notifications字段数据结构说明
参数名称 | 参数类型 | 描述 | 示例值 |
---|---|---|---|
id | String | 规则id | notify-id-1 |
name | String | 规则名称 | rule-name |
appId | String | 注册本条规则的产品id | app-id-1 |
status | String | 可选值:{"disabled", "enabled"} | enabled |
resources | List<String> | 订阅的资源 | |
events | List<String> | 订阅的事件 | |
apps | List<Apps> | 订阅消息的产品 |
Apps字段数据结构说明
参数名称 | 参数类型 | 描述 | 示例值 |
---|---|---|---|
id | String | app-id-3 | |
eventUrl | String | app:ImageOcr | |
xVars | String | {"saveUrl": "http://xxx.com/ocr\"} |
请求示例
JSON
1GET /v1/bucketName_example/?notification
2<公共请求头>
3
4
5{ }
响应示例
JSON
1HTTP/1.1 200 OK
2<公共响应头>
3
4{
5 "notifications" : [ {
6 "appId" : "app-id-1",
7 "name" : "rule-name",
8 "resources" : [ "bucket-a/path1", "bucket-a/path1" ],
9 "id" : "notify-id-1",
10 "events" : [ "PutObject", "PutObject" ],
11 "status" : "enabled",
12 "apps" : [ {
13 "eventUrl" : "app:ImageOcr",
14 "xVars" : "{\"saveUrl\": \"http://xxx.com/ocr\"}",
15 "id" : "app-id-3"
16 }, {
17 "eventUrl" : "app:ImageOcr",
18 "xVars" : "{\"saveUrl\": \"http://xxx.com/ocr\"}",
19 "id" : "app-id-3"
20 } ]
21 }, {
22 "appId" : "app-id-1",
23 "name" : "rule-name",
24 "resources" : [ "bucket-a/path1", "bucket-a/path1" ],
25 "id" : "notify-id-1",
26 "events" : [ "PutObject", "PutObject" ],
27 "status" : "enabled",
28 "apps" : [ {
29 "eventUrl" : "app:ImageOcr",
30 "xVars" : "{\"saveUrl\": \"http://xxx.com/ocr\"}",
31 "id" : "app-id-3"
32 }, {
33 "eventUrl" : "app:ImageOcr",
34 "xVars" : "{\"saveUrl\": \"http://xxx.com/ocr\"}",
35 "id" : "app-id-3"
36 } ]
37 } ]
38}
错误码
请参考通用错误码