You need to enable JavaScript to run this app.
文档中心
对象存储

对象存储

复制全文
下载 pdf
事件通知
GetBucketNotification
复制全文
下载 pdf
GetBucketNotification
功能描述​
此接口用于获取指定存储桶(Bucket)设置的事件通知规则。​
注意事项​
  • 调用此接口您必须为桶所有者,或被授权当前桶的 GetBucketNotification 权限。​
  • 推荐使用GetBucketNotificationV2接口,该接口兼容 PutBucketNotification 接口创建的事件通知规则。​
  • 分层桶暂不支持 GetBucketNotification 接口。​
请求消息样式​
​
GET /?notification HTTP/1.1​
Host: bucketname.tos-cn-beijing.volces.com​
Date: GMT Date​
Authorization: authorization string​
​
请求参数与消息头​
​
名称​
位置​
参数类型​
是否必选​
示例值​
说明​
notification​
Query​
String​
是​
-​
代表 PutBucketNotification 请求的特殊标识。​
​
请求元素​
该请求无消息元素。​
响应消息头​
该请求返回的公共响应消息头,请参见公共参数。​
响应元素​
​
名称​
参数类型​
示例值​
说明​
CloudFunctionConfigurations​
Array​
-​
事件通知规则信息。​
Event​
Array​
[ "tos:ObjectCreated:Put"]​
需要通知的事件类型。TOS 支持的事件列表,请参见事件列表。​
父节点:CloudFunctionConfigurations​
Filter​
Container​
-​
设置的过滤规则。​
父节点:CloudFunctionConfigurations​
TOSKey​
Container​
-​
当前支持返回 FilterRule,即对象的过滤信息。​
父节点:Filter​
FilterRules​
Array​
[ { "Name": "prefix", "Value": "test_" }, { "Name": "suffix", "Value": ".jpg" } ]​
对象需要匹配的过滤规则。支持 prefix 和 suffix,即分别根据前缀和后缀规则对事件对象过滤。​
  • 如果同时设置了前缀与后缀规则,则事件需要同时满足二者,才会被通知。​
  • 如果前后缀均未设置,则会匹配存储桶内所有对象。​
父节点:TOSKey​
Name​
String​
suffix​
需要匹配的条件。取值说明如下:​
  • prefix:前缀。​
  • suffix:后缀。​
父节点:FilterRules​
Value​
String​
.jpg​
需要匹配的前后缀信息。​
父节点:FilterRules​
RuleId​
String​
TestNotification​
事件通知规则名称。​
父节点:CloudFunctionConfigurations​
CloudFunction​
String​
l2u0****​
事件投递的函数 ID。​
父节点:CloudFunctionConfigurations​
​
请求示例​
​
GET /?notification= HTTP/1.1​
Host: bucketname.tos-cn-beijing.volces.com​
Date: Fri, 30 Jul 2021 13:53:55 +0000​
Authorization: authorization string​
​
响应示例​
​
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"​
}​
]​
}​
​
​
最近更新时间:2025.09.05 15:47:27
这个页面对您有帮助吗?
有用
有用
无用
无用