The heat.engine.template Module

class heat.engine.template.Template(template, template_id=None, files=None, env=None)[source]

Bases: _abcoll.Mapping

A stack template.

add_resource(definition, name=None)[source]

Add a resource to the template.

The resource is passed as a ResourceDefinition object. If no name is specified, the name from the ResourceDefinition should be used.

classmethod create_empty_template(version=('heat_template_version', '2015-04-30'))[source]

Create an empty template.

Creates a new empty template with given version. If version is not provided, a new empty HOT template of version “2015-04-30” is returned.

Parameters:version – A tuple containing version header of the

template: version key and value. E.g. (“heat_template_version”, “2015-04-30”) :returns: A new empty template.

get_section_name(section)[source]

Return a correct section name.

classmethod load(context, template_id, t=None)[source]

Retrieve a Template with the given ID from the database.

param_schemata(param_defaults=None)[source]

Return a dict of parameters.Schema objects for the parameters.

parameters(stack_identifier, user_params, param_defaults=None)[source]

Return a parameters.Parameters object for the stack.

parse(stack, snippet)[source]
remove_resource(name)[source]

Remove a resource from the template.

resource_definitions(stack)[source]

Return a dictionary of ResourceDefinition objects.

store(context=None)[source]

Store the Template in the database and return its ID.

validate()[source]

Validate the template.

Validates the top-level sections of the template as well as syntax inside select sections. Some sections are not checked here but in code parts that are responsible for working with the respective sections (e.g. parameters are check by parameters schema class).

validate_resource_definitions(stack)[source]

Check section’s type of ResourceDefinitions.

classmethod validate_resource_key_type(key, valid_types, typename, allowed_keys, rsrc_name, rsrc_data)[source]

Validation type of the specific resource key.

Used in validate_resource_definition and check correctness of key’s type.

Previous topic

The heat.engine.sync_point Module

Next topic

The heat.engine.timestamp Module

Project Source

This Page