Add pollStatus function for script actions #62
This commit is contained in:
Родитель
1c13ecf0f3
Коммит
9c7fce1f13
|
@ -2,6 +2,7 @@
|
|||
|
||||
S3method(print,azureActiveContext)
|
||||
S3method(str,azureActiveContext)
|
||||
S3method(summary,azureScriptActionHistory)
|
||||
export(AzureListRG)
|
||||
export(as.azureActiveContext)
|
||||
export(azureAuthenticate)
|
||||
|
|
10
R/AzureHDI.R
10
R/AzureHDI.R
|
@ -356,9 +356,9 @@ azureResizeHDI <- function(azureActiveContext, clustername,
|
|||
#' @inheritParams azureAuthenticate
|
||||
#' @inheritParams azureListHDI
|
||||
#'
|
||||
#' @return Returns Dataframe of HDInsight Clusters information
|
||||
#' @return Data frame with HDInsight clusters information
|
||||
#' @family HDInsight functions
|
||||
#' @reference https://docs.microsoft.com/en-us/rest/api/hdinsight/hdinsight-cluster#delete
|
||||
#' @references https://docs.microsoft.com/en-us/rest/api/hdinsight/hdinsight-cluster#delete
|
||||
#' @export
|
||||
azureDeleteHDI <- function(azureActiveContext, clustername, subscriptionID,
|
||||
resourceGroup, verbose = FALSE) {
|
||||
|
@ -509,9 +509,11 @@ azureScriptActionHistory <- function(azureActiveContext, resourceGroup,
|
|||
}
|
||||
|
||||
#' @export
|
||||
#' @param object azureScriptActionHistory object, created by [azureScriptActionHistory()]
|
||||
#' @param ... not used
|
||||
#' @rdname azureScriptActionHistory
|
||||
summary.azureScriptActionHistory <- function(x) {
|
||||
do.call(rbind, lapply(x, function(x) {
|
||||
summary.azureScriptActionHistory <- function(object, ...) {
|
||||
do.call(rbind, lapply(object, function(x) {
|
||||
data.frame(
|
||||
x[c("name", "scriptExecutionId", "startTime")],
|
||||
if (is.null(x$endTime)) list(endTime = NA) else x["endTime"],
|
||||
|
|
|
@ -135,7 +135,7 @@ pollStatusScriptAction <- function(azureActiveContext, scriptname) {
|
|||
while (iteration < 500 && waiting) {
|
||||
|
||||
status <- azureScriptActionHistory(azureActiveContext)
|
||||
idx <- which(sapply(z, "[[", "name") == scriptname)[1]
|
||||
idx <- which(sapply(status, "[[", "name") == scriptname)[1]
|
||||
summary <- status[[idx]]$status
|
||||
rc <- switch(tolower(summary),
|
||||
accepted = "A",
|
||||
|
|
Загрузка…
Ссылка в новой задаче