Class GetObjectAttributesRequest
Container for the parameters to the GetObjectAttributes operation. Retrieves all the metadata from an object without returning the object iteself. This action is useful if you're only interested in an object's metadata. To use
GetObjectAttributes
,
you must have READ access to the object.
GetObjectAttributes
combines the functionality of GetObjectAcl
,
GetObjectLegelHold
, GetObjectLockConfiguration
, GetObjectRetention
,
GetObjectTagging
, HeadObject
, and ListParts
.
All of the data returned with each of those individual calls can be returned with
a single call to GetObjectAttributes
.
If you encrypt an object by using server-side encryption with customer-provided encryption keys (SSE-C) when you store the object in Amazon S3, then when you retrieve the metadata from the object, you must use the following headers:
x-amz-server-side-encryption-customer-algorithm
x-amz-server-side-encryption-customer-key
x-amz-server-side-encryption-customer-key-MD5
For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided Encryption Keys).
note
Encryption request headers, like
, should not be sent for GET requests if your object uses server-side encryption with CMKs stored in Amazon Web Services KMS (SSE-KMS) or server-side encryption with Amazon S3–managed encryption keys (SSE-S3). If your object does use these types of keys, you'll get an HTTP 400 BadRequest error.x-amz-server-side-encryption
The last modified property in this case is the creation date of the object.
Consider the following when using request headers:
Consideration 1 – If both of the
andIf-Match
headers are present in the request as follows:If-Unmodified-Since
condition evaluates toIf-Match
, and;true
condition evaluates toIf-Unmodified-Since
;false
Then Amazon S3 returns
and the data requested.200 OK
Consideration 2 – If both of the
andIf-None-Match
headers are present in the request as follows:If-Modified-Since
condition evaluates toIf-None-Match
, and;false
condition evaluates toIf-Modified-Since
;true
Then Amazon S3 returns the
response code.304 Not Modified
For more information about conditional requests, see RFC 7232.
Permissions
The permissions you need to use this operation depend on whether or not the bucket is versioned. If the bucket is versioned, you need both the
s3:GetObjectVersion
and s3:GetObjectVersionAttributes
permissions for this operation. If
the bucket is not versioned, you need the s3:GetObject
and s3:GetObjectAttributes
permissions. For more information, see Specifying
Permissions in a Policy. If the object you request does not exist, the error Amazon
S3 returns depends on whether you also have the s3:ListBucket
permission.
If you have the
permission on the bucket, Amazon S3 returns an HTTP status code 404 ("no such key") error.s3:ListBucket
If you don't have the
permission, Amazon S3 returns an HTTP status code 403 ("access denied") error.s3:ListBucket
The following actions are related to
GetObjectAttributes
:
public class GetObjectAttributesRequest : AmazonWebServiceRequest
- Inheritance
-
GetObjectAttributesRequest
Constructors
GetObjectAttributesRequest()
public GetObjectAttributesRequest()
Properties
BucketName
Gets and sets the property BucketName.
The name of the bucket that contains the object.
When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.
When you use this action with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form
AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com
.
When you use this action with S3 on Outposts through the Amazon Web Services SDKs,
you provide the Outposts access point ARN in place of the bucket name. For more information
about S3 on Outposts ARNs, see What
is S3 on Outposts in the Amazon S3 User Guide.
public string BucketName { get; set; }
Property Value
ExpectedBucketOwner
Gets and sets the property ExpectedBucketOwner.
The account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP
403 (Access Denied)
error.
public string ExpectedBucketOwner { get; set; }
Property Value
Key
Gets and sets the property Key.
The object key.
public string Key { get; set; }
Property Value
MaxParts
Gets and sets the property MaxParts.
Sets the maximum number of parts to return.
public int MaxParts { get; set; }
Property Value
ObjectAttributes
Gets and sets the property ObjectAttributes.
An XML header that specifies the fields at the root level that you want returned in the response. Fields that you do not specify will not be returned.
public List<ObjectAttributes> ObjectAttributes { get; set; }
Property Value
PartNumberMarker
Gets and sets the property PartNumberMarker.
Specifies the part after which listing should begin. Only parts with higher part numbers will be listed.
public int PartNumberMarker { get; set; }
Property Value
RequestPayer
Gets and sets the property RequestPayer.
public RequestPayer RequestPayer { get; set; }
Property Value
SSECustomerAlgorithm
Gets and sets the property SSECustomerAlgorithm.
Specifies the algorithm to use to when encrypting the object (for example, AES256).
public string SSECustomerAlgorithm { get; set; }
Property Value
SSECustomerKey
Gets and sets the property SSECustomerKey.
Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon S3 does not store the encryption key. The key must be appropriate for use with the algorithm specified in the
x-amz-server-side-encryption-customer-algorithm
header.
public string SSECustomerKey { get; set; }
Property Value
SSECustomerKeyMD5
Gets and sets the property SSECustomerKeyMD5.
Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error.
public string SSECustomerKeyMD5 { get; set; }
Property Value
VersionId
Gets and sets the property VersionId.
public string VersionId { get; set; }