Skip to content

Commit d5b27f3

Browse files
author
awstools
committedNov 21, 2024
feat(client-s3): Add support for conditional deletes for the S3 DeleteObject and DeleteObjects APIs. Add support for write offset bytes option used to append to objects with the S3 PutObject API.
1 parent 576ea4e commit d5b27f3

File tree

99 files changed

+3069
-1932
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+3069
-1932
lines changed
 

‎clients/client-s3/src/commands/AbortMultipartUploadCommand.ts

+16-13
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,24 @@ export interface AbortMultipartUploadCommandOutput extends AbortMultipartUploadO
3636
* to abort a given multipart upload multiple times in order to completely free all storage
3737
* consumed by all parts. </p>
3838
* <p>To verify that all parts have been removed and prevent getting charged for the part
39-
* storage, you should call the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html">ListParts</a> API operation and ensure that
40-
* the parts list is empty.</p>
39+
* storage, you should call the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html">ListParts</a> API operation and ensure
40+
* that the parts list is empty.</p>
4141
* <note>
4242
* <ul>
4343
* <li>
4444
* <p>
45-
* <b>Directory buckets</b> -
46-
* If multipart uploads in a directory bucket are in progress, you can't delete the bucket until all the in-progress multipart uploads are aborted or completed.
47-
* To delete these in-progress multipart uploads, use the
48-
* <code>ListMultipartUploads</code> operation to list the in-progress multipart
49-
* uploads in the bucket and use the <code>AbortMultipartUpload</code> operation to
50-
* abort all the in-progress multipart uploads.
51-
* </p>
45+
* <b>Directory buckets</b> - If multipart
46+
* uploads in a directory bucket are in progress, you can't delete the bucket until
47+
* all the in-progress multipart uploads are aborted or completed. To delete these
48+
* in-progress multipart uploads, use the <code>ListMultipartUploads</code> operation
49+
* to list the in-progress multipart uploads in the bucket and use the
50+
* <code>AbortMultipartUpload</code> operation to abort all the in-progress
51+
* multipart uploads. </p>
5252
* </li>
5353
* <li>
5454
* <p>
55-
* <b>Directory buckets</b> - 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 <code>https://<i>bucket_name</i>.s3express-<i>az_id</i>.<i>region</i>.amazonaws.com/<i>key-name</i>
55+
* <b>Directory buckets</b> -
56+
* 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 <code>https://<i>bucket_name</i>.s3express-<i>az_id</i>.<i>region</i>.amazonaws.com/<i>key-name</i>
5657
* </code>. Path-style requests are not supported. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html">Regional and Zonal endpoints</a> in the
5758
* <i>Amazon S3 User Guide</i>.</p>
5859
* </li>
@@ -64,9 +65,10 @@ export interface AbortMultipartUploadCommandOutput extends AbortMultipartUploadO
6465
* <ul>
6566
* <li>
6667
* <p>
67-
* <b>General purpose bucket permissions</b> - For information about permissions required to use the multipart upload, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html">Multipart Upload
68-
* and Permissions</a> in the <i>Amazon S3
69-
* User Guide</i>.</p>
68+
* <b>General purpose bucket permissions</b> - For
69+
* information about permissions required to use the multipart upload, see
70+
* <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html">Multipart Upload and
71+
* Permissions</a> in the <i>Amazon S3 User Guide</i>.</p>
7072
* </li>
7173
* <li>
7274
* <p>
@@ -126,6 +128,7 @@ export interface AbortMultipartUploadCommandOutput extends AbortMultipartUploadO
126128
* UploadId: "STRING_VALUE", // required
127129
* RequestPayer: "requester",
128130
* ExpectedBucketOwner: "STRING_VALUE",
131+
* IfMatchInitiatedTime: new Date("TIMESTAMP"),
129132
* };
130133
* const command = new AbortMultipartUploadCommand(input);
131134
* const response = await client.send(command);

‎clients/client-s3/src/commands/CompleteMultipartUploadCommand.ts

+47-42
Original file line numberDiff line numberDiff line change
@@ -37,41 +37,44 @@ export interface CompleteMultipartUploadCommandOutput extends CompleteMultipartU
3737
/**
3838
* <p>Completes a multipart upload by assembling previously uploaded parts.</p>
3939
* <p>You first initiate the multipart upload and then upload all parts using the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html">UploadPart</a>
40-
* operation or the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html">UploadPartCopy</a>
41-
* operation. After successfully uploading all relevant parts of an upload, you call this
42-
* <code>CompleteMultipartUpload</code> operation to complete the upload. Upon receiving this request, Amazon S3 concatenates all the parts
43-
* in ascending order by part number to create a new object. In the CompleteMultipartUpload
44-
* request, you must provide the parts list and ensure that the parts list is complete.
45-
* The CompleteMultipartUpload API operation concatenates the parts that you provide in the list. For each part in the list,
46-
* you must provide the <code>PartNumber</code> value and the <code>ETag</code> value that are returned after that part
47-
* was uploaded.</p>
40+
* operation or the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html">UploadPartCopy</a> operation.
41+
* After successfully uploading all relevant parts of an upload, you call this
42+
* <code>CompleteMultipartUpload</code> operation to complete the upload. Upon receiving
43+
* this request, Amazon S3 concatenates all the parts in ascending order by part number to create a
44+
* new object. In the CompleteMultipartUpload request, you must provide the parts list and
45+
* ensure that the parts list is complete. The CompleteMultipartUpload API operation
46+
* concatenates the parts that you provide in the list. For each part in the list, you must
47+
* provide the <code>PartNumber</code> value and the <code>ETag</code> value that are returned
48+
* after that part was uploaded.</p>
4849
* <p>The processing of a CompleteMultipartUpload request could take several minutes to
4950
* finalize. After Amazon S3 begins processing the request, it sends an HTTP response header that
50-
* specifies a <code>200 OK</code> response. While processing is in progress, Amazon S3 periodically sends white
51-
* space characters to keep the connection from timing out. A request could fail after the
52-
* initial <code>200 OK</code> response has been sent. This means that a <code>200 OK</code> response can
53-
* contain either a success or an error. The error response might be embedded in the <code>200 OK</code> response.
54-
* If you call this API operation directly, make sure to design
55-
* your application to parse the contents of the response and handle it appropriately. If you
56-
* use Amazon Web Services SDKs, SDKs handle this condition. The SDKs detect the embedded error and apply
57-
* error handling per your configuration settings (including automatically retrying the
58-
* request as appropriate). If the condition persists, the SDKs throw an exception (or, for
59-
* the SDKs that don't use exceptions, they return an error). </p>
51+
* specifies a <code>200 OK</code> response. While processing is in progress, Amazon S3
52+
* periodically sends white space characters to keep the connection from timing out. A request
53+
* could fail after the initial <code>200 OK</code> response has been sent. This means that a
54+
* <code>200 OK</code> response can contain either a success or an error. The error
55+
* response might be embedded in the <code>200 OK</code> response. If you call this API
56+
* operation directly, make sure to design your application to parse the contents of the
57+
* response and handle it appropriately. If you use Amazon Web Services SDKs, SDKs handle this condition.
58+
* The SDKs detect the embedded error and apply error handling per your configuration settings
59+
* (including automatically retrying the request as appropriate). If the condition persists,
60+
* the SDKs throw an exception (or, for the SDKs that don't use exceptions, they return an
61+
* error). </p>
6062
* <p>Note that if <code>CompleteMultipartUpload</code> fails, applications should be prepared
61-
* to retry any failed requests (including 500 error responses). For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/ErrorBestPractices.html">Amazon S3 Error Best
62-
* Practices</a>.</p>
63+
* to retry any failed requests (including 500 error responses). For more information, see
64+
* <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/ErrorBestPractices.html">Amazon S3 Error
65+
* Best Practices</a>.</p>
6366
* <important>
6467
* <p>You can't use <code>Content-Type: application/x-www-form-urlencoded</code> for the
65-
* CompleteMultipartUpload requests. Also, if you don't provide a
66-
* <code>Content-Type</code> header, <code>CompleteMultipartUpload</code> can still return a <code>200
67-
* OK</code> response.</p>
68+
* CompleteMultipartUpload requests. Also, if you don't provide a <code>Content-Type</code>
69+
* header, <code>CompleteMultipartUpload</code> can still return a <code>200 OK</code>
70+
* response.</p>
6871
* </important>
6972
* <p>For more information about multipart uploads, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html">Uploading Objects Using Multipart
70-
* Upload</a> in the <i>Amazon S3
71-
* User Guide</i>.</p>
73+
* Upload</a> in the <i>Amazon S3 User Guide</i>.</p>
7274
* <note>
7375
* <p>
74-
* <b>Directory buckets</b> - 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 <code>https://<i>bucket_name</i>.s3express-<i>az_id</i>.<i>region</i>.amazonaws.com/<i>key-name</i>
76+
* <b>Directory buckets</b> -
77+
* 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 <code>https://<i>bucket_name</i>.s3express-<i>az_id</i>.<i>region</i>.amazonaws.com/<i>key-name</i>
7578
* </code>. Path-style requests are not supported. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html">Regional and Zonal endpoints</a> in the
7679
* <i>Amazon S3 User Guide</i>.</p>
7780
* </note>
@@ -86,10 +89,10 @@ export interface CompleteMultipartUploadCommandOutput extends CompleteMultipartU
8689
* <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html">Multipart Upload and
8790
* Permissions</a> in the <i>Amazon S3 User Guide</i>.</p>
8891
* <p>If you provide an <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_Checksum.html">additional checksum
89-
* value</a> in your <code>MultipartUpload</code> requests and the
92+
* value</a> in your <code>MultipartUpload</code> requests and the
9093
* object is encrypted with Key Management Service, you must have permission to use the
91-
* <code>kms:Decrypt</code> action for the
92-
* <code>CompleteMultipartUpload</code> request to succeed.</p>
94+
* <code>kms:Decrypt</code> action for the
95+
* <code>CompleteMultipartUpload</code> request to succeed.</p>
9396
* </li>
9497
* <li>
9598
* <p>
@@ -99,9 +102,10 @@ export interface CompleteMultipartUploadCommandOutput extends CompleteMultipartU
99102
* 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 <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html">
100103
* <code>CreateSession</code>
101104
* </a>.</p>
102-
* <p>If the object is encrypted with
103-
* SSE-KMS, you must also have the
104-
* <code>kms:GenerateDataKey</code> and <code>kms:Decrypt</code> permissions in IAM identity-based policies and KMS key policies for the KMS key.</p>
105+
* <p>If the object is encrypted with SSE-KMS, you must also have the
106+
* <code>kms:GenerateDataKey</code> and <code>kms:Decrypt</code> permissions
107+
* in IAM identity-based policies and KMS key policies for the KMS
108+
* key.</p>
105109
* </li>
106110
* </ul>
107111
* </dd>
@@ -113,8 +117,9 @@ export interface CompleteMultipartUploadCommandOutput extends CompleteMultipartU
113117
* </p>
114118
* <ul>
115119
* <li>
116-
* <p>Description: Your proposed upload is smaller than the minimum allowed object
117-
* size. Each part must be at least 5 MB in size, except the last part.</p>
120+
* <p>Description: Your proposed upload is smaller than the minimum
121+
* allowed object size. Each part must be at least 5 MB in size, except
122+
* the last part.</p>
118123
* </li>
119124
* <li>
120125
* <p>HTTP Status Code: 400 Bad Request</p>
@@ -126,9 +131,9 @@ export interface CompleteMultipartUploadCommandOutput extends CompleteMultipartU
126131
* </p>
127132
* <ul>
128133
* <li>
129-
* <p>Description: One or more of the specified parts could not be found. The part
130-
* might not have been uploaded, or the specified ETag might not have
131-
* matched the uploaded part's ETag.</p>
134+
* <p>Description: One or more of the specified parts could not be found.
135+
* The part might not have been uploaded, or the specified ETag might not
136+
* have matched the uploaded part's ETag.</p>
132137
* </li>
133138
* <li>
134139
* <p>HTTP Status Code: 400 Bad Request</p>
@@ -140,8 +145,8 @@ export interface CompleteMultipartUploadCommandOutput extends CompleteMultipartU
140145
* </p>
141146
* <ul>
142147
* <li>
143-
* <p>Description: The list of parts was not in ascending order. The parts list
144-
* must be specified in order by part number.</p>
148+
* <p>Description: The list of parts was not in ascending order. The
149+
* parts list must be specified in order by part number.</p>
145150
* </li>
146151
* <li>
147152
* <p>HTTP Status Code: 400 Bad Request</p>
@@ -153,9 +158,9 @@ export interface CompleteMultipartUploadCommandOutput extends CompleteMultipartU
153158
* </p>
154159
* <ul>
155160
* <li>
156-
* <p>Description: The specified multipart upload does not exist. The upload ID
157-
* might be invalid, or the multipart upload might have been aborted or
158-
* completed.</p>
161+
* <p>Description: The specified multipart upload does not exist. The
162+
* upload ID might be invalid, or the multipart upload might have been
163+
* aborted or completed.</p>
159164
* </li>
160165
* <li>
161166
* <p>HTTP Status Code: 404 Not Found</p>

0 commit comments

Comments
 (0)
Please sign in to comment.