Command line interface client and python library for Dkron
Project description
Command line interface client and python library for Dkron.
Prerequisites
Pytnon 3
Installing
To install use pip:
pip install dkron
Or clone the repo:
git clone https://github.com/Eyjafjallajokull/dkron-python.git
python setup.py install
CLI Usage
Before you begin, set environment variable DKRON_HOSTS to point running dkron instance.
export DKRON_HOSTS=http://my-dkron.example.com,http://my-dkron-2.example.com:8080
Alternatively, you can instert --hosts argument to every invocation of dkron-cli.
Fetch all jobs
dkron-cli get jobs
It works well with jq, to list all job names:
dkron-cli get jobs | jq '.[].name'
Fetch specific job
dkron-cli get job [job_name]
Create or update job
dkron-cli apply job [json_file] ...
You can pass multiple files at once.
Execute job
dkron-cli run [job_name]
Delete job
dkron-cli delete job [job_name]
Cluster status
dkron-cli get status
dkron-cli get leader
dkron-cli get members
Library Usage
from dkron import Dkron
hosts = ['http://localhost:8080']
api = Dkron(hosts)
print(api.get_job('my-dkron-job')['error_count'])
api.run_job('my-dkron-job')
Running tests
make test
make coverage
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
dkron-0.0.4.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for dkron-0.0.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9337d2454b298ed5258a6799ec656efb29ac4fceba546ce25fc7ea0fe9d63c0 |
|
MD5 | 61ede1f8ad21a138687822781dcbbe3e |
|
BLAKE2b-256 | 91b973a693fa2858454411267a40644195c843379d560f70ed122ee0e7a750bd |