AzureStor (version 2.0.1)

storage_container: Storage client generics

Description

Storage client generics

Usage

storage_container(endpoint, ...)

# S3 method for blob_endpoint storage_container(endpoint, name, ...)

# S3 method for file_endpoint storage_container(endpoint, name, ...)

# S3 method for adls_endpoint storage_container(endpoint, name, ...)

# S3 method for character storage_container(endpoint, key = NULL, token = NULL, sas = NULL, ...)

create_storage_container(endpoint, ...)

# S3 method for blob_endpoint create_storage_container(endpoint, name, ...)

# S3 method for file_endpoint create_storage_container(endpoint, name, ...)

# S3 method for adls_endpoint create_storage_container(endpoint, name, ...)

# S3 method for storage_container create_storage_container(endpoint, ...)

# S3 method for character create_storage_container(endpoint, key = NULL, token = NULL, sas = NULL, ...)

delete_storage_container(endpoint, ...)

# S3 method for blob_endpoint delete_storage_container(endpoint, name, ...)

# S3 method for file_endpoint delete_storage_container(endpoint, name, ...)

# S3 method for adls_endpoint delete_storage_container(endpoint, name, ...)

# S3 method for storage_container delete_storage_container(endpoint, ...)

# S3 method for character delete_storage_container(endpoint, key = NULL, token = NULL, sas = NULL, confirm = TRUE, ...)

list_storage_containers(endpoint, ...)

# S3 method for blob_endpoint list_storage_containers(endpoint, ...)

# S3 method for file_endpoint list_storage_containers(endpoint, ...)

# S3 method for adls_endpoint list_storage_containers(endpoint, ...)

# S3 method for character list_storage_containers(endpoint, key = NULL, token = NULL, sas = NULL, ...)

list_storage_files(container, ...)

# S3 method for blob_container list_storage_files(container, ...)

# S3 method for file_share list_storage_files(container, ...)

# S3 method for adls_filesystem list_storage_files(container, ...)

create_storage_dir(container, ...)

# S3 method for blob_container create_storage_dir(container, ...)

# S3 method for file_share create_storage_dir(container, dir, ...)

# S3 method for adls_filesystem create_storage_dir(container, dir, ...)

delete_storage_dir(container, ...)

# S3 method for blob_container delete_storage_dir(container, ...)

# S3 method for file_share delete_storage_dir(container, dir, ...)

# S3 method for adls_filesystem delete_storage_dir(container, dir, confirm = TRUE, ...)

delete_storage_file(container, ...)

# S3 method for blob_container delete_storage_file(container, file, ...)

# S3 method for file_share delete_storage_file(container, file, ...)

# S3 method for adls_filesystem delete_storage_file(container, file, confirm = TRUE, ...)

Arguments

endpoint

A storage endpoint object, or for the character methods, a string giving the full URL to the container.

...

Further arguments to pass to lower-level functions.

name

For the storage container management methods, a container name.

key, token, sas

For the character methods, authentication credentials for the container: either an access key, an Azure Active Directory (AAD) token, or a SAS. If multiple arguments are supplied, a key takes priority over a token, which takes priority over a SAS.

confirm

For the deletion methods, whether to ask for confirmation first.

container

A storage container object.

file, dir

For the storage object management methods, a file or directory name.

Details

These methods provide a framework for all storage management tasks supported by AzureStor. They dispatch to the appropriate functions for each type of storage.

Storage container management methods:

  • storage_container dispatches to blob_container, file_share or adls_filesystem

  • create_storage_container dispatches to create_blob_container, create_file_share or create_adls_filesystem

  • delete_storage_container dispatches to delete_blob_container, delete_file_share or delete_adls_filesystem

  • list_storage_containers dispatches to list_blob_containers, list_file_shares or list_adls_filesystems

Storage object management methods:

  • list_storage_files dispatches to list_blobs, list_azure_files or list_adls_files

  • create_storage_dir dispatches to create_azure_dir or create_adls_dir; throws an error if passed a blob container

  • delete_storage_dir dispatches to delete_azure_dir or delete_adls_dir; throws an error if passed a blob container

  • delete_storage_file dispatches to delete_blob, delete_azure_file or delete_adls_file

See Also

storage_endpoint, blob_container, file_share, adls_filesystem

list_blobs, list_azure_files, list_adls_files

Similar generics exist for file transfer methods; see the page for storage_download.

Examples

Run this code
# NOT RUN {
# storage endpoints for the one account
bl <- storage_endpoint("https://mystorage.blob.core.windows.net/", key="access_key")
fl <- storage_endpoint("https://mystorage.file.core.windows.net/", key="access_key")

list_storage_containers(bl)
list_storage_containers(fl)

# creating containers
cont <- create_storage_container(bl, "newblobcontainer")
fs <- create_storage_container(fl, "newfileshare")

# creating directories (if possible)
create_storage_dir(cont, "newdir")  # will error out
create_storage_dir(fs, "newdir")

# transfer a file
storage_upload(bl, "~/file.txt", "storage_file.txt")
storage_upload(cont, "~/file.txt", "newdir/storage_file.txt")

# }

Run the code above in your browser using DataLab