Helper function to check existance of a resource group at location.

This commit is contained in:
Graham Williams 2017-02-24 15:23:46 +08:00
Родитель e8d0ab0452
Коммит 17075f543e
1 изменённых файлов: 20 добавлений и 0 удалений

20
R/existsRG.R Normal file
Просмотреть файл

@ -0,0 +1,20 @@
#' @title Check if a resource group exists.
#'
#' @param context Authentication context of AzureSMR encapsulating the
#' TID, CID, and key obtained from Azure Actrive Directory.
#' @param resource.group The Azure resource group where the DSVM is
#' created.
#' @param location Location of the data centre to host the DSVM.
#' @export
existsRG <- function(context, resource.group, location, verbose=TRUE)
{
context %>%
azureListRG() %>%
filter(name == RG) %>%
select(name, location) %T>%
{if (verbose) print(.)} %>%
nrow() %>%
equals(0) %>%
not() %T>%
{if (verbose) print(.)}
}