diff --git a/CHANGELOG.md b/CHANGELOG.md index d41a6df2..75190ad2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -81,6 +81,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Fixed response schema for `GET /_plugins/_security/api/nodesdn/{cluster_name}` ([#731](https://github.com/opensearch-project/opensearch-api-specification/pull/731)) - Fixed request body for `/_search/scroll/{scroll_id}` ([#732](https://github.com/opensearch-project/opensearch-api-specification/pull/732)) - Fixed type in `_msearch/template` ([#735](https://github.com/opensearch-project/opensearch-api-specification/pull/735)) +- Fixed indices API schemas ([#750](https://github.com/opensearch-project/opensearch-api-specification/pull/750)) ### Changed - Changed `tasks._common:TaskInfo` and `tasks._common:TaskGroup` to be composed of a `tasks._common:TaskInfoBase` ([#683](https://github.com/opensearch-project/opensearch-api-specification/pull/683)) diff --git a/spec/namespaces/indices.yaml b/spec/namespaces/indices.yaml index ab17e182..bdf1d34a 100644 --- a/spec/namespaces/indices.yaml +++ b/spec/namespaces/indices.yaml @@ -867,8 +867,6 @@ paths: - $ref: '#/components/parameters/indices.upgrade::query.ignore_unavailable' - $ref: '#/components/parameters/indices.upgrade::query.only_ancient_segments' - $ref: '#/components/parameters/indices.upgrade::query.wait_for_completion' - requestBody: - $ref: '#/components/requestBodies/indices.upgrade' responses: '200': $ref: '#/components/responses/indices.upgrade@200' @@ -1856,8 +1854,6 @@ paths: - $ref: '#/components/parameters/indices.upgrade::query.ignore_unavailable' - $ref: '#/components/parameters/indices.upgrade::query.only_ancient_segments' - $ref: '#/components/parameters/indices.upgrade::query.wait_for_completion' - requestBody: - $ref: '#/components/requestBodies/indices.upgrade' responses: '200': $ref: '#/components/responses/indices.upgrade@200' @@ -1969,8 +1965,7 @@ components: settings: description: Configuration options for the target index. type: object - additionalProperties: - type: object + additionalProperties: true description: The configuration for the target index (`settings` and `aliases`) indices.create: content: @@ -2179,8 +2174,7 @@ components: Configuration options for the index. Data streams do not support this parameter. type: object - additionalProperties: - type: object + additionalProperties: true description: The conditions that needs to be met for executing rollover indices.shrink: content: @@ -2198,8 +2192,7 @@ components: settings: description: Configuration options for the target index. type: object - additionalProperties: - type: object + additionalProperties: true description: The configuration for the target index (`settings` and `aliases`) indices.simulate_index_template: content: @@ -2273,11 +2266,6 @@ components: $ref: '../schemas/indices.update_aliases.yaml#/components/schemas/Action' description: The definition of `actions` to perform required: true - indices.upgrade: - content: - application/json: - schema: - $ref: '../schemas/indices._common.yaml#/components/schemas/UpgradeRequest' indices.validate_query: content: application/json: @@ -2292,20 +2280,19 @@ components: content: application/json: schema: - type: object - properties: - acknowledged: - type: boolean - shards_acknowledged: - type: boolean - indices: - type: array - items: - $ref: '../schemas/indices.add_block.yaml#/components/schemas/IndicesBlockStatus' - required: - - acknowledged - - indices - - shards_acknowledged + allOf: + - $ref: '../schemas/_common.yaml#/components/schemas/AcknowledgedResponseBase' + - type: object + properties: + shards_acknowledged: + type: boolean + indices: + type: array + items: + $ref: '../schemas/indices.add_block.yaml#/components/schemas/IndicesBlockStatus' + required: + - indices + - shards_acknowledged indices.analyze@200: content: application/json: @@ -2327,36 +2314,34 @@ components: content: application/json: schema: - type: object - properties: - acknowledged: - type: boolean - index: - $ref: '../schemas/_common.yaml#/components/schemas/IndexName' - shards_acknowledged: - type: boolean - required: - - acknowledged - - index - - shards_acknowledged + allOf: + - $ref: '../schemas/_common.yaml#/components/schemas/AcknowledgedResponseBase' + - type: object + properties: + shards_acknowledged: + type: boolean + index: + $ref: '../schemas/_common.yaml#/components/schemas/IndexName' + required: + - index + - shards_acknowledged indices.close@200: content: application/json: schema: - type: object - properties: - acknowledged: - type: boolean - indices: - type: object - additionalProperties: - $ref: '../schemas/indices.close.yaml#/components/schemas/CloseIndexResult' - shards_acknowledged: - type: boolean - required: - - acknowledged - - indices - - shards_acknowledged + allOf: + - $ref: '../schemas/_common.yaml#/components/schemas/AcknowledgedResponseBase' + - type: object + properties: + indices: + type: object + additionalProperties: + $ref: '../schemas/indices.close.yaml#/components/schemas/CloseIndexResult' + shards_acknowledged: + type: boolean + required: + - indices + - shards_acknowledged indices.create@200: content: application/json: @@ -2633,32 +2618,31 @@ components: content: application/json: schema: - type: object - properties: - acknowledged: - type: boolean - conditions: - type: object - additionalProperties: - type: boolean - dry_run: - type: boolean - new_index: - type: string - old_index: - type: string - rolled_over: - type: boolean - shards_acknowledged: - type: boolean - required: - - acknowledged - - conditions - - dry_run - - new_index - - old_index - - rolled_over - - shards_acknowledged + allOf: + - $ref: '../schemas/_common.yaml#/components/schemas/AcknowledgedResponseBase' + - type: object + properties: + conditions: + type: object + additionalProperties: + type: boolean + dry_run: + type: boolean + new_index: + type: string + old_index: + type: string + rolled_over: + type: boolean + shards_acknowledged: + type: boolean + required: + - conditions + - dry_run + - new_index + - old_index + - rolled_over + - shards_acknowledged indices.segments@200: content: application/json: @@ -2690,18 +2674,17 @@ components: content: application/json: schema: - type: object - properties: - acknowledged: - type: boolean - shards_acknowledged: - type: boolean - index: - $ref: '../schemas/_common.yaml#/components/schemas/IndexName' - required: - - acknowledged - - index - - shards_acknowledged + allOf: + - $ref: '../schemas/_common.yaml#/components/schemas/AcknowledgedResponseBase' + - type: object + properties: + shards_acknowledged: + type: boolean + index: + $ref: '../schemas/_common.yaml#/components/schemas/IndexName' + required: + - index + - shards_acknowledged indices.simulate_index_template@200: content: application/json: @@ -2725,18 +2708,17 @@ components: content: application/json: schema: - type: object - properties: - acknowledged: - type: boolean - shards_acknowledged: - type: boolean - index: - $ref: '../schemas/_common.yaml#/components/schemas/IndexName' - required: - - acknowledged - - index - - shards_acknowledged + allOf: + - $ref: '../schemas/_common.yaml#/components/schemas/AcknowledgedResponseBase' + - type: object + properties: + shards_acknowledged: + type: boolean + index: + $ref: '../schemas/_common.yaml#/components/schemas/IndexName' + required: + - index + - shards_acknowledged indices.stats@200: content: application/json: @@ -2763,7 +2745,14 @@ components: content: application/json: schema: - $ref: '../schemas/indices._common.yaml#/components/schemas/IndexPostUpgradeStatus' + allOf: + - $ref: '../schemas/_common.yaml#/components/schemas/ShardsOperationResponseBase' + - type: object + properties: + upgraded_indices: + type: object + additionalProperties: + $ref: '../schemas/indices._common.yaml#/components/schemas/UpgradeVersionStatus' indices.validate_query@200: content: application/json: @@ -3658,7 +3647,8 @@ components: Set this parameter to 1 to merge all segments into one segment. The default behavior is to perform the merge as necessary. schema: - type: number + type: integer + format: int64 style: form indices.forcemerge::query.only_expunge_deletes: in: query @@ -4802,10 +4792,10 @@ components: description: List of shard health statuses used to limit the request. schema: oneOf: - - $ref: '../schemas/indices.shard_stores.yaml#/components/schemas/Status' + - $ref: '../schemas/indices.shard_stores.yaml#/components/schemas/ShardStoreStatus' - type: array items: - $ref: '../schemas/indices.shard_stores.yaml#/components/schemas/Status' + $ref: '../schemas/indices.shard_stores.yaml#/components/schemas/ShardStoreStatus' style: form indices.shrink::path.index: in: path diff --git a/spec/schemas/_common.yaml b/spec/schemas/_common.yaml index f5ab3b89..eb84bd63 100644 --- a/spec/schemas/_common.yaml +++ b/spec/schemas/_common.yaml @@ -1060,20 +1060,23 @@ components: description: |- The total number of non-deleted documents across all primary shards assigned to the selected nodes. This number is based on documents in Lucene segments and may include documents from nested fields. - type: number + type: integer + format: int64 deleted: description: |- The total number of deleted documents across all primary shards assigned to the selected nodes. This number is based on the number of documents stored in Lucene segments. OpenSearch reclaims the disk space previously occupied by the deleted Lucene documents when a segment is merged. - type: number + type: integer + format: int64 required: - count FielddataStats: type: object properties: evictions: - type: number + type: integer + format: int64 memory_size: $ref: '#/components/schemas/HumanReadableByteCount' memory_size_in_bytes: @@ -1100,16 +1103,20 @@ components: description: |- The total number of entries added to the query cache across all shards assigned to the selected nodes. This number includes all current and evicted entries. - type: number + type: integer + format: int64 cache_size: description: The total number of entries currently stored in the query cache across all shards assigned to the selected nodes. - type: number + type: integer + format: int64 evictions: description: The total number of query cache evictions across all shards assigned to the selected nodes. - type: number + type: integer + format: int64 hit_count: description: The total number of query cache hits across all shards assigned to the selected nodes. - type: number + type: integer + format: int64 memory_size: $ref: '#/components/schemas/HumanReadableByteCount' memory_size_in_bytes: @@ -1117,10 +1124,12 @@ components: $ref: '#/components/schemas/ByteCount' miss_count: description: The total number of query cache misses across all shards assigned to the selected nodes. - type: number + type: integer + format: int64 total_count: description: The total number of hits and misses stored in the query cache across all shards assigned to the selected nodes. - type: number + type: integer + format: int64 required: - cache_count - cache_size @@ -1164,13 +1173,16 @@ components: properties: failed: description: The number of failed upload syncs to the remote translog store. - type: number + type: integer + format: int64 started: description: The number of upload syncs to the remote translog store that have started. - type: number + type: integer + format: int64 succeeded: description: The number of successful upload syncs to the remote translog store. - type: number + type: integer + format: int64 required: - failed - started @@ -1225,7 +1237,6 @@ components: $ref: '#/components/schemas/RemoteStoreUploadDownloadStats' required: - max_refresh_time_lag_in_millis - - pressure - refresh_size_lag - total_time_spent_in_millis - total_upload_size @@ -1261,7 +1272,8 @@ components: properties: total_rejections: description: The total number of requests rejected due to segment store upload backpressure. - type: number + type: integer + format: int64 required: - total_rejections RemoteStoreUploadRefreshSizeLagStats: @@ -1300,24 +1312,42 @@ components: - total_download_size - total_time_spent_in_millis SegmentReplicationStats: - type: object - properties: - max_bytes_behind: - $ref: '#/components/schemas/ByteCount' - max_replication_lag: - $ref: '#/components/schemas/ByteCount' - total_bytes_behind: - $ref: '#/components/schemas/ByteCount' - required: - - max_bytes_behind - - max_replication_lag - - total_bytes_behind + x-version-added: 2.10.0 + oneOf: + - x-version-added: 2.10.0 + x-version-removed: 2.12.0 + type: object + properties: + max_bytes_behind: + $ref: '#/components/schemas/HumanReadableByteCount' + max_replication_lag: + $ref: '#/components/schemas/Duration' + total_bytes_behind: + $ref: '#/components/schemas/HumanReadableByteCount' + required: + - max_bytes_behind + - max_replication_lag + - total_bytes_behind + - x-version-added: 2.12.0 + type: object + properties: + max_bytes_behind: + $ref: '#/components/schemas/ByteCount' + max_replication_lag: + $ref: '#/components/schemas/DurationValueUnitMillis' + total_bytes_behind: + $ref: '#/components/schemas/ByteCount' + required: + - max_bytes_behind + - max_replication_lag + - total_bytes_behind SegmentsStats: type: object properties: count: description: The total number of segments across all shards assigned to the selected nodes. - type: number + type: integer + format: int32 doc_values_memory: $ref: '#/components/schemas/HumanReadableByteCount' doc_values_memory_in_bytes: @@ -1344,7 +1374,7 @@ components: $ref: '#/components/schemas/ByteCount' max_unsafe_auto_id_timestamp: description: The Unix timestamp, in milliseconds, of the most recently retried indexing request. - type: number + $ref: '#/components/schemas/EpochTimeUnitMillis' memory: description: The total amount of memory used for segments across all shards assigned to the selected nodes. $ref: '#/components/schemas/HumanReadableByteCount' @@ -1390,6 +1420,7 @@ components: remote_store: $ref: '#/components/schemas/RemoteStoreStats' segment_replication: + x-version-added: 2.10.0 $ref: '#/components/schemas/SegmentReplicationStats' required: - count @@ -1634,9 +1665,11 @@ components: type: object properties: periodic: - type: number + type: integer + format: int64 total: - type: number + type: integer + format: int64 total_time: $ref: '#/components/schemas/Duration' total_time_in_millis: @@ -1649,25 +1682,29 @@ components: type: object properties: total: - type: number + type: integer + format: int64 getTime: $ref: '#/components/schemas/Duration' time_in_millis: $ref: '#/components/schemas/DurationValueUnitMillis' exists_total: - type: number + type: integer + format: int64 exists_time: $ref: '#/components/schemas/Duration' exists_time_in_millis: $ref: '#/components/schemas/DurationValueUnitMillis' missing_total: - type: number + type: integer + format: int64 missing_time: $ref: '#/components/schemas/Duration' missing_time_in_millis: $ref: '#/components/schemas/DurationValueUnitMillis' current: - type: number + type: integer + format: int64 required: - current - exists_time_in_millis @@ -1680,25 +1717,31 @@ components: type: object properties: index_total: - type: number + type: integer + format: int64 index_time: $ref: '#/components/schemas/Duration' index_time_in_millis: $ref: '#/components/schemas/DurationValueUnitMillis' index_current: - type: number + type: integer + format: int64 index_failed: - type: number + type: integer + format: int64 delete_total: - type: number + type: integer + format: int64 delete_time: $ref: '#/components/schemas/Duration' delete_time_in_millis: $ref: '#/components/schemas/DurationValueUnitMillis' delete_current: - type: number + type: integer + format: int64 noop_update_total: - type: number + type: integer + format: int64 is_throttled: type: boolean throttle_time: @@ -1727,21 +1770,25 @@ components: type: object properties: current: - type: number + type: integer + format: int64 current_docs: - type: number + type: integer + format: int64 current_size: $ref: '#/components/schemas/HumanReadableByteCount' current_size_in_bytes: $ref: '#/components/schemas/ByteCount' total: - type: number + type: integer + format: int64 total_auto_throttle: $ref: '#/components/schemas/HumanReadableByteCount' total_auto_throttle_in_bytes: $ref: '#/components/schemas/ByteCount' total_docs: - type: number + type: integer + format: int64 total_size: $ref: '#/components/schemas/HumanReadableByteCount' total_size_in_bytes: @@ -1759,7 +1806,8 @@ components: total_time_in_millis: $ref: '#/components/schemas/DurationValueUnitMillis' unreferenced_file_cleanups_performed: - type: number + type: integer + format: int64 required: - current - current_docs @@ -1775,9 +1823,11 @@ components: type: object properties: current_as_source: - type: number + type: integer + format: int64 current_as_target: - type: number + type: integer + format: int64 throttle_time: $ref: '#/components/schemas/Duration' throttle_time_in_millis: @@ -1790,15 +1840,18 @@ components: type: object properties: external_total: - type: number + type: integer + format: int64 external_total_time: $ref: '#/components/schemas/Duration' external_total_time_in_millis: $ref: '#/components/schemas/DurationValueUnitMillis' listeners: - type: number + type: integer + format: int64 total: - type: number + type: integer + format: int64 total_time: $ref: '#/components/schemas/Duration' total_time_in_millis: @@ -1813,15 +1866,18 @@ components: type: object properties: evictions: - type: number + type: integer + format: int64 hit_count: - type: number + type: integer + format: int64 memory_size: $ref: '#/components/schemas/HumanReadableByteCount' memory_size_in_bytes: $ref: '#/components/schemas/ByteCount' miss_count: - type: number + type: integer + format: int64 required: - evictions - hit_count @@ -1831,11 +1887,13 @@ components: type: object properties: open_contexts: - description: The number of open search contexts. - type: number + description: The number of open search contexts. + type: integer + format: int64 query_current: - description: The number of currently running shard query operations. - type: number + description: The number of currently running shard query operations. + type: integer + format: int64 query_time: description: The total amount of time taken to complete all shard query operations. $ref: '#/components/schemas/Duration' @@ -1844,10 +1902,12 @@ components: $ref: '#/components/schemas/DurationValueUnitMillis' query_total: description: The total number of shard query operations. - type: number + type: integer + format: int64 concurrent_query_total: - description: The total number of query operations using concurrent segment search. - type: number + description: The total number of query operations using concurrent segment search. + type: integer + format: int64 concurrent_query_time: $ref: '#/components/schemas/Duration' concurrent_query_time_in_millis: @@ -1855,13 +1915,16 @@ components: $ref: '#/components/schemas/DurationValueUnitMillis' concurrent_query_current: description: The number of currently running query operations using concurrent segment search. - type: number + type: integer + format: int64 concurrent_avg_slice_count: description: The average slice count of all search requests. This is computed as the total slice count divided by the total number of concurrent search requests. - type: number + type: integer + format: int64 fetch_current: - description: The number of currently running shard fetch operations. - type: number + description: The number of currently running shard fetch operations. + type: integer + format: int64 fetch_time: description: The total amount of time taken to complete all shard fetch operations. $ref: '#/components/schemas/Duration' @@ -1870,10 +1933,12 @@ components: $ref: '#/components/schemas/DurationValueUnitMillis' fetch_total: description: The total number of shard fetch operations. - type: number + type: integer + format: int64 scroll_current: description: The number of shard scroll operations that are currently running. - type: number + type: integer + format: int64 scroll_time: description: The total amount of time taken to complete all shard scroll operations. $ref: '#/components/schemas/Duration' @@ -1882,21 +1947,25 @@ components: $ref: '#/components/schemas/DurationValueUnitMillis' scroll_total: description: The total number of shard scroll operations. - type: number + type: integer + format: int64 point_in_time_total: - description: The total number of shard Point in Time (PIT) contexts created (completed and active) since the node last restarted. - type: number + description: The total number of shard Point in Time (PIT) contexts created (completed and active) since the node last restarted. + type: integer + format: int64 point_in_time_time: $ref: '#/components/schemas/Duration' point_in_time_time_in_millis: description: The amount of time that shard PIT contexts have been held open since the node last restarted, in milliseconds. $ref: '#/components/schemas/DurationValueUnitMillis' point_in_time_current: - description: The number of currently open shard PIT contexts. - type: number + description: The number of currently open shard PIT contexts. + type: integer + format: int64 suggest_current: - description: The number of currently running shard suggest operations. - type: number + description: The number of currently running shard suggest operations. + type: integer + format: int64 suggest_time: description: The total amount of time take to complete all shard suggest operations. $ref: '#/components/schemas/Duration' @@ -1904,10 +1973,12 @@ components: description: The total amount of time taken to complete all shard suggest operations, in milliseconds. $ref: '#/components/schemas/DurationValueUnitMillis' suggest_total: - description: The total number of shard suggest operations. - type: number + description: The total number of shard suggest operations. + type: integer + format: int64 search_idle_reactivate_count_total: - type: number + type: integer + format: int64 request: type: object description: Statistics related to coordinator search operations for the node. @@ -1934,9 +2005,11 @@ components: type: object properties: earliest_last_modified_age: - type: number + type: integer + format: int64 operations: - type: number + type: integer + format: int32 remote_store: $ref: '#/components/schemas/RemoteStoreTranslogStats' size: @@ -1944,7 +2017,8 @@ components: size_in_bytes: $ref: '#/components/schemas/ByteCount' uncommitted_operations: - type: number + type: integer + format: int32 uncommitted_size: $ref: '#/components/schemas/HumanReadableByteCount' uncommitted_size_in_bytes: @@ -1963,16 +2037,20 @@ components: time_in_millis: $ref: '#/components/schemas/DurationValueUnitMillis' current: - type: number + type: integer + format: int64 total: - type: number + type: integer + format: int64 WarmerStats: type: object properties: current: - type: number + type: integer + format: int64 total: - type: number + type: integer + format: int64 total_time: $ref: '#/components/schemas/Duration' total_time_in_millis: diff --git a/spec/schemas/indices._common.yaml b/spec/schemas/indices._common.yaml index bfe24843..0b5ad7c3 100644 --- a/spec/schemas/indices._common.yaml +++ b/spec/schemas/indices._common.yaml @@ -1167,15 +1167,6 @@ components: $ref: '_common.yaml#/components/schemas/ByteCount' size_to_upgrade_ancient_in_bytes: $ref: '_common.yaml#/components/schemas/ByteCount' - IndexPostUpgradeStatus: - type: object - properties: - _shards: - $ref: '_common.yaml#/components/schemas/ShardStatistics' - upgraded_indices: - type: object - additionalProperties: - $ref: '#/components/schemas/UpgradeVersionStatus' UpgradeVersionStatus: type: object properties: @@ -1183,22 +1174,6 @@ components: $ref: '_common.yaml#/components/schemas/VersionString' oldest_lucene_segment_version: $ref: '_common.yaml#/components/schemas/VersionString' - UpgradeRequest: - type: object - properties: - allow_no_indices: - type: boolean - expand_wildcards: - type: string - enum: - - all - - closed - - none - - open - ignore_unavailable: - type: boolean - wait_for_completion: - type: boolean IndexError: type: object properties: diff --git a/spec/schemas/indices.analyze.yaml b/spec/schemas/indices.analyze.yaml index fb9b0d49..ffe9e108 100644 --- a/spec/schemas/indices.analyze.yaml +++ b/spec/schemas/indices.analyze.yaml @@ -49,17 +49,22 @@ components: bytes: type: string end_offset: - type: number + type: integer + format: int32 keyword: type: boolean position: - type: number + type: integer + format: int32 positionLength: - type: number + type: integer + format: int32 start_offset: - type: number + type: integer + format: int32 termFrequency: - type: number + type: integer + format: int32 token: type: string type: @@ -101,13 +106,17 @@ components: type: object properties: end_offset: - type: number + type: integer + format: int32 position: - type: number + type: integer + format: int32 positionLength: - type: number + type: integer + format: int32 start_offset: - type: number + type: integer + format: int32 token: type: string type: diff --git a/spec/schemas/indices.recovery.yaml b/spec/schemas/indices.recovery.yaml index bda47b36..1e09c8dc 100644 --- a/spec/schemas/indices.recovery.yaml +++ b/spec/schemas/indices.recovery.yaml @@ -19,7 +19,8 @@ components: type: object properties: id: - type: number + type: integer + format: int32 index: $ref: '#/components/schemas/RecoveryIndexStatus' primary: @@ -125,11 +126,14 @@ components: percent: $ref: '_common.yaml#/components/schemas/PercentageString' recovered: - type: number + type: integer + format: int64 reused: - type: number + type: integer + format: int64 total: - type: number + type: integer + format: int64 required: - percent - recovered @@ -139,11 +143,13 @@ components: type: object properties: length: - type: number + type: integer + format: int64 name: type: string recovered: - type: number + type: integer + format: int64 required: - length - name @@ -203,11 +209,14 @@ components: percent: $ref: '_common.yaml#/components/schemas/PercentageString' recovered: - type: number + type: integer + format: int32 total: - type: number + type: integer + format: int32 total_on_start: - type: number + type: integer + format: int32 total_time: $ref: '_common.yaml#/components/schemas/Duration' total_time_in_millis: diff --git a/spec/schemas/indices.rollover.yaml b/spec/schemas/indices.rollover.yaml index 29158a35..455b688d 100644 --- a/spec/schemas/indices.rollover.yaml +++ b/spec/schemas/indices.rollover.yaml @@ -16,9 +16,11 @@ components: max_age_millis: $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' min_docs: - type: number + type: integer + format: int64 max_docs: - type: number + type: integer + format: int64 max_size: $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' max_size_bytes: @@ -36,6 +38,8 @@ components: min_primary_shard_size_bytes: $ref: '_common.yaml#/components/schemas/ByteCount' max_primary_shard_docs: - type: number + type: integer + format: int64 min_primary_shard_docs: - type: number + type: integer + format: int64 diff --git a/spec/schemas/indices.segments.yaml b/spec/schemas/indices.segments.yaml index e2e8230b..b86a63a9 100644 --- a/spec/schemas/indices.segments.yaml +++ b/spec/schemas/indices.segments.yaml @@ -23,11 +23,13 @@ components: type: object properties: num_committed_segments: - type: number + type: integer + format: int32 routing: $ref: '#/components/schemas/ShardSegmentRouting' num_search_segments: - type: number + type: integer + format: int32 segments: type: object additionalProperties: diff --git a/spec/schemas/indices.shard_stores.yaml b/spec/schemas/indices.shard_stores.yaml index 9b76b902..b8411f90 100644 --- a/spec/schemas/indices.shard_stores.yaml +++ b/spec/schemas/indices.shard_stores.yaml @@ -6,13 +6,20 @@ info: paths: {} components: schemas: - Status: - type: string - enum: - - all - - green - - red - - yellow + ShardStoreStatus: + oneOf: + - type: string + const: all + description: Return all shards, regardless of health status. + - type: string + const: green + description: The primary shard and all replica shards are assigned. + - type: string + const: red + description: The primary shard is unassigned. + - type: string + const: yellow + description: One or more replica shards are unassigned. IndicesShardStores: type: object properties: @@ -41,6 +48,7 @@ components: store_exception: $ref: '#/components/schemas/ShardStoreException' additionalProperties: + title: nodes $ref: '_common.yaml#/components/schemas/NodeAttributes' required: - allocation diff --git a/spec/schemas/indices.stats.yaml b/spec/schemas/indices.stats.yaml index 367ce207..02abf2b1 100644 --- a/spec/schemas/indices.stats.yaml +++ b/spec/schemas/indices.stats.yaml @@ -22,7 +22,8 @@ components: average_size_in_bytes: $ref: '_common.yaml#/components/schemas/ByteCount' count: - type: number + type: integer + format: int64 required: - description - size_in_bytes @@ -134,11 +135,13 @@ components: type: object properties: generation: - type: number + type: integer + format: int32 id: $ref: '_common.yaml#/components/schemas/Id' num_docs: - type: number + type: integer + format: int64 user_data: type: object additionalProperties: @@ -165,7 +168,8 @@ components: type: object properties: primary_term: - type: number + type: integer + format: int64 version: $ref: '_common.yaml#/components/schemas/VersionNumber' leases: @@ -184,7 +188,8 @@ components: retaining_seq_no: $ref: '_common.yaml#/components/schemas/SequenceNumber' timestamp: - type: number + type: integer + format: int64 source: type: string required: @@ -218,9 +223,11 @@ components: type: object properties: global_checkpoint: - type: number + type: integer + format: int64 local_checkpoint: - type: number + type: integer + format: int64 max_seq_no: $ref: '_common.yaml#/components/schemas/SequenceNumber' required: diff --git a/tests/default/_core/upgrade.yaml b/tests/default/_core/upgrade.yaml index 9075e1a6..27c8269f 100644 --- a/tests/default/_core/upgrade.yaml +++ b/tests/default/_core/upgrade.yaml @@ -1,15 +1,30 @@ $schema: ../../../json_schemas/test_story.schema.yaml description: Test upgrading indices using both GET and POST methods. +epilogues: + - path: /movies + method: DELETE + status: [200, 404] +prologues: + - path: /_bulk + method: POST + parameters: + refresh: true + request: + content_type: application/x-ndjson + payload: + - {create: {_index: movies, _id: movie1}} + - {director: Bennett Miller, title: The Cruise, year: 1998} + - {create: {_index: movies, _id: movie2}} + - {director: Nicolas Winding Refn, title: Drive, year: 1960} chapters: - synopsis: Trigger upgrade (POST). path: /_upgrade method: POST - request: - payload: - allow_no_indices: false - expand_wildcards: closed - ignore_unavailable: false + parameters: + allow_no_indices: false + expand_wildcards: open + ignore_unavailable: false response: status: 200 diff --git a/tests/default/indices/upgrade.yaml b/tests/default/indices/upgrade.yaml index 46d81bb0..f21c3984 100644 --- a/tests/default/indices/upgrade.yaml +++ b/tests/default/indices/upgrade.yaml @@ -23,11 +23,9 @@ chapters: method: POST parameters: index: [movies] - request: - payload: - allow_no_indices: true - expand_wildcards: open - ignore_unavailable: true + allow_no_indices: true + expand_wildcards: open + ignore_unavailable: true response: status: 200