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
-
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.
-
name
¶
-
path
¶
-
registry
¶
-
user_resource
¶
-
value
¶
-
-
class
heat.engine.environment.
ResourceRegistry
(global_registry, param_defaults)[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, with_description=False)[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 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'¶
-
template_name
¶
-
-
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.