Skip to content

Commit 752012a

Browse files
committed
[DOCS] Reformats get rollup jobs API (#45114)
1 parent 412f507 commit 752012a

File tree

1 file changed

+61
-44
lines changed

1 file changed

+61
-44
lines changed

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

Lines changed: 61 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,83 @@
11
[role="xpack"]
22
[testenv="basic"]
33
[[rollup-get-job]]
4-
=== Get rollup jobs API
4+
=== Get {rollup-jobs} API
55
++++
66
<titleabbrev>Get job</titleabbrev>
77
++++
88

9-
experimental[]
10-
11-
This API returns the configuration, stats and status of rollup jobs. The API can return the details for a single job,
12-
or for all jobs.
13-
14-
Note: This API only returns active (both `STARTED` and `STOPPED`) jobs. If a job was created, ran for a while then deleted,
15-
this API will not return any details about that job.
9+
Retrieves the configuration, stats, and status of {rollup-jobs}.
1610

17-
For details about a historical job, the <<rollup-get-rollup-caps,Rollup Capabilities API>> may be more useful
11+
experimental[]
1812

19-
==== Request
13+
[[rollup-get-job-request]]
14+
==== {api-request-title}
2015

2116
`GET _rollup/job/<job_id>`
2217

23-
//===== Description
18+
[[rollup-get-job-prereqs]]
19+
==== {api-prereq-title}
20+
21+
* You must have `monitor`, `monitor_rollup`, `manage` or `manage_rollup` cluster
22+
privileges to use this API. For more information, see
23+
{stack-ov}/security-privileges.html[Security privileges].
2424

25-
==== Path Parameters
25+
[[rollup-get-job-desc]]
26+
==== {api-description-title}
2627

27-
`job_id`::
28-
(string) Identifier for the job to retrieve. If omitted (or `_all` is used) all jobs will be returned
28+
The API can return the details for a single {rollup-job} or for all {rollup-jobs}.
2929

30+
NOTE: This API returns only active (both `STARTED` and `STOPPED`) jobs. If a job
31+
was created, ran for a while then deleted, this API does not return any details
32+
about that job.
3033

31-
==== Request Body
34+
For details about a historical {rollup-job}, the
35+
<<rollup-get-rollup-caps,rollup capabilities API>> may be more useful.
3236

33-
There is no request body for the Get Jobs API.
37+
[[rollup-get-job-path-params]]
38+
==== {api-path-parms-title}
3439

35-
==== Authorization
40+
`<job_id>`::
41+
(Optional, string) Identifier for the {rollup-job}. If it is `_all` or omitted,
42+
the API returns all {rollup-jobs}.
43+
44+
[[rollup-get-job-response-body]]
45+
==== {api-response-body-title}
3646

37-
You must have `monitor`, `monitor_rollup`, `manage` or `manage_rollup` cluster privileges to use this API.
38-
For more information, see
39-
{xpack-ref}/security-privileges.html[Security Privileges].
47+
`jobs`::
48+
(array) An array of {rollup-job} resources.
49+
`config`:::
50+
(object) Contains the configuration for the {rollup-job}. This information
51+
is identical to the configuration that was supplied when creating the job
52+
via the <<rollup-put-job,create job API>>.
53+
`status`:::
54+
(object) Contains the current status of the indexer for the {rollup-job}.
55+
The possible values and their meanings are:
56+
+
57+
--
58+
- `stopped` means the indexer is paused and will not process data, even if its
59+
cron interval triggers.
60+
- `started` means the indexer is running, but not actively indexing data. When
61+
the cron interval triggers, the job's indexer will begin to process data.
62+
- `indexing` means the indexer is actively processing data and creating new
63+
rollup documents. When in this state, any subsequent cron interval triggers will
64+
be ignored because the job is already active with the prior trigger.
65+
- `abort` is a transient state, which is usually not witnessed by the user. It
66+
is used if the task needs to be shut down for some reason (job has been deleted,
67+
an unrecoverable error has been encountered, etc). Shortly after the `abort`
68+
state is set, the job will remove itself from the cluster.
69+
--
70+
`stats`:::
71+
(object) Contains transient statistics about the {rollup-job}, such as how
72+
many documents have been processed and how many rollup summary docs have
73+
been indexed. These stats are not persisted. If a node is restarted, these
74+
stats will be reset.
4075

41-
==== Examples
76+
[[rollup-get-job-example]]
77+
==== {api-examples-title}
4278

43-
If we have already created a rollup job named `sensor`, the details about the job can be retrieved with:
79+
If we have already created a rollup job named `sensor`, the details about the
80+
job can be retrieved with:
4481

4582
[source,js]
4683
--------------------------------------------------
@@ -49,7 +86,7 @@ GET _rollup/job/sensor
4986
// CONSOLE
5087
// TEST[setup:sensor_rollup_job]
5188

52-
Which will yield the following response:
89+
The API yields the following response:
5390

5491
[source,js]
5592
----
@@ -115,27 +152,7 @@ Which will yield the following response:
115152
----
116153
// TESTRESPONSE
117154

118-
The `jobs` array contains a single job (`id: sensor`) since we requested a single job in the endpoint's URL. The
119-
details for this job contain three top-level parameters: `config`, `status` and `stats`
120-
121-
`config` holds the rollup job's configuration, which is identical to the configuration that was supplied when creating
122-
the job via the <<rollup-put-job,Create Job API>>.
123-
124-
The `status` object holds the current status of the rollup job's indexer. The possible values and their meanings are:
125-
126-
- `stopped` means the indexer is paused and will not process data, even if it's cron interval triggers
127-
- `started` means the indexer is running, but not actively indexing data. When the cron interval triggers, the job's
128-
indexer will begin to process data
129-
- `indexing` means the indexer is actively processing data and creating new rollup documents. When in this state, any
130-
subsequent cron interval triggers will be ignored because the job is already active with the prior trigger
131-
- `abort` a transient state, which is usually not witnessed by the user. The `abort` state is used if the task needs to
132-
be shut down for some reason (job has been deleted, an unrecoverable error has been encountered, etc). Shortly after
133-
the `abort` state is set, the job will remove itself from the cluster
134-
135-
Finally, the `stats` object provides transient statistics about the rollup job, such as how many documents have been
136-
processed and how many rollup summary docs have been indexed. These stats are not persisted, so if a node is restarted
137-
these stats will be reset.
138-
155+
The `jobs` array contains a single job (`id: sensor`) since we requested a single job in the endpoint's URL.
139156
If we add another job, we can see how multi-job responses are handled:
140157

141158
[source,js]

0 commit comments

Comments
 (0)