For details on how to use this API, see Using OpenStack Object Store
The Object Store high-level interface is exposed as the object_store
object on Connection
objects.
Get metadata for this account.
Set metadata for this account.
metadata (kwargs) – Key/value pairs to be set as metadata on the container. Custom metadata can be set. Custom metadata are keys and values defined by the user.
Delete metadata for this account.
keys – The keys of metadata to be deleted.
Obtain Container objects for this account.
query (kwargs) – Optional query parameters to be sent to limit the resources being returned.
A generator of
Container
objects.
Create a new container from attributes
Delete a container
container – The value can be either the name of a container or a
Container
instance.
ignore_missing (bool) – When set to False
ResourceNotFound
will be raised when
the container does not exist. When set to True
, no exception
will be set when attempting to delete a nonexistent server.
None
Get metadata for a container
Set metadata for a container.
container – The value can be the name of a container or a
Container
instance.
refresh – Flag to trigger refresh of container object re-fetch.
metadata (kwargs) –
Key/value pairs to be set as metadata on the container. Both custom and system metadata can be set. Custom metadata are keys and values defined by the user. System metadata are keys defined by the Object Store and values defined by the user. The system metadata keys are:
content_type
is_content_type_detected
versions_location
read_ACL
write_ACL
sync_to
sync_key
Delete metadata for a container.
container – The value can be the ID of a container or a
Container
instance.
keys – The keys of metadata to be deleted.
Return a generator that yields the Container’s objects.
Get the data associated with an object
obj – The value can be the name of an object or a
Object
instance.
container – The value can be the name of a container or a
Container
instance.
resp_chunk_size (int) – chunk size of data to read. Only used if the results are being written to a file or stream is True. (optional, defaults to 1k)
outfile – Write the object to a file instead of returning the contents. If this option is given, body in the return tuple will be None. outfile can either be a file path given as a string, or a File like object.
remember_content (bool) – Flag whether object data should be saved as data property of the Object. When left as false and outfile is not defined data will not be saved and need to be fetched separately.
Instance of the
Object
objects.
ResourceNotFound
when no resource can be found.
Download the data contained inside an object.
Create a file object.
Automatically uses large-object segments if needed.
container – The name of the container to store the file in. This container will be created if it does not exist already.
name – Name for the object within the container.
filename – The path to the local file whose contents will be uploaded. Mutually exclusive with data.
data – The content to upload to the object. Mutually exclusive with filename.
md5 – A hexadecimal md5 of the file. (Optional), if it is known and can be passed here, it will save repeating the expensive md5 process. It is assumed to be accurate.
sha256 – A hexadecimal sha256 of the file. (Optional) See md5.
segment_size – Break the uploaded object into segments of this many bytes. (Optional) SDK will attempt to discover the maximum value for this from the server if it is not specified, or will use a reasonable default.
headers – These will be passed through to the object creation API as HTTP Headers.
use_slo – If the object is large enough to need to be a Large Object, use a static rather than dynamic object. Static Objects will delete segment objects when the manifest object is deleted. (optional, defaults to True)
generate_checksums – Whether to generate checksums on the client side that get added to headers for later prevention of double uploads of identical data. (optional, defaults to True)
metadata – This dict will get changed into headers that set metadata of the object
OpenStackCloudException
on operation error.
Copy an object.
Delete an object
obj – The value can be either the name of an object or a
Container
instance.
container – The value can be the ID of a container or a
Container
instance.
ignore_missing (bool) – When set to False
ResourceNotFound
will be raised when
the object does not exist. When set to True
, no exception will
be set when attempting to delete a nonexistent server.
None
Get metadata for an object.
Set metadata for an object.
Note: This method will do an extra HEAD call.
obj – The value can be the name of an object or a
Object
instance.
container – The value can be the name of a container or a
Container
instance.
metadata (kwargs) –
Key/value pairs to be set as metadata on the container. Both custom and system metadata can be set. Custom metadata are keys and values defined by the user. System metadata are keys defined by the Object Store and values defined by the user. The system metadata keys are:
content_type
content_encoding
content_disposition
delete_after
delete_at
is_content_type_detected
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.