Skip to content
This repository was archived by the owner on Jan 4, 2022. It is now read-only.

Yelp/chronos-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chronos-python

Build Status

Simple python api for the chronos job scheduler

###Installation

python setup.py install

###Usage Example

import chronos
c = chronos.connect("chronos.mesos.server.com:8080")
# or specify multilple servers that will be tried in order
c = chronos.connect(["chronos1.mesos.server.com:8080", "chronos2.mesos.server.com:8080"])

# get list of scheduled jobs and their status as
# [{ 'name': 'job1', ..}, { 'name': 'job2', ..}]
jobs = c.list()

# run job by name
c.run("job123")

# add || update
job = { 'async': False, 'command': 'echo 1', 'epsilon': 'PT15M', 'name': 'foo',
    'owner': 'me@foo.com', 'disabled': True, 'schedule': 'R/2014-01-01T00:00:00Z/PT60M'}
try:
    c.add(job) # fails if job of the same name already exists
except:
    c.update(job)

# delete job by name
c.delete("job123")

# kill all tasks for a running/stuck job
c.delete_tasks("job123")

###Included Scripts

  • chronos-sync-jobs.py - Sync chronos jobs from a directory tree containing job.json files. chronos-sync-jobs.py --hostname chronos.server.com:4400 --sync /path/to/job.json/files

  • chronos-nagios.py - Nagios/Icinga style monitor of jobs chronos-nagios.py --hostname chronos.server.com:4400 --crit 3 --prefix etl. --prefix data. chronos-nagios.py --hostname chronos.server.com:4400 --crit 3 --exclude etl.

About

python api for the chronos (for apache mesos) job scheduler

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 93.0%
  • Gherkin 4.2%
  • Shell 2.6%
  • Makefile 0.2%