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

get_user_value(key)[source]
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’}}

update_translation(rules, client_resolve=True, ignore_resolve_error=False)[source]
validate(with_value=True)[source]
class heat.engine.properties.Property(schema, name=None, context=None, path=None)[source]

基类: object

default()[source]
get_value(value, validate=False, translation=None)[source]

从原始值获取值并根据数据类型进行清理。

has_default()[source]
immutable()[source]
implemented()[source]
make_path(name, path=None)[source]
required()[source]
support_status()[source]
type()[source]
update_allowed()[source]
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。

classmethod from_legacy(schema_dict)[source]

从旧版(基于字典)的模式字典返回 Property Schema 对象。

classmethod from_parameter(param)[source]

返回与 Parameter Schema 对应的 Property Schema。

将提供程序模板中的参数模式转换为资源 facade 对应的属性 Schema。

validate(context=None)[source]

验证模式。

此方法检查模式本身是否有效,如果存在默认值,则检查默认值是否符合模式的约束。

heat.engine.properties.schemata(schema_dicts)[source]

返回给定模式字典的 Schema 对象字典。

输入模式将转换为 Schema 对象(如果需要)。