Before you upload data such as documents, images, and audio or video files to Object Storage Service (OSS), you must create a bucket in an OSS region. OSS does not impose limits on the number of objects that you can upload to a bucket.
Buckets and objects are OSS resources. OSS provides API operations to manage these resources. For example, you can call API operations to create a bucket and upload objects to the bucket. You can also perform these operations in the OSS console. When you perform operations in the OSS console, OSS API operations are called to sent requests to OSS.
OSS does not use a hierarchical structure for objects, but instead uses a flat structure. All elements are stored as objects in buckets. However, OSS supports folders as a concept to group objects and simplify management. The name of a bucket is unique within OSS and cannot be modified after the bucket is created. For more information, see bucket naming conventions in Terms.
The following table lists supported operations related to buckets. For more information about operations related to objects, see Overview.
Before you can upload objects to OSS, you must create a bucket. The attributes of a bucket include the region, access control list (ACL), and other metadata.
When you create a bucket, you must select a region for the bucket based on your requirements on latency, costs, and compliance. For more information about the regions supported by OSS, see Regions and endpoints.
You can configure the ACL of a bucket when you create the bucket or modify the ACL of a created bucket. Only the owner of a bucket can configure or modify the ACL of the bucket.
You can call the GetBucketLocation operation to obtain the region of a bucket, which indicates the data center in which the bucket is located.
You can specify different filters to list all buckets or buckets whose names contain a specified prefix in a region.
You can use the bucket inventory feature to export the information about specific objects in a bucket, such as the number, sizes, storage classes, and encryption status of the objects. Compared with the GetBucket (ListObjects) operation, we recommend that you use the bucket inventory feature to list a large number of objects.
When pay-by-requester is enabled for a bucket, requesters pay the request and traffic fees that are incurred when the requesters access objects in the bucket. The bucket owner is still charged for the storage fees of the objects. You can enable pay-by-requester to share your data in OSS without having to pay for additional fees on your own.
After you upload objects to a bucket, OSS automatically generates URLs that include the public endpoint of the bucket for the uploaded objects. You can use these URLs to access the objects. If you want to access the objects by using custom domain names, you must map the custom domain names to the bucket in which the objects are stored and add CNAME records for the custom domain names.
OSS uses data centers distributed around the globe to implement transfer acceleration. When a request is sent to your bucket, it is resolved and routed to the data center where the bucket resides over the most optimal network path and protocol. The transfer acceleration feature provides an optimized end-to-end acceleration solution to access OSS over the Internet.
Cross-origin resource sharing (CORS) is a standard cross-origin solution provided by HTML5 to allow web application servers to control cross-origin access, which ensures the security of data transmission across origins.
OSS allows you to configure bucket tags to classify and manage buckets. For example, you can list buckets that have specific tags and configure ACL for buckets that have specific tags.
You can configure event notifications for specific objects in a bucket. When the specified events occur on the objects, you are notified as soon as possible.
After you configure lifecycle rules for a bucket, OSS converts the storage class of objects in the bucket to Infrequent Access (IA), Archive, Cold Archive, or deletes expired objects and parts on a regular basis to save storage costs.
After you configure real-time log query for a bucket, you can track requests that are sent to access the bucket. This feature allows you to collect access statistics, audit access to OSS, track exceptions, and troubleshoot problems. Real-time log query can improve your efficiency and help you make better decisions based on real-time data.
You can configure a time-based retention policy for a bucket. After the retention policy is locked, you can upload objects to the objects or read objects in the bucket. However, objects in the bucket and the retention policy cannot be deleted within the retention period. You can delete objects in the bucket only after the retention period expires.
You can configure bucket policies to authorize other users to access the specified OSS resources.
Configure data replication
You can replicate objects from a source bucket to a destination bucket. The source bucket and the destination bucket can be in the same region or different regions.
OSS allows you to configure versioning for a bucket to protect objects stored in the bucket. After you enable versioning for a bucket, objects that are overwritten or deleted in the bucket are saved as previous versions. You can use versioning to recover a previous version of an object that is accidentally overwritten or deleted.
You can delete a bucket that you no longer need.