Parser for TOSCA Simple Profile in YAML.
Go to file
Yasufumi Ogawa 16932ad1d5 Support importing def from local instead of url
Sometimes importing a nested definition from remote server is failed
for the server is busy. Although we usually can download the definition
before and change the path as local then, cannot for a case if the
contents of the template is fixed and it should not be changed.

This update is avoid such a case as a remedy. The url can be replaced
with any other path by using arg `local_defs` like as below. In this
case, the definition is imported from local path instead of url.

    local_defs = {"https://example.org/orig": "/path/to/local/def"}
    tosca = ToscaTemplate(template, local_defs=local_defs}

Closes-Bug: #2006796
Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
Change-Id: Iac88def836970cd976396452ffb9c3d276263d3e
2023-02-20 10:50:09 +00:00
doc Merge "[ussuri][goal] Update contributor documentation" 2021-07-23 07:56:15 +00:00
toscaparser Support importing def from local instead of url 2023-02-20 10:50:09 +00:00
.coveragerc Change ignore-errors to ignore_errors 2015-09-21 14:56:14 +00:00
.gitignore Use stestr instead of testr 2018-06-19 13:32:34 -05:00
.gitreview OpenDev Migration Patch 2019-04-19 19:33:52 +00:00
.mailmap Add .gitreview file and apply cookiecutter template. 2014-04-01 09:43:50 -05:00
.stestr.conf Use stestr instead of testr 2018-06-19 13:32:34 -05:00
.zuul.yaml Switch to 2023.1 Python3 UT and generic template 2022-10-06 12:25:58 +05:30
CONTRIBUTING.rst [ussuri][goal] Update contributor documentation 2021-06-01 13:48:43 +00:00
HACKING.rst Replace git.openstack.org URLs with opendev.org URLs 2019-06-20 14:31:56 +08:00
LICENSE Add .gitreview file and apply cookiecutter template. 2014-04-01 09:43:50 -05:00
README.rst Replace git.openstack.org URLs with opendev.org URLs 2019-06-20 14:31:56 +08:00
requirements.txt Drop lower-constraints.txt and its testing 2022-05-03 09:36:27 +05:30
setup.cfg Update python classifier for python 3.10 2022-12-15 12:05:18 +05:30
setup.py [ussuri][goal] Drop python 2.7 support and testing 2020-02-04 18:49:57 +01:00
test-requirements.txt Move tosca-parser to new hacking 4.0.0 2021-01-26 16:30:49 +05:30
tosca_parser.py Create shell entry point 2015-11-11 12:09:31 -08:00
tox.ini Fix passenv for tox4 2023-02-20 12:35:19 +10:00

README.rst

Team and repository tags

image

TOSCA Parser

Overview

The TOSCA Parser is an OpenStack project and licensed under Apache 2. It is developed to parse TOSCA Simple Profile in YAML. It reads the TOSCA templates and creates an in-memory graph of TOSCA nodes and their relationship.

Architecture

The TOSCA Parser takes TOSCA YAML template or TOSCA Cloud Service Archive (CSAR) file as an input, with optional input of dictionary of needed parameters with their values, and produces in-memory objects of different TOSCA elements with their relationship to each other. It also creates a graph of TOSCA node templates and their relationship.

The ToscaTemplate class located in the toscaparser/tosca_template.py is an entry class of the parser and various functionality of parser can be used by initiating this class. In order to see an example usage of TOSCA Parser from a separate tool, refer to the OpenStack heat-translator class TranslateTemplate located in the translator/osc/v1/translate.py module. The toscaparser/shell.py module of tosca-parser also provides a good reference on how to invoke TOSCA Parser from Command Line Interface.

The toscaparser/elements sub-directory contains various modules to handle various TOSCA type elements like node type, relationship type etc. The entity_type.py module is a parent of all type elements. The toscaparser directory contains various python module to handle service template including topology template, node templates, relationship templates etc. The entity_template.py is a parent of all template elements.

How To Use

Please refer to doc/source/usage.rst

Project Info