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=None, resolve_data=True, disable_rollback=True, parent_resource=None, owner_id=None, adopt_stack_data=None, stack_user_project_id=None, created_time=None, updated_time=None, user_creds_id=None, tenant_id=None)[source]

Bases: _abcoll.Mapping

ACTIONS = ('CREATE', 'DELETE', 'UPDATE', 'ROLLBACK', 'SUSPEND', 'RESUME', 'ADOPT')
ADOPT = 'ADOPT'
COMPLETE = 'COMPLETE'
CREATE = 'CREATE'
DELETE = 'DELETE'
FAILED = 'FAILED'
IN_PROGRESS = 'IN_PROGRESS'
RESUME = 'RESUME'
ROLLBACK = 'ROLLBACK'
STATUSES = ('IN_PROGRESS', 'FAILED', 'COMPLETE')
SUSPEND = 'SUSPEND'
UPDATE = 'UPDATE'
access_allowed(credential_id, resource_name)[source]

Returns True if the credential_id is authorised to access the resource with the specified resource_name.

adopt()[source]

Adopt a stack (create stack with all the existing resources).

create()[source]

Create the stack and all of the resources.

delete(action='DELETE', backup=False)[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.

dependencies[source]
get_abandon_data()[source]
get_availability_zones()[source]
identifier()[source]

Return an identifier for this stack.

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

Retrieve a Stack from the database.

output(key)[source]

Get the value of the specified stack output.

preview_resources()[source]

Preview the stack with all of the resources.

register_access_allowed_handler(credential_id, handler)[source]

Register a function which determines whether the credentials with a give ID can have access to a named resource.

requires_deferred_auth()[source]

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

reset_dependencies()[source]
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

resources[source]
restart_resource(resource_name)[source]

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

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.

root_stack[source]

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

set_deletion_policy(policy)[source]
set_stack_user_project_id(project_id)[source]
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

state[source]

Returns state, tuple of action, status.

state_set(action, status, reason)[source]

Update the stack state in the database.

store(backup=False)[source]

Store the stack in the database and return its ID If self.id is set, we update the existing 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.

timeout_secs()[source]

Return the stack action timeout in seconds.

total_resources()[source]

Return the total number of resources in a stack, including nested stacks below.

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

update_task(*args, **kwargs)[source]
validate()[source]

Validates the template.

Previous topic

The heat.engine.constraints Module

Next topic

The heat.engine.watchrule Module

This Page