From b0186974ae2851470dc39434b77e4a727c36ee84 Mon Sep 17 00:00:00 2001 From: lcawl Date: Wed, 10 Nov 2021 14:30:46 -0800 Subject: [PATCH 1/3] [DOCS] Fixes query parameters for get buckets API --- .../apis/get-bucket.asciidoc | 39 +++++++++++++------ 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/docs/reference/ml/anomaly-detection/apis/get-bucket.asciidoc b/docs/reference/ml/anomaly-detection/apis/get-bucket.asciidoc index 31a1c534fa675..40427250d45b5 100644 --- a/docs/reference/ml/anomaly-detection/apis/get-bucket.asciidoc +++ b/docs/reference/ml/anomaly-detection/apis/get-bucket.asciidoc @@ -38,15 +38,17 @@ include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection] (Optional, string) The timestamp of a single bucket result. If you do not specify this parameter, the API returns information about all buckets. -[[ml-get-bucket-request-body]] -== {api-request-body-title} + +[[ml-get-bucket-query-parms]] +== {api-query-parms-title} `anomaly_score`:: (Optional, double) Returns buckets with anomaly scores greater or equal than this value. Defaults to `0.0`. `desc`:: -(Optional, Boolean) If true, the buckets are sorted in descending order. Defaults to `false`. +(Optional, Boolean) If true, the buckets are sorted in descending order. +Defaults to `false`. `end`:: (Optional, string) Returns buckets with timestamps earlier than this time. @@ -60,11 +62,12 @@ include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=exclude-interim-results] `expand`:: (Optional, Boolean) If true, the output includes anomaly records. Defaults to `false`. -`page`.`from`:: +`from`:: (Optional, integer) Skips the specified number of buckets. Defaults to `0`. -`page`.`size`:: -(Optional, integer) Specifies the maximum number of buckets to obtain. Defaults to `100`. +`size`:: +(Optional, integer) Specifies the maximum number of buckets to obtain. Defaults +to `100`. `sort`:: (Optional, string) Specifies the sort field for the requested buckets. By @@ -75,6 +78,19 @@ default, the buckets are sorted by the `timestamp` field. `-1`, which means it is unset and results are not limited to specific timestamps. +[[ml-get-bucket-request-body]] +== {api-request-body-title} + +You can also specify the query parameters (such as `anomaly_score` and `desc`) +in the request body. + +`page`.`from`:: +(Optional, integer) Skips the specified number of buckets. Defaults to `0`. + +`page`.`size`:: +(Optional, integer) Specifies the maximum number of buckets to obtain. Defaults +to `100`. + [role="child_attributes"] [[ml-get-bucket-results]] == {api-response-body-title} @@ -101,15 +117,16 @@ influencer. This score might be updated as newer data is analyzed. (number) The length of the bucket in seconds. This value matches the `bucket_span` that is specified in the job. -`initial_anomaly_score`::: -(number) The score between 0-100 for each bucket influencer. This score is the -initial value that was calculated at the time the bucket was processed. - `influencer_field_name`::: (string) The field name of the influencer. - +//// `influencer_field_value`::: (string) The field value of the influencer. +//// + +`initial_anomaly_score`::: +(number) The score between 0-100 for each bucket influencer. This score is the +initial value that was calculated at the time the bucket was processed. `is_interim`::: (Boolean) From ac74144ca5941a4c798a7a243da9f5eef96ae786 Mon Sep 17 00:00:00 2001 From: lcawl Date: Mon, 22 Nov 2021 09:58:18 -0800 Subject: [PATCH 2/3] [DOCS] Clarify page exception --- docs/reference/ml/anomaly-detection/apis/get-bucket.asciidoc | 4 ++-- .../ml/anomaly-detection/apis/get-calendar-event.asciidoc | 4 ++-- .../ml/anomaly-detection/apis/get-influencer.asciidoc | 4 ++-- docs/reference/ml/anomaly-detection/apis/get-record.asciidoc | 4 ++-- .../reference/ml/anomaly-detection/apis/get-snapshot.asciidoc | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/reference/ml/anomaly-detection/apis/get-bucket.asciidoc b/docs/reference/ml/anomaly-detection/apis/get-bucket.asciidoc index 40427250d45b5..ebbbb30ae38fa 100644 --- a/docs/reference/ml/anomaly-detection/apis/get-bucket.asciidoc +++ b/docs/reference/ml/anomaly-detection/apis/get-bucket.asciidoc @@ -81,8 +81,8 @@ timestamps. [[ml-get-bucket-request-body]] == {api-request-body-title} -You can also specify the query parameters (such as `anomaly_score` and `desc`) -in the request body. +You can also specify the query parameters in the request body; the exception are +`from` and `size`, use `page` instead: `page`.`from`:: (Optional, integer) Skips the specified number of buckets. Defaults to `0`. diff --git a/docs/reference/ml/anomaly-detection/apis/get-calendar-event.asciidoc b/docs/reference/ml/anomaly-detection/apis/get-calendar-event.asciidoc index 0431aa8aa4e05..62a9b19b57352 100644 --- a/docs/reference/ml/anomaly-detection/apis/get-calendar-event.asciidoc +++ b/docs/reference/ml/anomaly-detection/apis/get-calendar-event.asciidoc @@ -63,8 +63,8 @@ as the calendar identifier. [[ml-get-calendar-event-request-body]] == {api-request-body-title} -You can also specify some of the query parameters (such as `end` and -`job_id`) in the request body. +You can also specify the query parameters in the request body; the exception are +`from` and `size`, use `page` instead: `page.from`:: (Optional, integer) Skips the specified number of events. Defaults to `0`. diff --git a/docs/reference/ml/anomaly-detection/apis/get-influencer.asciidoc b/docs/reference/ml/anomaly-detection/apis/get-influencer.asciidoc index 1281a27073e58..630525ef366de 100644 --- a/docs/reference/ml/anomaly-detection/apis/get-influencer.asciidoc +++ b/docs/reference/ml/anomaly-detection/apis/get-influencer.asciidoc @@ -74,8 +74,8 @@ timestamps. [[ml-get-influencer-request-body]] == {api-request-body-title} -You can also specify some of the query parameters (such as `desc` and -`end`) in the request body. +You can also specify the query parameters in the request body; the exception are +`from` and `size`, use `page` instead: `page`.`from`:: (Optional, integer) Skips the specified number of influencers. Defaults to `0`. diff --git a/docs/reference/ml/anomaly-detection/apis/get-record.asciidoc b/docs/reference/ml/anomaly-detection/apis/get-record.asciidoc index bcbee61da8a69..a8015bd8f3709 100644 --- a/docs/reference/ml/anomaly-detection/apis/get-record.asciidoc +++ b/docs/reference/ml/anomaly-detection/apis/get-record.asciidoc @@ -79,8 +79,8 @@ default, the records are sorted by the `record_score` value. [[ml-get-record-request-body]] == {api-request-body-title} -You can also specify some of the query parameters (such as `desc` and -`end`) in the request body. +You can also specify the query parameters in the request body; the exception are +`from` and `size`, use `page` instead: `page`.`from`:: (Optional, integer) Skips the specified number of records. Defaults to `0`. diff --git a/docs/reference/ml/anomaly-detection/apis/get-snapshot.asciidoc b/docs/reference/ml/anomaly-detection/apis/get-snapshot.asciidoc index 331cc51680feb..f778c55ab86c4 100644 --- a/docs/reference/ml/anomaly-detection/apis/get-snapshot.asciidoc +++ b/docs/reference/ml/anomaly-detection/apis/get-snapshot.asciidoc @@ -67,8 +67,8 @@ specifying `*` as the snapshot ID, or by omitting the snapshot ID. [[ml-get-snapshot-request-body]] == {api-request-body-title} -You can also specify some of the query parameters (such as `desc` and -`end`) in the request body. +You can also specify the query parameters in the request body; the exception are +`from` and `size`, use `page` instead: `page`.`from`:: (Optional, integer) Skips the specified number of snapshots. Defaults to `0`. From 295181856164d4fe6049f4c78ac5024e206848d2 Mon Sep 17 00:00:00 2001 From: lcawl Date: Mon, 22 Nov 2021 10:32:26 -0800 Subject: [PATCH 3/3] [DOCS] Adds nesting for page object in ML get APIs --- .../apis/get-bucket.asciidoc | 11 ++++++++-- .../apis/get-calendar-event.asciidoc | 18 ++++++++++----- .../apis/get-calendar.asciidoc | 22 ++++++++++++------- .../apis/get-category.asciidoc | 11 ++++++++-- .../apis/get-influencer.asciidoc | 11 ++++++++-- .../apis/get-record.asciidoc | 11 ++++++++-- .../apis/get-snapshot.asciidoc | 11 ++++++++-- 7 files changed, 72 insertions(+), 23 deletions(-) diff --git a/docs/reference/ml/anomaly-detection/apis/get-bucket.asciidoc b/docs/reference/ml/anomaly-detection/apis/get-bucket.asciidoc index ebbbb30ae38fa..a234901be1c47 100644 --- a/docs/reference/ml/anomaly-detection/apis/get-bucket.asciidoc +++ b/docs/reference/ml/anomaly-detection/apis/get-bucket.asciidoc @@ -84,12 +84,19 @@ timestamps. You can also specify the query parameters in the request body; the exception are `from` and `size`, use `page` instead: -`page`.`from`:: +`page`:: ++ +.Properties of `page` +[%collapsible%open] +==== + +`from`::: (Optional, integer) Skips the specified number of buckets. Defaults to `0`. -`page`.`size`:: +`size`::: (Optional, integer) Specifies the maximum number of buckets to obtain. Defaults to `100`. +==== [role="child_attributes"] [[ml-get-bucket-results]] diff --git a/docs/reference/ml/anomaly-detection/apis/get-calendar-event.asciidoc b/docs/reference/ml/anomaly-detection/apis/get-calendar-event.asciidoc index 62a9b19b57352..e56afcce71aca 100644 --- a/docs/reference/ml/anomaly-detection/apis/get-calendar-event.asciidoc +++ b/docs/reference/ml/anomaly-detection/apis/get-calendar-event.asciidoc @@ -66,12 +66,20 @@ as the calendar identifier. You can also specify the query parameters in the request body; the exception are `from` and `size`, use `page` instead: -`page.from`:: - (Optional, integer) Skips the specified number of events. Defaults to `0`. +`page`:: ++ +.Properties of `page` +[%collapsible%open] +==== + +`from`::: +(Optional, integer) Skips the specified number of events. Defaults to `0`. + +`size`::: +(Optional, integer) Specifies the maximum number of events to obtain. Defaults +to `100`. +==== -`page.size`:: - (Optional, integer) Specifies the maximum number of events to obtain. - Defaults to `100`. [[ml-get-calendar-event-results]] == {api-response-body-title} diff --git a/docs/reference/ml/anomaly-detection/apis/get-calendar.asciidoc b/docs/reference/ml/anomaly-detection/apis/get-calendar.asciidoc index 331aa10286db7..e4bea16a59222 100644 --- a/docs/reference/ml/anomaly-detection/apis/get-calendar.asciidoc +++ b/docs/reference/ml/anomaly-detection/apis/get-calendar.asciidoc @@ -53,14 +53,20 @@ or by omitting the identifier. [[ml-get-calendar-request-body]] == {api-request-body-title} -`page`.`from`:: - (Optional, integer) Skips the specified number of calendars. This object is - supported only when you omit the ``. Defaults to `0`. - -`page`.`size`:: - (Optional, integer) Specifies the maximum number of calendars to obtain. - This object is supported only when you omit the ``. Defaults - to `100`. +`page`:: ++ +.Properties of `page` +[%collapsible%open] +==== + +`from`::: +(Optional, integer) Skips the specified number of calendars. This object is +supported only when you omit the ``. Defaults to `0`. + +`size`::: +(Optional, integer) Specifies the maximum number of calendars to obtain. This +object is supported only when you omit the ``. Defaults to `100`. +==== [[ml-get-calendar-results]] == {api-response-body-title} diff --git a/docs/reference/ml/anomaly-detection/apis/get-category.asciidoc b/docs/reference/ml/anomaly-detection/apis/get-category.asciidoc index 37a769b838d6a..034a598b73370 100644 --- a/docs/reference/ml/anomaly-detection/apis/get-category.asciidoc +++ b/docs/reference/ml/anomaly-detection/apis/get-category.asciidoc @@ -68,12 +68,19 @@ Defaults to `100`. You can also specify the `partition_field_value` query parameter in the request body. -`page`.`from`:: +`page`:: ++ +.Properties of `page` +[%collapsible%open] +==== + +`from`::: (Optional, integer) Skips the specified number of categories. Defaults to `0`. -`page`.`size`:: +`size`::: (Optional, integer) Specifies the maximum number of categories to obtain. Defaults to `100`. +==== [[ml-get-category-results]] == {api-response-body-title} diff --git a/docs/reference/ml/anomaly-detection/apis/get-influencer.asciidoc b/docs/reference/ml/anomaly-detection/apis/get-influencer.asciidoc index 630525ef366de..76ead2921df6f 100644 --- a/docs/reference/ml/anomaly-detection/apis/get-influencer.asciidoc +++ b/docs/reference/ml/anomaly-detection/apis/get-influencer.asciidoc @@ -77,12 +77,19 @@ timestamps. You can also specify the query parameters in the request body; the exception are `from` and `size`, use `page` instead: -`page`.`from`:: +`page`:: ++ +.Properties of `page` +[%collapsible%open] +==== + +`from`::: (Optional, integer) Skips the specified number of influencers. Defaults to `0`. -`page`.`size`:: +`size`::: (Optional, integer) Specifies the maximum number of influencers to obtain. Defaults to `100`. +==== [[ml-get-influencer-results]] == {api-response-body-title} diff --git a/docs/reference/ml/anomaly-detection/apis/get-record.asciidoc b/docs/reference/ml/anomaly-detection/apis/get-record.asciidoc index a8015bd8f3709..9fac1ba37b20d 100644 --- a/docs/reference/ml/anomaly-detection/apis/get-record.asciidoc +++ b/docs/reference/ml/anomaly-detection/apis/get-record.asciidoc @@ -82,12 +82,19 @@ default, the records are sorted by the `record_score` value. You can also specify the query parameters in the request body; the exception are `from` and `size`, use `page` instead: -`page`.`from`:: +`page`:: ++ +.Properties of `page` +[%collapsible%open] +==== + +`from`::: (Optional, integer) Skips the specified number of records. Defaults to `0`. -`page`.`size`:: +`size`::: (Optional, integer) Specifies the maximum number of records to obtain. Defaults to `100`. +==== [[ml-get-record-results]] == {api-response-body-title} diff --git a/docs/reference/ml/anomaly-detection/apis/get-snapshot.asciidoc b/docs/reference/ml/anomaly-detection/apis/get-snapshot.asciidoc index f778c55ab86c4..5f9eef088ee04 100644 --- a/docs/reference/ml/anomaly-detection/apis/get-snapshot.asciidoc +++ b/docs/reference/ml/anomaly-detection/apis/get-snapshot.asciidoc @@ -70,12 +70,19 @@ specifying `*` as the snapshot ID, or by omitting the snapshot ID. You can also specify the query parameters in the request body; the exception are `from` and `size`, use `page` instead: -`page`.`from`:: +`page`:: ++ +.Properties of `page` +[%collapsible%open] +==== + +`from`::: (Optional, integer) Skips the specified number of snapshots. Defaults to `0`. -`page`.`size`:: +`size`::: (Optional, integer) Specifies the maximum number of snapshots to obtain. Defaults to `100`. +==== [role="child_attributes"] [[ml-get-snapshot-results]]