From ba1b317ed3bd99a53445fbcbd2e0b57819f9b916 Mon Sep 17 00:00:00 2001 From: Marcus Wasner Date: Tue, 15 Sep 2015 17:03:55 +0200 Subject: [PATCH 1/3] Fixes #540 - Document Search Endpoint --- docs/docs/api.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/docs/api.md b/docs/docs/api.md index 1b70911d6..4e20e7b30 100644 --- a/docs/docs/api.md +++ b/docs/docs/api.md @@ -10,6 +10,7 @@ All examples in this section assume that you've found a running leader at `chron - [Leaders](#leaders) - [Listing Jobs](#listing-jobs) +- [Searching for a Job](#searching-for-a-job) - [Deleting a Job](#deleting-a-job) - [Deleting All Tasks for a Job](#deleting-all-tasks-for-a-job) - [Manually Starting a Job](#manually-starting-a-job) @@ -49,6 +50,16 @@ Interesting fields in the hashes are: If there is a `parents` field there will be no `schedule` field, and vice-versa. +## Searching for a Job + +Searching for a job with known attributes can be helpful when a large amount of jobs are being deployed. The list of possible attributes is described in the [Job Configuration](#job-configuration) section. + +* Endpoint: __/scheduler/jobs/search__ +* Method: __GET__ +* Example: `curl -L -X GET chronos-node:8080/scheduler/jobs/search?name=request_event_counter_hourly` +* Example: `curl -L -X GET chronos-node:8080/scheduler/jobs/search?owner=foo@bar.io` +* Response: HTTP 204 + ## Deleting a Job Get a job name from the job listing above. From 5c542a9b904a822069fce11f9656567299f7bc3c Mon Sep 17 00:00:00 2001 From: Marcus Wasner Date: Tue, 15 Sep 2015 18:26:03 +0200 Subject: [PATCH 2/3] Fixes #540 - Document Search Endpoint Incorporating comments of gkleiman. --- docs/docs/api.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/docs/api.md b/docs/docs/api.md index 4e20e7b30..ca603a0ce 100644 --- a/docs/docs/api.md +++ b/docs/docs/api.md @@ -52,14 +52,19 @@ If there is a `parents` field there will be no `schedule` field, and vice-versa. ## Searching for a Job -Searching for a job with known attributes can be helpful when a large amount of jobs are being deployed. The list of possible attributes is described in the [Job Configuration](#job-configuration) section. +Get the job definition by searching for the following attributes by using the search endpoint: +* `name`: Name of a job. +* `command`: Command to execute. +* `any`: Search term contained in `name` or `command`. +* * Endpoint: __/scheduler/jobs/search__ * Method: __GET__ * Example: `curl -L -X GET chronos-node:8080/scheduler/jobs/search?name=request_event_counter_hourly` -* Example: `curl -L -X GET chronos-node:8080/scheduler/jobs/search?owner=foo@bar.io` * Response: HTTP 204 +Search term and the desired job attribute will be converted to lower case. The it will be checked if the job attribute contains the term. + ## Deleting a Job Get a job name from the job listing above. From da52288f184fd3d711697fd13ae78f0cb7ba647f Mon Sep 17 00:00:00 2001 From: Marcus Wasner Date: Wed, 16 Sep 2015 10:23:48 +0200 Subject: [PATCH 3/3] Fixes #540 - Document Search Endpoint Update Found a misspelling and fixed it. --- docs/docs/api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/api.md b/docs/docs/api.md index ca603a0ce..c960c7de4 100644 --- a/docs/docs/api.md +++ b/docs/docs/api.md @@ -63,7 +63,7 @@ Get the job definition by searching for the following attributes by using the se * Example: `curl -L -X GET chronos-node:8080/scheduler/jobs/search?name=request_event_counter_hourly` * Response: HTTP 204 -Search term and the desired job attribute will be converted to lower case. The it will be checked if the job attribute contains the term. +Search term and the desired job attribute will be converted to lower case. It will then be checked if the job attribute contains the term. ## Deleting a Job