heat.engine.resources.stack_resource module

class heat.engine.resources.stack_resource.StackResource(name, definition, stack)[source]

Bases: heat.engine.resource.Resource

Allows entire stack to be managed as a resource in a parent stack.

An abstract Resource subclass that allows the management of an entire Stack as a resource in a parent stack.

check_adopt_complete(cookie=None)[source]
check_check_complete(cookie=None)[source]
check_create_complete(cookie=None)[source]
check_delete_complete(cookie=None)[source]
check_resume_complete(cookie=None)[source]
check_suspend_complete(cookie=None)[source]
check_update_complete(cookie=None)[source]
child_definition(child_template=None, user_params=None, nested_identifier=None)[source]
child_params()[source]

Default implementation to get the child params.

Resources that inherit from StackResource should override this method with specific details about the parameters used by them.

child_template()[source]

Default implementation to get the child template.

Resources that inherit from StackResource should override this method with specific details about the template used by them.

child_template_files(child_env)[source]

Default implementation to get the files map for child template.

create_with_template(child_template, user_params=None, timeout_mins=None, adopt_data=None)[source]

Create the nested stack with the given template.

delete_nested()[source]

Delete the nested stack.

get_nested_parameters_stack()[source]

Return a stack for schema validation.

This returns a stack to be introspected for building parameters schema. It can be customized by subclass to return a restricted version of what will be running.

get_output(op)[source]

Return the specified Output value from the nested stack.

If the output key does not exist, raise a NotFound exception.

handle_check()[source]
handle_create_cancel(cookie)[source]
handle_delete()[source]

Default implementation; should be overridden by resources.

handle_preempt()[source]

Pre-empt an in-progress update when a new update is available.

This method is called when a previous convergence update is in progress but a new update for the resource is available. By default it does nothing, but subclasses may override it to cancel the in-progress update if it is safe to do so.

Note that this method does not run in the context of the in-progress update and has no access to runtime information about it; nor is it safe to make changes to the Resource in the database. If implemented, this method should cause the existing update to complete by external means. If this leaves the resource in a FAILED state, that should be taken into account in needs_replace_failed().

handle_resume()[source]
handle_suspend()[source]
handle_update_cancel(cookie)[source]
has_nested()[source]

Return True if the resource has an existing nested stack.

nested()[source]

Return a Stack object representing the nested (child) stack.

If we catch NotFound exception when loading, return None.

nested_identifier()[source]
prepare_abandon()[source]
preview()[source]

Preview a StackResource as resources within a Stack.

This method overrides the original Resource.preview to return a preview of all the resources contained in this Stack. For this to be possible, the specific resources need to override both child_template and child_params with specific information to allow the stack to be parsed correctly. If any of these methods is missing, the entire StackResource will be returned as if it were a regular Resource.

requires_deferred_auth = True
property template_url

Template url for the stack resource.

When stack resource is a TemplateResource, it’s the template location. For group resources like ResourceGroup where the template is constructed dynamically, it’s just a placeholder.

translate_remote_exceptions(ex)[source]
update_with_template(child_template, user_params=None, timeout_mins=None)[source]

Update the nested stack with the new template.

validate()[source]

Validate the resource.

This may be overridden by resource plugins to add extra validation logic specific to the resource implementation.

validate_nested_stack()[source]