Configuring Object Versioning

If versioning is enabled, multiple versions of an object can be saved in a bucket. You must manually enable versioning for your bucket because versioning is disabled by default. No matter you enable versioning or not, each object in your bucket owns a version ID. If you disable versioning, OBS sets the version ID to null. If you enable versioning, OBS specifies a unique version ID for an object. When versioning is enabled for a bucket, no change occurs in the existing objects (if there are) in the bucket. Their version IDs (null), contents, and permissions remain unchanged.

When you use PUT to add an object to a bucket whose versioning is enabled, versions other than the current version are not overwritten. As shown in the following figure, when you upload object photo.gif by using PUT to a bucket containing a namesake object, the earlier object is saved as the object with the version ID (111111), and OBS generates the version ID (121212) for the new object and add the new object to the bucket.

The versioning function prevents you from mistakenly overwriting or deleting objects and makes objects of earlier versions available for you.