Skip to content

Commit 16997d7

Browse files
committed
Add rollup API examples
1 parent 3d0ea68 commit 16997d7

20 files changed

+205
-3
lines changed

specification/_doc_ids/table.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,12 +475,14 @@ reroute-processor,https://www.elastic.co/guide/en/elasticsearch/reference/{branc
475475
render-search-template-api,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/render-search-template-api.html
476476
reset-transform,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/reset-transform.html
477477
restore-snapshot,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/snapshots-restore-snapshot.html
478+
rollup-agg-limitations,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/rollup-agg-limitations.html
478479
rollup-delete-job,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/rollup-delete-job.html
479480
rollup-get-job,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/rollup-get-job.html
480481
rollup-get-rollup-caps,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/rollup-get-rollup-caps.html
481482
rollup-get-rollup-index-caps,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/rollup-get-rollup-index-caps.html
482483
rollup-put-job,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/rollup-put-job.html
483484
rollup-search,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/rollup-search.html
485+
rollup-search-limitations,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/rollup-search-limitations.html
484486
rollup-start-job,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/rollup-start-job.html
485487
rollup-stop-job,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/rollup-stop-job.html
486488
routing,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/docs-get.html#get-routing

specification/rollup/delete_job/DeleteRollupJobRequest.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ import { Id } from '@_types/common'
4747
* ```
4848
* @rest_spec_name rollup.delete_job
4949
* @availability stack since=6.3.0 stability=experimental
50+
* @deprecated 8.11.0
5051
* @cluster_privileges manage_rollup
52+
* @doc_id rollup-delete-job
5153
*/
5254
export interface Request extends RequestBase {
5355
path_parts: {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# summary:
2+
description: A successful response from `DELETE _rollup/job/sensor`.
3+
# type: response
4+
# response_code: ''
5+
value: "{\n \"acknowledged\": true\n}"

specification/rollup/get_jobs/GetRollupJobRequest.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ import { Id } from '@_types/common'
3030
* @rest_spec_name rollup.get_jobs
3131
* @availability stack since=6.3.0 stability=experimental
3232
* @cluster_privileges monitor_rollup
33+
* @deprecated 8.11.0
34+
* @doc_id rollup-get-job
3335
*/
3436
export interface Request extends RequestBase {
3537
path_parts: {
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# summary:
2+
description: A successful response from `GET _rollup/job/sensor`.
3+
# type: response
4+
# response_code: ''
5+
value:
6+
"{\n \"jobs\": [\n {\n \"config\": {\n \"id\": \"sensor\",\n\
7+
\ \"index_pattern\": \"sensor-*\",\n \"rollup_index\": \"sensor_rollup\"\
8+
,\n \"cron\": \"*/30 * * * * ?\",\n \"groups\": {\n \"date_histogram\"\
9+
: {\n \"fixed_interval\": \"1h\",\n \"delay\": \"7d\",\n \
10+
\ \"field\": \"timestamp\",\n \"time_zone\": \"UTC\"\n \
11+
\ },\n \"terms\": {\n \"fields\": [\n \"node\"\
12+
\n ]\n }\n },\n \"metrics\": [\n {\n\
13+
\ \"field\": \"temperature\",\n \"metrics\": [\n \
14+
\ \"min\",\n \"max\",\n \"sum\"\n ]\n \
15+
\ },\n {\n \"field\": \"voltage\",\n \"metrics\"\
16+
: [\n \"avg\"\n ]\n }\n ],\n \"timeout\"\
17+
: \"20s\",\n \"page_size\": 1000\n },\n \"status\": {\n \
18+
\ \"job_state\": \"stopped\"\n },\n \"stats\": {\n \"pages_processed\"\
19+
: 0,\n \"documents_processed\": 0,\n \"rollups_indexed\": 0,\n \
20+
\ \"trigger_count\": 0,\n \"index_failures\": 0,\n \"index_time_in_ms\"\
21+
: 0,\n \"index_total\": 0,\n \"search_failures\": 0,\n \"search_time_in_ms\"\
22+
: 0,\n \"search_total\": 0,\n \"processing_time_in_ms\": 0,\n \
23+
\ \"processing_total\": 0\n }\n }\n ]\n}"

specification/rollup/get_jobs/types.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,19 @@ import { long } from '@_types/Numeric'
2626
import { Duration, DurationValue, UnitMillis } from '@_types/Time'
2727

2828
export class RollupJob {
29+
/**
30+
* The rollup job configuration.
31+
*/
2932
config: RollupJobConfiguration
33+
/**
34+
* Transient statistics about the rollup job, such as how many documents have been processed and how many rollup summary docs have been indexed.
35+
* These stats are not persisted.
36+
* If a node is restarted, these stats are reset.
37+
*/
3038
stats: RollupJobStats
39+
/**
40+
* The current status of the indexer for the rollup job.
41+
*/
3142
status: RollupJobStatus
3243
}
3344

specification/rollup/get_rollup_caps/GetRollupCapabilitiesRequest.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ import { Id } from '@_types/common'
3333
* @rest_spec_name rollup.get_rollup_caps
3434
* @availability stack since=6.3.0 stability=experimental
3535
* @cluster_privileges monitor_rollup
36+
* @deprecated 8.11.0
37+
* @doc_id rollup-get-rollup-caps
3638
*/
3739
export interface Request extends RequestBase {
3840
path_parts: {
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# summary:
2+
description: >
3+
A successful response from `GET _rollup/data/sensor-*` for a rollup job that targets the index pattern `sensor-*`.
4+
The response contains the rollup job ID, the index that holds the rolled data, and the index pattern that the job was targeting.
5+
It also shows a list of fields that contain data eligible for rollup searches.
6+
For example, you can use a `min`, `max`, or `sum` aggregation on the `temperature` field, but only a `date_histogram` on `timestamp`.
7+
# type: response
8+
# response_code: ''
9+
value:
10+
"{\n \"sensor-*\" : {\n \"rollup_jobs\" : [\n {\n \"job_id\"\
11+
\ : \"sensor\",\n \"rollup_index\" : \"sensor_rollup\",\n \"index_pattern\"\
12+
\ : \"sensor-*\",\n \"fields\" : {\n \"node\" : [\n {\n\
13+
\ \"agg\" : \"terms\"\n }\n ],\n \"temperature\"\
14+
\ : [\n {\n \"agg\" : \"min\"\n },\n \
15+
\ {\n \"agg\" : \"max\"\n },\n {\n \
16+
\ \"agg\" : \"sum\"\n }\n ],\n \"timestamp\"\
17+
\ : [\n {\n \"agg\" : \"date_histogram\",\n \
18+
\ \"time_zone\" : \"UTC\",\n \"fixed_interval\" : \"1h\",\n \
19+
\ \"delay\": \"7d\"\n }\n ],\n \"voltage\" :\
20+
\ [\n {\n \"agg\" : \"avg\"\n }\n ]\n\
21+
\ }\n }\n ]\n }\n}"

specification/rollup/get_rollup_caps/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ import { Field } from '@_types/common'
2222
import { Duration, TimeZone } from '@_types/Time'
2323

2424
export class RollupCapabilities {
25+
/**
26+
* There can be multiple, independent jobs configured for a single index or index pattern. Each of these jobs may have different configurations, so the API returns a list of all the various configurations available.
27+
*/
2528
rollup_jobs: RollupCapabilitySummary[]
2629
}
2730

specification/rollup/get_rollup_index_caps/GetRollupIndexCapabilitiesRequest.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ import { Ids } from '@_types/common'
3030
* @rest_spec_name rollup.get_rollup_index_caps
3131
* @availability stack since=6.4.0 stability=experimental
3232
* @index_privileges read
33+
* @deprecated 8.11.0
34+
* @doc_id rollup-get-rollup-index-caps
3335
*/
3436
export interface Request extends RequestBase {
3537
path_parts: {

0 commit comments

Comments
 (0)