heat.engine.properties 模块¶
- class heat.engine.properties.Properties(schema, data, resolver=<function _default_resolver>, parent_name=None, context=None, section=None, translation=None, rsrc_description=None)[source]¶
基类:
Mapping- static schema_from_params(params_snippet)[source]¶
从模板的参数部分创建属性模式。
- 参数:
params_snippet – 模板中的参数定义
- 返回值:
为指定的参数创建等效的属性模式
- classmethod schema_to_parameters_and_properties(schema, template_type='cfn')[source]¶
将模式转换为模板参数和属性。
这可用于生成与给定属性模式匹配的提供程序模板。
- 参数:
schema – 资源类型的 properties_schema
- 返回值:
一个包含 params 和 properties 字典的元组
- 例如:输入:{‘foo’: {‘Type’: ‘List’}}
- 输出:{‘foo’: {‘Type’: ‘CommaDelimitedList’}},
{‘foo’: {‘Fn::Split’: {‘Ref’: ‘foo’}}}
- 例如:输入:{‘foo’: {‘Type’: ‘String’}, ‘bar’: {‘Type’: ‘Map’}}
- 输出:{‘foo’: {‘Type’: ‘String’}, ‘bar’: {‘Type’: ‘Json’}},
{‘foo’: {‘Ref’: ‘foo’}, ‘bar’: {‘Ref’: ‘bar’}}
- class heat.engine.properties.Property(schema, name=None, context=None, path=None)[source]¶
基类:
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]¶
基类:
Schema用于验证资源属性的 Schema 类。
此类用于定义资源属性的模式约束。它从基础 Schema 类继承通用的验证功能,并添加特定于资源属性的处理。
- 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]¶
返回从参数转换的属性 Schema 允许的类型。
特别是,当从提供程序模板生成 Schema 时,Number 参数将提供 Integer 属性 Schema。