heat.common.grouputils module

class heat.common.grouputils.GroupInspector(context, rpc_client, group_identity)[source]

Bases: object

A class for returning data about a scaling group.

All data is fetched over RPC, and the group’s stack is never loaded into memory locally. Data is cached so it will be fetched only once. To refresh the data, create a new GroupInspector.

classmethod from_parent_resource(parent_resource)[source]

Create a GroupInspector from a parent resource.

This is a convenience method to instantiate a GroupInspector from a Heat StackResource object.

member_names(include_failed)[source]

Return an iterator over the names of the group members

If include_failed is False, only members not in a FAILED state will be included.

size(include_failed)[source]

Return the size of the group.

If include_failed is False, only members not in a FAILED state will be counted.

template()[source]

Return a Template object representing the group’s current template.

Note that this does not include any environment data.

heat.common.grouputils.get_child_template_files(context, stack, is_rolling_update, old_template_id)[source]

Return a merged map of old and new template files.

For rolling update files for old and new defintions are required as the nested stack is updated in batches of scaled units.

heat.common.grouputils.get_member_definitions(group, include_failed=False)[source]

Get member definitions in (name, ResourceDefinition) pair for group.

The List is sorted first by created_time then by name. If include_failed is set, failed members will be put first in the List sorted by created_time then by name.

heat.common.grouputils.get_member_names(group)[source]

Get a list of resource names of the resources in the specified group.

Failed resources will be ignored.

heat.common.grouputils.get_member_refids(group)[source]

Get a list of member resources managed by the specified group.

The list of resources is sorted first by created_time then by name.

heat.common.grouputils.get_members(group, include_failed=False)[source]

Get a list of member resources managed by the specified group.

Sort the list of instances first by created_time then by name. If include_failed is set, failed members will be put first in the list sorted by created_time then by name.

heat.common.grouputils.get_nested_attrs(stack, key, use_indices, *path)[source]
heat.common.grouputils.get_resource(stack, resource_name, use_indices, key=None)[source]
heat.common.grouputils.get_rsrc_attr(stack, key, use_indices, resource_name, *attr_path)[source]
heat.common.grouputils.get_rsrc_id(stack, key, use_indices, resource_name)[source]
heat.common.grouputils.get_size(group, include_failed=False)[source]

Get number of member resources managed by the specified group.

The size excludes failed members by default; set include_failed=True to get the total size.