An R6 class that extends api_client to provide specialized methods for Azure Data Lake Storage Gen2 (ADLS Gen2) REST API operations.
Super class
azr::api_client -> api_storage_client
Methods
Method new()
Create a new Azure Storage API client instance
Usage
api_storage_client$new(
storageaccount,
filesystem,
scope = default_azure_scope("azure_storage"),
endpoint_suffix = default_storage_endpoint(),
provider = NULL,
chain = NULL,
tenant_id = NULL,
...
)Arguments
storageaccountA character string specifying the Azure Storage account name.
filesystemA character string specifying the filesystem (container) name.
scopeA character string specifying the OAuth2 scope. Defaults to
default_azure_scope("azure_storage").endpoint_suffixA character string specifying the Azure Storage DFS endpoint suffix. Defaults to
default_storage_endpoint().providerAn optional credential provider object that inherits from
CredentialorDefaultCredential. If provided,chainis ignored.chainA credential_chain instance for authentication. If NULL, a default credential chain will be created using DefaultCredential.
tenant_idA character string specifying the Azure tenant ID. Passed to DefaultCredential when
chainisNULL....Additional arguments passed to the parent api_client constructor.
Method download_file()
Download a file from the filesystem
Arguments
pathA character string specifying the file path within the filesystem.
destA character string specifying the local destination path. Defaults to a temporary file via
tempfile().
Method get_access_control()
Get the access control list (ACL) for a file or directory
Method list_files()
List files and directories in a path
Examples
if (FALSE) { # \dontrun{
# Create a storage client
storage <- api_storage_client$new(
storageaccount = "mystorageaccount",
filesystem = "mycontainer"
)
# List files in the root directory
files <- storage$list_files()
# List files in a specific path
files <- storage$list_files(path = "data/folder1")
# List files recursively
files <- storage$list_files(path = "data", recursive = TRUE)
} # }
