The heat.rpc.client Module
Client side of the heat engine RPC API.
-
class heat.rpc.client.EngineClient[source]
Bases: object
Client side of the heat engine rpc API.
API version history:
1.0 - Initial version.
1.1 - Add support_status argument to list_resource_types()
1.4 - Add support for service list
-
BASE_RPC_API_VERSION = '1.0'
-
abandon_stack(ctxt, stack_identity)[source]
The abandon_stack method deletes a given stack but
resources would not be deleted.
Parameters: |
- ctxt – RPC context.
- stack_identity – Name of the stack you want to abandon.
|
-
authenticated_to_backend(ctxt)[source]
Verify that the credentials in the RPC context are valid for the
current cloud backend.
Parameters: | ctxt – RPC context. |
-
call(ctxt, msg, version=None)[source]
-
cast(ctxt, msg, version=None)[source]
-
count_stacks(ctxt, filters=None, tenant_safe=True, show_deleted=False, show_nested=False)[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
:param tenant_safe: if true, scope the request by the current tenant
:param show_deleted: if true, count will include the deleted stacks
:param show_nested: if true, count will include nested stacks
:returns: a integer representing the number of matched stacks
-
create_software_config(cnxt, group, name, config, inputs=None, outputs=None, options=None)[source]
-
create_software_deployment(cnxt, server_id, config_id=None, input_values=None, action='INIT', status='COMPLETE', status_reason='', stack_user_project_id=None)[source]
-
create_stack(ctxt, stack_name, template, params, files, args)[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: |
- ctxt – RPC context.
- stack_name – Name of the stack you want to create.
- template – Template of stack you want to create.
- params – Stack Input Params/Environment
- files – files referenced from the environment.
- args – Request parameters/args passed from API
|
-
create_watch_data(ctxt, watch_name, stats_data)[source]
This could be used by CloudWatch and WaitConditions
and treat HA service events like any other CloudWatch.
:param ctxt: RPC context.
:param watch_name: Name of the watch/alarm
:param stats_data: The data to post.
-
delete_snapshot(cnxt, stack_identity, snapshot_id)[source]
-
delete_software_config(cnxt, config_id)[source]
-
delete_software_deployment(cnxt, deployment_id)[source]
-
delete_stack(ctxt, stack_identity, cast=True)[source]
The delete_stack method deletes a given stack.
Parameters: |
- ctxt – RPC context.
- stack_identity – Name of the stack you want to delete.
- cast – cast the message or use call (default: True)
|
-
describe_stack_resource(ctxt, stack_identity, resource_name, with_attr=None)[source]
Get detailed resource information about a particular resource.
:param ctxt: RPC context.
:param stack_identity: Name of the stack.
:param resource_name: the Resource.
-
describe_stack_resources(ctxt, stack_identity, resource_name)[source]
Get detailed resource information about one or more resources.
:param ctxt: RPC context.
:param stack_identity: Name of the stack.
:param resource_name: the Resource.
-
find_physical_resource(ctxt, physical_resource_id)[source]
Return an identifier for the resource with the specified physical
resource ID.
:param ctxt RPC context.
:param physcial_resource_id The physical resource ID to look up.
-
generate_template(ctxt, type_name)[source]
Generate a template based on the specified type.
Parameters: |
- ctxt – RPC context.
- type_name – The resource type name to generate a template for.
|
-
get_revision(ctxt)[source]
-
get_template(ctxt, stack_identity)[source]
Get the template.
Parameters: |
- ctxt – RPC context.
- stack_name – Name of the stack you want to see.
|
-
identify_stack(ctxt, stack_name)[source]
The identify_stack method returns the full stack identifier for a
single, live stack given the stack name.
Parameters: |
- ctxt – RPC context.
- stack_name – Name of the stack you want to see,
or None to see all
|
-
ignore_error_named(error, name)[source]
Raises the error unless its local name matches the supplied name
Parameters: |
- error – Remote raised error to derive the local name from.
- name – Name to compare local name to.
|
-
list_events(ctxt, stack_identity, filters=None, limit=None, marker=None, sort_keys=None, sort_dir=None)[source]
The list_events method lists all events associated with a given stack.
It supports pagination (limit and marker),
sorting (sort_keys and sort_dir) and filtering(filters)
of the results.
Parameters: |
- ctxt – RPC context.
- stack_identity – Name of the stack you want to get events for
- filters – a dict with attribute:value to filter the list
- limit – the number of events to list (integer or string)
- marker – the ID of the last event 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’).
|
-
list_resource_types(ctxt, support_status=None)[source]
Get a list of valid resource types.
Parameters: | ctxt – RPC context. |
-
list_services(cnxt)[source]
-
list_software_deployments(cnxt, server_id=None)[source]
-
list_stack_resources(ctxt, stack_identity, nested_depth=0)[source]
List the resources belonging to a stack.
:param ctxt: RPC context.
:param stack_identity: Name of the stack.
:param nested_depth: Levels of nested stacks of which list resources.
-
list_stacks(ctxt, limit=None, marker=None, sort_keys=None, sort_dir=None, filters=None, tenant_safe=True, show_deleted=False, show_nested=False)[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: |
- ctxt – 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
- show_deleted – if true, show soft-deleted stacks
- show_nested – if true, show nested stacks
|
Returns: | a list of stacks
|
-
local_error_name(error)[source]
Returns the name of the error with any _Remote postfix removed.
Parameters: | error – Remote raised error to derive the name from. |
-
static make_msg(method, **kwargs)[source]
-
metadata_software_deployments(cnxt, server_id)[source]
-
metadata_update(ctxt, stack_identity, resource_name, metadata)[source]
Update the metadata for the given resource.
-
preview_stack(ctxt, stack_name, template, params, files, args)[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: |
- ctxt – RPC context.
- stack_name – Name of the stack you want to create.
- template – Template of stack you want to create.
- params – Stack Input Params/Environment
- files – files referenced from the environment.
- args – Request parameters/args passed from API
|
-
resource_schema(ctxt, type_name)[source]
Get the schema for a resource type.
Parameters: | ctxt – RPC context. |
-
resource_signal(ctxt, stack_identity, resource_name, details, sync_call=False)[source]
Generate an alarm on the resource.
:param ctxt: RPC context.
:param stack_identity: Name of the stack.
:param resource_name: the Resource.
:param details: the details of the signal.
-
set_watch_state(ctxt, watch_name, state)[source]
Temporarily set the state of a given watch
:param ctxt: RPC context.
:param watch_name: Name of the watch
:param state: State (must be one defined in WatchRule class)
-
show_snapshot(cnxt, stack_identity, snapshot_id)[source]
-
show_software_config(cnxt, config_id)[source]
-
show_software_deployment(cnxt, deployment_id)[source]
-
show_stack(ctxt, stack_identity)[source]
Return detailed information about one or all stacks.
:param ctxt: RPC context.
:param stack_identity: Name of the stack you want to show, or None to
show all
-
show_watch(ctxt, watch_name)[source]
The show_watch method returns the attributes of one watch
or all watches if no watch_name is passed
Parameters: |
- ctxt – RPC context.
- watch_name – Name of the watch/alarm you want to see,
or None to see all
|
-
show_watch_metric(ctxt, metric_namespace=None, metric_name=None)[source]
The show_watch_metric method returns the datapoints associated
with a specified metric, or all metrics if no metric_name is passed
Parameters: |
- ctxt – 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
|
-
signal_software_deployment(cnxt, deployment_id, details, updated_at=None)[source]
-
stack_cancel_update(ctxt, stack_identity)[source]
-
stack_check(ctxt, stack_identity)[source]
-
stack_list_snapshots(cnxt, stack_identity)[source]
-
stack_restore(cnxt, stack_identity, snapshot_id)[source]
-
stack_resume(ctxt, stack_identity)[source]
-
stack_snapshot(ctxt, stack_identity, name)[source]
-
stack_suspend(ctxt, stack_identity)[source]
-
update_software_deployment(cnxt, deployment_id, config_id=None, input_values=None, output_values=None, action=None, status=None, status_reason=None, updated_at=None)[source]
-
update_stack(ctxt, stack_identity, template, params, files, args)[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: |
- ctxt – RPC context.
- stack_name – Name of the stack you want to create.
- template – Template of stack you want to create.
- params – Stack Input Params/Environment
- files – files referenced from the environment.
- args – Request parameters/args passed from API
|
-
validate_template(ctxt, template, params=None)[source]
The validate_template method uses the stack parser to check
the validity of a template.
Parameters: |
- ctxt – RPC context.
- template – Template of stack you want to create.
- params – Stack Input Params/Environment
|