Locking

GET/:Key?legal-hold

GetObjectLegalHold

Gets an object's current legal hold status.

Request Properties

  • Name
    Bucket
    Type
    string
    SupportedRequiredPath
    Description
    Represents the bucket within which the object exsits.
  • Name
    Key
    Type
    string
    SupportedRequiredPath
    Description
    The key name for the object whose legal hold status you want to retrieve.
  • Name
    x-amz-expected-bucket-owner
    Type
    string
    Not SupportedHeader
    Description
    The account ID of the expected bucket owner.
  • Name
    x-amz-request-payer
    Type
    string
    Not SupportedHeader
    Description
    Confirms that the requester knows that they will be charged for the request.
  • Name
    VersionId
    Type
    string
    Not SupportedQuery
    Description
    The version ID of the object whose legal hold status you want to retrieve.

Response Properties

  • Name
    LegalHold
    Type
    LegalHold
    Body
    Description
    Root level tag for the LegalHold parameters.
  • Name
    Status
    Type
    string
    Body
    Description
    Indicates whether the specified object has a legal hold in place.

Request

GET
/:Key?legal-hold
GET /{Key+}?legal-hold&versionId=VersionId HTTP/1.1
Host: Bucket.Endpoint
x-amz-request-payer: RequestPayer
x-amz-expected-bucket-owner: ExpectedBucketOwner

Response

HTTP/1.1 200
<?xml version="1.0" encoding="UTF-8"?>
<LegalHold>
<Status>string</Status>
</LegalHold>

GET/?object-lock

GetObjectLockConfiguration

Gets the Object Lock configuration for a bucket. The rule specified in the Object Lock configuration will be applied by default to every new object placed in the specified bucket.

Request Properties

  • Name
    Bucket
    Type
    string
    SupportedRequiredPath
    Description
    Represents the bucket within which the object exsits.
  • Name
    x-amz-expected-bucket-owner
    Type
    string
    Not SupportedHeader
    Description
    The account ID of the expected bucket owner.

Response Properties

  • Name
    ObjectLockConfiguration
    Type
    ObjectLockConfiguration
    Body
    Description
    Root level tag for the ObjectLockConfiguration parameters.
  • Name
    ObjectLockEnabled
    Type
    string
    Body
    Description
    Indicates whether this bucket has an Object Lock configuration enabled. Enable ObjectLockEnabled when you apply ObjectLockConfiguration to a bucket.
  • Name
    Rule
    Type
    Rule
    Body
    Description
    Specifies the Object Lock rule for the specified object.

Request

GET
/?object-lock
GET /?object-lock HTTP/1.1
Host: Bucket.Endpoint
x-amz-expected-bucket-owner: ExpectedBucketOwner

Response

HTTP/1.1 200
<?xml version="1.0" encoding="UTF-8"?>
<ObjectLockConfiguration>
<ObjectLockEnabled>string</ObjectLockEnabled>
<Rule>
	<DefaultRetention>
		<Days>integer</Days>
		<Mode>string</Mode>
		<Years>integer</Years>
	</DefaultRetention>
</Rule>
</ObjectLockConfiguration>

PUT/:key?legal-hold

PutObjectLegalHold

Applies a legal hold configuration to the specified object.

Request Properties

  • Name
    Bucket
    Type
    string
    SupportedRequiredPath
    Description
    Represents the bucket within which the object exsits.
  • Name
    Key
    Type
    string
    SupportedRequiredPath
    Description
    The key name for the object that you want to place a legal hold on.
  • Name
    Content-MD5
    Type
    string
    Not SupportedHeader
    Description
    The MD5 hash for the request body.
  • Name
    x-amz-expected-bucket-owner
    Type
    string
    Not SupportedHeader
    Description
    The account ID of the expected bucket owner.
  • Name
    x-amz-request-payer
    Type
    string
    Not SupportedHeader
    Description
    Confirms that the requester knows that they will be charged for the request.
  • Name
    x-amz-sdk-checksum-algorithm
    Type
    string
    Not SupportedHeader
    Description
    Indicates the algorithm used to create the checksum for the object when you use the SDK.
  • Name
    VersionId
    Type
    string
    Not SupportedQuery
    Description
    The version ID of the object that you want to place a legal hold on.
  • Name
    LegalHold
    Type
    LegalHold
    SupportedRequiredBody
    Description
    Root level tag for the LegalHold parameters.
  • Name
    Status
    Type
    string
    SupportedBody
    Description
    Indicates whether the specified object has a legal hold in place.

Response Properties

  • Name
    x-amz-request-charged
    Not SupportedHeader
    Description
    If present, indicates that the requester was successfully charged for the request.

Request

PUT
/:key?legal-hold
PUT /{Key+}?legal-hold&versionId=VersionId HTTP/1.1
Host: Bucket.Endpoint
x-amz-request-payer: RequestPayer
Content-MD5: ContentMD5
x-amz-sdk-checksum-algorithm: ChecksumAlgorithm
x-amz-expected-bucket-owner: ExpectedBucketOwner
<?xml version="1.0" encoding="UTF-8"?>
<LegalHold>
<Status>string</Status>
</LegalHold>

Response

HTTP/1.1 200
x-amz-request-charged: RequestCharged

PUT/?object-lock

PutObjectLockConfiguration

Places an Object Lock configuration on the specified bucket. The rule specified in the Object Lock configuration will be applied by default to every new object placed in the specified bucket.

Request Properties

  • Name
    Bucket
    Type
    string
    SupportedRequiredPath
    Description
    Represents the bucket within which the object exsits.
  • Name
    Content-MD5
    Type
    string
    Not SupportedHeader
    Description
    The MD5 hash for the request body.
  • Name
    x-amz-bucket-object-lock-token
    Type
    string
    Not SupportedHeader
    Description
    A token to allow Object Lock to be enabled for an existing bucket.
  • Name
    x-amz-expected-bucket-owner
    Type
    string
    Not SupportedHeader
    Description
    The account ID of the expected bucket owner.
  • Name
    x-amz-request-payer
    Type
    string
    Not SupportedHeader
    Description
    Confirms that the requester knows that they will be charged for the request.
  • Name
    x-amz-sdk-checksum-algorithm
    Type
    string
    Not SupportedHeader
    Description
    Indicates the algorithm used to create the checksum for the object when you use the SDK.
  • Name
    ObjectLockConfiguration
    Type
    ObjectLockConfiguration
    RequiredBody
    Description
    Root level tag for the ObjectLockConfiguration parameters.
  • Name
    ObjectLockEnabled
    Type
    string
    Body
    Description
    Indicates whether this bucket has an Object Lock configuration enabled. Enable ObjectLockEnabled when you apply ObjectLockConfiguration to a bucket.
  • Name
    Rule
    Type
    Rule
    Body
    Description
    Specifies the Object Lock rule for the specified object.

Response Properties

  • Name
    x-amz-request-charged
    Not SupportedHeader
    Description
    If present, indicates that the requester was successfully charged for the request.

Request

PUT
/?object-lock
PUT /?object-lock HTTP/1.1
Host: Bucket.Endpoint
x-amz-request-payer: RequestPayer
x-amz-bucket-object-lock-token: Token
Content-MD5: ContentMD5
x-amz-sdk-checksum-algorithm: ChecksumAlgorithm
x-amz-expected-bucket-owner: ExpectedBucketOwner
<?xml version="1.0" encoding="UTF-8"?>
<ObjectLockConfiguration>
<ObjectLockEnabled>string</ObjectLockEnabled>
<Rule>
	<DefaultRetention>
		<Days>integer</Days>
		<Mode>string</Mode>
		<Years>integer</Years>
	</DefaultRetention>
</Rule>
</ObjectLockConfiguration>

Response

HTTP/1.1 200
x-amz-request-charged: RequestCharged