Skip to content

Commit d20e8e2

Browse files
authored
Docs: Use task_id in examples of tasks (#30436)
We had been using `task_id:1` or `taskId:1` because it is parses as a valid task identifier but the `:1` part is confusing. This replaces those examples with `task_id` which matches the response from the list tasks API. Closes #28314
1 parent ce008c4 commit d20e8e2

File tree

4 files changed

+22
-11
lines changed

4 files changed

+22
-11
lines changed

docs/reference/cluster/tasks.asciidoc

+4-2
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@ It is also possible to retrieve information for a particular task:
6464

6565
[source,js]
6666
--------------------------------------------------
67-
GET _tasks/task_id:1 <1>
67+
GET _tasks/task_id <1>
6868
--------------------------------------------------
6969
// CONSOLE
70+
// TEST[s/task_id/node_id:1/]
7071
// TEST[catch:missing]
7172

7273
<1> This will return a 404 if the task isn't found.
@@ -75,9 +76,10 @@ Or to retrieve all children of a particular task:
7576

7677
[source,js]
7778
--------------------------------------------------
78-
GET _tasks?parent_task_id=parentTaskId:1 <1>
79+
GET _tasks?parent_task_id=parent_task_id <1>
7980
--------------------------------------------------
8081
// CONSOLE
82+
// TEST[s/=parent_task_id/=node_id:1/]
8183

8284
<1> This won't return a 404 if the parent isn't found.
8385

docs/reference/docs/delete-by-query.asciidoc

+6-3
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,10 @@ With the task id you can look up the task directly:
357357

358358
[source,js]
359359
--------------------------------------------------
360-
GET /_tasks/taskId:1
360+
GET /_tasks/task_id
361361
--------------------------------------------------
362362
// CONSOLE
363+
// TEST[s/task_id/node_id:1/]
363364
// TEST[catch:missing]
364365

365366
The advantage of this API is that it integrates with `wait_for_completion=false`
@@ -378,8 +379,9 @@ Any Delete By Query can be canceled using the <<tasks,Task Cancel API>>:
378379

379380
[source,js]
380381
--------------------------------------------------
381-
POST _tasks/task_id:1/_cancel
382+
POST _tasks/task_id/_cancel
382383
--------------------------------------------------
384+
// TEST[s/task_id/node_id:1/]
383385
// CONSOLE
384386

385387
The `task_id` can be found using the tasks API above.
@@ -397,8 +399,9 @@ using the `_rethrottle` API:
397399

398400
[source,js]
399401
--------------------------------------------------
400-
POST _delete_by_query/task_id:1/_rethrottle?requests_per_second=-1
402+
POST _delete_by_query/task_id/_rethrottle?requests_per_second=-1
401403
--------------------------------------------------
404+
// TEST[s/task_id/node_id:1/]
402405
// CONSOLE
403406

404407
The `task_id` can be found using the tasks API above.

docs/reference/docs/reindex.asciidoc

+6-3
Original file line numberDiff line numberDiff line change
@@ -740,9 +740,10 @@ With the task id you can look up the task directly:
740740

741741
[source,js]
742742
--------------------------------------------------
743-
GET /_tasks/taskId:1
743+
GET /_tasks/task_id
744744
--------------------------------------------------
745745
// CONSOLE
746+
// TEST[s/task_id/node_id:1/]
746747
// TEST[catch:missing]
747748

748749
The advantage of this API is that it integrates with `wait_for_completion=false`
@@ -761,9 +762,10 @@ Any Reindex can be canceled using the <<tasks,Task Cancel API>>:
761762

762763
[source,js]
763764
--------------------------------------------------
764-
POST _tasks/task_id:1/_cancel
765+
POST _tasks/task_id/_cancel
765766
--------------------------------------------------
766767
// CONSOLE
768+
// TEST[s/task_id/node_id:1/]
767769

768770
The `task_id` can be found using the Tasks API.
769771

@@ -780,9 +782,10 @@ the `_rethrottle` API:
780782

781783
[source,js]
782784
--------------------------------------------------
783-
POST _reindex/task_id:1/_rethrottle?requests_per_second=-1
785+
POST _reindex/task_id/_rethrottle?requests_per_second=-1
784786
--------------------------------------------------
785787
// CONSOLE
788+
// TEST[s/task_id/node_id:1/]
786789

787790
The `task_id` can be found using the Tasks API above.
788791

docs/reference/docs/update-by-query.asciidoc

+6-3
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,10 @@ With the task id you can look up the task directly:
415415

416416
[source,js]
417417
--------------------------------------------------
418-
GET /_tasks/taskId:1
418+
GET /_tasks/task_id
419419
--------------------------------------------------
420420
// CONSOLE
421+
// TEST[s/task_id/node_id:1/]
421422
// TEST[catch:missing]
422423

423424
The advantage of this API is that it integrates with `wait_for_completion=false`
@@ -436,9 +437,10 @@ Any Update By Query can be canceled using the <<tasks,Task Cancel API>>:
436437

437438
[source,js]
438439
--------------------------------------------------
439-
POST _tasks/task_id:1/_cancel
440+
POST _tasks/task_id/_cancel
440441
--------------------------------------------------
441442
// CONSOLE
443+
// TEST[s/task_id/node_id:1/]
442444

443445
The `task_id` can be found using the tasks API above.
444446

@@ -455,9 +457,10 @@ using the `_rethrottle` API:
455457

456458
[source,js]
457459
--------------------------------------------------
458-
POST _update_by_query/task_id:1/_rethrottle?requests_per_second=-1
460+
POST _update_by_query/task_id/_rethrottle?requests_per_second=-1
459461
--------------------------------------------------
460462
// CONSOLE
463+
// TEST[s/task_id/node_id:1/]
461464

462465
The `task_id` can be found using the tasks API above.
463466

0 commit comments

Comments
 (0)