Managing Object Versioning for an Object Storage Bucket
Enable or suspend object versioning on an Object Storage bucket.
By default, object versioning isn't enabled when you create a bucket. You can enable object versioning on an existing bucket. You can also suspend object versioning on a bucket where the feature is enabled. Versioning can't be disabled after it is enabled on a bucket. Versioning can only be suspended.
Object version is now enabled on the bucket. All later objects uploaded to the bucket are versioned.
Use the oci os bucket update command and required parameters to enable or suspend object versioning in a bucket. Include the
versioning
parameter and a value of eitherEnabled
orSuspended
:oci os bucket update --name bucket_name --versioning [Enabled | Suspended] [OPTIONS]
For example:
oci os bucket update --name MyBucket --versioning Enabled { "data": { "approximate-count": null, "approximate-size": null, "compartment-id": "ocid1.compartment.oc1..aaaaaaaamnk2ilreg5fkgu7rarfbbhdv3a5ji4eixxgkl4uprbqk6aefv5sq", "created-by": "ocid1.user.oc1..aaaaaaaah46lg3ueuftovn3urjgstlg4laxnre3djelu5jxy5uaqhgy7acgq", "defined-tags": { "Financials": { "key1": "nondefault" } }, "etag": "b8578b95-f37f-401f-ac4f-057b980ef680", "freeform-tags": {}, "id": "ocid1.bucket.oc1.phx.aaaaaaaabez242beorntix2tb4qfure2x7n3vpfmarcfqscrtgh3hplacg5q", "is-read-only": false, "kms-key-id": null, "metadata": {}, "name": "MyBucket", "namespace": "MyNamespace", "object-events-enabled": false, "object-level-audit-mode": "Disabled", "object-lifecycle-policy-etag": null, "public-access-type": "NoPublicAccess", "replication-enabled": false, "storage-tier": "Standard", "time-created": "2020-03-25T05:27:12.373000+00:00", "versioning": "Enabled" }, "etag": "b8578b95-f37f-401f-ac4f-057b980ef680" }
For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
Run the UpdateBucket operation. Include the
versioning
attribute with either theEnabled
orSuspended
value depending on whether you want to enable or suspend object versioning on the bucket.