2014/11/06 - Amazon Simple Storage Service - 5 updated api methods
{'CreateBucketConfiguration': {'LocationConstraint': {'cn-north-1'}}}
Creates a new bucket.
Request Syntax
client.create_bucket( ACL='private'|'public-read'|'public-read-write'|'authenticated-read', Bucket='string', CreateBucketConfiguration={ 'LocationConstraint': 'EU'|'eu-west-1'|'us-west-1'|'us-west-2'|'ap-southeast-1'|'ap-southeast-2'|'ap-northeast-1'|'sa-east-1'|''|'cn-north-1' }, GrantFullControl='string', GrantRead='string', GrantReadACP='string', GrantWrite='string', GrantWriteACP='string' )
string
The canned ACL to apply to the bucket.
string
[REQUIRED]
dict
LocationConstraint (string) -- Specifies the region where the bucket will be created.
string
Allows grantee the read, write, read ACP, and write ACP permissions on the bucket.
string
Allows grantee to list the objects in the bucket.
string
Allows grantee to read the bucket ACL.
string
Allows grantee to create, overwrite, and delete any object in the bucket.
string
Allows grantee to write the ACL for the applicable bucket.
dict
Response Syntax
{ 'Location': 'string' }
Response Structure
(dict) --
Location (string) --
{'LocationConstraint': {'cn-north-1'}}
Returns the region the bucket resides in.
Request Syntax
client.get_bucket_location( Bucket='string' )
string
[REQUIRED]
dict
Response Syntax
{ 'LocationConstraint': 'EU'|'eu-west-1'|'us-west-1'|'us-west-2'|'ap-southeast-1'|'ap-southeast-2'|'ap-northeast-1'|'sa-east-1'|''|'cn-north-1' }
Response Structure
(dict) --
LocationConstraint (string) --
{'Delimiter': 'string'}
This operation lists in-progress multipart uploads.
Request Syntax
client.list_multipart_uploads( Bucket='string', Delimiter='string', EncodingType='url', KeyMarker='string', MaxUploads=123, Prefix='string', UploadIdMarker='string' )
string
[REQUIRED]
string
Character you use to group keys.
string
Requests Amazon S3 to encode the object keys in the response and specifies the encoding method to use. An object key may contain any Unicode character; however, XML 1.0 parser cannot parse some characters, such as characters with an ASCII value from 0 to 10. For characters that are not supported in XML 1.0, you can add this parameter to request that Amazon S3 encode the keys in the response.
string
Together with upload-id-marker, this parameter specifies the multipart upload after which listing should begin.
integer
Sets the maximum number of multipart uploads, from 1 to 1,000, to return in the response body. 1,000 is the maximum number of uploads that can be returned in a response.
string
Lists in-progress uploads only for those keys that begin with the specified prefix.
string
Together with key-marker, specifies the multipart upload after which listing should begin. If key-marker is not specified, the upload-id-marker parameter is ignored.
dict
Response Syntax
{ 'Bucket': 'string', 'KeyMarker': 'string', 'UploadIdMarker': 'string', 'NextKeyMarker': 'string', 'Prefix': 'string', 'Delimiter': 'string', 'NextUploadIdMarker': 'string', 'MaxUploads': 123, 'IsTruncated': True|False, 'Uploads': [ { 'UploadId': 'string', 'Key': 'string', 'Initiated': datetime(2015, 1, 1), 'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY', 'Owner': { 'DisplayName': 'string', 'ID': 'string' }, 'Initiator': { 'ID': 'string', 'DisplayName': 'string' } }, ], 'CommonPrefixes': [ { 'Prefix': 'string' }, ], 'EncodingType': 'url' }
Response Structure
(dict) --
Bucket (string) -- Name of the bucket to which the multipart upload was initiated.
KeyMarker (string) -- The key at or after which the listing began.
UploadIdMarker (string) -- Upload ID after which listing began.
NextKeyMarker (string) -- When a list is truncated, this element specifies the value that should be used for the key-marker request parameter in a subsequent request.
Prefix (string) -- When a prefix is provided in the request, this field contains the specified prefix. The result contains only keys starting with the specified prefix.
Delimiter (string) --
NextUploadIdMarker (string) -- When a list is truncated, this element specifies the value that should be used for the upload-id-marker request parameter in a subsequent request.
MaxUploads (integer) -- Maximum number of multipart uploads that could have been included in the response.
IsTruncated (boolean) -- Indicates whether the returned list of multipart uploads is truncated. A value of true indicates that the list was truncated. The list can be truncated if the number of multipart uploads exceeds the limit allowed or specified by max uploads.
Uploads (list) --
(dict) --
UploadId (string) -- Upload ID that identifies the multipart upload.
Key (string) -- Key of the object for which the multipart upload was initiated.
Initiated (datetime) -- Date and time at which the multipart upload was initiated.
StorageClass (string) -- The class of storage used to store the object.
Owner (dict) --
DisplayName (string) --
ID (string) --
Initiator (dict) -- Identifies who initiated the multipart upload.
ID (string) -- If the principal is an AWS account, it provides the Canonical User ID. If the principal is an IAM User, it provides a user ARN value.
DisplayName (string) -- Name of the Principal.
CommonPrefixes (list) --
(dict) --
Prefix (string) --
EncodingType (string) -- Encoding type used by Amazon S3 to encode object keys in the response.
{'Delimiter': 'string'}
Returns metadata about all of the versions of objects in a bucket.
Request Syntax
client.list_object_versions( Bucket='string', Delimiter='string', EncodingType='url', KeyMarker='string', MaxKeys=123, Prefix='string', VersionIdMarker='string' )
string
[REQUIRED]
string
A delimiter is a character you use to group keys.
string
Requests Amazon S3 to encode the object keys in the response and specifies the encoding method to use. An object key may contain any Unicode character; however, XML 1.0 parser cannot parse some characters, such as characters with an ASCII value from 0 to 10. For characters that are not supported in XML 1.0, you can add this parameter to request that Amazon S3 encode the keys in the response.
string
Specifies the key to start with when listing objects in a bucket.
integer
Sets the maximum number of keys returned in the response. The response might contain fewer keys but will never contain more.
string
Limits the response to keys that begin with the specified prefix.
string
Specifies the object version you want to start listing from.
dict
Response Syntax
{ 'IsTruncated': True|False, 'KeyMarker': 'string', 'VersionIdMarker': 'string', 'NextKeyMarker': 'string', 'NextVersionIdMarker': 'string', 'Versions': [ { 'ETag': 'string', 'Size': 123, 'StorageClass': 'STANDARD', 'Key': 'string', 'VersionId': 'string', 'IsLatest': True|False, 'LastModified': datetime(2015, 1, 1), 'Owner': { 'DisplayName': 'string', 'ID': 'string' } }, ], 'DeleteMarkers': [ { 'Owner': { 'DisplayName': 'string', 'ID': 'string' }, 'Key': 'string', 'VersionId': 'string', 'IsLatest': True|False, 'LastModified': datetime(2015, 1, 1) }, ], 'Name': 'string', 'Prefix': 'string', 'Delimiter': 'string', 'MaxKeys': 123, 'CommonPrefixes': [ { 'Prefix': 'string' }, ], 'EncodingType': 'url' }
Response Structure
(dict) --
IsTruncated (boolean) -- A flag that indicates whether or not Amazon S3 returned all of the results that satisfied the search criteria. If your results were truncated, you can make a follow-up paginated request using the NextKeyMarker and NextVersionIdMarker response parameters as a starting place in another request to return the rest of the results.
KeyMarker (string) -- Marks the last Key returned in a truncated response.
VersionIdMarker (string) --
NextKeyMarker (string) -- Use this value for the key marker request parameter in a subsequent request.
NextVersionIdMarker (string) -- Use this value for the next version id marker parameter in a subsequent request.
Versions (list) --
(dict) --
ETag (string) --
Size (integer) -- Size in bytes of the object.
StorageClass (string) -- The class of storage used to store the object.
Key (string) -- The object key.
VersionId (string) -- Version ID of an object.
IsLatest (boolean) -- Specifies whether the object is (true) or is not (false) the latest version of an object.
LastModified (datetime) -- Date and time the object was last modified.
Owner (dict) --
DisplayName (string) --
ID (string) --
DeleteMarkers (list) --
(dict) --
Owner (dict) --
DisplayName (string) --
ID (string) --
Key (string) -- The object key.
VersionId (string) -- Version ID of an object.
IsLatest (boolean) -- Specifies whether the object is (true) or is not (false) the latest version of an object.
LastModified (datetime) -- Date and time the object was last modified.
Name (string) --
Prefix (string) --
Delimiter (string) --
MaxKeys (integer) --
CommonPrefixes (list) --
(dict) --
Prefix (string) --
EncodingType (string) -- Encoding type used by Amazon S3 to encode object keys in the response.
{'Delimiter': 'string'}
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.
Request Syntax
client.list_objects( Bucket='string', Delimiter='string', EncodingType='url', Marker='string', MaxKeys=123, Prefix='string' )
string
[REQUIRED]
string
A delimiter is a character you use to group keys.
string
Requests Amazon S3 to encode the object keys in the response and specifies the encoding method to use. An object key may contain any Unicode character; however, XML 1.0 parser cannot parse some characters, such as characters with an ASCII value from 0 to 10. For characters that are not supported in XML 1.0, you can add this parameter to request that Amazon S3 encode the keys in the response.
string
Specifies the key to start with when listing objects in a bucket.
integer
Sets the maximum number of keys returned in the response. The response might contain fewer keys but will never contain more.
string
Limits the response to keys that begin with the specified prefix.
dict
Response Syntax
{ 'IsTruncated': True|False, 'Marker': 'string', 'NextMarker': 'string', 'Contents': [ { 'Key': 'string', 'LastModified': datetime(2015, 1, 1), 'ETag': 'string', 'Size': 123, 'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'GLACIER', 'Owner': { 'DisplayName': 'string', 'ID': 'string' } }, ], 'Name': 'string', 'Prefix': 'string', 'Delimiter': 'string', 'MaxKeys': 123, 'CommonPrefixes': [ { 'Prefix': 'string' }, ], 'EncodingType': 'url' }
Response Structure
(dict) --
IsTruncated (boolean) -- A flag that indicates whether or not Amazon S3 returned all of the results that satisfied the search criteria.
Marker (string) --
NextMarker (string) -- When response is truncated (the IsTruncated element value in the response is true), you can use the key name in this field as marker in the subsequent request to get next set of objects. Amazon S3 lists objects in alphabetical order Note: This element is returned only if you have delimiter request parameter specified. If response does not include the NextMaker and it is truncated, you can use the value of the last Key in the response as the marker in the subsequent request to get the next set of object keys.
Contents (list) --
(dict) --
Key (string) --
LastModified (datetime) --
ETag (string) --
Size (integer) --
StorageClass (string) -- The class of storage used to store the object.
Owner (dict) --
DisplayName (string) --
ID (string) --
Name (string) --
Prefix (string) --
Delimiter (string) --
MaxKeys (integer) --
CommonPrefixes (list) --
(dict) --
Prefix (string) --
EncodingType (string) -- Encoding type used by Amazon S3 to encode object keys in the response.