Editing an Object Storage Retention Rule

Update a retention rule for an Object Storage bucket.

You can get the retention rule's ID by running the list command. See Listing Object Storage Retention Rules.

    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. This is the compartment where the bucket you create is located.
    3. Click the bucket for which you're creating a retention rule. The bucket's Details page appears.
    4. Click Retention Rules under Resources. The Retention Rules list appears. All retention rules are listed in tabular form.
    5. Click the Actions menu (Actions Menu) next to the retention rule, and then click select Edit. The Edit Retention Rule dialog box appears.
    6. Make your edits. See Creating a Retention Rule for descriptions of the settings.
    7. Click Save Changes.
  • Use the oci os retention-rule update command and required parameters to edit a retention rule for a bucket:

    oci os retention-rule update --bucket-name bucket_name --retention-rule-id retention_rule_id [OPTIONS]

    For example:

    oci os retention-rule update --bucket-name MyBucket --retention-rule-id b1a6c84c-57c4-416c-b006-f864b0904c9e --time-amount 6 --time-unit years --time-rule-locked "2020-04-30 00:00"
    {
      "data": {
        "display-name": "RegulatoryCompliance",
        "duration": {
          "time-amount": 6,
          "time-unit": "YEARS"
        },
        "etag": "700ada5c-6a2a-4c6c-acb6-4ebb173e0f8f",
        "id": "b1a6c84c-57c4-416c-b006-f864b0904c9e",
        "time-created": "2020-03-25T15:11:44.423000+00:00",
        "time-modified": "2020-03-25T15:46:28.724000+00:00",
        "time-rule-locked": "2020-04-30T00:00:00+00:00"
      },
      "etag": "700ada5c-6a2a-4c6c-acb6-4ebb173e0f8f"
    }

    In this example, the retention rule has been updated to include values for time-amount, time-unit, and time-rule-locked.

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • Run the UpdateRetentionRule operation to edit a retention rule for a bucket.