Documentation Index

Fetch the complete documentation index at: https://api.ncloud-docs.com/llms.txt

Use this file to discover all available pages before exploring further.

PutObjectLockConfiguration

Prev Next

Available in Classic and VPC

Apply object lock settings on an Ncloud Storage bucket. With object lock, you can preserve objects so that they cannot be deleted or modified for a specified period or indefinitely.

Request

This section describes the request format. The method and URI are as follows:

Method URI
PUT -

Request headers

The following describes the request headers.

Note

For information about the headers common to all Ncloud Storage APIs, see Ncloud Storage request headers.

Field Required Description
Content-MD5 Conditional Base64-encoded 128-bit MD5 hash of the request body
  • Used to verify the integrity of the request body.
  • Required if x-amz-checksum-* is not entered.
x-amz-checksum-* Conditional Checksum hash value
  • Enter the used algorithm in * of the key.
    • Supported algorithms: crc32 | crc32c | sha1 | sha256 | crc64nvme
  • Required if Content-MD5 is not entered.

Request body

You can include the following data in the body of your request:

Field Type Required Description
ObjectLockConfiguration Object Required Object lock settings
ObjectLockConfiguration.ObjectLockEnabled String Required Whether object lock is enabled
  • Enabled (valid value)
ObjectLockConfiguration.Rule Object Optional Default retention rule
  • If not specified, the default retention period is not set.
ObjectLockConfiguration.Rule.DefaultRetention Object Optional Default retention settings
  • Required if Rule is set
ObjectLockConfiguration.Rule.DefaultRetention.Mode String Optional Default retention mode
  • GOVERNANCE | COMPLIANCE
    • GOVERNANCE: Can be bypassed with special permissions.
    • COMPLIANCE: No one can bypass it.
ObjectLockConfiguration.Rule.DefaultRetention.Days Integer Optional Default retention period (days)
  • 1-36,500
  • Can't be specified simultaneously with Years (select one).
ObjectLockConfiguration.Rule.DefaultRetention.Years Integer Optional Default retention period (years)
  • 1-100
  • Can't be specified simultaneously with Days (select one).

Request example

The request example is as follows:

PUT /?object-lock HTTP/1.1
Host: {Bucket}.kr.ncloudstorage.com
Content-MD5: {MD5 hash value}

<?xml version="1.0" encoding="UTF-8"?>
<ObjectLockConfiguration>
    <ObjectLockEnabled>Enabled</ObjectLockEnabled>
    <Rule>
        <DefaultRetention>
            <Mode>GOVERNANCE</Mode>
            <Days>30</Days>
        </DefaultRetention>
    </Rule>
</ObjectLockConfiguration>

Response

This section describes the response format.

Response headers

For information about the headers common to all Ncloud Storage APIs, see Ncloud Storage response headers.

Response status codes

The following describes the response status codes.

Note

For information about the HTTP status codes common to all Ncloud Storage APIs, see Common Ncloud Storage response status codes.

Error code HTTP status code Description
InvalidArgument 400 The default retention period is outside the valid range.
  • Days/Years is not a positive integer.
  • Days (36,500)/Years (100) exceeds the limit.
MalformedXML 400 The request body XML does not conform to the schema.
  • ObjectLockEnabled is not Enabled.
  • Mode is not GOVERNANCE/COMPLIANCE.
  • Days and Years are specified simultaneously or neither is specified.

Response example

The response example is as follows:

HTTP/1.1 200 OK