AzureStor (version 2.0.1)

file_share: Operations on a file endpoint

Description

Get, list, create, or delete file shares.

Usage

file_share(endpoint, ...)

# S3 method for character file_share(endpoint, key = NULL, token = NULL, sas = NULL, api_version = getOption("azure_storage_api_version"), ...)

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

# S3 method for file_share print(x, ...)

list_file_shares(endpoint, ...)

# S3 method for character list_file_shares(endpoint, key = NULL, token = NULL, sas = NULL, api_version = getOption("azure_storage_api_version"), ...)

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

create_file_share(endpoint, ...)

# S3 method for character create_file_share(endpoint, key = NULL, token = NULL, sas = NULL, api_version = getOption("azure_storage_api_version"), ...)

# S3 method for file_share create_file_share(endpoint, ...)

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

delete_file_share(endpoint, ...)

# S3 method for character delete_file_share(endpoint, key = NULL, token = NULL, sas = NULL, api_version = getOption("azure_storage_api_version"), ...)

# S3 method for file_share delete_file_share(endpoint, ...)

# S3 method for file_endpoint delete_file_share(endpoint, name, confirm = TRUE, ...)

Arguments

endpoint

Either a file endpoint object as created by storage_endpoint, or a character string giving the URL of the endpoint.

...

Further arguments passed to lower-level functions.

key, token, sas

If an endpoint object is not supplied, authentication credentials: either an access key, an Azure Active Directory (AAD) token, or a SAS, in that order of priority.

api_version

If an endpoint object is not supplied, the storage API version to use when interacting with the host. Currently defaults to "2018-03-28".

name

The name of the file share to get, create, or delete.

x

For the print method, a file share object.

confirm

For deleting a share, whether to ask for confirmation.

Value

For file_share and create_file_share, an S3 object representing an existing or created share respectively.

For list_file_shares, a list of such objects.

Details

You can call these functions in a couple of ways: by passing the full URL of the share, or by passing the endpoint object and the name of the share as a string.

See Also

storage_endpoint, az_storage, storage_container

Examples

Run this code
# NOT RUN {
endp <- file_endpoint("https://mystorage.file.core.windows.net/", key="access_key")

# list file shares
list_file_shares(endp)

# get, create, and delete a file share
file_share(endp, "myshare")
create_file_share(endp, "newshare")
delete_file_share(endp, "newshare")

# alternative way to do the same
file_share("https://mystorage.file.file.windows.net/myshare", key="access_key")
create_file_share("https://mystorage.file.core.windows.net/newshare", key="access_key")
delete_file_share("https://mystorage.file.core.windows.net/newshare", key="access_key")

# }

Run the code above in your browser using DataCamp Workspace