Skip to content

Commit

Permalink
Fix tasks namespace
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia committed Sep 9, 2024
1 parent 9193d58 commit 608065b
Show file tree
Hide file tree
Showing 6 changed files with 197 additions and 165 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Fixed content-type for `/hot_threads` ([#543](https://github.com/opensearch-project/opensearch-api-specification/pull/543))
- Fixed `/_cluster/settings` returning flat results ([#545](https://github.com/opensearch-project/opensearch-api-specification/pull/545))
- Fixed missing fields in `_cat` API ([#551](https://github.com/opensearch-project/opensearch-api-specification/pull/551))
- Fixed tasks namespace schemas ([#520](https://github.com/opensearch-project/opensearch-api-specification/pull/520))

### Security

Expand Down
1 change: 1 addition & 0 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ This repository includes several OpenAPI Specification Extensions to fill in any
- `x-ignorable`: Denotes that the operation should be ignored by the client generator. This is used in operation groups where some operations have been replaced by newer ones, but we still keep them in the specs because the server still supports them.
- `x-global`: Denotes that the parameter is a global parameter that is included in every operation. These parameters are listed in the [spec/_global_parameters.yaml](spec/_global_parameters.yaml).
- `x-default`: Contains the default value of a parameter. This is often used to override the default value specified in the schema, or to avoid accidentally changing the default value when updating a shared schema.
- `x-deprecated-enums`: Contains the values of an enum which should be annotated as deprecated in the client.
- `x-distributions-included`: Contains a list of distributions known to include the API.
- `x-distributions-excluded`: Contains a list of distributions known to exclude the API.

Expand Down
126 changes: 18 additions & 108 deletions spec/namespaces/_core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2719,42 +2719,12 @@ components:
content:
application/json:
schema:
type: object
properties:
batches:
type: number
deleted:
type: number
failures:
type: array
items:
$ref: '../schemas/_common.yaml#/components/schemas/BulkIndexByScrollFailure'
noops:
type: number
requests_per_second:
type: number
retries:
$ref: '../schemas/_common.yaml#/components/schemas/Retries'
slice_id:
type: number
task:
$ref: '../schemas/_common.yaml#/components/schemas/TaskId'
throttled:
$ref: '../schemas/_common.yaml#/components/schemas/Duration'
throttled_millis:
$ref: '../schemas/_common.yaml#/components/schemas/DurationValueUnitMillis'
throttled_until:
$ref: '../schemas/_common.yaml#/components/schemas/Duration'
throttled_until_millis:
$ref: '../schemas/_common.yaml#/components/schemas/DurationValueUnitMillis'
timed_out:
type: boolean
took:
$ref: '../schemas/_common.yaml#/components/schemas/DurationValueUnitMillis'
total:
type: number
version_conflicts:
type: number
oneOf:
- $ref: '../schemas/_common.yaml#/components/schemas/BulkByScrollResponseBase'
- type: object
properties:
task:
$ref: '../schemas/_common.yaml#/components/schemas/TaskId'
delete_by_query_rethrottle@200:
content:
application/json:
Expand Down Expand Up @@ -2982,42 +2952,12 @@ components:
content:
application/json:
schema:
type: object
properties:
batches:
type: number
created:
type: number
deleted:
type: number
failures:
type: array
items:
$ref: '../schemas/_common.yaml#/components/schemas/BulkIndexByScrollFailure'
noops:
type: number
retries:
$ref: '../schemas/_common.yaml#/components/schemas/Retries'
requests_per_second:
type: number
slice_id:
type: number
task:
$ref: '../schemas/_common.yaml#/components/schemas/TaskId'
throttled_millis:
$ref: '../schemas/_common.yaml#/components/schemas/EpochTimeUnitMillis'
throttled_until_millis:
$ref: '../schemas/_common.yaml#/components/schemas/EpochTimeUnitMillis'
timed_out:
type: boolean
took:
$ref: '../schemas/_common.yaml#/components/schemas/DurationValueUnitMillis'
total:
type: number
updated:
type: number
version_conflicts:
type: number
oneOf:
- $ref: '../schemas/_common.yaml#/components/schemas/BulkByScrollResponseBase'
- type: object
properties:
task:
$ref: '../schemas/_common.yaml#/components/schemas/TaskId'
reindex_rethrottle@200:
content:
application/json:
Expand Down Expand Up @@ -3178,42 +3118,12 @@ components:
content:
application/json:
schema:
type: object
properties:
batches:
type: number
failures:
type: array
items:
$ref: '../schemas/_common.yaml#/components/schemas/BulkIndexByScrollFailure'
noops:
type: number
deleted:
type: number
requests_per_second:
type: number
retries:
$ref: '../schemas/_common.yaml#/components/schemas/Retries'
task:
$ref: '../schemas/_common.yaml#/components/schemas/TaskId'
timed_out:
type: boolean
took:
$ref: '../schemas/_common.yaml#/components/schemas/DurationValueUnitMillis'
total:
type: number
updated:
type: number
version_conflicts:
type: number
throttled:
$ref: '../schemas/_common.yaml#/components/schemas/Duration'
throttled_millis:
$ref: '../schemas/_common.yaml#/components/schemas/DurationValueUnitMillis'
throttled_until:
$ref: '../schemas/_common.yaml#/components/schemas/Duration'
throttled_until_millis:
$ref: '../schemas/_common.yaml#/components/schemas/DurationValueUnitMillis'
oneOf:
- $ref: '../schemas/_common.yaml#/components/schemas/BulkByScrollResponseBase'
- type: object
properties:
task:
$ref: '../schemas/_common.yaml#/components/schemas/TaskId'
update_by_query_rethrottle@200:
content:
application/json:
Expand Down
2 changes: 1 addition & 1 deletion spec/namespaces/tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ components:
task:
$ref: '../schemas/tasks._common.yaml#/components/schemas/TaskInfo'
response:
type: object
$ref: '../schemas/tasks._common.yaml#/components/schemas/TaskResponse'
error:
$ref: '../schemas/_common.yaml#/components/schemas/ErrorCause'
required:
Expand Down
151 changes: 128 additions & 23 deletions spec/schemas/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1382,25 +1382,6 @@ components:
type: string
enum:
- auto
BulkIndexByScrollFailure:
type: object
properties:
cause:
$ref: '#/components/schemas/ErrorCause'
id:
$ref: '#/components/schemas/Id'
index:
$ref: '#/components/schemas/IndexName'
status:
type: number
type:
type: string
required:
- cause
- id
- index
- status
- type
Retries:
type: object
properties:
Expand Down Expand Up @@ -1927,6 +1908,8 @@ components:
- remote_cluster_client
- transform
- voting_only
x-deprecated-enums:
- master
HttpHeaders:
type: object
additionalProperties:
Expand Down Expand Up @@ -1957,11 +1940,7 @@ components:
transport_address:
$ref: '#/components/schemas/TransportAddress'
required:
- attributes
- host
- ip
- name
- transport_address
RankContainer:
type: object
properties:
Expand Down Expand Up @@ -2078,3 +2057,129 @@ components:
- expand
- fetch
- query
BulkByScrollTaskStatus:
type: object
properties:
slice_id:
type: integer
format: int32
total:
description: The number of documents that were successfully processed.
type: integer
format: int64
updated:
description: The number of documents that were successfully updated, for example, a document with same ID already existed prior to reindex updating it.
type: integer
format: int64
created:
description: The number of documents that were successfully created.
type: integer
format: int64
deleted:
description: The number of documents that were successfully deleted.
type: integer
format: int64
batches:
description: The number of scroll responses pulled back by the reindex.
type: integer
format: int32
version_conflicts:
description: The number of version conflicts that reindex hits.
type: integer
format: int64
noops:
description: The number of documents that were ignored.
type: integer
format: int64
retries:
$ref: '#/components/schemas/Retries'
throttled_millis:
$ref: '#/components/schemas/DurationValueUnitMillis'
throttled:
$ref: '#/components/schemas/Duration'
requests_per_second:
description: The number of requests per second effectively executed during the reindex.
type: number
format: float
canceled:
type: string
throttled_until_millis:
$ref: '#/components/schemas/DurationValueUnitMillis'
throttled_until:
$ref: '#/components/schemas/Duration'
slices:
type: array
items:
$ref: '#/components/schemas/BulkByScrollTaskStatusOrException'
required:
- batches
- deleted
- noops
- requests_per_second
- retries
- throttled_millis
- throttled_until_millis
- total
- version_conflicts
BulkByScrollTaskStatusOrException:
oneOf:
- title: status
$ref: '#/components/schemas/BulkByScrollTaskStatus'
- title: exception
$ref: '#/components/schemas/ErrorCause'
BulkByScrollResponseBase:
allOf:
- $ref: '#/components/schemas/BulkByScrollTaskStatus'
- type: object
properties:
took:
type: integer
format: int64
timed_out:
type: boolean
failures:
type: array
items:
$ref: '#/components/schemas/BulkByScrollFailure'
required:
- failures
- timed_out
- took
BulkByScrollFailure:
anyOf:
- $ref: '#/components/schemas/BulkItemResponseFailure'
- $ref: '#/components/schemas/ScrollableHitSourceSearchFailure'
BulkItemResponseFailure:
type: object
properties:
cause:
$ref: '#/components/schemas/ErrorCause'
id:
$ref: '#/components/schemas/Id'
index:
$ref: '#/components/schemas/IndexName'
status:
type: integer
format: int32
required:
- cause
- index
- status
ScrollableHitSourceSearchFailure:
type: object
properties:
index:
$ref: '#/components/schemas/IndexName'
shard:
type: integer
format: int32
node:
type: string
status:
type: integer
format: int32
reason:
$ref: '#/components/schemas/ErrorCause'
required:
- reason
- status
Loading

0 comments on commit 608065b

Please sign in to comment.