Home | Trees | Indices | Help |
|
---|
|
Container object and Object instance factory.
If your account has the feature enabled, containers can be publically shared over a global content delivery network.
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
bool |
|
||
str |
|
||
str |
|
||
str |
|
||
Object |
|
||
ObjectResults |
|
||
Object |
|
||
list({"name":"...", "hash":..., "size":..., "type":...}) |
|
||
list(str) |
|
||
|
|||
|
|||
|
|||
Inherited from |
Instance Variables | |
str |
name the container's name (generally treated as read-only) |
bool |
cdn_log_retention retention of the logs in the container. |
number |
cdn_ttl the time-to-live of the CDN's public cache of this container (cached, use make_public to alter) |
number |
object_count the number of objects in this container (cached) |
number |
size_used the sum of the sizes of all objects in this container (cached) |
Properties | |
Inherited from |
Method Details |
Containers will rarely if ever need to be instantiated directly by the user. Instead, use the create_container, get_container, list_containers and other methods on a valid Connection object.
|
Update Container Metadata >>> metadata = {'x-container-meta-foo' : 'bar'} >>> container.update_metadata(metadata)
|
Enable static web for this Container >>> container.enable_static_web('index.html', 'error.html', True, 'style.css')
|
Disable static web for this Container
>>> container.disable_static_web()
|
Enable object versioning on this container >>> container.enable_object_versioning('container_i_want_versions_to_go_to')
|
Disable object versioning on this container
>>> container.disable_object_versioning()
|
Either publishes the current container to the CDN or updates its CDN attributes. Requires CDN be enabled on the account. >>> container.make_public(ttl=604800) # expire in 1 week
|
Disables CDN access to this container. It may continue to be available until its TTL expires.
>>> container.make_private()
|
Purge Edge cache for all object inside of this container. You will be notified by email if one is provided when the job completes. >>> container.purge_from_cdn("user@dmain.com") or >>> container.purge_from_cdn("user@domain.com,user2@domain.com") or
>>> container.purge_from_cdn()
|
Enable CDN log retention on the container. If enabled logs will be periodically (at unpredictable intervals) compressed and uploaded to a ".CDN_ACCESS_LOGS" container in the form of "container_name/YYYY/MM/DD/HH/XXXX.gz". Requires CDN be enabled on the account.
>>> container.log_retention(True)
|
Returns a boolean indicating whether or not this container is publically accessible via the CDN. >>> container.is_public() False >>> container.make_public() >>> container.is_public() True
|
Return the URI for this container, if it is publically accessible via the CDN. >>> connection['container1'].public_uri() 'http://c00061.cdn.cloudfiles.rackspacecloud.com'
|
Return the SSL URI for this container, if it is publically accessible via the CDN. >>> connection['container1'].public_ssl_uri() 'https://c61.ssl.cf0.rackcdn.com'
|
Return the Streaming URI for this container, if it is publically accessible via the CDN. >>> connection['container1'].public_ssl_uri() 'https://c61.stream.rackcdn.com'
|
Return an Object instance, creating it if necessary. When passed the name of an existing object, this method will return an instance of that object, otherwise it will create a new one. >>> container.create_object('new_object') <cloudfiles.storage_object.Object object at 0xb778366c> >>> obj = container.create_object('new_object') >>> obj.name 'new_object'
|
Return a result set of all Objects in the Container. Keyword arguments are treated as HTTP query parameters and can be used to limit the result set (see the API documentation). >>> container.get_objects(limit=2) ObjectResults: 2 objects >>> for obj in container.get_objects(): ... print obj.name new_object old_object
|
Return an Object instance for an existing storage object. If an object with a name matching object_name does not exist then a NoSuchObject exception is raised. >>> obj = container.get_object('old_object') >>> obj.name 'old_object'
|
Return information about all objects in the Container. Keyword arguments are treated as HTTP query parameters and can be used limit the result set (see the API documentation). >>> conn['container1'].list_objects_info(limit=2) [{u'bytes': 4820, u'content_type': u'application/octet-stream', u'hash': u'db8b55400b91ce34d800e126e37886f8', u'last_modified': u'2008-11-05T00:56:00.406565', u'name': u'new_object'}, {u'bytes': 1896, u'content_type': u'application/octet-stream', u'hash': u'1b49df63db7bc97cd2a10e391e102d4b', u'last_modified': u'2008-11-05T00:56:27.508729', u'name': u'old_object'}]
|
Return names of all Objects in the Container. Keyword arguments are treated as HTTP query parameters and can be used to limit the result set (see the API documentation). >>> container.list_objects() ['new_object', 'old_object']
|
str(x)
|
Permanently remove a storage object. >>> container.list_objects() ['new_object', 'old_object'] >>> container.delete_object('old_object') >>> container.list_objects() ['new_object']
|
Instance Variable Details |
namethe container's name (generally treated as read-only)
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Jun 1 13:14:14 2012 | http://epydoc.sourceforge.net |