Skip to content

Commit

Permalink
feat(client-s3): Add support for automatic date based partitioning in…
Browse files Browse the repository at this point in the history
… S3 Server Access Logs.
  • Loading branch information
awstools committed Nov 21, 2023
1 parent 4ef66f7 commit 06ee66a
Show file tree
Hide file tree
Showing 16 changed files with 673 additions and 425 deletions.
26 changes: 13 additions & 13 deletions clients/client-s3/src/commands/CreateBucketCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,39 +196,39 @@ export interface CreateBucketCommandOutput extends CreateBucketOutput, __Metadat
* @throws {@link S3ServiceException}
* <p>Base exception class for all service exceptions from S3 service.</p>
*
* @example To create a bucket
* @example To create a bucket in a specific region
* ```javascript
* // The following example creates a bucket.
* // The following example creates a bucket. The request specifies an AWS region where to create the bucket.
* const input = {
* "Bucket": "examplebucket"
* "Bucket": "examplebucket",
* "CreateBucketConfiguration": {
* "LocationConstraint": "eu-west-1"
* }
* };
* const command = new CreateBucketCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "Location": "/examplebucket"
* "Location": "http://examplebucket.<Region>.s3.amazonaws.com/"
* }
* *\/
* // example id: to-create-a-bucket--1472851826060
* // example id: to-create-a-bucket-in-a-specific-region-1483399072992
* ```
*
* @example To create a bucket in a specific region
* @example To create a bucket
* ```javascript
* // The following example creates a bucket. The request specifies an AWS region where to create the bucket.
* // The following example creates a bucket.
* const input = {
* "Bucket": "examplebucket",
* "CreateBucketConfiguration": {
* "LocationConstraint": "eu-west-1"
* }
* "Bucket": "examplebucket"
* };
* const command = new CreateBucketCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "Location": "http://examplebucket.<Region>.s3.amazonaws.com/"
* "Location": "/examplebucket"
* }
* *\/
* // example id: to-create-a-bucket-in-a-specific-region-1483399072992
* // example id: to-create-a-bucket--1472851826060
* ```
*
*/
Expand Down
22 changes: 11 additions & 11 deletions clients/client-s3/src/commands/DeleteObjectTaggingCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,39 +86,39 @@ export interface DeleteObjectTaggingCommandOutput extends DeleteObjectTaggingOut
* @throws {@link S3ServiceException}
* <p>Base exception class for all service exceptions from S3 service.</p>
*
* @example To remove tag set from an object version
* @example To remove tag set from an object
* ```javascript
* // The following example removes tag set associated with the specified object version. The request specifies both the object key and object version.
* // The following example removes tag set associated with the specified object. If the bucket is versioning enabled, the operation removes tag set from the latest object version.
* const input = {
* "Bucket": "examplebucket",
* "Key": "HappyFace.jpg",
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
* "Key": "HappyFace.jpg"
* };
* const command = new DeleteObjectTaggingCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
* "VersionId": "null"
* }
* *\/
* // example id: to-remove-tag-set-from-an-object-version-1483145285913
* // example id: to-remove-tag-set-from-an-object-1483145342862
* ```
*
* @example To remove tag set from an object
* @example To remove tag set from an object version
* ```javascript
* // The following example removes tag set associated with the specified object. If the bucket is versioning enabled, the operation removes tag set from the latest object version.
* // The following example removes tag set associated with the specified object version. The request specifies both the object key and object version.
* const input = {
* "Bucket": "examplebucket",
* "Key": "HappyFace.jpg"
* "Key": "HappyFace.jpg",
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
* };
* const command = new DeleteObjectTaggingCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "VersionId": "null"
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
* }
* *\/
* // example id: to-remove-tag-set-from-an-object-1483145342862
* // example id: to-remove-tag-set-from-an-object-version-1483145285913
* ```
*
*/
Expand Down
6 changes: 6 additions & 0 deletions clients/client-s3/src/commands/GetBucketLoggingCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ export interface GetBucketLoggingCommandOutput extends GetBucketLoggingOutput, _
* // },
* // ],
* // TargetPrefix: "STRING_VALUE", // required
* // TargetObjectKeyFormat: { // TargetObjectKeyFormat
* // SimplePrefix: {},
* // PartitionedPrefix: { // PartitionedPrefix
* // PartitionDateSource: "EventTime" || "DeliveryTime",
* // },
* // },
* // },
* // };
*
Expand Down
47 changes: 24 additions & 23 deletions clients/client-s3/src/commands/GetObjectCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export interface GetObjectCommandOutput extends Omit<GetObjectOutput, "Body">, _
* <note>
* <ul>
* <li>
* <p> If you supply a <code>versionId</code>, you need the
* <p>If you supply a <code>versionId</code>, you need the
* <code>s3:GetObjectVersion</code> permission to access a specific
* version of an object. If you request a specific version, you do not need
* to have the <code>s3:GetObject</code> permission. If you request the
Expand All @@ -133,9 +133,10 @@ export interface GetObjectCommandOutput extends Omit<GetObjectOutput, "Body">, _
* <code>s3:GetObjectVersion</code> permission won't be required.</p>
* </li>
* <li>
* <p>If the current version of the object is a delete marker, Amazon S3 behaves
* as if the object was deleted and includes <code>x-amz-delete-marker:
* true</code> in the response.</p>
* <p>If the current version of the object is a delete marker, Amazon S3 behaves as if the object was deleted and includes <code>x-amz-delete-marker: true</code> in the response.</p>
* </li>
* <li>
* <p>If the specified version is a delete marker, the response returns a 405 (Method Not Allowed) error and the <code>Last-Modified: timestamp</code> response header.</p>
* </li>
* </ul>
* </note>
Expand Down Expand Up @@ -311,53 +312,53 @@ export interface GetObjectCommandOutput extends Omit<GetObjectOutput, "Body">, _
* @throws {@link S3ServiceException}
* <p>Base exception class for all service exceptions from S3 service.</p>
*
* @example To retrieve a byte range of an object
* @example To retrieve an object
* ```javascript
* // The following example retrieves an object for an S3 bucket. The request specifies the range header to retrieve a specific byte range.
* // The following example retrieves an object for an S3 bucket.
* const input = {
* "Bucket": "examplebucket",
* "Key": "SampleFile.txt",
* "Range": "bytes=0-9"
* "Key": "HappyFace.jpg"
* };
* const command = new GetObjectCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "AcceptRanges": "bytes",
* "ContentLength": "10",
* "ContentRange": "bytes 0-9/43",
* "ContentType": "text/plain",
* "ETag": "\"0d94420ffd0bc68cd3d152506b97a9cc\"",
* "LastModified": "Thu, 09 Oct 2014 22:57:28 GMT",
* "ContentLength": "3191",
* "ContentType": "image/jpeg",
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
* "LastModified": "Thu, 15 Dec 2016 01:19:41 GMT",
* "Metadata": {},
* "TagCount": 2,
* "VersionId": "null"
* }
* *\/
* // example id: to-retrieve-a-byte-range-of-an-object--1481832674603
* // example id: to-retrieve-an-object-1481827837012
* ```
*
* @example To retrieve an object
* @example To retrieve a byte range of an object
* ```javascript
* // The following example retrieves an object for an S3 bucket.
* // The following example retrieves an object for an S3 bucket. The request specifies the range header to retrieve a specific byte range.
* const input = {
* "Bucket": "examplebucket",
* "Key": "HappyFace.jpg"
* "Key": "SampleFile.txt",
* "Range": "bytes=0-9"
* };
* const command = new GetObjectCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "AcceptRanges": "bytes",
* "ContentLength": "3191",
* "ContentType": "image/jpeg",
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
* "LastModified": "Thu, 15 Dec 2016 01:19:41 GMT",
* "ContentLength": "10",
* "ContentRange": "bytes 0-9/43",
* "ContentType": "text/plain",
* "ETag": "\"0d94420ffd0bc68cd3d152506b97a9cc\"",
* "LastModified": "Thu, 09 Oct 2014 22:57:28 GMT",
* "Metadata": {},
* "TagCount": 2,
* "VersionId": "null"
* }
* *\/
* // example id: to-retrieve-an-object-1481827837012
* // example id: to-retrieve-a-byte-range-of-an-object--1481832674603
* ```
*
*/
Expand Down
17 changes: 14 additions & 3 deletions clients/client-s3/src/commands/HeadObjectCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ export interface HeadObjectCommandOutput extends HeadObjectOutput, __MetadataBea
* <p>A <code>HEAD</code> request has the same options as a <code>GET</code> action 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>400 Bad Request</code>, <code>403 Forbidden</code> or <code>404 Not
* Found</code> code. It is not possible to retrieve the exact exception beyond these error
* codes.</p>
* 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>
* <p>If you encrypt an object by using server-side encryption with customer-provided
* encryption keys (SSE-C) when you store the object in Amazon S3, then when you retrieve the
* metadata from the object, you must use the following headers:</p>
Expand Down Expand Up @@ -149,6 +149,17 @@ export interface HeadObjectCommandOutput extends HeadObjectOutput, __MetadataBea
* </li>
* </ul>
* </dd>
* <dt>Versioning</dt>
* <dd>
* <ul>
* <li>
* <p>If the current version of the object is a delete marker, Amazon S3 behaves as if the object was deleted and includes <code>x-amz-delete-marker: true</code> in the response.</p>
* </li>
* <li>
* <p>If the specified version is a delete marker, the response returns a 405 (Method Not Allowed) error and the <code>Last-Modified: timestamp</code> response header.</p>
* </li>
* </ul>
* </dd>
* </dl>
* <p>The following actions are related to <code>HeadObject</code>:</p>
* <ul>
Expand Down
64 changes: 32 additions & 32 deletions clients/client-s3/src/commands/ListMultipartUploadsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,104 +149,104 @@ export interface ListMultipartUploadsCommandOutput extends ListMultipartUploadsO
* @throws {@link S3ServiceException}
* <p>Base exception class for all service exceptions from S3 service.</p>
*
* @example To list in-progress multipart uploads on a bucket
* @example List next set of multipart uploads when previous result is truncated
* ```javascript
* // The following example lists in-progress multipart uploads on a specific bucket.
* // The following example specifies the upload-id-marker and key-marker from previous truncated response to retrieve next setup of multipart uploads.
* const input = {
* "Bucket": "examplebucket"
* "Bucket": "examplebucket",
* "KeyMarker": "nextkeyfrompreviousresponse",
* "MaxUploads": "2",
* "UploadIdMarker": "valuefrompreviousresponse"
* };
* const command = new ListMultipartUploadsCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "Bucket": "acl1",
* "IsTruncated": true,
* "KeyMarker": "",
* "MaxUploads": "2",
* "NextKeyMarker": "someobjectkey",
* "NextUploadIdMarker": "examplelo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--",
* "UploadIdMarker": "",
* "Uploads": [
* {
* "Initiated": "2014-05-01T05:40:58.000Z",
* "Initiator": {
* "DisplayName": "display-name",
* "DisplayName": "ownder-display-name",
* "ID": "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc"
* },
* "Key": "JavaFile",
* "Owner": {
* "DisplayName": "display-name",
* "ID": "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc"
* "DisplayName": "mohanataws",
* "ID": "852b113e7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc"
* },
* "StorageClass": "STANDARD",
* "UploadId": "examplelUa.CInXklLQtSMJITdUnoZ1Y5GACB5UckOtspm5zbDMCkPF_qkfZzMiFZ6dksmcnqxJyIBvQMG9X9Q--"
* "UploadId": "gZ30jIqlUa.CInXklLQtSMJITdUnoZ1Y5GACB5UckOtspm5zbDMCkPF_qkfZzMiFZ6dksmcnqxJyIBvQMG9X9Q--"
* },
* {
* "Initiated": "2014-05-01T05:41:27.000Z",
* "Initiator": {
* "DisplayName": "display-name",
* "DisplayName": "ownder-display-name",
* "ID": "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc"
* },
* "Key": "JavaFile",
* "Owner": {
* "DisplayName": "display-name",
* "DisplayName": "ownder-display-name",
* "ID": "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc"
* },
* "StorageClass": "STANDARD",
* "UploadId": "examplelo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--"
* "UploadId": "b7tZSqIlo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--"
* }
* ]
* }
* *\/
* // example id: to-list-in-progress-multipart-uploads-on-a-bucket-1481852775260
* // example id: list-next-set-of-multipart-uploads-when-previous-result-is-truncated-1482428106748
* ```
*
* @example List next set of multipart uploads when previous result is truncated
* @example To list in-progress multipart uploads on a bucket
* ```javascript
* // The following example specifies the upload-id-marker and key-marker from previous truncated response to retrieve next setup of multipart uploads.
* // The following example lists in-progress multipart uploads on a specific bucket.
* const input = {
* "Bucket": "examplebucket",
* "KeyMarker": "nextkeyfrompreviousresponse",
* "MaxUploads": "2",
* "UploadIdMarker": "valuefrompreviousresponse"
* "Bucket": "examplebucket"
* };
* const command = new ListMultipartUploadsCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "Bucket": "acl1",
* "IsTruncated": true,
* "KeyMarker": "",
* "MaxUploads": "2",
* "NextKeyMarker": "someobjectkey",
* "NextUploadIdMarker": "examplelo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--",
* "UploadIdMarker": "",
* "Uploads": [
* {
* "Initiated": "2014-05-01T05:40:58.000Z",
* "Initiator": {
* "DisplayName": "ownder-display-name",
* "DisplayName": "display-name",
* "ID": "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc"
* },
* "Key": "JavaFile",
* "Owner": {
* "DisplayName": "mohanataws",
* "ID": "852b113e7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc"
* "DisplayName": "display-name",
* "ID": "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc"
* },
* "StorageClass": "STANDARD",
* "UploadId": "gZ30jIqlUa.CInXklLQtSMJITdUnoZ1Y5GACB5UckOtspm5zbDMCkPF_qkfZzMiFZ6dksmcnqxJyIBvQMG9X9Q--"
* "UploadId": "examplelUa.CInXklLQtSMJITdUnoZ1Y5GACB5UckOtspm5zbDMCkPF_qkfZzMiFZ6dksmcnqxJyIBvQMG9X9Q--"
* },
* {
* "Initiated": "2014-05-01T05:41:27.000Z",
* "Initiator": {
* "DisplayName": "ownder-display-name",
* "DisplayName": "display-name",
* "ID": "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc"
* },
* "Key": "JavaFile",
* "Owner": {
* "DisplayName": "ownder-display-name",
* "DisplayName": "display-name",
* "ID": "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc"
* },
* "StorageClass": "STANDARD",
* "UploadId": "b7tZSqIlo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--"
* "UploadId": "examplelo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--"
* }
* ]
* }
* *\/
* // example id: list-next-set-of-multipart-uploads-when-previous-result-is-truncated-1482428106748
* // example id: to-list-in-progress-multipart-uploads-on-a-bucket-1481852775260
* ```
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export interface ListObjectVersionsCommandOutput extends ListObjectVersionsOutpu
* appropriately.</p>
* </note>
* <p>To use this operation, you must have READ access to the bucket.</p>
* <p>This action is not supported by Amazon S3 on Outposts.</p>
* <p>The following operations are related to <code>ListObjectVersions</code>:</p>
* <ul>
* <li>
Expand Down

0 comments on commit 06ee66a

Please sign in to comment.