diff --git a/CHANGELOG.md b/CHANGELOG.md index 99dbae057..cd9b356bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,7 +41,9 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added 404 response to `/_search/scroll` ([#749](https://github.com/opensearch-project/opensearch-api-specification/pull/749)) - Added `node_failures` to `DELETE /_search/scroll` and `DELETE /_search/scroll/{scroll_id}` ([#749](https://github.com/opensearch-project/opensearch-api-specification/pull/749)) - Added `POST /_plugins/_ml/_train/{algorithm_name}`, `_predict/{algorithm_name}/{model_id}`, and `_train_predict/{algorithm_name}` ([#755](https://github.com/opensearch-project/opensearch-api-specification/pull/755)) -- Added the ability to skip an individual chapter test ([#x](https://github.com/opensearch-project/opensearch-api-specification/pull/x)) +- Added `PUT /_plugins/_ml/model_groups/{model_group_id}`, `GET /_plugins/_ml/model_groups/_search`, and `POST /_plugins/_ml/model_groups/_search` ([#760](https://github.com/opensearch-project/opensearch-api-specification/pull/760)) +- Added `GET /_plugins/_ml/connectors/{connector_id}`, `_search`, `POST /_plugins/_ml/connectors/_search`, and `PUT /_plugins/_ml/connectors/{connector_id}` ([#764](https://github.com/opensearch-project/opensearch-api-specification/pull/764)) +- Added the ability to skip an individual chapter test ([#765](https://github.com/opensearch-project/opensearch-api-specification/pull/765)) ### Removed - Removed unsupported `_common.mapping:SourceField`'s `mode` field and associated `_common.mapping:SourceFieldMode` enum ([#652](https://github.com/opensearch-project/opensearch-api-specification/pull/652)) @@ -86,6 +88,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Fixed indices API schemas ([#750](https://github.com/opensearch-project/opensearch-api-specification/pull/750)) - Fixed cluster API schemas ([#754](https://github.com/opensearch-project/opensearch-api-specification/pull/754)) - Fixed schema validation for invalid properties in `retry` configuration ([#758](https://github.com/opensearch-project/opensearch-api-specification/pull/758)) +- Fixed nodes API schemas ([#761](https://github.com/opensearch-project/opensearch-api-specification/pull/761)) ### 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/_global_parameters.yaml b/spec/_global_parameters.yaml index 160d1d241..dbb6cff1f 100644 --- a/spec/_global_parameters.yaml +++ b/spec/_global_parameters.yaml @@ -36,8 +36,4 @@ components: in: query description: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". schema: - oneOf: - - type: string - - type: array - items: - type: string + $ref: 'schemas/_common.yaml#/components/schemas/StringOrStringArray' diff --git a/spec/namespaces/_core.yaml b/spec/namespaces/_core.yaml index e97de368d..74f9f27ac 100644 --- a/spec/namespaces/_core.yaml +++ b/spec/namespaces/_core.yaml @@ -5755,11 +5755,7 @@ components: name: sort description: A comma-separated list of : pairs. schema: - oneOf: - - type: string - - type: array - items: - type: string + $ref: '../schemas/_common.yaml#/components/schemas/StringOrStringArray' style: form search::query.stats: in: query diff --git a/spec/namespaces/indices.yaml b/spec/namespaces/indices.yaml index bdf1d34ae..2ccebc4fb 100644 --- a/spec/namespaces/indices.yaml +++ b/spec/namespaces/indices.yaml @@ -2128,11 +2128,7 @@ components: description: |- Array of wildcard expressions used to match the names of indexes during creation. - oneOf: - - type: string - - type: array - items: - type: string + $ref: '../schemas/_common.yaml#/components/schemas/StringOrStringArray' mappings: $ref: '../schemas/_common.mapping.yaml#/components/schemas/TypeMapping' order: @@ -5083,11 +5079,7 @@ components: name: groups description: Comma-separated list of search groups to include in the search statistics. schema: - oneOf: - - type: string - - type: array - items: - type: string + $ref: '../schemas/_common.yaml#/components/schemas/StringOrStringArray' style: form indices.stats::query.include_segment_file_sizes: in: query diff --git a/spec/namespaces/ml.yaml b/spec/namespaces/ml.yaml index 25ec908b2..d9166bfed 100644 --- a/spec/namespaces/ml.yaml +++ b/spec/namespaces/ml.yaml @@ -24,6 +24,18 @@ paths: responses: '200': $ref: '#/components/responses/ml.get_model_group@200' + put: + operationId: ml.update_model_group.0 + x-operation-group: ml.update_model_group + x-version-added: '2.9' + description: Updates a model group. + parameters: + - $ref: '#/components/parameters/ml.update_model_group::path.model_group_id' + requestBody: + $ref: '#/components/requestBodies/ml.update_model_group' + responses: + '200': + $ref: '#/components/responses/ml.update_model_group@200' delete: operationId: ml.delete_model_group.0 x-operation-group: ml.delete_model_group @@ -33,6 +45,27 @@ paths: responses: '200': $ref: '#/components/responses/ml.delete_model_group@200' + /_plugins/_ml/model_groups/_search: + get: + operationId: ml.search_model_group.0 + x-operation-group: ml.search_model_group + x-version-added: '2.9' + description: Searches for model groups. + requestBody: + $ref: '#/components/requestBodies/ml.search_model_group' + responses: + '200': + $ref: '#/components/responses/ml.search_model_group@200' + post: + operationId: ml.search_model_group.1 + x-operation-group: ml.search_model_group + x-version-added: '2.9' + description: Searches for model groups. + requestBody: + $ref: '#/components/requestBodies/ml.search_model_group' + responses: + '200': + $ref: '#/components/responses/ml.search_model_group@200' /_plugins/_ml/models/_register: post: operationId: ml.register_model.0 @@ -150,6 +183,28 @@ paths: '200': $ref: '#/components/responses/ml.create_connector@200' /_plugins/_ml/connectors/{connector_id}: + get: + operationId: ml.get_connector.0 + x-operation-group: ml.get_connector + x-version-added: '2.11' + description: Retrieves a standalone connector. + parameters: + - $ref: '#/components/parameters/ml.get_connector::path.connector_id' + responses: + '200': + $ref: '#/components/responses/ml.get_connector@200' + put: + operationId: ml.update_connector.0 + x-operation-group: ml.update_connector + x-version-added: '2.12' + description: Updates a standalone connector. + parameters: + - $ref: '#/components/parameters/ml.update_connector::path.connector_id' + requestBody: + $ref: '#/components/requestBodies/ml.update_connector' + responses: + '200': + $ref: '#/components/responses/ml.update_connector@200' delete: operationId: ml.delete_connector.0 x-operation-group: ml.delete_connector @@ -159,6 +214,27 @@ paths: responses: '200': $ref: '#/components/responses/ml.delete_connector@200' + /_plugins/_ml/connectors/_search: + get: + operationId: ml.search_connectors.0 + x-operation-group: ml.search_connectors + x-version-added: '2.11' + description: Searches for standalone connectors. + requestBody: + $ref: '#/components/requestBodies/ml.search_connectors' + responses: + '200': + $ref: '#/components/responses/ml.search_connectors@200' + post: + operationId: ml.search_connectors.1 + x-operation-group: ml.search_connectors + x-version-added: '2.11' + description: Searches for standalone connectors. + requestBody: + $ref: '#/components/requestBodies/ml.search_connectors' + responses: + '200': + $ref: '#/components/responses/ml.search_connectors@200' /_plugins/_ml/agents/_register: post: operationId: ml.register_agents.0 @@ -207,6 +283,51 @@ components: description: The add all backend roles. required: - name + ml.update_model_group: + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: The model group name. + description: + type: string + description: The model group description. + add_all_backend_roles: + type: boolean + description: Whether to include all backend roles. + model_access_name: + type: string + description: The model access name + backend_roles: + type: array + items: + type: string + description: The backend roles. + add_backend_roles: + type: array + items: + type: string + description: The backend roles to add. + ml.search_model_group: + content: + application/json: + schema: + type: object + properties: + query: + $ref: '../schemas/ml._common.yaml#/components/schemas/Query' + size: + type: integer + format: int64 + description: The number of model groups to return. + sort: + type: array + items: + $ref: '../schemas/ml._common.yaml#/components/schemas/Sort' + description: The sort order. ml.register_model: content: application/json: @@ -241,14 +362,16 @@ components: properties: query: type: object - # TODO: Define the query schema - description: The query. + $ref: '../schemas/ml._common.yaml#/components/schemas/Query' size: type: integer + format: int64 description: The number of models to return. - required: - - query - - size + sort: + type: array + items: + $ref: '../schemas/ml._common.yaml#/components/schemas/Sort' + description: The sort order. ml.predict: content: application/json: @@ -321,6 +444,9 @@ components: type: integer protocol: type: string + enum: + - aws_sigv4 + - http credential: $ref: '../schemas/ml._common.yaml#/components/schemas/Credential' parameters: @@ -339,6 +465,61 @@ components: - parameters - protocol - version + ml.update_connector: + content: + application/json: + schema: + type: object + properties: + name: + $ref: '../schemas/_common.yaml#/components/schemas/Name' + description: + type: string + description: The connector description. + version: + $ref: '../schemas/_common.yaml#/components/schemas/VersionNumber' + protocol: + type: string + description: The connector protocol. + enum: + - aws_sigv4 + - http + parameters: + $ref: '../schemas/ml._common.yaml#/components/schemas/Parameters' + credential: + $ref: '../schemas/ml._common.yaml#/components/schemas/Credential' + actions: + type: array + items: + $ref: '../schemas/ml._common.yaml#/components/schemas/Action' + backend_roles: + type: array + items: + type: string + description: The backend roles. + access_mode: + type: string + description: The model group access mode. + enum: [private, public, restricted] + parameters.skip_validating_missing_parameters: + type: boolean + description: Whether to skip validating missing parameters. + ml.search_connectors: + content: + application/json: + schema: + type: object + properties: + query: + $ref: '../schemas/ml._common.yaml#/components/schemas/Query' + size: + type: integer + description: The number of connectors to return. + sort: + type: array + items: + type: string + description: The sort order. ml.register_agents: content: application/json: @@ -377,6 +558,16 @@ components: application/json: schema: $ref: '../schemas/ml._common.yaml#/components/schemas/ModelGroup' + ml.update_model_group@200: + content: + application/json: + schema: + $ref: '../schemas/ml._common.yaml#/components/schemas/UpdateModelGroupResponse' + ml.search_model_group@200: + content: + application/json: + schema: + $ref: '../schemas/ml._common.yaml#/components/schemas/SearchModelGroupsResponse' ml.delete_model_group@200: content: application/json: @@ -458,11 +649,26 @@ components: properties: connector_id: type: string + ml.get_connector@200: + content: + application/json: + schema: + $ref: '../schemas/ml._common.yaml#/components/schemas/GetConnectorResponse' + ml.update_connector@200: + content: + application/json: + schema: + $ref: '../schemas/_common.yaml#/components/schemas/WriteResponseBase' ml.delete_connector@200: content: application/json: schema: $ref: '../schemas/_common.yaml#/components/schemas/WriteResponseBase' + ml.search_connectors@200: + content: + application/json: + schema: + $ref: '../schemas/ml._common.yaml#/components/schemas/SearchConnectorsResponse' ml.register_agents@200: content: application/json: @@ -483,6 +689,12 @@ components: required: true schema: type: string + ml.update_model_group::path.model_group_id: + name: model_group_id + in: path + required: true + schema: + type: string ml.delete_model_group::path.model_group_id: name: model_group_id in: path @@ -537,6 +749,18 @@ components: required: true schema: type: string + ml.get_connector::path.connector_id: + name: connector_id + in: path + required: true + schema: + type: string + ml.update_connector::path.connector_id: + name: connector_id + in: path + required: true + schema: + type: string ml.delete_connector::path.connector_id: name: connector_id in: path diff --git a/spec/namespaces/nodes.yaml b/spec/namespaces/nodes.yaml index 31fec73a0..71f6b6754 100644 --- a/spec/namespaces/nodes.yaml +++ b/spec/namespaces/nodes.yaml @@ -366,22 +366,69 @@ components: content: application/json: schema: - $ref: '../schemas/nodes.info.yaml#/components/schemas/ResponseBase' + allOf: + - $ref: '../schemas/nodes._common.yaml#/components/schemas/NodesResponseBase' + - type: object + properties: + cluster_name: + $ref: '../schemas/_common.yaml#/components/schemas/Name' + nodes: + type: object + additionalProperties: + $ref: '../schemas/nodes.info.yaml#/components/schemas/NodeInfo' + required: + - cluster_name + - nodes nodes.reload_secure_settings@200: content: application/json: schema: - $ref: '../schemas/nodes.reload_secure_settings.yaml#/components/schemas/ResponseBase' + allOf: + - $ref: '../schemas/nodes._common.yaml#/components/schemas/NodesResponseBase' + - type: object + properties: + cluster_name: + $ref: '../schemas/_common.yaml#/components/schemas/Name' + nodes: + type: object + additionalProperties: + $ref: '../schemas/nodes.reload_secure_settings.yaml#/components/schemas/NodeReloadResult' + required: + - cluster_name + - nodes nodes.stats@200: content: application/json: schema: - $ref: '../schemas/nodes.stats.yaml#/components/schemas/ResponseBase' + allOf: + - $ref: '../schemas/nodes._common.yaml#/components/schemas/NodesResponseBase' + - type: object + properties: + cluster_name: + $ref: '../schemas/_common.yaml#/components/schemas/Name' + nodes: + type: object + additionalProperties: + $ref: '../schemas/nodes.stats.yaml#/components/schemas/Stats' + required: + - nodes nodes.usage@200: content: application/json: schema: - $ref: '../schemas/nodes.usage.yaml#/components/schemas/ResponseBase' + allOf: + - $ref: '../schemas/nodes._common.yaml#/components/schemas/NodesResponseBase' + - type: object + properties: + cluster_name: + $ref: '../schemas/_common.yaml#/components/schemas/Name' + nodes: + type: object + additionalProperties: + $ref: '../schemas/nodes.usage.yaml#/components/schemas/NodeUsage' + required: + - cluster_name + - nodes parameters: nodes.hot_threads::path.node_id: name: node_id diff --git a/spec/namespaces/tasks.yaml b/spec/namespaces/tasks.yaml index a0409b8a6..c4c5a8f26 100644 --- a/spec/namespaces/tasks.yaml +++ b/spec/namespaces/tasks.yaml @@ -115,11 +115,7 @@ components: name: actions description: Comma-separated list or wildcard expression of actions used to limit the request. schema: - oneOf: - - type: string - - type: array - items: - type: string + $ref: '../schemas/_common.yaml#/components/schemas/StringOrStringArray' style: form tasks.cancel::query.nodes: in: query @@ -175,11 +171,7 @@ components: name: actions description: Comma-separated list or wildcard expression of actions used to limit the request. schema: - oneOf: - - type: string - - type: array - items: - type: string + $ref: '../schemas/_common.yaml#/components/schemas/StringOrStringArray' style: form tasks.list::query.detailed: in: query diff --git a/spec/schemas/_common.analysis.yaml b/spec/schemas/_common.analysis.yaml index dfa6e9a6d..73b2ec4b8 100644 --- a/spec/schemas/_common.analysis.yaml +++ b/spec/schemas/_common.analysis.yaml @@ -81,11 +81,7 @@ components: Language value, such as `arabic` or `thai`. Defaults to `english`. Each language value corresponds to a predefined list of stop words in Lucene. See Stop words by language for supported language values and their stop words. Also accepts an array of stop words. - oneOf: - - type: string - - type: array - items: - type: string + $ref: '_common.yaml#/components/schemas/StringOrStringArray' KeywordAnalyzer: type: object properties: diff --git a/spec/schemas/_common.yaml b/spec/schemas/_common.yaml index eb84bd635..aa18d7757 100644 --- a/spec/schemas/_common.yaml +++ b/spec/schemas/_common.yaml @@ -385,16 +385,19 @@ components: description: Time unit for nanoseconds. type: integer format: int64 + DurationValueUnitMicros: + allOf: + - $ref: '#/components/schemas/UnitMicros' + UnitMicros: + description: Time unit for microseconds. + type: integer + format: int64 ScrollId: type: string Routing: type: string RoutingInQueryString: - oneOf: - - type: string - - type: array - items: - type: string + $ref: '#/components/schemas/StringOrStringArray' DateTime: description: |- A date and time, either as a string whose format depends on the context (defaulting to ISO_8601) or the @@ -925,6 +928,12 @@ components: $ref: '#/components/schemas/ScrollId' TransportAddress: type: string + StringOrStringArray: + oneOf: + - type: string + - type: array + items: + type: string StringifiedInteger: description: |- Certain APIs may return values, including numbers such as epoch timestamps, as strings. This setting captures @@ -2143,11 +2152,7 @@ components: HttpHeaders: type: object additionalProperties: - oneOf: - - type: string - - type: array - items: - type: string + $ref: '#/components/schemas/StringOrStringArray' Password: type: string Username: diff --git a/spec/schemas/indices._common.yaml b/spec/schemas/indices._common.yaml index 0b5ad7c36..e9f9db55b 100644 --- a/spec/schemas/indices._common.yaml +++ b/spec/schemas/indices._common.yaml @@ -15,11 +15,7 @@ components: mode: type: string routing_path: - oneOf: - - type: string - - type: array - items: - type: string + $ref: '_common.yaml#/components/schemas/StringOrStringArray' soft_deletes: $ref: '#/components/schemas/SoftDeletes' soft_deletes.retention_lease.period: diff --git a/spec/schemas/indices.analyze.yaml b/spec/schemas/indices.analyze.yaml index ffe9e108e..c6a791d2e 100644 --- a/spec/schemas/indices.analyze.yaml +++ b/spec/schemas/indices.analyze.yaml @@ -7,11 +7,7 @@ paths: {} components: schemas: TextToAnalyze: - oneOf: - - type: string - - type: array - items: - type: string + $ref: '_common.yaml#/components/schemas/StringOrStringArray' AnalyzeDetail: type: object properties: diff --git a/spec/schemas/indices.stats.yaml b/spec/schemas/indices.stats.yaml index 02abf2b1f..0b7cc962b 100644 --- a/spec/schemas/indices.stats.yaml +++ b/spec/schemas/indices.stats.yaml @@ -95,7 +95,7 @@ components: allOf: - $ref: '#/components/schemas/IndexStatsBase' - type: object - IndexShardStats: + IndexShardStatsBase: allOf: - $ref: '#/components/schemas/IndexStatsBase' - type: object @@ -110,6 +110,11 @@ components: $ref: '#/components/schemas/ShardRetentionLeases' shard_path: $ref: '#/components/schemas/ShardPath' + IndexShardStats: + allOf: + - $ref: '#/components/schemas/IndexShardStatsBase' + - type: object + properties: {} Metric: type: string enum: diff --git a/spec/schemas/ml._common.yaml b/spec/schemas/ml._common.yaml index 0c482a35f..7a38327fc 100644 --- a/spec/schemas/ml._common.yaml +++ b/spec/schemas/ml._common.yaml @@ -7,6 +7,8 @@ paths: {} components: schemas: SearchModelsResponse: + $ref: '#/components/schemas/SearchResponse' + SearchResponse: type: object properties: took: @@ -18,10 +20,10 @@ components: _shards: $ref: '_common.yaml#/components/schemas/ShardStatistics' hits: - $ref: '#/components/schemas/SearchModelsHits' + $ref: '#/components/schemas/SearchHits' required: - hits - SearchModelsHits: + SearchHits: type: object properties: total: @@ -29,7 +31,7 @@ components: hits: type: array items: - $ref: '#/components/schemas/SearchModelsHitsHit' + $ref: '#/components/schemas/SearchHitsHit' max_score: type: number format: float @@ -50,7 +52,7 @@ components: required: - relation - value - SearchModelsHitsHit: + SearchHitsHit: type: object properties: _version: @@ -115,6 +117,7 @@ components: - PARTIALLY_DEPLOYED - REGISTERED - REGISTERING + - UNDEPLOYED model_content_size_in_bytes: type: integer format: int64 @@ -171,6 +174,35 @@ components: url: type: string description: The model URL. + backend_roles: + type: array + items: + type: string + description: The backend roles. + owner: + $ref: '#/components/schemas/Owner' + access: + type: string + description: The model group access. + enum: + - private + - public + - restricted + latest_version: + type: integer + description: The latest version. + protocol: + type: string + description: The connector protocol. + enum: + - aws_sigv4 + - http + parameters: + $ref: '#/components/schemas/Parameters' + actions: + type: array + items: + $ref: '#/components/schemas/Action' ModelConfig: type: object properties: @@ -329,6 +361,14 @@ components: properties: bool: $ref: '#/components/schemas/BoolQuery' + match_all: + $ref: '#/components/schemas/MatchAllQuery' + term: + $ref: '#/components/schemas/Term' + MatchAllQuery: + type: object + description: The match all query. + properties: {} BoolQuery: type: object description: The Boolean query. @@ -338,12 +378,35 @@ components: description: Filter query that appears in matching documents. items: $ref: '#/components/schemas/Filter' + must: + type: array + description: Query that must appears in matching documents + items: + $ref: '#/components/schemas/Filter' + must_not: + description: Query that must not appears in matching documents. + $ref: '#/components/schemas/Filter' + should: + type: array + description: Query that should appear in matching documents. + items: + $ref: '#/components/schemas/Filter' Filter: type: object description: The filter element. properties: range: $ref: '#/components/schemas/Range' + nested: + $ref: '#/components/schemas/Nested' + exists: + $ref: '#/components/schemas/Exists' + term: + $ref: '#/components/schemas/Term' + terms: + $ref: '#/components/schemas/Term' + match: + $ref: '#/components/schemas/Match' Range: type: object description: The filter range. @@ -370,6 +433,150 @@ components: lt: type: number description: Less than. + Term: + type: object + description: Term to match the query. + properties: + algorithm: + $ref: '#/components/schemas/Algorithm' + _id: + type: array + items: + $ref: '_common.yaml#/components/schemas/Id' + model_id: + $ref: '_common.yaml#/components/schemas/Name' + owner.name.keyword: + $ref: '#/components/schemas/OwnerNameKeyword' + Algorithm: + type: object + description: The algorithm. + properties: + value: + type: string + description: The function name. + enum: + - AD_LIBSVM + - AGENT + - ANOMALY_LOCALIZATION + - BATCH_RCF + - CONNECTOR + - FIT_RCF + - KMEANS + - LINEAR_REGRESSION + - LOCAL_SAMPLE_CALCULATOR + - LOGISTIC_REGRESSION + - METRICS_CORRELATION + - QUESTION_ANSWERING + - RCF_SUMMARIZE + - REMOTE + - SAMPLE_ALGO + - SPARSE_ENCODING + - SPARSE_TOKENIZE + - TEXT_EMBEDDING + - TEXT_SIMILARITY + OwnerNameKeyword: + type: object + description: The owner name keyword. + properties: + value: + $ref: '_common.yaml#/components/schemas/FieldValue' + boost: + type: number + description: Adjust the relevance score of a match. + Nested: + type: object + description: The nested filter. + properties: + query: + $ref: '#/components/schemas/Query' + path: + $ref: '_common.yaml#/components/schemas/Field' + ignore_unmapped: + type: boolean + description: Whether to ignore unmapped fields. + score_mode: + type: string + description: The score mode. + enum: + - avg + - max + - min + - none + - sum + boost: + type: number + description: Adjust the relevance score of a match. + Exists: + type: object + description: The exists filter. + properties: + field: + $ref: '_common.yaml#/components/schemas/Field' + Sort: + type: object + description: Sort query. + properties: + algorithm: + $ref: '#/components/schemas/SortOrder' + auto_redeploy_retry_times: + $ref: '#/components/schemas/SortOrder' + chunk_number: + $ref: '#/components/schemas/SortOrder' + created_time: + $ref: '#/components/schemas/SortOrder' + current_worker_node_count: + $ref: '#/components/schemas/SortOrder' + deploy_to_all_nodes: + $ref: '#/components/schemas/SortOrder' + is_hidden: + $ref: '#/components/schemas/SortOrder' + last_registered_time: + $ref: '#/components/schemas/SortOrder' + last_updated_time: + $ref: '#/components/schemas/SortOrder' + model_content_hash_value: + $ref: '#/components/schemas/SortOrder' + model_content_size_in_bytes: + $ref: '#/components/schemas/SortOrder' + model_format: + $ref: '#/components/schemas/SortOrder' + model_group_id: + $ref: '#/components/schemas/SortOrder' + model_state: + $ref: '#/components/schemas/SortOrder' + model_version: + $ref: '#/components/schemas/SortOrder' + planning_worker_nodes: + $ref: '#/components/schemas/SortOrder' + planning_worker_node_count: + $ref: '#/components/schemas/SortOrder' + total_chunks: + $ref: '#/components/schemas/SortOrder' + _index: + $ref: '#/components/schemas/SortOrder' + _id: + $ref: '#/components/schemas/SortOrder' + _seq_no: + $ref: '#/components/schemas/SortOrder' + _score: + $ref: '#/components/schemas/SortOrder' + SortOrder: + type: object + description: The order of the sort. + properties: + order: + type: string + description: The order. + enum: + - asc + - desc + Match: + type: object + description: Match query. + properties: + description: + type: string + description: The description. TrainParameters: type: object properties: @@ -430,9 +637,15 @@ components: description: type: string description: The model group description. + owner: + $ref: '#/components/schemas/Owner' access: type: string description: The model group access. + enum: + - private + - public + - restricted created_time: type: integer format: int64 @@ -444,6 +657,39 @@ components: - description - latest_version - name + Owner: + type: object + properties: + name: + $ref: '_common.yaml#/components/schemas/Name' + backend_roles: + type: array + items: + type: string + description: The backend roles. + roles: + type: array + items: + type: string + description: The roles. + custom_attribute_names: + type: array + items: + type: string + description: The custom attribute names. + user_requested_tenant: + type: ['null', string] + description: The user requested tenant. + required: + - name + UpdateModelGroupResponse: + type: object + properties: + status: + type: string + description: The status. + SearchModelGroupsResponse: + $ref: '#/components/schemas/SearchResponse' Task: type: object properties: @@ -573,4 +819,36 @@ components: properties: content_type: type: string - additionalProperties: true \ No newline at end of file + additionalProperties: true + GetConnectorResponse: + type: object + properties: + name: + $ref: '_common.yaml#/components/schemas/Name' + version: + $ref: '_common.yaml#/components/schemas/VersionString' + description: + type: string + description: The connector description. + protocol: + type: string + description: The connector protocol. + enum: + - aws_sigv4 + - http + parameters: + $ref: '#/components/schemas/Parameters' + actions: + type: array + items: + $ref: '#/components/schemas/Action' + created_time: + type: integer + format: int64 + description: The created time. + last_updated_time: + type: integer + format: int64 + description: The last updated time. + SearchConnectorsResponse: + $ref: '#/components/schemas/SearchResponse' \ No newline at end of file diff --git a/spec/schemas/nodes._common.yaml b/spec/schemas/nodes._common.yaml index 7640634ab..63a79046f 100644 --- a/spec/schemas/nodes._common.yaml +++ b/spec/schemas/nodes._common.yaml @@ -6,1314 +6,12 @@ info: paths: {} components: schemas: - Http: - type: object - properties: - current_open: - description: Current number of open HTTP connections for the node. - type: number - total_opened: - description: Total number of HTTP connections opened for the node. - type: number - clients: - description: |- - Information on current and recently-closed HTTP client connections. - Clients that have been closed longer than the `http.client_stats.closed_channels.max_age` setting will not be represented here. - type: array - items: - $ref: '#/components/schemas/Client' - Client: - type: object - properties: - id: - description: Unique ID for the HTTP client. - type: number - agent: - description: |- - Reported agent for the HTTP client. - If unavailable, this property is not included in the response. - type: string - local_address: - description: Local address for the HTTP connection. - type: string - remote_address: - description: Remote address for the HTTP connection. - type: string - last_uri: - description: The URI of the client's most recent request. - type: string - opened_time_millis: - description: Time at which the client opened the connection. - type: number - closed_time_millis: - description: Time at which the client closed the connection if the connection is closed. - type: number - last_request_time_millis: - description: Time of the most recent request from this client. - type: number - request_count: - description: Number of requests from this client. - type: number - request_size_bytes: - description: Cumulative size in bytes of all requests from this client. - $ref: '_common.yaml#/components/schemas/ByteCount' - x_opaque_id: - description: |- - Value from the client's `x-opaque-id` HTTP header. - If unavailable, this property is not included in the response. - type: string - Ingest: - type: object - properties: - pipelines: - description: Contains statistics about ingest pipelines for the node. - type: object - additionalProperties: - $ref: '#/components/schemas/IngestTotal' - total: - $ref: '#/components/schemas/IngestTotal' - IngestTotal: - type: object - properties: - count: - description: Total number of documents ingested during the lifetime of this node. - type: number - current: - description: Total number of documents currently being ingested. - type: number - failed: - description: Total number of failed ingest operations during the lifetime of this node. - type: number - processors: - description: Total number of ingest processors. - type: array - items: - type: object - additionalProperties: - $ref: '#/components/schemas/KeyedProcessor' - time: - $ref: '_common.yaml#/components/schemas/Duration' - time_in_millis: - $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' - KeyedProcessor: - type: object - properties: - stats: - $ref: '#/components/schemas/Processor' - type: - type: string - Processor: - type: object - properties: - count: - description: Number of documents transformed by the processor. - type: number - current: - description: Number of documents currently being transformed by the processor. - type: number - failed: - description: Number of failed operations for the processor. - type: number - time: - $ref: '_common.yaml#/components/schemas/Duration' - time_in_millis: - $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' - ThreadCount: - type: object - properties: - active: - description: Number of active threads in the thread pool. - type: number - completed: - description: Number of tasks completed by the thread pool executor. - type: number - largest: - description: Highest number of active threads in the thread pool. - type: number - queue: - description: Number of tasks in queue for the thread pool. - type: number - rejected: - description: Number of tasks rejected by the thread pool executor. - type: number - threads: - description: Number of threads in the thread pool. - type: number - total_wait_time: - description: | - The total amount of time that tasks spend waiting in the thread pool queue. - Currently, only `search`, `search_throttled`, and `index_searcher` thread pools support this metric. - $ref: '_common.yaml#/components/schemas/Duration' - total_wait_time_in_nanos: - description: | - The total amount of time that tasks spend waiting in the thread pool queue. - Currently, only `search`, `search_throttled`, and `index_searcher` thread pools support this metric. - type: number - Scripting: - type: object - properties: - cache_evictions: - description: Total number of times the script cache has evicted old data. - type: number - compilations: - description: Total number of inline script compilations performed by the node. - type: number - compilations_history: - description: Contains this recent history of script compilations. - type: object - additionalProperties: - type: number - compilation_limit_triggered: - description: Total number of times the script compilation circuit breaker has limited inline script compilations. - type: number - contexts: - type: array - items: - $ref: '#/components/schemas/Context' - Context: - type: object - properties: - context: - type: string - compilations: - type: number - cache_evictions: - type: number - compilation_limit_triggered: - type: number NodesResponseBase: type: object properties: _nodes: description: Contains statistics about the number of nodes selected by the request's node filters. $ref: '_common.yaml#/components/schemas/NodeStatistics' - NodeReloadResult: - anyOf: - - $ref: '#/components/schemas/NodeReloadResponse' - - $ref: '#/components/schemas/NodeReloadError' - Stats: - type: object - properties: - adaptive_selection: - description: Statistics about adaptive replica selection. - type: object - additionalProperties: - $ref: '#/components/schemas/AdaptiveSelection' - breakers: - description: Statistics about the field data circuit breaker. - type: object - additionalProperties: - $ref: '#/components/schemas/Breaker' - fs: - $ref: '#/components/schemas/FileSystem' - host: - $ref: '_common.yaml#/components/schemas/Host' - http: - $ref: '#/components/schemas/Http' - ingest: - $ref: '#/components/schemas/Ingest' - ip: - description: IP address and port for the node. - oneOf: - - $ref: '_common.yaml#/components/schemas/Ip' - - type: array - items: - $ref: '_common.yaml#/components/schemas/Ip' - jvm: - $ref: '#/components/schemas/Jvm' - name: - $ref: '_common.yaml#/components/schemas/Name' - os: - $ref: '#/components/schemas/OperatingSystem' - process: - $ref: '#/components/schemas/Process' - roles: - $ref: '_common.yaml#/components/schemas/NodeRoles' - script: - $ref: '#/components/schemas/Scripting' - script_cache: - type: object - additionalProperties: - oneOf: - - $ref: '#/components/schemas/ScriptCache' - - type: array - items: - $ref: '#/components/schemas/ScriptCache' - thread_pool: - description: Statistics about each thread pool, including current size, queue and rejected tasks. - type: object - additionalProperties: - $ref: '#/components/schemas/ThreadCount' - timestamp: - type: number - transport: - $ref: '#/components/schemas/Transport' - transport_address: - $ref: '_common.yaml#/components/schemas/TransportAddress' - attributes: - description: Contains a list of attributes for the node. - type: object - additionalProperties: - type: string - discovery: - $ref: '#/components/schemas/Discovery' - indexing_pressure: - $ref: '#/components/schemas/IndexingPressure' - indices: - $ref: 'indices.stats.yaml#/components/schemas/IndexShardStats' - shard_indexing_pressure: - $ref: '#/components/schemas/ShardIndexingPressureStats' - search_backpressure: - $ref: '#/components/schemas/ShardSearchBackpressureStats' - cluster_manager_throttling: - $ref: '#/components/schemas/ShardClusterManagerThrottlingStats' - weighted_routing: - $ref: '#/components/schemas/ShardWeightedRoutingStats' - task_cancellation: - $ref: '#/components/schemas/ShardTaskCancellationStats' - resource_usage_stats: - $ref: '#/components/schemas/ShardResourceUsageStats' - search_pipeline: - $ref: '#/components/schemas/ShardSearchPipelineStats' - segment_replication_backpressure: - $ref: '#/components/schemas/ShardSegmentReplicationBackpressureStats' - remote_store: - $ref: '#/components/schemas/RemoteStoreStats' - repositories: - $ref: '#/components/schemas/ShardRepositoriesStats' - admission_control: - $ref: '#/components/schemas/ShardAdmissionControlStats' - caches: - $ref: '#/components/schemas/ShardCachesStats' - RemoteStoreStats: - type: object - properties: - last_successful_fetch_of_pinned_timestamps: - description: Timestamp for the last successful fetch of pinned timestamps. - $ref: '_common.yaml#/components/schemas/StringifiedEpochTimeUnitSeconds' - ShardClusterManagerThrottlingStats: - type: object - properties: - stats: - $ref: '#/components/schemas/ShardClusterManagerThrottlingStatsDetail' - ShardClusterManagerThrottlingStatsDetail: - type: object - properties: - total_throttled_tasks: - type: number - throttled_tasks_per_task_type: - type: object # TODO: list of tasks - ShardWeightedRoutingStats: - type: object - properties: - stats: - $ref: '#/components/schemas/ShardWeightedRoutingStatsDetail' - ShardWeightedRoutingStatsDetail: - type: object - properties: - fail_open_count: - type: number - ShardTaskCancellationStats: - type: object - properties: - search_shard_task: - $ref: '#/components/schemas/ShardTaskCancellationStatsDetail' - ShardTaskCancellationStatsDetail: - type: object - properties: - current_count_post_cancel: - type: number - total_count_post_cancel: - type: number - ShardSearchPipelineStats: - type: object - properties: - total_request: - $ref: '#/components/schemas/ShardSearchPipelineTotalStats' - total_response: - $ref: '#/components/schemas/ShardSearchPipelineTotalStats' - pipelines: - type: object - ShardSearchPipelineTotalStats: - type: object - properties: - count: - type: number - time: - $ref: '_common.yaml#/components/schemas/Duration' - time_in_millis: - $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' - current: - type: number - failed: - type: number - ShardResourceUsageStats: - type: object - additionalProperties: - $ref: '#/components/schemas/ShardResourceUsageStatsDetail' - ShardResourceUsageStatsDetail: - type: object - properties: - timestamp: - type: number - cpu_utilization_percent: - $ref: '_common.yaml#/components/schemas/PercentageString' - memory_utilization_percent: - $ref: '_common.yaml#/components/schemas/PercentageString' - io_usage_stats: - $ref: '#/components/schemas/ShardResourceUsageStatsIoUsageStats' - ShardResourceUsageStatsIoUsageStats: - type: object - properties: - max_io_utilization_percent: - $ref: '_common.yaml#/components/schemas/PercentageString' - ShardSegmentReplicationBackpressureStats: - type: object - properties: - total_rejected_requests: - type: number - ShardRepositoriesStats: - type: array - ShardAdmissionControlStats: - type: object - properties: - global_io_usage: - $ref: '#/components/schemas/UsageStats' - global_cpu_usage: - $ref: '#/components/schemas/UsageStats' - UsageStats: - type: object - properties: - transport: - $ref: '#/components/schemas/TransportUsageStats' - TransportUsageStats: - type: object - properties: - rejection_count: - type: object - ShardCachesStats: - type: object - additionalProperties: - $ref: '#/components/schemas/ShardCacheStats' - ShardCacheStats: - type: object - properties: - size: - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - size_in_bytes: - $ref: '_common.yaml#/components/schemas/ByteCount' - evictions: - type: number - hit_count: - type: number - miss_count: - type: number - item_count: - type: number - store_name: - type: string - AdaptiveSelection: - type: object - properties: - avg_queue_size: - description: The exponentially weighted moving average queue size of search requests on the keyed node. - type: number - avg_response_time: - $ref: '_common.yaml#/components/schemas/Duration' - avg_response_time_ns: - description: The exponentially weighted moving average response time, in nanoseconds, of search requests on the keyed node. - type: number - avg_service_time: - $ref: '_common.yaml#/components/schemas/Duration' - avg_service_time_ns: - description: The exponentially weighted moving average service time, in nanoseconds, of search requests on the keyed node. - type: number - outgoing_searches: - description: The number of outstanding search requests to the keyed node from the node these stats are for. - type: number - rank: - description: The rank of this node; used for shard selection when routing search requests. - type: string - Breaker: - type: object - properties: - estimated_size: - description: Estimated memory used for the operation. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - estimated_size_in_bytes: - description: Estimated memory used, in bytes, for the operation. - $ref: '_common.yaml#/components/schemas/ByteCount' - limit_size: - description: Memory limit for the circuit breaker. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - limit_size_in_bytes: - description: Memory limit, in bytes, for the circuit breaker. - $ref: '_common.yaml#/components/schemas/ByteCount' - overhead: - description: A constant that all estimates for the circuit breaker are multiplied with to calculate a final estimate. - type: number - tripped: - description: Total number of times the circuit breaker has been triggered and prevented an out of memory error. - type: number - FileSystem: - type: object - properties: - data: - description: List of all file stores. - type: array - items: - $ref: '#/components/schemas/DataPathStats' - timestamp: - description: |- - Last time the file stores statistics were refreshed. - Recorded in milliseconds since the Unix Epoch. - type: number - total: - $ref: '#/components/schemas/FileSystemTotal' - io_stats: - $ref: '#/components/schemas/IoStats' - DataPathStats: - type: object - properties: - available: - description: Total amount of disk space available to this Java virtual machine on this file store. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - available_in_bytes: - description: Total number of bytes available to this Java virtual machine on this file store. - $ref: '_common.yaml#/components/schemas/ByteCount' - cache_reserved: - x-version-added: '2.7' - description: Total number of cache bytes reserved available to this Java virtual machine on this file store. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - cache_reserved_in_bytes: - x-version-added: '2.7' - description: Total number of cache bytes reserved available to this Java virtual machine on this file store. - $ref: '_common.yaml#/components/schemas/ByteCount' - disk_queue: - type: string - disk_reads: - type: number - disk_read_size: - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - disk_read_size_in_bytes: - $ref: '_common.yaml#/components/schemas/ByteCount' - disk_writes: - type: number - disk_write_size: - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - disk_write_size_in_bytes: - $ref: '_common.yaml#/components/schemas/ByteCount' - free: - description: Total amount of unallocated disk space in the file store. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - free_in_bytes: - description: Total number of unallocated bytes in the file store. - $ref: '_common.yaml#/components/schemas/ByteCount' - mount: - description: 'Mount point of the file store (for example: `/dev/sda2`).' - type: string - path: - description: Path to the file store. - type: string - total: - description: Total size of the file store. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - total_in_bytes: - description: Total size of the file store in bytes. - $ref: '_common.yaml#/components/schemas/ByteCount' - type: - description: 'Type of the file store (ex: ext4).' - type: string - FileSystemTotal: - type: object - properties: - available: - description: |- - Total disk space available to this Java virtual machine on all file stores. - Depending on OS or process level restrictions, this might appear less than `free`. - This is the actual amount of free disk space the OpenSearch node can utilize. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - available_in_bytes: - description: |- - Total number of bytes available to this Java virtual machine on all file stores. - Depending on OS or process level restrictions, this might appear less than `free_in_bytes`. - This is the actual amount of free disk space the OpenSearch node can utilize. - $ref: '_common.yaml#/components/schemas/ByteCount' - free: - description: Total unallocated disk space in all file stores. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - free_in_bytes: - description: Total number of unallocated bytes in all file stores. - $ref: '_common.yaml#/components/schemas/ByteCount' - total: - description: Total size of all file stores. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - total_in_bytes: - description: Total size of all file stores in bytes. - $ref: '_common.yaml#/components/schemas/ByteCount' - cache_reserved: - x-version-added: '2.7' - description: Total size of cache bytes reserved in all file stores. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - cache_reserved_in_bytes: - x-version-added: '2.7' - description: Total size of cache bytes reserved in all file stores. - $ref: '_common.yaml#/components/schemas/ByteCount' - IoStats: - type: object - properties: - devices: - description: |- - Array of disk metrics for each device that is backing an OpenSearch data path. - These disk metrics are probed periodically and averages between the last probe and the current probe are computed. - type: array - items: - $ref: '#/components/schemas/IoStatDevice' - total: - $ref: '#/components/schemas/IoStatDevice' - IoStatDevice: - type: object - properties: - device_name: - description: The Linux device name. - type: string - operations: - description: The total number of read and write operations for the device completed since starting OpenSearch. - type: number - read_kilobytes: - description: The total number of kilobytes read for the device since starting OpenSearch. - type: number - read_operations: - description: The total number of read operations for the device completed since starting OpenSearch. - type: number - write_kilobytes: - description: The total number of kilobytes written for the device since starting OpenSearch. - type: number - write_operations: - description: The total number of write operations for the device completed since starting OpenSearch. - type: number - read_time: - type: number - write_time: - type: number - queue_size: - type: number - io_time_in_millis: - $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' - Jvm: - type: object - properties: - buffer_pools: - description: Contains statistics about JVM buffer pools for the node. - type: object - additionalProperties: - $ref: '#/components/schemas/NodeBufferPool' - classes: - $ref: '#/components/schemas/JvmClasses' - gc: - $ref: '#/components/schemas/GarbageCollector' - mem: - $ref: '#/components/schemas/JvmMemoryStats' - threads: - $ref: '#/components/schemas/JvmThreads' - timestamp: - description: Last time JVM statistics were refreshed. - type: number - uptime: - description: |- - Human-readable JVM uptime. - Only returned if the `human` query parameter is `true`. - type: string - uptime_in_millis: - description: JVM uptime in milliseconds. - type: number - NodeBufferPool: - type: object - properties: - count: - description: Number of buffer pools. - type: number - total_capacity: - description: Total capacity of buffer pools. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - total_capacity_in_bytes: - description: Total capacity of buffer pools in bytes. - $ref: '_common.yaml#/components/schemas/ByteCount' - used: - description: Size of buffer pools. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - used_in_bytes: - description: Size of buffer pools in bytes. - $ref: '_common.yaml#/components/schemas/ByteCount' - JvmClasses: - type: object - properties: - current_loaded_count: - description: Number of classes currently loaded by JVM. - type: number - total_loaded_count: - description: Total number of classes loaded since the JVM started. - type: number - total_unloaded_count: - description: Total number of classes unloaded since the JVM started. - type: number - GarbageCollector: - type: object - properties: - collectors: - description: Contains statistics about JVM garbage collectors for the node. - type: object - additionalProperties: - $ref: '#/components/schemas/GarbageCollectorTotal' - GarbageCollectorTotal: - type: object - properties: - collection_count: - description: Total number of JVM garbage collectors that collect objects. - type: number - collection_time: - description: Total time spent by JVM collecting objects. - type: string - collection_time_in_millis: - description: Total time, in milliseconds, spent by JVM collecting objects. - type: number - JvmMemoryStats: - type: object - properties: - heap_used: - description: Memory currently in use by the heap. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - heap_used_in_bytes: - description: Memory, in bytes, currently in use by the heap. - $ref: '_common.yaml#/components/schemas/ByteCount' - heap_used_percent: - description: Percentage of memory currently in use by the heap. - $ref: '_common.yaml#/components/schemas/PercentageNumber' - heap_committed: - description: Amount of memory available for use by the heap. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - heap_committed_in_bytes: - description: Amount of memory, in bytes, available for use by the heap. - $ref: '_common.yaml#/components/schemas/ByteCount' - heap_max: - description: Maximum amount of memory available for use by the heap. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - heap_max_in_bytes: - description: Maximum amount of memory, in bytes, available for use by the heap. - $ref: '_common.yaml#/components/schemas/ByteCount' - non_heap_used: - description: Non-heap memory used. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - non_heap_used_in_bytes: - description: Non-heap memory used, in bytes. - $ref: '_common.yaml#/components/schemas/ByteCount' - non_heap_committed: - description: Amount of non-heap memory available. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - non_heap_committed_in_bytes: - description: Amount of non-heap memory available, in bytes. - $ref: '_common.yaml#/components/schemas/ByteCount' - pools: - description: Contains statistics about heap memory usage for the node. - type: object - additionalProperties: - $ref: '#/components/schemas/Pool' - Pool: - type: object - properties: - used: - description: Memory used by the heap. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - used_in_bytes: - description: Memory, in bytes, used by the heap. - $ref: '_common.yaml#/components/schemas/ByteCount' - max: - description: Maximum amount of memory available for use by the heap. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - max_in_bytes: - description: Maximum amount of memory, in bytes, available for use by the heap. - $ref: '_common.yaml#/components/schemas/ByteCount' - peak_used: - description: Largest amount of memory historically used by the heap. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - peak_used_in_bytes: - description: Largest amount of memory, in bytes, historically used by the heap. - $ref: '_common.yaml#/components/schemas/ByteCount' - peak_max: - description: Largest amount of memory historically used by the heap. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - peak_max_in_bytes: - description: Largest amount of memory, in bytes, historically used by the heap. - $ref: '_common.yaml#/components/schemas/ByteCount' - last_gc_stats: - description: Most recent GC cycle stats for a particular memory pool. - $ref: '#/components/schemas/LastGcStats' - LastGcStats: - type: object - properties: - used: - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - used_in_bytes: - $ref: '_common.yaml#/components/schemas/ByteCount' - max: - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - max_in_bytes: - $ref: '_common.yaml#/components/schemas/ByteCount' - usage_percent: - $ref: '_common.yaml#/components/schemas/PercentageNumber' - JvmThreads: - type: object - properties: - count: - description: Number of active threads in use by JVM. - type: number - peak_count: - description: Highest number of threads used by JVM. - type: number - OperatingSystem: - type: object - properties: - cpu: - $ref: '#/components/schemas/Cpu' - mem: - $ref: '#/components/schemas/ExtendedMemoryStats' - swap: - $ref: '#/components/schemas/MemoryStats' - cgroup: - $ref: '#/components/schemas/Cgroup' - timestamp: - type: number - Cpu: - type: object - properties: - percent: - $ref: '_common.yaml#/components/schemas/PercentageNumber' - sys: - $ref: '_common.yaml#/components/schemas/Duration' - sys_in_millis: - $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' - total: - $ref: '_common.yaml#/components/schemas/Duration' - total_in_millis: - $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' - user: - $ref: '_common.yaml#/components/schemas/Duration' - user_in_millis: - $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' - load_average: - type: object - additionalProperties: - type: number - ExtendedMemoryStats: - allOf: - - $ref: '#/components/schemas/MemoryStats' - - type: object - properties: - free_percent: - description: Percentage of free memory. - $ref: '_common.yaml#/components/schemas/PercentageNumber' - used_percent: - description: Percentage of used memory. - $ref: '_common.yaml#/components/schemas/PercentageNumber' - MemoryStats: - type: object - properties: - adjusted_total_in_bytes: - description: |- - If the amount of physical memory has been overridden using the `es`.`total_memory_bytes` system property then this reports the overridden value in bytes. - Otherwise it reports the same value as `total_in_bytes`. - $ref: '_common.yaml#/components/schemas/ByteCount' - resident: - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - resident_in_bytes: - $ref: '_common.yaml#/components/schemas/ByteCount' - share: - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - share_in_bytes: - $ref: '_common.yaml#/components/schemas/ByteCount' - total_virtual: - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - total_virtual_in_bytes: - $ref: '_common.yaml#/components/schemas/ByteCount' - total: - description: Total amount of physical memory. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - total_in_bytes: - description: Total amount of physical memory in bytes. - $ref: '_common.yaml#/components/schemas/ByteCount' - free: - description: Amount of free physical memory. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - free_in_bytes: - description: Amount of free physical memory in bytes. - $ref: '_common.yaml#/components/schemas/ByteCount' - used: - description: Amount of used physical memory. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - used_in_bytes: - description: Amount of used physical memory in bytes. - $ref: '_common.yaml#/components/schemas/ByteCount' - Cgroup: - type: object - properties: - cpuacct: - $ref: '#/components/schemas/CpuAcct' - cpu: - $ref: '#/components/schemas/CgroupCpu' - memory: - $ref: '#/components/schemas/CgroupMemory' - CpuAcct: - type: object - properties: - control_group: - description: The `cpuacct` control group to which the OpenSearch process belongs. - type: string - usage_nanos: - $ref: '_common.yaml#/components/schemas/DurationValueUnitNanos' - CgroupCpu: - type: object - properties: - control_group: - description: The `cpu` control group to which the OpenSearch process belongs. - type: string - cfs_period_micros: - description: The period of time, in microseconds, for how regularly all tasks in the same cgroup as the OpenSearch process should have their access to CPU resources reallocated. - type: number - cfs_quota_micros: - description: The total amount of time, in microseconds, for which all tasks in the same cgroup as the OpenSearch process can run during one period `cfs_period_micros`. - type: number - stat: - $ref: '#/components/schemas/CgroupCpuStat' - CgroupCpuStat: - type: object - properties: - number_of_elapsed_periods: - description: The number of reporting periods (as specified by `cfs_period_micros`) that have elapsed. - type: number - number_of_times_throttled: - description: The number of times all tasks in the same cgroup as the OpenSearch process have been throttled. - type: number - time_throttled_nanos: - $ref: '_common.yaml#/components/schemas/DurationValueUnitNanos' - CgroupMemory: - type: object - properties: - control_group: - description: The `memory` control group to which the OpenSearch process belongs. - type: string - limit_in_bytes: - description: |- - The maximum amount of user memory (including file cache) allowed for all tasks in the same cgroup as the OpenSearch process. - This value can be too big to store in a `long`, so is returned as a string so that the value returned can exactly match what the underlying operating system interface returns. - Any value that is too large to parse into a `long` almost certainly means no limit has been set for the cgroup. - type: string - usage_in_bytes: - description: |- - The total current memory usage by processes in the cgroup, in bytes, by all tasks in the same cgroup as the OpenSearch process. - This value is stored as a string for consistency with `limit_in_bytes`. - type: string - Process: - type: object - properties: - cpu: - $ref: '#/components/schemas/Cpu' - mem: - $ref: '#/components/schemas/MemoryStats' - open_file_descriptors: - description: Number of opened file descriptors associated with the current or `-1` if not supported. - type: number - max_file_descriptors: - description: Maximum number of file descriptors allowed on the system, or `-1` if not supported. - type: number - timestamp: - description: |- - Last time the statistics were refreshed. - Recorded in milliseconds since the Unix Epoch. - type: number - ScriptCache: - type: object - properties: - cache_evictions: - description: Total number of times the script cache has evicted old data. - type: number - compilation_limit_triggered: - description: Total number of times the script compilation circuit breaker has limited inline script compilations. - type: number - compilations: - description: Total number of inline script compilations performed by the node. - type: number - context: - type: string - Transport: - type: object - properties: - inbound_handling_time_histogram: - description: The distribution of the time spent handling each inbound message on a transport thread, represented as a histogram. - type: array - items: - $ref: '#/components/schemas/TransportHistogram' - outbound_handling_time_histogram: - description: The distribution of the time spent sending each outbound transport message on a transport thread, represented as a histogram. - type: array - items: - $ref: '#/components/schemas/TransportHistogram' - rx_count: - description: Total number of RX (receive) packets received by the node during internal cluster communication. - type: number - rx_size: - description: Size of RX packets received by the node during internal cluster communication. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - rx_size_in_bytes: - description: Size, in bytes, of RX packets received by the node during internal cluster communication. - $ref: '_common.yaml#/components/schemas/ByteCount' - server_open: - description: Current number of inbound TCP connections used for internal communication between nodes. - type: number - tx_count: - description: Total number of TX (transmit) packets sent by the node during internal cluster communication. - type: number - tx_size: - description: Size of TX packets sent by the node during internal cluster communication. - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - tx_size_in_bytes: - description: Size, in bytes, of TX packets sent by the node during internal cluster communication. - $ref: '_common.yaml#/components/schemas/ByteCount' - total_outbound_connections: - description: |- - The cumulative number of outbound transport connections that this node has opened since it started. - Each transport connection may comprise multiple TCP connections but is only counted once in this statistic. - Transport connections are typically long-lived so this statistic should remain constant in a stable cluster. - type: number - TransportHistogram: - type: object - properties: - count: - description: The number of times a transport thread took a period of time within the bounds of this bucket to handle an inbound message. - type: number - lt_millis: - description: |- - The exclusive upper bound of the bucket in milliseconds. - May be omitted on the last bucket if this bucket has no upper bound. - type: number - ge_millis: - description: The inclusive lower bound of the bucket in milliseconds. May be omitted on the first bucket if this bucket has no lower bound. - type: number - Discovery: - type: object - properties: - cluster_state_queue: - $ref: '#/components/schemas/ClusterStateQueue' - cluster_state_stats: - $ref: '#/components/schemas/ClusterStateStats' - published_cluster_states: - $ref: '#/components/schemas/PublishedClusterStates' - cluster_state_update: - description: |- - Contains low-level statistics about how long various activities took during cluster state updates while the node was the elected cluster manager. - Omitted if the node is not cluster-manager-eligible. - Every field whose name ends in `_time` within this object is also represented as a raw number of milliseconds in a field whose name ends in `_time_millis`. - The human-readable fields with a `_time` suffix are only returned if requested with the `?human=true` query parameter. - type: object - additionalProperties: - $ref: '#/components/schemas/ClusterStateUpdate' - serialized_cluster_states: - $ref: '#/components/schemas/SerializedClusterState' - cluster_applier_stats: - $ref: '#/components/schemas/ClusterAppliedStats' - ClusterStateQueue: - type: object - properties: - total: - description: Total number of cluster states in queue. - type: number - pending: - description: Number of pending cluster states in queue. - type: number - committed: - description: Number of committed cluster states in queue. - type: number - ClusterStateStats: - type: object - properties: - overall: - $ref: '#/components/schemas/ClusterStateOverallStats' - ClusterStateOverallStats: - type: object - properties: - update_count: - type: number - total_time_in_millis: - $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' - failed_count: - type: number - PublishedClusterStates: - type: object - properties: - full_states: - description: Number of published cluster states. - type: number - incompatible_diffs: - description: Number of incompatible differences between published cluster states. - type: number - compatible_diffs: - description: Number of compatible differences between published cluster states. - type: number - ClusterStateUpdate: - type: object - properties: - count: - description: The number of cluster state update attempts that did not change the cluster state since the node started. - type: number - computation_time: - $ref: '_common.yaml#/components/schemas/Duration' - computation_time_millis: - $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' - publication_time: - $ref: '_common.yaml#/components/schemas/Duration' - publication_time_millis: - $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' - context_construction_time: - $ref: '_common.yaml#/components/schemas/Duration' - context_construction_time_millis: - $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' - commit_time: - $ref: '_common.yaml#/components/schemas/Duration' - commit_time_millis: - $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' - completion_time: - $ref: '_common.yaml#/components/schemas/Duration' - completion_time_millis: - $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' - master_apply_time: - $ref: '_common.yaml#/components/schemas/Duration' - master_apply_time_millis: - $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' - notification_time: - $ref: '_common.yaml#/components/schemas/Duration' - notification_time_millis: - $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' - required: - - count - SerializedClusterState: - type: object - properties: - full_states: - $ref: '#/components/schemas/SerializedClusterStateDetail' - diffs: - $ref: '#/components/schemas/SerializedClusterStateDetail' - SerializedClusterStateDetail: - type: object - properties: - count: - type: number - uncompressed_size: - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - uncompressed_size_in_bytes: - $ref: '_common.yaml#/components/schemas/ByteCount' - compressed_size: - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - compressed_size_in_bytes: - $ref: '_common.yaml#/components/schemas/ByteCount' - ClusterAppliedStats: - type: object - properties: - recordings: - type: array - items: - $ref: '#/components/schemas/Recording' - Recording: - type: object - properties: - name: - type: string - cumulative_execution_count: - type: number - cumulative_execution_time: - $ref: '_common.yaml#/components/schemas/Duration' - cumulative_execution_time_millis: - $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' - IndexingPressure: - type: object - properties: - memory: - $ref: '#/components/schemas/IndexingPressureMemory' - ShardIndexingPressureStats: - type: object - properties: - stats: - type: object - enabled: - type: boolean - enforced: - type: boolean - total_rejections_breakup: - $ref: '#/components/schemas/TotalRejectionsBreakup' - total_rejections_breakup_shadow_mode: - $ref: '#/components/schemas/TotalRejectionsBreakup' - ShardSearchBackpressureStats: - type: object - properties: - search_task: - $ref: '#/components/schemas/ShardSearchBackpressureTaskStats' - search_shard_task: - $ref: '#/components/schemas/ShardSearchBackpressureTaskStats' - mode: - $ref: '#/components/schemas/ShardSearchBackpressureMode' - ShardSearchBackpressureMode: - type: string - enum: - - disabled - - enforced - - monitor_only - ShardSearchBackpressureTaskStats: - type: object - properties: - resource_tracker_stats: - $ref: '#/components/schemas/ShardSearchBackpressureTaskResourceTrackerStats' - cancellation_stats: - $ref: '#/components/schemas/ShardSearchBackpressureTaskCancellationStats' - completion_count: - x-version-added: '3.0' - type: number - ShardSearchBackpressureTaskResourceTrackerStats: - type: object - properties: - heap_usage_tracker: - $ref: '#/components/schemas/ShardSearchBackpressureTaskResourceTrackerHeapUsageTrackerStats' - elapsed_time_tracker: - $ref: '#/components/schemas/ShardSearchBackpressureTaskResourceTrackerElapsedTimeTrackerStats' - cpu_usage_tracker: - $ref: '#/components/schemas/ShardSearchBackpressureTaskResourceTrackerCpuUsageTrackerStats' - ShardSearchBackpressureTaskResourceTrackerHeapUsageTrackerStats: - type: object - properties: - cancellation_count: - type: number - current_max: - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - current_max_bytes: - $ref: '_common.yaml#/components/schemas/ByteCount' - current_avg: - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - current_avg_bytes: - $ref: '_common.yaml#/components/schemas/ByteCount' - rolling_avg: - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - rolling_avg_bytes: - $ref: '_common.yaml#/components/schemas/ByteCount' - ShardSearchBackpressureTaskResourceTrackerElapsedTimeTrackerStats: - type: object - properties: - cancellation_count: - type: number - current_max: - $ref: '_common.yaml#/components/schemas/Duration' - current_max_millis: - $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' - current_avg: - $ref: '_common.yaml#/components/schemas/Duration' - current_avg_millis: - $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' - ShardSearchBackpressureTaskResourceTrackerCpuUsageTrackerStats: - type: object - properties: - cancellation_count: - type: number - current_max: - $ref: '_common.yaml#/components/schemas/Duration' - current_max_millis: - $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' - current_avg: - $ref: '_common.yaml#/components/schemas/Duration' - current_avg_millis: - $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' - ShardSearchBackpressureTaskCancellationStats: - type: object - properties: - cancellation_count: - type: number - cancellation_limit_reached_count: - type: number - cancelled_task_percentage: - $ref: '_common.yaml#/components/schemas/PercentageNumber' - current_cancellation_eligible_tasks_count: - type: number - TotalRejectionsBreakup: - type: object - properties: - node_limits: - type: number - no_successful_request_limits: - type: number - throughput_degradation_limits: - type: number - IndexingPressureMemory: - type: object - properties: - limit: - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - limit_in_bytes: - description: |- - Configured memory limit, in bytes, for the indexing requests. - Replica requests have an automatic limit that is 1.5x this value. - $ref: '_common.yaml#/components/schemas/ByteCount' - current: - $ref: '#/components/schemas/PressureMemory' - total: - $ref: '#/components/schemas/PressureMemory' - PressureMemory: - type: object - properties: - all: - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - all_in_bytes: - description: Memory consumed, in bytes, by indexing requests in the coordinating, primary, or replica stage. - $ref: '_common.yaml#/components/schemas/ByteCount' - combined_coordinating_and_primary: - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - combined_coordinating_and_primary_in_bytes: - description: |- - Memory consumed, in bytes, by indexing requests in the coordinating or primary stage. - This value is not the sum of coordinating and primary as a node can reuse the coordinating memory if the primary stage is executed locally. - $ref: '_common.yaml#/components/schemas/ByteCount' - coordinating: - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - coordinating_in_bytes: - description: Memory consumed, in bytes, by indexing requests in the coordinating stage. - $ref: '_common.yaml#/components/schemas/ByteCount' - primary: - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - primary_in_bytes: - description: Memory consumed, in bytes, by indexing requests in the primary stage. - $ref: '_common.yaml#/components/schemas/ByteCount' - replica: - $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' - replica_in_bytes: - description: Memory consumed, in bytes, by indexing requests in the replica stage. - $ref: '_common.yaml#/components/schemas/ByteCount' - coordinating_rejections: - description: Number of indexing requests rejected in the coordinating stage. - type: number - primary_rejections: - description: Number of indexing requests rejected in the primary stage. - type: number - replica_rejections: - description: Number of indexing requests rejected in the replica stage. - type: number - NodeReloadResponse: - type: object - properties: - name: - $ref: '_common.yaml#/components/schemas/Name' - required: - - name - NodeReloadError: - allOf: - - $ref: '#/components/schemas/NodeReloadResponse' - - type: object - properties: - reload_exception: - $ref: '_common.yaml#/components/schemas/ErrorCause' SampleType: type: string description: The type to sample. diff --git a/spec/schemas/nodes.info.yaml b/spec/schemas/nodes.info.yaml index f53c43ff2..df6eaa8cb 100644 --- a/spec/schemas/nodes.info.yaml +++ b/spec/schemas/nodes.info.yaml @@ -22,20 +22,6 @@ components: - settings - thread_pool - transport - ResponseBase: - allOf: - - $ref: 'nodes._common.yaml#/components/schemas/NodesResponseBase' - - type: object - properties: - cluster_name: - $ref: '_common.yaml#/components/schemas/Name' - nodes: - type: object - additionalProperties: - $ref: '#/components/schemas/NodeInfo' - required: - - cluster_name - - nodes NodeInfo: type: object properties: @@ -78,11 +64,12 @@ components: type: object additionalProperties: $ref: '#/components/schemas/NodeThreadPoolInfo' + # NOTE: total_indexing_buffer and total_indexing_buffer_in_bytes inverted according to the standard pattern, this is a bug: https://github.com/opensearch-project/OpenSearch/issues/16910 total_indexing_buffer: description: Total heap allowed to be used to hold recently indexed documents before they must be written to disk. This size is a shared pool across all shards on this node, and is controlled by Indexing Buffer settings. - type: number - total_indexing_buffer_in_bytes: $ref: '_common.yaml#/components/schemas/ByteCount' + total_indexing_buffer_in_bytes: + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' transport: $ref: '#/components/schemas/NodeInfoTransport' transport_address: @@ -138,7 +125,10 @@ components: items: type: string pid: - type: number + type: integer + format: int32 + start_time: + $ref: '_common.yaml#/components/schemas/DateTime' start_time_in_millis: $ref: '_common.yaml#/components/schemas/EpochTimeUnitMillis' version: @@ -154,9 +144,7 @@ components: using_bundled_jdk: type: [boolean, 'null'] using_compressed_ordinary_object_pointers: - oneOf: - - type: boolean - - type: string + $ref: '_common.yaml#/components/schemas/StringifiedBoolean' input_arguments: type: array items: @@ -201,7 +189,8 @@ components: primary_interface: $ref: '#/components/schemas/NodeInfoNetworkInterface' refresh_interval: - type: number + type: integer + format: int32 required: - primary_interface - refresh_interval @@ -226,14 +215,18 @@ components: type: string available_processors: description: Number of processors available to the Java virtual machine - type: number + type: integer + format: int32 allocated_processors: description: The number of processors actually used to calculate thread pool size. This number can be set with the `node.processors` setting of a node and defaults to the number of processors reported by the OS. - type: number + type: integer + format: int32 name: $ref: '_common.yaml#/components/schemas/Name' pretty_name: $ref: '_common.yaml#/components/schemas/Name' + refresh_interval: + $ref: '_common.yaml#/components/schemas/Duration' refresh_interval_in_millis: $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' version: @@ -255,15 +248,19 @@ components: cache_size_in_bytes: $ref: '_common.yaml#/components/schemas/ByteCount' cores_per_socket: - type: number + type: integer + format: int32 mhz: - type: number + type: integer + format: int32 model: type: string total_cores: - type: number + type: integer + format: int32 total_sockets: - type: number + type: integer + format: int32 vendor: type: string required: @@ -290,10 +287,13 @@ components: properties: id: description: Process identifier (PID) - type: number + type: integer + format: int64 mlockall: description: Indicates if the process address space has been successfully locked in memory type: boolean + refresh_interval: + $ref: '_common.yaml#/components/schemas/Duration' refresh_interval_in_millis: $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' required: @@ -352,11 +352,11 @@ components: election: $ref: '#/components/schemas/NodeInfoSettingsClusterElection' initial_cluster_manager_nodes: - type: string + $ref: '_common.yaml#/components/schemas/StringOrStringArray' initial_master_nodes: - type: string + $ref: '_common.yaml#/components/schemas/StringOrStringArray' deprecation_indexing: - $ref: '#/components/schemas/DeprecationIndexing' + $ref: '#/components/schemas/NodeInfoSettingsDeprecationIndexing' required: - name NodeInfoSettingsClusterElection: @@ -366,13 +366,11 @@ components: $ref: '_common.yaml#/components/schemas/Name' required: - strategy - DeprecationIndexing: + NodeInfoSettingsDeprecationIndexing: type: object properties: enabled: - oneOf: - - type: boolean - - type: string + $ref: '_common.yaml#/components/schemas/StringifiedBoolean' required: - enabled NodeInfoSettingsNode: @@ -381,7 +379,8 @@ components: name: $ref: '_common.yaml#/components/schemas/Name' attr: - $ref: '#/components/schemas/NodeInfoShardIndexingPressureEnabled' + type: object + additionalProperties: true max_local_storage_nodes: type: string required: @@ -419,13 +418,6 @@ components: type: string required: - allowed_urls - NodeInfoShardIndexingPressureEnabled: - type: object - properties: - shard_indexing_pressure_enabled: - type: string - required: - - shard_indexing_pressure_enabled NodeInfoDiscovery: type: object properties: @@ -455,13 +447,9 @@ components: type.default: type: string compression: - oneOf: - - type: boolean - - type: string + $ref: '_common.yaml#/components/schemas/StringifiedBoolean' port: - oneOf: - - type: number - - type: string + $ref: '_common.yaml#/components/schemas/StringifiedInteger' required: - type NodeInfoBootstrap: @@ -625,15 +613,19 @@ components: type: object properties: core: - type: number + type: integer + format: int32 keep_alive: $ref: '_common.yaml#/components/schemas/Duration' max: - type: number + type: integer + format: int32 queue_size: - type: number + type: integer + format: int32 size: - type: number + type: integer + format: int32 type: type: string required: diff --git a/spec/schemas/nodes.reload_secure_settings.yaml b/spec/schemas/nodes.reload_secure_settings.yaml index f1b106024..a37d91031 100644 --- a/spec/schemas/nodes.reload_secure_settings.yaml +++ b/spec/schemas/nodes.reload_secure_settings.yaml @@ -6,17 +6,21 @@ info: paths: {} components: schemas: - ResponseBase: + NodeReloadResponse: + type: object + properties: + name: + $ref: '_common.yaml#/components/schemas/Name' + required: + - name + NodeReloadError: allOf: - - $ref: 'nodes._common.yaml#/components/schemas/NodesResponseBase' + - $ref: '#/components/schemas/NodeReloadResponse' - type: object properties: - cluster_name: - $ref: '_common.yaml#/components/schemas/Name' - nodes: - type: object - additionalProperties: - $ref: 'nodes._common.yaml#/components/schemas/NodeReloadResult' - required: - - cluster_name - - nodes + reload_exception: + $ref: '_common.yaml#/components/schemas/ErrorCause' + NodeReloadResult: + anyOf: + - $ref: '#/components/schemas/NodeReloadResponse' + - $ref: '#/components/schemas/NodeReloadError' diff --git a/spec/schemas/nodes.stats.yaml b/spec/schemas/nodes.stats.yaml index 0c5a1ee19..a61712bb4 100644 --- a/spec/schemas/nodes.stats.yaml +++ b/spec/schemas/nodes.stats.yaml @@ -58,16 +58,1411 @@ components: - suggest - translog - warmer - ResponseBase: + Stats: + type: object + properties: + adaptive_selection: + description: Statistics about adaptive replica selection. + type: object + additionalProperties: + $ref: '#/components/schemas/AdaptiveSelection' + breakers: + description: Statistics about the field data circuit breaker. + type: object + additionalProperties: + $ref: '#/components/schemas/Breaker' + fs: + $ref: '#/components/schemas/FileSystem' + host: + $ref: '_common.yaml#/components/schemas/Host' + http: + $ref: '#/components/schemas/Http' + ingest: + $ref: '#/components/schemas/Ingest' + ip: + description: IP address and port for the node. + oneOf: + - $ref: '_common.yaml#/components/schemas/Ip' + - type: array + items: + $ref: '_common.yaml#/components/schemas/Ip' + jvm: + $ref: '#/components/schemas/Jvm' + name: + $ref: '_common.yaml#/components/schemas/Name' + os: + $ref: '#/components/schemas/OperatingSystem' + process: + $ref: '#/components/schemas/Process' + roles: + $ref: '_common.yaml#/components/schemas/NodeRoles' + script: + $ref: '#/components/schemas/ScriptStats' + script_cache: + $ref: '#/components/schemas/ScriptCacheStats' + thread_pool: + description: Statistics about each thread pool, including current size, queue and rejected tasks. + type: object + additionalProperties: + $ref: '#/components/schemas/ThreadCount' + timestamp: + $ref: '_common.yaml#/components/schemas/EpochTimeUnitMillis' + transport: + $ref: '#/components/schemas/Transport' + transport_address: + $ref: '_common.yaml#/components/schemas/TransportAddress' + attributes: + description: Contains a list of attributes for the node. + type: object + additionalProperties: + type: string + discovery: + $ref: '#/components/schemas/Discovery' + indexing_pressure: + $ref: '#/components/schemas/IndexingPressure' + indices: + $ref: '#/components/schemas/NodeIndicesStats' + shard_indexing_pressure: + $ref: '#/components/schemas/ShardIndexingPressureStats' + search_backpressure: + $ref: '#/components/schemas/ShardSearchBackpressureStats' + cluster_manager_throttling: + $ref: '#/components/schemas/ShardClusterManagerThrottlingStats' + weighted_routing: + $ref: '#/components/schemas/ShardWeightedRoutingStats' + task_cancellation: + $ref: '#/components/schemas/ShardTaskCancellationStats' + resource_usage_stats: + $ref: '#/components/schemas/ShardResourceUsageStats' + search_pipeline: + $ref: '#/components/schemas/ShardSearchPipelineStats' + segment_replication_backpressure: + $ref: '#/components/schemas/ShardSegmentReplicationBackpressureStats' + remote_store: + $ref: '#/components/schemas/RemoteStoreStats' + repositories: + $ref: '#/components/schemas/ShardRepositoriesStats' + admission_control: + $ref: '#/components/schemas/ShardAdmissionControlStats' + caches: + $ref: '#/components/schemas/ShardCachesStats' + Http: + type: object + properties: + current_open: + description: Current number of open HTTP connections for the node. + type: integer + format: int64 + total_opened: + description: Total number of HTTP connections opened for the node. + type: integer + format: int64 + Ingest: + type: object + properties: + pipelines: + description: Contains statistics about ingest pipelines for the node. + type: object + additionalProperties: + $ref: '#/components/schemas/IngestTotal' + total: + $ref: '#/components/schemas/IngestTotal' + IngestTotal: + type: object + properties: + count: + description: Total number of documents ingested during the lifetime of this node. + type: integer + format: int64 + current: + description: Total number of documents currently being ingested. + type: integer + format: int64 + failed: + description: Total number of failed ingest operations during the lifetime of this node. + type: integer + format: int64 + processors: + description: Total number of ingest processors. + type: array + items: + type: object + additionalProperties: + $ref: '#/components/schemas/KeyedProcessor' + time: + $ref: '_common.yaml#/components/schemas/Duration' + time_in_millis: + $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' + KeyedProcessor: + type: object + properties: + stats: + $ref: '#/components/schemas/Processor' + type: + type: string + Processor: + type: object + properties: + count: + description: Number of documents transformed by the processor. + type: integer + format: int64 + current: + description: Number of documents currently being transformed by the processor. + type: integer + format: int64 + failed: + description: Number of failed operations for the processor. + type: integer + format: int64 + time: + $ref: '_common.yaml#/components/schemas/Duration' + time_in_millis: + $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' + ThreadCount: + type: object + properties: + active: + description: Number of active threads in the thread pool. + type: integer + format: int64 + completed: + description: Number of tasks completed by the thread pool executor. + type: integer + format: int64 + largest: + description: Highest number of active threads in the thread pool. + type: integer + format: int64 + queue: + description: Number of tasks in queue for the thread pool. + type: integer + format: int64 + rejected: + description: Number of tasks rejected by the thread pool executor. + type: integer + format: int64 + threads: + description: Number of threads in the thread pool. + type: integer + format: int64 + total_wait_time: + description: | + The total amount of time that tasks spend waiting in the thread pool queue. + Currently, only `search`, `search_throttled`, and `index_searcher` thread pools support this metric. + $ref: '_common.yaml#/components/schemas/Duration' + total_wait_time_in_nanos: + description: | + The total amount of time that tasks spend waiting in the thread pool queue. + Currently, only `search`, `search_throttled`, and `index_searcher` thread pools support this metric. + $ref: '_common.yaml#/components/schemas/DurationValueUnitNanos' + ScriptStatsBase: + type: object + properties: + cache_evictions: + description: Total number of times the script cache has evicted old data. + type: integer + format: int64 + compilations: + description: Total number of inline script compilations performed by the node. + type: integer + format: int64 + compilation_limit_triggered: + description: Total number of times the script compilation circuit breaker has limited inline script compilations. + type: integer + format: int64 + required: + - cache_evictions + - compilation_limit_triggered + - compilations + ScriptStats: allOf: - - $ref: 'nodes._common.yaml#/components/schemas/NodesResponseBase' + - $ref: '#/components/schemas/ScriptStatsBase' + - type: object + properties: {} + ScriptContextStats: + allOf: + - $ref: '#/components/schemas/ScriptStatsBase' + - type: object + properties: + context: + type: string + required: + - context + NodeIndicesStats: + allOf: + - $ref: 'indices.stats.yaml#/components/schemas/IndexStatsBase' - type: object properties: - cluster_name: - $ref: '_common.yaml#/components/schemas/Name' - nodes: + indices: type: object additionalProperties: - $ref: 'nodes._common.yaml#/components/schemas/Stats' - required: - - nodes + $ref: 'indices.stats.yaml#/components/schemas/IndexStats' + shards: + type: object + additionalProperties: + type: array + items: + type: object + propertyNames: + title: shard_id + type: string + additionalProperties: + $ref: '#/components/schemas/NodeIndexShardStats' + minProperties: 1 + maxProperties: 1 + NodeIndexShardStats: + allOf: + - $ref: 'indices.stats.yaml#/components/schemas/IndexShardStatsBase' + - type: object + properties: { } + RemoteStoreStats: + type: object + properties: + last_successful_fetch_of_pinned_timestamps: + description: Timestamp for the last successful fetch of pinned timestamps. + $ref: '_common.yaml#/components/schemas/EpochTimeUnitSeconds' + ShardClusterManagerThrottlingStats: + type: object + properties: + stats: + $ref: '#/components/schemas/ShardClusterManagerThrottlingStatsDetail' + ShardClusterManagerThrottlingStatsDetail: + type: object + properties: + total_throttled_tasks: + type: integer + format: int64 + throttled_tasks_per_task_type: + type: object + additionalProperties: + type: integer + format: int64 + required: + - throttled_tasks_per_task_type + - total_throttled_tasks + ShardWeightedRoutingStats: + type: object + properties: + stats: + $ref: '#/components/schemas/ShardWeightedRoutingStatsDetail' + ShardWeightedRoutingStatsDetail: + type: object + properties: + fail_open_count: + type: integer + format: int32 + ShardTaskCancellationStats: + type: object + properties: + search_shard_task: + $ref: '#/components/schemas/ShardTaskCancellationStatsDetail' + ShardTaskCancellationStatsDetail: + type: object + properties: + current_count_post_cancel: + type: integer + format: int64 + total_count_post_cancel: + type: integer + format: int64 + ShardSearchPipelineStats: + type: object + properties: + total_request: + $ref: '#/components/schemas/ShardSearchPipelineOperationStats' + total_response: + $ref: '#/components/schemas/ShardSearchPipelineOperationStats' + pipelines: + type: object + additionalProperties: + $ref: '#/components/schemas/ShardSearchPipelinePerPipelineStats' + ShardSearchPipelinePerPipelineStats: + type: object + properties: + request: + $ref: '#/components/schemas/ShardSearchPipelineOperationStats' + response: + $ref: '#/components/schemas/ShardSearchPipelineOperationStats' + request_processors: + type: array + items: + $ref: '#/components/schemas/ShardSearchPipelinePerPipelineProcessorStats' + response_processors: + type: array + items: + type: object + propertyNames: + title: processor_name + type: string + additionalProperties: + $ref: '#/components/schemas/ShardSearchPipelinePerPipelineProcessorStats' + minProperties: 1 + maxProperties: 1 + ShardSearchPipelinePerPipelineProcessorStats: + type: object + properties: + type: + type: string + stats: + $ref: '#/components/schemas/ShardSearchPipelineOperationStats' + ShardSearchPipelineOperationStats: + type: object + properties: + count: + type: integer + format: int64 + time: + $ref: '_common.yaml#/components/schemas/Duration' + time_in_millis: + $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' + current: + type: integer + format: int64 + failed: + type: integer + format: int64 + ShardResourceUsageStats: + type: object + additionalProperties: + $ref: '#/components/schemas/ShardResourceUsageStatsDetail' + ShardResourceUsageStatsDetail: + type: object + properties: + timestamp: + $ref: '_common.yaml#/components/schemas/EpochTimeUnitMillis' + cpu_utilization_percent: + $ref: '_common.yaml#/components/schemas/PercentageString' + memory_utilization_percent: + $ref: '_common.yaml#/components/schemas/PercentageString' + io_usage_stats: + $ref: '#/components/schemas/ShardResourceUsageStatsIoUsageStats' + ShardResourceUsageStatsIoUsageStats: + type: object + properties: + max_io_utilization_percent: + $ref: '_common.yaml#/components/schemas/PercentageString' + ShardSegmentReplicationBackpressureStats: + type: object + properties: + total_rejected_requests: + type: integer + format: int64 + ShardRepositoriesStats: + type: array + ShardAdmissionControlStats: + type: object + properties: + global_io_usage: + $ref: '#/components/schemas/UsageStats' + global_cpu_usage: + $ref: '#/components/schemas/UsageStats' + UsageStats: + type: object + properties: + transport: + $ref: '#/components/schemas/TransportUsageStats' + TransportUsageStats: + type: object + properties: + rejection_count: + type: object + additionalProperties: + type: integer + format: int64 + ShardCachesStats: + type: object + additionalProperties: + $ref: '#/components/schemas/ShardCacheStats' + ShardCacheStats: + type: object + properties: + size: + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + size_in_bytes: + $ref: '_common.yaml#/components/schemas/ByteCount' + evictions: + type: integer + format: int64 + hit_count: + type: integer + format: int64 + miss_count: + type: integer + format: int64 + item_count: + type: integer + format: int64 + store_name: + type: string + AdaptiveSelection: + type: object + properties: + avg_queue_size: + description: The exponentially weighted moving average queue size of search requests on the keyed node. + type: integer + format: int64 + avg_response_time: + $ref: '_common.yaml#/components/schemas/Duration' + avg_response_time_ns: + description: The exponentially weighted moving average response time, in nanoseconds, of search requests on the keyed node. + $ref: '_common.yaml#/components/schemas/DurationValueUnitNanos' + avg_service_time: + $ref: '_common.yaml#/components/schemas/Duration' + avg_service_time_ns: + description: The exponentially weighted moving average service time, in nanoseconds, of search requests on the keyed node. + $ref: '_common.yaml#/components/schemas/DurationValueUnitNanos' + outgoing_searches: + description: The number of outstanding search requests to the keyed node from the node these stats are for. + type: integer + format: int64 + rank: + description: The rank of this node; used for shard selection when routing search requests. + type: string + Breaker: + type: object + properties: + estimated_size: + description: Estimated memory used for the operation. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + estimated_size_in_bytes: + description: Estimated memory used, in bytes, for the operation. + $ref: '_common.yaml#/components/schemas/ByteCount' + limit_size: + description: Memory limit for the circuit breaker. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + limit_size_in_bytes: + description: Memory limit, in bytes, for the circuit breaker. + $ref: '_common.yaml#/components/schemas/ByteCount' + overhead: + description: A constant that all estimates for the circuit breaker are multiplied with to calculate a final estimate. + type: number + format: double + tripped: + description: Total number of times the circuit breaker has been triggered and prevented an out of memory error. + type: integer + format: int64 + FileSystem: + type: object + properties: + data: + description: List of all file stores. + type: array + items: + $ref: '#/components/schemas/DataPathStats' + timestamp: + description: |- + Last time the file stores statistics were refreshed. + Recorded in milliseconds since the Unix Epoch. + $ref: '_common.yaml#/components/schemas/EpochTimeUnitMillis' + total: + $ref: '#/components/schemas/FileSystemTotal' + io_stats: + $ref: '#/components/schemas/IoStats' + DataPathStats: + type: object + properties: + available: + description: Total amount of disk space available to this Java virtual machine on this file store. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + available_in_bytes: + description: Total number of bytes available to this Java virtual machine on this file store. + $ref: '_common.yaml#/components/schemas/ByteCount' + cache_reserved: + x-version-added: '2.7' + description: Total number of cache bytes reserved available to this Java virtual machine on this file store. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + cache_reserved_in_bytes: + x-version-added: '2.7' + description: Total number of cache bytes reserved available to this Java virtual machine on this file store. + $ref: '_common.yaml#/components/schemas/ByteCount' + free: + description: Total amount of unallocated disk space in the file store. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + free_in_bytes: + description: Total number of unallocated bytes in the file store. + $ref: '_common.yaml#/components/schemas/ByteCount' + mount: + description: 'Mount point of the file store (for example: `/dev/sda2`).' + type: string + path: + description: Path to the file store. + type: string + total: + description: Total size of the file store. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + total_in_bytes: + description: Total size of the file store in bytes. + $ref: '_common.yaml#/components/schemas/ByteCount' + type: + description: 'Type of the file store (ex: ext4).' + type: string + FileSystemTotal: + type: object + properties: + available: + description: |- + Total disk space available to this Java virtual machine on all file stores. + Depending on OS or process level restrictions, this might appear less than `free`. + This is the actual amount of free disk space the OpenSearch node can utilize. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + available_in_bytes: + description: |- + Total number of bytes available to this Java virtual machine on all file stores. + Depending on OS or process level restrictions, this might appear less than `free_in_bytes`. + This is the actual amount of free disk space the OpenSearch node can utilize. + $ref: '_common.yaml#/components/schemas/ByteCount' + free: + description: Total unallocated disk space in all file stores. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + free_in_bytes: + description: Total number of unallocated bytes in all file stores. + $ref: '_common.yaml#/components/schemas/ByteCount' + total: + description: Total size of all file stores. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + total_in_bytes: + description: Total size of all file stores in bytes. + $ref: '_common.yaml#/components/schemas/ByteCount' + cache_reserved: + x-version-added: '2.7' + description: Total size of cache bytes reserved in all file stores. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + cache_reserved_in_bytes: + x-version-added: '2.7' + description: Total size of cache bytes reserved in all file stores. + $ref: '_common.yaml#/components/schemas/ByteCount' + IoStats: + type: object + properties: + devices: + description: |- + Array of disk metrics for each device that is backing an OpenSearch data path. + These disk metrics are probed periodically and averages between the last probe and the current probe are computed. + type: array + items: + $ref: '#/components/schemas/IoStatDevice' + total: + $ref: '#/components/schemas/IoStatDevice' + IoStatDevice: + type: object + properties: + device_name: + description: The Linux device name. + type: string + operations: + description: The total number of read and write operations for the device completed since starting OpenSearch. + type: integer + format: int64 + read_kilobytes: + description: The total number of kilobytes read for the device since starting OpenSearch. + type: integer + format: int64 + read_operations: + description: The total number of read operations for the device completed since starting OpenSearch. + type: integer + format: int64 + write_kilobytes: + description: The total number of kilobytes written for the device since starting OpenSearch. + type: integer + format: int64 + write_operations: + description: The total number of write operations for the device completed since starting OpenSearch. + type: integer + format: int64 + read_time: + type: integer + format: int64 + write_time: + type: integer + format: int64 + queue_size: + type: integer + format: int64 + io_time_in_millis: + $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' + Jvm: + type: object + properties: + buffer_pools: + description: Contains statistics about JVM buffer pools for the node. + type: object + additionalProperties: + $ref: '#/components/schemas/NodeBufferPool' + classes: + $ref: '#/components/schemas/JvmClasses' + gc: + $ref: '#/components/schemas/GarbageCollector' + mem: + $ref: '#/components/schemas/JvmMemoryStats' + threads: + $ref: '#/components/schemas/JvmThreads' + timestamp: + description: Last time JVM statistics were refreshed. + $ref: '_common.yaml#/components/schemas/EpochTimeUnitMillis' + uptime: + description: |- + Human-readable JVM uptime. + Only returned if the `human` query parameter is `true`. + $ref: '_common.yaml#/components/schemas/Duration' + uptime_in_millis: + description: JVM uptime in milliseconds. + $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' + NodeBufferPool: + type: object + properties: + count: + description: Number of buffer pools. + type: integer + format: int64 + total_capacity: + description: Total capacity of buffer pools. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + total_capacity_in_bytes: + description: Total capacity of buffer pools in bytes. + $ref: '_common.yaml#/components/schemas/ByteCount' + used: + description: Size of buffer pools. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + used_in_bytes: + description: Size of buffer pools in bytes. + $ref: '_common.yaml#/components/schemas/ByteCount' + JvmClasses: + type: object + properties: + current_loaded_count: + description: Number of classes currently loaded by JVM. + type: integer + format: int64 + total_loaded_count: + description: Total number of classes loaded since the JVM started. + type: integer + format: int64 + total_unloaded_count: + description: Total number of classes unloaded since the JVM started. + type: integer + format: int64 + GarbageCollector: + type: object + properties: + collectors: + description: Contains statistics about JVM garbage collectors for the node. + type: object + additionalProperties: + $ref: '#/components/schemas/GarbageCollectorTotal' + GarbageCollectorTotal: + type: object + properties: + collection_count: + description: Total number of JVM garbage collectors that collect objects. + type: integer + format: int64 + collection_time: + description: Total time spent by JVM collecting objects. + $ref: '_common.yaml#/components/schemas/Duration' + collection_time_in_millis: + description: Total time, in milliseconds, spent by JVM collecting objects. + $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' + JvmMemoryStats: + type: object + properties: + heap_used: + description: Memory currently in use by the heap. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + heap_used_in_bytes: + description: Memory, in bytes, currently in use by the heap. + $ref: '_common.yaml#/components/schemas/ByteCount' + heap_used_percent: + description: Percentage of memory currently in use by the heap. + $ref: '_common.yaml#/components/schemas/PercentageNumber' + heap_committed: + description: Amount of memory available for use by the heap. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + heap_committed_in_bytes: + description: Amount of memory, in bytes, available for use by the heap. + $ref: '_common.yaml#/components/schemas/ByteCount' + heap_max: + description: Maximum amount of memory available for use by the heap. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + heap_max_in_bytes: + description: Maximum amount of memory, in bytes, available for use by the heap. + $ref: '_common.yaml#/components/schemas/ByteCount' + non_heap_used: + description: Non-heap memory used. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + non_heap_used_in_bytes: + description: Non-heap memory used, in bytes. + $ref: '_common.yaml#/components/schemas/ByteCount' + non_heap_committed: + description: Amount of non-heap memory available. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + non_heap_committed_in_bytes: + description: Amount of non-heap memory available, in bytes. + $ref: '_common.yaml#/components/schemas/ByteCount' + pools: + description: Contains statistics about heap memory usage for the node. + type: object + additionalProperties: + $ref: '#/components/schemas/Pool' + Pool: + type: object + properties: + used: + description: Memory used by the heap. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + used_in_bytes: + description: Memory, in bytes, used by the heap. + $ref: '_common.yaml#/components/schemas/ByteCount' + max: + description: Maximum amount of memory available for use by the heap. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + max_in_bytes: + description: Maximum amount of memory, in bytes, available for use by the heap. + $ref: '_common.yaml#/components/schemas/ByteCount' + peak_used: + description: Largest amount of memory historically used by the heap. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + peak_used_in_bytes: + description: Largest amount of memory, in bytes, historically used by the heap. + $ref: '_common.yaml#/components/schemas/ByteCount' + peak_max: + description: Largest amount of memory historically used by the heap. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + peak_max_in_bytes: + description: Largest amount of memory, in bytes, historically used by the heap. + $ref: '_common.yaml#/components/schemas/ByteCount' + last_gc_stats: + description: Most recent GC cycle stats for a particular memory pool. + $ref: '#/components/schemas/LastGcStats' + LastGcStats: + type: object + properties: + used: + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + used_in_bytes: + $ref: '_common.yaml#/components/schemas/ByteCount' + max: + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + max_in_bytes: + $ref: '_common.yaml#/components/schemas/ByteCount' + usage_percent: + $ref: '_common.yaml#/components/schemas/PercentageNumber' + JvmThreads: + type: object + properties: + count: + description: Number of active threads in use by JVM. + type: integer + format: int64 + peak_count: + description: Highest number of threads used by JVM. + type: integer + format: int64 + OperatingSystem: + type: object + properties: + cpu: + $ref: '#/components/schemas/OperatingSystemCpuStats' + mem: + $ref: '#/components/schemas/ExtendedMemoryStats' + swap: + $ref: '#/components/schemas/MemoryStats' + cgroup: + $ref: '#/components/schemas/CgroupStats' + timestamp: + $ref: '_common.yaml#/components/schemas/EpochTimeUnitMillis' + OperatingSystemCpuStats: + type: object + properties: + percent: + $ref: '_common.yaml#/components/schemas/PercentageNumber' + load_average: + type: object + additionalProperties: + type: number + format: double + ExtendedMemoryStats: + allOf: + - $ref: '#/components/schemas/MemoryStatsBase' + - type: object + properties: + free_percent: + description: Percentage of free memory. + $ref: '_common.yaml#/components/schemas/PercentageNumber' + used_percent: + description: Percentage of used memory. + $ref: '_common.yaml#/components/schemas/PercentageNumber' + MemoryStatsBase: + type: object + properties: + total: + description: Total amount of physical memory. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + total_in_bytes: + description: Total amount of physical memory in bytes. + $ref: '_common.yaml#/components/schemas/ByteCount' + free: + description: Amount of free physical memory. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + free_in_bytes: + description: Amount of free physical memory in bytes. + $ref: '_common.yaml#/components/schemas/ByteCount' + used: + description: Amount of used physical memory. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + used_in_bytes: + description: Amount of used physical memory in bytes. + $ref: '_common.yaml#/components/schemas/ByteCount' + MemoryStats: + allOf: + - $ref: '#/components/schemas/MemoryStatsBase' + - type: object + properties: {} + CgroupStats: + type: object + properties: + cpuacct: + $ref: '#/components/schemas/CgroupCpuAcctStats' + cpu: + $ref: '#/components/schemas/CgroupCpuStats' + memory: + $ref: '#/components/schemas/CgroupMemoryStats' + CgroupCpuAcctStats: + type: object + properties: + control_group: + description: The `cpuacct` control group to which the OpenSearch process belongs. + type: string + usage_nanos: + $ref: '_common.yaml#/components/schemas/DurationValueUnitNanos' + CgroupCpuStats: + type: object + properties: + control_group: + description: The `cpu` control group to which the OpenSearch process belongs. + type: string + cfs_period_micros: + description: The period of time, in microseconds, for how regularly all tasks in the same cgroup as the OpenSearch process should have their access to CPU resources reallocated. + $ref: '_common.yaml#/components/schemas/DurationValueUnitMicros' + cfs_quota_micros: + description: The total amount of time, in microseconds, for which all tasks in the same cgroup as the OpenSearch process can run during one period `cfs_period_micros`. + $ref: '_common.yaml#/components/schemas/DurationValueUnitMicros' + stat: + $ref: '#/components/schemas/CgroupCpuStat' + CgroupCpuStat: + type: object + properties: + number_of_elapsed_periods: + description: The number of reporting periods (as specified by `cfs_period_micros`) that have elapsed. + type: integer + format: int64 + number_of_times_throttled: + description: The number of times all tasks in the same cgroup as the OpenSearch process have been throttled. + type: integer + format: int64 + time_throttled_nanos: + $ref: '_common.yaml#/components/schemas/DurationValueUnitNanos' + CgroupMemoryStats: + type: object + properties: + control_group: + description: The `memory` control group to which the OpenSearch process belongs. + type: string + limit_in_bytes: + description: |- + The maximum amount of user memory (including file cache) allowed for all tasks in the same cgroup as the OpenSearch process. + This value can be too big to store in a `long`, so is returned as a string so that the value returned can exactly match what the underlying operating system interface returns. + Any value that is too large to parse into a `long` almost certainly means no limit has been set for the cgroup. + type: string + usage_in_bytes: + description: |- + The total current memory usage by processes in the cgroup, in bytes, by all tasks in the same cgroup as the OpenSearch process. + This value is stored as a string for consistency with `limit_in_bytes`. + type: string + Process: + type: object + properties: + cpu: + $ref: '#/components/schemas/ProcessCpuStats' + mem: + $ref: '#/components/schemas/ProcessMemoryStats' + open_file_descriptors: + description: Number of opened file descriptors associated with the current or `-1` if not supported. + type: integer + format: int64 + max_file_descriptors: + description: Maximum number of file descriptors allowed on the system, or `-1` if not supported. + type: integer + format: int64 + timestamp: + description: |- + Last time the statistics were refreshed. + Recorded in milliseconds since the Unix Epoch. + $ref: '_common.yaml#/components/schemas/EpochTimeUnitMillis' + ProcessCpuStats: + type: object + properties: + percent: + $ref: '_common.yaml#/components/schemas/PercentageNumber' + total: + $ref: '_common.yaml#/components/schemas/Duration' + total_in_millis: + $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' + required: + - percent + - total_in_millis + ProcessMemoryStats: + type: object + properties: + total_virtual: + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + total_virtual_in_bytes: + $ref: '_common.yaml#/components/schemas/ByteCount' + ScriptCacheStats: + type: object + properties: + sum: + $ref: '#/components/schemas/ScriptStats' + contexts: + type: array + items: + $ref: '#/components/schemas/ScriptContextStats' + required: + - sum + Transport: + type: object + properties: + rx_count: + description: Total number of RX (receive) packets received by the node during internal cluster communication. + type: integer + format: int64 + rx_size: + description: Size of RX packets received by the node during internal cluster communication. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + rx_size_in_bytes: + description: Size, in bytes, of RX packets received by the node during internal cluster communication. + $ref: '_common.yaml#/components/schemas/ByteCount' + server_open: + description: Current number of inbound TCP connections used for internal communication between nodes. + type: integer + format: int64 + tx_count: + description: Total number of TX (transmit) packets sent by the node during internal cluster communication. + type: integer + format: int64 + tx_size: + description: Size of TX packets sent by the node during internal cluster communication. + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + tx_size_in_bytes: + description: Size, in bytes, of TX packets sent by the node during internal cluster communication. + $ref: '_common.yaml#/components/schemas/ByteCount' + total_outbound_connections: + description: |- + The cumulative number of outbound transport connections that this node has opened since it started. + Each transport connection may comprise multiple TCP connections but is only counted once in this statistic. + Transport connections are typically long-lived so this statistic should remain constant in a stable cluster. + type: integer + format: int64 + Discovery: + type: object + properties: + cluster_state_queue: + $ref: '#/components/schemas/ClusterStateQueue' + cluster_state_stats: + $ref: '#/components/schemas/ClusterStateStats' + published_cluster_states: + $ref: '#/components/schemas/PublishedClusterStates' + ClusterStateQueue: + type: object + properties: + total: + description: Total number of cluster states in queue. + type: integer + format: int32 + pending: + description: Number of pending cluster states in queue. + type: integer + format: int32 + committed: + description: Number of committed cluster states in queue. + type: integer + format: int32 + ClusterStateStats: + type: object + properties: + overall: + $ref: '#/components/schemas/ClusterStateOverallStats' + ClusterStateOverallStats: + type: object + properties: + update_count: + type: integer + format: int64 + total_time_in_millis: + $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' + failed_count: + type: integer + format: int64 + PublishedClusterStates: + type: object + properties: + full_states: + description: Number of published cluster states. + type: integer + format: int64 + incompatible_diffs: + description: Number of incompatible differences between published cluster states. + type: integer + format: int64 + compatible_diffs: + description: Number of compatible differences between published cluster states. + type: integer + format: int64 + IndexingPressure: + type: object + properties: + memory: + $ref: '#/components/schemas/IndexingPressureMemory' + ShardIndexingPressureStats: + type: object + properties: + stats: + type: object + additionalProperties: + $ref: '#/components/schemas/ShardIndexingPressurePerShardStats' + enabled: + type: boolean + enforced: + type: boolean + total_rejections_breakup: + $ref: '#/components/schemas/ShardIndexingPressureRejectionsBreakupStats' + total_rejections_breakup_shadow_mode: + $ref: '#/components/schemas/ShardIndexingPressureRejectionsBreakupStats' + ShardIndexingPressurePerShardStats: + type: object + properties: + memory: + $ref: '#/components/schemas/ShardIndexingPressurePerShardMemoryStats' + rejection: + $ref: '#/components/schemas/ShardIndexingPressurePerShardRejectionStats' + last_successful_timestamp: + $ref: '#/components/schemas/ShardIndexingPressurePerShardLastSuccessfulTimestamp' + indexing: + $ref: '#/components/schemas/ShardIndexingPressurePerShardIndexingStats' + memory_allocation: + $ref: '#/components/schemas/ShardIndexingPressurePerShardMemoryAllocationStats' + required: + - indexing + - last_successful_timestamp + - memory + - memory_allocation + - rejection + ShardIndexingPressurePerShardMemoryStats: + type: object + properties: + current: + $ref: '#/components/schemas/ShardIndexingPressurePerShardMemoryStatsDetails' + total: + $ref: '#/components/schemas/ShardIndexingPressurePerShardMemoryStatsDetails' + required: + - current + - total + ShardIndexingPressurePerShardMemoryStatsDetails: + type: object + properties: + coordinating: + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + coordinating_in_bytes: + $ref: '_common.yaml#/components/schemas/ByteCount' + primary: + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + primary_in_bytes: + $ref: '_common.yaml#/components/schemas/ByteCount' + replica: + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + replica_in_bytes: + $ref: '_common.yaml#/components/schemas/ByteCount' + required: + - coordinating_in_bytes + - primary_in_bytes + - replica_in_bytes + ShardIndexingPressurePerShardRejectionStats: + type: object + properties: + coordinating: + $ref: '#/components/schemas/ShardIndexingPressurePerShardRejectionCoordinatingStats' + primary: + $ref: '#/components/schemas/ShardIndexingPressurePerShardRejectionPrimaryStats' + replica: + $ref: '#/components/schemas/ShardIndexingPressurePerShardRejectionReplicaStats' + required: + - coordinating + - primary + - replica + ShardIndexingPressurePerShardRejectionCoordinatingStats: + type: object + properties: + coordinating_rejections: + type: integer + format: int64 + breakup: + $ref: '#/components/schemas/ShardIndexingPressureRejectionsBreakupStats' + breakup_shadow_mode: + $ref: '#/components/schemas/ShardIndexingPressureRejectionsBreakupStats' + required: + - coordinating_rejections + ShardIndexingPressurePerShardRejectionPrimaryStats: + type: object + properties: + primary_rejections: + type: integer + format: int64 + breakup: + $ref: '#/components/schemas/ShardIndexingPressureRejectionsBreakupStats' + breakup_shadow_mode: + $ref: '#/components/schemas/ShardIndexingPressureRejectionsBreakupStats' + required: + - primary_rejections + ShardIndexingPressurePerShardRejectionReplicaStats: + type: object + properties: + replica_rejections: + type: integer + format: int64 + breakup: + $ref: '#/components/schemas/ShardIndexingPressureRejectionsBreakupStats' + breakup_shadow_mode: + $ref: '#/components/schemas/ShardIndexingPressureRejectionsBreakupStats' + required: + - replica_rejections + ShardIndexingPressurePerShardLastSuccessfulTimestamp: + type: object + properties: + coordinating_last_successful_request_timestamp_in_millis: + $ref: '_common.yaml#/components/schemas/EpochTimeUnitMillis' + primary_last_successful_request_timestamp_in_millis: + $ref: '_common.yaml#/components/schemas/EpochTimeUnitMillis' + replica_last_successful_request_timestamp_in_millis: + $ref: '_common.yaml#/components/schemas/EpochTimeUnitMillis' + required: + - coordinating_last_successful_request_timestamp_in_millis + - primary_last_successful_request_timestamp_in_millis + - replica_last_successful_request_timestamp_in_millis + ShardIndexingPressurePerShardIndexingStats: + type: object + properties: + coordinating_time_in_millis: + $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' + coordinating_count: + type: integer + format: int64 + primary_time_in_millis: + $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' + primary_count: + type: integer + format: int64 + replica_time_in_millis: + $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' + replica_count: + type: integer + format: int64 + required: + - coordinating_count + - coordinating_time_in_millis + - primary_count + - primary_time_in_millis + - replica_count + - replica_time_in_millis + ShardIndexingPressurePerShardMemoryAllocationStats: + type: object + properties: + current: + $ref: '#/components/schemas/ShardIndexingPressurePerShardMemoryAllocationCurrentStats' + limit: + $ref: '#/components/schemas/ShardIndexingPressurePerShardMemoryAllocationLimitStats' + required: + - current + - limit + ShardIndexingPressurePerShardMemoryAllocationCurrentStats: + type: object + properties: + current_coordinating_and_primary_bytes: + $ref: '_common.yaml#/components/schemas/ByteCount' + current_replica_bytes: + $ref: '_common.yaml#/components/schemas/ByteCount' + required: + - current_coordinating_and_primary_bytes + - current_replica_bytes + ShardIndexingPressurePerShardMemoryAllocationLimitStats: + type: object + properties: + current_coordinating_and_primary_limits_in_bytes: + $ref: '_common.yaml#/components/schemas/ByteCount' + current_replica_limits_in_bytes: + $ref: '_common.yaml#/components/schemas/ByteCount' + required: + - current_coordinating_and_primary_limits_in_bytes + - current_replica_limits_in_bytes + ShardSearchBackpressureStats: + type: object + properties: + search_task: + $ref: '#/components/schemas/ShardSearchBackpressureTaskStats' + search_shard_task: + $ref: '#/components/schemas/ShardSearchBackpressureTaskStats' + mode: + $ref: '#/components/schemas/ShardSearchBackpressureMode' + ShardSearchBackpressureMode: + type: string + enum: + - disabled + - enforced + - monitor_only + ShardSearchBackpressureTaskStats: + type: object + properties: + resource_tracker_stats: + $ref: '#/components/schemas/ShardSearchBackpressureTaskResourceTrackerStats' + cancellation_stats: + $ref: '#/components/schemas/ShardSearchBackpressureTaskCancellationStats' + completion_count: + x-version-added: '3.0' + type: integer + format: int64 + ShardSearchBackpressureTaskResourceTrackerStats: + type: object + properties: + heap_usage_tracker: + $ref: '#/components/schemas/ShardSearchBackpressureTaskResourceTrackerHeapUsageTrackerStats' + elapsed_time_tracker: + $ref: '#/components/schemas/ShardSearchBackpressureTaskResourceTrackerElapsedTimeTrackerStats' + cpu_usage_tracker: + $ref: '#/components/schemas/ShardSearchBackpressureTaskResourceTrackerCpuUsageTrackerStats' + ShardSearchBackpressureTaskResourceTrackerHeapUsageTrackerStats: + type: object + properties: + cancellation_count: + type: integer + format: int64 + current_max: + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + current_max_bytes: + $ref: '_common.yaml#/components/schemas/ByteCount' + current_avg: + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + current_avg_bytes: + $ref: '_common.yaml#/components/schemas/ByteCount' + rolling_avg: + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + rolling_avg_bytes: + $ref: '_common.yaml#/components/schemas/ByteCount' + ShardSearchBackpressureTaskResourceTrackerElapsedTimeTrackerStats: + type: object + properties: + cancellation_count: + type: integer + format: int64 + current_max: + $ref: '_common.yaml#/components/schemas/Duration' + current_max_millis: + $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' + current_avg: + $ref: '_common.yaml#/components/schemas/Duration' + current_avg_millis: + $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' + ShardSearchBackpressureTaskResourceTrackerCpuUsageTrackerStats: + type: object + properties: + cancellation_count: + type: integer + format: int64 + current_max: + $ref: '_common.yaml#/components/schemas/Duration' + current_max_millis: + $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' + current_avg: + $ref: '_common.yaml#/components/schemas/Duration' + current_avg_millis: + $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' + ShardSearchBackpressureTaskCancellationStats: + type: object + properties: + cancellation_count: + type: integer + format: int64 + cancellation_limit_reached_count: + type: integer + format: int64 + cancelled_task_percentage: + $ref: '_common.yaml#/components/schemas/PercentageNumber' + current_cancellation_eligible_tasks_count: + type: integer + format: int64 + ShardIndexingPressureRejectionsBreakupStats: + type: object + properties: + node_limits: + type: integer + format: int64 + no_successful_request_limits: + type: integer + format: int64 + throughput_degradation_limits: + type: integer + format: int64 + IndexingPressureMemory: + type: object + properties: + limit: + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + limit_in_bytes: + description: |- + Configured memory limit, in bytes, for the indexing requests. + Replica requests have an automatic limit that is 1.5x this value. + $ref: '_common.yaml#/components/schemas/ByteCount' + current: + $ref: '#/components/schemas/PressureMemory' + total: + $ref: '#/components/schemas/PressureMemory' + PressureMemory: + type: object + properties: + all: + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + all_in_bytes: + description: Memory consumed, in bytes, by indexing requests in the coordinating, primary, or replica stage. + $ref: '_common.yaml#/components/schemas/ByteCount' + combined_coordinating_and_primary: + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + combined_coordinating_and_primary_in_bytes: + description: |- + Memory consumed, in bytes, by indexing requests in the coordinating or primary stage. + This value is not the sum of coordinating and primary as a node can reuse the coordinating memory if the primary stage is executed locally. + $ref: '_common.yaml#/components/schemas/ByteCount' + coordinating: + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + coordinating_in_bytes: + description: Memory consumed, in bytes, by indexing requests in the coordinating stage. + $ref: '_common.yaml#/components/schemas/ByteCount' + primary: + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + primary_in_bytes: + description: Memory consumed, in bytes, by indexing requests in the primary stage. + $ref: '_common.yaml#/components/schemas/ByteCount' + replica: + $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' + replica_in_bytes: + description: Memory consumed, in bytes, by indexing requests in the replica stage. + $ref: '_common.yaml#/components/schemas/ByteCount' + coordinating_rejections: + description: Number of indexing requests rejected in the coordinating stage. + type: integer + format: int64 + primary_rejections: + description: Number of indexing requests rejected in the primary stage. + type: integer + format: int64 + replica_rejections: + description: Number of indexing requests rejected in the replica stage. + type: integer + format: int64 diff --git a/spec/schemas/nodes.usage.yaml b/spec/schemas/nodes.usage.yaml index 19deeb842..177eb4406 100644 --- a/spec/schemas/nodes.usage.yaml +++ b/spec/schemas/nodes.usage.yaml @@ -12,35 +12,21 @@ components: - _all - aggregations - rest_actions - ResponseBase: - allOf: - - $ref: 'nodes._common.yaml#/components/schemas/NodesResponseBase' - - type: object - properties: - cluster_name: - $ref: '_common.yaml#/components/schemas/Name' - nodes: - type: object - additionalProperties: - $ref: '#/components/schemas/NodeUsage' - required: - - cluster_name - - nodes NodeUsage: type: object properties: rest_actions: type: object additionalProperties: - type: number + type: integer + format: int64 since: $ref: '_common.yaml#/components/schemas/EpochTimeUnitMillis' timestamp: $ref: '_common.yaml#/components/schemas/EpochTimeUnitMillis' aggregations: type: object - additionalProperties: - type: object + additionalProperties: true required: - since - timestamp diff --git a/tests/default/nodes/info.yaml b/tests/default/nodes/info.yaml index 7e352f8a6..599c31777 100644 --- a/tests/default/nodes/info.yaml +++ b/tests/default/nodes/info.yaml @@ -5,6 +5,8 @@ chapters: - synopsis: Get all nodes. path: /_nodes method: GET + parameters: + human: true response: status: 200 - synopsis: Get nodes. diff --git a/tests/default/nodes/stats.yaml b/tests/default/nodes/stats.yaml index 8886d05e6..9e01d9de6 100644 --- a/tests/default/nodes/stats.yaml +++ b/tests/default/nodes/stats.yaml @@ -7,6 +7,22 @@ chapters: method: GET response: status: 200 + - synopsis: Get stats for all nodes at indices level. + path: /_nodes/stats + method: GET + parameters: + human: true + level: indices + response: + status: 200 + - synopsis: Get stats for all nodes at shards level. + path: /_nodes/stats + method: GET + parameters: + human: true + level: shards + response: + status: 200 - synopsis: Get stats for all nodes with parameters. path: /_nodes/stats method: GET diff --git a/tests/plugins/ml/ml/connectors.yaml b/tests/plugins/ml/ml/connectors.yaml index c19939634..4d4944498 100644 --- a/tests/plugins/ml/ml/connectors.yaml +++ b/tests/plugins/ml/ml/connectors.yaml @@ -41,6 +41,13 @@ chapters: status: 200 output: test_connector_id: payload.connector_id + - synopsis: Get connector. + path: /_plugins/_ml/connectors/{connector_id} + method: GET + parameters: + connector_id: ${create_connector.test_connector_id} + response: + status: 200 - synopsis: Delete connector. path: /_plugins/_ml/connectors/{connector_id} method: DELETE diff --git a/tests/plugins/ml/ml/connectors/search.yaml b/tests/plugins/ml/ml/connectors/search.yaml new file mode 100644 index 000000000..ee4550791 --- /dev/null +++ b/tests/plugins/ml/ml/connectors/search.yaml @@ -0,0 +1,66 @@ +$schema: ../../../../../json_schemas/test_story.schema.yaml + +description: Test the search of connectors. +version: '>= 2.11' +prologues: + - path: /_plugins/_ml/connectors/_create + id: create_connector + method: POST + request: + payload: + name: OpenAI Chat Connector + description: The connector to public OpenAI model service for GPT 3.5 + version: 1 + protocol: http + parameters: + endpoint: api.openai.com + model: gpt-3.5-turbo + credential: + openAI_key: test_api_key + actions: + - action_type: predict + method: POST + url: https://api.openai.com/v1/chat/completions + headers: + Authorization: Bearer Key + request_body: '{ "model": "model", "messages": "messages" }' + output: + test_connector_id: payload.connector_id +epilogues: + - path: /_plugins/_ml/connectors/{connector_id} + method: DELETE + status: [200, 404] + parameters: + connector_id: ${create_connector.test_connector_id} +chapters: + - synopsis: Search connector. + path: /_plugins/_ml/connectors/_search + method: GET + request: + payload: + query: + match_all: {} + size: 1000 + response: + status: 200 + payload: + hits: + hits: + - _score: 1 + - synopsis: Search connector with a connector ID. + path: /_plugins/_ml/connectors/_search + method: POST + request: + payload: + query: + bool: + must: + - terms: + _id: + - ${create_connector.test_connector_id} + response: + status: 200 + payload: + hits: + hits: + - _score: 1 diff --git a/tests/plugins/ml/ml/connectors/update.yaml b/tests/plugins/ml/ml/connectors/update.yaml new file mode 100644 index 000000000..ed8a3913b --- /dev/null +++ b/tests/plugins/ml/ml/connectors/update.yaml @@ -0,0 +1,45 @@ +$schema: ../../../../../json_schemas/test_story.schema.yaml + +description: Test updating a connector. +version: '>= 2.12' +prologues: + - path: /_plugins/_ml/connectors/_create + id: create_connector + method: POST + request: + payload: + name: OpenAI Chat Connector + description: The connector to public OpenAI model service for GPT 3.5 + version: 1 + protocol: http + parameters: + endpoint: api.openai.com + model: gpt-3.5-turbo + credential: + openAI_key: test_api_key + actions: + - action_type: predict + method: POST + url: https://api.openai.com/v1/chat/completions + headers: + Authorization: Bearer Key + request_body: '{ "model": "model", "messages": "messages" }' + output: + test_connector_id: payload.connector_id +epilogues: + - path: /_plugins/_ml/connectors/{connector_id} + method: DELETE + status: [200, 404] + parameters: + connector_id: ${create_connector.test_connector_id} +chapters: + - synopsis: Update connector. + path: /_plugins/_ml/connectors/{connector_id} + method: PUT + parameters: + connector_id: ${create_connector.test_connector_id} + request: + payload: + name: This is the updated name. + response: + status: 200 \ No newline at end of file diff --git a/tests/plugins/ml/ml/model_groups/search.yaml b/tests/plugins/ml/ml/model_groups/search.yaml new file mode 100644 index 000000000..717b87a76 --- /dev/null +++ b/tests/plugins/ml/ml/model_groups/search.yaml @@ -0,0 +1,52 @@ +$schema: ../../../../../json_schemas/test_story.schema.yaml + +description: Test the search of model groups. +version: '>= 2.9' +prologues: + - path: /_plugins/_ml/model_groups/_register + id: create_model_group + method: POST + request: + payload: + name: NLP_Group + description: Model group for NLP models. + output: + test_model_group_id: payload.model_group_id +epilogues: + - path: /_plugins/_ml/model_groups/{model_group_id} + method: DELETE + status: [200, 404] + parameters: + model_group_id: ${create_model_group.test_model_group_id} +chapters: + - synopsis: Search model group. + path: /_plugins/_ml/model_groups/_search + method: GET + request: + payload: + query: + match_all: {} + size: 1000 + response: + status: 200 + payload: + hits: + hits: + - _score: 1 + - synopsis: Search model group with a model group ID. + path: /_plugins/_ml/model_groups/_search + method: POST + request: + payload: + query: + bool: + must: + - terms: + _id: + - ${create_model_group.test_model_group_id} + response: + status: 200 + payload: + hits: + hits: + - _score: 1 diff --git a/tests/plugins/ml/ml/model_groups/update.yaml b/tests/plugins/ml/ml/model_groups/update.yaml new file mode 100644 index 000000000..e9ef14a30 --- /dev/null +++ b/tests/plugins/ml/ml/model_groups/update.yaml @@ -0,0 +1,36 @@ +$schema: ../../../../../json_schemas/test_story.schema.yaml + +description: Test the creation of model groups. +version: '>= 2.9' +prologues: + - path: /_plugins/_ml/model_groups/_register + id: create_model_group + method: POST + request: + payload: + name: NLP_Group + description: Model group for NLP models. + output: + test_model_group_id: payload.model_group_id + - path: /_plugins/_ml/model_groups/{model_group_id} + method: GET + parameters: + model_group_id: ${create_model_group.test_model_group_id} + status: [200, 404] +epilogues: + - path: /_plugins/_ml/model_groups/{model_group_id} + method: DELETE + status: [200, 404] + parameters: + model_group_id: ${create_model_group.test_model_group_id} +chapters: + - synopsis: Update model group. + path: /_plugins/_ml/model_groups/{model_group_id} + method: PUT + parameters: + model_group_id: ${create_model_group.test_model_group_id} + request: + payload: + description: This is the updated description. + response: + status: 200 diff --git a/tools/src/merger/GlobalParamsGenerator.ts b/tools/src/merger/GlobalParamsGenerator.ts index 192e711b9..38daa9c5c 100644 --- a/tools/src/merger/GlobalParamsGenerator.ts +++ b/tools/src/merger/GlobalParamsGenerator.ts @@ -10,6 +10,8 @@ import { type OpenAPIV3 } from 'openapi-types' import _ from 'lodash' import { read_yaml } from '../helpers' +import { is_ref, SpecificationContext } from "../_utils"; +import { SchemaVisitor } from "../_utils/SpecificationVisitor"; export default class GlobalParamsGenerator { global_params: Record @@ -33,13 +35,29 @@ export default class GlobalParamsGenerator { } create_global_params (spec: OpenAPIV3.Document): Record { + const ref_rewriter = new SchemaVisitor((_, schema) => { + if (!is_ref(schema)) return + + if (schema.$ref.startsWith('schemas/')) { + schema.$ref = schema.$ref.replace('schemas/', '#/components/schemas/').replace('.yaml#/components/schemas/', ':') + } + }) + + const ctx = new SpecificationContext('_global_parameters.yaml').child('components').child('parameters') + const params = (spec.components?.parameters ?? {}) as Record _.entries(params).forEach(([original_key, param]) => { const global_key = `_global::${param.in}.${param.name}` _.set(param, 'x-global', true) _.unset(params, original_key) + + if (param.schema != null) { + ref_rewriter.visit_schema(ctx.child(original_key).child('schema'), param.schema) + } + params[global_key] = param }) + return params } }