OpenStax.Swift v0.1.3 OpenStax.Swift.API.Object

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

Summary

Functions

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

Permanently deletes an object from the object store

Downloads the object content and gets the object metadata

Functions

copy(endpoint_id, source_container, source_object, destination_container, destination_object, copy_manifest \\ false)

Copies an object to another object in the object store.

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

create(endpoint_id, container, object, body, metadata \\ nil)

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

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

create_dlo_manifest(endpoint_id, container, object, segments_container, segments_object_prefix, content_type \\ "application/octet-stream", content_disposition \\ "attachment", filename \\ nil)

Creates or updates Dynamic Large Object manifest.

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

create_slo_manifest(endpoint_id, container, object, segments, metadata \\ nil)

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

delete(endpoint_id, container, object, delete_manifest \\ false)

Permanently deletes an object from the object store.

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

get_meta(endpoint_id, container, object)

Shows object metadata.

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

read(endpoint_id, container, object)

Downloads the object content and gets the object metadata.

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

set_meta(endpoint_id, container, object, metadata \\ nil)

Creates or updates object metadata.

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