diff options
author | Jenkins <jenkins@review.openstack.org> | 2015-09-04 09:45:46 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2015-09-04 09:45:46 +0000 |
commit | 1d845828dd8be8b1ad221454c94f3d3f1644f880 (patch) | |
tree | b93154bac4998119961a0d5af4b41276341320ca /doc | |
parent | 21fdcec72e4ef071bc95990384537be11e6505b3 (diff) | |
parent | 292ad4e13f8e972a9f104d3000818f7110e791e6 (diff) | |
download | heat-1d845828dd8be8b1ad221454c94f3d3f1644f880.tar.gz |
Merge "Add information about new get_attr functionality"
Diffstat (limited to 'doc')
-rw-r--r-- | doc/source/template_guide/hot_spec.rst | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/doc/source/template_guide/hot_spec.rst b/doc/source/template_guide/hot_spec.rst index 22e73154a..c7a58cee2 100644 --- a/doc/source/template_guide/hot_spec.rst +++ b/doc/source/template_guide/hot_spec.rst @@ -160,7 +160,11 @@ For example, Heat currently supports the following values for the The key with value ``2015-10-15`` indicates that the YAML document is a HOT template and it may contain features added and/or removed up until the Liberty release. This version removes the *Fn::Select* function, path based - ``get_attr``/``get_param`` references should be used instead:: + ``get_attr``/``get_param`` references should be used instead. Moreover + ``get_attr`` since this version returns dict of all attributes for the + given resource excluding *show* attribute, if there's no <attribute name> + specified, e.g. :code:`{ get_attr: [<resource name>]}`. The complete list + of supported functions is:: get_attr get_file @@ -725,7 +729,7 @@ attribute name specified. These additional parameters are used to navigate the data structure to return the desired value. -The following example demonstrates how to use the :code:`get_attr` function +The following example demonstrates how to use the :code:`get_attr` function: .. code-block:: yaml @@ -747,9 +751,18 @@ In this example, if the ``networks`` attribute contained the following data:: {"public": ["2001:0db8:0000:0000:0000:ff00:0042:8329", "1.2.3.4"], "private": ["10.0.0.1"]} -then the value of :code:`get_attr` function would resolve to ``10.0.0.1`` +then the value of ``get_attr`` function would resolve to ``10.0.0.1`` (first item of the ``private`` entry in the ``networks`` map). +From ``heat_template_version``: '2015-10-15' <attribute_name> is optional and +if <attribute_name> is not specified, ``get_attr`` returns dict of all +attributes for the given resource excluding *show* attribute. In this case +syntax would be next: + +.. code-block:: yaml + + get_attr: + - <resource_name> get_file -------- |