put_object_annotation
async
¶
put_object_annotation(
bucket: BucketName,
key: ObjectKey,
annotation_name: AnnotationName,
annotation_payload: Body[AsyncIterator[bytes]] | AsyncIterator[bytes] | bytes,
*,
config_overrides: Optional[AsyncS3ClientConfig] = None,
version_id: Optional[ObjectVersionId] = None,
object_if_match: Optional[ObjectIfMatch] = None,
checksum_algorithm: Optional[ChecksumAlgorithm] = None,
checksum_crc32: Optional[ChecksumCRC32] = None,
checksum_crc32_c: Optional[ChecksumCRC32C] = None,
checksum_crc64_nvme: Optional[ChecksumCRC64NVME] = None,
checksum_sha1: Optional[ChecksumSHA1] = None,
checksum_sha256: Optional[ChecksumSHA256] = None,
checksum_sha512: Optional[ChecksumSHA512] = None,
checksum_md5: Optional[ChecksumMD5] = None,
checksum_xxhash64: Optional[ChecksumXXHASH64] = None,
checksum_xxhash3: Optional[ChecksumXXHASH3] = None,
checksum_xxhash128: Optional[ChecksumXXHASH128] = None,
content_md5: Optional[ContentMD5] = None,
request_payer: Optional[RequestPayer] = None,
expected_bucket_owner: Optional[AccountId] = 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.
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:
-
bucket(BucketName) –The name of the bucket that contains the object.
-
key(ObjectKey) –The object key.
-
version_id(Optional[ObjectVersionId], default:None) –The version ID of the object to attach the annotation to.
-
annotation_name(AnnotationName) –The name of the annotation.
Length Constraints: Minimum length of 1. Maximum length of 512 bytes.
-
annotation_payload(Body[AsyncIterator[bytes]] | AsyncIterator[bytes] | bytes) –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.
-
object_if_match(Optional[ObjectIfMatch], default:None) –If specified, the operation only succeeds if the object's ETag matches the provided value.
-
checksum_algorithm(Optional[ChecksumAlgorithm], default:None) –The checksum algorithm to use. Supported values:
CRC32,CRC32C,CRC64NVME,SHA1,SHA256,SHA512,MD5,XXHASH64,XXHASH3,XXHASH128. -
checksum_crc32(Optional[ChecksumCRC32], default:None) –Base64-encoded CRC32 checksum of the annotation payload.
-
checksum_crc32_c(Optional[ChecksumCRC32C], default:None) –Base64-encoded CRC32C checksum of the annotation payload.
-
checksum_crc64_nvme(Optional[ChecksumCRC64NVME], default:None) –Base64-encoded CRC64NVME checksum of the annotation payload.
-
checksum_sha1(Optional[ChecksumSHA1], default:None) –Base64-encoded SHA1 checksum of the annotation payload.
-
checksum_sha256(Optional[ChecksumSHA256], default:None) –Base64-encoded SHA256 checksum of the annotation payload.
-
checksum_sha512(Optional[ChecksumSHA512], default:None) –Base64-encoded SHA512 checksum of the annotation payload.
-
checksum_md5(Optional[ChecksumMD5], default:None) –Base64-encoded MD5 checksum of the annotation payload.
-
checksum_xxhash64(Optional[ChecksumXXHASH64], default:None) –Base64-encoded XXHASH64 checksum of the annotation payload.
-
checksum_xxhash3(Optional[ChecksumXXHASH3], default:None) –Base64-encoded XXHASH3 checksum of the annotation payload.
-
checksum_xxhash128(Optional[ChecksumXXHASH128], default:None) –Base64-encoded XXHASH128 checksum of the annotation payload.
-
content_md5(Optional[ContentMD5], default:None) –Base64-encoded MD5 digest of the message.
-
expected_bucket_owner(Optional[AccountId], default: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.
Raises:
-
AnnotationLimitExceeded–The request would exceed the maximum number of annotations allowed per object.
-
AnnotationNameTooLong–The annotation name exceeds 512 bytes.
-
InvalidAnnotationName–The annotation name you provided is invalid.
-
InvalidRequest–A parameter or header in your request isn't valid. For details, see the description of this API operation.
-
NoSuchBucket–The specified bucket does not exist.
-
NoSuchKey–The specified key does not exist.
-
UnsupportedMediaType–The annotation payload is not valid UTF-8 encoded text.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_s3/_services/async_s3.py
8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 8681 8682 8683 8684 8685 8686 8687 8688 8689 8690 8691 8692 8693 8694 8695 8696 8697 8698 8699 8700 8701 8702 8703 8704 8705 8706 8707 8708 8709 8710 8711 8712 8713 8714 8715 8716 8717 8718 8719 8720 8721 8722 8723 8724 8725 8726 8727 8728 8729 8730 8731 8732 8733 8734 8735 8736 8737 8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 | |