Object Lock

Object Lock Configuration

GetObjectLockConfiguration

get

Retrieves the Object Lock configuration for a bucket.

Permissions

You must be the contract owner or an administrator to perform this operation. If not, they can grant you permission to perform the s3:GetBucketObjectLockConfiguration operation using Bucket Policy.

Authorizations
Path parameters
Bucketstring · min: 3 · max: 63Required

The bucket name.

Example: my-bucket
Query parameters
object-lockboolean · enumRequiredPossible values:
Responses
200
Successful operation
application/xml
get
GET /{Bucket} HTTP/1.1
Host: s3.eu-central-1.ionoscloud.com
Authorization: YOUR_API_KEY
Accept: */*
<?xml version="1.0" encoding="UTF-8"?>
<ObjectLockConfiguration>
    <ObjectLockEnabled>Enabled</ObjectLockEnabled>
    <Rule>
        <DefaultRetention>
            <Mode>GOVERNANCE</Mode>
            <Days>10</Days>
        </DefaultRetention>
    </Rule>
</ObjectLockConfiguration>

PutObjectLockConfiguration

put

Applies an Object Lock configuration on the specified bucket, which requires the Object Lock feature to have been enabled during its creation. The rule specified in the Object Lock configuration will be applied by default to every new object placed in the specified bucket.

Note:

  • An Object Lock Configuration can only be applied to buckets with Object Lock enabled.

  • This feature can only be activated on a new bucket during its creation.

  • Object Lock cannot be enabled on a bucket that already exists.

Permissions

You must be the contract owner or an administrator to perform this operation. If not, they can grant you permission to perform the s3:PutBucketObjectLockConfiguration operation using Bucket Policy.

Authorizations
Path parameters
Bucketstring · min: 3 · max: 63Required

The bucket name.

Example: my-bucket
Query parameters
object-lockboolean · enumRequiredPossible values:
Header parameters
Content-MD5stringRequired

The base64 encoded MD5 digest of the message (without the headers) according to RFC 1864.

Body
Responses
200
Successful operation
application/xml
put
PUT /{Bucket} HTTP/1.1
Host: s3.eu-central-1.ionoscloud.com
Authorization: YOUR_API_KEY
Content-MD5: text
Content-Type: application/xml
Accept: */*
Content-Length: 351

"<?xml version="1.0" encoding="UTF-8"?>
<ObjectLockConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <ObjectLockEnabled>Enabled</ObjectLockEnabled>
    <Rule>
        <DefaultRetention>
            <Mode>GOVERNANCE</Mode>
            <Days>15</Days>
        </DefaultRetention>
    </Rule>
</ObjectLockConfiguration>
"

No content

GetObjectRetention

get

Retrieves an object's retention configuration.

Permissions

You must be the contract owner or an administrator to perform this operation. If not, they can grant you permission to perform the s3:GetObjectRetention operation using Bucket Policy.

Authorizations
Path parameters
Bucketstring · min: 3 · max: 63Required

The bucket name.

Example: my-bucket
Keystring · min: 1Required

The key name of the object whose retention settings you want to retrieve.

Query parameters
retentionboolean · enumRequiredPossible values:
versionIdstringOptional

The version ID of the object whose retention settings you want to retrieve.

Responses
200
Successful operation
application/xml
get
GET /{Bucket}/{Key} HTTP/1.1
Host: s3.eu-central-1.ionoscloud.com
Authorization: YOUR_API_KEY
Accept: */*
<?xml version="1.0" encoding="UTF-8"?>
<Retention xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <Mode>GOVERNANCE</Mode>
    <RetainUntilDate>2023-08-09T09:01:01Z</RetainUntilDate>
</Retention>

PutObjectRetention

put

Places an Object Retention configuration on an object.

Permissions

You must be the contract owner or an administrator to perform this operation. If not, they can grant you permission to perform the s3:PutObjectRetention operation using Bucket Policy. Bypassing a Governance Retention configuration also requires the s3:BypassGovernanceRetention permission.

Authorizations
Path parameters
Bucketstring · min: 3 · max: 63Required

The bucket name.

Example: my-bucket
Keystring · min: 1Required

The key name of the object to which you want to apply the Object Retention configuration.

Query parameters
retentionboolean · enumRequiredPossible values:
versionIdstringOptional

The version ID of the object to which you want to apply the Object Retention configuration.

Header parameters
x-amz-bypass-governance-retentionbooleanOptional

Indicates whether this operation should bypass Governance mode's restrictions.

Default: false
Content-MD5stringOptional

The base64 encoded MD5 digest of the message (without the headers) according to RFC 1864.

Body
Responses
200
Successful operation
application/xml
put
PUT /{Bucket}/{Key} HTTP/1.1
Host: s3.eu-central-1.ionoscloud.com
Authorization: YOUR_API_KEY
Content-Type: application/xml
Accept: */*
Content-Length: 213

"<?xml version="1.0" encoding="UTF-8"?>
<Retention xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <Mode>GOVERNANCE</Mode>
    <RetainUntilDate>2023-08-10T09:01:01Z</RetainUntilDate>
</Retention>
"

No content

get

Gets an object's current Legal Hold status.

Permissions

You must be the contract owner or an administrator to perform this operation. If not, they can grant you permission to perform the s3:GetObjectLegalHold operation using Bucket Policy.

Authorizations
Path parameters
Bucketstring · min: 3 · max: 63Required

The bucket name.

Example: my-bucket
Keystring · min: 1Required

The key name of the object whose Legal Hold status you want to retrieve.

Query parameters
legal-holdboolean · enumRequiredPossible values:
versionIdstringOptional

The version ID of the object whose Legal Hold status you want to retrieve.

Responses
200
Successful operation
application/xml
get
GET /{Bucket}/{Key} HTTP/1.1
Host: s3.eu-central-1.ionoscloud.com
Authorization: YOUR_API_KEY
Accept: */*
<?xml version="1.0" encoding="UTF-8"?>
<LegalHold xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <Status>ON</Status>
</LegalHold>
put

Applies a Legal Hold configuration to the specified object.

Permissions

You must be the contract owner or an administrator to perform this operation. If not, they can grant you permission to perform the s3:PutObjectLegalHold operation using Bucket Policy.

Authorizations
Path parameters
Bucketstring · min: 3 · max: 63Required

The bucket name.

Example: my-bucket
Keystring · min: 1Required

The key name of the object on which you want to place a Legal Hold.

Query parameters
legal-holdboolean · enumRequiredPossible values:
versionIdstringOptional

The version ID of the object on which you want to place a Legal Hold.

Header parameters
Content-MD5stringOptional

The base64 encoded MD5 digest of the message (without the headers) according to RFC 1864.

Body
Responses
200
Successful operation
application/xml
put
PUT /{Bucket}/{Key} HTTP/1.1
Host: s3.eu-central-1.ionoscloud.com
Authorization: YOUR_API_KEY
Content-Type: application/xml
Accept: */*
Content-Length: 148

"<?xml version="1.0" encoding="UTF-8"?>
<LegalHold xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <Status>ON</Status>
</LegalHold>
"

No content

Was this helpful?