Values.GetObjectOutputSourceRetrieves an object from Amazon S3. In the GetObject request, specify the full key name for the object. General purpose buckets - Both the virtual-hosted-style requests and the path-style requests are supported. For a virtual hosted-style request example, if you have the object photos/2006/February/sample.jpg, specify the object key name as /photos/2006/February/sample.jpg. For a path-style request example, if you have the object photos/2006/February/sample.jpg in the bucket named examplebucket, specify the object key name as /examplebucket/photos/2006/February/sample.jpg. For more information about request types, see HTTP Host Header Bucket Specification in the Amazon S3 User Guide. Directory buckets - Only virtual-hosted-style requests are supported. For a virtual hosted-style request example, if you have the object photos/2006/February/sample.jpg in the bucket named amzn-s3-demo-bucket--usw2-az1--x-s3, specify the object key name as /photos/2006/February/sample.jpg. Also, when you make requests to this API operation, your requests are sent to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format https://bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name . Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the Amazon S3 User Guide. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the Amazon S3 User Guide. Permissions General purpose bucket permissions - You must have the required permissions in a policy. To use GetObject, you must have the READ access to the object (or version). If you grant READ access to the anonymous user, the GetObject operation returns the object without using an authorization header. For more information, see Specifying permissions in a policy in the Amazon S3 User Guide. If you include a versionId in your request header, you must have the s3:GetObjectVersion permission to access a specific version of an object. The s3:GetObject permission is not required in this scenario. If you request the current version of an object without a specific versionId in the request header, only the s3:GetObject permission is required. The s3:GetObjectVersion permission is not required in this scenario. If the object that you request doesn’t exist, the error that Amazon S3 returns depends on whether you also have the s3:ListBucket permission. If you have the s3:ListBucket permission on the bucket, Amazon S3 returns an HTTP status code 404 Not Found error. If you don’t have the s3:ListBucket permission, Amazon S3 returns an HTTP status code 403 Access Denied error. Directory bucket permissions - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the s3express:CreateSession permission to the directory bucket in a bucket policy or an IAM identity-based policy. Then, you make the CreateSession API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another CreateSession API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession . If the object is encrypted using SSE-KMS, you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key. Storage classes If the object you are retrieving is stored in the S3 Glacier Flexible Retrieval storage class, the S3 Glacier Deep Archive storage class, the S3 Intelligent-Tiering Archive Access tier, or the S3 Intelligent-Tiering Deep Archive Access tier, before you can retrieve the object you must first restore a copy using RestoreObject. Otherwise, this operation returns an InvalidObjectState error. For information about restoring archived objects, see Restoring Archived Objects in the Amazon S3 User Guide. Directory buckets - Directory buckets only support EXPRESS_ONEZONE (the S3 Express One Zone storage class) in Availability Zones and ONEZONE_IA (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. Unsupported storage class values won't write a destination object and will respond with the HTTP status code 400 Bad Request. Encryption Encryption request headers, like x-amz-server-side-encryption, should not be sent for the GetObject requests, if your object uses server-side encryption with Amazon S3 managed encryption keys (SSE-S3), server-side encryption with Key Management Service (KMS) keys (SSE-KMS), or dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS). If you include the header in your GetObject requests for the object that uses these types of keys, you’ll get an HTTP 400 Bad Request error. Directory buckets - For directory buckets, there are only two supported options for server-side encryption: SSE-S3 and SSE-KMS. SSE-C isn't supported. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. Overriding response header values through the request There are times when you want to override certain response header values of a GetObject response. For example, you might override the Content-Disposition response header value through your GetObject request. You can override values for a set of response headers. These modified response header values are included only in a successful response, that is, when the HTTP status code 200 OK is returned. The headers you can override using the following query parameters in the request are a subset of the headers that Amazon S3 accepts when you create an object. The response headers that you can override for the GetObject response are Cache-Control, Content-Disposition, Content-Encoding, Content-Language, Content-Type, and Expires. To override values for a set of response headers in the GetObject response, you can use the following query parameters in the request. response-cache-control response-content-disposition response-content-encoding response-content-language response-content-type response-expires When you use these parameters, you must sign the request by using either an Authorization header or a presigned URL. These parameters cannot be used with an unsigned (anonymous) request. HTTP Host header syntax Directory buckets - The HTTP Host header syntax is Bucket-name.s3express-zone-id.region-code.amazonaws.com. The following operations are related to GetObject: ListBuckets GetObjectAcl 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.
type nonrec t = {body : Body.t option;Object data.
*)deleteMarker : DeleteMarker.t option;Indicates whether the object retrieved was (true) or was not (false) a Delete Marker. If false, this response header does not appear in the response. If the current version of the object is a delete marker, Amazon S3 behaves as if the object was deleted and includes x-amz-delete-marker: true in the response. If the specified version in the request is a delete marker, the response returns a 405 Method Not Allowed error and the Last-Modified: timestamp response header.
*)acceptRanges : AcceptRanges.t option;Indicates that a range of bytes was specified in the request.
*)expiration : Expiration.t option;If the object expiration is configured (see PutBucketLifecycleConfiguration ), the response includes this header. It includes the expiry-date and rule-id key-value pairs providing object expiration information. The value of the rule-id is URL-encoded. Object expiration information is not returned in directory buckets and this header returns the value "NotImplemented" in all responses for directory buckets.
*)restore : Restore.t option;Provides information about object restoration action and expiration time of the restored object copy. This functionality is not supported for directory buckets. Directory buckets only support EXPRESS_ONEZONE (the S3 Express One Zone storage class) in Availability Zones and ONEZONE_IA (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones.
*)lastModified : LastModified.t option;Date and time when the object was last modified. General purpose buckets - When you specify a versionId of the object in your request, if the specified version in the request is a delete marker, the response returns a 405 Method Not Allowed error and the Last-Modified: timestamp response header.
*)contentLength : ContentLength.t option;Size of the body in bytes.
*)eTag : ETag.t option;An entity tag (ETag) is an opaque identifier assigned by a web server to a specific version of a resource found at a URL.
*)checksumCRC32 : ChecksumCRC32.t option;The Base64 encoded, 32-bit CRC32 checksum of the object. This checksum is only present if the object was uploaded with the object. For more information, see Checking object integrity in the Amazon S3 User Guide.
*)checksumCRC32C : ChecksumCRC32C.t option;The Base64 encoded, 32-bit CRC32C checksum of the object. This checksum is only present if the checksum was uploaded with the object. For more information, see Checking object integrity in the Amazon S3 User Guide.
*)checksumCRC64NVME : ChecksumCRC64NVME.t option;The Base64 encoded, 64-bit CRC64NVME checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.
*)checksumSHA1 : ChecksumSHA1.t option;The Base64 encoded, 160-bit SHA1 digest of the object. This checksum is only present if the checksum was uploaded with the object. For more information, see Checking object integrity in the Amazon S3 User Guide.
*)checksumSHA256 : ChecksumSHA256.t option;The Base64 encoded, 256-bit SHA256 digest of the object. This checksum is only present if the checksum was uploaded with the object. For more information, see Checking object integrity in the Amazon S3 User Guide.
*)checksumSHA512 : ChecksumSHA512.t option;The Base64 encoded, 512-bit SHA512 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.
*)checksumMD5 : ChecksumMD5.t option;The Base64 encoded, 128-bit MD5 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.
*)checksumXXHASH64 : ChecksumXXHASH64.t option;The Base64 encoded, 64-bit XXHASH64 checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.
*)checksumXXHASH3 : ChecksumXXHASH3.t option;The Base64 encoded, 64-bit XXHASH3 checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.
*)checksumXXHASH128 : ChecksumXXHASH128.t option;The Base64 encoded, 128-bit XXHASH128 checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.
*)checksumType : ChecksumType.t option;The checksum type, which determines how part-level checksums are combined to create an object-level checksum for multipart objects. You can use this header response to verify that the checksum type that is received is the same checksum type that was specified in the CreateMultipartUpload request. For more information, see Checking object integrity in the Amazon S3 User Guide.
*)missingMeta : MissingMeta.t option;This is set to the number of metadata entries not returned in the headers that are prefixed with x-amz-meta-. 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. This functionality is not supported for directory buckets.
*)versionId : ObjectVersionId.t option;Version ID of the object. This functionality is not supported for directory buckets.
*)cacheControl : CacheControl.t option;Specifies caching behavior along the request/reply chain.
*)contentDisposition : ContentDisposition.t option;Specifies presentational information for the object.
*)contentEncoding : ContentEncoding.t option;Indicates 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.
*)contentLanguage : ContentLanguage.t option;The language the content is in.
*)contentRange : ContentRange.t option;The portion of the object returned in the response.
*)contentType : ContentType.t option;A standard MIME type describing the format of the object data.
*)expires : Expires.t option;The date and time at which the object is no longer cacheable.
*)websiteRedirectLocation : WebsiteRedirectLocation.t option;If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata. This functionality is not supported for directory buckets.
*)serverSideEncryption : ServerSideEncryption.t option;The server-side encryption algorithm used when you store this 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.
*)metadata : Metadata.t option;A map of metadata to store with the object in S3.
*)sSECustomerAlgorithm : SSECustomerAlgorithm.t option;If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used. This functionality is not supported for directory buckets.
*)sSECustomerKeyMD5 : SSECustomerKeyMD5.t option;If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key. This functionality is not supported for directory buckets.
*)sSEKMSKeyId : SSEKMSKeyId.t option;If present, indicates the ID of the KMS key that was used for object encryption.
*)bucketKeyEnabled : BucketKeyEnabled.t option;Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).
*)storageClass : StorageClass.t option;Provides storage class information of the object. Amazon S3 returns this header for all objects except for S3 Standard storage class objects. Directory buckets - Directory buckets only support EXPRESS_ONEZONE (the S3 Express One Zone storage class) in Availability Zones and ONEZONE_IA (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones.
*)requestCharged : RequestCharged.t option;replicationStatus : ReplicationStatus.t option;Amazon S3 can return this if your request involves a bucket that is either a source or destination in a replication rule. This functionality is not supported for directory buckets.
*)partsCount : PartsCount.t option;The count of parts this object has. This value is only returned if you specify partNumber in your request and the object was uploaded as a multipart upload.
*)tagCount : TagCount.t option;The number of tags, if any, on the object, when you have the relevant permission to read object tags. You can use GetObjectTagging to retrieve the tag set associated with an object. This functionality is not supported for directory buckets.
*)objectLockMode : ObjectLockMode.t option;The Object Lock mode that's currently in place for this object. This functionality is not supported for directory buckets.
*)objectLockRetainUntilDate : ObjectLockRetainUntilDate.t option;The date and time when this object's Object Lock will expire. This functionality is not supported for directory buckets.
*)objectLockLegalHoldStatus : ObjectLockLegalHoldStatus.t option;Indicates whether this object has an active legal hold. This field is only returned if you have permission to view an object's legal hold status. This functionality is not supported for directory buckets.
*)}type nonrec error = [ | `InvalidObjectState of InvalidObjectState.t| `NoSuchKey of NoSuchKey.t| `Unknown_operation_error of string * string option ]val make :
?body:??? ->
?deleteMarker:??? ->
?acceptRanges:??? ->
?expiration:??? ->
?restore:??? ->
?lastModified:??? ->
?contentLength:??? ->
?eTag:??? ->
?checksumCRC32:??? ->
?checksumCRC32C:??? ->
?checksumCRC64NVME:??? ->
?checksumSHA1:??? ->
?checksumSHA256:??? ->
?checksumSHA512:??? ->
?checksumMD5:??? ->
?checksumXXHASH64:??? ->
?checksumXXHASH3:??? ->
?checksumXXHASH128:??? ->
?checksumType:??? ->
?missingMeta:??? ->
?versionId:??? ->
?cacheControl:??? ->
?contentDisposition:??? ->
?contentEncoding:??? ->
?contentLanguage:??? ->
?contentRange:??? ->
?contentType:??? ->
?expires:??? ->
?websiteRedirectLocation:??? ->
?serverSideEncryption:??? ->
?metadata:??? ->
?sSECustomerAlgorithm:??? ->
?sSECustomerKeyMD5:??? ->
?sSEKMSKeyId:??? ->
?bucketKeyEnabled:??? ->
?storageClass:??? ->
?requestCharged:??? ->
?replicationStatus:??? ->
?partsCount:??? ->
?tagCount:??? ->
?objectLockMode:??? ->
?objectLockRetainUntilDate:??? ->
?objectLockLegalHoldStatus:??? ->
unit ->
tval error_of_json :
string ->
Yojson.Safe.t ->
[> `InvalidObjectState of InvalidObjectState.t
| `NoSuchKey of unit
| `Unknown_operation_error of string * string option ]val error_of_xml :
string ->
Awso.Xml.t ->
[> `InvalidObjectState of InvalidObjectState.t
| `NoSuchKey of unit
| `Unknown_operation_error of string * string option ]val of_header_and_body :
((Base.String.t, AcceptRanges.t) Awso.Import.List.Assoc.t * Body.t) ->
tval to_value :
t ->
[> `Structure of
(string
* [> `Blob of Body.t
| `Boolean of DeleteMarker.t
| `Enum of string
| `Integer of MissingMeta.t
| `Long of ContentLength.t
| `Map of
([> `String of MetadataKey.t ] * [> `String of MetadataValue.t ])
list
| `String of AcceptRanges.t
| `Timestamp of LastModified.t ])
list ]