diff --git a/clients/client-s3/src/commands/PutObjectCommand.ts b/clients/client-s3/src/commands/PutObjectCommand.ts index a6076e3bf0d54..a94502b2c78dd 100644 --- a/clients/client-s3/src/commands/PutObjectCommand.ts +++ b/clients/client-s3/src/commands/PutObjectCommand.ts @@ -263,49 +263,49 @@ export interface PutObjectCommandOutput extends PutObjectOutput, __MetadataBeare * // example id: to-upload-an-object-1481760101010 * ``` * - * @example To upload object and specify user-defined metadata + * @example To upload an object (specify optional headers) * ```javascript - * // The following example creates an object. The request also specifies optional metadata. If the bucket is versioning enabled, S3 returns version ID in response. + * // The following example uploads an object. The request specifies optional request headers to directs S3 to use specific storage class and use server-side encryption. * const input = { - * "Body": "filetoupload", + * "Body": "HappyFace.jpg", * "Bucket": "examplebucket", - * "Key": "exampleobject", - * "Metadata": { - * "metadata1": "value1", - * "metadata2": "value2" - * } + * "Key": "HappyFace.jpg", + * "ServerSideEncryption": "AES256", + * "StorageClass": "STANDARD_IA" * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); * /* response == * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "VersionId": "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0" + * "ServerSideEncryption": "AES256", + * "VersionId": "CG612hodqujkf8FaaNfp8U..FIhLROcp" * } * *\/ - * // example id: to-upload-object-and-specify-user-defined-metadata-1483396974757 + * // example id: to-upload-an-object-(specify-optional-headers) * ``` * - * @example To upload an object (specify optional headers) + * @example To upload object and specify user-defined metadata * ```javascript - * // The following example uploads an object. The request specifies optional request headers to directs S3 to use specific storage class and use server-side encryption. + * // The following example creates an object. The request also specifies optional metadata. If the bucket is versioning enabled, S3 returns version ID in response. * const input = { - * "Body": "HappyFace.jpg", + * "Body": "filetoupload", * "Bucket": "examplebucket", - * "Key": "HappyFace.jpg", - * "ServerSideEncryption": "AES256", - * "StorageClass": "STANDARD_IA" + * "Key": "exampleobject", + * "Metadata": { + * "metadata1": "value1", + * "metadata2": "value2" + * } * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); * /* response == * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "ServerSideEncryption": "AES256", - * "VersionId": "CG612hodqujkf8FaaNfp8U..FIhLROcp" + * "VersionId": "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0" * } * *\/ - * // example id: to-upload-an-object-(specify-optional-headers) + * // example id: to-upload-object-and-specify-user-defined-metadata-1483396974757 * ``` * * @example To upload an object and specify canned ACL. diff --git a/clients/client-s3/src/protocols/Aws_restXml.ts b/clients/client-s3/src/protocols/Aws_restXml.ts index 2e6eae7adc256..579d277e747f5 100644 --- a/clients/client-s3/src/protocols/Aws_restXml.ts +++ b/clients/client-s3/src/protocols/Aws_restXml.ts @@ -492,7 +492,6 @@ export const se_CompleteMultipartUploadCommand = async ( b.p("Bucket", () => input.Bucket!, "{Bucket}", false); b.p("Key", () => input.Key!, "{Key+}", true); const query: any = map({ - [_xi]: [, "CompleteMultipartUpload"], [_uI]: [, __expectNonNull(input[_UI]!, `UploadId`)], }); let body: any; @@ -658,7 +657,6 @@ export const se_CreateMultipartUploadCommand = async ( b.p("Key", () => input.Key!, "{Key+}", true); const query: any = map({ [_u]: [, ""], - [_xi]: [, "CreateMultipartUpload"], }); let body: any; b.m("POST").h(headers).q(query).b(body); @@ -1004,7 +1002,6 @@ export const se_DeleteObjectsCommand = async ( b.p("Bucket", () => input.Bucket!, "{Bucket}", false); const query: any = map({ [_d]: [, ""], - [_xi]: [, "DeleteObjects"], }); let body: any; let contents: any; @@ -2909,7 +2906,6 @@ export const se_RestoreObjectCommand = async ( b.p("Key", () => input.Key!, "{Key+}", true); const query: any = map({ [_res]: [, ""], - [_xi]: [, "RestoreObject"], [_vI]: [, input[_VI]!], }); let body: any; @@ -2945,7 +2941,6 @@ export const se_SelectObjectContentCommand = async ( const query: any = map({ [_se]: [, ""], [_st]: [, "2"], - [_xi]: [, "SelectObjectContent"], }); let body: any; body = _ve; @@ -3108,9 +3103,6 @@ export const se_WriteGetObjectResponseCommand = async ( }, {})), }); b.bp("/WriteGetObjectResponse"); - const query: any = map({ - [_xi]: [, "WriteGetObjectResponse"], - }); let body: any; let contents: any; if (input.Body !== undefined) { @@ -3129,7 +3121,7 @@ export const se_WriteGetObjectResponseCommand = async ( } } b.hn(resolvedHostname); - b.m("POST").h(headers).q(query).b(body); + b.m("POST").h(headers).b(body); return b.build(); }; diff --git a/codegen/sdk-codegen/aws-models/s3.json b/codegen/sdk-codegen/aws-models/s3.json index 2843f9e4358b0..e35fefbb233a9 100644 --- a/codegen/sdk-codegen/aws-models/s3.json +++ b/codegen/sdk-codegen/aws-models/s3.json @@ -18255,7 +18255,7 @@ "smithy.api#documentation": "
Completes a multipart upload by assembling previously uploaded parts.
\nYou first initiate the multipart upload and then upload all parts using the UploadPart\n operation or the UploadPartCopy\n operation. After successfully uploading all relevant parts of an upload, you call this\n CompleteMultipartUpload
operation to complete the upload. Upon receiving this request, Amazon S3 concatenates all the parts\n in ascending order by part number to create a new object. In the CompleteMultipartUpload \n request, you must provide the parts list and ensure that the parts list is complete.\n The CompleteMultipartUpload API operation concatenates the parts that you provide in the list. For each part in the list,\n you must provide the PartNumber
value and the ETag
value that are returned after that part\n was uploaded.
The processing of a CompleteMultipartUpload request could take several minutes to\n finalize. After Amazon S3 begins processing the request, it sends an HTTP response header that\n specifies a 200 OK
response. While processing is in progress, Amazon S3 periodically sends white\n space characters to keep the connection from timing out. A request could fail after the\n initial 200 OK
response has been sent. This means that a 200 OK
response can\n contain either a success or an error. The error response might be embedded in the 200 OK
response. \n If you call this API operation directly, make sure to design\n your application to parse the contents of the response and handle it appropriately. If you\n use Amazon Web Services SDKs, SDKs handle this condition. The SDKs detect the embedded error and apply\n error handling per your configuration settings (including automatically retrying the\n request as appropriate). If the condition persists, the SDKs throw an exception (or, for\n the SDKs that don't use exceptions, they return an error).
Note that if CompleteMultipartUpload
fails, applications should be prepared\n to retry any failed requests (including 500 error responses). For more information, see Amazon S3 Error Best\n Practices.
You can't use Content-Type: application/x-www-form-urlencoded
for the \n CompleteMultipartUpload requests. Also, if you don't provide a\n Content-Type
header, CompleteMultipartUpload
can still return a 200\n OK
response.
For more information about multipart uploads, see Uploading Objects Using Multipart\n Upload in the Amazon S3\n User Guide.
\n\n Directory buckets - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format https://bucket_name.s3express-az_id.region.amazonaws.com/key-name\n
. Path-style requests are not supported. For more information, see Regional and Zonal endpoints in the\n Amazon S3 User Guide.
\n General purpose bucket permissions - For information about permissions required to use the multipart upload API, see Multipart Upload\n and Permissions in the Amazon S3\n User Guide.
\n\n Directory bucket permissions - To grant access to this API operation on a directory bucket, we recommend that you use the \n CreateSession
\n 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. \nAmazon 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 \n CreateSession
\n .
Error Code: EntityTooSmall
\n
Description: Your proposed upload is smaller than the minimum allowed object\n size. Each part must be at least 5 MB in size, except the last part.
\nHTTP Status Code: 400 Bad Request
\nError Code: InvalidPart
\n
Description: One or more of the specified parts could not be found. The part\n might not have been uploaded, or the specified ETag might not have\n matched the uploaded part's ETag.
\nHTTP Status Code: 400 Bad Request
\nError Code: InvalidPartOrder
\n
Description: The list of parts was not in ascending order. The parts list\n must be specified in order by part number.
\nHTTP Status Code: 400 Bad Request
\nError Code: NoSuchUpload
\n
Description: The specified multipart upload does not exist. The upload ID\n might be invalid, or the multipart upload might have been aborted or\n completed.
\nHTTP Status Code: 404 Not Found
\n\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com
.
The following operations are related to CompleteMultipartUpload
:
\n UploadPart\n
\n\n AbortMultipartUpload\n
\n\n ListParts\n
\n\n ListMultipartUploads\n
\nRemoves an object from a bucket. The behavior depends on the bucket's versioning state:
\nIf bucket versioning is not enabled, the operation permanently deletes the object.
\nIf bucket versioning is enabled, the operation inserts a delete marker, which becomes the current version of the object. To permanently delete an object in a versioned bucket, you must include the object’s versionId
in the request. For more information about versioning-enabled buckets, see Deleting object versions from a versioning-enabled bucket.
If bucket versioning is suspended, the operation removes the object that has a null versionId
, if there is one, and inserts a delete marker that becomes the current version of the object. If there isn't an object with a null versionId
, and all versions of the object have a versionId
, Amazon S3 does not remove the object and only inserts a delete marker. To permanently delete an object that has a versionId
, you must include the object’s versionId
in the request. For more information about versioning-suspended buckets, see Deleting objects from versioning-suspended buckets.
\n Directory buckets - S3 Versioning isn't enabled and supported for directory buckets. For this API operation, only the null
value of the version ID is supported by directory buckets. You can only specify null
\n to the versionId
query parameter in the request.
\n Directory buckets - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format https://bucket_name.s3express-az_id.region.amazonaws.com/key-name\n
. Path-style requests are not supported. For more information, see Regional and Zonal endpoints in the\n Amazon S3 User Guide.
To remove a specific version, you must use the versionId
query parameter. Using this\n query parameter permanently deletes the version. If the object deleted is a delete marker, Amazon S3\n sets the response header x-amz-delete-marker
to true.
If the object you want to delete is in a bucket where the bucket versioning\n configuration is MFA Delete enabled, you must include the x-amz-mfa
request\n header in the DELETE versionId
request. Requests that include\n x-amz-mfa
must use HTTPS. For more information about MFA Delete, see Using MFA Delete in the Amazon S3\n User Guide. To see sample\n requests that use versioning, see Sample\n Request.
\n Directory buckets - MFA delete is not supported by directory buckets.
\nYou can delete objects by explicitly calling DELETE Object or calling \n (PutBucketLifecycle) to enable Amazon S3 to remove them for you. If you want to block\n users or accounts from removing or deleting objects from your bucket, you must deny them\n the s3:DeleteObject
, s3:DeleteObjectVersion
, and\n s3:PutLifeCycleConfiguration
actions.
\n Directory buckets - S3 Lifecycle is not supported by directory buckets.
\n\n General purpose bucket permissions - The following permissions are required in your policies when your \n DeleteObjects
request includes specific headers.
\n \n s3:DeleteObject
\n - To delete an object from a bucket, you must always have the s3:DeleteObject
permission.
\n \n s3:DeleteObjectVersion
\n - To delete a specific version of an object from a versioning-enabled bucket, you must have the s3:DeleteObjectVersion
permission.
\n Directory bucket permissions - To grant access to this API operation on a directory bucket, we recommend that you use the \n CreateSession
\n 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. \nAmazon 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 \n CreateSession
\n .
\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com
.
The following action is related to DeleteObject
:
\n PutObject\n
\nThis operation is not supported by directory buckets.
\nReturns the tag-set of an object. You send the GET request against the tagging\n subresource associated with the object.
\nTo use this operation, you must have permission to perform the\n s3:GetObjectTagging
action. By default, the GET action returns information\n about current version of an object. For a versioned bucket, you can have multiple versions\n of an object in your bucket. To retrieve tags of any other version, use the versionId query\n parameter. You also need permission for the s3:GetObjectVersionTagging
\n action.
By default, the bucket owner has this permission and can grant this permission to\n others.
\nFor information about the Amazon S3 object tagging feature, see Object Tagging.
\nThe following actions are related to GetObjectTagging
:
\n DeleteObjectTagging\n
\n\n GetObjectAttributes\n
\n\n PutObjectTagging\n
\nThis operation is not supported by directory buckets.
\nReturns metadata about all versions of the objects in a bucket. You can also use request\n parameters as selection criteria to return metadata about a subset of all the object\n versions.
\n To use this operation, you must have permission to perform the\n s3:ListBucketVersions
action. Be aware of the name difference.
A 200 OK
response can contain valid or invalid XML. Make sure to design\n your application to parse the contents of the response and handle it\n appropriately.
To use this operation, you must have READ access to the bucket.
\nThe following operations are related to ListObjectVersions
:
\n ListObjectsV2\n
\n\n GetObject\n
\n\n PutObject\n
\n\n DeleteObject\n
\nAdds an object to a bucket.
\nAmazon S3 never adds partial objects; if you receive a success response, Amazon S3 added the\n entire object to the bucket. You cannot use PutObject
to only update a\n single piece of metadata for an existing object. You must put the entire object with\n updated metadata if you want to update some values.
If your bucket uses the bucket owner enforced setting for Object Ownership, ACLs are disabled and no longer affect permissions. All\n objects written to the bucket by any account will be owned by the bucket owner.
\n\n Directory buckets - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format https://bucket_name.s3express-az_id.region.amazonaws.com/key-name\n
. Path-style requests are not supported. For more information, see Regional and Zonal endpoints in the\n Amazon S3 User Guide.
Amazon S3 is a distributed system. If it receives multiple write requests for the same object\n simultaneously, it overwrites all but the last object written. However, Amazon S3 provides features that can modify this behavior:
\n\n S3 Object Lock - To prevent objects from\n being deleted or overwritten, you can use Amazon S3 Object\n Lock in the Amazon S3 User Guide.
\nThis functionality is not supported for directory buckets.
\n\n S3 Versioning - When you enable\n versioning for a bucket, if Amazon S3 receives multiple write requests for the same object\n simultaneously, it stores all versions of the objects. For each write request that is made to the same object, Amazon S3 automatically generates a unique version ID\n of that object being stored in Amazon S3. \n You can retrieve, replace, or delete any version of the object. For more information about versioning, see\n Adding Objects to\n Versioning-Enabled Buckets in the Amazon S3\n User Guide. For information about returning the versioning state\n of a bucket, see GetBucketVersioning.
\nThis functionality is not supported for directory buckets.
\n\n General purpose bucket permissions - The following permissions are required in your policies when your \n PutObject
request includes specific headers.
\n \n s3:PutObject
\n - To successfully complete the PutObject
request, you must always have the s3:PutObject
permission on a bucket to add an object\n to it.
\n \n s3:PutObjectAcl
\n - To successfully change the objects ACL of your PutObject
request, you must have the s3:PutObjectAcl
.
\n \n s3:PutObjectTagging
\n - To successfully set the tag-set with your PutObject
request, you\n must have the s3:PutObjectTagging
.
\n Directory bucket permissions - To grant access to this API operation on a directory bucket, we recommend that you use the \n CreateSession
\n 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. \nAmazon 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 \n CreateSession
\n .
\n General purpose bucket - To ensure that data is not corrupted traversing the network, use the\n Content-MD5
header. When you use this header, Amazon S3 checks the object\n against the provided MD5 value and, if they do not match, Amazon S3 returns an error. Alternatively, when the object's ETag is its MD5 digest, \n you can calculate the MD5 while putting the object to Amazon S3 and compare the returned ETag to\n the calculated MD5 value.
\n Directory bucket - This functionality is not supported for directory buckets.
\n\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com
.
For more information about related Amazon S3 APIs, see the following:
\n\n CopyObject\n
\n\n DeleteObject\n
\nThis operation is not supported by directory buckets.
\nThis action filters the contents of an Amazon S3 object based on a simple structured query\n language (SQL) statement. In the request, along with the SQL expression, you must also\n specify a data serialization format (JSON, CSV, or Apache Parquet) of the object. Amazon S3 uses\n this format to parse object data into records, and returns only records that match the\n specified SQL expression. You must also specify the data serialization format for the\n response.
\nThis functionality is not supported for Amazon S3 on Outposts.
\nFor more information about Amazon S3 Select, see Selecting Content from\n Objects and SELECT\n Command in the Amazon S3 User Guide.
\n \nYou must have the s3:GetObject
permission for this operation. Amazon S3\n Select does not support anonymous access. For more information about permissions,\n see Specifying Permissions in\n a Policy in the Amazon S3 User Guide.
You can use Amazon S3 Select to query objects that have the following format\n properties:
\n\n CSV, JSON, and Parquet - Objects must be in CSV,\n JSON, or Parquet format.
\n\n UTF-8 - UTF-8 is the only encoding type Amazon S3 Select\n supports.
\n\n GZIP or BZIP2 - CSV and JSON files can be compressed\n using GZIP or BZIP2. GZIP and BZIP2 are the only compression formats that\n Amazon S3 Select supports for CSV and JSON files. Amazon S3 Select supports columnar\n compression for Parquet using GZIP or Snappy. Amazon S3 Select does not support\n whole-object compression for Parquet objects.
\n\n Server-side encryption - Amazon S3 Select supports\n querying objects that are protected with server-side encryption.
\nFor objects that are encrypted with customer-provided encryption keys\n (SSE-C), you must use HTTPS, and you must use the headers that are\n documented in the GetObject. For more\n information about SSE-C, see Server-Side Encryption (Using Customer-Provided Encryption Keys)\n in the Amazon S3 User Guide.
\nFor objects that are encrypted with Amazon S3 managed keys (SSE-S3) and\n Amazon Web Services KMS keys (SSE-KMS), server-side encryption is handled transparently,\n so you don't need to specify anything. For more information about\n server-side encryption, including SSE-S3 and SSE-KMS, see Protecting Data Using Server-Side Encryption in the\n Amazon S3 User Guide.
\nGiven the response size is unknown, Amazon S3 Select streams the response as a\n series of messages and includes a Transfer-Encoding
header with\n chunked
as its value in the response. For more information, see\n Appendix:\n SelectObjectContent\n Response.
The SelectObjectContent
action does not support the following\n GetObject
functionality. For more information, see GetObject.
\n Range
: Although you can specify a scan range for an Amazon S3 Select\n request (see SelectObjectContentRequest - ScanRange in the request\n parameters), you cannot specify the range of bytes of an object to return.\n
The GLACIER
, DEEP_ARCHIVE
, and\n REDUCED_REDUNDANCY
storage classes, or the\n ARCHIVE_ACCESS
and DEEP_ARCHIVE_ACCESS
access\n tiers of the INTELLIGENT_TIERING
storage class: You cannot\n query objects in the GLACIER
, DEEP_ARCHIVE
, or\n REDUCED_REDUNDANCY
storage classes, nor objects in the\n ARCHIVE_ACCESS
or DEEP_ARCHIVE_ACCESS
access\n tiers of the INTELLIGENT_TIERING
storage class. For more\n information about storage classes, see Using Amazon S3\n storage classes in the\n Amazon S3 User Guide.
For a list of special errors for this operation, see List of SELECT Object Content Error Codes\n
\nThe following operations are related to SelectObjectContent
:
\n GetObject\n
\n