S3 / Client / list_object_annotations

list_object_annotations

S3.Client.list_object_annotations(**kwargs)

Lists the annotations attached to an Amazon S3 object. Results are paginated, with a maximum of 1,000 annotations per object. Use the AnnotationPrefix parameter to filter the results by name prefix.

To use this operation, you must have the s3:ListObjectAnnotations permission.

Note

Annotations are not supported by the following features: S3 Inventory Reports, API Gateway, S3 Storage Lens, Amazon S3 File Gateway, Amazon FSx, S3 on Outposts, and S3 Express One Zone (directory buckets).

The following operations are related to ListObjectAnnotations:

See also: AWS API Documentation

Request Syntax

response = client.list_object_annotations(
    Bucket='string',
    Key='string',
    VersionId='string',
    MaxAnnotationResults=123,
    AnnotationPrefix='string',
    ContinuationToken='string',
    RequestPayer='requester',
    ExpectedBucketOwner='string'
)
Parameters:
  • Bucket (string) –

    [REQUIRED]

    The name of the bucket that contains the object.

  • Key (string) –

    [REQUIRED]

    The object key.

  • VersionId (string) – The version ID of the object.

  • MaxAnnotationResults (integer) – The maximum number of annotations to return in the response. Maximum is 1,000.

  • AnnotationPrefix (string) – Filter results to annotations whose name begins with the specified prefix.

  • ContinuationToken (string) – Continuation token returned by a previous request to retrieve the next page.

  • RequestPayer (string) –

    Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for the corresponding charges. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.

    Note

    This functionality is not supported for directory buckets.

  • ExpectedBucketOwner (string) – The account ID of the expected bucket owner.

Return type:

dict

Returns:

Response Syntax

{
    'Annotations': [
        {
            'AnnotationName': 'string',
            'LastModified': datetime(2015, 1, 1),
            'ETag': 'string',
            'ChecksumAlgorithm': [
                'CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME'|'SHA512'|'MD5'|'XXHASH64'|'XXHASH3'|'XXHASH128',
            ],
            'Size': 123,
            'ReplicationStatus': 'COMPLETE'|'PENDING'|'FAILED'|'REPLICA'|'COMPLETED'
        },
    ],
    'Bucket': 'string',
    'Key': 'string',
    'ObjectVersionId': 'string',
    'AnnotationPrefix': 'string',
    'MaxAnnotationResults': 123,
    'AnnotationCount': 123,
    'ContinuationToken': 'string',
    'NextContinuationToken': 'string',
    'RequestCharged': 'requester'
}

Response Structure

  • (dict) –

    • Annotations (list) –

      The list of annotations attached to the object.

      • (dict) –

        Describes a single annotation attached to an object, including its name, last modified time, size, ETag, checksum algorithm, and replication status. Returned in the response from ListObjectAnnotations.

        • AnnotationName (string) –

          The name of the annotation.

        • LastModified (datetime) –

          The date and time the annotation was last modified.

        • ETag (string) –

          The entity tag of the annotation.

        • ChecksumAlgorithm (list) –

          The checksum algorithm used for the annotation.

          • (string) –

        • Size (integer) –

          The size of the annotation payload, in bytes.

        • ReplicationStatus (string) –

          The replication status of the annotation.

    • Bucket (string) –

      The bucket name.

    • Key (string) –

      The object key.

    • ObjectVersionId (string) –

      The version ID of the object.

    • AnnotationPrefix (string) –

      The prefix used to filter the response.

    • MaxAnnotationResults (integer) –

      The maximum number of annotations returned in the response.

    • AnnotationCount (integer) –

      The number of annotations returned.

    • ContinuationToken (string) –

      The continuation token used in this request.

    • NextContinuationToken (string) –

      The continuation token to use to retrieve the next page of results.

    • RequestCharged (string) –

      If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the Amazon Simple Storage Service user guide.

      Note

      This functionality is not supported for directory buckets.

Exceptions