The heat.engine.parser Module

class heat.engine.parser.Stack(context, stack_name, tmpl, parameters=None, stack_id=None, state=None, state_description='', timeout_mins=60, resolve_data=True, disable_rollback=True)[source]

Bases: object

ACTIONS = ('CREATE', 'DELETE', 'UPDATE', 'ROLLBACK')
CREATE = 'CREATE'
CREATE_COMPLETE = 'CREATE_COMPLETE'
CREATE_FAILED = 'CREATE_FAILED'
CREATE_IN_PROGRESS = 'CREATE_IN_PROGRESS'
DELETE = 'DELETE'
DELETE_COMPLETE = 'DELETE_COMPLETE'
DELETE_FAILED = 'DELETE_FAILED'
DELETE_IN_PROGRESS = 'DELETE_IN_PROGRESS'
ROLLBACK = 'ROLLBACK'
ROLLBACK_COMPLETE = 'ROLLBACK_COMPLETE'
ROLLBACK_FAILED = 'ROLLBACK_FAILED'
ROLLBACK_IN_PROGRESS = 'ROLLBACK_IN_PROGRESS'
UPDATE = 'UPDATE'
UPDATE_COMPLETE = 'UPDATE_COMPLETE'
UPDATE_FAILED = 'UPDATE_FAILED'
UPDATE_IN_PROGRESS = 'UPDATE_IN_PROGRESS'
create()[source]

Create the stack and all of the resources.

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

created_time = None
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.

identifier()[source]

Return an identifier for this stack.

keys()[source]

Return a list of resource keys for the stack

classmethod load(context, stack_id=None, stack=None, resolve_data=True)[source]

Retrieve a Stack from the database

output(key)[source]

Get the value of the specified stack output.

resolve_runtime_data(snippet)[source]
resolve_static_data(snippet)[source]
resource_by_refid(refid)[source]

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

restart_resource(resource_name)[source]

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

state_set(new_status, reason)[source]

Update the stack state in the database

store(owner=None)[source]

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

update(newstack, action='UPDATE')[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

updated_time = None
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, parameters, snippet)[source]

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

Example:

>>> template = Template(template_format.parse(template_path))
>>> parameters = Parameters('stack', template, {'KeyName': 'my_key'})
>>> resolve_static_data(template, 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.

This Page