A Command-line Interface for Chronos v3.
Directly from GitHub:
# latest version (use @version for specific version)
$ pip install git+ssh://[email protected]/aparenton/chronos-cli.git
Or, install from the sources after cloning:
$ python setup.py install
Chronos CLI supports both YAML and JSON (see config):
stage:
url: YOUR_CHRONOS_STAGE_URL
username: YOUR_CHRONOS_STAGE_USERNAME
password: YOUR_CHRONOS_STAGE_PASSWORD
prod:
url: YOUR_CHRONOS_PROD_URL
username: YOUR_CHRONOS_PROD_USERNAME
password: YOUR_CHRONOS_PROD_PASSWORD
By default, Chronos CLI will read from:
~/.config/chronos/config.json
or~/.config/chronos/config.yaml
or~/.config/chronos/config.yml
But you can choose a specific configuration file with --config my-config.yaml
.
A simple Chronos artifact (see examples for more detailed samples):
{
"schedule":"R/2015-11-09T00:00:00Z/PT24H",
"name":"test-1",
"epsilon":"PT30M",
"command":"echo test1 && sleep 60",
"owner":"[email protected]",
"async":false
}
Note: see Chronos documentation for ISO 8601 format for scheduling the job.
$ chronos -h
usage: chronos [-h] {create_dep,create,delete,get,graph,kill,list,start} ...
positional arguments:
{create_dep,create,delete,get,graph,kill,list,start}
Description
create_dep Create a dependent job
create Create a scheduled job
delete Delete a job
get Get filtered jobs
graph Dependency graph
kill Kill all tasks for a job
list List all jobs
start Start a job manually
optional arguments:
-h, --help show this help message and exit
You can also do:
$ chronos create -h
usage: chronos create [-h] [-p PROFILE] [-c CONFIG] [--dry-run] [-m MESSAGE]
optional arguments:
-h, --help show this help message and exit
-p PROFILE, --profile PROFILE
Profile to run
-c CONFIG, --config CONFIG
Config file for chronos
--dry-run Dry-run this command without really executing
-m MESSAGE, --message MESSAGE
Chronos description file for the job
So if you want to create a new scheduled job on Chronos using Chronos CLI, you would do:
$ chronos create -m examples/sample-job.json -p stage
{
"message": "Scheduled job added",
"code": 204
}
Note: by default stage
is being used as your profile.