heat.engine.rsrc_defn module

class heat.engine.rsrc_defn.ResourceDefinition(name, resource_type, properties=None, metadata=None, depends=None, deletion_policy=None, update_policy=None, description=None, external_id=None, condition=None)[source]

Bases: object

A definition of a resource, independent of any template format.

DELETE = 'Delete'
DELETION_POLICIES = ('Delete', 'Retain', 'Snapshot')
class Diff(old_defn, new_defn)[source]

Bases: object

A diff between two versions of the same resource definition.

metadata_changed()[source]

Return True if the resource metadata has changed.

properties_changed()[source]

Return True if the resource properties have changed.

update_policy_changed()[source]

Return True if the resource update policy has changed.

RETAIN = 'Retain'
SNAPSHOT = 'Snapshot'
condition()[source]

Return the name of the conditional inclusion rule, if any.

Returns None if the resource is included unconditionally.

deletion_policy()[source]

Return the deletion policy for the resource.

The policy will be one of those listed in DELETION_POLICIES.

dep_attrs(resource_name, load_all=False)[source]

Iterate over attributes of a given resource that this references.

Return an iterator over dependent attributes for specified resource_name in resources’ properties and metadata fields.

dependencies(stack)[source]

Return the Resource objects in given stack on which this depends.

external_id()[source]

Return the external resource id.

freeze(**overrides)[source]

Return a frozen resource definition, with all functions resolved.

This return a new resource definition with fixed data (containing no intrinsic functions). Named arguments passed to this method override the values passed as arguments to the constructor.

metadata()[source]

Return the resource metadata.

properties(schema, context=None)[source]

Return a Properties object representing the resource properties.

The Properties object is constructed from the given schema, and may require a context to validate constraints.

render_hot()[source]

Return a HOT snippet for the resource definition.

reparse(stack, template)[source]

Reinterpret the resource definition in the context of a new stack.

This returns a new resource definition, with all of the functions parsed in the context of the specified stack and template.

Any conditions are not included - it is assumed that the resource is being interpreted in any context that it should be enabled in that context.

required_resource_names()[source]

Return a set of names of all resources on which this depends.

Note that this is done entirely in isolation from the rest of the template, so the resource names returned may refer to resources that don’t actually exist, or would have strict_dependency=False. Use the dependencies() method to get validated dependencies.

set_translation_rules(rules=None, client_resolve=True)[source]

Helper method to update properties with translation rules.

update_policy(schema, context=None)[source]

Return a Properties object representing the resource update policy.

The Properties object is constructed from the given schema, and may require a context to validate constraints.

validate()[source]

Validate intrinsic functions that appear in the definition.