/AWS1/CL_S3=>PUTBUCKETVERSIONING()
¶
About PutBucketVersioning¶
This operation is not supported by directory buckets.
Sets the versioning state of an existing bucket.
You can set the versioning state with one of the following values:
Enabled—Enables versioning for the objects in the bucket. All objects added to the bucket receive a unique version ID.
Suspended—Disables versioning for the objects in the bucket. All objects added to the bucket receive the version ID null.
If the versioning state has never been set on a bucket, it has no versioning state; a GetBucketVersioning request does not return a versioning state value.
In order to enable MFA Delete, you must be the bucket owner. If you are the bucket owner
and want to enable MFA Delete in the bucket versioning configuration, you must include the
x-amz-mfa request
header and the Status
and the
MfaDelete
request elements in a request to set the versioning state of the
bucket.
If you have an object expiration lifecycle configuration in your non-versioned bucket and you want to maintain the same permanent delete behavior when you enable versioning, you must add a noncurrent expiration policy. The noncurrent expiration lifecycle configuration will manage the deletes of the noncurrent object versions in the version-enabled bucket. (A version-enabled bucket maintains one current and zero or more noncurrent object versions.) For more information, see Lifecycle and Versioning.
The following operations are related to PutBucketVersioning
:
Method Signature¶
IMPORTING¶
Required arguments:¶
IV_BUCKET
TYPE /AWS1/S3_BUCKETNAME
/AWS1/S3_BUCKETNAME
¶
The bucket name.
IO_VERSIONINGCONFIGURATION
TYPE REF TO /AWS1/CL_S3_VERSIONINGCONF
/AWS1/CL_S3_VERSIONINGCONF
¶
Container for setting the versioning state.
Optional arguments:¶
IV_CONTENTMD5
TYPE /AWS1/S3_CONTENTMD5
/AWS1/S3_CONTENTMD5
¶
>The base64-encoded 128-bit MD5 digest of the data. You must use this header as a message integrity check to verify that the request body was not corrupted in transit. For more information, see RFC 1864.
For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.
IV_CHECKSUMALGORITHM
TYPE /AWS1/S3_CHECKSUMALGORITHM
/AWS1/S3_CHECKSUMALGORITHM
¶
Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding
x-amz-checksum
orx-amz-trailer
header sent. Otherwise, Amazon S3 fails the request with the HTTP status code400 Bad Request
. For more information, see Checking object integrity in the Amazon S3 User Guide.If you provide an individual checksum, Amazon S3 ignores any provided
ChecksumAlgorithm
parameter.
IV_MFA
TYPE /AWS1/S3_MFA
/AWS1/S3_MFA
¶
The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device.
IV_EXPECTEDBUCKETOWNER
TYPE /AWS1/S3_ACCOUNTID
/AWS1/S3_ACCOUNTID
¶
The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden
(access denied).