diff --git a/DESCRIPTION b/DESCRIPTION index a8cd5cc..983c286 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -32,4 +32,4 @@ Suggests: testthat VignetteBuilder: knitr LazyData: TRUE -RoxygenNote: 5.0.1 +RoxygenNote: 6.0.0 diff --git a/NAMESPACE b/NAMESPACE index f8fe871..52ef64c 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -2,6 +2,7 @@ S3method(print,azureActiveContext) S3method(str,azureActiveContext) +export(AzureListRG) export(as.azureActiveContext) export(azureAuthenticate) export(azureBlobCD) @@ -30,6 +31,9 @@ export(azureListAllResources) export(azureListHDI) export(azureListRG) export(azureListSA) +export(azureListScaleSetNetwork) +export(azureListScaleSetVM) +export(azureListScaleSets) export(azureListStorageBlobs) export(azureListStorageContainers) export(azureListSubscriptions) diff --git a/R/AzureAuthenticate.R b/R/AzureAuthenticate.R index 873f435..f2da2a1 100644 --- a/R/AzureAuthenticate.R +++ b/R/AzureAuthenticate.R @@ -35,8 +35,10 @@ azureAuthenticate <- function(azureActiveContext, tenantID, clientID, authKey, v URLGT <- paste0("https://login.microsoftonline.com/", AtenantID, "/oauth2/token?api-version=1.0") + AauthKeyE <- URLencode(AauthKey, reserved = TRUE) + bodyGT <- paste0("grant_type=client_credentials&resource=https%3A%2F%2Fmanagement.azure.com%2F&client_id=", - AclientID, "&client_secret=", AauthKey) + AclientID, "&client_secret=", AauthKeyE) r <- httr::POST(URLGT, add_headers( diff --git a/R/AzureHDI.R b/R/AzureHDI.R index a71ac71..d5c74a7 100644 --- a/R/AzureHDI.R +++ b/R/AzureHDI.R @@ -373,6 +373,7 @@ azureDeleteHDI <- function(azureActiveContext, clustername, azToken, subscriptio #' #' #' @param version HDinsight version +#' @param kind HDinsight kind: "hadoop","spark" or "rserver" #' @param adminUser Admin user name #' @param adminPassword Admin user password #' @param workers Define the number of worker nodes @@ -383,6 +384,7 @@ azureDeleteHDI <- function(azureActiveContext, clustername, azToken, subscriptio #' @param hiveUser Hive user name #' @param hivePassword Hive user password #' @param componentVersion Spark componentVersion. Default : 1.6.2 +#' @param vmSize Size of nodes: "Large", "Small", "Standard_D14_V2", etc. #' @param mode Provisioning mode, "Sync" or "Async". Use "Async" to immediately return to R session after submission of request #' #' @return Success message @@ -393,6 +395,7 @@ azureDeleteHDI <- function(azureActiveContext, clustername, azToken, subscriptio azureCreateHDI <- function(azureActiveContext, clustername, location, kind = "spark", storageAccount, storageKey, version = "3.4", componentVersion="1.6.2", workers = 2, adminUser, adminPassword, sshUser, sshPassword, hiveServer, hiveDB, hiveUser, hivePassword, resourceGroup, + vmSize = "Large", azToken, subscriptionID, mode = "Sync", verbose = FALSE) { azureCheckToken(azureActiveContext) @@ -470,7 +473,7 @@ azureCreateHDI <- function(azureActiveContext, clustername, location, kind = "sp "location": "LLLLLLLLLLL", "tags": { "tag1": "value1", "tag2": "value2" }, "properties": { - "clusterversion": "VVVV", + "clusterVersion": "VVVV", "osType": "Linux", "tier": "standard", "clusterDefinition": { @@ -485,7 +488,8 @@ azureCreateHDI <- function(azureActiveContext, clustername, location, kind = "sp "core-site": { "fs.defaultFS": "wasb://CCCCCC@TTTTTTTTTTT.blob.core.windows.net", "fs.azure.account.key.TTTTTTTTTTT.blob.core.windows.net": "KKKKKKKKKKKKKKKK" - } + }, + YYYYYYYYYYYYYY, HHHHHHHHHHHHHH }}, "computeProfile": { @@ -494,7 +498,19 @@ azureCreateHDI <- function(azureActiveContext, clustername, location, kind = "sp "name": "headnode", "targetInstanceCount": 2, "hardwareProfile": { - "vmsize": "Large" + "vmsize": "ZZZZZZ" + }, + "osProfile": { + "linuxOperatingSystemProfile": { + "username": "UUUUUUUUU", + "password": "PPPPPPPPP" + }}}, + { + "name": "edgenode", + "minInstanceCount": 1, + "targetInstanceCount": 1, + "hardwareProfile": { + "vmSize": "ZZZZZZ" }, "osProfile": { "linuxOperatingSystemProfile": { @@ -505,7 +521,7 @@ azureCreateHDI <- function(azureActiveContext, clustername, location, kind = "sp "name": "workernode", "targetInstanceCount": WWWWWW, "hardwareProfile": { - "vmsize": "Large" + "vmsize": "ZZZZZZ" }, "osProfile": { "linuxOperatingSystemProfile": { @@ -543,7 +559,15 @@ azureCreateHDI <- function(azureActiveContext, clustername, location, kind = "sp "hive_existing_mssql_server_host": "SSSSSSSSSS", "hive_hostname": "SSSSSSSSSS" }' - + + rserver <- (kind == "rserver") + + if (rserver) { + bodyI <- gsub("YYYYYYYYYYYYYY", "\"rserver\": {\"rstudio\": true}\n", bodyI) + } else { + bodyI <- gsub("YYYYYYYYYYYYYY", "", bodyI) + } + bodyI <- gsub("CCCCCC", clustername, bodyI) bodyI <- gsub("UUUUUUUUU", sshUser, bodyI) bodyI <- gsub("PPPPPPPPP", sshPassword, bodyI) @@ -555,7 +579,8 @@ azureCreateHDI <- function(azureActiveContext, clustername, location, kind = "sp bodyI <- gsub("TTTTTTTTTTT", storageAccount, bodyI) bodyI <- gsub("KKKKKKKKKKKKKKKK", storageKey, bodyI) bodyI <- gsub("DDDDDDDDD", kind, bodyI) - bodyI <- gsub("VVVV", version, bodyI) + bodyI <- gsub("VVVV", componentVersion, bodyI) + bodyI <- gsub("ZZZZZZ", vmSize, bodyI) if (HIVE) { HIVEJSON <- gsub("SSSSSSSSSS", hiveServer, HIVEJSON) HIVEJSON <- gsub("DDDDDDDDDD", hiveDB, HIVEJSON) diff --git a/R/AzureResources.R b/R/AzureResources.R index bd7fd31..ea54a06 100644 --- a/R/AzureResources.R +++ b/R/AzureResources.R @@ -79,6 +79,11 @@ azureListRG <- function(azureActiveContext, subscriptionID, azToken, verbose = F } +#' @rdname azureListRG +#' @export +AzureListRG <- azureListRG + + #' Get all Resource in default Subscription. #' #' @inheritParams setAzureContext diff --git a/R/AzureTemplate.R b/R/AzureTemplate.R index 01a4e70..59cc544 100644 --- a/R/AzureTemplate.R +++ b/R/AzureTemplate.R @@ -82,12 +82,16 @@ azureDeployTemplate <- function(azureActiveContext, deplname, templateURL, r <- PUT(URL, add_headers(.headers = c(Host = "management.azure.com", Authorization = AT, `Content-type` = "application/json")), body = bodyI, verbosity) + + rl <- content(r, "text", encoding = "UTF-8") + if (verbose == TRUE && status_code(r) != 200 && status_code(r) != 201 && status_code(r) != + 202) print (rl) + # print(paste(deplname,'Submitted')) if (status_code(r) != 200 && status_code(r) != 201 && status_code(r) != 202) { stopWithAzureError(r) } - rl <- content(r, "text", encoding = "UTF-8") # print (rl) df <- fromJSON(rl) if (toupper(mode) == "SYNC") { @@ -103,7 +107,7 @@ azureDeployTemplate <- function(azureActiveContext, deplname, templateURL, writeLines(paste("Finished Deploying Sucessfully: ", Sys.time())) (break)() } - if (grepl("Error", rc)) { + if (grepl("Error", rc) || grepl("Failed", rc)) { writeLines("") writeLines(paste("Error Deploying: ", Sys.time())) (break)() @@ -130,7 +134,7 @@ azureDeployTemplate <- function(azureActiveContext, deplname, templateURL, } } writeLines(paste("Deployment", deplname, "Submitted: ", Sys.time())) - return("OK") + return(TRUE) } diff --git a/R/AzureVM.R b/R/AzureVM.R index ccbf5d2..c2f0e1a 100644 --- a/R/AzureVM.R +++ b/R/AzureVM.R @@ -441,3 +441,250 @@ azureDeleteVM <- function(azureActiveContext, resourceGroup, vmName, subscriptio writeLines(paste("Finished: ", Sys.time())) return(rc) } + +#' List scale sets within a resource group. +#' +#' @inheritParams setAzureContext +#' @inheritParams azureListAllResources +#' +#' @family Virtual machine functions +#' @export +azureListScaleSets <- function(azureActiveContext, resourceGroup, location, subscriptionID, + azToken, verbose = FALSE) { + azureCheckToken(azureActiveContext) + if (missing(azToken)) { + AT <- azureActiveContext$Token + } else (AT <- azToken) + if (missing(subscriptionID)) { + SUBIDI <- azureActiveContext$subscriptionID + } else (SUBIDI <- subscriptionID) + if (missing(resourceGroup)) { + RGI <- azureActiveContext$resourceGroup + } else (RGI <- resourceGroup) + verbosity <- if (verbose) + httr::verbose(TRUE) else NULL + + if (!length(RGI)) { + stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") + } + if (!length(SUBIDI)) { + stop("Error: No subscriptionID provided: Use SUBID argument or set in AzureContext") + } + if (!length(AT)) { + stop("Error: No Token / Not currently Authenticated") + } + + URL <- paste("https://management.azure.com/subscriptions/", SUBIDI, + "/resourceGroups/", RGI, "/providers/Microsoft.Compute/virtualMachineScaleSets?api-version=2016-03-30", + sep = "") + + r <- GET(URL, add_headers(.headers = c(Host = "management.azure.com", + Authorization = AT, `Content-type` = "application/json")), verbosity) + rl <- content(r, "text", encoding = "UTF-8") + df <- fromJSON(rl) + dfn <- as.data.frame(df$value$name) + clust <- nrow(dfn) + if (clust < 1) { + dfn[1:clust, 1] <- "" + dfn[1:clust, 2] <- "" + dfn[1:clust, 3] <- "" + dfn[1:clust, 4] <- "" + dfn[1:clust, 5] <- "" + dfn[1:clust, 6] <- "" + dfn[1:clust, 7] <- "" + colnames(dfn) <- c("name", "location", "Skuname", "skutier", "capacity", "image", + "ver") + print("No Virtual Machines scalesets found") + return(dfn[-1,]) + } + dfn[1:clust, 1] <- df$value$name + dfn[1:clust, 2] <- df$value$location + dfn[1:clust, 3] <- df$value$sku$name + dfn[1:clust, 4] <- df$value$sku$tier + dfn[1:clust, 5] <- df$value$sku$capacity + dfn[1:clust, 6] <- df$value$properties$virtualMachineProfile$storageProfile$imageReference$offer + dfn[1:clust, 7] <- df$value$properties$virtualMachineProfile$storageProfile$imageReference$sku + + colnames(dfn) <- c("name", "location", "Skuname", "skutier", "capacity", "image", + "ver") + azureActiveContext$subscriptionID <- SUBIDI + azureActiveContext$resourceGroup <- RGI + + return(dfn) +} + +#' List scale set network information with a ResourceGroup +#' +#' @inheritParams setAzureContext +#' @inheritParams azureListAllResources +#' +#' @family Virtual machine functions +#' @export +azureListScaleSetNetwork <- function(azureActiveContext,resourceGroup, location, subscriptionID, + azToken, verbose = FALSE) { + azureCheckToken(azureActiveContext) + if (missing(azToken)) { + AT <- azureActiveContext$Token + } else (AT <- azToken) + if (missing(subscriptionID)) { + SUBIDI <- azureActiveContext$subscriptionID + } else (SUBIDI <- subscriptionID) + if (missing(resourceGroup)) { + RGI <- azureActiveContext$resourceGroup + } else (RGI <- resourceGroup) + verbosity <- if (verbose) + httr::verbose(TRUE) else NULL + + if (!length(RGI)) { + stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") + } + if (!length(SUBIDI)) { + stop("Error: No subscriptionID provided: Use SUBID argument or set in AzureContext") + } + if (!length(AT)) { + stop("Error: No Token / Not currently Authenticated") + } + + URL <- paste("https://management.azure.com/subscriptions/", SUBIDI, + "/resourceGroups/", RGI, "/providers/Microsoft.Network/loadBalancers/","?api-version=2016-03-30", + sep = "") + + r <- GET(URL, add_headers(.headers = c(Host = "management.azure.com", + Authorization = AT, `Content-type` = "application/json")), verbosity) + rl <- content(r, "text", encoding = "UTF-8") + df <- fromJSON(rl) + lbs <- df$value$name + dfn <- data.frame(lbname="",publicIpAdress="",inport="",outport="") + clust <- length(lbs) + if (clust > 0) + { + for (lb in lbs) + { + URL <- paste("https://management.azure.com/subscriptions/", SUBIDI, + "/resourceGroups/", RGI, "/providers/Microsoft.Network/loadBalancers/",lb,"?api-version=2016-03-30", + sep = "") + r <- GET(URL, add_headers(.headers = c(Host = "management.azure.com", + Authorization = AT, `Content-type` = "application/json")), verbosity) + rl <- content(r, "text", encoding = "UTF-8") + df2 <- fromJSON(rl) + dfn3 <- as.data.frame(df2$properties$inboundNatRules$name) + clust2 <- nrow(dfn3) + if (clust2 > 0) { + dfn3[1:clust2, 2] <- "" + dfn3[1:clust2, 3] <- "" + dfn3[1:clust2, 4] <- df2$properties$inboundNatRules$properties$frontendPort + dfn3[1:clust2, 5] <- df2$properties$inboundNatRules$properties$backendPort + } + if (nrow(dfn) == 1) + dfn <- dfn3 + else + dfn <- rbind(dfn, dfn3) + } + colnames(dfn) <- c("lbname","domainName","publicIP", "inPort", "outPort") + } + + URL <- paste("https://management.azure.com/subscriptions/", SUBIDI, + "/resourceGroups/", RGI, "/providers/Microsoft.Network/publicIPAddresses","?api-version=2016-03-30", + sep = "") + + r <- GET(URL, add_headers(.headers = c(Host = "management.azure.com", + Authorization = AT, `Content-type` = "application/json")), verbosity) + rl <- content(r, "text", encoding = "UTF-8") + df <- fromJSON(rl) + pips <- df$value$name + clust <- length(lbs) + + if (clust > 0) + { + for (pip in pips) + { + URL <- paste("https://management.azure.com/subscriptions/", SUBIDI, + "/resourceGroups/", RGI, "/providers/Microsoft.Network/publicIPAddresses/",pip,"?api-version=2016-03-30", + sep = "") + r <- GET(URL, add_headers(.headers = c(Host = "management.azure.com", + Authorization = AT, `Content-type` = "application/json")), verbosity) + rl <- content(r, "text", encoding = "UTF-8") + df2 <- fromJSON(rl) + clust <- nrow(dfn) + clust2 <- length(df2$properties$ipAddress) + if (clust2 > 0) { + dfn[1:clust, 2] <- df2$properties$dnsSettings$fqdn + dfn[1:clust, 3] <- df2$properties$ipAddress + } + } + } + + azureActiveContext$subscriptionID <- SUBIDI + azureActiveContext$resourceGroup <- RGI + + return(dfn) +} + +#' List VMs within a scale set +#' +#' @inheritParams setAzureContext +#' @inheritParams azureListAllResources +#' @param scaleSet name of the scale refer to (azureListScaleSets) +#' +#' @family Virtual machine functions +#' @export +azureListScaleSetVM <- function(azureActiveContext, scaleSet, resourceGroup, location, subscriptionID, + azToken, verbose = FALSE) { + azureCheckToken(azureActiveContext) + if (missing(azToken)) { + AT <- azureActiveContext$Token + } else (AT <- azToken) + if (missing(subscriptionID)) { + SUBIDI <- azureActiveContext$subscriptionID + } else (SUBIDI <- subscriptionID) + if (missing(resourceGroup)) { + RGI <- azureActiveContext$resourceGroup + } else (RGI <- resourceGroup) + verbosity <- if (verbose) + httr::verbose(TRUE) else NULL + + if (!length(RGI)) { + stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") + } + if (!length(scaleSet)) { + stop("Error: No scaleSet provided") + } + if (!length(SUBIDI)) { + stop("Error: No subscriptionID provided: Use SUBID argument or set in AzureContext") + } + if (!length(AT)) { + stop("Error: No Token / Not currently Authenticated") + } + + + URL <- paste("https://management.azure.com/subscriptions/", SUBIDI, + "/resourceGroups/", RGI, "/providers/Microsoft.Compute/virtualMachineScaleSets/",scaleSet,"/virtualMachines?api-version=2016-03-30", + sep = "") + + r <- GET(URL, add_headers(.headers = c(Host = "management.azure.com", + Authorization = AT, `Content-type` = "application/json")), verbosity) + rl <- content(r, "text", encoding = "UTF-8") + df <- fromJSON(rl) + dfn <- as.data.frame(df$value$name) + clust <- nrow(dfn) + if (clust < 1) { + dfn[1:clust, 1] <- "" + dfn[1:clust, 2] <- "" + dfn[1:clust, 3] <- "" + dfn[1:clust, 4] <- "" + colnames(dfn) <- c("name","id", "computerName", "state") + print("No Virtual Machines scalesets found") + return(dfn[-1,]) + } + dfn[1:clust, 1] <- df$value$name + dfn[1:clust, 2] <- df$value$instanceId + dfn[1:clust, 3] <- df$value$properties$osProfile$computerName + dfn[1:clust, 4] <- df$value$properties$provisioningState + + colnames(dfn) <- c("name","id", "computerName", "state") + azureActiveContext$subscriptionID <- SUBIDI + azureActiveContext$resourceGroup <- RGI + + return(dfn) +} + diff --git a/R/internal.R b/R/internal.R index 423d3dc..c35c3a6 100644 --- a/R/internal.R +++ b/R/internal.R @@ -33,8 +33,8 @@ stopWithAzureError <- function(r){ msg <- addToMsg(rr$Message) } else { rr <- content(r) - msg <- addToMsg(rr$error$code) - msg <- addToMsg(rr$error$message) + msg <- addToMsg(rr$code) + msg <- addToMsg(rr$message) } msg <- addToMsg(paste0("Return code: ", status_code(r))) stop(msg, call. = FALSE) diff --git a/man/AzureSMR-package.Rd b/man/AzureSMR-package.Rd index 291bd5b..d9df671 100644 --- a/man/AzureSMR-package.Rd +++ b/man/AzureSMR-package.Rd @@ -2,8 +2,8 @@ % Please edit documentation in R/AzureSM-package.R \docType{package} \name{AzureSMR-package} -\alias{AzureSMR} \alias{AzureSMR-package} +\alias{AzureSMR} \title{AzureSMR} \description{ The AzureSMR package connects R to the Azure Service Manager API. @@ -19,4 +19,3 @@ This enables you to use and change many Azure resources, including: } } \keyword{package} - diff --git a/man/Internal.Rd b/man/Internal.Rd index 7426d7c..9d924ac 100644 --- a/man/Internal.Rd +++ b/man/Internal.Rd @@ -28,4 +28,3 @@ Functions for creating and displaying information about azureActiveContext objec \seealso{ \code{\link{createAzureContext}} } - diff --git a/man/azureAuthenticate.Rd b/man/azureAuthenticate.Rd index 913fe86..f238ddf 100644 --- a/man/azureAuthenticate.Rd +++ b/man/azureAuthenticate.Rd @@ -33,4 +33,3 @@ See \url{https://azure.microsoft.com/en-us/documentation/articles/resource-group \seealso{ Other Resources: \code{\link{azureCheckToken}} } - diff --git a/man/azureBlobCD.Rd b/man/azureBlobCD.Rd index d72c15d..c0f486a 100644 --- a/man/azureBlobCD.Rd +++ b/man/azureBlobCD.Rd @@ -38,4 +38,3 @@ Other blob store functions: \code{\link{azureBlobFind}}, \code{\link{azureListStorageBlobs}}, \code{\link{azurePutBlob}} } - diff --git a/man/azureBlobFind.Rd b/man/azureBlobFind.Rd index c281234..7033cad 100644 --- a/man/azureBlobFind.Rd +++ b/man/azureBlobFind.Rd @@ -36,4 +36,3 @@ Other blob store functions: \code{\link{azureBlobCD}}, \code{\link{azureListStorageBlobs}}, \code{\link{azurePutBlob}} } - diff --git a/man/azureBlobLS.Rd b/man/azureBlobLS.Rd index 13a7beb..f9e80d2 100644 --- a/man/azureBlobLS.Rd +++ b/man/azureBlobLS.Rd @@ -40,4 +40,3 @@ Other blob store functions: \code{\link{azureBlobCD}}, \code{\link{azureListStorageBlobs}}, \code{\link{azurePutBlob}} } - diff --git a/man/azureCancelDeploy.Rd b/man/azureCancelDeploy.Rd index 332e5a7..c5678b0 100644 --- a/man/azureCancelDeploy.Rd +++ b/man/azureCancelDeploy.Rd @@ -28,4 +28,3 @@ Other Template functions: \code{\link{azureDeleteDeploy}}, \code{\link{azureDeployStatus}}, \code{\link{azureDeployTemplate}} } - diff --git a/man/azureCheckToken.Rd b/man/azureCheckToken.Rd index dc0d411..6ea6407 100644 --- a/man/azureCheckToken.Rd +++ b/man/azureCheckToken.Rd @@ -15,4 +15,3 @@ Check the timestamp of a Token and Renew if needed. \seealso{ Other Resources: \code{\link{azureAuthenticate}} } - diff --git a/man/azureCreateHDI.Rd b/man/azureCreateHDI.Rd index 9b44066..83b26b5 100644 --- a/man/azureCreateHDI.Rd +++ b/man/azureCreateHDI.Rd @@ -7,8 +7,8 @@ azureCreateHDI(azureActiveContext, clustername, location, kind = "spark", storageAccount, storageKey, version = "3.4", componentVersion = "1.6.2", workers = 2, adminUser, adminPassword, sshUser, sshPassword, hiveServer, - hiveDB, hiveUser, hivePassword, resourceGroup, azToken, subscriptionID, - mode = "Sync", verbose = FALSE) + hiveDB, hiveUser, hivePassword, resourceGroup, vmSize = "Large", azToken, + subscriptionID, mode = "Sync", verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} @@ -17,7 +17,7 @@ azureCreateHDI(azureActiveContext, clustername, location, kind = "spark", \item{location}{Azure region, e.g. 'westeurope' or 'southcentralus'} -\item{kind}{HDinsight kind: "hadoop","spark" or "pyspark"} +\item{kind}{HDinsight kind: "hadoop","spark" or "rserver"} \item{storageAccount}{Name of the azure storage account} @@ -47,6 +47,8 @@ azureCreateHDI(azureActiveContext, clustername, location, kind = "spark", \item{resourceGroup}{Name of the resource group} +\item{vmSize}{Size of nodes: "Large", "Small", "Standard_D14_V2", etc.} + \item{azToken}{Azure authentication token, obtained by \code{\link{azureAuthenticate}}} \item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link{azureAuthenticate}} when only a single subscriptionID is available via Active Directory} @@ -71,4 +73,3 @@ Other HDInsight functions: \code{\link{azureDeleteHDI}}, \code{\link{azureRunScriptAction}}, \code{\link{azureScriptActionHistory}} } - diff --git a/man/azureCreateResourceGroup.Rd b/man/azureCreateResourceGroup.Rd index 6afa01b..cd96a6d 100644 --- a/man/azureCreateResourceGroup.Rd +++ b/man/azureCreateResourceGroup.Rd @@ -32,4 +32,3 @@ Other Resource group functions: \code{\link{azureDeleteResourceGroup}}, \code{\link{azureListRG}}, \code{\link{azureListSubscriptions}} } - diff --git a/man/azureCreateStorageAccount.Rd b/man/azureCreateStorageAccount.Rd index 932b8bc..0afa9cc 100644 --- a/man/azureCreateStorageAccount.Rd +++ b/man/azureCreateStorageAccount.Rd @@ -27,4 +27,3 @@ Create an Azure Storage Account. Other Storage account functions: \code{\link{azureDeletestorageAccount}}, \code{\link{azureListSA}}, \code{\link{azureSAGetKey}} } - diff --git a/man/azureCreateStorageContainer.Rd b/man/azureCreateStorageContainer.Rd index ecf453a..287737a 100644 --- a/man/azureCreateStorageContainer.Rd +++ b/man/azureCreateStorageContainer.Rd @@ -31,4 +31,3 @@ Create Storage containers in a specified Storage Account. Other container functions: \code{\link{azureDeleteStorageContainer}}, \code{\link{azureListStorageContainers}} } - diff --git a/man/azureDeleteBlob.Rd b/man/azureDeleteBlob.Rd index f984073..9a5479d 100644 --- a/man/azureDeleteBlob.Rd +++ b/man/azureDeleteBlob.Rd @@ -38,4 +38,3 @@ Other blob store functions: \code{\link{azureBlobCD}}, \code{\link{azureListStorageBlobs}}, \code{\link{azurePutBlob}} } - diff --git a/man/azureDeleteDeploy.Rd b/man/azureDeleteDeploy.Rd index 8268aff..0e7e960 100644 --- a/man/azureDeleteDeploy.Rd +++ b/man/azureDeleteDeploy.Rd @@ -28,4 +28,3 @@ Other Template functions: \code{\link{azureCancelDeploy}}, \code{\link{azureDeployStatus}}, \code{\link{azureDeployTemplate}} } - diff --git a/man/azureDeleteHDI.Rd b/man/azureDeleteHDI.Rd index a699625..c8b4403 100644 --- a/man/azureDeleteHDI.Rd +++ b/man/azureDeleteHDI.Rd @@ -33,4 +33,3 @@ Other HDInsight functions: \code{\link{azureCreateHDI}}, \code{\link{azureRunScriptAction}}, \code{\link{azureScriptActionHistory}} } - diff --git a/man/azureDeleteResourceGroup.Rd b/man/azureDeleteResourceGroup.Rd index aa86765..9128441 100644 --- a/man/azureDeleteResourceGroup.Rd +++ b/man/azureDeleteResourceGroup.Rd @@ -32,4 +32,3 @@ Other Resource group functions: \code{\link{azureCreateResourceGroup}}, \code{\link{azureListRG}}, \code{\link{azureListSubscriptions}} } - diff --git a/man/azureDeleteStorageContainer.Rd b/man/azureDeleteStorageContainer.Rd index 9f01276..44ee610 100644 --- a/man/azureDeleteStorageContainer.Rd +++ b/man/azureDeleteStorageContainer.Rd @@ -31,4 +31,3 @@ Delete Storage container in a specified Storage Account. Other container functions: \code{\link{azureCreateStorageContainer}}, \code{\link{azureListStorageContainers}} } - diff --git a/man/azureDeleteVM.Rd b/man/azureDeleteVM.Rd index 3bed4b8..6e1e908 100644 --- a/man/azureDeleteVM.Rd +++ b/man/azureDeleteVM.Rd @@ -26,8 +26,9 @@ azureDeleteVM(azureActiveContext, resourceGroup, vmName, subscriptionID, Delete a Virtual Machine. } \seealso{ -Other Virtual machine functions: \code{\link{azureListVM}}, - \code{\link{azureStartVM}}, \code{\link{azureStopVM}}, - \code{\link{azureVMStatus}} +Other Virtual machine functions: \code{\link{azureListScaleSetNetwork}}, + \code{\link{azureListScaleSetVM}}, + \code{\link{azureListScaleSets}}, + \code{\link{azureListVM}}, \code{\link{azureStartVM}}, + \code{\link{azureStopVM}}, \code{\link{azureVMStatus}} } - diff --git a/man/azureDeletestorageAccount.Rd b/man/azureDeletestorageAccount.Rd index 36bf8e0..7a9483b 100644 --- a/man/azureDeletestorageAccount.Rd +++ b/man/azureDeletestorageAccount.Rd @@ -27,4 +27,3 @@ Delete an Azure Storage Account. Other Storage account functions: \code{\link{azureCreateStorageAccount}}, \code{\link{azureListSA}}, \code{\link{azureSAGetKey}} } - diff --git a/man/azureDeployStatus.Rd b/man/azureDeployStatus.Rd index 5325c39..46121f8 100644 --- a/man/azureDeployStatus.Rd +++ b/man/azureDeployStatus.Rd @@ -28,4 +28,3 @@ Other Template functions: \code{\link{azureCancelDeploy}}, \code{\link{azureDeleteDeploy}}, \code{\link{azureDeployTemplate}} } - diff --git a/man/azureDeployTemplate.Rd b/man/azureDeployTemplate.Rd index 683f79f..1aac49b 100644 --- a/man/azureDeployTemplate.Rd +++ b/man/azureDeployTemplate.Rd @@ -39,4 +39,3 @@ Other Template functions: \code{\link{azureCancelDeploy}}, \code{\link{azureDeleteDeploy}}, \code{\link{azureDeployStatus}} } - diff --git a/man/azureGetBlob.Rd b/man/azureGetBlob.Rd index 49aeef9..91698a6 100644 --- a/man/azureGetBlob.Rd +++ b/man/azureGetBlob.Rd @@ -41,4 +41,3 @@ Other blob store functions: \code{\link{azureBlobCD}}, \code{\link{azureListStorageBlobs}}, \code{\link{azurePutBlob}} } - diff --git a/man/azureHDIConf.Rd b/man/azureHDIConf.Rd index d00db93..1e86bd1 100644 --- a/man/azureHDIConf.Rd +++ b/man/azureHDIConf.Rd @@ -39,4 +39,3 @@ Other HDInsight functions: \code{\link{azureCreateHDI}}, \code{\link{azureRunScriptAction}}, \code{\link{azureScriptActionHistory}} } - diff --git a/man/azureHiveSQL.Rd b/man/azureHiveSQL.Rd index 549a817..bd5a81f 100644 --- a/man/azureHiveSQL.Rd +++ b/man/azureHiveSQL.Rd @@ -28,4 +28,3 @@ Submit SQL command to Hive Service. \seealso{ Other Hive functions: \code{\link{azureHiveStatus}} } - diff --git a/man/azureHiveStatus.Rd b/man/azureHiveStatus.Rd index 09c7205..842a874 100644 --- a/man/azureHiveStatus.Rd +++ b/man/azureHiveStatus.Rd @@ -24,4 +24,3 @@ Get Status of a HDI Hive Service/version. \seealso{ Other Hive functions: \code{\link{azureHiveSQL}} } - diff --git a/man/azureListAllResources.Rd b/man/azureListAllResources.Rd index 60ea35e..4df16b8 100644 --- a/man/azureListAllResources.Rd +++ b/man/azureListAllResources.Rd @@ -36,4 +36,3 @@ Other Resource group functions: \code{\link{azureCreateResourceGroup}}, \code{\link{azureListRG}}, \code{\link{azureListSubscriptions}} } - diff --git a/man/azureListHDI.Rd b/man/azureListHDI.Rd index 22ecdd6..c0fedea 100644 --- a/man/azureListHDI.Rd +++ b/man/azureListHDI.Rd @@ -39,4 +39,3 @@ Other HDInsight functions: \code{\link{azureCreateHDI}}, \code{\link{azureRunScriptAction}}, \code{\link{azureScriptActionHistory}} } - diff --git a/man/azureListRG.Rd b/man/azureListRG.Rd index 4c0e8ab..0ee597b 100644 --- a/man/azureListRG.Rd +++ b/man/azureListRG.Rd @@ -2,9 +2,12 @@ % Please edit documentation in R/AzureResources.R \name{azureListRG} \alias{azureListRG} +\alias{AzureListRG} \title{Get all resource groups in subscription ID.} \usage{ azureListRG(azureActiveContext, subscriptionID, azToken, verbose = FALSE) + +AzureListRG(azureActiveContext, subscriptionID, azToken, verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} @@ -27,4 +30,3 @@ Other Resource group functions: \code{\link{azureCreateResourceGroup}}, \code{\link{azureListAllResources}}, \code{\link{azureListSubscriptions}} } - diff --git a/man/azureListSA.Rd b/man/azureListSA.Rd index a887fff..9570db0 100644 --- a/man/azureListSA.Rd +++ b/man/azureListSA.Rd @@ -26,4 +26,3 @@ Other Storage account functions: \code{\link{azureCreateStorageAccount}}, \code{\link{azureDeletestorageAccount}}, \code{\link{azureSAGetKey}} } - diff --git a/man/azureListScaleSetNetwork.Rd b/man/azureListScaleSetNetwork.Rd new file mode 100644 index 0000000..c5cec73 --- /dev/null +++ b/man/azureListScaleSetNetwork.Rd @@ -0,0 +1,32 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/AzureVM.R +\name{azureListScaleSetNetwork} +\alias{azureListScaleSetNetwork} +\title{List scale set network information with a ResourceGroup} +\usage{ +azureListScaleSetNetwork(azureActiveContext, resourceGroup, location, + subscriptionID, azToken, verbose = FALSE) +} +\arguments{ +\item{azureActiveContext}{A container used for caching variables used by AzureSMR} + +\item{resourceGroup}{Name of the resource group} + +\item{location}{Azure region, e.g. 'westeurope' or 'southcentralus'} + +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link{azureAuthenticate}} when only a single subscriptionID is available via Active Directory} + +\item{azToken}{Azure authentication token, obtained by \code{\link{azureAuthenticate}}} + +\item{verbose}{Print Tracing information (Default False)} +} +\description{ +List scale set network information with a ResourceGroup +} +\seealso{ +Other Virtual machine functions: \code{\link{azureDeleteVM}}, + \code{\link{azureListScaleSetVM}}, + \code{\link{azureListScaleSets}}, + \code{\link{azureListVM}}, \code{\link{azureStartVM}}, + \code{\link{azureStopVM}}, \code{\link{azureVMStatus}} +} diff --git a/man/azureListScaleSetVM.Rd b/man/azureListScaleSetVM.Rd new file mode 100644 index 0000000..3c8ea75 --- /dev/null +++ b/man/azureListScaleSetVM.Rd @@ -0,0 +1,34 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/AzureVM.R +\name{azureListScaleSetVM} +\alias{azureListScaleSetVM} +\title{List VMs within a scale set} +\usage{ +azureListScaleSetVM(azureActiveContext, scaleSet, resourceGroup, location, + subscriptionID, azToken, verbose = FALSE) +} +\arguments{ +\item{azureActiveContext}{A container used for caching variables used by AzureSMR} + +\item{scaleSet}{name of the scale refer to (azureListScaleSets)} + +\item{resourceGroup}{Name of the resource group} + +\item{location}{Azure region, e.g. 'westeurope' or 'southcentralus'} + +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link{azureAuthenticate}} when only a single subscriptionID is available via Active Directory} + +\item{azToken}{Azure authentication token, obtained by \code{\link{azureAuthenticate}}} + +\item{verbose}{Print Tracing information (Default False)} +} +\description{ +List VMs within a scale set +} +\seealso{ +Other Virtual machine functions: \code{\link{azureDeleteVM}}, + \code{\link{azureListScaleSetNetwork}}, + \code{\link{azureListScaleSets}}, + \code{\link{azureListVM}}, \code{\link{azureStartVM}}, + \code{\link{azureStopVM}}, \code{\link{azureVMStatus}} +} diff --git a/man/azureListScaleSets.Rd b/man/azureListScaleSets.Rd new file mode 100644 index 0000000..864aedd --- /dev/null +++ b/man/azureListScaleSets.Rd @@ -0,0 +1,32 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/AzureVM.R +\name{azureListScaleSets} +\alias{azureListScaleSets} +\title{List scale sets within a resource group.} +\usage{ +azureListScaleSets(azureActiveContext, resourceGroup, location, subscriptionID, + azToken, verbose = FALSE) +} +\arguments{ +\item{azureActiveContext}{A container used for caching variables used by AzureSMR} + +\item{resourceGroup}{Name of the resource group} + +\item{location}{Azure region, e.g. 'westeurope' or 'southcentralus'} + +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link{azureAuthenticate}} when only a single subscriptionID is available via Active Directory} + +\item{azToken}{Azure authentication token, obtained by \code{\link{azureAuthenticate}}} + +\item{verbose}{Print Tracing information (Default False)} +} +\description{ +List scale sets within a resource group. +} +\seealso{ +Other Virtual machine functions: \code{\link{azureDeleteVM}}, + \code{\link{azureListScaleSetNetwork}}, + \code{\link{azureListScaleSetVM}}, + \code{\link{azureListVM}}, \code{\link{azureStartVM}}, + \code{\link{azureStopVM}}, \code{\link{azureVMStatus}} +} diff --git a/man/azureListStorageBlobs.Rd b/man/azureListStorageBlobs.Rd index 8f07fd3..593e844 100644 --- a/man/azureListStorageBlobs.Rd +++ b/man/azureListStorageBlobs.Rd @@ -33,4 +33,3 @@ Other blob store functions: \code{\link{azureBlobCD}}, \code{\link{azureDeleteBlob}}, \code{\link{azureGetBlob}}, \code{\link{azurePutBlob}} } - diff --git a/man/azureListStorageContainers.Rd b/man/azureListStorageContainers.Rd index 3bcd32f..4200a15 100644 --- a/man/azureListStorageContainers.Rd +++ b/man/azureListStorageContainers.Rd @@ -29,4 +29,3 @@ List Storage containers for Specified Storage Account. Other container functions: \code{\link{azureCreateStorageContainer}}, \code{\link{azureDeleteStorageContainer}} } - diff --git a/man/azureListSubscriptions.Rd b/man/azureListSubscriptions.Rd index d89f21f..59f5f58 100644 --- a/man/azureListSubscriptions.Rd +++ b/man/azureListSubscriptions.Rd @@ -25,4 +25,3 @@ Other Resource group functions: \code{\link{azureCreateResourceGroup}}, \code{\link{azureListAllResources}}, \code{\link{azureListRG}} } - diff --git a/man/azureListVM.Rd b/man/azureListVM.Rd index f82e188..1f8646b 100644 --- a/man/azureListVM.Rd +++ b/man/azureListVM.Rd @@ -25,7 +25,9 @@ List VMs in a Subscription. } \seealso{ Other Virtual machine functions: \code{\link{azureDeleteVM}}, + \code{\link{azureListScaleSetNetwork}}, + \code{\link{azureListScaleSetVM}}, + \code{\link{azureListScaleSets}}, \code{\link{azureStartVM}}, \code{\link{azureStopVM}}, \code{\link{azureVMStatus}} } - diff --git a/man/azurePutBlob.Rd b/man/azurePutBlob.Rd index 28ee4d4..e7839b5 100644 --- a/man/azurePutBlob.Rd +++ b/man/azurePutBlob.Rd @@ -43,4 +43,3 @@ Other blob store functions: \code{\link{azureBlobCD}}, \code{\link{azureGetBlob}}, \code{\link{azureListStorageBlobs}} } - diff --git a/man/azureResizeHDI.Rd b/man/azureResizeHDI.Rd index c31af56..51dc40a 100644 --- a/man/azureResizeHDI.Rd +++ b/man/azureResizeHDI.Rd @@ -36,4 +36,3 @@ Other HDInsight functions: \code{\link{azureCreateHDI}}, \code{\link{azureRunScriptAction}}, \code{\link{azureScriptActionHistory}} } - diff --git a/man/azureRunScriptAction.Rd b/man/azureRunScriptAction.Rd index 732a74c..1ae4c07 100644 --- a/man/azureRunScriptAction.Rd +++ b/man/azureRunScriptAction.Rd @@ -45,4 +45,3 @@ Other HDInsight functions: \code{\link{azureCreateHDI}}, \code{\link{azureListHDI}}, \code{\link{azureResizeHDI}}, \code{\link{azureScriptActionHistory}} } - diff --git a/man/azureSAGetKey.Rd b/man/azureSAGetKey.Rd index f8c4efd..7b5d1ad 100644 --- a/man/azureSAGetKey.Rd +++ b/man/azureSAGetKey.Rd @@ -28,4 +28,3 @@ Other Storage account functions: \code{\link{azureCreateStorageAccount}}, \code{\link{azureDeletestorageAccount}}, \code{\link{azureListSA}} } - diff --git a/man/azureScriptActionHistory.Rd b/man/azureScriptActionHistory.Rd index 91f9970..b6df4f5 100644 --- a/man/azureScriptActionHistory.Rd +++ b/man/azureScriptActionHistory.Rd @@ -36,4 +36,3 @@ Other HDInsight functions: \code{\link{azureCreateHDI}}, \code{\link{azureListHDI}}, \code{\link{azureResizeHDI}}, \code{\link{azureRunScriptAction}} } - diff --git a/man/azureSparkCMD.Rd b/man/azureSparkCMD.Rd index 0aafa5d..3b7fb5e 100644 --- a/man/azureSparkCMD.Rd +++ b/man/azureSparkCMD.Rd @@ -33,4 +33,3 @@ Other Spark functions: \code{\link{azureSparkJob}}, \code{\link{azureSparkShowURL}}, \code{\link{azureSparkStopSession}} } - diff --git a/man/azureSparkJob.Rd b/man/azureSparkJob.Rd index a6522d6..de205c9 100644 --- a/man/azureSparkJob.Rd +++ b/man/azureSparkJob.Rd @@ -33,4 +33,3 @@ Other Spark functions: \code{\link{azureSparkCMD}}, \code{\link{azureSparkShowURL}}, \code{\link{azureSparkStopSession}} } - diff --git a/man/azureSparkListJobs.Rd b/man/azureSparkListJobs.Rd index 81d0cce..4de5820 100644 --- a/man/azureSparkListJobs.Rd +++ b/man/azureSparkListJobs.Rd @@ -32,4 +32,3 @@ Other Spark functions: \code{\link{azureSparkCMD}}, \code{\link{azureSparkShowURL}}, \code{\link{azureSparkStopSession}} } - diff --git a/man/azureSparkListSessions.Rd b/man/azureSparkListSessions.Rd index 4f41bda..23cdfaa 100644 --- a/man/azureSparkListSessions.Rd +++ b/man/azureSparkListSessions.Rd @@ -29,4 +29,3 @@ Other Spark functions: \code{\link{azureSparkCMD}}, \code{\link{azureSparkShowURL}}, \code{\link{azureSparkStopSession}} } - diff --git a/man/azureSparkNewSession.Rd b/man/azureSparkNewSession.Rd index f7efb7b..b97595e 100644 --- a/man/azureSparkNewSession.Rd +++ b/man/azureSparkNewSession.Rd @@ -31,4 +31,3 @@ Other Spark functions: \code{\link{azureSparkCMD}}, \code{\link{azureSparkShowURL}}, \code{\link{azureSparkStopSession}} } - diff --git a/man/azureSparkShowURL.Rd b/man/azureSparkShowURL.Rd index 788f381..7257a5f 100644 --- a/man/azureSparkShowURL.Rd +++ b/man/azureSparkShowURL.Rd @@ -22,4 +22,3 @@ Other Spark functions: \code{\link{azureSparkCMD}}, \code{\link{azureSparkNewSession}}, \code{\link{azureSparkStopSession}} } - diff --git a/man/azureSparkStopSession.Rd b/man/azureSparkStopSession.Rd index 7a833bd..3d82b96 100644 --- a/man/azureSparkStopSession.Rd +++ b/man/azureSparkStopSession.Rd @@ -31,4 +31,3 @@ Other Spark functions: \code{\link{azureSparkCMD}}, \code{\link{azureSparkNewSession}}, \code{\link{azureSparkShowURL}} } - diff --git a/man/azureStartVM.Rd b/man/azureStartVM.Rd index 8be97d9..e8621d0 100644 --- a/man/azureStartVM.Rd +++ b/man/azureStartVM.Rd @@ -27,7 +27,9 @@ Start a Virtual Machine. } \seealso{ Other Virtual machine functions: \code{\link{azureDeleteVM}}, + \code{\link{azureListScaleSetNetwork}}, + \code{\link{azureListScaleSetVM}}, + \code{\link{azureListScaleSets}}, \code{\link{azureListVM}}, \code{\link{azureStopVM}}, \code{\link{azureVMStatus}} } - diff --git a/man/azureStopVM.Rd b/man/azureStopVM.Rd index aee6c50..373e1b2 100644 --- a/man/azureStopVM.Rd +++ b/man/azureStopVM.Rd @@ -27,7 +27,9 @@ Stop a Virtual Machine. } \seealso{ Other Virtual machine functions: \code{\link{azureDeleteVM}}, + \code{\link{azureListScaleSetNetwork}}, + \code{\link{azureListScaleSetVM}}, + \code{\link{azureListScaleSets}}, \code{\link{azureListVM}}, \code{\link{azureStartVM}}, \code{\link{azureVMStatus}} } - diff --git a/man/azureVMStatus.Rd b/man/azureVMStatus.Rd index 1460b7d..306d4ba 100644 --- a/man/azureVMStatus.Rd +++ b/man/azureVMStatus.Rd @@ -27,7 +27,9 @@ Get Status of a Virtual Machine. } \seealso{ Other Virtual machine functions: \code{\link{azureDeleteVM}}, + \code{\link{azureListScaleSetNetwork}}, + \code{\link{azureListScaleSetVM}}, + \code{\link{azureListScaleSets}}, \code{\link{azureListVM}}, \code{\link{azureStartVM}}, \code{\link{azureStopVM}} } - diff --git a/man/createAzureContext.Rd b/man/createAzureContext.Rd index fbb1758..187d401 100644 --- a/man/createAzureContext.Rd +++ b/man/createAzureContext.Rd @@ -24,4 +24,3 @@ See the Azure documentation (\url{https://azure.microsoft.com/en-us/documentatio Other azureActiveContext functions: \code{\link{setAzureContext}} } - diff --git a/man/dumpAzureContext.Rd b/man/dumpAzureContext.Rd index e211c9c..158fdba 100644 --- a/man/dumpAzureContext.Rd +++ b/man/dumpAzureContext.Rd @@ -12,4 +12,3 @@ dumpAzureContext(azureActiveContext) \description{ Dumps out the contents of the AzureContext. } - diff --git a/man/setAzureContext.Rd b/man/setAzureContext.Rd index 4c960e7..c25aa3c 100644 --- a/man/setAzureContext.Rd +++ b/man/setAzureContext.Rd @@ -49,4 +49,3 @@ Updates the value of an azureActiveContext object, created by \code{\link{create \seealso{ Other azureActiveContext functions: \code{\link{createAzureContext}} } - diff --git a/vignettes/Authentication.Rmd b/vignettes/Authentication.Rmd index 9cb368e..48b3908 100644 --- a/vignettes/Authentication.Rmd +++ b/vignettes/Authentication.Rmd @@ -76,7 +76,7 @@ That is all. You can test this by trying: ```{r, eval = FALSE} sc <- createAzureContext(tenantID = "{TID}", clientID = "{CID}", authKey= "{KEY}") -rgs <- AzureListRG(sc) +rgs <- azureListRG(sc) rgs ``` diff --git a/vignettes/tutorial.Rmd b/vignettes/tutorial.Rmd index 555037f..17df9a4 100644 --- a/vignettes/tutorial.Rmd +++ b/vignettes/tutorial.Rmd @@ -67,7 +67,7 @@ azureListSubscriptions(sc) ```{r, eval=FALSE} # list resource groups -AzureListRG(sc) +azureListRG(sc) # list all resources azureListAllResources(sc)