@aws-sdk/client-s3 3.287.0 → 3.289.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-types/commands/AbortMultipartUploadCommand.d.ts +13 -0
- package/dist-types/commands/CompleteMultipartUploadCommand.d.ts +33 -0
- package/dist-types/commands/CopyObjectCommand.d.ts +21 -0
- package/dist-types/commands/CreateBucketCommand.d.ts +35 -0
- package/dist-types/commands/CreateMultipartUploadCommand.d.ts +19 -0
- package/dist-types/commands/DeleteBucketCommand.d.ts +11 -0
- package/dist-types/commands/DeleteBucketCorsCommand.d.ts +11 -0
- package/dist-types/commands/DeleteBucketLifecycleCommand.d.ts +11 -0
- package/dist-types/commands/DeleteBucketPolicyCommand.d.ts +11 -0
- package/dist-types/commands/DeleteBucketReplicationCommand.d.ts +11 -0
- package/dist-types/commands/DeleteBucketTaggingCommand.d.ts +11 -0
- package/dist-types/commands/DeleteBucketWebsiteCommand.d.ts +11 -0
- package/dist-types/commands/DeleteObjectCommand.d.ts +24 -0
- package/dist-types/commands/DeleteObjectTaggingCommand.d.ts +35 -0
- package/dist-types/commands/DeleteObjectsCommand.d.ts +76 -0
- package/dist-types/commands/GetBucketCorsCommand.d.ts +29 -0
- package/dist-types/commands/GetBucketLifecycleConfigurationCommand.d.ts +28 -0
- package/dist-types/commands/GetBucketLocationCommand.d.ts +16 -0
- package/dist-types/commands/GetBucketPolicyCommand.d.ts +16 -0
- package/dist-types/commands/GetBucketReplicationCommand.d.ts +28 -0
- package/dist-types/commands/GetBucketRequestPaymentCommand.d.ts +16 -0
- package/dist-types/commands/GetBucketTaggingCommand.d.ts +25 -0
- package/dist-types/commands/GetBucketVersioningCommand.d.ts +17 -0
- package/dist-types/commands/GetBucketWebsiteCommand.d.ts +21 -0
- package/dist-types/commands/GetObjectAclCommand.d.ts +54 -0
- package/dist-types/commands/GetObjectCommand.d.ts +49 -0
- package/dist-types/commands/GetObjectTaggingCommand.d.ts +51 -0
- package/dist-types/commands/GetObjectTorrentCommand.d.ts +12 -0
- package/dist-types/commands/HeadBucketCommand.d.ts +11 -0
- package/dist-types/commands/HeadObjectCommand.d.ts +23 -0
- package/dist-types/commands/ListBucketsCommand.d.ts +31 -0
- package/dist-types/commands/ListMultipartUploadsCommand.d.ts +100 -0
- package/dist-types/commands/ListObjectVersionsCommand.d.ts +44 -0
- package/dist-types/commands/ListObjectsCommand.d.ts +41 -0
- package/dist-types/commands/ListObjectsV2Command.d.ts +38 -0
- package/dist-types/commands/ListPartsCommand.d.ts +40 -0
- package/dist-types/commands/PutBucketAclCommand.d.ts +13 -0
- package/dist-types/commands/PutBucketCorsCommand.d.ts +45 -0
- package/dist-types/commands/PutBucketLifecycleConfigurationCommand.d.ts +31 -0
- package/dist-types/commands/PutBucketLoggingCommand.d.ts +26 -0
- package/dist-types/commands/PutBucketNotificationConfigurationCommand.d.ts +21 -0
- package/dist-types/commands/PutBucketPolicyCommand.d.ts +12 -0
- package/dist-types/commands/PutBucketReplicationCommand.d.ts +24 -0
- package/dist-types/commands/PutBucketRequestPaymentCommand.d.ts +14 -0
- package/dist-types/commands/PutBucketTaggingCommand.d.ts +23 -0
- package/dist-types/commands/PutBucketVersioningCommand.d.ts +15 -0
- package/dist-types/commands/PutBucketWebsiteCommand.d.ts +20 -0
- package/dist-types/commands/PutObjectAclCommand.d.ts +15 -0
- package/dist-types/commands/PutObjectCommand.d.ts +145 -0
- package/dist-types/commands/PutObjectTaggingCommand.d.ts +29 -0
- package/dist-types/commands/RestoreObjectCommand.d.ts +18 -0
- package/dist-types/commands/UploadPartCommand.d.ts +20 -0
- package/dist-types/commands/UploadPartCopyCommand.d.ts +47 -0
- package/package.json +45 -45
|
@@ -84,6 +84,51 @@ export interface PutBucketCorsCommandOutput extends __MetadataBearer {
|
|
|
84
84
|
* @see {@link PutBucketCorsCommandOutput} for command's `response` shape.
|
|
85
85
|
* @see {@link S3ClientResolvedConfig | config} for S3Client's `config` shape.
|
|
86
86
|
*
|
|
87
|
+
* @example To set cors configuration on a bucket.
|
|
88
|
+
* ```javascript
|
|
89
|
+
* // The following example enables PUT, POST, and DELETE requests from www.example.com, and enables GET requests from any domain.
|
|
90
|
+
* const input = {
|
|
91
|
+
* "Bucket": "",
|
|
92
|
+
* "CORSConfiguration": {
|
|
93
|
+
* "CORSRules": [
|
|
94
|
+
* {
|
|
95
|
+
* "AllowedHeaders": [
|
|
96
|
+
* "*"
|
|
97
|
+
* ],
|
|
98
|
+
* "AllowedMethods": [
|
|
99
|
+
* "PUT",
|
|
100
|
+
* "POST",
|
|
101
|
+
* "DELETE"
|
|
102
|
+
* ],
|
|
103
|
+
* "AllowedOrigins": [
|
|
104
|
+
* "http://www.example.com"
|
|
105
|
+
* ],
|
|
106
|
+
* "ExposeHeaders": [
|
|
107
|
+
* "x-amz-server-side-encryption"
|
|
108
|
+
* ],
|
|
109
|
+
* "MaxAgeSeconds": 3000
|
|
110
|
+
* },
|
|
111
|
+
* {
|
|
112
|
+
* "AllowedHeaders": [
|
|
113
|
+
* "Authorization"
|
|
114
|
+
* ],
|
|
115
|
+
* "AllowedMethods": [
|
|
116
|
+
* "GET"
|
|
117
|
+
* ],
|
|
118
|
+
* "AllowedOrigins": [
|
|
119
|
+
* "*"
|
|
120
|
+
* ],
|
|
121
|
+
* "MaxAgeSeconds": 3000
|
|
122
|
+
* }
|
|
123
|
+
* ]
|
|
124
|
+
* },
|
|
125
|
+
* "ContentMD5": ""
|
|
126
|
+
* };
|
|
127
|
+
* const command = new PutBucketCorsCommand(input);
|
|
128
|
+
* await client.send(command);
|
|
129
|
+
* // example id: to-set-cors-configuration-on-a-bucket-1483037818805
|
|
130
|
+
* ```
|
|
131
|
+
*
|
|
87
132
|
*/
|
|
88
133
|
export declare class PutBucketCorsCommand extends $Command<PutBucketCorsCommandInput, PutBucketCorsCommandOutput, S3ClientResolvedConfig> {
|
|
89
134
|
readonly input: PutBucketCorsCommandInput;
|
|
@@ -116,6 +116,37 @@ export interface PutBucketLifecycleConfigurationCommandOutput extends __Metadata
|
|
|
116
116
|
* @see {@link PutBucketLifecycleConfigurationCommandOutput} for command's `response` shape.
|
|
117
117
|
* @see {@link S3ClientResolvedConfig | config} for S3Client's `config` shape.
|
|
118
118
|
*
|
|
119
|
+
* @example Put bucket lifecycle
|
|
120
|
+
* ```javascript
|
|
121
|
+
* // The following example replaces existing lifecycle configuration, if any, on the specified bucket.
|
|
122
|
+
* const input = {
|
|
123
|
+
* "Bucket": "examplebucket",
|
|
124
|
+
* "LifecycleConfiguration": {
|
|
125
|
+
* "Rules": [
|
|
126
|
+
* {
|
|
127
|
+
* "Expiration": {
|
|
128
|
+
* "Days": 3650
|
|
129
|
+
* },
|
|
130
|
+
* "Filter": {
|
|
131
|
+
* "Prefix": "documents/"
|
|
132
|
+
* },
|
|
133
|
+
* "ID": "TestOnly",
|
|
134
|
+
* "Status": "Enabled",
|
|
135
|
+
* "Transitions": [
|
|
136
|
+
* {
|
|
137
|
+
* "Days": 365,
|
|
138
|
+
* "StorageClass": "GLACIER"
|
|
139
|
+
* }
|
|
140
|
+
* ]
|
|
141
|
+
* }
|
|
142
|
+
* ]
|
|
143
|
+
* }
|
|
144
|
+
* };
|
|
145
|
+
* const command = new PutBucketLifecycleConfigurationCommand(input);
|
|
146
|
+
* await client.send(command);
|
|
147
|
+
* // example id: put-bucket-lifecycle-1482264533092
|
|
148
|
+
* ```
|
|
149
|
+
*
|
|
119
150
|
*/
|
|
120
151
|
export declare class PutBucketLifecycleConfigurationCommand extends $Command<PutBucketLifecycleConfigurationCommandInput, PutBucketLifecycleConfigurationCommandOutput, S3ClientResolvedConfig> {
|
|
121
152
|
readonly input: PutBucketLifecycleConfigurationCommandInput;
|
|
@@ -104,6 +104,32 @@ export interface PutBucketLoggingCommandOutput extends __MetadataBearer {
|
|
|
104
104
|
* @see {@link PutBucketLoggingCommandOutput} for command's `response` shape.
|
|
105
105
|
* @see {@link S3ClientResolvedConfig | config} for S3Client's `config` shape.
|
|
106
106
|
*
|
|
107
|
+
* @example Set logging configuration for a bucket
|
|
108
|
+
* ```javascript
|
|
109
|
+
* // The following example sets logging policy on a bucket. For the Log Delivery group to deliver logs to the destination bucket, it needs permission for the READ_ACP action which the policy grants.
|
|
110
|
+
* const input = {
|
|
111
|
+
* "Bucket": "sourcebucket",
|
|
112
|
+
* "BucketLoggingStatus": {
|
|
113
|
+
* "LoggingEnabled": {
|
|
114
|
+
* "TargetBucket": "targetbucket",
|
|
115
|
+
* "TargetGrants": [
|
|
116
|
+
* {
|
|
117
|
+
* "Grantee": {
|
|
118
|
+
* "Type": "Group",
|
|
119
|
+
* "URI": "http://acs.amazonaws.com/groups/global/AllUsers"
|
|
120
|
+
* },
|
|
121
|
+
* "Permission": "READ"
|
|
122
|
+
* }
|
|
123
|
+
* ],
|
|
124
|
+
* "TargetPrefix": "MyBucketLogs/"
|
|
125
|
+
* }
|
|
126
|
+
* }
|
|
127
|
+
* };
|
|
128
|
+
* const command = new PutBucketLoggingCommand(input);
|
|
129
|
+
* await client.send(command);
|
|
130
|
+
* // example id: set-logging-configuration-for-a-bucket-1482269119909
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
107
133
|
*/
|
|
108
134
|
export declare class PutBucketLoggingCommand extends $Command<PutBucketLoggingCommandInput, PutBucketLoggingCommandOutput, S3ClientResolvedConfig> {
|
|
109
135
|
readonly input: PutBucketLoggingCommandInput;
|
|
@@ -83,6 +83,27 @@ export interface PutBucketNotificationConfigurationCommandOutput extends __Metad
|
|
|
83
83
|
* @see {@link PutBucketNotificationConfigurationCommandOutput} for command's `response` shape.
|
|
84
84
|
* @see {@link S3ClientResolvedConfig | config} for S3Client's `config` shape.
|
|
85
85
|
*
|
|
86
|
+
* @example Set notification configuration for a bucket
|
|
87
|
+
* ```javascript
|
|
88
|
+
* // The following example sets notification configuration on a bucket to publish the object created events to an SNS topic.
|
|
89
|
+
* const input = {
|
|
90
|
+
* "Bucket": "examplebucket",
|
|
91
|
+
* "NotificationConfiguration": {
|
|
92
|
+
* "TopicConfigurations": [
|
|
93
|
+
* {
|
|
94
|
+
* "Events": [
|
|
95
|
+
* "s3:ObjectCreated:*"
|
|
96
|
+
* ],
|
|
97
|
+
* "TopicArn": "arn:aws:sns:us-west-2:123456789012:s3-notification-topic"
|
|
98
|
+
* }
|
|
99
|
+
* ]
|
|
100
|
+
* }
|
|
101
|
+
* };
|
|
102
|
+
* const command = new PutBucketNotificationConfigurationCommand(input);
|
|
103
|
+
* await client.send(command);
|
|
104
|
+
* // example id: set-notification-configuration-for-a-bucket-1482270296426
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
86
107
|
*/
|
|
87
108
|
export declare class PutBucketNotificationConfigurationCommand extends $Command<PutBucketNotificationConfigurationCommandInput, PutBucketNotificationConfigurationCommandOutput, S3ClientResolvedConfig> {
|
|
88
109
|
readonly input: PutBucketNotificationConfigurationCommandInput;
|
|
@@ -55,6 +55,18 @@ export interface PutBucketPolicyCommandOutput extends __MetadataBearer {
|
|
|
55
55
|
* @see {@link PutBucketPolicyCommandOutput} for command's `response` shape.
|
|
56
56
|
* @see {@link S3ClientResolvedConfig | config} for S3Client's `config` shape.
|
|
57
57
|
*
|
|
58
|
+
* @example Set bucket policy
|
|
59
|
+
* ```javascript
|
|
60
|
+
* // The following example sets a permission policy on a bucket.
|
|
61
|
+
* const input = {
|
|
62
|
+
* "Bucket": "examplebucket",
|
|
63
|
+
* "Policy": "{\"Version\": \"2012-10-17\", \"Statement\": [{ \"Sid\": \"id-1\",\"Effect\": \"Allow\",\"Principal\": {\"AWS\": \"arn:aws:iam::123456789012:root\"}, \"Action\": [ \"s3:PutObject\",\"s3:PutObjectAcl\"], \"Resource\": [\"arn:aws:s3:::acl3/*\" ] } ]}"
|
|
64
|
+
* };
|
|
65
|
+
* const command = new PutBucketPolicyCommand(input);
|
|
66
|
+
* await client.send(command);
|
|
67
|
+
* // example id: set-bucket-policy-1482448903302
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
58
70
|
*/
|
|
59
71
|
export declare class PutBucketPolicyCommand extends $Command<PutBucketPolicyCommandInput, PutBucketPolicyCommandOutput, S3ClientResolvedConfig> {
|
|
60
72
|
readonly input: PutBucketPolicyCommandInput;
|
|
@@ -90,6 +90,30 @@ export interface PutBucketReplicationCommandOutput extends __MetadataBearer {
|
|
|
90
90
|
* @see {@link PutBucketReplicationCommandOutput} for command's `response` shape.
|
|
91
91
|
* @see {@link S3ClientResolvedConfig | config} for S3Client's `config` shape.
|
|
92
92
|
*
|
|
93
|
+
* @example Set replication configuration on a bucket
|
|
94
|
+
* ```javascript
|
|
95
|
+
* // The following example sets replication configuration on a bucket.
|
|
96
|
+
* const input = {
|
|
97
|
+
* "Bucket": "examplebucket",
|
|
98
|
+
* "ReplicationConfiguration": {
|
|
99
|
+
* "Role": "arn:aws:iam::123456789012:role/examplerole",
|
|
100
|
+
* "Rules": [
|
|
101
|
+
* {
|
|
102
|
+
* "Destination": {
|
|
103
|
+
* "Bucket": "arn:aws:s3:::destinationbucket",
|
|
104
|
+
* "StorageClass": "STANDARD"
|
|
105
|
+
* },
|
|
106
|
+
* "Prefix": "",
|
|
107
|
+
* "Status": "Enabled"
|
|
108
|
+
* }
|
|
109
|
+
* ]
|
|
110
|
+
* }
|
|
111
|
+
* };
|
|
112
|
+
* const command = new PutBucketReplicationCommand(input);
|
|
113
|
+
* await client.send(command);
|
|
114
|
+
* // example id: id-1
|
|
115
|
+
* ```
|
|
116
|
+
*
|
|
93
117
|
*/
|
|
94
118
|
export declare class PutBucketReplicationCommand extends $Command<PutBucketReplicationCommandInput, PutBucketReplicationCommandOutput, S3ClientResolvedConfig> {
|
|
95
119
|
readonly input: PutBucketReplicationCommandInput;
|
|
@@ -46,6 +46,20 @@ export interface PutBucketRequestPaymentCommandOutput extends __MetadataBearer {
|
|
|
46
46
|
* @see {@link PutBucketRequestPaymentCommandOutput} for command's `response` shape.
|
|
47
47
|
* @see {@link S3ClientResolvedConfig | config} for S3Client's `config` shape.
|
|
48
48
|
*
|
|
49
|
+
* @example Set request payment configuration on a bucket.
|
|
50
|
+
* ```javascript
|
|
51
|
+
* // The following example sets request payment configuration on a bucket so that person requesting the download is charged.
|
|
52
|
+
* const input = {
|
|
53
|
+
* "Bucket": "examplebucket",
|
|
54
|
+
* "RequestPaymentConfiguration": {
|
|
55
|
+
* "Payer": "Requester"
|
|
56
|
+
* }
|
|
57
|
+
* };
|
|
58
|
+
* const command = new PutBucketRequestPaymentCommand(input);
|
|
59
|
+
* await client.send(command);
|
|
60
|
+
* // example id: set-request-payment-configuration-on-a-bucket-1482343596680
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
49
63
|
*/
|
|
50
64
|
export declare class PutBucketRequestPaymentCommand extends $Command<PutBucketRequestPaymentCommandInput, PutBucketRequestPaymentCommandOutput, S3ClientResolvedConfig> {
|
|
51
65
|
readonly input: PutBucketRequestPaymentCommandInput;
|
|
@@ -103,6 +103,29 @@ export interface PutBucketTaggingCommandOutput extends __MetadataBearer {
|
|
|
103
103
|
* @see {@link PutBucketTaggingCommandOutput} for command's `response` shape.
|
|
104
104
|
* @see {@link S3ClientResolvedConfig | config} for S3Client's `config` shape.
|
|
105
105
|
*
|
|
106
|
+
* @example Set tags on a bucket
|
|
107
|
+
* ```javascript
|
|
108
|
+
* // The following example sets tags on a bucket. Any existing tags are replaced.
|
|
109
|
+
* const input = {
|
|
110
|
+
* "Bucket": "examplebucket",
|
|
111
|
+
* "Tagging": {
|
|
112
|
+
* "TagSet": [
|
|
113
|
+
* {
|
|
114
|
+
* "Key": "Key1",
|
|
115
|
+
* "Value": "Value1"
|
|
116
|
+
* },
|
|
117
|
+
* {
|
|
118
|
+
* "Key": "Key2",
|
|
119
|
+
* "Value": "Value2"
|
|
120
|
+
* }
|
|
121
|
+
* ]
|
|
122
|
+
* }
|
|
123
|
+
* };
|
|
124
|
+
* const command = new PutBucketTaggingCommand(input);
|
|
125
|
+
* await client.send(command);
|
|
126
|
+
* // example id: set-tags-on-a-bucket-1482346269066
|
|
127
|
+
* ```
|
|
128
|
+
*
|
|
106
129
|
*/
|
|
107
130
|
export declare class PutBucketTaggingCommand extends $Command<PutBucketTaggingCommandInput, PutBucketTaggingCommandOutput, S3ClientResolvedConfig> {
|
|
108
131
|
readonly input: PutBucketTaggingCommandInput;
|
|
@@ -71,6 +71,21 @@ export interface PutBucketVersioningCommandOutput extends __MetadataBearer {
|
|
|
71
71
|
* @see {@link PutBucketVersioningCommandOutput} for command's `response` shape.
|
|
72
72
|
* @see {@link S3ClientResolvedConfig | config} for S3Client's `config` shape.
|
|
73
73
|
*
|
|
74
|
+
* @example Set versioning configuration on a bucket
|
|
75
|
+
* ```javascript
|
|
76
|
+
* // The following example sets versioning configuration on bucket. The configuration enables versioning on the bucket.
|
|
77
|
+
* const input = {
|
|
78
|
+
* "Bucket": "examplebucket",
|
|
79
|
+
* "VersioningConfiguration": {
|
|
80
|
+
* "MFADelete": "Disabled",
|
|
81
|
+
* "Status": "Enabled"
|
|
82
|
+
* }
|
|
83
|
+
* };
|
|
84
|
+
* const command = new PutBucketVersioningCommand(input);
|
|
85
|
+
* await client.send(command);
|
|
86
|
+
* // example id: set-versioning-configuration-on-a-bucket-1482344186279
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
74
89
|
*/
|
|
75
90
|
export declare class PutBucketVersioningCommand extends $Command<PutBucketVersioningCommandInput, PutBucketVersioningCommandOutput, S3ClientResolvedConfig> {
|
|
76
91
|
readonly input: PutBucketVersioningCommandInput;
|
|
@@ -150,6 +150,26 @@ export interface PutBucketWebsiteCommandOutput extends __MetadataBearer {
|
|
|
150
150
|
* @see {@link PutBucketWebsiteCommandOutput} for command's `response` shape.
|
|
151
151
|
* @see {@link S3ClientResolvedConfig | config} for S3Client's `config` shape.
|
|
152
152
|
*
|
|
153
|
+
* @example Set website configuration on a bucket
|
|
154
|
+
* ```javascript
|
|
155
|
+
* // The following example adds website configuration to a bucket.
|
|
156
|
+
* const input = {
|
|
157
|
+
* "Bucket": "examplebucket",
|
|
158
|
+
* "ContentMD5": "",
|
|
159
|
+
* "WebsiteConfiguration": {
|
|
160
|
+
* "ErrorDocument": {
|
|
161
|
+
* "Key": "error.html"
|
|
162
|
+
* },
|
|
163
|
+
* "IndexDocument": {
|
|
164
|
+
* "Suffix": "index.html"
|
|
165
|
+
* }
|
|
166
|
+
* }
|
|
167
|
+
* };
|
|
168
|
+
* const command = new PutBucketWebsiteCommand(input);
|
|
169
|
+
* await client.send(command);
|
|
170
|
+
* // example id: set-website-configuration-on-a-bucket-1482346836261
|
|
171
|
+
* ```
|
|
172
|
+
*
|
|
153
173
|
*/
|
|
154
174
|
export declare class PutBucketWebsiteCommand extends $Command<PutBucketWebsiteCommandInput, PutBucketWebsiteCommandOutput, S3ClientResolvedConfig> {
|
|
155
175
|
readonly input: PutBucketWebsiteCommandInput;
|
|
@@ -207,6 +207,21 @@ export interface PutObjectAclCommandOutput extends PutObjectAclOutput, __Metadat
|
|
|
207
207
|
* @see {@link PutObjectAclCommandOutput} for command's `response` shape.
|
|
208
208
|
* @see {@link S3ClientResolvedConfig | config} for S3Client's `config` shape.
|
|
209
209
|
*
|
|
210
|
+
* @example To grant permissions using object ACL
|
|
211
|
+
* ```javascript
|
|
212
|
+
* // The following example adds grants to an object ACL. The first permission grants user1 and user2 FULL_CONTROL and the AllUsers group READ permission.
|
|
213
|
+
* const input = {
|
|
214
|
+
* "AccessControlPolicy": {},
|
|
215
|
+
* "Bucket": "examplebucket",
|
|
216
|
+
* "GrantFullControl": "emailaddress=user1@example.com,emailaddress=user2@example.com",
|
|
217
|
+
* "GrantRead": "uri=http://acs.amazonaws.com/groups/global/AllUsers",
|
|
218
|
+
* "Key": "HappyFace.jpg"
|
|
219
|
+
* };
|
|
220
|
+
* const command = new PutObjectAclCommand(input);
|
|
221
|
+
* await client.send(command);
|
|
222
|
+
* // example id: to-grant-permissions-using-object-acl-1481835549285
|
|
223
|
+
* ```
|
|
224
|
+
*
|
|
210
225
|
*/
|
|
211
226
|
export declare class PutObjectAclCommand extends $Command<PutObjectAclCommandInput, PutObjectAclCommandOutput, S3ClientResolvedConfig> {
|
|
212
227
|
readonly input: PutObjectAclCommandInput;
|
|
@@ -137,6 +137,151 @@ export interface PutObjectCommandOutput extends PutObjectOutput, __MetadataBeare
|
|
|
137
137
|
* @see {@link PutObjectCommandOutput} for command's `response` shape.
|
|
138
138
|
* @see {@link S3ClientResolvedConfig | config} for S3Client's `config` shape.
|
|
139
139
|
*
|
|
140
|
+
* @example To upload an object
|
|
141
|
+
* ```javascript
|
|
142
|
+
* // The following example uploads an object to a versioning-enabled bucket. The source file is specified using Windows file syntax. S3 returns VersionId of the newly created object.
|
|
143
|
+
* const input = {
|
|
144
|
+
* "Body": "HappyFace.jpg",
|
|
145
|
+
* "Bucket": "examplebucket",
|
|
146
|
+
* "Key": "HappyFace.jpg"
|
|
147
|
+
* };
|
|
148
|
+
* const command = new PutObjectCommand(input);
|
|
149
|
+
* const response = await client.send(command);
|
|
150
|
+
* /* response ==
|
|
151
|
+
* {
|
|
152
|
+
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
|
153
|
+
* "VersionId": "tpf3zF08nBplQK1XLOefGskR7mGDwcDk"
|
|
154
|
+
* }
|
|
155
|
+
* *\/
|
|
156
|
+
* // example id: to-upload-an-object-1481760101010
|
|
157
|
+
* ```
|
|
158
|
+
*
|
|
159
|
+
* @example To upload object and specify user-defined metadata
|
|
160
|
+
* ```javascript
|
|
161
|
+
* // The following example creates an object. The request also specifies optional metadata. If the bucket is versioning enabled, S3 returns version ID in response.
|
|
162
|
+
* const input = {
|
|
163
|
+
* "Body": "filetoupload",
|
|
164
|
+
* "Bucket": "examplebucket",
|
|
165
|
+
* "Key": "exampleobject",
|
|
166
|
+
* "Metadata": {
|
|
167
|
+
* "metadata1": "value1",
|
|
168
|
+
* "metadata2": "value2"
|
|
169
|
+
* }
|
|
170
|
+
* };
|
|
171
|
+
* const command = new PutObjectCommand(input);
|
|
172
|
+
* const response = await client.send(command);
|
|
173
|
+
* /* response ==
|
|
174
|
+
* {
|
|
175
|
+
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
|
176
|
+
* "VersionId": "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0"
|
|
177
|
+
* }
|
|
178
|
+
* *\/
|
|
179
|
+
* // example id: to-upload-object-and-specify-user-defined-metadata-1483396974757
|
|
180
|
+
* ```
|
|
181
|
+
*
|
|
182
|
+
* @example To upload an object (specify optional headers)
|
|
183
|
+
* ```javascript
|
|
184
|
+
* // 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.
|
|
185
|
+
* const input = {
|
|
186
|
+
* "Body": "HappyFace.jpg",
|
|
187
|
+
* "Bucket": "examplebucket",
|
|
188
|
+
* "Key": "HappyFace.jpg",
|
|
189
|
+
* "ServerSideEncryption": "AES256",
|
|
190
|
+
* "StorageClass": "STANDARD_IA"
|
|
191
|
+
* };
|
|
192
|
+
* const command = new PutObjectCommand(input);
|
|
193
|
+
* const response = await client.send(command);
|
|
194
|
+
* /* response ==
|
|
195
|
+
* {
|
|
196
|
+
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
|
197
|
+
* "ServerSideEncryption": "AES256",
|
|
198
|
+
* "VersionId": "CG612hodqujkf8FaaNfp8U..FIhLROcp"
|
|
199
|
+
* }
|
|
200
|
+
* *\/
|
|
201
|
+
* // example id: to-upload-an-object-(specify-optional-headers)
|
|
202
|
+
* ```
|
|
203
|
+
*
|
|
204
|
+
* @example To create an object.
|
|
205
|
+
* ```javascript
|
|
206
|
+
* // The following example creates an object. If the bucket is versioning enabled, S3 returns version ID in response.
|
|
207
|
+
* const input = {
|
|
208
|
+
* "Body": "filetoupload",
|
|
209
|
+
* "Bucket": "examplebucket",
|
|
210
|
+
* "Key": "objectkey"
|
|
211
|
+
* };
|
|
212
|
+
* const command = new PutObjectCommand(input);
|
|
213
|
+
* const response = await client.send(command);
|
|
214
|
+
* /* response ==
|
|
215
|
+
* {
|
|
216
|
+
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
|
217
|
+
* "VersionId": "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ"
|
|
218
|
+
* }
|
|
219
|
+
* *\/
|
|
220
|
+
* // example id: to-create-an-object-1483147613675
|
|
221
|
+
* ```
|
|
222
|
+
*
|
|
223
|
+
* @example To upload an object and specify server-side encryption and object tags
|
|
224
|
+
* ```javascript
|
|
225
|
+
* // The following example uploads and object. The request specifies the optional server-side encryption option. The request also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response.
|
|
226
|
+
* const input = {
|
|
227
|
+
* "Body": "filetoupload",
|
|
228
|
+
* "Bucket": "examplebucket",
|
|
229
|
+
* "Key": "exampleobject",
|
|
230
|
+
* "ServerSideEncryption": "AES256",
|
|
231
|
+
* "Tagging": "key1=value1&key2=value2"
|
|
232
|
+
* };
|
|
233
|
+
* const command = new PutObjectCommand(input);
|
|
234
|
+
* const response = await client.send(command);
|
|
235
|
+
* /* response ==
|
|
236
|
+
* {
|
|
237
|
+
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
|
238
|
+
* "ServerSideEncryption": "AES256",
|
|
239
|
+
* "VersionId": "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt"
|
|
240
|
+
* }
|
|
241
|
+
* *\/
|
|
242
|
+
* // example id: to-upload-an-object-and-specify-server-side-encryption-and-object-tags-1483398331831
|
|
243
|
+
* ```
|
|
244
|
+
*
|
|
245
|
+
* @example To upload an object and specify optional tags
|
|
246
|
+
* ```javascript
|
|
247
|
+
* // The following example uploads an object. The request specifies optional object tags. The bucket is versioned, therefore S3 returns version ID of the newly created object.
|
|
248
|
+
* const input = {
|
|
249
|
+
* "Body": "c:\\HappyFace.jpg",
|
|
250
|
+
* "Bucket": "examplebucket",
|
|
251
|
+
* "Key": "HappyFace.jpg",
|
|
252
|
+
* "Tagging": "key1=value1&key2=value2"
|
|
253
|
+
* };
|
|
254
|
+
* const command = new PutObjectCommand(input);
|
|
255
|
+
* const response = await client.send(command);
|
|
256
|
+
* /* response ==
|
|
257
|
+
* {
|
|
258
|
+
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
|
259
|
+
* "VersionId": "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a"
|
|
260
|
+
* }
|
|
261
|
+
* *\/
|
|
262
|
+
* // example id: to-upload-an-object-and-specify-optional-tags-1481762310955
|
|
263
|
+
* ```
|
|
264
|
+
*
|
|
265
|
+
* @example To upload an object and specify canned ACL.
|
|
266
|
+
* ```javascript
|
|
267
|
+
* // The following example uploads and object. The request specifies optional canned ACL (access control list) to all READ access to authenticated users. If the bucket is versioning enabled, S3 returns version ID in response.
|
|
268
|
+
* const input = {
|
|
269
|
+
* "ACL": "authenticated-read",
|
|
270
|
+
* "Body": "filetoupload",
|
|
271
|
+
* "Bucket": "examplebucket",
|
|
272
|
+
* "Key": "exampleobject"
|
|
273
|
+
* };
|
|
274
|
+
* const command = new PutObjectCommand(input);
|
|
275
|
+
* const response = await client.send(command);
|
|
276
|
+
* /* response ==
|
|
277
|
+
* {
|
|
278
|
+
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
|
279
|
+
* "VersionId": "Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr"
|
|
280
|
+
* }
|
|
281
|
+
* *\/
|
|
282
|
+
* // example id: to-upload-an-object-and-specify-canned-acl-1483397779571
|
|
283
|
+
* ```
|
|
284
|
+
*
|
|
140
285
|
*/
|
|
141
286
|
export declare class PutObjectCommand extends $Command<PutObjectCommandInput, PutObjectCommandOutput, S3ClientResolvedConfig> {
|
|
142
287
|
readonly input: PutObjectCommandInput;
|
|
@@ -120,6 +120,35 @@ export interface PutObjectTaggingCommandOutput extends PutObjectTaggingOutput, _
|
|
|
120
120
|
* @see {@link PutObjectTaggingCommandOutput} for command's `response` shape.
|
|
121
121
|
* @see {@link S3ClientResolvedConfig | config} for S3Client's `config` shape.
|
|
122
122
|
*
|
|
123
|
+
* @example To add tags to an existing object
|
|
124
|
+
* ```javascript
|
|
125
|
+
* // The following example adds tags to an existing object.
|
|
126
|
+
* const input = {
|
|
127
|
+
* "Bucket": "examplebucket",
|
|
128
|
+
* "Key": "HappyFace.jpg",
|
|
129
|
+
* "Tagging": {
|
|
130
|
+
* "TagSet": [
|
|
131
|
+
* {
|
|
132
|
+
* "Key": "Key3",
|
|
133
|
+
* "Value": "Value3"
|
|
134
|
+
* },
|
|
135
|
+
* {
|
|
136
|
+
* "Key": "Key4",
|
|
137
|
+
* "Value": "Value4"
|
|
138
|
+
* }
|
|
139
|
+
* ]
|
|
140
|
+
* }
|
|
141
|
+
* };
|
|
142
|
+
* const command = new PutObjectTaggingCommand(input);
|
|
143
|
+
* const response = await client.send(command);
|
|
144
|
+
* /* response ==
|
|
145
|
+
* {
|
|
146
|
+
* "VersionId": "null"
|
|
147
|
+
* }
|
|
148
|
+
* *\/
|
|
149
|
+
* // example id: to-add-tags-to-an-existing-object-1481764668793
|
|
150
|
+
* ```
|
|
151
|
+
*
|
|
123
152
|
*/
|
|
124
153
|
export declare class PutObjectTaggingCommand extends $Command<PutObjectTaggingCommandInput, PutObjectTaggingCommandOutput, S3ClientResolvedConfig> {
|
|
125
154
|
readonly input: PutObjectTaggingCommandInput;
|
|
@@ -312,6 +312,24 @@ export interface RestoreObjectCommandOutput extends RestoreObjectOutput, __Metad
|
|
|
312
312
|
* @see {@link RestoreObjectCommandOutput} for command's `response` shape.
|
|
313
313
|
* @see {@link S3ClientResolvedConfig | config} for S3Client's `config` shape.
|
|
314
314
|
*
|
|
315
|
+
* @example To restore an archived object
|
|
316
|
+
* ```javascript
|
|
317
|
+
* // The following example restores for one day an archived copy of an object back into Amazon S3 bucket.
|
|
318
|
+
* const input = {
|
|
319
|
+
* "Bucket": "examplebucket",
|
|
320
|
+
* "Key": "archivedobjectkey",
|
|
321
|
+
* "RestoreRequest": {
|
|
322
|
+
* "Days": 1,
|
|
323
|
+
* "GlacierJobParameters": {
|
|
324
|
+
* "Tier": "Expedited"
|
|
325
|
+
* }
|
|
326
|
+
* }
|
|
327
|
+
* };
|
|
328
|
+
* const command = new RestoreObjectCommand(input);
|
|
329
|
+
* await client.send(command);
|
|
330
|
+
* // example id: to-restore-an-archived-object-1483049329953
|
|
331
|
+
* ```
|
|
332
|
+
*
|
|
315
333
|
*/
|
|
316
334
|
export declare class RestoreObjectCommand extends $Command<RestoreObjectCommandInput, RestoreObjectCommandOutput, S3ClientResolvedConfig> {
|
|
317
335
|
readonly input: RestoreObjectCommandInput;
|
|
@@ -158,6 +158,26 @@ export interface UploadPartCommandOutput extends UploadPartOutput, __MetadataBea
|
|
|
158
158
|
* @see {@link UploadPartCommandOutput} for command's `response` shape.
|
|
159
159
|
* @see {@link S3ClientResolvedConfig | config} for S3Client's `config` shape.
|
|
160
160
|
*
|
|
161
|
+
* @example To upload a part
|
|
162
|
+
* ```javascript
|
|
163
|
+
* // The following example uploads part 1 of a multipart upload. The example specifies a file name for the part data. The Upload ID is same that is returned by the initiate multipart upload.
|
|
164
|
+
* const input = {
|
|
165
|
+
* "Body": "fileToUpload",
|
|
166
|
+
* "Bucket": "examplebucket",
|
|
167
|
+
* "Key": "examplelargeobject",
|
|
168
|
+
* "PartNumber": "1",
|
|
169
|
+
* "UploadId": "xadcOB_7YPBOJuoFiQ9cz4P3Pe6FIZwO4f7wN93uHsNBEw97pl5eNwzExg0LAT2dUN91cOmrEQHDsP3WA60CEg--"
|
|
170
|
+
* };
|
|
171
|
+
* const command = new UploadPartCommand(input);
|
|
172
|
+
* const response = await client.send(command);
|
|
173
|
+
* /* response ==
|
|
174
|
+
* {
|
|
175
|
+
* "ETag": "\"d8c2eafd90c266e19ab9dcacc479f8af\""
|
|
176
|
+
* }
|
|
177
|
+
* *\/
|
|
178
|
+
* // example id: to-upload-a-part-1481847914943
|
|
179
|
+
* ```
|
|
180
|
+
*
|
|
161
181
|
*/
|
|
162
182
|
export declare class UploadPartCommand extends $Command<UploadPartCommandInput, UploadPartCommandOutput, S3ClientResolvedConfig> {
|
|
163
183
|
readonly input: UploadPartCommandInput;
|
|
@@ -195,6 +195,53 @@ export interface UploadPartCopyCommandOutput extends UploadPartCopyOutput, __Met
|
|
|
195
195
|
* @see {@link UploadPartCopyCommandOutput} for command's `response` shape.
|
|
196
196
|
* @see {@link S3ClientResolvedConfig | config} for S3Client's `config` shape.
|
|
197
197
|
*
|
|
198
|
+
* @example To upload a part by copying byte range from an existing object as data source
|
|
199
|
+
* ```javascript
|
|
200
|
+
* // The following example uploads a part of a multipart upload by copying a specified byte range from an existing object as data source.
|
|
201
|
+
* const input = {
|
|
202
|
+
* "Bucket": "examplebucket",
|
|
203
|
+
* "CopySource": "/bucketname/sourceobjectkey",
|
|
204
|
+
* "CopySourceRange": "bytes=1-100000",
|
|
205
|
+
* "Key": "examplelargeobject",
|
|
206
|
+
* "PartNumber": "2",
|
|
207
|
+
* "UploadId": "exampleuoh_10OhKhT7YukE9bjzTPRiuaCotmZM_pFngJFir9OZNrSr5cWa3cq3LZSUsfjI4FI7PkP91We7Nrw--"
|
|
208
|
+
* };
|
|
209
|
+
* const command = new UploadPartCopyCommand(input);
|
|
210
|
+
* const response = await client.send(command);
|
|
211
|
+
* /* response ==
|
|
212
|
+
* {
|
|
213
|
+
* "CopyPartResult": {
|
|
214
|
+
* "ETag": "\"65d16d19e65a7508a51f043180edcc36\"",
|
|
215
|
+
* "LastModified": "2016-12-29T21:44:28.000Z"
|
|
216
|
+
* }
|
|
217
|
+
* }
|
|
218
|
+
* *\/
|
|
219
|
+
* // example id: to-upload-a-part-by-copying-byte-range-from-an-existing-object-as-data-source-1483048068594
|
|
220
|
+
* ```
|
|
221
|
+
*
|
|
222
|
+
* @example To upload a part by copying data from an existing object as data source
|
|
223
|
+
* ```javascript
|
|
224
|
+
* // The following example uploads a part of a multipart upload by copying data from an existing object as data source.
|
|
225
|
+
* const input = {
|
|
226
|
+
* "Bucket": "examplebucket",
|
|
227
|
+
* "CopySource": "/bucketname/sourceobjectkey",
|
|
228
|
+
* "Key": "examplelargeobject",
|
|
229
|
+
* "PartNumber": "1",
|
|
230
|
+
* "UploadId": "exampleuoh_10OhKhT7YukE9bjzTPRiuaCotmZM_pFngJFir9OZNrSr5cWa3cq3LZSUsfjI4FI7PkP91We7Nrw--"
|
|
231
|
+
* };
|
|
232
|
+
* const command = new UploadPartCopyCommand(input);
|
|
233
|
+
* const response = await client.send(command);
|
|
234
|
+
* /* response ==
|
|
235
|
+
* {
|
|
236
|
+
* "CopyPartResult": {
|
|
237
|
+
* "ETag": "\"b0c6f0e7e054ab8fa2536a2677f8734d\"",
|
|
238
|
+
* "LastModified": "2016-12-29T21:24:43.000Z"
|
|
239
|
+
* }
|
|
240
|
+
* }
|
|
241
|
+
* *\/
|
|
242
|
+
* // example id: to-upload-a-part-by-copying-data-from-an-existing-object-as-data-source-1483046746348
|
|
243
|
+
* ```
|
|
244
|
+
*
|
|
198
245
|
*/
|
|
199
246
|
export declare class UploadPartCopyCommand extends $Command<UploadPartCopyCommandInput, UploadPartCopyCommandOutput, S3ClientResolvedConfig> {
|
|
200
247
|
readonly input: UploadPartCopyCommandInput;
|