Skip to content

Commit

Permalink
feat(client-s3): Amazon Simple Storage Service / Features : Adds supp…
Browse files Browse the repository at this point in the history
…ort for pagination in the S3 ListBuckets API.
  • Loading branch information
awstools committed Aug 15, 2024
1 parent 62c6973 commit f31c6ea
Show file tree
Hide file tree
Showing 16 changed files with 404 additions and 175 deletions.
20 changes: 17 additions & 3 deletions clients/client-s3/src/commands/AbortMultipartUploadCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,24 @@ export interface AbortMultipartUploadCommandOutput extends AbortMultipartUploadO
* 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
* the parts list is empty.</p>
* <note>
* <p>
* <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>
* </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
* <ul>
* <li>
* <p>
* <b>Directory buckets</b> -
* 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.
* To delete these in-progress multipart uploads, use the
* <code>ListMultipartUploads</code> operation to list the in-progress multipart
* uploads in the bucket and use the <code>AbortMultupartUpload</code> operation to
* abort all the in-progress multipart uploads.
* </p>
* </li>
* <li>
* <p>
* <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>
* </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
* <i>Amazon S3 User Guide</i>.</p>
* </li>
* </ul>
* </note>
* <dl>
* <dt>Permissions</dt>
Expand Down
16 changes: 13 additions & 3 deletions clients/client-s3/src/commands/CopyObjectCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,20 @@ export interface CopyObjectCommandOutput extends CopyObjectOutput, __MetadataBea
* <p>You can copy individual objects between general purpose buckets, between directory buckets, and
* between general purpose buckets and directory buckets.</p>
* <note>
* <p>
* <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>
* </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
* <ul>
* <li>
* <p>Amazon S3 supports copy operations using Multi-Region Access Points only as a destination when using the Multi-Region Access Point ARN. </p>
* </li>
* <li>
* <p>
* <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>
* </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
* <i>Amazon S3 User Guide</i>.</p>
* </li>
* <li>
* <p>VPC endpoints don't support cross-Region requests (including copies). If you're using VPC endpoints, your source and destination buckets should be in the same Amazon Web Services Region as your VPC endpoint.</p>
* </li>
* </ul>
* </note>
* <p>Both the
* Region that you want to copy the object from and the Region that you want to copy the
Expand Down
16 changes: 9 additions & 7 deletions clients/client-s3/src/commands/HeadBucketCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,20 @@ export interface HeadBucketCommandOutput extends HeadBucketOutput, __MetadataBea
/**
* <p>You can use this operation to determine if a bucket exists and if you have permission to access it. The action returns a <code>200 OK</code> if the bucket exists and you have permission
* to access it.</p>
* <p>If the bucket does not exist or you do not have permission to access it, the
* <note>
* <p>If the bucket does not exist or you do not have permission to access it, the
* <code>HEAD</code> request returns a generic <code>400 Bad Request</code>, <code>403
* Forbidden</code> or <code>404 Not Found</code> code. A message body is not included, so
* you cannot determine the exception beyond these HTTP response codes.</p>
* <note>
* <p>
* <b>Directory buckets </b> - 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</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
* <i>Amazon S3 User Guide</i>.</p>
* </note>
* <dl>
* <dt>Authentication and authorization</dt>
* <dd>
* <p>All <code>HeadBucket</code> requests must be authenticated and signed by using IAM credentials (access key ID and secret access key for the IAM identities). All headers with the <code>x-amz-</code> prefix, including
* <p>
* <b>General purpose buckets</b> - Request to public buckets that grant the s3:ListBucket permission publicly do not need to be signed. All other <code>HeadBucket</code> requests must be authenticated and signed by using IAM credentials (access key ID and secret access key for the IAM identities). All headers with the <code>x-amz-</code> prefix, including
* <code>x-amz-copy-source</code>, must be signed. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html">REST Authentication</a>.</p>
* <p>
* <b>Directory bucket</b> - You must use IAM credentials to authenticate and authorize your access to the <code>HeadBucket</code> API operation, instead of using the
* <b>Directory buckets</b> - You must use IAM credentials to authenticate and authorize your access to the <code>HeadBucket</code> API operation, instead of using the
* temporary security credentials through the <code>CreateSession</code> API operation.</p>
* <p>Amazon Web Services CLI or SDKs handles authentication and authorization on your behalf.</p>
* </dd>
Expand Down Expand Up @@ -77,6 +75,10 @@ export interface HeadBucketCommandOutput extends HeadBucketOutput, __MetadataBea
* <p>
* <b>Directory buckets </b> - The HTTP Host header syntax is <code>
* <i>Bucket_name</i>.s3express-<i>az_id</i>.<i>region</i>.amazonaws.com</code>.</p>
* <note>
* <p>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</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
* <i>Amazon S3 User Guide</i>.</p>
* </note>
* </dd>
* </dl>
* @example
Expand Down
15 changes: 8 additions & 7 deletions clients/client-s3/src/commands/HeadObjectCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,16 @@ export interface HeadObjectCommandOutput extends HeadObjectOutput, __MetadataBea
/**
* <p>The <code>HEAD</code> operation retrieves metadata from an object without returning the
* object itself. This operation is useful if you're interested only in an object's metadata.</p>
* <p>A <code>HEAD</code> request has the same options as a <code>GET</code> operation on an
* <note>
* <p>A <code>HEAD</code> request has the same options as a <code>GET</code> operation on an
* object. The response is identical to the <code>GET</code> response except that there is no
* response body. Because of this, if the <code>HEAD</code> request generates an error, it
* returns a generic code, such as <code>400 Bad Request</code>, <code>403 Forbidden</code>, <code>404 Not
* Found</code>, <code>405 Method Not Allowed</code>, <code>412 Precondition Failed</code>, or <code>304 Not Modified</code>.
* It's not possible to retrieve the exact exception of these error codes.</p>
* </note>
* <p>Request headers are limited to 8 KB in size. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonRequestHeaders.html">Common
* Request Headers</a>.</p>
* <note>
* <p>
* <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>
* </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
* <i>Amazon S3 User Guide</i>.</p>
* </note>
* <dl>
* <dt>Permissions</dt>
* <dd>
Expand Down Expand Up @@ -155,6 +151,11 @@ export interface HeadObjectCommandOutput extends HeadObjectOutput, __MetadataBea
* <p>
* <b>Directory buckets </b> - The HTTP Host header syntax is <code>
* <i>Bucket_name</i>.s3express-<i>az_id</i>.<i>region</i>.amazonaws.com</code>.</p>
* <note>
* <p>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>
* </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
* <i>Amazon S3 User Guide</i>.</p>
* </note>
* </dd>
* </dl>
* <p>The following actions are related to <code>HeadObject</code>:</p>
Expand Down
10 changes: 7 additions & 3 deletions clients/client-s3/src/commands/ListBucketsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import { ListBucketsOutput } from "../models/models_0";
import { ListBucketsOutput, ListBucketsRequest } from "../models/models_0";
import { de_ListBucketsCommand, se_ListBucketsCommand } from "../protocols/Aws_restXml";
import { S3ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../S3Client";

Expand All @@ -20,7 +20,7 @@ export { $Command };
*
* The input for {@link ListBucketsCommand}.
*/
export interface ListBucketsCommandInput {}
export interface ListBucketsCommandInput extends ListBucketsRequest {}
/**
* @public
*
Expand All @@ -42,7 +42,10 @@ export interface ListBucketsCommandOutput extends ListBucketsOutput, __MetadataB
* import { S3Client, ListBucketsCommand } from "@aws-sdk/client-s3"; // ES Modules import
* // const { S3Client, ListBucketsCommand } = require("@aws-sdk/client-s3"); // CommonJS import
* const client = new S3Client(config);
* const input = {};
* const input = { // ListBucketsRequest
* MaxBuckets: Number("int"),
* ContinuationToken: "STRING_VALUE",
* };
* const command = new ListBucketsCommand(input);
* const response = await client.send(command);
* // { // ListBucketsOutput
Expand All @@ -56,6 +59,7 @@ export interface ListBucketsCommandOutput extends ListBucketsOutput, __MetadataB
* // DisplayName: "STRING_VALUE",
* // ID: "STRING_VALUE",
* // },
* // ContinuationToken: "STRING_VALUE",
* // };
*
* ```
Expand Down
2 changes: 2 additions & 0 deletions clients/client-s3/src/commands/ListMultipartUploadsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export interface ListMultipartUploadsCommandOutput extends ListMultipartUploadsO
* <p>
* <b>Directory buckets</b> -
* 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.
* To delete these in-progress multipart uploads, use the <code>ListMultipartUploads</code> operation to list the in-progress multipart
* uploads in the bucket and use the <code>AbortMultupartUpload</code> operation to abort all the in-progress multipart uploads.
* </p>
* </note>
* <p>The <code>ListMultipartUploads</code> operation returns a maximum of 1,000 multipart uploads in the response. The limit of 1,000 multipart
Expand Down
20 changes: 17 additions & 3 deletions clients/client-s3/src/commands/ListObjectsV2Command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,24 @@ export interface ListObjectsV2CommandOutput extends ListObjectsV2Output, __Metad
* For more information about listing objects, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/ListingKeysUsingAPIs.html">Listing object keys
* programmatically</a> in the <i>Amazon S3 User Guide</i>. To get a list of your buckets, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html">ListBuckets</a>.</p>
* <note>
* <p>
* <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>
* </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
* <ul>
* <li>
* <p>
* <b>General purpose bucket</b> - For general purpose buckets, <code>ListObjectsV2</code> doesn't return prefixes that are related only to in-progress multipart uploads.</p>
* </li>
* <li>
* <p>
* <b>Directory buckets</b> -
* For directory buckets, <code>ListObjectsV2</code> response includes the prefixes that are related only to in-progress multipart uploads.
* </p>
* </li>
* <li>
* <p>
* <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>
* </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
* <i>Amazon S3 User Guide</i>.</p>
* </li>
* </ul>
* </note>
* <dl>
* <dt>Permissions</dt>
Expand Down
6 changes: 5 additions & 1 deletion clients/client-s3/src/commands/PutBucketEncryptionCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ export interface PutBucketEncryptionCommandOutput extends __MetadataBearer {}
* SSE-KMS, you can also configure <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html">Amazon S3 Bucket
* Keys</a>. If you use PutBucketEncryption to set your <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html">default bucket encryption</a> to SSE-KMS, you should verify that your KMS key ID is correct. Amazon S3 does not validate the KMS key ID provided in PutBucketEncryption requests.</p>
* <important>
* <p>This action requires Amazon Web Services Signature Version 4. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html">
* <p>If you're specifying a customer managed KMS key, we recommend using a fully qualified
* KMS key ARN. If you use a KMS key alias instead, then KMS resolves the key within the
* requester’s account. This behavior can result in data that's encrypted with a KMS key
* that belongs to the requester, and not the bucket owner.</p>
* <p>Also, this action requires Amazon Web Services Signature Version 4. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html">
* Authenticating Requests (Amazon Web Services Signature Version 4)</a>. </p>
* </important>
* <p>To use this operation, you must have permission to perform the
Expand Down
2 changes: 1 addition & 1 deletion clients/client-s3/src/commands/PutBucketPolicyCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import { PutBucketPolicyRequest } from "../models/models_0";
import { PutBucketPolicyRequest } from "../models/models_1";
import { de_PutBucketPolicyCommand, se_PutBucketPolicyCommand } from "../protocols/Aws_restXml";
import { S3ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../S3Client";

Expand Down
9 changes: 9 additions & 0 deletions clients/client-s3/src/commands/PutBucketVersioningCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ export interface PutBucketVersioningCommandOutput extends __MetadataBearer {}
* <note>
* <p>This operation is not supported by directory buckets.</p>
* </note>
* <note>
* <p>When you enable versioning on a bucket for the first time, it might take a short
* amount of time for the change to be fully propagated. We recommend that you wait for 15
* minutes after enabling versioning before issuing write operations
* (<code>PUT</code>
* or
* <code>DELETE</code>)
* on objects in the bucket. </p>
* </note>
* <p>Sets the versioning state of an existing bucket.</p>
* <p>You can set the versioning state with one of the following values:</p>
* <p>
Expand Down
Loading

0 comments on commit f31c6ea

Please sign in to comment.