Skip to content

S3  >  Operations  >  put_object_annotation

put_object_annotation

Operation

put_object_annotation async

put_object_annotation(input: PutObjectAnnotationInput, plugins: list[Plugin] | None = None) -> PutObjectAnnotationOutput

Attaches an annotation to an Amazon S3 object. An annotation is a named payload of 1 byte to 1 MiB that you can associate with a specific object or object version. Each object can have up to 1,000 annotations.

For annotation naming rules and restrictions, see Annotation naming guidelines in the Amazon S3 User Guide.

Annotations inherit the encryption of their parent object. For objects without server-side encryption, annotations are encrypted with SSE-S3 (the default for new objects). Objects encrypted with SSE-C cannot have annotations.

To use this operation, you must have the s3:PutObjectAnnotation permission. If the bucket has Requester Pays enabled, you must include the x-amz-request-payer header.

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 PutObjectAnnotation:

Parameters:

Name Type Description Default
input PutObjectAnnotationInput

An instance of PutObjectAnnotationInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
PutObjectAnnotationOutput

An instance of PutObjectAnnotationOutput.

Input

PutObjectAnnotationInput dataclass

Bases: _SerdeShape

Dataclass for PutObjectAnnotationInput structure.

Attributes

annotation_name class-attribute instance-attribute
annotation_name: str | None = ...

The name of the annotation.

Length Constraints: Minimum length of 1. Maximum length of 512 bytes.

annotation_payload class-attribute instance-attribute
annotation_payload: StreamingBlob | None = ...

The annotation payload. Must be between 1 byte and 1 MiB in size, and must be valid UTF-8 encoded text. If the payload contains invalid UTF-8 bytes, the request fails with HTTP 415 (Unsupported Media Type). To store binary data, encode the payload using Base64 before uploading.

bucket class-attribute instance-attribute
bucket: str | None = ...

The name of the bucket that contains the object.

checksum_algorithm class-attribute instance-attribute
checksum_algorithm: str | None = ...

The checksum algorithm to use. Supported values: CRC32, CRC32C, CRC64NVME, SHA1, SHA256, SHA512, MD5, XXHASH64, XXHASH3, XXHASH128.

checksum_crc32 class-attribute instance-attribute
checksum_crc32: str | None = ...

Base64-encoded CRC32 checksum of the annotation payload.

checksum_crc32_c class-attribute instance-attribute
checksum_crc32_c: str | None = ...

Base64-encoded CRC32C checksum of the annotation payload.

checksum_crc64_nvme class-attribute instance-attribute
checksum_crc64_nvme: str | None = ...

Base64-encoded CRC64NVME checksum of the annotation payload.

checksum_md5 class-attribute instance-attribute
checksum_md5: str | None = ...

Base64-encoded MD5 checksum of the annotation payload.

checksum_sha1 class-attribute instance-attribute
checksum_sha1: str | None = ...

Base64-encoded SHA1 checksum of the annotation payload.

checksum_sha256 class-attribute instance-attribute
checksum_sha256: str | None = ...

Base64-encoded SHA256 checksum of the annotation payload.

checksum_sha512 class-attribute instance-attribute
checksum_sha512: str | None = ...

Base64-encoded SHA512 checksum of the annotation payload.

checksum_xxhash128 class-attribute instance-attribute
checksum_xxhash128: str | None = ...

Base64-encoded XXHASH128 checksum of the annotation payload.

checksum_xxhash3 class-attribute instance-attribute
checksum_xxhash3: str | None = ...

Base64-encoded XXHASH3 checksum of the annotation payload.

checksum_xxhash64 class-attribute instance-attribute
checksum_xxhash64: str | None = ...

Base64-encoded XXHASH64 checksum of the annotation payload.

content_md5 class-attribute instance-attribute
content_md5: str | None = ...

Base64-encoded MD5 digest of the message.

expected_bucket_owner class-attribute instance-attribute
expected_bucket_owner: str | None = ...

The account ID of the expected bucket owner. If the bucket is owned by a different account, the request fails with an HTTP 403 (Access Denied) error.

key class-attribute instance-attribute
key: str | None = ...

The object key.

object_if_match class-attribute instance-attribute
object_if_match: str | None = ...

If specified, the operation only succeeds if the object's ETag matches the provided value.

request_payer class-attribute instance-attribute
request_payer: str | None = ...

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.

version_id class-attribute instance-attribute
version_id: str | None = ...

The version ID of the object to attach the annotation to.

Output

PutObjectAnnotationOutput dataclass

Bases: _SerdeShape

Dataclass for PutObjectAnnotationOutput structure.

Attributes

annotation_name class-attribute instance-attribute
annotation_name: str | None = ...

The name of the annotation.

checksum_crc32 class-attribute instance-attribute
checksum_crc32: str | None = ...

The CRC32 checksum of the stored annotation.

checksum_crc32_c class-attribute instance-attribute
checksum_crc32_c: str | None = ...

The CRC32C checksum of the stored annotation.

checksum_crc64_nvme class-attribute instance-attribute
checksum_crc64_nvme: str | None = ...

The CRC64NVME checksum of the stored annotation.

checksum_md5 class-attribute instance-attribute
checksum_md5: str | None = ...

The MD5 checksum of the stored annotation.

checksum_sha1 class-attribute instance-attribute
checksum_sha1: str | None = ...

The SHA1 checksum of the stored annotation.

checksum_sha256 class-attribute instance-attribute
checksum_sha256: str | None = ...

The SHA256 checksum of the stored annotation.

checksum_sha512 class-attribute instance-attribute
checksum_sha512: str | None = ...

The SHA512 checksum of the stored annotation.

checksum_type class-attribute instance-attribute
checksum_type: str | None = ...

The type of checksum used.

checksum_xxhash128 class-attribute instance-attribute
checksum_xxhash128: str | None = ...

The XXHASH128 checksum of the stored annotation.

checksum_xxhash3 class-attribute instance-attribute
checksum_xxhash3: str | None = ...

The XXHASH3 checksum of the stored annotation.

checksum_xxhash64 class-attribute instance-attribute
checksum_xxhash64: str | None = ...

The XXHASH64 checksum of the stored annotation.

e_tag class-attribute instance-attribute
e_tag: str | None = ...

The entity tag of the annotation.

key class-attribute instance-attribute
key: str | None = ...

The object key.

object_version_id class-attribute instance-attribute
object_version_id: str | None = ...

The version ID of the object that the annotation was attached to.

request_charged class-attribute instance-attribute
request_charged: str | None = ...

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.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

server_side_encryption class-attribute instance-attribute
server_side_encryption: str | None = ...

The server-side encryption algorithm used to encrypt the annotation.