Skip to main content

Parse MiCADO ADTs for the MiCADO Submitter

Project description

MiCADO Parser

The MiCADO component responsible for parsing and validating ADTs

Historically part of the MiCADO TOSCASubmitter, now a standalone library and command-line tool used inside MiCADO and on its own for validating single-file (YAML) and multi-file (CSAR) ADTs.

Dependencies

The MiCADO Parser uses the following packages:

Installation

Install the latest version of the MiCADO Parser from PyPI.

pip install micado-parser

or from GitHub.

git clone https://github.com/micado-scale/micado-parser
pip install micado-parser/.

Usage

Command-line

For some helpful tips, use the --help option

micadoparser --help

To validate an ADT, simply point at an ADT.

micadoparser /home/ubuntu/adts/nginx.yaml

Multi-file ADTs in .csar format are also supported

micadoparser /home/ubuntu/adts/wordpress.csar

The tool can handle multiple files.

micadoparser ~/adts/nginx.yaml ~/adts/wordpress.csar

Or an entire directory.

micadoparser ~/adts/*

For verbose output use the -v option (for even more verbosity use -vv or -vvv).

micadoparser -v ~/adts/nginx.yaml

Library

The primary function of the MiCADO Parser is to return a validated ToscaTemplate object.

To use it in your own project, simply import the set_template function and pass it the path to your ADT. You can optionally pass a dictionary of TOSCA inputs, if inputs are defined in your ADT.

from micadoparser import set_template

tpl = set_template("/home/ubuntu/adts/nginx.yaml")

tpl_with_params = set_template(
    "home/ubuntu/adts/wordpress.csar",
    {"username": "jay", "token": "ABD992LOKAL"}
)

To use the package for validation only, use the set_template function and catch the MultiError exception.

from micadoparser import set_template, MultiError

try:
    set_template("/home/ubuntu/adts/nginx.yaml")
except MultiError as e:
    print(e)

Comparison with the OpenStack TOSCA Parser

The MiCADO Parser adds a few features compared to the upstream TOSCA Parser.

  • MiCADO-specific validations
  • MiCADO-specific CSAR handling
  • Input resolution
  • Support for some TOSCA v1.3 features

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

micado-parser-0.12.0.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

micado_parser-0.12.0-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file micado-parser-0.12.0.tar.gz.

File metadata

  • Download URL: micado-parser-0.12.0.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for micado-parser-0.12.0.tar.gz
Algorithm Hash digest
SHA256 a60fb93c4a98b38428acd7b601bbad0c5051ea14f6a56586ced9afc9a4c64b5a
MD5 612f0635ea8586a7f89d8184813b05b0
BLAKE2b-256 c1e097dbc17565e7e3262962af88cc8104e693c66e27d2e68c50a7f928676bd2

See more details on using hashes here.

Provenance

File details

Details for the file micado_parser-0.12.0-py3-none-any.whl.

File metadata

File hashes

Hashes for micado_parser-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5dc54eb8339663f4f6a240f8dd5fc94574d40915ac947fa21310c33421b02562
MD5 40e0d049862578eba52909c3bbcdf80b
BLAKE2b-256 df43ae17d129ad4d70ea09caff986cd389f7920638f4dca14e082ea7d27fb8df

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page