From 7acf498967430a04047f1b808bb60f32bd3ef51d Mon Sep 17 00:00:00 2001 From: hong-revo Date: Fri, 4 May 2018 21:20:55 +1000 Subject: [PATCH] add location listing --- R/az_subscription.R | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/R/az_subscription.R b/R/az_subscription.R index df35597..c8fa574 100644 --- a/R/az_subscription.R +++ b/R/az_subscription.R @@ -42,9 +42,21 @@ public=list( lst }, - create_resource_group=function(name, ...) + list_locations=function() { - az_resource_group$new(self$token, self$id, name, ..., create=TRUE) + cont <- call_azure_rm(self$token, self$id, "locations") + locs <- do.call(rbind, lapply(cont$value, data.frame, stringsAsFactors=FALSE)) + within(locs, + { + id <- NULL + longitude <- as.numeric(longitude) + latitude <- as.numeric(latitude) + }) + }, + + create_resource_group=function(name, location) + { + az_resource_group$new(self$token, self$id, name, location=location, create=TRUE) }, delete_resource_group=function(name)