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,
scopes = ".default",
chain = NULL,
tenant_id = NULL,
...
)Arguments
storageaccountA character string specifying the Azure Storage account name.
filesystemA character string specifying the filesystem (container) name.
scopesA character string specifying the OAuth2 scope suffix. Defaults to
".default", which requests all permissions the app has been granted.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)
} # }