From 4adeb53f1868c60ef896eeeaef462af883d733a0 Mon Sep 17 00:00:00 2001 From: Andrie de Vries Date: Sun, 21 May 2017 20:41:51 +0100 Subject: [PATCH 1/3] Remove azToken from all functions #50 Fix roxygen markdown links #57 --- R/AzureAuthenticate.R | 8 +- R/AzureBlob.R | 20 +-- R/AzureContainer.R | 63 ++++----- R/AzureContextObject.R | 32 ++--- R/AzureHDI.R | 168 ++++++++++------------ R/AzureHive.R | 2 +- R/AzureResources.R | 102 ++++++-------- R/AzureSMR-package.R | 14 +- R/AzureSpark.R | 12 +- R/AzureTemplate.R | 90 ++++++------ R/AzureVM.R | 219 ++++++++++++++--------------- R/methods.R | 6 +- man/AzureSMR-package.Rd | 20 ++- man/Internal.Rd | 13 +- man/azureAuthenticate.Rd | 4 +- man/azureBlobCD.Rd | 4 +- man/azureBlobFind.Rd | 4 +- man/azureBlobLS.Rd | 4 +- man/azureCancelDeploy.Rd | 6 +- man/azureCheckToken.Rd | 6 +- man/azureCreateHDI.Rd | 8 +- man/azureCreateResourceGroup.Rd | 6 +- man/azureCreateStorageAccount.Rd | 2 +- man/azureCreateStorageContainer.Rd | 10 +- man/azureDeleteBlob.Rd | 4 +- man/azureDeleteDeploy.Rd | 6 +- man/azureDeleteHDI.Rd | 10 +- man/azureDeleteResourceGroup.Rd | 6 +- man/azureDeleteStorageContainer.Rd | 10 +- man/azureDeleteVM.Rd | 6 +- man/azureDeletestorageAccount.Rd | 2 +- man/azureDeployStatus.Rd | 6 +- man/azureDeployTemplate.Rd | 6 +- man/azureGetBlob.Rd | 6 +- man/azureHDIConf.Rd | 12 +- man/azureHiveSQL.Rd | 2 +- man/azureHiveStatus.Rd | 6 +- man/azureListAllResources.Rd | 10 +- man/azureListHDI.Rd | 12 +- man/azureListRG.Rd | 11 +- man/azureListSA.Rd | 2 +- man/azureListScaleSetNetwork.Rd | 6 +- man/azureListScaleSetVM.Rd | 6 +- man/azureListScaleSets.Rd | 6 +- man/azureListStorageBlobs.Rd | 8 +- man/azureListStorageContainers.Rd | 8 +- man/azureListSubscriptions.Rd | 10 +- man/azureListVM.Rd | 6 +- man/azurePutBlob.Rd | 4 +- man/azureResizeHDI.Rd | 8 +- man/azureRunScriptAction.Rd | 8 +- man/azureSAGetKey.Rd | 2 +- man/azureScriptActionHistory.Rd | 14 +- man/azureSparkCMD.Rd | 4 +- man/azureSparkJob.Rd | 2 +- man/azureSparkListJobs.Rd | 2 +- man/azureSparkListSessions.Rd | 2 +- man/azureSparkNewSession.Rd | 2 +- man/azureSparkStopSession.Rd | 4 +- man/azureStartVM.Rd | 6 +- man/azureStopVM.Rd | 6 +- man/azureVMStatus.Rd | 6 +- man/createAzureContext.Rd | 4 +- man/setAzureContext.Rd | 12 +- 64 files changed, 490 insertions(+), 586 deletions(-) diff --git a/R/AzureAuthenticate.R b/R/AzureAuthenticate.R index fcc0fbd..9aab213 100644 --- a/R/AzureAuthenticate.R +++ b/R/AzureAuthenticate.R @@ -6,8 +6,8 @@ #' @note See \url{https://azure.microsoft.com/en-us/documentation/articles/resource-group-create-service-principal-portal/} for instructions to set up an Active Directory application #' @references \url{https://azure.microsoft.com/en-us/documentation/articles/resource-group-create-service-principal-portal/} #' -#' @return Retunrs Azure Tokem and sets AzureContext Token -#' @family Resources +#' @return Returns Azure token and sets AzureContext token +#' @family Azure resource functions #' #' @importFrom utils URLencode #' @export @@ -65,11 +65,11 @@ azureAuthenticate <- function(azureActiveContext, tenantID, clientID, authKey, v -#' Check the timestamp of a Token and Renew if needed. +#' Check the timestamp of a token and renew if needed. #' #' @inheritParams setAzureContext #' @inheritParams azureAuthenticate -#' @family Resources +#' @family Azure resource functions #' @export azureCheckToken <- function(azureActiveContext) { if (missing(azureActiveContext) || is.null(azureActiveContext)) return(NA) diff --git a/R/AzureBlob.R b/R/AzureBlob.R index 2674681..db4417e 100644 --- a/R/AzureBlob.R +++ b/R/AzureBlob.R @@ -5,13 +5,13 @@ #' @inheritParams azureAuthenticate #' @inheritParams azureSAGetKey #' -#' @param maxresults Optional. Specifies the maximum number of blobs to return, including all BlobPrefix elements. If the request does not specify maxresults or specifies a value greater than 5,000, the server will return up to 5,000 items. Setting maxresults to a value less than or equal to zero results in error response code 400 (Bad Request). +#' @param maxresults Optional. Specifies the maximum number of blobs to return, including all BlobPrefix elements. If the request does not specify maxresults or specifies a value greater than 5,000, the server will return up to 5,000 items. Setting `maxresults` to a value less than or equal to zero results in error response code 400 (Bad Request). #' @param prefix Optional. Filters the results to return only blobs whose names begin with the specified prefix. #' @param delimiter Optional. When the request includes this parameter, the operation returns a BlobPrefix element in the response body that acts as a placeholder for all blobs whose names begin with the same substring up to the appearance of the delimiter character. The delimiter may be a single character or a string. #' @param marker Optional. A string value that identifies the portion of the list to be returned with the next list operation. The operation returns a marker value within the response body if the list returned was not complete. The marker value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to the client. #' -#' @return Returns a data frame. This data frame has an attribute called "marker" that can be used with the "marker" argument to return the next set of values. -#' @family blob store functions +#' @return Returns a data frame. This data frame has an attribute called `marker` that can be used with the `marker` argument to return the next set of values. +#' @family Blob store functions #' @export azureListStorageBlobs <- function(azureActiveContext, storageAccount, storageKey, container, resourceGroup, maxresults, prefix, delimiter, marker, verbose = FALSE) { @@ -117,7 +117,7 @@ azureListStorageBlobs <- function(azureActiveContext, storageAccount, storageKey #' @param directory Blob store directory to list for content #' @param recursive If TRUE, list blob store directories recursively #' -#' @family blob store functions +#' @family Blob store functions #' @export azureBlobLS <- function(azureActiveContext, directory, recursive = FALSE, storageAccount, storageKey, container, resourceGroup, verbose = FALSE) { @@ -275,9 +275,9 @@ azureBlobLS <- function(azureActiveContext, directory, recursive = FALSE, #' @inheritParams azureSAGetKey #' @inheritParams azureBlobLS -#' @param type String, either "text" or "raw". Passed to `httr::content` +#' @param type String, either "text" or "raw". Passed to [httr::content()] #' -#' @family blob store functions +#' @family Blob store functions #' @export azureGetBlob <- function(azureActiveContext, blob, directory, type = "text", @@ -379,7 +379,7 @@ azureGetBlob <- function(azureActiveContext, blob, directory, type = "text", #' @param contents - Object or value to store #' @param file - Local filename to store in Azure blob #' -#' @family blob store functions +#' @family Blob store functions #' @export azurePutBlob <- function(azureActiveContext, blob, contents = "", file = "", directory, storageAccount, storageKey, @@ -487,7 +487,7 @@ azurePutBlob <- function(azureActiveContext, blob, contents = "", file = "", #' @inheritParams azureSAGetKey #' @inheritParams azurePutBlob #' -#' @family blob store functions +#' @family Blob store functions #' @export azureBlobFind <- function(azureActiveContext, file, storageAccount, storageKey, container, resourceGroup, verbose = FALSE) { @@ -551,7 +551,7 @@ azureBlobFind <- function(azureActiveContext, file, storageAccount, storageKey, #' @inheritParams azureBlobLS #' @inheritParams azurePutBlob #' -#' @family blob store functions +#' @family Blob store functions #' @export azureBlobCD <- function(azureActiveContext, directory, container, file, storageAccount, storageKey, resourceGroup, verbose = FALSE) { @@ -640,7 +640,7 @@ azureBlobCD <- function(azureActiveContext, directory, container, file, #' @inheritParams azureSAGetKey #' @inheritParams azureBlobLS #' -#' @family blob store functions +#' @family Blob store functions #' @export azureDeleteBlob <- function(azureActiveContext, blob, directory, diff --git a/R/AzureContainer.R b/R/AzureContainer.R index e9a5a00..9bcb30a 100644 --- a/R/AzureContainer.R +++ b/R/AzureContainer.R @@ -4,29 +4,26 @@ #' @inheritParams azureAuthenticate #' @inheritParams azureSAGetKey -#' @family container functions +#' @family Container functions #' #' @export azureListStorageContainers <- function(azureActiveContext, storageAccount, storageKey, - resourceGroup, azToken, subscriptionID, verbose = FALSE) { + resourceGroup, subscriptionID, verbose = FALSE) { azureCheckToken(azureActiveContext) if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI <- subscriptionID) - if (missing(azToken)) { - ATI <- azureActiveContext$Token - } else (ATI <- azToken) + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID <- subscriptionID) if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup - } else (RGI <- resourceGroup) + resourceGroup <- azureActiveContext$resourceGroup + } else (resourceGroup <- resourceGroup) if (missing(storageAccount)) { SAI <- azureActiveContext$storageAccount } else (SAI <- storageAccount) verbosity <- if (verbose) httr::verbose(TRUE) else NULL - if (length(RGI) < 1) { + if (length(resourceGroup) < 1) { stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") } if (length(SAI) < 1) { @@ -36,7 +33,7 @@ azureListStorageContainers <- function(azureActiveContext, storageAccount, stora STK <- if (length(azureActiveContext$storageAccountK) < 1 || SAI != azureActiveContext$storageAccountK || length(azureActiveContext$storageKey) < 1) { - azureSAGetKey(azureActiveContext, resourceGroup = RGI, storageAccount = SAI) + azureSAGetKey(azureActiveContext, resourceGroup = resourceGroup, storageAccount = SAI) } else { azureActiveContext$storageKey } @@ -87,7 +84,7 @@ azureListStorageContainers <- function(azureActiveContext, storageAccount, stora } azureActiveContext$storageAccount <- SAI - azureActiveContext$resourceGroup <- RGI + azureActiveContext$resourceGroup <- resourceGroup azureActiveContext$storageKey <- STK data.frame( @@ -109,22 +106,19 @@ azureListStorageContainers <- function(azureActiveContext, storageAccount, stora #' @inheritParams azureAuthenticate #' @inheritParams azureSAGetKey -#' @family container functions +#' @family Container functions #' #' @export azureCreateStorageContainer <- function(azureActiveContext, container, storageAccount, - storageKey, resourceGroup, azToken, subscriptionID, verbose = FALSE) { + storageKey, resourceGroup, subscriptionID, verbose = FALSE) { # azureCheckToken(azureActiveContext) if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI <- subscriptionID) - if (missing(azToken)) { - ATI <- azureActiveContext$Token - } else (ATI <- azToken) + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID <- subscriptionID) if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup - } else (RGI <- resourceGroup) + resourceGroup <- azureActiveContext$resourceGroup + } else (resourceGroup <- resourceGroup) if (missing(storageAccount)) { SAI <- azureActiveContext$storageAccount } else (SAI <- storageAccount) @@ -137,14 +131,14 @@ azureCreateStorageContainer <- function(azureActiveContext, container, storageAc verbosity <- if (verbose) httr::verbose(TRUE) else NULL - if (length(RGI) < 1) { + if (length(resourceGroup) < 1) { stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") } if (length(SAI) < 1) { stop("Error: No storageAccount provided: Use storageAccount argument or set in AzureContext") } - STK <- refreshStorageKey(azureActiveContext, SAI, RGI) + STK <- refreshStorageKey(azureActiveContext, SAI, resourceGroup) if (length(STK) < 1) { stop("Error: No storageKey provided: Use storageKey argument or set in AzureContext") @@ -165,7 +159,7 @@ azureCreateStorageContainer <- function(azureActiveContext, container, storageAc azureActiveContext$container <- container azureActiveContext$storageAccount <- SAI - azureActiveContext$resourceGroup <- RGI + azureActiveContext$resourceGroup <- resourceGroup URL <- paste("http://", SAI, ".blob.core.windows.net/", container, "?restype=container", sep = "") @@ -203,22 +197,19 @@ azureCreateStorageContainer <- function(azureActiveContext, container, storageAc #' @inheritParams azureAuthenticate #' @inheritParams azureSAGetKey -#' @family container functions +#' @family Container functions #' #' @export azureDeleteStorageContainer <- function(azureActiveContext, container, storageAccount, - storageKey, resourceGroup, azToken, subscriptionID, verbose = FALSE) { + storageKey, resourceGroup, subscriptionID, verbose = FALSE) { azureCheckToken(azureActiveContext) if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI <- subscriptionID) - if (missing(azToken)) { - ATI <- azureActiveContext$Token - } else (ATI <- azToken) + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID <- subscriptionID) if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup - } else (RGI <- resourceGroup) + resourceGroup <- azureActiveContext$resourceGroup + } else (resourceGroup <- resourceGroup) if (missing(storageAccount)) { SAI <- azureActiveContext$storageAccount } else (SAI <- storageAccount) @@ -233,14 +224,14 @@ azureDeleteStorageContainer <- function(azureActiveContext, container, storageAc CNTR <- container - if (length(RGI) < 1) { + if (length(resourceGroup) < 1) { stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") } if (length(SAI) < 1) { stop("Error: No storageAccount provided: Use storageAccount argument or set in AzureContext") } - STK <- refreshStorageKey(azureActiveContext, SAI, RGI) + STK <- refreshStorageKey(azureActiveContext, SAI, resourceGroup) if (length(STK) < 1) { stop("Error: No storageKey provided: Use storageKey argument or set in AzureContext") } @@ -258,7 +249,7 @@ azureDeleteStorageContainer <- function(azureActiveContext, container, storageAc azureActiveContext$container <- CNTR azureActiveContext$storageAccount <- SAI - azureActiveContext$resourceGroup <- RGI + azureActiveContext$resourceGroup <- resourceGroup SIG <- getSig(azureActiveContext, url = URL, verb = "DELETE", key = STK, storageAccount = SAI, CMD = paste0(CNTR, "\nrestype:container"), dateSig = D1) diff --git a/R/AzureContextObject.R b/R/AzureContextObject.R index 6ebfbdb..eefe772 100644 --- a/R/AzureContextObject.R +++ b/R/AzureContextObject.R @@ -1,21 +1,21 @@ #' Create an AzureContext. #' -#' Create a container (azureContextObject) for holding variables used by the AzureSMR package. If the Tenant ID, Client ID and Authenication Key are provided the function will attempt to authenticate the session. +#' Create a container (azureContextObject) for holding variables used by the `AzureSMR` package. If the Tenant ID, Client ID and Authenication Key are provided the function will attempt to authenticate the session. #' #' See the Azure documentation (\url{https://azure.microsoft.com/en-us/documentation/articles/resource-group-create-service-principal-portal/}) for information to configure an Active Directory application. #' #' @inheritParams setAzureContext #' @family azureActiveContext functions #' -#' @seealso `setAzureContext` +#' @seealso [setAzureContext()] #' @export createAzureContext <- function(tenantID, clientID, authKey){ azEnv <- new.env(parent = globalenv()) azEnv <- as.azureActiveContext(azEnv) - if (!missing(tenantID)) azEnv$tenantID <- tenantID else azEnv$tenantID <- "?" - if (!missing(clientID)) azEnv$clientID <- clientID else azEnv$tenantID <- "?" - if (!missing(authKey)) azEnv$authKey <- authKey else azEnv$tenantID <- "?" + if (!missing(tenantID)) azEnv$tenantID <- tenantID else azEnv$tenantID <- "?" + if (!missing(clientID)) azEnv$clientID <- clientID else azEnv$tenantID <- "?" + if (!missing(authKey)) azEnv$authKey <- authKey else azEnv$tenantID <- "?" if (!missing(tenantID) && !missing(clientID) && !missing(authKey) ) azureAuthenticate(azEnv,tenantID, clientID, authKey) @@ -33,34 +33,34 @@ dumpAzureContext <- function(azureActiveContext){ #' Updates azureActiveContext object. #' -#' Updates the value of an azureActiveContext object, created by `createAzureContext` +#' Updates the value of an azureActiveContext object, created by [createAzureContext()] #' #' @param azureActiveContext A container used for caching variables used by AzureSMR #' @param tenantID The Tenant ID provided during creation of the Active Directory application / service principal #' @param clientID The Client ID provided during creation of the Active Directory application / service principal #' @param authKey The Authentication Key provided during creation of the Active Directory application / service principal -#' @param subscriptionID Set the subscriptionID. This is obtained automatically by `azureAuthenticate` when only a single subscriptionID is available via Active Directory -#' @param azToken Azure authentication token, obtained by `azureAuthenticate` +#' @param subscriptionID Set the subscriptionID. This is obtained automatically by [azureAuthenticate()] when only a single subscriptionID is available via Active Directory +#' @param azToken Azure authentication token, obtained by [azureAuthenticate()] #' @param resourceGroup Name of the resource group #' @param vmName Name of the virtual Machine #' @param storageAccount Name of the azure storage account #' @param storageKey Storage key associated with storage account #' @param blob Blob name -#' @param clustername Cluster name, used for HDI and Spark clusters. See `azureCreateHDI` -#' @param sessionID Spark sessionID. See `azureSparkCMD` +#' @param clustername Cluster name, used for HDI and Spark clusters. See [azureCreateHDI()] +#' @param sessionID Spark sessionID. See [azureSparkCMD()] #' @param hdiAdmin HDInsight admin username #' @param hdiPassword HDInsight admin password -#' @param container Storage container name. See `azureListStorageContainers` +#' @param container Storage container name. See [azureListStorageContainers()] #' @param kind HDinsight kind: "hadoop","spark" or "pyspark" #' #' @family azureActiveContext functions #' @export -setAzureContext <- function(azureActiveContext,tenantID, clientID, authKey,azToken, - subscriptionID,resourceGroup, - storageKey,storageAccount, - container,blob, +setAzureContext <- function(azureActiveContext, tenantID, clientID, authKey, azToken, + subscriptionID, resourceGroup, + storageKey, storageAccount, + container, blob, vmName, - hdiAdmin,hdiPassword ,clustername,kind,sessionID) + hdiAdmin, hdiPassword, clustername, kind, sessionID) { if (!missing(tenantID)) azureActiveContext$tenantID <- tenantID if (!missing(clientID)) azureActiveContext$clientID <- clientID diff --git a/R/AzureHDI.R b/R/AzureHDI.R index cfdd5b5..303f174 100644 --- a/R/AzureHDI.R +++ b/R/AzureHDI.R @@ -1,4 +1,4 @@ -#' Get all HDInsight Clusters in default Subscription or details for a specified clustername. +#' Get all HDInsight Clusters in default Subscription or details for a specified cluster name. #' #' @inheritParams setAzureContext #' @inheritParams azureAuthenticate @@ -9,37 +9,35 @@ #' @return Returns Dataframe of HDInsight Clusters #' @export azureListHDI <- function(azureActiveContext, resourceGroup, clustername = "*", - subscriptionID, azToken, name, type, location, verbose = FALSE) { + subscriptionID, name, type, location, verbose = FALSE) { azureCheckToken(azureActiveContext) - if (missing(azToken)) { - AT <- azureActiveContext$Token - } else (AT <- azToken) + AT <- azureActiveContext$Token if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI <- subscriptionID) + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID <- subscriptionID) if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup - } else (RGI <- resourceGroup) + resourceGroup <- azureActiveContext$resourceGroup + } else (resourceGroup <- resourceGroup) verbosity <- if (verbose) httr::verbose(TRUE) else NULL if (!length(AT)) { stop("Error: No Token / Not currently Authenticated.") } - if (!length(SUBIDI)) { + if (!length(subscriptionID)) { stop("Error: No subscriptionID provided: Use SUBID argument or set in AzureContext") } - if (clustername != "*" && !length(RGI)) { + if (clustername != "*" && !length(resourceGroup)) { stop("Error: No resourceGroup Defined.") } URL <- if (clustername == "*") { - paste0("https://management.azure.com/subscriptions/", SUBIDI, + paste0("https://management.azure.com/subscriptions/", subscriptionID, "/providers/Microsoft.HDInsight/clusters?api-version=2015-03-01-preview") } else { - paste0("https://management.azure.com/subscriptions/", SUBIDI, - "/resourceGroups/", RGI, "/providers/Microsoft.HDInsight/clusters/", + paste0("https://management.azure.com/subscriptions/", subscriptionID, + "/resourceGroups/", resourceGroup, "/providers/Microsoft.HDInsight/clusters/", clustername, "?api-version=2015-03-01-preview") } @@ -115,13 +113,13 @@ azureListHDI <- function(azureActiveContext, resourceGroup, clustername = "*", } colnames(dfn) <- c("name", "ID", "location", "type", "tier", "kind", "OS", "provState", "status", "created", "numCores", "information") - azureActiveContext$resourceGroup <- RGI + azureActiveContext$resourceGroup <- resourceGroup return(t(dfn)) } -#' Get Configuration Information for a specified clustername. +#' Get Configuration Information for a specified cluster name. #' #' @inheritParams setAzureContext #' @inheritParams azureAuthenticate @@ -132,17 +130,15 @@ azureListHDI <- function(azureActiveContext, resourceGroup, clustername = "*", #' @family HDInsight functions #' @export azureHDIConf <- function(azureActiveContext, clustername, resourceGroup, - subscriptionID, azToken, name, type, location, verbose = FALSE) { + subscriptionID, name, type, location, verbose = FALSE) { azureCheckToken(azureActiveContext) - if (missing(azToken)) { - AT <- azureActiveContext$Token - } else (AT <- azToken) + AT <- azureActiveContext$Token if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI <- subscriptionID) + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID <- subscriptionID) if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup - } else (RGI <- resourceGroup) + resourceGroup <- azureActiveContext$resourceGroup + } else (resourceGroup <- resourceGroup) if (missing(clustername)) { CN <- azureActiveContext$clustername } else (CN <- clustername) @@ -152,15 +148,15 @@ azureHDIConf <- function(azureActiveContext, clustername, resourceGroup, if (!length(AT)) { stop("Error: No Token / Not currently Authenticated.") } - if (!length(SUBIDI)) { + if (!length(subscriptionID)) { stop("Error: No subscriptionID provided: Use SUBID argument or set in AzureContext") } if (!length(CN)) { stop("Error: No clustername Provided.") } - URL <- paste("https://management.azure.com/subscriptions/", SUBIDI, - "/resourceGroups/", RGI, "/providers/Microsoft.HDInsight/clusters/", + URL <- paste("https://management.azure.com/subscriptions/", subscriptionID, + "/resourceGroups/", resourceGroup, "/providers/Microsoft.HDInsight/clusters/", clustername, "?api-version=2015-03-01-preview", sep = "") r <- GET(URL, add_headers(.headers = c(Host = "management.azure.com", @@ -214,23 +210,21 @@ azureHDIConf <- function(azureActiveContext, clustername, resourceGroup, #' @family HDInsight functions #' @export azureResizeHDI <- function(azureActiveContext, clustername, role = "worker", - size = 2, mode = "Sync", azToken, subscriptionID, + size = 2, mode = "Sync", subscriptionID, resourceGroup, verbose = FALSE) { azureCheckToken(azureActiveContext) + AT <- azureActiveContext$Token if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup - } else (RGI <- resourceGroup) + resourceGroup <- azureActiveContext$resourceGroup + } else (resourceGroup <- resourceGroup) if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI <- subscriptionID) - if (missing(azToken)) { - AT <- azureActiveContext$Token - } else (AT <- azToken) + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID <- subscriptionID) verbosity <- if (verbose) httr::verbose(TRUE) else NULL - if (!length(RGI)) { + if (!length(resourceGroup)) { stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") } if (!length(clustername)) { @@ -239,14 +233,14 @@ azureResizeHDI <- function(azureActiveContext, clustername, role = "worker", if (!length(role)) { stop("Error: No role Provided") } - if (!length(RGI)) { + if (!length(resourceGroup)) { stop("Error: No New role size provided") } verbosity <- if (verbose) httr::verbose(TRUE) else NULL - URL <- paste("https://management.azure.com/subscriptions/", SUBIDI, - "/resourceGroups/", RGI, "/providers/Microsoft.HDInsight/clusters/", + URL <- paste("https://management.azure.com/subscriptions/", subscriptionID, + "/resourceGroups/", resourceGroup, "/providers/Microsoft.HDInsight/clusters/", clustername, "/roles/", role, "/resize?api-version=2015-03-01-preview", sep = "") @@ -264,7 +258,7 @@ azureResizeHDI <- function(azureActiveContext, clustername, role = "worker", } RT <- "Request accepted" if (toupper(mode) == "SYNC") { - azureActiveContext$resourceGroup <- RGI + azureActiveContext$resourceGroup <- resourceGroup message(paste("azureResizeHDI: Request Submitted: ", Sys.time())) message("Accepted(A), Resizing(R), Succeeded(S)") a <- 1 @@ -320,34 +314,32 @@ azureResizeHDI <- function(azureActiveContext, clustername, role = "worker", #' @return Returns Dataframe of HDInsight Clusters information #' @family HDInsight functions #' @export -azureDeleteHDI <- function(azureActiveContext, clustername, azToken, subscriptionID, +azureDeleteHDI <- function(azureActiveContext, clustername, subscriptionID, resourceGroup, verbose = FALSE) { azureCheckToken(azureActiveContext) + ATI <- azureActiveContext$Token if (missing(clustername)) { CN <- azureActiveContext$clustername } else (CN <- clustername) if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup - } else (RGI <- resourceGroup) + resourceGroup <- azureActiveContext$resourceGroup + } else (resourceGroup <- resourceGroup) if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI <- subscriptionID) - if (missing(azToken)) { - ATI <- azureActiveContext$Token - } else (ATI <- azToken) + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID <- subscriptionID) verbosity <- if (verbose) httr::verbose(TRUE) else NULL if (!length(CN)) { stop("Error: No Valid clustername provided") } - if (!length(RGI)) { + if (!length(resourceGroup)) { stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") } - URL <- paste("https://management.azure.com/subscriptions/", SUBIDI, - "/resourceGroups/", RGI, "/providers/Microsoft.HDInsight/clusters/", + URL <- paste("https://management.azure.com/subscriptions/", subscriptionID, + "/resourceGroups/", resourceGroup, "/providers/Microsoft.HDInsight/clusters/", CN, "?api-version=2015-03-01-preview", sep = "") @@ -396,18 +388,16 @@ azureCreateHDI <- function(azureActiveContext, clustername, location, kind = "sp 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) { + subscriptionID, mode = "Sync", verbose = FALSE) { azureCheckToken(azureActiveContext) + ATI <- azureActiveContext$Token if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup - } else (RGI <- resourceGroup) + resourceGroup <- azureActiveContext$resourceGroup + } else (resourceGroup <- resourceGroup) if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI <- subscriptionID) - if (missing(azToken)) { - ATI <- azureActiveContext$Token - } else (ATI <- azToken) + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID <- subscriptionID) verbosity <- if (verbose) httr::verbose(TRUE) else NULL if (!length(storageAccount)) { @@ -432,12 +422,12 @@ azureCreateHDI <- function(azureActiveContext, clustername, location, kind = "sp if (!length(adminPassword)) { stop("Error: No Valid adminPassword provided") } - if (!length(RGI)) { + if (!length(resourceGroup)) { stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") } message("Fetching Storage Key..") - storageKey <- azureSAGetKey(azureActiveContext, resourceGroup = RGI, storageAccount = storageAccount) + storageKey <- azureSAGetKey(azureActiveContext, resourceGroup = resourceGroup, storageAccount = storageAccount) HIVE <- FALSE if (!missing(hiveServer)) { @@ -574,7 +564,7 @@ azureCreateHDI <- function(azureActiveContext, clustername, location, kind = "sp bodyI <- gsub("AAAAAAAAAAA", adminUser, bodyI) bodyI <- gsub("QQQQQQQQQQQ", adminPassword, bodyI) bodyI <- gsub("WWWWWW", workers, bodyI) - bodyI <- gsub("SSSSSSSSSSSS", SUBIDI, bodyI) + bodyI <- gsub("SSSSSSSSSSSS", subscriptionID, bodyI) bodyI <- gsub("LLLLLLLLLLL", location, bodyI) bodyI <- gsub("TTTTTTTTTTT", storageAccount, bodyI) bodyI <- gsub("KKKKKKKKKKKKKKKK", storageKey, bodyI) @@ -597,8 +587,8 @@ azureCreateHDI <- function(azureActiveContext, clustername, location, kind = "sp #return(bodyI) - URL <- paste0("https://management.azure.com/subscriptions/", SUBIDI, - "/resourceGroups/", RGI, + URL <- paste0("https://management.azure.com/subscriptions/", subscriptionID, + "/resourceGroups/", resourceGroup, "/providers/Microsoft.HDInsight/clusters/", clustername, "?api-version=2015-03-01-preview") @@ -612,7 +602,7 @@ azureCreateHDI <- function(azureActiveContext, clustername, location, kind = "sp if (!status_code(r) %in% c(200, 201)) stopWithAzureError(r) rl <- content(r, "text", encoding = "UTF-8") if (toupper(mode) == "SYNC") { - azureActiveContext$resourceGroup <- RGI + azureActiveContext$resourceGroup <- resourceGroup message(paste("azureResizeHDI: Request Submitted: ", Sys.time())) message("Runing(C), Succeeded(S)") a <- 1 @@ -670,27 +660,26 @@ azureCreateHDI <- function(azureActiveContext, clustername, location, kind = "sp azureRunScriptAction <- function(azureActiveContext, scriptname = "script1", scriptURL, headNode = TRUE, workerNode = FALSE, edgeNode = FALSE, clustername, resourceGroup, - parameters = "", azToken, subscriptionID, verbose = FALSE) { + parameters = "", subscriptionID, verbose = FALSE) { azureCheckToken(azureActiveContext) + ATI <- azureActiveContext$Token + if (missing(clustername)) { CN <- azureActiveContext$clustername } else (CN <- clustername) if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup - } else (RGI <- resourceGroup) + resourceGroup <- azureActiveContext$resourceGroup + } else (resourceGroup <- resourceGroup) if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI <- subscriptionID) - if (missing(azToken)) { - ATI <- azureActiveContext$Token - } else (ATI <- azToken) + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID <- subscriptionID) verbosity <- if (verbose) httr::verbose(TRUE) else NULL if (!length(CN)) { stop("Error: No Valid clustername provided") } - if (!length(RGI)) { + if (!length(resourceGroup)) { stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") } if (!length(scriptname)) { @@ -734,8 +723,8 @@ azureRunScriptAction <- function(azureActiveContext, scriptname = "script1", scr bodyI <- gsub("RRRRRRRRRRRRRR", RL, bodyI) - URL <- paste("https://management.azure.com/subscriptions/", SUBIDI, - "/resourceGroups/", RGI, "/providers/Microsoft.HDInsight/clusters/", + URL <- paste("https://management.azure.com/subscriptions/", subscriptionID, + "/resourceGroups/", resourceGroup, "/providers/Microsoft.HDInsight/clusters/", CN, "/executeScriptActions?api-version=2015-03-01-preview", sep = "") r <- POST(URL, add_headers(.headers = c(Host = "management.azure.com", @@ -760,48 +749,47 @@ azureRunScriptAction <- function(azureActiveContext, scriptname = "script1", scr } -#' Get all HDInsight Script Action History for a specified clustername. +#' Get all HDInsight Script Action History for a specified cluster name. #' #' @inheritParams setAzureContext #' @inheritParams azureListHDI #' @inheritParams azureRunScriptAction #' -#' @return Returns Dataframe of HDInsight Clusters +#' @return Dataframe of HDInsight Clusters #' @family HDInsight functions #' @export azureScriptActionHistory <- function(azureActiveContext, resourceGroup, - clustername = "*", subscriptionID, azToken, + clustername = "*", subscriptionID, name, type, verbose = FALSE) { azureCheckToken(azureActiveContext) - if (missing(azToken)) { - AT <- azureActiveContext$Token - } else (AT <- azToken) + AT <- azureActiveContext$Token + if (missing(clustername)) { CN <- azureActiveContext$clustername } else (CN <- clustername) if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI <- subscriptionID) + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID <- subscriptionID) if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup - } else (RGI <- resourceGroup) + resourceGroup <- azureActiveContext$resourceGroup + } else (resourceGroup <- resourceGroup) verbosity <- if (verbose) httr::verbose(TRUE) else NULL if (!length(AT)) { stop("Error: No Token / Not currently Authenticated.") } - if (!length(SUBIDI)) { + if (!length(subscriptionID)) { stop("Error: No subscriptionID provided: Use SUBID argument or set in AzureContext") } - if (clustername != "*" && !length(RGI)) { + if (clustername != "*" && !length(resourceGroup)) { stop("Error: No resourceGroup Defined.") } # https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupname}/providers/Microsoft.HDInsight/clusters/{clustername}/scriptExecutionHistory/{scriptExecutionId}?api-version={api-version} - URL <- paste("https://management.azure.com/subscriptions/", SUBIDI, - "/resourceGroups/", RGI, "/providers/Microsoft.HDInsight/clusters/", + URL <- paste("https://management.azure.com/subscriptions/", subscriptionID, + "/resourceGroups/", resourceGroup, "/providers/Microsoft.HDInsight/clusters/", CN, "/scriptExecutionHistory/?api-version=2015-03-01-preview", sep = "") diff --git a/R/AzureHive.R b/R/AzureHive.R index 74519e5..4a9b00a 100644 --- a/R/AzureHive.R +++ b/R/AzureHive.R @@ -1,4 +1,4 @@ -#' Get Status of a HDI Hive Service/version. +#' Get Status of a HDI Hive Service / version. #' #' @inheritParams setAzureContext #' @inheritParams azureAuthenticate diff --git a/R/AzureResources.R b/R/AzureResources.R index ea54a06..beba065 100644 --- a/R/AzureResources.R +++ b/R/AzureResources.R @@ -1,16 +1,15 @@ -#' Get available Subscriptions. +#' Get available subscriptions. #' #' @inheritParams setAzureContext #' @inheritParams azureAuthenticate #' -#' @return Returns Dataframe of subscriptionID sets AzureContext subscriptionID +#' @return Dataframe of subscriptionID; Sets AzureContext subscriptionID #' @family Resource group functions #' @export -azureListSubscriptions <- function(azureActiveContext, azToken, verbose = FALSE) { - if (missing(azToken)) { - AT <- azureActiveContext$Token - } else (AT = azToken) +azureListSubscriptions <- function(azureActiveContext, verbose = FALSE) { + azureCheckToken(azureActiveContext) + AT <- azureActiveContext$Token if (nchar(AT) < 5) { stop("Error: No Token / Not currently Authenticated.") } @@ -40,27 +39,25 @@ azureListSubscriptions <- function(azureActiveContext, azToken, verbose = FALSE) #' @inheritParams setAzureContext #' @inheritParams azureAuthenticate #' -#' @return Returns Dataframe of resourceGroups +#' @return Dataframe of resourceGroups #' @family Resource group functions #' @export -azureListRG <- function(azureActiveContext, subscriptionID, azToken, verbose = FALSE) { +azureListRG <- function(azureActiveContext, subscriptionID, verbose = FALSE) { azureCheckToken(azureActiveContext) - if (missing(azToken)) { - ATI <- azureActiveContext$Token - } else (ATI = azToken) + ATI <- azureActiveContext$Token if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI = subscriptionID) + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID = subscriptionID) if (!length(ATI)) { stop("Error: No Token / Not currently Authenticated.") } - if (!length(SUBIDI)) { + if (!length(subscriptionID)) { stop("Error: No subscriptionID provided: Use SUBID argument or set in AzureContext") } verbosity <- if (verbose) httr::verbose(TRUE) else NULL - URLRG <- paste("https://management.azure.com/subscriptions/", SUBIDI, + URLRG <- paste("https://management.azure.com/subscriptions/", subscriptionID, "/resourcegroups?api-version=2015-01-01", sep = "") r <- GET(URLRG, add_headers(.headers = c(Host = "management.azure.com", @@ -79,9 +76,10 @@ azureListRG <- function(azureActiveContext, subscriptionID, azToken, verbose = F } -#' @rdname azureListRG #' @export -AzureListRG <- azureListRG +AzureListRG <- function(...) { + .Deprecated("azureListRG") +} #' Get all Resource in default Subscription. @@ -90,8 +88,8 @@ AzureListRG <- azureListRG #' @inheritParams azureAuthenticate #' #' @param azureActiveContext Azure Context Object -#' @param resourceGroup resourceGroup Object (or use azureActiveContext) -#' @param subscriptionID subscriptionID Object (or use azureActiveContext) +#' @param resourceGroup resourceGroup Object (or use `azureActiveContext`) +#' @param subscriptionID subscriptionID Object (or use `azureActiveContext`) #' @param name filter by resource name #' @param type filter by resource type #' @param location Azure region, e.g. 'westeurope' or 'southcentralus' @@ -100,29 +98,25 @@ AzureListRG <- azureListRG #' @family Resource group functions #' @export azureListAllResources <- function(azureActiveContext, resourceGroup, subscriptionID, - azToken, name, type, location, verbose = FALSE) { + name, type, location, verbose = FALSE) { azureCheckToken(azureActiveContext) - if (missing(azToken)) { - ATI <- azureActiveContext$Token - } else (ATI = azToken) + ATI <- azureActiveContext$Token if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI = subscriptionID) - # if (ATI == '') stop('Token not provided') if (SUBIDI == '') - # stop('Subscription not provided') + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID = subscriptionID) if (!length(ATI)) { stop("Error: No Token / Not currently Authenticated.") } - if (!length(SUBIDI)) { + if (!length(subscriptionID)) { stop("Error: No subscriptionID provided: Use SUBID argument or set in AzureContext") } verbosity <- if (verbose) httr::verbose(TRUE) else NULL - URLRS <- paste("https://management.azure.com/subscriptions/", SUBIDI, + URLRS <- paste("https://management.azure.com/subscriptions/", subscriptionID, "/resources?api-version=2015-01-01", sep = "") r <- GET(URLRS, add_headers(.headers = c(Host = "management.azure.com", Authorization = ATI, @@ -159,21 +153,19 @@ azureListAllResources <- function(azureActiveContext, resourceGroup, subscriptio #' @family Resource group functions #' @export azureCreateResourceGroup <- function(azureActiveContext, resourceGroup, - location, subscriptionID, azToken, verbose = FALSE) { + location, subscriptionID, verbose = FALSE) { azureCheckToken(azureActiveContext) - if (missing(azToken)) { - ATI <- azureActiveContext$Token - } else (ATI = azToken) + ATI <- azureActiveContext$Token if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI = subscriptionID) - # if (ATI == '') stop('Token not provided') if (SUBIDI == '') + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID = subscriptionID) + # if (ATI == '') stop('Token not provided') if (subscriptionID == '') # stop('Subscription not provided') if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup + resourceGroup <- azureActiveContext$resourceGroup } else { - RGI <- resourceGroup - azureActiveContext$resourceGroup <- RGI + resourceGroup <- resourceGroup + azureActiveContext$resourceGroup <- resourceGroup } if (missing(location)) { stop("Error: No location provided") @@ -182,20 +174,20 @@ azureCreateResourceGroup <- function(azureActiveContext, resourceGroup, verbosity <- if (verbose) httr::verbose(TRUE) else NULL - if (!length(RGI)) { + if (!length(resourceGroup)) { stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") } if (!length(ATI)) { stop("Error: No Token / Not currently Authenticated.") } - if (!length(SUBIDI)) { + if (!length(subscriptionID)) { stop("Error: No subscriptionID provided: Use SUBID argument or set in AzureContext") } bodyI <- list(location = location) - URLRS <- paste("https://management.azure.com/subscriptions/", SUBIDI, - "/resourcegroups/", RGI, "?api-version=2015-01-01", sep = "") + URLRS <- paste("https://management.azure.com/subscriptions/", subscriptionID, + "/resourcegroups/", resourceGroup, "?api-version=2015-01-01", sep = "") r <- PUT(URLRS, add_headers(.headers = c(Host = "management.azure.com", Authorization = ATI, `Content-type` = "application/json")), @@ -223,37 +215,35 @@ azureCreateResourceGroup <- function(azureActiveContext, resourceGroup, #' @family Resource group functions #' @export azureDeleteResourceGroup <- function(azureActiveContext, resourceGroup, - subscriptionID, azToken, type, verbose = FALSE) { + subscriptionID, type, verbose = FALSE) { azureCheckToken(azureActiveContext) + ATI <- azureActiveContext$Token - if (missing(azToken)) { - ATI <- azureActiveContext$Token - } else (ATI = azToken) if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI = subscriptionID) - # if (ATI == '') stop('Token not provided') if (SUBIDI == '') + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID = subscriptionID) + # if (ATI == '') stop('Token not provided') if (subscriptionID == '') # stop('Subscription not provided') if (missing(resourceGroup)) stop("Please supply Resource Group to Confirm") if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup - } else (RGI = resourceGroup) + resourceGroup <- azureActiveContext$resourceGroup + } else (resourceGroup = resourceGroup) verbosity <- if (verbose) httr::verbose(TRUE) else NULL - if (!length(RGI)) { + if (!length(resourceGroup)) { stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") } if (!length(ATI)) { stop("Error: No Token / Not currently Authenticated.") } - if (!length(SUBIDI)) { + if (!length(subscriptionID)) { stop("Error: No subscriptionID provided: Use SUBID argument or set in AzureContext") } - URLRS <- paste("https://management.azure.com/subscriptions/", SUBIDI, - "/resourcegroups/", RGI, "?api-version=2015-01-01", sep = "") + URLRS <- paste("https://management.azure.com/subscriptions/", subscriptionID, + "/resourcegroups/", resourceGroup, "?api-version=2015-01-01", sep = "") r <- DELETE(URLRS, add_headers(.headers = c(Host = "management.azure.com", Authorization = ATI, `Content-type` = "application/json")), diff --git a/R/AzureSMR-package.R b/R/AzureSMR-package.R index d1ce44b..5048aad 100644 --- a/R/AzureSMR-package.R +++ b/R/AzureSMR-package.R @@ -2,9 +2,19 @@ #' #' The AzureSMR package connects R to the Azure Service Manager API. #' -#' This enables you to use and change many Azure resources, including: +#' This enables you to use and change many Azure resources. The following is an incomplete list of available functions: #' -#' * Storage blobs +#' * Create an Azure context: +#' - [createAzureContext()] +#' * Resources and resource groups: +#' - [azureListAllResources()] +#' - [azureCreateResourceGroup()] +#' - [azureListRG()] +#' * Storage accounts and blobs: +#' - [azureListSA()] +#' - [azureCreateStorageAccount()] +#' - [azureListStorageContainers()] +#' - [azureListStorageBlobs()] #' * HDInsight (Nodes, Hive, Spark) #' * Azure Resource Manager #' * Virtual Machines diff --git a/R/AzureSpark.R b/R/AzureSpark.R index 9adc946..0426123 100644 --- a/R/AzureSpark.R +++ b/R/AzureSpark.R @@ -45,7 +45,7 @@ azureSparkNewSession <- function(azureActiveContext, clustername, hdiAdmin, URL <- paste("https://", CN, ".azurehdinsight.net/livy/sessions", sep = "") # URL <- - # paste('https://management.azure.com/subscriptions/',SUBIDI,'/resourceGroups/',RGI,'/providers/Microsoft.HDInsight/clusters/',clustername,'?api-version=2015-03-01-preview',sep='') + # paste('https://management.azure.com/subscriptions/',subscriptionID,'/resourceGroups/',resourceGroup,'/providers/Microsoft.HDInsight/clusters/',clustername,'?api-version=2015-03-01-preview',sep='') # print(URL) @@ -105,7 +105,7 @@ azureSparkListSessions <- function(azureActiveContext, clustername, hdiAdmin, URL <- paste("https://", CN, ".azurehdinsight.net/livy/sessions", sep = "") # URL <- - # paste('https://management.azure.com/subscriptions/',SUBIDI,'/resourceGroups/',RGI,'/providers/Microsoft.HDInsight/clusters/',clustername,'?api-version=2015-03-01-preview',sep='') + # paste('https://management.azure.com/subscriptions/',subscriptionID,'/resourceGroups/',resourceGroup,'/providers/Microsoft.HDInsight/clusters/',clustername,'?api-version=2015-03-01-preview',sep='') # print(URL) @@ -178,7 +178,7 @@ azureSparkStopSession <- function(azureActiveContext, clustername, hdiAdmin, SI, sep = "") # URL <- - # paste('https://management.azure.com/subscriptions/',SUBIDI,'/resourceGroups/',RGI,'/providers/Microsoft.HDInsight/clusters/',clustername,'?api-version=2015-03-01-preview',sep='') + # paste('https://management.azure.com/subscriptions/',subscriptionID,'/resourceGroups/',resourceGroup,'/providers/Microsoft.HDInsight/clusters/',clustername,'?api-version=2015-03-01-preview',sep='') # print(URL) @@ -247,7 +247,7 @@ azureSparkCMD <- function(azureActiveContext, CMD, clustername, hdiAdmin, SI, "/statements", sep = "") # URL <- - # paste('https://management.azure.com/subscriptions/',SUBIDI,'/resourceGroups/',RGI,'/providers/Microsoft.HDInsight/clusters/',clustername,'?api-version=2015-03-01-preview',sep='') + # paste('https://management.azure.com/subscriptions/',subscriptionID,'/resourceGroups/',resourceGroup,'/providers/Microsoft.HDInsight/clusters/',clustername,'?api-version=2015-03-01-preview',sep='') # print(URL) print(typeof(CMD)) bodyI <- list(code = CMD) @@ -344,7 +344,7 @@ azureSparkJob <- function(azureActiveContext, FILE, clustername, hdiAdmin, URL <- paste("https://", CN, ".azurehdinsight.net/livy/batches", sep = "") # URL <- - # paste('https://management.azure.com/subscriptions/',SUBIDI,'/resourceGroups/',RGI,'/providers/Microsoft.HDInsight/clusters/',clustername,'?api-version=2015-03-01-preview',sep='') + # paste('https://management.azure.com/subscriptions/',subscriptionID,'/resourceGroups/',resourceGroup,'/providers/Microsoft.HDInsight/clusters/',clustername,'?api-version=2015-03-01-preview',sep='') # print(URL) print(typeof(CMD)) bodyI <- list(file = FILE) @@ -454,7 +454,7 @@ azureSparkListJobs <- function(azureActiveContext, clustername, hdiAdmin, URL <- paste("https://", CN, ".azurehdinsight.net/livy/batches", sep = "") # URL <- - # paste('https://management.azure.com/subscriptions/',SUBIDI,'/resourceGroups/',RGI,'/providers/Microsoft.HDInsight/clusters/',clustername,'?api-version=2015-03-01-preview',sep='') + # paste('https://management.azure.com/subscriptions/',subscriptionID,'/resourceGroups/',resourceGroup,'/providers/Microsoft.HDInsight/clusters/',clustername,'?api-version=2015-03-01-preview',sep='') # print(URL) diff --git a/R/AzureTemplate.R b/R/AzureTemplate.R index e0b5643..87c4b87 100644 --- a/R/AzureTemplate.R +++ b/R/AzureTemplate.R @@ -15,23 +15,21 @@ azureDeployTemplate <- function(azureActiveContext, deplname, templateURL, paramURL, templateJSON, paramJSON, mode = "Sync", resourceGroup, subscriptionID, - azToken, verbose = FALSE) { + verbose = FALSE) { azureCheckToken(azureActiveContext) - if (missing(azToken)) { - AT <- azureActiveContext$Token - } else (AT <- azToken) + AT <- azureActiveContext$Token if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI <- subscriptionID) + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID <- subscriptionID) if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup - } else (RGI <- resourceGroup) + resourceGroup <- azureActiveContext$resourceGroup + } else (resourceGroup <- resourceGroup) - if (!length(RGI)) { + if (!length(resourceGroup)) { stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") } - if (!length(SUBIDI)) { + if (!length(subscriptionID)) { stop("Error: No subscriptionID provided: Use SUBID argument or set in AzureContext") } if (!length(AT)) { @@ -48,8 +46,8 @@ azureDeployTemplate <- function(azureActiveContext, deplname, templateURL, verbosity <- if (verbose) httr::verbose(TRUE) else NULL - URL <- paste("https://management.azure.com/subscriptions/", SUBIDI, - "/resourceGroups/", RGI, "/providers/microsoft.resources/deployments/", + URL <- paste("https://management.azure.com/subscriptions/", subscriptionID, + "/resourceGroups/", resourceGroup, "/providers/microsoft.resources/deployments/", deplname, "?api-version=2016-06-01", sep = "") # print(URL) @@ -101,7 +99,7 @@ azureDeployTemplate <- function(azureActiveContext, deplname, templateURL, a <- 1 while (a > 0) { rc <- azureDeployStatus(azureActiveContext, deplname = deplname, - resourceGroup = RGI) + resourceGroup = resourceGroup) if (grepl("Succeeded", rc)) { message("") message(paste("Finished Deploying Sucessfully: ", Sys.time())) @@ -147,24 +145,22 @@ azureDeployTemplate <- function(azureActiveContext, deplname, templateURL, #' @family Template functions #' @export azureDeployStatus <- function(azureActiveContext, deplname, resourceGroup, - subscriptionID, azToken, verbose = FALSE) { + subscriptionID, verbose = FALSE) { azureCheckToken(azureActiveContext) - if (missing(azToken)) { - AT <- azureActiveContext$Token - } else (AT <- azToken) + AT <- azureActiveContext$Token if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI <- subscriptionID) + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID <- subscriptionID) if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup - } else (RGI <- resourceGroup) + resourceGroup <- azureActiveContext$resourceGroup + } else (resourceGroup <- resourceGroup) verbosity <- if (verbose) httr::verbose(TRUE) else NULL - if (!length(RGI)) { + if (!length(resourceGroup)) { stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") } - if (!length(SUBIDI)) { + if (!length(subscriptionID)) { stop("Error: No subscriptionID provided: Use SUBID argument or set in AzureContext") } if (!length(AT)) { @@ -174,8 +170,8 @@ azureDeployStatus <- function(azureActiveContext, deplname, resourceGroup, stop("No deplname provided") } - URL <- paste("https://management.azure.com/subscriptions/", SUBIDI, - "/resourceGroups/", RGI, "/providers/microsoft.resources/deployments/", + URL <- paste("https://management.azure.com/subscriptions/", subscriptionID, + "/resourceGroups/", resourceGroup, "/providers/microsoft.resources/deployments/", deplname, "?api-version=2016-06-01", sep = "") # print(URL) @@ -200,25 +196,23 @@ azureDeployStatus <- function(azureActiveContext, deplname, resourceGroup, #' @family Template functions #' @export azureDeleteDeploy <- function(azureActiveContext, deplname, resourceGroup, - subscriptionID, azToken, verbose = FALSE) { + subscriptionID, verbose = FALSE) { azureCheckToken(azureActiveContext) - if (missing(azToken)) { - AT <- azureActiveContext$Token - } else (AT <- azToken) + AT <- azureActiveContext$Token if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI <- subscriptionID) + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID <- subscriptionID) if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup - } else (RGI <- resourceGroup) + resourceGroup <- azureActiveContext$resourceGroup + } else (resourceGroup <- resourceGroup) verbosity <- if (verbose) httr::verbose(TRUE) else NULL - if (!length(RGI)) { + if (!length(resourceGroup)) { stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") } - if (!length(SUBIDI)) { + if (!length(subscriptionID)) { stop("Error: No subscriptionID provided: Use SUBID argument or set in AzureContext") } if (!length(AT)) { @@ -228,8 +222,8 @@ azureDeleteDeploy <- function(azureActiveContext, deplname, resourceGroup, stop("No deplname provided") } - URL <- paste("https://management.azure.com/subscriptions/", SUBIDI, - "/resourceGroups/", RGI, "/providers/microsoft.resources/deployments/", + URL <- paste("https://management.azure.com/subscriptions/", subscriptionID, + "/resourceGroups/", resourceGroup, "/providers/microsoft.resources/deployments/", deplname, "?api-version=2016-06-01", sep = "") # print(URL) @@ -252,26 +246,24 @@ azureDeleteDeploy <- function(azureActiveContext, deplname, resourceGroup, #' @family Template functions #' @export azureCancelDeploy <- function(azureActiveContext, deplname, resourceGroup, - subscriptionID, azToken, verbose = FALSE) { + subscriptionID, verbose = FALSE) { azureCheckToken(azureActiveContext) - if (missing(azToken)) { - AT <- azureActiveContext$Token - } else (AT <- azToken) + AT <- azureActiveContext$Token if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI <- subscriptionID) + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID <- subscriptionID) if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup - } else (RGI <- resourceGroup) + resourceGroup <- azureActiveContext$resourceGroup + } else (resourceGroup <- resourceGroup) verbosity <- if (verbose) httr::verbose(TRUE) else NULL - if (!length(RGI)) { + if (!length(resourceGroup)) { stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") } - if (!length(SUBIDI)) { + if (!length(subscriptionID)) { stop("Error: No subscriptionID provided: Use SUBID argument or set in AzureContext") } if (!length(AT)) { @@ -281,8 +273,8 @@ azureCancelDeploy <- function(azureActiveContext, deplname, resourceGroup, stop("No deplname provided") } - URL <- paste("https://management.azure.com/subscriptions/", SUBIDI, - "/resourceGroups/", RGI, "/providers/microsoft.resources/deployments/", + URL <- paste("https://management.azure.com/subscriptions/", subscriptionID, + "/resourceGroups/", resourceGroup, "/providers/microsoft.resources/deployments/", deplname, "/cancel?api-version=2016-06-01", sep = "") # print(URL) diff --git a/R/AzureVM.R b/R/AzureVM.R index 92b4a7e..91c66f6 100644 --- a/R/AzureVM.R +++ b/R/AzureVM.R @@ -6,32 +6,30 @@ #' @family Virtual machine functions #' @export azureListVM <- function(azureActiveContext, resourceGroup, location, subscriptionID, - azToken, verbose = FALSE) { + verbose = FALSE) { azureCheckToken(azureActiveContext) - if (missing(azToken)) { AT <- azureActiveContext$Token - } else (AT <- azToken) if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI <- subscriptionID) + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID <- subscriptionID) if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup - } else (RGI <- resourceGroup) + resourceGroup <- azureActiveContext$resourceGroup + } else (resourceGroup <- resourceGroup) verbosity <- if (verbose) httr::verbose(TRUE) else NULL - if (!length(RGI)) { + if (!length(resourceGroup)) { stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") } - if (!length(SUBIDI)) { + if (!length(subscriptionID)) { 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/virtualmachines?api-version=2015-05-01-preview", + URL <- paste("https://management.azure.com/subscriptions/", subscriptionID, + "/resourceGroups/", resourceGroup, "/providers/Microsoft.Compute/virtualmachines?api-version=2015-05-01-preview", sep = "") r <- GET(URL, add_headers(.headers = c(Host = "management.azure.com", @@ -62,8 +60,8 @@ azureListVM <- function(azureActiveContext, resourceGroup, location, subscriptio colnames(dfn) <- c("name", "location", "type", "OS", "state", "admin", "ID") - azureActiveContext$subscriptionID <- SUBIDI - azureActiveContext$resourceGroup <- RGI + azureActiveContext$subscriptionID <- subscriptionID + azureActiveContext$resourceGroup <- resourceGroup return(dfn) } @@ -78,27 +76,26 @@ azureListVM <- function(azureActiveContext, resourceGroup, location, subscriptio #' @family Virtual machine functions #' @export azureStartVM <- function(azureActiveContext, resourceGroup, vmName, mode = "Sync", - subscriptionID, azToken, verbose = FALSE) { + subscriptionID, verbose = FALSE) { azureCheckToken(azureActiveContext) - if (missing(azToken)) { - AT <- azureActiveContext$Token - } else (AT <- azToken) + AT <- azureActiveContext$Token + if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI <- subscriptionID) + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID <- subscriptionID) if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup - } else (RGI <- resourceGroup) + resourceGroup <- azureActiveContext$resourceGroup + } else (resourceGroup <- resourceGroup) if (missing(vmName)) { vmNameI <- azureActiveContext$vmNameI } else (vmNameI <- vmName) verbosity <- if (verbose) httr::verbose(TRUE) else NULL - if (!length(RGI)) { + if (!length(resourceGroup)) { stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") } - if (!length(SUBIDI)) { + if (!length(subscriptionID)) { stop("Error: No subscriptionID provided: Use SUBID argument or set in AzureContext") } if (!length(AT)) { @@ -108,8 +105,8 @@ azureStartVM <- function(azureActiveContext, resourceGroup, vmName, mode = "Sync stop("No VM name provided") } - URL <- paste("https://management.azure.com/subscriptions/", SUBIDI, - "/resourceGroups/", RGI, "/providers/Microsoft.Compute/virtualmachines/", + URL <- paste("https://management.azure.com/subscriptions/", subscriptionID, + "/resourceGroups/", resourceGroup, "/providers/Microsoft.Compute/virtualmachines/", vmNameI, "/start?api-version=2015-05-01-preview", sep = "") # print(URL) @@ -123,8 +120,8 @@ azureStartVM <- function(azureActiveContext, resourceGroup, vmName, mode = "Sync rl <- content(r, "text", encoding = "UTF-8") # print(rl) df <- fromJSON(rl) dfn <- as.data.frame(df$value$name) - azureActiveContext$subscriptionID <- SUBIDI - azureActiveContext$resourceGroup <- RGI + azureActiveContext$subscriptionID <- subscriptionID + azureActiveContext$resourceGroup <- resourceGroup azureActiveContext$vmName <- vmNameI if (toupper(mode) == "SYNC") { rc <- "running" @@ -183,28 +180,26 @@ azureStartVM <- function(azureActiveContext, resourceGroup, vmName, mode = "Sync #' @family Virtual machine functions #' @export azureStopVM <- function(azureActiveContext, resourceGroup, vmName, mode = "Sync", - subscriptionID, azToken, verbose = FALSE) { + subscriptionID, verbose = FALSE) { azureCheckToken(azureActiveContext) + AT <- azureActiveContext$Token - if (missing(azToken)) { - AT <- azureActiveContext$Token - } else (AT <- azToken) if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI <- subscriptionID) + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID <- subscriptionID) if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup - } else (RGI <- resourceGroup) + resourceGroup <- azureActiveContext$resourceGroup + } else (resourceGroup <- resourceGroup) if (missing(vmName)) { vmNameI <- azureActiveContext$vmName } else (vmNameI <- vmName) verbosity <- if (verbose) httr::verbose(TRUE) else NULL - if (!length(RGI)) { + if (!length(resourceGroup)) { stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") } - if (!length(SUBIDI)) { + if (!length(subscriptionID)) { stop("Error: No subscriptionID provided: Use SUBID argument or set in AzureContext") } if (!length(AT)) { @@ -214,8 +209,8 @@ azureStopVM <- function(azureActiveContext, resourceGroup, vmName, mode = "Sync" stop("No VM name provided") } - URL <- paste("https://management.azure.com/subscriptions/", SUBIDI, - "/resourceGroups/", RGI, "/providers/Microsoft.Compute/virtualmachines/", + URL <- paste("https://management.azure.com/subscriptions/", subscriptionID, + "/resourceGroups/", resourceGroup, "/providers/Microsoft.Compute/virtualmachines/", vmNameI, "/deallocate?api-version=2015-05-01-preview", sep = "") # print(URL) @@ -231,8 +226,8 @@ azureStopVM <- function(azureActiveContext, resourceGroup, vmName, mode = "Sync" # df <- fromJSON(rl) # dfn <- as.data.frame(df$value$name) - azureActiveContext$subscriptionID <- SUBIDI - azureActiveContext$resourceGroup <- RGI + azureActiveContext$subscriptionID <- subscriptionID + azureActiveContext$resourceGroup <- resourceGroup azureActiveContext$vmName <- vmNameI if (toupper(mode) == "SYNC") { @@ -288,28 +283,26 @@ azureStopVM <- function(azureActiveContext, resourceGroup, vmName, mode = "Sync" #' @family Virtual machine functions #' @export azureVMStatus <- function(azureActiveContext, resourceGroup, vmName, subscriptionID, - azToken, ignore = "N", verbose = FALSE) { + ignore = "N", verbose = FALSE) { azureCheckToken(azureActiveContext) + AT <- azureActiveContext$Token - if (missing(azToken)) { - AT <- azureActiveContext$Token - } else (AT <- azToken) if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI <- subscriptionID) + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID <- subscriptionID) if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup - } else (RGI <- resourceGroup) + resourceGroup <- azureActiveContext$resourceGroup + } else (resourceGroup <- resourceGroup) if (missing(vmName)) { vmNameI <- azureActiveContext$vmName } else (vmNameI <- vmName) verbosity <- if (verbose) httr::verbose(TRUE) else NULL - if (!length(RGI)) { + if (!length(resourceGroup)) { stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") } - if (!length(SUBIDI)) { + if (!length(subscriptionID)) { stop("Error: No subscriptionID provided: Use SUBID argument or set in AzureContext") } if (!length(AT)) { @@ -319,8 +312,8 @@ azureVMStatus <- function(azureActiveContext, resourceGroup, vmName, subscriptio stop("No VM name provided") } - URL <- paste("https://management.azure.com/subscriptions/", SUBIDI, - "/resourceGroups/", RGI, "/providers/Microsoft.Compute/virtualmachines/", + URL <- paste("https://management.azure.com/subscriptions/", subscriptionID, + "/resourceGroups/", resourceGroup, "/providers/Microsoft.Compute/virtualmachines/", vmNameI, "/InstanceView?api-version=2015-05-01-preview", sep = "") # print(URL) @@ -352,27 +345,26 @@ azureVMStatus <- function(azureActiveContext, resourceGroup, vmName, subscriptio #' @family Virtual machine functions #' @export azureDeleteVM <- function(azureActiveContext, resourceGroup, vmName, subscriptionID, - azToken, mode = "Sync", verbose = FALSE) { + mode = "Sync", verbose = FALSE) { azureCheckToken(azureActiveContext) - if (missing(azToken)) { - AT <- azureActiveContext$Token - } else (AT <- azToken) + AT <- azureActiveContext$Token + if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI <- subscriptionID) + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID <- subscriptionID) if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup - } else (RGI <- resourceGroup) + resourceGroup <- azureActiveContext$resourceGroup + } else (resourceGroup <- resourceGroup) if (missing(vmName)) { vmNameI <- azureActiveContext$vmNameI } else (vmNameI <- vmName) verbosity <- if (verbose) httr::verbose(TRUE) else NULL - if (!length(RGI)) { + if (!length(resourceGroup)) { stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") } - if (!length(SUBIDI)) { + if (!length(subscriptionID)) { stop("Error: No subscriptionID provided: Use SUBID argument or set in AzureContext") } if (!length(AT)) { @@ -382,8 +374,8 @@ azureDeleteVM <- function(azureActiveContext, resourceGroup, vmName, subscriptio stop("No VM name provided") } - URL <- paste("https://management.azure.com/subscriptions/", SUBIDI, - "/resourceGroups/", RGI, "/providers/Microsoft.Compute/virtualmachines/", + URL <- paste("https://management.azure.com/subscriptions/", subscriptionID, + "/resourceGroups/", resourceGroup, "/providers/Microsoft.Compute/virtualmachines/", vmNameI, "?api-version=2015-05-01-preview", sep = "") # print(URL) print(URL) @@ -401,8 +393,8 @@ azureDeleteVM <- function(azureActiveContext, resourceGroup, vmName, subscriptio # df <- fromJSON(rl) # dfn <- as.data.frame(df$value$name) - azureActiveContext$subscriptionID <- SUBIDI - azureActiveContext$resourceGroup <- RGI + azureActiveContext$subscriptionID <- subscriptionID + azureActiveContext$resourceGroup <- resourceGroup azureActiveContext$vmName <- vmNameI if (toupper(mode) == "SYNC") { @@ -450,32 +442,31 @@ azureDeleteVM <- function(azureActiveContext, resourceGroup, vmName, subscriptio #' @family Virtual machine functions #' @export azureListScaleSets <- function(azureActiveContext, resourceGroup, location, subscriptionID, - azToken, verbose = FALSE) { + verbose = FALSE) { azureCheckToken(azureActiveContext) - if (missing(azToken)) { - AT <- azureActiveContext$Token - } else (AT <- azToken) + AT <- azureActiveContext$Token + if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI <- subscriptionID) + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID <- subscriptionID) if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup - } else (RGI <- resourceGroup) + resourceGroup <- azureActiveContext$resourceGroup + } else (resourceGroup <- resourceGroup) verbosity <- if (verbose) httr::verbose(TRUE) else NULL - if (!length(RGI)) { + if (!length(resourceGroup)) { stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") } - if (!length(SUBIDI)) { + if (!length(subscriptionID)) { 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", + URL <- paste("https://management.azure.com/subscriptions/", subscriptionID, + "/resourceGroups/", resourceGroup, "/providers/Microsoft.Compute/virtualMachineScaleSets?api-version=2016-03-30", sep = "") r <- GET(URL, add_headers(.headers = c(Host = "management.azure.com", @@ -507,8 +498,8 @@ azureListScaleSets <- function(azureActiveContext, resourceGroup, location, subs colnames(dfn) <- c("name", "location", "Skuname", "skutier", "capacity", "image", "ver") - azureActiveContext$subscriptionID <- SUBIDI - azureActiveContext$resourceGroup <- RGI + azureActiveContext$subscriptionID <- subscriptionID + azureActiveContext$resourceGroup <- resourceGroup return(dfn) } @@ -521,32 +512,31 @@ azureListScaleSets <- function(azureActiveContext, resourceGroup, location, subs #' @family Virtual machine functions #' @export azureListScaleSetNetwork <- function(azureActiveContext,resourceGroup, location, subscriptionID, - azToken, verbose = FALSE) { + verbose = FALSE) { azureCheckToken(azureActiveContext) - if (missing(azToken)) { - AT <- azureActiveContext$Token - } else (AT <- azToken) + AT <- azureActiveContext$Token + if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI <- subscriptionID) + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID <- subscriptionID) if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup - } else (RGI <- resourceGroup) + resourceGroup <- azureActiveContext$resourceGroup + } else (resourceGroup <- resourceGroup) verbosity <- if (verbose) httr::verbose(TRUE) else NULL - if (!length(RGI)) { + if (!length(resourceGroup)) { stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") } - if (!length(SUBIDI)) { + if (!length(subscriptionID)) { 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", + URL <- paste("https://management.azure.com/subscriptions/", subscriptionID, + "/resourceGroups/", resourceGroup, "/providers/Microsoft.Network/loadBalancers/","?api-version=2016-03-30", sep = "") r <- GET(URL, add_headers(.headers = c(Host = "management.azure.com", @@ -560,8 +550,8 @@ azureListScaleSetNetwork <- function(azureActiveContext,resourceGroup, location, { for (lb in lbs) { - URL <- paste("https://management.azure.com/subscriptions/", SUBIDI, - "/resourceGroups/", RGI, "/providers/Microsoft.Network/loadBalancers/",lb,"?api-version=2016-03-30", + URL <- paste("https://management.azure.com/subscriptions/", subscriptionID, + "/resourceGroups/", resourceGroup, "/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) @@ -583,8 +573,8 @@ azureListScaleSetNetwork <- function(azureActiveContext,resourceGroup, location, 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", + URL <- paste("https://management.azure.com/subscriptions/", subscriptionID, + "/resourceGroups/", resourceGroup, "/providers/Microsoft.Network/publicIPAddresses","?api-version=2016-03-30", sep = "") r <- GET(URL, add_headers(.headers = c(Host = "management.azure.com", @@ -598,8 +588,8 @@ azureListScaleSetNetwork <- function(azureActiveContext,resourceGroup, location, { for (pip in pips) { - URL <- paste("https://management.azure.com/subscriptions/", SUBIDI, - "/resourceGroups/", RGI, "/providers/Microsoft.Network/publicIPAddresses/",pip,"?api-version=2016-03-30", + URL <- paste("https://management.azure.com/subscriptions/", subscriptionID, + "/resourceGroups/", resourceGroup, "/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) @@ -614,8 +604,8 @@ azureListScaleSetNetwork <- function(azureActiveContext,resourceGroup, location, } } - azureActiveContext$subscriptionID <- SUBIDI - azureActiveContext$resourceGroup <- RGI + azureActiveContext$subscriptionID <- subscriptionID + azureActiveContext$resourceGroup <- resourceGroup return(dfn) } @@ -629,27 +619,26 @@ azureListScaleSetNetwork <- function(azureActiveContext,resourceGroup, location, #' @family Virtual machine functions #' @export azureListScaleSetVM <- function(azureActiveContext, scaleSet, resourceGroup, location, subscriptionID, - azToken, verbose = FALSE) { + verbose = FALSE) { azureCheckToken(azureActiveContext) - if (missing(azToken)) { - AT <- azureActiveContext$Token - } else (AT <- azToken) + AT <- azureActiveContext$Token + if (missing(subscriptionID)) { - SUBIDI <- azureActiveContext$subscriptionID - } else (SUBIDI <- subscriptionID) + subscriptionID <- azureActiveContext$subscriptionID + } else (subscriptionID <- subscriptionID) if (missing(resourceGroup)) { - RGI <- azureActiveContext$resourceGroup - } else (RGI <- resourceGroup) + resourceGroup <- azureActiveContext$resourceGroup + } else (resourceGroup <- resourceGroup) verbosity <- if (verbose) httr::verbose(TRUE) else NULL - if (!length(RGI)) { + if (!length(resourceGroup)) { stop("Error: No resourceGroup provided: Use resourceGroup argument or set in AzureContext") } if (!length(scaleSet)) { stop("Error: No scaleSet provided") } - if (!length(SUBIDI)) { + if (!length(subscriptionID)) { stop("Error: No subscriptionID provided: Use SUBID argument or set in AzureContext") } if (!length(AT)) { @@ -657,8 +646,8 @@ azureListScaleSetVM <- function(azureActiveContext, scaleSet, resourceGroup, loc } - URL <- paste("https://management.azure.com/subscriptions/", SUBIDI, - "/resourceGroups/", RGI, "/providers/Microsoft.Compute/virtualMachineScaleSets/",scaleSet,"/virtualMachines?api-version=2016-03-30", + URL <- paste("https://management.azure.com/subscriptions/", subscriptionID, + "/resourceGroups/", resourceGroup, "/providers/Microsoft.Compute/virtualMachineScaleSets/",scaleSet,"/virtualMachines?api-version=2016-03-30", sep = "") r <- GET(URL, add_headers(.headers = c(Host = "management.azure.com", @@ -682,8 +671,8 @@ azureListScaleSetVM <- function(azureActiveContext, scaleSet, resourceGroup, loc dfn[1:clust, 4] <- df$value$properties$provisioningState colnames(dfn) <- c("name","id", "computerName", "state") - azureActiveContext$subscriptionID <- SUBIDI - azureActiveContext$resourceGroup <- RGI + azureActiveContext$subscriptionID <- subscriptionID + azureActiveContext$resourceGroup <- resourceGroup return(dfn) } diff --git a/R/methods.R b/R/methods.R index fec531a..d2a7b47 100644 --- a/R/methods.R +++ b/R/methods.R @@ -3,10 +3,9 @@ #' Functions for creating and displaying information about azureActiveContext objects. #' #' @param x Object to create, test or print -#' @param object Object to create, test or print #' @param ... Ignored #' -#' @seealso `createAzureContext` +#' @seealso [createAzureContext()] #' @export #' @rdname Internal as.azureActiveContext <- function(x){ @@ -16,13 +15,11 @@ as.azureActiveContext <- function(x){ } #' @export -#' @rdname Internal is.azureActiveContext <- function(x){ inherits(x, "azureActiveContext") } #' @export -#' @rdname Internal print.azureActiveContext <- function(x, ...){ cat("AzureSMR azureActiveContext\n") cat("Tenant ID :", x$tenantID, "\n") @@ -33,7 +30,6 @@ print.azureActiveContext <- function(x, ...){ #' @export #' @importFrom utils str -#' @rdname Internal str.azureActiveContext <- function(object, ...){ cat(("AzureSMR azureActiveContext with elements:\n")) ls.str(object, all.names = TRUE) diff --git a/man/AzureSMR-package.Rd b/man/AzureSMR-package.Rd index 533b5c7..9d92050 100644 --- a/man/AzureSMR-package.Rd +++ b/man/AzureSMR-package.Rd @@ -9,9 +9,25 @@ The AzureSMR package connects R to the Azure Service Manager API. } \details{ -This enables you to use and change many Azure resources, including: +This enables you to use and change many Azure resources. The following is an incomplete list of available functions: \itemize{ -\item Storage blobs +\item Create an Azure context: +\itemize{ +\item \code{\link[=createAzureContext]{createAzureContext()}} +} +\item Resources and resource groups: +\itemize{ +\item \code{\link[=azureListAllResources]{azureListAllResources()}} +\item \code{\link[=azureCreateResourceGroup]{azureCreateResourceGroup()}} +\item \code{\link[=azureListRG]{azureListRG()}} +} +\item Storage accounts and blobs: +\itemize{ +\item \code{\link[=azureListSA]{azureListSA()}} +\item \code{\link[=azureCreateStorageAccount]{azureCreateStorageAccount()}} +\item \code{\link[=azureListStorageContainers]{azureListStorageContainers()}} +\item \code{\link[=azureListStorageBlobs]{azureListStorageBlobs()}} +} \item HDInsight (Nodes, Hive, Spark) \item Azure Resource Manager \item Virtual Machines diff --git a/man/Internal.Rd b/man/Internal.Rd index 6a05f15..bae0436 100644 --- a/man/Internal.Rd +++ b/man/Internal.Rd @@ -2,29 +2,18 @@ % Please edit documentation in R/methods.R \name{as.azureActiveContext} \alias{as.azureActiveContext} -\alias{is.azureActiveContext} -\alias{print.azureActiveContext} -\alias{str.azureActiveContext} \title{azureActiveContext object.} \usage{ as.azureActiveContext(x) - -is.azureActiveContext(x) - -\method{print}{azureActiveContext}(x, ...) - -\method{str}{azureActiveContext}(object, ...) } \arguments{ \item{x}{Object to create, test or print} \item{...}{Ignored} - -\item{object}{Object to create, test or print} } \description{ Functions for creating and displaying information about azureActiveContext objects. } \seealso{ -\code{createAzureContext} +\code{\link[=createAzureContext]{createAzureContext()}} } diff --git a/man/azureAuthenticate.Rd b/man/azureAuthenticate.Rd index 98314d8..11eb7d4 100644 --- a/man/azureAuthenticate.Rd +++ b/man/azureAuthenticate.Rd @@ -19,7 +19,7 @@ azureAuthenticate(azureActiveContext, tenantID, clientID, authKey, \item{verbose}{Print Tracing information (Default False)} } \value{ -Retunrs Azure Tokem and sets AzureContext Token +Returns Azure token and sets AzureContext token } \description{ Authenticates against Azure Active directory application. @@ -31,5 +31,5 @@ See \url{https://azure.microsoft.com/en-us/documentation/articles/resource-group \url{https://azure.microsoft.com/en-us/documentation/articles/resource-group-create-service-principal-portal/} } \seealso{ -Other Resources: \code{\link{azureCheckToken}} +Other Azure resource functions: \code{\link{azureCheckToken}} } diff --git a/man/azureBlobCD.Rd b/man/azureBlobCD.Rd index 7e6cc4d..c90ead6 100644 --- a/man/azureBlobCD.Rd +++ b/man/azureBlobCD.Rd @@ -12,7 +12,7 @@ azureBlobCD(azureActiveContext, directory, container, file, storageAccount, \item{directory}{Blob store directory to list for content} -\item{container}{Storage container name. See \code{azureListStorageContainers}} +\item{container}{Storage container name. See \code{\link[=azureListStorageContainers]{azureListStorageContainers()}}} \item{file}{\itemize{ \item Local filename to store in Azure blob @@ -30,7 +30,7 @@ azureBlobCD(azureActiveContext, directory, container, file, storageAccount, Azure blob change current directory. } \seealso{ -Other blob store functions: \code{\link{azureBlobFind}}, +Other Blob store functions: \code{\link{azureBlobFind}}, \code{\link{azureBlobLS}}, \code{\link{azureDeleteBlob}}, \code{\link{azureGetBlob}}, \code{\link{azureListStorageBlobs}}, diff --git a/man/azureBlobFind.Rd b/man/azureBlobFind.Rd index bb27caf..7cf2968 100644 --- a/man/azureBlobFind.Rd +++ b/man/azureBlobFind.Rd @@ -18,7 +18,7 @@ azureBlobFind(azureActiveContext, file, storageAccount, storageKey, container, \item{storageKey}{Storage key associated with storage account} -\item{container}{Storage container name. See \code{azureListStorageContainers}} +\item{container}{Storage container name. See \code{\link[=azureListStorageContainers]{azureListStorageContainers()}}} \item{resourceGroup}{Name of the resource group} @@ -28,7 +28,7 @@ azureBlobFind(azureActiveContext, file, storageAccount, storageKey, container, Find file in a Storage account directory. } \seealso{ -Other blob store functions: \code{\link{azureBlobCD}}, +Other Blob store functions: \code{\link{azureBlobCD}}, \code{\link{azureBlobLS}}, \code{\link{azureDeleteBlob}}, \code{\link{azureGetBlob}}, \code{\link{azureListStorageBlobs}}, diff --git a/man/azureBlobLS.Rd b/man/azureBlobLS.Rd index befce6e..ac826f6 100644 --- a/man/azureBlobLS.Rd +++ b/man/azureBlobLS.Rd @@ -18,7 +18,7 @@ azureBlobLS(azureActiveContext, directory, recursive = FALSE, storageAccount, \item{storageKey}{Storage key associated with storage account} -\item{container}{Storage container name. See \code{azureListStorageContainers}} +\item{container}{Storage container name. See \code{\link[=azureListStorageContainers]{azureListStorageContainers()}}} \item{resourceGroup}{Name of the resource group} @@ -28,7 +28,7 @@ azureBlobLS(azureActiveContext, directory, recursive = FALSE, storageAccount, List blob files in a Storage account directory. } \seealso{ -Other blob store functions: \code{\link{azureBlobCD}}, +Other Blob store functions: \code{\link{azureBlobCD}}, \code{\link{azureBlobFind}}, \code{\link{azureDeleteBlob}}, \code{\link{azureGetBlob}}, diff --git a/man/azureCancelDeploy.Rd b/man/azureCancelDeploy.Rd index 93bca0c..15974aa 100644 --- a/man/azureCancelDeploy.Rd +++ b/man/azureCancelDeploy.Rd @@ -5,7 +5,7 @@ \title{Cancel Template Deployment.} \usage{ azureCancelDeploy(azureActiveContext, deplname, resourceGroup, subscriptionID, - azToken, verbose = FALSE) + verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} @@ -14,9 +14,7 @@ azureCancelDeploy(azureActiveContext, deplname, resourceGroup, subscriptionID, \item{resourceGroup}{Name of the resource group} -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} - -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{verbose}{Print Tracing information (Default False)} } diff --git a/man/azureCheckToken.Rd b/man/azureCheckToken.Rd index 6ea6407..9c689aa 100644 --- a/man/azureCheckToken.Rd +++ b/man/azureCheckToken.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/AzureAuthenticate.R \name{azureCheckToken} \alias{azureCheckToken} -\title{Check the timestamp of a Token and Renew if needed.} +\title{Check the timestamp of a token and renew if needed.} \usage{ azureCheckToken(azureActiveContext) } @@ -10,8 +10,8 @@ azureCheckToken(azureActiveContext) \item{azureActiveContext}{A container used for caching variables used by AzureSMR} } \description{ -Check the timestamp of a Token and Renew if needed. +Check the timestamp of a token and renew if needed. } \seealso{ -Other Resources: \code{\link{azureAuthenticate}} +Other Azure resource functions: \code{\link{azureAuthenticate}} } diff --git a/man/azureCreateHDI.Rd b/man/azureCreateHDI.Rd index 909bd3c..46e6eca 100644 --- a/man/azureCreateHDI.Rd +++ b/man/azureCreateHDI.Rd @@ -7,13 +7,13 @@ 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, vmSize = "Large", azToken, + hiveDB, hiveUser, hivePassword, resourceGroup, vmSize = "Large", subscriptionID, mode = "Sync", verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} -\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{azureCreateHDI}} +\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{\link[=azureCreateHDI]{azureCreateHDI()}}} \item{location}{Azure region, e.g. 'westeurope' or 'southcentralus'} @@ -49,9 +49,7 @@ azureCreateHDI(azureActiveContext, clustername, location, kind = "spark", \item{vmSize}{Size of nodes: "Large", "Small", "Standard_D14_V2", etc.} -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} - -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{mode}{Provisioning mode, "Sync" or "Async". Use "Async" to immediately return to R session after submission of request} diff --git a/man/azureCreateResourceGroup.Rd b/man/azureCreateResourceGroup.Rd index 9b4d115..2738124 100644 --- a/man/azureCreateResourceGroup.Rd +++ b/man/azureCreateResourceGroup.Rd @@ -5,7 +5,7 @@ \title{Create a resourceGroup.} \usage{ azureCreateResourceGroup(azureActiveContext, resourceGroup, location, - subscriptionID, azToken, verbose = FALSE) + subscriptionID, verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} @@ -14,9 +14,7 @@ azureCreateResourceGroup(azureActiveContext, resourceGroup, location, \item{location}{Azure region, e.g. 'westeurope' or 'southcentralus'} -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} - -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{verbose}{Print Tracing information (Default False)} } diff --git a/man/azureCreateStorageAccount.Rd b/man/azureCreateStorageAccount.Rd index fe836da..e071f4e 100644 --- a/man/azureCreateStorageAccount.Rd +++ b/man/azureCreateStorageAccount.Rd @@ -16,7 +16,7 @@ azureCreateStorageAccount(azureActiveContext, storageAccount, \item{resourceGroup}{Name of the resource group} -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{verbose}{Print Tracing information (Default False)} } diff --git a/man/azureCreateStorageContainer.Rd b/man/azureCreateStorageContainer.Rd index 9edef27..8bd4896 100644 --- a/man/azureCreateStorageContainer.Rd +++ b/man/azureCreateStorageContainer.Rd @@ -5,12 +5,12 @@ \title{Create Storage containers in a specified Storage Account.} \usage{ azureCreateStorageContainer(azureActiveContext, container, storageAccount, - storageKey, resourceGroup, azToken, subscriptionID, verbose = FALSE) + storageKey, resourceGroup, subscriptionID, verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} -\item{container}{Storage container name. See \code{azureListStorageContainers}} +\item{container}{Storage container name. See \code{\link[=azureListStorageContainers]{azureListStorageContainers()}}} \item{storageAccount}{Name of the azure storage account} @@ -18,9 +18,7 @@ azureCreateStorageContainer(azureActiveContext, container, storageAccount, \item{resourceGroup}{Name of the resource group} -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} - -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{verbose}{Print Tracing information (Default False)} } @@ -28,6 +26,6 @@ azureCreateStorageContainer(azureActiveContext, container, storageAccount, Create Storage containers in a specified Storage Account. } \seealso{ -Other container functions: \code{\link{azureDeleteStorageContainer}}, +Other Container functions: \code{\link{azureDeleteStorageContainer}}, \code{\link{azureListStorageContainers}} } diff --git a/man/azureDeleteBlob.Rd b/man/azureDeleteBlob.Rd index 85cef36..152737c 100644 --- a/man/azureDeleteBlob.Rd +++ b/man/azureDeleteBlob.Rd @@ -18,7 +18,7 @@ azureDeleteBlob(azureActiveContext, blob, directory, storageAccount, storageKey, \item{storageKey}{Storage key associated with storage account} -\item{container}{Storage container name. See \code{azureListStorageContainers}} +\item{container}{Storage container name. See \code{\link[=azureListStorageContainers]{azureListStorageContainers()}}} \item{resourceGroup}{Name of the resource group} @@ -28,7 +28,7 @@ azureDeleteBlob(azureActiveContext, blob, directory, storageAccount, storageKey, Delete a specifed Storage blob. } \seealso{ -Other blob store functions: \code{\link{azureBlobCD}}, +Other Blob store functions: \code{\link{azureBlobCD}}, \code{\link{azureBlobFind}}, \code{\link{azureBlobLS}}, \code{\link{azureGetBlob}}, \code{\link{azureListStorageBlobs}}, diff --git a/man/azureDeleteDeploy.Rd b/man/azureDeleteDeploy.Rd index fc077ca..8745607 100644 --- a/man/azureDeleteDeploy.Rd +++ b/man/azureDeleteDeploy.Rd @@ -5,7 +5,7 @@ \title{Delete Template Deployment.} \usage{ azureDeleteDeploy(azureActiveContext, deplname, resourceGroup, subscriptionID, - azToken, verbose = FALSE) + verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} @@ -14,9 +14,7 @@ azureDeleteDeploy(azureActiveContext, deplname, resourceGroup, subscriptionID, \item{resourceGroup}{Name of the resource group} -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} - -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{verbose}{Print Tracing information (Default False)} } diff --git a/man/azureDeleteHDI.Rd b/man/azureDeleteHDI.Rd index d262d2e..4528c48 100644 --- a/man/azureDeleteHDI.Rd +++ b/man/azureDeleteHDI.Rd @@ -4,17 +4,15 @@ \alias{azureDeleteHDI} \title{Delete Specifed HDInsight Cluster.} \usage{ -azureDeleteHDI(azureActiveContext, clustername, azToken, subscriptionID, - resourceGroup, verbose = FALSE) +azureDeleteHDI(azureActiveContext, clustername, subscriptionID, resourceGroup, + verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} -\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{azureCreateHDI}} +\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{\link[=azureCreateHDI]{azureCreateHDI()}}} -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} - -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{resourceGroup}{Name of the resource group} diff --git a/man/azureDeleteResourceGroup.Rd b/man/azureDeleteResourceGroup.Rd index 15504c2..b1f4323 100644 --- a/man/azureDeleteResourceGroup.Rd +++ b/man/azureDeleteResourceGroup.Rd @@ -5,16 +5,14 @@ \title{Delete a resourceGroup with all Resources.} \usage{ azureDeleteResourceGroup(azureActiveContext, resourceGroup, subscriptionID, - azToken, type, verbose = FALSE) + type, verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} \item{resourceGroup}{Name of the resource group} -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} - -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{type}{filter by resource type} diff --git a/man/azureDeleteStorageContainer.Rd b/man/azureDeleteStorageContainer.Rd index ef8aa03..68249b4 100644 --- a/man/azureDeleteStorageContainer.Rd +++ b/man/azureDeleteStorageContainer.Rd @@ -5,12 +5,12 @@ \title{Delete Storage container in a specified Storage Account.} \usage{ azureDeleteStorageContainer(azureActiveContext, container, storageAccount, - storageKey, resourceGroup, azToken, subscriptionID, verbose = FALSE) + storageKey, resourceGroup, subscriptionID, verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} -\item{container}{Storage container name. See \code{azureListStorageContainers}} +\item{container}{Storage container name. See \code{\link[=azureListStorageContainers]{azureListStorageContainers()}}} \item{storageAccount}{Name of the azure storage account} @@ -18,9 +18,7 @@ azureDeleteStorageContainer(azureActiveContext, container, storageAccount, \item{resourceGroup}{Name of the resource group} -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} - -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{verbose}{Print Tracing information (Default False)} } @@ -28,6 +26,6 @@ azureDeleteStorageContainer(azureActiveContext, container, storageAccount, Delete Storage container in a specified Storage Account. } \seealso{ -Other container functions: \code{\link{azureCreateStorageContainer}}, +Other Container functions: \code{\link{azureCreateStorageContainer}}, \code{\link{azureListStorageContainers}} } diff --git a/man/azureDeleteVM.Rd b/man/azureDeleteVM.Rd index 27682ec..92a30b0 100644 --- a/man/azureDeleteVM.Rd +++ b/man/azureDeleteVM.Rd @@ -5,7 +5,7 @@ \title{Delete a Virtual Machine.} \usage{ azureDeleteVM(azureActiveContext, resourceGroup, vmName, subscriptionID, - azToken, mode = "Sync", verbose = FALSE) + mode = "Sync", verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} @@ -14,9 +14,7 @@ azureDeleteVM(azureActiveContext, resourceGroup, vmName, subscriptionID, \item{vmName}{Virtual Machine name} -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} - -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{mode}{Wait for operation to complete 'Sync' (Default)} diff --git a/man/azureDeletestorageAccount.Rd b/man/azureDeletestorageAccount.Rd index e1effe7..ba1b784 100644 --- a/man/azureDeletestorageAccount.Rd +++ b/man/azureDeletestorageAccount.Rd @@ -14,7 +14,7 @@ azureDeletestorageAccount(azureActiveContext, storageAccount, resourceGroup, \item{resourceGroup}{Name of the resource group} -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{verbose}{Print Tracing information (Default False)} } diff --git a/man/azureDeployStatus.Rd b/man/azureDeployStatus.Rd index 3a67188..f335672 100644 --- a/man/azureDeployStatus.Rd +++ b/man/azureDeployStatus.Rd @@ -5,7 +5,7 @@ \title{Check Template Deployment Status.} \usage{ azureDeployStatus(azureActiveContext, deplname, resourceGroup, subscriptionID, - azToken, verbose = FALSE) + verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} @@ -14,9 +14,7 @@ azureDeployStatus(azureActiveContext, deplname, resourceGroup, subscriptionID, \item{resourceGroup}{Name of the resource group} -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} - -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{verbose}{Print Tracing information (Default False)} } diff --git a/man/azureDeployTemplate.Rd b/man/azureDeployTemplate.Rd index c908850..b5cf9c6 100644 --- a/man/azureDeployTemplate.Rd +++ b/man/azureDeployTemplate.Rd @@ -6,7 +6,7 @@ \usage{ azureDeployTemplate(azureActiveContext, deplname, templateURL, paramURL, templateJSON, paramJSON, mode = "Sync", resourceGroup, subscriptionID, - azToken, verbose = FALSE) + verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} @@ -25,9 +25,7 @@ azureDeployTemplate(azureActiveContext, deplname, templateURL, paramURL, \item{resourceGroup}{Name of the resource group} -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} - -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{verbose}{Print Tracing information (Default False)} } diff --git a/man/azureGetBlob.Rd b/man/azureGetBlob.Rd index e8798e4..9a44c3a 100644 --- a/man/azureGetBlob.Rd +++ b/man/azureGetBlob.Rd @@ -14,13 +14,13 @@ azureGetBlob(azureActiveContext, blob, directory, type = "text", \item{directory}{Blob store directory to list for content} -\item{type}{String, either "text" or "raw". Passed to \code{httr::content}} +\item{type}{String, either "text" or "raw". Passed to \code{\link[httr:content]{httr::content()}}} \item{storageAccount}{Name of the azure storage account} \item{storageKey}{Storage key associated with storage account} -\item{container}{Storage container name. See \code{azureListStorageContainers}} +\item{container}{Storage container name. See \code{\link[=azureListStorageContainers]{azureListStorageContainers()}}} \item{resourceGroup}{Name of the resource group} @@ -30,7 +30,7 @@ azureGetBlob(azureActiveContext, blob, directory, type = "text", Get contents from a specifed Storage blob. } \seealso{ -Other blob store functions: \code{\link{azureBlobCD}}, +Other Blob store functions: \code{\link{azureBlobCD}}, \code{\link{azureBlobFind}}, \code{\link{azureBlobLS}}, \code{\link{azureDeleteBlob}}, \code{\link{azureListStorageBlobs}}, diff --git a/man/azureHDIConf.Rd b/man/azureHDIConf.Rd index 5419d60..f936489 100644 --- a/man/azureHDIConf.Rd +++ b/man/azureHDIConf.Rd @@ -2,21 +2,19 @@ % Please edit documentation in R/AzureHDI.R \name{azureHDIConf} \alias{azureHDIConf} -\title{Get Configuration Information for a specified clustername.} +\title{Get Configuration Information for a specified cluster name.} \usage{ azureHDIConf(azureActiveContext, clustername, resourceGroup, subscriptionID, - azToken, name, type, location, verbose = FALSE) + name, type, location, verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} -\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{azureCreateHDI}} +\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{\link[=azureCreateHDI]{azureCreateHDI()}}} \item{resourceGroup}{Name of the resource group} -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} - -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{name}{filter by resource name} @@ -30,7 +28,7 @@ azureHDIConf(azureActiveContext, clustername, resourceGroup, subscriptionID, Returns Dataframe of HDInsight Clusters information } \description{ -Get Configuration Information for a specified clustername. +Get Configuration Information for a specified cluster name. } \seealso{ Other HDInsight functions: \code{\link{azureCreateHDI}}, diff --git a/man/azureHiveSQL.Rd b/man/azureHiveSQL.Rd index 28e69fb..5f54b1c 100644 --- a/man/azureHiveSQL.Rd +++ b/man/azureHiveSQL.Rd @@ -12,7 +12,7 @@ azureHiveSQL(azureActiveContext, CMD, clustername, hdiAdmin, hdiPassword, \item{CMD}{SQl COmmand String} -\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{azureCreateHDI}} +\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{\link[=azureCreateHDI]{azureCreateHDI()}}} \item{hdiAdmin}{HDInsight admin username} diff --git a/man/azureHiveStatus.Rd b/man/azureHiveStatus.Rd index 838e849..6f2f2ee 100644 --- a/man/azureHiveStatus.Rd +++ b/man/azureHiveStatus.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/AzureHive.R \name{azureHiveStatus} \alias{azureHiveStatus} -\title{Get Status of a HDI Hive Service/version.} +\title{Get Status of a HDI Hive Service / version.} \usage{ azureHiveStatus(azureActiveContext, clustername, hdiAdmin, hdiPassword, verbose = FALSE) @@ -10,7 +10,7 @@ azureHiveStatus(azureActiveContext, clustername, hdiAdmin, hdiPassword, \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} -\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{azureCreateHDI}} +\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{\link[=azureCreateHDI]{azureCreateHDI()}}} \item{hdiAdmin}{HDInsight admin username} @@ -19,7 +19,7 @@ azureHiveStatus(azureActiveContext, clustername, hdiAdmin, hdiPassword, \item{verbose}{Print Tracing information (Default False)} } \description{ -Get Status of a HDI Hive Service/version. +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 d50ce49..efc5745 100644 --- a/man/azureListAllResources.Rd +++ b/man/azureListAllResources.Rd @@ -4,17 +4,15 @@ \alias{azureListAllResources} \title{Get all Resource in default Subscription.} \usage{ -azureListAllResources(azureActiveContext, resourceGroup, subscriptionID, - azToken, name, type, location, verbose = FALSE) +azureListAllResources(azureActiveContext, resourceGroup, subscriptionID, name, + type, location, verbose = FALSE) } \arguments{ \item{azureActiveContext}{Azure Context Object} -\item{resourceGroup}{resourceGroup Object (or use azureActiveContext)} +\item{resourceGroup}{resourceGroup Object (or use \code{azureActiveContext})} -\item{subscriptionID}{subscriptionID Object (or use azureActiveContext)} - -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} +\item{subscriptionID}{subscriptionID Object (or use \code{azureActiveContext})} \item{name}{filter by resource name} diff --git a/man/azureListHDI.Rd b/man/azureListHDI.Rd index fa7a7fa..2191e71 100644 --- a/man/azureListHDI.Rd +++ b/man/azureListHDI.Rd @@ -2,21 +2,19 @@ % Please edit documentation in R/AzureHDI.R \name{azureListHDI} \alias{azureListHDI} -\title{Get all HDInsight Clusters in default Subscription or details for a specified clustername.} +\title{Get all HDInsight Clusters in default Subscription or details for a specified cluster name.} \usage{ azureListHDI(azureActiveContext, resourceGroup, clustername = "*", - subscriptionID, azToken, name, type, location, verbose = FALSE) + subscriptionID, name, type, location, verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} \item{resourceGroup}{Name of the resource group} -\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{azureCreateHDI}} +\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{\link[=azureCreateHDI]{azureCreateHDI()}}} -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} - -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{name}{filter by resource name} @@ -30,7 +28,7 @@ azureListHDI(azureActiveContext, resourceGroup, clustername = "*", Returns Dataframe of HDInsight Clusters } \description{ -Get all HDInsight Clusters in default Subscription or details for a specified clustername. +Get all HDInsight Clusters in default Subscription or details for a specified cluster name. } \seealso{ Other HDInsight functions: \code{\link{azureCreateHDI}}, diff --git a/man/azureListRG.Rd b/man/azureListRG.Rd index 20affb0..164f4a1 100644 --- a/man/azureListRG.Rd +++ b/man/azureListRG.Rd @@ -2,24 +2,19 @@ % 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) +azureListRG(azureActiveContext, subscriptionID, verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} - -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{verbose}{Print Tracing information (Default False)} } \value{ -Returns Dataframe of resourceGroups +Dataframe of resourceGroups } \description{ Get all resource groups in subscription ID. diff --git a/man/azureListSA.Rd b/man/azureListSA.Rd index c362dbf..5069001 100644 --- a/man/azureListSA.Rd +++ b/man/azureListSA.Rd @@ -12,7 +12,7 @@ azureListSA(azureActiveContext, resourceGroup, subscriptionID, \item{resourceGroup}{Name of the resource group} -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{verbose}{Print Tracing information (Default False)} } diff --git a/man/azureListScaleSetNetwork.Rd b/man/azureListScaleSetNetwork.Rd index 7cbad92..6f33d0c 100644 --- a/man/azureListScaleSetNetwork.Rd +++ b/man/azureListScaleSetNetwork.Rd @@ -5,7 +5,7 @@ \title{List scale set network information with a ResourceGroup} \usage{ azureListScaleSetNetwork(azureActiveContext, resourceGroup, location, - subscriptionID, azToken, verbose = FALSE) + subscriptionID, verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} @@ -14,9 +14,7 @@ azureListScaleSetNetwork(azureActiveContext, resourceGroup, location, \item{location}{Azure region, e.g. 'westeurope' or 'southcentralus'} -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} - -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{verbose}{Print Tracing information (Default False)} } diff --git a/man/azureListScaleSetVM.Rd b/man/azureListScaleSetVM.Rd index 4512c48..c9a839e 100644 --- a/man/azureListScaleSetVM.Rd +++ b/man/azureListScaleSetVM.Rd @@ -5,7 +5,7 @@ \title{List VMs within a scale set} \usage{ azureListScaleSetVM(azureActiveContext, scaleSet, resourceGroup, location, - subscriptionID, azToken, verbose = FALSE) + subscriptionID, verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} @@ -16,9 +16,7 @@ azureListScaleSetVM(azureActiveContext, scaleSet, resourceGroup, location, \item{location}{Azure region, e.g. 'westeurope' or 'southcentralus'} -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} - -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{verbose}{Print Tracing information (Default False)} } diff --git a/man/azureListScaleSets.Rd b/man/azureListScaleSets.Rd index 38f9fd4..178f4a5 100644 --- a/man/azureListScaleSets.Rd +++ b/man/azureListScaleSets.Rd @@ -5,7 +5,7 @@ \title{List scale sets within a resource group.} \usage{ azureListScaleSets(azureActiveContext, resourceGroup, location, subscriptionID, - azToken, verbose = FALSE) + verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} @@ -14,9 +14,7 @@ azureListScaleSets(azureActiveContext, resourceGroup, location, subscriptionID, \item{location}{Azure region, e.g. 'westeurope' or 'southcentralus'} -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} - -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{verbose}{Print Tracing information (Default False)} } diff --git a/man/azureListStorageBlobs.Rd b/man/azureListStorageBlobs.Rd index 64b7e6b..1edd6b7 100644 --- a/man/azureListStorageBlobs.Rd +++ b/man/azureListStorageBlobs.Rd @@ -14,11 +14,11 @@ azureListStorageBlobs(azureActiveContext, storageAccount, storageKey, container, \item{storageKey}{Storage key associated with storage account} -\item{container}{Storage container name. See \code{azureListStorageContainers}} +\item{container}{Storage container name. See \code{\link[=azureListStorageContainers]{azureListStorageContainers()}}} \item{resourceGroup}{Name of the resource group} -\item{maxresults}{Optional. Specifies the maximum number of blobs to return, including all BlobPrefix elements. If the request does not specify maxresults or specifies a value greater than 5,000, the server will return up to 5,000 items. Setting maxresults to a value less than or equal to zero results in error response code 400 (Bad Request).} +\item{maxresults}{Optional. Specifies the maximum number of blobs to return, including all BlobPrefix elements. If the request does not specify maxresults or specifies a value greater than 5,000, the server will return up to 5,000 items. Setting \code{maxresults} to a value less than or equal to zero results in error response code 400 (Bad Request).} \item{prefix}{Optional. Filters the results to return only blobs whose names begin with the specified prefix.} @@ -29,13 +29,13 @@ azureListStorageBlobs(azureActiveContext, storageAccount, storageKey, container, \item{verbose}{Print Tracing information (Default False)} } \value{ -Returns a data frame. This data frame has an attribute called "marker" that can be used with the "marker" argument to return the next set of values. +Returns a data frame. This data frame has an attribute called \code{marker} that can be used with the \code{marker} argument to return the next set of values. } \description{ List storage blobs for specified storage account. } \seealso{ -Other blob store functions: \code{\link{azureBlobCD}}, +Other Blob store functions: \code{\link{azureBlobCD}}, \code{\link{azureBlobFind}}, \code{\link{azureBlobLS}}, \code{\link{azureDeleteBlob}}, \code{\link{azureGetBlob}}, \code{\link{azurePutBlob}} diff --git a/man/azureListStorageContainers.Rd b/man/azureListStorageContainers.Rd index d630e63..e9dc4e9 100644 --- a/man/azureListStorageContainers.Rd +++ b/man/azureListStorageContainers.Rd @@ -5,7 +5,7 @@ \title{List Storage containers for Specified Storage Account.} \usage{ azureListStorageContainers(azureActiveContext, storageAccount, storageKey, - resourceGroup, azToken, subscriptionID, verbose = FALSE) + resourceGroup, subscriptionID, verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} @@ -16,9 +16,7 @@ azureListStorageContainers(azureActiveContext, storageAccount, storageKey, \item{resourceGroup}{Name of the resource group} -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} - -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{verbose}{Print Tracing information (Default False)} } @@ -26,6 +24,6 @@ azureListStorageContainers(azureActiveContext, storageAccount, storageKey, List Storage containers for Specified Storage Account. } \seealso{ -Other container functions: \code{\link{azureCreateStorageContainer}}, +Other Container functions: \code{\link{azureCreateStorageContainer}}, \code{\link{azureDeleteStorageContainer}} } diff --git a/man/azureListSubscriptions.Rd b/man/azureListSubscriptions.Rd index f08bf19..d98f7a4 100644 --- a/man/azureListSubscriptions.Rd +++ b/man/azureListSubscriptions.Rd @@ -2,22 +2,20 @@ % Please edit documentation in R/AzureResources.R \name{azureListSubscriptions} \alias{azureListSubscriptions} -\title{Get available Subscriptions.} +\title{Get available subscriptions.} \usage{ -azureListSubscriptions(azureActiveContext, azToken, verbose = FALSE) +azureListSubscriptions(azureActiveContext, verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} - \item{verbose}{Print Tracing information (Default False)} } \value{ -Returns Dataframe of subscriptionID sets AzureContext subscriptionID +Dataframe of subscriptionID; Sets AzureContext subscriptionID } \description{ -Get available Subscriptions. +Get available subscriptions. } \seealso{ Other Resource group functions: \code{\link{azureCreateResourceGroup}}, diff --git a/man/azureListVM.Rd b/man/azureListVM.Rd index 14eb30e..c052172 100644 --- a/man/azureListVM.Rd +++ b/man/azureListVM.Rd @@ -5,7 +5,7 @@ \title{List VMs in a Subscription.} \usage{ azureListVM(azureActiveContext, resourceGroup, location, subscriptionID, - azToken, verbose = FALSE) + verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} @@ -14,9 +14,7 @@ azureListVM(azureActiveContext, resourceGroup, location, subscriptionID, \item{location}{Azure region, e.g. 'westeurope' or 'southcentralus'} -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} - -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{verbose}{Print Tracing information (Default False)} } diff --git a/man/azurePutBlob.Rd b/man/azurePutBlob.Rd index 023d93d..178c024 100644 --- a/man/azurePutBlob.Rd +++ b/man/azurePutBlob.Rd @@ -26,7 +26,7 @@ azurePutBlob(azureActiveContext, blob, contents = "", file = "", directory, \item{storageKey}{Storage key associated with storage account} -\item{container}{Storage container name. See \code{azureListStorageContainers}} +\item{container}{Storage container name. See \code{\link[=azureListStorageContainers]{azureListStorageContainers()}}} \item{resourceGroup}{Name of the resource group} @@ -36,7 +36,7 @@ azurePutBlob(azureActiveContext, blob, contents = "", file = "", directory, Write contents to a specifed Storage blob. } \seealso{ -Other blob store functions: \code{\link{azureBlobCD}}, +Other Blob store functions: \code{\link{azureBlobCD}}, \code{\link{azureBlobFind}}, \code{\link{azureBlobLS}}, \code{\link{azureDeleteBlob}}, \code{\link{azureGetBlob}}, diff --git a/man/azureResizeHDI.Rd b/man/azureResizeHDI.Rd index 9044d90..99631b8 100644 --- a/man/azureResizeHDI.Rd +++ b/man/azureResizeHDI.Rd @@ -5,12 +5,12 @@ \title{Resize a HDInsight Cluster role.} \usage{ azureResizeHDI(azureActiveContext, clustername, role = "worker", size = 2, - mode = "Sync", azToken, subscriptionID, resourceGroup, verbose = FALSE) + mode = "Sync", subscriptionID, resourceGroup, verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} -\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{azureCreateHDI}} +\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{\link[=azureCreateHDI]{azureCreateHDI()}}} \item{role}{role type: 'worker', 'head' or 'Edge'} @@ -18,9 +18,7 @@ azureResizeHDI(azureActiveContext, clustername, role = "worker", size = 2, \item{mode}{Provisioning mode, "Sync" or "Async". Use "Async" to immediately return to R session after submission of request} -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} - -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{resourceGroup}{Name of the resource group} diff --git a/man/azureRunScriptAction.Rd b/man/azureRunScriptAction.Rd index bde1090..9ecd120 100644 --- a/man/azureRunScriptAction.Rd +++ b/man/azureRunScriptAction.Rd @@ -6,7 +6,7 @@ \usage{ azureRunScriptAction(azureActiveContext, scriptname = "script1", scriptURL, headNode = TRUE, workerNode = FALSE, edgeNode = FALSE, clustername, - resourceGroup, parameters = "", azToken, subscriptionID, verbose = FALSE) + resourceGroup, parameters = "", subscriptionID, verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} @@ -21,15 +21,13 @@ azureRunScriptAction(azureActiveContext, scriptname = "script1", scriptURL, \item{edgeNode}{install on worker nodes (default FALSE)} -\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{azureCreateHDI}} +\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{\link[=azureCreateHDI]{azureCreateHDI()}}} \item{resourceGroup}{Name of the resource group} \item{parameters}{parameters} -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} - -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{verbose}{Print Tracing information (Default False)} } diff --git a/man/azureSAGetKey.Rd b/man/azureSAGetKey.Rd index 7dd54d0..e3d0855 100644 --- a/man/azureSAGetKey.Rd +++ b/man/azureSAGetKey.Rd @@ -14,7 +14,7 @@ azureSAGetKey(azureActiveContext, storageAccount, resourceGroup, subscriptionID, \item{resourceGroup}{Name of the resource group} -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{verbose}{Print Tracing information (Default False)} } diff --git a/man/azureScriptActionHistory.Rd b/man/azureScriptActionHistory.Rd index e2a585b..50fef98 100644 --- a/man/azureScriptActionHistory.Rd +++ b/man/azureScriptActionHistory.Rd @@ -2,21 +2,19 @@ % Please edit documentation in R/AzureHDI.R \name{azureScriptActionHistory} \alias{azureScriptActionHistory} -\title{Get all HDInsight Script Action History for a specified clustername.} +\title{Get all HDInsight Script Action History for a specified cluster name.} \usage{ azureScriptActionHistory(azureActiveContext, resourceGroup, clustername = "*", - subscriptionID, azToken, name, type, verbose = FALSE) + subscriptionID, name, type, verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} \item{resourceGroup}{Name of the resource group} -\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{azureCreateHDI}} +\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{\link[=azureCreateHDI]{azureCreateHDI()}}} -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} - -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{name}{filter by resource name} @@ -25,10 +23,10 @@ azureScriptActionHistory(azureActiveContext, resourceGroup, clustername = "*", \item{verbose}{Print Tracing information (Default False)} } \value{ -Returns Dataframe of HDInsight Clusters +Dataframe of HDInsight Clusters } \description{ -Get all HDInsight Script Action History for a specified clustername. +Get all HDInsight Script Action History for a specified cluster name. } \seealso{ Other HDInsight functions: \code{\link{azureCreateHDI}}, diff --git a/man/azureSparkCMD.Rd b/man/azureSparkCMD.Rd index 55bed95..04ee67d 100644 --- a/man/azureSparkCMD.Rd +++ b/man/azureSparkCMD.Rd @@ -12,13 +12,13 @@ azureSparkCMD(azureActiveContext, CMD, clustername, hdiAdmin, hdiPassword, \item{CMD}{CMD} -\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{azureCreateHDI}} +\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{\link[=azureCreateHDI]{azureCreateHDI()}}} \item{hdiAdmin}{HDInsight admin username} \item{hdiPassword}{HDInsight admin password} -\item{sessionID}{Spark sessionID. See \code{azureSparkCMD}} +\item{sessionID}{Spark sessionID. See \code{\link[=azureSparkCMD]{azureSparkCMD()}}} \item{verbose}{Print Tracing information (Default False)} } diff --git a/man/azureSparkJob.Rd b/man/azureSparkJob.Rd index d41a6f0..97e58d8 100644 --- a/man/azureSparkJob.Rd +++ b/man/azureSparkJob.Rd @@ -12,7 +12,7 @@ azureSparkJob(azureActiveContext, FILE, clustername, hdiAdmin, hdiPassword, \item{FILE}{file} -\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{azureCreateHDI}} +\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{\link[=azureCreateHDI]{azureCreateHDI()}}} \item{hdiAdmin}{HDInsight admin username} diff --git a/man/azureSparkListJobs.Rd b/man/azureSparkListJobs.Rd index e13f988..7b82115 100644 --- a/man/azureSparkListJobs.Rd +++ b/man/azureSparkListJobs.Rd @@ -10,7 +10,7 @@ azureSparkListJobs(azureActiveContext, clustername, hdiAdmin, hdiPassword, \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} -\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{azureCreateHDI}} +\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{\link[=azureCreateHDI]{azureCreateHDI()}}} \item{hdiAdmin}{HDInsight admin username} diff --git a/man/azureSparkListSessions.Rd b/man/azureSparkListSessions.Rd index ce02c5c..5e33388 100644 --- a/man/azureSparkListSessions.Rd +++ b/man/azureSparkListSessions.Rd @@ -10,7 +10,7 @@ azureSparkListSessions(azureActiveContext, clustername, hdiAdmin, hdiPassword, \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} -\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{azureCreateHDI}} +\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{\link[=azureCreateHDI]{azureCreateHDI()}}} \item{hdiAdmin}{HDInsight admin username} diff --git a/man/azureSparkNewSession.Rd b/man/azureSparkNewSession.Rd index dede974..b90847c 100644 --- a/man/azureSparkNewSession.Rd +++ b/man/azureSparkNewSession.Rd @@ -10,7 +10,7 @@ azureSparkNewSession(azureActiveContext, clustername, hdiAdmin, hdiPassword, \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} -\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{azureCreateHDI}} +\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{\link[=azureCreateHDI]{azureCreateHDI()}}} \item{hdiAdmin}{HDInsight admin username} diff --git a/man/azureSparkStopSession.Rd b/man/azureSparkStopSession.Rd index 44187e1..a64b034 100644 --- a/man/azureSparkStopSession.Rd +++ b/man/azureSparkStopSession.Rd @@ -10,13 +10,13 @@ azureSparkStopSession(azureActiveContext, clustername, hdiAdmin, hdiPassword, \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} -\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{azureCreateHDI}} +\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{\link[=azureCreateHDI]{azureCreateHDI()}}} \item{hdiAdmin}{HDInsight admin username} \item{hdiPassword}{HDInsight admin password} -\item{sessionID}{Spark sessionID. See \code{azureSparkCMD}} +\item{sessionID}{Spark sessionID. See \code{\link[=azureSparkCMD]{azureSparkCMD()}}} \item{verbose}{Print Tracing information (Default False)} } diff --git a/man/azureStartVM.Rd b/man/azureStartVM.Rd index 19869a1..e65fd0c 100644 --- a/man/azureStartVM.Rd +++ b/man/azureStartVM.Rd @@ -5,7 +5,7 @@ \title{Start a Virtual Machine.} \usage{ azureStartVM(azureActiveContext, resourceGroup, vmName, mode = "Sync", - subscriptionID, azToken, verbose = FALSE) + subscriptionID, verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} @@ -16,9 +16,7 @@ azureStartVM(azureActiveContext, resourceGroup, vmName, mode = "Sync", \item{mode}{Wait for operation to complete 'Sync' (Default)} -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} - -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{verbose}{Print Tracing information (Default False)} } diff --git a/man/azureStopVM.Rd b/man/azureStopVM.Rd index 21f7860..91b1104 100644 --- a/man/azureStopVM.Rd +++ b/man/azureStopVM.Rd @@ -5,7 +5,7 @@ \title{Stop a Virtual Machine.} \usage{ azureStopVM(azureActiveContext, resourceGroup, vmName, mode = "Sync", - subscriptionID, azToken, verbose = FALSE) + subscriptionID, verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} @@ -16,9 +16,7 @@ azureStopVM(azureActiveContext, resourceGroup, vmName, mode = "Sync", \item{mode}{Wait for operation to complete 'Sync' (Default)} -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} - -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{verbose}{Print Tracing information (Default False)} } diff --git a/man/azureVMStatus.Rd b/man/azureVMStatus.Rd index d006207..2d1eb89 100644 --- a/man/azureVMStatus.Rd +++ b/man/azureVMStatus.Rd @@ -5,7 +5,7 @@ \title{Get Status of a Virtual Machine.} \usage{ azureVMStatus(azureActiveContext, resourceGroup, vmName, subscriptionID, - azToken, ignore = "N", verbose = FALSE) + ignore = "N", verbose = FALSE) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} @@ -14,9 +14,7 @@ azureVMStatus(azureActiveContext, resourceGroup, vmName, subscriptionID, \item{vmName}{Name of the virtual Machine} -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} - -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{ignore}{ignore} diff --git a/man/createAzureContext.Rd b/man/createAzureContext.Rd index e33f545..fa7dea9 100644 --- a/man/createAzureContext.Rd +++ b/man/createAzureContext.Rd @@ -14,13 +14,13 @@ createAzureContext(tenantID, clientID, authKey) \item{authKey}{The Authentication Key provided during creation of the Active Directory application / service principal} } \description{ -Create a container (azureContextObject) for holding variables used by the AzureSMR package. If the Tenant ID, Client ID and Authenication Key are provided the function will attempt to authenticate the session. +Create a container (azureContextObject) for holding variables used by the \code{AzureSMR} package. If the Tenant ID, Client ID and Authenication Key are provided the function will attempt to authenticate the session. } \details{ See the Azure documentation (\url{https://azure.microsoft.com/en-us/documentation/articles/resource-group-create-service-principal-portal/}) for information to configure an Active Directory application. } \seealso{ -\code{setAzureContext} +\code{\link[=setAzureContext]{setAzureContext()}} Other azureActiveContext functions: \code{\link{setAzureContext}} } diff --git a/man/setAzureContext.Rd b/man/setAzureContext.Rd index e9b0b5e..edf15c0 100644 --- a/man/setAzureContext.Rd +++ b/man/setAzureContext.Rd @@ -17,9 +17,9 @@ setAzureContext(azureActiveContext, tenantID, clientID, authKey, azToken, \item{authKey}{The Authentication Key provided during creation of the Active Directory application / service principal} -\item{azToken}{Azure authentication token, obtained by \code{azureAuthenticate}} +\item{azToken}{Azure authentication token, obtained by \code{\link[=azureAuthenticate]{azureAuthenticate()}}} -\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{azureAuthenticate} when only a single subscriptionID is available via Active Directory} +\item{subscriptionID}{Set the subscriptionID. This is obtained automatically by \code{\link[=azureAuthenticate]{azureAuthenticate()}} when only a single subscriptionID is available via Active Directory} \item{resourceGroup}{Name of the resource group} @@ -27,7 +27,7 @@ setAzureContext(azureActiveContext, tenantID, clientID, authKey, azToken, \item{storageAccount}{Name of the azure storage account} -\item{container}{Storage container name. See \code{azureListStorageContainers}} +\item{container}{Storage container name. See \code{\link[=azureListStorageContainers]{azureListStorageContainers()}}} \item{blob}{Blob name} @@ -37,14 +37,14 @@ setAzureContext(azureActiveContext, tenantID, clientID, authKey, azToken, \item{hdiPassword}{HDInsight admin password} -\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{azureCreateHDI}} +\item{clustername}{Cluster name, used for HDI and Spark clusters. See \code{\link[=azureCreateHDI]{azureCreateHDI()}}} \item{kind}{HDinsight kind: "hadoop","spark" or "pyspark"} -\item{sessionID}{Spark sessionID. See \code{azureSparkCMD}} +\item{sessionID}{Spark sessionID. See \code{\link[=azureSparkCMD]{azureSparkCMD()}}} } \description{ -Updates the value of an azureActiveContext object, created by \code{createAzureContext} +Updates the value of an azureActiveContext object, created by \code{\link[=createAzureContext]{createAzureContext()}} } \seealso{ Other azureActiveContext functions: \code{\link{createAzureContext}} From 46b32dcf49bb74b32dbb00a610c88d1a7b3268b1 Mon Sep 17 00:00:00 2001 From: Andrie de Vries Date: Sun, 21 May 2017 21:03:22 +0100 Subject: [PATCH 2/3] Document deprecated functions. Remove references to deprecated functions. --- R/AzureContextObject.R | 9 --------- R/AzureResources.R | 7 ------- R/deprecated.R | 20 +++++++++++++++++++ R/methods.R | 1 + man/Internal.Rd | 3 +++ ...{dumpAzureContext.Rd => pkg-deprecated.Rd} | 9 ++++++++- vignettes/Authentication.R | 3 +-- vignettes/tutorial.R | 4 ++-- vignettes/tutorial.Rmd | 12 +++++------ 9 files changed, 41 insertions(+), 27 deletions(-) create mode 100644 R/deprecated.R rename man/{dumpAzureContext.Rd => pkg-deprecated.Rd} (67%) diff --git a/R/AzureContextObject.R b/R/AzureContextObject.R index eefe772..06cfcf3 100644 --- a/R/AzureContextObject.R +++ b/R/AzureContextObject.R @@ -22,15 +22,6 @@ createAzureContext <- function(tenantID, clientID, authKey){ return(azEnv) } -#' Dumps out the contents of the AzureContext. -#' -#' @inheritParams setAzureContext -#' @export -dumpAzureContext <- function(azureActiveContext){ - .Deprecated("str") - str(azureActiveContext) -} - #' Updates azureActiveContext object. #' #' Updates the value of an azureActiveContext object, created by [createAzureContext()] diff --git a/R/AzureResources.R b/R/AzureResources.R index beba065..df3a24f 100644 --- a/R/AzureResources.R +++ b/R/AzureResources.R @@ -75,13 +75,6 @@ azureListRG <- function(azureActiveContext, subscriptionID, verbose = FALSE) { return(dfn) } - -#' @export -AzureListRG <- function(...) { - .Deprecated("azureListRG") -} - - #' Get all Resource in default Subscription. #' #' @inheritParams setAzureContext diff --git a/R/deprecated.R b/R/deprecated.R new file mode 100644 index 0000000..5bebdeb --- /dev/null +++ b/R/deprecated.R @@ -0,0 +1,20 @@ +#' Dumps out the contents of the AzureContext. +#' +#' @inheritParams setAzureContext +#' @rdname pkg-deprecated +#' @export +dumpAzureContext <- function(azureActiveContext) { + .Deprecated("str") + str(azureActiveContext) +} + + +#' Deprecated functions. +#' +#' @rdname pkg-deprecated +#' @param ... passed to [azureListRG()] +#' @export +AzureListRG <- function(...) { + .Deprecated("azureListRG") + azureListRG(...) +} diff --git a/R/methods.R b/R/methods.R index d2a7b47..ee2a82f 100644 --- a/R/methods.R +++ b/R/methods.R @@ -15,6 +15,7 @@ as.azureActiveContext <- function(x){ } #' @export +#' @rdname Internal is.azureActiveContext <- function(x){ inherits(x, "azureActiveContext") } diff --git a/man/Internal.Rd b/man/Internal.Rd index bae0436..81c0f11 100644 --- a/man/Internal.Rd +++ b/man/Internal.Rd @@ -2,9 +2,12 @@ % Please edit documentation in R/methods.R \name{as.azureActiveContext} \alias{as.azureActiveContext} +\alias{is.azureActiveContext} \title{azureActiveContext object.} \usage{ as.azureActiveContext(x) + +is.azureActiveContext(x) } \arguments{ \item{x}{Object to create, test or print} diff --git a/man/dumpAzureContext.Rd b/man/pkg-deprecated.Rd similarity index 67% rename from man/dumpAzureContext.Rd rename to man/pkg-deprecated.Rd index 158fdba..52709f1 100644 --- a/man/dumpAzureContext.Rd +++ b/man/pkg-deprecated.Rd @@ -1,14 +1,21 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/AzureContextObject.R +% Please edit documentation in R/deprecated.R \name{dumpAzureContext} \alias{dumpAzureContext} +\alias{AzureListRG} \title{Dumps out the contents of the AzureContext.} \usage{ dumpAzureContext(azureActiveContext) + +AzureListRG(...) } \arguments{ \item{azureActiveContext}{A container used for caching variables used by AzureSMR} + +\item{...}{passed to \code{\link[=azureListRG]{azureListRG()}}} } \description{ Dumps out the contents of the AzureContext. + +Deprecated functions. } diff --git a/vignettes/Authentication.R b/vignettes/Authentication.R index 1f3be33..d33720d 100644 --- a/vignettes/Authentication.R +++ b/vignettes/Authentication.R @@ -1,5 +1,4 @@ ## ---- eval = FALSE------------------------------------------------------- # sc <- createAzureContext(tenantID = "{TID}", clientID = "{CID}", authKey= "{KEY}") -# rgs <- AzureListRG(sc) +# rgs <- azureListRG(sc) # rgs - diff --git a/vignettes/tutorial.R b/vignettes/tutorial.R index ccc7a2b..eb0bf4d 100644 --- a/vignettes/tutorial.R +++ b/vignettes/tutorial.R @@ -14,7 +14,7 @@ ## ---- eval=FALSE--------------------------------------------------------- # # list resource groups -# AzureListRG(sc) +# azureListRG(sc) # # # list all resources # azureListAllResources(sc) @@ -51,7 +51,7 @@ # azureListStorageBlobs(sc, storageAccount = "analyticsfiles", container = "test") ## ---- eval=FALSE--------------------------------------------------------- -# AzurePutBlob(sc, StorageAccount = "analyticsfiles", container = "test", +# azurePutBlob(sc, StorageAccount = "analyticsfiles", container = "test", # contents = "Hello World", # blob = "HELLO") diff --git a/vignettes/tutorial.Rmd b/vignettes/tutorial.Rmd index 17df9a4..9a7d758 100644 --- a/vignettes/tutorial.Rmd +++ b/vignettes/tutorial.Rmd @@ -56,7 +56,7 @@ sc To get an authorisation token use `azureAuthenticate()`. Note this token will time our after a period and therefore you need to run it again occasionally. TIP: Use AzureAuthenticate before a long running task. -The `azureListSubscriptions()` funtion lists all the available subscriptions. If you only have one it sets the default Subscription in the `azureActiveContext` to that subscription ID. +The `azureListSubscriptions()` function lists all the available subscriptions. If you only have one it sets the default Subscription in the `azureActiveContext` to that subscription ID. ```{r, eval=FALSE} @@ -109,13 +109,13 @@ In order to access Storage Blobs you need to have a key. Use `azureSAGetKey()` t ```{r, eval=FALSE} -sKey <- AzureSAGetKey(sc, resourceGroup = "Analytics", storageAccount = "analyticsfiles") +sKey <- azureSAGetKey(sc, resourceGroup = "Analytics", storageAccount = "analyticsfiles") ``` To list containers in a storage account use `azureListContainers()` ```{r, eval=FALSE} -azListContainers(sc, storageAccount = "analyticsfiles", containers = "Test") +azureListContainers(sc, storageAccount = "analyticsfiles", containers = "Test") ``` @@ -128,7 +128,7 @@ azureListStorageBlobs(sc, storageAccount = "analyticsfiles", container = "test") To Write a Blobs use `azurePutBlob()` ```{r, eval=FALSE} -AzurePutBlob(sc, StorageAccount = "analyticsfiles", container = "test", +azurePutBlob(sc, StorageAccount = "analyticsfiles", container = "test", contents = "Hello World", blob = "HELLO") ``` @@ -199,11 +199,11 @@ These functions facilitate the use of hive jobs on a HDInsight Cluster azureHiveStatus(sc, clusterName = "{hdicluster}", hdiAdmin = "admin", hdiPassword = "********") -AzureHiveSQL(sc, +azureHiveSQL(sc, CMD = "select * from airports", Path = "wasb://{container}@{hdicluster}.blob.core.windows.net/") -stdout <- AzureGetBlob(sc, Container = "test", Blob = "stdout") +stdout <- azureGetBlob(sc, Container = "test", Blob = "stdout") read.delim(text=stdout, header=TRUE, fill=TRUE) From 4c50cd10fb822896852b0d4ba43f451b799c97bc Mon Sep 17 00:00:00 2001 From: Andrie de Vries Date: Sun, 21 May 2017 21:03:36 +0100 Subject: [PATCH 3/3] Bump version number to 0.2.3 --- DESCRIPTION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 68a6724..af95952 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -5,8 +5,8 @@ Description: Helps users to manage Azure Services and objects from within an Machines and HDInsight (Spark, Hive). Requires that an Active Directory application and service principal has been configured to access Azure resources. Type: Package -Version: 0.2.2 -Date: 2016-12-22 +Version: 0.2.3 +Date: 2017-05-21 Authors@R: c( person(family="Microsoft Corporation", role="cph"), person("Alan", "Weaver", role=c("aut", "cre"), email="alanwe@microsoft.com"),