Skip to main content

Update an S3 bucket configuration for an SVM

Contributors

PATCH /protocols/s3/services/{svm.uuid}/buckets/{uuid}

Introduced In: 9.7

Updates the S3 bucket configuration of an SVM.

Important notes

  • The following fields can be modified for a bucket:

    • comment - Any information related to the bucket.

    • size - Bucket size.

    • policy - An access policy for resources (buckets and objects) that defines their permissions. New policies are created after existing policies are deleted. To retain any of the existing policy statements, you need to specify those statements again. Policy conditions can also be modified using this API.

    • qos_policy - A QoS policy for buckets.

    • audit_event_selector - Audit policy for buckets. None can be specified for both access and permission to remove audit event selector.

    • versioning_state - Versioning state for buckets.

    • nas_path - NAS path to which the NAS bucket corresponds to.

    • retention.default_period - Specifies the duration of default-retention applicable for objects on the object store bucket.

  • vserver object-store-server bucket modify

  • vserver object-store-server bucket policy statement modify

  • vserver object-store-server bucket policy-statement-condition modify

Parameters

Name Type In Required Description

uuid

string

path

True

The unique identifier of the bucket.

return_timeout

integer

query

False

The number of seconds to allow the call to execute before returning. When doing a POST, PATCH, or DELETE operation on a single record, the default is 0 seconds. This means that if an asynchronous operation is started, the server immediately returns HTTP code 202 (Accepted) along with a link to the job. If a non-zero value is specified for POST, PATCH, or DELETE operations, ONTAP waits that length of time to see if the job completes so it can return something other than 202.

  • Default value: 1

  • Max value: 120

  • Min value: 0

svm.uuid

string

path

True

UUID of the SVM to which this object belongs.

Request Body

Name Type Description

aggregates

array[aggregates]

A list of aggregates for FlexGroup volume constituents where the bucket is hosted. If this option is not specified, the bucket is auto-provisioned as a FlexGroup volume. The "uuid" field cannot be used with the field "storage_service_level".

audit_event_selector

audit_event_selector

Event selector allows you to specify access and permission types to audit.

comment

string

Can contain any additional information about the bucket being created or modified.

constituents_per_aggregate

integer

Specifies the number of constituents or FlexVol volumes per aggregate. A FlexGroup volume consisting of all such constituents across all specified aggregates is created. This option is used along with the aggregates option and cannot be used independently. This field cannot be set using the PATCH method.

encryption

encryption

lifecycle_management

lifecycle_management

Lifecycle management is implemented as an object associated with a bucket. It defines rules to be applied against objects within a bucket. These rules are applied in the background and can delete objects.

logical_used_size

integer

Specifies the bucket logical used size up to this point. This field cannot be set using the PATCH method.

name

string

Specifies the name of the bucket. Bucket name is a string that can only contain the following combination of ASCII-range alphanumeric characters 0-9, a-z, ".", and "-".

nas_path

string

Specifies the NAS path to which the nas bucket corresponds to.

policy

policy

A policy is an object associated with a bucket. It defines resource (bucket, folder, or object) permissions. These policies get evaluated when an S3 user makes a request by executing a specific command. The user must be part of the principal (user or group) specified in the policy. Permissions in the policies determine whether the request is allowed or denied.

protection_status

protection_status

Specifies attributes of bucket protection.

qos_policy

qos_policy

Specifes "qos_policy.max_throughput_iops" and/or "qos_policy.max_throughput_mbps" or "qos_policy.min_throughput_iops" and/or "qos_policy.min_throughput_mbps". Specifying "min_throughput_iops" or "min_throughput_mbps" is only supported on volumes hosted on a node that is flash optimized. A pre-created QoS policy can also be used by specifying "qos_policy.name" or "qos_policy.uuid" properties. Setting or assigning a QoS policy to a bucket is not supported if its containing volume or SVM already has a QoS policy attached.

retention

retention

Specifies the retention mode and default retention period configured on the bucket.

role

string

Specifies the role of the bucket. This field cannot be set in a POST method.

size

integer

Specifies the bucket size in bytes; ranges from 190MB to 62PB.

storage_service_level

string

Specifies the storage service level of the FlexGroup volume on which the bucket should be created. Valid values are "value", "performance" or "extreme". This field cannot be used with the field "aggregates.uuid" or with the "constituents_per_aggregate" in a POST method. This field cannot be set using the PATCH method.

svm

svm

SVM, applies only to SVM-scoped objects.

type

string

Specifies the bucket type. Valid values are "s3"and "nas". This field cannot be set using the PATCH method.

uuid

string

Specifies the unique identifier of the bucket. This field cannot be specified in a POST or PATCH method.

versioning_state

string

Specifies the versioning state of the bucket. Valid values are "disabled", "enabled" or "suspended". Note that the versioning state cannot be modified to 'disabled' from any other state.

volume

volume

Specifies the FlexGroup volume name and UUID where the bucket is hosted. This field cannot be set in a POST method.

Example request
{
  "aggregates": [
    {
      "_links": {
        "self": {
          "href": "/api/resourcelink"
        }
      },
      "name": "aggr1",
      "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
    }
  ],
  "audit_event_selector": {
    "access": "string",
    "permission": "string"
  },
  "comment": "S3 bucket.",
  "constituents_per_aggregate": 4,
  "lifecycle_management": {
    "rules": [
      {
        "_links": {
          "self": {
            "href": "/api/resourcelink"
          }
        },
        "abort_incomplete_multipart_upload": {
          "_links": {
            "self": {
              "href": "/api/resourcelink"
            }
          }
        },
        "bucket_name": "bucket1",
        "expiration": {
          "_links": {
            "self": {
              "href": "/api/resourcelink"
            }
          },
          "object_age_days": 100,
          "object_expiry_date": "2039-09-22 20:00:00 -0400"
        },
        "name": "string",
        "non_current_version_expiration": {
          "_links": {
            "self": {
              "href": "/api/resourcelink"
            }
          }
        },
        "object_filter": {
          "_links": {
            "self": {
              "href": "/api/resourcelink"
            }
          },
          "prefix": "/logs",
          "size_greater_than": 10240,
          "size_less_than": 10485760,
          "tags": [
            "project1=projA",
            "project2=projB"
          ]
        },
        "svm": {
          "_links": {
            "self": {
              "href": "/api/resourcelink"
            }
          },
          "name": "svm1",
          "uuid": "02c9e252-41be-11e9-81d5-00a0986138f7"
        },
        "uuid": "414b29a1-3b26-11e9-bd58-0050568ea055"
      }
    ]
  },
  "logical_used_size": 0,
  "name": "bucket1",
  "nas_path": "/",
  "policy": {
    "statements": [
      {
        "actions": [
          "GetObject",
          "PutObject",
          "DeleteObject",
          "ListBucket"
        ],
        "conditions": [
          {
            "delimiters": [
              "/"
            ],
            "max_keys": [
              1000
            ],
            "operator": "ip_address",
            "prefixes": [
              "pref"
            ],
            "source_ips": [
              "1.1.1.1",
              "1.2.2.0/24"
            ],
            "usernames": [
              "user1"
            ]
          }
        ],
        "effect": "allow",
        "principals": [
          "user1",
          "group/grp1",
          "nasgroup/group1"
        ],
        "resources": [
          "bucket1",
          "bucket1/*"
        ],
        "sid": "FullAccessToUser1"
      }
    ]
  },
  "qos_policy": {
    "_links": {
      "self": {
        "href": "/api/resourcelink"
      }
    },
    "max_throughput_iops": 10000,
    "max_throughput_mbps": 500,
    "min_throughput_iops": 2000,
    "min_throughput_mbps": 500,
    "name": "performance",
    "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
  },
  "retention": {
    "default_period": "P10Y",
    "mode": "governance"
  },
  "role": "string",
  "size": 819200000,
  "storage_service_level": "value",
  "svm": {
    "_links": {
      "self": {
        "href": "/api/resourcelink"
      }
    },
    "name": "svm1",
    "uuid": "02c9e252-41be-11e9-81d5-00a0986138f7"
  },
  "type": "s3",
  "uuid": "string",
  "versioning_state": "enabled",
  "volume": {
    "_links": {
      "self": {
        "href": "/api/resourcelink"
      }
    },
    "name": "volume1",
    "uuid": "028baa66-41bd-11e9-81d5-00a0986138f7"
  }
}

Response

Status: 200, Ok
Name Type Description

job

job_link

Example response
{
  "job": {
    "_links": {
      "self": {
        "href": "/api/resourcelink"
      }
    },
    "uuid": "string"
  }
}

Response

Status: 202, Accepted

Error

Status: Default

ONTAP Error Response Codes

Error code Message

92405778

"Failed to modify bucket "{bucket name}" for SVM "{svm.name}". Reason: {Reason for failure}. ";

92405846

"Failed to modify the object store volume. Reason: {Reason for failure}.";

92405811

"Failed to modify bucket "{bucket name}" for SVM "{svm.name}". Wait a few minutes and try the operation again.";

92405858

"Failed to "modify" the "bucket" because the operation is only supported on data SVMs.";

92405861

"The specified "{parameter field}", "{parameter value}", does not exist.";

92405863

"Failed to create access policies for bucket "{bucket name}". Reason: "Principal list can have a maximum of 10 entries.". Resolve all the issues and retry the operation.";

92405864

"An error occurs when deleting an access policy. The reason for failure is detailed in the error message.";

92405891

The resources specified in the access policy are not valid. Valid ways to specify a resource are *, <bucket-name>, <bucket-name>/…​/…​. Valid characters for a resource are 0-9, A-Z, a-z, _, +, comma, ;, :, =, ., &, @,?, (, ), single quote, *, !, - and $.

92405894

"Statements, principals and resources list can have a maximum of 10 entries.";

92405897

The principals specified in the access policy are not in the correct format. User name must be in between 1 and 64 characters. Valid characters for a user name are 0-9, A-Z, a-z, _, +, =, comma, ., @, and - .

92405898

"The SID specified in the access policy is not valid. Valid characters for a SID are 0-9, A-Z and a-z.";

92405940

"The specified condition key is not valid for operator "ip-address". Valid choices of keys for this operator: source-ips.";

92406014

"Failed to modify event selector for bucket "{bucket name}". If value of either access or permission is set to none, then the other must be set to none as well.";

92406032

"Modifying the NAS path for a NAS bucket is not supported.";

Name Type Description

error

returned_error

Example error
{
  "error": {
    "arguments": [
      {
        "code": "string",
        "message": "string"
      }
    ],
    "code": "4",
    "message": "entry doesn't exist",
    "target": "uuid"
  }
}

Definitions

See Definitions

href

Name Type Description

href

string