nomad v0.7.1 NomadStorage behaviour

Summary

Callbacks

Creates a storage (a bucket) for the chosen cloud provider’s storage service in the desired ‘region’

Same as create_storage/3 but returns the complete HTTP reply

Deletes the file in ‘item’ in the given ‘storage’

Same as delete_item/2 but returns the complete HTTP reply

Deletes the given ‘storage’. Usually the storage must be empty before deletion

Same as delete_storage/1 but returns the complete HTTP reply

Downloads the given ‘item’ in the given ‘storage’

Same as get_item/2 but returns the complete HTTP reply

Retrieves the given ‘item’s ACL in the given ‘storage’

Same as get_item_acl/2 but returns the complete HTTP reply

Returns the given ‘storage’ ACL

Same as get_storage_acl/1 but returns the complete HTTP reply

Returns the given ‘storage’ class

Returns the given ‘storage’ region

Same as get_storage_region/1 but returns the complete HTTP reply

Lists the available classes for the storages

Lists all the available files in the given ‘storage’

Same as list_items/1 but returns the complete HTTP reply

Lists all the available storages for the chosen cloud provider’s storage service

Same as list_storages/0 but returns the complete HTTP reply

Uploads the file in ‘filepath’ to the given ‘storage’ and stores it in the specified ‘storage_path’. The necessaries directories in ‘storage_path’ will be created if they do not exist

Same as put_item/3 but returns the complete HTTP reply

Callbacks

create_storage(storage, region, class)

Specs

create_storage(storage :: binary, region :: binary, class :: binary) ::
  :ok |
  binary

Creates a storage (a bucket) for the chosen cloud provider’s storage service in the desired ‘region’.

create_storage!(storage, region, class)

Specs

create_storage!(storage :: binary, region :: binary, class :: binary) :: HTTPoison.Response.t

Same as create_storage/3 but returns the complete HTTP reply.

delete_item(storage, item)

Specs

delete_item(storage :: binary, item :: binary) ::
  :ok |
  binary

Deletes the file in ‘item’ in the given ‘storage’.

delete_item!(storage, item)

Specs

delete_item!(storage :: binary, item :: binary) :: HTTPoison.Response.t

Same as delete_item/2 but returns the complete HTTP reply.

delete_storage(storage)

Specs

delete_storage(storage :: binary) :: :ok | binary

Deletes the given ‘storage’. Usually the storage must be empty before deletion.

delete_storage!(storage)

Specs

delete_storage!(storage :: binary) :: HTTPoison.Response.t

Same as delete_storage/1 but returns the complete HTTP reply.

get_item(storage, item)

Specs

get_item(storage :: binary, item :: binary) ::
  :ok |
  binary

Downloads the given ‘item’ in the given ‘storage’.

get_item!(storage, item)

Specs

get_item!(storage :: binary, item :: binary) :: HTTPoison.Response.t

Same as get_item/2 but returns the complete HTTP reply.

get_item_acl(binary, binary)

Specs

get_item_acl(binary, binary) ::
  [{binary, binary}] |
  binary

Retrieves the given ‘item’s ACL in the given ‘storage’.

get_item_acl!(storage, item)

Specs

get_item_acl!(storage :: binary, item :: binary) :: HTTPoison.Response.t

Same as get_item_acl/2 but returns the complete HTTP reply.

get_storage_acl(binary)

Specs

get_storage_acl(binary) ::
  [{binary, binary}] |
  binary

Returns the given ‘storage’ ACL.

get_storage_acl!(storage)

Specs

get_storage_acl!(storage :: binary) :: HTTPoison.Response.t

Same as get_storage_acl/1 but returns the complete HTTP reply.

get_storage_class(storage)

Specs

get_storage_class(storage :: binary) :: binary

Returns the given ‘storage’ class.

get_storage_region(storage)

Specs

get_storage_region(storage :: binary) :: binary

Returns the given ‘storage’ region.

get_storage_region!(storage)

Specs

get_storage_region!(storage :: binary) :: HTTPoison.Response.t

Same as get_storage_region/1 but returns the complete HTTP reply.

list_classes()

Specs

list_classes :: [binary]

Lists the available classes for the storages.

list_items(storage)

Specs

list_items(storage :: binary) :: [binary] | binary

Lists all the available files in the given ‘storage’.

list_items!(storage)

Specs

list_items!(storage :: binary) :: HTTPoison.Response.t

Same as list_items/1 but returns the complete HTTP reply.

list_storages()

Specs

list_storages :: [binary] | binary

Lists all the available storages for the chosen cloud provider’s storage service.

list_storages!()

Specs

list_storages! :: HTTPoison.Response.t

Same as list_storages/0 but returns the complete HTTP reply.

put_item(storage, filepath, storage_path)

Specs

put_item(storage :: binary, filepath :: binary, storage_path :: binary) ::
  :ok |
  binary

Uploads the file in ‘filepath’ to the given ‘storage’ and stores it in the specified ‘storage_path’. The necessaries directories in ‘storage_path’ will be created if they do not exist.

put_item!(storage, filepath, storage_path)

Specs

put_item!(storage :: binary, filepath :: binary, storage_path :: binary) :: HTTPoison.Response.t

Same as put_item/3 but returns the complete HTTP reply.