The heat.engine.properties
Module¶
-
class
heat.engine.properties.
Properties
(schema, data, resolver=<function <lambda>>, parent_name=None, context=None, section=None)[source]¶ Bases:
_abcoll.Mapping
-
static
schema_from_params
(params_snippet)[source]¶ Convert a template snippet with parameters into a properties schema.
Parameters: params_snippet – parameter definition from a template Returns: an equivalent properties schema for the specified params
-
classmethod
schema_to_parameters_and_properties
(schema, template_type='cfn')[source]¶ Generates properties with params resolved for a schema.
Parameters: schema – A resource type’s properties_schema Returns: A tuple of params and properties dicts - ex: input: {‘foo’: {‘Type’: ‘List’}}
- output: {‘foo’: {‘Type’: ‘CommaDelimitedList’}},
- {‘foo’: {‘Fn::Split’: {‘Ref’: ‘foo’}}}
- ex: input: {‘foo’: {‘Type’: ‘String’}, ‘bar’: {‘Type’: ‘Map’}}
- output: {‘foo’: {‘Type’: ‘String’}, ‘bar’: {‘Type’: ‘Json’}},
- {‘foo’: {‘Ref’: ‘foo’}, ‘bar’: {‘Ref’: ‘bar’}}
-
static
-
class
heat.engine.properties.
Property
(schema, name=None, context=None)[source]¶ Bases:
object
-
class
heat.engine.properties.
Schema
(data_type, description=None, default=None, schema=None, required=False, constraints=None, implemented=True, update_allowed=False, immutable=False, support_status=<heat.engine.support.SupportStatus object>, allow_conversion=False)[source]¶ Bases:
heat.engine.constraints.Schema
Schema class for validating resource properties.
This class is used for defining schema constraints for resource properties. It inherits generic validation features from the base Schema class and add processing that is specific to resource properties.
-
CONSTRAINTS
= 'constraints'¶
-
DEFAULT
= 'default'¶
-
DESCRIPTION
= 'description'¶
-
IMMUTABLE
= 'immutable'¶
-
KEYS
= ('type', 'description', 'default', 'schema', 'required', 'constraints', 'update_allowed', 'immutable')¶
-
REQUIRED
= 'required'¶
-
SCHEMA
= 'schema'¶
-
TYPE
= 'type'¶
-
UPDATE_ALLOWED
= 'update_allowed'¶
-
allowed_param_prop_type
()[source]¶ Return allowed type of Property Schema converted from parameter.
Especially, when generating Schema from parameter, Integer Property Schema will be supplied by Number parameter.
-
-
class
heat.engine.properties.
TranslationRule
(properties, rule, source_path, value=None, value_name=None, value_path=None)[source]¶ Bases:
object
Translating mechanism one properties to another.
Mechanism uses list of rules, each defines by this class, and can be executed. Working principe: during resource creating after properties defining resource take list of rules, specified by method translation_rules, which should be overloaded for each resource, if it’s needed, and execute each rule using translate_properties method. Next operations are allowed:
- ADD. This rule allows to add some value to list-type properties. Only
list-type values can be added to such properties. Using for other cases is prohibited and will be returned with error.
- REPLACE. This rule allows to replace some property value to another. Used
for all types of properties. Note, that if property has list type, then value will be replaced for all elements of list, where it needed. If element in such property must be replaced by value of another element of this property, value_name must be defined.
- DELETE. This rule allows to delete some property. If property has list
type, then deleting affects value in all list elements.
-
ADD
= 'Add'¶
-
DELETE
= 'Delete'¶
-
REPLACE
= 'Replace'¶
-
RULE_KEYS
= ('Add', 'Replace', 'Delete')¶