Bases: Cloud.Cloud
A class to interface into Rackspace Cloud Files.
Retrieves the number of containers and the total bytes stored in Cloud Files for the account.
Returns: Results header as string
Allows for metadata entries to an account(TempURL or form posts etc)
Arguments: metaDict – Python dictionary of key/value pairs to be added.
Returns: status code
Lists the available containers in the Cloud Files account.
Arguments: attrDict –
limit – For an integer value n, limits the number of results to n values. (Optional) marker – Given a string value x, return object names greater in value than the marker. (Optional) format – Specify either json or xml to return the respective serialized response. (Optional)
Create a container at the root of the CF account.
Arguments: container – container name (string) metaDict – A python dictionary with key/value pairs for metadata tags and desc etc.
Must be valid UTF-8 http header and take the format X-Container-Meta- etc.
Returns: status code
Permanently remove a container. Must be empty
Arguments: container – container name (string)
Returns: status code
Retrieves metadata for a specified container.
Arguments: container – container name (string)
Returns: Header info as string
Create or update metadata on a container.
Arguments: container – container name (string) metaDict – A python dictionary with key/value pairs for metadata tags and desc etc.
Must be valid UTF-8 http header and take the format X-Container-Meta- etc.
Returns: status code
Retrieves a list of objects stored in the container. Additionally, there are a number of optional query parameters that can be used to refine the list results.
Arguments: container – container name (string) attrDict – dictionary containing any of the following
limit – For an integer value n, limits the number of results to n values. (Optional) marker – Return object names greater in value than the specified marker. (Optional) prefix – Causes the results to be limited to object names beginning with the substring (Optional) format – Specify either json or xml to return the respective serialized response. Default json (Optional) path – Return the object names nested in the pseudo path. (Optional) delimiter – Return all the object names nested in the container with given delimiter (Optional)
Returns: JSON results as python dict
Retrieves CF objects data.
Arguments: container – container name (string) myObject – object name(string) headersList – HTTP headers as documented in RFC 2616 as key/value in python dictionary. See api docs.
Returns: Binary content on success or status code on failure.
PUT object into CF container.
Arguments: container – container name (string) myObject – Object name(string) data – File object headersList – HTTP headers as documented in RFC 2616 as key/value in python dictionary. See api docs. (Optional)
Returns: Header results
Copy object into CF container.
Arguments: sourceContainer – Name(str) sourceObject – Name(string) destContainer – Name(str) destinationObject – Name(string)
Returns: status code
Delete CF object.
Arguments: container – container name(str) myObject – object name(str)
Returns: status code
Retrieves object metadata.
Arguments: container – container name(str) myObject – object name(str)
Returns: Header info
Replaces user defined metadata with supplied.
Arguments: container – container name(str) myObject – object name(str) metaDict – Python dictionary with key/values to be added. Keys must be prefixed with X-Object-Meta
Returns: status code
Enable or disable CDN services on a container.
Arguments: container – container name(str) enabled – bool (Optional) ttl – How long till CDN cache expires. The default TTL value is 259200 seconds, or 72 hours (Optional)
Returns: headers as string
Container list request from the CDN service. It will default to showing public and private containers.
Arguments: attrDict –
limit – Limits the number of results to n values. (Optional) marker – Return object names greater in value than the specified marker. (Optional) format – either json or xml for serialized output. Default json (Optional) enabledOnly – If True, only shows CDN enabled containers (Optional)
Returns: JSON results as python dict
Adjust CDN containers attributes.
Arguments: container – metaDict – Python dictionary with key/value pairs to append to container metadata
Returns: Headers as string