From bf5e3571b1337eb908a38f2f412f56ec8ee0c659 Mon Sep 17 00:00:00 2001 From: tengqm Date: Mon, 27 Oct 2014 22:18:34 +0800 Subject: [PATCH] Update docs to reflect HOT version support. This patch updates hot_spec.rst and functions.rst to reflect the changes made to HOT version support. Change-Id: I61f77ba30b59d5954201072f59b03cbd3d67debd Closes-bug: #1386184 --- doc/source/template_guide/functions.rst | 5 +- doc/source/template_guide/hot_spec.rst | 76 ++++++++++++++++++++++--- 2 files changed, 72 insertions(+), 9 deletions(-) diff --git a/doc/source/template_guide/functions.rst b/doc/source/template_guide/functions.rst index 8e63484a7a..bc3fcd8291 100644 --- a/doc/source/template_guide/functions.rst +++ b/doc/source/template_guide/functions.rst @@ -16,7 +16,10 @@ CloudFormation Compatible Functions =================================== There are a number of functions that you can use to help you write -CloudFormation compatible templates. +CloudFormation compatible templates. While most CloudFormation functions are +supported in HOT version '2013-05-23', *Fn::Select* is the only CloudFormation +function supported in HOT templates since version '2014-10-16' which is +introduced in Juno. All of these functions (except *Ref*) start with *Fn::*. diff --git a/doc/source/template_guide/hot_spec.rst b/doc/source/template_guide/hot_spec.rst index ceb4cf605b..f0ae102ded 100644 --- a/doc/source/template_guide/hot_spec.rst +++ b/doc/source/template_guide/hot_spec.rst @@ -30,10 +30,8 @@ Status HOT is considered reliable, supported, and standardized as of our Icehouse (April 2014) release. The Heat core team may make improvements to the standard, which very likely would be backward compatible. The template -format is also versioned. In our Juno release, Heat will support multiple -different versions of the HOT specification if there is a need driven by the -introduction of new features. - +format is also versioned. Since Juno release, Heat supports multiple +different versions of the HOT specification. ------------------ Template Structure @@ -90,6 +88,59 @@ outputs omitted when no output values are required. +.. _hot_spec_template_version: + +--------------------- +Heat Template Version +--------------------- + +The value of *heat_template_version* tells Heat not only the format of the +template but also features that will be validated and supported. +For example, Heat currently supports the following values for the +*heat_template_version* key: + +2013-05-23 + The key with value *2013-05-23* indicates that the YAML document is a HOT + template and it may contain features implemented until the Icehouse release. + This version supports the following functions (some are back ported + to this version): + +:: + get_attr + get_file + get_param + get_resource + list_join + resource_facade + str_replace + Fn::Base64 + Fn::GetAZs + Fn::Join + Fn::MemberListToMap + Fn::Replace + Fn::ResourceFacade + Fn::Select + Fn::Split + Ref + +2014-10-16 + The key with value *2014-10-16* indicates that the YAML document is a HOT + template and it may contain features added and/or removed up until the Juno + release. This version removes most CFN functions that were supported in + the Icehouse release, i.e. the *2013-05-23* version. So the supported functions + now are: + +:: + get_attr + get_file + get_param + get_resource + list_join + resource_facade + str_replace + Fn::Select + + .. _hot_spec_parameter_groups: ------------------------ @@ -659,7 +710,7 @@ get_param --------- The *get_param* function allows for referencing an input parameter of a template from anywhere within a template. At runtime, it will be resolved to the value -provided for this input parameter. The syntax of the get_param function is as +provided for this input parameter. The syntax of the *get_param* function is as follows: :: @@ -729,8 +780,8 @@ given as single parameter to the get_resource function. list_join --------- The *list_join* function joins a list of strings with the given delimiter. This -function is available beginning with the `2014-10-16` version of HOT. -The syntax of the list_join function is as follows: +function is introduced in the Juno release, usable in HOT versions later than +`2013-05-23`. The syntax of the list_join function is as follows: :: @@ -750,7 +801,11 @@ This would resolve to "one, two, and three". resource_facade --------------- The *resource_facade* function allows a provider template to retrieve data -about its resource facade in the parent template. (A provider template is used to provide a custom definition of a resource - the facade - in the form of a Heat template. The resource's properties are passed to the provider template as its parameters, but other resource data can be included using this function.) +about its resource facade in the parent template. A provider template is used +to provide a custom definition of a resource - the facade - in the form of a +Heat template. The resource's properties are passed to the provider template as +its parameters, but other resource data can be included using this function.) + The syntax of the *resource_facade* function is as follows:: resource_facade: @@ -833,3 +888,8 @@ In the example above, one can imagine that MySQL is being configured on a compute instance and the root password is going to be set based on a user provided parameter. The script for doing this is provided as userdata to the compute instance, leveraging the str_replace function. + +Fn::Select +--------- +*Fn::Select* is a function borrowed from CFN template. Please check the CFN +template guide for a description.