Skip to content

Commit 0f15736

Browse files
committed
[DOCS] Reformat rollup API docs (#49397)
1 parent d9fd4cc commit 0f15736

7 files changed

+173
-130
lines changed

docs/reference/rollup/apis/get-job.asciidoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ experimental[]
1818
[[rollup-get-job-prereqs]]
1919
==== {api-prereq-title}
2020

21-
* You must have `monitor`, `monitor_rollup`, `manage` or `manage_rollup` cluster
22-
privileges to use this API. For more information, see
23-
<<security-privileges>>.
21+
* If the {es} {security-features} are enabled, you must have `monitor`,
22+
`monitor_rollup`, `manage` or `manage_rollup` cluster privileges to use this API.
23+
For more information, see <<security-privileges>>.
2424

2525
[[rollup-get-job-desc]]
2626
==== {api-description-title}

docs/reference/rollup/apis/put-job.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Jobs are created in a `STOPPED` state. You can start them with the
3232
[[rollup-put-job-api-path-params]]
3333
==== {api-path-parms-title}
3434

35-
`job_id`::
35+
`<job_id>`::
3636
(Required, string) Identifier for the {rollup-job}.
3737

3838
[[rollup-put-job-api-request-body]]

docs/reference/rollup/apis/rollup-caps.asciidoc

+52-42
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
11
[role="xpack"]
22
[testenv="basic"]
33
[[rollup-get-rollup-caps]]
4-
=== Get rollup job capabilities API
4+
=== Get {rollup-job} capabilities API
55
++++
66
<titleabbrev>Get rollup caps</titleabbrev>
77
++++
88

9+
Returns the capabilities of any {rollup-jobs} that have been configured for a
10+
specific index or index pattern.
11+
912
experimental[]
1013

11-
This API returns the capabilities of any rollup jobs that have been configured
12-
for a specific index or index pattern.
14+
[[rollup-get-rollup-caps-request]]
15+
==== {api-request-title}
16+
17+
`GET _rollup/data/<index>`
18+
19+
[[rollup-get-rollup-caps-prereqs]]
20+
==== {api-prereq-title}
1321

14-
This API is useful because a rollup job is often configured to rollup only a
22+
* If the {es} {security-features} are enabled, you must have `monitor`,
23+
`monitor_rollup`, `manage` or `manage_rollup` cluster privileges to use this API.
24+
For more information, see <<security-privileges>>.
25+
26+
[[rollup-get-rollup-caps-desc]]
27+
==== {api-description-title}
28+
29+
This API is useful because a {rollup-job} is often configured to rollup only a
1530
subset of fields from the source index. Furthermore, only certain aggregations
1631
can be configured for various fields, leading to a limited subset of
1732
functionality depending on that configuration.
@@ -22,33 +37,20 @@ This API enables you to inspect an index and determine:
2237
2. If yes to the first question, what fields were rolled up, what aggregations
2338
can be performed, and where does the data live?
2439

25-
==== Request
26-
27-
`GET _rollup/data/{index}`
28-
29-
//===== Description
30-
31-
==== Path Parameters
32-
33-
`index`::
34-
(string) Index, indices or index-pattern to return rollup capabilities for. `_all` may be used to fetch
35-
rollup capabilities from all jobs
36-
37-
38-
==== Request Body
39-
40-
There is no request body for the Get Rollup Caps API.
40+
[[rollup-get-rollup-path-params]]
41+
==== {api-path-parms-title}
4142

42-
==== Authorization
43+
`<index>`::
44+
(string) Index, indices or index-pattern to return rollup capabilities for.
45+
`_all` may be used to fetch rollup capabilities from all jobs.
4346

44-
You must have `monitor`, `monitor_rollup`, `manage` or `manage_rollup` cluster privileges to use this API.
45-
For more information, see
46-
<<security-privileges>>.
4747

48-
==== Examples
48+
[[rollup-get-rollup-example]]
49+
==== {api-examples-title}
4950

50-
Imagine we have an index named `sensor-1` full of raw data. We know that the data will grow over time, so there
51-
will be a `sensor-2`, `sensor-3`, etc. Let's create a Rollup job that targets the index pattern `sensor-*` to accommodate
51+
Imagine we have an index named `sensor-1` full of raw data. We know that the
52+
data will grow over time, so there will be a `sensor-2`, `sensor-3`, etc. Let's
53+
create a {rollup-job} that targets the index pattern `sensor-*` to accommodate
5254
this future scaling:
5355

5456
[source,console]
@@ -83,7 +85,8 @@ PUT _rollup/job/sensor
8385
--------------------------------------------------
8486
// TEST[setup:sensor_index]
8587

86-
We can then retrieve the rollup capabilities of that index pattern (`sensor-*`) via the following command:
88+
We can then retrieve the rollup capabilities of that index pattern (`sensor-*`)
89+
via the following command:
8790

8891
[source,console]
8992
--------------------------------------------------
@@ -139,17 +142,21 @@ Which will yield the following response:
139142
}
140143
----
141144

142-
The response that is returned contains information that is similar to the original Rollup configuration, but formatted
143-
differently. First, there are some house-keeping details: the Rollup job's ID, the index that holds the rolled data,
144-
the index pattern that the job was targeting.
145+
The response that is returned contains information that is similar to the
146+
original rollup configuration, but formatted differently. First, there are some
147+
house-keeping details: the {rollup-job} ID, the index that holds the rolled data,
148+
and the index pattern that the job was targeting.
145149

146-
Next it shows a list of fields that contain data eligible for rollup searches. Here we see four fields: `node`, `temperature`,
147-
`timestamp` and `voltage`. Each of these fields list the aggregations that are possible. For example, you can use a min, max
148-
or sum aggregation on the `temperature` field, but only a `date_histogram` on `timestamp`.
150+
Next it shows a list of fields that contain data eligible for rollup searches.
151+
Here we see four fields: `node`, `temperature`, `timestamp` and `voltage`. Each
152+
of these fields list the aggregations that are possible. For example, you can
153+
use a min, max or sum aggregation on the `temperature` field, but only a
154+
`date_histogram` on `timestamp`.
149155

150-
Note that the `rollup_jobs` element is an array; there can be multiple, independent jobs configured for a single index
151-
or index pattern. Each of these jobs may have different configurations, so the API returns a list of all the various
152-
configurations available.
156+
Note that the `rollup_jobs` element is an array; there can be multiple,
157+
independent jobs configured for a single index or index pattern. Each of these
158+
jobs may have different configurations, so the API returns a list of all the
159+
various configurations available.
153160

154161
We could also retrieve the same information with a request to `_all`:
155162

@@ -159,7 +166,8 @@ GET _rollup/data/_all
159166
--------------------------------------------------
160167
// TEST[continued]
161168

162-
But note that if we use the concrete index name (`sensor-1`), we'll retrieve no rollup capabilities:
169+
But note that if we use the concrete index name (`sensor-1`), we'll retrieve no
170+
rollup capabilities:
163171

164172
[source,console]
165173
--------------------------------------------------
@@ -174,7 +182,9 @@ GET _rollup/data/sensor-1
174182
}
175183
----
176184

177-
Why is this? The original rollup job was configured against a specific index pattern (`sensor-*`) not a concrete index
178-
(`sensor-1`). So while the index belongs to the pattern, the rollup job is only valid across the entirety of the pattern
179-
not just one of it's containing indices. So for that reason, the Rollup Capabilities API only returns information based
180-
on the originally configured index name or pattern.
185+
Why is this? The original {rollup-job} was configured against a specific index
186+
pattern (`sensor-*`) not a concrete index (`sensor-1`). So while the index
187+
belongs to the pattern, the {rollup-job} is only valid across the entirety of
188+
the pattern not just one of it's containing indices. So for that reason, the
189+
get rollup capabilities API only returns information based on the originally
190+
configured index name or pattern.

docs/reference/rollup/apis/rollup-index-caps.asciidoc

+47-36
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,48 @@
66
<titleabbrev>Get rollup index caps</titleabbrev>
77
++++
88

9-
experimental[]
10-
11-
This API returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored).
12-
A single rollup index may store the data for multiple rollup jobs, and may have a variety of capabilities depending on those jobs.
9+
Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the
10+
index where rollup data is stored).
1311

14-
This API will allow you to determine:
12+
experimental[]
1513

16-
1. What jobs are stored in an index (or indices specified via a pattern)?
17-
2. What target indices were rolled up, what fields were used in those rollups and what aggregations can be performed on each job?
14+
[[rollup-get-rollup-index-caps-request]]
15+
==== {api-request-title}
1816

19-
==== Request
17+
`GET <index>/_rollup/data`
2018

21-
`GET {index}/_rollup/data`
19+
[[rollup-get-rollup-index-caps-prereqs]]
20+
==== {api-prereq-title}
2221

23-
//===== Description
22+
* If the {es} {security-features} are enabled, you must have the `read` index
23+
privilege on the index that stores the rollup results. For more information, see
24+
<<security-privileges>>.
2425

25-
==== Path Parameters
26+
[[rollup-get-rollup-index-caps-desc]]
27+
==== {api-description-title}
2628

27-
`index`::
28-
(string) Index or index-pattern of concrete rollup indices to check for capabilities.
29+
A single rollup index may store the data for multiple {rollup-jobs}, and may
30+
have a variety of capabilities depending on those jobs.
2931

30-
==== Request Body
32+
This API will allow you to determine:
3133

32-
There is no request body for the Get Jobs API.
34+
1. What jobs are stored in an index (or indices specified via a pattern)?
35+
2. What target indices were rolled up, what fields were used in those rollups
36+
and what aggregations can be performed on each job?
3337

34-
==== Authorization
38+
[[rollup-get-rollup-index-caps-path-params]]
39+
==== {api-path-parms-title}
3540

36-
You must have the `read` index privilege on the index that stores the rollup results.
37-
For more information, see
38-
<<security-privileges>>.
41+
`<index>`::
42+
(Required, string) Index or index-pattern of concrete rollup indices to check
43+
for capabilities.
3944

40-
==== Examples
45+
[[rollup-get-rollup-index-caps-example]]
46+
==== {api-examples-title}
4147

42-
Imagine we have an index named `sensor-1` full of raw data. We know that the data will grow over time, so there
43-
will be a `sensor-2`, `sensor-3`, etc. Let's create a Rollup job, which stores it's data in `sensor_rollup`:
48+
Imagine we have an index named `sensor-1` full of raw data. We know that the
49+
data will grow over time, so there will be a `sensor-2`, `sensor-3`, etc.
50+
Let's create a {rollup-job} that stores its data in `sensor_rollup`:
4451

4552
[source,console]
4653
--------------------------------------------------
@@ -74,17 +81,17 @@ PUT _rollup/job/sensor
7481
--------------------------------------------------
7582
// TEST[setup:sensor_index]
7683

77-
If at a later date, we'd like to determine what jobs and capabilities were stored in the `sensor_rollup` index, we can use the Get Rollup
78-
Index API:
84+
If at a later date, we'd like to determine what jobs and capabilities were
85+
stored in the `sensor_rollup` index, we can use the get rollup index API:
7986

8087
[source,console]
8188
--------------------------------------------------
8289
GET /sensor_rollup/_rollup/data
8390
--------------------------------------------------
8491
// TEST[continued]
8592

86-
Note how we are requesting the concrete rollup index name (`sensor_rollup`) as the first part of the URL.
87-
This will yield the following response:
93+
Note how we are requesting the concrete rollup index name (`sensor_rollup`) as
94+
the first part of the URL. This will yield the following response:
8895

8996
[source,console-result]
9097
----
@@ -133,20 +140,24 @@ This will yield the following response:
133140
----
134141

135142

136-
The response that is returned contains information that is similar to the original Rollup configuration, but formatted
137-
differently. First, there are some house-keeping details: the Rollup job's ID, the index that holds the rolled data,
143+
The response that is returned contains information that is similar to the
144+
original rollup configuration, but formatted differently. First, there are some
145+
house-keeping details: the {rollup-job} ID, the index that holds the rolled data,
138146
the index pattern that the job was targeting.
139147

140-
Next it shows a list of fields that contain data eligible for rollup searches. Here we see four fields: `node`, `temperature`,
141-
`timestamp` and `voltage`. Each of these fields list the aggregations that are possible. For example, you can use a min, max
142-
or sum aggregation on the `temperature` field, but only a `date_histogram` on `timestamp`.
143-
144-
Note that the `rollup_jobs` element is an array; there can be multiple, independent jobs configured for a single index
145-
or index pattern. Each of these jobs may have different configurations, so the API returns a list of all the various
146-
configurations available.
148+
Next it shows a list of fields that contain data eligible for rollup searches.
149+
Here we see four fields: `node`, `temperature`, `timestamp` and `voltage`. Each
150+
of these fields list the aggregations that are possible. For example, you can
151+
use a min, max, or sum aggregation on the `temperature` field, but only a
152+
`date_histogram` on `timestamp`.
147153

154+
Note that the `rollup_jobs` element is an array; there can be multiple,
155+
independent jobs configured for a single index or index pattern. Each of these
156+
jobs may have different configurations, so the API returns a list of all the
157+
various configurations available.
148158

149-
Like other APIs that interact with indices, you can specify index patterns instead of explicit indices:
159+
Like other APIs that interact with indices, you can specify index patterns
160+
instead of explicit indices:
150161

151162
[source,console]
152163
--------------------------------------------------

0 commit comments

Comments
 (0)