Metadata-Version: 2.0
Name: dkron
Version: 0.0.3
Summary: Command line interface client and python library for Dkron
Home-page: https://github.com/Eyjafjallajokull/dkron-python
Author: Paweł Olejniczak
Author-email: pawel.olejniczak@gmail.com
License: MIT
Download-URL: https://github.com/Eyjafjallajokull/dkron-python/tarball/0.0.3
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Information Technology
Classifier: Programming Language :: Python :: 3
Classifier: Environment :: Console
Classifier: Topic :: System :: Clustering
Classifier: Topic :: System :: Distributed Computing
Requires-Dist: appdirs (==1.4.0)
Requires-Dist: click (==6.7)
Requires-Dist: packaging (==16.8)
Requires-Dist: pyparsing (==2.1.10)
Requires-Dist: requests (==2.13.0)
Requires-Dist: six (==1.10.0)

dkron-python
============

|Build Status|

Command line interface client and python library for
`Dkron <http://dkron.io/>`__.

Prerequisites
-------------

-  Pytnon 3

Installing
----------

To install use pip:

.. code:: console

    pip install dkron

Or clone the repo:

.. code:: console

    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.

.. code:: console

    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
^^^^^^^^^^^^^^

.. code:: console

    dkron-cli get jobs

It works well with ``jq``, to list all job names:

.. code:: console

    dkron-cli get jobs | jq '.[].name'

Fetch specific job
^^^^^^^^^^^^^^^^^^

.. code:: console

    dkron-cli get job [job_name]

Create or update job
^^^^^^^^^^^^^^^^^^^^

.. code:: console

    dkron-cli apply job [json_file] ...

You can pass multiple files at once.

Execute job
^^^^^^^^^^^

.. code:: console

    dkron-cli run [job_name]

Delete job
^^^^^^^^^^

.. code:: console

    dkron-cli delete job [job_name]

Cluster status
^^^^^^^^^^^^^^

.. code:: console

    dkron-cli get status
    dkron-cli get leader
    dkron-cli get members

Library Usage
-------------

.. code:: python

    from dkron import Dkron

    api = Dkron('http://localhost:8080')
    print(api.get_job('my-dkron-job'))
    api.run_job('my-dkron-job')

Running tests
-------------

.. code:: console

    make test
    make coverage

.. |Build Status| image:: https://travis-ci.org/Eyjafjallajokull/dkron-python.svg?branch=master
   :target: https://travis-ci.org/Eyjafjallajokull/dkron-python


