From 3410fc1f1158e1c29ad0ddd493f01512e29153de Mon Sep 17 00:00:00 2001 From: Angus Salkeld Date: Tue, 13 Jan 2015 09:05:28 +1000 Subject: [PATCH] Add a small section to the hot-guide composition doc This completes a two way sync of the contents with the in-tree composition docs. Also set the template version in the examples to the latest template version (we should be encouraging the latest template version). Change-Id: I0c9767835614ea8e44d6b0ec3ca28c50bdc0b1d2 --- doc/hot-guide/source/composition.rst | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/doc/hot-guide/source/composition.rst b/doc/hot-guide/source/composition.rst index 5af6633681..17b891e218 100644 --- a/doc/hot-guide/source/composition.rst +++ b/doc/hot-guide/source/composition.rst @@ -30,7 +30,7 @@ new types of resources. These examples use a custom template stored in a .. code-block:: yaml - heat_template_version: 2013-05-23 + heat_template_version: 2014-10-16 parameters: key_name: @@ -55,7 +55,8 @@ The following template defines the :file:`my_nova.yaml` file as value for the .. code-block:: yaml - heat_template_version: 2013-05-23 + heat_template_version: 2014-10-16 + resources: my_server: type: my_nova.yaml @@ -107,6 +108,8 @@ You can now use the new ``OS::Nova::Server`` in your new template: .. code-block:: yaml + heat_template_version: 2014-10-16 + resources: my_server: type: OS::Nova::Server @@ -119,6 +122,25 @@ To create the stack run: $ heat stack-create -f main.yaml -e env.yaml example-two + +Get access to nested attributes +=============================== +There are implicit attributes of a template resource. These are +accessible as follows: + +.. code-block:: yaml + + heat_template_version: 2014-10-16 + + resources: + my_server: + type: my_nova.yaml + + outputs: + test_out: + value: {get_attr: my_server, resource.server, first_address} + + Making your template resource more "transparent" ================================================ If you wish to be able to return the ID of one of the inner resources @@ -127,6 +149,8 @@ output "OS::stack_id" to your template resource. .. code-block:: yaml + heat_template_version: 2014-10-16 + resources: server: type: OS::Nova::Server