tencent cloud

Cloud Object Storage

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Overview
Features
Use Cases
Strengths
Concepts
Regions and Access Endpoints
Specifications and Limits
Service Regions and Service Providers
Billing
Billing Overview
Billing Method
Billable Items
Free Tier
Billing Examples
Viewing and Downloading Bill
Payment Overdue
FAQs
Getting Started
Console
Getting Started with COSBrowser
User Guide
Creating Request
Bucket
Object
Data Management
Batch Operation
Global Acceleration
Monitoring and Alarms
Operations Center
Data Processing
Content Moderation
Smart Toolbox
Data Processing Workflow
Application Integration
User Tools
Tool Overview
Installation and Configuration of Environment
COSBrowser
COSCLI (Beta)
COSCMD
COS Migration
FTP Server
Hadoop
COSDistCp
HDFS TO COS
GooseFS-Lite
Online Tools
Diagnostic Tool
Use Cases
Overview
Access Control and Permission Management
Performance Optimization
Accessing COS with AWS S3 SDK
Data Disaster Recovery and Backup
Domain Name Management Practice
Image Processing
Audio/Video Practices
Workflow
Direct Data Upload
Content Moderation
Data Security
Data Verification
Big Data Practice
COS Cost Optimization Solutions
Using COS in the Third-party Applications
Migration Guide
Migrating Local Data to COS
Migrating Data from Third-Party Cloud Storage Service to COS
Migrating Data from URL to COS
Migrating Data Within COS
Migrating Data Between HDFS and COS
Data Lake Storage
Cloud Native Datalake Storage
Metadata Accelerator
GooseFS
Data Processing
Data Processing Overview
Image Processing
Media Processing
Content Moderation
File Processing Service
File Preview
Troubleshooting
Obtaining RequestId
Slow Upload over Public Network
403 Error for COS Access
Resource Access Error
POST Object Common Exceptions
API Documentation
Introduction
Common Request Headers
Common Response Headers
Error Codes
Request Signature
Action List
Service APIs
Bucket APIs
Object APIs
Batch Operation APIs
Data Processing APIs
Job and Workflow
Content Moderation APIs
Cloud Antivirus API
SDK Documentation
SDK Overview
Preparations
Android SDK
C SDK
C++ SDK
.NET(C#) SDK
Flutter SDK
Go SDK
iOS SDK
Java SDK
JavaScript SDK
Node.js SDK
PHP SDK
Python SDK
React Native SDK
Mini Program SDK
Error Codes
Harmony SDK
Endpoint SDK Quality Optimization
Security and Compliance
Data Disaster Recovery
Data Security
Cloud Access Management
FAQs
Popular Questions
General
Billing
Domain Name Compliance Issues
Bucket Configuration
Domain Names and CDN
Object Operations
Logging and Monitoring
Permission Management
Data Processing
Data Security
Pre-signed URL Issues
SDKs
Tools
APIs
Agreements
Service Level Agreement
Privacy Policy
Data Processing And Security Agreement
Contact Us
Glossary

Event Notifications

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2024-03-25 15:28:24

Overview

If any change is made to Cloud Object Storage (COS) resources (such as new files uploaded or files deleted), you will receive prompt notification. Event notification can be used together with Serverless Cloud Function (SCF) to meet the needs of more application scenarios:
Interaction with other Tencent Cloud services: For example, purge CDN cache or update the database when a new file is uploaded to COS.
System integration: Your own service APIs can be called when files in COS are created, deleted, or overwritten. In user-generated content (UGC) scenarios, with the event notification feature, the client side will be able to interact with the server side.
Data processing: Files in COS can be automatically processed, such as automatic decompression and AI recognition.
COS event notification

COS event notification has the following features:
Async processing: sending notifications does not affect normal COS operations.
Notification targets: notifications can only be sent to SCF functions in the same region.
Currently, an SCF function can be triggered by the following COS events:
Event Type
Description
cos: ObjectCreated:*
All upload events mentioned below
cos: ObjectCreated:Put
An object is created using the Put Object API
cos: ObjectCreated:Post
An object is created using the Post Object API
cos: ObjectCreated:Copy
An object is created using the Put Object - Copy API
cos: ObjectCreated:CompleteMultipartUpload
An object is created using the Complete Multipart Upload API
cos:ObjectCreated:Origin
Image origin-pull occurs
cos:ObjectCreated:Replication
An object is created using cross-region replication
cos: ObjectRemove:*
All deletion events mentioned below
cos: ObjectRemove:Delete
An object is deleted from an unversioned bucket using the Delete Object API, or an object with a specified version is deleted by specifying versionid
cos: ObjectRemove:DeleteMarkerCreated
An object is deleted from a versioning-enabled or versioning-suspended bucket using the Delete Object API
cos:ObjectRestore:Post
An ARCHIVE restoration job is created
cos:ObjectRestore:Completed
An ARCHIVE restoration job is completed


How to Use COS Event Notification

Please follow the steps below:
1. Create an SCF function
You can create a function in the SCF console or using the CLI. When creating the function, you need to select the runtime environment based on the language you will use to write the function and submit the function code either by editing online or uploading a local code package.
You can also use a preconfigured SCF template to simplify the creation. For more information, see Create a Function. The way to write the function varies by programming language. For more information, see the SCF documentation.
2. Test the function Once a function is created, you can test it with a test template which can simulate COS events and trigger the function. For more information, see Testing a Function.
3. Add a trigger After you finish the testing, you can bind the SCF function with a bucket by creating a COS trigger in the console or using the command line. For more information, see Creating a Trigger.
4. Check if the function works After completing the steps above, you can make changes to the bucket in COS to see if everything works. For example, you can upload or delete files via the console or COSBrowser. Then, go to the SCF console, choose Function Service, click the name of the target function, and click Log Query to check if everything works properly.
For more information on SCF COS triggers, see COS Trigger.

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan