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.

    1. Open the navigation menu and click Storage. Under Object Storage & Archive Storage, click Buckets.
    2. Select the compartment from the list under List Scope. All buckets in that compartment are listed in tabular form.
    3. Click the bucket on which you want to enable object versioning. The bucket's Details page appears.
    4. Find Object Versioning under Features. If object versioning is listed as Enabled, no further action is required. If object versioning is listed as Disabled or Suspended, click Edit. The Object Versioning dialog box appears.
    5. Click Enable Versioning.

    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 either Enabled or Suspended:

    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 the Enabled or Suspended value depending on whether you want to enable or suspend object versioning on the bucket.