GET Object Attributes

The GET Object Attributes operation returns a subset of object metadata without fetching the object itself. This operation is useful to quickly retrieve specific information about an object, such as its ETag, ObjectParts, StorageClass, and ObjectSize, without the overhead of a full GET or HEAD request.

ARTESCA extends this functionality to support the retrieval of user-defined metadata using the x-amz-meta-* and x-amz-meta-<key> attributes.

Requests

Syntax

GET /{{ObjectName}}?attributes HTTP/1.1
Host: {{BucketName}}.{{StorageService}}.com
Authorization: {{authorizationString}}
Date: {{date}}
x-amz-expected-bucket-owner: {{ExpectedBucketOwner}}
x-amz-object-attributes: {{ObjectAttributes}}

Parameters

Parameter

Type

Description

versionId

string

The version ID of the object whose attributes are being requested.

Default: None

Headers

The GET Object Attributes operation uses the following request headers in addition to those that are common to all operations (refer to Common Request Headers).

Header

Type

Description

x-amz-object-attributes

string

Specifies the attributes to return. Attribute names are comma-separated.

Valid Values: ETag | ObjectParts | StorageClass | ObjectSize | x-amz-meta-* | x-amz-meta-<key>

x-amz-meta-* returns all user-defined metadata for the object. x-amz-meta-<key> returns a specific user metadata key. These are Scality extensions not available in the standard S3 API.

Required: Yes

Note

User metadata values concern only user metadata, not tagging.

Note

When using x-amz-meta-* or x-amz-meta-<key>, the scality:GetObject\ AttributesCustom permission is required in addition to s3:GetObjectAttributes.

x-amz-expected-bucket-owner

string

The account ID of the expected bucket owner. If the bucket is owned by a different account, the request fails with the HTTP status code 403 Forbidden (access denied).

Default: None

Note

The AWS Checksum attribute is not supported by ARTESCA. Requesting Checksum in the x-amz-object-attributes header will result in a 501 Not Implemented response error.

Elements

The GET Object Attributes operation does not use request elements.

Responses

Headers

Header

Type

Description

x-amz-delete-marker

Boolean

Specifies whether the object is a delete marker.

Valid Values: true | false

x-amz-version-id

string

The version ID of the object.

Default: None

Last-Modified

string

The date and time at which the object was last modified.

Default: None

Elements

The GET Object Attributes operation returns an XML response body with the following elements.

Element

Type

Description

GetObjectAttributesResponse

Container

Root element for the response.

ETag

string

The entity tag of the object.

ObjectParts

Container

A collection of parts associated with a multipart upload.

ObjectParts.PartsCount

integer

The total number of parts.

StorageClass

string

The storage class of the object.

ObjectSize

integer

The size of the object in bytes.

x-amz-meta-<key>

string

User-defined metadata keys and values. These elements are only returned when the x-amz-object-attributes request header includes x-amz-meta-* (for all metadata) or x-amz-meta-<key> (for a specific key).

Note

This is a Scality extension.

Errors

Error

HTTP Code

Description

InvalidRequest

400

The x-amz-object-attributes header is missing or empty.

InvalidArgument

400

An invalid value was provided for x-amz-object-attributes.

AccessDenied

403

Access denied. Verify that the requester has the s3:GetObjectAttributes permission (and scality:GetObjectAttributesCustom when requesting user-defined metadata).

NoSuchKey

404

The specified object does not exist.

NoSuchVersion

404

The specified versionId does not exist.

MethodNotAllowed

405

The specified object is a delete marker.

NotImplemented

501

The Checksum attribute was requested but is not supported.

Examples

Getting Object Attributes

Request

GET /my-object?attributes HTTP/1.1
Host: {{bucketName}}.s3.example.com
Date: Wed, 28 Oct 2009 22:32:00 GMT
Authorization: {{authorizationString}}
x-amz-object-attributes: ETag,ObjectSize,StorageClass

Response

HTTP/1.1 200 OK
x-amz-id-2: eftixk72aD6Ap51TnqcoF8eFidJG9Z/2
x-amz-request-id: 318BC8BC148832E5
Date: Wed, 28 Oct 2009 22:32:00 GMT
Last-Modified: Wed, 12 Oct 2009 17:50:00 GMT
Content-Type: application/xml
Server: ScalityS3

<?xml version="1.0" encoding="UTF-8"?>
<GetObjectAttributesResponse>
  <ETag>fba9dede5f27731c9771645a39863328</ETag>
  <StorageClass>STANDARD</StorageClass>
  <ObjectSize>434234</ObjectSize>
</GetObjectAttributesResponse>

Getting Object Attributes for a Multipart-Uploaded Object

Request

GET /my-multipart-object?attributes HTTP/1.1
Host: {{bucketName}}.s3.example.com
Date: Wed, 28 Oct 2009 22:32:00 GMT
Authorization: {{authorizationString}}
x-amz-object-attributes: ObjectParts,ObjectSize

Response

HTTP/1.1 200 OK
x-amz-id-2: eftixk72aD6Ap51TnqcoF8eFidJG9Z/2
x-amz-request-id: 318BC8BC148832E5
Date: Wed, 28 Oct 2009 22:32:00 GMT
Last-Modified: Sun, 1 Jan 2006 12:00:00 GMT
Content-Type: application/xml
Server: ScalityS3

<?xml version="1.0" encoding="UTF-8"?>
<GetObjectAttributesResponse>
  <ObjectSize>209715200</ObjectSize>
  <ObjectParts>
    <PartsCount>5</PartsCount>
  </ObjectParts>
</GetObjectAttributesResponse>

Getting Attributes of a Specific Version of an Object

Request

GET /my-object?attributes&versionId=3/L4kqtJlcpXroDTDmpUMLUo HTTP/1.1
Host: {{bucketName}}.s3.example.com
Date: Wed, 28 Oct 2009 22:32:00 GMT
Authorization: {{authorizationString}}
x-amz-object-attributes: ETag,ObjectSize,StorageClass

Response

HTTP/1.1 200 OK
x-amz-id-2: eftixk72aD6Ap51TnqcoF8eFidJG9Z/2
x-amz-request-id: 318BC8BC148832E5
Date: Wed, 28 Oct 2009 22:32:00 GMT
Last-Modified: Sun, 1 Jan 2006 12:00:00 GMT
x-amz-version-id: 3/L4kqtJlcpXroDTDmJ+rmSpXd3QBpUMLUo
Content-Type: application/xml
Server: ScalityS3

<?xml version="1.0" encoding="UTF-8"?>
<GetObjectAttributesResponse>
  <ETag>fba9dede5f27731c9771645a39863328</ETag>
  <StorageClass>STANDARD</StorageClass>
  <ObjectSize>434234</ObjectSize>
</GetObjectAttributesResponse>

Getting Object Attributes with User-Defined Metadata

This example uses the x-amz-meta-* Scality extension value in the x-amz-object-attributes header to retrieve user-defined metadata along with standard object attributes.

Request

GET /my-object?attributes HTTP/1.1
Host: {{bucketName}}.s3.example.com
Date: Wed, 28 Oct 2009 22:32:00 GMT
Authorization: {{authorizationString}}
x-amz-object-attributes: ETag,ObjectSize,StorageClass,x-amz-meta-*

Response

HTTP/1.1 200 OK
x-amz-id-2: eftixk72aD6Ap51TnqcoF8eFidJG9Z/2
x-amz-request-id: 318BC8BC148832E5
Date: Wed, 28 Oct 2009 22:32:00 GMT
Last-Modified: Wed, 12 Oct 2009 17:50:00 GMT
Content-Type: application/xml
Server: ScalityS3

<?xml version="1.0" encoding="UTF-8"?>
<GetObjectAttributesResponse>
  <ETag>fba9dede5f27731c9771645a39863328</ETag>
  <StorageClass>STANDARD</StorageClass>
  <ObjectSize>434234</ObjectSize>
  <x-amz-meta-department>Legal</x-amz-meta-department>
  <x-amz-meta-project>compliance-2026</x-amz-meta-project>
</GetObjectAttributesResponse>