You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
Event Notification
GetBucketNotification
Copy page
Download PDF
GetBucketNotification
Feature description​
This API retrieves the event notification rules set for a specified bucket.​
Notes​
  • To call this API, you must be the bucket owner or have the GetBucketNotification permission for the current bucket.​
  • It is recommended to use the GetBucketNotificationV2 API, which is compatible with event notification rules created by the PutBucketNotification API.​
  • HNS buckets do not support the GetBucketNotification API.​
Request syntax​
​
GET /?notification HTTP/1.1​
Host: bucketname.tos-cn-beijing.volces.com​
Date: GMT Date​
Authorization: authorization string​
​
Request parameters and headers​
​
Name​
Location​
type​
Required​
Sample value​
Note​
notification​
Query​
String​
Yes​
-​
Special identifier representing the PutBucketNotification request.​
​
Request elements​
This request has no message elements.​
Response headers​
The common response headers returned by this request. See Common Parameters.​
Response body elements​
​
Name​
Type​
Sample value​
Note​
CloudFunctionConfigurations​
Array​
-​
Information on the event notification rule.​
Event​
Array​
[ "tos:ObjectCreated:Put"]​
Types of events that require notification. For a list of types supported by TOS, see Supported event types.​
Parent node: CloudFunctionConfigurations​
Filter​
Container​
-​
Configured filter rules.​
Parent node: CloudFunctionConfigurations​
TOSKey​
Container​
-​
Currently supports returning FilterRule, which is the object's filter information.​
Parent node: Filter​
FilterRules​
Array​
[ { "Name": "prefix", "Value": "test_" }, { "Name": "suffix", "Value": ".jpg" } ]​
filter rules that the object needs to match. Supports prefix and suffix, which filter event objects according to prefix and suffix rules respectively.​
  • When both prefix and suffix rules are set, the event must meet both conditions to trigger notification.​
  • if neither a prefix nor a suffix is set, all objects in the bucket will be matched.​
parent node: TOSKey​
Name​
String​
suffix​
Conditions to match. The options are as follows:​
  • prefix: prefix.​
  • suffix: suffix.​
Parent node: FilterRules​
Value​
String​
.jpg​
prefix and suffix information to match.​
parent node: FilterRules​
RuleId​
String​
TestNotification​
Name of the event notification rule.​
Parent node: CloudFunctionConfigurations​
CloudFunction​
String​
l2u0****​
Function ID for event delivery.​
Parent node: CloudFunctionConfigurations​
​
Sample request​
​
GET /?notification= HTTP/1.1​
Host: bucketname.tos-cn-beijing.volces.com​
Date: Fri, 30 Jul 2021 13:53:55 +0000​
Authorization: authorization string​
​
Sample response​
​
HTTP/1.1 200 OK​
Content-Length: 259​
Content-Type: application/json​
Date: Wed, 17 May 2023 12:18:08 GMT​
Server: TosServer​
X-Tos-Id-2: b2cb0164c600cacd6464c600-ac1023d1-1pzG6a-GBN-cgb-tos​
X-Tos-Request-Id: b2cb0164c600cacd6464c600-ac1023d1-1pzG6a-GBN-cgb-tos​
X-Tos-Server-Time: 7​
{​
"CloudFunctionConfigurations": [​
{​
"Events": [​
"tos:ObjectCreated:Put"​
],​
"Filter": {​
"TOSKey": {​
"FilterRules": [​
{​
"Name": "prefix",​
"Value": "test-"​
},​
{​
"Name": "suffix",​
"Value": ".jpg"​
}​
]​
}​
},​
"RuleId": "TestNotification",​
"CloudFunction": "cloudFunctionID"​
}​
]​
}​
​
​
Last updated: 2025.09.08 17:32:47