The heat.engine.properties ModuleΒΆ

class heat.engine.properties.AllowedPattern(pattern, description=None)[source]

Bases: heat.engine.properties.Constraint

Constrain values to a predefined regular expression pattern.

Serialises to JSON as:

{
    'allowed_pattern': <pattern>,
    'description': <description>
}
AllowedPattern.valid_types = ('String',)
class heat.engine.properties.AllowedValues(allowed, description=None)[source]

Bases: heat.engine.properties.Constraint

Constrain values to a predefined set.

Serialises to JSON as:

{
    'allowed_values': [<allowed1>, <allowed2>, ...],
    'description': <description>
}
AllowedValues.valid_types = ('String', 'Integer', 'Number', 'Boolean')
class heat.engine.properties.AnyIndexDict(value)[source]

Bases: _abcoll.Mapping

A Mapping that returns the same value for any integer index.

Used for storing the schema for a list. When converted to a dictionary, it contains a single item with the key ‘*’.

AnyIndexDict.ANYTHING = '*'
class heat.engine.properties.Constraint(description=None)[source]

Bases: _abcoll.Mapping

Parent class for constraints on allowable values for a Property.

Constraints are serialisable to dictionaries following the HOT input Parameter constraints schema using dict().

Constraint.DESCRIPTION = 'description'
Constraint.validate(value)[source]
exception heat.engine.properties.InvalidPropertySchemaError[source]

Bases: exceptions.Exception

class heat.engine.properties.Length(min=None, max=None, description=None)[source]

Bases: heat.engine.properties.Range

Constrain the length of values within a range.

Serialises to JSON as:

{
    'length': {'min': <min>, 'max': <max>},
    'description': <description>
}
Length.valid_types = ('String', 'List')
class heat.engine.properties.Properties(schema, data, resolver=<function <lambda> at 0x7f48a2038ed8>, parent_name=None)[source]

Bases: _abcoll.Mapping

static Properties.schema_from_params(params_snippet)[source]

Convert a template snippet that defines parameters into a properties schema

Parameters:params_snippet – parameter definition from a template
Returns:an equivalent properties schema for the specified params
static Properties.schema_to_parameters_and_properties(schema)[source]

Generates properties with params resolved for a resource’s properties_schema.

Parameters:schema – A resource’s properties_schema
Returns:A tuple of params and properties dicts
Properties.validate(with_value=True)[source]
class heat.engine.properties.Property(schema, name=None)[source]

Bases: object

Property.default()[source]
Property.has_default()[source]
Property.implemented()[source]
Property.required()[source]
static Property.str_to_num(value)[source]
Property.type()[source]
Property.validate_data(value)[source]
class heat.engine.properties.Range(min=None, max=None, description=None)[source]

Bases: heat.engine.properties.Constraint

Constrain values within a range.

Serialises to JSON as:

{
    'range': {'min': <min>, 'max': <max>},
    'description': <description>
}
Range.MAX = 'max'
Range.MIN = 'min'
Range.valid_types = ('Integer', 'Number')
class heat.engine.properties.Schema(data_type, description=None, default=None, schema=None, required=False, constraints=[], implemented=True)[source]

Bases: _abcoll.Mapping

A Schema for a resource Property.

Schema objects are serialisable to dictionaries following a superset of the HOT input Parameter schema using dict().

Serialises to JSON in the form:

{
    'type': 'list',
    'required': False
    'constraints': [
        {
            'length': {'min': 1},
            'description': 'List must not be empty'
        }
    ],
    'schema': {
        '*': {
            'type': 'string'
        }
    },
    'description': 'An example list property.'
}
Schema.CONSTRAINTS = 'constraints'
Schema.DEFAULT = 'default'
Schema.DESCRIPTION = 'description'
Schema.KEYS = ('type', 'description', 'default', 'schema', 'required', 'constraints')
Schema.REQUIRED = 'required'
Schema.SCHEMA = 'schema'
Schema.TYPE = 'type'
classmethod Schema.from_legacy(schema_dict)[source]

Return a new Schema object from a legacy schema dictionary.

classmethod Schema.from_parameter(param)[source]

Return a property Schema corresponding to a parameter.

Convert a parameter schema from a provider template to a property Schema for the corresponding resource facade.

Schema.validate_constraints(value)[source]
heat.engine.properties.schemata(schema_dicts)[source]

Return a dictionary of Schema objects for the given dictionary of schemata.

The input schemata are converted from the legacy (dictionary-based) format to Schema objects where necessary.

Previous topic

The heat.engine.parameters Module

Next topic

The heat.engine.signal_responder Module

This Page