Class Fog::Storage::AWS::Real
In: lib/fog/storage/requests/aws/put_object_url.rb
lib/fog/storage/requests/aws/get_request_payment.rb
lib/fog/storage/requests/aws/get_object.rb
lib/fog/storage/requests/aws/get_object_acl.rb
lib/fog/storage/requests/aws/list_parts.rb
lib/fog/storage/requests/aws/initiate_multipart_upload.rb
lib/fog/storage/requests/aws/get_bucket.rb
lib/fog/storage/requests/aws/put_bucket_policy.rb
lib/fog/storage/requests/aws/put_bucket_acl.rb
lib/fog/storage/requests/aws/put_bucket_versioning.rb
lib/fog/storage/requests/aws/get_bucket_policy.rb
lib/fog/storage/requests/aws/get_object_torrent.rb
lib/fog/storage/requests/aws/copy_object.rb
lib/fog/storage/requests/aws/get_object_url.rb
lib/fog/storage/requests/aws/complete_multipart_upload.rb
lib/fog/storage/requests/aws/list_multipart_uploads.rb
lib/fog/storage/requests/aws/delete_bucket.rb
lib/fog/storage/requests/aws/get_service.rb
lib/fog/storage/requests/aws/get_bucket_acl.rb
lib/fog/storage/requests/aws/get_bucket_versioning.rb
lib/fog/storage/requests/aws/get_bucket_website.rb
lib/fog/storage/requests/aws/post_object_hidden_fields.rb
lib/fog/storage/requests/aws/put_bucket_logging.rb
lib/fog/storage/requests/aws/delete_object.rb
lib/fog/storage/requests/aws/get_bucket_logging.rb
lib/fog/storage/requests/aws/put_request_payment.rb
lib/fog/storage/requests/aws/put_object.rb
lib/fog/storage/requests/aws/put_bucket_website.rb
lib/fog/storage/requests/aws/get_bucket_location.rb
lib/fog/storage/requests/aws/delete_bucket_website.rb
lib/fog/storage/requests/aws/head_object.rb
lib/fog/storage/requests/aws/put_object_acl.rb
lib/fog/storage/requests/aws/delete_bucket_policy.rb
lib/fog/storage/requests/aws/upload_part.rb
lib/fog/storage/requests/aws/get_bucket_object_versions.rb
lib/fog/storage/requests/aws/put_bucket.rb
lib/fog/storage/requests/aws/abort_multipart_upload.rb
lib/fog/storage/requests/aws/sync_clock.rb
lib/fog/storage/aws.rb
Parent: Object

Methods

Included Modules

Utils

Public Class methods

Initialize connection to S3

Notes

options parameter must include values for :aws_access_key_id and :aws_secret_access_key in order to create a connection

Examples

  s3 = S3.new(
    :aws_access_key_id => your_aws_access_key_id,
    :aws_secret_access_key => your_aws_secret_access_key
  )

Parameters

  • options<~Hash> - config arguments for connection. Defaults to {}.

Returns

  • S3 object with connection to aws.

Public Instance methods

Abort a multipart upload

Parameters

  • bucket_name<~String> - Name of bucket to abort multipart upload on
  • object_name<~String> - Name of object to abort multipart upload on
  • upload_id<~String> - Id of upload to add part to

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadAbort.html

Complete a multipart upload

Parameters

  • bucket_name<~String> - Name of bucket to complete multipart upload for
  • object_name<~String> - Name of object to complete multipart upload for
  • upload_id<~String> - Id of upload to add part to
  • parts<~Array>: Array of etags for parts
    • :etag<~String> - Etag for this part

Returns

  • response<~Excon::Response>:
    • headers<~Hash>:
      • ‘Bucket’<~String> - bucket of new object
      • ‘ETag’<~String> - etag of new object (will be needed to complete upload)
      • ‘Key’<~String> - key of new object
      • ‘Location’<~String> - location of new object

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadComplete.html

Copy an object from one S3 bucket to another

Parameters

  • source_bucket_name<~String> - Name of source bucket
  • source_object_name<~String> - Name of source object
  • target_bucket_name<~String> - Name of bucket to create copy in
  • target_object_name<~String> - Name for new copy of object
  • options<~Hash>:
    • ‘x-amz-metadata-directive’<~String> - Specifies whether to copy metadata from source or replace with data in request. Must be in [‘COPY’, ‘REPLACE’]
    • ‘x-amz-copy_source-if-match’<~String> - Copies object if its etag matches this value
    • ‘x-amz-copy_source-if-modified_since’<~Time> - Copies object it it has been modified since this time
    • ‘x-amz-copy_source-if-none-match’<~String> - Copies object if its etag does not match this value
    • ‘x-amz-copy_source-if-unmodified-since’<~Time> - Copies object it it has not been modified since this time
    • ‘x-amz-storage-class’<~String> - Default is ‘STANDARD’, set to ‘REDUCED_REDUNDANCY’ for non-critical, reproducable data

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘ETag’<~String> - etag of new object
      • ‘LastModified’<~Time> - date object was last modified

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectCOPY.html

Delete an S3 bucket

Parameters

  • bucket_name<~String> - name of bucket to delete

Returns

  • response<~Excon::Response>:
    • status<~Integer> - 204

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketDELETE.html

Delete policy for a bucket

Parameters

  • bucket_name<~String> - name of bucket to delete policy from

Returns

  • response<~Excon::Response>:
    • status<~Integer> - 204

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketDELETEpolicy.html

Delete website configuration for a bucket

Parameters

  • bucket_name<~String> - name of bucket to delete website configuration from

Returns

  • response<~Excon::Response>:
    • status<~Integer> - 204

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketDELETEwebsite.html

Delete an object from S3

Parameters

  • bucket_name<~String> - Name of bucket containing object to delete
  • object_name<~String> - Name of object to delete

Returns

  • response<~Excon::Response>:
    • status<~Integer> - 204

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectDELETE.html

List information about objects in an S3 bucket

Parameters

  • bucket_name<~String> - name of bucket to list object keys from
  • options<~Hash> - config arguments for list. Defaults to {}.
    • ‘delimiter’<~String> - causes keys with the same string between the prefix value and the first occurence of delimiter to be rolled up
    • ‘marker’<~String> - limits object keys to only those that appear lexicographically after its value.
    • ‘max-keys’<~Integer> - limits number of object keys returned
    • ‘prefix’<~String> - limits object keys to those beginning with its value.

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘Delimeter’<~String> - Delimiter specified for query
      • ‘IsTruncated’<~Boolean> - Whether or not the listing is truncated
      • ‘Marker’<~String> - Marker specified for query
      • ‘MaxKeys’<~Integer> - Maximum number of keys specified for query
      • ‘Name’<~String> - Name of the bucket
      • ‘Prefix’<~String> - Prefix specified for query
      • ‘CommonPrefixes’<~Array> - Array of strings for common prefixes
      • ‘Contents’<~Array>:
        • ‘ETag’<~String>: Etag of object
        • ‘Key’<~String>: Name of object
        • ‘LastModified’<~String>: Timestamp of last modification of object
        • ‘Owner’<~Hash>:
          • ‘DisplayName’<~String> - Display name of object owner
          • ‘ID’<~String> - Id of object owner
        • ‘Size’<~Integer> - Size of object
        • ‘StorageClass’<~String> - Storage class of object

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGET.html

Get access control list for an S3 bucket

Parameters

  • bucket_name<~String> - name of bucket to get access control list for

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘AccessControlPolicy’<~Hash>
        • ‘Owner’<~Hash>:
          • ‘DisplayName’<~String> - Display name of object owner
          • ‘ID’<~String> - Id of object owner
        • ‘AccessControlList’<~Array>:
          • ‘Grant’<~Hash>:
            • ‘Grantee’<~Hash>:
               * 'DisplayName'<~String> - Display name of grantee
               * 'ID'<~String> - Id of grantee
              

              or

               * 'URI'<~String> - URI of group to grant access for
              
            • ‘Permission’<~String> - Permission, in [FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP]

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETacl.html

Get location constraint for an S3 bucket

Parameters

  • bucket_name<~String> - name of bucket to get location constraint for

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘LocationConstraint’<~String> - Location constraint of the bucket

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETlocation.html

Get logging status for an S3 bucket

Parameters

  • bucket_name<~String> - name of bucket to get logging status for

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘BucketLoggingStatus’<~Hash>: (will be empty if logging is disabled)
        • ‘LoggingEnabled’<~Hash>:
          • ‘TargetBucket’<~String> - bucket where logs are stored
          • ‘TargetPrefix’<~String> - prefix logs are stored with
          • ‘TargetGrants’<~Array>:
            • ‘Grant’<~Hash>:
              • ‘Grantee’<~Hash>:
                  * 'DisplayName'<~String> - Display name of grantee
                  * 'ID'<~String> - Id of grantee
                

                or

                  * 'URI'<~String> - URI of group to grant access for
                
              • ‘Permission’<~String> - Permission, in [FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP]

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETlogging.html

List information about object versions in an S3 bucket

Parameters

  • bucket_name<~String> - name of bucket to list object keys from
  • options<~Hash> - config arguments for list. Defaults to {}.
    • ‘delimiter’<~String> - causes keys with the same string between the prefix value and the first occurence of delimiter to be rolled up
    • ‘key-marker’<~String> - limits object keys to only those that appear lexicographically after its value.
    • ‘max-keys’<~Integer> - limits number of object keys returned
    • ‘prefix’<~String> - limits object keys to those beginning with its value.
    • ‘version-id-marker’<~String> - limits object versions to only those that appear lexicographically after its value

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘Delimeter’<~String> - Delimiter specified for query
      • ‘KeyMarker’<~String> - Key marker specified for query
      • ‘MaxKeys’<~Integer> - Maximum number of keys specified for query
      • ‘Name’<~String> - Name of the bucket
      • ‘Prefix’<~String> - Prefix specified for query
      • ‘VersionIdMarker’<~String> - Version id marker specified for query
      • ‘IsTruncated’<~Boolean> - Whether or not this is the totality of the bucket
      • ‘Versions’<~Array>:
          * 'DeleteMarker'<~Hash>:
            * 'IsLatest'<~Boolean> - Whether or not this is the latest version
            * 'Key'<~String> - Name of object
            * 'LastModified'<~String>: Timestamp of last modification of object
            * 'Owner'<~Hash>:
              * 'DisplayName'<~String> - Display name of object owner
              * 'ID'<~String> - Id of object owner
            * 'VersionId'<~String> - The id of this version
        

        or

          * 'Version'<~Hash>:
            * 'ETag'<~String>: Etag of object
            * 'IsLatest'<~Boolean> - Whether or not this is the latest version
            * 'Key'<~String> - Name of object
            * 'LastModified'<~String>: Timestamp of last modification of object
            * 'Owner'<~Hash>:
              * 'DisplayName'<~String> - Display name of object owner
              * 'ID'<~String> - Id of object owner
            * 'Size'<~Integer> - Size of object
            * 'StorageClass'<~String> - Storage class of object
            * 'VersionId'<~String> - The id of this version
        

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETVersion.html

Get bucket policy for an S3 bucket

Parameters

  • bucket_name<~String> - name of bucket to get policy for

Returns

  • response<~Excon::Response>:
    • body<~Hash> - policy document

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETpolicy.html

Get versioning status for an S3 bucket

Parameters

  • bucket_name<~String> - name of bucket to get versioning status for

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘VersioningConfiguration’<~Hash>
          * Status<~String>: Versioning status in ['Enabled', 'Suspended', nil]
        

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETversioningStatus.html

Get website configuration for an S3 bucket

Parameters

  • bucket_name<~String> - name of bucket to get website configuration for

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • IndexDocument<~Hash>
        • Suffix<~String> - Suffix appended when directory is requested
      • ErrorDocument<~Hash>
        • Key<~String> - Object key to return for 4XX class errors

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETwebsite.html

Get an object from S3

Parameters

  • bucket_name<~String> - Name of bucket to read from
  • object_name<~String> - Name of object to read
  • options<~Hash>:
    • ‘If-Match’<~String> - Returns object only if its etag matches this value, otherwise returns 412 (Precondition Failed).
    • ‘If-Modified-Since’<~Time> - Returns object only if it has been modified since this time, otherwise returns 304 (Not Modified).
    • ‘If-None-Match’<~String> - Returns object only if its etag differs from this value, otherwise returns 304 (Not Modified)
    • ‘If-Unmodified-Since’<~Time> - Returns object only if it has not been modified since this time, otherwise returns 412 (Precodition Failed).
    • ‘Range’<~String> - Range of object to download
    • ‘versionId’<~String> - specify a particular version to retrieve

Returns

  • response<~Excon::Response>:
    • body<~String> - Contents of object
    • headers<~Hash>:
      • ‘Content-Length’<~String> - Size of object contents
      • ‘Content-Type’<~String> - MIME type of object
      • ‘ETag’<~String> - Etag of object
      • ‘Last-Modified’<~String> - Last modified timestamp for object

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectGET.html

Get access control list for an S3 object

Parameters

  • bucket_name<~String> - name of bucket containing object
  • object_name<~String> - name of object to get access control list for
  • options<~Hash>:
    • ‘versionId’<~String> - specify a particular version to retrieve

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘AccessControlPolicy’<~Hash>
        • ‘Owner’<~Hash>:
          • ‘DisplayName’<~String> - Display name of object owner
          • ‘ID’<~String> - Id of object owner
        • ‘AccessControlList’<~Array>:
          • ‘Grant’<~Hash>:
            • ‘Grantee’<~Hash>:
               * 'DisplayName'<~String> - Display name of grantee
               * 'ID'<~String> - Id of grantee
              

              or

               * 'URI'<~String> - URI of group to grant access for
              
            • ‘Permission’<~String> - Permission, in [FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP]

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectGETacl.html

Get torrent for an S3 object

Parameters

  • bucket_name<~String> - name of bucket containing object
  • object_name<~String> - name of object to get torrent for

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘AccessControlPolicy’<~Hash>
        • ‘Owner’<~Hash>:
          • ‘DisplayName’<~String> - Display name of object owner
          • ‘ID’<~String> - Id of object owner
        • ‘AccessControlList’<~Array>:
          • ‘Grant’<~Hash>:
            • ‘Grantee’<~Hash>:
              • ‘DisplayName’<~String> - Display name of grantee
              • ‘ID’<~String> - Id of grantee
            • ‘Permission’<~String> - Permission, in [FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP]

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectGETtorrent.html

Get an expiring object url from S3

Parameters

  • bucket_name<~String> - Name of bucket containing object
  • object_name<~String> - Name of object to get expiring url for
  • expires<~Time> - An expiry time for this url

Returns

  • response<~Excon::Response>:
    • body<~String> - url for object

See Also

docs.amazonwebservices.com/AmazonS3/latest/dev/S3_QSAuth.html

Get configured payer for an S3 bucket

Parameters

  • bucket_name<~String> - name of bucket to get payer for

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘Payer’<~String> - Specifies who pays for download and requests

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTrequestPaymentGET.html

List information about S3 buckets for authorized user

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘Buckets’<~Hash>:
        • ‘Name’<~String> - Name of bucket
        • ‘CreationTime’<~Time> - Timestamp of bucket creation
      • ‘Owner’<~Hash>:
        • ‘DisplayName’<~String> - Display name of bucket owner
        • ‘ID’<~String> - Id of bucket owner

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTServiceGET.html

Get headers for an object from S3

Parameters

  • bucket_name<~String> - Name of bucket to read from
  • object_name<~String> - Name of object to read
  • options<~Hash>:
    • ‘If-Match’<~String> - Returns object only if its etag matches this value, otherwise returns 412 (Precondition Failed).
    • ‘If-Modified-Since’<~Time> - Returns object only if it has been modified since this time, otherwise returns 304 (Not Modified).
    • ‘If-None-Match’<~String> - Returns object only if its etag differs from this value, otherwise returns 304 (Not Modified)
    • ‘If-Unmodified-Since’<~Time> - Returns object only if it has not been modified since this time, otherwise returns 412 (Precodition Failed).
    • ‘Range’<~String> - Range of object to download
    • ‘versionId’<~String> - specify a particular version to retrieve

Returns

  • response<~Excon::Response>:
    • body<~String> - Contents of object
    • headers<~Hash>:
      • ‘Content-Length’<~String> - Size of object contents
      • ‘Content-Type’<~String> - MIME type of object
      • ‘ETag’<~String> - Etag of object
      • ‘Last-Modified’<~String> - Last modified timestamp for object

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectHEAD.html

Initiate a multipart upload to an S3 bucket

Parameters

  • bucket_name<~String> - Name of bucket to create object in
  • object_name<~String> - Name of object to create
  • options<~Hash>:
    • ‘Cache-Control’<~String> - Caching behaviour
    • ‘Content-Disposition’<~String> - Presentational information for the object
    • ‘Content-Encoding’<~String> - Encoding of object data
    • ‘Content-MD5’<~String> - Base64 encoded 128-bit MD5 digest of message (defaults to Base64 encoded MD5 of object.read)
    • ‘Content-Type’<~String> - Standard MIME type describing contents (defaults to MIME::Types.of.first)
    • ‘x-amz-acl’<~String> - Permissions, must be in [‘private’, ‘public-read’, ‘public-read-write’, ‘authenticated-read’]
    • "x-amz-meta-#{name}" - Headers to be returned with object, note total size of request without body must be less than 8 KB.

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘Bucket’<~String> - Bucket where upload was initiated
      • ‘Key’<~String> - Object key where the upload was initiated
      • ‘UploadId’<~String> - Id for initiated multipart upload

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadInitiate.html

List multipart uploads for a bucket

Parameters

  • bucket_name<~String> - Name of bucket to list multipart uploads for
  • upload_id<~String> - upload id to list objects for
  • options<~Hash> - config arguments for list. Defaults to {}.
    • ‘key-marker’<~String> - limits parts to only those that appear lexicographically after this key.
    • ‘max-uploads’<~Integer> - limits number of uploads returned
    • ‘upload-id-marker’<~String> - limits uploads to only those that appear lexicographically after this upload id.

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘Bucket’<~string> - Bucket where the multipart upload was initiated
      • ‘IsTruncated’<~Boolean> - Whether or not the listing is truncated
      • ‘KeyMarker’<~String> - first key in list, only upload ids after this lexographically will appear
      • ‘MaxUploads’<~Integer> - Maximum results to return
      • ‘NextKeyMarker’<~String> - last key in list, for further pagination
      • ‘NextUploadIdMarker’<~String> - last key in list, for further pagination
      • ‘Upload’<~Hash>:
        • ‘Initiated’<~Time> - Time when upload was initiated
        • ‘Initiator’<~Hash>:
          • ‘DisplayName’<~String> - Display name of upload initiator
          • ‘ID’<~String> - Id of upload initiator
        • ‘Key’<~String> - Key where multipart upload was initiated
        • ‘Owner’<~Hash>:
          • ‘DisplayName’<~String> - Display name of upload owner
          • ‘ID’<~String> - Id of upload owner
        • ‘StorageClass’<~String> - Storage class of object
        • ‘UploadId’<~String> - upload id of upload containing part
      • ‘UploadIdMarker’<String> - first key in list, only upload ids after this lexographically will appear

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadListMPUpload.html

List parts for a multipart upload

Parameters

  • bucket_name<~String> - Name of bucket to list parts for
  • object_name<~String> - Name of object to list parts for
  • upload_id<~String> - upload id to list objects for
  • options<~Hash> - config arguments for list. Defaults to {}.
    • ‘max-parts’<~Integer> - limits number of parts returned
    • ‘part-number-marker’<~String> - limits parts to only those that appear lexicographically after this part number.

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘Bucket’<~string> - Bucket where the multipart upload was initiated
      • ‘Initiator’<~Hash>:
        • ‘DisplayName’<~String> - Display name of upload initiator
        • ‘ID’<~String> - Id of upload initiator
      • ‘IsTruncated’<~Boolean> - Whether or not the listing is truncated
      • ‘Key’<~String> - Key where multipart upload was initiated
      • ‘MaxParts’<~String> - maximum number of replies alllowed in response
      • ‘NextPartNumberMarker’<~String> - last item in list, for further pagination
      • ‘Part’<~Array>:
        • ‘ETag’<~String> - ETag of part
        • ‘LastModified’<~Timestamp> - Last modified for part
        • ‘PartNumber’<~String> - Part number for part
        • ‘Size’<~Integer> - Size of part
      • ‘PartNumberMarker’<~String> - Part number after which listing begins
      • ‘StorageClass’<~String> - Storage class of object
      • ‘UploadId’<~String> - upload id of upload containing part

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadListParts.html

Get a hash of hidden fields for form uploading to S3, in the form {:field_name => :field_value} Form should look like: <form action="#{bucket_name}.s3.amazonaws.com/" method="post" enctype="multipart/form-data"> These hidden fields should then appear, followed by a field named ‘file’ which is either a textarea or file input.

Parameters

  • options<~Hash>:
    • acl<~String> - access control list, in [‘private’, ‘public-read’, ‘public-read-write’, ‘authenticated-read’, ‘bucket-owner-read’, ‘bucket-owner-full-control’]
    • Cache-Control - same as REST header
    • Content-Type - same as REST header
    • Content-Disposition - same as REST header
    • Content-Encoding - same as REST header
    • Expires - same as REST header
    • key - key for object, set to ’${filename}’ to use filename provided by user
    • policy - security policy for upload
    • success_action_redirect - url to redirct to upon success
    • success_action_status - status code to return on success, in [200, 201, 204]
    • x-amz-security-token - devpay security token
    • x-amz-meta-… - meta data tags

See Also

docs.amazonwebservices.com/AmazonS3/latest/dev/HTTPPOSTForms.html

Create an S3 bucket

Parameters

  • bucket_name<~String> - name of bucket to create
  • options<~Hash> - config arguments for bucket. Defaults to {}.
    • ‘LocationConstraint’<~Symbol> - sets the location for the bucket
    • ‘x-amz-acl’<~String> - Permissions, must be in [‘private’, ‘public-read’, ‘public-read-write’, ‘authenticated-read’]

Returns

  • response<~Excon::Response>:
    • status<~Integer> - 200

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUT.html

Change access control list for an S3 bucket

Parameters

  • bucket_name<~String> - name of bucket to modify
  • acl<~Hash>:
    • Owner<~Hash>:
      • ID<~String>: id of owner
      • DisplayName<~String>: display name of owner
    • AccessControlList<~Array>:
      • Grantee<~Hash>:
          * 'DisplayName'<~String> - Display name of grantee
          * 'ID'<~String> - Id of grantee
        

        or

          * 'EmailAddress'<~String> - Email address of grantee
        

        or

          * 'URI'<~String> - URI of group to grant access for
        
      • Permission<~String> - Permission, in [FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP]

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTacl.html

Change logging status for an S3 bucket

Parameters

  • bucket_name<~String> - name of bucket to modify
  • logging_status<~Hash>:
    • Owner<~Hash>:
      • ID<~String>: id of owner
      • DisplayName<~String>: display name of owner
    • AccessControlList<~Array>:
      • Grantee<~Hash>:
          * 'DisplayName'<~String> - Display name of grantee
          * 'ID'<~String> - Id of grantee
        

        or

          * 'EmailAddress'<~String> - Email address of grantee
        

        or

          * 'URI'<~String> - URI of group to grant access for
        
      • Permission<~String> - Permission, in [FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP]

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTlogging.html

Change bucket policy for an S3 bucket

Parameters

  • bucket_name<~String> - name of bucket to modify
  • policy<~Hash> - policy document

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTpolicy.html

Change versioning status for an S3 bucket

Parameters

  • bucket_name<~String> - name of bucket to modify
  • status<~String> - Status to change to in [‘Enabled’, ‘Suspended’]

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTVersioningStatus.html

Change website configuration for an S3 bucket

Parameters

  • bucket_name<~String> - name of bucket to modify
  • suffix<~String> - suffix to append to requests for the bucket
  • options<~Hash>
    • key<~String> - key to use for 4XX class errors

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTwebsite.html

Create an object in an S3 bucket

Parameters

  • bucket_name<~String> - Name of bucket to create object in
  • object_name<~String> - Name of object to create
  • data<~File||String> - File or String to create object from
  • options<~Hash>:
    • ‘Cache-Control’<~String> - Caching behaviour
    • ‘Content-Disposition’<~String> - Presentational information for the object
    • ‘Content-Encoding’<~String> - Encoding of object data
    • ‘Content-Length’<~String> - Size of object in bytes (defaults to object.read.length)
    • ‘Content-MD5’<~String> - Base64 encoded 128-bit MD5 digest of message
    • ‘Content-Type’<~String> - Standard MIME type describing contents (defaults to MIME::Types.of.first)
    • ‘Expires’<~String> - Cache expiry
    • ‘x-amz-acl’<~String> - Permissions, must be in [‘private’, ‘public-read’, ‘public-read-write’, ‘authenticated-read’]
    • ‘x-amz-storage-class’<~String> - Default is ‘STANDARD’, set to ‘REDUCED_REDUNDANCY’ for non-critical, reproducable data
    • "x-amz-meta-#{name}" - Headers to be returned with object, note total size of request without body must be less than 8 KB.

Returns

  • response<~Excon::Response>:
    • headers<~Hash>:
      • ‘ETag’<~String> - etag of new object

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectPUT.html

Change access control list for an S3 object

Parameters

  • bucket_name<~String> - name of bucket to modify
  • object_name<~String> - name of object to get access control list for
  • acl<~Hash>:
    • Owner<~Hash>:
      • ID<~String>: id of owner
      • DisplayName<~String>: display name of owner
    • AccessControlList<~Array>:
      • Grantee<~Hash>:
          * 'DisplayName'<~String> - Display name of grantee
          * 'ID'<~String> - Id of grantee
        

        or

          * 'EmailAddress'<~String> - Email address of grantee
        

        or

          * 'URI'<~String> - URI of group to grant access for
        
      • Permission<~String> - Permission, in [FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP]
  • options<~Hash>:
    • ‘versionId’<~String> - specify a particular version to retrieve

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectPUTacl.html

Get an expiring object url from S3 for putting an object

Parameters

  • bucket_name<~String> - Name of bucket containing object
  • object_name<~String> - Name of object to get expiring url for
  • expires<~Time> - An expiry time for this url

Returns

  • response<~Excon::Response>:
    • body<~String> - url for object

See Also

docs.amazonwebservices.com/AmazonS3/latest/dev/S3_QSAuth.html

Change who pays for requests to an S3 bucket

Parameters

  • bucket_name<~String> - name of bucket to modify
  • payer<~String> - valid values are BucketOwner or Requester

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/RESTrequestPaymentPUT.html

Sync clock against S3 to avoid skew errors

Upload a part for a multipart upload

Parameters

  • bucket_name<~String> - Name of bucket to add part to
  • object_name<~String> - Name of object to add part to
  • upload_id<~String> - Id of upload to add part to
  • part_number<~String> - Index of part in upload
  • data<~File||String> - Content for part
  • options<~Hash>:
    • ‘Content-MD5’<~String> - Base64 encoded 128-bit MD5 digest of message

Returns

  • response<~Excon::Response>:
    • headers<~Hash>:
      • ‘ETag’<~String> - etag of new object (will be needed to complete upload)

See Also

docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadUploadPart.html

[Validate]