The heat.engine.service ModuleΒΆ

class heat.engine.service.EngineListener(host, engine_id, thread_group_mgr)[source]

Bases: heat.openstack.common.rpc.service.Service

Listen on an AMQP queue named for the engine. Allows individual engines to communicate with each other for multi-engine support.

listening(ctxt)[source]

Respond affirmatively to confirm that the engine performing the action is still alive.

stop_stack(ctxt, stack_identity)[source]

Stop any active threads on a stack.

class heat.engine.service.EngineService(host, topic, manager=None)[source]

Bases: heat.openstack.common.rpc.service.Service

Manages the running instances from creation to destruction. All the methods in here are called from the RPC backend. This is all done dynamically so if a call is made via RPC that does not have a corresponding method here, an exception will be thrown when it attempts to call into this class. Arguments to these methods are also dynamically added and will be named as keyword arguments by the RPC caller.

RPC_API_VERSION = '1.1'
abandon_stack(ctx, *args, **kwargs)[source]

The abandon_stack method abandons a given stack. :param cnxt: RPC context. :param stack_identity: Name of the stack you want to abandon.

authenticated_to_backend(ctx, *args, **kwargs)[source]

Verify that the credentials in the RPC context are valid for the current cloud backend.

count_stacks(ctx, *args, **kwargs)[source]

Return the number of stacks that match the given filters :param ctxt: RPC context. :param filters: a dict of ATTR:VALUE to match against stacks :returns: a integer representing the number of matched stacks

create_software_config(ctx, *args, **kwargs)[source]
create_software_deployment(ctx, *args, **kwargs)[source]
create_stack(ctx, *args, **kwargs)[source]

The create_stack method creates a new stack using the template provided. Note that at this stage the template has already been fetched from the heat-api process if using a template-url.

Parameters:
  • cnxt – RPC context.
  • stack_name – Name of the stack you want to create.
  • template – Template of stack you want to create.
  • params – Stack Input Params
  • files – Files referenced from the template
  • args – Request parameters/args passed from API
create_watch_data(ctx, *args, **kwargs)[source]

This could be used by CloudWatch and WaitConditions and treat HA service events like any other CloudWatch.

delete_software_config(ctx, *args, **kwargs)[source]
delete_software_deployment(ctx, *args, **kwargs)[source]
delete_stack(ctx, *args, **kwargs)[source]

The delete_stack method deletes a given stack.

Parameters:
  • cnxt – RPC context.
  • stack_identity – Name of the stack you want to delete.
describe_stack_resource(ctx, *args, **kwargs)[source]
describe_stack_resources(ctx, *args, **kwargs)[source]
find_physical_resource(ctx, *args, **kwargs)[source]

Return an identifier for the resource with the specified physical resource ID.

Parameters:
  • cnxt – RPC context.
  • physical_resource_id – The physical resource ID to look up.
generate_template(cnxt, type_name)[source]

Generate a template based on the specified type.

Parameters:
  • cnxt – RPC context.
  • type_name – Name of the resource type to generate a template for.
get_revision(cnxt)[source]
get_template(ctx, *args, **kwargs)[source]

Get the template.

Parameters:
  • cnxt – RPC context.
  • stack_identity – Name of the stack you want to see.
identify_stack(ctx, *args, **kwargs)[source]

The identify_stack method returns the full stack identifier for a single, live stack given the stack name.

Parameters:
  • cnxt – RPC context.
  • stack_name – Name or UUID of the stack to look up.
list_events(ctx, *args, **kwargs)[source]

The list_events method lists all events associated with a given stack.

Parameters:
  • cnxt – RPC context.
  • stack_identity – Name of the stack you want to get events for.
list_resource_types(cnxt, support_status=None)[source]

Get a list of supported resource types.

Parameters:cnxt – RPC context.
list_software_deployments(ctx, *args, **kwargs)[source]
list_stack_resources(ctx, *args, **kwargs)[source]
list_stacks(ctx, *args, **kwargs)[source]

The list_stacks method returns attributes of all stacks. It supports pagination (limit and marker), sorting (sort_keys and sort_dir) and filtering (filters) of the results.

Parameters:
  • cnxt – RPC context
  • limit – the number of stacks to list (integer or string)
  • marker – the ID of the last item in the previous page
  • sort_keys – an array of fields used to sort the list
  • sort_dir – the direction of the sort (‘asc’ or ‘desc’)
  • filters – a dict with attribute:value to filter the list
  • tenant_safe – if true, scope the request by the current tenant
Returns:

a list of formatted stacks

static load_user_creds(creds_id)[source]
metadata_software_deployments(ctx, *args, **kwargs)[source]
metadata_update(ctx, *args, **kwargs)[source]

Update the metadata for the given resource.

preview_stack(ctx, *args, **kwargs)[source]

Simulates a new stack using the provided template.

Note that at this stage the template has already been fetched from the heat-api process if using a template-url.

Parameters:
  • cnxt – RPC context.
  • stack_name – Name of the stack you want to create.
  • template – Template of stack you want to create.
  • params – Stack Input Params
  • files – Files referenced from the template
  • args – Request parameters/args passed from API
resource_schema(cnxt, type_name)[source]

Return the schema of the specified type.

Parameters:
  • cnxt – RPC context.
  • type_name – Name of the resource type to obtain the schema of.
resource_signal(ctx, *args, **kwargs)[source]
set_watch_state(ctx, *args, **kwargs)[source]

Temporarily set the state of a given watch

Parameters:
  • cnxt – RPC context.
  • watch_name – Name of the watch
  • state – State (must be one defined in WatchRule class
show_software_config(ctx, *args, **kwargs)[source]
show_software_deployment(ctx, *args, **kwargs)[source]
show_stack(ctx, *args, **kwargs)[source]

Return detailed information about one or all stacks.

Parameters:
  • cnxt – RPC context.
  • stack_identity – Name of the stack you want to show, or None to show all
show_watch(ctx, *args, **kwargs)[source]

The show_watch method returns the attributes of one watch/alarm

Parameters:
  • cnxt – RPC context.
  • watch_name – Name of the watch you want to see, or None to see all
show_watch_metric(ctx, *args, **kwargs)[source]

The show_watch method returns the datapoints for a metric

Parameters:
  • cnxt – RPC context.
  • metric_namespace – Name of the namespace you want to see, or None to see all
  • metric_name – Name of the metric you want to see, or None to see all
stack_resume(ctx, *args, **kwargs)[source]

Handle request to perform a resume action on a stack

stack_suspend(ctx, *args, **kwargs)[source]

Handle request to perform suspend action on a stack

start()[source]
update_software_deployment(ctx, *args, **kwargs)[source]
update_stack(ctx, *args, **kwargs)[source]

The update_stack method updates an existing stack based on the provided template and parameters. Note that at this stage the template has already been fetched from the heat-api process if using a template-url.

Parameters:
  • cnxt – RPC context.
  • stack_identity – Name of the stack you want to create.
  • template – Template of stack you want to create.
  • params – Stack Input Params
  • files – Files referenced from the template
  • args – Request parameters/args passed from API
validate_template(ctx, *args, **kwargs)[source]

The validate_template method uses the stack parser to check the validity of a template.

Parameters:
  • cnxt – RPC context.
  • template – Template of stack you want to create.
  • params – Stack Input Params
class heat.engine.service.StackWatch(thread_group_mgr)[source]

Bases: object

check_stack_watches(sid)[source]
periodic_watcher_task(sid)[source]

Periodic task, created for each stack, triggers watch-rule evaluation for all rules defined for the stack sid = stack ID

start_watch_task(stack_id, cnxt)[source]
class heat.engine.service.ThreadGroupManager[source]

Bases: object

add_timer(stack_id, func, *args, **kwargs)[source]

Define a periodic task, to be run in a separate thread, in the stack threadgroups. Periodicity is cfg.CONF.periodic_interval

start(stack_id, func, *args, **kwargs)[source]

Run the given method in a sub-thread.

start_with_acquired_lock(stack, lock, func, *args, **kwargs)[source]

Run the given method in a sub-thread and release the provided lock when the thread finishes.

Parameters:
  • stack (heat.engine.parser.Stack) – Stack to be operated on
  • lock (heat.engine.stack_lock.StackLock) – The acquired stack lock
  • func (function or instancemethod) – Callable to be invoked in sub-thread
  • args – Args to be passed to func
  • kwargs – Keyword-args to be passed to func
start_with_lock(cnxt, stack, engine_id, func, *args, **kwargs)[source]

Try to acquire a stack lock and, if successful, run the given method in a sub-thread. Release the lock when the thread finishes.

Parameters:
  • cnxt – RPC context
  • stack (heat.engine.parser.Stack) – Stack to be operated on
  • engine_id – The UUID of the engine acquiring the lock
  • func (function or instancemethod) – Callable to be invoked in sub-thread
  • args – Args to be passed to func
  • kwargs – Keyword-args to be passed to func.
stop(stack_id)[source]

Stop any active threads on a stack.

heat.engine.service.request_context(func)[source]

Previous topic

The heat.engine.resource Module

Next topic

The heat.engine Module

This Page