Class: Aws::S3::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::S3::Client
- Includes:
- ClientStubs
- Defined in:
- lib/aws-sdk-s3/client.rb
Class Attribute Summary collapse
- .identifier ⇒ Object readonly private
API Operations collapse
-
#abort_multipart_upload(params = {}) ⇒ Types::AbortMultipartUploadOutput
Aborts a multipart upload.
-
#complete_multipart_upload(params = {}) ⇒ Types::CompleteMultipartUploadOutput
Completes a multipart upload by assembling previously uploaded parts.
-
#copy_object(params = {}) ⇒ Types::CopyObjectOutput
Creates a copy of an object that is already stored in Amazon S3.
-
#create_bucket(params = {}) ⇒ Types::CreateBucketOutput
Creates a new bucket.
-
#create_multipart_upload(params = {}) ⇒ Types::CreateMultipartUploadOutput
Initiates a multipart upload and returns an upload ID.
-
#delete_bucket(params = {}) ⇒ Struct
Deletes the bucket.
-
#delete_bucket_analytics_configuration(params = {}) ⇒ Struct
Deletes an analytics configuration for the bucket (specified by the analytics configuration ID).
-
#delete_bucket_cors(params = {}) ⇒ Struct
Deletes the cors configuration information set for the bucket.
-
#delete_bucket_encryption(params = {}) ⇒ Struct
Deletes the server-side encryption configuration from the bucket.
-
#delete_bucket_inventory_configuration(params = {}) ⇒ Struct
Deletes an inventory configuration (identified by the inventory ID) from the bucket.
-
#delete_bucket_lifecycle(params = {}) ⇒ Struct
Deletes the lifecycle configuration from the bucket.
-
#delete_bucket_metrics_configuration(params = {}) ⇒ Struct
Deletes a metrics configuration (specified by the metrics configuration ID) from the bucket.
-
#delete_bucket_policy(params = {}) ⇒ Struct
Deletes the policy from the bucket.
-
#delete_bucket_replication(params = {}) ⇒ Struct
Deletes the replication configuration from the bucket.
-
#delete_bucket_tagging(params = {}) ⇒ Struct
Deletes the tags from the bucket.
-
#delete_bucket_website(params = {}) ⇒ Struct
This operation removes the website configuration from the bucket.
-
#delete_object(params = {}) ⇒ Types::DeleteObjectOutput
Removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest version of the object.
-
#delete_object_tagging(params = {}) ⇒ Types::DeleteObjectTaggingOutput
Removes the tag-set from an existing object.
-
#delete_objects(params = {}) ⇒ Types::DeleteObjectsOutput
This operation enables you to delete multiple objects from a bucket using a single HTTP request.
-
#get_bucket_accelerate_configuration(params = {}) ⇒ Types::GetBucketAccelerateConfigurationOutput
Returns the accelerate configuration of a bucket.
-
#get_bucket_acl(params = {}) ⇒ Types::GetBucketAclOutput
Gets the access control policy for the bucket.
-
#get_bucket_analytics_configuration(params = {}) ⇒ Types::GetBucketAnalyticsConfigurationOutput
Gets an analytics configuration for the bucket (specified by the analytics configuration ID).
-
#get_bucket_cors(params = {}) ⇒ Types::GetBucketCorsOutput
Returns the cors configuration for the bucket.
-
#get_bucket_encryption(params = {}) ⇒ Types::GetBucketEncryptionOutput
Returns the server-side encryption configuration of a bucket.
-
#get_bucket_inventory_configuration(params = {}) ⇒ Types::GetBucketInventoryConfigurationOutput
Returns an inventory configuration (identified by the inventory ID) from the bucket.
-
#get_bucket_lifecycle(params = {}) ⇒ Types::GetBucketLifecycleOutput
Deprecated, see the GetBucketLifecycleConfiguration operation.
-
#get_bucket_lifecycle_configuration(params = {}) ⇒ Types::GetBucketLifecycleConfigurationOutput
Returns the lifecycle configuration information set on the bucket.
-
#get_bucket_location(params = {}) ⇒ Types::GetBucketLocationOutput
Returns the region the bucket resides in.
-
#get_bucket_logging(params = {}) ⇒ Types::GetBucketLoggingOutput
Returns the logging status of a bucket and the permissions users have to view and modify that status.
-
#get_bucket_metrics_configuration(params = {}) ⇒ Types::GetBucketMetricsConfigurationOutput
Gets a metrics configuration (specified by the metrics configuration ID) from the bucket.
-
#get_bucket_notification(params = {}) ⇒ Types::NotificationConfigurationDeprecated
Deprecated, see the GetBucketNotificationConfiguration operation.
-
#get_bucket_notification_configuration(params = {}) ⇒ Types::NotificationConfiguration
Returns the notification configuration of a bucket.
-
#get_bucket_policy(params = {}) ⇒ Types::GetBucketPolicyOutput
Returns the policy of a specified bucket.
-
#get_bucket_replication(params = {}) ⇒ Types::GetBucketReplicationOutput
Returns the replication configuration of a bucket.
-
#get_bucket_request_payment(params = {}) ⇒ Types::GetBucketRequestPaymentOutput
Returns the request payment configuration of a bucket.
-
#get_bucket_tagging(params = {}) ⇒ Types::GetBucketTaggingOutput
Returns the tag set associated with the bucket.
-
#get_bucket_versioning(params = {}) ⇒ Types::GetBucketVersioningOutput
Returns the versioning state of a bucket.
-
#get_bucket_website(params = {}) ⇒ Types::GetBucketWebsiteOutput
Returns the website configuration for a bucket.
-
#get_object(params = {}) ⇒ Types::GetObjectOutput
Retrieves objects from Amazon S3.
-
#get_object_acl(params = {}) ⇒ Types::GetObjectAclOutput
Returns the access control list (ACL) of an object.
-
#get_object_tagging(params = {}) ⇒ Types::GetObjectTaggingOutput
Returns the tag-set of an object.
-
#get_object_torrent(params = {}) ⇒ Types::GetObjectTorrentOutput
Return torrent files from a bucket.
-
#head_bucket(params = {}) ⇒ Struct
This operation is useful to determine if a bucket exists and you have permission to access it.
-
#head_object(params = {}) ⇒ Types::HeadObjectOutput
The HEAD operation retrieves metadata from an object without returning the object itself.
-
#list_bucket_analytics_configurations(params = {}) ⇒ Types::ListBucketAnalyticsConfigurationsOutput
Lists the analytics configurations for the bucket.
-
#list_bucket_inventory_configurations(params = {}) ⇒ Types::ListBucketInventoryConfigurationsOutput
Returns a list of inventory configurations for the bucket.
-
#list_bucket_metrics_configurations(params = {}) ⇒ Types::ListBucketMetricsConfigurationsOutput
Lists the metrics configurations for the bucket.
-
#list_buckets(params = {}) ⇒ Types::ListBucketsOutput
Returns a list of all buckets owned by the authenticated sender of the request.
-
#list_multipart_uploads(params = {}) ⇒ Types::ListMultipartUploadsOutput
This operation lists in-progress multipart uploads.
-
#list_object_versions(params = {}) ⇒ Types::ListObjectVersionsOutput
Returns metadata about all of the versions of objects in a bucket.
-
#list_objects(params = {}) ⇒ Types::ListObjectsOutput
Returns some or all (up to 1000) of the objects in a bucket.
-
#list_objects_v2(params = {}) ⇒ Types::ListObjectsV2Output
Returns some or all (up to 1000) of the objects in a bucket.
-
#list_parts(params = {}) ⇒ Types::ListPartsOutput
Lists the parts that have been uploaded for a specific multipart upload.
-
#put_bucket_accelerate_configuration(params = {}) ⇒ Struct
Sets the accelerate configuration of an existing bucket.
-
#put_bucket_acl(params = {}) ⇒ Struct
Sets the permissions on a bucket using access control lists (ACL).
-
#put_bucket_analytics_configuration(params = {}) ⇒ Struct
Sets an analytics configuration for the bucket (specified by the analytics configuration ID).
-
#put_bucket_cors(params = {}) ⇒ Struct
Sets the cors configuration for a bucket.
-
#put_bucket_encryption(params = {}) ⇒ Struct
Creates a new server-side encryption configuration (or replaces an existing one, if present).
-
#put_bucket_inventory_configuration(params = {}) ⇒ Struct
Adds an inventory configuration (identified by the inventory ID) from the bucket.
-
#put_bucket_lifecycle(params = {}) ⇒ Struct
Deprecated, see the PutBucketLifecycleConfiguration operation.
-
#put_bucket_lifecycle_configuration(params = {}) ⇒ Struct
Sets lifecycle configuration for your bucket.
-
#put_bucket_logging(params = {}) ⇒ Struct
Set the logging parameters for a bucket and to specify permissions for who can view and modify the logging parameters.
-
#put_bucket_metrics_configuration(params = {}) ⇒ Struct
Sets a metrics configuration (specified by the metrics configuration ID) for the bucket.
-
#put_bucket_notification(params = {}) ⇒ Struct
Deprecated, see the PutBucketNotificationConfiguraiton operation.
-
#put_bucket_notification_configuration(params = {}) ⇒ Struct
Enables notifications of specified events for a bucket.
-
#put_bucket_policy(params = {}) ⇒ Struct
Replaces a policy on a bucket.
-
#put_bucket_replication(params = {}) ⇒ Struct
Creates a new replication configuration (or replaces an existing one, if present).
-
#put_bucket_request_payment(params = {}) ⇒ Struct
Sets the request payment configuration for a bucket.
-
#put_bucket_tagging(params = {}) ⇒ Struct
Sets the tags for a bucket.
-
#put_bucket_versioning(params = {}) ⇒ Struct
Sets the versioning state of an existing bucket.
-
#put_bucket_website(params = {}) ⇒ Struct
Set the website configuration for a bucket.
-
#put_object(params = {}) ⇒ Types::PutObjectOutput
Adds an object to a bucket.
-
#put_object_acl(params = {}) ⇒ Types::PutObjectAclOutput
uses the acl subresource to set the access control list (ACL) permissions for an object that already exists in a bucket.
-
#put_object_tagging(params = {}) ⇒ Types::PutObjectTaggingOutput
Sets the supplied tag-set to an object that already exists in a bucket.
-
#restore_object(params = {}) ⇒ Types::RestoreObjectOutput
Restores an archived copy of an object back into Amazon S3.
-
#upload_part(params = {}) ⇒ Types::UploadPartOutput
Uploads a part in a multipart upload.
-
#upload_part_copy(params = {}) ⇒ Types::UploadPartCopyOutput
Uploads a part by copying data from an existing object as data source.
Class Method Summary collapse
- .errors_module ⇒ Object private
Instance Method Summary collapse
- #build_request(operation_name, params = {}) ⇒ Object private
-
#initialize(*args) ⇒ Client
constructor
A new instance of Client.
-
#wait_until(waiter_name, params = {}, options = {}) {|w.waiter| ... } ⇒ Boolean
Polls an API operation until a resource enters a desired state.
- #waiter_names ⇒ Object deprecated private Deprecated.
Constructor Details
#initialize(*args) ⇒ Client
Returns a new instance of Client.
196 197 198 |
# File 'lib/aws-sdk-s3/client.rb', line 196 def initialize(*args) super end |
Class Attribute Details
.identifier ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
6229 6230 6231 |
# File 'lib/aws-sdk-s3/client.rb', line 6229 def identifier @identifier end |
Class Method Details
Instance Method Details
#abort_multipart_upload(params = {}) ⇒ Types::AbortMultipartUploadOutput
Aborts a multipart upload.
To verify that all parts have been removed, so you don’t get charged for the part storage, you should call the List Parts operation and ensure the parts list is empty.
257 258 259 260 |
# File 'lib/aws-sdk-s3/client.rb', line 257 def abort_multipart_upload(params = {}, = {}) req = build_request(:abort_multipart_upload, params) req.send_request() end |
#build_request(operation_name, params = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 |
# File 'lib/aws-sdk-s3/client.rb', line 6088 def build_request(operation_name, params = {}) handlers = @handlers.for(operation_name) context = Seahorse::Client::RequestContext.new( operation_name: operation_name, operation: config.api.operation(operation_name), client: self, params: params, config: config) context[:gem_name] = 'aws-sdk-s3' context[:gem_version] = '1.9.0' Seahorse::Client::Request.new(handlers, context) end |
#complete_multipart_upload(params = {}) ⇒ Types::CompleteMultipartUploadOutput
Completes a multipart upload by assembling previously uploaded parts.
355 356 357 358 |
# File 'lib/aws-sdk-s3/client.rb', line 355 def complete_multipart_upload(params = {}, = {}) req = build_request(:complete_multipart_upload, params) req.send_request() end |
#copy_object(params = {}) ⇒ Types::CopyObjectOutput
Creates a copy of an object that is already stored in Amazon S3.
580 581 582 583 |
# File 'lib/aws-sdk-s3/client.rb', line 580 def copy_object(params = {}, = {}) req = build_request(:copy_object, params) req.send_request() end |
#create_bucket(params = {}) ⇒ Types::CreateBucketOutput
Creates a new bucket.
668 669 670 671 |
# File 'lib/aws-sdk-s3/client.rb', line 668 def create_bucket(params = {}, = {}) req = build_request(:create_bucket, params) req.send_request() end |
#create_multipart_upload(params = {}) ⇒ Types::CreateMultipartUploadOutput
Initiates a multipart upload and returns an upload ID.
Note: After you initiate multipart upload and upload one or more parts, you must either complete or abort multipart upload in order to stop getting charged for storage of the uploaded parts. Only after you either complete or abort multipart upload, Amazon S3 frees up the parts storage and stops charging you for the parts storage.
847 848 849 850 |
# File 'lib/aws-sdk-s3/client.rb', line 847 def create_multipart_upload(params = {}, = {}) req = build_request(:create_multipart_upload, params) req.send_request() end |
#delete_bucket(params = {}) ⇒ Struct
Deletes the bucket. All objects (including all object versions and Delete Markers) in the bucket must be deleted before the bucket itself can be deleted.
879 880 881 882 |
# File 'lib/aws-sdk-s3/client.rb', line 879 def delete_bucket(params = {}, = {}) req = build_request(:delete_bucket, params) req.send_request() end |
#delete_bucket_analytics_configuration(params = {}) ⇒ Struct
Deletes an analytics configuration for the bucket (specified by the analytics configuration ID).
907 908 909 910 |
# File 'lib/aws-sdk-s3/client.rb', line 907 def delete_bucket_analytics_configuration(params = {}, = {}) req = build_request(:delete_bucket_analytics_configuration, params) req.send_request() end |
#delete_bucket_cors(params = {}) ⇒ Struct
Deletes the cors configuration information set for the bucket.
937 938 939 940 |
# File 'lib/aws-sdk-s3/client.rb', line 937 def delete_bucket_cors(params = {}, = {}) req = build_request(:delete_bucket_cors, params) req.send_request() end |
#delete_bucket_encryption(params = {}) ⇒ Struct
Deletes the server-side encryption configuration from the bucket.
960 961 962 963 |
# File 'lib/aws-sdk-s3/client.rb', line 960 def delete_bucket_encryption(params = {}, = {}) req = build_request(:delete_bucket_encryption, params) req.send_request() end |
#delete_bucket_inventory_configuration(params = {}) ⇒ Struct
Deletes an inventory configuration (identified by the inventory ID) from the bucket.
988 989 990 991 |
# File 'lib/aws-sdk-s3/client.rb', line 988 def delete_bucket_inventory_configuration(params = {}, = {}) req = build_request(:delete_bucket_inventory_configuration, params) req.send_request() end |
#delete_bucket_lifecycle(params = {}) ⇒ Struct
Deletes the lifecycle configuration from the bucket.
1018 1019 1020 1021 |
# File 'lib/aws-sdk-s3/client.rb', line 1018 def delete_bucket_lifecycle(params = {}, = {}) req = build_request(:delete_bucket_lifecycle, params) req.send_request() end |
#delete_bucket_metrics_configuration(params = {}) ⇒ Struct
Deletes a metrics configuration (specified by the metrics configuration ID) from the bucket.
1045 1046 1047 1048 |
# File 'lib/aws-sdk-s3/client.rb', line 1045 def delete_bucket_metrics_configuration(params = {}, = {}) req = build_request(:delete_bucket_metrics_configuration, params) req.send_request() end |
#delete_bucket_policy(params = {}) ⇒ Struct
Deletes the policy from the bucket.
1075 1076 1077 1078 |
# File 'lib/aws-sdk-s3/client.rb', line 1075 def delete_bucket_policy(params = {}, = {}) req = build_request(:delete_bucket_policy, params) req.send_request() end |
#delete_bucket_replication(params = {}) ⇒ Struct
Deletes the replication configuration from the bucket.
1105 1106 1107 1108 |
# File 'lib/aws-sdk-s3/client.rb', line 1105 def delete_bucket_replication(params = {}, = {}) req = build_request(:delete_bucket_replication, params) req.send_request() end |
#delete_bucket_tagging(params = {}) ⇒ Struct
Deletes the tags from the bucket.
1135 1136 1137 1138 |
# File 'lib/aws-sdk-s3/client.rb', line 1135 def delete_bucket_tagging(params = {}, = {}) req = build_request(:delete_bucket_tagging, params) req.send_request() end |
#delete_bucket_website(params = {}) ⇒ Struct
This operation removes the website configuration from the bucket.
1165 1166 1167 1168 |
# File 'lib/aws-sdk-s3/client.rb', line 1165 def delete_bucket_website(params = {}, = {}) req = build_request(:delete_bucket_website, params) req.send_request() end |
#delete_object(params = {}) ⇒ Types::DeleteObjectOutput
Removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest version of the object. If there isn’t a null version, Amazon S3 does not remove any objects.
1241 1242 1243 1244 |
# File 'lib/aws-sdk-s3/client.rb', line 1241 def delete_object(params = {}, = {}) req = build_request(:delete_object, params) req.send_request() end |
#delete_object_tagging(params = {}) ⇒ Types::DeleteObjectTaggingOutput
Removes the tag-set from an existing object.
1307 1308 1309 1310 |
# File 'lib/aws-sdk-s3/client.rb', line 1307 def delete_object_tagging(params = {}, = {}) req = build_request(:delete_object_tagging, params) req.send_request() end |
#delete_objects(params = {}) ⇒ Types::DeleteObjectsOutput
This operation enables you to delete multiple objects from a bucket using a single HTTP request. You may specify up to 1000 keys.
1444 1445 1446 1447 |
# File 'lib/aws-sdk-s3/client.rb', line 1444 def delete_objects(params = {}, = {}) req = build_request(:delete_objects, params) req.send_request() end |
#get_bucket_accelerate_configuration(params = {}) ⇒ Types::GetBucketAccelerateConfigurationOutput
Returns the accelerate configuration of a bucket.
1473 1474 1475 1476 |
# File 'lib/aws-sdk-s3/client.rb', line 1473 def get_bucket_accelerate_configuration(params = {}, = {}) req = build_request(:get_bucket_accelerate_configuration, params) req.send_request() end |
#get_bucket_acl(params = {}) ⇒ Types::GetBucketAclOutput
Gets the access control policy for the bucket.
1509 1510 1511 1512 |
# File 'lib/aws-sdk-s3/client.rb', line 1509 def get_bucket_acl(params = {}, = {}) req = build_request(:get_bucket_acl, params) req.send_request() end |
#get_bucket_analytics_configuration(params = {}) ⇒ Types::GetBucketAnalyticsConfigurationOutput
Gets an analytics configuration for the bucket (specified by the analytics configuration ID).
1555 1556 1557 1558 |
# File 'lib/aws-sdk-s3/client.rb', line 1555 def get_bucket_analytics_configuration(params = {}, = {}) req = build_request(:get_bucket_analytics_configuration, params) req.send_request() end |
#get_bucket_cors(params = {}) ⇒ Types::GetBucketCorsOutput
Returns the cors configuration for the bucket.
1618 1619 1620 1621 |
# File 'lib/aws-sdk-s3/client.rb', line 1618 def get_bucket_cors(params = {}, = {}) req = build_request(:get_bucket_cors, params) req.send_request() end |
#get_bucket_encryption(params = {}) ⇒ Types::GetBucketEncryptionOutput
Returns the server-side encryption configuration of a bucket.
1649 1650 1651 1652 |
# File 'lib/aws-sdk-s3/client.rb', line 1649 def get_bucket_encryption(params = {}, = {}) req = build_request(:get_bucket_encryption, params) req.send_request() end |
#get_bucket_inventory_configuration(params = {}) ⇒ Types::GetBucketInventoryConfigurationOutput
Returns an inventory configuration (identified by the inventory ID) from the bucket.
1694 1695 1696 1697 |
# File 'lib/aws-sdk-s3/client.rb', line 1694 def get_bucket_inventory_configuration(params = {}, = {}) req = build_request(:get_bucket_inventory_configuration, params) req.send_request() end |
#get_bucket_lifecycle(params = {}) ⇒ Types::GetBucketLifecycleOutput
Deprecated, see the GetBucketLifecycleConfiguration operation.
1757 1758 1759 1760 |
# File 'lib/aws-sdk-s3/client.rb', line 1757 def get_bucket_lifecycle(params = {}, = {}) req = build_request(:get_bucket_lifecycle, params) req.send_request() end |
#get_bucket_lifecycle_configuration(params = {}) ⇒ Types::GetBucketLifecycleConfigurationOutput
Returns the lifecycle configuration information set on the bucket.
1832 1833 1834 1835 |
# File 'lib/aws-sdk-s3/client.rb', line 1832 def get_bucket_lifecycle_configuration(params = {}, = {}) req = build_request(:get_bucket_lifecycle_configuration, params) req.send_request() end |
#get_bucket_location(params = {}) ⇒ Types::GetBucketLocationOutput
Returns the region the bucket resides in.
1873 1874 1875 1876 |
# File 'lib/aws-sdk-s3/client.rb', line 1873 def get_bucket_location(params = {}, = {}) req = build_request(:get_bucket_location, params) req.send_request() end |
#get_bucket_logging(params = {}) ⇒ Types::GetBucketLoggingOutput
Returns the logging status of a bucket and the permissions users have to view and modify that status. To use GET, you must be the bucket owner.
1910 1911 1912 1913 |
# File 'lib/aws-sdk-s3/client.rb', line 1910 def get_bucket_logging(params = {}, = {}) req = build_request(:get_bucket_logging, params) req.send_request() end |
#get_bucket_metrics_configuration(params = {}) ⇒ Types::GetBucketMetricsConfigurationOutput
Gets a metrics configuration (specified by the metrics configuration ID) from the bucket.
1951 1952 1953 1954 |
# File 'lib/aws-sdk-s3/client.rb', line 1951 def get_bucket_metrics_configuration(params = {}, = {}) req = build_request(:get_bucket_metrics_configuration, params) req.send_request() end |
#get_bucket_notification(params = {}) ⇒ Types::NotificationConfigurationDeprecated
Deprecated, see the GetBucketNotificationConfiguration operation.
2053 2054 2055 2056 |
# File 'lib/aws-sdk-s3/client.rb', line 2053 def get_bucket_notification(params = {}, = {}) req = build_request(:get_bucket_notification, params) req.send_request() end |
#get_bucket_notification_configuration(params = {}) ⇒ Types::NotificationConfiguration
Returns the notification configuration of a bucket.
2106 2107 2108 2109 |
# File 'lib/aws-sdk-s3/client.rb', line 2106 def get_bucket_notification_configuration(params = {}, = {}) req = build_request(:get_bucket_notification_configuration, params) req.send_request() end |
#get_bucket_policy(params = {}) ⇒ Types::GetBucketPolicyOutput
Returns the policy of a specified bucket.
2147 2148 2149 2150 |
# File 'lib/aws-sdk-s3/client.rb', line 2147 def get_bucket_policy(params = {}, = {}, &block) req = build_request(:get_bucket_policy, params) req.send_request(, &block) end |
#get_bucket_replication(params = {}) ⇒ Types::GetBucketReplicationOutput
Returns the replication configuration of a bucket.
2210 2211 2212 2213 |
# File 'lib/aws-sdk-s3/client.rb', line 2210 def get_bucket_replication(params = {}, = {}) req = build_request(:get_bucket_replication, params) req.send_request() end |
#get_bucket_request_payment(params = {}) ⇒ Types::GetBucketRequestPaymentOutput
Returns the request payment configuration of a bucket.
2251 2252 2253 2254 |
# File 'lib/aws-sdk-s3/client.rb', line 2251 def get_bucket_request_payment(params = {}, = {}) req = build_request(:get_bucket_request_payment, params) req.send_request() end |
#get_bucket_tagging(params = {}) ⇒ Types::GetBucketTaggingOutput
Returns the tag set associated with the bucket.
2303 2304 2305 2306 |
# File 'lib/aws-sdk-s3/client.rb', line 2303 def get_bucket_tagging(params = {}, = {}) req = build_request(:get_bucket_tagging, params) req.send_request() end |
#get_bucket_versioning(params = {}) ⇒ Types::GetBucketVersioningOutput
Returns the versioning state of a bucket.
2347 2348 2349 2350 |
# File 'lib/aws-sdk-s3/client.rb', line 2347 def get_bucket_versioning(params = {}, = {}) req = build_request(:get_bucket_versioning, params) req.send_request() end |
#get_bucket_website(params = {}) ⇒ Types::GetBucketWebsiteOutput
Returns the website configuration for a bucket.
2407 2408 2409 2410 |
# File 'lib/aws-sdk-s3/client.rb', line 2407 def get_bucket_website(params = {}, = {}) req = build_request(:get_bucket_website, params) req.send_request() end |
#get_object(params = {}) ⇒ Types::GetObjectOutput
Retrieves objects from Amazon S3.
2659 2660 2661 2662 |
# File 'lib/aws-sdk-s3/client.rb', line 2659 def get_object(params = {}, = {}, &block) req = build_request(:get_object, params) req.send_request(, &block) end |
#get_object_acl(params = {}) ⇒ Types::GetObjectAclOutput
Returns the access control list (ACL) of an object.
2764 2765 2766 2767 |
# File 'lib/aws-sdk-s3/client.rb', line 2764 def get_object_acl(params = {}, = {}) req = build_request(:get_object_acl, params) req.send_request() end |
#get_object_tagging(params = {}) ⇒ Types::GetObjectTaggingOutput
Returns the tag-set of an object.
2847 2848 2849 2850 |
# File 'lib/aws-sdk-s3/client.rb', line 2847 def get_object_tagging(params = {}, = {}) req = build_request(:get_object_tagging, params) req.send_request() end |
#get_object_torrent(params = {}) ⇒ Types::GetObjectTorrentOutput
Return torrent files from a bucket.
2904 2905 2906 2907 |
# File 'lib/aws-sdk-s3/client.rb', line 2904 def get_object_torrent(params = {}, = {}, &block) req = build_request(:get_object_torrent, params) req.send_request(, &block) end |
#head_bucket(params = {}) ⇒ Struct
This operation is useful to determine if a bucket exists and you have permission to access it.
2935 2936 2937 2938 |
# File 'lib/aws-sdk-s3/client.rb', line 2935 def head_bucket(params = {}, = {}) req = build_request(:head_bucket, params) req.send_request() end |
#head_object(params = {}) ⇒ Types::HeadObjectOutput
The HEAD operation retrieves metadata from an object without returning the object itself. This operation is useful if you’re only interested in an object’s metadata. To use HEAD, you must have READ access to the object.
3105 3106 3107 3108 |
# File 'lib/aws-sdk-s3/client.rb', line 3105 def head_object(params = {}, = {}) req = build_request(:head_object, params) req.send_request() end |
#list_bucket_analytics_configurations(params = {}) ⇒ Types::ListBucketAnalyticsConfigurationsOutput
Lists the analytics configurations for the bucket.
3158 3159 3160 3161 |
# File 'lib/aws-sdk-s3/client.rb', line 3158 def list_bucket_analytics_configurations(params = {}, = {}) req = build_request(:list_bucket_analytics_configurations, params) req.send_request() end |
#list_bucket_inventory_configurations(params = {}) ⇒ Types::ListBucketInventoryConfigurationsOutput
Returns a list of inventory configurations for the bucket.
3212 3213 3214 3215 |
# File 'lib/aws-sdk-s3/client.rb', line 3212 def list_bucket_inventory_configurations(params = {}, = {}) req = build_request(:list_bucket_inventory_configurations, params) req.send_request() end |
#list_bucket_metrics_configurations(params = {}) ⇒ Types::ListBucketMetricsConfigurationsOutput
Lists the metrics configurations for the bucket.
3262 3263 3264 3265 |
# File 'lib/aws-sdk-s3/client.rb', line 3262 def list_bucket_metrics_configurations(params = {}, = {}) req = build_request(:list_bucket_metrics_configurations, params) req.send_request() end |
#list_buckets(params = {}) ⇒ Types::ListBucketsOutput
Returns a list of all buckets owned by the authenticated sender of the request.
3319 3320 3321 3322 |
# File 'lib/aws-sdk-s3/client.rb', line 3319 def list_buckets(params = {}, = {}) req = build_request(:list_buckets, params) req.send_request() end |
#list_multipart_uploads(params = {}) ⇒ Types::ListMultipartUploadsOutput
This operation lists in-progress multipart uploads.
3508 3509 3510 3511 |
# File 'lib/aws-sdk-s3/client.rb', line 3508 def list_multipart_uploads(params = {}, = {}) req = build_request(:list_multipart_uploads, params) req.send_request() end |
#list_object_versions(params = {}) ⇒ Types::ListObjectVersionsOutput
Returns metadata about all of the versions of objects in a bucket.
3649 3650 3651 3652 |
# File 'lib/aws-sdk-s3/client.rb', line 3649 def list_object_versions(params = {}, = {}) req = build_request(:list_object_versions, params) req.send_request() end |
#list_objects(params = {}) ⇒ Types::ListObjectsOutput
Returns some or all (up to 1000) of the objects in a bucket. You can use the request parameters as selection criteria to return a subset of the objects in a bucket.
3775 3776 3777 3778 |
# File 'lib/aws-sdk-s3/client.rb', line 3775 def list_objects(params = {}, = {}) req = build_request(:list_objects, params) req.send_request() end |
#list_objects_v2(params = {}) ⇒ Types::ListObjectsV2Output
Returns some or all (up to 1000) of the objects in a bucket. You can use the request parameters as selection criteria to return a subset of the objects in a bucket. Note: ListObjectsV2 is the revised List Objects API and we recommend you use this revised API for new application development.
3915 3916 3917 3918 |
# File 'lib/aws-sdk-s3/client.rb', line 3915 def list_objects_v2(params = {}, = {}) req = build_request(:list_objects_v2, params) req.send_request() end |
#list_parts(params = {}) ⇒ Types::ListPartsOutput
Lists the parts that have been uploaded for a specific multipart upload.
4038 4039 4040 4041 |
# File 'lib/aws-sdk-s3/client.rb', line 4038 def list_parts(params = {}, = {}) req = build_request(:list_parts, params) req.send_request() end |
#put_bucket_accelerate_configuration(params = {}) ⇒ Struct
Sets the accelerate configuration of an existing bucket.
4066 4067 4068 4069 |
# File 'lib/aws-sdk-s3/client.rb', line 4066 def put_bucket_accelerate_configuration(params = {}, = {}) req = build_request(:put_bucket_accelerate_configuration, params) req.send_request() end |
#put_bucket_acl(params = {}) ⇒ Struct
Sets the permissions on a bucket using access control lists (ACL).
4149 4150 4151 4152 |
# File 'lib/aws-sdk-s3/client.rb', line 4149 def put_bucket_acl(params = {}, = {}) req = build_request(:put_bucket_acl, params) req.send_request() end |
#put_bucket_analytics_configuration(params = {}) ⇒ Struct
Sets an analytics configuration for the bucket (specified by the analytics configuration ID).
4211 4212 4213 4214 |
# File 'lib/aws-sdk-s3/client.rb', line 4211 def put_bucket_analytics_configuration(params = {}, = {}) req = build_request(:put_bucket_analytics_configuration, params) req.send_request() end |
#put_bucket_cors(params = {}) ⇒ Struct
Sets the cors configuration for a bucket.
4292 4293 4294 4295 |
# File 'lib/aws-sdk-s3/client.rb', line 4292 def put_bucket_cors(params = {}, = {}) req = build_request(:put_bucket_cors, params) req.send_request() end |
#put_bucket_encryption(params = {}) ⇒ Struct
Creates a new server-side encryption configuration (or replaces an existing one, if present).
4335 4336 4337 4338 |
# File 'lib/aws-sdk-s3/client.rb', line 4335 def put_bucket_encryption(params = {}, = {}) req = build_request(:put_bucket_encryption, params) req.send_request() end |
#put_bucket_inventory_configuration(params = {}) ⇒ Struct
Adds an inventory configuration (identified by the inventory ID) from the bucket.
4393 4394 4395 4396 |
# File 'lib/aws-sdk-s3/client.rb', line 4393 def put_bucket_inventory_configuration(params = {}, = {}) req = build_request(:put_bucket_inventory_configuration, params) req.send_request() end |
#put_bucket_lifecycle(params = {}) ⇒ Struct
Deprecated, see the PutBucketLifecycleConfiguration operation.
4448 4449 4450 4451 |
# File 'lib/aws-sdk-s3/client.rb', line 4448 def put_bucket_lifecycle(params = {}, = {}) req = build_request(:put_bucket_lifecycle, params) req.send_request() end |
#put_bucket_lifecycle_configuration(params = {}) ⇒ Struct
Sets lifecycle configuration for your bucket. If a lifecycle configuration exists, it replaces it.
4550 4551 4552 4553 |
# File 'lib/aws-sdk-s3/client.rb', line 4550 def put_bucket_lifecycle_configuration(params = {}, = {}) req = build_request(:put_bucket_lifecycle_configuration, params) req.send_request() end |
#put_bucket_logging(params = {}) ⇒ Struct
Set the logging parameters for a bucket and to specify permissions for who can view and modify the logging parameters. To set the logging status of a bucket, you must be the bucket owner.
4621 4622 4623 4624 |
# File 'lib/aws-sdk-s3/client.rb', line 4621 def put_bucket_logging(params = {}, = {}) req = build_request(:put_bucket_logging, params) req.send_request() end |
#put_bucket_metrics_configuration(params = {}) ⇒ Struct
Sets a metrics configuration (specified by the metrics configuration ID) for the bucket.
4670 4671 4672 4673 |
# File 'lib/aws-sdk-s3/client.rb', line 4670 def put_bucket_metrics_configuration(params = {}, = {}) req = build_request(:put_bucket_metrics_configuration, params) req.send_request() end |
#put_bucket_notification(params = {}) ⇒ Struct
Deprecated, see the PutBucketNotificationConfiguraiton operation.
4717 4718 4719 4720 |
# File 'lib/aws-sdk-s3/client.rb', line 4717 def put_bucket_notification(params = {}, = {}) req = build_request(:put_bucket_notification, params) req.send_request() end |
#put_bucket_notification_configuration(params = {}) ⇒ Struct
Enables notifications of specified events for a bucket.
4814 4815 4816 4817 |
# File 'lib/aws-sdk-s3/client.rb', line 4814 def put_bucket_notification_configuration(params = {}, = {}) req = build_request(:put_bucket_notification_configuration, params) req.send_request() end |
#put_bucket_policy(params = {}) ⇒ Struct
Replaces a policy on a bucket. If the bucket already has a policy, the one in this request completely replaces it.
4858 4859 4860 4861 |
# File 'lib/aws-sdk-s3/client.rb', line 4858 def put_bucket_policy(params = {}, = {}) req = build_request(:put_bucket_policy, params) req.send_request() end |
#put_bucket_replication(params = {}) ⇒ Struct
Creates a new replication configuration (or replaces an existing one, if present).
4935 4936 4937 4938 |
# File 'lib/aws-sdk-s3/client.rb', line 4935 def put_bucket_replication(params = {}, = {}) req = build_request(:put_bucket_replication, params) req.send_request() end |
#put_bucket_request_payment(params = {}) ⇒ Struct
Sets the request payment configuration for a bucket. By default, the bucket owner pays for downloads from the bucket. This configuration parameter enables the bucket owner (only) to specify that the person requesting the download will be charged for the download. Documentation on requester pays buckets can be found at docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html
4981 4982 4983 4984 |
# File 'lib/aws-sdk-s3/client.rb', line 4981 def put_bucket_request_payment(params = {}, = {}) req = build_request(:put_bucket_request_payment, params) req.send_request() end |
#put_bucket_tagging(params = {}) ⇒ Struct
Sets the tags for a bucket.
5036 5037 5038 5039 |
# File 'lib/aws-sdk-s3/client.rb', line 5036 def put_bucket_tagging(params = {}, = {}) req = build_request(:put_bucket_tagging, params) req.send_request() end |
#put_bucket_versioning(params = {}) ⇒ Struct
Sets the versioning state of an existing bucket. To set the versioning state, you must be the bucket owner.
5085 5086 5087 5088 |
# File 'lib/aws-sdk-s3/client.rb', line 5085 def put_bucket_versioning(params = {}, = {}) req = build_request(:put_bucket_versioning, params) req.send_request() end |
#put_bucket_website(params = {}) ⇒ Struct
Set the website configuration for a bucket.
5156 5157 5158 5159 |
# File 'lib/aws-sdk-s3/client.rb', line 5156 def put_bucket_website(params = {}, = {}) req = build_request(:put_bucket_website, params) req.send_request() end |
#put_object(params = {}) ⇒ Types::PutObjectOutput
Adds an object to a bucket.
5460 5461 5462 5463 |
# File 'lib/aws-sdk-s3/client.rb', line 5460 def put_object(params = {}, = {}) req = build_request(:put_object, params) req.send_request() end |
#put_object_acl(params = {}) ⇒ Types::PutObjectAclOutput
uses the acl subresource to set the access control list (ACL) permissions for an object that already exists in a bucket
5571 5572 5573 5574 |
# File 'lib/aws-sdk-s3/client.rb', line 5571 def put_object_acl(params = {}, = {}) req = build_request(:put_object_acl, params) req.send_request() end |
#put_object_tagging(params = {}) ⇒ Types::PutObjectTaggingOutput
Sets the supplied tag-set to an object that already exists in a bucket
5644 5645 5646 5647 |
# File 'lib/aws-sdk-s3/client.rb', line 5644 def put_object_tagging(params = {}, = {}) req = build_request(:put_object_tagging, params) req.send_request() end |
#restore_object(params = {}) ⇒ Types::RestoreObjectOutput
Restores an archived copy of an object back into Amazon S3
5788 5789 5790 5791 |
# File 'lib/aws-sdk-s3/client.rb', line 5788 def restore_object(params = {}, = {}) req = build_request(:restore_object, params) req.send_request() end |
#upload_part(params = {}) ⇒ Types::UploadPartOutput
Uploads a part in a multipart upload.
Note: After you initiate multipart upload and upload one or more parts, you must either complete or abort multipart upload in order to stop getting charged for storage of the uploaded parts. Only after you either complete or abort multipart upload, Amazon S3 frees up the parts storage and stops charging you for the parts storage.
5907 5908 5909 5910 |
# File 'lib/aws-sdk-s3/client.rb', line 5907 def upload_part(params = {}, = {}) req = build_request(:upload_part, params) req.send_request() end |
#upload_part_copy(params = {}) ⇒ Types::UploadPartCopyOutput
Uploads a part by copying data from an existing object as data source.
6079 6080 6081 6082 |
# File 'lib/aws-sdk-s3/client.rb', line 6079 def upload_part_copy(params = {}, = {}) req = build_request(:upload_part_copy, params) req.send_request() end |
#wait_until(waiter_name, params = {}, options = {}) {|w.waiter| ... } ⇒ Boolean
Polls an API operation until a resource enters a desired state.
## Basic Usage
A waiter will call an API operation until:
-
It is successful
-
It enters a terminal state
-
It makes the maximum number of attempts
In between attempts, the waiter will sleep.
# polls in a loop, sleeping between attempts
client.waiter_until(waiter_name, params)
## Configuration
You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You can pass configuration as the final arguments hash.
# poll for ~25 seconds
client.wait_until(waiter_name, params, {
max_attempts: 5,
delay: 5,
})
## Callbacks
You can be notified before each polling attempt and before each delay. If you throw ‘:success` or `:failure` from these callbacks, it will terminate the waiter.
started_at = Time.now
client.wait_until(waiter_name, params, {
# disable max attempts
max_attempts: nil,
# poll for 1 hour, instead of a number of attempts
before_wait: -> (attempts, response) do
throw :failure if Time.now - started_at > 3600
end
})
## Handling Errors
When a waiter is unsuccessful, it will raise an error. All of the failure errors extend from Waiters::Errors::WaiterFailed.
begin
client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
## Valid Waiters
The following table lists the valid waiter names, the operations they call, and the default ‘:delay` and `:max_attempts` values.
| waiter_name | params | :delay | :max_attempts | | —————– | ————– | ——– | ————- | | bucket_exists | #head_bucket | 5 | 20 | | bucket_not_exists | #head_bucket | 5 | 20 | | object_exists | #head_object | 5 | 20 | | object_not_exists | #head_object | 5 | 20 |
6192 6193 6194 6195 6196 |
# File 'lib/aws-sdk-s3/client.rb', line 6192 def wait_until(waiter_name, params = {}, = {}) w = waiter(waiter_name, ) yield(w.waiter) if block_given? # deprecated w.wait(params) end |
#waiter_names ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
6200 6201 6202 |
# File 'lib/aws-sdk-s3/client.rb', line 6200 def waiter_names waiters.keys end |