diff --git a/DESCRIPTION b/DESCRIPTION index 47681d0..df2fc36 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AzureRMR Title: Interface to 'Azure Resource Manager' -Version: 2.3.5.9000 +Version: 2.3.6 Authors@R: c( person("Hong", "Ooi", , "hongooi73@gmail.com", role = c("aut", "cre")), person("Microsoft", role="cph") diff --git a/NEWS.md b/NEWS.md index 5f36aed..3e7dfb6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AzureRMR 2.3.5.9000 +# AzureRMR 2.3.6 - Add ability to specify user-defined functions in `build_template_definition`. Also allow changing the schema, content version and api profile. - Change maintainer email address. diff --git a/R/build_tpl_json.R b/R/build_tpl_json.R index 2bb234c..e037a30 100644 --- a/R/build_tpl_json.R +++ b/R/build_tpl_json.R @@ -6,7 +6,7 @@ #' @param functions User-defined functions used by the template. #' @param resources List of resources that the template should deploy. #' @param outputs The template outputs. -#' @param schema,content_version,api_profile Less common arguments that can be used to customise the template. See the guide to template syntax on Microsoft Docs, linked below. +#' @param schema,version,api_profile Less commonly used arguments that can be used to customise the template. See the guide to template syntax on Microsoft Docs, linked below. #' #' @details #' `build_template_definition` is used to generate a template from its components. The main arguments are `parameters`, `variables`, `functions`, `resources` and `outputs`. Each of these can be specified in various ways: @@ -143,8 +143,8 @@ build_template_definition <- function(...) #' @export build_template_definition.default <- function( parameters=named_list(), variables=named_list(), functions=list(), resources=list(), outputs=named_list(), - schema="https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - content_version="1.0.0.0", + schema="2019-04-01", + version="1.0.0.0", api_profile=NULL, ...) { @@ -154,8 +154,8 @@ build_template_definition.default <- function( parts <- lapply( list( - `$schema`=schema, - contentVersion=content_version, + `$schema`=paste0("https://schema.management.azure.com/schemas/", schema, "/deploymentTemplate.json#"), + contentVersion=version, apiProfile=api_profile, parameters=parameters, variables=variables, diff --git a/man/build_template.Rd b/man/build_template.Rd index acbcc63..07ff92d 100644 --- a/man/build_template.Rd +++ b/man/build_template.Rd @@ -12,9 +12,8 @@ build_template_definition(...) \method{build_template_definition}{default}(parameters = named_list(), variables = named_list(), functions = list(), resources = list(), - outputs = named_list(), - schema = "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - content_version = "1.0.0.0", api_profile = NULL, ...) + outputs = named_list(), schema = "2019-04-01", version = "1.0.0.0", + api_profile = NULL, ...) build_template_parameters(...) @@ -33,7 +32,7 @@ build_template_parameters(...) \item{outputs}{The template outputs.} -\item{schema, content_version, api_profile}{Less common arguments that can be used to customise the template. See the guide to template syntax on Microsoft Docs, linked below.} +\item{schema, version, api_profile}{Less commonly used arguments that can be used to customise the template. See the guide to template syntax on Microsoft Docs, linked below.} } \value{ The JSON text for the template definition and its parameters.