| 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}.{endpoint_suffix}
api_client -> api_storage_client
.filesystemThe filesystem (container) name
api_storage_client$new()Create a new Azure Storage API client instance
api_storage_client$new(
storageaccount,
filesystem,
scope = default_azure_scope("azure_storage"),
endpoint_suffix = default_storage_endpoint(),
provider = NULL,
chain = NULL,
tenant_id = NULL,
client_id = default_azure_cli_client_id(),
...
)
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
Credential or DefaultCredential. If provided, chain is 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 chain is NULL.
client_idA character string specifying the Azure client ID. Passed to
DefaultCredential when chain is NULL. Defaults to
default_azure_cli_client_id().
...Additional arguments passed to the parent api_client constructor.
A new api_storage_client object
api_storage_client$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).
api_storage_client$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.
api_storage_client$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) with one row per file or
directory. Columns include name, contentLength, lastModified, etc.
All pages are fetched transparently; the result is the complete listing.
api_storage_client$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.