This commit is contained in:
hong-revo 2018-05-02 08:49:39 +10:00
Родитель 3882b83519
Коммит 4fa8680a7b
4 изменённых файлов: 11 добавлений и 11 удалений

Просмотреть файл

@ -32,7 +32,7 @@ public=list(
self$auth_type <- match.arg(auth_type)
self$token <- get_azure_token(aad_host, tenant, app, self$auth_type, secret, host)
private$set_subs()
private$set_subslist()
NULL
},
@ -42,15 +42,15 @@ public=list(
if(is.null(self$subscriptions))
stop("No subscriptions associated with this app")
if(is.numeric(subscription))
subscription <- self$subscriptions[subscription][1]
az_subscription$new(self$token, subscription)
subscription <- self$subscriptions[subscription]
az_subscription$new(self$token, subscription[1])
}
),
private=list(
# obtain subscription IDs owned by this app
set_subs=function()
set_subslist=function()
{
cont <- call_azure_sm(self$token, subscription="", operation="")

Просмотреть файл

@ -26,7 +26,7 @@ public=list(
self$properties <- cont$properties
self$tags <- cont$tags
private$set_res()
private$set_reslist()
NULL
},
@ -38,7 +38,7 @@ public=list(
private=list(
set_res=function()
set_reslist=function()
{
op <- paste0("resourcegroups/", self$name, "/resources")
cont <- call_azure_sm(self$token, self$subscription, op)

Просмотреть файл

@ -21,7 +21,7 @@ public=list(
self$policies <- info$subscriptionPolicies
self$authorization_source <- info$authorizationSource
private$set_rgrps()
private$set_rglist()
NULL
},
@ -31,8 +31,8 @@ public=list(
if(is.null(self$resource_groups))
stop("No resource groups associated with this subscription")
if(is.numeric(resource_group))
resource_group <- self$resource_groups[resource_group][1]
az_resource_group$new(self$token, self$id, resource_group)
resource_group <- self$resource_groups[resource_group]
az_resource_group$new(self$token, self$id, resource_group[1])
},
create_resource_group=function(resource_group) { },
@ -43,7 +43,7 @@ public=list(
private=list(
set_rgrps=function()
set_rglist=function()
{
cont <- call_azure_sm(self$token, self$id, "resourcegroups")
self$resource_groups <- sapply(cont$value, `[[`, "name")

Просмотреть файл

@ -29,7 +29,7 @@ call_azure_sm <- function(token, subscription, operation, ...,
catch <- match.arg(http_condition_handler)
if(catch != "pass")
{
catch <- get(paste0(match.arg(catch), "_for_status"), getNamespace("httr"))
catch <- get(paste0(catch, "_for_status"), getNamespace("httr"))
catch(res)
}
httr::content(res, as="parsed")