| api_storage_client | R Documentation |
An R6 class that extends api_client to provide specialized methods for Azure Data Lake Storage Gen2 (ADLS Gen2) REST API operations.
The base URL is constructed as:
https://{storageaccount}.dfs.core.windows.net
azr::api_client -> api_storage_client
.filesystemThe filesystem (container) name
new()Create a new Azure Storage API client instance
api_storage_client$new( storageaccount, filesystem, scopes = ".default", chain = NULL, tenant_id = NULL, ... )
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 chain is NULL.
...Additional arguments passed to the parent api_client constructor.
A new api_storage_client object
download_file()Download a file from the filesystem
api_storage_client$download_file(path, dest = NULL)
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().
The local path the file was written to (invisibly).
get_access_control()Get the access control list (ACL) for a file or directory
api_storage_client$get_access_control(dataset, upn = FALSE)
datasetA character string specifying the file or directory path within the filesystem.
upnA logical value. If TRUE, user principal names (UPN) are
returned in the x-ms-owner, x-ms-group, and x-ms-acl response
headers instead of object IDs. Defaults to FALSE.
A data.frame with columns group_id and permission, one row per
named group entry in the x-ms-acl response header.
list_files()List files and directories in a path
api_storage_client$list_files(path = "", recursive = FALSE, ...)
pathA character string specifying the directory path to list.
Use empty string or NULL for the root directory. Defaults to "".
recursiveA logical value indicating whether to list files recursively.
Defaults to FALSE.
...Additional query parameters to pass to the API.
A data.frame (or data.table if available) containing file and directory information with columns such as name, contentLength, lastModified, etc.
clone()The objects of this class are cloneable with this method.
api_storage_client$clone(deep = FALSE)
deepWhether to make a deep clone.
## Not run:
# 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)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.