Skip to main content

Python SDK client for Netflix Maestro workflow orchestrator

Project description

maestro-python

Python sdk client library for Maestro workflow orchestrator. It has a minimal dependency, only requiring pyyaml.

Features

  • Maestro yaml DSL
  • Maestro python DSL
  • Maestro client
  • Maestro command line interface

Installation

pip install maestro-sdk

Or install maestro sdk from source code:

git clone https://github.com/jun-he/maestro-python.git
cd maestro-python
pip install -e .

Quick Start

Creating a workflow

from maestro import Workflow, Job

wf = Workflow(id="test-wf")
wf.owner("tester").tags("test")
wf.job(Job(id="job1", type='NoOp'))
wf_yaml = wf.to_yaml()

Pushing a workflow to Maestro server

from maestro import Workflow, Job, MaestroClient

wf = Workflow(id="test-wf")
wf.owner("tester").tags("test")
wf.job(Job(id="job1", type='NoOp'))
wf_yaml = wf.to_yaml()

client = MaestroClient(base_url="http://127.0.0.1:8080", user="tester")
response = client.push_yaml(wf_yaml)
print(response)

Starting a workflow

from maestro import MaestroClient

client = MaestroClient(base_url="http://127.0.0.1:8080", user="tester")
response = client.start(workflow_id="test-wf", run_params={"foo": {"value": "bar", "type": "STRING"}})
print(response)

Command line interface (CLI)

Push a workflow

maestro --base-url http://127.0.0.1:8080 --user tester push sample-wf.yaml
# push the yaml using default base-url and user name
maestro push sample-wf.yaml

Validate a workflow

maestro --base-url http://127.0.0.1:8080 --user tester validate sample-wf.yaml
# validate the yaml using default base-url and user name
maestro validate sample-wf.yaml

Start a workflow definition

# start sample-wf with default version and none runtime params
maestro --base-url http://127.0.0.1:8080 --user tester start sample-wf.yaml
# start sample-wf with default base-url & user name and runtime params using a specific version 
maestro start sample-wf --version 1 --params '{"foo": {"value": "bar", "type": "STRING"}}'
# start sample-wf with default base-url & user name and runtime params using the latest version
maestro start sample-wf --version latest --params '{"foo": {"value": "bar", "type": "STRING"}}'

Stop workflow or step execution(s)

maestro --base-url http://127.0.0.1:8080 --user tester start sample-wf.yaml
maestro start sample-wf --version 1 --params '{"foo": {"value": "bar", "type": "STRING"}}'
# stop all workflow instances for workflow_id = sample-wf
maestro stop sample-wf
# stop a workflow instance for workflow_id = sample-wf and instance_id = 1
maestro stop sample-wf 1
# stop a step instance for workflow_id = sample-wf and instance_id = 1 and step_id = job1
maestro stop sample-wf 1 job1

Get a workflow definition

maestro --base-url http://127.0.0.1:8080 --user tester start sample-wf.yaml
# get workflow definition for version 1
maestro get-workflow sample-wf --version 1

Get a workflow instance or step instance

maestro --base-url http://127.0.0.1:8080 --user tester start sample-wf.yaml
maestro start sample-wf --version 1 --params '{"foo": {"value": "bar", "type": "STRING"}}'
# get workflow instance for instance id 1
maestro get-instance sample-wf 1
# get workflow step instance for instance id = 1 and step id = job1
maestro get-instance sample-wf 1 job1

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

maestro_sdk-0.1.3.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

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

maestro_sdk-0.1.3-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file maestro_sdk-0.1.3.tar.gz.

File metadata

  • Download URL: maestro_sdk-0.1.3.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for maestro_sdk-0.1.3.tar.gz
Algorithm Hash digest
SHA256 77f5c9f47d75c350884e8cbcb6544ca04cc2bb2925a2f9e17baa4c102332fc52
MD5 71c1dc0ba9b03ec03e5487908e668435
BLAKE2b-256 f7a18f51b615df9a07c34b7b3cb3105b1ced1cf21170c948159664ffffb17843

See more details on using hashes here.

File details

Details for the file maestro_sdk-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: maestro_sdk-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for maestro_sdk-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 33794752603bbd7505a5f1c4ee666756ef3efb2d61144eca6142e54b0bae3af4
MD5 12f6793e80fea99323984ed082aa7311
BLAKE2b-256 0b2a05cfc6579a055cb589ba29824176fde74896036a54b7e7cf366e8ad43803

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