write_get_object_response
¶
write_get_object_response(
request_route: RequestRoute,
request_token: RequestToken,
*,
config_overrides: Optional[S3ClientConfig] = None,
body: Optional[Body[Iterator[bytes]] | Iterator[bytes] | bytes] = None,
status_code: Optional[GetObjectResponseStatusCode] = None,
error_code: Optional[ErrorCode] = None,
error_message: Optional[ErrorMessage] = None,
accept_ranges: Optional[AcceptRanges] = None,
cache_control: Optional[CacheControl] = None,
content_disposition: Optional[ContentDisposition] = None,
content_encoding: Optional[ContentEncoding] = None,
content_language: Optional[ContentLanguage] = None,
content_length: Optional[ContentLength] = None,
content_range: Optional[ContentRange] = None,
content_type: Optional[ContentType] = 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,
delete_marker: Optional[DeleteMarker] = None,
e_tag: Optional[ETag] = None,
expires: Optional[Expires] = None,
expiration: Optional[Expiration] = None,
last_modified: Optional[LastModified] = None,
missing_meta: Optional[MissingMeta] = None,
metadata: Optional[Metadata] = None,
object_lock_mode: Optional[ObjectLockMode] = None,
object_lock_legal_hold_status: Optional[ObjectLockLegalHoldStatus] = None,
object_lock_retain_until_date: Optional[ObjectLockRetainUntilDate] = None,
parts_count: Optional[PartsCount] = None,
replication_status: Optional[ReplicationStatus] = None,
request_charged: Optional[RequestCharged] = None,
restore: Optional[Restore] = None,
server_side_encryption: Optional[ServerSideEncryption] = None,
sse_customer_algorithm: Optional[SSECustomerAlgorithm] = None,
ssekms_key_id: Optional[SSEKMSKeyId] = None,
sse_customer_key_md5: Optional[SSECustomerKeyMD5] = None,
storage_class: Optional[StorageClass] = None,
tag_count: Optional[TagCount] = None,
version_id: Optional[ObjectVersionId] = None,
bucket_key_enabled: Optional[BucketKeyEnabled] = None,
) -> None
This operation is not supported for directory buckets.
Passes transformed objects to a GetObject operation when using Object Lambda access points. For information about Object Lambda access points, see Transforming objects with Object Lambda access points in the Amazon S3 User Guide.
This operation supports metadata that can be returned by GetObject, in addition to RequestRoute, RequestToken, StatusCode, ErrorCode, and ErrorMessage. The GetObject response metadata is supported so that the WriteGetObjectResponse caller, typically an Lambda function, can provide the same metadata when it internally invokes GetObject. When WriteGetObjectResponse is called by a customer-owned Lambda function, the metadata returned to the end user GetObject call might differ from what Amazon S3 would normally return.
You can include any number of metadata headers. When including a metadata header, it should be prefaced with x-amz-meta. For example, x-amz-meta-my-custom-header: MyCustomValue. The primary use case for this is to forward GetObject metadata.
Amazon Web Services provides some prebuilt Lambda functions that you can use with S3 Object Lambda to detect and redact personally identifiable information (PII) and decompress S3 objects. These Lambda functions are available in the Amazon Web Services Serverless Application Repository, and can be selected through the Amazon Web Services Management Console when you create your Object Lambda access point.
Example 1: PII Access Control - This Lambda function uses Amazon Comprehend, a natural language processing (NLP) service using machine learning to find insights and relationships in text. It automatically detects personally identifiable information (PII) such as names, addresses, dates, credit card numbers, and social security numbers from documents in your Amazon S3 bucket.
Example 2: PII Redaction - This Lambda function uses Amazon Comprehend, a natural language processing (NLP) service using machine learning to find insights and relationships in text. It automatically redacts personally identifiable information (PII) such as names, addresses, dates, credit card numbers, and social security numbers from documents in your Amazon S3 bucket.
Example 3: Decompression - The Lambda function S3ObjectLambdaDecompression, is equipped to decompress objects stored in S3 in one of six compressed file formats including bzip2, gzip, snappy, zlib, zstandard and ZIP.
For information on how to view and use these functions, see Using Amazon Web Services built Lambda functions in the Amazon S3 User Guide.
You must URL encode any signed header values that contain spaces. For example, if your header value is my file.txt, containing two spaces after my, you must URL encode this value to my%20%20file.txt.
Parameters:
-
request_route(RequestRoute) –Route prefix to the HTTP URL generated.
-
request_token(RequestToken) –A single use encrypted token that maps
WriteGetObjectResponseto the end userGetObjectrequest. -
body(Optional[Body[Iterator[bytes]] | Iterator[bytes] | bytes], default:None) –The object data.
-
status_code(Optional[GetObjectResponseStatusCode], default:None) –The integer status code for an HTTP response of a corresponding
GetObjectrequest. The following is a list of status codes.-
200 - OK -
206 - Partial Content -
304 - Not Modified -
400 - Bad Request -
401 - Unauthorized -
403 - Forbidden -
404 - Not Found -
405 - Method Not Allowed -
409 - Conflict -
411 - Length Required -
412 - Precondition Failed -
416 - Range Not Satisfiable -
500 - Internal Server Error -
503 - Service Unavailable
-
-
error_code(Optional[ErrorCode], default:None) –A string that uniquely identifies an error condition. Returned in the
tag of the error XML response for a correspondingGetObjectcall. Cannot be used with a successfulStatusCodeheader or when the transformed object is provided in the body. All error codes from S3 are sentence-cased. The regular expression (regex) value is"^[A-Z][a-zA-Z]+$". -
error_message(Optional[ErrorMessage], default:None) –Contains a generic description of the error condition. Returned in the
tag of the error XML response for a corresponding GetObjectcall. Cannot be used with a successfulStatusCodeheader or when the transformed object is provided in body. -
accept_ranges(Optional[AcceptRanges], default:None) –Indicates that a range of bytes was specified.
-
cache_control(Optional[CacheControl], default:None) –Specifies caching behavior along the request/reply chain.
-
content_disposition(Optional[ContentDisposition], default:None) –Specifies presentational information for the object.
-
content_encoding(Optional[ContentEncoding], default:None) –Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
-
content_language(Optional[ContentLanguage], default:None) –The language the content is in.
-
content_length(Optional[ContentLength], default:None) –The size of the content body in bytes.
-
content_range(Optional[ContentRange], default:None) –The portion of the object returned in the response.
-
content_type(Optional[ContentType], default:None) –A standard MIME type describing the format of the object data.
-
checksum_crc32(Optional[ChecksumCRC32], default:None) –This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This specifies the Base64 encoded, 32-bit
CRC32checksum of the object returned by the Object Lambda function. This may not match the checksum for the object stored in Amazon S3. Amazon S3 will perform validation of the checksum values only when the originalGetObjectrequest required checksum validation. For more information about checksums, see Checking object integrity in the Amazon S3 User Guide.Only one checksum header can be specified at a time. If you supply multiple checksum headers, this request will fail.
-
checksum_crc32_c(Optional[ChecksumCRC32C], default:None) –This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This specifies the Base64 encoded, 32-bit
CRC32Cchecksum of the object returned by the Object Lambda function. This may not match the checksum for the object stored in Amazon S3. Amazon S3 will perform validation of the checksum values only when the originalGetObjectrequest required checksum validation. For more information about checksums, see Checking object integrity in the Amazon S3 User Guide.Only one checksum header can be specified at a time. If you supply multiple checksum headers, this request will fail.
-
checksum_crc64_nvme(Optional[ChecksumCRC64NVME], default:None) –This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit
CRC64NVMEchecksum of the part. For more information, see Checking object integrity in the Amazon S3 User Guide. -
checksum_sha1(Optional[ChecksumSHA1], default:None) –This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This specifies the Base64 encoded, 160-bit
SHA1digest of the object returned by the Object Lambda function. This may not match the checksum for the object stored in Amazon S3. Amazon S3 will perform validation of the checksum values only when the originalGetObjectrequest required checksum validation. For more information about checksums, see Checking object integrity in the Amazon S3 User Guide.Only one checksum header can be specified at a time. If you supply multiple checksum headers, this request will fail.
-
checksum_sha256(Optional[ChecksumSHA256], default:None) –This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This specifies the Base64 encoded, 256-bit
SHA256digest of the object returned by the Object Lambda function. This may not match the checksum for the object stored in Amazon S3. Amazon S3 will perform validation of the checksum values only when the originalGetObjectrequest required checksum validation. For more information about checksums, see Checking object integrity in the Amazon S3 User Guide.Only one checksum header can be specified at a time. If you supply multiple checksum headers, this request will fail.
-
checksum_sha512(Optional[ChecksumSHA512], default:None) –This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 512-bit
SHA512digest of the part. For more information, see Checking object integrity in the Amazon S3 User Guide. -
checksum_md5(Optional[ChecksumMD5], default:None) –This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 128-bit
MD5digest of the part. For more information, see Checking object integrity in the Amazon S3 User Guide. -
checksum_xxhash64(Optional[ChecksumXXHASH64], default:None) –This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit
XXHASH64checksum of the part. For more information, see Checking object integrity in the Amazon S3 User Guide. -
checksum_xxhash3(Optional[ChecksumXXHASH3], default:None) –This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit
XXHASH3checksum of the part. For more information, see Checking object integrity in the Amazon S3 User Guide. -
checksum_xxhash128(Optional[ChecksumXXHASH128], default:None) –This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 128-bit
XXHASH128checksum of the part. For more information, see Checking object integrity in the Amazon S3 User Guide. -
delete_marker(Optional[DeleteMarker], default:None) –Specifies whether an object stored in Amazon S3 is (
true) or is not (false) a delete marker. To learn more about delete markers, see Working with delete markers. -
e_tag(Optional[ETag], default:None) –An opaque identifier assigned by a web server to a specific version of a resource found at a URL.
-
expires(Optional[Expires], default:None) –The date and time at which the object is no longer cacheable.
-
expiration(Optional[Expiration], default:None) –If the object expiration is configured (see PUT Bucket lifecycle), the response includes this header. It includes the
expiry-dateandrule-idkey-value pairs that provide the object expiration information. The value of therule-idis URL-encoded. -
last_modified(Optional[LastModified], default:None) –The date and time that the object was last modified.
-
missing_meta(Optional[MissingMeta], default:None) –Set to the number of metadata entries not returned in
x-amz-metaheaders. This can happen if you create metadata using an API like SOAP that supports more flexible metadata than the REST API. For example, using SOAP, you can create metadata whose values are not legal HTTP headers. -
metadata(Optional[Metadata], default:None) –A map of metadata to store with the object in S3.
-
object_lock_mode(Optional[ObjectLockMode], default:None) –Indicates whether an object stored in Amazon S3 has Object Lock enabled. For more information about S3 Object Lock, see Object Lock.
-
object_lock_legal_hold_status(Optional[ObjectLockLegalHoldStatus], default:None) –Indicates whether an object stored in Amazon S3 has an active legal hold.
-
object_lock_retain_until_date(Optional[ObjectLockRetainUntilDate], default:None) –The date and time when Object Lock is configured to expire.
-
parts_count(Optional[PartsCount], default:None) –The count of parts this object has.
-
replication_status(Optional[ReplicationStatus], default:None) –Indicates if request involves bucket that is either a source or destination in a Replication rule. For more information about S3 Replication, see Replication.
-
restore(Optional[Restore], default:None) –Provides information about object restoration operation and expiration time of the restored object copy.
-
server_side_encryption(Optional[ServerSideEncryption], default:None) –The server-side encryption algorithm used when storing requested object in Amazon S3 or Amazon FSx.
When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is
aws:fsx. -
sse_customer_algorithm(Optional[SSECustomerAlgorithm], default:None) –Encryption algorithm used if server-side encryption with a customer-provided encryption key was specified for object stored in Amazon S3.
-
ssekms_key_id(Optional[SSEKMSKeyId], default:None) –If present, specifies the ID (Key ID, Key ARN, or Key Alias) of the Amazon Web Services Key Management Service (Amazon Web Services KMS) symmetric encryption customer managed key that was used for stored in Amazon S3 object.
-
sse_customer_key_md5(Optional[SSECustomerKeyMD5], default:None) –128-bit MD5 digest of customer-provided encryption key used in Amazon S3 to encrypt data stored in S3. For more information, see Protecting data using server-side encryption with customer-provided encryption keys (SSE-C).
-
storage_class(Optional[StorageClass], default:None) –Provides storage class information of the object. Amazon S3 returns this header for all objects except for S3 Standard storage class objects.
For more information, see Storage Classes.
-
tag_count(Optional[TagCount], default:None) –The number of tags, if any, on the object.
-
version_id(Optional[ObjectVersionId], default:None) –An ID used to reference a specific version of the object.
-
bucket_key_enabled(Optional[BucketKeyEnabled], default:None) –Indicates whether the object stored in Amazon S3 uses an S3 bucket key for server-side encryption with Amazon Web Services KMS (SSE-KMS).
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_s3/_services/s3.py
10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 10199 10200 10201 10202 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 10218 10219 10220 10221 10222 10223 10224 10225 10226 10227 10228 10229 10230 10231 10232 10233 10234 10235 10236 10237 10238 10239 10240 10241 10242 10243 10244 10245 10246 10247 10248 10249 10250 10251 10252 10253 10254 10255 10256 10257 10258 10259 10260 10261 10262 10263 10264 10265 10266 10267 10268 10269 10270 10271 10272 10273 10274 10275 10276 10277 10278 10279 10280 10281 10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 10298 10299 10300 10301 10302 10303 10304 10305 10306 10307 10308 10309 10310 10311 10312 10313 10314 10315 10316 10317 10318 10319 10320 10321 10322 10323 10324 10325 10326 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 10339 10340 | |