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
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’.
Specs
create_storage!(storage :: binary, region :: binary, class :: binary) :: HTTPoison.Response.t
Same as create_storage/3 but returns the complete HTTP reply.
Specs
delete_item(storage :: binary, item :: binary) ::
:ok |
binary
Deletes the file in ‘item’ in the given ‘storage’.
Specs
delete_item!(storage :: binary, item :: binary) :: HTTPoison.Response.t
Same as delete_item/2 but returns the complete HTTP reply.
Specs
delete_storage(storage :: binary) :: :ok | binary
Deletes the given ‘storage’. Usually the storage must be empty before deletion.
Specs
delete_storage!(storage :: binary) :: HTTPoison.Response.t
Same as delete_storage/1 but returns the complete HTTP reply.
Specs
get_item(storage :: binary, item :: binary) ::
:ok |
binary
Downloads the given ‘item’ in the given ‘storage’.
Specs
get_item!(storage :: binary, item :: binary) :: HTTPoison.Response.t
Same as get_item/2 but returns the complete HTTP reply.
Specs
get_item_acl(binary, binary) ::
[{binary, binary}] |
binary
Retrieves the given ‘item’s ACL in the given ‘storage’.
Specs
get_item_acl!(storage :: binary, item :: binary) :: HTTPoison.Response.t
Same as get_item_acl/2 but returns the complete HTTP reply.
Specs
get_storage_acl(binary) ::
[{binary, binary}] |
binary
Returns the given ‘storage’ ACL.
Specs
get_storage_acl!(storage :: binary) :: HTTPoison.Response.t
Same as get_storage_acl/1 but returns the complete HTTP reply.
Specs
get_storage_class(storage :: binary) :: binary
Returns the given ‘storage’ class.
Specs
get_storage_region(storage :: binary) :: binary
Returns the given ‘storage’ region.
Specs
get_storage_region!(storage :: binary) :: HTTPoison.Response.t
Same as get_storage_region/1 but returns the complete HTTP reply.
Specs
list_items(storage :: binary) :: [binary] | binary
Lists all the available files in the given ‘storage’.
Specs
list_items!(storage :: binary) :: HTTPoison.Response.t
Same as list_items/1 but returns the complete HTTP reply.
Specs
list_storages :: [binary] | binary
Lists all the available storages for the chosen cloud provider’s storage service.
Specs
list_storages! :: HTTPoison.Response.t
Same as list_storages/0 but returns the complete HTTP reply.
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.