Event Type | Description |
cos:ObjectCreated:* | All upload events mentioned below can trigger the function. |
cos:ObjectCreated:Put | The function will be triggered when a file is created through the `Put Object` API. |
cos:ObjectCreated:Post | The function will be triggered when a file is created through the `Post Object` API. |
cos:ObjectCreated:Copy | The function will be triggered when a file is created through the `Put Object - Copy` API. |
cos:ObjectCreated:CompleteMultipartUpload | The function will be triggered when a file is created through the `CompleteMultipartUpload` API. |
cos:ObjectCreated:Origin | |
cos:ObjectCreated:Replication | The function will be triggered when an object is created through cross-region replication. |
cos:ObjectRemove:* | All deletion events mentioned below can trigger the function. |
cos:ObjectRemove:Delete | The function will be triggered when an object in a bucket for which versioning is not enabled is deleted through the `Delete Object` API, or an object on a specified version is deleted with `versionid`. |
cos:ObjectRemove:DeleteMarkerCreated | The function will be triggered when an object in a bucket for which versioning is enabled or suspended is deleted through the `Delete Object` API. |
cos:ObjectRestore:Post | The function will be triggered when an archive restoration job is created. |
cos:ObjectRestore:Completed | The function will be triggered when an archive restoration job is completed. |
test/
, only file events in the test/
directory can trigger the function, while those in the hello/
directory cannot..jpg
, only file events of the .jpg
type can trigger the function, while those of the .png/
type cannot.Created: *
event trigger in the test bucket for function A (with no filter rule configured), then the upload events (including Created:Put
and Created:Post
) in the test bucket cannot be bound to other functions, but you can configure an ObjectRemove
event trigger in the test bucket for function B.Created: *
trigger event with prefix filter of Log
in the test bucket for function A, then you cannot configure a Created: *
trigger event with prefix filter of Log
in the test bucket.{"Records": [{"cos": {"cosSchemaVersion": "1.0","cosObject": {"url": "http://testpic-1253970026.cos.ap-chengdu.myqcloud.com/testfile","meta": {"x-cos-request-id": "NWMxOWY4MGFfMjViMjU4NjRfMTUyMVxxxxxxxxx=","Content-Type": "","x-cos-meta-mykey": "myvalue"},"vid": "","key": "/1253970026/testpic/testfile","size": 1029},"cosBucket": {"region": "cd","name": "testpic","appid": "1253970026"},"cosNotificationId": "unkown"},"event": {"eventName": "cos:ObjectCreated:*","eventVersion": "1.0","eventTime": 1545205770,"eventSource": "qcs::cos","requestParameters": {"requestSourceIP": "192.168.15.101","requestHeaders": {"Authorization": "q-sign-algorithm=sha1&q-ak=xxxxxxxxxxxxxx&q-sign-time=1545205709;1545215769&q-key-time=1545205709;1545215769&q-header-list=host;x-cos-storage-class&q-url-param-list=&q-signature=xxxxxxxxxxxxxxx"}},"eventQueue": "qcs:0:scf:cd:appid/1253970026:default.printevent.$LATEST","reservedInfo": "","reqid": 179398952}}]}
Structure | Description |
Records | List structure. There may be multiple messages merged in the list. |
event | This records the event information, including event version, event source, event name, time, queue information, request parameters, and request ID. |
cos | This records the COS information corresponding to the event. |
cosBucket | This records the bucket of the specific event, including bucket name, region, and user APPID (which can be obtained on the Account Info page). |
cosObject | This records the object of the specific event, including object file path, size, custom metadata, and access URL. |
https://github.com/tencentyun/scf-demo-java/blob/master/src/main/java/example/Cos.java
Was this page helpful?