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'¶
-
-
class
heat.engine.environment.
Environment
(env=None, user_env=True)[source]¶ Bases:
object
-
get_class
(resource_type, resource_name=None, files=None)¶
-
get_class_to_instantiate
(resource_type, resource_name=None)¶
-
get_constraint
(name)¶
-
get_event_sinks
()¶
-
get_resource_info
(resource_type, resource_name=None, registry_type=None, ignore=None)¶
-
get_stack_lifecycle_plugins
()¶
-
get_types
(cnxt=None, support_status=None, type_name=None, version=None)¶
-
load
(env_snippet)¶
-
register_class
(resource_type, resource_class, path=None)¶
-
register_constraint
(constraint_name, constraint)¶
-
register_event_sink
(event_sink_name, event_sink_class)¶
-
register_stack_lifecycle_plugin
(stack_lifecycle_name, stack_lifecycle_class)¶
-
user_env_as_dict
()¶ 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::*
Also supports many-to-one mapping (mostly useful together with special “OS::Heat::None” resource)
like: OS::* -> OS::Heat::None
-
description
= 'Wildcard Mapping'¶
-
-
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'¶
-
-
class
heat.engine.environment.
ResourceInfo
(registry, path, value)[source]¶ Bases:
object
Base mapping of resource type to implementation.
-
class
heat.engine.environment.
ResourceRegistry
(global_registry, env)[source]¶ Bases:
object
By looking at the environment, find the resource implementation.
-
get_resource_info
(resource_type, resource_name=None, registry_type=None, ignore=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_rsrc_restricted_actions
(resource_name)[source]¶ Returns a set of restricted actions.
For a given resource we get the set of restricted actions.
Actions are set in this format via resources:
- {
- “restricted_actions”: [update, replace]
}
A restricted_actions value is either update, replace or a list of those values. Resources support wildcard matching. The asterisk sign matches everything.
-
get_types
(cnxt=None, support_status=None, type_name=None, version=None)[source]¶ Return a list of valid resource types.
-
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.
-
-
class
heat.engine.environment.
TemplateResourceInfo
(registry, path, value)[source]¶ Bases:
heat.engine.environment.ResourceInfo
Store the info needed to start a TemplateResource.
-
description
= 'Template'¶
-
-
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 precedence).
- 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.