Read Object Lock retention on an object

Note: Only bucket owners have permissions to read object retention on an already uploaded object. Bucket owners can also read retention on objects owned by other users that were uploaded to their bucket.

Request syntax


GET /BucketName/ObjectName?retention&versionId=<VersionID> HTTP/1.

Response syntax


HTTP/1.1 200 OK
Date: Wed, 8 Feb 2017 17:51:00 GMT
Connection: close

<?xml version="1.0" encoding="UTF-8"?>
<Retention>
    <Mode>string</Mode>
    <RetainUntilDate>string</RetainUntilDate>
</Retention>

Response Payload Elements

Table 1. Response parameters
Name Description
Retention Container for holding Retention Elements.
Mode The Object Lock retention mode that is applied to the object.
Type
String
Valid Values
COMPLIANCE, GOVERNANCE
Ancestor
Retention
RetainUntilDate The Object Lock retention retain until date that is applied to the object.
Type
String
Valid Values
ISO8601 Date-Time Format
Ancestor
Retention

Sample request

Object Lock Object Retention request


GET /BucketName/ObjectName?retention&versionId=<VersionID> 
HTTP/1.1 Host: myBucket.mydsNet.corp.com
Date: Wed, 8 Feb 2017 17:50:00 GMT
Authorization: authorization string 

Sample response

Object Lock Object Retention response


HTTP/1.1 200 OK
Date: Wed, 8 Feb 2017 17:51:00 GMT
Connection: close

<?xml version="1.0" encoding="UTF-8"?>
<Retention>
    <Mode>COMPLIANCE</Mode>
    <RetainUntilDate>2022-06-18T23:01:00.000Z</RetainUntilDate>
</Retention>