Skip to content

Commit 4615564

Browse files
authored
Added missing types for /_delete_by_query/{task_id}/_rethrottle. (#692)
Signed-off-by: dblock <[email protected]>
1 parent c51aa2e commit 4615564

File tree

4 files changed

+82
-0
lines changed

4 files changed

+82
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
1717
- Added `/_list/indices` & `/_list/shards` api specs ([#613](https://github.com/opensearch-project/opensearch-api-specification/pull/613))
1818
- Added `GET` and `HEAD /{index}/_source/{id}` returning `404` ([#673](https://github.com/opensearch-project/opensearch-api-specification/pull/673))
1919
- Added `rename_alias_pattern` and `rename_alias_replacment` to `/_snapshot/{repository}/{snapshot}/_restore` body parameters ([#615](https://github.com/opensearch-project/opensearch-api-specification/pull/615))
20+
- Added `resource_stats` to `TaskInfoBase` ([#692](https://github.com/opensearch-project/opensearch-api-specification/pull/692))
2021
- Added `s` to `/_ingest/processor/grok` ([#689](https://github.com/opensearch-project/opensearch-api-specification/pull/689))
2122

2223
### Removed

spec/schemas/_common.yaml

+39
Original file line numberDiff line numberDiff line change
@@ -2338,3 +2338,42 @@ components:
23382338
type: string
23392339
enum:
23402340
- index_or_alias
2341+
ResourceStats:
2342+
type: object
2343+
properties:
2344+
average:
2345+
$ref: '#/components/schemas/ResourceStat'
2346+
total:
2347+
$ref: '#/components/schemas/ResourceStat'
2348+
min:
2349+
$ref: '#/components/schemas/ResourceStat'
2350+
max:
2351+
$ref: '#/components/schemas/ResourceStat'
2352+
thread_info:
2353+
$ref: '#/components/schemas/ThreadInfo'
2354+
required:
2355+
- average
2356+
- max
2357+
- min
2358+
- thread_info
2359+
- total
2360+
ResourceStat:
2361+
type: object
2362+
properties:
2363+
cpu_time_in_nanos:
2364+
$ref: '#/components/schemas/DurationValueUnitNanos'
2365+
memory_in_bytes:
2366+
$ref: '#/components/schemas/ByteCount'
2367+
required:
2368+
- cpu_time_in_nanos
2369+
- memory_in_bytes
2370+
ThreadInfo:
2371+
type: object
2372+
properties:
2373+
thread_executions:
2374+
type: number
2375+
active_threads:
2376+
type: number
2377+
required:
2378+
- active_threads
2379+
- thread_executions

spec/schemas/tasks._common.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ components:
6767
type: string
6868
parent_task_id:
6969
$ref: '_common.yaml#/components/schemas/TaskId'
70+
resource_stats:
71+
$ref: '_common.yaml#/components/schemas/ResourceStats'
7072
required:
7173
- action
7274
- cancellable
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
$schema: ../../../../json_schemas/test_story.schema.yaml
2+
3+
description: Test adjusting the value of `requests_per_second` of a running delete by query.
4+
epilogues:
5+
- path: /books
6+
method: DELETE
7+
status: [200, 404]
8+
prologues:
9+
- path: /_bulk
10+
method: POST
11+
parameters:
12+
refresh: true
13+
request:
14+
content_type: application/x-ndjson
15+
payload:
16+
- {create: {_index: books, _id: book_1392214}}
17+
- {author: Harper Lee, title: To Kill a Mockingbird, year: 60}
18+
- {create: {_index: books, _id: book_1392215}}
19+
- {author: Elizabeth Rudnick, title: Beauty and the Beast, year: 91}
20+
- path: /books/_delete_by_query
21+
id: task
22+
method: POST
23+
parameters:
24+
wait_for_completion: false
25+
requests_per_second: 1
26+
request:
27+
payload:
28+
query:
29+
match_all: {}
30+
output:
31+
task_id: payload.task
32+
chapters:
33+
- synopsis: Change the value of `requests_per_second``on a running delete by query.
34+
path: /_delete_by_query/{task_id}/_rethrottle
35+
method: POST
36+
parameters:
37+
task_id: ${task.task_id}
38+
requests_per_second: 2
39+
response:
40+
status: 200

0 commit comments

Comments
 (0)