зеркало из https://github.com/Azure/AzureStor.git
add regen_key method
This commit is contained in:
Родитель
9f3a84cf2f
Коммит
ca5fb6b433
11
R/storage.R
11
R/storage.R
|
@ -6,12 +6,13 @@
|
|||
#' @section Methods:
|
||||
#' The following methods are available, in addition to those provided by the [AzureRMR::az_resource] class:
|
||||
#' - `new(...)`: Initialize a new storage object. See 'Initialization'.
|
||||
#' - `list_keys`: Return the access keys for this account.
|
||||
#' - `list_keys()`: Return the access keys for this account.
|
||||
#' - `get_account_sas(...)`: Return an account shared access signature (SAS). See 'Shared access signatures' for more details.
|
||||
#' - `get_blob_endpoint(key, sas)`: Return the account's blob storage endpoint, along with an access key and/or a SAS. See 'Endpoints' for more details
|
||||
#' - `get_file_endpoint(key, sas)`: Return the account's file storage endpoint.
|
||||
#' - `get_queue_endpoint(key, sas)`: Return the account's queue storage endpoint.
|
||||
#' - `get_table_endpoint(key, sas)`: Return the account's table storage endpoint.
|
||||
#' - `regen_key(key)`: Regenerates (creates a new value for) an access key. The argument `key` can be 1 or 2.
|
||||
#'
|
||||
#' @section Initialization:
|
||||
#' Initializing a new object of this class can either retrieve an existing storage account, or create a account on the host. Generally, the best way to initialize an object is via the `get_storage_account`, `create_storage_account` or `list_storage_accounts` methods of the [az_resource_group] class, which handle the details automatically.
|
||||
|
@ -87,6 +88,14 @@ public=list(
|
|||
file_endpoint(self$properties$primaryEndpoints$file, key=key, sas=sas)
|
||||
},
|
||||
|
||||
regen_key=function(key=1)
|
||||
{
|
||||
body <- list(keyName=paste0("key", key))
|
||||
keys <- self$do_operation("regenerateKey", body=body, encode="json", http_verb="POST")
|
||||
keys <- named_list(keys$keys, "keyName")
|
||||
sapply(keys, `[[`, "value")
|
||||
},
|
||||
|
||||
print=function(...)
|
||||
{
|
||||
cat("<Azure resource ", self$type, "/", self$name, ">\n", sep="")
|
||||
|
|
|
@ -16,12 +16,13 @@ Class representing a storage account, exposing methods for working with it.
|
|||
The following methods are available, in addition to those provided by the \link[AzureRMR:az_resource]{AzureRMR::az_resource} class:
|
||||
\itemize{
|
||||
\item \code{new(...)}: Initialize a new storage object. See 'Initialization'.
|
||||
\item \code{list_keys}: Return the access keys for this account.
|
||||
\item \code{list_keys()}: Return the access keys for this account.
|
||||
\item \code{get_account_sas(...)}: Return an account shared access signature (SAS). See 'Shared access signatures' for more details.
|
||||
\item \code{get_blob_endpoint(key, sas)}: Return the account's blob storage endpoint, along with an access key and/or a SAS. See 'Endpoints' for more details
|
||||
\item \code{get_file_endpoint(key, sas)}: Return the account's file storage endpoint.
|
||||
\item \code{get_queue_endpoint(key, sas)}: Return the account's queue storage endpoint.
|
||||
\item \code{get_table_endpoint(key, sas)}: Return the account's table storage endpoint.
|
||||
\item \code{regen_key(key)}: Regenerates (creates a new value for) an access key. The argument \code{key} can be 1 or 2.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче