Skip to main content

pydkron: Python Client for Dkron

Project description

pydkron - Python Library for Interacting with Dkron

Build Status

Requirements

requests

Installing

Pip

pip install pydkron

Manually

git clone https://github.com/oldmantaiter/pydkron
cd pydkron
python setup.py install

Usage Examples

from pydkron.client import DkronClient

# Return all the configured jobs
client = DkronClient(hosts=["dkron01:8080", "dkron02:8080"])
for job in client.jobs():
    print "%s runs %s" % (job.name, job.schedule)

# Get a job by name
job = client.get_job("job1")

# Delete a job
job.delete()

# Create a new job
data = {
    "name": "job2",
    "schedule": "@every 2m",
    "command": "run stuff",
    "owner": "Tait Clarridge",
    "tags": {
        "role": "dkron:1",
    }
}

job = client.create_job(data)

# Update a job (change the schedule)

job.schedule = "@every 2m"
job.save()

# Run a job
job.run()

# List executions
print job.executions()

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

pydkron-0.2.4.tar.gz (3.8 kB view hashes)

Uploaded Source

Supported by

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