consistent interface for rg creation

This commit is contained in:
hong-revo 2018-05-07 01:09:30 +10:00
Родитель f063b81c85
Коммит 20abbdf72f
2 изменённых файлов: 7 добавлений и 7 удалений

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

@ -12,7 +12,7 @@ public=list(
token=NULL,
# constructor: can refer to an existing RG, or create a new RG
initialize=function(token, subscription, name=NULL, ..., parms=list(...), create=FALSE)
initialize=function(token, subscription, name=NULL, ..., parms=list())
{
if(is_empty(name) && is_empty(parms))
stop("Must supply either resource group name, or parameter list")
@ -20,8 +20,8 @@ public=list(
self$token <- token
self$subscription <- subscription
parms <- if(create)
private$init_and_create(name, parms)
parms <- if(!is_empty(list(...)))
private$init_and_create(name, ...)
else private$init(name, parms)
self$id <- parms$id
@ -119,9 +119,9 @@ private=list(
parms
},
init_and_create=function(name, parms)
init_and_create=function(name, ...)
{
parms <- c(name=name, parms)
parms <- modifyList(list(...), list(name=name))
private$validate_parms(parms)
self$name <- name
private$rg_op(body=parms, encode="json", http_verb="PUT")

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

@ -79,9 +79,9 @@ public=list(
named_list(lst)
},
create_resource_group=function(name, location)
create_resource_group=function(name, location, ...)
{
az_resource_group$new(self$token, self$id, name, location=location, create=TRUE)
az_resource_group$new(self$token, self$id, name, location=location, ...)
},
delete_resource_group=function(name)