Create the S3 bucket configuration for an SVM
POST /protocols/s3/buckets
Introduced In: 9.8
Creates the S3 bucket configuration of an SVM.
Important notes
-
Each SVM can have one or more bucket configurations.
-
Aggregate lists should be specified explicitly. If not specified, then the bucket is auto-provisioned as a FlexGroup volume.
-
Constituents per aggregate specifies the number of components (or FlexVol volumes) per aggregate. Is specified only when an aggregate list is explicitly defined.
-
An access policy can be created along with a bucket create. If creating an access policy fails, bucket configurations are saved and the access policy can be created using the PATCH endpoint.
-
"qos_policy" can be specified if a bucket needs to be attached to a QoS group policy during creation time.
-
"audit_event_selector" can be specified if a bucket needs to be specify access and permission type for auditing.
Required properties
-
svm.uuid or svm.name
- Existing SVM in which to create the bucket configuration. -
name
- Bucket name that is to be created.
Recommended optional properties
-
aggregates
- List of aggregates for the FlexGroup volume on which the bucket is hosted on. -
constituents_per_aggregate
- Number of constituents per aggregate. -
size
- Specifying the bucket size is recommended. -
policy
- Specifying a policy enables users to perform operations on buckets; specifying the resource permissions is recommended. -
qos_policy
- A QoS policy for buckets. -
audit_event_selector
- Audit policy for buckets. -
versioning_state
- Versioning state for buckets. -
type
- Type of bucket. -
nas_path
- NAS path to which the bucket corresponds to. -
use_mirrored_aggregates
- Specifies whether mirrored aggregates are selected when provisioning a FlexGroup volume. -
lifecycle_management
- Object store server lifecycle management policy. -
retention.mode
- Object lock mode supported on the bucket. -
retention.default_period
- Specifies the duration of default-retention applicable for objects on the object store bucket.
Default property values
-
size
- 800MB -
comment
- "" -
aggregates
- No default value. -
constituents_per_aggregate
- 4 , if an aggregates list is specified. Otherwise, no default value. -
policy.statements.actions
- GetObject, PutObject, DeleteObject, ListBucket, ListBucketMultipartUploads, ListMultipartUploadParts, GetObjectTagging, PutObjectTagging, DeleteObjectTagging, GetBucketVersioning, PutBucketVersioning. -
policy.statements.principals
- all S3 users and groups in the SVM or the NAS groups. -
policy.statements.resources
- all objects in the bucket. -
policy.statements.conditions
- list of bucket policy conditions. -
versioning_state
- disabled. -
use_mirrored_aggregates
- true for a MetroCluster configuration and false for a non-MetroCluster configuration. -
type
- S3 -
retention.mode
- no_lock
Related ONTAP commands
-
vserver object-store-server bucket create
-
vserver object-store-server bucket policy statement create
-
vserver object-store-server bucket lifecycle-management-rule create
Learn more
Parameters
Name | Type | In | Required | Description |
---|---|---|---|---|
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.
|
return_records |
boolean |
query |
False |
The default is false. If set to true, the records are returned.
|
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. |
allowed |
boolean |
If this is set to true, an SVM administrator can manage the S3 service. If it is false, only the cluster administrator can manage the service. This field cannot be specified in a POST method. |
audit_event_selector |
Audit 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. |
encryption |
||
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 specified using a POST or 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 |
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 |
Specifies attributes of bucket protection. |
|
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 |
Specifies the retention mode and default retention period configured on the bucket. |
|
role |
string |
Specifies the role of the bucket. This field cannot be specified using 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". |
svm |
SVM, applies only to SVM-scoped objects. |
|
type |
string |
Specifies the bucket type. Valid values are "s3"and "nas". |
use_mirrored_aggregates |
boolean |
Specifies whether mirrored aggregates are selected when provisioning a FlexGroup. Only mirrored aggregates are used if this parameter is set to "true" and only unmirrored aggregates are used if this parameter is set to "false". The default value is "true" for a MetroCluster configuration and is "false" for a non-MetroCluster configuration. |
uuid |
string |
Specifies the unique identifier of the bucket. |
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 |
Specifies the FlexGroup volume name and UUID where the bucket is hosted. |
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": 1677721600,
"storage_service_level": "value",
"svm": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "svm1",
"uuid": "02c9e252-41be-11e9-81d5-00a0986138f7"
},
"type": "s3",
"uuid": "414b29a1-3b26-11e9-bd58-0050568ea055",
"versioning_state": "enabled",
"volume": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "volume1",
"uuid": "028baa66-41bd-11e9-81d5-00a0986138f7"
}
}
Response
Status: 202, Accepted
Name | Type | Description |
---|---|---|
job |
Example response
{
"job": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"uuid": "string"
}
}
Headers
Name | Description | Type |
---|---|---|
Location |
Useful for tracking the resource location |
string |
Response
Status: 201, Created
Error
Status: Default
ONTAP Error Response Codes
Error code | Message |
---|---|
92405777 |
"Failed to create bucket "{bucket name}" for SVM "{svm.name}". Reason: {Reason of failure}. "; |
92405785 |
"Bucket name "{bucket name}" contains invalid characters. Valid characters for a bucket name are 0-9, a-z, ".", and "-". "; |
92405786 |
"Bucket name "{bucket name}" is not valid. Bucket names must have between 3 and 63 characters. "; |
92405811 |
"Failed to create bucket "{bucket name}" for SVM "{svm.name}". Wait a few minutes and try the operation again."; |
92405812 |
"Failed to create the object store volume. Reason: {Reason for failure}."; |
92405819 |
"Cannot provision an object store server volume for bucket "{bucket name}" in SVM "{svm.name}" on the following aggregates because they are SnapLock aggregates: {List of aggregates.name}."; |
92405820 |
"Failed to check whether the aggregate "{aggregates.name}" is a FabricPool. Reason: {Reason for failure}."; |
92405821 |
"Cannot provision an object store server volume for bucket "{bucket name}" in SVM "{svm.name}" on the following aggregates because they are FabricPool: {List of aggregates.name}."; |
92405827 |
"Internal Error. Unable to generate object store volume name."; |
92405857 |
"One or more aggregates must be specified if "constituents_per_aggregate" is specified."; |
92405858 |
"Failed to "create" the "bucket" because the operation is only supported on data SVMs."; |
92405859 |
"The specified "aggregates.uuid" "{aggregates.uuid}" does not exist."; |
92405860 |
"The specified "aggregates.name" "{aggregates.name}" and "aggregates.uuid" "{aggregates.uuid}" refer to different aggregates."; |
92405861 |
"The specified SVM UUID or bucket UUID does not exist."; |
92405863 |
"An error occurs when creating an access policy. The reason for failure is detailed in the error message."; |
92405863 |
"Failed to create lifecycle management rules for bucket "s3bucket1". Reason: {Reason of failure}. "; |
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 $. |
92406166 |
"Cannot enable locking on a NAS bucket."; |
92406170 |
"Cannot set "-default-retention-period" on object store bucket "{0}" in Vserver "{1}". Setting the default retention period on an object store bucket requires an effective cluster version of 9.14.1 or later."; |
92406171 |
"Cannot set "{retention_mode}" to "compliance" in a MetroCluster configuration"; |
92406174 |
"Internal error. Failed to complete bucket create workflow with "-retention-mode" set to "compliance" or "governance". Reason: {0}"; |
92406175 |
"The SnapLock compliance clock is not running. Use the "snaplock compliance-clock initialize" command to initialize the compliance clock, and then try the operation again."; |
92406176 |
"The SnapLock compliance clock is not running on the MetroCluster partner cluster. Use the "snaplock compliance-clock initialize" command to initialize the compliance clock on the MetroCluster partner cluster, and then try the operation again."; |
Name | Type | Description |
---|---|---|
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 |
_links
Name | Type | Description |
---|---|---|
self |
aggregates
Aggregate
Name | Type | Description |
---|---|---|
_links |
||
name |
string |
|
uuid |
string |
audit_event_selector
Audit event selector allows you to specify access and permission types to audit.
Name | Type | Description |
---|---|---|
access |
string |
Specifies read and write access types. |
permission |
string |
Specifies allow and deny permission types. |
encryption
Name | Type | Description |
---|---|---|
enabled |
boolean |
Specifies whether encryption is enabled on the bucket. By default, encryption is disabled on a bucket. This field cannot be specified in a POST method. |
abort_incomplete_multipart_upload
Specifies a way to perform abort_incomplete_multipart_upload action on filtered objects within a bucket. It cannot be specified with tags.
Name | Type | Description |
---|---|---|
_links |
||
after_initiation_days |
integer |
Number of days of initiation after which uploads can be aborted. |
expiration
Specifies a way to perform expiration action on filtered objects within a bucket.
Name | Type | Description |
---|---|---|
_links |
||
expired_object_delete_marker |
boolean |
Cleanup object delete markers. |
object_age_days |
integer |
Number of days since creation after which objects can be deleted. This cannot be used along with object_expiry_date. |
object_expiry_date |
string |
Specific date from when objects can expire. This cannot be used with object_age_days. |
non_current_version_expiration
Specifies a way to perform non_current_version_expiration action on filtered objects within a bucket.
Name | Type | Description |
---|---|---|
_links |
||
new_non_current_versions |
integer |
Number of latest non-current versions to be retained. |
non_current_days |
integer |
Number of days after which non-current versions can be deleted. |
object_filter
Specifies a way to filter objects within a bucket.
Name | Type | Description |
---|---|---|
_links |
||
prefix |
string |
A prefix that is matched against object-names within a bucket. |
size_greater_than |
integer |
Size of the object greater than specified for which the corresponding lifecycle rule is to be applied. |
size_less_than |