heat.engine.stk_defn 模块

class heat.engine.stk_defn.ResourceProxy(name, definition, resource_data)[source]

基类: ResourceStatus

资源基本数据的轻量级 API。

这是模板函数访问堆栈定义中特定资源数据的接口,例如资源定义以及引用 ID 和属性的当前值。

堆栈中的某些或所有资源的资源代理可能会在每次检查资源操作时加载,因此必须高效地实现此 API,仅使用通过 RPC 接收的数据,而不引用数据库中存储的资源数据。

第三方模板或函数插件可以认为此 API 是稳定的,不应在没有适当弃用流程的情况下更改或删除其任何部分。

FnGetAtt(attr, *path)[source]

用于内置函数 get_attr。

FnGetAtts()[source]

用于内置函数 get_attr,获取所有属性时使用。

返回值:

资源的所有属性值的字典,不包括“show”属性。

FnGetRefId()[source]

用于内置函数 get_resource。

property action

资源的当前操作。

property attributes_schema

有效的顶级属性名称的集合。

为了与旧版本兼容,为需要包含所有有效属性名称的容器才能验证模板的函数提供此功能。由于我们实际上无法在此处访问属性模式,因此我们返回一个集合而不是字典。

property external_id

资源的外部 ID。

name
property state

资源的当前状态(操作、状态)。

property status

资源的当前状态。

property t

资源定义。

class heat.engine.stk_defn.StackDefinition(context, template, stack_identifier, resource_data, parent_info=None)[source]

基类: object

表示堆栈定义的类,但不包括其当前状态。

这是模板函数访问堆栈定义数据的接口,包括模板以及资源引用 ID 和属性的当前值。

第三方模板或函数插件可以认为此 API 是稳定的,不应在没有适当弃用流程的情况下更改或删除其任何部分。

all_resource_types()[source]

返回模板中所有资源的类型集合。

all_rsrc_names()[source]

返回模板中所有资源的名称集合。

这包括由于条件为假而禁用的资源。

clone_with_new_template(new_template, stack_identifier, clear_resource_data=False)[source]

使用不同的模板创建一个新的 StackDefinition。

enabled_output_names()[source]

返回模板中所有已启用输出的名称集合。

enabled_rsrc_names()[source]

返回模板中所有已启用资源的名称集合。

property env

堆栈的环境。

get_availability_zones()[source]

返回 Nova 可用区列表。

output_definition(output_name)[source]

返回给定输出的定义。

property parent_resource

返回父资源的代理。

如果堆栈不是 TemplateResource 的提供程序堆栈,则返回 None。

resource_definition(resource_name)[source]

返回给定资源的定义。

property t

堆栈的模板。

heat.engine.stk_defn.add_resource(stack_definition, resource_definition)[source]

将给定的资源定义插入到堆栈定义中。

将资源添加到模板并存储任何临时数据。

heat.engine.stk_defn.remove_resource(stack_definition, resource_name)[source]

从堆栈定义中删除指定名称的资源。

从模板中删除资源并消除对其引用。

heat.engine.stk_defn.update_resource_data(stack_definition, resource_name, resource_data)[source]

存储指定资源的新的资源状态数据。

此函数使遗留(非收敛)路径能够存储在整个堆栈操作的生命周期中持续存在的单个 StackDefinition 中创建/更新资源时更新的 NodeData。