libcloud.storage.drivers.s3 module
- class libcloud.storage.drivers.s3.BaseS3Connection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, backoff=None, retry_delay=None)[source]
Bases:
ConnectionUserAndKey
Represents a single connection to the S3 Endpoint
Initialize user_id and key; set secure to an
int
based on passed value.- add_default_params(params)[source]
Adds default parameters (such as API key, version, etc.) to the passed params
Should return a dictionary.
- static get_auth_signature(method, headers, params, expires, secret_key, path, vendor_prefix)[source]
- Signature = URL-Encode( Base64( HMAC-SHA1( YourSecretAccessKeyID,
UTF-8-Encoding-Of( StringToSign ) ) ) );
StringToSign = HTTP-VERB + “
- “ +
Content-MD5 + “
- “ +
Content-Type + “
- “ +
Expires + “
- “ +
CanonicalizedVendorHeaders + CanonicalizedResource;
- pre_connect_hook(params, headers)[source]
A hook which is called before connecting to the remote server. This hook can perform a final manipulation on the params, headers and url parameters.
- Parameters:
params (
dict
) – Request parameters.headers (
dict
) – Request headers.
- rawResponseCls
alias of
S3RawResponse
- responseCls
alias of
S3Response
- class libcloud.storage.drivers.s3.BaseS3StorageDriver(key, secret=None, secure=True, host=None, port=None, api_version=None, region=None, **kwargs)[source]
Bases:
StorageDriver
- Parameters:
key (
str
) – API key or username to be used (required)secret (
str
) – Secret password to be used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.host (
str
) – Override hostname used for connections.port (
int
) – Override port used for connections.api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions.region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
- Return type:
None
- connectionCls
alias of
BaseS3Connection
- create_container(container_name)[source]
Create a new container.
- Parameters:
container_name (
str
) – Container name.- Returns:
Container instance on success.
- Return type:
- delete_container(container)[source]
Delete a container.
- Parameters:
container (
libcloud.storage.base.Container
) – Container instance- Returns:
True
on success,False
otherwise.- Return type:
bool
- delete_object(obj)[source]
Delete an object.
- Parameters:
obj (
libcloud.storage.base.Object
) – Object instance.- Returns:
bool
True on success.- Return type:
bool
- download_object(obj, destination_path, overwrite_existing=False, delete_on_failure=True)[source]
Download an object to the specified destination path.
- Parameters:
obj (
libcloud.storage.base.Object
) – Object instance.destination_path (
str
) – Full path to a file or a directory where the incoming file will be saved.overwrite_existing (
bool
) – True to overwrite an existing file, defaults to False.delete_on_failure (
bool
) – True to delete a partially downloaded file if the download was not successful (hash mismatch / file size).
- Returns:
True if an object has been successfully downloaded, False otherwise.
- Return type:
bool
- download_object_as_stream(obj, chunk_size=None)[source]
Return a iterator which yields object data.
- Parameters:
obj (
libcloud.storage.base.Object
) – Object instancechunk_size (
int
) – Optional chunk size (in bytes).
- Return type:
iterator
ofbytes
- download_object_range(obj, destination_path, start_bytes, end_bytes=None, overwrite_existing=False, delete_on_failure=True)[source]
Download part of an object.
- Parameters:
obj (
libcloud.storage.base.Object
) – Object instance.destination_path (
str
) – Full path to a file or a directory where the incoming file will be saved.start_bytes (
int
) – Start byte offset (inclusive) for the range download. Offset is 0 index based so the first byte in file file is “0”.end_bytes (
int
) – End byte offset (non-inclusive) for the range download. If not provided, it will default to the end of the file.overwrite_existing (
bool
) – True to overwrite an existing file, defaults to False.delete_on_failure (
bool
) – True to delete a partially downloaded file if the download was not successful (hash mismatch / file size).
- Returns:
True if an object has been successfully downloaded, False otherwise.
- Return type:
bool
- download_object_range_as_stream(obj, start_bytes, end_bytes=None, chunk_size=None)[source]
Return a iterator which yields range / part of the object data.
- Parameters:
obj (
libcloud.storage.base.Object
) – Object instancestart_bytes (
int
) – Start byte offset (inclusive) for the range download. Offset is 0 index based so the first byte in file file is “0”.end_bytes (
int
) – End byte offset (non-inclusive) for the range download. If not provided, it will default to the end of the file.chunk_size (
int
) – Optional chunk size (in bytes).
- Return type:
iterator
ofbytes
- ex_cleanup_all_multipart_uploads(container, prefix=None)[source]
Extension method for removing all partially completed S3 multipart uploads.
- Parameters:
container (
Container
) – The container holding the uploadsprefix (
str
) – Delete only uploads of objects with this prefix
- ex_iterate_multipart_uploads(container, prefix=None, delimiter=None)[source]
Extension method for listing all in-progress S3 multipart uploads.
Each multipart upload which has not been committed or aborted is considered in-progress.
- Parameters:
container (
Container
) – The container holding the uploadsprefix (
str
) – Print only uploads of objects with this prefixdelimiter (
str
) – The object/key names are grouped based on being split by this delimiter
- Returns:
A generator of S3MultipartUpload instances.
- Return type:
generator
ofS3MultipartUpload
- ex_location_name = ''
- get_container(container_name)[source]
Return a container instance.
- Parameters:
container_name (
str
) – Container name.- Returns:
Container
instance.- Return type:
- get_object(container_name, object_name)[source]
Return an object instance.
- Parameters:
container_name (
str
) – Container name.object_name (
str
) – Object name.
- Returns:
Object
instance.- Return type:
- http_vendor_prefix = 'x-amz'
- iterate_container_objects(container, prefix=None, ex_prefix=None)[source]
Return a generator of objects for the given container.
- Parameters:
container (
Container
) – Container instanceprefix (
str
) – Only return objects starting with prefixex_prefix (
str
) – Only return objects starting with ex_prefix
- Returns:
A generator of Object instances.
- Return type:
generator
ofObject
- iterate_containers()[source]
Return a iterator of containers for the given account
- Returns:
A iterator of Container instances.
- Return type:
iterator
oflibcloud.storage.base.Container
- namespace = 'http://s3.amazonaws.com/doc/2006-03-01/'
- supports_s3_multipart_upload = True
- upload_object(file_path, container, object_name, extra=None, verify_hash=True, headers=None, ex_storage_class=None)[source]
@inherits:
StorageDriver.upload_object
- Parameters:
ex_storage_class (
str
) – Storage class
- upload_object_via_stream(iterator, container, object_name, extra=None, headers=None, ex_storage_class=None)[source]
@inherits:
StorageDriver.upload_object_via_stream
- Parameters:
ex_storage_class (
str
) – Storage class
- website = 'http://aws.amazon.com/s3/'
- class libcloud.storage.drivers.s3.S3APNE1Connection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, token=None, retry_delay=None, backoff=None)[source]
Bases:
S3SignatureV4Connection
Initialize user_id and key; set secure to an
int
based on passed value.
- class libcloud.storage.drivers.s3.S3APNE1StorageDriver(key, secret=None, secure=True, host=None, port=None, region=None, token=None, **kwargs)[source]
Bases:
S3StorageDriver
- Parameters:
key (
str
) – API key or username to be used (required)secret (
str
) – Secret password to be used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.host (
str
) – Override hostname used for connections.port (
int
) – Override port used for connections.api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions.region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
- Return type:
None
- connectionCls
alias of
S3APNE1Connection
- ex_location_name = 'ap-northeast-1'
- region_name = 'ap-northeast-1'
- class libcloud.storage.drivers.s3.S3APNE2Connection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, token=None, retry_delay=None, backoff=None)[source]
Bases:
S3SignatureV4Connection
Initialize user_id and key; set secure to an
int
based on passed value.
- class libcloud.storage.drivers.s3.S3APNE2StorageDriver(key, secret=None, secure=True, host=None, port=None, region=None, token=None, **kwargs)[source]
Bases:
S3StorageDriver
- Parameters:
key (
str
) – API key or username to be used (required)secret (
str
) – Secret password to be used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.host (
str
) – Override hostname used for connections.port (
int
) – Override port used for connections.api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions.region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
- Return type:
None
- connectionCls
alias of
S3APNE2Connection
- ex_location_name = 'ap-northeast-2'
- region_name = 'ap-northeast-2'
- libcloud.storage.drivers.s3.S3APNEConnection
alias of
S3APNE1Connection
- libcloud.storage.drivers.s3.S3APNEStorageDriver
alias of
S3APNE1StorageDriver
- class libcloud.storage.drivers.s3.S3APSE2Connection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, token=None, retry_delay=None, backoff=None)[source]
Bases:
S3SignatureV4Connection
Initialize user_id and key; set secure to an
int
based on passed value.
- class libcloud.storage.drivers.s3.S3APSE2StorageDriver(key, secret=None, secure=True, host=None, port=None, region=None, token=None, **kwargs)[source]
Bases:
S3StorageDriver
- Parameters:
key (
str
) – API key or username to be used (required)secret (
str
) – Secret password to be used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.host (
str
) – Override hostname used for connections.port (
int
) – Override port used for connections.api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions.region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
- Return type:
None
- connectionCls
alias of
S3APSE2Connection
- ex_location_name = 'ap-southeast-2'
- region_name = 'ap-southeast-2'
- class libcloud.storage.drivers.s3.S3APSEConnection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, token=None, retry_delay=None, backoff=None)[source]
Bases:
S3SignatureV4Connection
Initialize user_id and key; set secure to an
int
based on passed value.
- class libcloud.storage.drivers.s3.S3APSEStorageDriver(key, secret=None, secure=True, host=None, port=None, region=None, token=None, **kwargs)[source]
Bases:
S3StorageDriver
- Parameters:
key (
str
) – API key or username to be used (required)secret (
str
) – Secret password to be used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.host (
str
) – Override hostname used for connections.port (
int
) – Override port used for connections.api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions.region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
- Return type:
None
- connectionCls
alias of
S3APSEConnection
- ex_location_name = 'ap-southeast-1'
- region_name = 'ap-southeast-1'
- class libcloud.storage.drivers.s3.S3APSouthConnection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, token=None, retry_delay=None, backoff=None)[source]
Bases:
S3SignatureV4Connection
Initialize user_id and key; set secure to an
int
based on passed value.
- class libcloud.storage.drivers.s3.S3APSouthStorageDriver(key, secret=None, secure=True, host=None, port=None, region=None, token=None, **kwargs)[source]
Bases:
S3StorageDriver
- Parameters:
key (
str
) – API key or username to be used (required)secret (
str
) – Secret password to be used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.host (
str
) – Override hostname used for connections.port (
int
) – Override port used for connections.api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions.region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
- Return type:
None
- connectionCls
alias of
S3APSouthConnection
- ex_location_name = 'ap-south-1'
- region_name = 'ap-south-1'
- class libcloud.storage.drivers.s3.S3CACentralConnection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, token=None, retry_delay=None, backoff=None)[source]
Bases:
S3SignatureV4Connection
Initialize user_id and key; set secure to an
int
based on passed value.
- class libcloud.storage.drivers.s3.S3CACentralStorageDriver(key, secret=None, secure=True, host=None, port=None, region=None, token=None, **kwargs)[source]
Bases:
S3StorageDriver
- Parameters:
key (
str
) – API key or username to be used (required)secret (
str
) – Secret password to be used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.host (
str
) – Override hostname used for connections.port (
int
) – Override port used for connections.api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions.region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
- Return type:
None
- connectionCls
alias of
S3CACentralConnection
- ex_location_name = 'ca-central-1'
- region_name = 'ca-central-1'
- class libcloud.storage.drivers.s3.S3CNNorthConnection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, token=None, retry_delay=None, backoff=None)[source]
Bases:
S3SignatureV4Connection
Initialize user_id and key; set secure to an
int
based on passed value.
- class libcloud.storage.drivers.s3.S3CNNorthStorageDriver(key, secret=None, secure=True, host=None, port=None, region=None, token=None, **kwargs)[source]
Bases:
S3StorageDriver
- Parameters:
key (
str
) – API key or username to be used (required)secret (
str
) – Secret password to be used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.host (
str
) – Override hostname used for connections.port (
int
) – Override port used for connections.api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions.region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
- Return type:
None
- connectionCls
alias of
S3CNNorthConnection
- ex_location_name = 'cn-north-1'
- region_name = 'cn-north-1'
- class libcloud.storage.drivers.s3.S3CNNorthWestConnection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, token=None, retry_delay=None, backoff=None)[source]
Bases:
S3SignatureV4Connection
Initialize user_id and key; set secure to an
int
based on passed value.
- class libcloud.storage.drivers.s3.S3CNNorthWestStorageDriver(key, secret=None, secure=True, host=None, port=None, region=None, token=None, **kwargs)[source]
Bases:
S3StorageDriver
- Parameters:
key (
str
) – API key or username to be used (required)secret (
str
) – Secret password to be used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.host (
str
) – Override hostname used for connections.port (
int
) – Override port used for connections.api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions.region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
- Return type:
None
- connectionCls
alias of
S3CNNorthWestConnection
- ex_location_name = 'cn-northwest-1'
- region_name = 'cn-northwest-1'
- class libcloud.storage.drivers.s3.S3Connection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, token=None, retry_delay=None, backoff=None)[source]
Bases:
AWSTokenConnection
,BaseS3Connection
Represents a single connection to the S3 endpoint, with AWS-specific features.
Initialize user_id and key; set secure to an
int
based on passed value.
- class libcloud.storage.drivers.s3.S3EUCentralConnection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, token=None, retry_delay=None, backoff=None)[source]
Bases:
S3SignatureV4Connection
Initialize user_id and key; set secure to an
int
based on passed value.
- class libcloud.storage.drivers.s3.S3EUCentralStorageDriver(key, secret=None, secure=True, host=None, port=None, region=None, token=None, **kwargs)[source]
Bases:
S3StorageDriver
- Parameters:
key (
str
) – API key or username to be used (required)secret (
str
) – Secret password to be used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.host (
str
) – Override hostname used for connections.port (
int
) – Override port used for connections.api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions.region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
- Return type:
None
- connectionCls
alias of
S3EUCentralConnection
- ex_location_name = 'eu-central-1'
- region_name = 'eu-central-1'
- class libcloud.storage.drivers.s3.S3EUNorth1Connection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, token=None, retry_delay=None, backoff=None)[source]
Bases:
S3SignatureV4Connection
Initialize user_id and key; set secure to an
int
based on passed value.
- class libcloud.storage.drivers.s3.S3EUNorth1StorageDriver(key, secret=None, secure=True, host=None, port=None, region=None, token=None, **kwargs)[source]
Bases:
S3StorageDriver
- Parameters:
key (
str
) – API key or username to be used (required)secret (
str
) – Secret password to be used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.host (
str
) – Override hostname used for connections.port (
int
) – Override port used for connections.api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions.region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
- Return type:
None
- connectionCls
alias of
S3EUNorth1Connection
- ex_location_name = 'eu-north-1'
- region_name = 'eu-north-1'
- class libcloud.storage.drivers.s3.S3EUWest2Connection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, token=None, retry_delay=None, backoff=None)[source]
Bases:
S3SignatureV4Connection
Initialize user_id and key; set secure to an
int
based on passed value.
- class libcloud.storage.drivers.s3.S3EUWest2StorageDriver(key, secret=None, secure=True, host=None, port=None, region=None, token=None, **kwargs)[source]
Bases:
S3StorageDriver
- Parameters:
key (
str
) – API key or username to be used (required)secret (
str
) – Secret password to be used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.host (
str
) – Override hostname used for connections.port (
int
) – Override port used for connections.api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions.region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
- Return type:
None
- connectionCls
alias of
S3EUWest2Connection
- ex_location_name = 'eu-west-2'
- region_name = 'eu-west-2'
- class libcloud.storage.drivers.s3.S3EUWestConnection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, token=None, retry_delay=None, backoff=None)[source]
Bases:
S3SignatureV4Connection
Initialize user_id and key; set secure to an
int
based on passed value.
- class libcloud.storage.drivers.s3.S3EUWestStorageDriver(key, secret=None, secure=True, host=None, port=None, region=None, token=None, **kwargs)[source]
Bases:
S3StorageDriver
- Parameters:
key (
str
) – API key or username to be used (required)secret (
str
) – Secret password to be used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.host (
str
) – Override hostname used for connections.port (
int
) – Override port used for connections.api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions.region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
- Return type:
None
- connectionCls
alias of
S3EUWestConnection
- ex_location_name = 'EU'
- region_name = 'eu-west-1'
- class libcloud.storage.drivers.s3.S3MultipartUpload(key, id, created_at, initiator, owner)[source]
Bases:
object
Class representing an amazon s3 multipart upload
Class representing an amazon s3 multipart upload
- Parameters:
key (
str
) – The object/key that was being uploadedid (
str
) – The upload id assigned by amazoncreated_at (
str
) – The date/time at which the upload was startedinitiator (
str
) – The AWS owner/IAM user who initiated thisowner (
str
) – The AWS owner/IAM who will own this object
- class libcloud.storage.drivers.s3.S3RawResponse(connection, response=None)[source]
Bases:
S3Response
,RawResponse
- Parameters:
connection (
Connection
) – Parent connection object.
- class libcloud.storage.drivers.s3.S3Response(response, connection)[source]
Bases:
AWSBaseResponse
- Parameters:
response (
httplib.HTTPResponse
) – HTTP response object. (optional)connection (
Connection
) – Parent connection object.
- namespace = None
- parse_error()[source]
Parse the error messages.
Override in a provider’s subclass.
- Returns:
Parsed error.
- Return type:
str
- success()[source]
Determine if our request was successful.
The meaning of this can be arbitrary; did we receive OK status? Did the node get created? Were we authenticated?
- Return type:
bool
- Returns:
True
orFalse
- valid_response_codes = [<HTTPStatus.NOT_FOUND: 404>, <HTTPStatus.CONFLICT: 409>, <HTTPStatus.BAD_REQUEST: 400>, <HTTPStatus.PARTIAL_CONTENT: 206>]
- class libcloud.storage.drivers.s3.S3SAEastConnection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, token=None, retry_delay=None, backoff=None)[source]
Bases:
S3SignatureV4Connection
Initialize user_id and key; set secure to an
int
based on passed value.
- class libcloud.storage.drivers.s3.S3SAEastStorageDriver(key, secret=None, secure=True, host=None, port=None, region=None, token=None, **kwargs)[source]
Bases:
S3StorageDriver
- Parameters:
key (
str
) – API key or username to be used (required)secret (
str
) – Secret password to be used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.host (
str
) – Override hostname used for connections.port (
int
) – Override port used for connections.api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions.region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
- Return type:
None
- connectionCls
alias of
S3SAEastConnection
- ex_location_name = 'sa-east-1'
- region_name = 'sa-east-1'
- class libcloud.storage.drivers.s3.S3SignatureV4Connection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, token=None, retry_delay=None, backoff=None)[source]
Bases:
SignedAWSConnection
,BaseS3Connection
Initialize user_id and key; set secure to an
int
based on passed value.- service_name = 's3'
- class libcloud.storage.drivers.s3.S3StorageDriver(key, secret=None, secure=True, host=None, port=None, region=None, token=None, **kwargs)[source]
Bases:
AWSDriver
,BaseS3StorageDriver
- Parameters:
key (
str
) – API key or username to be used (required)secret (
str
) – Secret password to be used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.host (
str
) – Override hostname used for connections.port (
int
) – Override port used for connections.api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions.region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
- Return type:
None
- connectionCls
alias of
S3SignatureV4Connection
- get_object_cdn_url(obj, ex_expiry=24.0)[source]
Return a “presigned URL” for read-only access to object
AWS only - requires AWS signature V4 authentication.
- Parameters:
obj (
Object
) – Object instance.ex_expiry (
float
) – The number of hours after which the URL expires. Defaults to 24 hours or the value of the environment variable “LIBCLOUD_S3_STORAGE_CDN_URL_EXPIRY_HOURS”, if set.
- Returns:
Presigned URL for the object.
- Return type:
str
- region_name = 'us-east-1'
- class libcloud.storage.drivers.s3.S3USEast2Connection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, token=None, retry_delay=None, backoff=None)[source]
Bases:
S3SignatureV4Connection
Initialize user_id and key; set secure to an
int
based on passed value.
- class libcloud.storage.drivers.s3.S3USEast2StorageDriver(key, secret=None, secure=True, host=None, port=None, region=None, token=None, **kwargs)[source]
Bases:
S3StorageDriver
- Parameters:
key (
str
) – API key or username to be used (required)secret (
str
) – Secret password to be used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.host (
str
) – Override hostname used for connections.port (
int
) – Override port used for connections.api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions.region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
- Return type:
None
- connectionCls
alias of
S3USEast2Connection
- ex_location_name = 'us-east-2'
- region_name = 'us-east-2'
- class libcloud.storage.drivers.s3.S3USGovEastConnection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, token=None, retry_delay=None, backoff=None)[source]
Bases:
S3SignatureV4Connection
Initialize user_id and key; set secure to an
int
based on passed value.
- class libcloud.storage.drivers.s3.S3USGovEastStorageDriver(key, secret=None, secure=True, host=None, port=None, region=None, token=None, **kwargs)[source]
Bases:
S3StorageDriver
- Parameters:
key (
str
) – API key or username to be used (required)secret (
str
) – Secret password to be used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.host (
str
) – Override hostname used for connections.port (
int
) – Override port used for connections.api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions.region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
- Return type:
None
- connectionCls
alias of
S3USGovEastConnection
- ex_location_name = 'us-gov-east-1'
- region_name = 'us-gov-east-1'
- class libcloud.storage.drivers.s3.S3USGovWestConnection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, token=None, retry_delay=None, backoff=None)[source]
Bases:
S3SignatureV4Connection
Initialize user_id and key; set secure to an
int
based on passed value.
- class libcloud.storage.drivers.s3.S3USGovWestStorageDriver(key, secret=None, secure=True, host=None, port=None, region=None, token=None, **kwargs)[source]
Bases:
S3StorageDriver
- Parameters:
key (
str
) – API key or username to be used (required)secret (
str
) – Secret password to be used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.host (
str
) – Override hostname used for connections.port (
int
) – Override port used for connections.api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions.region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
- Return type:
None
- connectionCls
alias of
S3USGovWestConnection
- ex_location_name = 'us-gov-west-1'
- region_name = 'us-gov-west-1'
- class libcloud.storage.drivers.s3.S3USWestConnection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, token=None, retry_delay=None, backoff=None)[source]
Bases:
S3SignatureV4Connection
Initialize user_id and key; set secure to an
int
based on passed value.
- class libcloud.storage.drivers.s3.S3USWestOregonConnection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, token=None, retry_delay=None, backoff=None)[source]
Bases:
S3SignatureV4Connection
Initialize user_id and key; set secure to an
int
based on passed value.
- class libcloud.storage.drivers.s3.S3USWestOregonStorageDriver(key, secret=None, secure=True, host=None, port=None, region=None, token=None, **kwargs)[source]
Bases:
S3StorageDriver
- Parameters:
key (
str
) – API key or username to be used (required)secret (
str
) – Secret password to be used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.host (
str
) – Override hostname used for connections.port (
int
) – Override port used for connections.api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions.region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
- Return type:
None
- connectionCls
alias of
S3USWestOregonConnection
- ex_location_name = 'us-west-2'
- region_name = 'us-west-2'
- class libcloud.storage.drivers.s3.S3USWestStorageDriver(key, secret=None, secure=True, host=None, port=None, region=None, token=None, **kwargs)[source]
Bases:
S3StorageDriver
- Parameters:
key (
str
) – API key or username to be used (required)secret (
str
) – Secret password to be used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.host (
str
) – Override hostname used for connections.port (
int
) – Override port used for connections.api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions.region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
- Return type:
None
- connectionCls
alias of
S3USWestConnection
- ex_location_name = 'us-west-1'
- region_name = 'us-west-1'