The heat.engine.parser ModuleΒΆ

class heat.engine.parser.Stack(context, stack_name, tmpl, env=None, stack_id=None, action=None, status=None, status_reason='', timeout_mins=60, resolve_data=True, disable_rollback=True, parent_resource=None, owner_id=None)[source]

Bases: object

Stack.ACTIONS = ('CREATE', 'DELETE', 'UPDATE', 'ROLLBACK', 'SUSPEND', 'RESUME')
Stack.COMPLETE = 'COMPLETE'
Stack.CREATE = 'CREATE'
Stack.DELETE = 'DELETE'
Stack.FAILED = 'FAILED'
Stack.IN_PROGRESS = 'IN_PROGRESS'
Stack.RESUME = 'RESUME'
Stack.ROLLBACK = 'ROLLBACK'
Stack.STATUSES = ('IN_PROGRESS', 'FAILED', 'COMPLETE')
Stack.SUSPEND = 'SUSPEND'
Stack.UPDATE = 'UPDATE'
Stack.create()[source]

Create the stack and all of the resources.

Stack.created_time = None
Stack.delete(action='DELETE')[source]

Delete all of the resources, and then the stack itself. The action parameter is used to differentiate between a user initiated delete and an automatic stack rollback after a failed create, which amount to the same thing, but the states are recorded differently.

Stack.dependencies[source]
Stack.get_availability_zones()[source]
Stack.identifier()[source]

Return an identifier for this stack.

Stack.keys()[source]

Return a list of resource keys for the stack.

classmethod Stack.load(context, stack_id=None, stack=None, resolve_data=True, parent_resource=None, show_deleted=True)[source]

Retrieve a Stack from the database.

Stack.output(key)[source]

Get the value of the specified stack output.

Stack.requires_deferred_auth()[source]

Returns whether this stack may need to perform API requests during its lifecycle using the configured deferred authentication method.

Stack.reset_dependencies()[source]
Stack.resolve_runtime_data(snippet)[source]
Stack.resolve_static_data(snippet)[source]
Stack.resource_by_refid(refid)[source]

Return the resource in this stack with the specified refid, or None if not found

Stack.resources[source]
Stack.restart_resource(resource_name)[source]

stop resource_name and all that depend on it start resource_name and all that depend on it

Stack.resume()[source]

Resume the stack, which invokes handle_resume for all stack resources waits for all resources to become RESUME_COMPLETE then declares the stack RESUME_COMPLETE. Note the default implementation for all resources is to do nothing other than move to RESUME_COMPLETE, so the resources must implement handle_resume for this to have any effect.

Stack.root_stack[source]

Return the root stack if this is nested (otherwise return self).

Stack.stack_task(*args, **kwargs)[source]

A task to perform an action on the stack and all of the resources in forward or reverse dependency order as specfifed by reverse

Stack.state[source]

Returns state, tuple of action, status.

Stack.state_set(action, status, reason)[source]

Update the stack state in the database.

Stack.store(backup=False)[source]

Store the stack in the database and return its ID If self.id is set, we update the existing stack

Stack.suspend()[source]

Suspend the stack, which invokes handle_suspend for all stack resources waits for all resources to become SUSPEND_COMPLETE then declares the stack SUSPEND_COMPLETE. Note the default implementation for all resources is to do nothing other than move to SUSPEND_COMPLETE, so the resources must implement handle_suspend for this to have any effect.

Stack.timeout_secs()[source]

Return the stack creation timeout in seconds, or None if no timeout should be used.

Stack.total_resources()[source]

Total number of resources in a stack, including nested stacks below.

Stack.update(newstack)[source]

Compare the current stack with newstack, and where necessary create/update/delete the resources until this stack aligns with newstack.

Note update of existing stack resources depends on update being implemented in the underlying resource types

Update will fail if it exceeds the specified timeout. The default is 60 minutes, set in the constructor

Stack.update_task(*args, **kwargs)[source]
Stack.updated_time = None
Stack.validate()[source]

http://docs.amazonwebservices.com/AWSCloudFormation/latest/ APIReference/API_ValidateTemplate.html

heat.engine.parser.resolve_runtime_data(template, resources, snippet)[source]
heat.engine.parser.resolve_static_data(template, stack, parameters, snippet)[source]

Resolve static parameters, map lookups, etc. in a template.

Example:

>>> from heat.common import template_format
>>> template_str = '# JSON or YAML encoded template'
>>> template = Template(template_format.parse(template_str))
>>> parameters = Parameters('stack', template, {'KeyName': 'my_key'})
>>> resolve_static_data(template, None, parameters, {'Ref': 'KeyName'})
'my_key'
heat.engine.parser.transform(data, transformations)[source]

Apply each of the transformation functions in the supplied list to the data in turn.

Previous topic

The heat.engine Module

Next topic

The heat.rpc.api Module

This Page