From 85aa57e2aef6a08b814631150833106c7b4ca44f Mon Sep 17 00:00:00 2001 From: Victor Castell Date: Sun, 13 Sep 2015 00:47:36 +0200 Subject: [PATCH] Added show job API method --- docs/docs/api.md | 41 +++++++++++++++++++++++++++++++++++++++++ static/schema.json | 7 +++++++ 2 files changed, 48 insertions(+) diff --git a/docs/docs/api.md b/docs/docs/api.md index d0e2e4573..14738ae74 100644 --- a/docs/docs/api.md +++ b/docs/docs/api.md @@ -152,6 +152,47 @@ HTTP/1.1 201 Created } ``` +### Job Show + +Show job. + +``` +GET /v1/jobs/{job_name} +``` + + +#### Curl Example + +```bash +$ curl -n dkron-node:8080/v1/jobs/$JOB_NAME +``` + + +#### Response Example + +``` +HTTP/1.1 200 OK +``` + +```json +{ + "name": "cron_job", + "schedule": "0 30 * * * *", + "command": "/usr/bin/date", + "owner": "John Doe", + "owner_email": "john@doe.com", + "run_as_user": "johndoe", + "success_count": 20, + "error_count": 5, + "last_success": "0001-01-01T00:00:00Z", + "last_error": "0001-01-01T100:00:00Z", + "disabled": false, + "tags": { + "role": "web" + } +} +``` + ### Job Delete Delete job. diff --git a/static/schema.json b/static/schema.json index 02074efdd..5b6d7f17c 100644 --- a/static/schema.json +++ b/static/schema.json @@ -218,6 +218,13 @@ ] } }, + { + "description": "Show job.", + "href": "/v1/jobs/{(%23%2Fdefinitions%2Fjob%2Fdefinitions%2Fname)}", + "method": "GET", + "rel": "show", + "title": "Show" + }, { "description": "Delete job.", "href": "/v1/jobs/{(%23%2Fdefinitions%2Fjob%2Fdefinitions%2Fname)}",