Skip to main content

Lightweight TOSCA orchestrator lightweight API

Project description

xOpera API

An HTTP API interface to the opera orchestrator. Mimics CLI commands.

WIP.

Development

To begin:

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

OpenAPI base code is generated with generate.sh and is not checked in to the repository.

Other useful commands:

# openapi-generator basics
java -jar openapi-generator-cli-4.3.0.jar
java -jar openapi-generator-cli-4.3.0.jar help generate
java -jar openapi-generator-cli-4.3.0.jar validate --input-spec openapi-spec.yml --recommend
java -jar openapi-generator-cli-4.3.0.jar config-help --generator-name python-flask --full-details

Usage

With Docker:

docker-compose up --build
docker cp test.csar xopera-api_api_1:/app/
docker exec xopera-api_api_1 unzip test.csar
# prepare request inputs: service_template, inputs (in JSON object form, not a string)
curl -XPOST localhost:8080/validate -H "Content-Type: application/json" -d @inputs-request.json
curl -XPOST localhost:8080/deploy -H "Content-Type: application/json" -d @inputs-request.json
curl localhost:8080/status
curl localhost:8080/outputs
curl -XPOST localhost:8080/undeploy

With a local development installation:

./generate.sh
python3 -m venv .venv
source .venv/bin/activate
pip install wheel
pip install -r requirements.txt
cd src/
python3 -m opera.api.cli
curl localhost:8080

Building for PyPI, releases

  • If the opera dependency version has changed, you must reflect that change in setup.cfg.
  • Generate sources with ./generate.sh.
  • Test built packages in a Docker container.
  • Only release tags without any local changes present.
  • Manually create and upload releases onto GitHub, no automation for that.
  • Build and test before pushing tags to reduce rollbacks.
pip3 install -r requirements.txt
./generate.sh
git tag -a 1.2.3 -m 1.2.3

rm -rfv dist/
python setup.py sdist bdist_wheel

docker run -it --rm -v $(realpath ./dist/):/dist/:ro python:3.8-buster bash
    pip3 install dist/*.whl
    opera-api
    pip3 uninstall -y opera-api
    pip3 install dist/*.tar.gz
    opera-api

twine upload --repository <pypi|testpypi> dist/*
# upload to github manually

git push --tags

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

opera-api-0.1.2.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opera_api-0.1.2-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

Details for the file opera-api-0.1.2.tar.gz.

File metadata

  • Download URL: opera-api-0.1.2.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.2

File hashes

Hashes for opera-api-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b09bcebc5aa9a6cbb8170992fb8f9adc373e0a8ebd5d022153ff39249f55e5d7
MD5 ba2f7126ce7e954ee819b66cba31e931
BLAKE2b-256 c1f1728dc43e7bd7bb33bb4d5e689f0adf79ff08caa440bdad4933aca91bf50e

See more details on using hashes here.

File details

Details for the file opera_api-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: opera_api-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 24.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.2

File hashes

Hashes for opera_api-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e4888310cede86d1479a7083fc9d5cb300e2b3c57fe57ab2756d6f5a5e50693e
MD5 95c09d43e32373d142808eed95c3bd51
BLAKE2b-256 d77a4ae0090654e329da329113f01be12a79781cb2c5bf930021dabababa33cf

See more details on using hashes here.

Supported by

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