From 19426f9cdfc939103260cca8c86ed26a460e6323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Tue, 30 Jul 2019 14:22:14 +0200 Subject: [PATCH] [DOCS] Adds allow no jobs param to the GET, GET stats and Close APIs (#44503) --- .../anomaly-detection/apis/close-job.asciidoc | 21 ++++++++++++++++ .../apis/get-job-stats.asciidoc | 24 +++++++++++++++++++ .../anomaly-detection/apis/get-job.asciidoc | 24 +++++++++++++++++++ 3 files changed, 69 insertions(+) diff --git a/docs/reference/ml/anomaly-detection/apis/close-job.asciidoc b/docs/reference/ml/anomaly-detection/apis/close-job.asciidoc index 4bdabd3ce91..e76c8338c30 100644 --- a/docs/reference/ml/anomaly-detection/apis/close-job.asciidoc +++ b/docs/reference/ml/anomaly-detection/apis/close-job.asciidoc @@ -64,6 +64,20 @@ results the job might have recently produced or might produce in the future. [[ml-close-job-query-parms]] ==== {api-query-parms-title} +`allow_no_jobs`:: + (Optional, boolean) Specifies what to do when the request: ++ +-- +* Contains wildcard expressions and there are no jobs that match. +* Contains the `_all` string or no identifiers and there are no matches. +* Contains wildcard expressions and there are only partial matches. + +The default value is `true`, which returns an empty `jobs` array +when there are no matches and the subset of results when there are partial +matches. If this parameter is `false`, the request returns a `404` status code +when there are no matches or only partial matches. +-- + `force`:: (Optional, boolean) Use to close a failed job, or to forcefully close a job which has not responded to its initial close request. @@ -72,6 +86,13 @@ results the job might have recently produced or might produce in the future. (Optional, time units) Controls the time to wait until a job has closed. The default value is 30 minutes. +[[ml-close-job-response-codes]] +==== {api-response-codes-title} + +`404` (Missing resources):: + If `allow_no_jobs` is `false`, this code indicates that there are no + resources that match the request or only partial matches for the request. + [[ml-close-job-example]] ==== {api-examples-title} diff --git a/docs/reference/ml/anomaly-detection/apis/get-job-stats.asciidoc b/docs/reference/ml/anomaly-detection/apis/get-job-stats.asciidoc index 22bb053e193..17abde59cd2 100644 --- a/docs/reference/ml/anomaly-detection/apis/get-job-stats.asciidoc +++ b/docs/reference/ml/anomaly-detection/apis/get-job-stats.asciidoc @@ -44,6 +44,23 @@ IMPORTANT: This API returns a maximum of 10,000 jobs. group name, or a wildcard expression. If you do not specify one of these options, the API returns statistics for all jobs. +[[ml-get-job-stats-query-parms]] +==== {api-query-parms-title} + +`allow_no_jobs`:: + (Optional, boolean) Specifies what to do when the request: ++ +-- +* Contains wildcard expressions and there are no jobs that match. +* Contains the `_all` string or no identifiers and there are no matches. +* Contains wildcard expressions and there are only partial matches. + +The default value is `true`, which returns an empty `jobs` array +when there are no matches and the subset of results when there are partial +matches. If this parameter is `false`, the request returns a `404` status code +when there are no matches or only partial matches. +-- + [[ml-get-job-stats-results]] ==== {api-response-body-title} @@ -53,6 +70,13 @@ The API returns the following information: (array) An array of job statistics objects. For more information, see <>. +[[ml-get-job-stats-response-codes]] +==== {api-response-codes-title} + +`404` (Missing resources):: + If `allow_no_jobs` is `false`, this code indicates that there are no + resources that match the request or only partial matches for the request. + [[ml-get-job-stats-example]] ==== {api-examples-title} diff --git a/docs/reference/ml/anomaly-detection/apis/get-job.asciidoc b/docs/reference/ml/anomaly-detection/apis/get-job.asciidoc index 0a83513dbf5..be50a061eef 100644 --- a/docs/reference/ml/anomaly-detection/apis/get-job.asciidoc +++ b/docs/reference/ml/anomaly-detection/apis/get-job.asciidoc @@ -44,6 +44,23 @@ IMPORTANT: This API returns a maximum of 10,000 jobs. name, or a wildcard expression. If you do not specify one of these options, the API returns information for all jobs. +[[ml-get-job-query-parms]] +==== {api-query-parms-title} + +`allow_no_jobs`:: + (Optional, boolean) Specifies what to do when the request: ++ +-- +* Contains wildcard expressions and there are no jobs that match. +* Contains the `_all` string or no identifiers and there are no matches. +* Contains wildcard expressions and there are only partial matches. + +The default value is `true`, which returns an empty `jobs` array +when there are no matches and the subset of results when there are partial +matches. If this parameter is `false`, the request returns a `404` status code +when there are no matches or only partial matches. +-- + [[ml-get-job-results]] ==== {api-response-body-title} @@ -53,6 +70,13 @@ The API returns the following information: (array) An array of job resources. For more information, see <>. +[[ml-get-job-response-codes]] +==== {api-response-codes-title} + +`404` (Missing resources):: + If `allow_no_jobs` is `false`, this code indicates that there are no + resources that match the request or only partial matches for the request. + [[ml-get-job-example]] ==== {api-examples-title}