使用oasis-tosca-yaml配置文件的应用拓扑
pytosca的Python项目详细描述
pytosca
[![生成状态](https://api.travis-ci.org/kapilt/pytosca.svg)](https://travis-ci.org/kapilt/pytosca)
使用oasis tosca yaml simple profile 1.0的python库
这个图书馆最初是作为一个学习练习来实现的 用于评估标准的早期草稿。
tosca的一个现成的替代品是toscalib 嵌入到热转换器中。
https://github.com/openstack/heat-translator/tree/master/translator/toscalib
TOSCA建模
tosca标准在这里建模为三个不同的集合,即 根据标准与一组类型关联的元模型, 它可以通过任何给定的tosca文件进行扩展。节点模板 这是从tosca加载的元模型的实现 yaml文件。最终实现的节点资源由 一个编排器,并与相应的节点模板相关联。
此库选择使用本机python映射这些集合 语言构造,元模型对应于类,节点模板 这些类的实例。
运行单元测试
stdlib测试运行程序通过setuptools ala集成:
$ python setup.py test
或者,可以直接使用任何其他测试转轮。
执行
模板的执行通过绑定的三个阶段进行
输入绑定
资源绑定
绑定层
TOSCA注释
标准问题
[过时]
- what does a relation callout binding in a template look like.
- relation shorthand form is not defined properly in the meta model
- page 13 and 14 has requirements: database but elsewhere its database_endpoint
Is this a typo. - wp_db_port: { get_ref_property: [ database_endpoint, database_endpoint, port ] }
- page 9 points to an interface implementation artifact directly against the name of the interface instead of against the lifecycle operation.. there’s some abmiguity here.
- can more than one interface be associated to a type
反馈
[过时]
- os version should not be an integer, minimum it should be a float, ideally a string.
图书馆笔记
- 定义按节点中的名称引用接口,但按关系中的类型引用接口。
- 几个打字错误
- 功能按错误名称匹配节点类型(应为types.nodes.root)
问题
- how does inheritance work across types, what inherits (properties, lifecycle)
- spelling of endpoint vs database endpoint.
- delete lifecycle operation [ is it normative, may have to combine with deletion]
- mapping lifecycle to machine operations.. is start automatically re-invoked on boot?
- is stopped launched before reboot?
- order of relation lifecycle events
- the xml policy notion
绑定到变量