The heat.engine.environment
ModuleΒΆ
-
class
heat.engine.environment.
ClassResourceInfo
(registry, path, value)[source] Bases:
heat.engine.environment.ResourceInfo
Store the mapping of resource name to python class implementation.
-
description
= 'Plugin'
-
get_class
()[source]
-
-
class
heat.engine.environment.
Environment
(env=None, user_env=True)[source] Bases:
object
-
get_class
(resource_type, resource_name=None)[source]
-
get_constraint
(name)[source]
-
get_resource_info
(resource_type, resource_name=None, registry_type=None)[source]
-
get_stack_lifecycle_plugins
()[source]
-
get_types
(support_status=None)[source]
-
load
(env_snippet)[source]
-
patch_previous_parameters
(previous_env, clear_parameters=[])[source] This instance of Environment is the new environment where we are reusing as default the previous parameter values.
-
register_class
(resource_type, resource_class)[source]
-
register_constraint
(constraint_name, constraint)[source]
-
register_stack_lifecycle_plugin
(stack_lifecycle_name, stack_lifecycle_class)[source]
-
user_env_as_dict
()[source] Get the environment as a dict, ready for storing in the db.
-
-
class
heat.engine.environment.
GlobResourceInfo
(registry, path, value)[source] Bases:
heat.engine.environment.MapResourceInfo
Store the mapping (with wild cards) of one resource type to another.
like: OS::Networking::* -> OS::Neutron::*
-
description
= 'Wildcard Mapping'
-
get_resource_info
(resource_type=None, resource_name=None)[source]
-
matches
(resource_type)[source]
-
-
class
heat.engine.environment.
MapResourceInfo
(registry, path, value)[source] Bases:
heat.engine.environment.ResourceInfo
Store the mapping of one resource type to another.
like: OS::Networking::FloatingIp -> OS::Neutron::FloatingIp
-
description
= 'Mapping'
-
get_class
()[source]
-
get_resource_info
(resource_type=None, resource_name=None)[source]
-
-
class
heat.engine.environment.
ResourceInfo
(registry, path, value)[source] Bases:
object
Base mapping of resource type to implementation.
-
get_resource_info
(resource_type=None, resource_name=None)[source]
-
matches
(resource_type)[source]
-
-
class
heat.engine.environment.
ResourceRegistry
(global_registry, env)[source] Bases:
object
By looking at the environment, find the resource implementation.
-
as_dict
()[source] Return user resources in a dict format.
-
get_class
(resource_type, resource_name=None)[source]
-
get_resource_info
(resource_type, resource_name=None, registry_type=None)[source] Find possible matches to the resource type and name. chain the results from the global and user registry to find a match.
-
get_types
(support_status)[source] Return a list of valid resource types.
-
iterable_by
(resource_type, resource_name=None)[source]
-
load
(json_snippet)[source]
-
matches_hook
(resource_name, hook)[source] Return whether a resource have a hook set in the environment.
For a given resource and a hook type, we check to see if the the passed group of resources has the right hook associated with the name.
Hooks are set in this format via resources:
- {
- “res_name”: {
- “hooks”: [pre-create, pre-update]
}, “*_suffix”: {
“hooks”: pre-create}, “prefix_*”: {
“hooks”: pre-update}
}
A hook value is either pre-create, pre-update or a list of those values. Resources support wildcard matching. The asterisk sign matches everything.
-
register_class
(resource_type, resource_class)[source]
-
remove_item
(info)[source]
-
remove_resources_except
(resource_name)[source]
-
-
class
heat.engine.environment.
TemplateResourceInfo
(registry, path, value)[source] Bases:
heat.engine.environment.ResourceInfo
Store the info needed to start a TemplateResource.
-
description
= 'Template'
-
get_class
()[source]
-
-
heat.engine.environment.
get_child_environment
(parent_env, child_params, item_to_remove=None, child_resource_name=None)[source] Build a child environment using the parent environment and params.
This is built from the child_params and the parent env so some resources can use user-provided parameters as if they come from an environment.
- resource_registry must be merged (child env should be loaded after the parent env to take presdence).
- child parameters must overwrite the parent’s as they won’t be relevant in the child template.
If child_resource_name is provided, resources in the registry will be replaced with the contents of the matching child resource plus anything that passes a wildcard match.
-
heat.engine.environment.
is_hook_definition
(key, value)[source]
-
heat.engine.environment.
read_global_environment
(env, env_dir=None)[source]
-
heat.engine.environment.
valid_hook_type
(hook)[source]