diff --git a/R/batch_service.R b/R/batch_service.R index 2dfabe5..0a3ddf9 100644 --- a/R/batch_service.R +++ b/R/batch_service.R @@ -1,4 +1,4 @@ -apiVersion <- "2017-05-01.5.0" +apiVersion <- "2017-06-01.5.1" getBatchCredentials <- function(configPath = "az_config.json", ...) { config <- getOption("az_config") diff --git a/R/job_operations.R b/R/job_operations.R index 1020d6d..c44467b 100644 --- a/R/job_operations.R +++ b/R/job_operations.R @@ -3,6 +3,7 @@ addJob <- function(jobId, jobPreparationTask = NULL, usesTaskDependencies = FALSE, content = "parsed", + metadata = NULL, ...) { batchCredentials <- getBatchCredentials() @@ -10,7 +11,8 @@ addJob <- function(jobId, id = jobId, poolInfo = poolInfo, jobPreparationTask = jobPreparationTask, - usesTaskDependencies = usesTaskDependencies + usesTaskDependencies = usesTaskDependencies, + metadata = metadata ) body <- Filter(length, body) @@ -129,3 +131,25 @@ getJobPreparationStatus <- function(jobId, content = "parsed", ...) { callBatchService(request, batchCredentials, content) } + +#' Gets job task counts by job state. +#' +#' @param jobId The id of the job. +#' +#' @return A response containing the task counts of different states. +#' @examples +#' \dontrun{ +#' getJobTaskCounts(job-001) +#' } +#' @export +getJobTaskCounts <- function(jobId, content = "parsed") { + batchCredentials <- getBatchCredentials() + + request <- AzureRequest$new( + method = "GET", + path = paste0("/jobs/", jobId, "/taskcounts"), + query = list("api-version" = apiVersion) + ) + + callBatchService(request, batchCredentials, content) +}