Adds a new intrinsic function to split strings into lists, and optionally
return a specific list item by index (similar to get_attr/get_param path
based attributes).
Syntax is:
str_split: [",", "apples,pears"]
which returns ["apples", "pears"]
Or with an optional index:
str_split: [",", "apples,pears", 1]
which returns "pears"
Change-Id: Ibc7a315bee278b8a49e44475206361b639536688
blueprint: str-split
Bump the HOT version for the Liberty release, currently planned
for 2015-10-15 [1]
This is the same as 2015-04-30 other than the removal of the
last remaining CFN compatible function, Fn::Select, which should
now be replaced by path based attributes/parameters, e.g:
{get_attr: [aResource, anAttribute, <list index>]}
{get_param: [aListParam, <list index>]}
[1] https://wiki.openstack.org/wiki/Liberty_Release_Schedule
Change-Id: I10e5b12b84a6de01dd3f8a37a2d6cb644f319049
The HOT Guide was formerly located in the User
Guide. This patch merges those files into the
heat docs repository in the Template Guide
directory.
Change-Id: I559b1b3edb42b1de40013c37e5967d8898c8a916
Closes-Bug: #1461720
This change adds a "repeat" function, which provides a loop control
structure that iterates over the items in a list replacing each item in
a template.
Change-Id: I4785d7f6f7ee84ddfee08789ca5fc86d54f8e23f
Implements: blueprint repeat-function
project id can be used to identify or tag which project the resources
belong to. The project id can be found in cfn pseudo param AWS::StackId, but when we
switch to hot, OS::stack_id is a pure stack id, no project info in it. So
we add OS::project_id to meet the similar scenario requirements.
Change-Id: I3db9db7c59cfa0ff3005a97cd0cb7962928598ab
Improve docstrings so that syntax warnings are no longer displayed when
generating docs.
Related-Bug: 1403897
Change-Id: I0163bc7f83e00f9077fc78e638173df2124580dd
This patch updates hot_spec.rst and functions.rst to reflect the changes
made to HOT version support.
Change-Id: I61f77ba30b59d5954201072f59b03cbd3d67debd
Closes-bug: #1386184
The current description is "resource ID" and this should read
"resource name".
Change-Id: I0d37f3484e603838c2e11b8984c91c94c793d6c1
Closes-bug: #1381127
The next revision of HOT, dated 2014-10-16 to coincide with the Juno
release date, will support the list_join function and remove support for
the CFN-style functions. There may also be other changes throughout the
Juno development cycle.
Change-Id: I20d9586201806ac34e303689660ff565cb9f2b5c
We have an increasing number of attributes which are a list of strings.
In HOT there is no way to join a list into a string as with the CFN
function Fn::Join.
This change implements HOT intrinsic function list_join using an
identical implementation as Fn::Join.
Tripleo will benefit from this function since the lack of a join
function in HOT is one of the barriers to transitioning to the
HOT template format.
Change-Id: I29e0b744271213429fff6922397b925eb9ccc204
The current order appears to be arbitrary. There is no other obvious
natural order so this change reorders alphabetically by the name
of the function.
Change-Id: Id1b0f02b8fb77f4e55827d962e3463d05245e564
Add a boolean parameter type to allow passing in boolean values via
parameters.
blueprint boolean-parameter-type
Change-Id: I693d0aa5bdc54bb57b8363633f1b41c59ccae7d3
Add documentation about the availablility of HOT pseudo parameters
and how to access them.
Implements: blueprint make-stack-name-available-in-template
Change-Id: Iee07aba5cf1b24321191f04282eb0c89a54382cb
There were two different behaviours during template validation and creation
stack (with template validation). In first case error was raised if
template did not have any resources. However user could create stack
without error using this such kind of template.
This patch make behaviour equal for both variant and gives ability to
create and successfully validate stack with template which does not have
resources.
Change-Id: I4dc30ccdc45e0fa7ff678b434106e056dba5f3b4
Closes-Bug: #1278090
This updates the status section of hot_spec.rst to indicate
Icehouse is supported and reliable, and indicate that future
versions will allow versioning of the template language.
Change-Id: I70455f71362babcea746831dd730f8c33ef51745
Closes-bug: #1304145
Add a native version of the function, rather than continue to rely on
Fn::ResourceFacade from the Heat-flavoured-cfn templates.
Closes-bug: #1299205
Change-Id: Iee118aeaa72d59e4d6a27ed487b99e9aba9779cd
The Resource Dependencies section in hot_spec.rst used a wrong
heading markup (inconsistent with previous sections' 2nd level
markups), so the heading did not appear in the HTML.
This patch fixes the markup.
Change-Id: Id10ca0246942b2b64ea6269413243379c3ae2158
Closes-Bug: #1295538
This patch fixes inconsistencies between keywords in resource
definitions in a HOT template as documented in the HOT specification
and the way they are processed by the code.
So far it was possible to use CFN like syntax or HOT syntax inside
resource definitions (e.g. both 'properties' and 'Properties' were
accepted) since the HOT processing code did tolerant processing.
Consequently, users had been able to produce CFN/HOT mixed templates.
This patch introduces strict enforcement of allowed keywords to
make HOT templates consistent with the spec by providing concrete
validation errors in case of invalid keywords.
This patch also adds a DB migration step to update existing templates
in the Heat database with potentially legacy keywords to comply with
the new strict syntax checking rules.
Change-Id: I44309acda86a930030cb70493f409e3ea4740130
Closes-Bug: #1274288
Closes-Bug: #1271008
Add a new custom_constraint keyword type in HOT parameters to allow
validation of custom parameters.
blueprint param-constraints
Co-Authored-By: cedric.soulas@cloudwatt.com
Change-Id: Ic52475ea8a39541f7b1643038a2bcba15f0d7471
HOT templates now allow the use of extra attributes for the
get_param function. With this change it is possible to traverse complex
parameters.
If one of the extra arguments does not match with a key or a valid
index, an empty string is returned.
Change-Id: I49f46b164fd21f6cc7dcea8d4ec1046f6cc912b3
Implements: blueprint hot-select
This change will add the ability to put a human readable label
in a HOT Template for each parameter. This label will be used
to provide a better form label in any user interface when
available.
Change-Id: I8d815d1cfceb71c1ea0a9907f2afeb06dc4fca09
Implements: blueprint add-parameter-label-to-template
This function takes a single string argument and uses that as the key
in a lookup into the template files. The resulting content is substituted
as a chunk of text.
The files keys can be arbitrary and the files section can be built manually
when generating the API request. However by convention heatclient will use
the absolute URL of the file as the key.
Change-Id: I83a73b14e1fbf56545151da1d8a0d7afe89149a4
The HOT templates now allows the use of extra attributes for the
get_attr function. Wich this change is possible to traverse complex
resource attributes.
For example, getting an IP address for a server on a given network:
when the network name is stable, and always known:
get_attr:
- my_server
- networks
- public
- 0
or if the network name is something other than public:
get_attr:
- my_server
- networks
- get_param: my_network_name
- 0
If one of the extra arguments does not match with a key or a valid
index, an empty string is returned.
As a bonus track the Fn::GetAttr support was removed from the HOT
templates.
Change-Id: Ia7361fbd10611cc796bd90e781f4ae387c970dbd
Implements: blueprint hot-select
The ability to group and order parameters in the template is
currently missing. This patch allows for a new section of the
template, parameter_groups, to be added by the template author
to explicitly define the expected behavior.
Change-Id: I6d8dc4e6490fbfe9cc45f6ca9cb1ac2826e13273
Implements: blueprint parameter-grouping-ordering
Fix description of outputs section in the HOT specification, and thus make it
consistent with the HOT template guide (which is correct).
Also fix incorrect uses of the native server resource's resource name and
attribute names.
Change-Id: I98643873c370d03619ee7df9c7e09b2cdf3cf08c
Closes-Bug: #1233318
str_replace uses python templates, whereas Fn::Replace uses python
string.replace.
During the original review for Fn::Replace, python templates were
decided against because $ would often need double-escaping in shell scripts.
https://review.openstack.org/#/c/31736/
Having different behaviours between Fn::Replace and str_replace will
add complication for users migrating existing templates to HOT.
Another advantage of using straight string replacement is seen when
the template generates a executable script. In this case it is generally
possible to write a template that can also be executed directly in a
dev/test environment. This would often not be possible if the template
format required placeholders to be prefixed with a $.
Whatever behaviour exists when Havana is release will have to be
supported indefinitely so now is the time to decide if this is going
to be fixed.
Closes-Bug: #1228640
Change-Id: I72879b374a3c61dfe0e4004251ab709d914f2e25
Fix syntax description of get_attr function in HOT specification.
Colon instead of comma was used in array.
Contributes to blueprint hot-specification
Change-Id: I8007d476093ecd5be41020025b486147a5ac038b
This patch adds support for two functions, get_resource and str_replace to HOT
to enable the definition of new HOT samples. Especially str_replace aims to
simplify the definition of scripts in HOT templates.
Change-Id: Ic14fee36bdc0b9c5d79ade7ece5fa1b5331c864a
This patch adds initial input for the HOT template guide and the HOT
specification.
Note that content so far is based on features implemented so far and
not forward-looking in any way. Whenever new features get implemented,
the guide and spec will be extended appropriately.
Contributes to blueprint hot-specification
Change-Id: I63d29ab0a1db6703b39f981161063d4fd9f97126