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]
Export all jobs
dkron-cli export [backup_dir]
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.5.tar.gz
(4.2 kB
view details)
Built Distribution
File details
Details for the file dkron-0.0.5.tar.gz
.
File metadata
- Download URL: dkron-0.0.5.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a68c0a4a32faccbdcbaa5a0e56dbb7bd0bdaf8682c9efcfd55de1977281d732 |
|
MD5 | 073f1550c366942765660f470a5b04eb |
|
BLAKE2b-256 | 0c4e0fc79de5c62a70d4696d60bba75655d563a39cf222d6f376dc8206f6107a |
File details
Details for the file dkron-0.0.5-py2.py3-none-any.whl
.
File metadata
- Download URL: dkron-0.0.5-py2.py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 513b124b1dd19579565e56ca7e36ec2d10e3aad10e82e3a63097aa317a8ab1a9 |
|
MD5 | 4ceea137f9ec7efc3a6ab489045cbdb7 |
|
BLAKE2b-256 | 8fd00bf3cc4b505cb0a282c71da7ba1cd3ff25ae1afde22767ce7def8d753b55 |