nomad v0.6.0 NomadStorage behaviour

Summary

Callbacks

Creates a storage (a bucket) for the chosen cloud provider’s storage service

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

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

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

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

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

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

Returns the given ‘storage’ ACL

Returns the given ‘storage’ class

Returns the given ‘storage’ region

Lists the available classes for the storages

Lists all the available files in the given ‘storage’

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

Uploads the file in ‘filepath’ to the given ‘storage’

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

Callbacks

create_storage(binary)

Specs

create_storage(binary) :: :ok | binary

Creates a storage (a bucket) for the chosen cloud provider’s storage service.

create_storage(binary, binary)

Specs

create_storage(binary, binary) :: :ok | binary

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

create_storage(binary, binary, binary)

Specs

create_storage(binary, binary, binary) ::
  :ok |
  binary

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

delete_item(binary, binary)

Specs

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

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

delete_storage(binary)

Specs

delete_storage(binary) :: :ok | binary

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

get_item(binary, binary)

Specs

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

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

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_storage_acl(binary)

Specs

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

Returns the given ‘storage’ ACL.

get_storage_class(binary)

Specs

get_storage_class(binary) :: binary

Returns the given ‘storage’ class.

get_storage_region(binary)

Specs

get_storage_region(binary) :: binary

Returns the given ‘storage’ region.

list_classes()

Specs

list_classes :: [binary]

Lists the available classes for the storages.

list_items(binary)

Specs

list_items(binary) :: [binary] | binary

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

list_storages()

Specs

list_storages :: [binary] | binary

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

put_item(binary, binary)

Specs

put_item(binary, binary) :: :ok | binary

Uploads the file in ‘filepath’ to the given ‘storage’.

put_item(binary, binary, binary)

Specs

put_item(binary, binary, 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.