OpenStax.Swift v0.3.0 OpenStax.Swift.API.Object View Source

This module is responsible for wrapping HTTP requests sent to Swift when it comes to object handling.

Link to this section Summary

Link to this section Functions

Link to this function copy(endpoint_id, source_container, source_object, destination_container, destination_object, copy_manifest \\ false) View Source

Copies an object to another object in the object store.

See http://developer.openstack.org/api-ref-objectstorage-v1.html#copyObject

Link to this function create(endpoint_id, container, object, body, content_type \\ "application/octet-stream", content_disposition \\ "attachment", filename \\ nil, metadata \\ nil) View Source

Creates an object with data content and metadata, or replaces an existing object with data content and metadata.

Body can be either string or {:file, path_to_the_file}.

On success it returns {:ok, %{etag: "md5 hash of contents"}}.

On error it returns {:error, reason}.

See http://developer.openstack.org/api-ref-objectstorage-v1.html#createOrReplaceObject

Link to this function create_dlo_manifest(endpoint_id, container, object, segments_container, segments_object_prefix, content_type \\ "application/octet-stream", content_disposition \\ "attachment", filename \\ nil, metadata \\ nil) View Source

Creates or updates Dynamic Large Object manifest.

See http://docs.openstack.org/developer/swift/api/large_objects.html#dynamic-large-objects

Link to this function create_slo_manifest(endpoint_id, container, object, segments, metadata \\ nil) View Source

Creates or updates Static Large Object manifest.

You have to pass information about segments that is a list of tuples {container/object, etag, size_bytes} in order that will compose the object.

See http://docs.openstack.org/developer/swift/api/large_objects.html#static-large-objects

Link to this function delete(endpoint_id, container, object, delete_manifest \\ false) View Source

Permanently deletes an object from the object store.

See http://developer.openstack.org/api-ref-objectstorage-v1.html#deleteObject

Link to this function get_meta(endpoint_id, container, object) View Source

Shows object metadata.

See http://developer.openstack.org/api-ref-objectstorage-v1.html#showObjectMeta

Link to this function read(endpoint_id, container, object) View Source

Downloads the object content and gets the object metadata.

See http://developer.openstack.org/api-ref-objectstorage-v1.html#showObject

Link to this function set_meta(endpoint_id, container, object, metadata \\ nil) View Source

Creates or updates object metadata.

See http://developer.openstack.org/api-ref-objectstorage-v1.html#updateObjectMeta