heat.engine.attributes 模块

class heat.engine.attributes.Attribute(attr_name, schema)[source]

基类: object

属性模式。

as_output(resource_name, template_type='cfn')[source]

为具有给定资源名称的提供程序模板生成输出条目。

参数:
  • resource_name – 提供程序资源的逻辑名称

  • template_type – 要生成的模板类型

返回值:

此属性作为 cfn 模板的模板 ‘Output’ 条目,以及 hot 模板的 ‘output’ 条目

support_status()[source]
class heat.engine.attributes.Attributes(res_name, schema, resolver)[source]

基类: Mapping

模拟资源属性的集合。

static as_outputs(resource_name, resource_class, template_type='cfn')[source]

具有资源名称的提供程序模板的输出条目字典。

参数:
  • resource_name – 资源的逻辑名称

  • resource_class – 资源实现类

返回值:

指定 resource_class 的属性作为模板输出映射

property cached_attrs
get_cache_mode(attribute_name)[source]

返回指定属性的缓存模式。

如果属性在模式中未定义,则返回默认缓存模式 (CACHE_LOCAL)。

has_new_cached_attrs()[source]

如果 cached_attrs 已更改,则返回 True

允许调用者确定此实例的 cached_attrs 是否自最初设置以来 (如果曾经设置过) 已更新。

reset_resolved_values()[source]
static schema_from_outputs(json_snippet)[source]
set_cached_attr(key, value)[source]
set_schema(schema)[source]
class heat.engine.attributes.Schema(description=None, support_status=<heat.engine.support.SupportStatus object>, cache_mode='cache_local', type=None)[source]

基类: Schema

用于属性的简单模式类。

模式对象可以序列化为字典,遵循使用 dict() 的 HOT 输入参数模式的超集。

BOOLEAN = '布尔值'
CACHE_LOCAL = 'cache_local'
CACHE_MODES = ('cache_local', 'cache_none')
CACHE_NONE = 'cache_none'
DESCRIPTION = 'description'
INTEGER = '整数'
KEYS = ('description', 'type')
LIST = '列表'
MAP = '映射'
STRING = '字符串'
TYPE = 'type'
TYPES = (None, 'String', 'Map', 'List', 'Integer', 'Boolean')
UNKNOWN = None
classmethod from_attribute(schema_dict)[source]

返回与属性模式对应的属性模式。

heat.engine.attributes.schemata(schema)[source]

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

heat.engine.attributes.select_from_attribute(attribute_value, path)[source]

从属性值中选择一个元素。

参数:
  • attribute_value – 属性值。

  • path – 从属性中选择的路径组件列表。

返回值:

所选属性组件值。