事件通知
更新时间:2022-07-13
put_notification
本接口用于指定bucket上增加通知规则。
注意:
- 只有bucket owner或者full control权限才能获取这个bucket的配置。
- 如果不是bucket owner则返回403,如果对应的文件不存在则返回404。
相关参数的详细解释请参见PutNotification接口。
Python
1notifications = list()
2notifications.append(
3 {
4 "resources": [
5 "/"
6 ],
7 "encryption": {
8 "key": "06a62b70f47dc4a0a7da349609f1a1ac"
9 },
10 "status": "enabled",
11 "name": "name3",
12 "id": "r3",
13 "appId": "p3",
14 "events": [
15 "AppendObject",
16 "CompleteMultipartUpload",
17 "CopyObject",
18 "PutObject",
19 "PostObject",
20 "FetchObject",
21 "DeleteObject"
22 ],
23 "apps": [
24 {
25 "eventUrl": "http://www.liujiang.com",
26 "id": "ImageCensor",
27 "xVars": "{\"saveUrl\": \"http://xxx.com/ocr\"}"
28 }
29 ]
30 })
31response = bos_client.put_notification(bucket_name, notifications)
get_notification
本接口用于获取指定bucket上的通知规则。
Python
1response = bos_client.get_notification(bucket_name)
delete_notification
本接口用于删除指定bucket上的通知规则。
注意:
该接口为一次性全部删除当前bucket下全部规则
Python
1response = bos_client.delete_notification(bucket_name)