Event notification
Updated at:2025-11-03
put_notification
This API sets notification rules for a specified bucket.
Note:
- Only the bucket owner or users with FULL_CONTROL permission can access this bucket's configuration.
- A 403 status will be returned if the requester is not the bucket owner, or a 404 status if the specified file does not exist.
For a detailed explanation of relevant parameters, please refer to [PutNotification API](BOS/API Reference/Bucket-Related Interface/Event notification/PutNotification.md).
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
This API retrieves notification rules for a specified bucket.
Python
1response = bos_client.get_notification(bucket_name)
delete_notification
This API is designed to delete notification rules for a specified bucket.
Note:
This API is used to delete all rules under the current bucket at one time
Python
1response = bos_client.delete_notification(bucket_name)
