heat.scaling.template 模块

heat.scaling.template.make_template(resource_definitions, version=('heat_template_version', '2015-04-30'), child_env=None)[source]

返回包含给定资源定义的 Template 对象。

默认情况下,模板将采用 HOT 格式。可以通过传递匹配任何可用模板格式插件的 (version_type, version_string) 元组来指定不同的格式。

heat.scaling.template.member_definitions(old_resources, new_definition, num_resources, num_new, get_new_id, customise=<function _identity>)[source]

迭代伸缩组的资源定义

生成伸缩组下一次更改的定义。每个项目都是一个 (name, definition) 元组。

输入是组中现有资源的 (name, definition) 元组列表,按应替换或删除的顺序排序(即,应首先替换(在更新时)或删除(在缩减时)的资源位于列表的开头)。根据需要添加新资源或删除旧资源,以确保总数为 num_resources。

要更改定义为新的资源数量由 num_new 控制。此值包括任何要添加的新资源,任何不足之处都通过修改现有资源的定义来弥补。