openapi: '3.1.2' info: title: Elasticsearch API description: "Elasticsearch provides REST APIs that are used by the UI components and can be called directly to configure and access Elasticsearch features.\n## Documentation source and versions\nThis documentation is derived from the `main` branch of the [elasticsearch-specification](https://github.com/elastic/elasticsearch-specification) repository. It is provided under license [Attribution-NonCommercial-NoDerivatives 4.0 International](https://creativecommons.org/licenses/by-nc-nd/4.0/).\nThis documentation contains work-in-progress information for future Elastic Stack releases.\n" license: name: Apache 2.0 url: https://github.com/elastic/elasticsearch-specification/blob/main/LICENSE version: '' x-doc-license: name: Attribution-NonCommercial-NoDerivatives 4.0 International url: https://creativecommons.org/licenses/by-nc-nd/4.0/ x-feedbackLink: label: Feedback url: https://github.com/elastic/docs-content/issues/new?assignees=&labels=feedback%2Ccommunity&projects=&template=api-feedback.yaml&title=%5BFeedback%5D%3A+ paths: '/_async_search/{id}': get: tags: - search summary: Get async search results description: "Retrieve the results of a previously submitted asynchronous search request.\nIf the Elasticsearch security features are enabled, access to the results of a specific async search is restricted to the user or API key that submitted it." operationId: async-search-get parameters: - name: id in: path description: A unique identifier for the async search. required: true schema: $ref: '#/components/schemas/_types.Id' - name: keep_alive in: query description: "The length of time that the async search should be available in the cluster.\nWhen not specified, the `keep_alive` set with the corresponding submit async request will be used.\nOtherwise, it is possible to override the value and extend the validity of the request.\nWhen this period expires, the search, if still running, is cancelled.\nIf the search is completed, its saved results are deleted." schema: $ref: '#/components/schemas/_types.Duration' - name: typed_keys in: query description: Specify whether aggregation and suggester names should be prefixed by their respective types in the response schema: type: boolean - name: wait_for_completion_timeout in: query description: "Specifies to wait for the search to be completed up until the provided timeout.\nFinal results will be returned if available before the timeout expires, otherwise the currently available results will be returned once the timeout expires.\nBy default no timeout is set meaning that the currently available results will be returned without any additional wait." schema: $ref: '#/components/schemas/_types.Duration' - name: return_intermediate_results in: query description: "Specifies whether the response should contain intermediate results if the query is still running when the wait_for_completion_timeout\nexpires or if no wait_for_completion_timeout is specified.\nIf true and the search is still running, the search response\nwill include any hits and partial aggregations that are available.\nIf false and the search is still running, the search response will not include any hits (but possibly include\ntotal hits) nor will include any partial aggregations.\nWhen not specified, the intermediate results are returned for running queries." schema: type: boolean responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/async_search._types.AsyncSearchDocumentResponseBase' examples: AsyncSearchGetResponseExample1: description: A succesful response from `GET /_async_search/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=`. value: "{\n \"id\" : \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n \"is_partial\" : false, \n \"is_running\" : false, \n \"start_time_in_millis\" : 1583945890986,\n \"expiration_time_in_millis\" : 1584377890986, \n \"completion_time_in_millis\" : 1583945903130, \n \"response\" : {\n \"took\" : 12144,\n \"timed_out\" : false,\n \"num_reduce_phases\" : 46, \n \"_shards\" : {\n \"total\" : 562,\n \"successful\" : 188, \n \"skipped\" : 0,\n \"failed\" : 0\n },\n \"hits\" : {\n \"total\" : {\n \"value\" : 456433,\n \"relation\" : \"eq\"\n },\n \"max_score\" : null,\n \"hits\" : [ ]\n },\n \"aggregations\" : { \n \"sale_date\" : {\n \"buckets\" : []\n }\n }\n }\n}" '400': description: '' content: application/json: schema: $ref: '#/components/schemas/async_search._types.AsyncSearchResponseException' '404': description: '' content: application/json: schema: $ref: '#/components/schemas/async_search._types.AsyncSearchResponseException' '429': description: '' content: application/json: schema: $ref: '#/components/schemas/async_search._types.AsyncSearchResponseException' '500': description: '' content: application/json: schema: $ref: '#/components/schemas/async_search._types.AsyncSearchResponseException' x-state: Generally available; Added in 7.7.0 x-codeSamples: - lang: Console source: "GET /_async_search/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\n" - lang: Python source: "resp = client.async_search.get(\n id=\"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n)" - lang: JavaScript source: "const response = await client.asyncSearch.get({\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n});" - lang: Ruby source: "response = client.async_search.get(\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\"\n)" - lang: PHP source: "$resp = $client->asyncSearch()->get([\n \"id\" => \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_async_search/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc="' - lang: C# source: 'var response = await client.AsyncSearch.GetAsync(id: "FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=");' - lang: Java source: "client.asyncSearch().get(g -> g\n .id(\"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - search summary: Delete an async search description: "If the asynchronous search is still running, it is cancelled.\nOtherwise, the saved search results are deleted.\nIf the Elasticsearch security features are enabled, the deletion of a specific async search is restricted to: the authenticated user that submitted the original search request; users that have the `cancel_task` cluster privilege.\n\n## Required authorization\n\n* Cluster privileges: `cancel_task`\n" operationId: async-search-delete parameters: - name: id in: path description: A unique identifier for the async search. required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 7.7.0 x-codeSamples: - lang: Console source: "DELETE /_async_search/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\n" - lang: Python source: "resp = client.async_search.delete(\n id=\"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n)" - lang: JavaScript source: "const response = await client.asyncSearch.delete({\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n});" - lang: Ruby source: "response = client.async_search.delete(\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\"\n)" - lang: PHP source: "$resp = $client->asyncSearch()->delete([\n \"id\" => \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_async_search/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc="' - lang: C# source: 'var response = await client.AsyncSearch.DeleteAsync(id: "FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=");' - lang: Java source: "client.asyncSearch().delete(d -> d\n .id(\"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_async_search/status/{id}': get: tags: - search summary: Get the async search status description: "Get the status of a previously submitted async search request given its identifier, without retrieving search results.\nIf the Elasticsearch security features are enabled, the access to the status of a specific async search is restricted to:\n\n* The user or API key that submitted the original async search request.\n* Users that have the `monitor` cluster privilege or greater privileges.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: async-search-status parameters: - name: id in: path description: A unique identifier for the async search. required: true schema: $ref: '#/components/schemas/_types.Id' - name: keep_alive in: query description: "The length of time that the async search needs to be available.\nOngoing async searches and any saved search results are deleted after this period." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 5d responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/async_search.status.StatusResponseBase' examples: AsyncSearchStatusResponseExample1: summary: An active async search description: 'A succesful response from `GET /_async_search/status/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=`, which retrieves the status of a previously submitted async search without the results.' value: "{\n \"id\" : \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n \"is_running\" : true,\n \"is_partial\" : true,\n \"start_time_in_millis\" : 1583945890986,\n \"expiration_time_in_millis\" : 1584377890986,\n \"_shards\" : {\n \"total\" : 562,\n \"successful\" : 188, \n \"skipped\" : 0,\n \"failed\" : 0\n }\n}" AsyncSearchStatusResponseExample2: summary: A completed async search description: "A succesful response from `GET /_async_search/status/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=` for an async search that has completed. The status response has an additional `completion_status` field that shows the status code of the completed async search.\n" value: "{\n \"id\" : \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n \"is_running\" : false,\n \"is_partial\" : false,\n \"start_time_in_millis\" : 1583945890986,\n \"expiration_time_in_millis\" : 1584377890986,\n \"_shards\" : {\n \"total\" : 562,\n \"successful\" : 562,\n \"skipped\" : 0,\n \"failed\" : 0\n },\n\"completion_status\" : 200 \n}" AsyncSearchStatusResponseExample3: summary: A failed async search description: "A response from `GET /_async_search/status/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=` for an async search that has completed with an error. The status response has an additional `completion_status` field that shows the status code of the completed async search.\n" value: "{\n \"id\" : \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n \"is_running\" : false,\n \"is_partial\" : true,\n \"start_time_in_millis\" : 1583945890986,\n \"expiration_time_in_millis\" : 1584377890986,\n \"_shards\" : {\n \"total\" : 562,\n \"successful\" : 450,\n \"skipped\" : 0,\n \"failed\" : 112\n },\n\"completion_status\" : 503 \n}" x-state: Generally available; Added in 7.11.0 x-codeSamples: - lang: Console source: "GET /_async_search/status/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\n" - lang: Python source: "resp = client.async_search.status(\n id=\"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n)" - lang: JavaScript source: "const response = await client.asyncSearch.status({\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n});" - lang: Ruby source: "response = client.async_search.status(\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\"\n)" - lang: PHP source: "$resp = $client->asyncSearch()->status([\n \"id\" => \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_async_search/status/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc="' - lang: C# source: 'var response = await client.AsyncSearch.StatusAsync(id: "FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=");' - lang: Java source: "client.asyncSearch().status(s -> s\n .id(\"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_async_search': post: tags: - search summary: "Run an async search\n" description: "**All methods and paths for this operation:**\n\n
\n POST\n /_async_search\n
\n
\n POST\n /{index}/_async_search\n
\n \n\nWhen the primary sort of the results is an indexed field, shards get sorted based on minimum and maximum value that they hold for that field. Partial results become available following the sort criteria that was requested.\n\nWarning: Asynchronous search does not support scroll or search requests that include only the suggest section.\n\nBy default, Elasticsearch does not allow you to store an async search response larger than 10Mb and an attempt to do this results in an error.\nThe maximum allowed size for a stored async search response can be set by changing the `search.max_async_search_response_size` cluster level setting.\n\n## Required authorization\n\n* Index privileges: `read`\n" operationId: async-search-submit parameters: - $ref: '#/components/parameters/async_search.submit-index' - $ref: '#/components/parameters/async_search.submit-wait_for_completion_timeout' - $ref: '#/components/parameters/async_search.submit-keep_alive' - $ref: '#/components/parameters/async_search.submit-keep_on_completion' - $ref: '#/components/parameters/async_search.submit-allow_no_indices' - $ref: '#/components/parameters/async_search.submit-allow_partial_search_results' - $ref: '#/components/parameters/async_search.submit-analyzer' - $ref: '#/components/parameters/async_search.submit-analyze_wildcard' - $ref: '#/components/parameters/async_search.submit-batched_reduce_size' - $ref: '#/components/parameters/async_search.submit-ccs_minimize_roundtrips' - $ref: '#/components/parameters/async_search.submit-default_operator' - $ref: '#/components/parameters/async_search.submit-df' - $ref: '#/components/parameters/async_search.submit-docvalue_fields' - $ref: '#/components/parameters/async_search.submit-expand_wildcards' - $ref: '#/components/parameters/async_search.submit-explain' - $ref: '#/components/parameters/async_search.submit-ignore_throttled' - $ref: '#/components/parameters/async_search.submit-ignore_unavailable' - $ref: '#/components/parameters/async_search.submit-lenient' - $ref: '#/components/parameters/async_search.submit-max_concurrent_shard_requests' - $ref: '#/components/parameters/async_search.submit-preference' - $ref: '#/components/parameters/async_search.submit-request_cache' - $ref: '#/components/parameters/async_search.submit-routing' - $ref: '#/components/parameters/async_search.submit-search_type' - $ref: '#/components/parameters/async_search.submit-stats' - $ref: '#/components/parameters/async_search.submit-stored_fields' - $ref: '#/components/parameters/async_search.submit-suggest_field' - $ref: '#/components/parameters/async_search.submit-suggest_mode' - $ref: '#/components/parameters/async_search.submit-suggest_size' - $ref: '#/components/parameters/async_search.submit-suggest_text' - $ref: '#/components/parameters/async_search.submit-terminate_after' - $ref: '#/components/parameters/async_search.submit-timeout' - $ref: '#/components/parameters/async_search.submit-track_total_hits' - $ref: '#/components/parameters/async_search.submit-track_scores' - $ref: '#/components/parameters/async_search.submit-typed_keys' - $ref: '#/components/parameters/async_search.submit-rest_total_hits_as_int' - $ref: '#/components/parameters/async_search.submit-version' - $ref: '#/components/parameters/async_search.submit-_source' - $ref: '#/components/parameters/async_search.submit-_source_excludes' - $ref: '#/components/parameters/async_search.submit-_source_includes' - $ref: '#/components/parameters/async_search.submit-seq_no_primary_term' - $ref: '#/components/parameters/async_search.submit-q' - $ref: '#/components/parameters/async_search.submit-size' - $ref: '#/components/parameters/async_search.submit-from' - $ref: '#/components/parameters/async_search.submit-sort' requestBody: $ref: '#/components/requestBodies/async_search.submit' responses: '200': $ref: '#/components/responses/async_search.submit-200' '400': $ref: '#/components/responses/async_search.submit-400' '404': $ref: '#/components/responses/async_search.submit-404' '429': $ref: '#/components/responses/async_search.submit-429' '500': $ref: '#/components/responses/async_search.submit-500' x-state: Generally available; Added in 7.7.0 x-codeSamples: - lang: Console source: "POST /sales*/_async_search?size=0\n{\n \"sort\": [\n { \"date\": { \"order\": \"asc\" } }\n ],\n \"aggs\": {\n \"sale_date\": {\n \"date_histogram\": {\n \"field\": \"date\",\n \"calendar_interval\": \"1d\"\n }\n }\n }\n}" - lang: Python source: "resp = client.async_search.submit(\n index=\"sales*\",\n size=\"0\",\n sort=[\n {\n \"date\": {\n \"order\": \"asc\"\n }\n }\n ],\n aggs={\n \"sale_date\": {\n \"date_histogram\": {\n \"field\": \"date\",\n \"calendar_interval\": \"1d\"\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.asyncSearch.submit({\n index: \"sales*\",\n size: 0,\n sort: [\n {\n date: {\n order: \"asc\",\n },\n },\n ],\n aggs: {\n sale_date: {\n date_histogram: {\n field: \"date\",\n calendar_interval: \"1d\",\n },\n },\n },\n});" - lang: Ruby source: "response = client.async_search.submit(\n index: \"sales*\",\n size: \"0\",\n body: {\n \"sort\": [\n {\n \"date\": {\n \"order\": \"asc\"\n }\n }\n ],\n \"aggs\": {\n \"sale_date\": {\n \"date_histogram\": {\n \"field\": \"date\",\n \"calendar_interval\": \"1d\"\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->asyncSearch()->submit([\n \"index\" => \"sales*\",\n \"size\" => \"0\",\n \"body\" => [\n \"sort\" => array(\n [\n \"date\" => [\n \"order\" => \"asc\",\n ],\n ],\n ),\n \"aggs\" => [\n \"sale_date\" => [\n \"date_histogram\" => [\n \"field\" => \"date\",\n \"calendar_interval\" => \"1d\",\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"sort":[{"date":{"order":"asc"}}],"aggs":{"sale_date":{"date_histogram":{"field":"date","calendar_interval":"1d"}}}}'' "$ELASTICSEARCH_URL/sales*/_async_search?size=0"' - lang: C# source: "var response = await client.AsyncSearch\n .SubmitAsync(d1 => d1\n .Indices(new[] { \"sales*\" })\n .Aggregations(d2 => d2\n .Add(\"sale_date\", d3 => d3\n .DateHistogram(d4 => d4\n .CalendarInterval(CalendarInterval.Day)\n .Field(x => x.Date)\n )\n )\n )\n .Sort(d2 => d2\n .Field(d3 => d3\n .Field(x => x.Date)\n .Order(SortOrder.Asc)\n )\n )\n );" - lang: Java source: "client.asyncSearch().submit(s -> s\n .aggregations(\"sale_date\", a -> a\n .dateHistogram(d -> d\n .calendarInterval(CalendarInterval.Day)\n .field(\"date\")\n )\n )\n .index(\"sales*\")\n .size(0)\n .sort(so -> so\n .field(f -> f\n .field(\"date\")\n .order(SortOrder.Asc)\n )\n )\n,Void.class);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_bulk': put: tags: - document summary: "Bulk index or delete documents\n" description: "**All methods and paths for this operation:**\n\n
\n POST\n /_bulk\n
\n
\n PUT\n /_bulk\n
\n
\n POST\n /{index}/_bulk\n
\n
\n PUT\n /{index}/_bulk\n
\n \n\nPerform multiple `index`, `create`, `delete`, and `update` actions in a single request.\nThis reduces overhead and can greatly increase indexing speed.\n\nIf the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or index alias:\n\n* To use the `create` action, you must have the `create_doc`, `create`, `index`, or `write` index privilege. Data streams support only the `create` action.\n* To use the `index` action, you must have the `create`, `index`, or `write` index privilege.\n* To use the `delete` action, you must have the `delete` or `write` index privilege.\n* To use the `update` action, you must have the `index` or `write` index privilege.\n* To automatically create a data stream or index with a bulk API request, you must have the `auto_configure`, `create_index`, or `manage` index privilege.\n* To make the result of a bulk operation visible to search using the `refresh` parameter, you must have the `maintenance` or `manage` index privilege.\n\nAutomatic data stream creation requires a matching index template with data stream enabled.\n\nThe actions are specified in the request body using a newline delimited JSON (NDJSON) structure:\n\n```\naction_and_meta_data\\n\noptional_source\\n\naction_and_meta_data\\n\noptional_source\\n\n....\naction_and_meta_data\\n\noptional_source\\n\n```\n\nThe `index` and `create` actions expect a source on the next line and have the same semantics as the `op_type` parameter in the standard index API.\nA `create` action fails if a document with the same ID already exists in the target\nAn `index` action adds or replaces a document as necessary.\n\nNOTE: Data streams support only the `create` action.\nTo update or delete a document in a data stream, you must target the backing index containing the document.\n\nAn `update` action expects that the partial doc, upsert, and script and its options are specified on the next line.\n\nA `delete` action does not expect a source on the next line and has the same semantics as the standard delete API.\n\nNOTE: The final line of data must end with a newline character (`\\n`).\nEach newline character may be preceded by a carriage return (`\\r`).\nWhen sending NDJSON data to the `_bulk` endpoint, use a `Content-Type` header of `application/json` or `application/x-ndjson`.\nBecause this format uses literal newline characters (`\\n`) as delimiters, make sure that the JSON actions and sources are not pretty printed.\n\nIf you provide a target in the request path, it is used for any actions that don't explicitly specify an `_index` argument.\n\nA note on the format: the idea here is to make processing as fast as possible.\nAs some of the actions are redirected to other shards on other nodes, only `action_meta_data` is parsed on the receiving node side.\n\nClient libraries using this protocol should try and strive to do something similar on the client side, and reduce buffering as much as possible.\n\nThere is no \"correct\" number of actions to perform in a single bulk request.\nExperiment with different settings to find the optimal size for your particular workload.\nNote that Elasticsearch limits the maximum size of a HTTP request to 100mb by default so clients must ensure that no request exceeds this size.\nIt is not possible to index a single document that exceeds the size limit, so you must pre-process any such documents into smaller pieces before sending them to Elasticsearch.\nFor instance, split documents into pages or chapters before indexing them, or store raw binary data in a system outside Elasticsearch and replace the raw data with a link to the external system in the documents that you send to Elasticsearch.\n\n**Client suppport for bulk requests**\n\nSome of the officially supported clients provide helpers to assist with bulk requests and reindexing:\n\n* Go: Check out `esutil.BulkIndexer`\n* Perl: Check out `Search::Elasticsearch::Client::5_0::Bulk` and `Search::Elasticsearch::Client::5_0::Scroll`\n* Python: Check out `elasticsearch.helpers.*`\n* JavaScript: Check out `client.helpers.*`\n* Java: Check out `co.elastic.clients.elasticsearch._helpers.bulk.BulkIngester`\n* .NET: Check out `BulkAllObservable`\n* PHP: Check out bulk indexing.\n* Ruby: Check out `Elasticsearch::Helpers::BulkHelper`\n\n**Submitting bulk requests with cURL**\n\nIf you're providing text file input to `curl`, you must use the `--data-binary` flag instead of plain `-d`.\nThe latter doesn't preserve newlines. For example:\n\n```\n$ cat requests\n{ \"index\" : { \"_index\" : \"test\", \"_id\" : \"1\" } }\n{ \"field1\" : \"value1\" }\n$ curl -s -H \"Content-Type: application/x-ndjson\" -XPOST localhost:9200/_bulk --data-binary \"@requests\"; echo\n{\"took\":7, \"errors\": false, \"items\":[{\"index\":{\"_index\":\"test\",\"_id\":\"1\",\"_version\":1,\"result\":\"created\",\"forced_refresh\":false}}]}\n```\n\n**Optimistic concurrency control**\n\nEach `index` and `delete` action within a bulk API call may include the `if_seq_no` and `if_primary_term` parameters in their respective action and meta data lines.\nThe `if_seq_no` and `if_primary_term` parameters control how operations are run, based on the last modification to existing documents. See Optimistic concurrency control for more details.\n\n**Versioning**\n\nEach bulk item can include the version value using the `version` field.\nIt automatically follows the behavior of the index or delete operation based on the `_version` mapping.\nIt also support the `version_type`.\n\n**Routing**\n\nEach bulk item can include the routing value using the `routing` field.\nIt automatically follows the behavior of the index or delete operation based on the `_routing` mapping.\n\nNOTE: Data streams do not support custom routing unless they were created with the `allow_custom_routing` setting enabled in the template.\n\n**Refresh**\n\nControl when the changes made by this request are visible to search.\n\nNOTE: Only the shards that receive the bulk request will be affected by refresh.\nImagine a `_bulk?refresh=wait_for` request with three documents in it that happen to be routed to different shards in an index with five shards.\nThe request will only wait for those three shards to refresh.\nThe other two shards that make up the index do not participate in the `_bulk` request at all.\n\nYou might want to disable the refresh interval temporarily to improve indexing throughput for large bulk requests.\nRefer to the linked documentation for step-by-step instructions using the index settings API.\n\n## Required authorization\n\n* Index privileges: `create_doc`,`create`,`delete`,`index`,`write`\n" externalDocs: description: About tune for indexing speed url: https://www.elastic.co/docs/deploy-manage/production-guidance/optimize-performance/indexing-speed#disable-refresh-interval x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/docs-bulk.html operationId: bulk parameters: - $ref: '#/components/parameters/bulk-index' - $ref: '#/components/parameters/bulk-include_source_on_error' - $ref: '#/components/parameters/bulk-list_executed_pipelines' - $ref: '#/components/parameters/bulk-pipeline' - $ref: '#/components/parameters/bulk-refresh' - $ref: '#/components/parameters/bulk-routing' - $ref: '#/components/parameters/bulk-_source' - $ref: '#/components/parameters/bulk-_source_excludes' - $ref: '#/components/parameters/bulk-_source_includes' - $ref: '#/components/parameters/bulk-timeout' - $ref: '#/components/parameters/bulk-wait_for_active_shards' - $ref: '#/components/parameters/bulk-require_alias' - $ref: '#/components/parameters/bulk-require_data_stream' requestBody: $ref: '#/components/requestBodies/bulk' responses: '200': $ref: '#/components/responses/bulk-200' x-state: Generally available x-codeSamples: - lang: Console source: "POST _bulk\n{ \"index\" : { \"_index\" : \"test\", \"_id\" : \"1\" } }\n{ \"field1\" : \"value1\" }\n{ \"delete\" : { \"_index\" : \"test\", \"_id\" : \"2\" } }\n{ \"create\" : { \"_index\" : \"test\", \"_id\" : \"3\" } }\n{ \"field1\" : \"value3\" }\n{ \"update\" : {\"_id\" : \"1\", \"_index\" : \"test\"} }\n{ \"doc\" : {\"field2\" : \"value2\"} }" - lang: Python source: "resp = client.bulk(\n operations=[\n {\n \"index\": {\n \"_index\": \"test\",\n \"_id\": \"1\"\n }\n },\n {\n \"field1\": \"value1\"\n },\n {\n \"delete\": {\n \"_index\": \"test\",\n \"_id\": \"2\"\n }\n },\n {\n \"create\": {\n \"_index\": \"test\",\n \"_id\": \"3\"\n }\n },\n {\n \"field1\": \"value3\"\n },\n {\n \"update\": {\n \"_id\": \"1\",\n \"_index\": \"test\"\n }\n },\n {\n \"doc\": {\n \"field2\": \"value2\"\n }\n }\n ],\n)" - lang: JavaScript source: "const response = await client.bulk({\n operations: [\n {\n index: {\n _index: \"test\",\n _id: \"1\",\n },\n },\n {\n field1: \"value1\",\n },\n {\n delete: {\n _index: \"test\",\n _id: \"2\",\n },\n },\n {\n create: {\n _index: \"test\",\n _id: \"3\",\n },\n },\n {\n field1: \"value3\",\n },\n {\n update: {\n _id: \"1\",\n _index: \"test\",\n },\n },\n {\n doc: {\n field2: \"value2\",\n },\n },\n ],\n});" - lang: Ruby source: "response = client.bulk(\n body: [\n {\n \"index\": {\n \"_index\": \"test\",\n \"_id\": \"1\"\n }\n },\n {\n \"field1\": \"value1\"\n },\n {\n \"delete\": {\n \"_index\": \"test\",\n \"_id\": \"2\"\n }\n },\n {\n \"create\": {\n \"_index\": \"test\",\n \"_id\": \"3\"\n }\n },\n {\n \"field1\": \"value3\"\n },\n {\n \"update\": {\n \"_id\": \"1\",\n \"_index\": \"test\"\n }\n },\n {\n \"doc\": {\n \"field2\": \"value2\"\n }\n }\n ]\n)" - lang: PHP source: "$resp = $client->bulk([\n \"body\" => array(\n [\n \"index\" => [\n \"_index\" => \"test\",\n \"_id\" => \"1\",\n ],\n ],\n [\n \"field1\" => \"value1\",\n ],\n [\n \"delete\" => [\n \"_index\" => \"test\",\n \"_id\" => \"2\",\n ],\n ],\n [\n \"create\" => [\n \"_index\" => \"test\",\n \"_id\" => \"3\",\n ],\n ],\n [\n \"field1\" => \"value3\",\n ],\n [\n \"update\" => [\n \"_id\" => \"1\",\n \"_index\" => \"test\",\n ],\n ],\n [\n \"doc\" => [\n \"field2\" => \"value2\",\n ],\n ],\n ),\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/x-ndjson" -d $''{"index":{"_index":"test","_id":"1"}}\n{"field1":"value1"}\n{"delete":{"_index":"test","_id":"2"}}\n{"create":{"_index":"test","_id":"3"}}\n{"field1":"value3"}\n{"update":{"_id":"1","_index":"test"}}\n{"doc":{"field2":"value2"}}\n'' "$ELASTICSEARCH_URL/_bulk"' - lang: C# source: "var response = await client\n .BulkAsync(new BulkRequest()\n {\n Operations = new global::Elastic.Clients.Elasticsearch.Core.Bulk.BulkOperationsCollection\n {\n new global::Elastic.Clients.Elasticsearch.Core.Bulk.BulkIndexOperation(JsonSerializer.Deserialize(\"\"\"\n {\n \"field1\": \"value1\"\n }\n \"\"\"))\n {\n Id = \"1\",\n Index = \"test\"\n },\n new global::Elastic.Clients.Elasticsearch.Core.Bulk.BulkDeleteOperation(\"2\")\n {\n Index = \"test\"\n },\n new global::Elastic.Clients.Elasticsearch.Core.Bulk.BulkCreateOperation(JsonSerializer.Deserialize(\"\"\"\n {\n \"field1\": \"value3\"\n }\n \"\"\"))\n {\n Id = \"3\",\n Index = \"test\"\n },\n new global::Elastic.Clients.Elasticsearch.Core.Bulk.BulkUpdateOperation(\"1\")\n {\n Index = \"test\",\n Doc = JsonSerializer.Deserialize(\"\"\"\n {\n \"field2\": \"value2\"\n }\n \"\"\")\n }\n }\n });" x-metaTags: - content: Elasticsearch name: product_name '/_reindex/{task_id}/_cancel': post: tags: - reindex summary: Cancel an ongoing reindex task description: "If `wait_for_completion` is `true` (the default), the response contains the final task state after cancellation.\nIf `wait_for_completion` is `false`, the response contains only `acknowledged: true`.\n\nThis API follows reindex tasks across node-shutdown relocations, so callers can\nkeep using the original task ID throughout the lifetime of the operation.\nReturned task IDs and timings reflect the original task, not its relocated successor.\nRelocated task IDs are also supported. They are followed transparently and return the task ID and timings of the original task.\n\nWhen the task ID cannot be cancelled (unknown ID, non-reindex task, sliced child, finished task, or node left with no stored result), the API returns the following response with a 404 status code:\n```\n{\n \"error\": {\n \"type\": \"resource_not_found_exception\",\n \"reason\": \"reindex task [r1A2WoRbTwKZ516z6NEs5A:36619] either not found or completed\"\n },\n \"status\": 404\n}\n```\n\nDuring a brief handoff window of a node-shutdown relocation, you may receive the response below with a 503 status code.\nRetry with the same task ID; the retry follows the relocated task transparently.\n```\n{\n \"error\": {\n \"type\": \"status_exception\",\n \"reason\": \"cannot cancel task [36619] because it is being relocated\"\n },\n \"status\": 503\n}\n```\n\n## Required authorization\n\n* Cluster privileges: `manage_reindex`\n" operationId: cancel-reindex parameters: - name: task_id in: path description: The ID of the reindex task to cancel. required: true schema: $ref: '#/components/schemas/_types.TaskId' - name: wait_for_completion in: query description: "If `true` (the default), the request blocks until the cancellation is complete and returns the final task state.\nIf `false`, the request returns immediately with `acknowledged: true`." schema: type: boolean default: true responses: '200': description: '' content: application/json: schema: type: object properties: acknowledged: type: boolean description: Present and `true` when `wait_for_completion=false`. completed: type: boolean description: Whether the reindex task has completed. Present when `wait_for_completion=true`. id: allOf: - $ref: '#/components/schemas/_types.TaskId' description: The ID of the reindex task. The value is the ID assigned when the task was first created and remains stable across node-shutdown relocations. Present when `wait_for_completion=true`. description: type: string description: A sanitized description of the reindex operation. start_time_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: 'The time at which the reindex task started, in milliseconds since the Unix epoch.' start_time: type: string description: 'The time at which the reindex task started, as an ISO 8601 formatted string.' running_time: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The elapsed running time of the reindex task, in a human-readable format.\nOnly present when the request includes the `?human=true` query parameter." running_time_in_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' description: 'The elapsed running time of the reindex task, in nanoseconds.' cancelled: type: boolean description: Whether the reindex task has been cancelled. status: allOf: - $ref: '#/components/schemas/_types.ReindexStatus' description: The status of the reindex operation at the time of cancellation. error: allOf: - $ref: '#/components/schemas/_types.ErrorCause' description: 'The error that caused the reindex task to fail, if any.' response: allOf: - $ref: '#/components/schemas/_types.ReindexTaskResult' description: 'The final result of the reindex operation, if it completed before being cancelled.' examples: CancelReindexResponseExample1: summary: Cancellation completed description: "A successful response from `POST _reindex/{task_id}/_cancel` (the default `wait_for_completion=true`). The response includes the final task state with `cancelled: true` and the `response` block summarising work done before cancellation.\n" value: "{\n \"completed\": true,\n \"id\": \"iXIKIbk_T4aF05n5iTA0nA:876\",\n \"description\": \"reindex from [cancel_reindex_src] to [cancel_reindex_dst]\",\n \"start_time_in_millis\": 1778265634844,\n \"running_time_in_nanos\": 1096397958,\n \"cancelled\": true,\n \"status\": {\n \"total\": 170,\n \"updated\": 0,\n \"created\": 16,\n \"deleted\": 0,\n \"batches\": 8,\n \"version_conflicts\": 0,\n \"noops\": 0,\n \"retries\": {\n \"bulk\": 0,\n \"search\": 0\n },\n \"throttled_millis\": 941,\n \"requests_per_second\": 17.0,\n \"canceled\": \"by user request\",\n \"throttled_until_millis\": 0,\n \"slices\": [\n {\n \"slice_id\": 0,\n \"total\": 75,\n \"updated\": 0,\n \"created\": 6,\n \"deleted\": 0,\n \"batches\": 3,\n \"version_conflicts\": 0,\n \"noops\": 0,\n \"retries\": {\n \"bulk\": 0,\n \"search\": 0\n },\n \"throttled_millis\": 235,\n \"requests_per_second\": -1.0,\n \"canceled\": \"by user request\",\n \"throttled_until_millis\": 0\n },\n {\n \"slice_id\": 1,\n \"total\": 95,\n \"updated\": 0,\n \"created\": 10,\n \"deleted\": 0,\n \"batches\": 5,\n \"version_conflicts\": 0,\n \"noops\": 0,\n \"retries\": {\n \"bulk\": 0,\n \"search\": 0\n },\n \"throttled_millis\": 705,\n \"requests_per_second\": -1.0,\n \"canceled\": \"by user request\",\n \"throttled_until_millis\": 0\n }\n ]\n },\n \"response\": {\n \"took\": 1074,\n \"timed_out\": false,\n \"total\": 170,\n \"updated\": 0,\n \"created\": 16,\n \"deleted\": 0,\n \"batches\": 8,\n \"version_conflicts\": 0,\n \"noops\": 0,\n \"retries\": {\n \"bulk\": 0,\n \"search\": 0\n },\n \"throttled\": \"941.1ms\",\n \"throttled_millis\": 941,\n \"requests_per_second\": 17.0,\n \"canceled\": \"by user request\",\n \"throttled_until\": \"0s\",\n \"throttled_until_millis\": 0,\n \"slices\": [\n {\n \"slice_id\": 0,\n \"total\": 75,\n \"updated\": 0,\n \"created\": 6,\n \"deleted\": 0,\n \"batches\": 3,\n \"version_conflicts\": 0,\n \"noops\": 0,\n \"retries\": {\n \"bulk\": 0,\n \"search\": 0\n },\n \"throttled\": \"235.2ms\",\n \"throttled_millis\": 235,\n \"requests_per_second\": -1.0,\n \"canceled\": \"by user request\",\n \"throttled_until\": \"0s\",\n \"throttled_until_millis\": 0\n },\n {\n \"slice_id\": 1,\n \"total\": 95,\n \"updated\": 0,\n \"created\": 10,\n \"deleted\": 0,\n \"batches\": 5,\n \"version_conflicts\": 0,\n \"noops\": 0,\n \"retries\": {\n \"bulk\": 0,\n \"search\": 0\n },\n \"throttled\": \"705.8ms\",\n \"throttled_millis\": 705,\n \"requests_per_second\": -1.0,\n \"canceled\": \"by user request\",\n \"throttled_until\": \"0s\",\n \"throttled_until_millis\": 0\n }\n ],\n \"failures\": []\n }\n}" CancelReindexResponseExample2: summary: Cancellation acknowledged description: "A successful response from `POST _reindex/{task_id}/_cancel?wait_for_completion=false`. The cancellation has been acknowledged but may not yet have taken effect; use the get reindex API to observe progress.\n" value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 9.5.0 x-codeSamples: - lang: Console source: "POST _reindex/r1A2WoRbTwKZ516z6NEs5A:36619/_cancel\n" - lang: Python source: "resp = client.cancel_reindex(\n task_id=\"r1A2WoRbTwKZ516z6NEs5A:36619\",\n)" - lang: JavaScript source: "const response = await client.cancelReindex({\n task_id: \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n});" - lang: Ruby source: "response = client.cancel_reindex(\n task_id: \"r1A2WoRbTwKZ516z6NEs5A:36619\"\n)" - lang: PHP source: "$resp = $client->cancelReindex([\n \"task_id\" => \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_reindex/r1A2WoRbTwKZ516z6NEs5A:36619/_cancel"' - lang: C# source: 'var response = await client.CancelReindexAsync(taskId: "r1A2WoRbTwKZ516z6NEs5A:36619");' - lang: Java source: "client.cancelReindex(c -> c\n .taskId(\"r1A2WoRbTwKZ516z6NEs5A:36619\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_cat/aliases/{name}': get: tags: - cat summary: "Get a compact list of aliases\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_cat/aliases\n
\n
\n GET\n /_cat/aliases/{name}\n
\n \n\nGet the cluster's index aliases, including filter and routing information.\nThis API does not return data stream aliases.\n\nIMPORTANT: CAT APIs are only intended for human consumption using the command line or the Kibana console. They are not intended for use by applications. For application consumption, use the aliases API.\n\n## Required authorization\n\n* Index privileges: `view_index_metadata`\n" operationId: cat-aliases parameters: - $ref: '#/components/parameters/cat.aliases-name' - $ref: '#/components/parameters/cat.aliases-h' - $ref: '#/components/parameters/cat.aliases-s' - $ref: '#/components/parameters/cat.aliases-expand_wildcards' - $ref: '#/components/parameters/cat.aliases-master_timeout' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': $ref: '#/components/responses/cat.aliases-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET _cat/aliases?format=json&v=true\n" - lang: Python source: "resp = client.cat.aliases(\n format=\"json\",\n v=True,\n)" - lang: JavaScript source: "const response = await client.cat.aliases({\n format: \"json\",\n v: \"true\",\n});" - lang: Ruby source: "response = client.cat.aliases(\n format: \"json\",\n v: \"true\"\n)" - lang: PHP source: "$resp = $client->cat()->aliases([\n \"format\" => \"json\",\n \"v\" => \"true\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/aliases?format=json&v=true"' - lang: Java source: "client.cat().aliases(a -> a);\n" x-metaTags: - content: Elasticsearch name: product_name '/_cat/allocation/{node_id}': get: tags: - cat summary: "Get shard allocation information\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_cat/allocation\n
\n
\n GET\n /_cat/allocation/{node_id}\n
\n \n\nGet a snapshot of the number of shards allocated to each data node and their disk space.\n\nIMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: cat-allocation parameters: - $ref: '#/components/parameters/cat.allocation-node_id' - $ref: '#/components/parameters/cat.allocation-h' - $ref: '#/components/parameters/cat.allocation-s' - $ref: '#/components/parameters/cat.allocation-local' - $ref: '#/components/parameters/cat.allocation-master_timeout' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': $ref: '#/components/responses/cat.allocation-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET /_cat/allocation?v=true&format=json\n" - lang: Python source: "resp = client.cat.allocation(\n v=True,\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.allocation({\n v: \"true\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.allocation(\n v: \"true\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->allocation([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/allocation?v=true&format=json"' - lang: Java source: "client.cat().allocation(a -> a);\n" x-metaTags: - content: Elasticsearch name: product_name '/_cat/circuit_breaker/{circuit_breaker_patterns}': get: tags: - cat summary: "Get circuit breakers statistics\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_cat/circuit_breaker\n
\n
\n GET\n /_cat/circuit_breaker/{circuit_breaker_patterns}\n
\n \n\nIMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: cat-circuit-breaker parameters: - $ref: '#/components/parameters/cat.circuit_breaker-circuit_breaker_patterns' - $ref: '#/components/parameters/cat.circuit_breaker-h' - $ref: '#/components/parameters/cat.circuit_breaker-s' - $ref: '#/components/parameters/cat.circuit_breaker-local' - $ref: '#/components/parameters/cat.circuit_breaker-master_timeout' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': $ref: '#/components/responses/cat.circuit_breaker-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET /_cat/circuit_breaker?v=true&format=json\n" - lang: Python source: "resp = client.cat.circuit_breaker(\n v=True,\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.circuitBreaker({\n v: \"true\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.circuit_breaker(\n v: \"true\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->circuitBreaker([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/circuit_breaker?v=true&format=json"' x-metaTags: - content: Elasticsearch name: product_name '/_cat/component_templates/{name}': get: tags: - cat summary: "Get a compact list of component templates\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_cat/component_templates\n
\n
\n GET\n /_cat/component_templates/{name}\n
\n \n\nGet information about component templates in a cluster.\nComponent templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.\n\nIMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console.\nThey are not intended for use by applications. For application consumption, use the get component template API.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: cat-component-templates parameters: - $ref: '#/components/parameters/cat.component_templates-name' - $ref: '#/components/parameters/cat.component_templates-h' - $ref: '#/components/parameters/cat.component_templates-s' - $ref: '#/components/parameters/cat.component_templates-local' - $ref: '#/components/parameters/cat.component_templates-master_timeout' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': $ref: '#/components/responses/cat.component_templates-200' x-state: Generally available; Added in 5.1.0 x-codeSamples: - lang: Console source: "GET _cat/component_templates/my-template-*?v=true&s=name&format=json\n" - lang: Python source: "resp = client.cat.component_templates(\n name=\"my-template-*\",\n v=True,\n s=\"name\",\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.componentTemplates({\n name: \"my-template-*\",\n v: \"true\",\n s: \"name\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.component_templates(\n name: \"my-template-*\",\n v: \"true\",\n s: \"name\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->componentTemplates([\n \"name\" => \"my-template-*\",\n \"v\" => \"true\",\n \"s\" => \"name\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/component_templates/my-template-*?v=true&s=name&format=json"' - lang: Java source: "client.cat().componentTemplates(c -> c\n .name(\"my-template-*\")\n .s(\"name\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_cat/count/{index}': get: tags: - cat summary: "Get a document count\n" description: "**All methods and paths for this operation:**\n\n
\n POST\n /_cat/count\n
\n
\n GET\n /_cat/count\n
\n
\n POST\n /_cat/count/{index}\n
\n
\n GET\n /_cat/count/{index}\n
\n \n\nGet quick access to a document count for a data stream, an index, or an entire cluster.\nThe document count only includes live documents, not deleted documents which have not yet been removed by the merge process.\n\nIMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console.\nThey are not intended for use by applications. For application consumption, use the count API.\n\nNOTE: Starting in Elasticsearch 9.3.0, this endpoint also supports the `POST` method. This is primarily intended for project routing in serverless environments.\n\n## Required authorization\n\n* Index privileges: `read`\n" operationId: cat-count parameters: - $ref: '#/components/parameters/cat.count-index' - $ref: '#/components/parameters/cat.count-h' - $ref: '#/components/parameters/cat.count-s' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' requestBody: $ref: '#/components/requestBodies/cat.count' responses: '200': $ref: '#/components/responses/cat.count-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET /_cat/count/my-index-000001?v=true&format=json\n" - lang: Python source: "resp = client.cat.count(\n index=\"my-index-000001\",\n v=True,\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.count({\n index: \"my-index-000001\",\n v: \"true\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.count(\n index: \"my-index-000001\",\n v: \"true\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->count([\n \"index\" => \"my-index-000001\",\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/count/my-index-000001?v=true&format=json"' - lang: Java source: "client.cat().count(c -> c\n .index(\"my-index-000001\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_cat/fielddata/{fields}': get: tags: - cat summary: "Get field data cache information\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_cat/fielddata\n
\n
\n GET\n /_cat/fielddata/{fields}\n
\n \n\nGet the amount of heap memory currently used by the field data cache on every data node in the cluster.\n\nIMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console.\nThey are not intended for use by applications. For application consumption, use the nodes stats API.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: cat-fielddata parameters: - $ref: '#/components/parameters/cat.fielddata-fields' - $ref: '#/components/parameters/cat.fielddata-fields_' - $ref: '#/components/parameters/cat.fielddata-h' - $ref: '#/components/parameters/cat.fielddata-s' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': $ref: '#/components/responses/cat.fielddata-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET /_cat/fielddata?v=true&fields=body&format=json\n" - lang: Python source: "resp = client.cat.fielddata(\n v=True,\n fields=\"body\",\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.fielddata({\n v: \"true\",\n fields: \"body\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.fielddata(\n v: \"true\",\n fields: \"body\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->fielddata([\n \"v\" => \"true\",\n \"fields\" => \"body\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/fielddata?v=true&fields=body&format=json"' - lang: Java source: "client.cat().fielddata(f -> f\n .fields(\"body\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_cat/health: get: tags: - cat summary: Get a compact cluster health summary description: "IMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console.\nThey are not intended for use by applications. For application consumption, use the cluster health API.\nThis API is often used to check malfunctioning clusters.\nTo help you track cluster health alongside log files and alerting systems, the API returns timestamps in two formats:\n`HH:MM:SS`, which is human-readable but includes no date information;\n`Unix epoch time`, which is machine-sortable and includes date information.\nThe latter format is useful for cluster recoveries that take multiple days.\nYou can use the cat health API to verify cluster health across multiple nodes.\nYou also can use the API to track the recovery of a large cluster over a longer period of time.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: cat-health parameters: - name: ts in: query description: 'If true, returns `HH:MM:SS` and Unix epoch timestamps.' schema: type: boolean default: true - name: h in: query description: "A comma-separated list of columns names to display. It supports simple wildcards.\n\nSupported values include:\n - `epoch` (or `t`, `time`): The number of seconds since 1970-01-01 00:00:00.\n - `timestamp` (or `ts`, `hms`, `hhmmss`): The time in HH:MM:SS format.\n - `cluster` (or `cl`): The cluster name.\n - `status` (or `st`): The health status.\n - `node.total` (or `nt`, `nodeTotal`): The total number of nodes that can store data.\n - `node.data` (or `nd`, `nodeData`): The number of nodes that can store data.\n - `shards` (or `t`, `sh`, `shards.total`, `shardsTotal`): The total number of shards.\n - `pri` (or `p`, `shards.primary`, `shardsPrimary`): The number of primary shards.\n - `relo` (or `r`, `shards.relocating`, `shardsRelocating`): The number of relocating nodes.\n - `init` (or `i`, `shards.initializing`, `shardsInitializing`): The number of initializing nodes.\n - `unassign` (or `u`, `shards.unassigned`, `shardsUnassigned`): The number of unassigned shards.\n - `unassign.pri` (or `up`, `shards.unassigned.primary`, `shardsUnassignedPrimary`): The number of unassigned primary shards.\n - `pending_tasks` (or `pt`, `pendingTasks`): The number of pending tasks.\n - `max_task_wait_time` (or `mtwt`, `maxTaskWaitTime`): The wait time of the longest pending task.\n - `active_shards_percent` (or `asp`, `activeShardsPercent`): The percentage of active shards.\n\n" schema: $ref: '#/components/schemas/cat._types.CatHealthColumns' - name: s in: query description: "List of columns that determine how the table should be sorted.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name." schema: $ref: '#/components/schemas/_types.Names' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.health.HealthRecord' examples: CatHealthResponseExample1: description: "A successful response from `GET /_cat/health?v=true&format=json`. By default, it returns `HH:MM:SS` and Unix epoch timestamps.\n" value: "[\n {\n \"epoch\": \"1475871424\",\n \"timestamp\": \"16:17:04\",\n \"cluster\": \"elasticsearch\",\n \"status\": \"green\",\n \"node.total\": \"1\",\n \"node.data\": \"1\",\n \"shards\": \"1\",\n \"pri\": \"1\",\n \"relo\": \"0\",\n \"init\": \"0\",\n \"unassign\": \"0\",\n \"unassign.pri\": \"0\",\n \"pending_tasks\": \"0\",\n \"max_task_wait_time\": \"-\",\n \"active_shards_percent\": \"100.0%\"\n }\n]" x-state: Generally available x-codeSamples: - lang: Console source: "GET /_cat/health?v=true&format=json\n" - lang: Python source: "resp = client.cat.health(\n v=True,\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.health({\n v: \"true\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.health(\n v: \"true\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->health([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/health?v=true&format=json"' - lang: Java source: "client.cat().health(h -> h);\n" x-metaTags: - content: Elasticsearch name: product_name /_cat: get: tags: - cat summary: Get CAT help description: Get help for the CAT APIs. operationId: cat-help responses: '200': description: '' content: application/json: schema: type: object x-state: Generally available x-metaTags: - content: Elasticsearch name: product_name '/_cat/indices/{index}': get: tags: - cat summary: "Get a compact list of indices\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_cat/indices\n
\n
\n GET\n /_cat/indices/{index}\n
\n \n\nGet high-level information about indices in a cluster, including backing indices for data streams.\n\nUse this request to get the following information for each index in a cluster:\n- shard count\n- document count\n- deleted document count\n- primary store size\n- total store size of all shards, including shard replicas\n\nThese metrics are retrieved directly from Lucene, which Elasticsearch uses internally to power indexing and search. As a result, all document counts include hidden nested documents.\nTo get an accurate count of Elasticsearch documents, use the cat count or count APIs.\n\nNOTE: Storage metrics reported by this API reflect the post-compression size of the indices on disk. Because these values are calculated after Elasticsearch compresses the data and processes deletions, they are typically significantly smaller than the raw, uncompressed data volume ingested.\n\nIMPORTANT: For Elastic Cloud Serverless, ingest billing is based on the raw, uncompressed data volume, not the post-compression metrics reported here. To learn more, refer to [Elasticsearch billing dimensions](https://www.elastic.co/docs/deploy-manage/cloud-organization/billing/elasticsearch-billing-dimensions).\n\nCAT APIs are only intended for human consumption using the command line or Kibana console.\nThey are not intended for use by applications. For application consumption, use an index endpoint.\n\n## Required authorization\n\n* Index privileges: `monitor`\n* Cluster privileges: `monitor`\n" operationId: cat-indices parameters: - $ref: '#/components/parameters/cat.indices-index' - $ref: '#/components/parameters/cat.indices-expand_wildcards' - $ref: '#/components/parameters/cat.indices-health' - $ref: '#/components/parameters/cat.indices-include_unloaded_segments' - $ref: '#/components/parameters/cat.indices-pri' - $ref: '#/components/parameters/cat.indices-master_timeout' - $ref: '#/components/parameters/cat.indices-h' - $ref: '#/components/parameters/cat.indices-s' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': $ref: '#/components/responses/cat.indices-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET /_cat/indices/my-index-*?v=true&s=index&format=json\n" - lang: Python source: "resp = client.cat.indices(\n index=\"my-index-*\",\n v=True,\n s=\"index\",\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.indices({\n index: \"my-index-*\",\n v: \"true\",\n s: \"index\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.indices(\n index: \"my-index-*\",\n v: \"true\",\n s: \"index\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->indices([\n \"index\" => \"my-index-*\",\n \"v\" => \"true\",\n \"s\" => \"index\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/indices/my-index-*?v=true&s=index&format=json"' - lang: Java source: "client.cat().indices(i -> i\n .index(\"my-index-*\")\n .s(\"index\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_cat/master: get: tags: - cat summary: Get master node information description: "Get information about the master node, including the ID, bound IP address, and name.\n\nIMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: cat-master parameters: - name: h in: query description: "A comma-separated list of columns names to display. It supports simple wildcards.\n\nSupported values include:\n - `id`: The node ID.\n - `host` (or `h`): The host name of the node.\n - `ip`: The IP address of the node.\n - `node` (or `n`): The node name.\n\n" schema: $ref: '#/components/schemas/cat._types.CatMasterColumns' - name: s in: query description: "List of columns that determine how the table should be sorted.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name." schema: $ref: '#/components/schemas/_types.Names' - name: local in: query description: "If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node." schema: type: boolean default: false - name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.master.MasterRecord' examples: CatMasterResponseExample1: description: "A successful response from `GET /_cat/master?v=true&format=json`.\n" value: "[\n {\n \"id\": \"YzWoH_2BT-6UjVGDyPdqYg\",\n \"host\": \"127.0.0.1\",\n \"ip\": \"127.0.0.1\",\n \"node\": \"YzWoH_2\"\n }\n]" x-state: Generally available x-codeSamples: - lang: Console source: "GET /_cat/master?v=true&format=json\n" - lang: Python source: "resp = client.cat.master(\n v=True,\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.master({\n v: \"true\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.master(\n v: \"true\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->master([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/master?v=true&format=json"' - lang: Java source: "client.cat().master(m -> m);\n" x-metaTags: - content: Elasticsearch name: product_name '/_cat/ml/data_frame/analytics/{id}': get: tags: - cat summary: "Get data frame analytics jobs\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_cat/ml/data_frame/analytics\n
\n
\n GET\n /_cat/ml/data_frame/analytics/{id}\n
\n \n\nGet configuration and usage information about data frame analytics jobs.\n\nIMPORTANT: CAT APIs are only intended for human consumption using the Kibana\nconsole or command line. They are not intended for use by applications. For\napplication consumption, use the get data frame analytics jobs statistics API.\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: cat-ml-data-frame-analytics parameters: - $ref: '#/components/parameters/cat.ml_data_frame_analytics-id' - $ref: '#/components/parameters/cat.ml_data_frame_analytics-allow_no_match' - $ref: '#/components/parameters/cat.ml_data_frame_analytics-h' - $ref: '#/components/parameters/cat.ml_data_frame_analytics-s' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': $ref: '#/components/responses/cat.ml_data_frame_analytics-200' x-state: Generally available; Added in 7.7.0 x-codeSamples: - lang: Console source: "GET _cat/ml/data_frame/analytics?v=true&format=json\n" - lang: Python source: "resp = client.cat.ml_data_frame_analytics(\n v=True,\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.mlDataFrameAnalytics({\n v: \"true\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.ml_data_frame_analytics(\n v: \"true\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->mlDataFrameAnalytics([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/ml/data_frame/analytics?v=true&format=json"' - lang: Java source: "client.cat().mlDataFrameAnalytics(m -> m);\n" x-metaTags: - content: Elasticsearch name: product_name '/_cat/ml/datafeeds/{datafeed_id}': get: tags: - cat summary: "Get datafeeds\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_cat/ml/datafeeds\n
\n
\n GET\n /_cat/ml/datafeeds/{datafeed_id}\n
\n \n\nGet configuration and usage information about datafeeds.\nThis API returns a maximum of 10,000 datafeeds.\nIf the Elasticsearch security features are enabled, you must have `monitor_ml`, `monitor`, `manage_ml`, or `manage`\ncluster privileges to use this API.\n\nIMPORTANT: CAT APIs are only intended for human consumption using the Kibana\nconsole or command line. They are not intended for use by applications. For\napplication consumption, use the get datafeed statistics API.\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: cat-ml-datafeeds parameters: - $ref: '#/components/parameters/cat.ml_datafeeds-datafeed_id' - $ref: '#/components/parameters/cat.ml_datafeeds-allow_no_match' - $ref: '#/components/parameters/cat.ml_datafeeds-h' - $ref: '#/components/parameters/cat.ml_datafeeds-s' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': $ref: '#/components/responses/cat.ml_datafeeds-200' x-state: Generally available; Added in 7.7.0 x-codeSamples: - lang: Console source: "GET _cat/ml/datafeeds?v=true&format=json\n" - lang: Python source: "resp = client.cat.ml_datafeeds(\n v=True,\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.mlDatafeeds({\n v: \"true\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.ml_datafeeds(\n v: \"true\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->mlDatafeeds([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/ml/datafeeds?v=true&format=json"' - lang: Java source: "client.cat().mlDatafeeds(m -> m);\n" x-metaTags: - content: Elasticsearch name: product_name '/_cat/ml/anomaly_detectors/{job_id}': get: tags: - cat summary: "Get anomaly detection jobs\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_cat/ml/anomaly_detectors\n
\n
\n GET\n /_cat/ml/anomaly_detectors/{job_id}\n
\n \n\nGet configuration and usage information for anomaly detection jobs.\nThis API returns a maximum of 10,000 jobs.\nIf the Elasticsearch security features are enabled, you must have `monitor_ml`,\n`monitor`, `manage_ml`, or `manage` cluster privileges to use this API.\n\nIMPORTANT: CAT APIs are only intended for human consumption using the Kibana\nconsole or command line. They are not intended for use by applications. For\napplication consumption, use the get anomaly detection job statistics API.\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: cat-ml-jobs parameters: - $ref: '#/components/parameters/cat.ml_jobs-job_id' - $ref: '#/components/parameters/cat.ml_jobs-allow_no_match' - $ref: '#/components/parameters/cat.ml_jobs-h' - $ref: '#/components/parameters/cat.ml_jobs-s' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': $ref: '#/components/responses/cat.ml_jobs-200' x-state: Generally available; Added in 7.7.0 x-codeSamples: - lang: Console source: "GET _cat/ml/anomaly_detectors?h=id,s,dpr,mb&v=true&format=json\n" - lang: Python source: "resp = client.cat.ml_jobs(\n h=\"id,s,dpr,mb\",\n v=True,\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.mlJobs({\n h: \"id,s,dpr,mb\",\n v: \"true\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.ml_jobs(\n h: \"id,s,dpr,mb\",\n v: \"true\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->mlJobs([\n \"h\" => \"id,s,dpr,mb\",\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/ml/anomaly_detectors?h=id,s,dpr,mb&v=true&format=json"' - lang: Java source: "client.cat().mlJobs(m -> m\n .h(List.of(\"id\",\"s\",\"dpr\",\"mb\"))\n .s(List.of())\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_cat/ml/trained_models/{model_id}': get: tags: - cat summary: "Get trained models\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_cat/ml/trained_models\n
\n
\n GET\n /_cat/ml/trained_models/{model_id}\n
\n \n\nGet configuration and usage information about inference trained models.\n\nIMPORTANT: CAT APIs are only intended for human consumption using the Kibana\nconsole or command line. They are not intended for use by applications. For\napplication consumption, use the get trained models statistics API.\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: cat-ml-trained-models parameters: - $ref: '#/components/parameters/cat.ml_trained_models-model_id' - $ref: '#/components/parameters/cat.ml_trained_models-allow_no_match' - $ref: '#/components/parameters/cat.ml_trained_models-h' - $ref: '#/components/parameters/cat.ml_trained_models-s' - $ref: '#/components/parameters/cat.ml_trained_models-from' - $ref: '#/components/parameters/cat.ml_trained_models-size' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': $ref: '#/components/responses/cat.ml_trained_models-200' x-state: Generally available; Added in 7.7.0 x-codeSamples: - lang: Console source: "GET _cat/ml/trained_models?v=true&format=json\n" - lang: Python source: "resp = client.cat.ml_trained_models(\n v=True,\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.mlTrainedModels({\n v: \"true\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.ml_trained_models(\n v: \"true\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->mlTrainedModels([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/ml/trained_models?v=true&format=json"' - lang: Java source: "client.cat().mlTrainedModels(m -> m);\n" x-metaTags: - content: Elasticsearch name: product_name /_cat/nodeattrs: get: tags: - cat summary: Get node attribute information description: "Get information about custom node attributes.\nIMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: cat-nodeattrs parameters: - name: h in: query description: "A comma-separated list of columns names to display. It supports simple wildcards.\n\nSupported values include:\n - `node`: The node name.\n - `id` (or `id`, `nodeId`): The unique node ID.\n - `pid` (or `p`): The process ID.\n - `host` (or `h`): The host name.\n - `ip` (or `i`): The IP address.\n - `port` (or `po`): The bound transport port.\n - `attr` (or `attr.name`): The attribute description.\n - `value` (or `attr.value`): The attribute value.\n\n" schema: $ref: '#/components/schemas/cat._types.CatNodeattrsColumns' - name: s in: query description: "List of columns that determine how the table should be sorted.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name." schema: $ref: '#/components/schemas/_types.Names' - name: local in: query description: "If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node." schema: type: boolean default: false - name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.nodeattrs.NodeAttributesRecord' examples: CatNodeAttributesResponseExample1: summary: Default columns description: "A successful response from `GET /_cat/nodeattrs?v=true&format=json`. The `node`, `host`, and `ip` columns provide basic information about each node. The `attr` and `value` columns return custom node attributes, one per line.\n" value: "[\n {\n \"node\": \"node-0\",\n \"host\": \"127.0.0.1\",\n \"ip\": \"127.0.0.1\",\n \"attr\": \"testattr\",\n \"value\": \"test\"\n }\n]" CatNodeAttributesResponseExample2: summary: Explicit columns description: "A successful response from `GET /_cat/nodeattrs?v=true&h=name,pid,attr,value`. It returns the `name`, `pid`, `attr`, and `value` columns.\n" value: "[\n {\n \"name\": \"node-0\",\n \"pid\": \"19566\",\n \"attr\": \"testattr\",\n \"value\": \"test\"\n }\n]" x-state: Generally available x-codeSamples: - lang: Console source: "GET /_cat/nodeattrs?v=true&format=json\n" - lang: Python source: "resp = client.cat.nodeattrs(\n v=True,\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.nodeattrs({\n v: \"true\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.nodeattrs(\n v: \"true\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->nodeattrs([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/nodeattrs?v=true&format=json"' - lang: Java source: "client.cat().nodeattrs(n -> n);\n" x-metaTags: - content: Elasticsearch name: product_name /_cat/nodes: get: tags: - cat summary: Get a compact list of nodes description: "Get information about the nodes in a cluster.\nIMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: cat-nodes parameters: - name: full_id in: query description: 'If `true`, return the full node ID. If `false`, return the shortened node ID.' schema: type: boolean default: false - name: include_unloaded_segments in: query description: 'If true, the response includes information from segments that are not loaded into memory.' schema: type: boolean default: false - name: h in: query description: "A comma-separated list of columns names to display.\nIt supports simple wildcards.\n\nSupported values include:\n - `build` (or `b`): The Elasticsearch build hash. For example: `5c03844`.\n - `completion.size` (or `cs`, `completionSize`): The size of completion. For example: `0b`.\n - `cpu`: The percentage of recent system CPU used.\n - `disk.avail` (or `d`, `disk`, `diskAvail`): The available disk space. For example: `198.4gb`.\n - `disk.total` (or `dt`, `diskTotal`): The total disk space. For example: `458.3gb`.\n - `disk.used` (or `du`, `diskUsed`): The used disk space. For example: `259.8gb`.\n - `disk.used_percent` (or `dup`, `diskUsedPercent`): The percentage of disk space used.\n - `fielddata.evictions` (or `fe`, `fielddataEvictions`): The number of fielddata cache evictions.\n - `fielddata.memory_size` (or `fm`, `fielddataMemory`): The fielddata cache memory used. For example: `0b`.\n - `file_desc.current` (or `fdc`, `fileDescriptorCurrent`): The number of file descriptors used.\n - `file_desc.max` (or `fdm`, `fileDescriptorMax`): The maximum number of file descriptors.\n - `file_desc.percent` (or `fdp`, `fileDescriptorPercent`): The percentage of file descriptors used.\n - `flush.total` (or `ft`, `flushTotal`): The number of flushes.\n - `flush.total_time` (or `ftt`, `flushTotalTime`): The amount of time spent in flush.\n - `get.current` (or `gc`, `getCurrent`): The number of current get operations.\n - `get.exists_time` (or `geti`, `getExistsTime`): The time spent in successful get operations. For example: `14ms`.\n - `get.exists_total` (or `geto`, `getExistsTotal`): The number of successful get operations.\n - `get.missing_time` (or `gmti`, `getMissingTime`): The time spent in failed get operations. For example: `0s`.\n - `get.missing_total` (or `gmto`, `getMissingTotal`): The number of failed get operations.\n - `get.time` (or `gti`, `getTime`): The amount of time spent in get operations. For example: `14ms`.\n - `get.total` (or `gto`, `getTotal`): The number of get operations.\n - `heap.current` (or `hc`, `heapCurrent`): The used heap size. For example: `311.2mb`.\n - `heap.max` (or `hm`, `heapMax`): The total heap size. For example: `4gb`.\n - `heap.percent` (or `hp`, `heapPercent`): The used percentage of total allocated Elasticsearch JVM heap.\nThis value reflects only the Elasticsearch process running within the operating system and is the most direct indicator of its JVM, heap, or memory resource performance.\n - `http_address` (or `http`): The bound HTTP address.\n - `id` (or `nodeId`): The identifier for the node.\n - `indexing.delete_current` (or `idc`, `indexingDeleteCurrent`): The number of current deletion operations.\n - `indexing.delete_time` (or `idti`, `indexingDeleteTime`): The time spent in deletion operations. For example: `2ms`.\n - `indexing.delete_total` (or `idto`, `indexingDeleteTotal`): The number of deletion operations.\n - `indexing.index_current` (or `iic`, `indexingIndexCurrent`): The number of current indexing operations.\n - `indexing.index_failed` (or `iif`, `indexingIndexFailed`): The number of failed indexing operations.\n - `indexing.index_failed_due_to_version_conflict` (or `iifvc`, `indexingIndexFailedDueToVersionConflict`): The number of indexing operations that failed due to version conflict.\n - `indexing.index_time` (or `iiti`, `indexingIndexTime`): The time spent in indexing operations. For example: `134ms`.\n - `indexing.index_total` (or `iito`, `indexingIndexTotal`): The number of indexing operations.\n - `ip` (or `i`): The IP address.\n - `jdk` (or `j`): The Java version. For example: `1.8.0`.\n - `load_1m` (or `l`): The most recent load average. For example: `0.22`.\n - `load_5m` (or `l`): The load average for the last five minutes. For example: `0.78`.\n - `load_15m` (or `l`): The load average for the last fifteen minutes. For example: `1.24`.\n - `available_processors` (or `ap`): The number of available processors (logical CPU cores available to the JVM).\n - `mappings.total_count` (or `mtc`, `mappingsTotalCount`): The number of mappings, including runtime and object fields.\n - `mappings.total_estimated_overhead_in_bytes` (or `mteo`, `mappingsTotalEstimatedOverheadInBytes`): The estimated heap overhead, in bytes, of mappings on this node, which allows for 1KiB of heap for every mapped field.\n - `master` (or `m`): Indicates whether the node is the elected master node.\nReturned values include `*` (elected master) and `-` (not elected master).\n - `merges.current` (or `mc`, `mergesCurrent`): The number of current merge operations.\n - `merges.current_docs` (or `mcd`, `mergesCurrentDocs`): The number of current merging documents.\n - `merges.current_size` (or `mcs`, `mergesCurrentSize`): The size of current merges. For example: `0b`.\n - `merges.total` (or `mt`, `mergesTotal`): The number of completed merge operations.\n - `merges.total_docs` (or `mtd`, `mergesTotalDocs`): The number of merged documents.\n - `merges.total_size` (or `mts`, `mergesTotalSize`): The total size of merges. For example: `0b`.\n - `merges.total_time` (or `mtt`, `mergesTotalTime`): The time spent merging documents. For example: `0s`.\n - `name` (or `n`): The node name.\n - `node.role` (or `r`, `role`, `nodeRole`): The roles of the node.\nReturned values include `c` (cold node), `d` (data node), `f` (frozen node), `h` (hot node), `i` (ingest node), `l` (machine learning node), `m` (master-eligible node), `r` (remote cluster client node), `s` (content node), `t` (transform node), `v` (voting-only node), `w` (warm node), and `-` (coordinating node only).\nFor example, `dim` indicates a master-eligible data and ingest node.\n - `pid` (or `p`): The process identifier.\n - `port` (or `po`): The bound transport port number.\n - `query_cache.memory_size` (or `qcm`, `queryCacheMemory`): The used query cache memory. For example: `0b`.\n - `query_cache.evictions` (or `qce`, `queryCacheEvictions`): The number of query cache evictions.\n - `query_cache.hit_count` (or `qchc`, `queryCacheHitCount`): The query cache hit count.\n - `query_cache.miss_count` (or `qcmc`, `queryCacheMissCount`): The query cache miss count.\n - `ram.current` (or `rc`, `ramCurrent`): The used total memory. For example: `513.4mb`.\n - `ram.max` (or `rm`, `ramMax`): The total memory. For example: `2.9gb`.\n - `ram.percent` (or `rp`, `ramPercent`): The used percentage of the total operating system memory.\nThis reflects all processes running on the operating system instead of only Elasticsearch and is not guaranteed to correlate to its performance.\n - `refresh.total` (or `rto`, `refreshTotal`): The number of refresh operations.\n - `refresh.time` (or `rti`, `refreshTime`): The time spent in refresh operations. For example: `91ms`.\n - `request_cache.memory_size` (or `rcm`, `requestCacheMemory`): The used request cache memory. For example: `0b`.\n - `request_cache.evictions` (or `rce`, `requestCacheEvictions`): The number of request cache evictions.\n - `request_cache.hit_count` (or `rchc`, `requestCacheHitCount`): The request cache hit count.\n - `request_cache.miss_count` (or `rcmc`, `requestCacheMissCount`): The request cache miss count.\n - `script.compilations` (or `scrcc`, `scriptCompilations`): The number of total script compilations.\n - `script.cache_evictions` (or `scrce`, `scriptCacheEvictions`): The number of total compiled scripts evicted from cache.\n - `search.fetch_current` (or `sfc`, `searchFetchCurrent`): The number of current fetch phase operations.\n - `search.fetch_time` (or `sfti`, `searchFetchTime`): The time spent in fetch phase. For example: `37ms`.\n - `search.fetch_total` (or `sfto`, `searchFetchTotal`): The number of fetch operations.\n - `search.open_contexts` (or `so`, `searchOpenContexts`): The number of open search contexts.\n - `search.query_current` (or `sqc`, `searchQueryCurrent`): The number of current query phase operations.\n - `search.query_time` (or `sqti`, `searchQueryTime`): The time spent in query phase. For example: `43ms`.\n - `search.query_total` (or `sqto`, `searchQueryTotal`): The number of query operations.\n - `search.scroll_current` (or `scc`, `searchScrollCurrent`): The number of open scroll contexts.\n - `search.scroll_time` (or `scti`, `searchScrollTime`): The amount of time scroll contexts were held open. For example: `2m`.\n - `search.scroll_total` (or `scto`, `searchScrollTotal`): The number of completed scroll contexts.\n - `segments.count` (or `sc`, `segmentsCount`): The number of segments.\n - `segments.fixed_bitset_memory` (or `sfbm`, `fixedBitsetMemory`): The memory used by fixed bit sets for nested object field types and type filters for types referred in join fields.\nFor example: `1.0kb`.\n - `segments.index_writer_memory` (or `siwm`, `segmentsIndexWriterMemory`): The memory used by the index writer. For example: `18mb`.\n - `segments.memory` (or `sm`, `segmentsMemory`): The memory used by segments. For example: `1.4kb`.\n - `segments.version_map_memory` (or `svmm`, `segmentsVersionMapMemory`): The memory used by the version map. For example: `1.0kb`.\n - `shard_stats.total_count` (or `sstc`, `shards`, `shardStatsTotalCount`): The number of shards assigned.\n - `suggest.current` (or `suc`, `suggestCurrent`): The number of current suggest operations.\n - `suggest.time` (or `suti`, `suggestTime`): The time spent in suggest operations.\n - `suggest.total` (or `suto`, `suggestTotal`): The number of suggest operations.\n - `uptime` (or `u`): The amount of node uptime. For example: `17.3m`.\n - `version` (or `v`): The Elasticsearch version. For example: `9.0.0`.\n\n" schema: allOf: - $ref: '#/components/schemas/cat._types.CatNodeColumns' default: 'ip,heap.percent,ram.percent,cpu,load_1m,load_5m,load_15m,node.role,master,name' - name: s in: query description: "A comma-separated list of column names or aliases that determines the sort order.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name." schema: $ref: '#/components/schemas/_types.Names' - name: master_timeout in: query description: The period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.nodes.NodesRecord' examples: CatNodesResponseExample1: summary: Default columns description: "A successful response from `GET /_cat/nodes?v=true&format=json`. The `ip`, `heap.percent`, `ram.percent`, `cpu`, and `load_*` columns provide the IP addresses and performance information of each node. The `node.role`, `master`, and `name` columns provide information useful for monitoring an entire cluster, particularly large ones.\n" value: "[\n {\n \"ip\": \"127.0.0.1\",\n \"heap.percent\": \"65\",\n \"ram.percent\": \"99\",\n \"cpu\": \"42\",\n \"load_1m\": \"3.07\",\n \"load_5m\": null,\n \"load_15m\": null,\n \"node.role\": \"cdfhilmrstw\",\n \"master\": \"*\",\n \"name\": \"mJw06l1\"\n }\n]" CatNodesResponseExample2: summary: Explicit columns description: "A successful response from `GET /_cat/nodes?v=true&h=id,ip,port,v,m&format=json`. It returns the `id`, `ip`, `port`, `v` (version), and `m` (master) columns.\n" value: "[\n {\n \"id\": \"veJR\",\n \"ip\": \"127.0.0.1\",\n \"port\": \"59938\",\n \"v\": \"9.0.0\",\n \"m\": \"*\"\n }\n]" x-state: Generally available x-codeSamples: - lang: Console source: "GET /_cat/nodes?v=true&h=id,ip,port,v,m&format=json\n" - lang: Python source: "resp = client.cat.nodes(\n v=True,\n h=\"id,ip,port,v,m\",\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.nodes({\n v: \"true\",\n h: \"id,ip,port,v,m\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.nodes(\n v: \"true\",\n h: \"id,ip,port,v,m\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->nodes([\n \"v\" => \"true\",\n \"h\" => \"id,ip,port,v,m\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/nodes?v=true&h=id,ip,port,v,m&format=json"' - lang: Java source: "client.cat().nodes(n -> n\n .h(List.of(\"id\",\"ip\",\"port\",\"v\",\"m\"))\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_cat/pending_tasks: get: tags: - cat summary: Get pending task information description: "Get information about cluster-level changes that have not yet taken effect.\nIMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the pending cluster tasks API.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: cat-pending-tasks parameters: - name: h in: query description: "A comma-separated list of columns names to display. It supports simple wildcards.\n\nSupported values include:\n - `insertOrder` (or `o`): The task insertion order.\n - `timeInQueue` (or `t`): How long the task has been in the queue.\n - `priority` (or `p`): The task priority.\n - `source` (or `s`): The task source.\n\n" schema: $ref: '#/components/schemas/cat._types.CatPendingTasksColumns' - name: s in: query description: "List of columns that determine how the table should be sorted.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name." schema: $ref: '#/components/schemas/_types.Names' - name: local in: query description: "If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node." schema: type: boolean default: false - name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.pending_tasks.PendingTasksRecord' examples: CatPendingTasksResponseExample1: description: "A successful response from `GET /_cat/pending_tasks?v=true&h=insertOrder,timeInQueue,priority,source&format=json`.\n" value: "[\n { \"insertOrder\": \"1685\", \"timeInQueue\": \"855ms\", \"priority\": \"HIGH\", \"source\": \"update-mapping [foo][t]\"},\n { \"insertOrder\": \"1686\", \"timeInQueue\": \"843ms\", \"priority\": \"HIGH\", \"source\": \"update-mapping [foo][t]\"},\n { \"insertOrder\": \"1693\", \"timeInQueue\": \"753ms\", \"priority\": \"HIGH\", \"source\": \"refresh-mapping [foo][[t]]\"},\n { \"insertOrder\": \"1688\", \"timeInQueue\": \"816ms\", \"priority\": \"HIGH\", \"source\": \"update-mapping [foo][t]\"},\n { \"insertOrder\": \"1689\", \"timeInQueue\": \"802ms\", \"priority\": \"HIGH\", \"source\": \"update-mapping [foo][t]\"},\n { \"insertOrder\": \"1690\", \"timeInQueue\": \"787ms\", \"priority\": \"HIGH\", \"source\": \"update-mapping [foo][t]\"},\n { \"insertOrder\": \"1691\", \"timeInQueue\": \"773ms\", \"priority\": \"HIGH\", \"source\": \"update-mapping [foo][t]\"}\n]" x-state: Generally available x-codeSamples: - lang: Console source: "GET /_cat/pending_tasks?v=true&h=insertOrder,timeInQueue,priority,source&format=json\n" - lang: Python source: "resp = client.cat.pending_tasks(\n v=True,\n h=\"insertOrder,timeInQueue,priority,source\",\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.pendingTasks({\n v: \"true\",\n h: \"insertOrder,timeInQueue,priority,source\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.pending_tasks(\n v: \"true\",\n h: \"insertOrder,timeInQueue,priority,source\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->pendingTasks([\n \"v\" => \"true\",\n \"h\" => \"insertOrder,timeInQueue,priority,source\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/pending_tasks?v=true&h=insertOrder,timeInQueue,priority,source&format=json"' - lang: Java source: "client.cat().pendingTasks(p -> p\n .h(List.of(\"insertOrder\",\"timeInQueue\",\"priority\",\"source\"))\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_cat/plugins: get: tags: - cat summary: Get plugin information description: "Get a list of plugins running on each node of a cluster.\nIMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: cat-plugins parameters: - name: h in: query description: "A comma-separated list of columns names to display. It supports simple wildcards.\n\nSupported values include:\n - `id`: The unique node ID.\n - `name` (or `n`): The node name.\n - `component` (or `c`): The component.\n - `version` (or `v`): The component version.\n - `description` (or `d`): The plugin details.\n\n" schema: $ref: '#/components/schemas/cat._types.CatPluginsColumns' - name: s in: query description: "List of columns that determine how the table should be sorted.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name." schema: $ref: '#/components/schemas/_types.Names' - name: include_bootstrap in: query description: Include bootstrap plugins in the response schema: type: boolean default: false - name: local in: query description: "If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node." schema: type: boolean default: false - name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.plugins.PluginsRecord' examples: CatPluginsResponseExample1: description: "A successful response from `GET /_cat/plugins?v=true&s=component&h=name,component,version,description&format=json`.\n" value: "[\n { \"name\": \"U7321H6\", \"component\": \"analysis-icu\", \"version\": \"8.17.0\", \"description\": \"The ICU Analysis plugin integrates the Lucene ICU module into Elasticsearch, adding ICU-related analysis components.\"},\n {\"name\": \"U7321H6\", \"component\": \"analysis-kuromoji\", \"verison\": \"8.17.0\", description: \"The Japanese (kuromoji) Analysis plugin integrates Lucene kuromoji analysis module into elasticsearch.\"},\n {\"name\" \"U7321H6\", \"component\": \"analysis-nori\", \"version\": \"8.17.0\", \"description\": \"The Korean (nori) Analysis plugin integrates Lucene nori analysis module into elasticsearch.\"},\n {\"name\": \"U7321H6\", \"component\": \"analysis-phonetic\", \"verison\": \"8.17.0\", \"description\": \"The Phonetic Analysis plugin integrates phonetic token filter analysis with elasticsearch.\"},\n {\"name\": \"U7321H6\", \"component\": \"analysis-smartcn\", \"verison\": \"8.17.0\", \"description\": \"Smart Chinese Analysis plugin integrates Lucene Smart Chinese analysis module into elasticsearch.\"},\n {\"name\": \"U7321H6\", \"component\": \"analysis-stempel\", \"verison\": \"8.17.0\", \"description\": \"The Stempel (Polish) Analysis plugin integrates Lucene stempel (polish) analysis module into elasticsearch.\"},\n {\"name\": \"U7321H6\", \"component\": \"analysis-ukrainian\", \"verison\": \"8.17.0\", \"description\": \"The Ukrainian Analysis plugin integrates the Lucene UkrainianMorfologikAnalyzer into elasticsearch.\"},\n {\"name\": \"U7321H6\", \"component\": \"discovery-azure-classic\", \"verison\": \"8.17.0\", \"description\": \"The Azure Classic Discovery plugin allows to use Azure Classic API for the unicast discovery mechanism\"},\n {\"name\": \"U7321H6\", \"component\": \"discovery-ec2\", \"verison\": \"8.17.0\", \"description\": \"The EC2 discovery plugin allows to use AWS API for the unicast discovery mechanism.\"},\n {\"name\": \"U7321H6\", \"component\": \"discovery-gce\", \"verison\": \"8.17.0\", \"description\": \"The Google Compute Engine (GCE) Discovery plugin allows to use GCE API for the unicast discovery mechanism.\"},\n {\"name\": \"U7321H6\", \"component\": \"mapper-annotated-text\", \"verison\": \"8.17.0\", \"description\": \"The Mapper Annotated_text plugin adds support for text fields with markup used to inject annotation tokens into the index.\"},\n {\"name\": \"U7321H6\", \"component\": \"mapper-murmur3\", \"verison\": \"8.17.0\", \"description\": \"The Mapper Murmur3 plugin allows to compute hashes of a field's values at index-time and to store them in the index.\"},\n {\"name\": \"U7321H6\", \"component\": \"mapper-size\", \"verison\": \"8.17.0\", \"description\": \"The Mapper Size plugin allows document to record their uncompressed size at index time.\"},\n {\"name\": \"U7321H6\", \"component\": \"store-smb\", \"verison\": \"8.17.0\", \"description\": \"The Store SMB plugin adds support for SMB stores.\"}\n]" x-state: Generally available x-codeSamples: - lang: Console source: "GET /_cat/plugins?v=true&s=component&h=name,component,version,description&format=json\n" - lang: Python source: "resp = client.cat.plugins(\n v=True,\n s=\"component\",\n h=\"name,component,version,description\",\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.plugins({\n v: \"true\",\n s: \"component\",\n h: \"name,component,version,description\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.plugins(\n v: \"true\",\n s: \"component\",\n h: \"name,component,version,description\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->plugins([\n \"v\" => \"true\",\n \"s\" => \"component\",\n \"h\" => \"name,component,version,description\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/plugins?v=true&s=component&h=name,component,version,description&format=json"' - lang: Java source: "client.cat().plugins(p -> p\n .h(List.of(\"name\",\"component\",\"version\",\"description\"))\n .s(\"component\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_cat/recovery/{index}': get: tags: - cat summary: "Get shard recovery information\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_cat/recovery\n
\n
\n GET\n /_cat/recovery/{index}\n
\n \n\nGet information about ongoing and completed shard recoveries.\nShard recovery is the process of initializing a shard copy, such as restoring a primary shard from a snapshot or syncing a replica shard from a primary shard. When a shard recovery completes, the recovered shard is available for search and indexing.\nFor data streams, the API returns information about the stream’s backing indices.\nIMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the index recovery API.\n\n## Required authorization\n\n* Index privileges: `monitor`\n* Cluster privileges: `monitor`\n" operationId: cat-recovery parameters: - $ref: '#/components/parameters/cat.recovery-index' - $ref: '#/components/parameters/cat.recovery-active_only' - $ref: '#/components/parameters/cat.recovery-detailed' - $ref: '#/components/parameters/cat.recovery-index_' - $ref: '#/components/parameters/cat.recovery-h' - $ref: '#/components/parameters/cat.recovery-s' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': $ref: '#/components/responses/cat.recovery-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET _cat/recovery?v=true&format=json\n" - lang: Python source: "resp = client.cat.recovery(\n v=True,\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.recovery({\n v: \"true\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.recovery(\n v: \"true\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->recovery([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/recovery?v=true&format=json"' - lang: Java source: "client.cat().recovery(r -> r);\n" x-metaTags: - content: Elasticsearch name: product_name /_cat/repositories: get: tags: - cat summary: Get a compact list of snapshot repositories description: "Get a list of snapshot repositories for a cluster.\nIMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get snapshot repository API.\n\n## Required authorization\n\n* Cluster privileges: `monitor_snapshot`\n" operationId: cat-repositories parameters: - name: h in: query description: List of columns to appear in the response. Supports simple wildcards. schema: $ref: '#/components/schemas/_types.Names' - name: s in: query description: "List of columns that determine how the table should be sorted.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name." schema: $ref: '#/components/schemas/_types.Names' - name: local in: query description: "If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node." schema: type: boolean default: false - name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.repositories.RepositoriesRecord' examples: CatRepositoriesResponseExample1: description: "A successful response from `GET /_cat/repositories?v=true&format=json`.\n" value: "[\n {\n \"id\": \"repo1\",\n \"type\": \"fs\"\n },\n {\n \"id\": \"repo2\",\n \"type\": \"s3\"\n }\n]" x-state: Generally available; Added in 2.1.0 x-codeSamples: - lang: Console source: "GET /_cat/repositories?v=true&format=json\n" - lang: Python source: "resp = client.cat.repositories(\n v=True,\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.repositories({\n v: \"true\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.repositories(\n v: \"true\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->repositories([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/repositories?v=true&format=json"' - lang: Java source: "client.cat().repositories(r -> r);\n" x-metaTags: - content: Elasticsearch name: product_name '/_cat/segments/{index}': get: tags: - cat summary: "Get segment information\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_cat/segments\n
\n
\n GET\n /_cat/segments/{index}\n
\n \n\nGet low-level information about the Lucene segments in index shards.\nFor data streams, the API returns information about the backing indices.\nIMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the index segments API.\n\n## Required authorization\n\n* Index privileges: `monitor`\n* Cluster privileges: `monitor`\n" operationId: cat-segments parameters: - $ref: '#/components/parameters/cat.segments-index' - $ref: '#/components/parameters/cat.segments-h' - $ref: '#/components/parameters/cat.segments-s' - $ref: '#/components/parameters/cat.segments-local' - $ref: '#/components/parameters/cat.segments-master_timeout' - $ref: '#/components/parameters/cat.segments-expand_wildcards' - $ref: '#/components/parameters/cat.segments-allow_no_indices' - $ref: '#/components/parameters/cat.segments-ignore_throttled' - $ref: '#/components/parameters/cat.segments-ignore_unavailable' - $ref: '#/components/parameters/cat.segments-allow_closed' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': $ref: '#/components/responses/cat.segments-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET /_cat/segments?v=true&format=json\n" - lang: Python source: "resp = client.cat.segments(\n v=True,\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.segments({\n v: \"true\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.segments(\n v: \"true\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->segments([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/segments?v=true&format=json"' - lang: Java source: "client.cat().segments(s -> s);\n" x-metaTags: - content: Elasticsearch name: product_name '/_cat/shards/{index}': get: tags: - cat summary: "Get shard information\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_cat/shards\n
\n
\n GET\n /_cat/shards/{index}\n
\n \n\nGet information about the shards in a cluster.\nFor data streams, the API returns information about the backing indices.\nIMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications.\n\n## Required authorization\n\n* Index privileges: `monitor`\n* Cluster privileges: `monitor`\n" operationId: cat-shards parameters: - $ref: '#/components/parameters/cat.shards-index' - $ref: '#/components/parameters/cat.shards-h' - $ref: '#/components/parameters/cat.shards-s' - $ref: '#/components/parameters/cat.shards-master_timeout' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': $ref: '#/components/responses/cat.shards-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET _cat/shards?format=json\n" - lang: Python source: "resp = client.cat.shards(\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.shards({\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.shards(\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->shards([\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/shards?format=json"' - lang: Java source: "client.cat().shards(s -> s);\n" x-metaTags: - content: Elasticsearch name: product_name '/_cat/snapshots/{repository}': get: tags: - cat summary: "Get a compact list of snapshots\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_cat/snapshots\n
\n
\n GET\n /_cat/snapshots/{repository}\n
\n \n\nGet information about the snapshots stored in one or more repositories.\nA snapshot is a backup of an index or running Elasticsearch cluster.\nIMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get snapshot API.\n\n## Required authorization\n\n* Cluster privileges: `monitor_snapshot`\n" operationId: cat-snapshots parameters: - $ref: '#/components/parameters/cat.snapshots-repository' - $ref: '#/components/parameters/cat.snapshots-ignore_unavailable' - $ref: '#/components/parameters/cat.snapshots-h' - $ref: '#/components/parameters/cat.snapshots-s' - $ref: '#/components/parameters/cat.snapshots-master_timeout' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': $ref: '#/components/responses/cat.snapshots-200' x-state: Generally available; Added in 2.1.0 x-codeSamples: - lang: Console source: "GET /_cat/snapshots/repo1?v=true&s=id&format=json\n" - lang: Python source: "resp = client.cat.snapshots(\n repository=\"repo1\",\n v=True,\n s=\"id\",\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.snapshots({\n repository: \"repo1\",\n v: \"true\",\n s: \"id\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.snapshots(\n repository: \"repo1\",\n v: \"true\",\n s: \"id\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->snapshots([\n \"repository\" => \"repo1\",\n \"v\" => \"true\",\n \"s\" => \"id\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/snapshots/repo1?v=true&s=id&format=json"' - lang: Java source: "client.cat().snapshots(s -> s\n .repository(\"repo1\")\n .s(\"id\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_cat/tasks: get: tags: - cat summary: Get a compact list of running tasks description: "Get information about tasks currently running in the cluster.\nIMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the task management API.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: cat-tasks parameters: - name: actions in: query description: 'The task action names, which are used to limit the response.' schema: type: array items: type: string - name: detailed in: query description: 'If `true`, the response includes detailed information about shard recoveries.' schema: type: boolean default: false - name: nodes in: query description: 'Unique node identifiers, which are used to limit the response.' schema: type: array items: type: string - name: parent_task_id in: query description: 'The parent task identifier, which is used to limit the response.' schema: type: string - name: h in: query description: "A comma-separated list of columns names to display. It supports simple wildcards.\n\nSupported values include:\n - `id`: The ID of the task with the node.\n - `action` (or `ac`): The task action.\n - `task_id` (or `ti`): The unique task ID.\n - `parent_task_id` (or `pti`): The parent task ID.\n - `type` (or `ty`): The task type.\n - `start_time` (or `start`): The start time in milliseconds.\n - `timestamp` (or `ts`, `hms`, `hhmmss`): The start time in HH:MM:SS.\n - `running_time_ns` (or `time`): The running time in nanoseconds.\n - `running_time` (or `time`): The running time.\n - `node_id` (or `ni`): The unique node ID.\n - `ip` (or `i`): The IP address.\n - `port` (or `po`): The bound transport port.\n - `node` (or `n`): The node name.\n - `version` (or `v`): The Elasticsearch version.\n - `x_opaque_id` (or `x`): The X-Opaque-ID header.\n\n" schema: $ref: '#/components/schemas/cat._types.CatTasksColumns' - name: s in: query description: "List of columns that determine how the table should be sorted.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name." schema: $ref: '#/components/schemas/_types.Names' - name: timeout in: query description: "Period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: wait_for_completion in: query description: 'If `true`, the request blocks until the task has completed.' schema: type: boolean default: false - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.tasks.TasksRecord' examples: CatTasksResponseExample1: description: A successful response from `GET _cat/tasks?v=true&format=json`. value: "[\n {\n \"action\": \"cluster:monitor/tasks/lists[n]\",\n \"task_id\": \"oTUltX4IQMOUUVeiohTt8A:124\",\n \"parent_task_id\": \"oTUltX4IQMOUUVeiohTt8A:123\",\n \"type\": \"direct\",\n \"start_time\": \"1458585884904\",\n \"timestamp\": \"01:48:24\",\n \"running_time\": \"44.1micros\",\n \"ip\": \"127.0.0.1:9300\",\n \"node\": \"oTUltX4IQMOUUVeiohTt8A\"\n },\n {\n \"action\": \"cluster:monitor/tasks/lists\",\n \"task_id\": \"oTUltX4IQMOUUVeiohTt8A:123\",\n \"parent_task_id\": \"-\",\n \"type\": \"transport\",\n \"start_time\": \"1458585884904\",\n \"timestamp\": \"01:48:24\",\n \"running_time\": \"186.2micros\",\n \"ip\": \"127.0.0.1:9300\",\n \"node\": \"oTUltX4IQMOUUVeiohTt8A\"\n }\n]" x-state: Experimental; Added in 5.0.0 x-codeSamples: - lang: Console source: "GET _cat/tasks?v=true&format=json\n" - lang: Python source: "resp = client.cat.tasks(\n v=True,\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.tasks({\n v: \"true\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.tasks(\n v: \"true\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->tasks([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/tasks?v=true&format=json"' - lang: Java source: "client.cat().tasks(t -> t);\n" x-metaTags: - content: Elasticsearch name: product_name '/_cat/templates/{name}': get: tags: - cat summary: "Get index template information\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_cat/templates\n
\n
\n GET\n /_cat/templates/{name}\n
\n \n\nGet information about the index templates in a cluster.\nYou can use index templates to apply index settings and field mappings to new indices at creation.\nIMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get index template API.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: cat-templates parameters: - $ref: '#/components/parameters/cat.templates-name' - $ref: '#/components/parameters/cat.templates-h' - $ref: '#/components/parameters/cat.templates-s' - $ref: '#/components/parameters/cat.templates-local' - $ref: '#/components/parameters/cat.templates-master_timeout' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': $ref: '#/components/responses/cat.templates-200' x-state: Generally available; Added in 5.2.0 x-codeSamples: - lang: Console source: "GET _cat/templates/my-template-*?v=true&s=name&format=json\n" - lang: Python source: "resp = client.cat.templates(\n name=\"my-template-*\",\n v=True,\n s=\"name\",\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.templates({\n name: \"my-template-*\",\n v: \"true\",\n s: \"name\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.templates(\n name: \"my-template-*\",\n v: \"true\",\n s: \"name\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->templates([\n \"name\" => \"my-template-*\",\n \"v\" => \"true\",\n \"s\" => \"name\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/templates/my-template-*?v=true&s=name&format=json"' - lang: Java source: "client.cat().templates(t -> t\n .name(\"my-template-*\")\n .s(\"name\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_cat/thread_pool/{thread_pool_patterns}': get: tags: - cat summary: "Get thread pool statistics\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_cat/thread_pool\n
\n
\n GET\n /_cat/thread_pool/{thread_pool_patterns}\n
\n \n\nGet thread pool statistics for each node in a cluster.\nReturned information includes all built-in thread pools and custom thread pools.\nIMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: cat-thread-pool parameters: - $ref: '#/components/parameters/cat.thread_pool-thread_pool_patterns' - $ref: '#/components/parameters/cat.thread_pool-h' - $ref: '#/components/parameters/cat.thread_pool-s' - $ref: '#/components/parameters/cat.thread_pool-local' - $ref: '#/components/parameters/cat.thread_pool-master_timeout' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': $ref: '#/components/responses/cat.thread_pool-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET /_cat/thread_pool?format=json\n" - lang: Python source: "resp = client.cat.thread_pool(\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.threadPool({\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.thread_pool(\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->threadPool([\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/thread_pool?format=json"' - lang: Java source: "client.cat().threadPool(t -> t);\n" x-metaTags: - content: Elasticsearch name: product_name '/_cat/transforms/{transform_id}': get: tags: - cat summary: "Get transform information\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_cat/transforms\n
\n
\n GET\n /_cat/transforms/{transform_id}\n
\n \n\nGet configuration and usage information about transforms.\n\nCAT APIs are only intended for human consumption using the Kibana\nconsole or command line. They are not intended for use by applications. For\napplication consumption, use the get transform statistics API.\n\n## Required authorization\n\n* Cluster privileges: `monitor_transform`\n" operationId: cat-transforms parameters: - $ref: '#/components/parameters/cat.transforms-transform_id' - $ref: '#/components/parameters/cat.transforms-allow_no_match' - $ref: '#/components/parameters/cat.transforms-from' - $ref: '#/components/parameters/cat.transforms-h' - $ref: '#/components/parameters/cat.transforms-s' - $ref: '#/components/parameters/cat.transforms-size' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-format' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-help' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-v' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-bytes' - $ref: '#/components/parameters/_spec_utils.CommonCatQueryParameters-time' responses: '200': $ref: '#/components/responses/cat.transforms-200' x-state: Generally available; Added in 7.7.0 x-codeSamples: - lang: Console source: "GET /_cat/transforms?v=true&format=json\n" - lang: Python source: "resp = client.cat.transforms(\n v=True,\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.cat.transforms({\n v: \"true\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.cat.transforms(\n v: \"true\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->cat()->transforms([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/transforms?v=true&format=json"' - lang: Java source: "client.cat().transforms(t -> t);\n" x-metaTags: - content: Elasticsearch name: product_name '/_ccr/auto_follow/{name}': get: tags: - ccr summary: "Get auto-follow patterns\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ccr/auto_follow\n
\n
\n GET\n /_ccr/auto_follow/{name}\n
\n \n\nGet cross-cluster replication auto-follow patterns.\n\n## Required authorization\n\n* Cluster privileges: `manage_ccr`\n" externalDocs: description: More about auto-follow patterns url: https://www.elastic.co/docs/deploy-manage/tools/cross-cluster-replication/manage-auto-follow-patterns x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/ccr-get-auto-follow-pattern.html operationId: ccr-get-auto-follow-pattern parameters: - $ref: '#/components/parameters/ccr.get_auto_follow_pattern-name' - $ref: '#/components/parameters/ccr.get_auto_follow_pattern-master_timeout' responses: '200': $ref: '#/components/responses/ccr.get_auto_follow_pattern-200' x-state: Generally available; Added in 6.5.0 x-codeSamples: - lang: Console source: "GET /_ccr/auto_follow/my_auto_follow_pattern\n" - lang: Python source: "resp = client.ccr.get_auto_follow_pattern(\n name=\"my_auto_follow_pattern\",\n)" - lang: JavaScript source: "const response = await client.ccr.getAutoFollowPattern({\n name: \"my_auto_follow_pattern\",\n});" - lang: Ruby source: "response = client.ccr.get_auto_follow_pattern(\n name: \"my_auto_follow_pattern\"\n)" - lang: PHP source: "$resp = $client->ccr()->getAutoFollowPattern([\n \"name\" => \"my_auto_follow_pattern\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ccr/auto_follow/my_auto_follow_pattern"' - lang: C# source: "var response = await client.CrossClusterReplication\n .GetAutoFollowPatternAsync(d1 => d1\n .Name(\"my_auto_follow_pattern\")\n );" - lang: Java source: "client.ccr().getAutoFollowPattern(g -> g\n .name(\"my_auto_follow_pattern\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - ccr summary: Create or update auto-follow patterns description: "Create a collection of cross-cluster replication auto-follow patterns for a remote cluster.\nNewly created indices on the remote cluster that match any of the patterns are automatically configured as follower indices.\nIndices on the remote cluster that were created before the auto-follow pattern was created will not be auto-followed even if they match the pattern.\n\nThis API can also be used to update auto-follow patterns.\nNOTE: Follower indices that were configured automatically before updating an auto-follow pattern will remain unchanged even if they do not match against the new patterns.\n\n## Required authorization\n\n* Cluster privileges: `manage_ccr`\n" externalDocs: description: More about auto-follow patterns url: https://www.elastic.co/docs/deploy-manage/tools/cross-cluster-replication/manage-auto-follow-patterns x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/ccr-put-auto-follow-pattern.html operationId: ccr-put-auto-follow-pattern parameters: - name: name in: path description: The name of the collection of auto-follow patterns. required: true schema: $ref: '#/components/schemas/_types.Name' - name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - remote_cluster type: object properties: remote_cluster: type: string description: The remote cluster containing the leader indices to match against. follow_index_pattern: allOf: - $ref: '#/components/schemas/_types.IndexPattern' description: 'The name of follower index. The template {{leader_index}} can be used to derive the name of the follower index from the name of the leader index. When following a data stream, use {{leader_index}}; CCR does not support changes to the names of a follower data stream’s backing indices.' leader_index_patterns: allOf: - $ref: '#/components/schemas/_types.IndexPatterns' description: An array of simple index patterns to match against indices in the remote cluster specified by the remote_cluster field. leader_index_exclusion_patterns: allOf: - $ref: '#/components/schemas/_types.IndexPatterns' description: An array of simple index patterns that can be used to exclude indices from being auto-followed. Indices in the remote cluster whose names are matching one or more leader_index_patterns and one or more leader_index_exclusion_patterns won’t be followed. max_outstanding_read_requests: type: number description: The maximum number of outstanding reads requests from the remote cluster. default: 12 settings: type: object additionalProperties: type: object description: 'Settings to override from the leader index. Note that certain settings can not be overrode (e.g., index.number_of_shards).' max_outstanding_write_requests: type: number description: The maximum number of outstanding reads requests from the remote cluster. default: 9 read_poll_timeout: allOf: - $ref: '#/components/schemas/_types.Duration' description: 'The maximum time to wait for new operations on the remote cluster when the follower index is synchronized with the leader index. When the timeout has elapsed, the poll for operations will return to the follower so that it can update some statistics. Then the follower will immediately attempt to read from the leader again.' default: 1m max_read_request_operation_count: type: number description: The maximum number of operations to pull per read from the remote cluster. default: 5120 max_read_request_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The maximum size in bytes of per read of a batch of operations pulled from the remote cluster. default: 32mb max_retry_delay: allOf: - $ref: '#/components/schemas/_types.Duration' description: The maximum time to wait before retrying an operation that failed exceptionally. An exponential backoff strategy is employed when retrying. default: 500ms max_write_buffer_count: type: number description: 'The maximum number of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will be deferred until the number of queued operations goes below the limit.' default: 2147483647 max_write_buffer_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: 'The maximum total bytes of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will be deferred until the total bytes of queued operations goes below the limit.' default: 512mb max_write_request_operation_count: type: number description: The maximum number of operations per bulk write request executed on the follower. default: 5120 max_write_request_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The maximum total bytes of operations per bulk write request executed on the follower. default: 9223372036854775807b examples: PutAutoFollowPatternRequestExample1: description: "Run `PUT /_ccr/auto_follow/my_auto_follow_pattern` to creates an auto-follow pattern.\n" value: "{\n \"remote_cluster\" : \"remote_cluster\",\n \"leader_index_patterns\" :\n [\n \"leader_index*\"\n ],\n \"follow_index_pattern\" : \"{{leader_index}}-follower\",\n \"settings\": {\n \"index.number_of_replicas\": 0\n },\n \"max_read_request_operation_count\" : 1024,\n \"max_outstanding_read_requests\" : 16,\n \"max_read_request_size\" : \"1024k\",\n \"max_write_request_operation_count\" : 32768,\n \"max_write_request_size\" : \"16k\",\n \"max_outstanding_write_requests\" : 8,\n \"max_write_buffer_count\" : 512,\n \"max_write_buffer_size\" : \"512k\",\n \"max_retry_delay\" : \"10s\",\n \"read_poll_timeout\" : \"30s\"\n}" x-codeSamples: - lang: Console source: "PUT /_ccr/auto_follow/my_auto_follow_pattern\n{\n \"remote_cluster\" : \"remote_cluster\",\n \"leader_index_patterns\" :\n [\n \"leader_index*\"\n ],\n \"follow_index_pattern\" : \"{{leader_index}}-follower\",\n \"settings\": {\n \"index.number_of_replicas\": 0\n },\n \"max_read_request_operation_count\" : 1024,\n \"max_outstanding_read_requests\" : 16,\n \"max_read_request_size\" : \"1024k\",\n \"max_write_request_operation_count\" : 32768,\n \"max_write_request_size\" : \"16k\",\n \"max_outstanding_write_requests\" : 8,\n \"max_write_buffer_count\" : 512,\n \"max_write_buffer_size\" : \"512k\",\n \"max_retry_delay\" : \"10s\",\n \"read_poll_timeout\" : \"30s\"\n}" - lang: Python source: "resp = client.ccr.put_auto_follow_pattern(\n name=\"my_auto_follow_pattern\",\n remote_cluster=\"remote_cluster\",\n leader_index_patterns=[\n \"leader_index*\"\n ],\n follow_index_pattern=\"{{leader_index}}-follower\",\n settings={\n \"index.number_of_replicas\": 0\n },\n max_read_request_operation_count=1024,\n max_outstanding_read_requests=16,\n max_read_request_size=\"1024k\",\n max_write_request_operation_count=32768,\n max_write_request_size=\"16k\",\n max_outstanding_write_requests=8,\n max_write_buffer_count=512,\n max_write_buffer_size=\"512k\",\n max_retry_delay=\"10s\",\n read_poll_timeout=\"30s\",\n)" - lang: JavaScript source: "const response = await client.ccr.putAutoFollowPattern({\n name: \"my_auto_follow_pattern\",\n remote_cluster: \"remote_cluster\",\n leader_index_patterns: [\"leader_index*\"],\n follow_index_pattern: \"{{leader_index}}-follower\",\n settings: {\n \"index.number_of_replicas\": 0,\n },\n max_read_request_operation_count: 1024,\n max_outstanding_read_requests: 16,\n max_read_request_size: \"1024k\",\n max_write_request_operation_count: 32768,\n max_write_request_size: \"16k\",\n max_outstanding_write_requests: 8,\n max_write_buffer_count: 512,\n max_write_buffer_size: \"512k\",\n max_retry_delay: \"10s\",\n read_poll_timeout: \"30s\",\n});" - lang: Ruby source: "response = client.ccr.put_auto_follow_pattern(\n name: \"my_auto_follow_pattern\",\n body: {\n \"remote_cluster\": \"remote_cluster\",\n \"leader_index_patterns\": [\n \"leader_index*\"\n ],\n \"follow_index_pattern\": \"{{leader_index}}-follower\",\n \"settings\": {\n \"index.number_of_replicas\": 0\n },\n \"max_read_request_operation_count\": 1024,\n \"max_outstanding_read_requests\": 16,\n \"max_read_request_size\": \"1024k\",\n \"max_write_request_operation_count\": 32768,\n \"max_write_request_size\": \"16k\",\n \"max_outstanding_write_requests\": 8,\n \"max_write_buffer_count\": 512,\n \"max_write_buffer_size\": \"512k\",\n \"max_retry_delay\": \"10s\",\n \"read_poll_timeout\": \"30s\"\n }\n)" - lang: PHP source: "$resp = $client->ccr()->putAutoFollowPattern([\n \"name\" => \"my_auto_follow_pattern\",\n \"body\" => [\n \"remote_cluster\" => \"remote_cluster\",\n \"leader_index_patterns\" => array(\n \"leader_index*\",\n ),\n \"follow_index_pattern\" => \"{{leader_index}}-follower\",\n \"settings\" => [\n \"index.number_of_replicas\" => 0,\n ],\n \"max_read_request_operation_count\" => 1024,\n \"max_outstanding_read_requests\" => 16,\n \"max_read_request_size\" => \"1024k\",\n \"max_write_request_operation_count\" => 32768,\n \"max_write_request_size\" => \"16k\",\n \"max_outstanding_write_requests\" => 8,\n \"max_write_buffer_count\" => 512,\n \"max_write_buffer_size\" => \"512k\",\n \"max_retry_delay\" => \"10s\",\n \"read_poll_timeout\" => \"30s\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"remote_cluster":"remote_cluster","leader_index_patterns":["leader_index*"],"follow_index_pattern":"{{leader_index}}-follower","settings":{"index.number_of_replicas":0},"max_read_request_operation_count":1024,"max_outstanding_read_requests":16,"max_read_request_size":"1024k","max_write_request_operation_count":32768,"max_write_request_size":"16k","max_outstanding_write_requests":8,"max_write_buffer_count":512,"max_write_buffer_size":"512k","max_retry_delay":"10s","read_poll_timeout":"30s"}'' "$ELASTICSEARCH_URL/_ccr/auto_follow/my_auto_follow_pattern"' - lang: C# source: "var response = await client.CrossClusterReplication\n .PutAutoFollowPatternAsync(name: \"my_auto_follow_pattern\", d1 => d1\n .FollowIndexPattern(\"{{leader_index}}-follower\")\n .LeaderIndexPatterns(\"leader_index*\")\n .MaxOutstandingReadRequests(16)\n .MaxOutstandingWriteRequests(8)\n .MaxReadRequestOperationCount(1024)\n .MaxReadRequestSize(new ByteSize(\"1024k\"))\n .MaxRetryDelay(\"10s\")\n .MaxWriteBufferCount(512)\n .MaxWriteBufferSize(new ByteSize(\"512k\"))\n .MaxWriteRequestOperationCount(32768)\n .MaxWriteRequestSize(new ByteSize(\"16k\"))\n .ReadPollTimeout(\"30s\")\n .RemoteCluster(\"remote_cluster\")\n .Settings(new Dictionary()\n {\n { \"index.number_of_replicas\", 0 }\n })\n );" - lang: Java source: "client.ccr().putAutoFollowPattern(p -> p\n .followIndexPattern(\"{{leader_index}}-follower\")\n .leaderIndexPatterns(\"leader_index*\")\n .maxOutstandingReadRequests(16)\n .maxOutstandingWriteRequests(8)\n .maxReadRequestOperationCount(1024)\n .maxReadRequestSize(\"1024k\")\n .maxRetryDelay(m -> m\n .time(\"10s\")\n )\n .maxWriteBufferCount(512)\n .maxWriteBufferSize(\"512k\")\n .maxWriteRequestOperationCount(32768)\n .maxWriteRequestSize(\"16k\")\n .name(\"my_auto_follow_pattern\")\n .readPollTimeout(r -> r\n .time(\"30s\")\n )\n .remoteCluster(\"remote_cluster\")\n .settings(\"index.number_of_replicas\", JsonData.fromJson(\"0\"))\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: PutAutoFollowPatternResponseExample1: description: A successful response for creating an auto-follow pattern. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 6.5.0 x-codeSamples: - lang: Console source: "PUT /_ccr/auto_follow/my_auto_follow_pattern\n{\n \"remote_cluster\" : \"remote_cluster\",\n \"leader_index_patterns\" :\n [\n \"leader_index*\"\n ],\n \"follow_index_pattern\" : \"{{leader_index}}-follower\",\n \"settings\": {\n \"index.number_of_replicas\": 0\n },\n \"max_read_request_operation_count\" : 1024,\n \"max_outstanding_read_requests\" : 16,\n \"max_read_request_size\" : \"1024k\",\n \"max_write_request_operation_count\" : 32768,\n \"max_write_request_size\" : \"16k\",\n \"max_outstanding_write_requests\" : 8,\n \"max_write_buffer_count\" : 512,\n \"max_write_buffer_size\" : \"512k\",\n \"max_retry_delay\" : \"10s\",\n \"read_poll_timeout\" : \"30s\"\n}" - lang: Python source: "resp = client.ccr.put_auto_follow_pattern(\n name=\"my_auto_follow_pattern\",\n remote_cluster=\"remote_cluster\",\n leader_index_patterns=[\n \"leader_index*\"\n ],\n follow_index_pattern=\"{{leader_index}}-follower\",\n settings={\n \"index.number_of_replicas\": 0\n },\n max_read_request_operation_count=1024,\n max_outstanding_read_requests=16,\n max_read_request_size=\"1024k\",\n max_write_request_operation_count=32768,\n max_write_request_size=\"16k\",\n max_outstanding_write_requests=8,\n max_write_buffer_count=512,\n max_write_buffer_size=\"512k\",\n max_retry_delay=\"10s\",\n read_poll_timeout=\"30s\",\n)" - lang: JavaScript source: "const response = await client.ccr.putAutoFollowPattern({\n name: \"my_auto_follow_pattern\",\n remote_cluster: \"remote_cluster\",\n leader_index_patterns: [\"leader_index*\"],\n follow_index_pattern: \"{{leader_index}}-follower\",\n settings: {\n \"index.number_of_replicas\": 0,\n },\n max_read_request_operation_count: 1024,\n max_outstanding_read_requests: 16,\n max_read_request_size: \"1024k\",\n max_write_request_operation_count: 32768,\n max_write_request_size: \"16k\",\n max_outstanding_write_requests: 8,\n max_write_buffer_count: 512,\n max_write_buffer_size: \"512k\",\n max_retry_delay: \"10s\",\n read_poll_timeout: \"30s\",\n});" - lang: Ruby source: "response = client.ccr.put_auto_follow_pattern(\n name: \"my_auto_follow_pattern\",\n body: {\n \"remote_cluster\": \"remote_cluster\",\n \"leader_index_patterns\": [\n \"leader_index*\"\n ],\n \"follow_index_pattern\": \"{{leader_index}}-follower\",\n \"settings\": {\n \"index.number_of_replicas\": 0\n },\n \"max_read_request_operation_count\": 1024,\n \"max_outstanding_read_requests\": 16,\n \"max_read_request_size\": \"1024k\",\n \"max_write_request_operation_count\": 32768,\n \"max_write_request_size\": \"16k\",\n \"max_outstanding_write_requests\": 8,\n \"max_write_buffer_count\": 512,\n \"max_write_buffer_size\": \"512k\",\n \"max_retry_delay\": \"10s\",\n \"read_poll_timeout\": \"30s\"\n }\n)" - lang: PHP source: "$resp = $client->ccr()->putAutoFollowPattern([\n \"name\" => \"my_auto_follow_pattern\",\n \"body\" => [\n \"remote_cluster\" => \"remote_cluster\",\n \"leader_index_patterns\" => array(\n \"leader_index*\",\n ),\n \"follow_index_pattern\" => \"{{leader_index}}-follower\",\n \"settings\" => [\n \"index.number_of_replicas\" => 0,\n ],\n \"max_read_request_operation_count\" => 1024,\n \"max_outstanding_read_requests\" => 16,\n \"max_read_request_size\" => \"1024k\",\n \"max_write_request_operation_count\" => 32768,\n \"max_write_request_size\" => \"16k\",\n \"max_outstanding_write_requests\" => 8,\n \"max_write_buffer_count\" => 512,\n \"max_write_buffer_size\" => \"512k\",\n \"max_retry_delay\" => \"10s\",\n \"read_poll_timeout\" => \"30s\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"remote_cluster":"remote_cluster","leader_index_patterns":["leader_index*"],"follow_index_pattern":"{{leader_index}}-follower","settings":{"index.number_of_replicas":0},"max_read_request_operation_count":1024,"max_outstanding_read_requests":16,"max_read_request_size":"1024k","max_write_request_operation_count":32768,"max_write_request_size":"16k","max_outstanding_write_requests":8,"max_write_buffer_count":512,"max_write_buffer_size":"512k","max_retry_delay":"10s","read_poll_timeout":"30s"}'' "$ELASTICSEARCH_URL/_ccr/auto_follow/my_auto_follow_pattern"' - lang: C# source: "var response = await client.CrossClusterReplication\n .PutAutoFollowPatternAsync(name: \"my_auto_follow_pattern\", d1 => d1\n .FollowIndexPattern(\"{{leader_index}}-follower\")\n .LeaderIndexPatterns(\"leader_index*\")\n .MaxOutstandingReadRequests(16)\n .MaxOutstandingWriteRequests(8)\n .MaxReadRequestOperationCount(1024)\n .MaxReadRequestSize(new ByteSize(\"1024k\"))\n .MaxRetryDelay(\"10s\")\n .MaxWriteBufferCount(512)\n .MaxWriteBufferSize(new ByteSize(\"512k\"))\n .MaxWriteRequestOperationCount(32768)\n .MaxWriteRequestSize(new ByteSize(\"16k\"))\n .ReadPollTimeout(\"30s\")\n .RemoteCluster(\"remote_cluster\")\n .Settings(new Dictionary()\n {\n { \"index.number_of_replicas\", 0 }\n })\n );" - lang: Java source: "client.ccr().putAutoFollowPattern(p -> p\n .followIndexPattern(\"{{leader_index}}-follower\")\n .leaderIndexPatterns(\"leader_index*\")\n .maxOutstandingReadRequests(16)\n .maxOutstandingWriteRequests(8)\n .maxReadRequestOperationCount(1024)\n .maxReadRequestSize(\"1024k\")\n .maxRetryDelay(m -> m\n .time(\"10s\")\n )\n .maxWriteBufferCount(512)\n .maxWriteBufferSize(\"512k\")\n .maxWriteRequestOperationCount(32768)\n .maxWriteRequestSize(\"16k\")\n .name(\"my_auto_follow_pattern\")\n .readPollTimeout(r -> r\n .time(\"30s\")\n )\n .remoteCluster(\"remote_cluster\")\n .settings(\"index.number_of_replicas\", JsonData.fromJson(\"0\"))\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - ccr summary: Delete auto-follow patterns description: "Delete a collection of cross-cluster replication auto-follow patterns.\n\n## Required authorization\n\n* Cluster privileges: `manage_ccr`\n" externalDocs: description: More about auto-follow patterns url: https://www.elastic.co/docs/deploy-manage/tools/cross-cluster-replication/manage-auto-follow-patterns x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/ccr-delete-auto-follow-pattern.html operationId: ccr-delete-auto-follow-pattern parameters: - name: name in: path description: The auto-follow pattern collection to delete. required: true schema: $ref: '#/components/schemas/_types.Name' - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nIt can also be set to `-1` to indicate that the request should never timeout." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: DeleteAutoFollowPatternResponseExample1: description: 'A successful response from `DELETE /_ccr/auto_follow/my_auto_follow_pattern`, which deletes an auto-follow pattern.' value: "{\n \"acknowledged\" : true\n}" x-state: Generally available; Added in 6.5.0 x-codeSamples: - lang: Console source: "DELETE /_ccr/auto_follow/my_auto_follow_pattern\n" - lang: Python source: "resp = client.ccr.delete_auto_follow_pattern(\n name=\"my_auto_follow_pattern\",\n)" - lang: JavaScript source: "const response = await client.ccr.deleteAutoFollowPattern({\n name: \"my_auto_follow_pattern\",\n});" - lang: Ruby source: "response = client.ccr.delete_auto_follow_pattern(\n name: \"my_auto_follow_pattern\"\n)" - lang: PHP source: "$resp = $client->ccr()->deleteAutoFollowPattern([\n \"name\" => \"my_auto_follow_pattern\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ccr/auto_follow/my_auto_follow_pattern"' - lang: C# source: 'var response = await client.CrossClusterReplication.DeleteAutoFollowPatternAsync(name: "my_auto_follow_pattern");' - lang: Java source: "client.ccr().deleteAutoFollowPattern(d -> d\n .name(\"my_auto_follow_pattern\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_ccr/follow': put: tags: - ccr summary: Create a follower description: "Create a cross-cluster replication follower index that follows a specific leader index.\nWhen the API returns, the follower index exists and cross-cluster replication starts replicating operations from the leader index to the follower index.\n\n## Required authorization\n\n* Index privileges: `manage_follow_index`\n* Cluster privileges: `manage_ccr`\n" operationId: ccr-follow parameters: - name: index in: path description: The name of the follower index. required: true schema: $ref: '#/components/schemas/_types.IndexName' - name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: wait_for_active_shards in: query description: "Specifies the number of shards to wait on being active before responding. This defaults to waiting on none of the shards to be\nactive.\nA shard must be restored from the leader index before being active. Restoring a follower shard requires transferring all the\nremote Lucene segment files to the follower index." schema: allOf: - $ref: '#/components/schemas/_types.WaitForActiveShards' default: '0' requestBody: content: application/json: schema: required: - leader_index - remote_cluster type: object properties: data_stream_name: type: string description: 'If the leader index is part of a data stream, the name to which the local data stream for the followed index should be renamed.' leader_index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: The name of the index in the leader cluster to follow. max_outstanding_read_requests: type: number description: The maximum number of outstanding reads requests from the remote cluster. max_outstanding_write_requests: type: number description: The maximum number of outstanding write requests on the follower. max_read_request_operation_count: type: number description: The maximum number of operations to pull per read from the remote cluster. max_read_request_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The maximum size in bytes of per read of a batch of operations pulled from the remote cluster. max_retry_delay: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The maximum time to wait before retrying an operation that failed exceptionally. An exponential backoff strategy is employed when\nretrying." max_write_buffer_count: type: number description: "The maximum number of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will be\ndeferred until the number of queued operations goes below the limit." max_write_buffer_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "The maximum total bytes of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will\nbe deferred until the total bytes of queued operations goes below the limit." max_write_request_operation_count: type: number description: The maximum number of operations per bulk write request executed on the follower. max_write_request_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The maximum total bytes of operations per bulk write request executed on the follower. read_poll_timeout: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The maximum time to wait for new operations on the remote cluster when the follower index is synchronized with the leader index.\nWhen the timeout has elapsed, the poll for operations will return to the follower so that it can update some statistics.\nThen the follower will immediately attempt to read from the leader again." remote_cluster: type: string description: The remote cluster containing the leader index. settings: allOf: - $ref: '#/components/schemas/indices._types.IndexSettings' description: Settings to override from the leader index. examples: CreateFollowIndexRequestExample1: description: Run `PUT /follower_index/_ccr/follow?wait_for_active_shards=1` to create a follower index named `follower_index`. value: "{\n \"remote_cluster\" : \"remote_cluster\",\n \"leader_index\" : \"leader_index\",\n \"settings\": {\n \"index.number_of_replicas\": 0\n },\n \"max_read_request_operation_count\" : 1024,\n \"max_outstanding_read_requests\" : 16,\n \"max_read_request_size\" : \"1024k\",\n \"max_write_request_operation_count\" : 32768,\n \"max_write_request_size\" : \"16k\",\n \"max_outstanding_write_requests\" : 8,\n \"max_write_buffer_count\" : 512,\n \"max_write_buffer_size\" : \"512k\",\n \"max_retry_delay\" : \"10s\",\n \"read_poll_timeout\" : \"30s\"\n}" x-codeSamples: - lang: Console source: "PUT /follower_index/_ccr/follow?wait_for_active_shards=1\n{\n \"remote_cluster\" : \"remote_cluster\",\n \"leader_index\" : \"leader_index\",\n \"settings\": {\n \"index.number_of_replicas\": 0\n },\n \"max_read_request_operation_count\" : 1024,\n \"max_outstanding_read_requests\" : 16,\n \"max_read_request_size\" : \"1024k\",\n \"max_write_request_operation_count\" : 32768,\n \"max_write_request_size\" : \"16k\",\n \"max_outstanding_write_requests\" : 8,\n \"max_write_buffer_count\" : 512,\n \"max_write_buffer_size\" : \"512k\",\n \"max_retry_delay\" : \"10s\",\n \"read_poll_timeout\" : \"30s\"\n}" - lang: Python source: "resp = client.ccr.follow(\n index=\"follower_index\",\n wait_for_active_shards=\"1\",\n remote_cluster=\"remote_cluster\",\n leader_index=\"leader_index\",\n settings={\n \"index.number_of_replicas\": 0\n },\n max_read_request_operation_count=1024,\n max_outstanding_read_requests=16,\n max_read_request_size=\"1024k\",\n max_write_request_operation_count=32768,\n max_write_request_size=\"16k\",\n max_outstanding_write_requests=8,\n max_write_buffer_count=512,\n max_write_buffer_size=\"512k\",\n max_retry_delay=\"10s\",\n read_poll_timeout=\"30s\",\n)" - lang: JavaScript source: "const response = await client.ccr.follow({\n index: \"follower_index\",\n wait_for_active_shards: 1,\n remote_cluster: \"remote_cluster\",\n leader_index: \"leader_index\",\n settings: {\n \"index.number_of_replicas\": 0,\n },\n max_read_request_operation_count: 1024,\n max_outstanding_read_requests: 16,\n max_read_request_size: \"1024k\",\n max_write_request_operation_count: 32768,\n max_write_request_size: \"16k\",\n max_outstanding_write_requests: 8,\n max_write_buffer_count: 512,\n max_write_buffer_size: \"512k\",\n max_retry_delay: \"10s\",\n read_poll_timeout: \"30s\",\n});" - lang: Ruby source: "response = client.ccr.follow(\n index: \"follower_index\",\n wait_for_active_shards: \"1\",\n body: {\n \"remote_cluster\": \"remote_cluster\",\n \"leader_index\": \"leader_index\",\n \"settings\": {\n \"index.number_of_replicas\": 0\n },\n \"max_read_request_operation_count\": 1024,\n \"max_outstanding_read_requests\": 16,\n \"max_read_request_size\": \"1024k\",\n \"max_write_request_operation_count\": 32768,\n \"max_write_request_size\": \"16k\",\n \"max_outstanding_write_requests\": 8,\n \"max_write_buffer_count\": 512,\n \"max_write_buffer_size\": \"512k\",\n \"max_retry_delay\": \"10s\",\n \"read_poll_timeout\": \"30s\"\n }\n)" - lang: PHP source: "$resp = $client->ccr()->follow([\n \"index\" => \"follower_index\",\n \"wait_for_active_shards\" => \"1\",\n \"body\" => [\n \"remote_cluster\" => \"remote_cluster\",\n \"leader_index\" => \"leader_index\",\n \"settings\" => [\n \"index.number_of_replicas\" => 0,\n ],\n \"max_read_request_operation_count\" => 1024,\n \"max_outstanding_read_requests\" => 16,\n \"max_read_request_size\" => \"1024k\",\n \"max_write_request_operation_count\" => 32768,\n \"max_write_request_size\" => \"16k\",\n \"max_outstanding_write_requests\" => 8,\n \"max_write_buffer_count\" => 512,\n \"max_write_buffer_size\" => \"512k\",\n \"max_retry_delay\" => \"10s\",\n \"read_poll_timeout\" => \"30s\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"remote_cluster":"remote_cluster","leader_index":"leader_index","settings":{"index.number_of_replicas":0},"max_read_request_operation_count":1024,"max_outstanding_read_requests":16,"max_read_request_size":"1024k","max_write_request_operation_count":32768,"max_write_request_size":"16k","max_outstanding_write_requests":8,"max_write_buffer_count":512,"max_write_buffer_size":"512k","max_retry_delay":"10s","read_poll_timeout":"30s"}'' "$ELASTICSEARCH_URL/follower_index/_ccr/follow?wait_for_active_shards=1"' - lang: Java source: "client.ccr().follow(f -> f\n .index(\"follower_index\")\n .leaderIndex(\"leader_index\")\n .maxOutstandingReadRequests(16L)\n .maxOutstandingWriteRequests(8)\n .maxReadRequestOperationCount(1024)\n .maxReadRequestSize(\"1024k\")\n .maxRetryDelay(m -> m\n .time(\"10s\")\n )\n .maxWriteBufferCount(512)\n .maxWriteBufferSize(\"512k\")\n .maxWriteRequestOperationCount(32768)\n .maxWriteRequestSize(\"16k\")\n .readPollTimeout(r -> r\n .time(\"30s\")\n )\n .remoteCluster(\"remote_cluster\")\n .settings(s -> s\n .otherSettings(\"index.number_of_replicas\", JsonData.fromJson(\"0\"))\n )\n .waitForActiveShards(w -> w\n .count(1)\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - follow_index_created - follow_index_shards_acked - index_following_started type: object properties: follow_index_created: type: boolean follow_index_shards_acked: type: boolean index_following_started: type: boolean examples: CreateFollowIndexResponseExample1: description: A successful response from `PUT /follower_index/_ccr/follow?wait_for_active_shards=1`. value: "{\n \"follow_index_created\" : true,\n \"follow_index_shards_acked\" : true,\n \"index_following_started\" : true\n}" x-state: Generally available; Added in 6.5.0 x-codeSamples: - lang: Console source: "PUT /follower_index/_ccr/follow?wait_for_active_shards=1\n{\n \"remote_cluster\" : \"remote_cluster\",\n \"leader_index\" : \"leader_index\",\n \"settings\": {\n \"index.number_of_replicas\": 0\n },\n \"max_read_request_operation_count\" : 1024,\n \"max_outstanding_read_requests\" : 16,\n \"max_read_request_size\" : \"1024k\",\n \"max_write_request_operation_count\" : 32768,\n \"max_write_request_size\" : \"16k\",\n \"max_outstanding_write_requests\" : 8,\n \"max_write_buffer_count\" : 512,\n \"max_write_buffer_size\" : \"512k\",\n \"max_retry_delay\" : \"10s\",\n \"read_poll_timeout\" : \"30s\"\n}" - lang: Python source: "resp = client.ccr.follow(\n index=\"follower_index\",\n wait_for_active_shards=\"1\",\n remote_cluster=\"remote_cluster\",\n leader_index=\"leader_index\",\n settings={\n \"index.number_of_replicas\": 0\n },\n max_read_request_operation_count=1024,\n max_outstanding_read_requests=16,\n max_read_request_size=\"1024k\",\n max_write_request_operation_count=32768,\n max_write_request_size=\"16k\",\n max_outstanding_write_requests=8,\n max_write_buffer_count=512,\n max_write_buffer_size=\"512k\",\n max_retry_delay=\"10s\",\n read_poll_timeout=\"30s\",\n)" - lang: JavaScript source: "const response = await client.ccr.follow({\n index: \"follower_index\",\n wait_for_active_shards: 1,\n remote_cluster: \"remote_cluster\",\n leader_index: \"leader_index\",\n settings: {\n \"index.number_of_replicas\": 0,\n },\n max_read_request_operation_count: 1024,\n max_outstanding_read_requests: 16,\n max_read_request_size: \"1024k\",\n max_write_request_operation_count: 32768,\n max_write_request_size: \"16k\",\n max_outstanding_write_requests: 8,\n max_write_buffer_count: 512,\n max_write_buffer_size: \"512k\",\n max_retry_delay: \"10s\",\n read_poll_timeout: \"30s\",\n});" - lang: Ruby source: "response = client.ccr.follow(\n index: \"follower_index\",\n wait_for_active_shards: \"1\",\n body: {\n \"remote_cluster\": \"remote_cluster\",\n \"leader_index\": \"leader_index\",\n \"settings\": {\n \"index.number_of_replicas\": 0\n },\n \"max_read_request_operation_count\": 1024,\n \"max_outstanding_read_requests\": 16,\n \"max_read_request_size\": \"1024k\",\n \"max_write_request_operation_count\": 32768,\n \"max_write_request_size\": \"16k\",\n \"max_outstanding_write_requests\": 8,\n \"max_write_buffer_count\": 512,\n \"max_write_buffer_size\": \"512k\",\n \"max_retry_delay\": \"10s\",\n \"read_poll_timeout\": \"30s\"\n }\n)" - lang: PHP source: "$resp = $client->ccr()->follow([\n \"index\" => \"follower_index\",\n \"wait_for_active_shards\" => \"1\",\n \"body\" => [\n \"remote_cluster\" => \"remote_cluster\",\n \"leader_index\" => \"leader_index\",\n \"settings\" => [\n \"index.number_of_replicas\" => 0,\n ],\n \"max_read_request_operation_count\" => 1024,\n \"max_outstanding_read_requests\" => 16,\n \"max_read_request_size\" => \"1024k\",\n \"max_write_request_operation_count\" => 32768,\n \"max_write_request_size\" => \"16k\",\n \"max_outstanding_write_requests\" => 8,\n \"max_write_buffer_count\" => 512,\n \"max_write_buffer_size\" => \"512k\",\n \"max_retry_delay\" => \"10s\",\n \"read_poll_timeout\" => \"30s\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"remote_cluster":"remote_cluster","leader_index":"leader_index","settings":{"index.number_of_replicas":0},"max_read_request_operation_count":1024,"max_outstanding_read_requests":16,"max_read_request_size":"1024k","max_write_request_operation_count":32768,"max_write_request_size":"16k","max_outstanding_write_requests":8,"max_write_buffer_count":512,"max_write_buffer_size":"512k","max_retry_delay":"10s","read_poll_timeout":"30s"}'' "$ELASTICSEARCH_URL/follower_index/_ccr/follow?wait_for_active_shards=1"' - lang: Java source: "client.ccr().follow(f -> f\n .index(\"follower_index\")\n .leaderIndex(\"leader_index\")\n .maxOutstandingReadRequests(16L)\n .maxOutstandingWriteRequests(8)\n .maxReadRequestOperationCount(1024)\n .maxReadRequestSize(\"1024k\")\n .maxRetryDelay(m -> m\n .time(\"10s\")\n )\n .maxWriteBufferCount(512)\n .maxWriteBufferSize(\"512k\")\n .maxWriteRequestOperationCount(32768)\n .maxWriteRequestSize(\"16k\")\n .readPollTimeout(r -> r\n .time(\"30s\")\n )\n .remoteCluster(\"remote_cluster\")\n .settings(s -> s\n .otherSettings(\"index.number_of_replicas\", JsonData.fromJson(\"0\"))\n )\n .waitForActiveShards(w -> w\n .count(1)\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_ccr/info': get: tags: - ccr summary: Get follower information description: "Get information about all cross-cluster replication follower indices.\nFor example, the results include follower index names, leader index names, replication options, and whether the follower indices are active or paused.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" externalDocs: description: About cross-cluster replication url: https://www.elastic.co/docs/deploy-manage/tools/cross-cluster-replication x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/ccr-get-follow-info.html operationId: ccr-follow-info parameters: - name: index in: path description: A comma-delimited list of follower index patterns. required: true schema: $ref: '#/components/schemas/_types.Indices' - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nIt can also be set to `-1` to indicate that the request should never timeout." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - follower_indices type: object properties: follower_indices: type: array items: $ref: '#/components/schemas/ccr.follow_info.FollowerIndex' examples: FollowInfoResponseExample1: summary: An active follower index description: A successful response from `GET /follower_index/_ccr/info` when the follower index is active. value: "{\n \"follower_indices\": [\n {\n \"follower_index\": \"follower_index\",\n \"remote_cluster\": \"remote_cluster\",\n \"leader_index\": \"leader_index\",\n \"status\": \"active\",\n \"parameters\": {\n \"max_read_request_operation_count\": 5120,\n \"max_read_request_size\": \"32mb\",\n \"max_outstanding_read_requests\": 12,\n \"max_write_request_operation_count\": 5120,\n \"max_write_request_size\": \"9223372036854775807b\",\n \"max_outstanding_write_requests\": 9,\n \"max_write_buffer_count\": 2147483647,\n \"max_write_buffer_size\": \"512mb\",\n \"max_retry_delay\": \"500ms\",\n \"read_poll_timeout\": \"1m\"\n }\n }\n ]\n}" FollowInfoResponseExample2: summary: A paused follower index description: A successful response from `GET /follower_index/_ccr/info` when the follower index is paused. value: "{\n \"follower_indices\": [\n {\n \"follower_index\": \"follower_index\",\n \"remote_cluster\": \"remote_cluster\",\n \"leader_index\": \"leader_index\",\n \"status\": \"paused\"\n }\n ]\n}" x-state: Generally available; Added in 6.7.0 x-codeSamples: - lang: Console source: "GET /follower_index/_ccr/info\n" - lang: Python source: "resp = client.ccr.follow_info(\n index=\"follower_index\",\n)" - lang: JavaScript source: "const response = await client.ccr.followInfo({\n index: \"follower_index\",\n});" - lang: Ruby source: "response = client.ccr.follow_info(\n index: \"follower_index\"\n)" - lang: PHP source: "$resp = $client->ccr()->followInfo([\n \"index\" => \"follower_index\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/follower_index/_ccr/info"' - lang: C# source: 'var response = await client.CrossClusterReplication.FollowInfoAsync(indices: new[] { "follower_index" });' - lang: Java source: "client.ccr().followInfo(f -> f\n .index(\"follower_index\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_ccr/stats': get: tags: - ccr summary: Get follower stats description: "Get cross-cluster replication follower stats.\nThe API returns shard-level stats about the \"following tasks\" associated with each shard for the specified indices.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" externalDocs: description: About cross-cluster replication url: https://www.elastic.co/docs/deploy-manage/tools/cross-cluster-replication x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/ccr-get-follow-stats.html operationId: ccr-follow-stats parameters: - name: index in: path description: A comma-delimited list of index patterns. required: true schema: $ref: '#/components/schemas/_types.Indices' - name: timeout in: query description: "The period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - indices type: object properties: indices: type: array items: $ref: '#/components/schemas/ccr._types.FollowIndexStats' description: An array of follower index statistics. examples: FollowIndexStatsResponseExample1: description: 'A successful response from `GET /follower_index/_ccr/stats`, which retrieves follower stats.' value: "{\n \"indices\" : [\n {\n \"index\" : \"follower_index\",\n \"total_global_checkpoint_lag\" : 256,\n \"shards\" : [\n {\n \"remote_cluster\" : \"remote_cluster\",\n \"leader_index\" : \"leader_index\",\n \"follower_index\" : \"follower_index\",\n \"shard_id\" : 0,\n \"leader_global_checkpoint\" : 1024,\n \"leader_max_seq_no\" : 1536,\n \"follower_global_checkpoint\" : 768,\n \"follower_max_seq_no\" : 896,\n \"last_requested_seq_no\" : 897,\n \"outstanding_read_requests\" : 8,\n \"outstanding_write_requests\" : 2,\n \"write_buffer_operation_count\" : 64,\n \"follower_mapping_version\" : 4,\n \"follower_settings_version\" : 2,\n \"follower_aliases_version\" : 8,\n \"total_read_time_millis\" : 32768,\n \"total_read_remote_exec_time_millis\" : 16384,\n \"successful_read_requests\" : 32,\n \"failed_read_requests\" : 0,\n \"operations_read\" : 896,\n \"bytes_read\" : 32768,\n \"total_write_time_millis\" : 16384,\n \"write_buffer_size_in_bytes\" : 1536,\n \"successful_write_requests\" : 16,\n \"failed_write_requests\" : 0,\n \"operations_written\" : 832,\n \"read_exceptions\" : [ ],\n \"time_since_last_read_millis\" : 8\n }\n ]\n }\n ]\n}" x-state: Generally available; Added in 6.5.0 x-codeSamples: - lang: Console source: "GET /follower_index/_ccr/stats\n" - lang: Python source: "resp = client.ccr.follow_stats(\n index=\"follower_index\",\n)" - lang: JavaScript source: "const response = await client.ccr.followStats({\n index: \"follower_index\",\n});" - lang: Ruby source: "response = client.ccr.follow_stats(\n index: \"follower_index\"\n)" - lang: PHP source: "$resp = $client->ccr()->followStats([\n \"index\" => \"follower_index\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/follower_index/_ccr/stats"' - lang: C# source: 'var response = await client.CrossClusterReplication.FollowStatsAsync(indices: new[] { "follower_index" });' - lang: Java source: "client.ccr().followStats(f -> f\n .index(\"follower_index\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_ccr/forget_follower': post: tags: - ccr summary: Forget a follower description: "Remove the cross-cluster replication follower retention leases from the leader.\n\nA following index takes out retention leases on its leader index.\nThese leases are used to increase the likelihood that the shards of the leader index retain the history of operations that the shards of the following index need to run replication.\nWhen a follower index is converted to a regular index by the unfollow API (either by directly calling the API or by index lifecycle management tasks), these leases are removed.\nHowever, removal of the leases can fail, for example when the remote cluster containing the leader index is unavailable.\nWhile the leases will eventually expire on their own, their extended existence can cause the leader index to hold more history than necessary and prevent index lifecycle management from performing some operations on the leader index.\nThis API exists to enable manually removing the leases when the unfollow API is unable to do so.\n\nNOTE: This API does not stop replication by a following index. If you use this API with a follower index that is still actively following, the following index will add back retention leases on the leader.\nThe only purpose of this API is to handle the case of failure to remove the following retention leases after the unfollow API is invoked.\n\n## Required authorization\n\n* Index privileges: `manage_leader_index`\n" externalDocs: description: About cross-cluster replication url: https://www.elastic.co/docs/deploy-manage/tools/cross-cluster-replication x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/ccr-post-forget-follower.html operationId: ccr-forget-follower parameters: - name: index in: path description: Name of the leader index for which specified follower retention leases should be removed required: true schema: $ref: '#/components/schemas/_types.IndexName' - name: timeout in: query description: 'Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: type: object properties: follower_cluster: type: string follower_index: allOf: - $ref: '#/components/schemas/_types.IndexName' follower_index_uuid: allOf: - $ref: '#/components/schemas/_types.Uuid' leader_remote_cluster: type: string examples: ForgetFollowerIndexRequestExample1: description: Run `POST //_ccr/forget_follower`. value: "{\n \"follower_cluster\" : \"\",\n \"follower_index\" : \"\",\n \"follower_index_uuid\" : \"\",\n \"leader_remote_cluster\" : \"\"\n}" x-codeSamples: - lang: Console source: "POST //_ccr/forget_follower\n{\n \"follower_cluster\" : \"\",\n \"follower_index\" : \"\",\n \"follower_index_uuid\" : \"\",\n \"leader_remote_cluster\" : \"\"\n}" - lang: Python source: "resp = client.ccr.forget_follower(\n index=\"\",\n follower_cluster=\"\",\n follower_index=\"\",\n follower_index_uuid=\"\",\n leader_remote_cluster=\"\",\n)" - lang: JavaScript source: "const response = await client.ccr.forgetFollower({\n index: \"\",\n follower_cluster: \"\",\n follower_index: \"\",\n follower_index_uuid: \"\",\n leader_remote_cluster: \"\",\n});" - lang: Ruby source: "response = client.ccr.forget_follower(\n index: \"\",\n body: {\n \"follower_cluster\": \"\",\n \"follower_index\": \"\",\n \"follower_index_uuid\": \"\",\n \"leader_remote_cluster\": \"\"\n }\n)" - lang: PHP source: "$resp = $client->ccr()->forgetFollower([\n \"index\" => \"\",\n \"body\" => [\n \"follower_cluster\" => \"\",\n \"follower_index\" => \"\",\n \"follower_index_uuid\" => \"\",\n \"leader_remote_cluster\" => \"\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"follower_cluster":"","follower_index":"","follower_index_uuid":"","leader_remote_cluster":""}'' "$ELASTICSEARCH_URL//_ccr/forget_follower"' - lang: C# source: "var response = await client.CrossClusterReplication\n .ForgetFollowerAsync(index: \"\", d1 => d1\n .FollowerCluster(\"\")\n .FollowerIndex(\"\")\n .FollowerIndexUuid(\"\")\n .LeaderRemoteCluster(\"\")\n );" - lang: Java source: "client.ccr().forgetFollower(f -> f\n .followerCluster(\"\")\n .followerIndex(\"\")\n .followerIndexUuid(\"\")\n .index(\"\")\n .leaderRemoteCluster(\"\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - _shards type: object properties: _shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' examples: ForgetFollowerIndexResponseExample1: description: "A successful response for removing the follower retention leases from the leader index.\n" value: "{\n \"_shards\" : {\n \"total\" : 1,\n \"successful\" : 1,\n \"failed\" : 0,\n \"failures\" : [ ]\n }\n}" x-state: Generally available; Added in 6.7.0 x-codeSamples: - lang: Console source: "POST //_ccr/forget_follower\n{\n \"follower_cluster\" : \"\",\n \"follower_index\" : \"\",\n \"follower_index_uuid\" : \"\",\n \"leader_remote_cluster\" : \"\"\n}" - lang: Python source: "resp = client.ccr.forget_follower(\n index=\"\",\n follower_cluster=\"\",\n follower_index=\"\",\n follower_index_uuid=\"\",\n leader_remote_cluster=\"\",\n)" - lang: JavaScript source: "const response = await client.ccr.forgetFollower({\n index: \"\",\n follower_cluster: \"\",\n follower_index: \"\",\n follower_index_uuid: \"\",\n leader_remote_cluster: \"\",\n});" - lang: Ruby source: "response = client.ccr.forget_follower(\n index: \"\",\n body: {\n \"follower_cluster\": \"\",\n \"follower_index\": \"\",\n \"follower_index_uuid\": \"\",\n \"leader_remote_cluster\": \"\"\n }\n)" - lang: PHP source: "$resp = $client->ccr()->forgetFollower([\n \"index\" => \"\",\n \"body\" => [\n \"follower_cluster\" => \"\",\n \"follower_index\" => \"\",\n \"follower_index_uuid\" => \"\",\n \"leader_remote_cluster\" => \"\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"follower_cluster":"","follower_index":"","follower_index_uuid":"","leader_remote_cluster":""}'' "$ELASTICSEARCH_URL//_ccr/forget_follower"' - lang: C# source: "var response = await client.CrossClusterReplication\n .ForgetFollowerAsync(index: \"\", d1 => d1\n .FollowerCluster(\"\")\n .FollowerIndex(\"\")\n .FollowerIndexUuid(\"\")\n .LeaderRemoteCluster(\"\")\n );" - lang: Java source: "client.ccr().forgetFollower(f -> f\n .followerCluster(\"\")\n .followerIndex(\"\")\n .followerIndexUuid(\"\")\n .index(\"\")\n .leaderRemoteCluster(\"\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_ccr/auto_follow/{name}/pause': post: tags: - ccr summary: Pause an auto-follow pattern description: "Pause a cross-cluster replication auto-follow pattern.\nWhen the API returns, the auto-follow pattern is inactive.\nNew indices that are created on the remote cluster and match the auto-follow patterns are ignored.\n\nYou can resume auto-following with the resume auto-follow pattern API.\nWhen it resumes, the auto-follow pattern is active again and automatically configures follower indices for newly created indices on the remote cluster that match its patterns.\nRemote indices that were created while the pattern was paused will also be followed, unless they have been deleted or closed in the interim.\n\n## Required authorization\n\n* Cluster privileges: `manage_ccr`\n" externalDocs: description: More about auto-follow patterns url: https://www.elastic.co/docs/deploy-manage/tools/cross-cluster-replication/manage-auto-follow-patterns x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/ccr-pause-auto-follow-pattern.html operationId: ccr-pause-auto-follow-pattern parameters: - name: name in: path description: The name of the auto-follow pattern to pause. required: true schema: $ref: '#/components/schemas/_types.Name' - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nIt can also be set to `-1` to indicate that the request should never timeout." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: PauseAutoFollowPatternResponseExample1: description: 'A successful response from `POST /_ccr/auto_follow/my_auto_follow_pattern/pause`, which pauses an auto-follow pattern.' value: "{\n \"acknowledged\" : true\n}" x-state: Generally available; Added in 7.5.0 x-codeSamples: - lang: Console source: "POST /_ccr/auto_follow/my_auto_follow_pattern/pause\n" - lang: Python source: "resp = client.ccr.pause_auto_follow_pattern(\n name=\"my_auto_follow_pattern\",\n)" - lang: JavaScript source: "const response = await client.ccr.pauseAutoFollowPattern({\n name: \"my_auto_follow_pattern\",\n});" - lang: Ruby source: "response = client.ccr.pause_auto_follow_pattern(\n name: \"my_auto_follow_pattern\"\n)" - lang: PHP source: "$resp = $client->ccr()->pauseAutoFollowPattern([\n \"name\" => \"my_auto_follow_pattern\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ccr/auto_follow/my_auto_follow_pattern/pause"' - lang: C# source: 'var response = await client.CrossClusterReplication.PauseAutoFollowPatternAsync(name: "my_auto_follow_pattern");' - lang: Java source: "client.ccr().pauseAutoFollowPattern(p -> p\n .name(\"my_auto_follow_pattern\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_ccr/pause_follow': post: tags: - ccr summary: Pause a follower description: "Pause a cross-cluster replication follower index.\nThe follower index will not fetch any additional operations from the leader index.\nYou can resume following with the resume follower API.\nYou can pause and resume a follower index to change the configuration of the following task.\n\n## Required authorization\n\n* Cluster privileges: `manage_ccr`\n" operationId: ccr-pause-follow parameters: - name: index in: path description: The name of the follower index. required: true schema: $ref: '#/components/schemas/_types.IndexName' - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nIt can also be set to `-1` to indicate that the request should never timeout." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: PauseFollowIndexResponseExample1: description: 'A successful response from `POST /follower_index/_ccr/pause_follow`, which pauses a follower index.' value: "{\n \"acknowledged\" : true\n}" x-state: Generally available; Added in 6.5.0 x-codeSamples: - lang: Console source: "POST /follower_index/_ccr/pause_follow\n" - lang: Python source: "resp = client.ccr.pause_follow(\n index=\"follower_index\",\n)" - lang: JavaScript source: "const response = await client.ccr.pauseFollow({\n index: \"follower_index\",\n});" - lang: Ruby source: "response = client.ccr.pause_follow(\n index: \"follower_index\"\n)" - lang: PHP source: "$resp = $client->ccr()->pauseFollow([\n \"index\" => \"follower_index\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/follower_index/_ccr/pause_follow"' - lang: C# source: 'var response = await client.CrossClusterReplication.PauseFollowAsync(index: "follower_index");' - lang: Java source: "client.ccr().pauseFollow(p -> p\n .index(\"follower_index\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_ccr/auto_follow/{name}/resume': post: tags: - ccr summary: Resume an auto-follow pattern description: "Resume a cross-cluster replication auto-follow pattern that was paused.\nThe auto-follow pattern will resume configuring following indices for newly created indices that match its patterns on the remote cluster.\nRemote indices created while the pattern was paused will also be followed unless they have been deleted or closed in the interim.\n\n## Required authorization\n\n* Cluster privileges: `manage_ccr`\n" externalDocs: description: More about auto-follow patterns url: https://www.elastic.co/docs/deploy-manage/tools/cross-cluster-replication/manage-auto-follow-patterns x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/ccr-resume-auto-follow-pattern.html operationId: ccr-resume-auto-follow-pattern parameters: - name: name in: path description: The name of the auto-follow pattern to resume. required: true schema: $ref: '#/components/schemas/_types.Name' - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nIt can also be set to `-1` to indicate that the request should never timeout." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: ResumeAutoFollowPatternResponseExample1: description: "A successful response `POST /_ccr/auto_follow/my_auto_follow_pattern/resume`, which resumes an auto-follow pattern.\n" value: "{\n \"acknowledged\" : true\n}" x-state: Generally available; Added in 7.5.0 x-codeSamples: - lang: Console source: "POST /_ccr/auto_follow/my_auto_follow_pattern/resume\n" - lang: Python source: "resp = client.ccr.resume_auto_follow_pattern(\n name=\"my_auto_follow_pattern\",\n)" - lang: JavaScript source: "const response = await client.ccr.resumeAutoFollowPattern({\n name: \"my_auto_follow_pattern\",\n});" - lang: Ruby source: "response = client.ccr.resume_auto_follow_pattern(\n name: \"my_auto_follow_pattern\"\n)" - lang: PHP source: "$resp = $client->ccr()->resumeAutoFollowPattern([\n \"name\" => \"my_auto_follow_pattern\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ccr/auto_follow/my_auto_follow_pattern/resume"' - lang: C# source: 'var response = await client.CrossClusterReplication.ResumeAutoFollowPatternAsync(name: "my_auto_follow_pattern");' - lang: Java source: "client.ccr().resumeAutoFollowPattern(r -> r\n .name(\"my_auto_follow_pattern\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_ccr/resume_follow': post: tags: - ccr summary: Resume a follower description: "Resume a cross-cluster replication follower index that was paused.\nThe follower index could have been paused with the pause follower API.\nAlternatively it could be paused due to replication that cannot be retried due to failures during following tasks.\nWhen this API returns, the follower index will resume fetching operations from the leader index.\n\n## Required authorization\n\n* Index privileges: `manage_follow_index`\n* Cluster privileges: `manage_ccr`\n" externalDocs: description: About cross-cluster replication url: https://www.elastic.co/docs/deploy-manage/tools/cross-cluster-replication x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/ccr-post-resume-follow.html operationId: ccr-resume-follow parameters: - name: index in: path description: Name of the follow index to resume following required: true schema: $ref: '#/components/schemas/_types.IndexName' - name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: type: object properties: max_outstanding_read_requests: type: number max_outstanding_write_requests: type: number max_read_request_operation_count: type: number max_read_request_size: type: string max_retry_delay: allOf: - $ref: '#/components/schemas/_types.Duration' max_write_buffer_count: type: number max_write_buffer_size: type: string max_write_request_operation_count: type: number max_write_request_size: type: string read_poll_timeout: allOf: - $ref: '#/components/schemas/_types.Duration' examples: ResumeFollowIndexRequestExample1: description: Run `POST /follower_index/_ccr/resume_follow` to resume the follower index. value: "{\n \"max_read_request_operation_count\" : 1024,\n \"max_outstanding_read_requests\" : 16,\n \"max_read_request_size\" : \"1024k\",\n \"max_write_request_operation_count\" : 32768,\n \"max_write_request_size\" : \"16k\",\n \"max_outstanding_write_requests\" : 8,\n \"max_write_buffer_count\" : 512,\n \"max_write_buffer_size\" : \"512k\",\n \"max_retry_delay\" : \"10s\",\n \"read_poll_timeout\" : \"30s\"\n}" x-codeSamples: - lang: Console source: "POST /follower_index/_ccr/resume_follow\n{\n \"max_read_request_operation_count\" : 1024,\n \"max_outstanding_read_requests\" : 16,\n \"max_read_request_size\" : \"1024k\",\n \"max_write_request_operation_count\" : 32768,\n \"max_write_request_size\" : \"16k\",\n \"max_outstanding_write_requests\" : 8,\n \"max_write_buffer_count\" : 512,\n \"max_write_buffer_size\" : \"512k\",\n \"max_retry_delay\" : \"10s\",\n \"read_poll_timeout\" : \"30s\"\n}" - lang: Python source: "resp = client.ccr.resume_follow(\n index=\"follower_index\",\n max_read_request_operation_count=1024,\n max_outstanding_read_requests=16,\n max_read_request_size=\"1024k\",\n max_write_request_operation_count=32768,\n max_write_request_size=\"16k\",\n max_outstanding_write_requests=8,\n max_write_buffer_count=512,\n max_write_buffer_size=\"512k\",\n max_retry_delay=\"10s\",\n read_poll_timeout=\"30s\",\n)" - lang: JavaScript source: "const response = await client.ccr.resumeFollow({\n index: \"follower_index\",\n max_read_request_operation_count: 1024,\n max_outstanding_read_requests: 16,\n max_read_request_size: \"1024k\",\n max_write_request_operation_count: 32768,\n max_write_request_size: \"16k\",\n max_outstanding_write_requests: 8,\n max_write_buffer_count: 512,\n max_write_buffer_size: \"512k\",\n max_retry_delay: \"10s\",\n read_poll_timeout: \"30s\",\n});" - lang: Ruby source: "response = client.ccr.resume_follow(\n index: \"follower_index\",\n body: {\n \"max_read_request_operation_count\": 1024,\n \"max_outstanding_read_requests\": 16,\n \"max_read_request_size\": \"1024k\",\n \"max_write_request_operation_count\": 32768,\n \"max_write_request_size\": \"16k\",\n \"max_outstanding_write_requests\": 8,\n \"max_write_buffer_count\": 512,\n \"max_write_buffer_size\": \"512k\",\n \"max_retry_delay\": \"10s\",\n \"read_poll_timeout\": \"30s\"\n }\n)" - lang: PHP source: "$resp = $client->ccr()->resumeFollow([\n \"index\" => \"follower_index\",\n \"body\" => [\n \"max_read_request_operation_count\" => 1024,\n \"max_outstanding_read_requests\" => 16,\n \"max_read_request_size\" => \"1024k\",\n \"max_write_request_operation_count\" => 32768,\n \"max_write_request_size\" => \"16k\",\n \"max_outstanding_write_requests\" => 8,\n \"max_write_buffer_count\" => 512,\n \"max_write_buffer_size\" => \"512k\",\n \"max_retry_delay\" => \"10s\",\n \"read_poll_timeout\" => \"30s\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"max_read_request_operation_count":1024,"max_outstanding_read_requests":16,"max_read_request_size":"1024k","max_write_request_operation_count":32768,"max_write_request_size":"16k","max_outstanding_write_requests":8,"max_write_buffer_count":512,"max_write_buffer_size":"512k","max_retry_delay":"10s","read_poll_timeout":"30s"}'' "$ELASTICSEARCH_URL/follower_index/_ccr/resume_follow"' - lang: C# source: "var response = await client.CrossClusterReplication\n .ResumeFollowAsync(index: \"follower_index\", d1 => d1\n .MaxOutstandingReadRequests(16L)\n .MaxOutstandingWriteRequests(8L)\n .MaxReadRequestOperationCount(1024L)\n .MaxReadRequestSize(\"1024k\")\n .MaxRetryDelay(\"10s\")\n .MaxWriteBufferCount(512L)\n .MaxWriteBufferSize(\"512k\")\n .MaxWriteRequestOperationCount(32768L)\n .MaxWriteRequestSize(\"16k\")\n .ReadPollTimeout(\"30s\")\n );" - lang: Java source: "client.ccr().resumeFollow(r -> r\n .index(\"follower_index\")\n .maxOutstandingReadRequests(16L)\n .maxOutstandingWriteRequests(8L)\n .maxReadRequestOperationCount(1024L)\n .maxReadRequestSize(\"1024k\")\n .maxRetryDelay(m -> m\n .time(\"10s\")\n )\n .maxWriteBufferCount(512L)\n .maxWriteBufferSize(\"512k\")\n .maxWriteRequestOperationCount(32768L)\n .maxWriteRequestSize(\"16k\")\n .readPollTimeout(re -> re\n .time(\"30s\")\n )\n);\n" responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: ResumeFollowIndexResponseExample1: description: A successful response from resuming a folower index. value: "{\n \"acknowledged\" : true\n}" x-state: Generally available; Added in 6.5.0 x-codeSamples: - lang: Console source: "POST /follower_index/_ccr/resume_follow\n{\n \"max_read_request_operation_count\" : 1024,\n \"max_outstanding_read_requests\" : 16,\n \"max_read_request_size\" : \"1024k\",\n \"max_write_request_operation_count\" : 32768,\n \"max_write_request_size\" : \"16k\",\n \"max_outstanding_write_requests\" : 8,\n \"max_write_buffer_count\" : 512,\n \"max_write_buffer_size\" : \"512k\",\n \"max_retry_delay\" : \"10s\",\n \"read_poll_timeout\" : \"30s\"\n}" - lang: Python source: "resp = client.ccr.resume_follow(\n index=\"follower_index\",\n max_read_request_operation_count=1024,\n max_outstanding_read_requests=16,\n max_read_request_size=\"1024k\",\n max_write_request_operation_count=32768,\n max_write_request_size=\"16k\",\n max_outstanding_write_requests=8,\n max_write_buffer_count=512,\n max_write_buffer_size=\"512k\",\n max_retry_delay=\"10s\",\n read_poll_timeout=\"30s\",\n)" - lang: JavaScript source: "const response = await client.ccr.resumeFollow({\n index: \"follower_index\",\n max_read_request_operation_count: 1024,\n max_outstanding_read_requests: 16,\n max_read_request_size: \"1024k\",\n max_write_request_operation_count: 32768,\n max_write_request_size: \"16k\",\n max_outstanding_write_requests: 8,\n max_write_buffer_count: 512,\n max_write_buffer_size: \"512k\",\n max_retry_delay: \"10s\",\n read_poll_timeout: \"30s\",\n});" - lang: Ruby source: "response = client.ccr.resume_follow(\n index: \"follower_index\",\n body: {\n \"max_read_request_operation_count\": 1024,\n \"max_outstanding_read_requests\": 16,\n \"max_read_request_size\": \"1024k\",\n \"max_write_request_operation_count\": 32768,\n \"max_write_request_size\": \"16k\",\n \"max_outstanding_write_requests\": 8,\n \"max_write_buffer_count\": 512,\n \"max_write_buffer_size\": \"512k\",\n \"max_retry_delay\": \"10s\",\n \"read_poll_timeout\": \"30s\"\n }\n)" - lang: PHP source: "$resp = $client->ccr()->resumeFollow([\n \"index\" => \"follower_index\",\n \"body\" => [\n \"max_read_request_operation_count\" => 1024,\n \"max_outstanding_read_requests\" => 16,\n \"max_read_request_size\" => \"1024k\",\n \"max_write_request_operation_count\" => 32768,\n \"max_write_request_size\" => \"16k\",\n \"max_outstanding_write_requests\" => 8,\n \"max_write_buffer_count\" => 512,\n \"max_write_buffer_size\" => \"512k\",\n \"max_retry_delay\" => \"10s\",\n \"read_poll_timeout\" => \"30s\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"max_read_request_operation_count":1024,"max_outstanding_read_requests":16,"max_read_request_size":"1024k","max_write_request_operation_count":32768,"max_write_request_size":"16k","max_outstanding_write_requests":8,"max_write_buffer_count":512,"max_write_buffer_size":"512k","max_retry_delay":"10s","read_poll_timeout":"30s"}'' "$ELASTICSEARCH_URL/follower_index/_ccr/resume_follow"' - lang: C# source: "var response = await client.CrossClusterReplication\n .ResumeFollowAsync(index: \"follower_index\", d1 => d1\n .MaxOutstandingReadRequests(16L)\n .MaxOutstandingWriteRequests(8L)\n .MaxReadRequestOperationCount(1024L)\n .MaxReadRequestSize(\"1024k\")\n .MaxRetryDelay(\"10s\")\n .MaxWriteBufferCount(512L)\n .MaxWriteBufferSize(\"512k\")\n .MaxWriteRequestOperationCount(32768L)\n .MaxWriteRequestSize(\"16k\")\n .ReadPollTimeout(\"30s\")\n );" - lang: Java source: "client.ccr().resumeFollow(r -> r\n .index(\"follower_index\")\n .maxOutstandingReadRequests(16L)\n .maxOutstandingWriteRequests(8L)\n .maxReadRequestOperationCount(1024L)\n .maxReadRequestSize(\"1024k\")\n .maxRetryDelay(m -> m\n .time(\"10s\")\n )\n .maxWriteBufferCount(512L)\n .maxWriteBufferSize(\"512k\")\n .maxWriteRequestOperationCount(32768L)\n .maxWriteRequestSize(\"16k\")\n .readPollTimeout(re -> re\n .time(\"30s\")\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_ccr/stats: get: tags: - ccr summary: Get cross-cluster replication stats description: "This API returns stats about auto-following and the same shard-level stats as the get follower stats API.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: ccr-stats parameters: - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nIt can also be set to `-1` to indicate that the request should never timeout." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: 'The period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - auto_follow_stats - follow_stats type: object properties: auto_follow_stats: allOf: - $ref: '#/components/schemas/ccr.stats.AutoFollowStats' description: Statistics for the auto-follow coordinator. follow_stats: allOf: - $ref: '#/components/schemas/ccr.stats.FollowStats' description: Shard-level statistics for follower indices. examples: CcrStatsResponseExample1: description: A successful response from `GET /_ccr/stats` that returns cross-cluster replication stats. value: "{\n \"auto_follow_stats\" : {\n \"number_of_failed_follow_indices\" : 0,\n \"number_of_failed_remote_cluster_state_requests\" : 0,\n \"number_of_successful_follow_indices\" : 1,\n \"recent_auto_follow_errors\" : [],\n \"auto_followed_clusters\" : []\n },\n \"follow_stats\" : {\n \"indices\" : [\n {\n \"index\" : \"follower_index\",\n \"total_global_checkpoint_lag\" : 256,\n \"shards\" : [\n {\n \"remote_cluster\" : \"remote_cluster\",\n \"leader_index\" : \"leader_index\",\n \"follower_index\" : \"follower_index\",\n \"shard_id\" : 0,\n \"leader_global_checkpoint\" : 1024,\n \"leader_max_seq_no\" : 1536,\n \"follower_global_checkpoint\" : 768,\n \"follower_max_seq_no\" : 896,\n \"last_requested_seq_no\" : 897,\n \"outstanding_read_requests\" : 8,\n \"outstanding_write_requests\" : 2,\n \"write_buffer_operation_count\" : 64,\n \"follower_mapping_version\" : 4,\n \"follower_settings_version\" : 2,\n \"follower_aliases_version\" : 8,\n \"total_read_time_millis\" : 32768,\n \"total_read_remote_exec_time_millis\" : 16384,\n \"successful_read_requests\" : 32,\n \"failed_read_requests\" : 0,\n \"operations_read\" : 896,\n \"bytes_read\" : 32768,\n \"total_write_time_millis\" : 16384,\n \"write_buffer_size_in_bytes\" : 1536,\n \"successful_write_requests\" : 16,\n \"failed_write_requests\" : 0,\n \"operations_written\" : 832,\n \"read_exceptions\" : [ ],\n \"time_since_last_read_millis\" : 8\n }\n ]\n }\n ]\n }\n}" x-state: Generally available; Added in 6.5.0 x-codeSamples: - lang: Console source: "GET /_ccr/stats\n" - lang: Python source: resp = client.ccr.stats() - lang: JavaScript source: const response = await client.ccr.stats(); - lang: Ruby source: response = client.ccr.stats - lang: PHP source: $resp = $client->ccr()->stats(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ccr/stats"' - lang: C# source: var response = await client.CrossClusterReplication.StatsAsync(); - lang: Java source: "client.ccr().stats(s -> s);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_ccr/unfollow': post: tags: - ccr summary: Unfollow an index description: "Convert a cross-cluster replication follower index to a regular index.\nThe API stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication.\nThe follower index must be paused and closed before you call the unfollow API.\n\n> info\n> Currently cross-cluster replication does not support converting an existing regular index to a follower index. Converting a follower index to a regular index is an irreversible operation.\n\n## Required authorization\n\n* Index privileges: `manage_follow_index`\n" externalDocs: description: About cross-cluster replication url: https://www.elastic.co/docs/deploy-manage/tools/cross-cluster-replication x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/ccr-post-unfollow.html operationId: ccr-unfollow parameters: - name: index in: path description: The name of the follower index. required: true schema: $ref: '#/components/schemas/_types.IndexName' - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nIt can also be set to `-1` to indicate that the request should never timeout." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: UnfollowIndexResponseExample1: description: A successful response from `POST /follower_index/_ccr/unfollow`. value: "{\n \"acknowledged\" : true\n}" x-state: Generally available; Added in 6.5.0 x-codeSamples: - lang: Console source: "POST /follower_index/_ccr/unfollow\n" - lang: Python source: "resp = client.ccr.unfollow(\n index=\"follower_index\",\n)" - lang: JavaScript source: "const response = await client.ccr.unfollow({\n index: \"follower_index\",\n});" - lang: Ruby source: "response = client.ccr.unfollow(\n index: \"follower_index\"\n)" - lang: PHP source: "$resp = $client->ccr()->unfollow([\n \"index\" => \"follower_index\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/follower_index/_ccr/unfollow"' - lang: C# source: 'var response = await client.CrossClusterReplication.UnfollowAsync(index: "follower_index");' - lang: Java source: "client.ccr().unfollow(u -> u\n .index(\"follower_index\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_search/scroll/{scroll_id}': post: tags: - search summary: "Run a scrolling search\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_search/scroll\n
\n
\n POST\n /_search/scroll\n
\n
\n GET\n /_search/scroll/{scroll_id}\n
\n
\n POST\n /_search/scroll/{scroll_id}\n
\n \n\nIMPORTANT: The scroll API is no longer recommend for deep pagination. If you need to preserve the index state while paging through more than 10,000 hits, use the `search_after` parameter with a point in time (PIT).\n\nThe scroll API gets large sets of results from a single scrolling search request.\nTo get the necessary scroll ID, submit a search API request that includes an argument for the `scroll` query parameter.\nThe `scroll` parameter indicates how long Elasticsearch should retain the search context for the request.\nThe search response returns a scroll ID in the `_scroll_id` response body parameter.\nYou can then use the scroll ID with the scroll API to retrieve the next batch of results for the request.\nIf the Elasticsearch security features are enabled, the access to the results of a specific scroll ID is restricted to the user or API key that submitted the search.\n\nYou can also use the scroll API to specify a new scroll parameter that extends or shortens the retention period for the search context.\n\nIMPORTANT: Results from a scrolling search reflect the state of the index at the time of the initial search request. Subsequent indexing or document changes only affect later search and scroll requests.\n\n## Required authorization\n\n* Index privileges: `read`\n" externalDocs: description: About paginating search results url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/paginate-search-results#scroll-search-results x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/scroll-api.html operationId: scroll parameters: - $ref: '#/components/parameters/scroll-scroll_id' - $ref: '#/components/parameters/scroll-scroll' - $ref: '#/components/parameters/scroll-scroll_id_' - $ref: '#/components/parameters/scroll-rest_total_hits_as_int' requestBody: $ref: '#/components/requestBodies/scroll' responses: '200': $ref: '#/components/responses/scroll-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET /_search/scroll\n{\n \"scroll_id\" : \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" - lang: Python source: "resp = client.scroll(\n scroll_id=\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n)" - lang: JavaScript source: "const response = await client.scroll({\n scroll_id: \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n});" - lang: Ruby source: "response = client.scroll(\n body: {\n \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n }\n)" - lang: PHP source: "$resp = $client->scroll([\n \"body\" => [\n \"scroll_id\" => \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n ],\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"scroll_id":"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ=="}'' "$ELASTICSEARCH_URL/_search/scroll"' - lang: C# source: "var response = await client\n .ScrollAsync(d1 => d1\n .ScrollId(\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\")\n );" - lang: Java source: "client.scroll(s -> s\n .scrollId(\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - search summary: "Clear a scrolling search\n" description: "**All methods and paths for this operation:**\n\n
\n DELETE\n /_search/scroll\n
\n
\n DELETE\n /_search/scroll/{scroll_id}\n
\n \n\nClear the search context and results for a scrolling search." externalDocs: description: About paginating search results url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/paginate-search-results#scroll-search-results x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/clear-scroll-api.html operationId: clear-scroll parameters: - $ref: '#/components/parameters/clear_scroll-scroll_id' requestBody: $ref: '#/components/requestBodies/clear_scroll' responses: '200': $ref: '#/components/responses/clear_scroll-200' '404': $ref: '#/components/responses/clear_scroll-404' x-state: Generally available x-codeSamples: - lang: Console source: "DELETE /_search/scroll\n{\n \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" - lang: Python source: "resp = client.clear_scroll(\n scroll_id=\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n)" - lang: JavaScript source: "const response = await client.clearScroll({\n scroll_id: \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n});" - lang: Ruby source: "response = client.clear_scroll(\n body: {\n \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n }\n)" - lang: PHP source: "$resp = $client->clearScroll([\n \"body\" => [\n \"scroll_id\" => \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n ],\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"scroll_id":"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ=="}'' "$ELASTICSEARCH_URL/_search/scroll"' - lang: C# source: "var response = await client\n .ClearScrollAsync(d1 => d1\n .ScrollId(new[] { \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\" })\n );" - lang: Java source: "client.clearScroll(c -> c\n .scrollId(\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_pit: delete: tags: - search summary: Close a point in time description: "A point in time must be opened explicitly before being used in search requests.\nThe `keep_alive` parameter tells Elasticsearch how long it should persist.\nA point in time is automatically closed when the `keep_alive` period has elapsed.\nHowever, keeping points in time has a cost; close them as soon as they are no longer required for search requests." operationId: close-point-in-time requestBody: content: application/json: schema: required: - id type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: "The ID of the point-in-time.\n\nIMPORTANT: Each search request against a PIT returns in its response a `pit_id` field which may be different from the identifier you originally supplied.\nAlways use the most recently-received PIT identifier for the next request.\nIf you make concurrent search requests against the same PIT, Elasticsearch can return several different `pit_id` values in its responses.\nIn that case, use any of these values for later requests, preferring more recently-received values whenever possible." examples: ClosePointInTimeRequestExample1: description: Run `DELETE /_pit` to close a point-in-time. value: "{\n \"id\": \"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\"\n}" x-codeSamples: - lang: Console source: "DELETE /_pit\n{\n \"id\": \"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\"\n}" - lang: Python source: "resp = client.close_point_in_time(\n id=\"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\",\n)" - lang: JavaScript source: "const response = await client.closePointInTime({\n id: \"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\",\n});" - lang: Ruby source: "response = client.close_point_in_time(\n body: {\n \"id\": \"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\"\n }\n)" - lang: PHP source: "$resp = $client->closePointInTime([\n \"body\" => [\n \"id\" => \"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\",\n ],\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"id":"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA=="}'' "$ELASTICSEARCH_URL/_pit"' - lang: C# source: "var response = await client\n .ClosePointInTimeAsync(d1 => d1\n .Id(\"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\")\n );" - lang: Java source: "client.closePointInTime(c -> c\n .id(\"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - succeeded - num_freed type: object properties: succeeded: type: boolean description: 'If `true`, all search contexts associated with the point-in-time ID were successfully closed.' num_freed: type: number description: The number of search contexts that were successfully closed. examples: ClosePointInTimeResponseExample1: description: A successful response from `DELETE /_pit`. value: "{\n \"succeeded\": true, \n \"num_freed\": 3 \n}" '404': description: '' content: application/json: schema: required: - succeeded - num_freed type: object properties: succeeded: type: boolean num_freed: type: number x-state: Generally available; Added in 7.10.0 x-codeSamples: - lang: Console source: "DELETE /_pit\n{\n \"id\": \"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\"\n}" - lang: Python source: "resp = client.close_point_in_time(\n id=\"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\",\n)" - lang: JavaScript source: "const response = await client.closePointInTime({\n id: \"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\",\n});" - lang: Ruby source: "response = client.close_point_in_time(\n body: {\n \"id\": \"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\"\n }\n)" - lang: PHP source: "$resp = $client->closePointInTime([\n \"body\" => [\n \"id\" => \"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\",\n ],\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"id":"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA=="}'' "$ELASTICSEARCH_URL/_pit"' - lang: C# source: "var response = await client\n .ClosePointInTimeAsync(d1 => d1\n .Id(\"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\")\n );" - lang: Java source: "client.closePointInTime(c -> c\n .id(\"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_cluster/allocation/explain: post: tags: - cluster summary: "Explain the shard allocations\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_cluster/allocation/explain\n
\n
\n POST\n /_cluster/allocation/explain\n
\n \n\nGet explanations for shard allocations in the cluster.\nThis API accepts the current_node, index, primary and shard parameters in the request body or in query parameters, but not in both at the same time.\nFor unassigned shards, it provides an explanation for why the shard is unassigned.\nFor assigned shards, it provides an explanation for why the shard is remaining on its current node and has not moved or rebalanced to another node.\nThis API can be very useful when attempting to diagnose why a shard is unassigned or why a shard continues to remain on its current node when you might expect otherwise.\nRefer to the linked documentation for examples of how to troubleshoot allocation issues using this API.\n\n## Required authorization\n\n* Cluster privileges: `monitor`,`manage`\n" externalDocs: description: Cluster allocation API examples url: https://www.elastic.co/docs/troubleshoot/elasticsearch/cluster-allocation-api-examples x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/cluster-allocation-explain.html operationId: cluster-allocation-explain parameters: - $ref: '#/components/parameters/cluster.allocation_explain-index' - $ref: '#/components/parameters/cluster.allocation_explain-shard' - $ref: '#/components/parameters/cluster.allocation_explain-primary' - $ref: '#/components/parameters/cluster.allocation_explain-current_node' - $ref: '#/components/parameters/cluster.allocation_explain-include_disk_info' - $ref: '#/components/parameters/cluster.allocation_explain-include_yes_decisions' - $ref: '#/components/parameters/cluster.allocation_explain-master_timeout' requestBody: $ref: '#/components/requestBodies/cluster.allocation_explain' responses: '200': $ref: '#/components/responses/cluster.allocation_explain-200' x-state: Generally available; Added in 5.0.0 x-codeSamples: - lang: Console source: "GET _cluster/allocation/explain\n{\n \"index\": \"my-index-000001\",\n \"shard\": 0,\n \"primary\": false,\n \"current_node\": \"my-node\"\n}" - lang: Python source: "resp = client.cluster.allocation_explain(\n index=\"my-index-000001\",\n shard=0,\n primary=False,\n current_node=\"my-node\",\n)" - lang: JavaScript source: "const response = await client.cluster.allocationExplain({\n index: \"my-index-000001\",\n shard: 0,\n primary: false,\n current_node: \"my-node\",\n});" - lang: Ruby source: "response = client.cluster.allocation_explain(\n body: {\n \"index\": \"my-index-000001\",\n \"shard\": 0,\n \"primary\": false,\n \"current_node\": \"my-node\"\n }\n)" - lang: PHP source: "$resp = $client->cluster()->allocationExplain([\n \"body\" => [\n \"index\" => \"my-index-000001\",\n \"shard\" => 0,\n \"primary\" => false,\n \"current_node\" => \"my-node\",\n ],\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"index":"my-index-000001","shard":0,"primary":false,"current_node":"my-node"}'' "$ELASTICSEARCH_URL/_cluster/allocation/explain"' - lang: C# source: "var response = await client.Cluster\n .AllocationExplainAsync(d1 => d1\n .CurrentNode(\"my-node\")\n .Index(\"my-index-000001\")\n .Primary(false)\n .Shard(0)\n );" - lang: Java source: "client.cluster().allocationExplain(a -> a\n .currentNode(\"my-node\")\n .index(\"my-index-000001\")\n .primary(false)\n .shard(0)\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_component_template/{name}': get: tags: - indices summary: "Get component templates\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_component_template\n
\n
\n GET\n /_component_template/{name}\n
\n \n\nGet information about component templates.\n\n## Required authorization\n\n* Cluster privileges: `manage_index_templates`\n" operationId: cluster-get-component-template parameters: - $ref: '#/components/parameters/cluster.get_component_template-name' - $ref: '#/components/parameters/cluster.get_component_template-flat_settings' - $ref: '#/components/parameters/cluster.get_component_template-settings_filter' - $ref: '#/components/parameters/cluster.get_component_template-include_defaults' - $ref: '#/components/parameters/cluster.get_component_template-local' - $ref: '#/components/parameters/cluster.get_component_template-master_timeout' responses: '200': $ref: '#/components/responses/cluster.get_component_template-200' x-state: Generally available; Added in 7.8.0 x-codeSamples: - lang: Console source: "GET /_component_template/template_1\n" - lang: Python source: "resp = client.cluster.get_component_template(\n name=\"template_1\",\n)" - lang: JavaScript source: "const response = await client.cluster.getComponentTemplate({\n name: \"template_1\",\n});" - lang: Ruby source: "response = client.cluster.get_component_template(\n name: \"template_1\"\n)" - lang: PHP source: "$resp = $client->cluster()->getComponentTemplate([\n \"name\" => \"template_1\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_component_template/template_1"' - lang: C# source: "var response = await client.Cluster\n .GetComponentTemplateAsync(d1 => d1\n .Name(\"template_1\")\n );" - lang: Java source: "client.cluster().getComponentTemplate(g -> g\n .name(\"template_1\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name post: tags: - indices summary: "Create or update a component template\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_component_template/{name}\n
\n
\n POST\n /_component_template/{name}\n
\n \n\nComponent templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.\n\nAn index template can be composed of multiple component templates.\nTo use a component template, specify it in an index template’s `composed_of` list.\nComponent templates are only applied to new data streams and indices as part of a matching index template.\n\nSettings and mappings specified directly in the index template or the create index request override any settings or mappings specified in a component template.\n\nComponent templates are only used during index creation.\nFor data streams, this includes data stream creation and the creation of a stream’s backing indices.\nChanges to component templates do not affect existing indices, including a stream’s backing indices.\n\nYou can use C-style `/* *\\/` block comments in component templates.\nYou can include comments anywhere in the request body except before the opening curly bracket.\n\n**Applying component templates**\n\nYou cannot directly apply a component template to a data stream or index.\nTo be applied, a component template must be included in an index template's `composed_of` list.\n\n## Required authorization\n\n* Cluster privileges: `manage_index_templates`\n" operationId: cluster-put-component-template parameters: - $ref: '#/components/parameters/cluster.put_component_template-name' - $ref: '#/components/parameters/cluster.put_component_template-create' - $ref: '#/components/parameters/cluster.put_component_template-cause' - $ref: '#/components/parameters/cluster.put_component_template-master_timeout' requestBody: $ref: '#/components/requestBodies/cluster.put_component_template' responses: '200': $ref: '#/components/responses/cluster.put_component_template-200' x-state: Generally available; Added in 7.8.0 x-codeSamples: - lang: Console source: "PUT _component_template/template_1\n{\n \"template\": {\n \"settings\": {\n \"number_of_shards\": 1\n },\n \"mappings\": {\n \"_source\": {\n \"enabled\": false\n },\n \"properties\": {\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n }\n }\n }\n}" - lang: Python source: "resp = client.cluster.put_component_template(\n name=\"template_1\",\n template={\n \"settings\": {\n \"number_of_shards\": 1\n },\n \"mappings\": {\n \"_source\": {\n \"enabled\": False\n },\n \"properties\": {\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.cluster.putComponentTemplate({\n name: \"template_1\",\n template: {\n settings: {\n number_of_shards: 1,\n },\n mappings: {\n _source: {\n enabled: false,\n },\n properties: {\n host_name: {\n type: \"keyword\",\n },\n created_at: {\n type: \"date\",\n format: \"EEE MMM dd HH:mm:ss Z yyyy\",\n },\n },\n },\n },\n});" - lang: Ruby source: "response = client.cluster.put_component_template(\n name: \"template_1\",\n body: {\n \"template\": {\n \"settings\": {\n \"number_of_shards\": 1\n },\n \"mappings\": {\n \"_source\": {\n \"enabled\": false\n },\n \"properties\": {\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->cluster()->putComponentTemplate([\n \"name\" => \"template_1\",\n \"body\" => [\n \"template\" => [\n \"settings\" => [\n \"number_of_shards\" => 1,\n ],\n \"mappings\" => [\n \"_source\" => [\n \"enabled\" => false,\n ],\n \"properties\" => [\n \"host_name\" => [\n \"type\" => \"keyword\",\n ],\n \"created_at\" => [\n \"type\" => \"date\",\n \"format\" => \"EEE MMM dd HH:mm:ss Z yyyy\",\n ],\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"template":{"settings":{"number_of_shards":1},"mappings":{"_source":{"enabled":false},"properties":{"host_name":{"type":"keyword"},"created_at":{"type":"date","format":"EEE MMM dd HH:mm:ss Z yyyy"}}}}}'' "$ELASTICSEARCH_URL/_component_template/template_1"' - lang: C# source: "var response = await client.Cluster\n .PutComponentTemplateAsync(name: \"template_1\", d1 => d1\n .Template(d2 => d2\n .Mappings(d3 => d3\n .Properties(d4 => d4\n .Keyword(x => x.HostName)\n .Date(x => x.CreatedAt, d5 => d5\n .Format(\"EEE MMM dd HH:mm:ss Z yyyy\")\n )\n )\n .Source(d4 => d4\n .Enabled(false)\n )\n )\n .Settings(d3 => d3\n .NumberOfShards(1)\n )\n )\n );" - lang: Java source: "client.cluster().putComponentTemplate(p -> p\n .name(\"template_1\")\n .template(t -> t\n .mappings(m -> m\n .properties(Map.of(\"created_at\", Property.of(pr -> pr\n .date(d -> d\n .format(\"EEE MMM dd HH:mm:ss Z yyyy\")\n )\n ),\"host_name\", Property.of(pro -> pro\n .keyword(k -> k)\n )))\n .source(s -> s\n .enabled(false)\n )\n )\n .settings(s -> s\n .otherSettings(Map.of())\n .numberOfShards(\"1\")\n )\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - indices summary: Delete component templates description: "Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.\n\n## Required authorization\n\n* Cluster privileges: `manage_index_templates`\n" operationId: cluster-delete-component-template parameters: - name: name in: path description: Comma-separated list or wildcard expression of component template names used to limit the request. required: true schema: $ref: '#/components/schemas/_types.Names' - name: master_timeout in: query description: "Period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "Period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 7.8.0 x-codeSamples: - lang: Console source: "DELETE _component_template/template_1\n" - lang: Python source: "resp = client.cluster.delete_component_template(\n name=\"template_1\",\n)" - lang: JavaScript source: "const response = await client.cluster.deleteComponentTemplate({\n name: \"template_1\",\n});" - lang: Ruby source: "response = client.cluster.delete_component_template(\n name: \"template_1\"\n)" - lang: PHP source: "$resp = $client->cluster()->deleteComponentTemplate([\n \"name\" => \"template_1\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_component_template/template_1"' - lang: C# source: 'var response = await client.Cluster.DeleteComponentTemplateAsync(name: new[] { "template_1" });' - lang: Java source: "client.cluster().deleteComponentTemplate(d -> d\n .name(\"template_1\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name head: tags: - indices summary: Check component templates description: "Returns information about whether a particular component template exists.\n\n## Required authorization\n\n* Cluster privileges: `monitor`,`manage_index_templates`\n" operationId: cluster-exists-component-template parameters: - name: name in: path description: "Comma-separated list of component template names used to limit the request.\nWildcard (*) expressions are supported." required: true schema: $ref: '#/components/schemas/_types.Names' - name: master_timeout in: query description: "Period to wait for a connection to the master node. If no response is\nreceived before the timeout expires, the request fails and returns an\nerror." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: local in: query description: "If true, the request retrieves information from the local node only.\nDefaults to false, which means information is retrieved from the master node." deprecated: true schema: type: boolean default: false responses: '200': description: '' content: application/json: { } x-state: Generally available; Added in 7.8.0 x-metaTags: - content: Elasticsearch name: product_name /_cluster/voting_config_exclusions: post: tags: - cluster summary: Update voting configuration exclusions description: "Update the cluster voting config exclusions by node IDs or node names.\nBy default, if there are more than three master-eligible nodes in the cluster and you remove fewer than half of the master-eligible nodes in the cluster at once, the voting configuration automatically shrinks.\nIf you want to shrink the voting configuration to contain fewer than three nodes or to remove half or more of the master-eligible nodes in the cluster at once, use this API to remove departing nodes from the voting configuration manually.\nThe API adds an entry for each specified node to the cluster’s voting configuration exclusions list.\nIt then waits until the cluster has reconfigured its voting configuration to exclude the specified nodes.\n\nClusters should have no voting configuration exclusions in normal operation.\nOnce the excluded nodes have stopped, clear the voting configuration exclusions with `DELETE /_cluster/voting_config_exclusions`.\nThis API waits for the nodes to be fully removed from the cluster before it returns.\nIf your cluster has voting configuration exclusions for nodes that you no longer intend to remove, use `DELETE /_cluster/voting_config_exclusions?wait_for_removal=false` to clear the voting configuration exclusions without waiting for the nodes to leave the cluster.\n\nA response to `POST /_cluster/voting_config_exclusions` with an HTTP status code of 200 OK guarantees that the node has been removed from the voting configuration and will not be reinstated until the voting configuration exclusions are cleared by calling `DELETE /_cluster/voting_config_exclusions`.\nIf the call to `POST /_cluster/voting_config_exclusions` fails or returns a response with an HTTP status code other than 200 OK then the node may not have been removed from the voting configuration.\nIn that case, you may safely retry the call.\n\nNOTE: Voting exclusions are required only when you remove at least half of the master-eligible nodes from a cluster in a short time period.\nThey are not required when removing master-ineligible nodes or when removing fewer than half of the master-eligible nodes.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" externalDocs: description: More about node management url: https://www.elastic.co/docs/deploy-manage/maintenance/add-and-remove-elasticsearch-nodes x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/voting-config-exclusions.html operationId: cluster-post-voting-config-exclusions parameters: - name: node_names in: query description: "A comma-separated list of the names of the nodes to exclude from the\nvoting configuration. If specified, you may not also specify node_ids." schema: $ref: '#/components/schemas/_types.Names' - name: node_ids in: query description: "A comma-separated list of the persistent ids of the nodes to exclude\nfrom the voting configuration. If specified, you may not also specify node_names." schema: $ref: '#/components/schemas/_types.Ids' - name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "When adding a voting configuration exclusion, the API waits for the\nspecified nodes to be excluded from the voting configuration before\nreturning. If the timeout expires before the appropriate condition\nis satisfied, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: { } x-state: Generally available; Added in 7.0.0 x-metaTags: - content: Elasticsearch name: product_name delete: tags: - cluster summary: Clear cluster voting config exclusions description: "Remove master-eligible nodes from the voting configuration exclusion list.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" externalDocs: description: More about node management url: https://www.elastic.co/docs/deploy-manage/maintenance/add-and-remove-elasticsearch-nodes x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/voting-config-exclusions.html operationId: cluster-delete-voting-config-exclusions parameters: - name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: wait_for_removal in: query description: "Specifies whether to wait for all excluded nodes to be removed from the\ncluster before clearing the voting configuration exclusions list.\nDefaults to true, meaning that all excluded nodes must be removed from\nthe cluster before this API takes any action. If set to false then the\nvoting configuration exclusions list is cleared even if some excluded\nnodes are still in the cluster." schema: type: boolean default: true responses: '200': description: '' content: application/json: { } x-state: Generally available; Added in 7.0.0 x-metaTags: - content: Elasticsearch name: product_name /_cluster/settings: get: tags: - cluster summary: Get cluster-wide settings description: "By default, it returns only settings that have been explicitly defined.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" externalDocs: description: More about Elastic Stack settings url: https://www.elastic.co/docs/deploy-manage/stack-settings x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/cluster-get-settings.html operationId: cluster-get-settings parameters: - name: flat_settings in: query description: 'If `true`, returns settings in flat format.' schema: type: boolean default: false - name: include_defaults in: query description: "If `true`, also returns the values of all other cluster settings set in the\n`elasticsearch.yml` file on one of the nodes in your cluster, together with the default\nvalues of all other cluster settings on that node. The default value of each setting may\ndepend on the values of other settings on that node. If the nodes in your cluster do not all\nhave the same configuration then the values returned by this API may vary from invocation to\ninvocation and may not reflect the values that Elasticsearch uses in all situations. Use the\n`GET _nodes/settings` API to fetch the settings for each individual node in your cluster." schema: type: boolean default: false - name: master_timeout in: query description: "Period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "Period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - persistent - transient type: object properties: persistent: type: object additionalProperties: type: object description: The settings that persist after the cluster restarts. transient: type: object additionalProperties: type: object description: The settings that do not persist after the cluster restarts. defaults: type: object additionalProperties: type: object description: The default setting values. x-state: Generally available x-codeSamples: - lang: Console source: "GET /_cluster/settings?filter_path=persistent.cluster.remote\n" - lang: Python source: "resp = client.cluster.get_settings(\n filter_path=\"persistent.cluster.remote\",\n)" - lang: JavaScript source: "const response = await client.cluster.getSettings({\n filter_path: \"persistent.cluster.remote\",\n});" - lang: Ruby source: "response = client.cluster.get_settings(\n filter_path: \"persistent.cluster.remote\"\n)" - lang: PHP source: "$resp = $client->cluster()->getSettings([\n \"filter_path\" => \"persistent.cluster.remote\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cluster/settings?filter_path=persistent.cluster.remote"' - lang: C# source: var response = await client.Cluster.GetSettingsAsync(); - lang: Java source: "client.cluster().getSettings(g -> g);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - cluster summary: Update the cluster settings description: "Configure and update dynamic settings on a running cluster.\nYou can also configure dynamic settings locally on an unstarted or shut down node in `elasticsearch.yml`.\n\nUpdates made with this API can be persistent, which apply across cluster restarts, or transient, which reset after a cluster restart.\nYou can also reset transient or persistent settings by assigning them a null value.\n\nIf you configure the same setting using multiple methods, Elasticsearch applies the settings in following order of precedence: 1) Transient setting; 2) Persistent setting; 3) `elasticsearch.yml` setting; 4) Default setting value.\nFor example, you can apply a transient setting to override a persistent setting or `elasticsearch.yml` setting.\nHowever, a change to an `elasticsearch.yml` setting will not override a defined transient or persistent setting.\n\nTIP: In Elastic Cloud, use the user settings feature to configure all cluster settings. This method automatically rejects unsafe settings that could break your cluster.\nIf you run Elasticsearch on your own hardware, use this API to configure dynamic cluster settings.\nOnly use `elasticsearch.yml` for static cluster settings and node settings.\nThe API doesn’t require a restart and ensures a setting’s value is the same on all nodes.\n\nWARNING: Transient cluster settings are no longer recommended. Use persistent cluster settings instead.\nIf a cluster becomes unstable, transient settings can clear unexpectedly, resulting in a potentially undesired cluster configuration.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" externalDocs: description: More about Elastic Stack settings url: https://www.elastic.co/docs/deploy-manage/stack-settings x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/cluster-update-settings.html operationId: cluster-put-settings parameters: - name: flat_settings in: query description: Return settings in flat format schema: type: boolean default: false - name: master_timeout in: query description: The period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: The period to wait for a response. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: type: object properties: persistent: type: object additionalProperties: type: object description: The settings that persist after the cluster restarts. transient: type: object additionalProperties: type: object description: The settings that do not persist after the cluster restarts. examples: ClusterPutSettingsRequestExample1: summary: A simple setting description: An example of a persistent update. value: "{\n \"persistent\" : {\n \"indices.recovery.max_bytes_per_sec\" : \"50mb\"\n }\n}" x-codeSamples: - lang: Console source: "PUT /_cluster/settings\n{\n \"persistent\" : {\n \"indices.recovery.max_bytes_per_sec\" : \"50mb\"\n }\n}" - lang: Python source: "resp = client.cluster.put_settings(\n persistent={\n \"indices.recovery.max_bytes_per_sec\": \"50mb\"\n },\n)" - lang: JavaScript source: "const response = await client.cluster.putSettings({\n persistent: {\n \"indices.recovery.max_bytes_per_sec\": \"50mb\",\n },\n});" - lang: Ruby source: "response = client.cluster.put_settings(\n body: {\n \"persistent\": {\n \"indices.recovery.max_bytes_per_sec\": \"50mb\"\n }\n }\n)" - lang: PHP source: "$resp = $client->cluster()->putSettings([\n \"body\" => [\n \"persistent\" => [\n \"indices.recovery.max_bytes_per_sec\" => \"50mb\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"persistent":{"indices.recovery.max_bytes_per_sec":"50mb"}}'' "$ELASTICSEARCH_URL/_cluster/settings"' - lang: C# source: "var response = await client.Cluster\n .PutSettingsAsync(d1 => d1\n .Persistent(new Dictionary()\n {\n { \"indices.recovery.max_bytes_per_sec\", \"50mb\" }\n })\n );" - lang: Java source: "client.cluster().putSettings(p -> p\n .persistent(\"indices.recovery.max_bytes_per_sec\", JsonData.fromJson(\"\\\"50mb\\\"\"))\n);\n" ClusterPutSettingsRequestExample2: summary: A setting with multiple patterns description: "PUT `/_cluster/settings` to update the `action.auto_create_index` setting. The setting accepts a comma-separated list of patterns that you want to allow or you can prefix each pattern with `+` or `-` to indicate whether it should be allowed or blocked. In this example, the auto-creation of indices called `my-index-000001` or `index10` is allowed, the creation of indices that match the pattern `index1*` is blocked, and the creation of any other indices that match the `ind*` pattern is allowed. Patterns are matched in the order specified.\n" value: "{\n \"persistent\": {\n \"action.auto_create_index\": \"my-index-000001,index10,-index1*,+ind*\" \n }\n}" x-codeSamples: - lang: Console source: "PUT /_cluster/settings\n{\n \"persistent\": {\n \"action.auto_create_index\": \"my-index-000001,index10,-index1*,+ind*\" \n }\n}" - lang: Python source: "resp = client.cluster.put_settings(\n persistent={\n \"action.auto_create_index\": \"my-index-000001,index10,-index1*,+ind*\"\n },\n)" - lang: JavaScript source: "const response = await client.cluster.putSettings({\n persistent: {\n \"action.auto_create_index\": \"my-index-000001,index10,-index1*,+ind*\",\n },\n});" - lang: Ruby source: "response = client.cluster.put_settings(\n body: {\n \"persistent\": {\n \"action.auto_create_index\": \"my-index-000001,index10,-index1*,+ind*\"\n }\n }\n)" - lang: PHP source: "$resp = $client->cluster()->putSettings([\n \"body\" => [\n \"persistent\" => [\n \"action.auto_create_index\" => \"my-index-000001,index10,-index1*,+ind*\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"persistent":{"action.auto_create_index":"my-index-000001,index10,-index1*,+ind*"}}'' "$ELASTICSEARCH_URL/_cluster/settings"' - lang: C# source: "var response = await client.Cluster\n .PutSettingsAsync(d1 => d1\n .Persistent(new Dictionary()\n {\n { \"action.auto_create_index\", \"my-index-000001,index10,-index1*,+ind*\" }\n })\n );" - lang: Java source: "client.cluster().putSettings(p -> p\n .persistent(\"action.auto_create_index\", JsonData.fromJson(\"\\\"my-index-000001,index10,-index1*,+ind*\\\"\"))\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - acknowledged - persistent - transient type: object properties: acknowledged: type: boolean persistent: type: object additionalProperties: type: object transient: type: object additionalProperties: type: object x-state: Generally available x-codeSamples: - lang: Console source: "PUT /_cluster/settings\n{\n \"persistent\" : {\n \"indices.recovery.max_bytes_per_sec\" : \"50mb\"\n }\n}" - lang: Python source: "resp = client.cluster.put_settings(\n persistent={\n \"indices.recovery.max_bytes_per_sec\": \"50mb\"\n },\n)" - lang: JavaScript source: "const response = await client.cluster.putSettings({\n persistent: {\n \"indices.recovery.max_bytes_per_sec\": \"50mb\",\n },\n});" - lang: Ruby source: "response = client.cluster.put_settings(\n body: {\n \"persistent\": {\n \"indices.recovery.max_bytes_per_sec\": \"50mb\"\n }\n }\n)" - lang: PHP source: "$resp = $client->cluster()->putSettings([\n \"body\" => [\n \"persistent\" => [\n \"indices.recovery.max_bytes_per_sec\" => \"50mb\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"persistent":{"indices.recovery.max_bytes_per_sec":"50mb"}}'' "$ELASTICSEARCH_URL/_cluster/settings"' - lang: C# source: "var response = await client.Cluster\n .PutSettingsAsync(d1 => d1\n .Persistent(new Dictionary()\n {\n { \"indices.recovery.max_bytes_per_sec\", \"50mb\" }\n })\n );" - lang: Java source: "client.cluster().putSettings(p -> p\n .persistent(\"indices.recovery.max_bytes_per_sec\", JsonData.fromJson(\"\\\"50mb\\\"\"))\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_cluster/health/{index}': get: tags: - cluster summary: "Get the cluster health status\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_cluster/health\n
\n
\n GET\n /_cluster/health/{index}\n
\n \n\nYou can also use the API to get the health status of only specified data streams and indices.\nFor data streams, the API retrieves the health status of the stream’s backing indices.\n\nThe cluster health status is: green, yellow or red.\nOn the shard level, a red status indicates that the specific shard is not allocated in the cluster. Yellow means that the primary shard is allocated but replicas are not. Green means that all shards are allocated.\nThe index level status is controlled by the worst shard status.\n\nOne of the main benefits of the API is the ability to wait until the cluster reaches a certain high watermark health level.\nThe cluster status is controlled by the worst index status.\n\n## Required authorization\n\n* Cluster privileges: `monitor`,`manage`\n" operationId: cluster-health parameters: - $ref: '#/components/parameters/cluster.health-index' - $ref: '#/components/parameters/cluster.health-expand_wildcards' - $ref: '#/components/parameters/cluster.health-level' - $ref: '#/components/parameters/cluster.health-local' - $ref: '#/components/parameters/cluster.health-master_timeout' - $ref: '#/components/parameters/cluster.health-timeout' - $ref: '#/components/parameters/cluster.health-wait_for_active_shards' - $ref: '#/components/parameters/cluster.health-wait_for_events' - $ref: '#/components/parameters/cluster.health-wait_for_nodes' - $ref: '#/components/parameters/cluster.health-wait_for_no_initializing_shards' - $ref: '#/components/parameters/cluster.health-wait_for_no_relocating_shards' - $ref: '#/components/parameters/cluster.health-wait_for_status' responses: '200': $ref: '#/components/responses/cluster.health-200' '408': $ref: '#/components/responses/cluster.health-408' x-state: Generally available; Added in 1.3.0 x-codeSamples: - lang: Console source: "GET _cluster/health\n" - lang: Python source: resp = client.cluster.health() - lang: JavaScript source: const response = await client.cluster.health(); - lang: Ruby source: response = client.cluster.health - lang: PHP source: $resp = $client->cluster()->health(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cluster/health"' - lang: C# source: var response = await client.Cluster.HealthAsync(); - lang: Java source: "client.cluster().health(h -> h);\n" x-metaTags: - content: Elasticsearch name: product_name '/_info/{target}': get: tags: - cluster summary: Get cluster subsystem info description: "Returns basic information about the cluster.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: cluster-info parameters: - name: target in: path description: "Limits the information returned to the specific target. Supports a comma-separated list, such as http,ingest.\n\nSupported values include: `_all`, `http`, `ingest`, `thread_pool`, `script`\n\n" required: true schema: $ref: '#/components/schemas/_types.ClusterInfoTargets' responses: '200': description: '' content: application/json: schema: required: - cluster_name type: object properties: cluster_name: allOf: - $ref: '#/components/schemas/_types.Name' http: allOf: - $ref: '#/components/schemas/nodes._types.Http' ingest: allOf: - $ref: '#/components/schemas/nodes._types.Ingest' thread_pool: type: object additionalProperties: $ref: '#/components/schemas/nodes._types.ThreadCount' script: allOf: - $ref: '#/components/schemas/nodes._types.Scripting' x-state: Generally available; Added in 8.9.0 x-codeSamples: - lang: Console source: "GET /_info/_all\n" - lang: Python source: "resp = client.cluster.info(\n target=\"_all\",\n)" - lang: JavaScript source: "const response = await client.cluster.info({\n target: \"_all\",\n});" - lang: Ruby source: "response = client.cluster.info(\n target: \"_all\"\n)" - lang: PHP source: "$resp = $client->cluster()->info([\n \"target\" => \"_all\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_info/_all"' - lang: C# source: 'var response = await client.Cluster.InfoAsync(target: [ClusterInfoTarget.All]);' - lang: Java source: "client.cluster().info(i -> i\n .target(ClusterInfoTarget.All)\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_cluster/pending_tasks: get: tags: - cluster summary: Get the pending cluster tasks description: "Get information about cluster-level changes (such as create index, update mapping, allocate or fail shard) that have not yet taken effect.\n\nNOTE: This API returns a list of any pending updates to the cluster state.\nThese are distinct from the tasks reported by the task management API which include periodic tasks and tasks initiated by the user, such as node stats, search queries, or create index requests.\nHowever, if a user-initiated task such as a create index command causes a cluster state update, the activity of this task might be reported by both task api and pending cluster tasks API.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: cluster-pending-tasks parameters: - name: local in: query description: "If `true`, the request retrieves information from the local node only.\nIf `false`, information is retrieved from the master node." schema: type: boolean default: false - name: master_timeout in: query description: "Period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - tasks type: object properties: tasks: type: array items: $ref: '#/components/schemas/cluster.pending_tasks.PendingTask' x-state: Generally available x-codeSamples: - lang: Console source: "GET /_cluster/pending_tasks\n" - lang: Python source: resp = client.cluster.pending_tasks() - lang: JavaScript source: const response = await client.cluster.pendingTasks(); - lang: Ruby source: response = client.cluster.pending_tasks - lang: PHP source: $resp = $client->cluster()->pendingTasks(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cluster/pending_tasks"' - lang: C# source: var response = await client.Cluster.PendingTasksAsync(); - lang: Java source: "client.cluster().pendingTasks(p -> p);\n" x-metaTags: - content: Elasticsearch name: product_name /_remote/info: get: tags: - cluster summary: Get remote cluster information description: "Get information about configured remote clusters.\nThe API returns connection and endpoint information keyed by the configured remote cluster alias.\n\n> info\n> This API returns information that reflects current state on the local cluster.\n> The `connected` field does not necessarily reflect whether a remote cluster is down or unavailable, only whether there is currently an open connection to it.\n> Elasticsearch does not spontaneously try to reconnect to a disconnected remote cluster.\n> To trigger a reconnection, attempt a cross-cluster search, ES|QL cross-cluster search, or try the [resolve cluster endpoint](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-resolve-cluster).\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" externalDocs: description: More about cross-cluster search url: https://www.elastic.co/docs/solutions/search/cross-cluster-search x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/cluster-remote-info.html operationId: cluster-remote-info responses: '200': description: '' content: application/json: schema: type: object additionalProperties: $ref: '#/components/schemas/cluster.remote_info.ClusterRemoteInfo' x-state: Generally available; Added in 6.1.0 x-codeSamples: - lang: Console source: "GET /_remote/info\n" - lang: Python source: resp = client.cluster.remote_info() - lang: JavaScript source: const response = await client.cluster.remoteInfo(); - lang: Ruby source: response = client.cluster.remote_info - lang: PHP source: $resp = $client->cluster()->remoteInfo(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_remote/info"' - lang: C# source: var response = await client.Cluster.RemoteInfoAsync(); - lang: Java source: "client.cluster().remoteInfo();\n" x-metaTags: - content: Elasticsearch name: product_name /_cluster/reroute: post: tags: - cluster summary: Reroute the cluster description: "Manually change the allocation of individual shards in the cluster.\nFor example, a shard can be moved from one node to another explicitly, an allocation can be canceled, and an unassigned shard can be explicitly allocated to a specific node.\n\nIt is important to note that after processing any reroute commands Elasticsearch will perform rebalancing as normal (respecting the values of settings such as `cluster.routing.rebalance.enable`) in order to remain in a balanced state.\nFor example, if the requested allocation includes moving a shard from node1 to node2 then this may cause a shard to be moved from node2 back to node1 to even things out.\n\nThe cluster can be set to disable allocations using the `cluster.routing.allocation.enable` setting.\nIf allocations are disabled then the only allocations that will be performed are explicit ones given using the reroute command, and consequent allocations due to rebalancing.\n\nThe cluster will attempt to allocate a shard a maximum of `index.allocation.max_retries` times in a row (defaults to `5`), before giving up and leaving the shard unallocated.\nThis scenario can be caused by structural problems such as having an analyzer which refers to a stopwords file which doesn’t exist on all nodes.\n\nOnce the problem has been corrected, allocation can be manually retried by calling the reroute API with the `?retry_failed` URI query parameter, which will attempt a single retry round for these shards.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: cluster-reroute parameters: - name: dry_run in: query description: "If true, then the request simulates the operation.\nIt will calculate the result of applying the commands to the current cluster state and return the resulting cluster state after the commands (and rebalancing) have been applied; it will not actually perform the requested changes." schema: type: boolean default: false - name: explain in: query description: 'If true, then the response contains an explanation of why the commands can or cannot run.' schema: type: boolean default: false - name: metric in: query description: Limits the information returned to the specified metrics. deprecated: true schema: oneOf: - type: string - type: array items: type: string - name: retry_failed in: query description: 'If true, then retries allocation of shards that are blocked due to too many subsequent allocation failures.' schema: type: boolean default: false - name: master_timeout in: query description: 'Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: 'Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: type: object properties: commands: type: array items: $ref: '#/components/schemas/cluster.reroute.Command' description: Defines the commands to perform. examples: ClusterRerouteRequestExample1: description: Run `POST /_cluster/reroute?metric=none` to changes the allocation of shards in a cluster. value: "{\n \"commands\": [\n {\n \"move\": {\n \"index\": \"test\", \"shard\": 0,\n \"from_node\": \"node1\", \"to_node\": \"node2\"\n }\n },\n {\n \"allocate_replica\": {\n \"index\": \"test\", \"shard\": 1,\n \"node\": \"node3\"\n }\n }\n ]\n}" x-codeSamples: - lang: Console source: "POST /_cluster/reroute?metric=none\n{\n \"commands\": [\n {\n \"move\": {\n \"index\": \"test\", \"shard\": 0,\n \"from_node\": \"node1\", \"to_node\": \"node2\"\n }\n },\n {\n \"allocate_replica\": {\n \"index\": \"test\", \"shard\": 1,\n \"node\": \"node3\"\n }\n }\n ]\n}" - lang: Python source: "resp = client.cluster.reroute(\n metric=\"none\",\n commands=[\n {\n \"move\": {\n \"index\": \"test\",\n \"shard\": 0,\n \"from_node\": \"node1\",\n \"to_node\": \"node2\"\n }\n },\n {\n \"allocate_replica\": {\n \"index\": \"test\",\n \"shard\": 1,\n \"node\": \"node3\"\n }\n }\n ],\n)" - lang: JavaScript source: "const response = await client.cluster.reroute({\n metric: \"none\",\n commands: [\n {\n move: {\n index: \"test\",\n shard: 0,\n from_node: \"node1\",\n to_node: \"node2\",\n },\n },\n {\n allocate_replica: {\n index: \"test\",\n shard: 1,\n node: \"node3\",\n },\n },\n ],\n});" - lang: Ruby source: "response = client.cluster.reroute(\n metric: \"none\",\n body: {\n \"commands\": [\n {\n \"move\": {\n \"index\": \"test\",\n \"shard\": 0,\n \"from_node\": \"node1\",\n \"to_node\": \"node2\"\n }\n },\n {\n \"allocate_replica\": {\n \"index\": \"test\",\n \"shard\": 1,\n \"node\": \"node3\"\n }\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->cluster()->reroute([\n \"metric\" => \"none\",\n \"body\" => [\n \"commands\" => array(\n [\n \"move\" => [\n \"index\" => \"test\",\n \"shard\" => 0,\n \"from_node\" => \"node1\",\n \"to_node\" => \"node2\",\n ],\n ],\n [\n \"allocate_replica\" => [\n \"index\" => \"test\",\n \"shard\" => 1,\n \"node\" => \"node3\",\n ],\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"commands":[{"move":{"index":"test","shard":0,"from_node":"node1","to_node":"node2"}},{"allocate_replica":{"index":"test","shard":1,"node":"node3"}}]}'' "$ELASTICSEARCH_URL/_cluster/reroute?metric=none"' - lang: Java source: "client.cluster().reroute(r -> r\n .commands(List.of(Command.of(c -> c\n .move(m -> m\n .index(\"test\")\n .shard(0)\n .fromNode(\"node1\")\n .toNode(\"node2\")\n )\n ),Command.of(c -> c\n .allocateReplica(a -> a\n .index(\"test\")\n .shard(1)\n .node(\"node3\")\n )\n )))\n .metric(\"none\")\n);\n" responses: '200': description: '' content: application/json: schema: required: - acknowledged type: object properties: acknowledged: type: boolean explanations: type: array items: $ref: '#/components/schemas/cluster.reroute.RerouteExplanation' state: type: object description: "There aren't any guarantees on the output/structure of the raw cluster state.\nHere you will find the internal representation of the cluster, which can\ndiffer from the external representation." x-state: Generally available; Added in 5.0.0 x-codeSamples: - lang: Console source: "POST /_cluster/reroute?metric=none\n{\n \"commands\": [\n {\n \"move\": {\n \"index\": \"test\", \"shard\": 0,\n \"from_node\": \"node1\", \"to_node\": \"node2\"\n }\n },\n {\n \"allocate_replica\": {\n \"index\": \"test\", \"shard\": 1,\n \"node\": \"node3\"\n }\n }\n ]\n}" - lang: Python source: "resp = client.cluster.reroute(\n metric=\"none\",\n commands=[\n {\n \"move\": {\n \"index\": \"test\",\n \"shard\": 0,\n \"from_node\": \"node1\",\n \"to_node\": \"node2\"\n }\n },\n {\n \"allocate_replica\": {\n \"index\": \"test\",\n \"shard\": 1,\n \"node\": \"node3\"\n }\n }\n ],\n)" - lang: JavaScript source: "const response = await client.cluster.reroute({\n metric: \"none\",\n commands: [\n {\n move: {\n index: \"test\",\n shard: 0,\n from_node: \"node1\",\n to_node: \"node2\",\n },\n },\n {\n allocate_replica: {\n index: \"test\",\n shard: 1,\n node: \"node3\",\n },\n },\n ],\n});" - lang: Ruby source: "response = client.cluster.reroute(\n metric: \"none\",\n body: {\n \"commands\": [\n {\n \"move\": {\n \"index\": \"test\",\n \"shard\": 0,\n \"from_node\": \"node1\",\n \"to_node\": \"node2\"\n }\n },\n {\n \"allocate_replica\": {\n \"index\": \"test\",\n \"shard\": 1,\n \"node\": \"node3\"\n }\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->cluster()->reroute([\n \"metric\" => \"none\",\n \"body\" => [\n \"commands\" => array(\n [\n \"move\" => [\n \"index\" => \"test\",\n \"shard\" => 0,\n \"from_node\" => \"node1\",\n \"to_node\" => \"node2\",\n ],\n ],\n [\n \"allocate_replica\" => [\n \"index\" => \"test\",\n \"shard\" => 1,\n \"node\" => \"node3\",\n ],\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"commands":[{"move":{"index":"test","shard":0,"from_node":"node1","to_node":"node2"}},{"allocate_replica":{"index":"test","shard":1,"node":"node3"}}]}'' "$ELASTICSEARCH_URL/_cluster/reroute?metric=none"' - lang: Java source: "client.cluster().reroute(r -> r\n .commands(List.of(Command.of(c -> c\n .move(m -> m\n .index(\"test\")\n .shard(0)\n .fromNode(\"node1\")\n .toNode(\"node2\")\n )\n ),Command.of(c -> c\n .allocateReplica(a -> a\n .index(\"test\")\n .shard(1)\n .node(\"node3\")\n )\n )))\n .metric(\"none\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_cluster/state/{metric}/{index}': get: tags: - cluster summary: "Get the cluster state\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_cluster/state\n
\n
\n GET\n /_cluster/state/{metric}\n
\n
\n GET\n /_cluster/state/{metric}/{index}\n
\n \n\nGet comprehensive information about the state of the cluster.\n\nThe cluster state is an internal data structure which keeps track of a variety of information needed by every node, including the identity and attributes of the other nodes in the cluster; cluster-wide settings; index metadata, including the mapping and settings for each index; the location and status of every shard copy in the cluster.\n\nThe elected master node ensures that every node in the cluster has a copy of the same cluster state.\nThis API lets you retrieve a representation of this internal state for debugging or diagnostic purposes.\nYou may need to consult the Elasticsearch source code to determine the precise meaning of the response.\n\nBy default the API will route requests to the elected master node since this node is the authoritative source of cluster states.\nYou can also retrieve the cluster state held on the node handling the API request by adding the `?local=true` query parameter.\n\nElasticsearch may need to expend significant effort to compute a response to this API in larger clusters, and the response may comprise a very large quantity of data.\nIf you use this API repeatedly, your cluster may become unstable.\n\nWARNING: The response is a representation of an internal data structure.\nIts format is not subject to the same compatibility guarantees as other more stable APIs and may change from version to version.\nDo not query this API using external monitoring tools.\nInstead, obtain the information you require using other more stable cluster APIs.\n\n## Required authorization\n\n* Cluster privileges: `monitor`,`manage`\n" operationId: cluster-state parameters: - $ref: '#/components/parameters/cluster.state-metric' - $ref: '#/components/parameters/cluster.state-index' - $ref: '#/components/parameters/cluster.state-allow_no_indices' - $ref: '#/components/parameters/cluster.state-expand_wildcards' - $ref: '#/components/parameters/cluster.state-flat_settings' - $ref: '#/components/parameters/cluster.state-ignore_unavailable' - $ref: '#/components/parameters/cluster.state-local' - $ref: '#/components/parameters/cluster.state-master_timeout' - $ref: '#/components/parameters/cluster.state-wait_for_metadata_version' - $ref: '#/components/parameters/cluster.state-wait_for_timeout' responses: '200': $ref: '#/components/responses/cluster.state-200' x-state: Generally available; Added in 1.3.0 x-codeSamples: - lang: Console source: "GET /_cluster/state?filter_path=metadata.cluster_coordination.last_committed_config\n" - lang: Python source: "resp = client.cluster.state(\n filter_path=\"metadata.cluster_coordination.last_committed_config\",\n)" - lang: JavaScript source: "const response = await client.cluster.state({\n filter_path: \"metadata.cluster_coordination.last_committed_config\",\n});" - lang: Ruby source: "response = client.cluster.state(\n filter_path: \"metadata.cluster_coordination.last_committed_config\"\n)" - lang: PHP source: "$resp = $client->cluster()->state([\n \"filter_path\" => \"metadata.cluster_coordination.last_committed_config\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cluster/state?filter_path=metadata.cluster_coordination.last_committed_config"' - lang: Java source: "client.cluster().state(s -> s);\n" x-metaTags: - content: Elasticsearch name: product_name '/_cluster/stats/nodes/{node_id}': get: tags: - cluster summary: "Get cluster statistics\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_cluster/stats\n
\n
\n GET\n /_cluster/stats/nodes/{node_id}\n
\n \n\nGet basic index metrics (shard numbers, store size, memory usage) and information about the current nodes that form the cluster (number, roles, os, jvm versions, memory usage, cpu and installed plugins).\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: cluster-stats parameters: - $ref: '#/components/parameters/cluster.stats-node_id' - $ref: '#/components/parameters/cluster.stats-include_remotes' - $ref: '#/components/parameters/cluster.stats-timeout' responses: '200': $ref: '#/components/responses/cluster.stats-200' x-state: Generally available; Added in 1.3.0 x-codeSamples: - lang: Console source: "GET _cluster/stats?human&filter_path=indices.mappings.total_deduplicated_mapping_size*\n" - lang: Python source: "resp = client.cluster.stats(\n human=True,\n filter_path=\"indices.mappings.total_deduplicated_mapping_size*\",\n)" - lang: JavaScript source: "const response = await client.cluster.stats({\n human: \"true\",\n filter_path: \"indices.mappings.total_deduplicated_mapping_size*\",\n});" - lang: Ruby source: "response = client.cluster.stats(\n human: \"true\",\n filter_path: \"indices.mappings.total_deduplicated_mapping_size*\"\n)" - lang: PHP source: "$resp = $client->cluster()->stats([\n \"human\" => \"true\",\n \"filter_path\" => \"indices.mappings.total_deduplicated_mapping_size*\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cluster/stats?human&filter_path=indices.mappings.total_deduplicated_mapping_size*"' - lang: C# source: var response = await client.Cluster.StatsAsync(); - lang: Java source: "client.cluster().stats(s -> s);\n" x-metaTags: - content: Elasticsearch name: product_name '/_connector/{connector_id}/_check_in': put: tags: - connector summary: Check in a connector description: Update the `last_seen` field in the connector and set it to the current timestamp. operationId: connector-check-in parameters: - name: connector_id in: path description: The unique identifier of the connector to be checked in required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: required: - result type: object properties: result: allOf: - $ref: '#/components/schemas/_types.Result' examples: ConnectorCheckInResponseExample1: value: "{\n \"result\": \"updated\"\n}" x-state: Experimental; Added in 8.12.0 x-codeSamples: - lang: Console source: "PUT _connector/my-connector/_check_in\n" - lang: Python source: "resp = client.connector.check_in(\n connector_id=\"my-connector\",\n)" - lang: JavaScript source: "const response = await client.connector.checkIn({\n connector_id: \"my-connector\",\n});" - lang: Ruby source: "response = client.connector.check_in(\n connector_id: \"my-connector\"\n)" - lang: PHP source: "$resp = $client->connector()->checkIn([\n \"connector_id\" => \"my-connector\",\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_connector/my-connector/_check_in"' - lang: Java source: "client.connector().checkIn(c -> c\n .connectorId(\"my-connector\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_connector/{connector_id}': get: tags: - connector summary: Get a connector description: Get the details about a connector. operationId: connector-get parameters: - name: connector_id in: path description: The unique identifier of the connector required: true schema: $ref: '#/components/schemas/_types.Id' - name: include_deleted in: query description: 'A flag to indicate if the desired connector should be fetched, even if it was soft-deleted.' schema: type: boolean default: false responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/connector._types.Connector' x-state: Beta; Added in 8.12.0 x-codeSamples: - lang: Console source: "GET _connector/my-connector-id\n" - lang: Python source: "resp = client.connector.get(\n connector_id=\"my-connector-id\",\n)" - lang: JavaScript source: "const response = await client.connector.get({\n connector_id: \"my-connector-id\",\n});" - lang: Ruby source: "response = client.connector.get(\n connector_id: \"my-connector-id\"\n)" - lang: PHP source: "$resp = $client->connector()->get([\n \"connector_id\" => \"my-connector-id\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_connector/my-connector-id"' - lang: Java source: "client.connector().get(g -> g\n .connectorId(\"my-connector-id\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - connector summary: "Create or update a connector\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_connector\n
\n
\n PUT\n /_connector/{connector_id}\n
" operationId: connector-put parameters: - $ref: '#/components/parameters/connector.put-connector_id' requestBody: $ref: '#/components/requestBodies/connector.put' responses: '200': $ref: '#/components/responses/connector.put-200' x-state: Beta; Added in 8.12.0 x-codeSamples: - lang: Console source: "PUT _connector/my-connector\n{\n \"index_name\": \"search-google-drive\",\n \"name\": \"My Connector\",\n \"service_type\": \"google_drive\"\n}" - lang: Python source: "resp = client.connector.put(\n connector_id=\"my-connector\",\n index_name=\"search-google-drive\",\n name=\"My Connector\",\n service_type=\"google_drive\",\n)" - lang: JavaScript source: "const response = await client.connector.put({\n connector_id: \"my-connector\",\n index_name: \"search-google-drive\",\n name: \"My Connector\",\n service_type: \"google_drive\",\n});" - lang: Ruby source: "response = client.connector.put(\n connector_id: \"my-connector\",\n body: {\n \"index_name\": \"search-google-drive\",\n \"name\": \"My Connector\",\n \"service_type\": \"google_drive\"\n }\n)" - lang: PHP source: "$resp = $client->connector()->put([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"index_name\" => \"search-google-drive\",\n \"name\" => \"My Connector\",\n \"service_type\" => \"google_drive\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"index_name":"search-google-drive","name":"My Connector","service_type":"google_drive"}'' "$ELASTICSEARCH_URL/_connector/my-connector"' - lang: Java source: "client.connector().put(p -> p\n .connectorId(\"my-connector\")\n .indexName(\"search-google-drive\")\n .name(\"My Connector\")\n .serviceType(\"google_drive\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - connector summary: Delete a connector description: "Removes a connector and associated sync jobs.\nThis is a destructive action that is not recoverable.\nNOTE: This action doesn’t delete any API keys, ingest pipelines, or data indices associated with the connector.\nThese need to be removed manually." operationId: connector-delete parameters: - name: connector_id in: path description: The unique identifier of the connector to be deleted required: true schema: $ref: '#/components/schemas/_types.Id' - name: delete_sync_jobs in: query description: A flag indicating if associated sync jobs should be also removed. schema: type: boolean default: false - name: hard in: query description: A flag indicating if the connector should be hard deleted. schema: type: boolean default: false responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: ConnectorDeleteResponseExample1: value: "{\n \"acknowledged\": true\n}" x-state: Beta; Added in 8.12.0 x-codeSamples: - lang: Console source: "DELETE _connector/my-connector-id&delete_sync_jobs=true\n" - lang: Python source: "resp = client.connector.delete(\n connector_id=\"my-connector-id&delete_sync_jobs=true\",\n)" - lang: JavaScript source: "const response = await client.connector.delete({\n connector_id: \"my-connector-id&delete_sync_jobs=true\",\n});" - lang: Ruby source: "response = client.connector.delete(\n connector_id: \"my-connector-id&delete_sync_jobs=true\"\n)" - lang: PHP source: "$resp = $client->connector()->delete([\n \"connector_id\" => \"my-connector-id&delete_sync_jobs=true\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_connector/my-connector-id&delete_sync_jobs=true"' - lang: Java source: "client.connector().delete(d -> d\n .connectorId(\"my-connector-id&delete_sync_jobs=true\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_connector: get: tags: - connector summary: Get all connectors description: Get information about all connectors. operationId: connector-list parameters: - name: from in: query description: Starting offset schema: type: number default: 0 - name: size in: query description: Specifies a max number of results to get schema: type: number default: 100 - name: index_name in: query description: A comma-separated list of connector index names to fetch connector documents for schema: $ref: '#/components/schemas/_types.Indices' - name: connector_name in: query description: A comma-separated list of connector names to fetch connector documents for schema: $ref: '#/components/schemas/_types.Names' - name: service_type in: query description: A comma-separated list of connector service types to fetch connector documents for schema: $ref: '#/components/schemas/_types.Names' - name: include_deleted in: query description: 'A flag to indicate if the desired connector should be fetched, even if it was soft-deleted.' schema: type: boolean default: false - name: query in: query description: 'A wildcard query string that filters connectors with matching name, description or index name' schema: type: string responses: '200': description: '' content: application/json: schema: required: - count - results type: object properties: count: type: number results: type: array items: $ref: '#/components/schemas/connector._types.Connector' x-state: Beta; Added in 8.12.0 x-codeSamples: - lang: Console source: "GET _connector\n" - lang: Python source: resp = client.connector.list() - lang: JavaScript source: const response = await client.connector.list(); - lang: Ruby source: response = client.connector.list - lang: PHP source: $resp = $client->connector()->list(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_connector"' - lang: Java source: "client.connector().list(l -> l);\n" x-metaTags: - content: Elasticsearch name: product_name post: tags: - connector summary: Create a connector description: "Connectors are Elasticsearch integrations that bring content from third-party data sources, which can be deployed on Elastic Cloud or hosted on your own infrastructure.\nElastic managed connectors (Native connectors) are a managed service on Elastic Cloud.\nSelf-managed connectors (Connector clients) are self-managed on your infrastructure." operationId: connector-post requestBody: content: application/json: schema: type: object properties: description: type: string index_name: allOf: - $ref: '#/components/schemas/_types.IndexName' is_native: type: boolean language: type: string name: type: string service_type: type: string responses: '200': description: '' content: application/json: schema: required: - result - id type: object properties: result: allOf: - $ref: '#/components/schemas/_types.Result' id: allOf: - $ref: '#/components/schemas/_types.Id' x-state: Beta; Added in 8.12.0 x-metaTags: - content: Elasticsearch name: product_name '/_connector/_sync_job/{connector_sync_job_id}/_cancel': put: tags: - connector summary: Cancel a connector sync job description: "Cancel a connector sync job, which sets the status to cancelling and updates `cancellation_requested_at` to the current time.\nThe connector service is then responsible for setting the status of connector sync jobs to cancelled." operationId: connector-sync-job-cancel parameters: - name: connector_sync_job_id in: path description: The unique identifier of the connector sync job required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: required: - result type: object properties: result: allOf: - $ref: '#/components/schemas/_types.Result' x-state: Beta; Added in 8.12.0 x-codeSamples: - lang: Console source: "PUT _connector/_sync_job/my-connector-sync-job-id/_cancel\n" - lang: Python source: "resp = client.connector.sync_job_cancel(\n connector_sync_job_id=\"my-connector-sync-job-id\",\n)" - lang: JavaScript source: "const response = await client.connector.syncJobCancel({\n connector_sync_job_id: \"my-connector-sync-job-id\",\n});" - lang: Ruby source: "response = client.connector.sync_job_cancel(\n connector_sync_job_id: \"my-connector-sync-job-id\"\n)" - lang: PHP source: "$resp = $client->connector()->syncJobCancel([\n \"connector_sync_job_id\" => \"my-connector-sync-job-id\",\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job-id/_cancel"' - lang: Java source: "client.connector().syncJobCancel(s -> s\n .connectorSyncJobId(\"my-connector-sync-job-id\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_connector/_sync_job/{connector_sync_job_id}/_check_in': put: tags: - connector summary: Check in a connector sync job description: "Check in a connector sync job and set the `last_seen` field to the current time before updating it in the internal index.\n\nTo sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure.\nThis service runs automatically on Elastic Cloud for Elastic managed connectors." operationId: connector-sync-job-check-in parameters: - name: connector_sync_job_id in: path description: The unique identifier of the connector sync job to be checked in. required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: type: object x-state: Experimental x-codeSamples: - lang: Console source: "PUT _connector/_sync_job/my-connector-sync-job/_check_in\n" - lang: Python source: "resp = client.connector.sync_job_check_in(\n connector_sync_job_id=\"my-connector-sync-job\",\n)" - lang: JavaScript source: "const response = await client.connector.syncJobCheckIn({\n connector_sync_job_id: \"my-connector-sync-job\",\n});" - lang: Ruby source: "response = client.connector.sync_job_check_in(\n connector_sync_job_id: \"my-connector-sync-job\"\n)" - lang: PHP source: "$resp = $client->connector()->syncJobCheckIn([\n \"connector_sync_job_id\" => \"my-connector-sync-job\",\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job/_check_in"' - lang: Java source: "client.connector().syncJobCheckIn(s -> s\n .connectorSyncJobId(\"my-connector-sync-job\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_connector/_sync_job/{connector_sync_job_id}/_claim': put: tags: - connector summary: Claim a connector sync job description: "This action updates the job status to `in_progress` and sets the `last_seen` and `started_at` timestamps to the current time.\nAdditionally, it can set the `sync_cursor` property for the sync job.\n\nThis API is not intended for direct connector management by users.\nIt supports the implementation of services that utilize the connector protocol to communicate with Elasticsearch.\n\nTo sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure.\nThis service runs automatically on Elastic Cloud for Elastic managed connectors." operationId: connector-sync-job-claim parameters: - name: connector_sync_job_id in: path description: The unique identifier of the connector sync job. required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: required: - worker_hostname type: object properties: sync_cursor: type: object description: "The cursor object from the last incremental sync job.\nThis should reference the `sync_cursor` field in the connector state for which the job runs." worker_hostname: type: string description: The host name of the current system that will run the job. examples: ConnectorSyncJobClaimExample1: description: An example body for a `PUT _connector/_sync_job/my-connector-sync-job-id/_claim` request. value: "{\n \"worker_hostname\": \"some-machine\"\n}" x-codeSamples: - lang: Console source: "PUT _connector/_sync_job/my-connector-sync-job-id/_claim\n{\n \"worker_hostname\": \"some-machine\"\n}" - lang: Python source: "resp = client.connector.sync_job_claim(\n connector_sync_job_id=\"my-connector-sync-job-id\",\n worker_hostname=\"some-machine\",\n)" - lang: JavaScript source: "const response = await client.connector.syncJobClaim({\n connector_sync_job_id: \"my-connector-sync-job-id\",\n worker_hostname: \"some-machine\",\n});" - lang: Ruby source: "response = client.connector.sync_job_claim(\n connector_sync_job_id: \"my-connector-sync-job-id\",\n body: {\n \"worker_hostname\": \"some-machine\"\n }\n)" - lang: PHP source: "$resp = $client->connector()->syncJobClaim([\n \"connector_sync_job_id\" => \"my-connector-sync-job-id\",\n \"body\" => [\n \"worker_hostname\" => \"some-machine\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"worker_hostname":"some-machine"}'' "$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job-id/_claim"' - lang: Java source: "client.connector().syncJobClaim(s -> s\n .connectorSyncJobId(\"my-connector-sync-job-id\")\n .workerHostname(\"some-machine\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: type: object x-state: Experimental x-codeSamples: - lang: Console source: "PUT _connector/_sync_job/my-connector-sync-job-id/_claim\n{\n \"worker_hostname\": \"some-machine\"\n}" - lang: Python source: "resp = client.connector.sync_job_claim(\n connector_sync_job_id=\"my-connector-sync-job-id\",\n worker_hostname=\"some-machine\",\n)" - lang: JavaScript source: "const response = await client.connector.syncJobClaim({\n connector_sync_job_id: \"my-connector-sync-job-id\",\n worker_hostname: \"some-machine\",\n});" - lang: Ruby source: "response = client.connector.sync_job_claim(\n connector_sync_job_id: \"my-connector-sync-job-id\",\n body: {\n \"worker_hostname\": \"some-machine\"\n }\n)" - lang: PHP source: "$resp = $client->connector()->syncJobClaim([\n \"connector_sync_job_id\" => \"my-connector-sync-job-id\",\n \"body\" => [\n \"worker_hostname\" => \"some-machine\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"worker_hostname":"some-machine"}'' "$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job-id/_claim"' - lang: Java source: "client.connector().syncJobClaim(s -> s\n .connectorSyncJobId(\"my-connector-sync-job-id\")\n .workerHostname(\"some-machine\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_connector/_sync_job/{connector_sync_job_id}': get: tags: - connector summary: Get a connector sync job operationId: connector-sync-job-get parameters: - name: connector_sync_job_id in: path description: The unique identifier of the connector sync job required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/connector._types.ConnectorSyncJob' x-state: Beta; Added in 8.12.0 x-codeSamples: - lang: Console source: "GET _connector/_sync_job/my-connector-sync-job\n" - lang: Python source: "resp = client.connector.sync_job_get(\n connector_sync_job_id=\"my-connector-sync-job\",\n)" - lang: JavaScript source: "const response = await client.connector.syncJobGet({\n connector_sync_job_id: \"my-connector-sync-job\",\n});" - lang: Ruby source: "response = client.connector.sync_job_get(\n connector_sync_job_id: \"my-connector-sync-job\"\n)" - lang: PHP source: "$resp = $client->connector()->syncJobGet([\n \"connector_sync_job_id\" => \"my-connector-sync-job\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job"' - lang: Java source: "client.connector().syncJobGet(s -> s\n .connectorSyncJobId(\"my-connector-sync-job\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - connector summary: Delete a connector sync job description: "Remove a connector sync job and its associated data.\nThis is a destructive action that is not recoverable." operationId: connector-sync-job-delete parameters: - name: connector_sync_job_id in: path description: The unique identifier of the connector sync job to be deleted required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: SyncJobDeleteResponseExample1: value: "{\n \"acknowledged\": true\n}" x-state: Beta; Added in 8.12.0 x-codeSamples: - lang: Console source: "DELETE _connector/_sync_job/my-connector-sync-job-id\n" - lang: Python source: "resp = client.connector.sync_job_delete(\n connector_sync_job_id=\"my-connector-sync-job-id\",\n)" - lang: JavaScript source: "const response = await client.connector.syncJobDelete({\n connector_sync_job_id: \"my-connector-sync-job-id\",\n});" - lang: Ruby source: "response = client.connector.sync_job_delete(\n connector_sync_job_id: \"my-connector-sync-job-id\"\n)" - lang: PHP source: "$resp = $client->connector()->syncJobDelete([\n \"connector_sync_job_id\" => \"my-connector-sync-job-id\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job-id"' - lang: Java source: "client.connector().syncJobDelete(s -> s\n .connectorSyncJobId(\"my-connector-sync-job-id\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_connector/_sync_job/{connector_sync_job_id}/_error': put: tags: - connector summary: Set a connector sync job error description: "Set the `error` field for a connector sync job and set its `status` to `error`.\n\nTo sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure.\nThis service runs automatically on Elastic Cloud for Elastic managed connectors." operationId: connector-sync-job-error parameters: - name: connector_sync_job_id in: path description: The unique identifier for the connector sync job. required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: required: - error type: object properties: error: type: string description: The error for the connector sync job error field. examples: SyncJobErrorRequestExample1: value: "{\n \"error\": \"some-error\"\n}" x-codeSamples: - lang: Console source: "PUT _connector/_sync_job/my-connector-sync-job/_error\n{\n \"error\": \"some-error\"\n}" - lang: Python source: "resp = client.connector.sync_job_error(\n connector_sync_job_id=\"my-connector-sync-job\",\n error=\"some-error\",\n)" - lang: JavaScript source: "const response = await client.connector.syncJobError({\n connector_sync_job_id: \"my-connector-sync-job\",\n error: \"some-error\",\n});" - lang: Ruby source: "response = client.connector.sync_job_error(\n connector_sync_job_id: \"my-connector-sync-job\",\n body: {\n \"error\": \"some-error\"\n }\n)" - lang: PHP source: "$resp = $client->connector()->syncJobError([\n \"connector_sync_job_id\" => \"my-connector-sync-job\",\n \"body\" => [\n \"error\" => \"some-error\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"error":"some-error"}'' "$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job/_error"' - lang: Java source: "client.connector().syncJobError(s -> s\n .connectorSyncJobId(\"my-connector-sync-job\")\n .error(\"some-error\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: type: object x-state: Experimental x-codeSamples: - lang: Console source: "PUT _connector/_sync_job/my-connector-sync-job/_error\n{\n \"error\": \"some-error\"\n}" - lang: Python source: "resp = client.connector.sync_job_error(\n connector_sync_job_id=\"my-connector-sync-job\",\n error=\"some-error\",\n)" - lang: JavaScript source: "const response = await client.connector.syncJobError({\n connector_sync_job_id: \"my-connector-sync-job\",\n error: \"some-error\",\n});" - lang: Ruby source: "response = client.connector.sync_job_error(\n connector_sync_job_id: \"my-connector-sync-job\",\n body: {\n \"error\": \"some-error\"\n }\n)" - lang: PHP source: "$resp = $client->connector()->syncJobError([\n \"connector_sync_job_id\" => \"my-connector-sync-job\",\n \"body\" => [\n \"error\" => \"some-error\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"error":"some-error"}'' "$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job/_error"' - lang: Java source: "client.connector().syncJobError(s -> s\n .connectorSyncJobId(\"my-connector-sync-job\")\n .error(\"some-error\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_connector/_sync_job: get: tags: - connector summary: Get all connector sync jobs description: Get information about all stored connector sync jobs listed by their creation date in ascending order. operationId: connector-sync-job-list parameters: - name: from in: query description: Starting offset schema: type: number default: 0 - name: size in: query description: Specifies a max number of results to get schema: type: number default: 100 - name: status in: query description: A sync job status to fetch connector sync jobs for schema: $ref: '#/components/schemas/connector._types.SyncStatus' - name: connector_id in: query description: A connector id to fetch connector sync jobs for schema: $ref: '#/components/schemas/_types.Id' - name: job_type in: query description: "A comma-separated list of job types to fetch the sync jobs for\n\nSupported values include: `full`, `incremental`, `access_control`\n\n" schema: oneOf: - $ref: '#/components/schemas/connector._types.SyncJobType' - type: array items: $ref: '#/components/schemas/connector._types.SyncJobType' responses: '200': description: '' content: application/json: schema: required: - count - results type: object properties: count: type: number results: type: array items: $ref: '#/components/schemas/connector._types.ConnectorSyncJob' x-state: Beta; Added in 8.12.0 x-codeSamples: - lang: Console source: "GET _connector/_sync_job?connector_id=my-connector-id&size=1\n" - lang: Python source: "resp = client.connector.sync_job_list(\n connector_id=\"my-connector-id\",\n size=\"1\",\n)" - lang: JavaScript source: "const response = await client.connector.syncJobList({\n connector_id: \"my-connector-id\",\n size: 1,\n});" - lang: Ruby source: "response = client.connector.sync_job_list(\n connector_id: \"my-connector-id\",\n size: \"1\"\n)" - lang: PHP source: "$resp = $client->connector()->syncJobList([\n \"connector_id\" => \"my-connector-id\",\n \"size\" => \"1\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_connector/_sync_job?connector_id=my-connector-id&size=1"' - lang: Java source: "client.connector().syncJobList(s -> s\n .connectorId(\"my-connector-id\")\n .size(1)\n);\n" x-metaTags: - content: Elasticsearch name: product_name post: tags: - connector summary: Create a connector sync job description: Create a connector sync job document in the internal index and initialize its counters and timestamps with default values. operationId: connector-sync-job-post requestBody: content: application/json: schema: required: - id type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: The id of the associated connector job_type: allOf: - $ref: '#/components/schemas/connector._types.SyncJobType' trigger_method: allOf: - $ref: '#/components/schemas/connector._types.SyncJobTriggerMethod' examples: SyncJobPostRequestExample1: value: "{\n \"id\": \"connector-id\",\n \"job_type\": \"full\",\n \"trigger_method\": \"on_demand\"\n}" x-codeSamples: - lang: Console source: "POST _connector/_sync_job\n{\n \"id\": \"connector-id\",\n \"job_type\": \"full\",\n \"trigger_method\": \"on_demand\"\n}" - lang: Python source: "resp = client.connector.sync_job_post(\n id=\"connector-id\",\n job_type=\"full\",\n trigger_method=\"on_demand\",\n)" - lang: JavaScript source: "const response = await client.connector.syncJobPost({\n id: \"connector-id\",\n job_type: \"full\",\n trigger_method: \"on_demand\",\n});" - lang: Ruby source: "response = client.connector.sync_job_post(\n body: {\n \"id\": \"connector-id\",\n \"job_type\": \"full\",\n \"trigger_method\": \"on_demand\"\n }\n)" - lang: PHP source: "$resp = $client->connector()->syncJobPost([\n \"body\" => [\n \"id\" => \"connector-id\",\n \"job_type\" => \"full\",\n \"trigger_method\" => \"on_demand\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"id":"connector-id","job_type":"full","trigger_method":"on_demand"}'' "$ELASTICSEARCH_URL/_connector/_sync_job"' - lang: Java source: "client.connector().syncJobPost(s -> s\n .id(\"connector-id\")\n .jobType(SyncJobType.Full)\n .triggerMethod(SyncJobTriggerMethod.OnDemand)\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - id type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' x-state: Beta; Added in 8.12.0 x-codeSamples: - lang: Console source: "POST _connector/_sync_job\n{\n \"id\": \"connector-id\",\n \"job_type\": \"full\",\n \"trigger_method\": \"on_demand\"\n}" - lang: Python source: "resp = client.connector.sync_job_post(\n id=\"connector-id\",\n job_type=\"full\",\n trigger_method=\"on_demand\",\n)" - lang: JavaScript source: "const response = await client.connector.syncJobPost({\n id: \"connector-id\",\n job_type: \"full\",\n trigger_method: \"on_demand\",\n});" - lang: Ruby source: "response = client.connector.sync_job_post(\n body: {\n \"id\": \"connector-id\",\n \"job_type\": \"full\",\n \"trigger_method\": \"on_demand\"\n }\n)" - lang: PHP source: "$resp = $client->connector()->syncJobPost([\n \"body\" => [\n \"id\" => \"connector-id\",\n \"job_type\" => \"full\",\n \"trigger_method\" => \"on_demand\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"id":"connector-id","job_type":"full","trigger_method":"on_demand"}'' "$ELASTICSEARCH_URL/_connector/_sync_job"' - lang: Java source: "client.connector().syncJobPost(s -> s\n .id(\"connector-id\")\n .jobType(SyncJobType.Full)\n .triggerMethod(SyncJobTriggerMethod.OnDemand)\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_connector/_sync_job/{connector_sync_job_id}/_stats': put: tags: - connector summary: Set the connector sync job stats description: "Stats include: `deleted_document_count`, `indexed_document_count`, `indexed_document_volume`, and `total_document_count`.\nYou can also update `last_seen`.\nThis API is mainly used by the connector service for updating sync job information.\n\nTo sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure.\nThis service runs automatically on Elastic Cloud for Elastic managed connectors." operationId: connector-sync-job-update-stats parameters: - name: connector_sync_job_id in: path description: The unique identifier of the connector sync job. required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: required: - deleted_document_count - indexed_document_count - indexed_document_volume type: object properties: deleted_document_count: type: number description: The number of documents the sync job deleted. indexed_document_count: type: number description: The number of documents the sync job indexed. indexed_document_volume: type: number description: The total size of the data (in MiB) the sync job indexed. last_seen: allOf: - $ref: '#/components/schemas/_types.Duration' description: The timestamp to use in the `last_seen` property for the connector sync job. metadata: allOf: - $ref: '#/components/schemas/_types.Metadata' description: The connector-specific metadata. total_document_count: type: number description: The total number of documents in the target index after the sync job finished. examples: ConnectorSyncJobUpdateStatsExample1: description: An example body for a `PUT _connector/_sync_job/my-connector-sync-job/_stats` request. value: "{\n \"deleted_document_count\": 10,\n \"indexed_document_count\": 20,\n \"indexed_document_volume\": 1000,\n \"total_document_count\": 2000,\n \"last_seen\": \"2023-01-02T10:00:00Z\"\n}" x-codeSamples: - lang: Console source: "PUT _connector/_sync_job/my-connector-sync-job/_stats\n{\n \"deleted_document_count\": 10,\n \"indexed_document_count\": 20,\n \"indexed_document_volume\": 1000,\n \"total_document_count\": 2000,\n \"last_seen\": \"2023-01-02T10:00:00Z\"\n}" - lang: Python source: "resp = client.connector.sync_job_update_stats(\n connector_sync_job_id=\"my-connector-sync-job\",\n deleted_document_count=10,\n indexed_document_count=20,\n indexed_document_volume=1000,\n total_document_count=2000,\n last_seen=\"2023-01-02T10:00:00Z\",\n)" - lang: JavaScript source: "const response = await client.connector.syncJobUpdateStats({\n connector_sync_job_id: \"my-connector-sync-job\",\n deleted_document_count: 10,\n indexed_document_count: 20,\n indexed_document_volume: 1000,\n total_document_count: 2000,\n last_seen: \"2023-01-02T10:00:00Z\",\n});" - lang: Ruby source: "response = client.connector.sync_job_update_stats(\n connector_sync_job_id: \"my-connector-sync-job\",\n body: {\n \"deleted_document_count\": 10,\n \"indexed_document_count\": 20,\n \"indexed_document_volume\": 1000,\n \"total_document_count\": 2000,\n \"last_seen\": \"2023-01-02T10:00:00Z\"\n }\n)" - lang: PHP source: "$resp = $client->connector()->syncJobUpdateStats([\n \"connector_sync_job_id\" => \"my-connector-sync-job\",\n \"body\" => [\n \"deleted_document_count\" => 10,\n \"indexed_document_count\" => 20,\n \"indexed_document_volume\" => 1000,\n \"total_document_count\" => 2000,\n \"last_seen\" => \"2023-01-02T10:00:00Z\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"deleted_document_count":10,"indexed_document_count":20,"indexed_document_volume":1000,"total_document_count":2000,"last_seen":"2023-01-02T10:00:00Z"}'' "$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job/_stats"' - lang: Java source: "client.connector().syncJobUpdateStats(s -> s\n .connectorSyncJobId(\"my-connector-sync-job\")\n .deletedDocumentCount(10L)\n .indexedDocumentCount(20L)\n .indexedDocumentVolume(1000L)\n .lastSeen(l -> l\n .time(\"2023-01-02T10:00:00Z\")\n )\n .totalDocumentCount(2000)\n);\n" required: true responses: '200': description: '' content: application/json: schema: type: object x-state: Experimental x-codeSamples: - lang: Console source: "PUT _connector/_sync_job/my-connector-sync-job/_stats\n{\n \"deleted_document_count\": 10,\n \"indexed_document_count\": 20,\n \"indexed_document_volume\": 1000,\n \"total_document_count\": 2000,\n \"last_seen\": \"2023-01-02T10:00:00Z\"\n}" - lang: Python source: "resp = client.connector.sync_job_update_stats(\n connector_sync_job_id=\"my-connector-sync-job\",\n deleted_document_count=10,\n indexed_document_count=20,\n indexed_document_volume=1000,\n total_document_count=2000,\n last_seen=\"2023-01-02T10:00:00Z\",\n)" - lang: JavaScript source: "const response = await client.connector.syncJobUpdateStats({\n connector_sync_job_id: \"my-connector-sync-job\",\n deleted_document_count: 10,\n indexed_document_count: 20,\n indexed_document_volume: 1000,\n total_document_count: 2000,\n last_seen: \"2023-01-02T10:00:00Z\",\n});" - lang: Ruby source: "response = client.connector.sync_job_update_stats(\n connector_sync_job_id: \"my-connector-sync-job\",\n body: {\n \"deleted_document_count\": 10,\n \"indexed_document_count\": 20,\n \"indexed_document_volume\": 1000,\n \"total_document_count\": 2000,\n \"last_seen\": \"2023-01-02T10:00:00Z\"\n }\n)" - lang: PHP source: "$resp = $client->connector()->syncJobUpdateStats([\n \"connector_sync_job_id\" => \"my-connector-sync-job\",\n \"body\" => [\n \"deleted_document_count\" => 10,\n \"indexed_document_count\" => 20,\n \"indexed_document_volume\" => 1000,\n \"total_document_count\" => 2000,\n \"last_seen\" => \"2023-01-02T10:00:00Z\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"deleted_document_count":10,"indexed_document_count":20,"indexed_document_volume":1000,"total_document_count":2000,"last_seen":"2023-01-02T10:00:00Z"}'' "$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job/_stats"' - lang: Java source: "client.connector().syncJobUpdateStats(s -> s\n .connectorSyncJobId(\"my-connector-sync-job\")\n .deletedDocumentCount(10L)\n .indexedDocumentCount(20L)\n .indexedDocumentVolume(1000L)\n .lastSeen(l -> l\n .time(\"2023-01-02T10:00:00Z\")\n )\n .totalDocumentCount(2000)\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_connector/{connector_id}/_filtering/_activate': put: tags: - connector summary: Activate the connector draft filter description: Activates the valid draft filtering for a connector. operationId: connector-update-active-filtering parameters: - name: connector_id in: path description: The unique identifier of the connector to be updated required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: required: - result type: object properties: result: allOf: - $ref: '#/components/schemas/_types.Result' x-state: Experimental; Added in 8.12.0 x-metaTags: - content: Elasticsearch name: product_name '/_connector/{connector_id}/_api_key_id': put: tags: - connector summary: Update the connector API key ID description: "Update the `api_key_id` and `api_key_secret_id` fields of a connector.\nYou can specify the ID of the API key used for authorization and the ID of the connector secret where the API key is stored.\nThe connector secret ID is required only for Elastic managed (native) connectors.\nSelf-managed connectors (connector clients) do not use this field." operationId: connector-update-api-key-id parameters: - name: connector_id in: path description: The unique identifier of the connector to be updated required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: type: object properties: api_key_id: type: string api_key_secret_id: type: string examples: ConnectorUpdateApiKeyIDRequestExample1: value: "{\n \"api_key_id\": \"my-api-key-id\",\n \"api_key_secret_id\": \"my-connector-secret-id\"\n}" x-codeSamples: - lang: Console source: "PUT _connector/my-connector/_api_key_id\n{\n \"api_key_id\": \"my-api-key-id\",\n \"api_key_secret_id\": \"my-connector-secret-id\"\n}" - lang: Python source: "resp = client.connector.update_api_key_id(\n connector_id=\"my-connector\",\n api_key_id=\"my-api-key-id\",\n api_key_secret_id=\"my-connector-secret-id\",\n)" - lang: JavaScript source: "const response = await client.connector.updateApiKeyId({\n connector_id: \"my-connector\",\n api_key_id: \"my-api-key-id\",\n api_key_secret_id: \"my-connector-secret-id\",\n});" - lang: Ruby source: "response = client.connector.update_api_key_id(\n connector_id: \"my-connector\",\n body: {\n \"api_key_id\": \"my-api-key-id\",\n \"api_key_secret_id\": \"my-connector-secret-id\"\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateApiKeyId([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"api_key_id\" => \"my-api-key-id\",\n \"api_key_secret_id\" => \"my-connector-secret-id\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"api_key_id":"my-api-key-id","api_key_secret_id":"my-connector-secret-id"}'' "$ELASTICSEARCH_URL/_connector/my-connector/_api_key_id"' - lang: Java source: "client.connector().updateApiKeyId(u -> u\n .apiKeyId(\"my-api-key-id\")\n .apiKeySecretId(\"my-connector-secret-id\")\n .connectorId(\"my-connector\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - result type: object properties: result: allOf: - $ref: '#/components/schemas/_types.Result' examples: ConnectorUpdateAPIKeyIDResponseExample1: value: "{\n \"result\": \"updated\"\n}" x-state: Beta; Added in 8.12.0 x-codeSamples: - lang: Console source: "PUT _connector/my-connector/_api_key_id\n{\n \"api_key_id\": \"my-api-key-id\",\n \"api_key_secret_id\": \"my-connector-secret-id\"\n}" - lang: Python source: "resp = client.connector.update_api_key_id(\n connector_id=\"my-connector\",\n api_key_id=\"my-api-key-id\",\n api_key_secret_id=\"my-connector-secret-id\",\n)" - lang: JavaScript source: "const response = await client.connector.updateApiKeyId({\n connector_id: \"my-connector\",\n api_key_id: \"my-api-key-id\",\n api_key_secret_id: \"my-connector-secret-id\",\n});" - lang: Ruby source: "response = client.connector.update_api_key_id(\n connector_id: \"my-connector\",\n body: {\n \"api_key_id\": \"my-api-key-id\",\n \"api_key_secret_id\": \"my-connector-secret-id\"\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateApiKeyId([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"api_key_id\" => \"my-api-key-id\",\n \"api_key_secret_id\" => \"my-connector-secret-id\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"api_key_id":"my-api-key-id","api_key_secret_id":"my-connector-secret-id"}'' "$ELASTICSEARCH_URL/_connector/my-connector/_api_key_id"' - lang: Java source: "client.connector().updateApiKeyId(u -> u\n .apiKeyId(\"my-api-key-id\")\n .apiKeySecretId(\"my-connector-secret-id\")\n .connectorId(\"my-connector\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_connector/{connector_id}/_configuration': put: tags: - connector summary: Update the connector configuration description: Update the configuration field in the connector document. operationId: connector-update-configuration parameters: - name: connector_id in: path description: The unique identifier of the connector to be updated required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: type: object properties: configuration: allOf: - $ref: '#/components/schemas/connector._types.ConnectorConfiguration' values: type: object additionalProperties: type: object examples: ConnectorUpdateConfigurationRequestExample1: value: "{\n \"values\": {\n \"tenant_id\": \"my-tenant-id\",\n \"tenant_name\": \"my-sharepoint-site\",\n \"client_id\": \"foo\",\n \"secret_value\": \"bar\",\n \"site_collections\": \"*\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _connector/my-spo-connector/_configuration\n{\n \"values\": {\n \"tenant_id\": \"my-tenant-id\",\n \"tenant_name\": \"my-sharepoint-site\",\n \"client_id\": \"foo\",\n \"secret_value\": \"bar\",\n \"site_collections\": \"*\"\n }\n}" - lang: Python source: "resp = client.connector.update_configuration(\n connector_id=\"my-spo-connector\",\n values={\n \"tenant_id\": \"my-tenant-id\",\n \"tenant_name\": \"my-sharepoint-site\",\n \"client_id\": \"foo\",\n \"secret_value\": \"bar\",\n \"site_collections\": \"*\"\n },\n)" - lang: JavaScript source: "const response = await client.connector.updateConfiguration({\n connector_id: \"my-spo-connector\",\n values: {\n tenant_id: \"my-tenant-id\",\n tenant_name: \"my-sharepoint-site\",\n client_id: \"foo\",\n secret_value: \"bar\",\n site_collections: \"*\",\n },\n});" - lang: Ruby source: "response = client.connector.update_configuration(\n connector_id: \"my-spo-connector\",\n body: {\n \"values\": {\n \"tenant_id\": \"my-tenant-id\",\n \"tenant_name\": \"my-sharepoint-site\",\n \"client_id\": \"foo\",\n \"secret_value\": \"bar\",\n \"site_collections\": \"*\"\n }\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateConfiguration([\n \"connector_id\" => \"my-spo-connector\",\n \"body\" => [\n \"values\" => [\n \"tenant_id\" => \"my-tenant-id\",\n \"tenant_name\" => \"my-sharepoint-site\",\n \"client_id\" => \"foo\",\n \"secret_value\" => \"bar\",\n \"site_collections\" => \"*\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"values":{"tenant_id":"my-tenant-id","tenant_name":"my-sharepoint-site","client_id":"foo","secret_value":"bar","site_collections":"*"}}'' "$ELASTICSEARCH_URL/_connector/my-spo-connector/_configuration"' - lang: Java source: "client.connector().updateConfiguration(u -> u\n .connectorId(\"my-spo-connector\")\n .values(Map.of(\"tenant_id\", JsonData.fromJson(\"\\\"my-tenant-id\\\"\"),\"tenant_name\", JsonData.fromJson(\"\\\"my-sharepoint-site\\\"\"),\"secret_value\", JsonData.fromJson(\"\\\"bar\\\"\"),\"client_id\", JsonData.fromJson(\"\\\"foo\\\"\"),\"site_collections\", JsonData.fromJson(\"\\\"*\\\"\")))\n);\n" ConnectorUpdateConfigurationRequestExample2: value: "{\n \"values\": {\n \"secret_value\": \"foo-bar\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _connector/my-spo-connector/_configuration\n{\n \"values\": {\n \"secret_value\": \"foo-bar\"\n }\n}" - lang: Python source: "resp = client.connector.update_configuration(\n connector_id=\"my-spo-connector\",\n values={\n \"secret_value\": \"foo-bar\"\n },\n)" - lang: JavaScript source: "const response = await client.connector.updateConfiguration({\n connector_id: \"my-spo-connector\",\n values: {\n secret_value: \"foo-bar\",\n },\n});" - lang: Ruby source: "response = client.connector.update_configuration(\n connector_id: \"my-spo-connector\",\n body: {\n \"values\": {\n \"secret_value\": \"foo-bar\"\n }\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateConfiguration([\n \"connector_id\" => \"my-spo-connector\",\n \"body\" => [\n \"values\" => [\n \"secret_value\" => \"foo-bar\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"values":{"secret_value":"foo-bar"}}'' "$ELASTICSEARCH_URL/_connector/my-spo-connector/_configuration"' - lang: Java source: "client.connector().updateConfiguration(u -> u\n .connectorId(\"my-spo-connector\")\n .values(\"secret_value\", JsonData.fromJson(\"\\\"foo-bar\\\"\"))\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - result type: object properties: result: allOf: - $ref: '#/components/schemas/_types.Result' examples: ConnectorUpdateConfigurationResponseExample1: value: "{\n \"result\": \"updated\"\n}" x-state: Beta; Added in 8.12.0 x-codeSamples: - lang: Console source: "PUT _connector/my-spo-connector/_configuration\n{\n \"values\": {\n \"tenant_id\": \"my-tenant-id\",\n \"tenant_name\": \"my-sharepoint-site\",\n \"client_id\": \"foo\",\n \"secret_value\": \"bar\",\n \"site_collections\": \"*\"\n }\n}" - lang: Python source: "resp = client.connector.update_configuration(\n connector_id=\"my-spo-connector\",\n values={\n \"tenant_id\": \"my-tenant-id\",\n \"tenant_name\": \"my-sharepoint-site\",\n \"client_id\": \"foo\",\n \"secret_value\": \"bar\",\n \"site_collections\": \"*\"\n },\n)" - lang: JavaScript source: "const response = await client.connector.updateConfiguration({\n connector_id: \"my-spo-connector\",\n values: {\n tenant_id: \"my-tenant-id\",\n tenant_name: \"my-sharepoint-site\",\n client_id: \"foo\",\n secret_value: \"bar\",\n site_collections: \"*\",\n },\n});" - lang: Ruby source: "response = client.connector.update_configuration(\n connector_id: \"my-spo-connector\",\n body: {\n \"values\": {\n \"tenant_id\": \"my-tenant-id\",\n \"tenant_name\": \"my-sharepoint-site\",\n \"client_id\": \"foo\",\n \"secret_value\": \"bar\",\n \"site_collections\": \"*\"\n }\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateConfiguration([\n \"connector_id\" => \"my-spo-connector\",\n \"body\" => [\n \"values\" => [\n \"tenant_id\" => \"my-tenant-id\",\n \"tenant_name\" => \"my-sharepoint-site\",\n \"client_id\" => \"foo\",\n \"secret_value\" => \"bar\",\n \"site_collections\" => \"*\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"values":{"tenant_id":"my-tenant-id","tenant_name":"my-sharepoint-site","client_id":"foo","secret_value":"bar","site_collections":"*"}}'' "$ELASTICSEARCH_URL/_connector/my-spo-connector/_configuration"' - lang: Java source: "client.connector().updateConfiguration(u -> u\n .connectorId(\"my-spo-connector\")\n .values(Map.of(\"tenant_id\", JsonData.fromJson(\"\\\"my-tenant-id\\\"\"),\"tenant_name\", JsonData.fromJson(\"\\\"my-sharepoint-site\\\"\"),\"secret_value\", JsonData.fromJson(\"\\\"bar\\\"\"),\"client_id\", JsonData.fromJson(\"\\\"foo\\\"\"),\"site_collections\", JsonData.fromJson(\"\\\"*\\\"\")))\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_connector/{connector_id}/_error': put: tags: - connector summary: Update the connector error field description: "Set the error field for the connector.\nIf the error provided in the request body is non-null, the connector’s status is updated to error.\nOtherwise, if the error is reset to null, the connector status is updated to connected." operationId: connector-update-error parameters: - name: connector_id in: path description: The unique identifier of the connector to be updated required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: required: - error type: object properties: error: oneOf: - type: string - $ref: '#/components/schemas/_spec_utils.NullValue' examples: ConnectorUpdateErrorRequestExample1: value: "{\n \"error\": \"Houston, we have a problem!\"\n}" x-codeSamples: - lang: Console source: "PUT _connector/my-connector/_error\n{\n \"error\": \"Houston, we have a problem!\"\n}" - lang: Python source: "resp = client.connector.update_error(\n connector_id=\"my-connector\",\n error=\"Houston, we have a problem!\",\n)" - lang: JavaScript source: "const response = await client.connector.updateError({\n connector_id: \"my-connector\",\n error: \"Houston, we have a problem!\",\n});" - lang: Ruby source: "response = client.connector.update_error(\n connector_id: \"my-connector\",\n body: {\n \"error\": \"Houston, we have a problem!\"\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateError([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"error\" => \"Houston, we have a problem!\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"error":"Houston, we have a problem!"}'' "$ELASTICSEARCH_URL/_connector/my-connector/_error"' - lang: Java source: "client.connector().updateError(u -> u\n .connectorId(\"my-connector\")\n .error(\"Houston, we have a problem!\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - result type: object properties: result: allOf: - $ref: '#/components/schemas/_types.Result' examples: ConnectorUpdateErrorResponseExample1: value: "{\n \"result\": \"updated\"\n}" x-state: Experimental; Added in 8.12.0 x-codeSamples: - lang: Console source: "PUT _connector/my-connector/_error\n{\n \"error\": \"Houston, we have a problem!\"\n}" - lang: Python source: "resp = client.connector.update_error(\n connector_id=\"my-connector\",\n error=\"Houston, we have a problem!\",\n)" - lang: JavaScript source: "const response = await client.connector.updateError({\n connector_id: \"my-connector\",\n error: \"Houston, we have a problem!\",\n});" - lang: Ruby source: "response = client.connector.update_error(\n connector_id: \"my-connector\",\n body: {\n \"error\": \"Houston, we have a problem!\"\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateError([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"error\" => \"Houston, we have a problem!\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"error":"Houston, we have a problem!"}'' "$ELASTICSEARCH_URL/_connector/my-connector/_error"' - lang: Java source: "client.connector().updateError(u -> u\n .connectorId(\"my-connector\")\n .error(\"Houston, we have a problem!\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_connector/{connector_id}/_features': put: tags: - connector summary: Update the connector features description: "Update the connector features in the connector document.\nThis API can be used to control the following aspects of a connector:\n\n* document-level security\n* incremental syncs\n* advanced sync rules\n* basic sync rules\n\nNormally, the running connector service automatically manages these features.\nHowever, you can use this API to override the default behavior.\n\nTo sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure.\nThis service runs automatically on Elastic Cloud for Elastic managed connectors." operationId: connector-update-features parameters: - name: connector_id in: path description: The unique identifier of the connector to be updated. required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: required: - features type: object properties: features: allOf: - $ref: '#/components/schemas/connector._types.ConnectorFeatures' examples: ConnectorUpdateFeaturesRequestExample1: value: "{\n \"features\": {\n \"document_level_security\": {\n \"enabled\": true\n },\n \"incremental_sync\": {\n \"enabled\": true\n },\n \"sync_rules\": {\n \"advanced\": {\n \"enabled\": false\n },\n \"basic\": {\n \"enabled\": true\n }\n }\n }\n}" x-codeSamples: - lang: Console source: "PUT _connector/my-connector/_features\n{\n \"features\": {\n \"document_level_security\": {\n \"enabled\": true\n },\n \"incremental_sync\": {\n \"enabled\": true\n },\n \"sync_rules\": {\n \"advanced\": {\n \"enabled\": false\n },\n \"basic\": {\n \"enabled\": true\n }\n }\n }\n}" - lang: Python source: "resp = client.connector.update_features(\n connector_id=\"my-connector\",\n features={\n \"document_level_security\": {\n \"enabled\": True\n },\n \"incremental_sync\": {\n \"enabled\": True\n },\n \"sync_rules\": {\n \"advanced\": {\n \"enabled\": False\n },\n \"basic\": {\n \"enabled\": True\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.connector.updateFeatures({\n connector_id: \"my-connector\",\n features: {\n document_level_security: {\n enabled: true,\n },\n incremental_sync: {\n enabled: true,\n },\n sync_rules: {\n advanced: {\n enabled: false,\n },\n basic: {\n enabled: true,\n },\n },\n },\n});" - lang: Ruby source: "response = client.connector.update_features(\n connector_id: \"my-connector\",\n body: {\n \"features\": {\n \"document_level_security\": {\n \"enabled\": true\n },\n \"incremental_sync\": {\n \"enabled\": true\n },\n \"sync_rules\": {\n \"advanced\": {\n \"enabled\": false\n },\n \"basic\": {\n \"enabled\": true\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateFeatures([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"features\" => [\n \"document_level_security\" => [\n \"enabled\" => true,\n ],\n \"incremental_sync\" => [\n \"enabled\" => true,\n ],\n \"sync_rules\" => [\n \"advanced\" => [\n \"enabled\" => false,\n ],\n \"basic\" => [\n \"enabled\" => true,\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"features":{"document_level_security":{"enabled":true},"incremental_sync":{"enabled":true},"sync_rules":{"advanced":{"enabled":false},"basic":{"enabled":true}}}}'' "$ELASTICSEARCH_URL/_connector/my-connector/_features"' - lang: Java source: "client.connector().updateFeatures(u -> u\n .connectorId(\"my-connector\")\n .features(f -> f\n .documentLevelSecurity(d -> d\n .enabled(true)\n )\n .incrementalSync(i -> i\n .enabled(true)\n )\n .syncRules(s -> s\n .advanced(a -> a\n .enabled(false)\n )\n .basic(b -> b\n .enabled(true)\n )\n )\n )\n);\n" ConnectorUpdateFeaturesRequestExample2: value: "{\n \"features\": {\n \"document_level_security\": {\n \"enabled\": true\n }\n }\n}" x-codeSamples: - lang: Console source: "PUT _connector/my-connector/_features\n{\n \"features\": {\n \"document_level_security\": {\n \"enabled\": true\n }\n }\n}" - lang: Python source: "resp = client.connector.update_features(\n connector_id=\"my-connector\",\n features={\n \"document_level_security\": {\n \"enabled\": True\n }\n },\n)" - lang: JavaScript source: "const response = await client.connector.updateFeatures({\n connector_id: \"my-connector\",\n features: {\n document_level_security: {\n enabled: true,\n },\n },\n});" - lang: Ruby source: "response = client.connector.update_features(\n connector_id: \"my-connector\",\n body: {\n \"features\": {\n \"document_level_security\": {\n \"enabled\": true\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateFeatures([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"features\" => [\n \"document_level_security\" => [\n \"enabled\" => true,\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"features":{"document_level_security":{"enabled":true}}}'' "$ELASTICSEARCH_URL/_connector/my-connector/_features"' - lang: Java source: "client.connector().updateFeatures(u -> u\n .connectorId(\"my-connector\")\n .features(f -> f\n .documentLevelSecurity(d -> d\n .enabled(true)\n )\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - result type: object properties: result: allOf: - $ref: '#/components/schemas/_types.Result' examples: ConnectorUpdateFeaturesResponseExample1: value: "{\n \"result\": \"updated\"\n}" x-state: Experimental x-codeSamples: - lang: Console source: "PUT _connector/my-connector/_features\n{\n \"features\": {\n \"document_level_security\": {\n \"enabled\": true\n },\n \"incremental_sync\": {\n \"enabled\": true\n },\n \"sync_rules\": {\n \"advanced\": {\n \"enabled\": false\n },\n \"basic\": {\n \"enabled\": true\n }\n }\n }\n}" - lang: Python source: "resp = client.connector.update_features(\n connector_id=\"my-connector\",\n features={\n \"document_level_security\": {\n \"enabled\": True\n },\n \"incremental_sync\": {\n \"enabled\": True\n },\n \"sync_rules\": {\n \"advanced\": {\n \"enabled\": False\n },\n \"basic\": {\n \"enabled\": True\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.connector.updateFeatures({\n connector_id: \"my-connector\",\n features: {\n document_level_security: {\n enabled: true,\n },\n incremental_sync: {\n enabled: true,\n },\n sync_rules: {\n advanced: {\n enabled: false,\n },\n basic: {\n enabled: true,\n },\n },\n },\n});" - lang: Ruby source: "response = client.connector.update_features(\n connector_id: \"my-connector\",\n body: {\n \"features\": {\n \"document_level_security\": {\n \"enabled\": true\n },\n \"incremental_sync\": {\n \"enabled\": true\n },\n \"sync_rules\": {\n \"advanced\": {\n \"enabled\": false\n },\n \"basic\": {\n \"enabled\": true\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateFeatures([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"features\" => [\n \"document_level_security\" => [\n \"enabled\" => true,\n ],\n \"incremental_sync\" => [\n \"enabled\" => true,\n ],\n \"sync_rules\" => [\n \"advanced\" => [\n \"enabled\" => false,\n ],\n \"basic\" => [\n \"enabled\" => true,\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"features":{"document_level_security":{"enabled":true},"incremental_sync":{"enabled":true},"sync_rules":{"advanced":{"enabled":false},"basic":{"enabled":true}}}}'' "$ELASTICSEARCH_URL/_connector/my-connector/_features"' - lang: Java source: "client.connector().updateFeatures(u -> u\n .connectorId(\"my-connector\")\n .features(f -> f\n .documentLevelSecurity(d -> d\n .enabled(true)\n )\n .incrementalSync(i -> i\n .enabled(true)\n )\n .syncRules(s -> s\n .advanced(a -> a\n .enabled(false)\n )\n .basic(b -> b\n .enabled(true)\n )\n )\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_connector/{connector_id}/_filtering': put: tags: - connector summary: Update the connector filtering description: "Update the draft filtering configuration of a connector and marks the draft validation state as edited.\nThe filtering draft is activated once validated by the running Elastic connector service.\nThe filtering property is used to configure sync rules (both basic and advanced) for a connector." operationId: connector-update-filtering parameters: - name: connector_id in: path description: The unique identifier of the connector to be updated required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: type: object properties: filtering: type: array items: $ref: '#/components/schemas/connector._types.FilteringConfig' rules: type: array items: $ref: '#/components/schemas/connector._types.FilteringRule' advanced_snippet: allOf: - $ref: '#/components/schemas/connector._types.FilteringAdvancedSnippet' examples: ConnectorUpdateFilteringRequestExample1: value: "{\n \"rules\": [\n {\n \"field\": \"file_extension\",\n \"id\": \"exclude-txt-files\",\n \"order\": 0,\n \"policy\": \"exclude\",\n \"rule\": \"equals\",\n \"value\": \"txt\"\n },\n {\n \"field\": \"_\",\n \"id\": \"DEFAULT\",\n \"order\": 1,\n \"policy\": \"include\",\n \"rule\": \"regex\",\n \"value\": \".*\"\n }\n ]\n}" x-codeSamples: - lang: Console source: "PUT _connector/my-g-drive-connector/_filtering\n{\n \"rules\": [\n {\n \"field\": \"file_extension\",\n \"id\": \"exclude-txt-files\",\n \"order\": 0,\n \"policy\": \"exclude\",\n \"rule\": \"equals\",\n \"value\": \"txt\"\n },\n {\n \"field\": \"_\",\n \"id\": \"DEFAULT\",\n \"order\": 1,\n \"policy\": \"include\",\n \"rule\": \"regex\",\n \"value\": \".*\"\n }\n ]\n}" - lang: Python source: "resp = client.connector.update_filtering(\n connector_id=\"my-g-drive-connector\",\n rules=[\n {\n \"field\": \"file_extension\",\n \"id\": \"exclude-txt-files\",\n \"order\": 0,\n \"policy\": \"exclude\",\n \"rule\": \"equals\",\n \"value\": \"txt\"\n },\n {\n \"field\": \"_\",\n \"id\": \"DEFAULT\",\n \"order\": 1,\n \"policy\": \"include\",\n \"rule\": \"regex\",\n \"value\": \".*\"\n }\n ],\n)" - lang: JavaScript source: "const response = await client.connector.updateFiltering({\n connector_id: \"my-g-drive-connector\",\n rules: [\n {\n field: \"file_extension\",\n id: \"exclude-txt-files\",\n order: 0,\n policy: \"exclude\",\n rule: \"equals\",\n value: \"txt\",\n },\n {\n field: \"_\",\n id: \"DEFAULT\",\n order: 1,\n policy: \"include\",\n rule: \"regex\",\n value: \".*\",\n },\n ],\n});" - lang: Ruby source: "response = client.connector.update_filtering(\n connector_id: \"my-g-drive-connector\",\n body: {\n \"rules\": [\n {\n \"field\": \"file_extension\",\n \"id\": \"exclude-txt-files\",\n \"order\": 0,\n \"policy\": \"exclude\",\n \"rule\": \"equals\",\n \"value\": \"txt\"\n },\n {\n \"field\": \"_\",\n \"id\": \"DEFAULT\",\n \"order\": 1,\n \"policy\": \"include\",\n \"rule\": \"regex\",\n \"value\": \".*\"\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateFiltering([\n \"connector_id\" => \"my-g-drive-connector\",\n \"body\" => [\n \"rules\" => array(\n [\n \"field\" => \"file_extension\",\n \"id\" => \"exclude-txt-files\",\n \"order\" => 0,\n \"policy\" => \"exclude\",\n \"rule\" => \"equals\",\n \"value\" => \"txt\",\n ],\n [\n \"field\" => \"_\",\n \"id\" => \"DEFAULT\",\n \"order\" => 1,\n \"policy\" => \"include\",\n \"rule\" => \"regex\",\n \"value\" => \".*\",\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"rules":[{"field":"file_extension","id":"exclude-txt-files","order":0,"policy":"exclude","rule":"equals","value":"txt"},{"field":"_","id":"DEFAULT","order":1,"policy":"include","rule":"regex","value":".*"}]}'' "$ELASTICSEARCH_URL/_connector/my-g-drive-connector/_filtering"' - lang: Java source: "client.connector().updateFiltering(u -> u\n .connectorId(\"my-g-drive-connector\")\n .rules(List.of(FilteringRule.of(f -> f\n .field(\"file_extension\")\n .id(\"exclude-txt-files\")\n .order(0)\n .policy(FilteringPolicy.Exclude)\n .rule(FilteringRuleRule.Equals)\n .value(\"txt\")\n ),FilteringRule.of(f -> f\n .field(\"_\")\n .id(\"DEFAULT\")\n .order(1)\n .policy(FilteringPolicy.Include)\n .rule(FilteringRuleRule.Regex)\n .value(\".*\")\n )))\n);\n" ConnectorUpdateFilteringRequestExample2: value: "{\n \"advanced_snippet\": {\n \"value\": [{\n \"tables\": [\n \"users\",\n \"orders\"\n ],\n \"query\": \"SELECT users.id AS id, orders.order_id AS order_id FROM users JOIN orders ON users.id = orders.user_id\"\n }]\n }\n}" x-codeSamples: - lang: Console source: "PUT _connector/my-sql-connector/_filtering\n{\n \"advanced_snippet\": {\n \"value\": [{\n \"tables\": [\n \"users\",\n \"orders\"\n ],\n \"query\": \"SELECT users.id AS id, orders.order_id AS order_id FROM users JOIN orders ON users.id = orders.user_id\"\n }]\n }\n}" - lang: Python source: "resp = client.connector.update_filtering(\n connector_id=\"my-sql-connector\",\n advanced_snippet={\n \"value\": [\n {\n \"tables\": [\n \"users\",\n \"orders\"\n ],\n \"query\": \"SELECT users.id AS id, orders.order_id AS order_id FROM users JOIN orders ON users.id = orders.user_id\"\n }\n ]\n },\n)" - lang: JavaScript source: "const response = await client.connector.updateFiltering({\n connector_id: \"my-sql-connector\",\n advanced_snippet: {\n value: [\n {\n tables: [\"users\", \"orders\"],\n query:\n \"SELECT users.id AS id, orders.order_id AS order_id FROM users JOIN orders ON users.id = orders.user_id\",\n },\n ],\n },\n});" - lang: Ruby source: "response = client.connector.update_filtering(\n connector_id: \"my-sql-connector\",\n body: {\n \"advanced_snippet\": {\n \"value\": [\n {\n \"tables\": [\n \"users\",\n \"orders\"\n ],\n \"query\": \"SELECT users.id AS id, orders.order_id AS order_id FROM users JOIN orders ON users.id = orders.user_id\"\n }\n ]\n }\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateFiltering([\n \"connector_id\" => \"my-sql-connector\",\n \"body\" => [\n \"advanced_snippet\" => [\n \"value\" => array(\n [\n \"tables\" => array(\n \"users\",\n \"orders\",\n ),\n \"query\" => \"SELECT users.id AS id, orders.order_id AS order_id FROM users JOIN orders ON users.id = orders.user_id\",\n ],\n ),\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"advanced_snippet":{"value":[{"tables":["users","orders"],"query":"SELECT users.id AS id, orders.order_id AS order_id FROM users JOIN orders ON users.id = orders.user_id"}]}}'' "$ELASTICSEARCH_URL/_connector/my-sql-connector/_filtering"' - lang: Java source: "client.connector().updateFiltering(u -> u\n .advancedSnippet(a -> a\n .value(JsonData.fromJson(\"\"\"\n[{\"tables\":[\"users\",\"orders\"],\"query\":\"SELECT users.id AS id, orders.order_id AS order_id FROM users JOIN orders ON users.id = orders.user_id\"}]\n\"\"\"))\n )\n .connectorId(\"my-sql-connector\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - result type: object properties: result: allOf: - $ref: '#/components/schemas/_types.Result' examples: ConnectorUpdateFilteringResponseExample1: value: "{\n \"result\": \"updated\"\n}" x-state: Beta; Added in 8.12.0 x-codeSamples: - lang: Console source: "PUT _connector/my-g-drive-connector/_filtering\n{\n \"rules\": [\n {\n \"field\": \"file_extension\",\n \"id\": \"exclude-txt-files\",\n \"order\": 0,\n \"policy\": \"exclude\",\n \"rule\": \"equals\",\n \"value\": \"txt\"\n },\n {\n \"field\": \"_\",\n \"id\": \"DEFAULT\",\n \"order\": 1,\n \"policy\": \"include\",\n \"rule\": \"regex\",\n \"value\": \".*\"\n }\n ]\n}" - lang: Python source: "resp = client.connector.update_filtering(\n connector_id=\"my-g-drive-connector\",\n rules=[\n {\n \"field\": \"file_extension\",\n \"id\": \"exclude-txt-files\",\n \"order\": 0,\n \"policy\": \"exclude\",\n \"rule\": \"equals\",\n \"value\": \"txt\"\n },\n {\n \"field\": \"_\",\n \"id\": \"DEFAULT\",\n \"order\": 1,\n \"policy\": \"include\",\n \"rule\": \"regex\",\n \"value\": \".*\"\n }\n ],\n)" - lang: JavaScript source: "const response = await client.connector.updateFiltering({\n connector_id: \"my-g-drive-connector\",\n rules: [\n {\n field: \"file_extension\",\n id: \"exclude-txt-files\",\n order: 0,\n policy: \"exclude\",\n rule: \"equals\",\n value: \"txt\",\n },\n {\n field: \"_\",\n id: \"DEFAULT\",\n order: 1,\n policy: \"include\",\n rule: \"regex\",\n value: \".*\",\n },\n ],\n});" - lang: Ruby source: "response = client.connector.update_filtering(\n connector_id: \"my-g-drive-connector\",\n body: {\n \"rules\": [\n {\n \"field\": \"file_extension\",\n \"id\": \"exclude-txt-files\",\n \"order\": 0,\n \"policy\": \"exclude\",\n \"rule\": \"equals\",\n \"value\": \"txt\"\n },\n {\n \"field\": \"_\",\n \"id\": \"DEFAULT\",\n \"order\": 1,\n \"policy\": \"include\",\n \"rule\": \"regex\",\n \"value\": \".*\"\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateFiltering([\n \"connector_id\" => \"my-g-drive-connector\",\n \"body\" => [\n \"rules\" => array(\n [\n \"field\" => \"file_extension\",\n \"id\" => \"exclude-txt-files\",\n \"order\" => 0,\n \"policy\" => \"exclude\",\n \"rule\" => \"equals\",\n \"value\" => \"txt\",\n ],\n [\n \"field\" => \"_\",\n \"id\" => \"DEFAULT\",\n \"order\" => 1,\n \"policy\" => \"include\",\n \"rule\" => \"regex\",\n \"value\" => \".*\",\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"rules":[{"field":"file_extension","id":"exclude-txt-files","order":0,"policy":"exclude","rule":"equals","value":"txt"},{"field":"_","id":"DEFAULT","order":1,"policy":"include","rule":"regex","value":".*"}]}'' "$ELASTICSEARCH_URL/_connector/my-g-drive-connector/_filtering"' - lang: Java source: "client.connector().updateFiltering(u -> u\n .connectorId(\"my-g-drive-connector\")\n .rules(List.of(FilteringRule.of(f -> f\n .field(\"file_extension\")\n .id(\"exclude-txt-files\")\n .order(0)\n .policy(FilteringPolicy.Exclude)\n .rule(FilteringRuleRule.Equals)\n .value(\"txt\")\n ),FilteringRule.of(f -> f\n .field(\"_\")\n .id(\"DEFAULT\")\n .order(1)\n .policy(FilteringPolicy.Include)\n .rule(FilteringRuleRule.Regex)\n .value(\".*\")\n )))\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_connector/{connector_id}/_filtering/_validation': put: tags: - connector summary: Update the connector draft filtering validation description: Update the draft filtering validation info for a connector. operationId: connector-update-filtering-validation parameters: - name: connector_id in: path description: The unique identifier of the connector to be updated required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: required: - validation type: object properties: validation: allOf: - $ref: '#/components/schemas/connector._types.FilteringRulesValidation' required: true responses: '200': description: '' content: application/json: schema: required: - result type: object properties: result: allOf: - $ref: '#/components/schemas/_types.Result' x-state: Experimental; Added in 8.12.0 x-metaTags: - content: Elasticsearch name: product_name '/_connector/{connector_id}/_index_name': put: tags: - connector summary: Update the connector index name description: 'Update the `index_name` field of a connector, specifying the index where the data ingested by the connector is stored.' operationId: connector-update-index-name parameters: - name: connector_id in: path description: The unique identifier of the connector to be updated required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: required: - index_name type: object properties: index_name: oneOf: - $ref: '#/components/schemas/_types.IndexName' - $ref: '#/components/schemas/_spec_utils.NullValue' examples: ConnectorUpdateIndexNameRequestExample1: value: "{\n \"index_name\": \"data-from-my-google-drive\"\n}" x-codeSamples: - lang: Console source: "PUT _connector/my-connector/_index_name\n{\n \"index_name\": \"data-from-my-google-drive\"\n}" - lang: Python source: "resp = client.connector.update_index_name(\n connector_id=\"my-connector\",\n index_name=\"data-from-my-google-drive\",\n)" - lang: JavaScript source: "const response = await client.connector.updateIndexName({\n connector_id: \"my-connector\",\n index_name: \"data-from-my-google-drive\",\n});" - lang: Ruby source: "response = client.connector.update_index_name(\n connector_id: \"my-connector\",\n body: {\n \"index_name\": \"data-from-my-google-drive\"\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateIndexName([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"index_name\" => \"data-from-my-google-drive\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"index_name":"data-from-my-google-drive"}'' "$ELASTICSEARCH_URL/_connector/my-connector/_index_name"' - lang: Java source: "client.connector().updateIndexName(u -> u\n .connectorId(\"my-connector\")\n .indexName(\"data-from-my-google-drive\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - result type: object properties: result: allOf: - $ref: '#/components/schemas/_types.Result' examples: ConnectorUpdateIndexNameResponseExample1: value: "{\n \"result\": \"updated\"\n}" x-state: Beta; Added in 8.12.0 x-codeSamples: - lang: Console source: "PUT _connector/my-connector/_index_name\n{\n \"index_name\": \"data-from-my-google-drive\"\n}" - lang: Python source: "resp = client.connector.update_index_name(\n connector_id=\"my-connector\",\n index_name=\"data-from-my-google-drive\",\n)" - lang: JavaScript source: "const response = await client.connector.updateIndexName({\n connector_id: \"my-connector\",\n index_name: \"data-from-my-google-drive\",\n});" - lang: Ruby source: "response = client.connector.update_index_name(\n connector_id: \"my-connector\",\n body: {\n \"index_name\": \"data-from-my-google-drive\"\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateIndexName([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"index_name\" => \"data-from-my-google-drive\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"index_name":"data-from-my-google-drive"}'' "$ELASTICSEARCH_URL/_connector/my-connector/_index_name"' - lang: Java source: "client.connector().updateIndexName(u -> u\n .connectorId(\"my-connector\")\n .indexName(\"data-from-my-google-drive\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_connector/{connector_id}/_name': put: tags: - connector summary: Update the connector name and description operationId: connector-update-name parameters: - name: connector_id in: path description: The unique identifier of the connector to be updated required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: type: object properties: name: type: string description: type: string examples: ConnectorUpdateNameRequestExample1: value: "{\n \"name\": \"Custom connector\",\n \"description\": \"This is my customized connector\"\n}" x-codeSamples: - lang: Console source: "PUT _connector/my-connector/_name\n{\n \"name\": \"Custom connector\",\n \"description\": \"This is my customized connector\"\n}" - lang: Python source: "resp = client.connector.update_name(\n connector_id=\"my-connector\",\n name=\"Custom connector\",\n description=\"This is my customized connector\",\n)" - lang: JavaScript source: "const response = await client.connector.updateName({\n connector_id: \"my-connector\",\n name: \"Custom connector\",\n description: \"This is my customized connector\",\n});" - lang: Ruby source: "response = client.connector.update_name(\n connector_id: \"my-connector\",\n body: {\n \"name\": \"Custom connector\",\n \"description\": \"This is my customized connector\"\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateName([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"name\" => \"Custom connector\",\n \"description\" => \"This is my customized connector\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"name":"Custom connector","description":"This is my customized connector"}'' "$ELASTICSEARCH_URL/_connector/my-connector/_name"' - lang: Java source: "client.connector().updateName(u -> u\n .connectorId(\"my-connector\")\n .description(\"This is my customized connector\")\n .name(\"Custom connector\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - result type: object properties: result: allOf: - $ref: '#/components/schemas/_types.Result' examples: ConnectorUpdateNameResponseExample1: value: "{\n \"result\": \"updated\"\n}" x-state: Beta; Added in 8.12.0 x-codeSamples: - lang: Console source: "PUT _connector/my-connector/_name\n{\n \"name\": \"Custom connector\",\n \"description\": \"This is my customized connector\"\n}" - lang: Python source: "resp = client.connector.update_name(\n connector_id=\"my-connector\",\n name=\"Custom connector\",\n description=\"This is my customized connector\",\n)" - lang: JavaScript source: "const response = await client.connector.updateName({\n connector_id: \"my-connector\",\n name: \"Custom connector\",\n description: \"This is my customized connector\",\n});" - lang: Ruby source: "response = client.connector.update_name(\n connector_id: \"my-connector\",\n body: {\n \"name\": \"Custom connector\",\n \"description\": \"This is my customized connector\"\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateName([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"name\" => \"Custom connector\",\n \"description\" => \"This is my customized connector\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"name":"Custom connector","description":"This is my customized connector"}'' "$ELASTICSEARCH_URL/_connector/my-connector/_name"' - lang: Java source: "client.connector().updateName(u -> u\n .connectorId(\"my-connector\")\n .description(\"This is my customized connector\")\n .name(\"Custom connector\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_connector/{connector_id}/_native': put: tags: - connector summary: Update the connector is_native flag operationId: connector-update-native parameters: - name: connector_id in: path description: The unique identifier of the connector to be updated required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: required: - is_native type: object properties: is_native: type: boolean required: true responses: '200': description: '' content: application/json: schema: required: - result type: object properties: result: allOf: - $ref: '#/components/schemas/_types.Result' x-state: Beta; Added in 8.12.0 x-metaTags: - content: Elasticsearch name: product_name '/_connector/{connector_id}/_pipeline': put: tags: - connector summary: Update the connector pipeline description: 'When you create a new connector, the configuration of an ingest pipeline is populated with default settings.' operationId: connector-update-pipeline parameters: - name: connector_id in: path description: The unique identifier of the connector to be updated required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: required: - pipeline type: object properties: pipeline: allOf: - $ref: '#/components/schemas/connector._types.IngestPipelineParams' examples: ConnectorUpdatePipelineRequestExample1: value: "{\n \"pipeline\": {\n \"extract_binary_content\": true,\n \"name\": \"my-connector-pipeline\",\n \"reduce_whitespace\": true,\n \"run_ml_inference\": true\n }\n}" x-codeSamples: - lang: Console source: "PUT _connector/my-connector/_pipeline\n{\n \"pipeline\": {\n \"extract_binary_content\": true,\n \"name\": \"my-connector-pipeline\",\n \"reduce_whitespace\": true,\n \"run_ml_inference\": true\n }\n}" - lang: Python source: "resp = client.connector.update_pipeline(\n connector_id=\"my-connector\",\n pipeline={\n \"extract_binary_content\": True,\n \"name\": \"my-connector-pipeline\",\n \"reduce_whitespace\": True,\n \"run_ml_inference\": True\n },\n)" - lang: JavaScript source: "const response = await client.connector.updatePipeline({\n connector_id: \"my-connector\",\n pipeline: {\n extract_binary_content: true,\n name: \"my-connector-pipeline\",\n reduce_whitespace: true,\n run_ml_inference: true,\n },\n});" - lang: Ruby source: "response = client.connector.update_pipeline(\n connector_id: \"my-connector\",\n body: {\n \"pipeline\": {\n \"extract_binary_content\": true,\n \"name\": \"my-connector-pipeline\",\n \"reduce_whitespace\": true,\n \"run_ml_inference\": true\n }\n }\n)" - lang: PHP source: "$resp = $client->connector()->updatePipeline([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"pipeline\" => [\n \"extract_binary_content\" => true,\n \"name\" => \"my-connector-pipeline\",\n \"reduce_whitespace\" => true,\n \"run_ml_inference\" => true,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"pipeline":{"extract_binary_content":true,"name":"my-connector-pipeline","reduce_whitespace":true,"run_ml_inference":true}}'' "$ELASTICSEARCH_URL/_connector/my-connector/_pipeline"' - lang: Java source: "client.connector().updatePipeline(u -> u\n .connectorId(\"my-connector\")\n .pipeline(p -> p\n .extractBinaryContent(true)\n .name(\"my-connector-pipeline\")\n .reduceWhitespace(true)\n .runMlInference(true)\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - result type: object properties: result: allOf: - $ref: '#/components/schemas/_types.Result' examples: ConnectorUpdatePipelineResponseExample1: value: "{\n \"result\": \"updated\"\n}" x-state: Beta; Added in 8.12.0 x-codeSamples: - lang: Console source: "PUT _connector/my-connector/_pipeline\n{\n \"pipeline\": {\n \"extract_binary_content\": true,\n \"name\": \"my-connector-pipeline\",\n \"reduce_whitespace\": true,\n \"run_ml_inference\": true\n }\n}" - lang: Python source: "resp = client.connector.update_pipeline(\n connector_id=\"my-connector\",\n pipeline={\n \"extract_binary_content\": True,\n \"name\": \"my-connector-pipeline\",\n \"reduce_whitespace\": True,\n \"run_ml_inference\": True\n },\n)" - lang: JavaScript source: "const response = await client.connector.updatePipeline({\n connector_id: \"my-connector\",\n pipeline: {\n extract_binary_content: true,\n name: \"my-connector-pipeline\",\n reduce_whitespace: true,\n run_ml_inference: true,\n },\n});" - lang: Ruby source: "response = client.connector.update_pipeline(\n connector_id: \"my-connector\",\n body: {\n \"pipeline\": {\n \"extract_binary_content\": true,\n \"name\": \"my-connector-pipeline\",\n \"reduce_whitespace\": true,\n \"run_ml_inference\": true\n }\n }\n)" - lang: PHP source: "$resp = $client->connector()->updatePipeline([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"pipeline\" => [\n \"extract_binary_content\" => true,\n \"name\" => \"my-connector-pipeline\",\n \"reduce_whitespace\" => true,\n \"run_ml_inference\" => true,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"pipeline":{"extract_binary_content":true,"name":"my-connector-pipeline","reduce_whitespace":true,"run_ml_inference":true}}'' "$ELASTICSEARCH_URL/_connector/my-connector/_pipeline"' - lang: Java source: "client.connector().updatePipeline(u -> u\n .connectorId(\"my-connector\")\n .pipeline(p -> p\n .extractBinaryContent(true)\n .name(\"my-connector-pipeline\")\n .reduceWhitespace(true)\n .runMlInference(true)\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_connector/{connector_id}/_scheduling': put: tags: - connector summary: Update the connector scheduling operationId: connector-update-scheduling parameters: - name: connector_id in: path description: The unique identifier of the connector to be updated required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: required: - scheduling type: object properties: scheduling: allOf: - $ref: '#/components/schemas/connector._types.SchedulingConfiguration' examples: ConnectorUpdateSchedulingRequestExample1: value: "{\n \"scheduling\": {\n \"access_control\": {\n \"enabled\": true,\n \"interval\": \"0 10 0 * * ?\"\n },\n \"full\": {\n \"enabled\": true,\n \"interval\": \"0 20 0 * * ?\"\n },\n \"incremental\": {\n \"enabled\": false,\n \"interval\": \"0 30 0 * * ?\"\n }\n }\n}" x-codeSamples: - lang: Console source: "PUT _connector/my-connector/_scheduling\n{\n \"scheduling\": {\n \"access_control\": {\n \"enabled\": true,\n \"interval\": \"0 10 0 * * ?\"\n },\n \"full\": {\n \"enabled\": true,\n \"interval\": \"0 20 0 * * ?\"\n },\n \"incremental\": {\n \"enabled\": false,\n \"interval\": \"0 30 0 * * ?\"\n }\n }\n}" - lang: Python source: "resp = client.connector.update_scheduling(\n connector_id=\"my-connector\",\n scheduling={\n \"access_control\": {\n \"enabled\": True,\n \"interval\": \"0 10 0 * * ?\"\n },\n \"full\": {\n \"enabled\": True,\n \"interval\": \"0 20 0 * * ?\"\n },\n \"incremental\": {\n \"enabled\": False,\n \"interval\": \"0 30 0 * * ?\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.connector.updateScheduling({\n connector_id: \"my-connector\",\n scheduling: {\n access_control: {\n enabled: true,\n interval: \"0 10 0 * * ?\",\n },\n full: {\n enabled: true,\n interval: \"0 20 0 * * ?\",\n },\n incremental: {\n enabled: false,\n interval: \"0 30 0 * * ?\",\n },\n },\n});" - lang: Ruby source: "response = client.connector.update_scheduling(\n connector_id: \"my-connector\",\n body: {\n \"scheduling\": {\n \"access_control\": {\n \"enabled\": true,\n \"interval\": \"0 10 0 * * ?\"\n },\n \"full\": {\n \"enabled\": true,\n \"interval\": \"0 20 0 * * ?\"\n },\n \"incremental\": {\n \"enabled\": false,\n \"interval\": \"0 30 0 * * ?\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateScheduling([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"scheduling\" => [\n \"access_control\" => [\n \"enabled\" => true,\n \"interval\" => \"0 10 0 * * ?\",\n ],\n \"full\" => [\n \"enabled\" => true,\n \"interval\" => \"0 20 0 * * ?\",\n ],\n \"incremental\" => [\n \"enabled\" => false,\n \"interval\" => \"0 30 0 * * ?\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"scheduling":{"access_control":{"enabled":true,"interval":"0 10 0 * * ?"},"full":{"enabled":true,"interval":"0 20 0 * * ?"},"incremental":{"enabled":false,"interval":"0 30 0 * * ?"}}}'' "$ELASTICSEARCH_URL/_connector/my-connector/_scheduling"' - lang: Java source: "client.connector().updateScheduling(u -> u\n .connectorId(\"my-connector\")\n .scheduling(s -> s\n .accessControl(a -> a\n .enabled(true)\n .interval(\"0 10 0 * * ?\")\n )\n .full(f -> f\n .enabled(true)\n .interval(\"0 20 0 * * ?\")\n )\n .incremental(i -> i\n .enabled(false)\n .interval(\"0 30 0 * * ?\")\n )\n )\n);\n" ConnectorUpdateSchedulingRequestExample2: value: "{\n \"scheduling\": {\n \"full\": {\n \"enabled\": true,\n \"interval\": \"0 10 0 * * ?\"\n }\n }\n}" x-codeSamples: - lang: Console source: "PUT _connector/my-connector/_scheduling\n{\n \"scheduling\": {\n \"full\": {\n \"enabled\": true,\n \"interval\": \"0 10 0 * * ?\"\n }\n }\n}" - lang: Python source: "resp = client.connector.update_scheduling(\n connector_id=\"my-connector\",\n scheduling={\n \"full\": {\n \"enabled\": True,\n \"interval\": \"0 10 0 * * ?\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.connector.updateScheduling({\n connector_id: \"my-connector\",\n scheduling: {\n full: {\n enabled: true,\n interval: \"0 10 0 * * ?\",\n },\n },\n});" - lang: Ruby source: "response = client.connector.update_scheduling(\n connector_id: \"my-connector\",\n body: {\n \"scheduling\": {\n \"full\": {\n \"enabled\": true,\n \"interval\": \"0 10 0 * * ?\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateScheduling([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"scheduling\" => [\n \"full\" => [\n \"enabled\" => true,\n \"interval\" => \"0 10 0 * * ?\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"scheduling":{"full":{"enabled":true,"interval":"0 10 0 * * ?"}}}'' "$ELASTICSEARCH_URL/_connector/my-connector/_scheduling"' - lang: Java source: "client.connector().updateScheduling(u -> u\n .connectorId(\"my-connector\")\n .scheduling(s -> s\n .full(f -> f\n .enabled(true)\n .interval(\"0 10 0 * * ?\")\n )\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - result type: object properties: result: allOf: - $ref: '#/components/schemas/_types.Result' examples: ConnectorUpdateSchedulingResponseExample1: value: "{\n \"result\": \"updated\"\n}" x-state: Beta; Added in 8.12.0 x-codeSamples: - lang: Console source: "PUT _connector/my-connector/_scheduling\n{\n \"scheduling\": {\n \"access_control\": {\n \"enabled\": true,\n \"interval\": \"0 10 0 * * ?\"\n },\n \"full\": {\n \"enabled\": true,\n \"interval\": \"0 20 0 * * ?\"\n },\n \"incremental\": {\n \"enabled\": false,\n \"interval\": \"0 30 0 * * ?\"\n }\n }\n}" - lang: Python source: "resp = client.connector.update_scheduling(\n connector_id=\"my-connector\",\n scheduling={\n \"access_control\": {\n \"enabled\": True,\n \"interval\": \"0 10 0 * * ?\"\n },\n \"full\": {\n \"enabled\": True,\n \"interval\": \"0 20 0 * * ?\"\n },\n \"incremental\": {\n \"enabled\": False,\n \"interval\": \"0 30 0 * * ?\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.connector.updateScheduling({\n connector_id: \"my-connector\",\n scheduling: {\n access_control: {\n enabled: true,\n interval: \"0 10 0 * * ?\",\n },\n full: {\n enabled: true,\n interval: \"0 20 0 * * ?\",\n },\n incremental: {\n enabled: false,\n interval: \"0 30 0 * * ?\",\n },\n },\n});" - lang: Ruby source: "response = client.connector.update_scheduling(\n connector_id: \"my-connector\",\n body: {\n \"scheduling\": {\n \"access_control\": {\n \"enabled\": true,\n \"interval\": \"0 10 0 * * ?\"\n },\n \"full\": {\n \"enabled\": true,\n \"interval\": \"0 20 0 * * ?\"\n },\n \"incremental\": {\n \"enabled\": false,\n \"interval\": \"0 30 0 * * ?\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateScheduling([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"scheduling\" => [\n \"access_control\" => [\n \"enabled\" => true,\n \"interval\" => \"0 10 0 * * ?\",\n ],\n \"full\" => [\n \"enabled\" => true,\n \"interval\" => \"0 20 0 * * ?\",\n ],\n \"incremental\" => [\n \"enabled\" => false,\n \"interval\" => \"0 30 0 * * ?\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"scheduling":{"access_control":{"enabled":true,"interval":"0 10 0 * * ?"},"full":{"enabled":true,"interval":"0 20 0 * * ?"},"incremental":{"enabled":false,"interval":"0 30 0 * * ?"}}}'' "$ELASTICSEARCH_URL/_connector/my-connector/_scheduling"' - lang: Java source: "client.connector().updateScheduling(u -> u\n .connectorId(\"my-connector\")\n .scheduling(s -> s\n .accessControl(a -> a\n .enabled(true)\n .interval(\"0 10 0 * * ?\")\n )\n .full(f -> f\n .enabled(true)\n .interval(\"0 20 0 * * ?\")\n )\n .incremental(i -> i\n .enabled(false)\n .interval(\"0 30 0 * * ?\")\n )\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_connector/{connector_id}/_service_type': put: tags: - connector summary: Update the connector service type operationId: connector-update-service-type parameters: - name: connector_id in: path description: The unique identifier of the connector to be updated required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: required: - service_type type: object properties: service_type: type: string examples: ConnectorUpdateServiceTypeRequestExample1: value: "{\n \"service_type\": \"sharepoint_online\"\n}" x-codeSamples: - lang: Console source: "PUT _connector/my-connector/_service_type\n{\n \"service_type\": \"sharepoint_online\"\n}" - lang: Python source: "resp = client.connector.update_service_type(\n connector_id=\"my-connector\",\n service_type=\"sharepoint_online\",\n)" - lang: JavaScript source: "const response = await client.connector.updateServiceType({\n connector_id: \"my-connector\",\n service_type: \"sharepoint_online\",\n});" - lang: Ruby source: "response = client.connector.update_service_type(\n connector_id: \"my-connector\",\n body: {\n \"service_type\": \"sharepoint_online\"\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateServiceType([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"service_type\" => \"sharepoint_online\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service_type":"sharepoint_online"}'' "$ELASTICSEARCH_URL/_connector/my-connector/_service_type"' - lang: Java source: "client.connector().updateServiceType(u -> u\n .connectorId(\"my-connector\")\n .serviceType(\"sharepoint_online\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - result type: object properties: result: allOf: - $ref: '#/components/schemas/_types.Result' examples: ConnectorUpdateServiceTypeResponseExample1: value: "{\n \"result\": \"updated\"\n}" x-state: Beta; Added in 8.12.0 x-codeSamples: - lang: Console source: "PUT _connector/my-connector/_service_type\n{\n \"service_type\": \"sharepoint_online\"\n}" - lang: Python source: "resp = client.connector.update_service_type(\n connector_id=\"my-connector\",\n service_type=\"sharepoint_online\",\n)" - lang: JavaScript source: "const response = await client.connector.updateServiceType({\n connector_id: \"my-connector\",\n service_type: \"sharepoint_online\",\n});" - lang: Ruby source: "response = client.connector.update_service_type(\n connector_id: \"my-connector\",\n body: {\n \"service_type\": \"sharepoint_online\"\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateServiceType([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"service_type\" => \"sharepoint_online\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service_type":"sharepoint_online"}'' "$ELASTICSEARCH_URL/_connector/my-connector/_service_type"' - lang: Java source: "client.connector().updateServiceType(u -> u\n .connectorId(\"my-connector\")\n .serviceType(\"sharepoint_online\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_connector/{connector_id}/_status': put: tags: - connector summary: Update the connector status operationId: connector-update-status parameters: - name: connector_id in: path description: The unique identifier of the connector to be updated required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: required: - status type: object properties: status: allOf: - $ref: '#/components/schemas/connector._types.ConnectorStatus' examples: ConnectorUpdateStatusRequestExample1: value: "{\n \"status\": \"needs_configuration\"\n}" x-codeSamples: - lang: Console source: "PUT _connector/my-connector/_status\n{\n \"status\": \"needs_configuration\"\n}" - lang: Python source: "resp = client.connector.update_status(\n connector_id=\"my-connector\",\n status=\"needs_configuration\",\n)" - lang: JavaScript source: "const response = await client.connector.updateStatus({\n connector_id: \"my-connector\",\n status: \"needs_configuration\",\n});" - lang: Ruby source: "response = client.connector.update_status(\n connector_id: \"my-connector\",\n body: {\n \"status\": \"needs_configuration\"\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateStatus([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"status\" => \"needs_configuration\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"status":"needs_configuration"}'' "$ELASTICSEARCH_URL/_connector/my-connector/_status"' - lang: Java source: "client.connector().updateStatus(u -> u\n .connectorId(\"my-connector\")\n .status(ConnectorStatus.NeedsConfiguration)\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - result type: object properties: result: allOf: - $ref: '#/components/schemas/_types.Result' examples: ConnectorUpdateStatusResponseExample1: value: "{\n \"result\": \"updated\"\n}" x-state: Experimental; Added in 8.12.0 x-codeSamples: - lang: Console source: "PUT _connector/my-connector/_status\n{\n \"status\": \"needs_configuration\"\n}" - lang: Python source: "resp = client.connector.update_status(\n connector_id=\"my-connector\",\n status=\"needs_configuration\",\n)" - lang: JavaScript source: "const response = await client.connector.updateStatus({\n connector_id: \"my-connector\",\n status: \"needs_configuration\",\n});" - lang: Ruby source: "response = client.connector.update_status(\n connector_id: \"my-connector\",\n body: {\n \"status\": \"needs_configuration\"\n }\n)" - lang: PHP source: "$resp = $client->connector()->updateStatus([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"status\" => \"needs_configuration\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"status":"needs_configuration"}'' "$ELASTICSEARCH_URL/_connector/my-connector/_status"' - lang: Java source: "client.connector().updateStatus(u -> u\n .connectorId(\"my-connector\")\n .status(ConnectorStatus.NeedsConfiguration)\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_count': get: tags: - search summary: "Count search results\n" description: "**All methods and paths for this operation:**\n\n
\n POST\n /_count\n
\n
\n GET\n /_count\n
\n
\n POST\n /{index}/_count\n
\n
\n GET\n /{index}/_count\n
\n \n\nGet the number of documents matching a query.\n\nThe query can be provided either by using a simple query string as a parameter, or by defining Query DSL within the request body.\nThe query is optional. When no query is provided, the API uses `match_all` to count all the documents.\n\nThe count API supports multi-target syntax. You can run a single count API search across multiple data streams and indices.\n\nThe operation is broadcast across all shards.\nFor each shard ID group, a replica is chosen and the search is run against it.\nThis means that replicas increase the scalability of the count.\n\n## Required authorization\n\n* Index privileges: `read`\n" operationId: count parameters: - $ref: '#/components/parameters/count-index' - $ref: '#/components/parameters/count-allow_no_indices' - $ref: '#/components/parameters/count-analyzer' - $ref: '#/components/parameters/count-analyze_wildcard' - $ref: '#/components/parameters/count-default_operator' - $ref: '#/components/parameters/count-df' - $ref: '#/components/parameters/count-expand_wildcards' - $ref: '#/components/parameters/count-ignore_throttled' - $ref: '#/components/parameters/count-ignore_unavailable' - $ref: '#/components/parameters/count-lenient' - $ref: '#/components/parameters/count-min_score' - $ref: '#/components/parameters/count-preference' - $ref: '#/components/parameters/count-routing' - $ref: '#/components/parameters/count-stats' - $ref: '#/components/parameters/count-terminate_after' - $ref: '#/components/parameters/count-q' requestBody: $ref: '#/components/requestBodies/count' responses: '200': $ref: '#/components/responses/count-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET /my-index-000001/_count\n{\n \"query\" : {\n \"term\" : { \"user.id\" : \"kimchy\" }\n }\n}" - lang: Python source: "resp = client.count(\n index=\"my-index-000001\",\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.count({\n index: \"my-index-000001\",\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n});" - lang: Ruby source: "response = client.count(\n index: \"my-index-000001\",\n body: {\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->count([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":{"term":{"user.id":"kimchy"}}}'' "$ELASTICSEARCH_URL/my-index-000001/_count"' - lang: C# source: "var response = await client\n .CountAsync(d1 => d1\n .Indices(new[] { \"my-index-000001\" })\n .Query(d2 => d2\n .Term(d3 => d3\n .Field(x => x.User.Id)\n .Value(\"kimchy\")\n )\n )\n );" - lang: Java source: "client.count(c -> c\n .index(\"my-index-000001\")\n .query(q -> q\n .term(t -> t\n .field(\"user.id\")\n .value(FieldValue.of(\"kimchy\"))\n )\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_create/{id}': post: tags: - document summary: "Create a new document in the index\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /{index}/_create/{id}\n
\n
\n POST\n /{index}/_create/{id}\n
\n \n\nYou can index a new JSON document with the `//_doc/` or `//_create/<_id>` APIs\nUsing `_create` guarantees that the document is indexed only if it does not already exist.\nIt returns a 409 response when a document with a same ID already exists in the index.\nTo update an existing document, you must use the `//_doc/` API.\n\nIf the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or index alias:\n\n* To add a document using the `PUT //_create/<_id>` or `POST //_create/<_id>` request formats, you must have the `create_doc`, `create`, `index`, or `write` index privilege.\n* To automatically create a data stream or index with this API request, you must have the `auto_configure`, `create_index`, or `manage` index privilege.\n\nAutomatic data stream creation requires a matching index template with data stream enabled.\n\n**Automatically create data streams and indices**\n\nIf the request's target doesn't exist and matches an index template with a `data_stream` definition, the index operation automatically creates the data stream.\n\nIf the target doesn't exist and doesn't match a data stream template, the operation automatically creates the index and applies any matching index templates.\n\nNOTE: Elasticsearch includes several built-in index templates. To avoid naming collisions with these templates, refer to index pattern documentation.\n\nIf no mapping exists, the index operation creates a dynamic mapping.\nBy default, new fields and objects are automatically added to the mapping if needed.\n\nAutomatic index creation is controlled by the `action.auto_create_index` setting.\nIf it is `true`, any index can be created automatically.\nYou can modify this setting to explicitly allow or block automatic creation of indices that match specified patterns or set it to `false` to turn off automatic index creation entirely.\nSpecify a comma-separated list of patterns you want to allow or prefix each pattern with `+` or `-` to indicate whether it should be allowed or blocked.\nWhen a list is specified, the default behaviour is to disallow.\n\nNOTE: The `action.auto_create_index` setting affects the automatic creation of indices only.\nIt does not affect the creation of data streams.\n\n**Routing**\n\nBy default, shard placement — or routing — is controlled by using a hash of the document's ID value.\nFor more explicit control, the value fed into the hash function used by the router can be directly specified on a per-operation basis using the `routing` parameter.\n\nWhen setting up explicit mapping, you can also use the `_routing` field to direct the index operation to extract the routing value from the document itself.\nThis does come at the (very minimal) cost of an additional document parsing pass.\nIf the `_routing` mapping is defined and set to be required, the index operation will fail if no routing value is provided or extracted.\n\nNOTE: Data streams do not support custom routing unless they were created with the `allow_custom_routing` setting enabled in the template.\n\n**Distributed**\n\nThe index operation is directed to the primary shard based on its route and performed on the actual node containing this shard.\nAfter the primary shard completes the operation, if needed, the update is distributed to applicable replicas.\n\n**Active shards**\n\nTo improve the resiliency of writes to the system, indexing operations can be configured to wait for a certain number of active shard copies before proceeding with the operation.\nIf the requisite number of active shard copies are not available, then the write operation must wait and retry, until either the requisite shard copies have started or a timeout occurs.\nBy default, write operations only wait for the primary shards to be active before proceeding (that is to say `wait_for_active_shards` is `1`).\nThis default can be overridden in the index settings dynamically by setting `index.write.wait_for_active_shards`.\nTo alter this behavior per operation, use the `wait_for_active_shards request` parameter.\n\nValid values are all or any positive integer up to the total number of configured copies per shard in the index (which is `number_of_replicas`+1).\nSpecifying a negative value or a number greater than the number of shard copies will throw an error.\n\nFor example, suppose you have a cluster of three nodes, A, B, and C and you create an index index with the number of replicas set to 3 (resulting in 4 shard copies, one more copy than there are nodes).\nIf you attempt an indexing operation, by default the operation will only ensure the primary copy of each shard is available before proceeding.\nThis means that even if B and C went down and A hosted the primary shard copies, the indexing operation would still proceed with only one copy of the data.\nIf `wait_for_active_shards` is set on the request to `3` (and all three nodes are up), the indexing operation will require 3 active shard copies before proceeding.\nThis requirement should be met because there are 3 active nodes in the cluster, each one holding a copy of the shard.\nHowever, if you set `wait_for_active_shards` to `all` (or to `4`, which is the same in this situation), the indexing operation will not proceed as you do not have all 4 copies of each shard active in the index.\nThe operation will timeout unless a new node is brought up in the cluster to host the fourth copy of the shard.\n\nIt is important to note that this setting greatly reduces the chances of the write operation not writing to the requisite number of shard copies, but it does not completely eliminate the possibility, because this check occurs before the write operation starts.\nAfter the write operation is underway, it is still possible for replication to fail on any number of shard copies but still succeed on the primary.\nThe `_shards` section of the API response reveals the number of shard copies on which replication succeeded and failed.\n\n## Required authorization\n\n* Index privileges: `create`\n" externalDocs: description: Learn more about data streams url: https://www.elastic.co/docs/manage-data/data-store/data-streams x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/docs-index_.html operationId: create parameters: - $ref: '#/components/parameters/create-index' - $ref: '#/components/parameters/create-id' - $ref: '#/components/parameters/create-include_source_on_error' - $ref: '#/components/parameters/create-pipeline' - $ref: '#/components/parameters/create-refresh' - $ref: '#/components/parameters/create-require_alias' - $ref: '#/components/parameters/create-require_data_stream' - $ref: '#/components/parameters/create-routing' - $ref: '#/components/parameters/create-timeout' - $ref: '#/components/parameters/create-version' - $ref: '#/components/parameters/create-version_type' - $ref: '#/components/parameters/create-wait_for_active_shards' requestBody: $ref: '#/components/requestBodies/create' responses: '200': $ref: '#/components/responses/create-200' x-state: Generally available; Added in 5.0.0 x-codeSamples: - lang: Console source: "PUT my-index-000001/_create/1\n{\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n}" - lang: Python source: "resp = client.create(\n index=\"my-index-000001\",\n id=\"1\",\n document={\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.create({\n index: \"my-index-000001\",\n id: 1,\n document: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n message: \"GET /search HTTP/1.1 200 1070000\",\n user: {\n id: \"kimchy\",\n },\n },\n});" - lang: Ruby source: "response = client.create(\n index: \"my-index-000001\",\n id: \"1\",\n body: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n }\n)" - lang: PHP source: "$resp = $client->create([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n \"body\" => [\n \"@timestamp\" => \"2099-11-15T13:12:00\",\n \"message\" => \"GET /search HTTP/1.1 200 1070000\",\n \"user\" => [\n \"id\" => \"kimchy\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"@timestamp":"2099-11-15T13:12:00","message":"GET /search HTTP/1.1 200 1070000","user":{"id":"kimchy"}}'' "$ELASTICSEARCH_URL/my-index-000001/_create/1"' - lang: C# source: "var response = await client.CreateAsync(document: new MyDocument()\n{\n Timestamp = \"2099-11-15T13:12:00\",\n Message = \"GET /search HTTP/1.1 200 1070000\",\n User = new()\n {\n Id = \"kimchy\"\n }\n}, index: \"my-index-000001\", routeSlice: null, id: \"1\");" - lang: Java source: "client.create(c -> c\n .id(\"1\")\n .index(\"my-index-000001\")\n .document(JsonData.fromJson(\"\"\"\n{\"@timestamp\":\"2099-11-15T13:12:00\",\"message\":\"GET /search HTTP/1.1 200 1070000\",\"user\":{\"id\":\"kimchy\"}}\n\"\"\"))\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_dangling/{index_uuid}': post: tags: - indices summary: Import a dangling index description: "If Elasticsearch encounters index data that is absent from the current cluster state, those indices are considered to be dangling.\nFor example, this can happen if you delete more than `cluster.indices.tombstones.size` indices while an Elasticsearch node is offline.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: dangling-indices-import-dangling-index parameters: - name: index_uuid in: path description: The UUID of the index to import. Use the get dangling indices API to locate the UUID. required: true schema: $ref: '#/components/schemas/_types.Uuid' - name: accept_data_loss in: query description: "This parameter must be set to true to import a dangling index.\nBecause Elasticsearch cannot know where the dangling index data came from or determine which shard copies are fresh and which are stale, it cannot guarantee that the imported data represents the latest state of the index when it was last in the cluster." schema: type: boolean default: false - name: master_timeout in: query description: The period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: The period to wait for a response. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: ImportDanglingIndexResponseExample1: description: "A successful response from `POST /_dangling/zmM4e0JtBkeUjiHD-MihPQ?accept_data_loss=true`.\n" value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 7.9.0 x-codeSamples: - lang: Console source: "POST /_dangling/zmM4e0JtBkeUjiHD-MihPQ?accept_data_loss=true\n" - lang: Python source: "resp = client.dangling_indices.import_dangling_index(\n index_uuid=\"zmM4e0JtBkeUjiHD-MihPQ\",\n accept_data_loss=True,\n)" - lang: JavaScript source: "const response = await client.danglingIndices.importDanglingIndex({\n index_uuid: \"zmM4e0JtBkeUjiHD-MihPQ\",\n accept_data_loss: \"true\",\n});" - lang: Ruby source: "response = client.dangling_indices.import_dangling_index(\n index_uuid: \"zmM4e0JtBkeUjiHD-MihPQ\",\n accept_data_loss: \"true\"\n)" - lang: PHP source: "$resp = $client->danglingIndices()->importDanglingIndex([\n \"index_uuid\" => \"zmM4e0JtBkeUjiHD-MihPQ\",\n \"accept_data_loss\" => \"true\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_dangling/zmM4e0JtBkeUjiHD-MihPQ?accept_data_loss=true"' - lang: C# source: "var response = await client.DanglingIndices\n .ImportDanglingIndexAsync(indexUuid: \"zmM4e0JtBkeUjiHD-MihPQ\", d1 => d1\n .AcceptDataLoss(true)\n );" - lang: Java source: "client.danglingIndices().importDanglingIndex(i -> i\n .acceptDataLoss(true)\n .indexUuid(\"zmM4e0JtBkeUjiHD-MihPQ\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - indices summary: Delete a dangling index description: "If Elasticsearch encounters index data that is absent from the current cluster state, those indices are considered to be dangling.\nFor example, this can happen if you delete more than `cluster.indices.tombstones.size` indices while an Elasticsearch node is offline.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: dangling-indices-delete-dangling-index parameters: - name: index_uuid in: path description: The UUID of the index to delete. Use the get dangling indices API to find the UUID. required: true schema: $ref: '#/components/schemas/_types.Uuid' - name: accept_data_loss in: query description: This parameter must be set to true to acknowledge that it will no longer be possible to recove data from the dangling index. schema: type: boolean default: false - name: master_timeout in: query description: The period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: The period to wait for a response. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 7.9.0 x-codeSamples: - lang: Console source: "DELETE /_dangling/?accept_data_loss=true\n" - lang: Python source: "resp = client.dangling_indices.delete_dangling_index(\n index_uuid=\"\",\n accept_data_loss=True,\n)" - lang: JavaScript source: "const response = await client.danglingIndices.deleteDanglingIndex({\n index_uuid: \"\",\n accept_data_loss: \"true\",\n});" - lang: Ruby source: "response = client.dangling_indices.delete_dangling_index(\n index_uuid: \"\",\n accept_data_loss: \"true\"\n)" - lang: PHP source: "$resp = $client->danglingIndices()->deleteDanglingIndex([\n \"index_uuid\" => \"\",\n \"accept_data_loss\" => \"true\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_dangling/?accept_data_loss=true"' - lang: C# source: "var response = await client.DanglingIndices\n .DeleteDanglingIndexAsync(indexUuid: \"\", d1 => d1\n .AcceptDataLoss(true)\n );" - lang: Java source: "client.danglingIndices().deleteDanglingIndex(d -> d\n .acceptDataLoss(true)\n .indexUuid(\"\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_dangling: get: tags: - indices summary: Get the dangling indices description: "If Elasticsearch encounters index data that is absent from the current cluster state, those indices are considered to be dangling.\nFor example, this can happen if you delete more than `cluster.indices.tombstones.size` indices while an Elasticsearch node is offline.\n\nUse this API to list dangling indices, which you can then import or delete.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: dangling-indices-list-dangling-indices responses: '200': description: '' content: application/json: schema: required: - dangling_indices type: object properties: dangling_indices: type: array items: $ref: '#/components/schemas/dangling_indices.list_dangling_indices.DanglingIndex' examples: ListDanglingIndicesResponseExample1: value: "{\n \"dangling_indices\": [\n {\n \"index_name\": \"my-index-000001\",\n \"index_uuid\": \"zmM4e0JtBkeUjiHD-MihPQ\",\n \"creation_date_millis\": 1589414451372,\n \"node_ids\": [\n \"pL47UN3dAb2d5RCWP6lQ3e\"\n ]\n }\n ]\n}" x-state: Generally available; Added in 7.9.0 x-codeSamples: - lang: Console source: "GET /_dangling\n" - lang: Python source: resp = client.dangling_indices.list_dangling_indices() - lang: JavaScript source: const response = await client.danglingIndices.listDanglingIndices(); - lang: Ruby source: response = client.dangling_indices.list_dangling_indices - lang: PHP source: $resp = $client->danglingIndices()->listDanglingIndices(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_dangling"' - lang: C# source: var response = await client.DanglingIndices.ListDanglingIndicesAsync(); - lang: Java source: "client.danglingIndices().listDanglingIndices();\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_doc/{id}': get: tags: - document summary: Get a document by its ID description: "Get a document and its source or stored fields from an index.\n\nBy default, this API is realtime and is not affected by the refresh rate of the index (when data will become visible for search).\nIn the case where stored fields are requested with the `stored_fields` parameter and the document has been updated but is not yet refreshed, the API will have to parse and analyze the source to extract the stored fields.\nTo turn off realtime behavior, set the `realtime` parameter to false.\n\n**Source filtering**\n\nBy default, the API returns the contents of the `_source` field unless you have used the `stored_fields` parameter or the `_source` field is turned off.\nYou can turn off `_source` retrieval by using the `_source` parameter:\n\n```\nGET my-index-000001/_doc/0?_source=false\n```\n\nIf you only need one or two fields from the `_source`, use the `_source_includes` or `_source_excludes` parameters to include or filter out particular fields.\nThis can be helpful with large documents where partial retrieval can save on network overhead\nBoth parameters take a comma separated list of fields or wildcard expressions.\nFor example:\n\n```\nGET my-index-000001/_doc/0?_source_includes=*.id&_source_excludes=entities\n```\n\nIf you only want to specify includes, you can use a shorter notation:\n\n```\nGET my-index-000001/_doc/0?_source=*.id\n```\n\n**Routing**\n\nIf routing is used during indexing, the routing value also needs to be specified to retrieve a document.\nFor example:\n\n```\nGET my-index-000001/_doc/2?routing=user1\n```\n\nThis request gets the document with ID 2, but it is routed based on the user.\nThe document is not fetched if the correct routing is not specified.\n\n**Distributed**\n\nThe GET operation is hashed into a specific shard ID.\nIt is then redirected to one of the replicas within that shard ID and returns the result.\nThe replicas are the primary shard and its replicas within that shard ID group.\nThis means that the more replicas you have, the better your GET scaling will be.\n\n**Versioning support**\n\nYou can use the `version` parameter to retrieve the document only if its current version is equal to the specified one.\n\nInternally, Elasticsearch has marked the old document as deleted and added an entirely new document.\nThe old version of the document doesn't disappear immediately, although you won't be able to access it.\nElasticsearch cleans up deleted documents in the background as you continue to index more data.\n\n## Required authorization\n\n* Index privileges: `read`\n" operationId: get parameters: - name: index in: path description: The name of the index that contains the document. required: true schema: $ref: '#/components/schemas/_types.IndexName' - name: id in: path description: A unique document identifier. required: true schema: $ref: '#/components/schemas/_types.Id' - name: preference in: query description: "The node or shard the operation should be performed on.\nBy default, the operation is randomized between the shard replicas.\n\nIf it is set to `_local`, the operation will prefer to be run on a local allocated shard when possible.\nIf it is set to a custom value, the value is used to guarantee that the same shards will be used for the same custom value.\nThis can help with \"jumping values\" when hitting different shards in different refresh states.\nA sample value can be something like the web session ID or the user name." schema: type: string - name: realtime in: query description: 'If `true`, the request is real-time as opposed to near-real-time.' schema: type: boolean default: true - name: refresh in: query description: "If `true`, the request refreshes the relevant shards before retrieving the document.\nSetting it to `true` should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing)." schema: type: boolean default: false - name: routing in: query description: "A custom value used to route operations to a specific shard.\nNot allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead." schema: $ref: '#/components/schemas/_types.Routing' - name: _source in: query description: Indicates whether to return the `_source` field (`true` or `false`) or lists the fields to return. schema: $ref: '#/components/schemas/_global.search._types.SourceConfigParam' - name: _source_excludes in: query description: "A comma-separated list of source fields to exclude from the response.\nYou can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter.\nIf the `_source` parameter is `false`, this parameter is ignored." schema: $ref: '#/components/schemas/_types.Fields' - name: _source_exclude_vectors in: query description: Whether vectors should be excluded from _source schema: type: boolean default: false x-state: Generally available; Added in 9.2.0 - name: _source_includes in: query description: "A comma-separated list of source fields to include in the response.\nIf this parameter is specified, only these source fields are returned.\nYou can exclude fields from this subset using the `_source_excludes` query parameter.\nIf the `_source` parameter is `false`, this parameter is ignored." schema: $ref: '#/components/schemas/_types.Fields' - name: stored_fields in: query description: "A comma-separated list of stored fields to return as part of a hit.\nIf no fields are specified, no stored fields are included in the response.\nIf this field is specified, the `_source` parameter defaults to `false`.\nOnly leaf fields can be retrieved with the `stored_fields` option.\nObject fields can't be returned; if specified, the request fails." schema: $ref: '#/components/schemas/_types.Fields' - name: version in: query description: "The version number for concurrency control.\nIt must match the current version of the document for the request to succeed." schema: $ref: '#/components/schemas/_types.VersionNumber' - name: version_type in: query description: "The version type.\n\nSupported values include:\n - `internal`: Use internal versioning that starts at 1 and increments with each update or delete.\n - `external`: Only index the document if the specified version is strictly higher than the version of the stored document or if there is no existing document.\n - `external_gte`: Only index the document if the specified version is equal or higher than the version of the stored document or if there is no existing document.\nNOTE: The `external_gte` version type is meant for special use cases and should be used with care.\nIf used incorrectly, it can result in loss of data.\n\n" schema: $ref: '#/components/schemas/_types.VersionType' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_global.get.GetResult' examples: GetResponseExample1: summary: Get a document description: "A successful response from `GET my-index-000001/_doc/0`. It retrieves the JSON document with the `_id` 0 from the `my-index-000001` index.\n" value: "{\n \"_index\": \"my-index-000001\",\n \"_id\": \"0\",\n \"_version\": 1,\n \"_seq_no\": 0,\n \"_primary_term\": 1,\n \"found\": true,\n \"_source\": {\n \"@timestamp\": \"2099-11-15T14:12:12\",\n \"http\": {\n \"request\": {\n \"method\": \"get\"\n },\n \"response\": {\n \"status_code\": 200,\n \"bytes\": 1070000\n },\n \"version\": \"1.1\"\n },\n \"source\": {\n \"ip\": \"127.0.0.1\"\n },\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n }\n}" GetResponseExample2: summary: Get stored fields description: "A successful response from `GET my-index-000001/_doc/1?stored_fields=tags,counter`, which retrieves a set of stored fields. Field values fetched from the document itself are always returned as an array. Any requested fields that are not stored (such as the counter field in this example) are ignored.\n" value: "{\n \"_index\": \"my-index-000001\",\n \"_id\": \"1\",\n \"_version\": 1,\n \"_seq_no\" : 22,\n \"_primary_term\" : 1,\n \"found\": true,\n \"fields\": {\n \"tags\": [\n \"production\"\n ]\n }\n}" GetResponseExample3: summary: Get metadata fields description: "A successful response from `GET my-index-000001/_doc/2?routing=user1&stored_fields=tags,counter`, which retrieves the `_routing` metadata field.\n" value: "{\n \"_index\": \"my-index-000001\",\n \"_id\": \"2\",\n \"_version\": 1,\n \"_seq_no\" : 13,\n \"_primary_term\" : 1,\n \"_routing\": \"user1\",\n \"found\": true,\n \"fields\": {\n \"tags\": [\n \"env2\"\n ]\n }\n}" '404': description: '' content: application/json: schema: oneOf: - $ref: '#/components/schemas/_global.get.GetResult' - $ref: '#/components/schemas/_types.ErrorResponseBase' x-state: Generally available x-codeSamples: - lang: Console source: "GET my-index-000001/_doc/1?stored_fields=tags,counter\n" - lang: Python source: "resp = client.get(\n index=\"my-index-000001\",\n id=\"1\",\n stored_fields=\"tags,counter\",\n)" - lang: JavaScript source: "const response = await client.get({\n index: \"my-index-000001\",\n id: 1,\n stored_fields: \"tags,counter\",\n});" - lang: Ruby source: "response = client.get(\n index: \"my-index-000001\",\n id: \"1\",\n stored_fields: \"tags,counter\"\n)" - lang: PHP source: "$resp = $client->get([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n \"stored_fields\" => \"tags,counter\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_doc/1?stored_fields=tags,counter"' - lang: C# source: "var response = await client\n .GetAsync(new GetRequest()\n {\n Id = \"1\",\n Index = \"my-index-000001\",\n StoredFields = global::Elastic.Clients.Elasticsearch.Infer.Fields(x => x.Tags, x => x.Counter)\n });" - lang: Java source: "client.get(g -> g\n .id(\"1\")\n .index(\"my-index-000001\")\n .storedFields(List.of(\"tags\",\"counter\"))\n);\n" x-metaTags: - content: Elasticsearch name: product_name post: tags: - document summary: "Create or update a document in an index\n" description: "**All methods and paths for this operation:**\n\n
\n POST\n /{index}/_doc\n
\n
\n PUT\n /{index}/_doc/{id}\n
\n
\n POST\n /{index}/_doc/{id}\n
\n \n\nAdd a JSON document to the specified data stream or index and make it searchable.\nIf the target is an index and the document already exists, the request updates the document and increments its version.\n\nNOTE: You cannot use this API to send update requests for existing documents in a data stream.\n\nIf the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or index alias:\n\n* To add or overwrite a document using the `PUT //_doc/<_id>` request format, you must have the `create`, `index`, or `write` index privilege.\n* To add a document using the `POST //_doc/` request format, you must have the `create_doc`, `create`, `index`, or `write` index privilege.\n* To automatically create a data stream or index with this API request, you must have the `auto_configure`, `create_index`, or `manage` index privilege.\n\nAutomatic data stream creation requires a matching index template with data stream enabled.\n\nNOTE: Replica shards might not all be started when an indexing operation returns successfully.\nBy default, only the primary is required. Set `wait_for_active_shards` to change this default behavior (this parameter is not available in Elasticsearch Serverless).\n\n**Automatically create data streams and indices**\n\nIf the request's target doesn't exist and matches an index template with a `data_stream` definition, the index operation automatically creates the data stream.\n\nIf the target doesn't exist and doesn't match a data stream template, the operation automatically creates the index and applies any matching index templates.\n\nNOTE: Elasticsearch includes several built-in index templates. To avoid naming collisions with these templates, refer to index pattern documentation.\n\nIf no mapping exists, the index operation creates a dynamic mapping.\nBy default, new fields and objects are automatically added to the mapping if needed.\n\nAutomatic index creation is controlled by the `action.auto_create_index` setting.\nIf it is `true`, any index can be created automatically.\nYou can modify this setting to explicitly allow or block automatic creation of indices that match specified patterns or set it to `false` to turn off automatic index creation entirely.\nSpecify a comma-separated list of patterns you want to allow or prefix each pattern with `+` or `-` to indicate whether it should be allowed or blocked.\nWhen a list is specified, the default behaviour is to disallow.\n\nNOTE: The `action.auto_create_index` setting affects the automatic creation of indices only.\nIt does not affect the creation of data streams.\n\n**Optimistic concurrency control**\n\nIndex operations can be made conditional and only be performed if the last modification to the document was assigned the sequence number and primary term specified by the `if_seq_no` and `if_primary_term` parameters.\nIf a mismatch is detected, the operation will result in a `VersionConflictException` and a status code of `409`.\n\n**Routing**\n\nBy default, shard placement — or routing — is controlled by using a hash of the document's ID value.\nFor more explicit control, the value fed into the hash function used by the router can be directly specified on a per-operation basis using the `routing` parameter.\n\nWhen setting up explicit mapping, you can also use the `_routing` field to direct the index operation to extract the routing value from the document itself.\nThis does come at the (very minimal) cost of an additional document parsing pass.\nIf the `_routing` mapping is defined and set to be required, the index operation will fail if no routing value is provided or extracted.\n\nNOTE: Data streams do not support custom routing unless they were created with the `allow_custom_routing` setting enabled in the template.\n\n**Distributed**\n\nThe index operation is directed to the primary shard based on its route and performed on the actual node containing this shard.\nAfter the primary shard completes the operation, if needed, the update is distributed to applicable replicas.\n\n**Active shards**\n\nTo improve the resiliency of writes to the system, indexing operations can be configured to wait for a certain number of active shard copies before proceeding with the operation.\nIf the requisite number of active shard copies are not available, then the write operation must wait and retry, until either the requisite shard copies have started or a timeout occurs.\nBy default, write operations only wait for the primary shards to be active before proceeding (that is to say `wait_for_active_shards` is `1`).\nThis default can be overridden in the index settings dynamically by setting `index.write.wait_for_active_shards`.\nTo alter this behavior per operation, use the `wait_for_active_shards request` parameter (this parameter is not available in Elasticsearch Serverless).\n\nValid values are all or any positive integer up to the total number of configured copies per shard in the index (which is `number_of_replicas`+1).\nSpecifying a negative value or a number greater than the number of shard copies will throw an error.\n\nFor example, suppose you have a cluster of three nodes, A, B, and C and you create an index index with the number of replicas set to 3 (resulting in 4 shard copies, one more copy than there are nodes).\nIf you attempt an indexing operation, by default the operation will only ensure the primary copy of each shard is available before proceeding.\nThis means that even if B and C went down and A hosted the primary shard copies, the indexing operation would still proceed with only one copy of the data.\nIf `wait_for_active_shards` is set on the request to `3` (and all three nodes are up), the indexing operation will require 3 active shard copies before proceeding.\nThis requirement should be met because there are 3 active nodes in the cluster, each one holding a copy of the shard.\nHowever, if you set `wait_for_active_shards` to `all` (or to `4`, which is the same in this situation), the indexing operation will not proceed as you do not have all 4 copies of each shard active in the index.\nThe operation will timeout unless a new node is brought up in the cluster to host the fourth copy of the shard.\n\nIt is important to note that this setting greatly reduces the chances of the write operation not writing to the requisite number of shard copies, but it does not completely eliminate the possibility, because this check occurs before the write operation starts.\nAfter the write operation is underway, it is still possible for replication to fail on any number of shard copies but still succeed on the primary.\nThe `_shards` section of the API response reveals the number of shard copies on which replication succeeded and failed.\n\n**No operation (noop) updates**\n\nWhen updating a document by using this API, a new version of the document is always created even if the document hasn't changed.\nIf this isn't acceptable use the `_update` API with `detect_noop` set to `true`.\nThe `detect_noop` option isn't available on this API because it doesn’t fetch the old source and isn't able to compare it against the new source.\n\nThere isn't a definitive rule for when noop updates aren't acceptable.\nIt's a combination of lots of factors like how frequently your data source sends updates that are actually noops and how many queries per second Elasticsearch runs on the shard receiving the updates.\n\n**Versioning**\n\nEach indexed document is given a version number.\nBy default, internal versioning is used that starts at 1 and increments with each update, deletes included.\nOptionally, the version number can be set to an external value (for example, if maintained in a database).\nTo enable this functionality, `version_type` should be set to `external`.\nThe value provided must be a numeric, long value greater than or equal to 0, and less than around `9.2e+18`.\n\nNOTE: Versioning is completely real time, and is not affected by the near real time aspects of search operations.\nIf no version is provided, the operation runs without any version checks.\n\nWhen using the external version type, the system checks to see if the version number passed to the index request is greater than the version of the currently stored document.\nIf true, the document will be indexed and the new version number used.\nIf the value provided is less than or equal to the stored document's version number, a version conflict will occur and the index operation will fail. For example:\n\n```\nPUT my-index-000001/_doc/1?version=2&version_type=external\n{\n \"user\": {\n \"id\": \"elkbee\"\n }\n}\n```\n\nIn this example, the operation will succeed since the supplied version of 2 is higher than the current document version of 1.\nIf the document was already updated and its version was set to 2 or higher, the indexing command will fail and result in a conflict (409 HTTP status code).\n\nA nice side effect is that there is no need to maintain strict ordering of async indexing operations run as a result of changes to a source database, as long as version numbers from the source database are used.\nEven the simple case of updating the Elasticsearch index using data from a database is simplified if external versioning is used, as only the latest version will be used if the index operations arrive out of order.\n\n## Required authorization\n\n* Index privileges: `index`\n" externalDocs: description: Learn more about data streams url: https://www.elastic.co/docs/manage-data/data-store/data-streams x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/docs-index_.html operationId: index parameters: - $ref: '#/components/parameters/index-index' - $ref: '#/components/parameters/index-id' - $ref: '#/components/parameters/index-if_primary_term' - $ref: '#/components/parameters/index-if_seq_no' - $ref: '#/components/parameters/index-include_source_on_error' - $ref: '#/components/parameters/index-op_type' - $ref: '#/components/parameters/index-pipeline' - $ref: '#/components/parameters/index-refresh' - $ref: '#/components/parameters/index-routing' - $ref: '#/components/parameters/index-timeout' - $ref: '#/components/parameters/index-version' - $ref: '#/components/parameters/index-version_type' - $ref: '#/components/parameters/index-wait_for_active_shards' - $ref: '#/components/parameters/index-require_alias' - $ref: '#/components/parameters/index-require_data_stream' requestBody: $ref: '#/components/requestBodies/index' responses: '200': $ref: '#/components/responses/index-200' x-state: Generally available x-codeSamples: - lang: Console source: "POST my-index-000001/_doc/\n{\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n}" - lang: Python source: "resp = client.index(\n index=\"my-index-000001\",\n document={\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.index({\n index: \"my-index-000001\",\n document: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n message: \"GET /search HTTP/1.1 200 1070000\",\n user: {\n id: \"kimchy\",\n },\n },\n});" - lang: Ruby source: "response = client.index(\n index: \"my-index-000001\",\n body: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n }\n)" - lang: PHP source: "$resp = $client->index([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"@timestamp\" => \"2099-11-15T13:12:00\",\n \"message\" => \"GET /search HTTP/1.1 200 1070000\",\n \"user\" => [\n \"id\" => \"kimchy\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"@timestamp":"2099-11-15T13:12:00","message":"GET /search HTTP/1.1 200 1070000","user":{"id":"kimchy"}}'' "$ELASTICSEARCH_URL/my-index-000001/_doc/"' - lang: C# source: "var response = await client.IndexAsync(document: new MyDocument()\n{\n Timestamp = \"2099-11-15T13:12:00\",\n Message = \"GET /search HTTP/1.1 200 1070000\",\n User = new()\n {\n Id = \"kimchy\"\n }\n}, index: \"my-index-000001\", routeSlice: null, id: null);" - lang: Java source: "client.index(i -> i\n .index(\"my-index-000001\")\n .document(JsonData.fromJson(\"\"\"\n{\"@timestamp\":\"2099-11-15T13:12:00\",\"message\":\"GET /search HTTP/1.1 200 1070000\",\"user\":{\"id\":\"kimchy\"}}\n\"\"\"))\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - document summary: Delete a document description: "Remove a JSON document from the specified index.\n\nNOTE: You cannot send deletion requests directly to a data stream.\nTo delete a document in a data stream, you must target the backing index containing the document.\n\n**Optimistic concurrency control**\n\nDelete operations can be made conditional and only be performed if the last modification to the document was assigned the sequence number and primary term specified by the `if_seq_no` and `if_primary_term` parameters.\nIf a mismatch is detected, the operation will result in a `VersionConflictException` and a status code of `409`.\n\n**Versioning**\n\nEach document indexed is versioned.\nWhen deleting a document, the version can be specified to make sure the relevant document you are trying to delete is actually being deleted and it has not changed in the meantime.\nEvery write operation run on a document, deletes included, causes its version to be incremented.\nThe version number of a deleted document remains available for a short time after deletion to allow for control of concurrent operations.\nThe length of time for which a deleted document's version remains available is determined by the `index.gc_deletes` index setting.\n\n**Routing**\n\nIf routing is used during indexing, the routing value also needs to be specified to delete a document.\n\nIf the `_routing` mapping is set to `required` and no routing value is specified, the delete API throws a `RoutingMissingException` and rejects the request.\n\nFor example:\n\n```\nDELETE /my-index-000001/_doc/1?routing=shard-1\n```\n\nThis request deletes the document with ID 1, but it is routed based on the user.\nThe document is not deleted if the correct routing is not specified.\n\n**Distributed**\n\nThe delete operation gets hashed into a specific shard ID.\nIt then gets redirected into the primary shard within that ID group and replicated (if needed) to shard replicas within that ID group.\n\n## Required authorization\n\n* Index privileges: `delete`\n" operationId: delete parameters: - name: index in: path description: The name of the target index. required: true schema: $ref: '#/components/schemas/_types.IndexName' - name: id in: path description: A unique identifier for the document. required: true schema: $ref: '#/components/schemas/_types.Id' - name: if_primary_term in: query description: Only perform the operation if the document has this primary term. schema: type: number - name: if_seq_no in: query description: Only perform the operation if the document has this sequence number. schema: $ref: '#/components/schemas/_types.SequenceNumber' - name: refresh in: query description: "If `true`, Elasticsearch refreshes the affected shards to make this operation visible to search.\nIf `wait_for`, it waits for a refresh to make this operation visible to search.\nIf `false`, it does nothing with refreshes." schema: allOf: - $ref: '#/components/schemas/_types.Refresh' default: 'false' - name: routing in: query description: "A custom value used to route operations to a specific shard.\nNot allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead." schema: $ref: '#/components/schemas/_types.Routing' x-state: Generally available - name: timeout in: query description: "The period to wait for active shards.\n\nThis parameter is useful for situations where the primary shard assigned to perform the delete operation might not be available when the delete operation runs.\nSome reasons for this might be that the primary shard is currently recovering from a store or undergoing relocation.\nBy default, the delete operation will wait on the primary shard to become available for up to 1 minute before failing and responding with an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 1m - name: version in: query description: "An explicit version number for concurrency control.\nIt must match the current version of the document for the request to succeed." schema: $ref: '#/components/schemas/_types.VersionNumber' - name: version_type in: query description: "The version type.\n\nSupported values include:\n - `internal`: Use internal versioning that starts at 1 and increments with each update or delete.\n - `external`: Only index the document if the specified version is strictly higher than the version of the stored document or if there is no existing document.\n - `external_gte`: Only index the document if the specified version is equal or higher than the version of the stored document or if there is no existing document.\nNOTE: The `external_gte` version type is meant for special use cases and should be used with care.\nIf used incorrectly, it can result in loss of data.\n\n" schema: $ref: '#/components/schemas/_types.VersionType' - name: wait_for_active_shards in: query description: "The minimum number of shard copies that must be active before proceeding with the operation.\nYou can set it to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`).\nThe default value of `1` means it waits for each primary shard to be active." schema: allOf: - $ref: '#/components/schemas/_types.WaitForActiveShards' default: '1' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.WriteResponseBase' examples: DeleteResponseExample1: description: 'A successful response from `DELETE /my-index-000001/_doc/1`, which deletes the JSON document 1 from the `my-index-000001` index.' value: "{\n \"_shards\": {\n \"total\": 2,\n \"failed\": 0,\n \"successful\": 2\n },\n \"_index\": \"my-index-000001\",\n \"_id\": \"1\",\n \"_version\": 2,\n \"_primary_term\": 1,\n \"_seq_no\": 5,\n \"result\": \"deleted\"\n}" '404': description: "\nIf the index does exist, but the document does not,\nthe response is the same as the successful case, but with a 404." content: application/json: schema: oneOf: - $ref: '#/components/schemas/_types.WriteResponseBase' - $ref: '#/components/schemas/_types.ErrorResponseBase' x-state: Generally available x-codeSamples: - lang: Console source: "DELETE /my-index-000001/_doc/1\n" - lang: Python source: "resp = client.delete(\n index=\"my-index-000001\",\n id=\"1\",\n)" - lang: JavaScript source: "const response = await client.delete({\n index: \"my-index-000001\",\n id: 1,\n});" - lang: Ruby source: "response = client.delete(\n index: \"my-index-000001\",\n id: \"1\"\n)" - lang: PHP source: "$resp = $client->delete([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_doc/1"' - lang: C# source: "var response = await client\n .DeleteAsync(new DeleteRequest()\n {\n Id = \"1\",\n Index = \"my-index-000001\"\n });" - lang: Java source: "client.delete(d -> d\n .id(\"1\")\n .index(\"my-index-000001\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name head: tags: - document summary: Check a document description: "Verify that a document exists.\nFor example, check to see if a document with the `_id` 0 exists:\n\n```\nHEAD my-index-000001/_doc/0\n```\n\nIf the document exists, the API returns a status code of `200 - OK`.\nIf the document doesn’t exist, the API returns `404 - Not Found`.\n\n**Versioning support**\n\nYou can use the `version` parameter to check the document only if its current version is equal to the specified one.\n\nInternally, Elasticsearch has marked the old document as deleted and added an entirely new document.\nThe old version of the document doesn't disappear immediately, although you won't be able to access it.\nElasticsearch cleans up deleted documents in the background as you continue to index more data.\n\n## Required authorization\n\n* Index privileges: `read`\n" operationId: exists parameters: - name: index in: path description: "A comma-separated list of data streams, indices, and aliases.\nIt supports wildcards (`*`)." required: true schema: $ref: '#/components/schemas/_types.IndexName' - name: id in: path description: A unique document identifier. required: true schema: $ref: '#/components/schemas/_types.Id' - name: preference in: query description: "The node or shard the operation should be performed on.\nBy default, the operation is randomized between the shard replicas.\n\nIf it is set to `_local`, the operation will prefer to be run on a local allocated shard when possible.\nIf it is set to a custom value, the value is used to guarantee that the same shards will be used for the same custom value.\nThis can help with \"jumping values\" when hitting different shards in different refresh states.\nA sample value can be something like the web session ID or the user name." schema: type: string - name: realtime in: query description: 'If `true`, the request is real-time as opposed to near-real-time.' schema: type: boolean default: true - name: refresh in: query description: "If `true`, the request refreshes the relevant shards before retrieving the document.\nSetting it to `true` should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing)." schema: type: boolean default: false - name: routing in: query description: "A custom value used to route operations to a specific shard.\nNot allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead." schema: $ref: '#/components/schemas/_types.Routing' - name: _source in: query description: Indicates whether to return the `_source` field (`true` or `false`) or lists the fields to return. schema: $ref: '#/components/schemas/_global.search._types.SourceConfigParam' - name: _source_excludes in: query description: "A comma-separated list of source fields to exclude from the response.\nYou can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter.\nIf the `_source` parameter is `false`, this parameter is ignored." schema: $ref: '#/components/schemas/_types.Fields' - name: _source_includes in: query description: "A comma-separated list of source fields to include in the response.\nIf this parameter is specified, only these source fields are returned.\nYou can exclude fields from this subset using the `_source_excludes` query parameter.\nIf the `_source` parameter is `false`, this parameter is ignored." schema: $ref: '#/components/schemas/_types.Fields' - name: stored_fields in: query description: "A comma-separated list of stored fields to return as part of a hit.\nIf no fields are specified, no stored fields are included in the response.\nIf this field is specified, the `_source` parameter defaults to `false`." schema: $ref: '#/components/schemas/_types.Fields' - name: version in: query description: "Explicit version number for concurrency control.\nThe specified version must match the current version of the document for the request to succeed." schema: $ref: '#/components/schemas/_types.VersionNumber' - name: version_type in: query description: "The version type.\n\nSupported values include:\n - `internal`: Use internal versioning that starts at 1 and increments with each update or delete.\n - `external`: Only index the document if the specified version is strictly higher than the version of the stored document or if there is no existing document.\n - `external_gte`: Only index the document if the specified version is equal or higher than the version of the stored document or if there is no existing document.\nNOTE: The `external_gte` version type is meant for special use cases and should be used with care.\nIf used incorrectly, it can result in loss of data.\n\n" schema: $ref: '#/components/schemas/_types.VersionType' responses: '200': description: '' content: application/json: { } x-state: Generally available x-codeSamples: - lang: Console source: "HEAD my-index-000001/_doc/0\n" - lang: Python source: "resp = client.exists(\n index=\"my-index-000001\",\n id=\"0\",\n)" - lang: JavaScript source: "const response = await client.exists({\n index: \"my-index-000001\",\n id: 0,\n});" - lang: Ruby source: "response = client.exists(\n index: \"my-index-000001\",\n id: \"0\"\n)" - lang: PHP source: "$resp = $client->exists([\n \"index\" => \"my-index-000001\",\n \"id\" => \"0\",\n]);" - lang: curl source: 'curl --head -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_doc/0"' - lang: C# source: "var response = await client\n .ExistsAsync(new ExistsRequest()\n {\n Id = \"0\",\n Index = \"my-index-000001\"\n });" - lang: Java source: "client.exists(e -> e\n .id(\"0\")\n .index(\"my-index-000001\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_delete_by_query': post: tags: - document summary: Delete documents description: "Deletes documents that match the specified query.\n\nIf the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or alias:\n\n* `read`\n* `delete` or `write`\n\nYou can specify the query criteria in the request URI or the request body using the same syntax as the search API.\nWhen you submit a delete by query request, Elasticsearch gets a snapshot of the data stream or index when it begins processing the request and deletes matching documents using internal versioning.\nIf a document changes between the time that the snapshot is taken and the delete operation is processed, it results in a version conflict and the delete operation fails.\n\nNOTE: Documents with a version equal to 0 cannot be deleted using delete by query because internal versioning does not support 0 as a valid version number.\n\nWhile processing a delete by query request, Elasticsearch performs multiple search requests sequentially to find all of the matching documents to delete.\nA bulk delete request is performed for each batch of matching documents.\nIf a search or bulk request is rejected, the requests are retried up to 10 times, with exponential back off.\nIf the maximum retry limit is reached, processing halts and all failed requests are returned in the response.\nAny delete requests that completed successfully still stick, they are not rolled back.\n\nYou can opt to count version conflicts instead of halting and returning by setting `conflicts` to `proceed`.\nNote that if you opt to count version conflicts the operation could attempt to delete more documents from the source than `max_docs` until it has successfully deleted `max_docs documents`, or it has gone through every document in the source query.\n\n**Throttling delete requests**\n\nTo control the rate at which delete by query issues batches of delete operations, you can set `requests_per_second` to any positive decimal number.\nThis pads each batch with a wait time to throttle the rate.\nSet `requests_per_second` to `-1` to disable throttling.\n\nThrottling uses a wait time between batches so that the internal scroll requests can be given a timeout that takes the request padding into account.\nThe padding time is the difference between the batch size divided by the `requests_per_second` and the time spent writing.\nBy default the batch size is `1000`, so if `requests_per_second` is set to `500`:\n\n```\ntarget_time = 1000 / 500 per second = 2 seconds\nwait_time = target_time - write_time = 2 seconds - .5 seconds = 1.5 seconds\n```\n\nSince the batch is issued as a single `_bulk` request, large batch sizes cause Elasticsearch to create many requests and wait before starting the next set.\nThis is \"bursty\" instead of \"smooth\".\n\n**Slicing**\n\nDelete by query supports sliced scroll to parallelize the delete process.\nThis can improve efficiency and provide a convenient way to break the request down into smaller parts.\n\nSetting `slices` to `auto` lets Elasticsearch choose the number of slices to use.\nThis setting will use one slice per shard, up to a certain limit.\nIf there are multiple source data streams or indices, it will choose the number of slices based on the index or backing index with the smallest number of shards.\nAdding slices to the delete by query operation creates sub-requests which means it has some quirks:\n\n* You can see these requests in the tasks APIs. These sub-requests are \"child\" tasks of the task for the request with slices.\n* Fetching the status of the task for the request with slices only contains the status of completed slices.\n* These sub-requests are individually addressable for things like cancellation and rethrottling.\n* Rethrottling the request with `slices` will rethrottle the unfinished sub-request proportionally.\n* Canceling the request with `slices` will cancel each sub-request.\n* Due to the nature of `slices` each sub-request won't get a perfectly even portion of the documents. All documents will be addressed, but some slices may be larger than others. Expect larger slices to have a more even distribution.\n* Parameters like `requests_per_second` and `max_docs` on a request with `slices` are distributed proportionally to each sub-request. Combine that with the earlier point about distribution being uneven and you should conclude that using `max_docs` with `slices` might not result in exactly `max_docs` documents being deleted.\n* Each sub-request gets a slightly different snapshot of the source data stream or index though these are all taken at approximately the same time.\n\nIf you're slicing manually or otherwise tuning automatic slicing, keep in mind that:\n\n* Query performance is most efficient when the number of slices is equal to the number of shards in the index or backing index. If that number is large (for example, 500), choose a lower number as too many `slices` hurts performance. Setting `slices` higher than the number of shards generally does not improve efficiency and adds overhead.\n* Delete performance scales linearly across available resources with the number of slices.\n\nWhether query or delete performance dominates the runtime depends on the documents being reindexed and cluster resources.\n\n**Cancel a delete by query operation**\n\nAny delete by query can be canceled using the task cancel API. For example:\n\n```\nPOST _tasks/r1A2WoRbTwKZ516z6NEs5A:36619/_cancel\n```\n\nThe task ID can be found by using the get tasks API.\n\nCancellation should happen quickly but might take a few seconds.\nThe get task status API will continue to list the delete by query task until this task checks that it has been cancelled and terminates itself.\n\n## Required authorization\n\n* Index privileges: `read`,`delete`\n" operationId: delete-by-query parameters: - name: index in: path description: "A comma-separated list of data streams, indices, and aliases to search.\nIt supports wildcards (`*`).\nTo search all data streams or indices, omit this parameter or use `*` or `_all`." required: true schema: $ref: '#/components/schemas/_types.Indices' - name: allow_no_indices in: query description: "A setting that does two separate checks on the index expression.\nIf `false`, the request returns an error (1) if any wildcard expression\n(including `_all` and `*`) resolves to zero matching indices or (2) if the\ncomplete set of resolved indices, aliases or data streams is empty after all\nexpressions are evaluated. If `true`, index expressions that resolve to no\nindices are allowed and the request returns an empty result." schema: type: boolean default: true - name: analyzer in: query description: "Analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified." schema: type: string - name: analyze_wildcard in: query description: "If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified." schema: type: boolean default: false - name: conflicts in: query description: "What to do if delete by query hits version conflicts: `abort` or `proceed`.\n\nSupported values include:\n - `abort`: Stop reindexing if there are conflicts.\n - `proceed`: Continue reindexing even if there are conflicts.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.Conflicts' default: abort - name: default_operator in: query description: "The default operator for query string query: `and` or `or`.\nThis parameter can be used only when the `q` query string parameter is specified." schema: allOf: - $ref: '#/components/schemas/_types.query_dsl.Operator' default: or - name: df in: query description: "The field to use as default where no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified." schema: type: string - name: expand_wildcards in: query description: "The type of index that wildcard patterns can match.\nIf the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.\nIt supports comma-separated values, such as `open,hidden`.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: open - name: from in: query description: Skips the specified number of documents. schema: type: number default: 0 - name: ignore_unavailable in: query description: "If `false`, the request returns an error if it targets a concrete (non-wildcarded)\nindex, alias, or data stream that is missing, closed, or otherwise unavailable.\nIf `true`, unavailable concrete targets are silently ignored." schema: type: boolean default: false - name: lenient in: query description: "If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified." schema: type: boolean default: false - name: max_docs in: query description: "The maximum number of documents to process.\nDefaults to all documents.\nWhen set to a value less then or equal to `scroll_size`, a scroll will not be used to retrieve the results for the operation." schema: type: number - name: preference in: query description: "The node or shard the operation should be performed on.\nIt is random by default." schema: type: string - name: refresh in: query description: "If `true`, Elasticsearch refreshes all shards involved in the delete by query after the request completes.\nThis is different than the delete API's `refresh` parameter, which causes just the shard that received the delete request to be refreshed.\nUnlike the delete API, it does not support `wait_for`." schema: type: boolean default: false - name: request_cache in: query description: "If `true`, the request cache is used for this request.\nDefaults to the index-level setting." schema: type: boolean - name: requests_per_second in: query description: "The maximum number of documents to delete per second, across the entire delete-by-query operation (including slices).\nIt can be either `-1` to turn off throttling or any decimal number like `1.7` or `12` to throttle to that level." schema: type: number default: -1 - name: routing in: query description: "A custom value used to route operations to a specific shard.\nNot allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead." schema: $ref: '#/components/schemas/_types.Routing' x-state: Generally available - name: q in: query description: A query in the Lucene query string syntax. schema: type: string - name: scroll in: query description: The period to retain the search context for scrolling. schema: $ref: '#/components/schemas/_types.Duration' - name: scroll_size in: query description: The size of the scroll request that powers the operation. schema: type: number default: 1000 - name: search_timeout in: query description: "The explicit timeout for each search request.\nIt defaults to no timeout." schema: $ref: '#/components/schemas/_types.Duration' - name: search_type in: query description: "The type of the search operation.\nAvailable options include `query_then_fetch` and `dfs_query_then_fetch`.\n\nSupported values include:\n - `query_then_fetch`: Documents are scored using local term and document frequencies for the shard. This is usually faster but less accurate.\n - `dfs_query_then_fetch`: Documents are scored using global term and document frequencies across all shards. This is usually slower but more accurate.\n\n" schema: $ref: '#/components/schemas/_types.SearchType' - name: slices in: query description: The number of slices this task should be divided into. schema: allOf: - $ref: '#/components/schemas/_types.Slices' default: '1' - name: sort in: query description: A comma-separated list of `:` pairs. deprecated: true schema: type: array items: type: string - name: stats in: query description: The specific `tag` of the request for logging and statistical purposes. schema: type: array items: type: string - name: terminate_after in: query description: "The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nUse with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers." schema: type: number - name: timeout in: query description: The period each deletion request waits for active shards. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 1m - name: version in: query description: 'If `true`, returns the document version as part of a hit.' schema: type: boolean - name: wait_for_active_shards in: query description: "The number of shard copies that must be active before proceeding with the operation.\nSet to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`).\nThe `timeout` value controls how long each write request waits for unavailable shards to become available." schema: allOf: - $ref: '#/components/schemas/_types.WaitForActiveShards' default: '1' - name: wait_for_completion in: query description: "If `true`, the request blocks until the operation is complete.\nIf `false`, Elasticsearch performs some preflight checks, launches the request, and returns a task you can use to cancel or get the status of the task. Elasticsearch creates a record of this task as a document at `.tasks/task/${taskId}`. When you are done with a task, you should delete the task document so Elasticsearch can reclaim the space." schema: type: boolean default: true requestBody: content: application/json: schema: type: object properties: max_docs: type: number description: The maximum number of documents to delete. query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: The documents to delete specified with Query DSL. runtime_mappings: allOf: - $ref: '#/components/schemas/_types.mapping.RuntimeFields' description: "One or more runtime fields in the search request.\nThese fields take precedence over mapped fields with the same name." externalDocs: url: https://www.elastic.co/docs/manage-data/data-store/mapping/define-runtime-fields-in-search-request slice: allOf: - $ref: '#/components/schemas/_types.SlicedScroll' description: Slice the request manually using the provided slice ID and total number of slices. sort: allOf: - $ref: '#/components/schemas/_types.Sort' description: A sort object that specifies the order of deleted documents. examples: DeleteByQueryRequestExample1: summary: Delete all documents description: 'Run `POST /my-index-000001,my-index-000002/_delete_by_query` to delete all documents from multiple data streams or indices.' value: "{\n \"query\": {\n \"match_all\": {}\n }\n}" x-codeSamples: - lang: Console source: "POST /my-index-000001,my-index-000002/_delete_by_query\n{\n \"query\": {\n \"match_all\": {}\n }\n}" - lang: Python source: "resp = client.delete_by_query(\n index=\"my-index-000001,my-index-000002\",\n query={\n \"match_all\": {}\n },\n)" - lang: JavaScript source: "const response = await client.deleteByQuery({\n index: \"my-index-000001,my-index-000002\",\n query: {\n match_all: {},\n },\n});" - lang: Ruby source: "response = client.delete_by_query(\n index: \"my-index-000001,my-index-000002\",\n body: {\n \"query\": {\n \"match_all\": {}\n }\n }\n)" - lang: PHP source: "$resp = $client->deleteByQuery([\n \"index\" => \"my-index-000001,my-index-000002\",\n \"body\" => [\n \"query\" => [\n \"match_all\" => new ArrayObject([]),\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":{"match_all":{}}}'' "$ELASTICSEARCH_URL/my-index-000001,my-index-000002/_delete_by_query"' - lang: C# source: "var response = await client\n .DeleteByQueryAsync(new DeleteByQueryRequest()\n {\n Indices = new[] { \"my-index-000001\", \"my-index-000002\" },\n Query = new Query()\n {\n MatchAll = new()\n }\n });" - lang: Java source: "client.deleteByQuery(d -> d\n .index(List.of(\"my-index-000001\",\"my-index-000002\"))\n .query(q -> q\n .matchAll(m -> m)\n )\n);\n" DeleteByQueryRequestExample2: summary: Delete a single document description: Run `POST my-index-000001/_delete_by_query` to delete a document by using a unique attribute. value: "{\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n \"max_docs\": 1\n}" x-codeSamples: - lang: Console source: "POST my-index-000001/_delete_by_query\n{\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n \"max_docs\": 1\n}" - lang: Python source: "resp = client.delete_by_query(\n index=\"my-index-000001\",\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n max_docs=1,\n)" - lang: JavaScript source: "const response = await client.deleteByQuery({\n index: \"my-index-000001\",\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n max_docs: 1,\n});" - lang: Ruby source: "response = client.delete_by_query(\n index: \"my-index-000001\",\n body: {\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n \"max_docs\": 1\n }\n)" - lang: PHP source: "$resp = $client->deleteByQuery([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n \"max_docs\" => 1,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":{"term":{"user.id":"kimchy"}},"max_docs":1}'' "$ELASTICSEARCH_URL/my-index-000001/_delete_by_query"' - lang: C# source: "var response = await client\n .DeleteByQueryAsync(new DeleteByQueryRequest()\n {\n Indices = new[] { \"my-index-000001\" },\n MaxDocs = 1L,\n Query = new Query()\n {\n Term = new()\n {\n Field = global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.User.Id),\n Value = \"kimchy\"\n }\n }\n });" - lang: Java source: "client.deleteByQuery(d -> d\n .index(\"my-index-000001\")\n .maxDocs(1L)\n .query(q -> q\n .term(t -> t\n .field(\"user.id\")\n .value(FieldValue.of(\"kimchy\"))\n )\n )\n);\n" DeleteByQueryRequestExample3: summary: Slice manually description: "Run `POST my-index-000001/_delete_by_query` to slice a delete by query manually. Provide a slice ID and total number of slices.\n" value: "{\n \"slice\": {\n \"id\": 0,\n \"max\": 2\n },\n \"query\": {\n \"range\": {\n \"http.response.bytes\": {\n \"lt\": 2000000\n }\n }\n }\n}" x-codeSamples: - lang: Console source: "POST my-index-000001/_delete_by_query\n{\n \"slice\": {\n \"id\": 0,\n \"max\": 2\n },\n \"query\": {\n \"range\": {\n \"http.response.bytes\": {\n \"lt\": 2000000\n }\n }\n }\n}" - lang: Python source: "resp = client.delete_by_query(\n index=\"my-index-000001\",\n slice={\n \"id\": 0,\n \"max\": 2\n },\n query={\n \"range\": {\n \"http.response.bytes\": {\n \"lt\": 2000000\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.deleteByQuery({\n index: \"my-index-000001\",\n slice: {\n id: 0,\n max: 2,\n },\n query: {\n range: {\n \"http.response.bytes\": {\n lt: 2000000,\n },\n },\n },\n});" - lang: Ruby source: "response = client.delete_by_query(\n index: \"my-index-000001\",\n body: {\n \"slice\": {\n \"id\": 0,\n \"max\": 2\n },\n \"query\": {\n \"range\": {\n \"http.response.bytes\": {\n \"lt\": 2000000\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->deleteByQuery([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"slice\" => [\n \"id\" => 0,\n \"max\" => 2,\n ],\n \"query\" => [\n \"range\" => [\n \"http.response.bytes\" => [\n \"lt\" => 2000000,\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"slice":{"id":0,"max":2},"query":{"range":{"http.response.bytes":{"lt":2000000}}}}'' "$ELASTICSEARCH_URL/my-index-000001/_delete_by_query"' - lang: C# source: "var response = await client\n .DeleteByQueryAsync(new DeleteByQueryRequest()\n {\n Indices = new[] { \"my-index-000001\" },\n Query = new Query()\n {\n Range = new UntypedRangeQuery()\n {\n Field = global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.Http.Response.Bytes),\n Lt = 2000000\n }\n },\n Slice = new()\n {\n Id = 0L,\n Max = 2\n }\n });" - lang: Java source: "client.deleteByQuery(d -> d\n .index(\"my-index-000001\")\n .query(q -> q\n .range(r -> r\n .untyped(u -> u\n .field(\"http.response.bytes\")\n .lt(JsonData.fromJson(\"2000000\"))\n )\n )\n )\n .slice(s -> s\n .id(\"0\")\n .max(2)\n )\n);\n" DeleteByQueryRequestExample4: summary: Automatic slicing description: "Run `POST my-index-000001/_delete_by_query?refresh&slices=5` to let delete by query automatically parallelize using sliced scroll to slice on `_id`. The `slices` query parameter value specifies the number of slices to use.\n" value: "{\n \"query\": {\n \"range\": {\n \"http.response.bytes\": {\n \"lt\": 2000000\n }\n }\n }\n}" x-codeSamples: - lang: Console source: "POST my-index-000001/_delete_by_query?refresh&slices=5\n{\n \"query\": {\n \"range\": {\n \"http.response.bytes\": {\n \"lt\": 2000000\n }\n }\n }\n}" - lang: Python source: "resp = client.delete_by_query(\n index=\"my-index-000001\",\n refresh=True,\n slices=\"5\",\n query={\n \"range\": {\n \"http.response.bytes\": {\n \"lt\": 2000000\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.deleteByQuery({\n index: \"my-index-000001\",\n refresh: \"true\",\n slices: 5,\n query: {\n range: {\n \"http.response.bytes\": {\n lt: 2000000,\n },\n },\n },\n});" - lang: Ruby source: "response = client.delete_by_query(\n index: \"my-index-000001\",\n refresh: \"true\",\n slices: \"5\",\n body: {\n \"query\": {\n \"range\": {\n \"http.response.bytes\": {\n \"lt\": 2000000\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->deleteByQuery([\n \"index\" => \"my-index-000001\",\n \"refresh\" => \"true\",\n \"slices\" => \"5\",\n \"body\" => [\n \"query\" => [\n \"range\" => [\n \"http.response.bytes\" => [\n \"lt\" => 2000000,\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":{"range":{"http.response.bytes":{"lt":2000000}}}}'' "$ELASTICSEARCH_URL/my-index-000001/_delete_by_query?refresh&slices=5"' - lang: C# source: "var response = await client\n .DeleteByQueryAsync(new DeleteByQueryRequest()\n {\n Indices = new[] { \"my-index-000001\" },\n Refresh = true,\n Slices = new Slices(5),\n Query = new Query()\n {\n Range = new UntypedRangeQuery()\n {\n Field = global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.Http.Response.Bytes),\n Lt = 2000000\n }\n }\n });" - lang: Java source: "client.deleteByQuery(d -> d\n .index(\"my-index-000001\")\n .query(q -> q\n .range(r -> r\n .untyped(u -> u\n .field(\"http.response.bytes\")\n .lt(JsonData.fromJson(\"2000000\"))\n )\n )\n )\n .refresh(true)\n .slices(s -> s\n .value(5)\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: type: object properties: batches: type: number description: The number of scroll responses pulled back by the delete by query. deleted: type: number description: The number of documents that were successfully deleted. failures: type: array items: $ref: '#/components/schemas/_types.BulkByPaginatedSearchFailure' description: "An array of failures if there were any unrecoverable errors during the process.\nIf this array is not empty, the request ended abnormally because of those failures.\nDelete by query is implemented using batches and any failures cause the entire process to end but all failures in the current batch are collected into the array.\nYou can use the `conflicts` option to prevent reindex from ending on version conflicts." noops: type: number description: "This field is always equal to zero for delete by query.\nIt exists only so that delete by query, update by query, and reindex APIs return responses with the same structure." requests_per_second: type: number description: The number of requests per second effectively run during the delete by query. retries: allOf: - $ref: '#/components/schemas/_types.Retries' description: "The number of retries attempted by delete by query.\n`bulk` is the number of bulk actions retried.\n`search` is the number of search actions retried." slice_id: type: number slices: type: array items: $ref: '#/components/schemas/_types.ReindexStatus' description: Status of each slice if the delete by query was sliced task: allOf: - $ref: '#/components/schemas/_types.TaskId' throttled: allOf: - $ref: '#/components/schemas/_types.Duration' throttled_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: The number of milliseconds the request slept to conform to `requests_per_second`. throttled_until: allOf: - $ref: '#/components/schemas/_types.Duration' throttled_until_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: "This field should always be equal to zero in a `_delete_by_query` response.\nIt has meaning only when using the task API, where it indicates the next time (in milliseconds since epoch) a throttled request will be run again in order to conform to `requests_per_second`." timed_out: type: boolean description: 'If `true`, some requests run during the delete by query operation timed out.' took: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: The number of milliseconds from start to end of the whole operation. total: type: number description: The number of documents that were successfully processed. version_conflicts: type: number description: The number of version conflicts that the delete by query hit. examples: DeleteByQueryResponseExample1: description: A successful response from `POST /my-index-000001/_delete_by_query`. value: "{\n \"took\" : 147,\n \"timed_out\": false,\n \"total\": 119,\n \"deleted\": 119,\n \"batches\": 1,\n \"version_conflicts\": 0,\n \"noops\": 0,\n \"retries\": {\n \"bulk\": 0,\n \"search\": 0\n },\n \"throttled_millis\": 0,\n \"requests_per_second\": -1.0,\n \"throttled_until_millis\": 0,\n \"failures\" : [ ]\n}" x-state: Generally available; Added in 5.0.0 x-codeSamples: - lang: Console source: "POST /my-index-000001,my-index-000002/_delete_by_query\n{\n \"query\": {\n \"match_all\": {}\n }\n}" - lang: Python source: "resp = client.delete_by_query(\n index=\"my-index-000001,my-index-000002\",\n query={\n \"match_all\": {}\n },\n)" - lang: JavaScript source: "const response = await client.deleteByQuery({\n index: \"my-index-000001,my-index-000002\",\n query: {\n match_all: {},\n },\n});" - lang: Ruby source: "response = client.delete_by_query(\n index: \"my-index-000001,my-index-000002\",\n body: {\n \"query\": {\n \"match_all\": {}\n }\n }\n)" - lang: PHP source: "$resp = $client->deleteByQuery([\n \"index\" => \"my-index-000001,my-index-000002\",\n \"body\" => [\n \"query\" => [\n \"match_all\" => new ArrayObject([]),\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":{"match_all":{}}}'' "$ELASTICSEARCH_URL/my-index-000001,my-index-000002/_delete_by_query"' - lang: C# source: "var response = await client\n .DeleteByQueryAsync(new DeleteByQueryRequest()\n {\n Indices = new[] { \"my-index-000001\", \"my-index-000002\" },\n Query = new Query()\n {\n MatchAll = new()\n }\n });" - lang: Java source: "client.deleteByQuery(d -> d\n .index(List.of(\"my-index-000001\",\"my-index-000002\"))\n .query(q -> q\n .matchAll(m -> m)\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_delete_by_query/{task_id}/_rethrottle': post: tags: - document summary: Throttle a delete by query operation description: "Change the number of requests per second for a particular delete by query operation.\nRethrottling that speeds up the query takes effect immediately but rethrotting that slows down the query takes effect after completing the current batch to prevent scroll timeouts.\n\n## Required authorization\n\n* Cluster privileges: `manage_reindex`\n" operationId: delete-by-query-rethrottle parameters: - name: task_id in: path description: The ID for the task. required: true schema: $ref: '#/components/schemas/_types.TaskId' - name: requests_per_second in: query description: "The maximum number of documents to delete per second, across the entire delete-by-query operation (including slices).\nIt can be either `-1` to turn off throttling or any decimal number like `1.7` or `12` to throttle to that level." required: true schema: type: number responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/tasks._types.TaskListResponseBase' x-state: Generally available; Added in 6.5.0 x-codeSamples: - lang: Console source: "POST _delete_by_query/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1\n" - lang: Python source: "resp = client.delete_by_query_rethrottle(\n task_id=\"r1A2WoRbTwKZ516z6NEs5A:36619\",\n requests_per_second=\"-1\",\n)" - lang: JavaScript source: "const response = await client.deleteByQueryRethrottle({\n task_id: \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n requests_per_second: \"-1\",\n});" - lang: Ruby source: "response = client.delete_by_query_rethrottle(\n task_id: \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n requests_per_second: \"-1\"\n)" - lang: PHP source: "$resp = $client->deleteByQueryRethrottle([\n \"task_id\" => \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n \"requests_per_second\" => \"-1\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_delete_by_query/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1"' - lang: C# source: "var response = await client\n .DeleteByQueryRethrottleAsync(taskId: \"r1A2WoRbTwKZ516z6NEs5A:36619\", d1 => d1\n .RequestsPerSecond(-1f)\n );" - lang: Java source: "client.deleteByQueryRethrottle(d -> d\n .requestsPerSecond(-1.0F)\n .taskId(\"r1A2WoRbTwKZ516z6NEs5A:36619\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_scripts/{id}': get: tags: - script summary: Get a script or search template description: "Retrieves a stored script or search template.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: get-script parameters: - name: id in: path description: The identifier for the stored script or search template. required: true schema: $ref: '#/components/schemas/_types.Id' - name: master_timeout in: query description: "The period to wait for the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nIt can also be set to `-1` to indicate that the request should never timeout." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - _id - found type: object properties: _id: allOf: - $ref: '#/components/schemas/_types.Id' found: type: boolean script: allOf: - $ref: '#/components/schemas/_types.StoredScript' x-state: Generally available x-codeSamples: - lang: Console source: "GET _scripts/my-search-template\n" - lang: Python source: "resp = client.get_script(\n id=\"my-search-template\",\n)" - lang: JavaScript source: "const response = await client.getScript({\n id: \"my-search-template\",\n});" - lang: Ruby source: "response = client.get_script(\n id: \"my-search-template\"\n)" - lang: PHP source: "$resp = $client->getScript([\n \"id\" => \"my-search-template\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_scripts/my-search-template"' - lang: C# source: 'var response = await client.GetScriptAsync(id: "my-search-template");' - lang: Java source: "client.getScript(g -> g\n .id(\"my-search-template\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - script summary: Delete a script or search template description: "Deletes a stored script or search template.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: delete-script parameters: - name: id in: path description: The identifier for the stored script or search template. required: true schema: $ref: '#/components/schemas/_types.Id' - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error.\nIt can also be set to `-1` to indicate that the request should never timeout." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "The period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error.\nIt can also be set to `-1` to indicate that the request should never timeout." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available x-codeSamples: - lang: Console source: "DELETE _scripts/my-search-template\n" - lang: Python source: "resp = client.delete_script(\n id=\"my-search-template\",\n)" - lang: JavaScript source: "const response = await client.deleteScript({\n id: \"my-search-template\",\n});" - lang: Ruby source: "response = client.delete_script(\n id: \"my-search-template\"\n)" - lang: PHP source: "$resp = $client->deleteScript([\n \"id\" => \"my-search-template\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_scripts/my-search-template"' - lang: C# source: 'var response = await client.DeleteScriptAsync(id: "my-search-template");' - lang: Java source: "client.deleteScript(d -> d\n .id(\"my-search-template\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_encryption/_reset: post: tags: - security summary: Reset the project encryption key description: "Destroy the current project encryption key (PEK) and generate a new one.\nThis is the recovery path for when the on-disk encrypted PEK becomes permanently\ninaccessible, for example because the key encryption material protecting it was lost.\n\nAll data that was encrypted under the destroyed key becomes permanently unrecoverable.\nEach feature that stores encrypted data decides how to handle its own data during the\nreset: some features drop the encrypted values entirely, while others preserve the rest\nof the affected data and only clear the values that can no longer be decrypted.\n\nBecause this operation causes permanent data loss, it requires the `accept_data_loss`\nquery parameter to be set to `true`." operationId: encryption-reset parameters: - name: accept_data_loss in: query description: "Acknowledge that resetting the project encryption key permanently destroys all data\nthat was encrypted under the current key.\nThe request fails if this is not set to `true`." required: true schema: type: boolean - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "The period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: EncryptionResetResponseExample1: summary: Reset the project encryption key description: "A successful response from `POST /_encryption/_reset?accept_data_loss=true`.\n" value: "{\n \"acknowledged\": true\n}" x-state: Experimental; Added in 9.5.0 x-codeSamples: - lang: Console source: "POST /_encryption/_reset?accept_data_loss=true\n" - lang: Python source: "resp = client.encryption.reset(\n accept_data_loss=True,\n)" - lang: JavaScript source: "const response = await client.encryption.reset({\n accept_data_loss: \"true\",\n});" - lang: Ruby source: "response = client.encryption.reset(\n accept_data_loss: \"true\"\n)" - lang: PHP source: "$resp = $client->encryption()->reset([\n \"accept_data_loss\" => \"true\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_encryption/_reset?accept_data_loss=true"' - lang: C# source: "var response = await client.Encryption\n .ResetAsync(d1 => d1\n .AcceptDataLoss(true)\n );" - lang: Java source: "client.encryption().reset(r -> r\n .acceptDataLoss(true)\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_enrich/policy/{name}': get: tags: - enrich summary: "Get an enrich policy\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_enrich/policy\n
\n
\n GET\n /_enrich/policy/{name}\n
\n \n\nReturns information about an enrich policy.\n\n## Required authorization\n\n* Cluster privileges: `monitor_enrich`,`manage_enrich`\n" operationId: enrich-get-policy parameters: - $ref: '#/components/parameters/enrich.get_policy-name' - $ref: '#/components/parameters/enrich.get_policy-master_timeout' responses: '200': $ref: '#/components/responses/enrich.get_policy-200' x-state: Generally available; Added in 7.5.0 x-codeSamples: - lang: Console source: "GET /_enrich/policy/my-policy\n" - lang: Python source: "resp = client.enrich.get_policy(\n name=\"my-policy\",\n)" - lang: JavaScript source: "const response = await client.enrich.getPolicy({\n name: \"my-policy\",\n});" - lang: Ruby source: "response = client.enrich.get_policy(\n name: \"my-policy\"\n)" - lang: PHP source: "$resp = $client->enrich()->getPolicy([\n \"name\" => \"my-policy\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_enrich/policy/my-policy"' - lang: C# source: "var response = await client.Enrich\n .GetPolicyAsync(d1 => d1\n .Name(new[] { \"my-policy\" })\n );" - lang: Java source: "client.enrich().getPolicy(g -> g\n .name(\"my-policy\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - enrich summary: Create an enrich policy description: "Creates an enrich policy.\n\n## Required authorization\n\n* Cluster privileges: `manage_enrich`\n" operationId: enrich-put-policy parameters: - name: name in: path description: Name of the enrich policy to create or update. required: true schema: $ref: '#/components/schemas/_types.Name' - name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: type: object properties: geo_match: allOf: - $ref: '#/components/schemas/enrich._types.Policy' description: Matches enrich data to incoming documents based on a `geo_shape` query. match: allOf: - $ref: '#/components/schemas/enrich._types.Policy' description: Matches enrich data to incoming documents based on a `term` query. range: allOf: - $ref: '#/components/schemas/enrich._types.Policy' description: 'Matches a number, date, or IP address in incoming documents to a range in the enrich index based on a `term` query.' examples: EnrichPutPolicyExample1: description: An example body for a `PUT /_enrich/policy/postal_policy` request. value: "{\n \"geo_match\": {\n \"indices\": \"postal_codes\",\n \"match_field\": \"location\",\n \"enrich_fields\": [ \"location\", \"postal_code\" ]\n }\n}" x-codeSamples: - lang: Console source: "PUT /_enrich/policy/postal_policy\n{\n \"geo_match\": {\n \"indices\": \"postal_codes\",\n \"match_field\": \"location\",\n \"enrich_fields\": [ \"location\", \"postal_code\" ]\n }\n}" - lang: Python source: "resp = client.enrich.put_policy(\n name=\"postal_policy\",\n geo_match={\n \"indices\": \"postal_codes\",\n \"match_field\": \"location\",\n \"enrich_fields\": [\n \"location\",\n \"postal_code\"\n ]\n },\n)" - lang: JavaScript source: "const response = await client.enrich.putPolicy({\n name: \"postal_policy\",\n geo_match: {\n indices: \"postal_codes\",\n match_field: \"location\",\n enrich_fields: [\"location\", \"postal_code\"],\n },\n});" - lang: Ruby source: "response = client.enrich.put_policy(\n name: \"postal_policy\",\n body: {\n \"geo_match\": {\n \"indices\": \"postal_codes\",\n \"match_field\": \"location\",\n \"enrich_fields\": [\n \"location\",\n \"postal_code\"\n ]\n }\n }\n)" - lang: PHP source: "$resp = $client->enrich()->putPolicy([\n \"name\" => \"postal_policy\",\n \"body\" => [\n \"geo_match\" => [\n \"indices\" => \"postal_codes\",\n \"match_field\" => \"location\",\n \"enrich_fields\" => array(\n \"location\",\n \"postal_code\",\n ),\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"geo_match":{"indices":"postal_codes","match_field":"location","enrich_fields":["location","postal_code"]}}'' "$ELASTICSEARCH_URL/_enrich/policy/postal_policy"' - lang: C# source: "var response = await client.Enrich\n .PutPolicyAsync(name: \"postal_policy\", d1 => d1\n .GeoMatch(d2 => d2\n .EnrichFields(x => x.Location, x => x.PostalCode)\n .Indices(new[] { \"postal_codes\" })\n .MatchField(x => x.Location)\n )\n );" - lang: Java source: "client.enrich().putPolicy(p -> p\n .geoMatch(g -> g\n .enrichFields(List.of(\"location\",\"postal_code\"))\n .indices(\"postal_codes\")\n .matchField(\"location\")\n )\n .name(\"postal_policy\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 7.5.0 x-codeSamples: - lang: Console source: "PUT /_enrich/policy/postal_policy\n{\n \"geo_match\": {\n \"indices\": \"postal_codes\",\n \"match_field\": \"location\",\n \"enrich_fields\": [ \"location\", \"postal_code\" ]\n }\n}" - lang: Python source: "resp = client.enrich.put_policy(\n name=\"postal_policy\",\n geo_match={\n \"indices\": \"postal_codes\",\n \"match_field\": \"location\",\n \"enrich_fields\": [\n \"location\",\n \"postal_code\"\n ]\n },\n)" - lang: JavaScript source: "const response = await client.enrich.putPolicy({\n name: \"postal_policy\",\n geo_match: {\n indices: \"postal_codes\",\n match_field: \"location\",\n enrich_fields: [\"location\", \"postal_code\"],\n },\n});" - lang: Ruby source: "response = client.enrich.put_policy(\n name: \"postal_policy\",\n body: {\n \"geo_match\": {\n \"indices\": \"postal_codes\",\n \"match_field\": \"location\",\n \"enrich_fields\": [\n \"location\",\n \"postal_code\"\n ]\n }\n }\n)" - lang: PHP source: "$resp = $client->enrich()->putPolicy([\n \"name\" => \"postal_policy\",\n \"body\" => [\n \"geo_match\" => [\n \"indices\" => \"postal_codes\",\n \"match_field\" => \"location\",\n \"enrich_fields\" => array(\n \"location\",\n \"postal_code\",\n ),\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"geo_match":{"indices":"postal_codes","match_field":"location","enrich_fields":["location","postal_code"]}}'' "$ELASTICSEARCH_URL/_enrich/policy/postal_policy"' - lang: C# source: "var response = await client.Enrich\n .PutPolicyAsync(name: \"postal_policy\", d1 => d1\n .GeoMatch(d2 => d2\n .EnrichFields(x => x.Location, x => x.PostalCode)\n .Indices(new[] { \"postal_codes\" })\n .MatchField(x => x.Location)\n )\n );" - lang: Java source: "client.enrich().putPolicy(p -> p\n .geoMatch(g -> g\n .enrichFields(List.of(\"location\",\"postal_code\"))\n .indices(\"postal_codes\")\n .matchField(\"location\")\n )\n .name(\"postal_policy\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - enrich summary: Delete an enrich policy description: "Deletes an existing enrich policy and its enrich index.\n\n## Required authorization\n\n* Cluster privileges: `manage_enrich`\n" operationId: enrich-delete-policy parameters: - name: name in: path description: Enrich policy to delete. required: true schema: $ref: '#/components/schemas/_types.Name' - name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 7.5.0 x-codeSamples: - lang: Console source: "DELETE /_enrich/policy/my-policy\n" - lang: Python source: "resp = client.enrich.delete_policy(\n name=\"my-policy\",\n)" - lang: JavaScript source: "const response = await client.enrich.deletePolicy({\n name: \"my-policy\",\n});" - lang: Ruby source: "response = client.enrich.delete_policy(\n name: \"my-policy\"\n)" - lang: PHP source: "$resp = $client->enrich()->deletePolicy([\n \"name\" => \"my-policy\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_enrich/policy/my-policy"' - lang: C# source: 'var response = await client.Enrich.DeletePolicyAsync(name: "my-policy");' - lang: Java source: "client.enrich().deletePolicy(d -> d\n .name(\"my-policy\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_enrich/policy/{name}/_execute': put: tags: - enrich summary: Run an enrich policy description: "Create the enrich index for an existing enrich policy.\n\n## Required authorization\n\n* Cluster privileges: `manage_enrich`\n" operationId: enrich-execute-policy parameters: - name: name in: path description: Enrich policy to execute. required: true schema: $ref: '#/components/schemas/_types.Name' - name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: wait_for_completion in: query description: 'If `true`, the request blocks other enrich policy execution requests until complete.' schema: type: boolean default: true responses: '200': description: '' content: application/json: schema: type: object properties: status: allOf: - $ref: '#/components/schemas/enrich.execute_policy.ExecuteEnrichPolicyStatus' task: allOf: - $ref: '#/components/schemas/_types.TaskId' x-state: Generally available; Added in 7.5.0 x-codeSamples: - lang: Console source: "PUT /_enrich/policy/my-policy/_execute?wait_for_completion=false\n" - lang: Python source: "resp = client.enrich.execute_policy(\n name=\"my-policy\",\n wait_for_completion=False,\n)" - lang: JavaScript source: "const response = await client.enrich.executePolicy({\n name: \"my-policy\",\n wait_for_completion: \"false\",\n});" - lang: Ruby source: "response = client.enrich.execute_policy(\n name: \"my-policy\",\n wait_for_completion: \"false\"\n)" - lang: PHP source: "$resp = $client->enrich()->executePolicy([\n \"name\" => \"my-policy\",\n \"wait_for_completion\" => \"false\",\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_enrich/policy/my-policy/_execute?wait_for_completion=false"' - lang: C# source: "var response = await client.Enrich\n .ExecutePolicyAsync(name: \"my-policy\", d1 => d1\n .WaitForCompletion(false)\n );" - lang: Java source: "client.enrich().executePolicy(e -> e\n .name(\"my-policy\")\n .waitForCompletion(false)\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_enrich/_stats: get: tags: - enrich summary: Get enrich stats description: "Returns enrich coordinator statistics and information about enrich policies that are currently executing.\n\n## Required authorization\n\n* Cluster privileges: `monitor`,`monitor_enrich`,`manage_enrich`\n" operationId: enrich-stats parameters: - name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - coordinator_stats - executing_policies type: object properties: coordinator_stats: type: array items: $ref: '#/components/schemas/enrich.stats.CoordinatorStats' description: Objects containing information about each coordinating ingest node for configured enrich processors. executing_policies: type: array items: $ref: '#/components/schemas/enrich.stats.ExecutingPolicy' description: Objects containing information about each enrich policy that is currently executing. cache_stats: type: array items: $ref: '#/components/schemas/enrich.stats.CacheStats' description: Objects containing information about the enrich cache stats on each ingest node. x-state: Generally available; Added in 7.16.0 x-state: Generally available; Added in 7.5.0 x-codeSamples: - lang: Console source: "GET /_enrich/_stats\n" - lang: Python source: resp = client.enrich.stats() - lang: JavaScript source: const response = await client.enrich.stats(); - lang: Ruby source: response = client.enrich.stats - lang: PHP source: $resp = $client->enrich()->stats(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_enrich/_stats"' - lang: C# source: var response = await client.Enrich.StatsAsync(); - lang: Java source: "client.enrich().stats(s -> s);\n" x-metaTags: - content: Elasticsearch name: product_name '/_eql/search/{id}': get: tags: - eql summary: Get async EQL search results description: Get the current status and available results for an async EQL search or a stored synchronous EQL search. operationId: eql-get parameters: - name: id in: path description: Identifier for the search. required: true schema: $ref: '#/components/schemas/_types.Id' - name: keep_alive in: query description: "Period for which the search and its results are stored on the cluster.\nDefaults to the keep_alive value set by the search’s EQL search API request." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 5d - name: wait_for_completion_timeout in: query description: "Timeout duration to wait for the request to finish.\nDefaults to no timeout, meaning the request waits for complete search results." schema: $ref: '#/components/schemas/_types.Duration' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/eql._types.EqlSearchResponseBase' x-state: Generally available; Added in 7.9.0 x-codeSamples: - lang: Console source: "GET /_eql/search/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=?wait_for_completion_timeout=2s\n" - lang: Python source: "resp = client.eql.get(\n id=\"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n wait_for_completion_timeout=\"2s\",\n)" - lang: JavaScript source: "const response = await client.eql.get({\n id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n wait_for_completion_timeout: \"2s\",\n});" - lang: Ruby source: "response = client.eql.get(\n id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n wait_for_completion_timeout: \"2s\"\n)" - lang: PHP source: "$resp = $client->eql()->get([\n \"id\" => \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n \"wait_for_completion_timeout\" => \"2s\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_eql/search/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=?wait_for_completion_timeout=2s"' - lang: C# source: "var response = await client.Eql\n .GetAsync(id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\", d1 => d1\n .WaitForCompletionTimeout(\"2s\")\n );" - lang: Java source: "client.eql().get(g -> g\n .id(\"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\")\n .waitForCompletionTimeout(w -> w\n .time(\"2s\")\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - eql summary: Delete an async EQL search description: "Delete an async EQL search or a stored synchronous EQL search.\nThe API also deletes results for the search.\n\n## Required authorization\n\n* Cluster privileges: `cancel_task`\n" operationId: eql-delete parameters: - name: id in: path description: "Identifier for the search to delete.\nA search ID is provided in the EQL search API's response for an async search.\nA search ID is also provided if the request’s `keep_on_completion` parameter is `true`." required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 7.9.0 x-codeSamples: - lang: Console source: "DELETE /_eql/search/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\n" - lang: Python source: "resp = client.eql.delete(\n id=\"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n)" - lang: JavaScript source: "const response = await client.eql.delete({\n id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n});" - lang: Ruby source: "response = client.eql.delete(\n id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\"\n)" - lang: PHP source: "$resp = $client->eql()->delete([\n \"id\" => \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_eql/search/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE="' - lang: C# source: 'var response = await client.Eql.DeleteAsync(id: "FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=");' - lang: Java source: "client.eql().delete(d -> d\n .id(\"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_eql/search/status/{id}': get: tags: - eql summary: Get the async EQL status description: "Get the current status for an async EQL search or a stored synchronous EQL search without returning results.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: eql-get-status parameters: - name: id in: path description: Identifier for the search. required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: required: - id - is_partial - is_running type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: Identifier for the search. is_partial: type: boolean description: 'If true, the search request is still executing. If false, the search is completed.' is_running: type: boolean description: 'If true, the response does not contain complete search results. This could be because either the search is still running (is_running status is false), or because it is already completed (is_running status is true) and results are partial due to failures or timeouts.' start_time_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: 'For a running search shows a timestamp when the eql search started, in milliseconds since the Unix epoch.' expiration_time_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: 'Shows a timestamp when the eql search will be expired, in milliseconds since the Unix epoch. When this time is reached, the search and its results are deleted, even if the search is still ongoing.' completion_status: type: number description: For a completed search shows the http status code of the completed search. examples: EqlGetStatusResponseExample1: description: A successful response for getting status information for an async EQL search. value: "{\n \"id\": \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n \"is_running\" : true,\n \"is_partial\" : true,\n \"start_time_in_millis\" : 1611690235000,\n \"expiration_time_in_millis\" : 1611690295000\n}" x-state: Generally available; Added in 7.9.0 x-codeSamples: - lang: Console source: "GET /_eql/search/status/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\n" - lang: Python source: "resp = client.eql.get_status(\n id=\"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n)" - lang: JavaScript source: "const response = await client.eql.getStatus({\n id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n});" - lang: Ruby source: "response = client.eql.get_status(\n id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\"\n)" - lang: PHP source: "$resp = $client->eql()->getStatus([\n \"id\" => \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_eql/search/status/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE="' - lang: C# source: 'var response = await client.Eql.GetStatusAsync(id: "FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=");' - lang: Java source: "client.eql().getStatus(g -> g\n .id(\"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_eql/search': post: tags: - eql summary: "Get EQL search results\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /{index}/_eql/search\n
\n
\n POST\n /{index}/_eql/search\n
\n \n\nReturns search results for an Event Query Language (EQL) query.\nEQL assumes each document in a data stream or index corresponds to an event.\n\n## Required authorization\n\n* Index privileges: `read`\n" externalDocs: description: Learn more about EQL url: https://www.elastic.co/docs/explore-analyze/query-filter/languages/eql x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/eql-search-api.html operationId: eql-search parameters: - $ref: '#/components/parameters/eql.search-index' - $ref: '#/components/parameters/eql.search-allow_no_indices' - $ref: '#/components/parameters/eql.search-allow_partial_search_results' - $ref: '#/components/parameters/eql.search-allow_partial_sequence_results' - $ref: '#/components/parameters/eql.search-expand_wildcards' - $ref: '#/components/parameters/eql.search-ccs_minimize_roundtrips' - $ref: '#/components/parameters/eql.search-ignore_unavailable' - $ref: '#/components/parameters/eql.search-keep_alive' - $ref: '#/components/parameters/eql.search-keep_on_completion' - $ref: '#/components/parameters/eql.search-wait_for_completion_timeout' requestBody: $ref: '#/components/requestBodies/eql.search' responses: '200': $ref: '#/components/responses/eql.search-200' x-state: Generally available; Added in 7.9.0 x-codeSamples: - lang: Console source: "GET /my-data-stream/_eql/search\n{\n \"query\": \"\"\"\n process where (process.name == \"cmd.exe\" and process.pid != 2013)\n \"\"\"\n}" - lang: Python source: "resp = client.eql.search(\n index=\"my-data-stream\",\n query=\"\\n process where (process.name == \\\"cmd.exe\\\" and process.pid != 2013)\\n \",\n)" - lang: JavaScript source: "const response = await client.eql.search({\n index: \"my-data-stream\",\n query:\n '\\n process where (process.name == \"cmd.exe\" and process.pid != 2013)\\n ',\n});" - lang: Ruby source: "response = client.eql.search(\n index: \"my-data-stream\",\n body: {\n \"query\": \"\\n process where (process.name == \\\"cmd.exe\\\" and process.pid != 2013)\\n \"\n }\n)" - lang: PHP source: "$resp = $client->eql()->search([\n \"index\" => \"my-data-stream\",\n \"body\" => [\n \"query\" => \"\\n process where (process.name == \\\"cmd.exe\\\" and process.pid != 2013)\\n \",\n ],\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":"\n process where (process.name == \"cmd.exe\" and process.pid != 2013)\n "}'' "$ELASTICSEARCH_URL/my-data-stream/_eql/search"' - lang: C# source: "var response = await client.Eql\n .SearchAsync(indices: new[] { \"my-data-stream\" }, d1 => d1\n .Query(\"\\n process where (process.name == \\\"cmd.exe\\\" and process.pid != 2013)\\n \")\n );" - lang: Java source: "client.eql().search(s -> s\n .index(\"my-data-stream\")\n .query(\"\"\"\n \n process where (process.name == \"cmd.exe\" and process.pid != 2013)\n \n \"\"\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_query/async: post: tags: - esql summary: Run an async ES|QL query description: "Asynchronously run an ES|QL (Elasticsearch query language) query, monitor its progress, and retrieve results when they become available.\n\nThe API accepts the same parameters and request body as the synchronous query API, along with additional async related properties.\n\n## Required authorization\n\n* Index privileges: `read`\n" externalDocs: description: More about ES|QL reference url: https://www.elastic.co/docs/explore-analyze/query-filter/languages/esql x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/esql-async-query-api.html operationId: esql-async-query parameters: - name: allow_partial_results in: query description: "If `true`, partial results will be returned if there are shard failures, but the query can continue to execute on other clusters and shards.\nIf `false`, the query will fail if there are any failures.\n\nTo override the default behavior, you can set the `esql.query.allow_partial_results` cluster setting to `false`." schema: type: boolean default: true - name: delimiter in: query description: "The character to use between values within a CSV row.\nIt is valid only for the CSV format." schema: type: string default: ',' - name: drop_null_columns in: query description: "Indicates whether columns that are entirely `null` will be removed from the `columns` and `values` portion of the results.\nIf `true`, the response will include an extra section under the name `all_columns` which has the name of all the columns." schema: type: boolean default: false - name: format in: query description: "A short version of the Accept header, e.g. json, yaml.\n\n`csv`, `tsv`, and `txt` formats will return results in a tabular format, excluding other metadata fields from the response.\n\nFor async requests, nothing will be returned if the async query doesn't finish within the timeout.\nThe query ID and running status are available in the `X-Elasticsearch-Async-Id` and `X-Elasticsearch-Async-Is-Running` HTTP headers of the response, respectively." schema: $ref: '#/components/schemas/esql._types.EsqlFormat' requestBody: content: application/json: schema: required: - query type: object properties: columnar: type: boolean description: 'By default, ES|QL returns results as rows. For example, FROM returns each individual document as one row. For the JSON, YAML, CBOR and smile formats, ES|QL can return the results in a columnar fashion where one row represents all the values of a certain column in the results.' filter: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: Specify a Query DSL query in the filter parameter to filter the set of documents that an ES|QL query runs on. time_zone: type: string description: Sets the default timezone of the query. x-state: Generally available; Added in 9.4.0 locale: type: string description: Returns results (especially dates) formatted per the conventions of the locale. params: allOf: - $ref: '#/components/schemas/esql._types.ESQLParams' description: 'To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters.' profile: type: boolean description: "If provided and `true` the response will include an extra `profile` object\nwith information on how the query was executed. This information is for human debugging\nand its format can change at any time but it can give some insight into the performance\nof each part of the query." query: type: string description: 'The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results.' tables: type: object additionalProperties: type: object additionalProperties: $ref: '#/components/schemas/esql._types.TableValuesContainer' description: "Tables to use with the LOOKUP operation. The top level key is the table\nname and the next level key is the column name." include_ccs_metadata: type: boolean description: "When set to `true` and performing a cross-cluster/cross-project query, the response will include an extra `_clusters`\nobject with information about the clusters that participated in the search along with info such as shards\ncount." default: false include_execution_metadata: type: boolean description: "When set to `true`, the response will include an extra `_clusters`\nobject with information about the clusters that participated in the search along with info such as shards\ncount.\nThis is similar to `include_ccs_metadata`, but it also returns metadata when the query is not CCS/CPS" default: false wait_for_completion_timeout: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The period to wait for the request to finish.\nBy default, the request waits for 1 second for the query results.\nIf the query completes during this period, results are returned\nOtherwise, a query ID is returned that can later be used to retrieve the results." default: 1s keep_alive: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The period for which the query and its results are stored in the cluster.\nThe default period is five days.\nWhen this period expires, the query and its results are deleted, even if the query is still ongoing.\nIf the `keep_on_completion` parameter is false, Elasticsearch only stores async queries that do not complete within the period set by the `wait_for_completion_timeout` parameter, regardless of this value." default: 5d keep_on_completion: type: boolean description: "Indicates whether the query and its results are stored in the cluster.\nIf false, the query and its results are stored in the cluster only if the request does not complete during the period set by the `wait_for_completion_timeout` parameter." default: false settings: allOf: - $ref: '#/components/schemas/esql._types.EsqlQuerySettings' description: "Per-query settings, the request-body equivalent of the in-query `SET` command.\nFor example, `time_zone` can be supplied here instead of as a top-level field." x-state: Generally available; Added in 9.5.0 examples: AsyncQueryRequestExample1: value: "{\n \"query\": \"\"\"\n FROM library,remote-*:library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n \"\"\",\n \"wait_for_completion_timeout\": \"2s\",\n \"include_ccs_metadata\": true\n}" x-codeSamples: - lang: Console source: "POST /_query/async\n{\n \"query\": \"\"\"\n FROM library,remote-*:library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n \"\"\",\n \"wait_for_completion_timeout\": \"2s\",\n \"include_ccs_metadata\": true\n}" - lang: Python source: "resp = client.esql.async_query(\n query=\"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n wait_for_completion_timeout=\"2s\",\n include_ccs_metadata=True,\n)" - lang: JavaScript source: "const response = await client.esql.asyncQuery({\n query:\n \"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n wait_for_completion_timeout: \"2s\",\n include_ccs_metadata: true,\n});" - lang: Ruby source: "response = client.esql.async_query(\n body: {\n \"query\": \"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n \"wait_for_completion_timeout\": \"2s\",\n \"include_ccs_metadata\": true\n }\n)" - lang: PHP source: "$resp = $client->esql()->asyncQuery([\n \"body\" => [\n \"query\" => \"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n \"wait_for_completion_timeout\" => \"2s\",\n \"include_ccs_metadata\" => true,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":"\n FROM library,remote-*:library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n ","wait_for_completion_timeout":"2s","include_ccs_metadata":true}'' "$ELASTICSEARCH_URL/_query/async"' - lang: C# source: "var response = await client.Esql\n .AsyncQueryAsync(d1 => d1\n .IncludeCcsMetadata(true)\n .Query(\"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \")\n .WaitForCompletionTimeout(\"2s\")\n );" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/esql._types.AsyncEsqlResult' x-state: Generally available; Added in 8.13.0 x-codeSamples: - lang: Console source: "POST /_query/async\n{\n \"query\": \"\"\"\n FROM library,remote-*:library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n \"\"\",\n \"wait_for_completion_timeout\": \"2s\",\n \"include_ccs_metadata\": true\n}" - lang: Python source: "resp = client.esql.async_query(\n query=\"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n wait_for_completion_timeout=\"2s\",\n include_ccs_metadata=True,\n)" - lang: JavaScript source: "const response = await client.esql.asyncQuery({\n query:\n \"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n wait_for_completion_timeout: \"2s\",\n include_ccs_metadata: true,\n});" - lang: Ruby source: "response = client.esql.async_query(\n body: {\n \"query\": \"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n \"wait_for_completion_timeout\": \"2s\",\n \"include_ccs_metadata\": true\n }\n)" - lang: PHP source: "$resp = $client->esql()->asyncQuery([\n \"body\" => [\n \"query\" => \"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n \"wait_for_completion_timeout\" => \"2s\",\n \"include_ccs_metadata\" => true,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":"\n FROM library,remote-*:library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n ","wait_for_completion_timeout":"2s","include_ccs_metadata":true}'' "$ELASTICSEARCH_URL/_query/async"' - lang: C# source: "var response = await client.Esql\n .AsyncQueryAsync(d1 => d1\n .IncludeCcsMetadata(true)\n .Query(\"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \")\n .WaitForCompletionTimeout(\"2s\")\n );" x-metaTags: - content: Elasticsearch name: product_name '/_query/async/{id}': get: tags: - esql summary: Get async ES|QL query results description: "Get the current status and available results or stored results for an ES|QL asynchronous query.\nIf the Elasticsearch security features are enabled, only the user who first submitted the ES|QL query can retrieve the results using this API.\n\n## Required authorization\n\n* Index privileges: `read`\n" externalDocs: description: More about ES|QL reference url: https://www.elastic.co/docs/explore-analyze/query-filter/languages/esql x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/esql-async-query-get-api.html operationId: esql-async-query-get parameters: - name: id in: path description: "The unique identifier of the query.\nA query ID is provided in the ES|QL async query API response for a query that does not complete in the designated time.\nA query ID is also provided when the request was submitted with the `keep_on_completion` parameter set to `true`." required: true schema: $ref: '#/components/schemas/_types.Id' - name: drop_null_columns in: query description: "Indicates whether columns that are entirely `null` will be removed from the `columns` and `values` portion of the results.\nIf `true`, the response will include an extra section under the name `all_columns` which has the name of all the columns." schema: type: boolean default: false - name: format in: query description: 'A short version of the Accept header, for example `json` or `yaml`.' schema: $ref: '#/components/schemas/esql._types.EsqlFormat' - name: keep_alive in: query description: "The period for which the query and its results are stored in the cluster.\nWhen this period expires, the query and its results are deleted, even if the query is still ongoing." schema: $ref: '#/components/schemas/_types.Duration' - name: wait_for_completion_timeout in: query description: "The period to wait for the request to finish.\nBy default, the request waits for complete query results.\nIf the request completes during the period specified in this parameter, complete query results are returned.\nOtherwise, the response returns an `is_running` value of `true` and no results." schema: $ref: '#/components/schemas/_types.Duration' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/esql._types.AsyncEsqlResult' x-state: Generally available; Added in 8.13.0 x-codeSamples: - lang: Console source: "GET /_query/async/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=?wait_for_completion_timeout=30s\n" - lang: Python source: "resp = client.esql.async_query_get(\n id=\"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n wait_for_completion_timeout=\"30s\",\n)" - lang: JavaScript source: "const response = await client.esql.asyncQueryGet({\n id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n wait_for_completion_timeout: \"30s\",\n});" - lang: Ruby source: "response = client.esql.async_query_get(\n id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n wait_for_completion_timeout: \"30s\"\n)" - lang: PHP source: "$resp = $client->esql()->asyncQueryGet([\n \"id\" => \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n \"wait_for_completion_timeout\" => \"30s\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_query/async/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=?wait_for_completion_timeout=30s"' - lang: C# source: "var response = await client.Esql\n .AsyncQueryGetAsync(id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\", d1 => d1\n .WaitForCompletionTimeout(\"30s\")\n );" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - esql summary: Delete an async ES|QL query description: "If the query is still running, it is cancelled.\nOtherwise, the stored results are deleted.\n\nIf the Elasticsearch security features are enabled, only the following users can use this API to delete a query:\n\n* The authenticated user that submitted the original query request\n* Users with the `cancel_task` cluster privilege\n\n## Required authorization\n\n* Cluster privileges: `cancel_task`\n" externalDocs: description: More about ES|QL reference url: https://www.elastic.co/docs/explore-analyze/query-filter/languages/esql x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/esql-async-query-delete-api.html operationId: esql-async-query-delete parameters: - name: id in: path description: "The unique identifier of the query.\nA query ID is provided in the ES|QL async query API response for a query that does not complete in the designated time.\nA query ID is also provided when the request was submitted with the `keep_on_completion` parameter set to `true`." required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 8.13.0 x-codeSamples: - lang: Console source: "DELETE /_query/async/FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\n" - lang: Python source: "resp = client.esql.async_query_delete(\n id=\"FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\",\n)" - lang: JavaScript source: "const response = await client.esql.asyncQueryDelete({\n id: \"FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\",\n});" - lang: Ruby source: "response = client.esql.async_query_delete(\n id: \"FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\"\n)" - lang: PHP source: "$resp = $client->esql()->asyncQueryDelete([\n \"id\" => \"FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_query/async/FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI="' - lang: C# source: 'var response = await client.Esql.AsyncQueryDeleteAsync(id: "FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=");' x-metaTags: - content: Elasticsearch name: product_name '/_query/async/{id}/stop': post: tags: - esql summary: Stop async ES|QL query description: "This API interrupts the query execution and returns the results so far.\nIf the Elasticsearch security features are enabled, only the user who first submitted the ES|QL query can stop it.\n\n## Required authorization\n\n* Index privileges: `read`\n" externalDocs: description: More about ES|QL reference url: https://www.elastic.co/docs/explore-analyze/query-filter/languages/esql operationId: esql-async-query-stop parameters: - name: id in: path description: "The unique identifier of the query.\nA query ID is provided in the ES|QL async query API response for a query that does not complete in the designated time.\nA query ID is also provided when the request was submitted with the `keep_on_completion` parameter set to `true`." required: true schema: $ref: '#/components/schemas/_types.Id' - name: drop_null_columns in: query description: "Indicates whether columns that are entirely `null` will be removed from the `columns` and `values` portion of the results.\nIf `true`, the response will include an extra section under the name `all_columns` which has the name of all the columns." schema: type: boolean default: false responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/esql._types.AsyncEsqlResult' x-state: Generally available; Added in 8.18.0 x-codeSamples: - lang: Console source: "POST /_query/async/FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=/stop\n" - lang: Python source: "resp = client.esql.async_query_stop(\n id=\"FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=\",\n)" - lang: JavaScript source: "const response = await client.esql.asyncQueryStop({\n id: \"FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=\",\n});" - lang: Ruby source: "response = client.esql.async_query_stop(\n id: \"FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=\"\n)" - lang: PHP source: "$resp = $client->esql()->asyncQueryStop([\n \"id\" => \"FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_query/async/FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=/stop"' - lang: C# source: 'var response = await client.Esql.AsyncQueryStopAsync(id: "FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=");' x-metaTags: - content: Elasticsearch name: product_name '/_query/data_source/{name}': get: tags: - esql summary: "Get ES|QL data sources\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_query/data_source\n
\n
\n GET\n /_query/data_source/{name}\n
\n \n\nReturns one or more data sources used in ES|QL data federation.\nA concrete-name miss returns `404`; a wildcard pattern or list-all request with no match\nreturns `200` with an empty array.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" externalDocs: description: ES|QL Data Federation url: https://www.elastic.co/docs/reference/query-languages/esql/esql-data-federation operationId: esql-get-data-source parameters: - $ref: '#/components/parameters/esql.get_data_source-name' - $ref: '#/components/parameters/esql.get_data_source-master_timeout' responses: '200': $ref: '#/components/responses/esql.get_data_source-200' x-state: Experimental; Added in 9.5.0 x-codeSamples: - lang: Console source: "GET /_query/data_source/prod_s3_logs\n" - lang: Python source: "resp = client.esql.get_data_source(\n name=\"prod_s3_logs\",\n)" - lang: JavaScript source: "const response = await client.esql.getDataSource({\n name: \"prod_s3_logs\",\n});" - lang: Ruby source: "response = client.esql.get_data_source(\n name: \"prod_s3_logs\"\n)" - lang: PHP source: "$resp = $client->esql()->getDataSource([\n \"name\" => \"prod_s3_logs\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_query/data_source/prod_s3_logs"' - lang: C# source: "var response = await client.Esql\n .GetDataSourceAsync(d1 => d1\n .Name(new[] { \"prod_s3_logs\" })\n );" - lang: Java source: "client.esql().getDataSource(g -> g\n .name(\"prod_s3_logs\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - esql summary: Create or update an ES|QL data source description: "Creates or replaces a named, type-specific data source configuration for ES|QL data federation.\nDatasets reference data source configurations to access external data. Names must be lowercase\nand follow index or alias naming rules.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" externalDocs: description: ES|QL Data Federation url: https://www.elastic.co/docs/reference/query-languages/esql/esql-data-federation operationId: esql-put-data-source parameters: - name: name in: path description: The data source name to create or update. required: true schema: $ref: '#/components/schemas/_types.Name' - name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: The time to wait for the request to be completed. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - type type: object properties: type: type: string description: "The data source type. Currently, `s3` is supported.\nThe value must be lowercase and contain no whitespace." description: type: string description: A free-text description of the data source. settings: type: object additionalProperties: type: object description: "Type-specific connection and authentication settings.\nFor `s3`, connection settings include `region` and `endpoint`. Authentication settings\ninclude `auth` and the credentials required by the selected authentication method." examples: PutDataSourceRequestExample1: summary: Create an S3 data source description: "Create a data source for production logs stored in Amazon S3. The data source uses static credentials and connects to a bucket in the us-east-1 region.\n" value: "{\n \"type\": \"s3\",\n \"description\": \"Production S3 logs bucket\",\n \"settings\": {\n \"region\": \"us-east-1\",\n \"auth\": \"static_credentials\",\n \"access_key\": \"\",\n \"secret_key\": \"\"\n }\n}" x-codeSamples: - lang: Console source: "PUT /_query/data_source/prod_s3_logs\n{\n \"type\": \"s3\",\n \"description\": \"Production S3 logs bucket\",\n \"settings\": {\n \"region\": \"us-east-1\",\n \"auth\": \"static_credentials\",\n \"access_key\": \"\",\n \"secret_key\": \"\"\n }\n}" - lang: Python source: "resp = client.esql.put_data_source(\n name=\"prod_s3_logs\",\n type=\"s3\",\n description=\"Production S3 logs bucket\",\n settings={\n \"region\": \"us-east-1\",\n \"auth\": \"static_credentials\",\n \"access_key\": \"\",\n \"secret_key\": \"\"\n },\n)" - lang: JavaScript source: "const response = await client.esql.putDataSource({\n name: \"prod_s3_logs\",\n type: \"s3\",\n description: \"Production S3 logs bucket\",\n settings: {\n region: \"us-east-1\",\n auth: \"static_credentials\",\n access_key: \"\",\n secret_key: \"\",\n },\n});" - lang: Ruby source: "response = client.esql.put_data_source(\n name: \"prod_s3_logs\",\n body: {\n \"type\": \"s3\",\n \"description\": \"Production S3 logs bucket\",\n \"settings\": {\n \"region\": \"us-east-1\",\n \"auth\": \"static_credentials\",\n \"access_key\": \"\",\n \"secret_key\": \"\"\n }\n }\n)" - lang: PHP source: "$resp = $client->esql()->putDataSource([\n \"name\" => \"prod_s3_logs\",\n \"body\" => [\n \"type\" => \"s3\",\n \"description\" => \"Production S3 logs bucket\",\n \"settings\" => [\n \"region\" => \"us-east-1\",\n \"auth\" => \"static_credentials\",\n \"access_key\" => \"\",\n \"secret_key\" => \"\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"type":"s3","description":"Production S3 logs bucket","settings":{"region":"us-east-1","auth":"static_credentials","access_key":"","secret_key":""}}'' "$ELASTICSEARCH_URL/_query/data_source/prod_s3_logs"' - lang: C# source: "var response = await client.Esql\n .PutDataSourceAsync(name: \"prod_s3_logs\", d1 => d1\n .Description(\"Production S3 logs bucket\")\n .Settings(new Dictionary()\n {\n { \"region\", \"us-east-1\" },\n { \"auth\", \"static_credentials\" },\n { \"access_key\", \"\" },\n { \"secret_key\", \"\" }\n })\n .Type(\"s3\")\n );" - lang: Java source: "client.esql().putDataSource(p -> p\n .description(\"Production S3 logs bucket\")\n .name(\"prod_s3_logs\")\n .settings(Map.of(\"secret_key\", JsonData.fromJson(\"\\\"\\\"\"),\"auth\", JsonData.fromJson(\"\\\"static_credentials\\\"\"),\"access_key\", JsonData.fromJson(\"\\\"\\\"\"),\"region\", JsonData.fromJson(\"\\\"us-east-1\\\"\")))\n .type(\"s3\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: PutDataSourceResponseExample1: summary: Data source created description: The data source configuration was stored successfully. value: "{\n \"acknowledged\": true\n}" x-state: Experimental; Added in 9.5.0 x-codeSamples: - lang: Console source: "PUT /_query/data_source/prod_s3_logs\n{\n \"type\": \"s3\",\n \"description\": \"Production S3 logs bucket\",\n \"settings\": {\n \"region\": \"us-east-1\",\n \"auth\": \"static_credentials\",\n \"access_key\": \"\",\n \"secret_key\": \"\"\n }\n}" - lang: Python source: "resp = client.esql.put_data_source(\n name=\"prod_s3_logs\",\n type=\"s3\",\n description=\"Production S3 logs bucket\",\n settings={\n \"region\": \"us-east-1\",\n \"auth\": \"static_credentials\",\n \"access_key\": \"\",\n \"secret_key\": \"\"\n },\n)" - lang: JavaScript source: "const response = await client.esql.putDataSource({\n name: \"prod_s3_logs\",\n type: \"s3\",\n description: \"Production S3 logs bucket\",\n settings: {\n region: \"us-east-1\",\n auth: \"static_credentials\",\n access_key: \"\",\n secret_key: \"\",\n },\n});" - lang: Ruby source: "response = client.esql.put_data_source(\n name: \"prod_s3_logs\",\n body: {\n \"type\": \"s3\",\n \"description\": \"Production S3 logs bucket\",\n \"settings\": {\n \"region\": \"us-east-1\",\n \"auth\": \"static_credentials\",\n \"access_key\": \"\",\n \"secret_key\": \"\"\n }\n }\n)" - lang: PHP source: "$resp = $client->esql()->putDataSource([\n \"name\" => \"prod_s3_logs\",\n \"body\" => [\n \"type\" => \"s3\",\n \"description\" => \"Production S3 logs bucket\",\n \"settings\" => [\n \"region\" => \"us-east-1\",\n \"auth\" => \"static_credentials\",\n \"access_key\" => \"\",\n \"secret_key\" => \"\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"type":"s3","description":"Production S3 logs bucket","settings":{"region":"us-east-1","auth":"static_credentials","access_key":"","secret_key":""}}'' "$ELASTICSEARCH_URL/_query/data_source/prod_s3_logs"' - lang: C# source: "var response = await client.Esql\n .PutDataSourceAsync(name: \"prod_s3_logs\", d1 => d1\n .Description(\"Production S3 logs bucket\")\n .Settings(new Dictionary()\n {\n { \"region\", \"us-east-1\" },\n { \"auth\", \"static_credentials\" },\n { \"access_key\", \"\" },\n { \"secret_key\", \"\" }\n })\n .Type(\"s3\")\n );" - lang: Java source: "client.esql().putDataSource(p -> p\n .description(\"Production S3 logs bucket\")\n .name(\"prod_s3_logs\")\n .settings(Map.of(\"secret_key\", JsonData.fromJson(\"\\\"\\\"\"),\"auth\", JsonData.fromJson(\"\\\"static_credentials\\\"\"),\"access_key\", JsonData.fromJson(\"\\\"\\\"\"),\"region\", JsonData.fromJson(\"\\\"us-east-1\\\"\")))\n .type(\"s3\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - esql summary: Delete ES|QL data sources description: "Deletes one or more data sources used in ES|QL data federation.\nFails with `409` if any dataset references one of the named data sources;\ndelete the dependent datasets first.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" externalDocs: description: ES|QL Data Federation url: https://www.elastic.co/docs/reference/query-languages/esql/esql-data-federation operationId: esql-delete-data-source parameters: - name: name in: path description: A comma-separated list of data source names to delete. required: true schema: $ref: '#/components/schemas/_types.Names' - name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: The time to wait for the request to be completed. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: DeleteDataSourceResponseExample1: summary: Data source deleted description: The data source configuration was deleted successfully. value: "{\n \"acknowledged\": true\n}" x-state: Experimental; Added in 9.5.0 x-codeSamples: - lang: Console source: "DELETE /_query/data_source/prod_s3_logs\n" - lang: Python source: "resp = client.esql.delete_data_source(\n name=\"prod_s3_logs\",\n)" - lang: JavaScript source: "const response = await client.esql.deleteDataSource({\n name: \"prod_s3_logs\",\n});" - lang: Ruby source: "response = client.esql.delete_data_source(\n name: \"prod_s3_logs\"\n)" - lang: PHP source: "$resp = $client->esql()->deleteDataSource([\n \"name\" => \"prod_s3_logs\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_query/data_source/prod_s3_logs"' - lang: C# source: 'var response = await client.Esql.DeleteDataSourceAsync(name: new[] { "prod_s3_logs" });' - lang: Java source: "client.esql().deleteDataSource(d -> d\n .name(\"prod_s3_logs\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_query/dataset/{name}': get: tags: - esql summary: "Get ES|QL datasets\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_query/dataset\n
\n
\n GET\n /_query/dataset/{name}\n
\n \n\nReturns one or more datasets used in ES|QL data federation.\nA concrete-name miss returns `404`; a wildcard pattern or list-all request with no match\nreturns `200` with an empty array.\n\n## Required authorization\n\n* Index privileges: `manage`\n" externalDocs: description: ES|QL Data Federation url: https://www.elastic.co/docs/reference/query-languages/esql/esql-data-federation operationId: esql-get-dataset parameters: - $ref: '#/components/parameters/esql.get_dataset-name' - $ref: '#/components/parameters/esql.get_dataset-master_timeout' responses: '200': $ref: '#/components/responses/esql.get_dataset-200' x-state: Experimental; Added in 9.5.0 x-codeSamples: - lang: Console source: "GET /_query/dataset/access_logs\n" - lang: Python source: "resp = client.esql.get_dataset(\n name=\"access_logs\",\n)" - lang: JavaScript source: "const response = await client.esql.getDataset({\n name: \"access_logs\",\n});" - lang: Ruby source: "response = client.esql.get_dataset(\n name: \"access_logs\"\n)" - lang: PHP source: "$resp = $client->esql()->getDataset([\n \"name\" => \"access_logs\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_query/dataset/access_logs"' - lang: C# source: "var response = await client.Esql\n .GetDatasetAsync(d1 => d1\n .Name(new[] { \"access_logs\" })\n );" - lang: Java source: "client.esql().getDataset(g -> g\n .name(\"access_logs\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - esql summary: Create or update an ES|QL dataset description: "Creates or replaces a dataset that references a data source in ES|QL data federation.\nDataset names participate in the index namespace and must follow index or alias naming rules.\nReturns `404` if the referenced data source does not exist.\n\n## Required authorization\n\n* Index privileges: `manage`\n" externalDocs: description: ES|QL Data Federation url: https://www.elastic.co/docs/reference/query-languages/esql/esql-data-federation operationId: esql-put-dataset parameters: - name: name in: path description: The dataset name to create or update. required: true schema: $ref: '#/components/schemas/_types.Name' - name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: The time to wait for the request to be completed. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - data_source - resource type: object properties: data_source: allOf: - $ref: '#/components/schemas/_types.Name' description: The name of the referenced data source. The data source must already exist. resource: type: string description: "The URI that identifies the data to read, resolved against the referenced data source.\nIt can include glob patterns. For example, a recursive pattern can match\nall Parquet files under the `s3://logs-bucket/access` prefix." description: type: string description: A free-text description of the dataset. mappings: allOf: - $ref: '#/components/schemas/esql._types.DatasetMapping' description: User-declared mapping on the dataset definition settings: type: object additionalProperties: type: object description: "Format and parsing-specific settings that configure how the resource is read.\nCommon keys include `format`, which explicitly selects a registered format, and\n`partition_detection`, which accepts `auto`, `hive`, `template`, or `none`. Additional\nkeys depend on the format reader. Compression can be inferred from the resource URI." examples: PutDatasetRequestExample1: summary: Create a Parquet dataset description: "Create a dataset that reads partitioned Parquet access logs through the prod_s3_logs data source.\n" value: "{\n \"data_source\": \"prod_s3_logs\",\n \"resource\": \"s3://logs-bucket/access/**/*.parquet\",\n \"description\": \"Production access logs\",\n \"settings\": {\n \"partition_detection\": \"hive\"\n }\n}" x-codeSamples: - lang: Console source: "PUT /_query/dataset/access_logs\n{\n \"data_source\": \"prod_s3_logs\",\n \"resource\": \"s3://logs-bucket/access/**/*.parquet\",\n \"description\": \"Production access logs\",\n \"settings\": {\n \"partition_detection\": \"hive\"\n }\n}" - lang: Python source: "resp = client.esql.put_dataset(\n name=\"access_logs\",\n data_source=\"prod_s3_logs\",\n resource=\"s3://logs-bucket/access/**/*.parquet\",\n description=\"Production access logs\",\n settings={\n \"partition_detection\": \"hive\"\n },\n)" - lang: JavaScript source: "const response = await client.esql.putDataset({\n name: \"access_logs\",\n data_source: \"prod_s3_logs\",\n resource: \"s3://logs-bucket/access/**/*.parquet\",\n description: \"Production access logs\",\n settings: {\n partition_detection: \"hive\",\n },\n});" - lang: Ruby source: "response = client.esql.put_dataset(\n name: \"access_logs\",\n body: {\n \"data_source\": \"prod_s3_logs\",\n \"resource\": \"s3://logs-bucket/access/**/*.parquet\",\n \"description\": \"Production access logs\",\n \"settings\": {\n \"partition_detection\": \"hive\"\n }\n }\n)" - lang: PHP source: "$resp = $client->esql()->putDataset([\n \"name\" => \"access_logs\",\n \"body\" => [\n \"data_source\" => \"prod_s3_logs\",\n \"resource\" => \"s3://logs-bucket/access/**/*.parquet\",\n \"description\" => \"Production access logs\",\n \"settings\" => [\n \"partition_detection\" => \"hive\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"data_source":"prod_s3_logs","resource":"s3://logs-bucket/access/**/*.parquet","description":"Production access logs","settings":{"partition_detection":"hive"}}'' "$ELASTICSEARCH_URL/_query/dataset/access_logs"' - lang: C# source: "var response = await client.Esql\n .PutDatasetAsync(name: \"access_logs\", d1 => d1\n .DataSource(\"prod_s3_logs\")\n .Description(\"Production access logs\")\n .Resource(\"s3://logs-bucket/access/**/*.parquet\")\n .Settings(new Dictionary()\n {\n { \"partition_detection\", \"hive\" }\n })\n );" - lang: Java source: "client.esql().putDataset(p -> p\n .dataSource(\"prod_s3_logs\")\n .description(\"Production access logs\")\n .name(\"access_logs\")\n .resource(\"s3://logs-bucket/access/**/*.parquet\")\n .settings(\"partition_detection\", JsonData.fromJson(\"\\\"hive\\\"\"))\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: PutDatasetResponseExample1: summary: Dataset created description: The dataset definition was stored successfully. value: "{\n \"acknowledged\": true\n}" x-state: Experimental; Added in 9.5.0 x-codeSamples: - lang: Console source: "PUT /_query/dataset/access_logs\n{\n \"data_source\": \"prod_s3_logs\",\n \"resource\": \"s3://logs-bucket/access/**/*.parquet\",\n \"description\": \"Production access logs\",\n \"settings\": {\n \"partition_detection\": \"hive\"\n }\n}" - lang: Python source: "resp = client.esql.put_dataset(\n name=\"access_logs\",\n data_source=\"prod_s3_logs\",\n resource=\"s3://logs-bucket/access/**/*.parquet\",\n description=\"Production access logs\",\n settings={\n \"partition_detection\": \"hive\"\n },\n)" - lang: JavaScript source: "const response = await client.esql.putDataset({\n name: \"access_logs\",\n data_source: \"prod_s3_logs\",\n resource: \"s3://logs-bucket/access/**/*.parquet\",\n description: \"Production access logs\",\n settings: {\n partition_detection: \"hive\",\n },\n});" - lang: Ruby source: "response = client.esql.put_dataset(\n name: \"access_logs\",\n body: {\n \"data_source\": \"prod_s3_logs\",\n \"resource\": \"s3://logs-bucket/access/**/*.parquet\",\n \"description\": \"Production access logs\",\n \"settings\": {\n \"partition_detection\": \"hive\"\n }\n }\n)" - lang: PHP source: "$resp = $client->esql()->putDataset([\n \"name\" => \"access_logs\",\n \"body\" => [\n \"data_source\" => \"prod_s3_logs\",\n \"resource\" => \"s3://logs-bucket/access/**/*.parquet\",\n \"description\" => \"Production access logs\",\n \"settings\" => [\n \"partition_detection\" => \"hive\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"data_source":"prod_s3_logs","resource":"s3://logs-bucket/access/**/*.parquet","description":"Production access logs","settings":{"partition_detection":"hive"}}'' "$ELASTICSEARCH_URL/_query/dataset/access_logs"' - lang: C# source: "var response = await client.Esql\n .PutDatasetAsync(name: \"access_logs\", d1 => d1\n .DataSource(\"prod_s3_logs\")\n .Description(\"Production access logs\")\n .Resource(\"s3://logs-bucket/access/**/*.parquet\")\n .Settings(new Dictionary()\n {\n { \"partition_detection\", \"hive\" }\n })\n );" - lang: Java source: "client.esql().putDataset(p -> p\n .dataSource(\"prod_s3_logs\")\n .description(\"Production access logs\")\n .name(\"access_logs\")\n .resource(\"s3://logs-bucket/access/**/*.parquet\")\n .settings(\"partition_detection\", JsonData.fromJson(\"\\\"hive\\\"\"))\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - esql summary: Delete ES|QL datasets description: "Deletes one or more datasets used in ES|QL data federation.\nIf any specified dataset does not exist, the request fails and no datasets are deleted.\n\n## Required authorization\n\n* Index privileges: `manage`\n" externalDocs: description: ES|QL Data Federation url: https://www.elastic.co/docs/reference/query-languages/esql/esql-data-federation operationId: esql-delete-dataset parameters: - name: name in: path description: A comma-separated list of dataset names to delete. required: true schema: $ref: '#/components/schemas/_types.Names' - name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: The time to wait for the request to be completed. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: DeleteDatasetResponseExample1: summary: Dataset deleted description: The dataset definition was deleted successfully. value: "{\n \"acknowledged\": true\n}" x-state: Experimental; Added in 9.5.0 x-codeSamples: - lang: Console source: "DELETE /_query/dataset/access_logs\n" - lang: Python source: "resp = client.esql.delete_dataset(\n name=\"access_logs\",\n)" - lang: JavaScript source: "const response = await client.esql.deleteDataset({\n name: \"access_logs\",\n});" - lang: Ruby source: "response = client.esql.delete_dataset(\n name: \"access_logs\"\n)" - lang: PHP source: "$resp = $client->esql()->deleteDataset([\n \"name\" => \"access_logs\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_query/dataset/access_logs"' - lang: C# source: 'var response = await client.Esql.DeleteDatasetAsync(name: new[] { "access_logs" });' - lang: Java source: "client.esql().deleteDataset(d -> d\n .name(\"access_logs\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_query/view/{name}': get: tags: - esql summary: "Get an ES|QL view\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_query/view\n
\n
\n GET\n /_query/view/{name}\n
\n \n\nReturns one or more stored views. A reserved view includes `reserved` set to `true`.\n\n## Required authorization\n\n* Index privileges: `read_view_metadata`\n" externalDocs: description: Define reusable queries with ES|QL views url: https://www.elastic.co/docs/reference/query-languages/esql/esql-views operationId: esql-get-view parameters: - $ref: '#/components/parameters/esql.get_view-name' responses: '200': $ref: '#/components/responses/esql.get_view-200' x-state: Generally available; Added in 9.4.0 x-codeSamples: - lang: Console source: "GET /_query/view/country_addresses\n" - lang: Python source: "resp = client.esql.get_view(\n name=\"country_addresses\",\n)" - lang: JavaScript source: "const response = await client.esql.getView({\n name: \"country_addresses\",\n});" - lang: Ruby source: "response = client.esql.get_view(\n name: \"country_addresses\"\n)" - lang: PHP source: "$resp = $client->esql()->getView([\n \"name\" => \"country_addresses\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_query/view/country_addresses"' - lang: C# source: "var response = await client.Esql\n .GetViewAsync(d1 => d1\n .Name(new[] { \"country_addresses\" })\n );" x-metaTags: - content: Elasticsearch name: product_name put: tags: - esql summary: Create or update an ES|QL view description: "Stores an ES|QL query that runs whenever the view is referenced.\nA query that cannot be parsed is rejected. Replacing a reserved view fails.\n\n## Required authorization\n\n* Index privileges: `create_view`\n" externalDocs: description: Define reusable queries with ES|QL views url: https://www.elastic.co/docs/reference/query-languages/esql/esql-views operationId: esql-put-view parameters: - name: name in: path description: The view name to create or update. required: true schema: $ref: '#/components/schemas/_types.Id' - name: validate in: query description: "Whether to analyze the view query and return a warning when validation fails.\n\nValidation reports an unknown index or column, including an index the caller cannot read.\nThe view is saved even when validation reports a problem.\nFailures unrelated to the query, such as an overloaded cluster, produce no warning." schema: type: boolean default: false x-state: Generally available; Added in 9.7.0 requestBody: content: application/json: schema: required: - query type: object properties: query: type: string description: The ES|QL query string that defines the view. A query that cannot be parsed is rejected. description: type: string description: A free-text description of the view. x-state: Generally available; Added in 9.6.0 examples: PutViewRequestExample1: summary: Create a view of country counts description: "Create a view that normalizes country names and counts addresses by country.\n" value: "{\n \"query\": \"\"\"\n FROM addresses\n | RENAME city.country.name AS country\n | EVAL country = CASE(country == \"United States of America\", \"United States\", country)\n | STATS count=COUNT() BY country\n \"\"\",\n \"description\": \"Address counts by country\"\n}" x-codeSamples: - lang: Console source: "PUT /_query/view/country_addresses\n{\n \"query\": \"\"\"\n FROM addresses\n | RENAME city.country.name AS country\n | EVAL country = CASE(country == \"United States of America\", \"United States\", country)\n | STATS count=COUNT() BY country\n \"\"\",\n \"description\": \"Address counts by country\"\n}" - lang: Python source: "resp = client.esql.put_view(\n name=\"country_addresses\",\n query=\"\\n FROM addresses\\n | RENAME city.country.name AS country\\n | EVAL country = CASE(country == \\\"United States of America\\\", \\\"United States\\\", country)\\n | STATS count=COUNT() BY country\\n \",\n description=\"Address counts by country\",\n)" - lang: JavaScript source: "const response = await client.esql.putView({\n name: \"country_addresses\",\n query:\n '\\n FROM addresses\\n | RENAME city.country.name AS country\\n | EVAL country = CASE(country == \"United States of America\", \"United States\", country)\\n | STATS count=COUNT() BY country\\n ',\n description: \"Address counts by country\",\n});" - lang: Ruby source: "response = client.esql.put_view(\n name: \"country_addresses\",\n body: {\n \"query\": \"\\n FROM addresses\\n | RENAME city.country.name AS country\\n | EVAL country = CASE(country == \\\"United States of America\\\", \\\"United States\\\", country)\\n | STATS count=COUNT() BY country\\n \",\n \"description\": \"Address counts by country\"\n }\n)" - lang: PHP source: "$resp = $client->esql()->putView([\n \"name\" => \"country_addresses\",\n \"body\" => [\n \"query\" => \"\\n FROM addresses\\n | RENAME city.country.name AS country\\n | EVAL country = CASE(country == \\\"United States of America\\\", \\\"United States\\\", country)\\n | STATS count=COUNT() BY country\\n \",\n \"description\" => \"Address counts by country\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":"\n FROM addresses\n | RENAME city.country.name AS country\n | EVAL country = CASE(country == \"United States of America\", \"United States\", country)\n | STATS count=COUNT() BY country\n ","description":"Address counts by country"}'' "$ELASTICSEARCH_URL/_query/view/country_addresses"' - lang: C# source: "var response = await client.Esql\n .PutViewAsync(name: \"country_addresses\", d1 => d1\n .Description(\"Address counts by country\")\n .Query(\"\\n FROM addresses\\n | RENAME city.country.name AS country\\n | EVAL country = CASE(country == \\\"United States of America\\\", \\\"United States\\\", country)\\n | STATS count=COUNT() BY country\\n \")\n );" PutViewRequestExample2: summary: Create a view and validate the query description: "Analyze the view query before saving it. When the query uses an unknown index or column, the response includes a warning and the view is still saved.\n" value: "{\n \"query\": \"\"\"\n FROM addresses\n | RENAME city.country.name AS country\n | EVAL country = CASE(country == \"United States of America\", \"United States\", country)\n | STATS count=COUNT() BY country\n \"\"\",\n \"description\": \"Address counts by country\"\n}" x-codeSamples: - lang: Console source: "PUT /_query/view/country_addresses?validate=true\n{\n \"query\": \"\"\"\n FROM addresses\n | RENAME city.country.name AS country\n | EVAL country = CASE(country == \"United States of America\", \"United States\", country)\n | STATS count=COUNT() BY country\n \"\"\",\n \"description\": \"Address counts by country\"\n}" - lang: Python source: "resp = client.esql.put_view(\n name=\"country_addresses\",\n validate=True,\n query=\"\\n FROM addresses\\n | RENAME city.country.name AS country\\n | EVAL country = CASE(country == \\\"United States of America\\\", \\\"United States\\\", country)\\n | STATS count=COUNT() BY country\\n \",\n description=\"Address counts by country\",\n)" - lang: JavaScript source: "const response = await client.esql.putView({\n name: \"country_addresses\",\n validate: \"true\",\n query:\n '\\n FROM addresses\\n | RENAME city.country.name AS country\\n | EVAL country = CASE(country == \"United States of America\", \"United States\", country)\\n | STATS count=COUNT() BY country\\n ',\n description: \"Address counts by country\",\n});" - lang: Ruby source: "response = client.esql.put_view(\n name: \"country_addresses\",\n validate: \"true\",\n body: {\n \"query\": \"\\n FROM addresses\\n | RENAME city.country.name AS country\\n | EVAL country = CASE(country == \\\"United States of America\\\", \\\"United States\\\", country)\\n | STATS count=COUNT() BY country\\n \",\n \"description\": \"Address counts by country\"\n }\n)" - lang: PHP source: "$resp = $client->esql()->putView([\n \"name\" => \"country_addresses\",\n \"validate\" => \"true\",\n \"body\" => [\n \"query\" => \"\\n FROM addresses\\n | RENAME city.country.name AS country\\n | EVAL country = CASE(country == \\\"United States of America\\\", \\\"United States\\\", country)\\n | STATS count=COUNT() BY country\\n \",\n \"description\" => \"Address counts by country\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":"\n FROM addresses\n | RENAME city.country.name AS country\n | EVAL country = CASE(country == \"United States of America\", \"United States\", country)\n | STATS count=COUNT() BY country\n ","description":"Address counts by country"}'' "$ELASTICSEARCH_URL/_query/view/country_addresses?validate=true"' - lang: C# source: "var response = await client.Esql\n .PutViewAsync(name: \"country_addresses\", d1 => d1\n .Validate(true)\n .Description(\"Address counts by country\")\n .Query(\"\\n FROM addresses\\n | RENAME city.country.name AS country\\n | EVAL country = CASE(country == \\\"United States of America\\\", \\\"United States\\\", country)\\n | STATS count=COUNT() BY country\\n \")\n );" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: PutViewResponseExample1: summary: View created description: The view definition was stored successfully. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 9.4.0 x-codeSamples: - lang: Console source: "PUT /_query/view/country_addresses\n{\n \"query\": \"\"\"\n FROM addresses\n | RENAME city.country.name AS country\n | EVAL country = CASE(country == \"United States of America\", \"United States\", country)\n | STATS count=COUNT() BY country\n \"\"\",\n \"description\": \"Address counts by country\"\n}" - lang: Python source: "resp = client.esql.put_view(\n name=\"country_addresses\",\n query=\"\\n FROM addresses\\n | RENAME city.country.name AS country\\n | EVAL country = CASE(country == \\\"United States of America\\\", \\\"United States\\\", country)\\n | STATS count=COUNT() BY country\\n \",\n description=\"Address counts by country\",\n)" - lang: JavaScript source: "const response = await client.esql.putView({\n name: \"country_addresses\",\n query:\n '\\n FROM addresses\\n | RENAME city.country.name AS country\\n | EVAL country = CASE(country == \"United States of America\", \"United States\", country)\\n | STATS count=COUNT() BY country\\n ',\n description: \"Address counts by country\",\n});" - lang: Ruby source: "response = client.esql.put_view(\n name: \"country_addresses\",\n body: {\n \"query\": \"\\n FROM addresses\\n | RENAME city.country.name AS country\\n | EVAL country = CASE(country == \\\"United States of America\\\", \\\"United States\\\", country)\\n | STATS count=COUNT() BY country\\n \",\n \"description\": \"Address counts by country\"\n }\n)" - lang: PHP source: "$resp = $client->esql()->putView([\n \"name\" => \"country_addresses\",\n \"body\" => [\n \"query\" => \"\\n FROM addresses\\n | RENAME city.country.name AS country\\n | EVAL country = CASE(country == \\\"United States of America\\\", \\\"United States\\\", country)\\n | STATS count=COUNT() BY country\\n \",\n \"description\" => \"Address counts by country\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":"\n FROM addresses\n | RENAME city.country.name AS country\n | EVAL country = CASE(country == \"United States of America\", \"United States\", country)\n | STATS count=COUNT() BY country\n ","description":"Address counts by country"}'' "$ELASTICSEARCH_URL/_query/view/country_addresses"' - lang: C# source: "var response = await client.Esql\n .PutViewAsync(name: \"country_addresses\", d1 => d1\n .Description(\"Address counts by country\")\n .Query(\"\\n FROM addresses\\n | RENAME city.country.name AS country\\n | EVAL country = CASE(country == \\\"United States of America\\\", \\\"United States\\\", country)\\n | STATS count=COUNT() BY country\\n \")\n );" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - esql summary: Delete an ES|QL view description: "Deletes a stored ES|QL view. Deleting a reserved view fails.\n\n## Required authorization\n\n* Index privileges: `delete_view`\n" externalDocs: description: Define reusable queries with ES|QL views url: https://www.elastic.co/docs/reference/query-languages/esql/esql-views operationId: esql-delete-view parameters: - name: name in: path description: The view name to remove. required: true schema: $ref: '#/components/schemas/_types.Ids' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: DeleteViewResponseExample1: summary: View deleted description: The view definition was deleted successfully. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 9.4.0 x-codeSamples: - lang: Console source: "DELETE /_query/view/country_addresses\n" - lang: Python source: "resp = client.esql.delete_view(\n name=\"country_addresses\",\n)" - lang: JavaScript source: "const response = await client.esql.deleteView({\n name: \"country_addresses\",\n});" - lang: Ruby source: "response = client.esql.delete_view(\n name: \"country_addresses\"\n)" - lang: PHP source: "$resp = $client->esql()->deleteView([\n \"name\" => \"country_addresses\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_query/view/country_addresses"' - lang: C# source: 'var response = await client.Esql.DeleteViewAsync(name: new[] { "country_addresses" });' x-metaTags: - content: Elasticsearch name: product_name '/_query/queries/{id}': get: tags: - esql summary: Get a specific running ES|QL query information description: "Returns an object extended information about a running ES|QL query.\n\n## Required authorization\n\n* Cluster privileges: `monitor_esql`\n" operationId: esql-get-query parameters: - name: id in: path description: The query ID required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: required: - id - node - start_time_millis - running_time_nanos - query - coordinating_node - data_nodes type: object properties: id: type: number node: allOf: - $ref: '#/components/schemas/_types.NodeId' start_time_millis: type: number running_time_nanos: type: number query: type: string coordinating_node: allOf: - $ref: '#/components/schemas/_types.NodeId' data_nodes: type: array items: $ref: '#/components/schemas/_types.NodeId' x-state: Experimental; Added in 9.1.0 x-metaTags: - content: Elasticsearch name: product_name /_query/queries: get: tags: - esql summary: Get running ES|QL queries information description: "Returns an object containing IDs and other information about the running ES|QL queries.\n\n## Required authorization\n\n* Cluster privileges: `monitor_esql`\n" operationId: esql-list-queries responses: '200': description: '' content: application/json: schema: required: - queries type: object properties: queries: type: object additionalProperties: $ref: '#/components/schemas/esql.list_queries.Body' x-state: Experimental; Added in 9.1.0 x-metaTags: - content: Elasticsearch name: product_name /_query: post: tags: - esql summary: Run an ES|QL query description: "Get search results for an ES|QL (Elasticsearch query language) query.\n\n## Required authorization\n\n* Index privileges: `read`\n" externalDocs: description: More about ES|QL reference url: https://www.elastic.co/docs/explore-analyze/query-filter/languages/esql operationId: esql-query parameters: - name: format in: query description: "A short version of the Accept header, e.g. json, yaml.\n\n`csv`, `tsv`, and `txt` formats will return results in a tabular format, excluding other metadata fields from the response." schema: $ref: '#/components/schemas/esql._types.EsqlFormat' - name: delimiter in: query description: The character to use between values within a CSV row. Only valid for the CSV format. schema: type: string default: ',' - name: drop_null_columns in: query description: "Should columns that are entirely `null` be removed from the `columns` and `values` portion of the results?\nDefaults to `false`. If `true` then the response will include an extra section under the name `all_columns` which has the name of all columns." schema: type: boolean default: false - name: allow_partial_results in: query description: "If `true`, partial results will be returned if there are shard failures, but the query can continue to execute on other clusters and shards.\nIf `false`, the query will fail if there are any failures.\n\nTo override the default behavior, you can set the `esql.query.allow_partial_results` cluster setting to `false`." schema: type: boolean default: true requestBody: content: application/json: schema: required: - query type: object properties: columnar: type: boolean description: 'By default, ES|QL returns results as rows. For example, FROM returns each individual document as one row. For the JSON, YAML, CBOR and smile formats, ES|QL can return the results in a columnar fashion where one row represents all the values of a certain column in the results.' filter: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: Specify a Query DSL query in the filter parameter to filter the set of documents that an ES|QL query runs on. time_zone: type: string description: Sets the default timezone of the query. x-state: Generally available; Added in 9.4.0 locale: type: string description: Returns results (especially dates) formatted per the conventions of the locale. params: allOf: - $ref: '#/components/schemas/esql._types.ESQLParams' description: 'To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters.' profile: type: boolean description: "If provided and `true` the response will include an extra `profile` object\nwith information on how the query was executed. This information is for human debugging\nand its format can change at any time but it can give some insight into the performance\nof each part of the query." query: type: string description: 'The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results.' tables: type: object additionalProperties: type: object additionalProperties: $ref: '#/components/schemas/esql._types.TableValuesContainer' description: "Tables to use with the LOOKUP operation. The top level key is the table\nname and the next level key is the column name." include_ccs_metadata: type: boolean description: "When set to `true` and performing a cross-cluster/cross-project query, the response will include an extra `_clusters`\nobject with information about the clusters that participated in the search along with info such as shards\ncount." default: false include_execution_metadata: type: boolean description: "When set to `true`, the response will include an extra `_clusters`\nobject with information about the clusters that participated in the search along with info such as shards\ncount.\nThis is similar to `include_ccs_metadata`, but it also returns metadata when the query is not CCS/CPS" default: false settings: allOf: - $ref: '#/components/schemas/esql._types.EsqlQuerySettings' description: "Per-query settings, the request-body equivalent of the in-query `SET` command.\nFor example, `time_zone` can be supplied here instead of as a top-level field." x-state: Generally available; Added in 9.5.0 examples: QueryRequestExample1: description: Run `POST /_query` to get results for an ES|QL query. value: "{\n \"query\": \"\"\"\n FROM library,remote-*:library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n \"\"\",\n \"include_ccs_metadata\": true\n}" x-codeSamples: - lang: Console source: "POST /_query\n{\n \"query\": \"\"\"\n FROM library,remote-*:library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n \"\"\",\n \"include_ccs_metadata\": true\n}" - lang: Python source: "resp = client.esql.query(\n query=\"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n include_ccs_metadata=True,\n)" - lang: JavaScript source: "const response = await client.esql.query({\n query:\n \"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n include_ccs_metadata: true,\n});" - lang: Ruby source: "response = client.esql.query(\n body: {\n \"query\": \"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n \"include_ccs_metadata\": true\n }\n)" - lang: PHP source: "$resp = $client->esql()->query([\n \"body\" => [\n \"query\" => \"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n \"include_ccs_metadata\" => true,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":"\n FROM library,remote-*:library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n ","include_ccs_metadata":true}'' "$ELASTICSEARCH_URL/_query"' - lang: C# source: "var response = await client.Esql\n .QueryAsync(d1 => d1\n .IncludeCcsMetadata(true)\n .Query(\"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \")\n );" - lang: Java source: "client.esql().query(q -> q\n .includeCcsMetadata(true)\n .query(\"\"\"\n \n FROM library,remote-*:library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n \n \"\"\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/esql._types.EsqlResult' x-state: Generally available; Added in 8.11.0 x-codeSamples: - lang: Console source: "POST /_query\n{\n \"query\": \"\"\"\n FROM library,remote-*:library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n \"\"\",\n \"include_ccs_metadata\": true\n}" - lang: Python source: "resp = client.esql.query(\n query=\"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n include_ccs_metadata=True,\n)" - lang: JavaScript source: "const response = await client.esql.query({\n query:\n \"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n include_ccs_metadata: true,\n});" - lang: Ruby source: "response = client.esql.query(\n body: {\n \"query\": \"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n \"include_ccs_metadata\": true\n }\n)" - lang: PHP source: "$resp = $client->esql()->query([\n \"body\" => [\n \"query\" => \"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n \"include_ccs_metadata\" => true,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":"\n FROM library,remote-*:library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n ","include_ccs_metadata":true}'' "$ELASTICSEARCH_URL/_query"' - lang: C# source: "var response = await client.Esql\n .QueryAsync(d1 => d1\n .IncludeCcsMetadata(true)\n .Query(\"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \")\n );" - lang: Java source: "client.esql().query(q -> q\n .includeCcsMetadata(true)\n .query(\"\"\"\n \n FROM library,remote-*:library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n \n \"\"\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_source/{id}': get: tags: - document summary: Get a document's source description: "Get the source of a document.\nFor example:\n\n```\nGET my-index-000001/_source/1\n```\n\nYou can use the source filtering parameters to control which parts of the `_source` are returned:\n\n```\nGET my-index-000001/_source/1/?_source_includes=*.id&_source_excludes=entities\n```\n\n## Required authorization\n\n* Index privileges: `read`\n" externalDocs: description: Learn more about _source field url: https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/mapping-source-field x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/docs-get.html operationId: get-source parameters: - name: index in: path description: The name of the index that contains the document. required: true schema: $ref: '#/components/schemas/_types.IndexName' - name: id in: path description: A unique document identifier. required: true schema: $ref: '#/components/schemas/_types.Id' - name: preference in: query description: "The node or shard the operation should be performed on.\nBy default, the operation is randomized between the shard replicas." schema: type: string - name: realtime in: query description: 'If `true`, the request is real-time as opposed to near-real-time.' schema: type: boolean default: true - name: refresh in: query description: "If `true`, the request refreshes the relevant shards before retrieving the document.\nSetting it to `true` should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing)." schema: type: boolean default: false - name: routing in: query description: A custom value used to route operations to a specific shard. schema: $ref: '#/components/schemas/_types.Routing' - name: _source in: query description: Indicates whether to return the `_source` field (`true` or `false`) or lists the fields to return. schema: $ref: '#/components/schemas/_global.search._types.SourceConfigParam' - name: _source_excludes in: query description: A comma-separated list of source fields to exclude in the response. schema: $ref: '#/components/schemas/_types.Fields' - name: _source_includes in: query description: A comma-separated list of source fields to include in the response. schema: $ref: '#/components/schemas/_types.Fields' - name: version in: query description: "The version number for concurrency control.\nIt must match the current version of the document for the request to succeed." schema: $ref: '#/components/schemas/_types.VersionNumber' - name: version_type in: query description: "The version type.\n\nSupported values include:\n - `internal`: Use internal versioning that starts at 1 and increments with each update or delete.\n - `external`: Only index the document if the specified version is strictly higher than the version of the stored document or if there is no existing document.\n - `external_gte`: Only index the document if the specified version is equal or higher than the version of the stored document or if there is no existing document.\nNOTE: The `external_gte` version type is meant for special use cases and should be used with care.\nIf used incorrectly, it can result in loss of data.\n\n" schema: $ref: '#/components/schemas/_types.VersionType' responses: '200': description: '' content: application/json: schema: type: object x-state: Generally available x-codeSamples: - lang: Console source: "GET my-index-000001/_source/1\n" - lang: Python source: "resp = client.get_source(\n index=\"my-index-000001\",\n id=\"1\",\n)" - lang: JavaScript source: "const response = await client.getSource({\n index: \"my-index-000001\",\n id: 1,\n});" - lang: Ruby source: "response = client.get_source(\n index: \"my-index-000001\",\n id: \"1\"\n)" - lang: PHP source: "$resp = $client->getSource([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_source/1"' - lang: C# source: 'var response = await client.GetSourceAsync(index: "my-index-000001", id: "1");' - lang: Java source: "client.getSource(g -> g\n .id(\"1\")\n .index(\"my-index-000001\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name head: tags: - document summary: Check for a document source description: "Check whether a document source exists in an index.\nFor example:\n\n```\nHEAD my-index-000001/_source/1\n```\n\nA document's source is not available if it is disabled in the mapping.\n\n## Required authorization\n\n* Index privileges: `read`\n" externalDocs: description: Learn more about _source field url: https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/mapping-source-field x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/docs-get.html operationId: exists-source parameters: - name: index in: path description: "A comma-separated list of data streams, indices, and aliases.\nIt supports wildcards (`*`)." required: true schema: $ref: '#/components/schemas/_types.IndexName' - name: id in: path description: A unique identifier for the document. required: true schema: $ref: '#/components/schemas/_types.Id' - name: preference in: query description: "The node or shard the operation should be performed on.\nBy default, the operation is randomized between the shard replicas." schema: type: string - name: realtime in: query description: 'If `true`, the request is real-time as opposed to near-real-time.' schema: type: boolean default: true - name: refresh in: query description: "If `true`, the request refreshes the relevant shards before retrieving the document.\nSetting it to `true` should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing)." schema: type: boolean default: false - name: routing in: query description: A custom value used to route operations to a specific shard. schema: $ref: '#/components/schemas/_types.Routing' - name: _source in: query description: Indicates whether to return the `_source` field (`true` or `false`) or lists the fields to return. schema: $ref: '#/components/schemas/_global.search._types.SourceConfigParam' - name: _source_excludes in: query description: A comma-separated list of source fields to exclude in the response. schema: $ref: '#/components/schemas/_types.Fields' - name: _source_includes in: query description: A comma-separated list of source fields to include in the response. schema: $ref: '#/components/schemas/_types.Fields' - name: version in: query description: "The version number for concurrency control.\nIt must match the current version of the document for the request to succeed." schema: $ref: '#/components/schemas/_types.VersionNumber' - name: version_type in: query description: "The version type.\n\nSupported values include:\n - `internal`: Use internal versioning that starts at 1 and increments with each update or delete.\n - `external`: Only index the document if the specified version is strictly higher than the version of the stored document or if there is no existing document.\n - `external_gte`: Only index the document if the specified version is equal or higher than the version of the stored document or if there is no existing document.\nNOTE: The `external_gte` version type is meant for special use cases and should be used with care.\nIf used incorrectly, it can result in loss of data.\n\n" schema: $ref: '#/components/schemas/_types.VersionType' responses: '200': description: '' content: application/json: { } x-state: Generally available; Added in 5.4.0 x-codeSamples: - lang: Console source: "HEAD my-index-000001/_source/1\n" - lang: Python source: "resp = client.exists_source(\n index=\"my-index-000001\",\n id=\"1\",\n)" - lang: JavaScript source: "const response = await client.existsSource({\n index: \"my-index-000001\",\n id: 1,\n});" - lang: Ruby source: "response = client.exists_source(\n index: \"my-index-000001\",\n id: \"1\"\n)" - lang: PHP source: "$resp = $client->existsSource([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n]);" - lang: curl source: 'curl --head -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_source/1"' - lang: C# source: 'var response = await client.ExistsSourceAsync(index: "my-index-000001", id: "1");' - lang: Java source: "client.existsSource(e -> e\n .id(\"1\")\n .index(\"my-index-000001\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_explain/{id}': post: tags: - search summary: "Explain a document match result\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /{index}/_explain/{id}\n
\n
\n POST\n /{index}/_explain/{id}\n
\n \n\nGet information about why a specific document matches, or doesn't match, a query.\nIt computes a score explanation for a query and a specific document.\n\n## Required authorization\n\n* Index privileges: `read`\n" operationId: explain parameters: - $ref: '#/components/parameters/explain-index' - $ref: '#/components/parameters/explain-id' - $ref: '#/components/parameters/explain-analyzer' - $ref: '#/components/parameters/explain-analyze_wildcard' - $ref: '#/components/parameters/explain-default_operator' - $ref: '#/components/parameters/explain-df' - $ref: '#/components/parameters/explain-lenient' - $ref: '#/components/parameters/explain-preference' - $ref: '#/components/parameters/explain-routing' - $ref: '#/components/parameters/explain-_source' - $ref: '#/components/parameters/explain-_source_excludes' - $ref: '#/components/parameters/explain-_source_includes' - $ref: '#/components/parameters/explain-stored_fields' - $ref: '#/components/parameters/explain-q' requestBody: $ref: '#/components/requestBodies/explain' responses: '200': $ref: '#/components/responses/explain-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET /my-index-000001/_explain/0\n{\n \"query\" : {\n \"match\" : { \"message\" : \"elasticsearch\" }\n }\n}" - lang: Python source: "resp = client.explain(\n index=\"my-index-000001\",\n id=\"0\",\n query={\n \"match\": {\n \"message\": \"elasticsearch\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.explain({\n index: \"my-index-000001\",\n id: 0,\n query: {\n match: {\n message: \"elasticsearch\",\n },\n },\n});" - lang: Ruby source: "response = client.explain(\n index: \"my-index-000001\",\n id: \"0\",\n body: {\n \"query\": {\n \"match\": {\n \"message\": \"elasticsearch\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->explain([\n \"index\" => \"my-index-000001\",\n \"id\" => \"0\",\n \"body\" => [\n \"query\" => [\n \"match\" => [\n \"message\" => \"elasticsearch\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":{"match":{"message":"elasticsearch"}}}'' "$ELASTICSEARCH_URL/my-index-000001/_explain/0"' - lang: C# source: "var response = await client\n .ExplainAsync(new ExplainRequest()\n {\n Id = \"0\",\n Index = \"my-index-000001\",\n Query = new Query()\n {\n Match = new()\n {\n Field = global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.Message),\n Query = \"elasticsearch\"\n }\n }\n });" - lang: Java source: "client.explain(e -> e\n .id(\"0\")\n .index(\"my-index-000001\")\n .query(q -> q\n .match(m -> m\n .field(\"message\")\n .query(FieldValue.of(\"elasticsearch\"))\n )\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_features: get: tags: - features summary: Get the features description: "Get a list of features that can be included in snapshots using the `feature_states` field when creating a snapshot.\nYou can use this API to determine which feature states to include when taking a snapshot.\nBy default, all feature states are included in a snapshot if that snapshot includes the global state, or none if it does not.\n\nA feature state includes one or more system indices necessary for a given feature to function.\nIn order to ensure data integrity, all system indices that comprise a feature state are snapshotted and restored together.\n\nThe features listed by this API are a combination of built-in features and features defined by plugins.\nIn order for a feature state to be listed in this API and recognized as a valid feature state by the create snapshot API, the plugin that defines that feature must be installed on the master node.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" externalDocs: description: More about managing snapshots url: https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore/create-snapshots x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/get-features-api.html operationId: features-get-features parameters: - name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - features type: object properties: features: type: array items: $ref: '#/components/schemas/features._types.Feature' examples: GetFeaturesResponseExample1: description: A successful response for retrieving a list of feature states that can be included when taking a snapshot. value: "{\n \"features\": [\n {\n \"name\": \"tasks\",\n \"description\": \"Manages task results\"\n },\n {\n \"name\": \"kibana\",\n \"description\": \"Manages Kibana configuration and reports\"\n }\n ]\n}" x-state: Generally available; Added in 7.12.0 x-codeSamples: - lang: Console source: "GET _features\n" - lang: Python source: resp = client.features.get_features() - lang: JavaScript source: const response = await client.features.getFeatures(); - lang: Ruby source: response = client.features.get_features - lang: PHP source: $resp = $client->features()->getFeatures(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_features"' - lang: C# source: var response = await client.Features.GetFeaturesAsync(); - lang: Java source: "client.features().getFeatures(g -> g);\n" x-metaTags: - content: Elasticsearch name: product_name /_features/_reset: post: tags: - features summary: Reset the features description: "Clear all of the state information stored in system indices by Elasticsearch features, including the security and machine learning indices.\n\nWARNING: Intended for development and testing use only. Do not reset features on a production cluster.\n\nReturn a cluster to the same state as a new installation by resetting the feature state for all Elasticsearch features.\nThis deletes all state information stored in system indices.\n\nThe response code is HTTP 200 if the state is successfully reset for all features.\nIt is HTTP 500 if the reset operation failed for any feature.\n\nNote that select features might provide a way to reset particular system indices.\nUsing this API resets all features, both those that are built-in and implemented as plugins.\n\nTo list the features that will be affected, use the get features API.\n\nIMPORTANT: The features installed on the node you submit this request to are the features that will be reset. Run on the master node if you have any doubts about which plugins are installed on individual nodes." operationId: features-reset-features parameters: - name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - features type: object properties: features: type: array items: $ref: '#/components/schemas/features._types.Feature' examples: ResetFeaturesResponseExample1: description: A successful response for clearing state information stored in system indices by Elasticsearch features. value: "{\n \"features\" : [\n {\n \"feature_name\" : \"security\",\n \"status\" : \"SUCCESS\"\n },\n {\n \"feature_name\" : \"tasks\",\n \"status\" : \"SUCCESS\"\n }\n ]\n}" x-state: Experimental; Added in 7.12.0 x-codeSamples: - lang: Console source: "POST /_features/_reset\n" - lang: Python source: resp = client.features.reset_features() - lang: JavaScript source: const response = await client.features.resetFeatures(); - lang: Ruby source: response = client.features.reset_features - lang: PHP source: $resp = $client->features()->resetFeatures(); - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_features/_reset"' - lang: C# source: var response = await client.Features.ResetFeaturesAsync(); - lang: Java source: "client.features().resetFeatures(r -> r);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_field_caps': post: tags: - search summary: "Get the field capabilities\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_field_caps\n
\n
\n POST\n /_field_caps\n
\n
\n GET\n /{index}/_field_caps\n
\n
\n POST\n /{index}/_field_caps\n
\n \n\nGet information about the capabilities of fields among multiple indices.\n\nFor data streams, the API returns field capabilities among the stream’s backing indices.\nIt returns runtime fields like any other field.\nFor example, a runtime field with a type of keyword is returned the same as any other field that belongs to the `keyword` family.\n\n## Required authorization\n\n* Index privileges: `view_index_metadata`,`read`\n" operationId: field-caps parameters: - $ref: '#/components/parameters/field_caps-index' - $ref: '#/components/parameters/field_caps-allow_no_indices' - $ref: '#/components/parameters/field_caps-expand_wildcards' - $ref: '#/components/parameters/field_caps-fields' - $ref: '#/components/parameters/field_caps-ignore_unavailable' - $ref: '#/components/parameters/field_caps-include_unmapped' - $ref: '#/components/parameters/field_caps-filters' - $ref: '#/components/parameters/field_caps-types' - $ref: '#/components/parameters/field_caps-include_empty_fields' requestBody: $ref: '#/components/requestBodies/field_caps' responses: '200': $ref: '#/components/responses/field_caps-200' x-state: Generally available; Added in 5.4.0 x-codeSamples: - lang: Console source: "POST my-index-*/_field_caps?fields=rating\n{\n \"index_filter\": {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n }\n}" - lang: Python source: "resp = client.field_caps(\n index=\"my-index-*\",\n fields=\"rating\",\n index_filter={\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.fieldCaps({\n index: \"my-index-*\",\n fields: \"rating\",\n index_filter: {\n range: {\n \"@timestamp\": {\n gte: \"2018\",\n },\n },\n },\n});" - lang: Ruby source: "response = client.field_caps(\n index: \"my-index-*\",\n fields: \"rating\",\n body: {\n \"index_filter\": {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->fieldCaps([\n \"index\" => \"my-index-*\",\n \"fields\" => \"rating\",\n \"body\" => [\n \"index_filter\" => [\n \"range\" => [\n \"@timestamp\" => [\n \"gte\" => \"2018\",\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"index_filter":{"range":{"@timestamp":{"gte":"2018"}}}}'' "$ELASTICSEARCH_URL/my-index-*/_field_caps?fields=rating"' - lang: C# source: "var response = await client\n .FieldCapsAsync(d1 => d1\n .Indices(new[] { \"my-index-*\" })\n .IndexFilter(d2 => d2\n .Range(new UntypedRangeQuery()\n {\n Field = global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.Timestamp),\n Gte = \"2018\"\n })\n )\n );" - lang: Java source: "client.fieldCaps(f -> f\n .fields(\"rating\")\n .index(\"my-index-*\")\n .indexFilter(i -> i\n .range(r -> r\n .untyped(u -> u\n .field(\"@timestamp\")\n .gte(JsonData.fromJson(\"\\\"2018\\\"\"))\n )\n )\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_fleet/global_checkpoints': get: tags: - fleet summary: Get global checkpoints description: "Get the current global checkpoints for an index.\nThis API is designed for internal use by the Fleet server project.\n\n## Required authorization\n\n* Index privileges: `monitor`\n" operationId: fleet-global-checkpoints parameters: - name: index in: path description: A single index or index alias that resolves to a single index. required: true schema: oneOf: - $ref: '#/components/schemas/_types.IndexName' - $ref: '#/components/schemas/_types.IndexAlias' - name: wait_for_advance in: query description: "A boolean value which controls whether to wait (until the timeout) for the global checkpoints\nto advance past the provided `checkpoints`." schema: type: boolean default: false - name: wait_for_index in: query description: "A boolean value which controls whether to wait (until the timeout) for the target index to exist\nand all primary shards be active. Can only be true when `wait_for_advance` is true." schema: type: boolean default: false - name: checkpoints in: query description: "A comma separated list of previous global checkpoints. When used in combination with `wait_for_advance`,\nthe API will only return once the global checkpoints advances past the checkpoints. Providing an empty list\nwill cause Elasticsearch to immediately return the current global checkpoints." schema: type: array items: $ref: '#/components/schemas/fleet._types.Checkpoint' default: [ ] - name: timeout in: query description: Period to wait for a global checkpoints to advance past `checkpoints`. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - global_checkpoints - timed_out type: object properties: global_checkpoints: type: array items: $ref: '#/components/schemas/fleet._types.Checkpoint' timed_out: type: boolean x-state: Generally available; Added in 7.13.0 x-metaTags: - content: 'Elasticsearch, Fleet' name: product_name '/{index}/_fleet/_fleet_msearch': post: tags: - fleet summary: "Run multiple Fleet searches\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_fleet/_fleet_msearch\n
\n
\n POST\n /_fleet/_fleet_msearch\n
\n
\n GET\n /{index}/_fleet/_fleet_msearch\n
\n
\n POST\n /{index}/_fleet/_fleet_msearch\n
\n \n\nRun several Fleet searches with a single API request.\nThe API follows the same structure as the multi search API.\nHowever, similar to the Fleet search API, it supports the `wait_for_checkpoints` parameter.\n\n## Required authorization\n\n* Index privileges: `read`\n" operationId: fleet-msearch parameters: - $ref: '#/components/parameters/fleet.msearch-index' - $ref: '#/components/parameters/fleet.msearch-allow_no_indices' - $ref: '#/components/parameters/fleet.msearch-ccs_minimize_roundtrips' - $ref: '#/components/parameters/fleet.msearch-expand_wildcards' - $ref: '#/components/parameters/fleet.msearch-ignore_throttled' - $ref: '#/components/parameters/fleet.msearch-ignore_unavailable' - $ref: '#/components/parameters/fleet.msearch-max_concurrent_searches' - $ref: '#/components/parameters/fleet.msearch-max_concurrent_shard_requests' - $ref: '#/components/parameters/fleet.msearch-pre_filter_shard_size' - $ref: '#/components/parameters/fleet.msearch-search_type' - $ref: '#/components/parameters/fleet.msearch-rest_total_hits_as_int' - $ref: '#/components/parameters/fleet.msearch-typed_keys' - $ref: '#/components/parameters/fleet.msearch-wait_for_checkpoints' - $ref: '#/components/parameters/fleet.msearch-allow_partial_search_results' requestBody: $ref: '#/components/requestBodies/fleet.msearch' responses: '200': $ref: '#/components/responses/fleet.msearch-200' x-state: Experimental; Added in 7.16.0 x-metaTags: - content: 'Elasticsearch, Fleet' name: product_name '/{index}/_fleet/_fleet_search': post: tags: - fleet summary: "Run a Fleet search\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /{index}/_fleet/_fleet_search\n
\n
\n POST\n /{index}/_fleet/_fleet_search\n
\n \n\nThe purpose of the Fleet search API is to provide an API where the search will be run only\nafter the provided checkpoint has been processed and is visible for searches inside of Elasticsearch.\n\n## Required authorization\n\n* Index privileges: `read`\n" operationId: fleet-search parameters: - $ref: '#/components/parameters/fleet.search-index' - $ref: '#/components/parameters/fleet.search-allow_no_indices' - $ref: '#/components/parameters/fleet.search-analyzer' - $ref: '#/components/parameters/fleet.search-analyze_wildcard' - $ref: '#/components/parameters/fleet.search-batched_reduce_size' - $ref: '#/components/parameters/fleet.search-ccs_minimize_roundtrips' - $ref: '#/components/parameters/fleet.search-default_operator' - $ref: '#/components/parameters/fleet.search-df' - $ref: '#/components/parameters/fleet.search-docvalue_fields' - $ref: '#/components/parameters/fleet.search-expand_wildcards' - $ref: '#/components/parameters/fleet.search-explain' - $ref: '#/components/parameters/fleet.search-ignore_throttled' - $ref: '#/components/parameters/fleet.search-ignore_unavailable' - $ref: '#/components/parameters/fleet.search-lenient' - $ref: '#/components/parameters/fleet.search-max_concurrent_shard_requests' - $ref: '#/components/parameters/fleet.search-preference' - $ref: '#/components/parameters/fleet.search-pre_filter_shard_size' - $ref: '#/components/parameters/fleet.search-request_cache' - $ref: '#/components/parameters/fleet.search-routing' - $ref: '#/components/parameters/fleet.search-scroll' - $ref: '#/components/parameters/fleet.search-search_type' - $ref: '#/components/parameters/fleet.search-stats' - $ref: '#/components/parameters/fleet.search-stored_fields' - $ref: '#/components/parameters/fleet.search-suggest_field' - $ref: '#/components/parameters/fleet.search-suggest_mode' - $ref: '#/components/parameters/fleet.search-suggest_size' - $ref: '#/components/parameters/fleet.search-suggest_text' - $ref: '#/components/parameters/fleet.search-terminate_after' - $ref: '#/components/parameters/fleet.search-timeout' - $ref: '#/components/parameters/fleet.search-track_total_hits' - $ref: '#/components/parameters/fleet.search-track_scores' - $ref: '#/components/parameters/fleet.search-typed_keys' - $ref: '#/components/parameters/fleet.search-rest_total_hits_as_int' - $ref: '#/components/parameters/fleet.search-version' - $ref: '#/components/parameters/fleet.search-_source' - $ref: '#/components/parameters/fleet.search-_source_excludes' - $ref: '#/components/parameters/fleet.search-_source_includes' - $ref: '#/components/parameters/fleet.search-seq_no_primary_term' - $ref: '#/components/parameters/fleet.search-q' - $ref: '#/components/parameters/fleet.search-size' - $ref: '#/components/parameters/fleet.search-from' - $ref: '#/components/parameters/fleet.search-sort' - $ref: '#/components/parameters/fleet.search-wait_for_checkpoints' - $ref: '#/components/parameters/fleet.search-allow_partial_search_results' requestBody: $ref: '#/components/requestBodies/fleet.search' responses: '200': $ref: '#/components/responses/fleet.search-200' x-state: Experimental; Added in 7.16.0 x-metaTags: - content: 'Elasticsearch, Fleet' name: product_name '/_reindex/{task_id}': get: tags: - reindex summary: Get the status and progress of a specific reindex task description: "This API follows reindex tasks across node-shutdown relocations, so callers can\nkeep using the original task ID throughout the lifetime of the operation.\nReturned task IDs and timings reflect the original task, not its relocated successor.\nRelocated task IDs are also supported. They are followed transparently and return the task ID and timings of the original task.\n\nWhen the task ID cannot be resolved, the API returns the response below with a 404 status code.\nThis response is used whether the ID is unknown, refers to a non-reindex task, refers to a sliced child subtask, or refers to a task whose node left the cluster with no stored result (e.g. a non-graceful shutdown).\n```\n{\n \"error\": {\n \"type\": \"resource_not_found_exception\",\n \"reason\": \"Reindex operation [r1A2WoRbTwKZ516z6NEs5A:36619] not found\"\n },\n \"status\": 404\n}\n```\n\n## Required authorization\n\n* Cluster privileges: `monitor`,`monitor_reindex`,`manage_reindex`\n" operationId: get-reindex parameters: - name: task_id in: path description: The ID of the reindex task to retrieve. required: true schema: $ref: '#/components/schemas/_types.TaskId' - name: wait_for_completion in: query description: 'If `true`, the request blocks until the reindex task completes, then returns the result.' schema: type: boolean default: false - name: timeout in: query description: The period to wait for the reindex task to complete when `wait_for_completion` is `true`. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - completed - id - start_time_in_millis - running_time_in_nanos - cancelled type: object properties: completed: type: boolean description: Whether the reindex task has completed. id: allOf: - $ref: '#/components/schemas/_types.TaskId' description: The ID of the reindex task. The value is the ID assigned when the task was first created and remains stable across node-shutdown relocations. description: type: string description: 'A sanitized description of the reindex operation (source and destination indices, and optionally remote host info).' start_time_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: 'The time at which the reindex task started, in milliseconds since the Unix epoch.' start_time: type: string description: "The time at which the reindex task started, as an ISO 8601 formatted string.\nOnly present when the request includes the `?human=true` query parameter." running_time: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The elapsed running time of the reindex task, in a human-readable format.\nOnly present when the request includes the `?human=true` query parameter." running_time_in_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' description: 'The elapsed running time of the reindex task, in nanoseconds.' cancelled: type: boolean description: Whether the reindex task has been cancelled. status: allOf: - $ref: '#/components/schemas/_types.ReindexStatus' description: The current progress of the reindex operation. error: allOf: - $ref: '#/components/schemas/_types.ErrorCause' description: 'The error that caused the reindex task to fail, if any.' response: allOf: - $ref: '#/components/schemas/_types.ReindexTaskResult' description: 'The final result of the completed reindex operation, if the task has finished successfully.' examples: GetReindexResponseExample1: summary: In-progress task description: "A successful response for an in-progress reindex task. The `status` block reports current progress; the `response` block is absent until the task completes.\n" value: "{\n \"completed\": false,\n \"id\": \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n \"description\": \"reindex from [reindex_src] to [reindex_dst]\",\n \"start_time_in_millis\": 1778265266199,\n \"running_time_in_nanos\": 1588606084,\n \"cancelled\": false,\n \"status\": {\n \"total\": 0,\n \"updated\": 0,\n \"created\": 0,\n \"deleted\": 0,\n \"batches\": 0,\n \"version_conflicts\": 0,\n \"noops\": 0,\n \"retries\": {\n \"bulk\": 0,\n \"search\": 0\n },\n \"throttled_millis\": 0,\n \"requests_per_second\": 4.0,\n \"throttled_until_millis\": 0,\n \"slices\": [\n null,\n null\n ]\n }\n}" GetReindexResponseExample2: summary: Completed task description: "A successful response for a completed reindex task. The final outcome is in the `response` block.\n" value: "{\n \"completed\": true,\n \"id\": \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n \"description\": \"reindex from [reindex_src] to [reindex_dst]\",\n \"start_time_in_millis\": 1778265266199,\n \"running_time_in_nanos\": 35457187167,\n \"cancelled\": false,\n \"status\": {\n \"total\": 240,\n \"updated\": 0,\n \"created\": 240,\n \"deleted\": 0,\n \"batches\": 120,\n \"version_conflicts\": 0,\n \"noops\": 0,\n \"retries\": {\n \"bulk\": 0,\n \"search\": 0\n },\n \"throttled_millis\": 2999,\n \"requests_per_second\": -1.0,\n \"throttled_until_millis\": 0,\n \"slices\": [\n {\n \"slice_id\": 0,\n \"total\": 174,\n \"updated\": 0,\n \"created\": 174,\n \"deleted\": 0,\n \"batches\": 87,\n \"version_conflicts\": 0,\n \"noops\": 0,\n \"retries\": {\n \"bulk\": 0,\n \"search\": 0\n },\n \"throttled_millis\": 999,\n \"requests_per_second\": -1.0,\n \"throttled_until_millis\": 0\n },\n {\n \"slice_id\": 1,\n \"total\": 66,\n \"updated\": 0,\n \"created\": 66,\n \"deleted\": 0,\n \"batches\": 33,\n \"version_conflicts\": 0,\n \"noops\": 0,\n \"retries\": {\n \"bulk\": 0,\n \"search\": 0\n },\n \"throttled_millis\": 1999,\n \"requests_per_second\": -1.0,\n \"throttled_until_millis\": 0\n }\n ]\n },\n \"response\": {\n \"took\": 35434,\n \"timed_out\": false,\n \"total\": 240,\n \"updated\": 0,\n \"created\": 240,\n \"deleted\": 0,\n \"batches\": 120,\n \"version_conflicts\": 0,\n \"noops\": 0,\n \"retries\": {\n \"bulk\": 0,\n \"search\": 0\n },\n \"throttled\": \"2.9s\",\n \"throttled_millis\": 2999,\n \"requests_per_second\": -1.0,\n \"throttled_until\": \"0s\",\n \"throttled_until_millis\": 0,\n \"slices\": [\n {\n \"slice_id\": 0,\n \"total\": 174,\n \"updated\": 0,\n \"created\": 174,\n \"deleted\": 0,\n \"batches\": 87,\n \"version_conflicts\": 0,\n \"noops\": 0,\n \"retries\": {\n \"bulk\": 0,\n \"search\": 0\n },\n \"throttled\": \"999.9ms\",\n \"throttled_millis\": 999,\n \"requests_per_second\": -1.0,\n \"throttled_until\": \"0s\",\n \"throttled_until_millis\": 0\n },\n {\n \"slice_id\": 1,\n \"total\": 66,\n \"updated\": 0,\n \"created\": 66,\n \"deleted\": 0,\n \"batches\": 33,\n \"version_conflicts\": 0,\n \"noops\": 0,\n \"retries\": {\n \"bulk\": 0,\n \"search\": 0\n },\n \"throttled\": \"1.9s\",\n \"throttled_millis\": 1999,\n \"requests_per_second\": -1.0,\n \"throttled_until\": \"0s\",\n \"throttled_until_millis\": 0\n }\n ],\n \"failures\": []\n }\n}" x-state: Generally available; Added in 9.5.0 x-codeSamples: - lang: Console source: "GET _reindex/r1A2WoRbTwKZ516z6NEs5A:36619\n" - lang: Python source: "resp = client.get_reindex(\n task_id=\"r1A2WoRbTwKZ516z6NEs5A:36619\",\n)" - lang: JavaScript source: "const response = await client.getReindex({\n task_id: \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n});" - lang: Ruby source: "response = client.get_reindex(\n task_id: \"r1A2WoRbTwKZ516z6NEs5A:36619\"\n)" - lang: PHP source: "$resp = $client->getReindex([\n \"task_id\" => \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_reindex/r1A2WoRbTwKZ516z6NEs5A:36619"' - lang: C# source: 'var response = await client.GetReindexAsync(taskId: "r1A2WoRbTwKZ516z6NEs5A:36619");' - lang: Java source: "client.getReindex(g -> g\n .taskId(\"r1A2WoRbTwKZ516z6NEs5A:36619\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_script_context: get: tags: - script summary: Get script contexts description: "Get a list of supported script contexts and their methods.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: get-script-context responses: '200': description: '' content: application/json: schema: required: - contexts type: object properties: contexts: type: array items: $ref: '#/components/schemas/_global.get_script_context.Context' x-state: Generally available x-codeSamples: - lang: Console source: "GET _script_context\n" - lang: Python source: resp = client.get_script_context() - lang: JavaScript source: const response = await client.getScriptContext(); - lang: Ruby source: response = client.get_script_context - lang: PHP source: $resp = $client->getScriptContext(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_script_context"' - lang: C# source: var response = await client.GetScriptContextAsync(); - lang: Java source: "client.getScriptContext();\n" x-metaTags: - content: Elasticsearch name: product_name /_script_language: get: tags: - script summary: Get script languages description: "Get a list of available script types, languages, and contexts.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: get-script-languages responses: '200': description: '' content: application/json: schema: required: - language_contexts - types_allowed type: object properties: language_contexts: type: array items: $ref: '#/components/schemas/_global.get_script_languages.LanguageContext' types_allowed: type: array items: type: string x-state: Generally available x-codeSamples: - lang: Console source: "GET _script_language\n" - lang: Python source: resp = client.get_script_languages() - lang: JavaScript source: const response = await client.getScriptLanguages(); - lang: Ruby source: response = client.get_script_languages - lang: PHP source: $resp = $client->getScriptLanguages(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_script_language"' - lang: C# source: var response = await client.GetScriptLanguagesAsync(); - lang: Java source: "client.getScriptLanguages();\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_graph/explore': post: tags: - graph summary: "Explore graph analytics\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /{index}/_graph/explore\n
\n
\n POST\n /{index}/_graph/explore\n
\n \n\nExtract and summarize information about the documents and terms in an Elasticsearch data stream or index.\nThe easiest way to understand the behavior of this API is to use the Graph UI to explore connections.\nAn initial request to the `_explore` API contains a seed query that identifies the documents of interest and specifies the fields that define the vertices and connections you want to include in the graph.\nSubsequent requests enable you to spider out from one more vertices of interest.\nYou can exclude vertices that have already been returned.\n\n## Required authorization\n\n* Index privileges: `read`\n" externalDocs: description: Learn more about graphs url: https://www.elastic.co/docs/explore-analyze/visualize/graph x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/graph-explore-api.html operationId: graph-explore parameters: - $ref: '#/components/parameters/graph.explore-index' - $ref: '#/components/parameters/graph.explore-routing' - $ref: '#/components/parameters/graph.explore-timeout' requestBody: $ref: '#/components/requestBodies/graph.explore' responses: '200': $ref: '#/components/responses/graph.explore-200' x-state: Generally available x-codeSamples: - lang: Console source: "POST clicklogs/_graph/explore\n{\n \"query\": {\n \"match\": {\n \"query.raw\": \"midi\"\n }\n },\n \"vertices\": [\n {\n \"field\": \"product\"\n }\n ],\n \"connections\": {\n \"vertices\": [\n {\n \"field\": \"query.raw\"\n }\n ]\n }\n}" - lang: Python source: "resp = client.graph.explore(\n index=\"clicklogs\",\n query={\n \"match\": {\n \"query.raw\": \"midi\"\n }\n },\n vertices=[\n {\n \"field\": \"product\"\n }\n ],\n connections={\n \"vertices\": [\n {\n \"field\": \"query.raw\"\n }\n ]\n },\n)" - lang: JavaScript source: "const response = await client.graph.explore({\n index: \"clicklogs\",\n query: {\n match: {\n \"query.raw\": \"midi\",\n },\n },\n vertices: [\n {\n field: \"product\",\n },\n ],\n connections: {\n vertices: [\n {\n field: \"query.raw\",\n },\n ],\n },\n});" - lang: Ruby source: "response = client.graph.explore(\n index: \"clicklogs\",\n body: {\n \"query\": {\n \"match\": {\n \"query.raw\": \"midi\"\n }\n },\n \"vertices\": [\n {\n \"field\": \"product\"\n }\n ],\n \"connections\": {\n \"vertices\": [\n {\n \"field\": \"query.raw\"\n }\n ]\n }\n }\n)" - lang: PHP source: "$resp = $client->graph()->explore([\n \"index\" => \"clicklogs\",\n \"body\" => [\n \"query\" => [\n \"match\" => [\n \"query.raw\" => \"midi\",\n ],\n ],\n \"vertices\" => array(\n [\n \"field\" => \"product\",\n ],\n ),\n \"connections\" => [\n \"vertices\" => array(\n [\n \"field\" => \"query.raw\",\n ],\n ),\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":{"match":{"query.raw":"midi"}},"vertices":[{"field":"product"}],"connections":{"vertices":[{"field":"query.raw"}]}}'' "$ELASTICSEARCH_URL/clicklogs/_graph/explore"' - lang: C# source: "var response = await client.Graph\n .ExploreAsync(indices: new[] { \"clicklogs\" }, d1 => d1\n .Connections(d2 => d2\n .Vertices(d3 => d3\n .Field(x => x.Query.Raw)\n )\n )\n .Query(d2 => d2\n .Match(d3 => d3\n .Field(x => x.Query.Raw)\n .Query(\"midi\")\n )\n )\n .Vertices(d2 => d2\n .Field(x => x.Product)\n )\n );" - lang: Java source: "client.graph().explore(e -> e\n .connections(c -> c\n .vertices(v -> v\n .field(\"query.raw\")\n )\n )\n .index(\"clicklogs\")\n .query(q -> q\n .match(m -> m\n .field(\"query.raw\")\n .query(FieldValue.of(\"midi\"))\n )\n )\n .vertices(v -> v\n .field(\"product\")\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_health_report/{feature}': get: tags: - health_report summary: "Get the cluster health\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_health_report\n
\n
\n GET\n /_health_report/{feature}\n
\n \n\nGet a report with the health status of an Elasticsearch cluster.\nThe report contains a list of indicators that compose Elasticsearch functionality.\n\nEach indicator has a health status of: green, unknown, yellow or red.\nThe indicator will provide an explanation and metadata describing the reason for its current health status.\n\nThe cluster’s status is controlled by the worst indicator status.\n\nIn the event that an indicator’s status is non-green, a list of impacts may be present in the indicator result which detail the functionalities that are negatively affected by the health issue.\nEach impact carries with it a severity level, an area of the system that is affected, and a simple description of the impact on the system.\n\nSome health indicators can determine the root cause of a health problem and prescribe a set of steps that can be performed in order to improve the health of the system.\nThe root cause and remediation steps are encapsulated in a diagnosis.\nA diagnosis contains a cause detailing a root cause analysis, an action containing a brief description of the steps to take to fix the problem, the list of affected resources (if applicable), and a detailed step-by-step troubleshooting guide to fix the diagnosed problem.\n\nNOTE: The health indicators perform root cause analysis of non-green health statuses. This can be computationally expensive when called frequently.\nWhen setting up automated polling of the API for health status, set verbose to false to disable the more expensive analysis logic.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: health-report parameters: - $ref: '#/components/parameters/health_report-feature' - $ref: '#/components/parameters/health_report-timeout' - $ref: '#/components/parameters/health_report-verbose' - $ref: '#/components/parameters/health_report-size' responses: '200': $ref: '#/components/responses/health_report-200' x-state: Generally available; Added in 8.7.0 x-codeSamples: - lang: Console source: "GET _health_report\n" - lang: Python source: resp = client.health_report() - lang: JavaScript source: const response = await client.healthReport(); - lang: Ruby source: response = client.health_report - lang: PHP source: $resp = $client->healthReport(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_health_report"' - lang: C# source: var response = await client.HealthReportAsync(); - lang: Java source: "client.healthReport(h -> h);\n" x-metaTags: - content: Elasticsearch name: product_name '/_ilm/policy/{policy}': get: tags: - ilm summary: "Get lifecycle policies\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ilm/policy\n
\n
\n GET\n /_ilm/policy/{policy}\n
\n\n## Required authorization\n\n* Cluster privileges: `manage_ilm`,`read_ilm`\n" operationId: ilm-get-lifecycle parameters: - $ref: '#/components/parameters/ilm.get_lifecycle-policy' - $ref: '#/components/parameters/ilm.get_lifecycle-master_timeout' - $ref: '#/components/parameters/ilm.get_lifecycle-timeout' responses: '200': $ref: '#/components/responses/ilm.get_lifecycle-200' x-state: Generally available; Added in 6.6.0 x-codeSamples: - lang: Console source: "GET _ilm/policy/my_policy\n" - lang: Python source: "resp = client.ilm.get_lifecycle(\n name=\"my_policy\",\n)" - lang: JavaScript source: "const response = await client.ilm.getLifecycle({\n name: \"my_policy\",\n});" - lang: Ruby source: "response = client.ilm.get_lifecycle(\n policy: \"my_policy\"\n)" - lang: PHP source: "$resp = $client->ilm()->getLifecycle([\n \"policy\" => \"my_policy\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ilm/policy/my_policy"' - lang: C# source: "var response = await client.IndexLifecycleManagement\n .GetLifecycleAsync(d1 => d1\n .Name(\"my_policy\")\n );" - lang: Java source: "client.ilm().getLifecycle(g -> g\n .name(\"my_policy\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - ilm summary: Create or update a lifecycle policy description: "If the specified policy exists, it is replaced and the policy version is incremented.\n\nNOTE: Only the latest version of the policy is stored, you cannot revert to previous versions.\n\n## Required authorization\n\n* Index privileges: `manage`\n* Cluster privileges: `manage_ilm`\n" externalDocs: description: About index lifecycle management url: https://www.elastic.co/docs/manage-data/lifecycle/index-lifecycle-management/index-lifecycle x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/ilm-put-lifecycle.html operationId: ilm-put-lifecycle parameters: - name: policy in: path description: Identifier for the policy. required: true schema: $ref: '#/components/schemas/_types.Name' - name: master_timeout in: query description: 'Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: 'Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: type: object properties: policy: allOf: - $ref: '#/components/schemas/ilm._types.Policy' examples: PutLifecycleRequestExample1: description: "Run `PUT _ilm/policy/my_policy` to create a new policy with arbitrary metadata.\n" value: "{\n \"policy\": {\n \"_meta\": {\n \"description\": \"used for nginx log\",\n \"project\": {\n \"name\": \"myProject\",\n \"department\": \"myDepartment\"\n }\n },\n \"phases\": {\n \"warm\": {\n \"min_age\": \"10d\",\n \"actions\": {\n \"forcemerge\": {\n \"max_num_segments\": 1\n }\n }\n },\n \"delete\": {\n \"min_age\": \"30d\",\n \"actions\": {\n \"delete\": {}\n }\n }\n }\n }\n}" x-codeSamples: - lang: Console source: "PUT _ilm/policy/my_policy\n{\n \"policy\": {\n \"_meta\": {\n \"description\": \"used for nginx log\",\n \"project\": {\n \"name\": \"myProject\",\n \"department\": \"myDepartment\"\n }\n },\n \"phases\": {\n \"warm\": {\n \"min_age\": \"10d\",\n \"actions\": {\n \"forcemerge\": {\n \"max_num_segments\": 1\n }\n }\n },\n \"delete\": {\n \"min_age\": \"30d\",\n \"actions\": {\n \"delete\": {}\n }\n }\n }\n }\n}" - lang: Python source: "resp = client.ilm.put_lifecycle(\n name=\"my_policy\",\n policy={\n \"_meta\": {\n \"description\": \"used for nginx log\",\n \"project\": {\n \"name\": \"myProject\",\n \"department\": \"myDepartment\"\n }\n },\n \"phases\": {\n \"warm\": {\n \"min_age\": \"10d\",\n \"actions\": {\n \"forcemerge\": {\n \"max_num_segments\": 1\n }\n }\n },\n \"delete\": {\n \"min_age\": \"30d\",\n \"actions\": {\n \"delete\": {}\n }\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.ilm.putLifecycle({\n name: \"my_policy\",\n policy: {\n _meta: {\n description: \"used for nginx log\",\n project: {\n name: \"myProject\",\n department: \"myDepartment\",\n },\n },\n phases: {\n warm: {\n min_age: \"10d\",\n actions: {\n forcemerge: {\n max_num_segments: 1,\n },\n },\n },\n delete: {\n min_age: \"30d\",\n actions: {\n delete: {},\n },\n },\n },\n },\n});" - lang: Ruby source: "response = client.ilm.put_lifecycle(\n policy: \"my_policy\",\n body: {\n \"policy\": {\n \"_meta\": {\n \"description\": \"used for nginx log\",\n \"project\": {\n \"name\": \"myProject\",\n \"department\": \"myDepartment\"\n }\n },\n \"phases\": {\n \"warm\": {\n \"min_age\": \"10d\",\n \"actions\": {\n \"forcemerge\": {\n \"max_num_segments\": 1\n }\n }\n },\n \"delete\": {\n \"min_age\": \"30d\",\n \"actions\": {\n \"delete\": {}\n }\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->ilm()->putLifecycle([\n \"policy\" => \"my_policy\",\n \"body\" => [\n \"policy\" => [\n \"_meta\" => [\n \"description\" => \"used for nginx log\",\n \"project\" => [\n \"name\" => \"myProject\",\n \"department\" => \"myDepartment\",\n ],\n ],\n \"phases\" => [\n \"warm\" => [\n \"min_age\" => \"10d\",\n \"actions\" => [\n \"forcemerge\" => [\n \"max_num_segments\" => 1,\n ],\n ],\n ],\n \"delete\" => [\n \"min_age\" => \"30d\",\n \"actions\" => [\n \"delete\" => new ArrayObject([]),\n ],\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"policy":{"_meta":{"description":"used for nginx log","project":{"name":"myProject","department":"myDepartment"}},"phases":{"warm":{"min_age":"10d","actions":{"forcemerge":{"max_num_segments":1}}},"delete":{"min_age":"30d","actions":{"delete":{}}}}}}'' "$ELASTICSEARCH_URL/_ilm/policy/my_policy"' - lang: C# source: "var response = await client.IndexLifecycleManagement\n .PutLifecycleAsync(name: \"my_policy\", d1 => d1\n .Policy(d2 => d2\n .Meta(new Dictionary()\n {\n { \"description\", \"used for nginx log\" },\n { \"project\", JsonSerializer.Deserialize(\"\"\"\n {\n \"name\": \"myProject\",\n \"department\": \"myDepartment\"\n }\n \"\"\") }\n })\n .Phases(d3 => d3\n .Delete(d4 => d4\n .Actions(d5 => d5\n .Delete()\n )\n .MinAge(\"30d\")\n )\n .Warm(d4 => d4\n .Actions(d5 => d5\n .Forcemerge(d6 => d6\n .MaxNumSegments(1)\n )\n )\n .MinAge(\"10d\")\n )\n )\n )\n );" - lang: Java source: "client.ilm().putLifecycle(p -> p\n .name(\"my_policy\")\n .policy(po -> po\n .phases(ph -> ph\n .delete(d -> d\n .actions(a -> a\n .delete(de -> de)\n )\n .minAge(m -> m\n .time(\"30d\")\n )\n )\n .warm(w -> w\n .actions(a -> a\n .forcemerge(f -> f\n .maxNumSegments(1)\n )\n )\n .minAge(m -> m\n .time(\"10d\")\n )\n )\n )\n .meta(Map.of(\"description\", JsonData.fromJson(\"\\\"used for nginx log\\\"\"),\"project\", JsonData.fromJson(\"\"\"\n{\"name\":\"myProject\",\"department\":\"myDepartment\"}\n\"\"\")))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: PutLifecycleResponseExample1: description: A successful response when creating a new lifecycle policy. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 6.6.0 x-codeSamples: - lang: Console source: "PUT _ilm/policy/my_policy\n{\n \"policy\": {\n \"_meta\": {\n \"description\": \"used for nginx log\",\n \"project\": {\n \"name\": \"myProject\",\n \"department\": \"myDepartment\"\n }\n },\n \"phases\": {\n \"warm\": {\n \"min_age\": \"10d\",\n \"actions\": {\n \"forcemerge\": {\n \"max_num_segments\": 1\n }\n }\n },\n \"delete\": {\n \"min_age\": \"30d\",\n \"actions\": {\n \"delete\": {}\n }\n }\n }\n }\n}" - lang: Python source: "resp = client.ilm.put_lifecycle(\n name=\"my_policy\",\n policy={\n \"_meta\": {\n \"description\": \"used for nginx log\",\n \"project\": {\n \"name\": \"myProject\",\n \"department\": \"myDepartment\"\n }\n },\n \"phases\": {\n \"warm\": {\n \"min_age\": \"10d\",\n \"actions\": {\n \"forcemerge\": {\n \"max_num_segments\": 1\n }\n }\n },\n \"delete\": {\n \"min_age\": \"30d\",\n \"actions\": {\n \"delete\": {}\n }\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.ilm.putLifecycle({\n name: \"my_policy\",\n policy: {\n _meta: {\n description: \"used for nginx log\",\n project: {\n name: \"myProject\",\n department: \"myDepartment\",\n },\n },\n phases: {\n warm: {\n min_age: \"10d\",\n actions: {\n forcemerge: {\n max_num_segments: 1,\n },\n },\n },\n delete: {\n min_age: \"30d\",\n actions: {\n delete: {},\n },\n },\n },\n },\n});" - lang: Ruby source: "response = client.ilm.put_lifecycle(\n policy: \"my_policy\",\n body: {\n \"policy\": {\n \"_meta\": {\n \"description\": \"used for nginx log\",\n \"project\": {\n \"name\": \"myProject\",\n \"department\": \"myDepartment\"\n }\n },\n \"phases\": {\n \"warm\": {\n \"min_age\": \"10d\",\n \"actions\": {\n \"forcemerge\": {\n \"max_num_segments\": 1\n }\n }\n },\n \"delete\": {\n \"min_age\": \"30d\",\n \"actions\": {\n \"delete\": {}\n }\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->ilm()->putLifecycle([\n \"policy\" => \"my_policy\",\n \"body\" => [\n \"policy\" => [\n \"_meta\" => [\n \"description\" => \"used for nginx log\",\n \"project\" => [\n \"name\" => \"myProject\",\n \"department\" => \"myDepartment\",\n ],\n ],\n \"phases\" => [\n \"warm\" => [\n \"min_age\" => \"10d\",\n \"actions\" => [\n \"forcemerge\" => [\n \"max_num_segments\" => 1,\n ],\n ],\n ],\n \"delete\" => [\n \"min_age\" => \"30d\",\n \"actions\" => [\n \"delete\" => new ArrayObject([]),\n ],\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"policy":{"_meta":{"description":"used for nginx log","project":{"name":"myProject","department":"myDepartment"}},"phases":{"warm":{"min_age":"10d","actions":{"forcemerge":{"max_num_segments":1}}},"delete":{"min_age":"30d","actions":{"delete":{}}}}}}'' "$ELASTICSEARCH_URL/_ilm/policy/my_policy"' - lang: C# source: "var response = await client.IndexLifecycleManagement\n .PutLifecycleAsync(name: \"my_policy\", d1 => d1\n .Policy(d2 => d2\n .Meta(new Dictionary()\n {\n { \"description\", \"used for nginx log\" },\n { \"project\", JsonSerializer.Deserialize(\"\"\"\n {\n \"name\": \"myProject\",\n \"department\": \"myDepartment\"\n }\n \"\"\") }\n })\n .Phases(d3 => d3\n .Delete(d4 => d4\n .Actions(d5 => d5\n .Delete()\n )\n .MinAge(\"30d\")\n )\n .Warm(d4 => d4\n .Actions(d5 => d5\n .Forcemerge(d6 => d6\n .MaxNumSegments(1)\n )\n )\n .MinAge(\"10d\")\n )\n )\n )\n );" - lang: Java source: "client.ilm().putLifecycle(p -> p\n .name(\"my_policy\")\n .policy(po -> po\n .phases(ph -> ph\n .delete(d -> d\n .actions(a -> a\n .delete(de -> de)\n )\n .minAge(m -> m\n .time(\"30d\")\n )\n )\n .warm(w -> w\n .actions(a -> a\n .forcemerge(f -> f\n .maxNumSegments(1)\n )\n )\n .minAge(m -> m\n .time(\"10d\")\n )\n )\n )\n .meta(Map.of(\"description\", JsonData.fromJson(\"\\\"used for nginx log\\\"\"),\"project\", JsonData.fromJson(\"\"\"\n{\"name\":\"myProject\",\"department\":\"myDepartment\"}\n\"\"\")))\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - ilm summary: Delete a lifecycle policy description: "You cannot delete policies that are currently in use. If the policy is being used to manage any indices, the request fails and returns an error.\n\n## Required authorization\n\n* Cluster privileges: `manage_ilm`\n" operationId: ilm-delete-lifecycle parameters: - name: policy in: path description: Identifier for the policy. required: true schema: $ref: '#/components/schemas/_types.Name' - name: master_timeout in: query description: 'Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: 'Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: DeleteLifecycleResponseExample1: description: A successful response when deleting a lifecycle policy. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 6.6.0 x-codeSamples: - lang: Console source: "DELETE _ilm/policy/my_policy\n" - lang: Python source: "resp = client.ilm.delete_lifecycle(\n name=\"my_policy\",\n)" - lang: JavaScript source: "const response = await client.ilm.deleteLifecycle({\n name: \"my_policy\",\n});" - lang: Ruby source: "response = client.ilm.delete_lifecycle(\n policy: \"my_policy\"\n)" - lang: PHP source: "$resp = $client->ilm()->deleteLifecycle([\n \"policy\" => \"my_policy\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ilm/policy/my_policy"' - lang: C# source: 'var response = await client.IndexLifecycleManagement.DeleteLifecycleAsync(name: "my_policy");' - lang: Java source: "client.ilm().deleteLifecycle(d -> d\n .name(\"my_policy\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_ilm/explain': get: tags: - ilm summary: Explain the lifecycle state description: "Get the current lifecycle status for one or more indices.\nFor data streams, the API retrieves the current lifecycle status for the stream's backing indices.\n\nThe response indicates when the index entered each lifecycle state, provides the definition of the running phase, and information about any failures.\n\n## Required authorization\n\n* Index privileges: `view_index_metadata`,`manage_ilm`\n" externalDocs: description: About explaining lifecycle state url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/explain-lifecycle x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/ilm-explain-lifecycle.html operationId: ilm-explain-lifecycle parameters: - name: index in: path description: "Comma-separated list of data streams, indices, and aliases to target. Supports wildcards (`*`).\nTo target all data streams and indices, use `*` or `_all`." required: true schema: $ref: '#/components/schemas/_types.IndexName' - name: only_errors in: query description: 'Filters the returned indices to only indices that are managed by ILM and are in an error state, either due to an encountering an error while executing the policy, or attempting to use a policy that does not exist.' schema: type: boolean - name: only_managed in: query description: Filters the returned indices to only indices that are managed by ILM. schema: type: boolean - name: master_timeout in: query description: 'Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - indices type: object properties: indices: type: object additionalProperties: $ref: '#/components/schemas/ilm.explain_lifecycle.LifecycleExplain' examples: ExplainLifecycleResponseExample1: description: A successful response when retrieving the current ILM status for an index. value: "{\n \"indices\": {\n \"my-index-000001\": {\n \"index\": \"my-index-000001\",\n \"index_creation_date_millis\": 1538475653281,\n \"index_creation_date\": \"2018-10-15T13:45:21.981Z\",\n \"time_since_index_creation\": \"15s\",\n \"managed\": true,\n \"policy\": \"my_policy\",\n \"lifecycle_date_millis\": 1538475653281,\n \"lifecycle_date\": \"2018-10-15T13:45:21.981Z\",\n \"age\": \"15s\",\n \"phase\": \"new\",\n \"phase_time_millis\": 1538475653317,\n \"phase_time\": \"2018-10-15T13:45:22.577Z\",\n \"action\": \"complete\"\n \"action_time_millis\": 1538475653317,\n \"action_time\": \"2018-10-15T13:45:22.577Z\",\n \"step\": \"complete\",\n \"step_time_millis\": 1538475653317,\n \"step_time\": \"2018-10-15T13:45:22.577Z\"\n }\n }\n}" x-state: Generally available; Added in 6.6.0 x-codeSamples: - lang: Console source: "GET .ds-timeseries-*/_ilm/explain\n" - lang: Python source: "resp = client.ilm.explain_lifecycle(\n index=\".ds-timeseries-*\",\n)" - lang: JavaScript source: "const response = await client.ilm.explainLifecycle({\n index: \".ds-timeseries-*\",\n});" - lang: Ruby source: "response = client.ilm.explain_lifecycle(\n index: \".ds-timeseries-*\"\n)" - lang: PHP source: "$resp = $client->ilm()->explainLifecycle([\n \"index\" => \".ds-timeseries-*\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/.ds-timeseries-*/_ilm/explain"' - lang: C# source: 'var response = await client.IndexLifecycleManagement.ExplainLifecycleAsync(index: ".ds-timeseries-*");' - lang: Java source: "client.ilm().explainLifecycle(e -> e\n .index(\".ds-timeseries-*\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_ilm/status: get: tags: - ilm summary: Get the ILM status description: "Get the current index lifecycle management status.\n\n## Required authorization\n\n* Cluster privileges: `read_ilm`\n" operationId: ilm-get-status responses: '200': description: '' content: application/json: schema: required: - operation_mode type: object properties: operation_mode: allOf: - $ref: '#/components/schemas/_types.LifecycleOperationMode' examples: GetILMStatusResponseExample1: description: A successful response when retrieving the current ILM status. value: "{\n \"operation_mode\": \"RUNNING\"\n}" x-state: Generally available; Added in 6.6.0 x-codeSamples: - lang: Console source: "GET _ilm/status\n" - lang: Python source: resp = client.ilm.get_status() - lang: JavaScript source: const response = await client.ilm.getStatus(); - lang: Ruby source: response = client.ilm.get_status - lang: PHP source: $resp = $client->ilm()->getStatus(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ilm/status"' - lang: C# source: var response = await client.IndexLifecycleManagement.GetStatusAsync(); - lang: Java source: "client.ilm().getStatus();\n" x-metaTags: - content: Elasticsearch name: product_name /_ilm/migrate_to_data_tiers: post: tags: - ilm summary: Migrate to data tiers routing description: "Switch the indices, ILM policies, and legacy, composable, and component templates from using custom node attributes and attribute-based allocation filters to using data tiers.\nOptionally, delete one legacy index template.\nUsing node roles enables ILM to automatically move the indices between data tiers.\n\nMigrating away from custom node attributes routing can be manually performed.\nThis API provides an automated way of performing three out of the four manual steps listed in the migration guide:\n\n1. Stop setting the custom hot attribute on new indices.\n1. Remove custom allocation settings from existing ILM policies.\n1. Replace custom allocation settings from existing indices with the corresponding tier preference.\n\nILM must be stopped before performing the migration.\nUse the stop ILM and get ILM status APIs to wait until the reported operation mode is `STOPPED`.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" externalDocs: description: About migrating index allocation url: https://www.elastic.co/docs/manage-data/lifecycle/index-lifecycle-management/migrate-index-allocation-filters-to-node-roles x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/ilm-migrate-to-data-tiers.html operationId: ilm-migrate-to-data-tiers parameters: - name: dry_run in: query description: "If true, simulates the migration from node attributes based allocation filters to data tiers, but does not perform the migration.\nThis provides a way to retrieve the indices and ILM policies that need to be migrated." schema: type: boolean default: false - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error.\nIt can also be set to `-1` to indicate that the request should never timeout." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: type: object properties: legacy_template_to_delete: type: string node_attribute: type: string examples: MigrateToDataTiersRequestExample1: description: "Run `POST /_ilm/migrate_to_data_tiers` to migrate the indices, ILM policies, legacy templates, composable, and component templates away from defining custom allocation filtering using the `custom_attribute_name` node attribute. It also deletes the legacy template with name `global-template` if it exists in the system.\n" value: "{\n \"legacy_template_to_delete\": \"global-template\",\n \"node_attribute\": \"custom_attribute_name\"\n}" x-codeSamples: - lang: Console source: "POST /_ilm/migrate_to_data_tiers\n{\n \"legacy_template_to_delete\": \"global-template\",\n \"node_attribute\": \"custom_attribute_name\"\n}" - lang: Python source: "resp = client.ilm.migrate_to_data_tiers(\n legacy_template_to_delete=\"global-template\",\n node_attribute=\"custom_attribute_name\",\n)" - lang: JavaScript source: "const response = await client.ilm.migrateToDataTiers({\n legacy_template_to_delete: \"global-template\",\n node_attribute: \"custom_attribute_name\",\n});" - lang: Ruby source: "response = client.ilm.migrate_to_data_tiers(\n body: {\n \"legacy_template_to_delete\": \"global-template\",\n \"node_attribute\": \"custom_attribute_name\"\n }\n)" - lang: PHP source: "$resp = $client->ilm()->migrateToDataTiers([\n \"body\" => [\n \"legacy_template_to_delete\" => \"global-template\",\n \"node_attribute\" => \"custom_attribute_name\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"legacy_template_to_delete":"global-template","node_attribute":"custom_attribute_name"}'' "$ELASTICSEARCH_URL/_ilm/migrate_to_data_tiers"' - lang: C# source: "var response = await client.IndexLifecycleManagement\n .MigrateToDataTiersAsync(d1 => d1\n .LegacyTemplateToDelete(\"global-template\")\n .NodeAttribute(\"custom_attribute_name\")\n );" - lang: Java source: "client.ilm().migrateToDataTiers(m -> m\n .legacyTemplateToDelete(\"global-template\")\n .nodeAttribute(\"custom_attribute_name\")\n);\n" responses: '200': description: '' content: application/json: schema: required: - dry_run - removed_legacy_template - migrated_ilm_policies - migrated_indices - migrated_legacy_templates - migrated_composable_templates - migrated_component_templates type: object properties: dry_run: type: boolean removed_legacy_template: type: string description: "The name of the legacy index template that was deleted.\nThis information is missing if no legacy index templates were deleted." migrated_ilm_policies: type: array items: type: string description: The ILM policies that were updated. migrated_indices: allOf: - $ref: '#/components/schemas/_types.Indices' description: The indices that were migrated to tier preference routing. migrated_legacy_templates: type: array items: type: string description: The legacy index templates that were updated to not contain custom routing settings for the provided data attribute. migrated_composable_templates: type: array items: type: string description: The composable index templates that were updated to not contain custom routing settings for the provided data attribute. migrated_component_templates: type: array items: type: string description: The component templates that were updated to not contain custom routing settings for the provided data attribute. examples: MigrateToDataTiersResponseExample1: description: "A successful response when migrating indices, ILMs, and templates from custom node attributes to data tiers.\n" value: "{\n \"dry_run\": false,\n \"removed_legacy_template\":\"global-template\",\n \"migrated_ilm_policies\":[\"policy_with_allocate_action\"],\n \"migrated_indices\":[\"warm-index-to-migrate-000001\"],\n \"migrated_legacy_templates\":[\"a-legacy-template\"],\n \"migrated_composable_templates\":[\"a-composable-template\"],\n \"migrated_component_templates\":[\"a-component-template\"]\n}" x-state: Generally available; Added in 7.14.0 x-codeSamples: - lang: Console source: "POST /_ilm/migrate_to_data_tiers\n{\n \"legacy_template_to_delete\": \"global-template\",\n \"node_attribute\": \"custom_attribute_name\"\n}" - lang: Python source: "resp = client.ilm.migrate_to_data_tiers(\n legacy_template_to_delete=\"global-template\",\n node_attribute=\"custom_attribute_name\",\n)" - lang: JavaScript source: "const response = await client.ilm.migrateToDataTiers({\n legacy_template_to_delete: \"global-template\",\n node_attribute: \"custom_attribute_name\",\n});" - lang: Ruby source: "response = client.ilm.migrate_to_data_tiers(\n body: {\n \"legacy_template_to_delete\": \"global-template\",\n \"node_attribute\": \"custom_attribute_name\"\n }\n)" - lang: PHP source: "$resp = $client->ilm()->migrateToDataTiers([\n \"body\" => [\n \"legacy_template_to_delete\" => \"global-template\",\n \"node_attribute\" => \"custom_attribute_name\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"legacy_template_to_delete":"global-template","node_attribute":"custom_attribute_name"}'' "$ELASTICSEARCH_URL/_ilm/migrate_to_data_tiers"' - lang: C# source: "var response = await client.IndexLifecycleManagement\n .MigrateToDataTiersAsync(d1 => d1\n .LegacyTemplateToDelete(\"global-template\")\n .NodeAttribute(\"custom_attribute_name\")\n );" - lang: Java source: "client.ilm().migrateToDataTiers(m -> m\n .legacyTemplateToDelete(\"global-template\")\n .nodeAttribute(\"custom_attribute_name\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_ilm/move/{index}': post: tags: - ilm summary: Move to a lifecycle step description: "Manually move an index into a specific step in the lifecycle policy and run that step.\n\nWARNING: This operation can result in the loss of data. Manually moving an index into a specific step runs that step even if it has already been performed. This is a potentially destructive action and this should be considered an expert level API.\n\nYou must specify both the current step and the step to be executed in the body of the request.\nThe request will fail if the current step does not match the step currently running for the index\nThis is to prevent the index from being moved from an unexpected step into the next step.\n\nWhen specifying the target (`next_step`) to which the index will be moved, either the name or both the action and name fields are optional.\nIf only the phase is specified, the index will move to the first step of the first action in the target phase.\nIf the phase and action are specified, the index will move to the first step of the specified action in the specified phase.\nOnly actions specified in the ILM policy are considered valid.\nAn index cannot move to a step that is not part of its policy.\n\n## Required authorization\n\n* Index privileges: `manage_ilm`\n" operationId: ilm-move-to-step parameters: - name: index in: path description: The name of the index whose lifecycle step is to change required: true schema: $ref: '#/components/schemas/_types.IndexName' requestBody: content: application/json: schema: required: - current_step - next_step type: object properties: current_step: allOf: - $ref: '#/components/schemas/ilm.move_to_step.StepKey' description: The step that the index is expected to be in. next_step: allOf: - $ref: '#/components/schemas/ilm.move_to_step.StepKey' description: The step that you want to run. examples: MoveToStepRequestExample1: summary: Move to forcemerge step description: "Run `POST _ilm/move/my-index-000001` to move `my-index-000001` from the initial step to the `forcemerge` step.\n" value: "{\n \"current_step\": {\n \"phase\": \"new\",\n \"action\": \"complete\",\n \"name\": \"complete\"\n },\n \"next_step\": {\n \"phase\": \"warm\",\n \"action\": \"forcemerge\",\n \"name\": \"forcemerge\"\n }\n}" x-codeSamples: - lang: Console source: "POST _ilm/move/my-index-000001\n{\n \"current_step\": {\n \"phase\": \"new\",\n \"action\": \"complete\",\n \"name\": \"complete\"\n },\n \"next_step\": {\n \"phase\": \"warm\",\n \"action\": \"forcemerge\",\n \"name\": \"forcemerge\"\n }\n}" - lang: Python source: "resp = client.ilm.move_to_step(\n index=\"my-index-000001\",\n current_step={\n \"phase\": \"new\",\n \"action\": \"complete\",\n \"name\": \"complete\"\n },\n next_step={\n \"phase\": \"warm\",\n \"action\": \"forcemerge\",\n \"name\": \"forcemerge\"\n },\n)" - lang: JavaScript source: "const response = await client.ilm.moveToStep({\n index: \"my-index-000001\",\n current_step: {\n phase: \"new\",\n action: \"complete\",\n name: \"complete\",\n },\n next_step: {\n phase: \"warm\",\n action: \"forcemerge\",\n name: \"forcemerge\",\n },\n});" - lang: Ruby source: "response = client.ilm.move_to_step(\n index: \"my-index-000001\",\n body: {\n \"current_step\": {\n \"phase\": \"new\",\n \"action\": \"complete\",\n \"name\": \"complete\"\n },\n \"next_step\": {\n \"phase\": \"warm\",\n \"action\": \"forcemerge\",\n \"name\": \"forcemerge\"\n }\n }\n)" - lang: PHP source: "$resp = $client->ilm()->moveToStep([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"current_step\" => [\n \"phase\" => \"new\",\n \"action\" => \"complete\",\n \"name\" => \"complete\",\n ],\n \"next_step\" => [\n \"phase\" => \"warm\",\n \"action\" => \"forcemerge\",\n \"name\" => \"forcemerge\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"current_step":{"phase":"new","action":"complete","name":"complete"},"next_step":{"phase":"warm","action":"forcemerge","name":"forcemerge"}}'' "$ELASTICSEARCH_URL/_ilm/move/my-index-000001"' - lang: C# source: "var response = await client.IndexLifecycleManagement\n .MoveToStepAsync(index: \"my-index-000001\", d1 => d1\n .CurrentStep(d2 => d2\n .Action(\"complete\")\n .Name(\"complete\")\n .Phase(\"new\")\n )\n .NextStep(d2 => d2\n .Action(\"forcemerge\")\n .Name(\"forcemerge\")\n .Phase(\"warm\")\n )\n );" - lang: Java source: "client.ilm().moveToStep(m -> m\n .currentStep(c -> c\n .action(\"complete\")\n .name(\"complete\")\n .phase(\"new\")\n )\n .index(\"my-index-000001\")\n .nextStep(n -> n\n .action(\"forcemerge\")\n .name(\"forcemerge\")\n .phase(\"warm\")\n )\n);\n" MoveToStepRequestExample2: summary: Move to warm step description: "Run `POST _ilm/move/my-index-000001` to move `my-index-000001` from the end of hot phase into the start of warm.\n" value: "{\n \"current_step\": {\n \"phase\": \"hot\",\n \"action\": \"complete\",\n \"name\": \"complete\"\n },\n \"next_step\": {\n \"phase\": \"warm\"\n }\n}" x-codeSamples: - lang: Console source: "POST _ilm/move/my-index-000001\n{\n \"current_step\": {\n \"phase\": \"hot\",\n \"action\": \"complete\",\n \"name\": \"complete\"\n },\n \"next_step\": {\n \"phase\": \"warm\"\n }\n}" - lang: Python source: "resp = client.ilm.move_to_step(\n index=\"my-index-000001\",\n current_step={\n \"phase\": \"hot\",\n \"action\": \"complete\",\n \"name\": \"complete\"\n },\n next_step={\n \"phase\": \"warm\"\n },\n)" - lang: JavaScript source: "const response = await client.ilm.moveToStep({\n index: \"my-index-000001\",\n current_step: {\n phase: \"hot\",\n action: \"complete\",\n name: \"complete\",\n },\n next_step: {\n phase: \"warm\",\n },\n});" - lang: Ruby source: "response = client.ilm.move_to_step(\n index: \"my-index-000001\",\n body: {\n \"current_step\": {\n \"phase\": \"hot\",\n \"action\": \"complete\",\n \"name\": \"complete\"\n },\n \"next_step\": {\n \"phase\": \"warm\"\n }\n }\n)" - lang: PHP source: "$resp = $client->ilm()->moveToStep([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"current_step\" => [\n \"phase\" => \"hot\",\n \"action\" => \"complete\",\n \"name\" => \"complete\",\n ],\n \"next_step\" => [\n \"phase\" => \"warm\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"current_step":{"phase":"hot","action":"complete","name":"complete"},"next_step":{"phase":"warm"}}'' "$ELASTICSEARCH_URL/_ilm/move/my-index-000001"' - lang: C# source: "var response = await client.IndexLifecycleManagement\n .MoveToStepAsync(index: \"my-index-000001\", d1 => d1\n .CurrentStep(d2 => d2\n .Action(\"complete\")\n .Name(\"complete\")\n .Phase(\"hot\")\n )\n .NextStep(d2 => d2\n .Phase(\"warm\")\n )\n );" - lang: Java source: "client.ilm().moveToStep(m -> m\n .currentStep(c -> c\n .action(\"complete\")\n .name(\"complete\")\n .phase(\"hot\")\n )\n .index(\"my-index-000001\")\n .nextStep(n -> n\n .phase(\"warm\")\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: MoveToStepResponseExample1: description: "A successful response when running a specific step in a lifecycle policy.\n" value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 6.6.0 x-codeSamples: - lang: Console source: "POST _ilm/move/my-index-000001\n{\n \"current_step\": {\n \"phase\": \"new\",\n \"action\": \"complete\",\n \"name\": \"complete\"\n },\n \"next_step\": {\n \"phase\": \"warm\",\n \"action\": \"forcemerge\",\n \"name\": \"forcemerge\"\n }\n}" - lang: Python source: "resp = client.ilm.move_to_step(\n index=\"my-index-000001\",\n current_step={\n \"phase\": \"new\",\n \"action\": \"complete\",\n \"name\": \"complete\"\n },\n next_step={\n \"phase\": \"warm\",\n \"action\": \"forcemerge\",\n \"name\": \"forcemerge\"\n },\n)" - lang: JavaScript source: "const response = await client.ilm.moveToStep({\n index: \"my-index-000001\",\n current_step: {\n phase: \"new\",\n action: \"complete\",\n name: \"complete\",\n },\n next_step: {\n phase: \"warm\",\n action: \"forcemerge\",\n name: \"forcemerge\",\n },\n});" - lang: Ruby source: "response = client.ilm.move_to_step(\n index: \"my-index-000001\",\n body: {\n \"current_step\": {\n \"phase\": \"new\",\n \"action\": \"complete\",\n \"name\": \"complete\"\n },\n \"next_step\": {\n \"phase\": \"warm\",\n \"action\": \"forcemerge\",\n \"name\": \"forcemerge\"\n }\n }\n)" - lang: PHP source: "$resp = $client->ilm()->moveToStep([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"current_step\" => [\n \"phase\" => \"new\",\n \"action\" => \"complete\",\n \"name\" => \"complete\",\n ],\n \"next_step\" => [\n \"phase\" => \"warm\",\n \"action\" => \"forcemerge\",\n \"name\" => \"forcemerge\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"current_step":{"phase":"new","action":"complete","name":"complete"},"next_step":{"phase":"warm","action":"forcemerge","name":"forcemerge"}}'' "$ELASTICSEARCH_URL/_ilm/move/my-index-000001"' - lang: C# source: "var response = await client.IndexLifecycleManagement\n .MoveToStepAsync(index: \"my-index-000001\", d1 => d1\n .CurrentStep(d2 => d2\n .Action(\"complete\")\n .Name(\"complete\")\n .Phase(\"new\")\n )\n .NextStep(d2 => d2\n .Action(\"forcemerge\")\n .Name(\"forcemerge\")\n .Phase(\"warm\")\n )\n );" - lang: Java source: "client.ilm().moveToStep(m -> m\n .currentStep(c -> c\n .action(\"complete\")\n .name(\"complete\")\n .phase(\"new\")\n )\n .index(\"my-index-000001\")\n .nextStep(n -> n\n .action(\"forcemerge\")\n .name(\"forcemerge\")\n .phase(\"warm\")\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_ilm/remove': post: tags: - ilm summary: Remove policies from an index description: "Remove the assigned lifecycle policies from an index or a data stream's backing indices.\nIt also stops managing the indices.\n\n## Required authorization\n\n* Index privileges: `manage_ilm`\n" operationId: ilm-remove-policy parameters: - name: index in: path description: The name of the index to remove policy on required: true schema: $ref: '#/components/schemas/_types.IndexName' responses: '200': description: '' content: application/json: schema: required: - failed_indexes - has_failures type: object properties: failed_indexes: type: array items: $ref: '#/components/schemas/_types.IndexName' has_failures: type: boolean examples: RemovePolicyResponseExample1: description: A successful response when removing a lifecycle policy from an index. value: "{\n \"has_failures\" : false,\n \"failed_indexes\" : []\n}" x-state: Generally available; Added in 6.6.0 x-codeSamples: - lang: Console source: "POST logs-my_app-default/_ilm/remove\n" - lang: Python source: "resp = client.ilm.remove_policy(\n index=\"logs-my_app-default\",\n)" - lang: JavaScript source: "const response = await client.ilm.removePolicy({\n index: \"logs-my_app-default\",\n});" - lang: Ruby source: "response = client.ilm.remove_policy(\n index: \"logs-my_app-default\"\n)" - lang: PHP source: "$resp = $client->ilm()->removePolicy([\n \"index\" => \"logs-my_app-default\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/logs-my_app-default/_ilm/remove"' - lang: C# source: 'var response = await client.IndexLifecycleManagement.RemovePolicyAsync(index: "logs-my_app-default");' - lang: Java source: "client.ilm().removePolicy(r -> r\n .index(\"logs-my_app-default\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_ilm/retry': post: tags: - ilm summary: Retry a policy description: "Retry running the lifecycle policy for an index that is in the ERROR step.\nThe API sets the policy back to the step where the error occurred and runs the step.\nUse the explain lifecycle state API to determine whether an index is in the ERROR step.\n\n## Required authorization\n\n* Index privileges: `manage_ilm`\n" operationId: ilm-retry parameters: - name: index in: path description: The name of the indices (comma-separated) whose failed lifecycle step is to be retry required: true schema: $ref: '#/components/schemas/_types.IndexName' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 6.6.0 x-codeSamples: - lang: Console source: "POST /my-index-000001/_ilm/retry\n" - lang: Python source: "resp = client.ilm.retry(\n index=\"my-index-000001\",\n)" - lang: JavaScript source: "const response = await client.ilm.retry({\n index: \"my-index-000001\",\n});" - lang: Ruby source: "response = client.ilm.retry(\n index: \"my-index-000001\"\n)" - lang: PHP source: "$resp = $client->ilm()->retry([\n \"index\" => \"my-index-000001\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_ilm/retry"' - lang: C# source: 'var response = await client.IndexLifecycleManagement.RetryAsync(index: "my-index-000001");' - lang: Java source: "client.ilm().retry(r -> r\n .index(\"my-index-000001\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_ilm/start: post: tags: - ilm summary: Start the ILM plugin description: "Start the index lifecycle management plugin if it is currently stopped.\nILM is started automatically when the cluster is formed.\nRestarting ILM is necessary only when it has been stopped using the stop ILM API.\n\n## Required authorization\n\n* Cluster privileges: `manage_ilm`\n" operationId: ilm-start parameters: - name: master_timeout in: query description: 'Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: 'Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: StartILMResponseExample1: description: A successful response when stating the ILM plugin. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 6.6.0 x-codeSamples: - lang: Console source: "POST _ilm/start\n" - lang: Python source: resp = client.ilm.start() - lang: JavaScript source: const response = await client.ilm.start(); - lang: Ruby source: response = client.ilm.start - lang: PHP source: $resp = $client->ilm()->start(); - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ilm/start"' - lang: C# source: var response = await client.IndexLifecycleManagement.StartAsync(); - lang: Java source: "client.ilm().start(s -> s);\n" x-metaTags: - content: Elasticsearch name: product_name /_ilm/stop: post: tags: - ilm summary: Stop the ILM plugin description: "Halt all lifecycle management operations and stop the index lifecycle management plugin.\nThis is useful when you are performing maintenance on the cluster and need to prevent ILM from performing any actions on your indices.\n\nThe API returns as soon as the stop request has been acknowledged, but the plugin might continue to run until in-progress operations complete and the plugin can be safely stopped.\nUse the get ILM status API to check whether ILM is running.\n\n## Required authorization\n\n* Cluster privileges: `manage_ilm`\n" operationId: ilm-stop parameters: - name: master_timeout in: query description: 'Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: 'Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: StopILMResponseExample1: description: A successful response when stopping the ILM plugin. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 6.6.0 x-codeSamples: - lang: Console source: "POST _ilm/stop\n" - lang: Python source: resp = client.ilm.stop() - lang: JavaScript source: const response = await client.ilm.stop(); - lang: Ruby source: response = client.ilm.stop - lang: PHP source: $resp = $client->ilm()->stop(); - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ilm/stop"' - lang: C# source: var response = await client.IndexLifecycleManagement.StopAsync(); - lang: Java source: "client.ilm().stop(s -> s);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_block/{block}': put: tags: - indices summary: Add an index block description: "Add an index block to an index.\nIndex blocks limit the operations allowed on an index by blocking specific operation types.\n\n## Required authorization\n\n* Index privileges: `manage`\n" operationId: indices-add-block parameters: - name: index in: path description: "A comma-separated list or wildcard expression of index names used to limit the request.\nBy default, you must explicitly name the indices you are adding blocks to.\nTo allow the adding of blocks to indices with `_all`, `*`, or other wildcard expressions, change the `action.destructive_requires_name` setting to `false`.\nYou can update this setting in the `elasticsearch.yml` file or by using the cluster update settings API." required: true schema: $ref: '#/components/schemas/_types.Indices' - name: block in: path description: "The block type to add to the index.\n\nSupported values include:\n - `metadata`: Disable metadata changes, such as closing the index.\n - `read`: Disable read operations.\n - `read_only`: Disable write operations and metadata changes.\n - `write`: Disable write operations. However, metadata changes are still allowed.\n\n" required: true schema: $ref: '#/components/schemas/indices._types.IndicesBlockOptions' - name: allow_no_indices in: query description: "A setting that does two separate checks on the index expression.\nIf `false`, the request returns an error (1) if any wildcard expression\n(including `_all` and `*`) resolves to zero matching indices or (2) if the\ncomplete set of resolved indices, aliases or data streams is empty after all\nexpressions are evaluated. If `true`, index expressions that resolve to no\nindices are allowed and the request returns an empty result." schema: type: boolean default: true - name: expand_wildcards in: query description: "The type of index that wildcard patterns can match.\nIf the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.\nIt supports comma-separated values, such as `open,hidden`.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: open - name: ignore_unavailable in: query description: "If `false`, the request returns an error if it targets a concrete (non-wildcarded)\nindex, alias, or data stream that is missing, closed, or otherwise unavailable.\nIf `true`, unavailable concrete targets are silently ignored." schema: type: boolean default: false - name: master_timeout in: query description: "The period to wait for the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nIt can also be set to `-1` to indicate that the request should never timeout." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "The period to wait for a response from all relevant nodes in the cluster after updating the cluster metadata.\nIf no response is received before the timeout expires, the cluster metadata update still applies but the response will indicate that it was not completely acknowledged.\nIt can also be set to `-1` to indicate that the request should never timeout." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - acknowledged - shards_acknowledged - indices type: object properties: acknowledged: type: boolean shards_acknowledged: type: boolean indices: type: array items: $ref: '#/components/schemas/indices.add_block.AddIndicesBlockStatus' examples: IndicesAddBlockResponseExample1: description: 'A successful response from `PUT /my-index-000001/_block/write`, which adds an index block to an index.''' value: "{\n \"acknowledged\" : true,\n \"shards_acknowledged\" : true,\n \"indices\" : [ {\n \"name\" : \"my-index-000001\",\n \"blocked\" : true\n } ]\n}" x-state: Generally available; Added in 7.9.0 x-codeSamples: - lang: Console source: "PUT /my-index-000001/_block/write\n" - lang: Python source: "resp = client.indices.add_block(\n index=\"my-index-000001\",\n block=\"write\",\n)" - lang: JavaScript source: "const response = await client.indices.addBlock({\n index: \"my-index-000001\",\n block: \"write\",\n});" - lang: Ruby source: "response = client.indices.add_block(\n index: \"my-index-000001\",\n block: \"write\"\n)" - lang: PHP source: "$resp = $client->indices()->addBlock([\n \"index\" => \"my-index-000001\",\n \"block\" => \"write\",\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_block/write"' - lang: C# source: 'var response = await client.Indices.AddBlockAsync(indices: new[] { "my-index-000001" }, block: IndicesBlockOptions.Write);' - lang: Java source: "client.indices().addBlock(a -> a\n .block(IndicesBlockOptions.Write)\n .index(\"my-index-000001\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - indices summary: Remove an index block description: "Remove an index block from an index.\nIndex blocks limit the operations allowed on an index by blocking specific operation types.\n\n## Required authorization\n\n* Index privileges: `manage`\n" operationId: indices-remove-block parameters: - name: index in: path description: "A comma-separated list or wildcard expression of index names used to limit the request.\nBy default, you must explicitly name the indices you are removing blocks from.\nTo allow the removal of blocks from indices with `_all`, `*`, or other wildcard expressions, change the `action.destructive_requires_name` setting to `false`.\nYou can update this setting in the `elasticsearch.yml` file or by using the cluster update settings API." required: true schema: $ref: '#/components/schemas/_types.Indices' - name: block in: path description: "The block type to remove from the index.\n\nSupported values include:\n - `metadata`: Disable metadata changes, such as closing the index.\n - `read`: Disable read operations.\n - `read_only`: Disable write operations and metadata changes.\n - `write`: Disable write operations. However, metadata changes are still allowed.\n\n" required: true schema: $ref: '#/components/schemas/indices._types.IndicesBlockOptions' - name: allow_no_indices in: query description: "A setting that does two separate checks on the index expression.\nIf `false`, the request returns an error (1) if any wildcard expression\n(including `_all` and `*`) resolves to zero matching indices or (2) if the\ncomplete set of resolved indices, aliases or data streams is empty after all\nexpressions are evaluated. If `true`, index expressions that resolve to no\nindices are allowed and the request returns an empty result." schema: type: boolean default: true - name: expand_wildcards in: query description: "The type of index that wildcard patterns can match.\nIf the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.\nIt supports comma-separated values, such as `open,hidden`.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: open - name: ignore_unavailable in: query description: "If `false`, the request returns an error if it targets a concrete (non-wildcarded)\nindex, alias, or data stream that is missing, closed, or otherwise unavailable.\nIf `true`, unavailable concrete targets are silently ignored." schema: type: boolean default: false - name: master_timeout in: query description: "The period to wait for the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nIt can also be set to `-1` to indicate that the request should never timeout." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "The period to wait for a response from all relevant nodes in the cluster after updating the cluster metadata.\nIf no response is received before the timeout expires, the cluster metadata update still applies but the response will indicate that it was not completely acknowledged.\nIt can also be set to `-1` to indicate that the request should never timeout." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - acknowledged - indices type: object properties: acknowledged: type: boolean indices: type: array items: $ref: '#/components/schemas/indices.remove_block.RemoveIndicesBlockStatus' examples: IndicesRemoveBlockResponseExample1: description: 'A successful response from `DELETE /my-index-000001/_block/write`, which removes an index block from an index.''' value: "{\n \"acknowledged\" : true,\n \"indices\" : [ {\n \"name\" : \"my-index-000001\",\n \"unblocked\" : true\n } ]\n}" x-state: Generally available; Added in 9.1.0 x-codeSamples: - lang: Console source: "DELETE /my-index-000001/_block/write\n" - lang: Python source: "resp = client.indices.remove_block(\n index=\"my-index-000001\",\n block=\"write\",\n)" - lang: JavaScript source: "const response = await client.indices.removeBlock({\n index: \"my-index-000001\",\n block: \"write\",\n});" - lang: Ruby source: "response = client.indices.remove_block(\n index: \"my-index-000001\",\n block: \"write\"\n)" - lang: PHP source: "$resp = $client->indices()->removeBlock([\n \"index\" => \"my-index-000001\",\n \"block\" => \"write\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_block/write"' - lang: C# source: 'var response = await client.Indices.RemoveBlockAsync(indices: new[] { "my-index-000001" }, block: IndicesBlockOptions.Write);' - lang: Java source: "client.indices().removeBlock(r -> r\n .block(IndicesBlockOptions.Write)\n .index(\"my-index-000001\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_analyze': post: tags: - indices summary: "Get tokens from text analysis\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_analyze\n
\n
\n POST\n /_analyze\n
\n
\n GET\n /{index}/_analyze\n
\n
\n POST\n /{index}/_analyze\n
\n \n\nThe analyze API performs analysis on a text string and returns the resulting tokens.\n\nGenerating excessive amount of tokens may cause a node to run out of memory.\nThe `index.analyze.max_token_count` setting enables you to limit the number of tokens that can be produced.\nIf more than this limit of tokens gets generated, an error occurs.\nThe `_analyze` endpoint without a specified index will always use `10000` as its limit.\n\n## Required authorization\n\n* Index privileges: `index`\n" externalDocs: description: Learn more about text analysis url: https://www.elastic.co/docs/manage-data/data-store/text-analysis x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/indices-analyze.html operationId: indices-analyze parameters: - $ref: '#/components/parameters/indices.analyze-index' - $ref: '#/components/parameters/indices.analyze-index_' requestBody: $ref: '#/components/requestBodies/indices.analyze' responses: '200': $ref: '#/components/responses/indices.analyze-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET /_analyze\n{\n \"analyzer\": \"standard\",\n \"text\": \"this is a test\"\n}" - lang: Python source: "resp = client.indices.analyze(\n analyzer=\"standard\",\n text=\"this is a test\",\n)" - lang: JavaScript source: "const response = await client.indices.analyze({\n analyzer: \"standard\",\n text: \"this is a test\",\n});" - lang: Ruby source: "response = client.indices.analyze(\n body: {\n \"analyzer\": \"standard\",\n \"text\": \"this is a test\"\n }\n)" - lang: PHP source: "$resp = $client->indices()->analyze([\n \"body\" => [\n \"analyzer\" => \"standard\",\n \"text\" => \"this is a test\",\n ],\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"analyzer":"standard","text":"this is a test"}'' "$ELASTICSEARCH_URL/_analyze"' - lang: C# source: "var response = await client.Indices\n .AnalyzeAsync(d1 => d1\n .Analyzer(\"standard\")\n .Text(\"this is a test\")\n );" - lang: Java source: "client.indices().analyze(a -> a\n .analyzer(\"standard\")\n .text(\"this is a test\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_migration/reindex/{index}/_cancel': post: tags: - migration summary: Cancel a migration reindex operation description: "Cancel a migration reindex attempt for a data stream or index.\n\n## Required authorization\n\n* Index privileges: `manage`\n" operationId: indices-cancel-migrate-reindex parameters: - name: index in: path description: The index or data stream name required: true schema: $ref: '#/components/schemas/_types.Indices' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 8.18.0 x-codeSamples: - lang: Console source: "POST /_migration/reindex/my-data-stream/_cancel\n" - lang: Python source: "resp = client.indices.cancel_migrate_reindex(\n index=\"my-data-stream\",\n)" - lang: JavaScript source: "const response = await client.indices.cancelMigrateReindex({\n index: \"my-data-stream\",\n});" - lang: Ruby source: "response = client.indices.cancel_migrate_reindex(\n index: \"my-data-stream\"\n)" - lang: PHP source: "$requestFactory = Psr17FactoryDiscovery::findRequestFactory();\n$request = $requestFactory->createRequest(\n \"POST\",\n \"/_migration/reindex/my-data-stream/_cancel\",\n);\n$resp = $client->sendRequest($request);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_migration/reindex/my-data-stream/_cancel"' - lang: C# source: 'var response = await client.Indices.CancelMigrateReindexAsync(indices: new[] { "my-data-stream" });' - lang: Java source: "client.indices().cancelMigrateReindex(c -> c\n .index(\"my-data-stream\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_cache/clear': post: tags: - indices summary: "Clear the cache\n" description: "**All methods and paths for this operation:**\n\n
\n POST\n /_cache/clear\n
\n
\n POST\n /{index}/_cache/clear\n
\n \n\nClear the cache of one or more indices.\nFor data streams, the API clears the caches of the stream's backing indices.\n\nBy default, the clear cache API clears all caches.\nTo clear only specific caches, use the `fielddata`, `query`, or `request` parameters.\nTo clear the cache only of specific fields, use the `fields` parameter.\n\n## Required authorization\n\n* Index privileges: `manage`\n" operationId: indices-clear-cache parameters: - $ref: '#/components/parameters/indices.clear_cache-index' - $ref: '#/components/parameters/indices.clear_cache-index_' - $ref: '#/components/parameters/indices.clear_cache-allow_no_indices' - $ref: '#/components/parameters/indices.clear_cache-expand_wildcards' - $ref: '#/components/parameters/indices.clear_cache-fielddata' - $ref: '#/components/parameters/indices.clear_cache-fields' - $ref: '#/components/parameters/indices.clear_cache-ignore_unavailable' - $ref: '#/components/parameters/indices.clear_cache-query' - $ref: '#/components/parameters/indices.clear_cache-request' responses: '200': $ref: '#/components/responses/indices.clear_cache-200' x-state: Generally available x-codeSamples: - lang: Console source: "POST /my-index-000001,my-index-000002/_cache/clear?request=true\n" - lang: Python source: "resp = client.indices.clear_cache(\n index=\"my-index-000001,my-index-000002\",\n request=True,\n)" - lang: JavaScript source: "const response = await client.indices.clearCache({\n index: \"my-index-000001,my-index-000002\",\n request: \"true\",\n});" - lang: Ruby source: "response = client.indices.clear_cache(\n index: \"my-index-000001,my-index-000002\",\n request: \"true\"\n)" - lang: PHP source: "$resp = $client->indices()->clearCache([\n \"index\" => \"my-index-000001,my-index-000002\",\n \"request\" => \"true\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001,my-index-000002/_cache/clear?request=true"' - lang: C# source: "var response = await client.Indices\n .ClearCacheAsync(d1 => d1\n .Indices(new[] { \"my-index-000001\", \"my-index-000002\" })\n .Request(true)\n );" - lang: Java source: "client.indices().clearCache(c -> c\n .index(List.of(\"my-index-000001\",\"my-index-000002\"))\n .request(true)\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_clone/{target}': post: tags: - indices summary: "Clone an index\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /{index}/_clone/{target}\n
\n
\n POST\n /{index}/_clone/{target}\n
\n \n\nClone an existing index into a new index.\nEach original primary shard is cloned into a new primary shard in the new index.\n\nIMPORTANT: Elasticsearch does not apply index templates to the resulting index.\nThe API also does not copy index metadata from the original index.\nIndex metadata includes aliases, index lifecycle management phase definitions, and cross-cluster replication (CCR) follower information.\nFor example, if you clone a CCR follower index, the resulting clone will not be a follower index.\n\nThe clone API copies most index settings from the source index to the resulting index, with the exception of `index.number_of_replicas` and `index.auto_expand_replicas`.\nTo set the number of replicas in the resulting index, configure these settings in the clone request.\n\nCloning works as follows:\n\n* First, it creates a new target index with the same definition as the source index.\n* Then it hard-links segments from the source index into the target index. If the file system does not support hard-linking, all segments are copied into the new index, which is a much more time consuming process.\n* Finally, it recovers the target index as though it were a closed index which had just been re-opened.\n\nIMPORTANT: Indices can only be cloned if they meet the following requirements:\n\n* The index must be marked as read-only and have a cluster health status of green.\n* The target index must not exist.\n* The source index must have the same number of primary shards as the target index.\n* The node handling the clone process must have sufficient free disk space to accommodate a second copy of the existing index.\n\nThe current write index on a data stream cannot be cloned.\nIn order to clone the current write index, the data stream must first be rolled over so that a new write index is created and then the previous write index can be cloned.\n\nNOTE: Mappings cannot be specified in the `_clone` request. The mappings of the source index will be used for the target index.\n\n**Monitor the cloning process**\n\nThe cloning process can be monitored with the cat recovery API or the cluster health API can be used to wait until all primary shards have been allocated by setting the `wait_for_status` parameter to `yellow`.\n\nThe `_clone` API returns as soon as the target index has been added to the cluster state, before any shards have been allocated.\nAt this point, all shards are in the state unassigned.\nIf, for any reason, the target index can't be allocated, its primary shard will remain unassigned until it can be allocated on that node.\n\nOnce the primary shard is allocated, it moves to state initializing, and the clone process begins.\nWhen the clone operation completes, the shard will become active.\nAt that point, Elasticsearch will try to allocate any replicas and may decide to relocate the primary shard to another node.\n\n**Wait for active shards**\n\nBecause the clone operation creates a new index to clone the shards to, the wait for active shards setting on index creation applies to the clone index action as well.\n\n## Required authorization\n\n* Index privileges: `manage`\n" operationId: indices-clone parameters: - $ref: '#/components/parameters/indices.clone-index' - $ref: '#/components/parameters/indices.clone-target' - $ref: '#/components/parameters/indices.clone-master_timeout' - $ref: '#/components/parameters/indices.clone-timeout' - $ref: '#/components/parameters/indices.clone-wait_for_active_shards' requestBody: $ref: '#/components/requestBodies/indices.clone' responses: '200': $ref: '#/components/responses/indices.clone-200' x-state: Generally available; Added in 7.4.0 x-codeSamples: - lang: Console source: "POST /my_source_index/_clone/my_target_index\n{\n \"settings\": {\n \"index.refresh_interval\": \"2s\"\n },\n \"aliases\": {\n \"my_search_indices\": {}\n }\n}" - lang: Python source: "resp = client.indices.clone(\n index=\"my_source_index\",\n target=\"my_target_index\",\n settings={\n \"index.refresh_interval\": \"2s\"\n },\n aliases={\n \"my_search_indices\": {}\n },\n)" - lang: JavaScript source: "const response = await client.indices.clone({\n index: \"my_source_index\",\n target: \"my_target_index\",\n settings: {\n \"index.refresh_interval\": \"2s\",\n },\n aliases: {\n my_search_indices: {},\n },\n});" - lang: Ruby source: "response = client.indices.clone(\n index: \"my_source_index\",\n target: \"my_target_index\",\n body: {\n \"settings\": {\n \"index.refresh_interval\": \"2s\"\n },\n \"aliases\": {\n \"my_search_indices\": {}\n }\n }\n)" - lang: PHP source: "$resp = $client->indices()->clone([\n \"index\" => \"my_source_index\",\n \"target\" => \"my_target_index\",\n \"body\" => [\n \"settings\" => [\n \"index.refresh_interval\" => \"2s\",\n ],\n \"aliases\" => [\n \"my_search_indices\" => new ArrayObject([]),\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"settings":{"index.refresh_interval":"2s"},"aliases":{"my_search_indices":{}}}'' "$ELASTICSEARCH_URL/my_source_index/_clone/my_target_index"' - lang: C# source: "var response = await client.Indices\n .CloneAsync(index: \"my_source_index\", target: \"my_target_index\", d1 => d1\n .Aliases(d2 => d2\n .Add(\"my_search_indices\", new Alias())\n )\n .Settings(new Dictionary()\n {\n { \"index.refresh_interval\", \"2s\" }\n })\n );" - lang: Java source: "client.indices().clone(c -> c\n .aliases(\"my_search_indices\", a -> a)\n .index(\"my_source_index\")\n .settings(\"index.refresh_interval\", JsonData.fromJson(\"\\\"2s\\\"\"))\n .target(\"my_target_index\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_close': post: tags: - indices summary: Close an index description: "A closed index is blocked for read or write operations and does not allow all operations that opened indices allow.\nIt is not possible to index documents or to search for documents in a closed index.\nClosed indices do not have to maintain internal data structures for indexing or searching documents, which results in a smaller overhead on the cluster.\n\nWhen opening or closing an index, the master node is responsible for restarting the index shards to reflect the new state of the index.\nThe shards will then go through the normal recovery process.\nThe data of opened and closed indices is automatically replicated by the cluster to ensure that enough shard copies are safely kept around at all times.\n\nYou can open and close multiple indices.\nAn error is thrown if the request explicitly refers to a missing index.\nThis behaviour can be turned off using the `ignore_unavailable=true` parameter.\n\nBy default, you must explicitly name the indices you are opening or closing.\nTo open or close indices with `_all`, `*`, or other wildcard expressions, change the` action.destructive_requires_name` setting to `false`. This setting can also be changed with the cluster update settings API.\n\nClosed indices consume a significant amount of disk-space which can cause problems in managed environments.\nClosing indices can be turned off with the cluster settings API by setting `cluster.indices.close.enable` to `false`.\n\n## Required authorization\n\n* Index privileges: `manage`\n" operationId: indices-close parameters: - name: index in: path description: Comma-separated list or wildcard expression of index names used to limit the request. required: true schema: $ref: '#/components/schemas/_types.Indices' - name: allow_no_indices in: query description: "A setting that does two separate checks on the index expression.\nIf `false`, the request returns an error (1) if any wildcard expression\n(including `_all` and `*`) resolves to zero matching indices or (2) if the\ncomplete set of resolved indices, aliases or data streams is empty after all\nexpressions are evaluated. If `true`, index expressions that resolve to no\nindices are allowed and the request returns an empty result." schema: type: boolean default: true - name: expand_wildcards in: query description: "Type of index that wildcard patterns can match.\nIf the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.\nSupports comma-separated values, such as `open,hidden`.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: open - name: ignore_unavailable in: query description: "If `false`, the request returns an error if it targets a concrete (non-wildcarded)\nindex, alias, or data stream that is missing, closed, or otherwise unavailable.\nIf `true`, unavailable concrete targets are silently ignored." schema: type: boolean default: false - name: master_timeout in: query description: "Period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "Period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: wait_for_active_shards in: query description: "The number of shard copies that must be active before proceeding with the operation.\nSet to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`)." schema: allOf: - $ref: '#/components/schemas/_types.WaitForActiveShards' default: '1' responses: '200': description: '' content: application/json: schema: required: - acknowledged - indices - shards_acknowledged type: object properties: acknowledged: type: boolean indices: type: object additionalProperties: $ref: '#/components/schemas/indices.close.CloseIndexResult' shards_acknowledged: type: boolean examples: CloseIndexResponseExample1: description: A successful response for closing an index. value: "{\n \"acknowledged\": true,\n \"shards_acknowledged\": true,\n \"indices\": {\n \"my-index-000001\": {\n \"closed\": true\n }\n }\n}" x-state: Generally available x-codeSamples: - lang: Console source: "POST /my-index-00001/_close\n" - lang: Python source: "resp = client.indices.close(\n index=\"my-index-00001\",\n)" - lang: JavaScript source: "const response = await client.indices.close({\n index: \"my-index-00001\",\n});" - lang: Ruby source: "response = client.indices.close(\n index: \"my-index-00001\"\n)" - lang: PHP source: "$resp = $client->indices()->close([\n \"index\" => \"my-index-00001\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-00001/_close"' - lang: C# source: 'var response = await client.Indices.CloseAsync(indices: new[] { "my-index-00001" });' - lang: Java source: "client.indices().close(c -> c\n .index(\"my-index-00001\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}': get: tags: - indices summary: Get index information description: "Get information about one or more indices. For data streams, the API returns information about the\nstream’s backing indices.\n\n## Required authorization\n\n* Index privileges: `view_index_metadata`,`manage`\n" operationId: indices-get parameters: - name: index in: path description: "Comma-separated list of data streams, indices, and index aliases used to limit the request.\nWildcard expressions (*) are supported." required: true schema: $ref: '#/components/schemas/_types.Indices' - name: allow_no_indices in: query description: "A setting that does two separate checks on the index expression.\nIf `false`, the request returns an error (1) if any wildcard expression\n(including `_all` and `*`) resolves to zero matching indices or (2) if the\ncomplete set of resolved indices, aliases or data streams is empty after all\nexpressions are evaluated. If `true`, index expressions that resolve to no\nindices are allowed and the request returns an empty result." schema: type: boolean default: true - name: expand_wildcards in: query description: "Type of index that wildcard expressions can match. If the request can target data streams, this argument\ndetermines whether wildcard expressions match hidden data streams. Supports comma-separated values,\nsuch as open,hidden.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: open - name: flat_settings in: query description: 'If true, returns settings in flat format.' schema: type: boolean default: false - name: ignore_unavailable in: query description: "If `false`, the request returns an error if it targets a concrete (non-wildcarded)\nindex, alias, or data stream that is missing, closed, or otherwise unavailable.\nIf `true`, unavailable concrete targets are silently ignored." schema: type: boolean default: false - name: include_defaults in: query description: 'If true, return all default settings in the response.' schema: type: boolean default: false - name: local in: query description: 'If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.' schema: type: boolean default: false - name: master_timeout in: query description: 'Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: features in: query description: "Return only information on specified index features\n\nSupported values include: `aliases`, `mappings`, `settings`\n\n" schema: allOf: - $ref: '#/components/schemas/indices.get.Features' default: '[''aliases'', ''mappings'', ''settings'']' x-state: Generally available; Added in 8.1.0 responses: '200': description: '' content: application/json: schema: type: object additionalProperties: $ref: '#/components/schemas/indices._types.IndexState' x-state: Generally available x-codeSamples: - lang: Console source: "GET /my-index-000001\n" - lang: Python source: "resp = client.indices.get(\n index=\"my-index-000001\",\n)" - lang: JavaScript source: "const response = await client.indices.get({\n index: \"my-index-000001\",\n});" - lang: Ruby source: "response = client.indices.get(\n index: \"my-index-000001\"\n)" - lang: PHP source: "$resp = $client->indices()->get([\n \"index\" => \"my-index-000001\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001"' - lang: C# source: 'var response = await client.Indices.GetAsync(indices: new[] { "my-index-000001" });' - lang: Java source: "client.indices().get(g -> g\n .index(\"my-index-000001\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - indices summary: Create an index description: "You can use the create index API to add a new index to an Elasticsearch cluster.\nWhen creating an index, you can specify the following:\n\n* Settings for the index.\n* Mappings for fields in the index.\n* Index aliases\n\n**Wait for active shards**\n\nBy default, index creation will only return a response to the client when the primary copies of each shard have been started, or the request times out.\nThe index creation response will indicate what happened.\nFor example, `acknowledged` indicates whether the index was successfully created in the cluster, `while shards_acknowledged` indicates whether the requisite number of shard copies were started for each shard in the index before timing out.\nNote that it is still possible for either `acknowledged` or `shards_acknowledged` to be `false`, but for the index creation to be successful.\nThese values simply indicate whether the operation completed before the timeout.\nIf `acknowledged` is false, the request timed out before the cluster state was updated with the newly created index, but it probably will be created sometime soon.\nIf `shards_acknowledged` is false, then the request timed out before the requisite number of shards were started (by default just the primaries), even if the cluster state was successfully updated to reflect the newly created index (that is to say, `acknowledged` is `true`).\n\nYou can change the default of only waiting for the primary shards to start through the index setting `index.write.wait_for_active_shards`.\nNote that changing this setting will also affect the `wait_for_active_shards` value on all subsequent write operations.\n\n## Required authorization\n\n* Index privileges: `create_index`,`manage`\n" operationId: indices-create parameters: - name: index in: path description: "Name of the index you wish to create.\nIndex names must meet the following criteria:\n\n* Lowercase only\n* Cannot include `\\`, `/`, `*`, `?`, `\"`, `<`, `>`, `|`, ` ` (space character), `,`, or `#`\n* Indices prior to 7.0 could contain a colon (`:`), but that has been deprecated and will not be supported in later versions\n* Cannot start with `-`, `_`, or `+`\n* Cannot be `.` or `..`\n* Cannot be longer than 255 bytes (note thtat it is bytes, so multi-byte characters will reach the limit faster)\n* Names starting with `.` are deprecated, except for hidden indices and internal indices managed by plugins" required: true schema: $ref: '#/components/schemas/_types.IndexName' - name: master_timeout in: query description: "Period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "Period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: wait_for_active_shards in: query description: "The number of shard copies that must be active before proceeding with the operation.\nSet to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`)." schema: allOf: - $ref: '#/components/schemas/_types.WaitForActiveShards' default: '1' requestBody: content: application/json: schema: type: object properties: aliases: type: object additionalProperties: $ref: '#/components/schemas/indices._types.Alias' description: Aliases for the index. mappings: allOf: - $ref: '#/components/schemas/_types.mapping.TypeMapping' description: "Mapping for fields in the index. If specified, this mapping can include:\n- Field names\n- Field data types\n- Mapping parameters" settings: allOf: - $ref: '#/components/schemas/indices._types.IndexSettings' description: Configuration options for the index. examples: indicesCreateRequestExample1: summary: Create an index. description: This request specifies the `number_of_shards` and `number_of_replicas`. value: "{\n \"settings\": {\n \"number_of_shards\": 3,\n \"number_of_replicas\": 2\n }\n}" x-codeSamples: - lang: Console source: "PUT /my-index-000001\n{\n \"settings\": {\n \"number_of_shards\": 3,\n \"number_of_replicas\": 2\n }\n}" - lang: Python source: "resp = client.indices.create(\n index=\"my-index-000001\",\n settings={\n \"number_of_shards\": 3,\n \"number_of_replicas\": 2\n },\n)" - lang: JavaScript source: "const response = await client.indices.create({\n index: \"my-index-000001\",\n settings: {\n number_of_shards: 3,\n number_of_replicas: 2,\n },\n});" - lang: Ruby source: "response = client.indices.create(\n index: \"my-index-000001\",\n body: {\n \"settings\": {\n \"number_of_shards\": 3,\n \"number_of_replicas\": 2\n }\n }\n)" - lang: PHP source: "$resp = $client->indices()->create([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"settings\" => [\n \"number_of_shards\" => 3,\n \"number_of_replicas\" => 2,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"settings":{"number_of_shards":3,"number_of_replicas":2}}'' "$ELASTICSEARCH_URL/my-index-000001"' - lang: C# source: "var response = await client.Indices\n .CreateAsync(index: \"my-index-000001\", d1 => d1\n .Settings(d2 => d2\n .NumberOfReplicas(2)\n .NumberOfShards(3)\n )\n );" - lang: Java source: "client.indices().create(c -> c\n .index(\"my-index-000001\")\n .settings(s -> s\n .otherSettings(Map.of())\n .numberOfShards(\"3\")\n .numberOfReplicas(\"2\")\n )\n);\n" indicesCreateRequestExample2: summary: Create an index with mappings. description: You can provide mapping definitions in the create index API requests. value: "{\n \"settings\": {\n \"number_of_shards\": 1\n },\n \"mappings\": {\n \"properties\": {\n \"field1\": { \"type\": \"text\" }\n }\n }\n}" x-codeSamples: - lang: Console source: "PUT /test\n{\n \"settings\": {\n \"number_of_shards\": 1\n },\n \"mappings\": {\n \"properties\": {\n \"field1\": { \"type\": \"text\" }\n }\n }\n}" - lang: Python source: "resp = client.indices.create(\n index=\"test\",\n settings={\n \"number_of_shards\": 1\n },\n mappings={\n \"properties\": {\n \"field1\": {\n \"type\": \"text\"\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.indices.create({\n index: \"test\",\n settings: {\n number_of_shards: 1,\n },\n mappings: {\n properties: {\n field1: {\n type: \"text\",\n },\n },\n },\n});" - lang: Ruby source: "response = client.indices.create(\n index: \"test\",\n body: {\n \"settings\": {\n \"number_of_shards\": 1\n },\n \"mappings\": {\n \"properties\": {\n \"field1\": {\n \"type\": \"text\"\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->indices()->create([\n \"index\" => \"test\",\n \"body\" => [\n \"settings\" => [\n \"number_of_shards\" => 1,\n ],\n \"mappings\" => [\n \"properties\" => [\n \"field1\" => [\n \"type\" => \"text\",\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"settings":{"number_of_shards":1},"mappings":{"properties":{"field1":{"type":"text"}}}}'' "$ELASTICSEARCH_URL/test"' - lang: C# source: "var response = await client.Indices\n .CreateAsync(index: \"test\", d1 => d1\n .Mappings(d2 => d2\n .Properties(d3 => d3\n .Text(x => x.Field1)\n )\n )\n .Settings(d2 => d2\n .NumberOfShards(1)\n )\n );" - lang: Java source: "client.indices().create(c -> c\n .index(\"test\")\n .mappings(m -> m\n .properties(\"field1\", p -> p\n .text(t -> t)\n )\n )\n .settings(s -> s\n .otherSettings(Map.of())\n .numberOfShards(\"1\")\n )\n);\n" indicesCreateRequestExample3: summary: Create an index with aliases. description: "You can provide mapping definitions in the create index API requests. Index alias names also support date math.\n" value: "{\n \"aliases\": {\n \"alias_1\": {},\n \"alias_2\": {\n \"filter\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n \"routing\": \"shard-1\"\n }\n }\n}" x-codeSamples: - lang: Console source: "PUT /test\n{\n \"aliases\": {\n \"alias_1\": {},\n \"alias_2\": {\n \"filter\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n \"routing\": \"shard-1\"\n }\n }\n}" - lang: Python source: "resp = client.indices.create(\n index=\"test\",\n aliases={\n \"alias_1\": {},\n \"alias_2\": {\n \"filter\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n \"routing\": \"shard-1\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.indices.create({\n index: \"test\",\n aliases: {\n alias_1: {},\n alias_2: {\n filter: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n routing: \"shard-1\",\n },\n },\n});" - lang: Ruby source: "response = client.indices.create(\n index: \"test\",\n body: {\n \"aliases\": {\n \"alias_1\": {},\n \"alias_2\": {\n \"filter\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n \"routing\": \"shard-1\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->indices()->create([\n \"index\" => \"test\",\n \"body\" => [\n \"aliases\" => [\n \"alias_1\" => new ArrayObject([]),\n \"alias_2\" => [\n \"filter\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n \"routing\" => \"shard-1\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"aliases":{"alias_1":{},"alias_2":{"filter":{"term":{"user.id":"kimchy"}},"routing":"shard-1"}}}'' "$ELASTICSEARCH_URL/test"' - lang: C# source: "var response = await client.Indices\n .CreateAsync(index: \"test\", d1 => d1\n .Aliases(d2 => d2\n .Add(\"alias_1\", new Alias())\n .Add(\"alias_2\", d3 => d3\n .Filter(d4 => d4\n .Term(d5 => d5\n .Field(x => x.User.Id)\n .Value(\"kimchy\")\n )\n )\n .Routing(\"shard-1\")\n )\n )\n );" - lang: Java source: "client.indices().create(c -> c\n .aliases(Map.of(\"alias_2\", Alias.of(a -> a\n .filter(f -> f\n .term(t -> t\n .field(\"user.id\")\n .value(FieldValue.of(\"kimchy\"))\n )\n )\n .routing(\"shard-1\")\n ),\"alias_1\", Alias.of(al -> al)))\n .index(\"test\")\n);\n" responses: '200': description: '' content: application/json: schema: required: - index - shards_acknowledged - acknowledged type: object properties: index: allOf: - $ref: '#/components/schemas/_types.IndexName' shards_acknowledged: type: boolean acknowledged: type: boolean x-state: Generally available x-codeSamples: - lang: Console source: "PUT /my-index-000001\n{\n \"settings\": {\n \"number_of_shards\": 3,\n \"number_of_replicas\": 2\n }\n}" - lang: Python source: "resp = client.indices.create(\n index=\"my-index-000001\",\n settings={\n \"number_of_shards\": 3,\n \"number_of_replicas\": 2\n },\n)" - lang: JavaScript source: "const response = await client.indices.create({\n index: \"my-index-000001\",\n settings: {\n number_of_shards: 3,\n number_of_replicas: 2,\n },\n});" - lang: Ruby source: "response = client.indices.create(\n index: \"my-index-000001\",\n body: {\n \"settings\": {\n \"number_of_shards\": 3,\n \"number_of_replicas\": 2\n }\n }\n)" - lang: PHP source: "$resp = $client->indices()->create([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"settings\" => [\n \"number_of_shards\" => 3,\n \"number_of_replicas\" => 2,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"settings":{"number_of_shards":3,"number_of_replicas":2}}'' "$ELASTICSEARCH_URL/my-index-000001"' - lang: C# source: "var response = await client.Indices\n .CreateAsync(index: \"my-index-000001\", d1 => d1\n .Settings(d2 => d2\n .NumberOfReplicas(2)\n .NumberOfShards(3)\n )\n );" - lang: Java source: "client.indices().create(c -> c\n .index(\"my-index-000001\")\n .settings(s -> s\n .otherSettings(Map.of())\n .numberOfShards(\"3\")\n .numberOfReplicas(\"2\")\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - indices summary: Delete indices description: "Deleting an index deletes its documents, shards, and metadata.\nIt does not delete related Kibana components, such as data views, visualizations, or dashboards.\n\nYou cannot delete the current write index of a data stream.\nTo delete the index, you must roll over the data stream so a new write index is created.\nYou can then use the delete index API to delete the previous write index.\n\n## Required authorization\n\n* Index privileges: `delete_index`\n" operationId: indices-delete parameters: - name: index in: path description: "Comma-separated list of indices to delete.\nYou cannot specify index aliases.\nBy default, this parameter does not support wildcards (`*`) or `_all`.\nTo use wildcards or `_all`, set the `action.destructive_requires_name` cluster setting to `false`." required: true schema: $ref: '#/components/schemas/_types.Indices' - name: allow_no_indices in: query description: "A setting that does two separate checks on the index expression.\nIf `false`, the request returns an error (1) if any wildcard expression\n(including `_all` and `*`) resolves to zero matching indices or (2) if the\ncomplete set of resolved indices, aliases or data streams is empty after all\nexpressions are evaluated. If `true`, index expressions that resolve to no\nindices are allowed and the request returns an empty result." schema: type: boolean default: true - name: expand_wildcards in: query description: "Type of index that wildcard patterns can match.\nIf the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.\nSupports comma-separated values, such as `open,hidden`.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: 'open,closed' - name: ignore_unavailable in: query description: "If `false`, the request returns an error if it targets a concrete (non-wildcarded)\nindex, alias, or data stream that is missing, closed, or otherwise unavailable.\nIf `true`, unavailable concrete targets are silently ignored." schema: type: boolean default: false - name: master_timeout in: query description: "Period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "Period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.IndicesResponseBase' x-state: Generally available x-codeSamples: - lang: Console source: "DELETE /books\n" - lang: Python source: "resp = client.indices.delete(\n index=\"books\",\n)" - lang: JavaScript source: "const response = await client.indices.delete({\n index: \"books\",\n});" - lang: Ruby source: "response = client.indices.delete(\n index: \"books\"\n)" - lang: PHP source: "$resp = $client->indices()->delete([\n \"index\" => \"books\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/books"' - lang: C# source: 'var response = await client.Indices.DeleteAsync(indices: new[] { "books" });' - lang: Java source: "client.indices().delete(d -> d\n .index(\"books\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name head: tags: - indices summary: Check indices description: "Check if one or more indices, index aliases, or data streams exist.\n\n## Required authorization\n\n* Index privileges: `view_index_metadata`,`manage`\n" operationId: indices-exists parameters: - name: index in: path description: 'Comma-separated list of data streams, indices, and aliases. Supports wildcards (`*`).' required: true schema: $ref: '#/components/schemas/_types.Indices' - name: allow_no_indices in: query description: "A setting that does two separate checks on the index expression.\nIf `false`, the request returns an error (1) if any wildcard expression\n(including `_all` and `*`) resolves to zero matching indices or (2) if the\ncomplete set of resolved indices, aliases or data streams is empty after all\nexpressions are evaluated. If `true`, index expressions that resolve to no\nindices are allowed and the request returns an empty result." schema: type: boolean default: true - name: expand_wildcards in: query description: "Type of index that wildcard patterns can match.\nIf the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.\nSupports comma-separated values, such as `open,hidden`.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: open - name: flat_settings in: query description: 'If `true`, returns settings in flat format.' schema: type: boolean default: false - name: ignore_unavailable in: query description: "If `false`, the request returns an error if it targets a concrete (non-wildcarded)\nindex, alias, or data stream that is missing, closed, or otherwise unavailable.\nIf `true`, unavailable concrete targets are silently ignored." schema: type: boolean default: false - name: include_defaults in: query description: 'If `true`, return all default settings in the response.' schema: type: boolean default: false - name: local in: query description: 'If `true`, the request retrieves information from the local node only.' schema: type: boolean default: false responses: '200': description: '' content: application/json: { } x-state: Generally available x-codeSamples: - lang: Console source: "HEAD my-data-stream\n" - lang: Python source: "resp = client.indices.exists(\n index=\"my-data-stream\",\n)" - lang: JavaScript source: "const response = await client.indices.exists({\n index: \"my-data-stream\",\n});" - lang: Ruby source: "response = client.indices.exists(\n index: \"my-data-stream\"\n)" - lang: PHP source: "$resp = $client->indices()->exists([\n \"index\" => \"my-data-stream\",\n]);" - lang: curl source: 'curl --head -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-data-stream"' - lang: C# source: 'var response = await client.Indices.ExistsAsync(indices: new[] { "my-data-stream" });' - lang: Java source: "client.indices().exists(e -> e\n .index(\"my-data-stream\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_data_stream/{name}': get: tags: - data stream summary: "Get data streams\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_data_stream\n
\n
\n GET\n /_data_stream/{name}\n
\n \n\nGet information about one or more data streams.\n\n## Required authorization\n\n* Index privileges: `view_index_metadata`\n" operationId: indices-get-data-stream parameters: - $ref: '#/components/parameters/indices.get_data_stream-name' - $ref: '#/components/parameters/indices.get_data_stream-expand_wildcards' - $ref: '#/components/parameters/indices.get_data_stream-include_defaults' - $ref: '#/components/parameters/indices.get_data_stream-master_timeout' - $ref: '#/components/parameters/indices.get_data_stream-verbose' responses: '200': $ref: '#/components/responses/indices.get_data_stream-200' x-state: Generally available; Added in 7.9.0 x-codeSamples: - lang: Console source: "GET _data_stream/my-data-stream\n" - lang: Python source: "resp = client.indices.get_data_stream(\n name=\"my-data-stream\",\n)" - lang: JavaScript source: "const response = await client.indices.getDataStream({\n name: \"my-data-stream\",\n});" - lang: Ruby source: "response = client.indices.get_data_stream(\n name: \"my-data-stream\"\n)" - lang: PHP source: "$resp = $client->indices()->getDataStream([\n \"name\" => \"my-data-stream\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_data_stream/my-data-stream"' - lang: C# source: "var response = await client.Indices\n .GetDataStreamAsync(d1 => d1\n .Name(new[] { \"my-data-stream\" })\n );" - lang: Java source: "client.indices().getDataStream(g -> g\n .name(\"my-data-stream\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - data stream summary: Create a data stream description: "You must have a matching index template with data stream enabled.\n\n## Required authorization\n\n* Index privileges: `create_index`\n" operationId: indices-create-data-stream parameters: - name: name in: path description: "Name of the data stream, which must meet the following criteria:\nLowercase only;\nCannot include `\\`, `/`, `*`, `?`, `\"`, `<`, `>`, `|`, `,`, `#`, `:`, or a space character;\nCannot start with `-`, `_`, `+`, or `.ds-`;\nCannot be `.` or `..`;\nCannot be longer than 255 bytes. Multi-byte characters count towards this limit faster." required: true schema: $ref: '#/components/schemas/_types.DataStreamName' - name: master_timeout in: query description: 'Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: 'Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 7.9.0 x-codeSamples: - lang: Console source: "PUT _data_stream/logs-foo-bar\n" - lang: Python source: "resp = client.indices.create_data_stream(\n name=\"logs-foo-bar\",\n)" - lang: JavaScript source: "const response = await client.indices.createDataStream({\n name: \"logs-foo-bar\",\n});" - lang: Ruby source: "response = client.indices.create_data_stream(\n name: \"logs-foo-bar\"\n)" - lang: PHP source: "$resp = $client->indices()->createDataStream([\n \"name\" => \"logs-foo-bar\",\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_data_stream/logs-foo-bar"' - lang: C# source: 'var response = await client.Indices.CreateDataStreamAsync(name: "logs-foo-bar");' - lang: Java source: "client.indices().createDataStream(c -> c\n .name(\"logs-foo-bar\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - data stream summary: Delete data streams description: "Deletes one or more data streams and their backing indices.\n\n## Required authorization\n\n* Index privileges: `delete_index`\n" operationId: indices-delete-data-stream parameters: - name: name in: path description: Comma-separated list of data streams to delete. Wildcard (`*`) expressions are supported. required: true schema: $ref: '#/components/schemas/_types.DataStreamNames' - name: master_timeout in: query description: 'Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: expand_wildcards in: query description: "Type of data stream that wildcard patterns can match. Supports comma-separated values,such as `open,hidden`.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: open responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 7.9.0 x-codeSamples: - lang: Console source: "DELETE _data_stream/my-data-stream\n" - lang: Python source: "resp = client.indices.delete_data_stream(\n name=\"my-data-stream\",\n)" - lang: JavaScript source: "const response = await client.indices.deleteDataStream({\n name: \"my-data-stream\",\n});" - lang: Ruby source: "response = client.indices.delete_data_stream(\n name: \"my-data-stream\"\n)" - lang: PHP source: "$resp = $client->indices()->deleteDataStream([\n \"name\" => \"my-data-stream\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_data_stream/my-data-stream"' - lang: C# source: 'var response = await client.Indices.DeleteDataStreamAsync(name: new[] { "my-data-stream" });' - lang: Java source: "client.indices().deleteDataStream(d -> d\n .name(\"my-data-stream\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_create_from/{source}/{dest}': post: tags: - migration summary: "Create an index from a source index\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_create_from/{source}/{dest}\n
\n
\n POST\n /_create_from/{source}/{dest}\n
\n \n\nCopy the mappings and settings from the source index to a destination index while allowing request settings and mappings to override the source values.\n\n## Required authorization\n\n* Index privileges: `manage`\n" externalDocs: description: Creating an index from source url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/create-index-from-source operationId: indices-create-from parameters: - $ref: '#/components/parameters/indices.create_from-source' - $ref: '#/components/parameters/indices.create_from-dest' requestBody: $ref: '#/components/requestBodies/indices.create_from' responses: '200': $ref: '#/components/responses/indices.create_from-200' x-state: Generally available; Added in 8.18.0 x-codeSamples: - lang: Console source: "POST _create_from/my-index/my-new-index\n" - lang: Python source: "resp = client.indices.create_from(\n source=\"my-index\",\n dest=\"my-new-index\",\n create_from=None,\n)" - lang: JavaScript source: "const response = await client.indices.createFrom({\n source: \"my-index\",\n dest: \"my-new-index\",\n create_from: null,\n});" - lang: Ruby source: "response = client.indices.create_from(\n source: \"my-index\",\n dest: \"my-new-index\"\n)" - lang: PHP source: "$requestFactory = Psr17FactoryDiscovery::findRequestFactory();\n$request = $requestFactory->createRequest(\n \"POST\",\n \"/_create_from/my-index/my-new-index\",\n);\n$resp = $client->sendRequest($request);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_create_from/my-index/my-new-index"' - lang: C# source: "var response = await client.Indices\n .CreateFromAsync(source: \"my-index\", dest: \"my-new-index\", d1 => d1\n .CreateFrom()\n );" - lang: Java source: "client.indices().createFrom(c -> c\n .dest(\"my-new-index\")\n .source(\"my-index\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_data_stream/{name}/_stats': get: tags: - data stream summary: "Get data stream stats\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_data_stream/_stats\n
\n
\n GET\n /_data_stream/{name}/_stats\n
\n \n\nGet statistics for one or more data streams.\n\n## Required authorization\n\n* Index privileges: `monitor`\n" operationId: indices-data-streams-stats parameters: - $ref: '#/components/parameters/indices.data_streams_stats-name' - $ref: '#/components/parameters/indices.data_streams_stats-expand_wildcards' responses: '200': $ref: '#/components/responses/indices.data_streams_stats-200' x-state: Generally available; Added in 7.9.0 x-codeSamples: - lang: Console source: "GET /_data_stream/my-index-000001/_stats\n" - lang: Python source: "resp = client.indices.data_streams_stats(\n name=\"my-index-000001\",\n)" - lang: JavaScript source: "const response = await client.indices.dataStreamsStats({\n name: \"my-index-000001\",\n});" - lang: Ruby source: "response = client.indices.data_streams_stats(\n name: \"my-index-000001\"\n)" - lang: PHP source: "$resp = $client->indices()->dataStreamsStats([\n \"name\" => \"my-index-000001\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_data_stream/my-index-000001/_stats"' - lang: C# source: "var response = await client.Indices\n .DataStreamsStatsAsync(d1 => d1\n .Name(new[] { \"my-index-000001\" })\n );" - lang: Java source: "client.indices().dataStreamsStats(d -> d\n .name(\"my-index-000001\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_aliases/{name}': post: tags: - indices summary: "Create or update an alias\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /{index}/_alias/{name}\n
\n
\n POST\n /{index}/_alias/{name}\n
\n
\n PUT\n /{index}/_aliases/{name}\n
\n
\n POST\n /{index}/_aliases/{name}\n
\n \n\nAdds a data stream or index to an alias.\n\n## Required authorization\n\n* Index privileges: `manage`\n" externalDocs: description: Aliases url: https://www.elastic.co/docs/manage-data/data-store/aliases x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/indices-add-alias.html operationId: indices-put-alias parameters: - $ref: '#/components/parameters/indices.put_alias-index' - $ref: '#/components/parameters/indices.put_alias-name' - $ref: '#/components/parameters/indices.put_alias-master_timeout' - $ref: '#/components/parameters/indices.put_alias-timeout' requestBody: $ref: '#/components/requestBodies/indices.put_alias' responses: '200': $ref: '#/components/responses/indices.put_alias-200' x-state: Generally available x-codeSamples: - lang: Console source: "POST /my-index-2099.05.06-000001/_alias/my-alias\n{\n \"filter\": {\n \"bool\": {\n \"filter\": [\n {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"now-1d/d\",\n \"lt\": \"now/d\"\n }\n }\n },\n {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n ]\n }\n }\n}" - lang: Python source: "resp = client.indices.put_alias(\n index=\"my-index-2099.05.06-000001\",\n name=\"my-alias\",\n filter={\n \"bool\": {\n \"filter\": [\n {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"now-1d/d\",\n \"lt\": \"now/d\"\n }\n }\n },\n {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n ]\n }\n },\n)" - lang: JavaScript source: "const response = await client.indices.putAlias({\n index: \"my-index-2099.05.06-000001\",\n name: \"my-alias\",\n filter: {\n bool: {\n filter: [\n {\n range: {\n \"@timestamp\": {\n gte: \"now-1d/d\",\n lt: \"now/d\",\n },\n },\n },\n {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n ],\n },\n },\n});" - lang: Ruby source: "response = client.indices.put_alias(\n index: \"my-index-2099.05.06-000001\",\n name: \"my-alias\",\n body: {\n \"filter\": {\n \"bool\": {\n \"filter\": [\n {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"now-1d/d\",\n \"lt\": \"now/d\"\n }\n }\n },\n {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n ]\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->indices()->putAlias([\n \"index\" => \"my-index-2099.05.06-000001\",\n \"name\" => \"my-alias\",\n \"body\" => [\n \"filter\" => [\n \"bool\" => [\n \"filter\" => array(\n [\n \"range\" => [\n \"@timestamp\" => [\n \"gte\" => \"now-1d/d\",\n \"lt\" => \"now/d\",\n ],\n ],\n ],\n [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ),\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"filter":{"bool":{"filter":[{"range":{"@timestamp":{"gte":"now-1d/d","lt":"now/d"}}},{"term":{"user.id":"kimchy"}}]}}}'' "$ELASTICSEARCH_URL/my-index-2099.05.06-000001/_alias/my-alias"' - lang: C# source: "var response = await client.Indices\n .PutAliasAsync(indices: new[] { \"my-index-2099.05.06-000001\" }, name: \"my-alias\", d1 => d1\n .Filter(d2 => d2\n .Bool(d3 => d3\n .Filter(d4 => d4\n .Range(new UntypedRangeQuery()\n {\n Field = global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.Timestamp),\n Gte = \"now-1d/d\",\n Lt = \"now/d\"\n }), d4 => d4\n .Term(d5 => d5\n .Field(x => x.User.Id)\n .Value(\"kimchy\")\n )\n )\n )\n )\n );" - lang: Java source: "client.indices().putAlias(p -> p\n .filter(f -> f\n .bool(b -> b\n .filter(List.of(Query.of(q -> q\n .range(r -> r\n .untyped(u -> u\n .field(\"@timestamp\")\n .gte(JsonData.fromJson(\"\\\"now-1d/d\\\"\"))\n .lt(JsonData.fromJson(\"\\\"now/d\\\"\"))\n )\n )\n ),Query.of(qu -> qu\n .term(t -> t\n .field(\"user.id\")\n .value(FieldValue.of(\"kimchy\"))\n )\n )))\n )\n )\n .index(\"my-index-2099.05.06-000001\")\n .name(\"my-alias\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - indices summary: "Delete an alias\n" description: "**All methods and paths for this operation:**\n\n
\n DELETE\n /{index}/_alias/{name}\n
\n
\n DELETE\n /{index}/_aliases/{name}\n
\n \n\nRemoves a data stream or index from an alias.\n\n## Required authorization\n\n* Index privileges: `manage`\n" operationId: indices-delete-alias parameters: - $ref: '#/components/parameters/indices.delete_alias-index' - $ref: '#/components/parameters/indices.delete_alias-name' - $ref: '#/components/parameters/indices.delete_alias-master_timeout' - $ref: '#/components/parameters/indices.delete_alias-timeout' responses: '200': $ref: '#/components/responses/indices.delete_alias-200' x-state: Generally available x-codeSamples: - lang: Console source: "DELETE my-data-stream/_alias/my-alias\n" - lang: Python source: "resp = client.indices.delete_alias(\n index=\"my-data-stream\",\n name=\"my-alias\",\n)" - lang: JavaScript source: "const response = await client.indices.deleteAlias({\n index: \"my-data-stream\",\n name: \"my-alias\",\n});" - lang: Ruby source: "response = client.indices.delete_alias(\n index: \"my-data-stream\",\n name: \"my-alias\"\n)" - lang: PHP source: "$resp = $client->indices()->deleteAlias([\n \"index\" => \"my-data-stream\",\n \"name\" => \"my-alias\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-data-stream/_alias/my-alias"' - lang: C# source: 'var response = await client.Indices.DeleteAliasAsync(indices: new[] { "my-data-stream" }, name: new[] { "my-alias" });' - lang: Java source: "client.indices().deleteAlias(d -> d\n .index(\"my-data-stream\")\n .name(\"my-alias\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_data_stream/{name}/_lifecycle': get: tags: - data stream summary: Get data stream lifecycles description: "Get the data stream lifecycle configuration of one or more data streams.\n\n## Required authorization\n\n* Index privileges: `view_index_metadata`\n" externalDocs: description: About data stream lifecycle url: https://www.elastic.co/docs/manage-data/lifecycle/data-stream x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/data-streams-get-lifecycle.html operationId: indices-get-data-lifecycle parameters: - name: name in: path description: "Comma-separated list of data streams to limit the request.\nSupports wildcards (`*`).\nTo target all data streams, omit this parameter or use `*` or `_all`." required: true schema: $ref: '#/components/schemas/_types.DataStreamNames' - name: expand_wildcards in: query description: "Type of data stream that wildcard patterns can match.\nSupports comma-separated values, such as `open,hidden`.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: open - name: include_defaults in: query description: 'If `true`, return all default settings in the response.' schema: type: boolean default: false - name: master_timeout in: query description: 'Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - data_streams - global_retention type: object properties: data_streams: type: array items: $ref: '#/components/schemas/indices.get_data_lifecycle.DataStreamWithLifecycle' global_retention: allOf: - $ref: '#/components/schemas/indices.get_data_lifecycle._types.GlobalRetention' examples: IndicesGetDataLifecycleResponseExample1: description: 'A successful response from `GET /_data_stream/{name}/_lifecycle?human&pretty`.' value: "{\n \"data_streams\": [\n {\n \"name\": \"my-data-stream-1\",\n \"lifecycle\": {\n \"enabled\": true,\n \"data_retention\": \"7d\"\n }\n },\n {\n \"name\": \"my-data-stream-2\",\n \"lifecycle\": {\n \"enabled\": true,\n \"data_retention\": \"7d\"\n }\n }\n ]\n}" x-state: Generally available; Added in 8.11.0 x-codeSamples: - lang: Console source: "GET /_data_stream/{name}/_lifecycle?human&pretty\n" - lang: Python source: "resp = client.indices.get_data_lifecycle(\n name=\"{name}\",\n human=True,\n pretty=True,\n)" - lang: JavaScript source: "const response = await client.indices.getDataLifecycle({\n name: \"{name}\",\n human: \"true\",\n pretty: \"true\",\n});" - lang: Ruby source: "response = client.indices.get_data_lifecycle(\n name: \"{name}\",\n human: \"true\",\n pretty: \"true\"\n)" - lang: PHP source: "$resp = $client->indices()->getDataLifecycle([\n \"name\" => \"{name}\",\n \"human\" => \"true\",\n \"pretty\" => \"true\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_data_stream/%7Bname%7D/_lifecycle?human&pretty"' - lang: C# source: 'var response = await client.Indices.GetDataLifecycleAsync(name: new[] { "{name}" });' - lang: Java source: "client.indices().getDataLifecycle(g -> g\n .name(\"{name}\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - data stream summary: Update data stream lifecycles description: "Update the data stream lifecycle of the specified data streams.\n\n## Required authorization\n\n* Index privileges: `manage_data_stream_lifecycle`\n" externalDocs: description: About data stream lifecycle url: https://www.elastic.co/docs/manage-data/lifecycle/data-stream x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/data-streams-put-lifecycle.html operationId: indices-put-data-lifecycle parameters: - name: name in: path description: "Comma-separated list of data streams used to limit the request.\nSupports wildcards (`*`).\nTo target all data streams use `*` or `_all`." required: true schema: $ref: '#/components/schemas/_types.DataStreamNames' - name: expand_wildcards in: query description: "Type of data stream that wildcard patterns can match.\nSupports comma-separated values, such as `open,hidden`.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: open - name: master_timeout in: query description: "Period to wait for a connection to the master node. If no response is\nreceived before the timeout expires, the request fails and returns an\nerror." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "Period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: type: object properties: data_retention: allOf: - $ref: '#/components/schemas/_types.Duration' description: "If defined, every document added to this data stream will be stored at least for this time frame.\nAny time after this duration the document could be deleted.\nWhen empty, every document in this data stream will be stored indefinitely." downsampling: type: array items: $ref: '#/components/schemas/indices._types.DownsamplingRound' description: The downsampling configuration to execute for the managed backing index after rollover. downsampling_method: allOf: - $ref: '#/components/schemas/indices._types.SamplingMethod' description: "The method used to downsample the data. There are two options `aggregate` and `last_value`. It requires\n`downsampling` to be defined. Defaults to `aggregate`." enabled: type: boolean description: "If defined, it turns data stream lifecycle on/off (`true`/`false`) for this data stream. A data stream lifecycle\nthat's disabled (enabled: `false`) will have no effect on the data stream." default: true examples: IndicesPutDataLifecycleRequestExample1: summary: Set the data stream lifecycle retention value: "{\n \"data_retention\": \"7d\"\n}" x-codeSamples: - lang: Console source: "PUT _data_stream/my-data-stream/_lifecycle\n{\n \"data_retention\": \"7d\"\n}" - lang: Python source: "resp = client.indices.put_data_lifecycle(\n name=\"my-data-stream\",\n data_retention=\"7d\",\n)" - lang: JavaScript source: "const response = await client.indices.putDataLifecycle({\n name: \"my-data-stream\",\n data_retention: \"7d\",\n});" - lang: Ruby source: "response = client.indices.put_data_lifecycle(\n name: \"my-data-stream\",\n body: {\n \"data_retention\": \"7d\"\n }\n)" - lang: PHP source: "$resp = $client->indices()->putDataLifecycle([\n \"name\" => \"my-data-stream\",\n \"body\" => [\n \"data_retention\" => \"7d\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"data_retention":"7d"}'' "$ELASTICSEARCH_URL/_data_stream/my-data-stream/_lifecycle"' - lang: C# source: "var response = await client.Indices\n .PutDataLifecycleAsync(name: new[] { \"my-data-stream\" }, d1 => d1\n .DataRetention(\"7d\")\n );" - lang: Java source: "client.indices().putDataLifecycle(p -> p\n .dataRetention(d -> d\n .time(\"7d\")\n )\n .name(\"my-data-stream\")\n);\n" IndicesPutDataLifecycleRequestExample2: summary: Set the data stream lifecycle downsampling description: This example configures two downsampling rounds. value: "{\n \"downsampling\": [\n {\n \"after\": \"1d\",\n \"fixed_interval\": \"10m\"\n },\n {\n \"after\": \"7d\",\n \"fixed_interval\": \"1d\"\n }\n ]\n}" x-codeSamples: - lang: Console source: "PUT _data_stream/my-weather-sensor-data-stream/_lifecycle\n{\n \"downsampling\": [\n {\n \"after\": \"1d\",\n \"fixed_interval\": \"10m\"\n },\n {\n \"after\": \"7d\",\n \"fixed_interval\": \"1d\"\n }\n ]\n}" - lang: Python source: "resp = client.indices.put_data_lifecycle(\n name=\"my-weather-sensor-data-stream\",\n downsampling=[\n {\n \"after\": \"1d\",\n \"fixed_interval\": \"10m\"\n },\n {\n \"after\": \"7d\",\n \"fixed_interval\": \"1d\"\n }\n ],\n)" - lang: JavaScript source: "const response = await client.indices.putDataLifecycle({\n name: \"my-weather-sensor-data-stream\",\n downsampling: [\n {\n after: \"1d\",\n fixed_interval: \"10m\",\n },\n {\n after: \"7d\",\n fixed_interval: \"1d\",\n },\n ],\n});" - lang: Ruby source: "response = client.indices.put_data_lifecycle(\n name: \"my-weather-sensor-data-stream\",\n body: {\n \"downsampling\": [\n {\n \"after\": \"1d\",\n \"fixed_interval\": \"10m\"\n },\n {\n \"after\": \"7d\",\n \"fixed_interval\": \"1d\"\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->indices()->putDataLifecycle([\n \"name\" => \"my-weather-sensor-data-stream\",\n \"body\" => [\n \"downsampling\" => array(\n [\n \"after\" => \"1d\",\n \"fixed_interval\" => \"10m\",\n ],\n [\n \"after\" => \"7d\",\n \"fixed_interval\" => \"1d\",\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"downsampling":[{"after":"1d","fixed_interval":"10m"},{"after":"7d","fixed_interval":"1d"}]}'' "$ELASTICSEARCH_URL/_data_stream/my-weather-sensor-data-stream/_lifecycle"' - lang: C# source: "var response = await client.Indices\n .PutDataLifecycleAsync(name: new[] { \"my-weather-sensor-data-stream\" }, d1 => d1\n .Downsampling(d2 => d2\n .After(\"1d\")\n .FixedInterval(\"10m\"), d2 => d2\n .After(\"7d\")\n .FixedInterval(\"1d\")\n )\n );" - lang: Java source: "client.indices().putDataLifecycle(p -> p\n .downsampling(List.of(DownsamplingRound.of(d -> d\n .after(a -> a\n .time(\"1d\")\n )\n .fixedInterval(f -> f\n .time(\"10m\")\n )\n ),DownsamplingRound.of(do -> do\n .after(af -> af\n .time(\"7d\")\n )\n .fixedInterval(f -> f\n .time(\"1d\")\n )\n )))\n .name(\"my-weather-sensor-data-stream\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: IndicesPutDataLifecycleResponseExample1: description: A successful response for configuring a data stream lifecycle. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 8.11.0 x-codeSamples: - lang: Console source: "PUT _data_stream/my-data-stream/_lifecycle\n{\n \"data_retention\": \"7d\"\n}" - lang: Python source: "resp = client.indices.put_data_lifecycle(\n name=\"my-data-stream\",\n data_retention=\"7d\",\n)" - lang: JavaScript source: "const response = await client.indices.putDataLifecycle({\n name: \"my-data-stream\",\n data_retention: \"7d\",\n});" - lang: Ruby source: "response = client.indices.put_data_lifecycle(\n name: \"my-data-stream\",\n body: {\n \"data_retention\": \"7d\"\n }\n)" - lang: PHP source: "$resp = $client->indices()->putDataLifecycle([\n \"name\" => \"my-data-stream\",\n \"body\" => [\n \"data_retention\" => \"7d\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"data_retention":"7d"}'' "$ELASTICSEARCH_URL/_data_stream/my-data-stream/_lifecycle"' - lang: C# source: "var response = await client.Indices\n .PutDataLifecycleAsync(name: new[] { \"my-data-stream\" }, d1 => d1\n .DataRetention(\"7d\")\n );" - lang: Java source: "client.indices().putDataLifecycle(p -> p\n .dataRetention(d -> d\n .time(\"7d\")\n )\n .name(\"my-data-stream\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - indices summary: Delete data stream lifecycles description: "Removes the data stream lifecycle from a data stream, rendering it not managed by the data stream lifecycle.\n\n## Required authorization\n\n* Index privileges: `manage_data_stream_lifecycle`\n" externalDocs: description: About data stream lifecycle url: https://www.elastic.co/docs/manage-data/lifecycle/data-stream x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/data-streams-delete-lifecycle.html operationId: indices-delete-data-lifecycle parameters: - name: name in: path description: "A comma-separated list of data streams of which the data stream lifecycle will be deleted.\nUse `*` to get all data streams" required: true schema: $ref: '#/components/schemas/_types.DataStreamNames' - name: expand_wildcards in: query description: "Whether wildcard expressions should get expanded to open or closed indices (default: open)\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: open - name: master_timeout in: query description: The period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: The period to wait for a response. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: IndicesDeleteDataLifecycleResponseExample1: description: A successful response for deleting a data stream lifecycle. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 8.11.0 x-codeSamples: - lang: Console source: "DELETE _data_stream/my-data-stream/_lifecycle\n" - lang: Python source: "resp = client.indices.delete_data_lifecycle(\n name=\"my-data-stream\",\n)" - lang: JavaScript source: "const response = await client.indices.deleteDataLifecycle({\n name: \"my-data-stream\",\n});" - lang: Ruby source: "response = client.indices.delete_data_lifecycle(\n name: \"my-data-stream\"\n)" - lang: PHP source: "$resp = $client->indices()->deleteDataLifecycle([\n \"name\" => \"my-data-stream\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_data_stream/my-data-stream/_lifecycle"' - lang: C# source: 'var response = await client.Indices.DeleteDataLifecycleAsync(name: new[] { "my-data-stream" });' - lang: Java source: "client.indices().deleteDataLifecycle(d -> d\n .name(\"my-data-stream\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_data_stream/{name}/_options': get: tags: - data stream summary: Get data stream options description: "Get the data stream options configuration of one or more data streams.\n\n## Required authorization\n\n* Index privileges: `manage`\n" operationId: indices-get-data-stream-options parameters: - name: name in: path description: "Comma-separated list of data streams to limit the request.\nSupports wildcards (`*`).\nTo target all data streams, omit this parameter or use `*` or `_all`." required: true schema: $ref: '#/components/schemas/_types.DataStreamNames' - name: expand_wildcards in: query description: "Type of data stream that wildcard patterns can match.\nSupports comma-separated values, such as `open,hidden`.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: open - name: master_timeout in: query description: 'Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - data_streams type: object properties: data_streams: type: array items: $ref: '#/components/schemas/indices.get_data_stream_options.DataStreamWithOptions' x-state: Generally available; Added in 8.19.0 x-metaTags: - content: Elasticsearch name: product_name put: tags: - data stream summary: Update data stream options description: "Update the data stream options of the specified data streams.\n\n## Required authorization\n\n* Index privileges: `manage`\n" operationId: indices-put-data-stream-options parameters: - name: name in: path description: "Comma-separated list of data streams used to limit the request.\nSupports wildcards (`*`).\nTo target all data streams use `*` or `_all`." required: true schema: $ref: '#/components/schemas/_types.DataStreamNames' - name: expand_wildcards in: query description: "Type of data stream that wildcard patterns can match.\nSupports comma-separated values, such as `open,hidden`.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: open - name: master_timeout in: query description: "Period to wait for a connection to the master node. If no response is\nreceived before the timeout expires, the request fails and returns an\nerror." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "Period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: type: object properties: failure_store: allOf: - $ref: '#/components/schemas/indices._types.DataStreamFailureStore' description: 'If defined, it will update the failure store configuration of every data stream resolved by the name expression.' required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 8.19.0 x-metaTags: - content: Elasticsearch name: product_name delete: tags: - data stream summary: Delete data stream options description: "Removes the data stream options from a data stream.\n\n## Required authorization\n\n* Index privileges: `manage`\n" operationId: indices-delete-data-stream-options parameters: - name: name in: path description: "A comma-separated list of data streams of which the data stream options will be deleted.\nUse `*` to get all data streams" required: true schema: $ref: '#/components/schemas/_types.DataStreamNames' - name: expand_wildcards in: query description: "Whether wildcard expressions should get expanded to open or closed indices\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: open - name: master_timeout in: query description: The period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: The period to wait for a response. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: IndicesDeleteDataStreamOptionsResponseExample1: description: A successful response for deleting data stream options. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 8.19.0 x-metaTags: - content: Elasticsearch name: product_name '/_index_template/{name}': get: tags: - indices summary: "Get index templates\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_index_template\n
\n
\n GET\n /_index_template/{name}\n
\n \n\nGet information about one or more index templates.\n\n## Required authorization\n\n* Cluster privileges: `manage_index_templates`\n" operationId: indices-get-index-template parameters: - $ref: '#/components/parameters/indices.get_index_template-name' - $ref: '#/components/parameters/indices.get_index_template-local' - $ref: '#/components/parameters/indices.get_index_template-flat_settings' - $ref: '#/components/parameters/indices.get_index_template-master_timeout' - $ref: '#/components/parameters/indices.get_index_template-include_defaults' responses: '200': $ref: '#/components/responses/indices.get_index_template-200' x-state: Generally available; Added in 7.9.0 x-codeSamples: - lang: Console source: "GET _index_template/*?filter_path=index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\n" - lang: Python source: "resp = client.indices.get_index_template(\n name=\"*\",\n filter_path=\"index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\",\n)" - lang: JavaScript source: "const response = await client.indices.getIndexTemplate({\n name: \"*\",\n filter_path:\n \"index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\",\n});" - lang: Ruby source: "response = client.indices.get_index_template(\n name: \"*\",\n filter_path: \"index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\"\n)" - lang: PHP source: "$resp = $client->indices()->getIndexTemplate([\n \"name\" => \"*\",\n \"filter_path\" => \"index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_index_template/*?filter_path=index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream"' - lang: C# source: "var response = await client.Indices\n .GetIndexTemplateAsync(d1 => d1\n .Name(\"*\")\n );" - lang: Java source: "client.indices().getIndexTemplate(g -> g\n .name(\"*\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name post: tags: - indices summary: "Create or update an index template\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_index_template/{name}\n
\n
\n POST\n /_index_template/{name}\n
\n \n\nIndex templates define settings, mappings, and aliases that can be applied automatically to new indices.\n\nElasticsearch applies templates to new indices based on an wildcard pattern that matches the index name.\nIndex templates are applied during data stream or index creation.\nFor data streams, these settings and mappings are applied when the stream's backing indices are created.\nSettings and mappings specified in a create index API request override any settings or mappings specified in an index template.\nChanges to index templates do not affect existing indices, including the existing backing indices of a data stream.\n\nYou can use C-style `/* *\\/` block comments in index templates.\nYou can include comments anywhere in the request body, except before the opening curly bracket.\n\n**Multiple matching templates**\n\nIf multiple index templates match the name of a new index or data stream, the template with the highest priority is used.\n\nMultiple templates with overlapping index patterns at the same priority are not allowed and an error will be thrown when attempting to create a template matching an existing index template at identical priorities.\n\n**Composing aliases, mappings, and settings**\n\nWhen multiple component templates are specified in the `composed_of` field for an index template, they are merged in the order specified, meaning that later component templates override earlier component templates.\nAny mappings, settings, or aliases from the parent index template are merged in next.\nFinally, any configuration on the index request itself is merged.\nMapping definitions are merged recursively, which means that later mapping components can introduce new field mappings and update the mapping configuration.\nIf a field mapping is already contained in an earlier component, its definition will be completely overwritten by the later one.\nThis recursive merging strategy applies not only to field mappings, but also root options like `dynamic_templates` and `meta`.\nIf an earlier component contains a `dynamic_templates` block, then by default new `dynamic_templates` entries are appended onto the end.\nIf an entry already exists with the same key, then it is overwritten by the new definition.\n\n## Required authorization\n\n* Cluster privileges: `manage_index_templates`\n" operationId: indices-put-index-template parameters: - $ref: '#/components/parameters/indices.put_index_template-name' - $ref: '#/components/parameters/indices.put_index_template-create' - $ref: '#/components/parameters/indices.put_index_template-master_timeout' - $ref: '#/components/parameters/indices.put_index_template-cause' requestBody: $ref: '#/components/requestBodies/indices.put_index_template' responses: '200': $ref: '#/components/responses/indices.put_index_template-200' x-state: Generally available; Added in 7.9.0 x-codeSamples: - lang: Console source: "PUT /_index_template/template_1\n{\n \"index_patterns\" : [\"template*\"],\n \"priority\" : 1,\n \"template\": {\n \"settings\" : {\n \"number_of_shards\" : 2\n }\n }\n}" - lang: Python source: "resp = client.indices.put_index_template(\n name=\"template_1\",\n index_patterns=[\n \"template*\"\n ],\n priority=1,\n template={\n \"settings\": {\n \"number_of_shards\": 2\n }\n },\n)" - lang: JavaScript source: "const response = await client.indices.putIndexTemplate({\n name: \"template_1\",\n index_patterns: [\"template*\"],\n priority: 1,\n template: {\n settings: {\n number_of_shards: 2,\n },\n },\n});" - lang: Ruby source: "response = client.indices.put_index_template(\n name: \"template_1\",\n body: {\n \"index_patterns\": [\n \"template*\"\n ],\n \"priority\": 1,\n \"template\": {\n \"settings\": {\n \"number_of_shards\": 2\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->indices()->putIndexTemplate([\n \"name\" => \"template_1\",\n \"body\" => [\n \"index_patterns\" => array(\n \"template*\",\n ),\n \"priority\" => 1,\n \"template\" => [\n \"settings\" => [\n \"number_of_shards\" => 2,\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"index_patterns":["template*"],"priority":1,"template":{"settings":{"number_of_shards":2}}}'' "$ELASTICSEARCH_URL/_index_template/template_1"' - lang: C# source: "var response = await client.Indices\n .PutIndexTemplateAsync(name: \"template_1\", d1 => d1\n .IndexPatterns(new[] { \"template*\" })\n .Priority(1L)\n .Template(d2 => d2\n .Settings(d3 => d3\n .NumberOfShards(2)\n )\n )\n );" - lang: Java source: "client.indices().putIndexTemplate(p -> p\n .indexPatterns(\"template*\")\n .name(\"template_1\")\n .priority(1L)\n .template(t -> t\n .settings(s -> s\n .otherSettings(Map.of())\n .numberOfShards(\"2\")\n )\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - indices summary: Delete an index template description: "The provided may contain multiple template names separated by a comma. If multiple template\nnames are specified then there is no wildcard support and the provided names should match completely with\nexisting templates.\n\n## Required authorization\n\n* Cluster privileges: `manage_index_templates`\n" operationId: indices-delete-index-template parameters: - name: name in: path description: Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. required: true schema: $ref: '#/components/schemas/_types.Names' - name: master_timeout in: query description: 'Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: 'Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 7.8.0 x-codeSamples: - lang: Console source: "DELETE /_index_template/my-index-template\n" - lang: Python source: "resp = client.indices.delete_index_template(\n name=\"my-index-template\",\n)" - lang: JavaScript source: "const response = await client.indices.deleteIndexTemplate({\n name: \"my-index-template\",\n});" - lang: Ruby source: "response = client.indices.delete_index_template(\n name: \"my-index-template\"\n)" - lang: PHP source: "$resp = $client->indices()->deleteIndexTemplate([\n \"name\" => \"my-index-template\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_index_template/my-index-template"' - lang: C# source: 'var response = await client.Indices.DeleteIndexTemplateAsync(name: new[] { "my-index-template" });' - lang: Java source: "client.indices().deleteIndexTemplate(d -> d\n .name(\"my-index-template\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name head: tags: - indices summary: Check index templates description: "Check whether index templates exist.\n\n## Required authorization\n\n* Cluster privileges: `manage_index_templates`\n" operationId: indices-exists-index-template parameters: - name: name in: path description: Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. required: true schema: $ref: '#/components/schemas/_types.Name' - name: local in: query description: 'If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.' schema: type: boolean default: false - name: flat_settings in: query description: 'If true, returns settings in flat format.' schema: type: boolean default: false - name: master_timeout in: query description: 'Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: { } x-state: Generally available x-metaTags: - content: Elasticsearch name: product_name '/_template/{name}': get: tags: - indices summary: "Get legacy index templates\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_template\n
\n
\n GET\n /_template/{name}\n
\n \n\nGet information about one or more index templates.\n\nIMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.\n\n## Required authorization\n\n* Cluster privileges: `manage_index_templates`\n" externalDocs: description: Learn more about templates url: https://www.elastic.co/docs/manage-data/data-store/templates x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/indices-get-template-v1.html operationId: indices-get-template parameters: - $ref: '#/components/parameters/indices.get_template-name' - $ref: '#/components/parameters/indices.get_template-flat_settings' - $ref: '#/components/parameters/indices.get_template-local' - $ref: '#/components/parameters/indices.get_template-master_timeout' responses: '200': $ref: '#/components/responses/indices.get_template-200' deprecated: true x-state: Generally available x-codeSamples: - lang: Console source: "GET /_template/.monitoring-*\n" - lang: Python source: "resp = client.indices.get_template(\n name=\".monitoring-*\",\n)" - lang: JavaScript source: "const response = await client.indices.getTemplate({\n name: \".monitoring-*\",\n});" - lang: Ruby source: "response = client.indices.get_template(\n name: \".monitoring-*\"\n)" - lang: PHP source: "$resp = $client->indices()->getTemplate([\n \"name\" => \".monitoring-*\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_template/.monitoring-*"' - lang: C# source: "var response = await client.Indices\n .GetTemplateAsync(d1 => d1\n .Name(new[] { \".monitoring-*\" })\n );" - lang: Java source: "client.indices().getTemplate(g -> g\n .name(\".monitoring-*\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name post: tags: - indices summary: "Create or update a legacy index template\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_template/{name}\n
\n
\n POST\n /_template/{name}\n
\n \n\nIndex templates define settings, mappings, and aliases that can be applied automatically to new indices.\nElasticsearch applies templates to new indices based on an index pattern that matches the index name.\n\nIMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.\n\nComposable templates always take precedence over legacy templates.\nIf no composable template matches a new index, matching legacy templates are applied according to their order.\n\nIndex templates are only applied during index creation.\nChanges to index templates do not affect existing indices.\nSettings and mappings specified in create index API requests override any settings or mappings specified in an index template.\n\nYou can use C-style `/* *\\/` block comments in index templates.\nYou can include comments anywhere in the request body, except before the opening curly bracket.\n\n**Indices matching multiple templates**\n\nMultiple index templates can potentially match an index, in this case, both the settings and mappings are merged into the final configuration of the index.\nThe order of the merging can be controlled using the order parameter, with lower order being applied first, and higher orders overriding them.\nNOTE: Multiple matching templates with the same order value will result in a non-deterministic merging order.\n\n## Required authorization\n\n* Cluster privileges: `manage_index_templates`,`manage`\n" externalDocs: description: Learn more about templates url: https://www.elastic.co/docs/manage-data/data-store/templates x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/indices-templates-v1.html operationId: indices-put-template parameters: - $ref: '#/components/parameters/indices.put_template-name' - $ref: '#/components/parameters/indices.put_template-create' - $ref: '#/components/parameters/indices.put_template-master_timeout' - $ref: '#/components/parameters/indices.put_template-order' - $ref: '#/components/parameters/indices.put_template-cause' requestBody: $ref: '#/components/requestBodies/indices.put_template' responses: '200': $ref: '#/components/responses/indices.put_template-200' deprecated: true x-state: Generally available x-codeSamples: - lang: Console source: "PUT _template/template_1\n{\n \"index_patterns\": [\n \"te*\",\n \"bar*\"\n ],\n \"settings\": {\n \"number_of_shards\": 1\n },\n \"mappings\": {\n \"_source\": {\n \"enabled\": false\n },\n \"properties\": {\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n }\n }\n}" - lang: Python source: "resp = client.indices.put_template(\n name=\"template_1\",\n index_patterns=[\n \"te*\",\n \"bar*\"\n ],\n settings={\n \"number_of_shards\": 1\n },\n mappings={\n \"_source\": {\n \"enabled\": False\n },\n \"properties\": {\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.indices.putTemplate({\n name: \"template_1\",\n index_patterns: [\"te*\", \"bar*\"],\n settings: {\n number_of_shards: 1,\n },\n mappings: {\n _source: {\n enabled: false,\n },\n properties: {\n host_name: {\n type: \"keyword\",\n },\n created_at: {\n type: \"date\",\n format: \"EEE MMM dd HH:mm:ss Z yyyy\",\n },\n },\n },\n});" - lang: Ruby source: "response = client.indices.put_template(\n name: \"template_1\",\n body: {\n \"index_patterns\": [\n \"te*\",\n \"bar*\"\n ],\n \"settings\": {\n \"number_of_shards\": 1\n },\n \"mappings\": {\n \"_source\": {\n \"enabled\": false\n },\n \"properties\": {\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->indices()->putTemplate([\n \"name\" => \"template_1\",\n \"body\" => [\n \"index_patterns\" => array(\n \"te*\",\n \"bar*\",\n ),\n \"settings\" => [\n \"number_of_shards\" => 1,\n ],\n \"mappings\" => [\n \"_source\" => [\n \"enabled\" => false,\n ],\n \"properties\" => [\n \"host_name\" => [\n \"type\" => \"keyword\",\n ],\n \"created_at\" => [\n \"type\" => \"date\",\n \"format\" => \"EEE MMM dd HH:mm:ss Z yyyy\",\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"index_patterns":["te*","bar*"],"settings":{"number_of_shards":1},"mappings":{"_source":{"enabled":false},"properties":{"host_name":{"type":"keyword"},"created_at":{"type":"date","format":"EEE MMM dd HH:mm:ss Z yyyy"}}}}'' "$ELASTICSEARCH_URL/_template/template_1"' - lang: C# source: "var response = await client.Indices\n .PutTemplateAsync(name: \"template_1\", d1 => d1\n .IndexPatterns(\"te*\", \"bar*\")\n .Mappings(d2 => d2\n .Properties(d3 => d3\n .Keyword(x => x.HostName)\n .Date(x => x.CreatedAt, d4 => d4\n .Format(\"EEE MMM dd HH:mm:ss Z yyyy\")\n )\n )\n .Source(d3 => d3\n .Enabled(false)\n )\n )\n .Settings(d2 => d2\n .NumberOfShards(1)\n )\n );" - lang: Java source: "client.indices().putTemplate(p -> p\n .indexPatterns(List.of(\"te*\",\"bar*\"))\n .mappings(m -> m\n .properties(Map.of(\"created_at\", Property.of(pr -> pr\n .date(d -> d\n .format(\"EEE MMM dd HH:mm:ss Z yyyy\")\n )\n ),\"host_name\", Property.of(pro -> pro\n .keyword(k -> k)\n )))\n .source(s -> s\n .enabled(false)\n )\n )\n .name(\"template_1\")\n .settings(s -> s\n .otherSettings(Map.of())\n .numberOfShards(\"1\")\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - indices summary: Delete a legacy index template description: "IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.\n\n## Required authorization\n\n* Cluster privileges: `manage_index_templates`\n" operationId: indices-delete-template parameters: - name: name in: path description: "The name of the legacy index template to delete.\nWildcard (`*`) expressions are supported." required: true schema: $ref: '#/components/schemas/_types.Name' - name: master_timeout in: query description: "Period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "Period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' deprecated: true x-state: Generally available x-codeSamples: - lang: Console source: "DELETE _template/.cloud-hot-warm-allocation-0\n" - lang: Python source: "resp = client.indices.delete_template(\n name=\".cloud-hot-warm-allocation-0\",\n)" - lang: JavaScript source: "const response = await client.indices.deleteTemplate({\n name: \".cloud-hot-warm-allocation-0\",\n});" - lang: Ruby source: "response = client.indices.delete_template(\n name: \".cloud-hot-warm-allocation-0\"\n)" - lang: PHP source: "$resp = $client->indices()->deleteTemplate([\n \"name\" => \".cloud-hot-warm-allocation-0\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_template/.cloud-hot-warm-allocation-0"' - lang: C# source: 'var response = await client.Indices.DeleteTemplateAsync(name: ".cloud-hot-warm-allocation-0");' - lang: Java source: "client.indices().deleteTemplate(d -> d\n .name(\".cloud-hot-warm-allocation-0\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name head: tags: - indices summary: Check existence of index templates description: "Get information about whether index templates exist.\nIndex templates define settings, mappings, and aliases that can be applied automatically to new indices.\n\nIMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.\n\n## Required authorization\n\n* Cluster privileges: `manage_index_templates`\n" externalDocs: description: Learn more about templates url: https://www.elastic.co/docs/manage-data/data-store/templates x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/indices-template-exists-v1.html operationId: indices-exists-template parameters: - name: name in: path description: "A comma-separated list of index template names used to limit the request.\nWildcard (`*`) expressions are supported." required: true schema: $ref: '#/components/schemas/_types.Names' - name: flat_settings in: query description: Indicates whether to use a flat format for the response. schema: type: boolean default: false - name: local in: query description: Indicates whether to get information from the local node only. deprecated: true schema: type: boolean default: false - name: master_timeout in: query description: "The period to wait for the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nTo indicate that the request should never timeout, set it to `-1`." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: { } x-state: Generally available x-codeSamples: - lang: Console source: "HEAD /_template/template_1\n" - lang: Python source: "resp = client.indices.exists_template(\n name=\"template_1\",\n)" - lang: JavaScript source: "const response = await client.indices.existsTemplate({\n name: \"template_1\",\n});" - lang: Ruby source: "response = client.indices.exists_template(\n name: \"template_1\"\n)" - lang: PHP source: "$resp = $client->indices()->existsTemplate([\n \"name\" => \"template_1\",\n]);" - lang: curl source: 'curl --head -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_template/template_1"' - lang: C# source: 'var response = await client.Indices.ExistsTemplateAsync(name: new[] { "template_1" });' - lang: Java source: "client.indices().existsTemplate(e -> e\n .name(\"template_1\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_disk_usage': post: tags: - indices summary: Analyze the index disk usage description: "Analyze the disk usage of each field of an index or data stream.\nThis API might not support indices created in previous Elasticsearch versions.\nThe result of a small index can be inaccurate as some parts of an index might not be analyzed by the API.\n\nNOTE: The total size of fields of the analyzed shards of the index in the response is usually smaller than the index `store_size` value because some small metadata files are ignored and some parts of data files might not be scanned by the API.\nSince stored fields are stored together in a compressed format, the sizes of stored fields are also estimates and can be inaccurate.\nThe stored size of the `_id` field is likely underestimated while the `_source` field is overestimated.\n\nFor usage examples see the External documentation or refer to [Analyze the index disk usage example](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/index-disk-usage) for an example." externalDocs: description: About analyzing index disk usage url: https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-disk-usage x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/indices-disk-usage.html operationId: indices-disk-usage parameters: - name: index in: path description: "Comma-separated list of data streams, indices, and aliases used to limit the request.\nIt’s recommended to execute this API with a single index (or the latest backing index of a data stream) as the API consumes resources significantly." required: true schema: $ref: '#/components/schemas/_types.Indices' - name: allow_no_indices in: query description: "A setting that does two separate checks on the index expression.\nIf `false`, the request returns an error (1) if any wildcard expression\n(including `_all` and `*`) resolves to zero matching indices or (2) if the\ncomplete set of resolved indices, aliases or data streams is empty after all\nexpressions are evaluated. If `true`, index expressions that resolve to no\nindices are allowed and the request returns an empty result." schema: type: boolean default: true - name: expand_wildcards in: query description: "Type of index that wildcard patterns can match.\nIf the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.\nSupports comma-separated values, such as `open,hidden`.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: open - name: flush in: query description: "If `true`, the API performs a flush before analysis.\nIf `false`, the response may not include uncommitted data." schema: type: boolean default: true - name: ignore_unavailable in: query description: "If `false`, the request returns an error if it targets a concrete (non-wildcarded)\nindex, alias, or data stream that is missing, closed, or otherwise unavailable.\nIf `true`, unavailable concrete targets are silently ignored." schema: type: boolean default: false - name: run_expensive_tasks in: query description: "Analyzing field disk usage is resource-intensive.\nTo use the API, this parameter must be set to `true`." schema: type: boolean default: false responses: '200': description: '' content: application/json: schema: type: object examples: IndicesDiskUsageResponseExample1: description: An abbreviated response from `POST /my-index-000001/_disk_usage?run_expensive_tasks=true`. value: "{\n \"_shards\": {\n \"total\": 1,\n \"successful\": 1,\n \"failed\": 0\n },\n \"my-index-000001\": {\n \"store_size\": \"929mb\",\n \"store_size_in_bytes\": 974192723,\n \"all_fields\": {\n \"total\": \"928.9mb\",\n \"total_in_bytes\": 973977084,\n \"inverted_index\": {\n \"total\": \"107.8mb\",\n \"total_in_bytes\": 113128526\n },\n \"stored_fields\": \"623.5mb\",\n \"stored_fields_in_bytes\": 653819143,\n \"doc_values\": \"125.7mb\",\n \"doc_values_in_bytes\": 131885142,\n \"points\": \"59.9mb\",\n \"points_in_bytes\": 62885773,\n \"norms\": \"2.3kb\",\n \"norms_in_bytes\": 2356,\n \"term_vectors\": \"2.2kb\",\n \"term_vectors_in_bytes\": 2310,\n \"knn_vectors\": \"0b\",\n \"knn_vectors_in_bytes\": 0\n },\n \"fields\": {\n \"_id\": {\n \"total\": \"49.3mb\",\n \"total_in_bytes\": 51709993,\n \"inverted_index\": {\n \"total\": \"29.7mb\",\n \"total_in_bytes\": 31172745\n },\n \"stored_fields\": \"19.5mb\",\n \"stored_fields_in_bytes\": 20537248,\n \"doc_values\": \"0b\",\n \"doc_values_in_bytes\": 0,\n \"points\": \"0b\",\n \"points_in_bytes\": 0,\n \"norms\": \"0b\",\n \"norms_in_bytes\": 0,\n \"term_vectors\": \"0b\",\n \"term_vectors_in_bytes\": 0,\n \"knn_vectors\": \"0b\",\n \"knn_vectors_in_bytes\": 0\n },\n \"_primary_term\": {},\n \"_seq_no\": {},\n \"_version\": {},\n \"_source\": {\n \"total\": \"603.9mb\",\n \"total_in_bytes\": 633281895,\n \"inverted_index\": {},\n \"stored_fields\": \"603.9mb\",\n \"stored_fields_in_bytes\": 633281895,\n \"doc_values\": \"0b\",\n \"doc_values_in_bytes\": 0,\n \"points\": \"0b\",\n \"points_in_bytes\": 0,\n \"norms\": \"0b\",\n \"norms_in_bytes\": 0,\n \"term_vectors\": \"0b\",\n \"term_vectors_in_bytes\": 0,\n \"knn_vectors\": \"0b\",\n \"knn_vectors_in_bytes\": 0\n },\n \"context\": {\n \"total\": \"28.6mb\",\n \"total_in_bytes\": 30060405,\n \"inverted_index\": {\n \"total\": \"22mb\",\n \"total_in_bytes\": 23090908\n },\n \"stored_fields\": \"0b\",\n \"stored_fields_in_bytes\": 0,\n \"doc_values\": \"0b\",\n \"doc_values_in_bytes\": 0,\n \"points\": \"0b\",\n \"points_in_bytes\": 0,\n \"norms\": \"2.3kb\",\n \"norms_in_bytes\": 2356,\n \"term_vectors\": \"2.2kb\",\n \"term_vectors_in_bytes\": 2310,\n \"knn_vectors\": \"0b\",\n \"knn_vectors_in_bytes\": 0\n },\n \"context.keyword\": {},\n \"message\": {},\n \"message.keyword\": {}\n }\n }\n}" x-state: Experimental; Added in 7.15.0 x-codeSamples: - lang: Console source: "POST /my-index-000001/_disk_usage?run_expensive_tasks=true\n" - lang: Python source: "resp = client.indices.disk_usage(\n index=\"my-index-000001\",\n run_expensive_tasks=True,\n)" - lang: JavaScript source: "const response = await client.indices.diskUsage({\n index: \"my-index-000001\",\n run_expensive_tasks: \"true\",\n});" - lang: Ruby source: "response = client.indices.disk_usage(\n index: \"my-index-000001\",\n run_expensive_tasks: \"true\"\n)" - lang: PHP source: "$resp = $client->indices()->diskUsage([\n \"index\" => \"my-index-000001\",\n \"run_expensive_tasks\" => \"true\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_disk_usage?run_expensive_tasks=true"' - lang: C# source: "var response = await client.Indices\n .DiskUsageAsync(indices: new[] { \"my-index-000001\" }, d1 => d1\n .RunExpensiveTasks(true)\n );" - lang: Java source: "client.indices().diskUsage(d -> d\n .index(\"my-index-000001\")\n .runExpensiveTasks(true)\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_downsample/{target_index}': post: tags: - data stream summary: Downsample an index description: "Downsamples a time series (TSDS) index and reduces its size by keeping the last value or by pre-aggregating metrics:\n\n- When running in `aggregate` mode, it pre-calculates and stores statistical summaries (`min`, `max`, `sum`, `value_count` and `avg`)\nfor each metric field grouped by a configured time interval and their dimensions.\n- When running in `last_value` mode, it keeps the last value for each metric in the configured interval and their dimensions.\n\nFor example, a TSDS index that contains metrics sampled every 10 seconds can be downsampled to an hourly index.\nAll documents within an hour interval are summarized and stored as a single document in the downsample index.\n\nNOTE: Only indices in a time series data stream are supported.\nNeither field nor document level security can be defined on the source index.\nThe source index must be read-only (`index.blocks.write: true`).\n\n## Required authorization\n\n* Index privileges: `manage`\n" operationId: indices-downsample parameters: - name: index in: path description: Name of the time series index to downsample. required: true schema: $ref: '#/components/schemas/_types.IndexName' - name: target_index in: path description: Name of the index to create. required: true schema: $ref: '#/components/schemas/_types.IndexName' requestBody: content: application/json: schema: $ref: '#/components/schemas/indices._types.DownsampleConfig' examples: DownsampleRequestExample1: value: "{\n \"fixed_interval\": \"1d\"\n}" x-codeSamples: - lang: Console source: "POST /my-time-series-index/_downsample/my-downsampled-time-series-index\n{\n \"fixed_interval\": \"1d\"\n}" - lang: Python source: "resp = client.indices.downsample(\n index=\"my-time-series-index\",\n target_index=\"my-downsampled-time-series-index\",\n config={\n \"fixed_interval\": \"1d\"\n },\n)" - lang: JavaScript source: "const response = await client.indices.downsample({\n index: \"my-time-series-index\",\n target_index: \"my-downsampled-time-series-index\",\n config: {\n fixed_interval: \"1d\",\n },\n});" - lang: Ruby source: "response = client.indices.downsample(\n index: \"my-time-series-index\",\n target_index: \"my-downsampled-time-series-index\",\n body: {\n \"fixed_interval\": \"1d\"\n }\n)" - lang: PHP source: "$resp = $client->indices()->downsample([\n \"index\" => \"my-time-series-index\",\n \"target_index\" => \"my-downsampled-time-series-index\",\n \"body\" => [\n \"fixed_interval\" => \"1d\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"fixed_interval":"1d"}'' "$ELASTICSEARCH_URL/my-time-series-index/_downsample/my-downsampled-time-series-index"' - lang: C# source: "var response = await client.Indices\n .DownsampleAsync(index: \"my-time-series-index\", targetIndex: \"my-downsampled-time-series-index\", d1 => d1\n .Config(d2 => d2\n .FixedInterval(\"1d\")\n )\n );" - lang: Java source: "client.indices().downsample(d -> d\n .index(\"my-time-series-index\")\n .targetIndex(\"my-downsampled-time-series-index\")\n .config(c -> c\n .fixedInterval(f -> f\n .time(\"1d\")\n )\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: type: object x-state: Generally available; Added in 8.7.0 x-codeSamples: - lang: Console source: "POST /my-time-series-index/_downsample/my-downsampled-time-series-index\n{\n \"fixed_interval\": \"1d\"\n}" - lang: Python source: "resp = client.indices.downsample(\n index=\"my-time-series-index\",\n target_index=\"my-downsampled-time-series-index\",\n config={\n \"fixed_interval\": \"1d\"\n },\n)" - lang: JavaScript source: "const response = await client.indices.downsample({\n index: \"my-time-series-index\",\n target_index: \"my-downsampled-time-series-index\",\n config: {\n fixed_interval: \"1d\",\n },\n});" - lang: Ruby source: "response = client.indices.downsample(\n index: \"my-time-series-index\",\n target_index: \"my-downsampled-time-series-index\",\n body: {\n \"fixed_interval\": \"1d\"\n }\n)" - lang: PHP source: "$resp = $client->indices()->downsample([\n \"index\" => \"my-time-series-index\",\n \"target_index\" => \"my-downsampled-time-series-index\",\n \"body\" => [\n \"fixed_interval\" => \"1d\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"fixed_interval":"1d"}'' "$ELASTICSEARCH_URL/my-time-series-index/_downsample/my-downsampled-time-series-index"' - lang: C# source: "var response = await client.Indices\n .DownsampleAsync(index: \"my-time-series-index\", targetIndex: \"my-downsampled-time-series-index\", d1 => d1\n .Config(d2 => d2\n .FixedInterval(\"1d\")\n )\n );" - lang: Java source: "client.indices().downsample(d -> d\n .index(\"my-time-series-index\")\n .targetIndex(\"my-downsampled-time-series-index\")\n .config(c -> c\n .fixedInterval(f -> f\n .time(\"1d\")\n )\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_alias/{name}': get: tags: - indices summary: "Get aliases\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_alias\n
\n
\n GET\n /_alias/{name}\n
\n
\n GET\n /{index}/_alias\n
\n
\n GET\n /{index}/_alias/{name}\n
\n \n\nRetrieves information for one or more data stream or index aliases.\n\n## Required authorization\n\n* Index privileges: `view_index_metadata`\n" operationId: indices-get-alias parameters: - $ref: '#/components/parameters/indices.get_alias-index' - $ref: '#/components/parameters/indices.get_alias-name' - $ref: '#/components/parameters/indices.get_alias-allow_no_indices' - $ref: '#/components/parameters/indices.get_alias-expand_wildcards' - $ref: '#/components/parameters/indices.get_alias-ignore_unavailable' - $ref: '#/components/parameters/indices.get_alias-master_timeout' responses: '200': $ref: '#/components/responses/indices.get_alias-200' '404': $ref: '#/components/responses/indices.get_alias-404' x-state: Generally available x-codeSamples: - lang: Console source: "GET _alias\n" - lang: Python source: resp = client.indices.get_alias() - lang: JavaScript source: const response = await client.indices.getAlias(); - lang: Ruby source: response = client.indices.get_alias - lang: PHP source: $resp = $client->indices()->getAlias(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_alias"' - lang: C# source: var response = await client.Indices.GetAliasAsync(); - lang: Java source: "client.indices().getAlias(g -> g);\n" x-metaTags: - content: Elasticsearch name: product_name head: tags: - indices summary: "Check aliases\n" description: "**All methods and paths for this operation:**\n\n
\n HEAD\n /_alias/{name}\n
\n
\n HEAD\n /{index}/_alias/{name}\n
\n \n\nCheck if one or more data stream or index aliases exist.\n\n## Required authorization\n\n* Index privileges: `view_index_metadata`,`manage`\n" operationId: indices-exists-alias parameters: - $ref: '#/components/parameters/indices.exists_alias-index' - $ref: '#/components/parameters/indices.exists_alias-name' - $ref: '#/components/parameters/indices.exists_alias-allow_no_indices' - $ref: '#/components/parameters/indices.exists_alias-expand_wildcards' - $ref: '#/components/parameters/indices.exists_alias-ignore_unavailable' - $ref: '#/components/parameters/indices.exists_alias-master_timeout' responses: '200': $ref: '#/components/responses/indices.exists_alias-200' x-state: Generally available x-codeSamples: - lang: Console source: "HEAD _alias/my-alias\n" - lang: Python source: "resp = client.indices.exists_alias(\n name=\"my-alias\",\n)" - lang: JavaScript source: "const response = await client.indices.existsAlias({\n name: \"my-alias\",\n});" - lang: Ruby source: "response = client.indices.exists_alias(\n name: \"my-alias\"\n)" - lang: PHP source: "$resp = $client->indices()->existsAlias([\n \"name\" => \"my-alias\",\n]);" - lang: curl source: 'curl --head -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_alias/my-alias"' - lang: C# source: "var response = await client.Indices\n .ExistsAliasAsync(new ExistsAliasRequest()\n {\n Name = new[] { \"my-alias\" }\n });" - lang: Java source: "client.indices().existsAlias(e -> e\n .name(\"my-alias\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_lifecycle/explain': get: tags: - data stream summary: Get the status for a data stream lifecycle description: "Get information about an index or data stream's current data stream lifecycle status, such as time since index creation, time since rollover, the lifecycle configuration managing the index, or any errors encountered during lifecycle execution.\n\n## Required authorization\n\n* Index privileges: `view_index_metadata`\n" externalDocs: description: About data stream lifecycle url: https://www.elastic.co/docs/manage-data/lifecycle/data-stream x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/data-streams-explain-lifecycle.html operationId: indices-explain-data-lifecycle parameters: - name: index in: path description: Comma-separated list of index names to explain required: true schema: $ref: '#/components/schemas/_types.Indices' - name: include_defaults in: query description: Indicates if the API should return the default values the system uses for the index's lifecycle schema: type: boolean default: false - name: master_timeout in: query description: The period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - indices type: object properties: indices: type: object additionalProperties: $ref: '#/components/schemas/indices.explain_data_lifecycle.DataStreamLifecycleExplain' examples: IndicesExplainDataLifecycleResponseExample1: summary: Successful response description: "A successful response from `GET .ds-metrics-2023.03.22-000001/_lifecycle/explain`, which retrieves the lifecycle status for a data stream backing index. If the index is managed by a data stream lifecycle, the API will show the `managed_by_lifecycle` field set to `true` and the rest of the response will contain information about the lifecycle status for this index.\n" value: "{\n \"indices\": {\n \".ds-my-data-stream-test-4-2026.10.20-000001\": {\n \"index\": \".ds-my-data-stream-test-4-2026.10.20-000001\",\n \"managed_by_lifecycle\": true,\n \"index_creation_date_millis\": 1792460913455,\n \"time_since_index_creation\": \"1.31m\",\n \"lifecycle\": {\n \"enabled\": true,\n \"data_retention\": \"7d\",\n \"effective_retention\": \"7d\",\n \"retention_determined_by\": \"data_stream_configuration\",\n \"frozen_after\": \"30d\"\n },\n \"frozen_transition_status\": \"waiting\"\n }\n }\n}" IndicesExplainDataLifecycleResponseExample2: summary: Successful response with error messages description: The API reports any errors related to the lifecycle execution for the target index. value: "{\n \"indices\": {\n \".ds-my-data-stream-test-2026.10.17-000001\": {\n \"index\": \".ds-my-data-stream-test-2026.10.17-000001\",\n \"managed_by_lifecycle\": true,\n \"index_creation_date_millis\": 1792195511314,\n \"time_since_index_creation\": \"3.07d\",\n \"rollover_date_millis\": 1792440980120,\n \"time_since_rollover\": \"5.51h\",\n \"generation_time\": \"5.51h\",\n \"lifecycle\": {\n \"enabled\": true,\n \"data_retention\": \"30d\",\n \"effective_retention\": \"30d\",\n \"retention_determined_by\": \"data_stream_configuration\"\n },\n \"error\": {\n \"first_occurrence_millis\": 1792441580075,\n \"message\": \"\"\"{\"type\":\"exception\",\"reason\":\"Force merge request only had 1 successful shards out of a total of 2\"}\"\"\",\n \"last_recorded_millis\": 1792460779960,\n \"retry_count\": 52\n }\n },\n \".ds-my-data-stream-test-2026.10.19-000002\": {\n \"index\": \".ds-my-data-stream-test-2026.10.19-000002\",\n \"managed_by_lifecycle\": true,\n \"index_creation_date_millis\": 1792440980129,\n \"time_since_index_creation\": \"5.51h\",\n \"lifecycle\": {\n \"enabled\": true,\n \"data_retention\": \"30d\",\n \"effective_retention\": \"30d\",\n \"retention_determined_by\": \"data_stream_configuration\"\n }\n }\n }\n}" x-state: Generally available; Added in 8.11.0 x-codeSamples: - lang: Console source: "GET .ds-metrics-2023.03.22-000001/_lifecycle/explain\n" - lang: Python source: "resp = client.indices.explain_data_lifecycle(\n index=\".ds-metrics-2023.03.22-000001\",\n)" - lang: JavaScript source: "const response = await client.indices.explainDataLifecycle({\n index: \".ds-metrics-2023.03.22-000001\",\n});" - lang: Ruby source: "response = client.indices.explain_data_lifecycle(\n index: \".ds-metrics-2023.03.22-000001\"\n)" - lang: PHP source: "$resp = $client->indices()->explainDataLifecycle([\n \"index\" => \".ds-metrics-2023.03.22-000001\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/.ds-metrics-2023.03.22-000001/_lifecycle/explain"' - lang: C# source: 'var response = await client.Indices.ExplainDataLifecycleAsync(indices: new[] { ".ds-metrics-2023.03.22-000001" });' - lang: Java source: "client.indices().explainDataLifecycle(e -> e\n .index(\".ds-metrics-2023.03.22-000001\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_field_usage_stats': get: tags: - indices summary: Get field usage stats description: "Get field usage information for each shard and field of an index.\nField usage statistics are automatically captured when queries are running on a cluster.\nA shard-level search request that accesses a given field, even if multiple times during that request, is counted as a single use.\n\nThe response body reports the per-shard usage count of the data structures that back the fields in the index.\nA given request will increment each count by a maximum value of 1, even if the request accesses the same field multiple times.\n\n## Required authorization\n\n* Index privileges: `manage`\n" operationId: indices-field-usage-stats parameters: - name: index in: path description: Comma-separated list or wildcard expression of index names used to limit the request. required: true schema: $ref: '#/components/schemas/_types.Indices' - name: allow_no_indices in: query description: "A setting that does two separate checks on the index expression.\nIf `false`, the request returns an error (1) if any wildcard expression\n(including `_all` and `*`) resolves to zero matching indices or (2) if the\ncomplete set of resolved indices, aliases or data streams is empty after all\nexpressions are evaluated. If `true`, index expressions that resolve to no\nindices are allowed and the request returns an empty result." schema: type: boolean - name: expand_wildcards in: query description: "Type of index that wildcard patterns can match.\nIf the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.\nSupports comma-separated values, such as `open,hidden`.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: open - name: ignore_unavailable in: query description: "If `false`, the request returns an error if it targets a concrete (non-wildcarded)\nindex, alias, or data stream that is missing, closed, or otherwise unavailable.\nIf `true`, unavailable concrete targets are silently ignored." schema: type: boolean default: false - name: fields in: query description: Comma-separated list or wildcard expressions of fields to include in the statistics. schema: $ref: '#/components/schemas/_types.Fields' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/indices.field_usage_stats.FieldsUsageBody' examples: indicesFieldUsageStatsResponseExample1: description: "An abbreviated response from `GET /my-index-000001/_field_usage_stats`. The `all_fields` object reports the sums of the usage counts for all fields in the index (on the listed shard).\n" value: "{\n \"_shards\": {\n \"total\": 1,\n \"successful\": 1,\n \"failed\": 0\n },\n \"my-index-000001\": {\n \"shards\": [\n {\n \"tracking_id\": \"MpOl0QlTQ4SYYhEe6KgJoQ\",\n \"tracking_started_at_millis\": 1625558985010,\n \"routing\": {\n \"state\": \"STARTED\",\n \"primary\": true,\n \"node\": \"gA6KeeVzQkGURFCUyV-e8Q\",\n \"relocating_node\": null\n },\n \"stats\": {\n \"all_fields\": {\n \"any\": \"6\",\n \"inverted_index\": {\n \"terms\": 1,\n \"postings\": 1,\n \"proximity\": 1,\n \"positions\": 0,\n \"term_frequencies\": 1,\n \"offsets\": 0,\n \"payloads\": 0\n },\n \"stored_fields\": 2,\n \"doc_values\": 1,\n \"points\": 0,\n \"norms\": 1,\n \"term_vectors\": 0,\n \"knn_vectors\": 0\n },\n \"fields\": {\n \"_id\": {\n \"any\": 1,\n \"inverted_index\": {\n \"terms\": 1,\n \"postings\": 1,\n \"proximity\": 1,\n \"positions\": 0,\n \"term_frequencies\": 1,\n \"offsets\": 0,\n \"payloads\": 0\n },\n \"stored_fields\": 1,\n \"doc_values\": 0,\n \"points\": 0,\n \"norms\": 0,\n \"term_vectors\": 0,\n \"knn_vectors\": 0\n },\n \"_source\": {},\n \"context\": {},\n \"message.keyword\": {}\n }\n }\n }\n ]\n }\n}" x-state: Experimental; Added in 7.15.0 x-codeSamples: - lang: Console source: "GET /my-index-000001/_field_usage_stats\n" - lang: Python source: "resp = client.indices.field_usage_stats(\n index=\"my-index-000001\",\n)" - lang: JavaScript source: "const response = await client.indices.fieldUsageStats({\n index: \"my-index-000001\",\n});" - lang: Ruby source: "response = client.indices.field_usage_stats(\n index: \"my-index-000001\"\n)" - lang: PHP source: "$resp = $client->indices()->fieldUsageStats([\n \"index\" => \"my-index-000001\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_field_usage_stats"' - lang: C# source: 'var response = await client.Indices.FieldUsageStatsAsync(indices: new[] { "my-index-000001" });' - lang: Java source: "client.indices().fieldUsageStats(f -> f\n .index(\"my-index-000001\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_flush': get: tags: - indices summary: "Flush data streams or indices\n" description: "**All methods and paths for this operation:**\n\n
\n POST\n /_flush\n
\n
\n GET\n /_flush\n
\n
\n POST\n /{index}/_flush\n
\n
\n GET\n /{index}/_flush\n
\n \n\nFlushing a data stream or index is the process of making sure that any data that is currently only stored in the transaction log is also permanently stored in the Lucene index.\nWhen restarting, Elasticsearch replays any unflushed operations from the transaction log into the Lucene index to bring it back into the state that it was in before the restart.\nElasticsearch automatically triggers flushes as needed, using heuristics that trade off the size of the unflushed transaction log against the cost of performing each flush.\n\nAfter each operation has been flushed it is permanently stored in the Lucene index.\nThis may mean that there is no need to maintain an additional copy of it in the transaction log.\nThe transaction log is made up of multiple files, called generations, and Elasticsearch will delete any generation files when they are no longer needed, freeing up disk space.\n\nIt is also possible to trigger a flush on one or more indices using the flush API, although it is rare for users to need to call this API directly.\nIf you call the flush API after indexing some documents then a successful response indicates that Elasticsearch has flushed all the documents that were indexed before the flush API was called.\n\n## Required authorization\n\n* Index privileges: `maintenance`\n" operationId: indices-flush parameters: - $ref: '#/components/parameters/indices.flush-index' - $ref: '#/components/parameters/indices.flush-allow_no_indices' - $ref: '#/components/parameters/indices.flush-expand_wildcards' - $ref: '#/components/parameters/indices.flush-force' - $ref: '#/components/parameters/indices.flush-ignore_unavailable' - $ref: '#/components/parameters/indices.flush-wait_if_ongoing' responses: '200': $ref: '#/components/responses/indices.flush-200' x-state: Generally available x-codeSamples: - lang: Console source: "POST /_flush\n" - lang: Python source: resp = client.indices.flush() - lang: JavaScript source: const response = await client.indices.flush(); - lang: Ruby source: response = client.indices.flush - lang: PHP source: $resp = $client->indices()->flush(); - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_flush"' - lang: C# source: var response = await client.Indices.FlushAsync(); - lang: Java source: "client.indices().flush(f -> f);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_forcemerge': post: tags: - indices summary: "Force a merge\n" description: "**All methods and paths for this operation:**\n\n
\n POST\n /_forcemerge\n
\n
\n POST\n /{index}/_forcemerge\n
\n \n\nPerform the force merge operation on the shards of one or more indices.\nFor data streams, the API forces a merge on the shards of the stream's backing indices.\n\nMerging reduces the number of segments in each shard by merging some of them together and also frees up the space used by deleted documents.\nMerging normally happens automatically, but sometimes it is useful to trigger a merge manually.\n\nWARNING: We recommend force merging only a read-only index (meaning the index is no longer receiving writes).\nWhen documents are updated or deleted, the old version is not immediately removed but instead soft-deleted and marked with a \"tombstone\".\nThese soft-deleted documents are automatically cleaned up during regular segment merges.\nBut force merge can cause very large (greater than 5 GB) segments to be produced, which are not eligible for regular merges.\nSo the number of soft-deleted documents can then grow rapidly, resulting in higher disk usage and worse search performance.\nIf you regularly force merge an index receiving writes, this can also make snapshots more expensive, since the new documents can't be backed up incrementally.\n\n**Blocks during a force merge**\n\nCalls to this API block until the merge is complete (unless request contains `wait_for_completion=false`).\nIf the client connection is lost before completion then the force merge process will continue in the background.\nAny new requests to force merge the same indices will also block until the ongoing force merge is complete.\n\n**Running force merge asynchronously**\n\nIf the request contains `wait_for_completion=false`, Elasticsearch performs some preflight checks, launches the request, and returns a task you can use to get the status of the task.\nHowever, you can not cancel this task as the force merge task is not cancelable.\nElasticsearch creates a record of this task as a document at `_tasks/`.\n\n**Force merging multiple indices**\n\nYou can force merge multiple indices with a single request by targeting:\n\n* One or more data streams that contain multiple backing indices\n* Multiple indices\n* One or more aliases\n* All data streams and indices in a cluster\n\nEach targeted shard is force-merged separately using the `force_merge` threadpool.\nThe `force_merge` threadpool has a fixed size of `max(1, allocatedProcessors / 8)` per node, which means multiple shards on a node may be force-merged in parallel.\nIf you expand the `force_merge` threadpool on a node then it will force merge its shards with more parallelism.\n\nForce merge makes the storage for the shard being merged temporarily increase, as it may require free space up to triple its size in case `max_num_segments parameter` is set to `1`, to rewrite all segments into a new one.\n\n**Data streams and time-based indices**\n\nForce-merging is useful for managing a data stream's older backing indices and other time-based indices, particularly after a rollover.\nIn these cases, each index only receives indexing traffic for a certain period of time.\nOnce an index receive no more writes, its shards can be force-merged to a single segment.\nThis can be a good idea because single-segment shards can sometimes use simpler and more efficient data structures to perform searches.\nFor example:\n\n```\nPOST /.ds-my-data-stream-2099.03.07-000001/_forcemerge?max_num_segments=1\n```\n\n## Required authorization\n\n* Index privileges: `maintenance`\n" externalDocs: description: More about merge settings url: https://www.elastic.co/docs/reference/elasticsearch/index-settings/merge x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/indices-forcemerge.html operationId: indices-forcemerge parameters: - $ref: '#/components/parameters/indices.forcemerge-index' - $ref: '#/components/parameters/indices.forcemerge-allow_no_indices' - $ref: '#/components/parameters/indices.forcemerge-expand_wildcards' - $ref: '#/components/parameters/indices.forcemerge-flush' - $ref: '#/components/parameters/indices.forcemerge-ignore_unavailable' - $ref: '#/components/parameters/indices.forcemerge-max_num_segments' - $ref: '#/components/parameters/indices.forcemerge-only_expunge_deletes' - $ref: '#/components/parameters/indices.forcemerge-wait_for_completion' responses: '200': $ref: '#/components/responses/indices.forcemerge-200' x-state: Generally available; Added in 2.1.0 x-codeSamples: - lang: Console source: "POST my-index-000001/_forcemerge\n" - lang: Python source: "resp = client.indices.forcemerge(\n index=\"my-index-000001\",\n)" - lang: JavaScript source: "const response = await client.indices.forcemerge({\n index: \"my-index-000001\",\n});" - lang: Ruby source: "response = client.indices.forcemerge(\n index: \"my-index-000001\"\n)" - lang: PHP source: "$resp = $client->indices()->forcemerge([\n \"index\" => \"my-index-000001\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_forcemerge"' - lang: C# source: "var response = await client.Indices\n .ForcemergeAsync(d1 => d1\n .Indices(new[] { \"my-index-000001\" })\n );" - lang: Java source: "client.indices().forcemerge(f -> f\n .index(\"my-index-000001\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_lifecycle/stats: get: tags: - data stream summary: Get data stream lifecycle stats description: "Get statistics about the data streams that are managed by a data stream lifecycle.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" externalDocs: description: About data stream lifecycle url: https://www.elastic.co/docs/manage-data/lifecycle/data-stream x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/data-streams-get-lifecycle-stats.html operationId: indices-get-data-lifecycle-stats responses: '200': description: '' content: application/json: schema: required: - data_stream_count - data_streams type: object properties: data_stream_count: type: number description: The count of data streams currently being managed by the data stream lifecycle. data_streams: type: array items: $ref: '#/components/schemas/indices.get_data_lifecycle_stats.DataStreamStats' description: Information about the data streams that are managed by the data stream lifecycle. last_run_duration_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: The duration of the last data stream lifecycle execution. time_between_starts_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: "The time that passed between the start of the last two data stream lifecycle executions.\nThis value should amount approximately to `data_streams.lifecycle.poll_interval`." examples: IndicesGetDataLifecycleStatsResponseExample1: description: A successful response for `GET _lifecycle/stats?human&pretty` value: "{\n \"last_run_duration_in_millis\": 2,\n \"last_run_duration\": \"2ms\",\n \"time_between_starts_in_millis\": 9998,\n \"time_between_starts\": \"9.99s\",\n \"data_streams_count\": 2,\n \"data_streams\": [\n {\n \"name\": \"my-data-stream\",\n \"backing_indices_in_total\": 2,\n \"backing_indices_in_error\": 0\n },\n {\n \"name\": \"my-other-stream\",\n \"backing_indices_in_total\": 2,\n \"backing_indices_in_error\": 1\n }\n ]\n}" x-state: Generally available; Added in 8.12.0 x-codeSamples: - lang: Console source: "GET _lifecycle/stats?human&pretty\n" - lang: Python source: "resp = client.indices.get_data_lifecycle_stats(\n human=True,\n pretty=True,\n)" - lang: JavaScript source: "const response = await client.indices.getDataLifecycleStats({\n human: \"true\",\n pretty: \"true\",\n});" - lang: Ruby source: "response = client.indices.get_data_lifecycle_stats(\n human: \"true\",\n pretty: \"true\"\n)" - lang: PHP source: "$resp = $client->indices()->getDataLifecycleStats([\n \"human\" => \"true\",\n \"pretty\" => \"true\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_lifecycle/stats?human&pretty"' - lang: C# source: var response = await client.Indices.GetDataLifecycleStatsAsync(); - lang: Java source: "client.indices().getDataLifecycleStats();\n" x-metaTags: - content: Elasticsearch name: product_name '/_data_stream/{name}/_mappings': get: tags: - data stream summary: Get data stream mappings description: "Get mapping information for one or more data streams.\n\n## Required authorization\n\n* Index privileges: `view_index_metadata`\n" operationId: indices-get-data-stream-mappings parameters: - name: name in: path description: A comma-separated list of data streams or data stream patterns. Supports wildcards (`*`). required: true schema: $ref: '#/components/schemas/_types.Indices' - name: master_timeout in: query description: "The period to wait for a connection to the master node. If no response is\nreceived before the timeout expires, the request fails and returns an\nerror." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - data_streams type: object properties: data_streams: type: array items: $ref: '#/components/schemas/indices.get_data_stream_mappings.DataStreamMappings' examples: IndicesGetDataStreamMappingsResponseExample1: summary: Get data stream settings on a data stream description: "This is a response to `GET /_data_stream/my-data-stream/_settings` where my-data-stream that has two settings set. The `effective_settings` field shows additional settings that are pulled from its template.\n" value: "{\n \"data_streams\": [\n {\n \"name\": \"my-data-stream\",\n \"mappings\": {\n \"properties\": {\n \"field1\": {\n \"type\": \"ip\"\n },\n \"field3\": {\n \"type\": \"text\"\n }\n }\n },\n \"effective_mappings\": {\n \"properties\": {\n \"field1\": {\n \"type\": \"ip\"\n },\n \"field2\": {\n \"type\": \"text\"\n },\n \"field3\": {\n \"type\": \"text\"\n }\n }\n }\n }\n ]\n}" x-state: Generally available; Added in 9.1.0 x-codeSamples: - lang: Console source: "GET /_data_stream/my-data-stream/_mappings\n" - lang: Python source: "resp = client.indices.get_data_stream_mappings(\n name=\"my-data-stream\",\n)" - lang: JavaScript source: "const response = await client.indices.getDataStreamMappings({\n name: \"my-data-stream\",\n});" - lang: Ruby source: "response = client.indices.get_data_stream_mappings(\n name: \"my-data-stream\"\n)" - lang: PHP source: "$resp = $client->indices()->getDataStreamMappings([\n \"name\" => \"my-data-stream\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_data_stream/my-data-stream/_mappings"' - lang: C# source: 'var response = await client.Indices.GetDataStreamMappingsAsync(name: new[] { "my-data-stream" });' - lang: Java source: "client.indices().getDataStreamMappings(g -> g\n .name(\"my-data-stream\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - data stream summary: Update data stream mappings description: "This API can be used to override mappings on specific data streams. These overrides will take precedence over what\nis specified in the template that the data stream matches. The mapping change is only applied to new write indices\nthat are created during rollover after this API is called. No indices are changed by this API.\n\n## Required authorization\n\n* Index privileges: `manage`\n" operationId: indices-put-data-stream-mappings parameters: - name: name in: path description: A comma-separated list of data streams or data stream patterns. required: true schema: $ref: '#/components/schemas/_types.Indices' - name: dry_run in: query description: "If `true`, the request does not actually change the mappings on any data streams. Instead, it\nsimulates changing the settings and reports back to the user what would have happened had these settings\nactually been applied." schema: type: boolean default: false - name: master_timeout in: query description: "The period to wait for a connection to the master node. If no response is\nreceived before the timeout expires, the request fails and returns an\nerror." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "The period to wait for a response. If no response is received before the\n timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: $ref: '#/components/schemas/_types.mapping.TypeMapping' examples: IndicesPutDataStreamMappingsRequestExample1: summary: Change a data stream mapping description: "This is a request to add or modify two fields in a mapping on a data stream.\n" value: "{\n \"properties\":{\n \"field1\":{\n \"type\":\"ip\"\n },\n \"field3\":{\n \"type\":\"text\"\n }\n }\n}" x-codeSamples: - lang: Console source: "PUT /_data_stream/my-data-stream/_mappings\n{\n \"properties\":{\n \"field1\":{\n \"type\":\"ip\"\n },\n \"field3\":{\n \"type\":\"text\"\n }\n }\n}" - lang: Python source: "resp = client.indices.put_data_stream_mappings(\n name=\"my-data-stream\",\n mappings={\n \"properties\": {\n \"field1\": {\n \"type\": \"ip\"\n },\n \"field3\": {\n \"type\": \"text\"\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.indices.putDataStreamMappings({\n name: \"my-data-stream\",\n mappings: {\n properties: {\n field1: {\n type: \"ip\",\n },\n field3: {\n type: \"text\",\n },\n },\n },\n});" - lang: Ruby source: "response = client.indices.put_data_stream_mappings(\n name: \"my-data-stream\",\n body: {\n \"properties\": {\n \"field1\": {\n \"type\": \"ip\"\n },\n \"field3\": {\n \"type\": \"text\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->indices()->putDataStreamMappings([\n \"name\" => \"my-data-stream\",\n \"body\" => [\n \"properties\" => [\n \"field1\" => [\n \"type\" => \"ip\",\n ],\n \"field3\" => [\n \"type\" => \"text\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"properties":{"field1":{"type":"ip"},"field3":{"type":"text"}}}'' "$ELASTICSEARCH_URL/_data_stream/my-data-stream/_mappings"' - lang: C# source: "var response = await client.Indices\n .PutDataStreamMappingsAsync(name: new[] { \"my-data-stream\" }, d1 => d1\n .Mappings(d2 => d2\n .Properties(d3 => d3\n .Ip(x => x.Field1)\n .Text(x => x.Field3)\n )\n )\n );" - lang: Java source: "client.indices().putDataStreamMappings(p -> p\n .name(\"my-data-stream\")\n .mappings(m -> m\n .properties(Map.of(\"field1\", Property.of(pr -> pr\n .ip(i -> i)\n ),\"field3\", Property.of(pro -> pro\n .text(t -> t)\n )))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - data_streams type: object properties: data_streams: type: array items: $ref: '#/components/schemas/indices.put_data_stream_mappings.UpdatedDataStreamMappings' examples: IndicesPutDataStreamMappingsResponseExample1: summary: Change data stream settings on a data stream description: "This shows a response to `PUT /_data_stream/my-data-stream/_settings` when two settings are successfully updated on the data stream. In this case, `index.number_of_shards` is only applied to the data stream -- it will be applied to the write index on rollover. The setting `index.lifecycle.name` is applied to the data stream and all backing indices.\n" value: "{\n \"data_streams\": [\n {\n \"name\": \"my-data-stream\",\n \"applied_to_data_stream\": true,\n \"mappings\": {\n \"properties\": {\n \"field1\": {\n \"type\": \"ip\"\n },\n \"field3\": {\n \"type\": \"text\"\n }\n }\n },\n \"effective_mappings\": {\n \"properties\": {\n \"field1\": {\n \"type\": \"ip\"\n },\n \"field3\": {\n \"type\": \"text\"\n }\n }\n }\n }\n ]\n}" IndicesPutDataStreamMappingsResponseExample2: summary: Attempt to change a data stream setting that is not allowed description: "This shows a response to `PUT /_data_stream/my-data-stream/_settings` when a user attempts to set a setting that is not allowed on a data stream. As a result, no change was applied to the data stream.\n" value: "{\n \"data_streams\": [\n {\n \"name\": \"my-data-stream\",\n \"applied_to_data_stream\": false,\n \"error\": \"Failed to parse mapping: The mapper type [txt] declared on field [field1] does not exist. It might have been created within a future version or requires a plugin to be installed. Check the documentation.\",\n \"mappings\": {\n \"_doc\": {}\n },\n \"effective_mappings\": {\n \"_doc\": {}\n }\n }\n ]\n}" x-state: Generally available; Added in 9.2.0 x-codeSamples: - lang: Console source: "PUT /_data_stream/my-data-stream/_mappings\n{\n \"properties\":{\n \"field1\":{\n \"type\":\"ip\"\n },\n \"field3\":{\n \"type\":\"text\"\n }\n }\n}" - lang: Python source: "resp = client.indices.put_data_stream_mappings(\n name=\"my-data-stream\",\n mappings={\n \"properties\": {\n \"field1\": {\n \"type\": \"ip\"\n },\n \"field3\": {\n \"type\": \"text\"\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.indices.putDataStreamMappings({\n name: \"my-data-stream\",\n mappings: {\n properties: {\n field1: {\n type: \"ip\",\n },\n field3: {\n type: \"text\",\n },\n },\n },\n});" - lang: Ruby source: "response = client.indices.put_data_stream_mappings(\n name: \"my-data-stream\",\n body: {\n \"properties\": {\n \"field1\": {\n \"type\": \"ip\"\n },\n \"field3\": {\n \"type\": \"text\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->indices()->putDataStreamMappings([\n \"name\" => \"my-data-stream\",\n \"body\" => [\n \"properties\" => [\n \"field1\" => [\n \"type\" => \"ip\",\n ],\n \"field3\" => [\n \"type\" => \"text\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"properties":{"field1":{"type":"ip"},"field3":{"type":"text"}}}'' "$ELASTICSEARCH_URL/_data_stream/my-data-stream/_mappings"' - lang: C# source: "var response = await client.Indices\n .PutDataStreamMappingsAsync(name: new[] { \"my-data-stream\" }, d1 => d1\n .Mappings(d2 => d2\n .Properties(d3 => d3\n .Ip(x => x.Field1)\n .Text(x => x.Field3)\n )\n )\n );" - lang: Java source: "client.indices().putDataStreamMappings(p -> p\n .name(\"my-data-stream\")\n .mappings(m -> m\n .properties(Map.of(\"field1\", Property.of(pr -> pr\n .ip(i -> i)\n ),\"field3\", Property.of(pro -> pro\n .text(t -> t)\n )))\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_data_stream/{name}/_settings': get: tags: - data stream summary: Get data stream settings description: "Get setting information for one or more data streams.\n\n## Required authorization\n\n* Index privileges: `view_index_metadata`\n" operationId: indices-get-data-stream-settings parameters: - name: name in: path description: A comma-separated list of data streams or data stream patterns. Supports wildcards (`*`). required: true schema: $ref: '#/components/schemas/_types.Indices' - name: master_timeout in: query description: "The period to wait for a connection to the master node. If no response is\nreceived before the timeout expires, the request fails and returns an\nerror." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - data_streams type: object properties: data_streams: type: array items: $ref: '#/components/schemas/indices.get_data_stream_settings.DataStreamSettings' examples: IndicesGetDataStreamSettingsResponseExample1: summary: Get data stream settings on a data stream description: "This is a response to `GET /_data_stream/my-data-stream/_settings` where my-data-stream that has two settings set. The `effective_settings` field shows additional settings that are pulled from its template.\n" value: "{\n \"data_streams\": [\n {\n \"name\": \"my-data-stream\",\n \"settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"number_of_shards\": \"11\"\n }\n },\n \"effective_settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"mode\": \"standard\",\n \"number_of_shards\": \"11\",\n \"number_of_replicas\": \"0\"\n }\n }\n }\n ]\n}" x-state: Generally available; Added in 9.1.0 x-codeSamples: - lang: Console source: "GET /_data_stream/my-data-stream/_settings\n" - lang: Python source: "resp = client.indices.get_data_stream_settings(\n name=\"my-data-stream\",\n)" - lang: JavaScript source: "const response = await client.indices.getDataStreamSettings({\n name: \"my-data-stream\",\n});" - lang: Ruby source: "response = client.indices.get_data_stream_settings(\n name: \"my-data-stream\"\n)" - lang: PHP source: "$resp = $client->indices()->getDataStreamSettings([\n \"name\" => \"my-data-stream\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_data_stream/my-data-stream/_settings"' - lang: C# source: 'var response = await client.Indices.GetDataStreamSettingsAsync(name: new[] { "my-data-stream" });' - lang: Java source: "client.indices().getDataStreamSettings(g -> g\n .name(\"my-data-stream\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - data stream summary: Update data stream settings description: "NOTE: Available in 8.19. Not available in earlier versions.\n\nThis API can be used to override settings on specific data streams. These overrides will take precedence over what\nis specified in the template that the data stream matches. To prevent your data stream from getting into an invalid state,\nonly certain settings are allowed. If possible, the setting change is applied to all\nbacking indices. Otherwise, it will be applied when the data stream is next rolled over.\n\n## Required authorization\n\n* Index privileges: `manage`\n" operationId: indices-put-data-stream-settings parameters: - name: name in: path description: A comma-separated list of data streams or data stream patterns. required: true schema: $ref: '#/components/schemas/_types.Indices' - name: dry_run in: query description: "If `true`, the request does not actually change the settings on any data streams or indices. Instead, it\nsimulates changing the settings and reports back to the user what would have happened had these settings\nactually been applied." schema: type: boolean default: false - name: master_timeout in: query description: "The period to wait for a connection to the master node. If no response is\nreceived before the timeout expires, the request fails and returns an\nerror." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "The period to wait for a response. If no response is received before the\n timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: $ref: '#/components/schemas/indices._types.IndexSettings' examples: IndicesPutDataStreamSettingsRequestExample1: summary: Change a data stream setting description: "This is a request to change two settings on a data stream.\n" value: "{\n \"index.lifecycle.name\" : \"new-test-policy\",\n \"index.number_of_shards\": 11\n}" x-codeSamples: - lang: Console source: "PUT /_data_stream/my-data-stream/_settings\n{\n \"index.lifecycle.name\" : \"new-test-policy\",\n \"index.number_of_shards\": 11\n}" - lang: Python source: "resp = client.indices.put_data_stream_settings(\n name=\"my-data-stream\",\n settings={\n \"index.lifecycle.name\": \"new-test-policy\",\n \"index.number_of_shards\": 11\n },\n)" - lang: JavaScript source: "const response = await client.indices.putDataStreamSettings({\n name: \"my-data-stream\",\n settings: {\n \"index.lifecycle.name\": \"new-test-policy\",\n \"index.number_of_shards\": 11,\n },\n});" - lang: Ruby source: "response = client.indices.put_data_stream_settings(\n name: \"my-data-stream\",\n body: {\n \"index.lifecycle.name\": \"new-test-policy\",\n \"index.number_of_shards\": 11\n }\n)" - lang: PHP source: "$resp = $client->indices()->putDataStreamSettings([\n \"name\" => \"my-data-stream\",\n \"body\" => [\n \"index.lifecycle.name\" => \"new-test-policy\",\n \"index.number_of_shards\" => 11,\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"index.lifecycle.name":"new-test-policy","index.number_of_shards":11}'' "$ELASTICSEARCH_URL/_data_stream/my-data-stream/_settings"' - lang: C# source: "var response = await client.Indices\n .PutDataStreamSettingsAsync(name: new[] { \"my-data-stream\" }, d1 => d1\n .Settings(d2 => d2\n .OtherSettings(new Dictionary()\n {\n { \"index.lifecycle.name\", \"new-test-policy\" },\n { \"index.number_of_shards\", 11 }\n })\n )\n );" - lang: Java source: "client.indices().putDataStreamSettings(p -> p\n .name(\"my-data-stream\")\n .settings(s -> s\n .otherSettings(Map.of(\"index.lifecycle.name\", JsonData.fromJson(\"\\\"new-test-policy\\\"\"),\"index.number_of_shards\", JsonData.fromJson(\"11\")))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - data_streams type: object properties: data_streams: type: array items: $ref: '#/components/schemas/indices.put_data_stream_settings.UpdatedDataStreamSettings' examples: IndicesPutDataStreamSettingsResponseExample1: summary: Change data stream settings on a data stream description: "This shows a response to `PUT /_data_stream/my-data-stream/_settings` when two settings are successfully updated on the data stream. In this case, `index.number_of_shards` is only applied to the data stream -- it will be applied to the write index on rollover. The setting `index.lifecycle.name` is applied to the data stream and all backing indices.\n" value: "{\n \"data_streams\": [\n {\n \"name\": \"my-data-stream\",\n \"applied_to_data_stream\": true,\n \"settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"number_of_shards\": \"11\"\n }\n },\n \"effective_settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"mode\": \"standard\",\n \"number_of_shards\": \"11\",\n \"number_of_replicas\": \"0\"\n }\n },\n \"index_settings_results\": {\n \"applied_to_data_stream_only\": [\n \"index.number_of_shards\"\n ],\n \"applied_to_data_stream_and_backing_indices\": [\n \"index.lifecycle.name\"\n ]\n }\n }\n ]\n}" IndicesPutDataStreamSettingsResponseExample2: summary: Change data stream settings on a data stream that has an index with a metadata block description: "This shows a response to `PUT /_data_stream/my-data-stream/_settings` when a setting is successfully applied to the data stream, but one of the backing indices, `.ds-my-data-stream-2025.05.28-000001`, has a write block. The response reports that the setting was not successfully applied to that index.\n" value: "{\n \"data_streams\": [\n {\n \"name\": \"my-data-stream\",\n \"applied_to_data_stream\": true,\n \"settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"number_of_shards\": \"11\"\n }\n },\n \"effective_settings\": {\n \"index\": {\n \"lifecycle\": {\n \"name\": \"new-test-policy\"\n },\n \"mode\": \"standard\",\n \"number_of_shards\": \"11\",\n \"number_of_replicas\": \"0\"\n }\n },\n \"index_settings_results\": {\n \"applied_to_data_stream_only\": [\n \"index.number_of_shards\"\n ],\n \"applied_to_data_stream_and_backing_indices\": [\n \"index.lifecycle.name\"\n ],\n \"errors\": [\n {\n \"index\": \".ds-my-data-stream-2025.05.28-000001\",\n \"error\": \"index [.ds-my-data-stream-2025.05.28-000001] blocked by: [FORBIDDEN/9/index metadata (api)];\"\n }\n ]\n }\n }\n ]\n}" IndicesPutDataStreamSettingsResponseExample3: summary: Attempt to change a data stream setting that is not allowed description: "This shows a response to `PUT /_data_stream/my-data-stream/_settings` when a user attempts to set a setting that is not allowed on a data stream. As a result, no change was applied to the data stream.\n" value: "{\n \"data_streams\": [\n {\n \"name\": \"my-data-stream\",\n \"applied_to_data_stream\": false,\n \"error\": \"Cannot set the following settings on a data stream: [index.number_of_replicas]\",\n \"settings\": {},\n \"effective_settings\": {},\n \"index_settings_results\": {\n \"applied_to_data_stream_only\": [],\n \"applied_to_data_stream_and_backing_indices\": []\n }\n }\n ]\n}" x-state: Generally available; Added in 9.1.0 x-codeSamples: - lang: Console source: "PUT /_data_stream/my-data-stream/_settings\n{\n \"index.lifecycle.name\" : \"new-test-policy\",\n \"index.number_of_shards\": 11\n}" - lang: Python source: "resp = client.indices.put_data_stream_settings(\n name=\"my-data-stream\",\n settings={\n \"index.lifecycle.name\": \"new-test-policy\",\n \"index.number_of_shards\": 11\n },\n)" - lang: JavaScript source: "const response = await client.indices.putDataStreamSettings({\n name: \"my-data-stream\",\n settings: {\n \"index.lifecycle.name\": \"new-test-policy\",\n \"index.number_of_shards\": 11,\n },\n});" - lang: Ruby source: "response = client.indices.put_data_stream_settings(\n name: \"my-data-stream\",\n body: {\n \"index.lifecycle.name\": \"new-test-policy\",\n \"index.number_of_shards\": 11\n }\n)" - lang: PHP source: "$resp = $client->indices()->putDataStreamSettings([\n \"name\" => \"my-data-stream\",\n \"body\" => [\n \"index.lifecycle.name\" => \"new-test-policy\",\n \"index.number_of_shards\" => 11,\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"index.lifecycle.name":"new-test-policy","index.number_of_shards":11}'' "$ELASTICSEARCH_URL/_data_stream/my-data-stream/_settings"' - lang: C# source: "var response = await client.Indices\n .PutDataStreamSettingsAsync(name: new[] { \"my-data-stream\" }, d1 => d1\n .Settings(d2 => d2\n .OtherSettings(new Dictionary()\n {\n { \"index.lifecycle.name\", \"new-test-policy\" },\n { \"index.number_of_shards\", 11 }\n })\n )\n );" - lang: Java source: "client.indices().putDataStreamSettings(p -> p\n .name(\"my-data-stream\")\n .settings(s -> s\n .otherSettings(Map.of(\"index.lifecycle.name\", JsonData.fromJson(\"\\\"new-test-policy\\\"\"),\"index.number_of_shards\", JsonData.fromJson(\"11\")))\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_mapping/field/{fields}': get: tags: - indices summary: "Get field mapping definitions\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_mapping/field/{fields}\n
\n
\n GET\n /{index}/_mapping/field/{fields}\n
\n \n\nRetrieves mapping definitions for one or more fields.\nFor data streams, the API retrieves field mappings for the stream’s backing indices.\n\nThis API is useful if you don't need a complete mapping or if an index mapping contains a large number of fields.\n\n## Required authorization\n\n* Index privileges: `view_index_metadata`\n" operationId: indices-get-field-mapping parameters: - $ref: '#/components/parameters/indices.get_field_mapping-index' - $ref: '#/components/parameters/indices.get_field_mapping-fields' - $ref: '#/components/parameters/indices.get_field_mapping-allow_no_indices' - $ref: '#/components/parameters/indices.get_field_mapping-expand_wildcards' - $ref: '#/components/parameters/indices.get_field_mapping-ignore_unavailable' - $ref: '#/components/parameters/indices.get_field_mapping-include_defaults' responses: '200': $ref: '#/components/responses/indices.get_field_mapping-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET publications/_mapping/field/title\n" - lang: Python source: "resp = client.indices.get_field_mapping(\n index=\"publications\",\n fields=\"title\",\n)" - lang: JavaScript source: "const response = await client.indices.getFieldMapping({\n index: \"publications\",\n fields: \"title\",\n});" - lang: Ruby source: "response = client.indices.get_field_mapping(\n index: \"publications\",\n fields: \"title\"\n)" - lang: PHP source: "$resp = $client->indices()->getFieldMapping([\n \"index\" => \"publications\",\n \"fields\" => \"title\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/publications/_mapping/field/title"' - lang: C# source: "var response = await client.Indices\n .GetFieldMappingAsync(new GetFieldMappingRequest()\n {\n Fields = global::Elastic.Clients.Elasticsearch.Infer.Fields(x => x.Title),\n Indices = new[] { \"publications\" }\n });" - lang: Java source: "client.indices().getFieldMapping(g -> g\n .fields(\"title\")\n .index(\"publications\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_mapping': get: tags: - indices summary: "Get mapping definitions\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_mapping\n
\n
\n GET\n /{index}/_mapping\n
\n \n\nFor data streams, the API retrieves mappings for the stream’s backing indices.\n\n## Required authorization\n\n* Index privileges: `view_index_metadata`\n" operationId: indices-get-mapping parameters: - $ref: '#/components/parameters/indices.get_mapping-index' - $ref: '#/components/parameters/indices.get_mapping-allow_no_indices' - $ref: '#/components/parameters/indices.get_mapping-expand_wildcards' - $ref: '#/components/parameters/indices.get_mapping-ignore_unavailable' - $ref: '#/components/parameters/indices.get_mapping-local' - $ref: '#/components/parameters/indices.get_mapping-master_timeout' responses: '200': $ref: '#/components/responses/indices.get_mapping-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET /books/_mapping\n" - lang: Python source: "resp = client.indices.get_mapping(\n index=\"books\",\n)" - lang: JavaScript source: "const response = await client.indices.getMapping({\n index: \"books\",\n});" - lang: Ruby source: "response = client.indices.get_mapping(\n index: \"books\"\n)" - lang: PHP source: "$resp = $client->indices()->getMapping([\n \"index\" => \"books\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/books/_mapping"' - lang: C# source: "var response = await client.Indices\n .GetMappingAsync(d1 => d1\n .Indices(new[] { \"books\" })\n );" - lang: Java source: "client.indices().getMapping(g -> g\n .index(\"books\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name post: tags: - indices summary: "Update field mappings\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /{index}/_mapping\n
\n
\n POST\n /{index}/_mapping\n
\n \n\nAdd new fields to an existing data stream or index.\nYou can use the update mapping API to:\n\n- Add a new field to an existing index\n- Update mappings for multiple indices in a single request\n- Add new properties to an object field\n- Enable multi-fields for an existing field\n- Update supported mapping parameters\n- Change a field's mapping using reindexing\n- Rename a field using a field alias\n\nLearn how to use the update mapping API with practical examples in the [Update mapping API examples](https://www.elastic.co/docs/manage-data/data-store/mapping/update-mappings-examples) guide.\n\n## Required authorization\n\n* Index privileges: `manage`\n" externalDocs: description: More about mapping parameters url: https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/mapping-parameters x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/indices-put-mapping.html operationId: indices-put-mapping parameters: - $ref: '#/components/parameters/indices.put_mapping-index' - $ref: '#/components/parameters/indices.put_mapping-allow_no_indices' - $ref: '#/components/parameters/indices.put_mapping-expand_wildcards' - $ref: '#/components/parameters/indices.put_mapping-ignore_unavailable' - $ref: '#/components/parameters/indices.put_mapping-master_timeout' - $ref: '#/components/parameters/indices.put_mapping-timeout' - $ref: '#/components/parameters/indices.put_mapping-write_index_only' requestBody: $ref: '#/components/requestBodies/indices.put_mapping' responses: '200': $ref: '#/components/responses/indices.put_mapping-200' x-state: Generally available x-codeSamples: - lang: Console source: "PUT /my-index-000001/_mapping\n{\n \"properties\": {\n \"user\": {\n \"properties\": {\n \"name\": {\n \"type\": \"keyword\"\n }\n }\n }\n }\n}" - lang: Python source: "resp = client.indices.put_mapping(\n index=\"my-index-000001\",\n properties={\n \"user\": {\n \"properties\": {\n \"name\": {\n \"type\": \"keyword\"\n }\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.indices.putMapping({\n index: \"my-index-000001\",\n properties: {\n user: {\n properties: {\n name: {\n type: \"keyword\",\n },\n },\n },\n },\n});" - lang: Ruby source: "response = client.indices.put_mapping(\n index: \"my-index-000001\",\n body: {\n \"properties\": {\n \"user\": {\n \"properties\": {\n \"name\": {\n \"type\": \"keyword\"\n }\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->indices()->putMapping([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"properties\" => [\n \"user\" => [\n \"properties\" => [\n \"name\" => [\n \"type\" => \"keyword\",\n ],\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"properties":{"user":{"properties":{"name":{"type":"keyword"}}}}}'' "$ELASTICSEARCH_URL/my-index-000001/_mapping"' - lang: C# source: "var response = await client.Indices\n .PutMappingAsync(indices: new[] { \"my-index-000001\" }, d1 => d1\n .Properties(d2 => d2\n .Object(x => x.User, d3 => d3\n .Properties(d4 => d4\n .Keyword(x => x.Name)\n )\n )\n )\n );" - lang: Java source: "client.indices().putMapping(p -> p\n .index(\"my-index-000001\")\n .properties(\"user\", pr -> pr\n .object(o -> o\n .properties(\"name\", pro -> pro\n .keyword(k -> k)\n )\n )\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_migration/reindex/{index}/_status': get: tags: - migration summary: Get the migration reindexing status description: "Get the status of a migration reindex attempt for a data stream or index.\n\n## Required authorization\n\n* Index privileges: `manage`\n" operationId: indices-get-migrate-reindex-status parameters: - name: index in: path description: The index or data stream name. required: true schema: $ref: '#/components/schemas/_types.Indices' responses: '200': description: '' content: application/json: schema: required: - start_time_millis - complete - total_indices_in_data_stream - total_indices_requiring_upgrade - successes - in_progress - pending - errors type: object properties: start_time: allOf: - $ref: '#/components/schemas/_types.DateTime' start_time_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' complete: type: boolean total_indices_in_data_stream: type: number total_indices_requiring_upgrade: type: number successes: type: number in_progress: type: array items: $ref: '#/components/schemas/indices.get_migrate_reindex_status.StatusInProgress' pending: type: number errors: type: array items: $ref: '#/components/schemas/indices.get_migrate_reindex_status.StatusError' exception: type: string x-state: Generally available; Added in 8.18.0 x-codeSamples: - lang: Console source: "GET /_migration/reindex/my-data-stream/_status\n" - lang: Python source: "resp = client.indices.get_migrate_reindex_status(\n index=\"my-data-stream\",\n)" - lang: JavaScript source: "const response = await client.indices.getMigrateReindexStatus({\n index: \"my-data-stream\",\n});" - lang: Ruby source: "response = client.indices.get_migrate_reindex_status(\n index: \"my-data-stream\"\n)" - lang: PHP source: "$requestFactory = Psr17FactoryDiscovery::findRequestFactory();\n$request = $requestFactory->createRequest(\n \"GET\",\n \"/_migration/reindex/my-data-stream/_status\",\n);\n$resp = $client->sendRequest($request);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_migration/reindex/my-data-stream/_status"' - lang: C# source: 'var response = await client.Indices.GetMigrateReindexStatusAsync(indices: new[] { "my-data-stream" });' - lang: Java source: "client.indices().getMigrateReindexStatus(g -> g\n .index(\"my-data-stream\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_settings/{name}': get: tags: - indices summary: "Get index settings\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_settings\n
\n
\n GET\n /_settings/{name}\n
\n
\n GET\n /{index}/_settings\n
\n
\n GET\n /{index}/_settings/{name}\n
\n \n\nGet setting information for one or more indices.\nFor data streams, it returns setting information for the stream's backing indices.\n\n## Required authorization\n\n* Index privileges: `view_index_metadata`\n" operationId: indices-get-settings parameters: - $ref: '#/components/parameters/indices.get_settings-index' - $ref: '#/components/parameters/indices.get_settings-name' - $ref: '#/components/parameters/indices.get_settings-allow_no_indices' - $ref: '#/components/parameters/indices.get_settings-expand_wildcards' - $ref: '#/components/parameters/indices.get_settings-flat_settings' - $ref: '#/components/parameters/indices.get_settings-ignore_unavailable' - $ref: '#/components/parameters/indices.get_settings-include_defaults' - $ref: '#/components/parameters/indices.get_settings-local' - $ref: '#/components/parameters/indices.get_settings-master_timeout' responses: '200': $ref: '#/components/responses/indices.get_settings-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET _all/_settings?expand_wildcards=all&filter_path=*.settings.index.*.slowlog\n" - lang: Python source: "resp = client.indices.get_settings(\n index=\"_all\",\n expand_wildcards=\"all\",\n filter_path=\"*.settings.index.*.slowlog\",\n)" - lang: JavaScript source: "const response = await client.indices.getSettings({\n index: \"_all\",\n expand_wildcards: \"all\",\n filter_path: \"*.settings.index.*.slowlog\",\n});" - lang: Ruby source: "response = client.indices.get_settings(\n index: \"_all\",\n expand_wildcards: \"all\",\n filter_path: \"*.settings.index.*.slowlog\"\n)" - lang: PHP source: "$resp = $client->indices()->getSettings([\n \"index\" => \"_all\",\n \"expand_wildcards\" => \"all\",\n \"filter_path\" => \"*.settings.index.*.slowlog\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_all/_settings?expand_wildcards=all&filter_path=*.settings.index.*.slowlog"' - lang: C# source: "var response = await client.Indices\n .GetSettingsAsync(d1 => d1\n .Indices(new[] { \"_all\" })\n .ExpandWildcards(ExpandWildcard.All)\n );" - lang: Java source: "client.indices().getSettings(g -> g\n .expandWildcards(ExpandWildcard.All)\n .index(\"_all\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_migration/reindex: post: tags: - migration summary: Reindex legacy backing indices description: "Reindex all legacy backing indices for a data stream.\nThis operation occurs in a persistent task.\nThe persistent task ID is returned immediately and the reindexing work is completed in that task.\n\n## Required authorization\n\n* Index privileges: `manage`\n" externalDocs: description: About reindexing data streams url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/reindex-data-stream operationId: indices-migrate-reindex requestBody: content: application/json: schema: $ref: '#/components/schemas/indices.migrate_reindex.MigrateReindex' examples: IndicesMigrateReindexExample1: description: An example body for a `POST _migration/reindex` request. value: "{\n \"source\": {\n \"index\": \"my-data-stream\"\n },\n \"mode\": \"upgrade\"\n}" x-codeSamples: - lang: Console source: "POST _migration/reindex\n{\n \"source\": {\n \"index\": \"my-data-stream\"\n },\n \"mode\": \"upgrade\"\n}" - lang: Python source: "resp = client.indices.migrate_reindex(\n reindex={\n \"source\": {\n \"index\": \"my-data-stream\"\n },\n \"mode\": \"upgrade\"\n },\n)" - lang: JavaScript source: "const response = await client.indices.migrateReindex({\n reindex: {\n source: {\n index: \"my-data-stream\",\n },\n mode: \"upgrade\",\n },\n});" - lang: Ruby source: "response = client.indices.migrate_reindex(\n body: {\n \"source\": {\n \"index\": \"my-data-stream\"\n },\n \"mode\": \"upgrade\"\n }\n)" - lang: PHP source: "$requestFactory = Psr17FactoryDiscovery::findRequestFactory();\n$streamFactory = Psr17FactoryDiscovery::findStreamFactory();\n$request = $requestFactory->createRequest(\n \"POST\",\n \"/_migration/reindex\",\n);\n$request = $request->withHeader(\"Content-Type\", \"application/json\");\n$request = $request->withBody($streamFactory->createStream(\n json_encode([\n \"source\" => [\n \"index\" => \"my-data-stream\",\n ],\n \"mode\" => \"upgrade\",\n ]),\n));\n$resp = $client->sendRequest($request);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"index":"my-data-stream"},"mode":"upgrade"}'' "$ELASTICSEARCH_URL/_migration/reindex"' - lang: C# source: "var response = await client.Indices\n .MigrateReindexAsync(d1 => d1\n .Reindex(d2 => d2\n .Mode(ModeEnum.Upgrade)\n .Source(d3 => d3\n .Index(\"my-data-stream\")\n )\n )\n );" - lang: Java source: "client.indices().migrateReindex(m -> m\n .reindex(r -> r\n .mode(ModeEnum.Upgrade)\n .source(s -> s\n .index(\"my-data-stream\")\n )\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 8.18.0 x-codeSamples: - lang: Console source: "POST _migration/reindex\n{\n \"source\": {\n \"index\": \"my-data-stream\"\n },\n \"mode\": \"upgrade\"\n}" - lang: Python source: "resp = client.indices.migrate_reindex(\n reindex={\n \"source\": {\n \"index\": \"my-data-stream\"\n },\n \"mode\": \"upgrade\"\n },\n)" - lang: JavaScript source: "const response = await client.indices.migrateReindex({\n reindex: {\n source: {\n index: \"my-data-stream\",\n },\n mode: \"upgrade\",\n },\n});" - lang: Ruby source: "response = client.indices.migrate_reindex(\n body: {\n \"source\": {\n \"index\": \"my-data-stream\"\n },\n \"mode\": \"upgrade\"\n }\n)" - lang: PHP source: "$requestFactory = Psr17FactoryDiscovery::findRequestFactory();\n$streamFactory = Psr17FactoryDiscovery::findStreamFactory();\n$request = $requestFactory->createRequest(\n \"POST\",\n \"/_migration/reindex\",\n);\n$request = $request->withHeader(\"Content-Type\", \"application/json\");\n$request = $request->withBody($streamFactory->createStream(\n json_encode([\n \"source\" => [\n \"index\" => \"my-data-stream\",\n ],\n \"mode\" => \"upgrade\",\n ]),\n));\n$resp = $client->sendRequest($request);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"index":"my-data-stream"},"mode":"upgrade"}'' "$ELASTICSEARCH_URL/_migration/reindex"' - lang: C# source: "var response = await client.Indices\n .MigrateReindexAsync(d1 => d1\n .Reindex(d2 => d2\n .Mode(ModeEnum.Upgrade)\n .Source(d3 => d3\n .Index(\"my-data-stream\")\n )\n )\n );" - lang: Java source: "client.indices().migrateReindex(m -> m\n .reindex(r -> r\n .mode(ModeEnum.Upgrade)\n .source(s -> s\n .index(\"my-data-stream\")\n )\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_data_stream/_migrate/{name}': post: tags: - data stream summary: Convert an index alias to a data stream description: "Converts an index alias to a data stream.\nYou must have a matching index template that is data stream enabled.\nThe alias must meet the following criteria:\nThe alias must have a write index;\nAll indices for the alias must have a `@timestamp` field mapping of a `date` or `date_nanos` field type;\nThe alias must not have any filters;\nThe alias must not use custom routing.\nIf successful, the request removes the alias and creates a data stream with the same name.\nThe indices for the alias become hidden backing indices for the stream.\nThe write index for the alias becomes the write index for the stream.\n\n## Required authorization\n\n* Index privileges: `manage`\n" operationId: indices-migrate-to-data-stream parameters: - name: name in: path description: Name of the index alias to convert to a data stream. required: true schema: $ref: '#/components/schemas/_types.IndexName' - name: master_timeout in: query description: 'Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: 'Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 7.9.0 x-codeSamples: - lang: Console source: "POST _data_stream/_migrate/my-time-series-data\n" - lang: Python source: "resp = client.indices.migrate_to_data_stream(\n name=\"my-time-series-data\",\n)" - lang: JavaScript source: "const response = await client.indices.migrateToDataStream({\n name: \"my-time-series-data\",\n});" - lang: Ruby source: "response = client.indices.migrate_to_data_stream(\n name: \"my-time-series-data\"\n)" - lang: PHP source: "$resp = $client->indices()->migrateToDataStream([\n \"name\" => \"my-time-series-data\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_data_stream/_migrate/my-time-series-data"' - lang: C# source: 'var response = await client.Indices.MigrateToDataStreamAsync(name: "my-time-series-data");' - lang: Java source: "client.indices().migrateToDataStream(m -> m\n .name(\"my-time-series-data\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_data_stream/_modify: post: tags: - data stream summary: Update data streams description: "Performs one or more data stream modification actions in a single atomic operation.\n\n## Required authorization\n\n* Index privileges: `manage`\n" operationId: indices-modify-data-stream requestBody: content: application/json: schema: required: - actions type: object properties: actions: type: array items: $ref: '#/components/schemas/indices.modify_data_stream.Action' description: Actions to perform. examples: IndicesModifyDataStreamExample1: description: An example body for a `POST _data_stream/_modify` request. value: "{\n \"actions\": [\n {\n \"remove_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001\"\n }\n },\n {\n \"add_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001-downsample\"\n }\n }\n ]\n}" x-codeSamples: - lang: Console source: "POST _data_stream/_modify\n{\n \"actions\": [\n {\n \"remove_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001\"\n }\n },\n {\n \"add_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001-downsample\"\n }\n }\n ]\n}" - lang: Python source: "resp = client.indices.modify_data_stream(\n actions=[\n {\n \"remove_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001\"\n }\n },\n {\n \"add_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001-downsample\"\n }\n }\n ],\n)" - lang: JavaScript source: "const response = await client.indices.modifyDataStream({\n actions: [\n {\n remove_backing_index: {\n data_stream: \"my-data-stream\",\n index: \".ds-my-data-stream-2023.07.26-000001\",\n },\n },\n {\n add_backing_index: {\n data_stream: \"my-data-stream\",\n index: \".ds-my-data-stream-2023.07.26-000001-downsample\",\n },\n },\n ],\n});" - lang: Ruby source: "response = client.indices.modify_data_stream(\n body: {\n \"actions\": [\n {\n \"remove_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001\"\n }\n },\n {\n \"add_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001-downsample\"\n }\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->indices()->modifyDataStream([\n \"body\" => [\n \"actions\" => array(\n [\n \"remove_backing_index\" => [\n \"data_stream\" => \"my-data-stream\",\n \"index\" => \".ds-my-data-stream-2023.07.26-000001\",\n ],\n ],\n [\n \"add_backing_index\" => [\n \"data_stream\" => \"my-data-stream\",\n \"index\" => \".ds-my-data-stream-2023.07.26-000001-downsample\",\n ],\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"actions":[{"remove_backing_index":{"data_stream":"my-data-stream","index":".ds-my-data-stream-2023.07.26-000001"}},{"add_backing_index":{"data_stream":"my-data-stream","index":".ds-my-data-stream-2023.07.26-000001-downsample"}}]}'' "$ELASTICSEARCH_URL/_data_stream/_modify"' - lang: C# source: "var response = await client.Indices\n .ModifyDataStreamAsync(d1 => d1\n .Actions(d2 => d2\n .RemoveBackingIndex(d3 => d3\n .DataStream(\"my-data-stream\")\n .Index(\".ds-my-data-stream-2023.07.26-000001\")\n ), d2 => d2\n .AddBackingIndex(d3 => d3\n .DataStream(\"my-data-stream\")\n .Index(\".ds-my-data-stream-2023.07.26-000001-downsample\")\n )\n )\n );" - lang: Java source: "client.indices().modifyDataStream(m -> m\n .actions(List.of(Action.of(a -> a\n .removeBackingIndex(r -> r\n .dataStream(\"my-data-stream\")\n .index(\".ds-my-data-stream-2023.07.26-000001\")\n )\n ),Action.of(ac -> ac\n .addBackingIndex(ad -> ad\n .dataStream(\"my-data-stream\")\n .index(\".ds-my-data-stream-2023.07.26-000001-downsample\")\n )\n )))\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 7.16.0 x-codeSamples: - lang: Console source: "POST _data_stream/_modify\n{\n \"actions\": [\n {\n \"remove_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001\"\n }\n },\n {\n \"add_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001-downsample\"\n }\n }\n ]\n}" - lang: Python source: "resp = client.indices.modify_data_stream(\n actions=[\n {\n \"remove_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001\"\n }\n },\n {\n \"add_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001-downsample\"\n }\n }\n ],\n)" - lang: JavaScript source: "const response = await client.indices.modifyDataStream({\n actions: [\n {\n remove_backing_index: {\n data_stream: \"my-data-stream\",\n index: \".ds-my-data-stream-2023.07.26-000001\",\n },\n },\n {\n add_backing_index: {\n data_stream: \"my-data-stream\",\n index: \".ds-my-data-stream-2023.07.26-000001-downsample\",\n },\n },\n ],\n});" - lang: Ruby source: "response = client.indices.modify_data_stream(\n body: {\n \"actions\": [\n {\n \"remove_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001\"\n }\n },\n {\n \"add_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001-downsample\"\n }\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->indices()->modifyDataStream([\n \"body\" => [\n \"actions\" => array(\n [\n \"remove_backing_index\" => [\n \"data_stream\" => \"my-data-stream\",\n \"index\" => \".ds-my-data-stream-2023.07.26-000001\",\n ],\n ],\n [\n \"add_backing_index\" => [\n \"data_stream\" => \"my-data-stream\",\n \"index\" => \".ds-my-data-stream-2023.07.26-000001-downsample\",\n ],\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"actions":[{"remove_backing_index":{"data_stream":"my-data-stream","index":".ds-my-data-stream-2023.07.26-000001"}},{"add_backing_index":{"data_stream":"my-data-stream","index":".ds-my-data-stream-2023.07.26-000001-downsample"}}]}'' "$ELASTICSEARCH_URL/_data_stream/_modify"' - lang: C# source: "var response = await client.Indices\n .ModifyDataStreamAsync(d1 => d1\n .Actions(d2 => d2\n .RemoveBackingIndex(d3 => d3\n .DataStream(\"my-data-stream\")\n .Index(\".ds-my-data-stream-2023.07.26-000001\")\n ), d2 => d2\n .AddBackingIndex(d3 => d3\n .DataStream(\"my-data-stream\")\n .Index(\".ds-my-data-stream-2023.07.26-000001-downsample\")\n )\n )\n );" - lang: Java source: "client.indices().modifyDataStream(m -> m\n .actions(List.of(Action.of(a -> a\n .removeBackingIndex(r -> r\n .dataStream(\"my-data-stream\")\n .index(\".ds-my-data-stream-2023.07.26-000001\")\n )\n ),Action.of(ac -> ac\n .addBackingIndex(ad -> ad\n .dataStream(\"my-data-stream\")\n .index(\".ds-my-data-stream-2023.07.26-000001-downsample\")\n )\n )))\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_open': post: tags: - indices summary: Open a closed index description: "For data streams, the API opens any closed backing indices.\n\nA closed index is blocked for read/write operations and does not allow all operations that opened indices allow.\nIt is not possible to index documents or to search for documents in a closed index.\nThis allows closed indices to not have to maintain internal data structures for indexing or searching documents, resulting in a smaller overhead on the cluster.\n\nWhen opening or closing an index, the master is responsible for restarting the index shards to reflect the new state of the index.\nThe shards will then go through the normal recovery process.\nThe data of opened or closed indices is automatically replicated by the cluster to ensure that enough shard copies are safely kept around at all times.\n\nYou can open and close multiple indices.\nAn error is thrown if the request explicitly refers to a missing index.\nThis behavior can be turned off by using the `ignore_unavailable=true` parameter.\n\nBy default, you must explicitly name the indices you are opening or closing.\nTo open or close indices with `_all`, `*`, or other wildcard expressions, change the `action.destructive_requires_name` setting to `false`.\nThis setting can also be changed with the cluster update settings API.\n\nClosed indices consume a significant amount of disk-space which can cause problems in managed environments.\nClosing indices can be turned off with the cluster settings API by setting `cluster.indices.close.enable` to `false`.\n\nBecause opening or closing an index allocates its shards, the `wait_for_active_shards` setting on index creation applies to the `_open` and `_close` index actions as well.\n\n## Required authorization\n\n* Index privileges: `manage`\n" operationId: indices-open parameters: - name: index in: path description: "Comma-separated list of data streams, indices, and aliases used to limit the request.\nSupports wildcards (`*`).\nBy default, you must explicitly name the indices you using to limit the request.\nTo limit a request using `_all`, `*`, or other wildcard expressions, change the `action.destructive_requires_name` setting to false.\nYou can update this setting in the `elasticsearch.yml` file or using the cluster update settings API." required: true schema: $ref: '#/components/schemas/_types.Indices' - name: allow_no_indices in: query description: "A setting that does two separate checks on the index expression.\nIf `false`, the request returns an error (1) if any wildcard expression\n(including `_all` and `*`) resolves to zero matching indices or (2) if the\ncomplete set of resolved indices, aliases or data streams is empty after all\nexpressions are evaluated. If `true`, index expressions that resolve to no\nindices are allowed and the request returns an empty result." schema: type: boolean default: true - name: expand_wildcards in: query description: "Type of index that wildcard patterns can match.\nIf the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.\nSupports comma-separated values, such as `open,hidden`.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: closed - name: ignore_unavailable in: query description: "If `false`, the request returns an error if it targets a concrete (non-wildcarded)\nindex, alias, or data stream that is missing, closed, or otherwise unavailable.\nIf `true`, unavailable concrete targets are silently ignored." schema: type: boolean default: false - name: master_timeout in: query description: "Period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "Period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: wait_for_active_shards in: query description: "The number of shard copies that must be active before proceeding with the operation.\nSet to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`)." schema: allOf: - $ref: '#/components/schemas/_types.WaitForActiveShards' default: '1' responses: '200': description: '' content: application/json: schema: required: - acknowledged - shards_acknowledged type: object properties: acknowledged: type: boolean shards_acknowledged: type: boolean examples: indicesOpenResponseExample1: description: A successful response for opening an index. value: "{\n \"acknowledged\" : true,\n \"shards_acknowledged\" : true\n}" x-state: Generally available x-codeSamples: - lang: Console source: "POST /.ds-my-data-stream-2099.03.07-000001/_open/\n" - lang: Python source: "resp = client.indices.open(\n index=\".ds-my-data-stream-2099.03.07-000001\",\n)" - lang: JavaScript source: "const response = await client.indices.open({\n index: \".ds-my-data-stream-2099.03.07-000001\",\n});" - lang: Ruby source: "response = client.indices.open(\n index: \".ds-my-data-stream-2099.03.07-000001\"\n)" - lang: PHP source: "$resp = $client->indices()->open([\n \"index\" => \".ds-my-data-stream-2099.03.07-000001\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/.ds-my-data-stream-2099.03.07-000001/_open/"' - lang: C# source: 'var response = await client.Indices.OpenAsync(indices: new[] { ".ds-my-data-stream-2099.03.07-000001" });' - lang: Java source: "client.indices().open(o -> o\n .index(\".ds-my-data-stream-2099.03.07-000001\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_data_stream/_promote/{name}': post: tags: - data stream summary: Promote a data stream description: "Promote a data stream from a replicated data stream managed by cross-cluster replication (CCR) to a regular data stream.\n\nWith CCR auto following, a data stream from a remote cluster can be replicated to the local cluster.\nThese data streams can't be rolled over in the local cluster.\nThese replicated data streams roll over only if the upstream data stream rolls over.\nIn the event that the remote cluster is no longer available, the data stream in the local cluster can be promoted to a regular data stream, which allows these data streams to be rolled over in the local cluster.\n\nNOTE: When promoting a data stream, ensure the local cluster has a data stream enabled index template that matches the data stream.\nIf this is missing, the data stream will not be able to roll over until a matching index template is created.\nThis will affect the lifecycle management of the data stream and interfere with the data stream size and retention.\n\n## Required authorization\n\n* Index privileges: `manage_follow_index`,`manage`\n" operationId: indices-promote-data-stream parameters: - name: name in: path description: The name of the data stream to promote required: true schema: $ref: '#/components/schemas/_types.IndexName' - name: master_timeout in: query description: 'Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: type: object x-state: Generally available; Added in 7.9.0 x-codeSamples: - lang: Console source: "POST /_data_stream/_promote/my-data-stream\n" - lang: Python source: "resp = client.indices.promote_data_stream(\n name=\"my-data-stream\",\n)" - lang: JavaScript source: "const response = await client.indices.promoteDataStream({\n name: \"my-data-stream\",\n});" - lang: Ruby source: "response = client.indices.promote_data_stream(\n name: \"my-data-stream\"\n)" - lang: PHP source: "$resp = $client->indices()->promoteDataStream([\n \"name\" => \"my-data-stream\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_data_stream/_promote/my-data-stream"' - lang: C# source: 'var response = await client.Indices.PromoteDataStreamAsync(name: "my-data-stream");' - lang: Java source: "client.indices().promoteDataStream(p -> p\n .name(\"my-data-stream\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_settings': put: tags: - indices summary: "Update index settings\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_settings\n
\n
\n PUT\n /{index}/_settings\n
\n \n\nChanges dynamic index settings in real time.\nFor data streams, index setting changes are applied to all backing indices by default.\n\nTo revert a setting to the default value, use a null value.\nThe list of per-index settings that can be updated dynamically on live indices can be found in index settings documentation.\nTo preserve existing settings from being updated, set the `preserve_existing` parameter to `true`.\n\nFor performance optimization during bulk indexing, you can disable the refresh interval.\nRefer to [disable refresh interval](https://www.elastic.co/docs/deploy-manage/production-guidance/optimize-performance/indexing-speed#disable-refresh-interval) for an example.\nThere are multiple valid ways to represent index settings in the request body. You can specify only the setting, for example:\n\n```\n{\n \"number_of_replicas\": 1\n}\n```\n\nOr you can use an `index` setting object:\n```\n{\n \"index\": {\n \"number_of_replicas\": 1\n }\n}\n```\n\nOr you can use dot annotation:\n```\n{\n \"index.number_of_replicas\": 1\n}\n```\n\nOr you can embed any of the aforementioned options in a `settings` object. For example:\n\n```\n{\n \"settings\": {\n \"index\": {\n \"number_of_replicas\": 1\n }\n }\n}\n```\n\nNOTE: You can only define new analyzers on closed indices.\nTo add an analyzer, you must close the index, define the analyzer, and reopen the index.\nYou cannot close the write index of a data stream.\nTo update the analyzer for a data stream's write index and future backing indices, update the analyzer in the index template used by the stream.\nThen roll over the data stream to apply the new analyzer to the stream's write index and future backing indices.\nThis affects searches and any new data added to the stream after the rollover.\nHowever, it does not affect the data stream's backing indices or their existing data.\nTo change the analyzer for existing backing indices, you must create a new data stream and reindex your data into it.\nRefer to [updating analyzers on existing indices](https://www.elastic.co/docs/manage-data/data-store/text-analysis/specify-an-analyzer#update-analyzers-on-existing-indices) for step-by-step examples.\n\n## Required authorization\n\n* Index privileges: `manage`\n" externalDocs: description: More about index settings url: https://www.elastic.co/docs/reference/elasticsearch/index-settings/ x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/indices-update-settings.html operationId: indices-put-settings parameters: - $ref: '#/components/parameters/indices.put_settings-index' - $ref: '#/components/parameters/indices.put_settings-allow_no_indices' - $ref: '#/components/parameters/indices.put_settings-expand_wildcards' - $ref: '#/components/parameters/indices.put_settings-flat_settings' - $ref: '#/components/parameters/indices.put_settings-ignore_unavailable' - $ref: '#/components/parameters/indices.put_settings-master_timeout' - $ref: '#/components/parameters/indices.put_settings-preserve_existing' - $ref: '#/components/parameters/indices.put_settings-reopen' - $ref: '#/components/parameters/indices.put_settings-timeout' requestBody: $ref: '#/components/requestBodies/indices.put_settings' responses: '200': $ref: '#/components/responses/indices.put_settings-200' x-state: Generally available x-codeSamples: - lang: Console source: "PUT /my-index-000001/_settings\n{\n \"index\" : {\n \"number_of_replicas\" : 2\n }\n}" - lang: Python source: "resp = client.indices.put_settings(\n index=\"my-index-000001\",\n settings={\n \"index\": {\n \"number_of_replicas\": 2\n }\n },\n)" - lang: JavaScript source: "const response = await client.indices.putSettings({\n index: \"my-index-000001\",\n settings: {\n index: {\n number_of_replicas: 2,\n },\n },\n});" - lang: Ruby source: "response = client.indices.put_settings(\n index: \"my-index-000001\",\n body: {\n \"index\": {\n \"number_of_replicas\": 2\n }\n }\n)" - lang: PHP source: "$resp = $client->indices()->putSettings([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"index\" => [\n \"number_of_replicas\" => 2,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"index":{"number_of_replicas":2}}'' "$ELASTICSEARCH_URL/my-index-000001/_settings"' - lang: C# source: "var response = await client.Indices\n .PutSettingsAsync(d1 => d1\n .Indices(new[] { \"my-index-000001\" })\n .Settings(d2 => d2\n .Index(d3 => d3\n .NumberOfReplicas(2)\n )\n )\n );" - lang: Java source: "client.indices().putSettings(p -> p\n .index(\"my-index-000001\")\n .settings(s -> s\n .otherSettings(Map.of())\n .index(i -> i\n .otherSettings(Map.of())\n .numberOfReplicas(\"2\")\n )\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_recovery': get: tags: - indices summary: "Get index recovery information\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_recovery\n
\n
\n GET\n /{index}/_recovery\n
\n \n\nGet information about ongoing and completed shard recoveries for one or more indices.\nFor data streams, the API returns information for the stream's backing indices.\n\nAll recoveries, whether ongoing or complete, are kept in the cluster state and may be reported on at any time.\n\nShard recovery is the process of initializing a shard copy, such as restoring a primary shard from a snapshot or creating a replica shard from a primary shard.\nWhen a shard recovery completes, the recovered shard is available for search and indexing.\n\nRecovery automatically occurs during the following processes:\n\n* When creating an index for the first time.\n* When a node rejoins the cluster and starts up any missing primary shard copies using the data that it holds in its data path.\n* Creation of new replica shard copies from the primary.\n* Relocation of a shard copy to a different node in the same cluster.\n* A snapshot restore operation.\n* A clone, shrink, or split operation.\n\nYou can determine the cause of a shard recovery using the recovery or cat recovery APIs.\n\nThe index recovery API reports information about completed recoveries only for shard copies that currently exist in the cluster.\nIt only reports the last recovery for each shard copy and does not report historical information about earlier recoveries, nor does it report information about the recoveries of shard copies that no longer exist.\nThis means that if a shard copy completes a recovery and then Elasticsearch relocates it onto a different node then the information about the original recovery will not be shown in the recovery API.\n\n## Required authorization\n\n* Index privileges: `monitor`\n" operationId: indices-recovery parameters: - $ref: '#/components/parameters/indices.recovery-index' - $ref: '#/components/parameters/indices.recovery-active_only' - $ref: '#/components/parameters/indices.recovery-detailed' - $ref: '#/components/parameters/indices.recovery-allow_no_indices' - $ref: '#/components/parameters/indices.recovery-expand_wildcards' - $ref: '#/components/parameters/indices.recovery-ignore_unavailable' responses: '200': $ref: '#/components/responses/indices.recovery-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET /_recovery?human\n" - lang: Python source: "resp = client.indices.recovery(\n human=True,\n)" - lang: JavaScript source: "const response = await client.indices.recovery({\n human: \"true\",\n});" - lang: Ruby source: "response = client.indices.recovery(\n human: \"true\"\n)" - lang: PHP source: "$resp = $client->indices()->recovery([\n \"human\" => \"true\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_recovery?human"' - lang: C# source: var response = await client.Indices.RecoveryAsync(); - lang: Java source: "client.indices().recovery(r -> r);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_refresh': get: tags: - indices summary: "Refresh an index\n" description: "**All methods and paths for this operation:**\n\n
\n POST\n /_refresh\n
\n
\n GET\n /_refresh\n
\n
\n POST\n /{index}/_refresh\n
\n
\n GET\n /{index}/_refresh\n
\n \n\nA refresh makes recent operations performed on one or more indices available for search.\nFor data streams, the API runs the refresh operation on the stream’s backing indices.\n\nBy default, Elasticsearch periodically refreshes indices every second, but only on indices that have received one search request or more in the last 30 seconds.\nYou can change this default interval with the `index.refresh_interval` setting.\n\nIn Elastic Cloud Serverless, the default refresh interval is 5 seconds across all indices.\n\nRefresh requests are synchronous and do not return a response until the refresh operation completes.\n\nRefreshes are resource-intensive.\nTo ensure good cluster performance, it's recommended to wait for Elasticsearch's periodic refresh rather than performing an explicit refresh when possible.\n\nIf your application workflow indexes documents and then runs a search to retrieve the indexed document, it's recommended to use the index API's `refresh=wait_for` query parameter option.\nThis option ensures the indexing operation waits for a periodic refresh before running the search.\n\n## Required authorization\n\n* Index privileges: `maintenance`\n" externalDocs: description: More about the refresh parameter url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/refresh-parameter x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/indices-refresh.html operationId: indices-refresh parameters: - $ref: '#/components/parameters/indices.refresh-index' - $ref: '#/components/parameters/indices.refresh-allow_no_indices' - $ref: '#/components/parameters/indices.refresh-expand_wildcards' - $ref: '#/components/parameters/indices.refresh-ignore_unavailable' responses: '200': $ref: '#/components/responses/indices.refresh-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET _refresh\n" - lang: Python source: resp = client.indices.refresh() - lang: JavaScript source: const response = await client.indices.refresh(); - lang: Ruby source: response = client.indices.refresh - lang: PHP source: $resp = $client->indices()->refresh(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_refresh"' - lang: C# source: var response = await client.Indices.RefreshAsync(); - lang: Java source: "client.indices().refresh(r -> r);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_reload_search_analyzers': post: tags: - indices summary: "Reload search analyzers\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /{index}/_reload_search_analyzers\n
\n
\n POST\n /{index}/_reload_search_analyzers\n
\n \n\nReload an index's search analyzers and their resources.\nFor data streams, the API reloads search analyzers and resources for the stream's backing indices.\n\nIMPORTANT: After reloading the search analyzers you should clear the request cache to make sure it doesn't contain responses derived from the previous versions of the analyzer.\n\nYou can use the reload search analyzers API to pick up changes to synonym files used in the `synonym_graph` or `synonym` token filter of a search analyzer.\nTo be eligible, the token filter must have an `updateable` flag of `true` and only be used in search analyzers.\n\nNOTE: This API does not perform a reload for each shard of an index.\nInstead, it performs a reload for each node containing index shards.\nAs a result, the total shard count returned by the API can differ from the number of index shards.\nBecause reloading affects every node with an index shard, it is important to update the synonym file on every data node in the cluster--including nodes that don't contain a shard replica--before using this API.\nThis ensures the synonym file is updated everywhere in the cluster in case shards are relocated in the future.\n\n## Required authorization\n\n* Index privileges: `manage`\n" externalDocs: description: More about the search_analyzer url: https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/search-analyzer x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/indices-reload-analyzers.html operationId: indices-reload-search-analyzers parameters: - $ref: '#/components/parameters/indices.reload_search_analyzers-index' - $ref: '#/components/parameters/indices.reload_search_analyzers-allow_no_indices' - $ref: '#/components/parameters/indices.reload_search_analyzers-expand_wildcards' - $ref: '#/components/parameters/indices.reload_search_analyzers-ignore_unavailable' - $ref: '#/components/parameters/indices.reload_search_analyzers-resource' responses: '200': $ref: '#/components/responses/indices.reload_search_analyzers-200' x-state: Generally available; Added in 7.3.0 x-codeSamples: - lang: Console source: "POST /my-index-000001/_reload_search_analyzers\n" - lang: Python source: "resp = client.indices.reload_search_analyzers(\n index=\"my-index-000001\",\n)" - lang: JavaScript source: "const response = await client.indices.reloadSearchAnalyzers({\n index: \"my-index-000001\",\n});" - lang: Ruby source: "response = client.indices.reload_search_analyzers(\n index: \"my-index-000001\"\n)" - lang: PHP source: "$resp = $client->indices()->reloadSearchAnalyzers([\n \"index\" => \"my-index-000001\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_reload_search_analyzers"' - lang: C# source: 'var response = await client.Indices.ReloadSearchAnalyzersAsync(indices: new[] { "my-index-000001" });' - lang: Java source: "client.indices().reloadSearchAnalyzers(r -> r\n .index(\"my-index-000001\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_resolve/cluster/{name}': get: tags: - indices summary: "Resolve the cluster\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_resolve/cluster\n
\n
\n GET\n /_resolve/cluster/{name}\n
\n \n\nResolve the specified index expressions to return information about each cluster, including the local \"querying\" cluster, if included.\nIf no index expression is provided, the API will return information about all the remote clusters that are configured on the querying cluster.\n\nThis endpoint is useful before doing a cross-cluster search in order to determine which remote clusters should be included in a search.\n\nYou use the same index expression with this endpoint as you would for cross-cluster search.\nIndex and cluster exclusions are also supported with this endpoint.\n\nFor each cluster in the index expression, information is returned about:\n\n* Whether the querying (\"local\") cluster is currently connected to each remote cluster specified in the index expression. Note that this endpoint actively attempts to contact the remote clusters, unlike the `remote/info` endpoint.\n* Whether each remote cluster is configured with `skip_unavailable` as `true` or `false`.\n* Whether there are any indices, aliases, or data streams on that cluster that match the index expression.\n* Whether the search is likely to have errors returned when you do the cross-cluster search (including any authorization errors if you do not have permission to query the index).\n* Cluster version information, including the Elasticsearch server version.\n\nFor example, `GET /_resolve/cluster/my-index-*,cluster*:my-index-*` returns information about the local cluster and all remotely configured clusters that start with the alias `cluster*`.\nEach cluster returns information about whether it has any indices, aliases or data streams that match `my-index-*`.\n\n## Note on backwards compatibility\nThe ability to query without an index expression was added in version 8.18, so when\nquerying remote clusters older than that, the local cluster will send the index\nexpression `dummy*` to those remote clusters. Thus, if an errors occur, you may see a reference\nto that index expression even though you didn't request it. If it causes a problem, you can\ninstead include an index expression like `*:*` to bypass the issue.\n\n## Advantages of using this endpoint before a cross-cluster search\n\nYou may want to exclude a cluster or index from a search when:\n\n* A remote cluster is not currently connected and is configured with `skip_unavailable=false`. Running a cross-cluster search under those conditions will cause the entire search to fail.\n* A cluster has no matching indices, aliases or data streams for the index expression (or your user does not have permissions to search them). For example, suppose your index expression is `logs*,remote1:logs*` and the remote1 cluster has no indices, aliases or data streams that match `logs*`. In that case, that cluster will return no results from that cluster if you include it in a cross-cluster search.\n* The index expression (combined with any query parameters you specify) will likely cause an exception to be thrown when you do the search. In these cases, the \"error\" field in the `_resolve/cluster` response will be present. (This is also where security/permission errors will be shown.)\n* A remote cluster is an older version that does not support the feature you want to use in your search.\n\n## Test availability of remote clusters\n\nThe `remote/info` endpoint is commonly used to test whether the \"local\" cluster (the cluster being queried) is connected to its remote clusters, but it does not necessarily reflect whether the remote cluster is available or not.\nThe remote cluster may be available, while the local cluster is not currently connected to it.\n\nYou can use the `_resolve/cluster` API to attempt to reconnect to remote clusters.\nFor example with `GET _resolve/cluster` or `GET _resolve/cluster/*:*`.\nThe `connected` field in the response will indicate whether it was successful.\nIf a connection was (re-)established, this will also cause the `remote/info` endpoint to now indicate a connected status.\n\n## Required authorization\n\n* Index privileges: `view_index_metadata`\n" operationId: indices-resolve-cluster parameters: - $ref: '#/components/parameters/indices.resolve_cluster-name' - $ref: '#/components/parameters/indices.resolve_cluster-allow_no_indices' - $ref: '#/components/parameters/indices.resolve_cluster-expand_wildcards' - $ref: '#/components/parameters/indices.resolve_cluster-ignore_throttled' - $ref: '#/components/parameters/indices.resolve_cluster-ignore_unavailable' - $ref: '#/components/parameters/indices.resolve_cluster-timeout' responses: '200': $ref: '#/components/responses/indices.resolve_cluster-200' x-state: Generally available; Added in 8.13.0 x-codeSamples: - lang: Console source: "GET /_resolve/cluster/not-present,clust*:my-index*,oldcluster:*?ignore_unavailable=false&timeout=5s\n" - lang: Python source: "resp = client.indices.resolve_cluster(\n name=\"not-present,clust*:my-index*,oldcluster:*\",\n ignore_unavailable=False,\n timeout=\"5s\",\n)" - lang: JavaScript source: "const response = await client.indices.resolveCluster({\n name: \"not-present,clust*:my-index*,oldcluster:*\",\n ignore_unavailable: \"false\",\n timeout: \"5s\",\n});" - lang: Ruby source: "response = client.indices.resolve_cluster(\n name: \"not-present,clust*:my-index*,oldcluster:*\",\n ignore_unavailable: \"false\",\n timeout: \"5s\"\n)" - lang: PHP source: "$resp = $client->indices()->resolveCluster([\n \"name\" => \"not-present,clust*:my-index*,oldcluster:*\",\n \"ignore_unavailable\" => \"false\",\n \"timeout\" => \"5s\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_resolve/cluster/not-present,clust*:my-index*,oldcluster:*?ignore_unavailable=false&timeout=5s"' - lang: C# source: "var response = await client.Indices\n .ResolveClusterAsync(d1 => d1\n .Name(new[] { \"not-present\", \"clust*:my-index*\", \"oldcluster:*\" })\n .IgnoreUnavailable(false)\n .Timeout(\"5s\")\n );" - lang: Java source: "client.indices().resolveCluster(r -> r\n .ignoreUnavailable(false)\n .name(List.of(\"not-present\",\"clust*:my-index*\",\"oldcluster:*\"))\n .timeout(t -> t\n .time(\"5s\")\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_resolve/index/{name}': post: tags: - indices summary: "Resolve indices\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_resolve/index/{name}\n
\n
\n POST\n /_resolve/index/{name}\n
\n \n\nResolve the names and/or index patterns for indices, aliases, and data streams.\nMultiple patterns and remote clusters are supported.\n\n## Required authorization\n\n* Index privileges: `view_index_metadata`\n" operationId: indices-resolve-index parameters: - $ref: '#/components/parameters/indices.resolve_index-name' - $ref: '#/components/parameters/indices.resolve_index-expand_wildcards' - $ref: '#/components/parameters/indices.resolve_index-ignore_unavailable' - $ref: '#/components/parameters/indices.resolve_index-allow_no_indices' - $ref: '#/components/parameters/indices.resolve_index-mode' requestBody: $ref: '#/components/requestBodies/indices.resolve_index' responses: '200': $ref: '#/components/responses/indices.resolve_index-200' x-state: Generally available; Added in 7.9.0 x-codeSamples: - lang: Console source: "GET /_resolve/index/f*,remoteCluster1:bar*?expand_wildcards=all\n" - lang: Python source: "resp = client.indices.resolve_index(\n name=\"f*,remoteCluster1:bar*\",\n expand_wildcards=\"all\",\n)" - lang: JavaScript source: "const response = await client.indices.resolveIndex({\n name: \"f*,remoteCluster1:bar*\",\n expand_wildcards: \"all\",\n});" - lang: Ruby source: "response = client.indices.resolve_index(\n name: \"f*,remoteCluster1:bar*\",\n expand_wildcards: \"all\"\n)" - lang: PHP source: "$resp = $client->indices()->resolveIndex([\n \"name\" => \"f*,remoteCluster1:bar*\",\n \"expand_wildcards\" => \"all\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_resolve/index/f*,remoteCluster1:bar*?expand_wildcards=all"' - lang: C# source: "var response = await client.Indices\n .ResolveIndexAsync(name: new[] { \"f*\", \"remoteCluster1:bar*\" }, d1 => d1\n .ExpandWildcards(ExpandWildcard.All)\n );" - lang: Java source: "client.indices().resolveIndex(r -> r\n .expandWildcards(ExpandWildcard.All)\n .name(List.of(\"f*\",\"remoteCluster1:bar*\"))\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{alias}/_rollover/{new_index}': post: tags: - indices summary: "Roll over to a new index\n" description: "**All methods and paths for this operation:**\n\n
\n POST\n /{alias}/_rollover\n
\n
\n POST\n /{alias}/_rollover/{new_index}\n
\n \n\nTIP: To automate rollovers, use index lifecycle management (ILM) in deployments that support it.\nServerless does not support ILM. For data streams in Serverless, use data stream lifecycle instead.\n\nThe rollover API creates a new index for a data stream or index alias.\nThe API behavior depends on the rollover target.\n\n**Roll over a data stream**\n\nIf you roll over a data stream, the API creates a new write index for the stream.\nThe stream's previous write index becomes a regular backing index.\nA rollover also increments the data stream's generation.\n\n**Roll over an index alias with a write index**\n\nTIP: Prior to Elasticsearch 7.9, you'd typically use an index alias with a write index to manage time series data.\nData streams replace this functionality, require less maintenance, and automatically integrate with data tiers.\n\nIf an index alias points to multiple indices, one of the indices must be a write index.\nThe rollover API creates a new write index for the alias with `is_write_index` set to `true`.\nThe API also `sets is_write_index` to `false` for the previous write index.\n\n**Roll over an index alias with one index**\n\nIf you roll over an index alias that points to only one index, the API creates a new index for the alias and removes the original index from the alias.\n\nNOTE: A rollover creates a new index and is subject to the `wait_for_active_shards` setting.\n\n**Increment index names for an alias**\n\nWhen you roll over an index alias, you can specify a name for the new index.\nIf you don't specify a name and the current index ends with `-` and a number, such as `my-index-000001` or `my-index-3`, the new index name increments that number.\nFor example, if you roll over an alias with a current index of `my-index-000001`, the rollover creates a new index named `my-index-000002`.\nThis number is always six characters and zero-padded, regardless of the previous index's name.\n\nIf you use an index alias for time series data, you can use date math in the index name to track the rollover date.\nFor example, you can create an alias that points to an index named ``.\nIf you create the index on May 6, 2099, the index's name is `my-index-2099.05.06-000001`.\nIf you roll over the alias on May 7, 2099, the new index's name is `my-index-2099.05.07-000002`.\n\n## Required authorization\n\n* Index privileges: `manage`\n" operationId: indices-rollover parameters: - $ref: '#/components/parameters/indices.rollover-alias' - $ref: '#/components/parameters/indices.rollover-new_index' - $ref: '#/components/parameters/indices.rollover-dry_run' - $ref: '#/components/parameters/indices.rollover-master_timeout' - $ref: '#/components/parameters/indices.rollover-timeout' - $ref: '#/components/parameters/indices.rollover-wait_for_active_shards' - $ref: '#/components/parameters/indices.rollover-lazy' requestBody: $ref: '#/components/requestBodies/indices.rollover' responses: '200': $ref: '#/components/responses/indices.rollover-200' x-state: Generally available; Added in 5.0.0 x-codeSamples: - lang: Console source: "POST my-data-stream/_rollover\n{\n \"conditions\": {\n \"max_age\": \"7d\",\n \"max_docs\": 1000,\n \"max_primary_shard_size\": \"50gb\",\n \"max_primary_shard_docs\": \"2000\"\n }\n}" - lang: Python source: "resp = client.indices.rollover(\n alias=\"my-data-stream\",\n conditions={\n \"max_age\": \"7d\",\n \"max_docs\": 1000,\n \"max_primary_shard_size\": \"50gb\",\n \"max_primary_shard_docs\": \"2000\"\n },\n)" - lang: JavaScript source: "const response = await client.indices.rollover({\n alias: \"my-data-stream\",\n conditions: {\n max_age: \"7d\",\n max_docs: 1000,\n max_primary_shard_size: \"50gb\",\n max_primary_shard_docs: \"2000\",\n },\n});" - lang: Ruby source: "response = client.indices.rollover(\n alias: \"my-data-stream\",\n body: {\n \"conditions\": {\n \"max_age\": \"7d\",\n \"max_docs\": 1000,\n \"max_primary_shard_size\": \"50gb\",\n \"max_primary_shard_docs\": \"2000\"\n }\n }\n)" - lang: PHP source: "$resp = $client->indices()->rollover([\n \"alias\" => \"my-data-stream\",\n \"body\" => [\n \"conditions\" => [\n \"max_age\" => \"7d\",\n \"max_docs\" => 1000,\n \"max_primary_shard_size\" => \"50gb\",\n \"max_primary_shard_docs\" => \"2000\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"conditions":{"max_age":"7d","max_docs":1000,"max_primary_shard_size":"50gb","max_primary_shard_docs":"2000"}}'' "$ELASTICSEARCH_URL/my-data-stream/_rollover"' - lang: C# source: "var response = await client.Indices\n .RolloverAsync(new RolloverRequest()\n {\n Alias = \"my-data-stream\",\n Conditions = new()\n {\n MaxAge = \"7d\",\n MaxDocs = 1000L,\n MaxPrimaryShardDocs = 2000L,\n MaxPrimaryShardSize = new ByteSize(\"50gb\")\n }\n });" - lang: Java source: "client.indices().rollover(r -> r\n .alias(\"my-data-stream\")\n .conditions(c -> c\n .maxAge(m -> m\n .time(\"7d\")\n )\n .maxDocs(1000L)\n .maxPrimaryShardSize(\"50gb\")\n .maxPrimaryShardDocs(2000L)\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_segments': get: tags: - indices summary: "Get index segments\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_segments\n
\n
\n GET\n /{index}/_segments\n
\n \n\nGet low-level information about the Lucene segments in index shards.\nFor data streams, the API returns information about the stream's backing indices.\n\n## Required authorization\n\n* Index privileges: `monitor`\n" operationId: indices-segments parameters: - $ref: '#/components/parameters/indices.segments-index' - $ref: '#/components/parameters/indices.segments-allow_no_indices' - $ref: '#/components/parameters/indices.segments-expand_wildcards' - $ref: '#/components/parameters/indices.segments-ignore_unavailable' - $ref: '#/components/parameters/indices.segments-include_auto_calibration' - $ref: '#/components/parameters/indices.segments-vector_formats' responses: '200': $ref: '#/components/responses/indices.segments-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET /my-index-000001/_segments\n" - lang: Python source: "resp = client.indices.segments(\n index=\"my-index-000001\",\n)" - lang: JavaScript source: "const response = await client.indices.segments({\n index: \"my-index-000001\",\n});" - lang: Ruby source: "response = client.indices.segments(\n index: \"my-index-000001\"\n)" - lang: PHP source: "$resp = $client->indices()->segments([\n \"index\" => \"my-index-000001\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_segments"' - lang: C# source: "var response = await client.Indices\n .SegmentsAsync(d1 => d1\n .Indices(new[] { \"my-index-000001\" })\n );" - lang: Java source: "client.indices().segments(s -> s\n .index(\"my-index-000001\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_shard_stores': get: tags: - indices summary: "Get index shard stores\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_shard_stores\n
\n
\n GET\n /{index}/_shard_stores\n
\n \n\nGet store information about replica shards in one or more indices.\nFor data streams, the API retrieves store information for the stream's backing indices.\n\nThe index shard stores API returns the following information:\n\n* The node on which each replica shard exists.\n* The allocation ID for each replica shard.\n* A unique ID for each replica shard.\n* Any errors encountered while opening the shard index or from an earlier failure.\n\nBy default, the API returns store information only for primary shards that are unassigned or have one or more unassigned replica shards.\n\n## Required authorization\n\n* Index privileges: `monitor`\n" operationId: indices-shard-stores parameters: - $ref: '#/components/parameters/indices.shard_stores-index' - $ref: '#/components/parameters/indices.shard_stores-allow_no_indices' - $ref: '#/components/parameters/indices.shard_stores-expand_wildcards' - $ref: '#/components/parameters/indices.shard_stores-ignore_unavailable' - $ref: '#/components/parameters/indices.shard_stores-status' responses: '200': $ref: '#/components/responses/indices.shard_stores-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET /_shard_stores?status=green\n" - lang: Python source: "resp = client.indices.shard_stores(\n status=\"green\",\n)" - lang: JavaScript source: "const response = await client.indices.shardStores({\n status: \"green\",\n});" - lang: Ruby source: "response = client.indices.shard_stores(\n status: \"green\"\n)" - lang: PHP source: "$resp = $client->indices()->shardStores([\n \"status\" => \"green\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_shard_stores?status=green"' - lang: C# source: "var response = await client.Indices\n .ShardStoresAsync(d1 => d1\n .Status(ShardStoreStatus.Green)\n );" - lang: Java source: "client.indices().shardStores(s -> s\n .status(ShardStoreStatus.Green)\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_shrink/{target}': post: tags: - indices summary: "Shrink an index\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /{index}/_shrink/{target}\n
\n
\n POST\n /{index}/_shrink/{target}\n
\n \n\nShrink an index into a new index with fewer primary shards.\n\nBefore you can shrink an index:\n\n* The index must be read-only.\n* A copy of every shard in the index must reside on the same node.\n* The index must have a green health status.\n\nTo make shard allocation easier, we recommend you also remove the index's replica shards.\nYou can later re-add replica shards as part of the shrink operation.\n\nThe requested number of primary shards in the target index must be a factor of the number of shards in the source index.\nFor example an index with 8 primary shards can be shrunk into 4, 2 or 1 primary shards or an index with 15 primary shards can be shrunk into 5, 3 or 1.\nIf the number of shards in the index is a prime number it can only be shrunk into a single primary shard\n Before shrinking, a (primary or replica) copy of every shard in the index must be present on the same node.\n\nIMPORTANT: If the source index already has one primary shard, configuring the shrink operation with 'index.number_of_shards: 1' will cause the request to fail. An index with one primary shard cannot be shrunk further.\n\nThe current write index on a data stream cannot be shrunk. In order to shrink the current write index, the data stream must first be rolled over so that a new write index is created and then the previous write index can be shrunk.\n\nA shrink operation:\n\n* Creates a new target index with the same definition as the source index, but with a smaller number of primary shards.\n* Hard-links segments from the source index into the target index. If the file system does not support hard-linking, then all segments are copied into the new index, which is a much more time consuming process. Also if using multiple data paths, shards on different data paths require a full copy of segment files if they are not on the same disk since hardlinks do not work across disks.\n* Recovers the target index as though it were a closed index which had just been re-opened. Recovers shards to the `.routing.allocation.initial_recovery._id` index setting.\n\nIMPORTANT: Indices can only be shrunk if they satisfy the following requirements:\n\n* The target index must not exist.\n* The source index must have more primary shards than the target index.\n* The number of primary shards in the target index must be a factor of the number of primary shards in the source index. The source index must have more primary shards than the target index.\n* The index must not contain more than 2,147,483,519 documents in total across all shards that will be shrunk into a single shard on the target index as this is the maximum number of docs that can fit into a single shard.\n* The node handling the shrink process must have sufficient free disk space to accommodate a second copy of the existing index.\n\n## Required authorization\n\n* Index privileges: `manage`\n" operationId: indices-shrink parameters: - $ref: '#/components/parameters/indices.shrink-index' - $ref: '#/components/parameters/indices.shrink-target' - $ref: '#/components/parameters/indices.shrink-master_timeout' - $ref: '#/components/parameters/indices.shrink-timeout' - $ref: '#/components/parameters/indices.shrink-wait_for_active_shards' requestBody: $ref: '#/components/requestBodies/indices.shrink' responses: '200': $ref: '#/components/responses/indices.shrink-200' x-state: Generally available; Added in 5.0.0 x-codeSamples: - lang: Console source: "POST /my_source_index/_shrink/my_target_index\n{\n \"settings\": {\n \"index.routing.allocation.require._name\": null,\n \"index.blocks.write\": null\n }\n}" - lang: Python source: "resp = client.indices.shrink(\n index=\"my_source_index\",\n target=\"my_target_index\",\n settings={\n \"index.routing.allocation.require._name\": None,\n \"index.blocks.write\": None\n },\n)" - lang: JavaScript source: "const response = await client.indices.shrink({\n index: \"my_source_index\",\n target: \"my_target_index\",\n settings: {\n \"index.routing.allocation.require._name\": null,\n \"index.blocks.write\": null,\n },\n});" - lang: Ruby source: "response = client.indices.shrink(\n index: \"my_source_index\",\n target: \"my_target_index\",\n body: {\n \"settings\": {\n \"index.routing.allocation.require._name\": nil,\n \"index.blocks.write\": nil\n }\n }\n)" - lang: PHP source: "$resp = $client->indices()->shrink([\n \"index\" => \"my_source_index\",\n \"target\" => \"my_target_index\",\n \"body\" => [\n \"settings\" => [\n \"index.routing.allocation.require._name\" => null,\n \"index.blocks.write\" => null,\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"settings":{"index.routing.allocation.require._name":null,"index.blocks.write":null}}'' "$ELASTICSEARCH_URL/my_source_index/_shrink/my_target_index"' - lang: C# source: "var response = await client.Indices\n .ShrinkAsync(index: \"my_source_index\", target: \"my_target_index\", d1 => d1\n .Settings(new Dictionary()\n {\n { \"index.routing.allocation.require._name\", null },\n { \"index.blocks.write\", null }\n })\n );" - lang: Java source: "client.indices().shrink(s -> s\n .index(\"my_source_index\")\n .settings(Map.of(\"index.blocks.write\", JsonData.fromJson(\"null\"),\"index.routing.allocation.require._name\", JsonData.fromJson(\"null\")))\n .target(\"my_target_index\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_index_template/_simulate_index/{name}': post: tags: - indices summary: Simulate an index description: "Get the index configuration that would be applied to the specified index from an existing index template.\n\n## Required authorization\n\n* Cluster privileges: `manage_index_templates`\n" operationId: indices-simulate-index-template parameters: - name: name in: path description: Name of the index to simulate required: true schema: $ref: '#/components/schemas/_types.Name' - name: create in: query description: Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one schema: type: boolean default: false - name: cause in: query description: User defined reason for dry-run creating the new template for simulation purposes schema: type: string default: 'false' - name: master_timeout in: query description: 'Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: include_defaults in: query description: 'If true, returns all relevant default configurations for the index template.' schema: type: boolean default: false x-state: Generally available; Added in 8.11.0 requestBody: content: application/json: schema: $ref: '#/components/schemas/indices._types.IndexTemplate' responses: '200': description: '' content: application/json: schema: required: - template type: object properties: overlapping: type: array items: $ref: '#/components/schemas/indices.simulate_template.Overlapping' template: allOf: - $ref: '#/components/schemas/indices.simulate_template.Template' examples: indicesSimulateIndexTemplateResponseExample1: description: A successful response from `POST /_index_template/_simulate_index/my-index-000001`. value: "{\n \"template\" : {\n \"settings\" : {\n \"index\" : {\n \"number_of_shards\" : \"2\",\n \"number_of_replicas\" : \"0\",\n \"routing\" : {\n \"allocation\" : {\n \"include\" : {\n \"_tier_preference\" : \"data_content\"\n }\n }\n }\n }\n },\n \"mappings\" : {\n \"properties\" : {\n \"@timestamp\" : {\n \"type\" : \"date\"\n }\n }\n },\n \"aliases\" : { }\n },\n \"overlapping\" : [\n {\n \"name\" : \"template_1\",\n \"index_patterns\" : [\n \"my-index-*\"\n ]\n }\n ]\n}" x-state: Generally available; Added in 7.9.0 x-codeSamples: - lang: Console source: "POST /_index_template/_simulate_index/my-index-000001\n" - lang: Python source: "resp = client.indices.simulate_index_template(\n name=\"my-index-000001\",\n index_template=None,\n)" - lang: JavaScript source: "const response = await client.indices.simulateIndexTemplate({\n name: \"my-index-000001\",\n index_template: null,\n});" - lang: Ruby source: "response = client.indices.simulate_index_template(\n name: \"my-index-000001\"\n)" - lang: PHP source: "$resp = $client->indices()->simulateIndexTemplate([\n \"name\" => \"my-index-000001\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_index_template/_simulate_index/my-index-000001"' - lang: Java source: "client.indices().simulateIndexTemplate(s -> s\n .name(\"my-index-000001\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_index_template/_simulate/{name}': post: tags: - indices summary: "Simulate an index template\n" description: "**All methods and paths for this operation:**\n\n
\n POST\n /_index_template/_simulate\n
\n
\n POST\n /_index_template/_simulate/{name}\n
\n \n\nGet the index configuration that would be applied by a particular index template.\n\n## Required authorization\n\n* Cluster privileges: `manage_index_templates`\n" operationId: indices-simulate-template parameters: - $ref: '#/components/parameters/indices.simulate_template-name' - $ref: '#/components/parameters/indices.simulate_template-create' - $ref: '#/components/parameters/indices.simulate_template-cause' - $ref: '#/components/parameters/indices.simulate_template-master_timeout' - $ref: '#/components/parameters/indices.simulate_template-include_defaults' requestBody: $ref: '#/components/requestBodies/indices.simulate_template' responses: '200': $ref: '#/components/responses/indices.simulate_template-200' x-state: Generally available x-codeSamples: - lang: Console source: "POST /_index_template/_simulate\n{\n \"index_patterns\": [\"my-index-*\"],\n \"composed_of\": [\"ct2\"],\n \"priority\": 10,\n \"template\": {\n \"settings\": {\n \"index.number_of_replicas\": 1\n }\n }\n}" - lang: Python source: "resp = client.indices.simulate_template(\n index_patterns=[\n \"my-index-*\"\n ],\n composed_of=[\n \"ct2\"\n ],\n priority=10,\n template={\n \"settings\": {\n \"index.number_of_replicas\": 1\n }\n },\n)" - lang: JavaScript source: "const response = await client.indices.simulateTemplate({\n index_patterns: [\"my-index-*\"],\n composed_of: [\"ct2\"],\n priority: 10,\n template: {\n settings: {\n \"index.number_of_replicas\": 1,\n },\n },\n});" - lang: Ruby source: "response = client.indices.simulate_template(\n body: {\n \"index_patterns\": [\n \"my-index-*\"\n ],\n \"composed_of\": [\n \"ct2\"\n ],\n \"priority\": 10,\n \"template\": {\n \"settings\": {\n \"index.number_of_replicas\": 1\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->indices()->simulateTemplate([\n \"body\" => [\n \"index_patterns\" => array(\n \"my-index-*\",\n ),\n \"composed_of\" => array(\n \"ct2\",\n ),\n \"priority\" => 10,\n \"template\" => [\n \"settings\" => [\n \"index.number_of_replicas\" => 1,\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"index_patterns":["my-index-*"],"composed_of":["ct2"],"priority":10,"template":{"settings":{"index.number_of_replicas":1}}}'' "$ELASTICSEARCH_URL/_index_template/_simulate"' - lang: C# source: "var response = await client.Indices\n .SimulateTemplateAsync(d1 => d1\n .ComposedOf([\"ct2\"])\n .IndexPatterns(new[] { \"my-index-*\" })\n .Priority(10L)\n .Template(d2 => d2\n .Settings(d3 => d3\n .OtherSettings(new Dictionary()\n {\n { \"index.number_of_replicas\", 1 }\n })\n )\n )\n );" - lang: Java source: "client.indices().simulateTemplate(s -> s\n .composedOf(\"ct2\")\n .indexPatterns(\"my-index-*\")\n .priority(10L)\n .template(t -> t\n .settings(se -> se\n .otherSettings(\"index.number_of_replicas\", JsonData.fromJson(\"1\"))\n )\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_split/{target}': post: tags: - indices summary: "Split an index\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /{index}/_split/{target}\n
\n
\n POST\n /{index}/_split/{target}\n
\n \n\nSplit an index into a new index with more primary shards.\n* Before you can split an index:\n\n* The index must be read-only.\n* The cluster health status must be green.\n\nYou can do make an index read-only with the following request using the add index block API:\n\n```\nPUT /my_source_index/_block/write\n```\n\nThe current write index on a data stream cannot be split.\nIn order to split the current write index, the data stream must first be rolled over so that a new write index is created and then the previous write index can be split.\n\nThe number of times the index can be split (and the number of shards that each original shard can be split into) is determined by the `index.number_of_routing_shards` setting.\nThe number of routing shards specifies the hashing space that is used internally to distribute documents across shards with consistent hashing.\nFor instance, a 5 shard index with `number_of_routing_shards` set to 30 (5 x 2 x 3) could be split by a factor of 2 or 3.\n\nA split operation:\n\n* Creates a new target index with the same definition as the source index, but with a larger number of primary shards.\n* Hard-links segments from the source index into the target index. If the file system doesn't support hard-linking, all segments are copied into the new index, which is a much more time consuming process.\n* Hashes all documents again, after low level files are created, to delete documents that belong to a different shard.\n* Recovers the target index as though it were a closed index which had just been re-opened.\n\nIMPORTANT: Indices can only be split if they satisfy the following requirements:\n\n* The target index must not exist.\n* The source index must have fewer primary shards than the target index.\n* The number of primary shards in the target index must be a multiple of the number of primary shards in the source index.\n* The number of primary shards in the target index must be a divisor of the source index's `index.number_of_routing_shards`.\n* The node handling the split process must have sufficient free disk space to accommodate a second copy of the existing index.\n\n## Required authorization\n\n* Index privileges: `manage`\n" operationId: indices-split parameters: - $ref: '#/components/parameters/indices.split-index' - $ref: '#/components/parameters/indices.split-target' - $ref: '#/components/parameters/indices.split-master_timeout' - $ref: '#/components/parameters/indices.split-timeout' - $ref: '#/components/parameters/indices.split-wait_for_active_shards' requestBody: $ref: '#/components/requestBodies/indices.split' responses: '200': $ref: '#/components/responses/indices.split-200' x-state: Generally available; Added in 6.1.0 x-codeSamples: - lang: Console source: "POST /my-index-000001/_split/split-my-index-000001\n{\n \"settings\": {\n \"index.number_of_shards\": 2\n }\n}" - lang: Python source: "resp = client.indices.split(\n index=\"my-index-000001\",\n target=\"split-my-index-000001\",\n settings={\n \"index.number_of_shards\": 2\n },\n)" - lang: JavaScript source: "const response = await client.indices.split({\n index: \"my-index-000001\",\n target: \"split-my-index-000001\",\n settings: {\n \"index.number_of_shards\": 2,\n },\n});" - lang: Ruby source: "response = client.indices.split(\n index: \"my-index-000001\",\n target: \"split-my-index-000001\",\n body: {\n \"settings\": {\n \"index.number_of_shards\": 2\n }\n }\n)" - lang: PHP source: "$resp = $client->indices()->split([\n \"index\" => \"my-index-000001\",\n \"target\" => \"split-my-index-000001\",\n \"body\" => [\n \"settings\" => [\n \"index.number_of_shards\" => 2,\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"settings":{"index.number_of_shards":2}}'' "$ELASTICSEARCH_URL/my-index-000001/_split/split-my-index-000001"' - lang: C# source: "var response = await client.Indices\n .SplitAsync(index: \"my-index-000001\", target: \"split-my-index-000001\", d1 => d1\n .Settings(new Dictionary()\n {\n { \"index.number_of_shards\", 2 }\n })\n );" - lang: Java source: "client.indices().split(s -> s\n .index(\"my-index-000001\")\n .settings(\"index.number_of_shards\", JsonData.fromJson(\"2\"))\n .target(\"split-my-index-000001\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_stats/{metric}': get: tags: - indices summary: "Get index statistics\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_stats\n
\n
\n GET\n /{index}/_stats\n
\n
\n GET\n /_stats/{metric}\n
\n
\n GET\n /{index}/_stats/{metric}\n
\n \n\nFor data streams, the API retrieves statistics for the stream's backing indices.\n\nBy default, the returned statistics are index-level with `primaries` and `total` aggregations.\n`primaries` are the values for only the primary shards.\n`total` are the accumulated values for both primary and replica shards.\n\nTo get shard-level statistics, set the `level` parameter to `shards`.\n\nNOTE: When moving to another node, the shard-level statistics for a shard are cleared.\nAlthough the shard is no longer part of the node, that node retains any node-level statistics to which the shard contributed.\n\n## Required authorization\n\n* Index privileges: `monitor`\n" operationId: indices-stats parameters: - $ref: '#/components/parameters/indices.stats-index' - $ref: '#/components/parameters/indices.stats-metric' - $ref: '#/components/parameters/indices.stats-completion_fields' - $ref: '#/components/parameters/indices.stats-expand_wildcards' - $ref: '#/components/parameters/indices.stats-fielddata_fields' - $ref: '#/components/parameters/indices.stats-fields' - $ref: '#/components/parameters/indices.stats-forbid_closed_indices' - $ref: '#/components/parameters/indices.stats-groups' - $ref: '#/components/parameters/indices.stats-include_auto_calibration' - $ref: '#/components/parameters/indices.stats-include_segment_file_sizes' - $ref: '#/components/parameters/indices.stats-include_unloaded_segments' - $ref: '#/components/parameters/indices.stats-level' responses: '200': $ref: '#/components/responses/indices.stats-200' x-state: Generally available; Added in 1.3.0 x-codeSamples: - lang: Console source: "GET _stats/fielddata?human&fields=my_join_field#question\n" - lang: Python source: "resp = client.indices.stats(\n metric=\"fielddata\",\n human=True,\n fields=\"my_join_field\",\n)" - lang: JavaScript source: "const response = await client.indices.stats({\n metric: \"fielddata\",\n human: \"true\",\n fields: \"my_join_field\",\n});" - lang: Ruby source: "response = client.indices.stats(\n metric: \"fielddata\",\n human: \"true\",\n fields: \"my_join_field\"\n)" - lang: PHP source: "$resp = $client->indices()->stats([\n \"metric\" => \"fielddata\",\n \"human\" => \"true\",\n \"fields\" => \"my_join_field\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_stats/fielddata?human&fields=my_join_field#question"' - lang: C# source: "var response = await client.Indices\n .StatsAsync(d1 => d1\n .Metric(CommonStatsFlag.Fielddata)\n .Fields(x => x.MyJoinField)\n );" - lang: Java source: "client.indices().stats(s -> s\n .fields(\"my_join_field\")\n .metric(CommonStatsFlag.Fielddata)\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_aliases: post: tags: - indices summary: Update aliases and delete indices atomically description: "Applies one or more actions in a single request:\n\n- Add a data stream or index to an alias.\n- Remove a data stream or index from an alias.\n- Delete an index in that same request, so the deletion and the alias changes are applied together.\n\nFor example, you can replace an index with an alias of the same name.\n\nNOTE: Every `remove_index` action in the request runs first, before any `add` or `remove` actions, no matter where it sits in the `actions` array.\n\n## Required authorization\n\n* Index privileges: `manage`\n" operationId: indices-update-aliases parameters: - name: master_timeout in: query description: "Period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "Period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: type: object properties: actions: type: array items: $ref: '#/components/schemas/indices.update_aliases.Action' description: Actions to perform. examples: IndicesUpdateAliasesExample1: summary: Add a data stream or index to an alias description: 'If the alias does not exist, it is created.' value: "{\n \"actions\": [\n {\n \"add\": {\n \"index\": \"logs-nginx.access-*\",\n \"alias\": \"logs\"\n }\n }\n ]\n}" x-codeSamples: - lang: Console source: "POST _aliases\n{\n \"actions\": [\n {\n \"add\": {\n \"index\": \"logs-nginx.access-*\",\n \"alias\": \"logs\"\n }\n }\n ]\n}" - lang: Python source: "resp = client.indices.update_aliases(\n actions=[\n {\n \"add\": {\n \"index\": \"logs-nginx.access-*\",\n \"alias\": \"logs\"\n }\n }\n ],\n)" - lang: JavaScript source: "const response = await client.indices.updateAliases({\n actions: [\n {\n add: {\n index: \"logs-nginx.access-*\",\n alias: \"logs\",\n },\n },\n ],\n});" - lang: Ruby source: "response = client.indices.update_aliases(\n body: {\n \"actions\": [\n {\n \"add\": {\n \"index\": \"logs-nginx.access-*\",\n \"alias\": \"logs\"\n }\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->indices()->updateAliases([\n \"body\" => [\n \"actions\" => array(\n [\n \"add\" => [\n \"index\" => \"logs-nginx.access-*\",\n \"alias\" => \"logs\",\n ],\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"actions":[{"add":{"index":"logs-nginx.access-*","alias":"logs"}}]}'' "$ELASTICSEARCH_URL/_aliases"' - lang: C# source: "var response = await client.Indices\n .UpdateAliasesAsync(d1 => d1\n .Actions(d2 => d2\n .Add(d3 => d3\n .Alias(\"logs\")\n .Index(\"logs-nginx.access-*\")\n )\n )\n );" - lang: Java source: "client.indices().updateAliases(u -> u\n .actions(a -> a\n .add(ad -> ad\n .alias(\"logs\")\n .index(\"logs-nginx.access-prod\")\n )\n )\n);\n" IndicesUpdateAliasesExample2: summary: Remove a data stream or index from an alias value: "{\n \"actions\": [\n {\n \"remove\": {\n \"index\": \"logs-nginx.access-prod\",\n \"alias\": \"logs\"\n }\n }\n ]\n}" x-codeSamples: - lang: Console source: "POST _aliases\n{\n \"actions\": [\n {\n \"remove\": {\n \"index\": \"logs-nginx.access-prod\",\n \"alias\": \"logs\"\n }\n }\n ]\n}" - lang: Python source: "resp = client.indices.update_aliases(\n actions=[\n {\n \"remove\": {\n \"index\": \"logs-nginx.access-prod\",\n \"alias\": \"logs\"\n }\n }\n ],\n)" - lang: JavaScript source: "const response = await client.indices.updateAliases({\n actions: [\n {\n remove: {\n index: \"logs-nginx.access-prod\",\n alias: \"logs\",\n },\n },\n ],\n});" - lang: Ruby source: "response = client.indices.update_aliases(\n body: {\n \"actions\": [\n {\n \"remove\": {\n \"index\": \"logs-nginx.access-prod\",\n \"alias\": \"logs\"\n }\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->indices()->updateAliases([\n \"body\" => [\n \"actions\" => array(\n [\n \"remove\" => [\n \"index\" => \"logs-nginx.access-prod\",\n \"alias\" => \"logs\",\n ],\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"actions":[{"remove":{"index":"logs-nginx.access-prod","alias":"logs"}}]}'' "$ELASTICSEARCH_URL/_aliases"' - lang: C# source: "var response = await client.Indices\n .UpdateAliasesAsync(d1 => d1\n .Actions(d2 => d2\n .Remove(d3 => d3\n .Alias(\"logs\")\n .Index(\"logs-nginx.access-prod\")\n )\n )\n );" IndicesUpdateAliasesExample3: summary: Remove an index and update an alias description: "First, remove the index `my-index-1` (which has the alias `my-alias`) and then add the index `my-index-2` to the alias in a single request.\n" value: "{\n \"actions\": [\n {\n \"remove_index\": {\n \"index\": \"my-index-1\"\n }\n },\n {\n \"add\": {\n \"index\": \"my-index-2\",\n \"alias\": \"my-alias\"\n }\n }\n ]\n}" x-codeSamples: - lang: Console source: "POST _aliases\n{\n \"actions\": [\n {\n \"remove_index\": {\n \"index\": \"my-index-1\"\n }\n },\n {\n \"add\": {\n \"index\": \"my-index-2\",\n \"alias\": \"my-alias\"\n }\n }\n ]\n}" - lang: Python source: "resp = client.indices.update_aliases(\n actions=[\n {\n \"remove_index\": {\n \"index\": \"my-index-1\"\n }\n },\n {\n \"add\": {\n \"index\": \"my-index-2\",\n \"alias\": \"my-alias\"\n }\n }\n ],\n)" - lang: JavaScript source: "const response = await client.indices.updateAliases({\n actions: [\n {\n remove_index: {\n index: \"my-index-1\",\n },\n },\n {\n add: {\n index: \"my-index-2\",\n alias: \"my-alias\",\n },\n },\n ],\n});" - lang: Ruby source: "response = client.indices.update_aliases(\n body: {\n \"actions\": [\n {\n \"remove_index\": {\n \"index\": \"my-index-1\"\n }\n },\n {\n \"add\": {\n \"index\": \"my-index-2\",\n \"alias\": \"my-alias\"\n }\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->indices()->updateAliases([\n \"body\" => [\n \"actions\" => array(\n [\n \"remove_index\" => [\n \"index\" => \"my-index-1\",\n ],\n ],\n [\n \"add\" => [\n \"index\" => \"my-index-2\",\n \"alias\" => \"my-alias\",\n ],\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"actions":[{"remove_index":{"index":"my-index-1"}},{"add":{"index":"my-index-2","alias":"my-alias"}}]}'' "$ELASTICSEARCH_URL/_aliases"' - lang: C# source: "var response = await client.Indices\n .UpdateAliasesAsync(d1 => d1\n .Actions(d2 => d2\n .RemoveIndex(d3 => d3\n .Index(\"my-index-1\")\n ), d2 => d2\n .Add(d3 => d3\n .Alias(\"my-alias\")\n .Index(\"my-index-2\")\n )\n )\n );" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/indices.update_aliases.IndicesUpdateAliasesResponseBody' examples: IndicesUpdateAliasesExample1: summary: A partially successful response description: 'When using multiple actions, if some succeed and some fail, the API returns a list of per-action results. For example, if the alias `logs-non-existing` does not exist, the API returns a 404 error for the `remove` action.' value: "{\n \"acknowledged\": true,\n \"errors\": true,\n \"action_results\": [\n {\n \"action\": {\n \"type\": \"remove\",\n \"indices\": [\n \"logs-nginx.access-prod\"\n ],\n \"aliases\": [\n \"logs-non-existing\"\n ]\n },\n \"status\": 404,\n \"error\": {\n \"type\": \"aliases_not_found_exception\",\n \"reason\": \"aliases [logs-non-existing] missing\",\n \"resource.type\": \"aliases\",\n \"resource.id\": \"logs-non-existing\"\n }\n },\n {\n \"action\": {\n \"type\": \"add\",\n \"indices\": [\n \"logs-nginx.access-default\"\n ],\n \"aliases\": [\n \"logs-non-existing\"\n ]\n },\n \"status\": 200\n }\n ]\n}" x-state: Generally available; Added in 1.3.0 x-codeSamples: - lang: Console source: "POST _aliases\n{\n \"actions\": [\n {\n \"add\": {\n \"index\": \"logs-nginx.access-*\",\n \"alias\": \"logs\"\n }\n }\n ]\n}" - lang: Python source: "resp = client.indices.update_aliases(\n actions=[\n {\n \"add\": {\n \"index\": \"logs-nginx.access-*\",\n \"alias\": \"logs\"\n }\n }\n ],\n)" - lang: JavaScript source: "const response = await client.indices.updateAliases({\n actions: [\n {\n add: {\n index: \"logs-nginx.access-*\",\n alias: \"logs\",\n },\n },\n ],\n});" - lang: Ruby source: "response = client.indices.update_aliases(\n body: {\n \"actions\": [\n {\n \"add\": {\n \"index\": \"logs-nginx.access-*\",\n \"alias\": \"logs\"\n }\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->indices()->updateAliases([\n \"body\" => [\n \"actions\" => array(\n [\n \"add\" => [\n \"index\" => \"logs-nginx.access-*\",\n \"alias\" => \"logs\",\n ],\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"actions":[{"add":{"index":"logs-nginx.access-*","alias":"logs"}}]}'' "$ELASTICSEARCH_URL/_aliases"' - lang: C# source: "var response = await client.Indices\n .UpdateAliasesAsync(d1 => d1\n .Actions(d2 => d2\n .Add(d3 => d3\n .Alias(\"logs\")\n .Index(\"logs-nginx.access-*\")\n )\n )\n );" - lang: Java source: "client.indices().updateAliases(u -> u\n .actions(a -> a\n .add(ad -> ad\n .alias(\"logs\")\n .index(\"logs-nginx.access-prod\")\n )\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_validate/query': post: tags: - indices summary: "Validate a query\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_validate/query\n
\n
\n POST\n /_validate/query\n
\n
\n GET\n /{index}/_validate/query\n
\n
\n POST\n /{index}/_validate/query\n
\n \n\nValidates a query without running it.\n\n## Required authorization\n\n* Index privileges: `view_index_metadata`,`manage`\n" operationId: indices-validate-query parameters: - $ref: '#/components/parameters/indices.validate_query-index' - $ref: '#/components/parameters/indices.validate_query-allow_no_indices' - $ref: '#/components/parameters/indices.validate_query-all_shards' - $ref: '#/components/parameters/indices.validate_query-analyzer' - $ref: '#/components/parameters/indices.validate_query-analyze_wildcard' - $ref: '#/components/parameters/indices.validate_query-default_operator' - $ref: '#/components/parameters/indices.validate_query-df' - $ref: '#/components/parameters/indices.validate_query-expand_wildcards' - $ref: '#/components/parameters/indices.validate_query-explain' - $ref: '#/components/parameters/indices.validate_query-ignore_unavailable' - $ref: '#/components/parameters/indices.validate_query-lenient' - $ref: '#/components/parameters/indices.validate_query-rewrite' - $ref: '#/components/parameters/indices.validate_query-q' - $ref: '#/components/parameters/indices.validate_query-routing' requestBody: $ref: '#/components/requestBodies/indices.validate_query' responses: '200': $ref: '#/components/responses/indices.validate_query-200' x-state: Generally available; Added in 1.3.0 x-codeSamples: - lang: Console source: "GET my-index-000001/_validate/query?q=user.id:kimchy\n" - lang: Python source: "resp = client.indices.validate_query(\n index=\"my-index-000001\",\n q=\"user.id:kimchy\",\n)" - lang: JavaScript source: "const response = await client.indices.validateQuery({\n index: \"my-index-000001\",\n q: \"user.id:kimchy\",\n});" - lang: Ruby source: "response = client.indices.validate_query(\n index: \"my-index-000001\",\n q: \"user.id:kimchy\"\n)" - lang: PHP source: "$resp = $client->indices()->validateQuery([\n \"index\" => \"my-index-000001\",\n \"q\" => \"user.id:kimchy\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_validate/query?q=user.id:kimchy"' - lang: C# source: "var response = await client.Indices\n .ValidateQueryAsync(d1 => d1\n .Indices(new[] { \"my-index-000001\" })\n .QueryLuceneSyntax(\"user.id:kimchy\")\n );" - lang: Java source: "client.indices().validateQuery(v -> v\n .index(\"my-index-000001\")\n .q(\"user.id:kimchy\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_inference/chat_completion/{inference_id}/_stream': post: tags: - inference summary: Perform streaming chat completion inference on the service description: "The chat completion inference API enables real-time responses for chat completion tasks by delivering answers incrementally, reducing response times during computation.\nIt only works with the `chat_completion` task type.\n\nNOTE: The `chat_completion` task type supports both streaming and non-streaming.\nThe Chat completion inference API and the Stream inference API differ in their response structure and capabilities.\nThe Chat completion inference API provides more comprehensive customization options through more fields and function calling support.\nTo determine whether a given inference service supports this task type, please see the page for that service.\n\n## Required authorization\n\n* Cluster privileges: `monitor_inference`\n" operationId: inference-chat-completion-unified parameters: - name: inference_id in: path description: The inference Id required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference request to complete. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 120s requestBody: content: application/json: schema: $ref: '#/components/schemas/inference._types.RequestChatCompletion' examples: PostChatCompletionRequestExample1: summary: A chat completion task description: Run `POST _inference/chat_completion/openai-completion/_stream` to perform a chat completion on the example question with streaming. value: "{\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n}" x-codeSamples: - lang: Console source: "POST _inference/chat_completion/openai-completion/_stream\n{\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n}" - lang: Python source: "resp = client.inference.chat_completion_unified(\n inference_id=\"openai-completion\",\n chat_completion_request={\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n },\n)" - lang: JavaScript source: "const response = await client.inference.chatCompletionUnified({\n inference_id: \"openai-completion\",\n chat_completion_request: {\n model: \"gpt-4o\",\n messages: [\n {\n role: \"user\",\n content: \"What is Elastic?\",\n },\n ],\n },\n});" - lang: Ruby source: "response = client.inference.chat_completion_unified(\n inference_id: \"openai-completion\",\n body: {\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->inference()->chatCompletionUnified([\n \"inference_id\" => \"openai-completion\",\n \"body\" => [\n \"model\" => \"gpt-4o\",\n \"messages\" => array(\n [\n \"role\" => \"user\",\n \"content\" => \"What is Elastic?\",\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"model":"gpt-4o","messages":[{"role":"user","content":"What is Elastic?"}]}'' "$ELASTICSEARCH_URL/_inference/chat_completion/openai-completion/_stream"' - lang: C# source: "var response = await client.Inference\n .ChatCompletionUnifiedAsync(inferenceId: \"openai-completion\", d1 => d1\n .ChatCompletionRequest(d2 => d2\n .Messages(d3 => d3\n .Content(\"What is Elastic?\")\n .Role(\"user\")\n )\n .Model(\"gpt-4o\")\n )\n );" - lang: Java source: "client.inference().chatCompletionUnified(c -> c\n .inferenceId(\"openai-completion\")\n .chatCompletionRequest(ch -> ch\n .messages(m -> m\n .content(co -> co\n .string(\"What is Elastic?\")\n )\n .role(\"user\")\n )\n .model(\"gpt-4o\")\n )\n);\n" PostChatCompletionRequestExample2: summary: A chat completion task with tool_calls description: Run `POST _inference/chat_completion/openai-completion/_stream` to perform a chat completion using an Assistant message with `tool_calls`. value: "{\n \"messages\": [\n {\n \"role\": \"assistant\",\n \"content\": \"Let's find out what the weather is\",\n \"tool_calls\": [ \n {\n \"id\": \"call_KcAjWtAww20AihPHphUh46Gd\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"arguments\": \"{\\\"location\\\":\\\"Boston, MA\\\"}\"\n }\n }\n ]\n },\n { \n \"role\": \"tool\",\n \"content\": \"The weather is cold\",\n \"tool_call_id\": \"call_KcAjWtAww20AihPHphUh46Gd\"\n }\n ]\n}" x-codeSamples: - lang: Console source: "POST _inference/chat_completion/openai-completion/_stream\n{\n \"messages\": [\n {\n \"role\": \"assistant\",\n \"content\": \"Let's find out what the weather is\",\n \"tool_calls\": [ \n {\n \"id\": \"call_KcAjWtAww20AihPHphUh46Gd\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"arguments\": \"{\\\"location\\\":\\\"Boston, MA\\\"}\"\n }\n }\n ]\n },\n { \n \"role\": \"tool\",\n \"content\": \"The weather is cold\",\n \"tool_call_id\": \"call_KcAjWtAww20AihPHphUh46Gd\"\n }\n ]\n}" - lang: Python source: "resp = client.inference.chat_completion_unified(\n inference_id=\"openai-completion\",\n chat_completion_request={\n \"messages\": [\n {\n \"role\": \"assistant\",\n \"content\": \"Let's find out what the weather is\",\n \"tool_calls\": [\n {\n \"id\": \"call_KcAjWtAww20AihPHphUh46Gd\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"arguments\": \"{\\\"location\\\":\\\"Boston, MA\\\"}\"\n }\n }\n ]\n },\n {\n \"role\": \"tool\",\n \"content\": \"The weather is cold\",\n \"tool_call_id\": \"call_KcAjWtAww20AihPHphUh46Gd\"\n }\n ]\n },\n)" - lang: JavaScript source: "const response = await client.inference.chatCompletionUnified({\n inference_id: \"openai-completion\",\n chat_completion_request: {\n messages: [\n {\n role: \"assistant\",\n content: \"Let's find out what the weather is\",\n tool_calls: [\n {\n id: \"call_KcAjWtAww20AihPHphUh46Gd\",\n type: \"function\",\n function: {\n name: \"get_current_weather\",\n arguments: '{\"location\":\"Boston, MA\"}',\n },\n },\n ],\n },\n {\n role: \"tool\",\n content: \"The weather is cold\",\n tool_call_id: \"call_KcAjWtAww20AihPHphUh46Gd\",\n },\n ],\n },\n});" - lang: Ruby source: "response = client.inference.chat_completion_unified(\n inference_id: \"openai-completion\",\n body: {\n \"messages\": [\n {\n \"role\": \"assistant\",\n \"content\": \"Let's find out what the weather is\",\n \"tool_calls\": [\n {\n \"id\": \"call_KcAjWtAww20AihPHphUh46Gd\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"arguments\": \"{\\\"location\\\":\\\"Boston, MA\\\"}\"\n }\n }\n ]\n },\n {\n \"role\": \"tool\",\n \"content\": \"The weather is cold\",\n \"tool_call_id\": \"call_KcAjWtAww20AihPHphUh46Gd\"\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->inference()->chatCompletionUnified([\n \"inference_id\" => \"openai-completion\",\n \"body\" => [\n \"messages\" => array(\n [\n \"role\" => \"assistant\",\n \"content\" => \"Let's find out what the weather is\",\n \"tool_calls\" => array(\n [\n \"id\" => \"call_KcAjWtAww20AihPHphUh46Gd\",\n \"type\" => \"function\",\n \"function\" => [\n \"name\" => \"get_current_weather\",\n \"arguments\" => \"{\\\"location\\\":\\\"Boston, MA\\\"}\",\n ],\n ],\n ),\n ],\n [\n \"role\" => \"tool\",\n \"content\" => \"The weather is cold\",\n \"tool_call_id\" => \"call_KcAjWtAww20AihPHphUh46Gd\",\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"messages":[{"role":"assistant","content":"Let''"''"''s find out what the weather is","tool_calls":[{"id":"call_KcAjWtAww20AihPHphUh46Gd","type":"function","function":{"name":"get_current_weather","arguments":"{\"location\":\"Boston, MA\"}"}}]},{"role":"tool","content":"The weather is cold","tool_call_id":"call_KcAjWtAww20AihPHphUh46Gd"}]}'' "$ELASTICSEARCH_URL/_inference/chat_completion/openai-completion/_stream"' - lang: C# source: "var response = await client.Inference\n .ChatCompletionUnifiedAsync(inferenceId: \"openai-completion\", d1 => d1\n .ChatCompletionRequest(d2 => d2\n .Messages(d3 => d3\n .Content(\"Let's find out what the weather is\")\n .Role(\"assistant\")\n .ToolCalls(d4 => d4\n .Function(d5 => d5\n .Arguments(\"{\\\"location\\\":\\\"Boston, MA\\\"}\")\n .Name(\"get_current_weather\")\n )\n .Id(\"call_KcAjWtAww20AihPHphUh46Gd\")\n .Type(\"function\")\n ), d3 => d3\n .Content(\"The weather is cold\")\n .Role(\"tool\")\n .ToolCallId(\"call_KcAjWtAww20AihPHphUh46Gd\")\n )\n )\n );" - lang: Java source: "client.inference().chatCompletionUnified(c -> c\n .inferenceId(\"openai-completion\")\n .chatCompletionRequest(ch -> ch\n .messages(List.of(Message.of(m -> m\n .content(co -> co\n .string(\"Let's find out what the weather is\")\n )\n .role(\"assistant\")\n .toolCalls(t -> t\n .id(\"call_KcAjWtAww20AihPHphUh46Gd\")\n .function(f -> f\n .arguments(\"\"\"\n {\"location\":\"Boston, MA\"}\n \"\"\")\n .name(\"get_current_weather\")\n )\n .type(\"function\")\n )\n ),Message.of(me -> me\n .content(co -> co\n .string(\"The weather is cold\")\n )\n .role(\"tool\")\n .toolCallId(\"call_KcAjWtAww20AihPHphUh46Gd\")\n )))\n )\n);\n" PostChatCompletionRequestExample3: summary: A chat completion task with tools and tool_calls description: Run `POST _inference/chat_completion/openai-completion/_stream` to perform a chat completion using a User message with `tools` and `tool_choice`. value: "{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What's the price of a scarf?\"\n }\n ]\n }\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\",\n \"description\": \"Get the current price of a item\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"id\": \"123\"\n }\n }\n }\n }\n }\n ],\n \"tool_choice\": {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\"\n }\n }\n}" x-codeSamples: - lang: Console source: "POST _inference/chat_completion/openai-completion/_stream\n{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What's the price of a scarf?\"\n }\n ]\n }\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\",\n \"description\": \"Get the current price of a item\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"id\": \"123\"\n }\n }\n }\n }\n }\n ],\n \"tool_choice\": {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\"\n }\n }\n}" - lang: Python source: "resp = client.inference.chat_completion_unified(\n inference_id=\"openai-completion\",\n chat_completion_request={\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What's the price of a scarf?\"\n }\n ]\n }\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\",\n \"description\": \"Get the current price of a item\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"id\": \"123\"\n }\n }\n }\n }\n }\n ],\n \"tool_choice\": {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\"\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.chatCompletionUnified({\n inference_id: \"openai-completion\",\n chat_completion_request: {\n messages: [\n {\n role: \"user\",\n content: [\n {\n type: \"text\",\n text: \"What's the price of a scarf?\",\n },\n ],\n },\n ],\n tools: [\n {\n type: \"function\",\n function: {\n name: \"get_current_price\",\n description: \"Get the current price of a item\",\n parameters: {\n type: \"object\",\n properties: {\n item: {\n id: \"123\",\n },\n },\n },\n },\n },\n ],\n tool_choice: {\n type: \"function\",\n function: {\n name: \"get_current_price\",\n },\n },\n },\n});" - lang: Ruby source: "response = client.inference.chat_completion_unified(\n inference_id: \"openai-completion\",\n body: {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What's the price of a scarf?\"\n }\n ]\n }\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\",\n \"description\": \"Get the current price of a item\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"id\": \"123\"\n }\n }\n }\n }\n }\n ],\n \"tool_choice\": {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->chatCompletionUnified([\n \"inference_id\" => \"openai-completion\",\n \"body\" => [\n \"messages\" => array(\n [\n \"role\" => \"user\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"What's the price of a scarf?\",\n ],\n ),\n ],\n ),\n \"tools\" => array(\n [\n \"type\" => \"function\",\n \"function\" => [\n \"name\" => \"get_current_price\",\n \"description\" => \"Get the current price of a item\",\n \"parameters\" => [\n \"type\" => \"object\",\n \"properties\" => [\n \"item\" => [\n \"id\" => \"123\",\n ],\n ],\n ],\n ],\n ],\n ),\n \"tool_choice\" => [\n \"type\" => \"function\",\n \"function\" => [\n \"name\" => \"get_current_price\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"messages":[{"role":"user","content":[{"type":"text","text":"What''"''"''s the price of a scarf?"}]}],"tools":[{"type":"function","function":{"name":"get_current_price","description":"Get the current price of a item","parameters":{"type":"object","properties":{"item":{"id":"123"}}}}}],"tool_choice":{"type":"function","function":{"name":"get_current_price"}}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/openai-completion/_stream"' - lang: Java source: "client.inference().chatCompletionUnified(c -> c\n .inferenceId(\"openai-completion\")\n .chatCompletionRequest(ch -> ch\n .messages(m -> m\n .content(co -> co\n .object(o -> o\n .text(\"What's the price of a scarf?\")\n .type(\"text\")\n )\n )\n .role(\"user\")\n )\n .toolChoice(t -> t\n .object(o -> o\n .type(\"function\")\n .function(f -> f\n .name(\"get_current_price\")\n )\n )\n )\n .tools(to -> to\n .type(\"function\")\n .function(f -> f\n .description(\"Get the current price of a item\")\n .name(\"get_current_price\")\n .parameters(JsonData.fromJson(\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"item\\\":{\\\"id\\\":\\\"123\\\"}}}\"))\n )\n )\n )\n);\n" PostChatCompletionRequestExample4: summary: A chat completion task with `effort` parameter defined reasoning description: 'Run `POST _inference/chat_completion/reasoning-chat-completion/_stream` to perform a chat completion task, using both `effort` parameter based reasoning configuration and including reasoning generated by the model on previous step.' value: "{\n \"messages\": [{\n \"role\": \"user\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n }, {\n \"role\": \"assistant\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [{\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n }, {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n }, {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n }, {\n \"role\": \"user\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"effort\": \"high\",\n \"summary\": \"detailed\",\n \"exclude\": false\n }\n}" x-codeSamples: - lang: Console source: "POST _inference/chat_completion/reasoning-chat-completion/_stream\n{\n \"messages\": [{\n \"role\": \"user\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n }, {\n \"role\": \"assistant\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [{\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n }, {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n }, {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n }, {\n \"role\": \"user\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"effort\": \"high\",\n \"summary\": \"detailed\",\n \"exclude\": false\n }\n}" - lang: Python source: "resp = client.inference.chat_completion_unified(\n inference_id=\"reasoning-chat-completion\",\n chat_completion_request={\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n },\n {\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [\n {\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n },\n {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n },\n {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"effort\": \"high\",\n \"summary\": \"detailed\",\n \"exclude\": False\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.chatCompletionUnified({\n inference_id: \"reasoning-chat-completion\",\n chat_completion_request: {\n messages: [\n {\n role: \"user\",\n content: [\n {\n type: \"text\",\n text: \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\",\n },\n ],\n },\n {\n role: \"assistant\",\n content: [\n {\n type: \"text\",\n text: \"This is the barber paradox. Such a barber cannot logically exist.\",\n },\n ],\n reasoning:\n \"If the barber shaves himself, he should not; if he does not, he should.\",\n reasoning_details: [\n {\n type: \"reasoning.encrypted\",\n data: \"[REDACTED]\",\n },\n {\n type: \"reasoning.summary\",\n summary: \"Barber shaving himself creates contradiction\",\n },\n {\n type: \"reasoning.text\",\n text: \"If the barber shaves himself, he should not; if he does not, he should.\",\n signature: \"sig_123\",\n },\n ],\n },\n {\n role: \"user\",\n content: [\n {\n type: \"text\",\n text: \"What if there are 2 barbers?\",\n },\n ],\n },\n ],\n reasoning: {\n effort: \"high\",\n summary: \"detailed\",\n exclude: false,\n },\n },\n});" - lang: Ruby source: "response = client.inference.chat_completion_unified(\n inference_id: \"reasoning-chat-completion\",\n body: {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n },\n {\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [\n {\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n },\n {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n },\n {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"effort\": \"high\",\n \"summary\": \"detailed\",\n \"exclude\": false\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->chatCompletionUnified([\n \"inference_id\" => \"reasoning-chat-completion\",\n \"body\" => [\n \"messages\" => array(\n [\n \"role\" => \"user\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\",\n ],\n ),\n ],\n [\n \"role\" => \"assistant\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"This is the barber paradox. Such a barber cannot logically exist.\",\n ],\n ),\n \"reasoning\" => \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\" => array(\n [\n \"type\" => \"reasoning.encrypted\",\n \"data\" => \"[REDACTED]\",\n ],\n [\n \"type\" => \"reasoning.summary\",\n \"summary\" => \"Barber shaving himself creates contradiction\",\n ],\n [\n \"type\" => \"reasoning.text\",\n \"text\" => \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\" => \"sig_123\",\n ],\n ),\n ],\n [\n \"role\" => \"user\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"What if there are 2 barbers?\",\n ],\n ),\n ],\n ),\n \"reasoning\" => [\n \"effort\" => \"high\",\n \"summary\" => \"detailed\",\n \"exclude\" => false,\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"messages":[{"role":"user","content":[{"type":"text","text":"Barber shaves all those, who do not shave themselves. Who shaves the barber?"}]},{"role":"assistant","content":[{"type":"text","text":"This is the barber paradox. Such a barber cannot logically exist."}],"reasoning":"If the barber shaves himself, he should not; if he does not, he should.","reasoning_details":[{"type":"reasoning.encrypted","data":"[REDACTED]"},{"type":"reasoning.summary","summary":"Barber shaving himself creates contradiction"},{"type":"reasoning.text","text":"If the barber shaves himself, he should not; if he does not, he should.","signature":"sig_123"}]},{"role":"user","content":[{"type":"text","text":"What if there are 2 barbers?"}]}],"reasoning":{"effort":"high","summary":"detailed","exclude":false}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/reasoning-chat-completion/_stream"' - lang: Java source: "client.inference().chatCompletionUnified(c -> c\n .inferenceId(\"reasoning-chat-completion\")\n .chatCompletionRequest(ch -> ch\n .messages(List.of(Message.of(m -> m\n .content(co -> co\n .object(o -> o\n .text(\"Barber shaves all those, who do not shave themselves. Who shaves the barber?\")\n .type(\"text\")\n )\n )\n .role(\"user\")\n ),Message.of(me -> me\n .content(co -> co\n .object(o -> o\n .text(\"This is the barber paradox. Such a barber cannot logically exist.\")\n .type(\"text\")\n )\n )\n .role(\"assistant\")\n ),Message.of(mes -> mes\n .content(co -> co\n .object(o -> o\n .text(\"What if there are 2 barbers?\")\n .type(\"text\")\n )\n )\n .role(\"user\")\n )))\n )\n);\n" PostChatCompletionRequestExample5: summary: A chat completion task with `enabled` parameter defined reasoning description: 'Run `POST _inference/chat_completion/reasoning-chat-completion/_stream` to perform a chat completion task, using both `enabled` parameter based reasoning configuration and including reasoning generated by the model on previous step.' value: "{\n \"messages\": [{\n \"role\": \"user\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n }, {\n \"role\": \"assistant\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [{\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n }, {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n }, {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n }, {\n \"role\": \"user\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"enabled\": true,\n \"summary\": \"detailed\",\n \"exclude\": false\n }\n}" x-codeSamples: - lang: Console source: "POST _inference/chat_completion/reasoning-chat-completion/_stream\n{\n \"messages\": [{\n \"role\": \"user\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n }, {\n \"role\": \"assistant\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [{\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n }, {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n }, {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n }, {\n \"role\": \"user\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"enabled\": true,\n \"summary\": \"detailed\",\n \"exclude\": false\n }\n}" - lang: Python source: "resp = client.inference.chat_completion_unified(\n inference_id=\"reasoning-chat-completion\",\n chat_completion_request={\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n },\n {\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [\n {\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n },\n {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n },\n {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"enabled\": True,\n \"summary\": \"detailed\",\n \"exclude\": False\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.chatCompletionUnified({\n inference_id: \"reasoning-chat-completion\",\n chat_completion_request: {\n messages: [\n {\n role: \"user\",\n content: [\n {\n type: \"text\",\n text: \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\",\n },\n ],\n },\n {\n role: \"assistant\",\n content: [\n {\n type: \"text\",\n text: \"This is the barber paradox. Such a barber cannot logically exist.\",\n },\n ],\n reasoning:\n \"If the barber shaves himself, he should not; if he does not, he should.\",\n reasoning_details: [\n {\n type: \"reasoning.encrypted\",\n data: \"[REDACTED]\",\n },\n {\n type: \"reasoning.summary\",\n summary: \"Barber shaving himself creates contradiction\",\n },\n {\n type: \"reasoning.text\",\n text: \"If the barber shaves himself, he should not; if he does not, he should.\",\n signature: \"sig_123\",\n },\n ],\n },\n {\n role: \"user\",\n content: [\n {\n type: \"text\",\n text: \"What if there are 2 barbers?\",\n },\n ],\n },\n ],\n reasoning: {\n enabled: true,\n summary: \"detailed\",\n exclude: false,\n },\n },\n});" - lang: Ruby source: "response = client.inference.chat_completion_unified(\n inference_id: \"reasoning-chat-completion\",\n body: {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n },\n {\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [\n {\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n },\n {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n },\n {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"enabled\": true,\n \"summary\": \"detailed\",\n \"exclude\": false\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->chatCompletionUnified([\n \"inference_id\" => \"reasoning-chat-completion\",\n \"body\" => [\n \"messages\" => array(\n [\n \"role\" => \"user\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\",\n ],\n ),\n ],\n [\n \"role\" => \"assistant\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"This is the barber paradox. Such a barber cannot logically exist.\",\n ],\n ),\n \"reasoning\" => \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\" => array(\n [\n \"type\" => \"reasoning.encrypted\",\n \"data\" => \"[REDACTED]\",\n ],\n [\n \"type\" => \"reasoning.summary\",\n \"summary\" => \"Barber shaving himself creates contradiction\",\n ],\n [\n \"type\" => \"reasoning.text\",\n \"text\" => \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\" => \"sig_123\",\n ],\n ),\n ],\n [\n \"role\" => \"user\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"What if there are 2 barbers?\",\n ],\n ),\n ],\n ),\n \"reasoning\" => [\n \"enabled\" => true,\n \"summary\" => \"detailed\",\n \"exclude\" => false,\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"messages":[{"role":"user","content":[{"type":"text","text":"Barber shaves all those, who do not shave themselves. Who shaves the barber?"}]},{"role":"assistant","content":[{"type":"text","text":"This is the barber paradox. Such a barber cannot logically exist."}],"reasoning":"If the barber shaves himself, he should not; if he does not, he should.","reasoning_details":[{"type":"reasoning.encrypted","data":"[REDACTED]"},{"type":"reasoning.summary","summary":"Barber shaving himself creates contradiction"},{"type":"reasoning.text","text":"If the barber shaves himself, he should not; if he does not, he should.","signature":"sig_123"}]},{"role":"user","content":[{"type":"text","text":"What if there are 2 barbers?"}]}],"reasoning":{"enabled":true,"summary":"detailed","exclude":false}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/reasoning-chat-completion/_stream"' - lang: Java source: "client.inference().chatCompletionUnified(c -> c\n .inferenceId(\"reasoning-chat-completion\")\n .chatCompletionRequest(ch -> ch\n .messages(List.of(Message.of(m -> m\n .content(co -> co\n .object(o -> o\n .text(\"Barber shaves all those, who do not shave themselves. Who shaves the barber?\")\n .type(\"text\")\n )\n )\n .role(\"user\")\n ),Message.of(me -> me\n .content(co -> co\n .object(o -> o\n .text(\"This is the barber paradox. Such a barber cannot logically exist.\")\n .type(\"text\")\n )\n )\n .role(\"assistant\")\n ),Message.of(mes -> mes\n .content(co -> co\n .object(o -> o\n .text(\"What if there are 2 barbers?\")\n .type(\"text\")\n )\n )\n .role(\"user\")\n )))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.StreamResult' examples: PostChatCompletionResponseExample1: description: A successful response when performing a chat completion task using a User message with `tools` and `tool_choice`. value: "event: message\ndata: {\"chat_completion\":{\"id\":\"chatcmpl-Ae0TWsy2VPnSfBbv5UztnSdYUMFP3\",\"choices\":[{\"delta\":{\"content\":\"\",\"role\":\"assistant\"},\"index\":0}],\"model\":\"gpt-4o-2024-08-06\",\"object\":\"chat.completion.chunk\"}}\n\nevent: message\ndata: {\"chat_completion\":{\"id\":\"chatcmpl-Ae0TWsy2VPnSfBbv5UztnSdYUMFP3\",\"choices\":[{\"delta\":{\"content\":Elastic\"},\"index\":0}],\"model\":\"gpt-4o-2024-08-06\",\"object\":\"chat.completion.chunk\"}}\n\nevent: message\ndata: {\"chat_completion\":{\"id\":\"chatcmpl-Ae0TWsy2VPnSfBbv5UztnSdYUMFP3\",\"choices\":[{\"delta\":{\"content\":\" is\"},\"index\":0}],\"model\":\"gpt-4o-2024-08-06\",\"object\":\"chat.completion.chunk\"}}\n\n(...)\n\nevent: message\ndata: {\"chat_completion\":{\"id\":\"chatcmpl-Ae0TWsy2VPnSfBbv5UztnSdYUMFP3\",\"choices\":[],\"model\":\"gpt-4o-2024-08-06\",\"object\":\"chat.completion.chunk\",\"usage\":{\"completion_tokens\":28,\"prompt_tokens\":16,\"total_tokens\":44}}} \n\nevent: message\ndata: [DONE]" PostChatCompletionResponseExample2: description: A successful response when performing a chat completion task with response-level reasoning data. value: "event: message\ndata: {\"chat_completion\":{\"id\":\"chatcmpl-910TWsy2VPnSfBbv5UztnSdYUJA10\",\"choices\":[{\"delta\":{\"content\":\"With two barbers, the paradox disappears.\",\"role\":\"assistant\"},\"index\":0,\"reasoning\":\"The contradiction only occurs when a barber must determine whether to shave himself.\",\"reasoning_details\":[{\"type\":\"reasoning.encrypted\",\"data\":\"[REDACTED]\"},{\"type\":\"reasoning.summary\",\"summary\":\"Two barbers can shave each other.\"},{\"type\":\"reasoning.text\",\"text\":\"The contradiction only occurs when a barber must determine whether to shave himself.\",\"signature\":\"sig_example\"}]}],\"model\":\"openai-gpt-oss-120b\",\"object\":\"chat.completion.chunk\"}}\n\nevent: message\ndata: {\"chat_completion\":{\"id\":\"chatcmpl-910TWsy2VPnSfBbv5UztnSdYUJA10\",\"choices\":[{\"delta\":{\"summary\":\"Each barber can shave the other, so neither needs to shave himself.\",\"role\":\"assistant\"},\"index\":0,\"reasoning\":\"With two barbers, they can shave each other.\",\"reasoning_details\":[{\"type\":\"reasoning.encrypted\",\"data\":\"[REDACTED]\"},{\"type\":\"reasoning.summary\",\"summary\":\"avoiding the self-reference paradox\"},{\"type\":\"reasoning.text\",\"format\":\"some_text_reasoning_detail_format\",\"text\":\"With two barbers, they can shave each other.\",\"signature\":\"sig_example\"}]}],\"model\":\"openai-gpt-oss-120b\",\"object\":\"chat.completion.chunk\"}}\n\n(...)\n\nevent: message\ndata: {\"chat_completion\":{\"id\":\"chatcmpl-910TWsy2VPnSfBbv5UztnSdYUJA10\",\"choices\":[],\"model\":\"openai-gpt-oss-120b\",\"object\":\"chat.completion.chunk\",\"usage\":{\"completion_tokens\":28,\"prompt_tokens\":16,\"total_tokens\":44,\"completion_tokens_details\":{\"reasoning_tokens\":10}}}}\n\nevent: message\ndata: [DONE]" x-state: Generally available; Added in 8.18.0 x-codeSamples: - lang: Console source: "POST _inference/chat_completion/openai-completion/_stream\n{\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n}" - lang: Python source: "resp = client.inference.chat_completion_unified(\n inference_id=\"openai-completion\",\n chat_completion_request={\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n },\n)" - lang: JavaScript source: "const response = await client.inference.chatCompletionUnified({\n inference_id: \"openai-completion\",\n chat_completion_request: {\n model: \"gpt-4o\",\n messages: [\n {\n role: \"user\",\n content: \"What is Elastic?\",\n },\n ],\n },\n});" - lang: Ruby source: "response = client.inference.chat_completion_unified(\n inference_id: \"openai-completion\",\n body: {\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->inference()->chatCompletionUnified([\n \"inference_id\" => \"openai-completion\",\n \"body\" => [\n \"model\" => \"gpt-4o\",\n \"messages\" => array(\n [\n \"role\" => \"user\",\n \"content\" => \"What is Elastic?\",\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"model":"gpt-4o","messages":[{"role":"user","content":"What is Elastic?"}]}'' "$ELASTICSEARCH_URL/_inference/chat_completion/openai-completion/_stream"' - lang: C# source: "var response = await client.Inference\n .ChatCompletionUnifiedAsync(inferenceId: \"openai-completion\", d1 => d1\n .ChatCompletionRequest(d2 => d2\n .Messages(d3 => d3\n .Content(\"What is Elastic?\")\n .Role(\"user\")\n )\n .Model(\"gpt-4o\")\n )\n );" - lang: Java source: "client.inference().chatCompletionUnified(c -> c\n .inferenceId(\"openai-completion\")\n .chatCompletionRequest(ch -> ch\n .messages(m -> m\n .content(co -> co\n .string(\"What is Elastic?\")\n )\n .role(\"user\")\n )\n .model(\"gpt-4o\")\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/completion/{inference_id}': post: tags: - inference summary: Perform completion inference on the service description: "Get responses for completion tasks.\nThis API works only with the completion task type.\n\nIMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face. For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs.\n\nThis API requires the `monitor_inference` cluster privilege (the built-in `inference_admin` and `inference_user` roles grant this privilege).\n\n## Required authorization\n\n* Cluster privileges: `monitor_inference`\n" operationId: inference-completion parameters: - name: inference_id in: path description: The inference Id required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference request to complete. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 120s requestBody: content: application/json: schema: required: - input type: object properties: input: oneOf: - type: string - type: array items: type: string description: "Inference input.\nEither a string or an array of strings." task_settings: allOf: - $ref: '#/components/schemas/inference._types.TaskSettings' description: Task settings for the individual inference request. These settings are specific to the you specified and override the task settings specified when initializing the service. examples: CompletionRequestExample1: summary: Completion task description: Run `POST _inference/completion/openai_completions` to perform a completion on the example question. value: "{\n \"input\": \"What is Elastic?\"\n}" x-codeSamples: - lang: Console source: "POST _inference/completion/openai_completions\n{\n \"input\": \"What is Elastic?\"\n}" - lang: Python source: "resp = client.inference.completion(\n inference_id=\"openai_completions\",\n input=\"What is Elastic?\",\n)" - lang: JavaScript source: "const response = await client.inference.completion({\n inference_id: \"openai_completions\",\n input: \"What is Elastic?\",\n});" - lang: Ruby source: "response = client.inference.completion(\n inference_id: \"openai_completions\",\n body: {\n \"input\": \"What is Elastic?\"\n }\n)" - lang: PHP source: "$resp = $client->inference()->completion([\n \"inference_id\" => \"openai_completions\",\n \"body\" => [\n \"input\" => \"What is Elastic?\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"input":"What is Elastic?"}'' "$ELASTICSEARCH_URL/_inference/completion/openai_completions"' - lang: C# source: "var response = await client.Inference\n .CompletionAsync(inferenceId: \"openai_completions\", d1 => d1\n .Input(\"What is Elastic?\")\n );" - lang: Java source: "client.inference().completion(c -> c\n .inferenceId(\"openai_completions\")\n .input(\"What is Elastic?\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.CompletionInferenceResult' examples: CompletionResponseExample1: summary: Completion task description: "A successful response from `POST _inference/completion/openai_completions`.\n" value: "{\n \"completion\": [\n {\n \"result\": \"Elastic is a company that provides a range of software solutions for search, logging, security, and analytics. Their flagship product is Elasticsearch, an open-source, distributed search engine that allows users to search, analyze, and visualize large volumes of data in real-time. Elastic also offers products such as Kibana, a data visualization tool, and Logstash, a log management and pipeline tool, as well as various other tools and solutions for data analysis and management.\"\n }\n ]\n}" x-state: Generally available; Added in 8.11.0 x-codeSamples: - lang: Console source: "POST _inference/completion/openai_completions\n{\n \"input\": \"What is Elastic?\"\n}" - lang: Python source: "resp = client.inference.completion(\n inference_id=\"openai_completions\",\n input=\"What is Elastic?\",\n)" - lang: JavaScript source: "const response = await client.inference.completion({\n inference_id: \"openai_completions\",\n input: \"What is Elastic?\",\n});" - lang: Ruby source: "response = client.inference.completion(\n inference_id: \"openai_completions\",\n body: {\n \"input\": \"What is Elastic?\"\n }\n)" - lang: PHP source: "$resp = $client->inference()->completion([\n \"inference_id\" => \"openai_completions\",\n \"body\" => [\n \"input\" => \"What is Elastic?\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"input":"What is Elastic?"}'' "$ELASTICSEARCH_URL/_inference/completion/openai_completions"' - lang: C# source: "var response = await client.Inference\n .CompletionAsync(inferenceId: \"openai_completions\", d1 => d1\n .Input(\"What is Elastic?\")\n );" - lang: Java source: "client.inference().completion(c -> c\n .inferenceId(\"openai_completions\")\n .input(\"What is Elastic?\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/decision/{inference_id}': post: tags: - inference summary: Perform decision inference on the service description: "Answer a set of named questions about an input, such as whether a customer is complaining, which team should handle a request, or how angry a customer is.\nThe questions are defined in the task settings of the inference endpoint, and can be replaced for a single request through `task_settings`.\n\n> info\n> Only the `elastic` service currently supports the `decision` task.\n\n## Required authorization\n\n* Cluster privileges: `monitor_inference`\n" operationId: inference-decision parameters: - name: inference_id in: path description: The unique identifier for the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: The amount of time to wait for the inference request to complete. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - input type: object properties: input: allOf: - $ref: '#/components/schemas/inference.decision.DecisionInput' description: "The input to answer the questions about.\nIt can be specified as a string, or as an object.\nThe object form additionally allows specifying images.\n\nstring example:\n```\n\"input\": \"I was charged twice for my order and nobody answers my emails.\"\n```\nobject example:\n```\n\"input\": {\n \"type\": \"image\",\n \"format\": \"base64\",\n \"value\": \"data:image/jpeg;base64,...\"\n}\n```" task_settings: allOf: - $ref: '#/components/schemas/inference.decision.DecisionTaskSettings' description: "Task settings for the individual inference request.\nThese settings override the task settings specified when creating the inference endpoint." examples: DecisionRequestExample1: summary: Decision task description: Run `POST _inference/decision/my-decision-endpoint` to answer questions about a customer message value: "{\n \"input\": \"I was charged twice for my order and nobody answers my emails.\",\n \"task_settings\": {\n \"questions\": {\n \"is_complaint\": {\n \"type\": \"predicate\",\n \"instructions\": \"Is the customer complaining?\"\n },\n \"team\": {\n \"type\": \"choice\",\n \"instructions\": \"Which team should handle this?\",\n \"choices\": {\n \"billing\": \"Charges, refunds, invoices\",\n \"shipping\": \"Deliveries and returns\",\n \"other\": null\n }\n },\n \"anger\": {\n \"type\": \"score\",\n \"instructions\": \"How angry is the customer?\",\n \"levels\": [\"calm\", \"annoyed\", { \"label\": \"furious\", \"description\": \"Threatens to leave\" }]\n }\n }\n }\n}" x-codeSamples: - lang: Console source: "POST _inference/decision/my-decision-endpoint\n{\n \"input\": \"I was charged twice for my order and nobody answers my emails.\",\n \"task_settings\": {\n \"questions\": {\n \"is_complaint\": {\n \"type\": \"predicate\",\n \"instructions\": \"Is the customer complaining?\"\n },\n \"team\": {\n \"type\": \"choice\",\n \"instructions\": \"Which team should handle this?\",\n \"choices\": {\n \"billing\": \"Charges, refunds, invoices\",\n \"shipping\": \"Deliveries and returns\",\n \"other\": null\n }\n },\n \"anger\": {\n \"type\": \"score\",\n \"instructions\": \"How angry is the customer?\",\n \"levels\": [\"calm\", \"annoyed\", { \"label\": \"furious\", \"description\": \"Threatens to leave\" }]\n }\n }\n }\n}" - lang: Python source: "resp = client.inference.decision(\n inference_id=\"my-decision-endpoint\",\n input=\"I was charged twice for my order and nobody answers my emails.\",\n task_settings={\n \"questions\": {\n \"is_complaint\": {\n \"type\": \"predicate\",\n \"instructions\": \"Is the customer complaining?\"\n },\n \"team\": {\n \"type\": \"choice\",\n \"instructions\": \"Which team should handle this?\",\n \"choices\": {\n \"billing\": \"Charges, refunds, invoices\",\n \"shipping\": \"Deliveries and returns\",\n \"other\": None\n }\n },\n \"anger\": {\n \"type\": \"score\",\n \"instructions\": \"How angry is the customer?\",\n \"levels\": [\n \"calm\",\n \"annoyed\",\n {\n \"label\": \"furious\",\n \"description\": \"Threatens to leave\"\n }\n ]\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.decision({\n inference_id: \"my-decision-endpoint\",\n input: \"I was charged twice for my order and nobody answers my emails.\",\n task_settings: {\n questions: {\n is_complaint: {\n type: \"predicate\",\n instructions: \"Is the customer complaining?\",\n },\n team: {\n type: \"choice\",\n instructions: \"Which team should handle this?\",\n choices: {\n billing: \"Charges, refunds, invoices\",\n shipping: \"Deliveries and returns\",\n other: null,\n },\n },\n anger: {\n type: \"score\",\n instructions: \"How angry is the customer?\",\n levels: [\n \"calm\",\n \"annoyed\",\n {\n label: \"furious\",\n description: \"Threatens to leave\",\n },\n ],\n },\n },\n },\n});" - lang: Ruby source: "response = client.inference.decision(\n inference_id: \"my-decision-endpoint\",\n body: {\n \"input\": \"I was charged twice for my order and nobody answers my emails.\",\n \"task_settings\": {\n \"questions\": {\n \"is_complaint\": {\n \"type\": \"predicate\",\n \"instructions\": \"Is the customer complaining?\"\n },\n \"team\": {\n \"type\": \"choice\",\n \"instructions\": \"Which team should handle this?\",\n \"choices\": {\n \"billing\": \"Charges, refunds, invoices\",\n \"shipping\": \"Deliveries and returns\",\n \"other\": nil\n }\n },\n \"anger\": {\n \"type\": \"score\",\n \"instructions\": \"How angry is the customer?\",\n \"levels\": [\n \"calm\",\n \"annoyed\",\n {\n \"label\": \"furious\",\n \"description\": \"Threatens to leave\"\n }\n ]\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->decision([\n \"inference_id\" => \"my-decision-endpoint\",\n \"body\" => [\n \"input\" => \"I was charged twice for my order and nobody answers my emails.\",\n \"task_settings\" => [\n \"questions\" => [\n \"is_complaint\" => [\n \"type\" => \"predicate\",\n \"instructions\" => \"Is the customer complaining?\",\n ],\n \"team\" => [\n \"type\" => \"choice\",\n \"instructions\" => \"Which team should handle this?\",\n \"choices\" => [\n \"billing\" => \"Charges, refunds, invoices\",\n \"shipping\" => \"Deliveries and returns\",\n \"other\" => null,\n ],\n ],\n \"anger\" => [\n \"type\" => \"score\",\n \"instructions\" => \"How angry is the customer?\",\n \"levels\" => array(\n \"calm\",\n \"annoyed\",\n [\n \"label\" => \"furious\",\n \"description\" => \"Threatens to leave\",\n ],\n ),\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"input":"I was charged twice for my order and nobody answers my emails.","task_settings":{"questions":{"is_complaint":{"type":"predicate","instructions":"Is the customer complaining?"},"team":{"type":"choice","instructions":"Which team should handle this?","choices":{"billing":"Charges, refunds, invoices","shipping":"Deliveries and returns","other":null}},"anger":{"type":"score","instructions":"How angry is the customer?","levels":["calm","annoyed",{"label":"furious","description":"Threatens to leave"}]}}}}'' "$ELASTICSEARCH_URL/_inference/decision/my-decision-endpoint"' - lang: C# source: "var response = await client.Inference\n .DecisionAsync(inferenceId: \"my-decision-endpoint\", d1 => d1\n .Input(\"I was charged twice for my order and nobody answers my emails.\")\n .TaskSettings(d2 => d2\n .Questions(d3 => d3\n .Predicate(\"is_complaint\", d4 => d4\n .Instructions(\"Is the customer complaining?\")\n )\n .Choice(\"team\", d4 => d4\n .Choices(new Dictionary()\n {\n { \"billing\", \"Charges, refunds, invoices\" },\n { \"shipping\", \"Deliveries and returns\" },\n { \"other\", null }\n })\n .Instructions(\"Which team should handle this?\")\n )\n .Score(\"anger\", d4 => d4\n .Instructions(\"How angry is the customer?\")\n .Levels([\"calm\", \"annoyed\", new DecisionScoreLevelObject()\n {\n Description = \"Threatens to leave\",\n Label = \"furious\"\n }])\n )\n )\n )\n );" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.DecisionInferenceResult' examples: DecisionResponseExample1: summary: Decision task description: "A response from `POST _inference/decision/my-decision-endpoint`, with an answer for each question.\n" value: "{\n \"decision\": {\n \"answers\": {\n \"is_complaint\": {\n \"type\": \"predicate\",\n \"probability\": 0.94\n },\n \"team\": {\n \"type\": \"choice\",\n \"choice\": \"billing\",\n \"probabilities\": [\n { \"value\": \"billing\", \"probability\": 0.91 },\n { \"value\": \"shipping\", \"probability\": 0.04 },\n { \"value\": \"other\", \"probability\": 0.05 }\n ],\n \"confidence\": 0.89\n },\n \"anger\": {\n \"type\": \"score\",\n \"score\": 1.4,\n \"probabilities\": [\n { \"value\": 0, \"label\": \"calm\", \"probability\": 0.1 },\n { \"value\": 1, \"label\": \"annoyed\", \"probability\": 0.4 },\n { \"value\": 2, \"label\": \"furious\", \"probability\": 0.5 }\n ],\n \"confidence\": 0.62\n }\n }\n }\n}" x-state: Experimental; Added in 9.6.0 x-codeSamples: - lang: Console source: "POST _inference/decision/my-decision-endpoint\n{\n \"input\": \"I was charged twice for my order and nobody answers my emails.\",\n \"task_settings\": {\n \"questions\": {\n \"is_complaint\": {\n \"type\": \"predicate\",\n \"instructions\": \"Is the customer complaining?\"\n },\n \"team\": {\n \"type\": \"choice\",\n \"instructions\": \"Which team should handle this?\",\n \"choices\": {\n \"billing\": \"Charges, refunds, invoices\",\n \"shipping\": \"Deliveries and returns\",\n \"other\": null\n }\n },\n \"anger\": {\n \"type\": \"score\",\n \"instructions\": \"How angry is the customer?\",\n \"levels\": [\"calm\", \"annoyed\", { \"label\": \"furious\", \"description\": \"Threatens to leave\" }]\n }\n }\n }\n}" - lang: Python source: "resp = client.inference.decision(\n inference_id=\"my-decision-endpoint\",\n input=\"I was charged twice for my order and nobody answers my emails.\",\n task_settings={\n \"questions\": {\n \"is_complaint\": {\n \"type\": \"predicate\",\n \"instructions\": \"Is the customer complaining?\"\n },\n \"team\": {\n \"type\": \"choice\",\n \"instructions\": \"Which team should handle this?\",\n \"choices\": {\n \"billing\": \"Charges, refunds, invoices\",\n \"shipping\": \"Deliveries and returns\",\n \"other\": None\n }\n },\n \"anger\": {\n \"type\": \"score\",\n \"instructions\": \"How angry is the customer?\",\n \"levels\": [\n \"calm\",\n \"annoyed\",\n {\n \"label\": \"furious\",\n \"description\": \"Threatens to leave\"\n }\n ]\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.decision({\n inference_id: \"my-decision-endpoint\",\n input: \"I was charged twice for my order and nobody answers my emails.\",\n task_settings: {\n questions: {\n is_complaint: {\n type: \"predicate\",\n instructions: \"Is the customer complaining?\",\n },\n team: {\n type: \"choice\",\n instructions: \"Which team should handle this?\",\n choices: {\n billing: \"Charges, refunds, invoices\",\n shipping: \"Deliveries and returns\",\n other: null,\n },\n },\n anger: {\n type: \"score\",\n instructions: \"How angry is the customer?\",\n levels: [\n \"calm\",\n \"annoyed\",\n {\n label: \"furious\",\n description: \"Threatens to leave\",\n },\n ],\n },\n },\n },\n});" - lang: Ruby source: "response = client.inference.decision(\n inference_id: \"my-decision-endpoint\",\n body: {\n \"input\": \"I was charged twice for my order and nobody answers my emails.\",\n \"task_settings\": {\n \"questions\": {\n \"is_complaint\": {\n \"type\": \"predicate\",\n \"instructions\": \"Is the customer complaining?\"\n },\n \"team\": {\n \"type\": \"choice\",\n \"instructions\": \"Which team should handle this?\",\n \"choices\": {\n \"billing\": \"Charges, refunds, invoices\",\n \"shipping\": \"Deliveries and returns\",\n \"other\": nil\n }\n },\n \"anger\": {\n \"type\": \"score\",\n \"instructions\": \"How angry is the customer?\",\n \"levels\": [\n \"calm\",\n \"annoyed\",\n {\n \"label\": \"furious\",\n \"description\": \"Threatens to leave\"\n }\n ]\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->decision([\n \"inference_id\" => \"my-decision-endpoint\",\n \"body\" => [\n \"input\" => \"I was charged twice for my order and nobody answers my emails.\",\n \"task_settings\" => [\n \"questions\" => [\n \"is_complaint\" => [\n \"type\" => \"predicate\",\n \"instructions\" => \"Is the customer complaining?\",\n ],\n \"team\" => [\n \"type\" => \"choice\",\n \"instructions\" => \"Which team should handle this?\",\n \"choices\" => [\n \"billing\" => \"Charges, refunds, invoices\",\n \"shipping\" => \"Deliveries and returns\",\n \"other\" => null,\n ],\n ],\n \"anger\" => [\n \"type\" => \"score\",\n \"instructions\" => \"How angry is the customer?\",\n \"levels\" => array(\n \"calm\",\n \"annoyed\",\n [\n \"label\" => \"furious\",\n \"description\" => \"Threatens to leave\",\n ],\n ),\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"input":"I was charged twice for my order and nobody answers my emails.","task_settings":{"questions":{"is_complaint":{"type":"predicate","instructions":"Is the customer complaining?"},"team":{"type":"choice","instructions":"Which team should handle this?","choices":{"billing":"Charges, refunds, invoices","shipping":"Deliveries and returns","other":null}},"anger":{"type":"score","instructions":"How angry is the customer?","levels":["calm","annoyed",{"label":"furious","description":"Threatens to leave"}]}}}}'' "$ELASTICSEARCH_URL/_inference/decision/my-decision-endpoint"' - lang: C# source: "var response = await client.Inference\n .DecisionAsync(inferenceId: \"my-decision-endpoint\", d1 => d1\n .Input(\"I was charged twice for my order and nobody answers my emails.\")\n .TaskSettings(d2 => d2\n .Questions(d3 => d3\n .Predicate(\"is_complaint\", d4 => d4\n .Instructions(\"Is the customer complaining?\")\n )\n .Choice(\"team\", d4 => d4\n .Choices(new Dictionary()\n {\n { \"billing\", \"Charges, refunds, invoices\" },\n { \"shipping\", \"Deliveries and returns\" },\n { \"other\", null }\n })\n .Instructions(\"Which team should handle this?\")\n )\n .Score(\"anger\", d4 => d4\n .Instructions(\"How angry is the customer?\")\n .Levels([\"calm\", \"annoyed\", new DecisionScoreLevelObject()\n {\n Description = \"Threatens to leave\",\n Label = \"furious\"\n }])\n )\n )\n )\n );" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{inference_id}': get: tags: - inference summary: "Get an inference endpoint\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_inference\n
\n
\n GET\n /_inference/{inference_id}\n
\n
\n GET\n /_inference/{task_type}/_all\n
\n
\n GET\n /_inference/{task_type}/{inference_id}\n
\n \n\nThis API requires the `monitor_inference` cluster privilege (the built-in `inference_admin` and `inference_user` roles grant this privilege).\n\n## Required authorization\n\n* Cluster privileges: `monitor_inference`\n" operationId: inference-get parameters: - $ref: '#/components/parameters/inference.get-task_type' - $ref: '#/components/parameters/inference.get-inference_id' responses: '200': $ref: '#/components/responses/inference.get-200' x-state: Generally available; Added in 8.11.0 x-codeSamples: - lang: Console source: "GET _inference/sparse_embedding/my-elser-model\n" - lang: Python source: "resp = client.inference.get(\n task_type=\"sparse_embedding\",\n inference_id=\"my-elser-model\",\n)" - lang: JavaScript source: "const response = await client.inference.get({\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n});" - lang: Ruby source: "response = client.inference.get(\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\"\n)" - lang: PHP source: "$resp = $client->inference()->get([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"my-elser-model\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model"' - lang: C# source: "var response = await client.Inference\n .GetAsync(d1 => d1\n .InferenceId(\"my-elser-model\")\n .TaskType(TaskType.SparseEmbedding)\n );" - lang: Java source: "client.inference().get(g -> g\n .inferenceId(\"my-elser-model\")\n .taskType(TaskType.SparseEmbedding)\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name put: tags: - inference summary: "Create an inference endpoint\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_inference/{inference_id}\n
\n
\n PUT\n /_inference/{task_type}/{inference_id}\n
\n \n\nIMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Mistral, Azure OpenAI, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face.\nFor built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models.\nHowever, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs.\n\nThe following integrations are available through the inference API. You can find the available task types next to the integration name:\n* AI21 (`chat_completion`, `completion`)\n* AlibabaCloud AI Search (`completion`, `rerank`, `sparse_embedding`, `text_embedding`)\n* Amazon Bedrock (`chat_completion`, `completion`, `text_embedding`)\n* Amazon SageMaker (`chat_completion`, `completion`, `rerank`, `sparse_embedding`, `text_embedding`)\n* Anthropic (`chat_completion`, `completion`)\n* Azure AI Studio (`completion`, `rerank`, `text_embedding`)\n* Azure OpenAI (`chat_completion`, `completion`, `text_embedding`)\n* Cohere (`completion`, `rerank`, `text_embedding`)\n* DeepSeek (`chat_completion`, `completion`)\n* Elasticsearch (`rerank`, `sparse_embedding`, `text_embedding` - this service is for built-in models and models uploaded through Eland)\n* ELSER (`sparse_embedding`)\n* Fireworks AI (`chat_completion`, `completion`, `text_embedding`)\n* Google AI Studio (`completion`, `text_embedding`)\n* Google Vertex AI (`chat_completion`, `completion`, `rerank`, `text_embedding`)\n* Groq (`chat_completion`)\n* Hugging Face (`chat_completion`, `completion`, `rerank`, `text_embedding`)\n* JinaAI (`embedding`, `rerank`, `text_embedding`)\n* Llama (`chat_completion`, `completion`, `text_embedding`)\n* Mistral (`chat_completion`, `completion`, `text_embedding`)\n* Nvidia (`chat_completion`, `completion`, `text_embedding`, `rerank`)\n* OpenAI (`chat_completion`, `completion`, `text_embedding`)\n* OpenShift AI (`chat_completion`, `completion`, `rerank`, `text_embedding`)\n* VoyageAI (`rerank`, `text_embedding`)\n* Watsonx (`chat_completion`, `completion`, `rerank`, `text_embedding`)\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put parameters: - $ref: '#/components/parameters/inference.put-task_type' - $ref: '#/components/parameters/inference.put-inference_id' - $ref: '#/components/parameters/inference.put-timeout' requestBody: $ref: '#/components/requestBodies/inference.put' responses: '200': $ref: '#/components/responses/inference.put-200' x-state: Generally available; Added in 8.11.0 x-codeSamples: - lang: Console source: "PUT _inference/rerank/my-rerank-model\n{\n \"service\": \"cohere\",\n \"service_settings\": {\n \"model_id\": \"rerank-english-v3.0\",\n \"api_key\": \"{{COHERE_API_KEY}}\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"my-rerank-model\",\n inference_config={\n \"service\": \"cohere\",\n \"service_settings\": {\n \"model_id\": \"rerank-english-v3.0\",\n \"api_key\": \"{{COHERE_API_KEY}}\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"my-rerank-model\",\n inference_config: {\n service: \"cohere\",\n service_settings: {\n model_id: \"rerank-english-v3.0\",\n api_key: \"{{COHERE_API_KEY}}\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"my-rerank-model\",\n body: {\n \"service\": \"cohere\",\n \"service_settings\": {\n \"model_id\": \"rerank-english-v3.0\",\n \"api_key\": \"{{COHERE_API_KEY}}\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"my-rerank-model\",\n \"body\" => [\n \"service\" => \"cohere\",\n \"service_settings\" => [\n \"model_id\" => \"rerank-english-v3.0\",\n \"api_key\" => \"{{COHERE_API_KEY}}\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"cohere","service_settings":{"model_id":"rerank-english-v3.0","api_key":"{{COHERE_API_KEY}}"}}'' "$ELASTICSEARCH_URL/_inference/rerank/my-rerank-model"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"my-rerank-model\",\n TaskType = TaskType.Rerank,\n InferenceConfig = new()\n {\n Service = \"cohere\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"model_id\": \"rerank-english-v3.0\",\n \"api_key\": \"{{COHERE_API_KEY}}\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"my-rerank-model\")\n .taskType(TaskType.Rerank)\n .inferenceConfig(i -> i\n .service(\"cohere\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"model_id\":\"rerank-english-v3.0\",\"api_key\":\"{{COHERE_API_KEY}}\"}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name post: tags: - inference summary: "Perform inference on the service\n" description: "**All methods and paths for this operation:**\n\n
\n POST\n /_inference/{inference_id}\n
\n
\n POST\n /_inference/{task_type}/{inference_id}\n
\n \n\nThis API enables you to use machine learning models to perform specific tasks on data that you provide as an input.\nIt returns a response with the results of the tasks.\nThe inference endpoint you use can perform one specific task that has been defined when the endpoint was created with the create inference API.\n\nFor details about using this API with a service, such as Amazon Bedrock, Anthropic, or HuggingFace, refer to the service-specific documentation.\n\n> info\n> The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face. For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs.\n\n## Required authorization\n\n* Cluster privileges: `monitor_inference`\n" operationId: inference-inference parameters: - $ref: '#/components/parameters/inference.inference-task_type' - $ref: '#/components/parameters/inference.inference-inference_id' - $ref: '#/components/parameters/inference.inference-timeout' requestBody: $ref: '#/components/requestBodies/inference.inference' responses: '200': $ref: '#/components/responses/inference.inference-200' x-state: Generally available; Added in 8.11.0 x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name delete: tags: - inference summary: "Delete an inference endpoint\n" description: "**All methods and paths for this operation:**\n\n
\n DELETE\n /_inference/{inference_id}\n
\n
\n DELETE\n /_inference/{task_type}/{inference_id}\n
\n \n\nThis API requires the manage_inference cluster privilege (the built-in `inference_admin` role grants this privilege).\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-delete parameters: - $ref: '#/components/parameters/inference.delete-task_type' - $ref: '#/components/parameters/inference.delete-inference_id' - $ref: '#/components/parameters/inference.delete-dry_run' - $ref: '#/components/parameters/inference.delete-force' responses: '200': $ref: '#/components/responses/inference.delete-200' x-state: Generally available; Added in 8.11.0 x-codeSamples: - lang: Console source: "DELETE /_inference/sparse_embedding/my-elser-model\n" - lang: Python source: "resp = client.inference.delete(\n task_type=\"sparse_embedding\",\n inference_id=\"my-elser-model\",\n)" - lang: JavaScript source: "const response = await client.inference.delete({\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n});" - lang: Ruby source: "response = client.inference.delete(\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\"\n)" - lang: PHP source: "$resp = $client->inference()->delete([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"my-elser-model\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model"' - lang: C# source: "var response = await client.Inference\n .DeleteAsync(new DeleteInferenceRequest()\n {\n InferenceId = \"my-elser-model\",\n TaskType = TaskType.SparseEmbedding\n });" - lang: Java source: "client.inference().delete(d -> d\n .inferenceId(\"my-elser-model\")\n .taskType(TaskType.SparseEmbedding)\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name /_inference/_region_policy: get: tags: - inference summary: Get the inference region policy description: "\n\n## Required authorization\n\n* Cluster privileges: `monitor_inference`\n" operationId: inference-get-region-policy responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.RegionPolicyDoc' examples: GetRegionPolicyResponseExample1: summary: The configured region policy description: A successful response when retrieving the currently configured region policy. value: "{\n \"region_policy\": {\n \"allowed_geos\": [\"us\", \"eu\"]\n },\n \"created_at\": \"2026-07-13T12:00:00.000Z\",\n \"created_by\": \"inference_user\",\n \"updated_at\": \"2026-07-13T13:30:00.000Z\",\n \"updated_by\": \"inference_user\"\n}" x-state: Generally available; Added in 9.5.0 x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name put: tags: - inference summary: Create or update the inference region policy description: "The region policy restricts inference to a set of allowed geographic areas or cloud service provider regions.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-region-policy parameters: - name: force in: query description: 'If `true`, the region policy is applied even if it would deny access to inference endpoints that are currently in use by ingest pipeline or indices.' schema: type: boolean default: false requestBody: content: application/json: schema: required: - region_policy type: object properties: region_policy: allOf: - $ref: '#/components/schemas/inference._types.RegionPolicy' description: The region policy configuration. examples: PutRegionPolicyRequestExample1: summary: A region policy allowing specific cloud service provider regions description: Run `PUT _inference/_region_policy` to restrict inference to a specific set of cloud service provider regions. value: "{\n \"region_policy\": {\n \"allowed_regions\": [\n { \"csp\": \"aws\", \"region\": \"us-east-1\" },\n { \"csp\": \"aws\", \"region\": \"eu-west-1\" }\n ]\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/_region_policy\n{\n \"region_policy\": {\n \"allowed_regions\": [\n { \"csp\": \"aws\", \"region\": \"us-east-1\" },\n { \"csp\": \"aws\", \"region\": \"eu-west-1\" }\n ]\n }\n}" - lang: Python source: "resp = client.inference.put_region_policy(\n region_policy={\n \"allowed_regions\": [\n {\n \"csp\": \"aws\",\n \"region\": \"us-east-1\"\n },\n {\n \"csp\": \"aws\",\n \"region\": \"eu-west-1\"\n }\n ]\n },\n)" - lang: JavaScript source: "const response = await client.inference.putRegionPolicy({\n region_policy: {\n allowed_regions: [\n {\n csp: \"aws\",\n region: \"us-east-1\",\n },\n {\n csp: \"aws\",\n region: \"eu-west-1\",\n },\n ],\n },\n});" - lang: Ruby source: "response = client.inference.put_region_policy(\n body: {\n \"region_policy\": {\n \"allowed_regions\": [\n {\n \"csp\": \"aws\",\n \"region\": \"us-east-1\"\n },\n {\n \"csp\": \"aws\",\n \"region\": \"eu-west-1\"\n }\n ]\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->putRegionPolicy([\n \"body\" => [\n \"region_policy\" => [\n \"allowed_regions\" => array(\n [\n \"csp\" => \"aws\",\n \"region\" => \"us-east-1\",\n ],\n [\n \"csp\" => \"aws\",\n \"region\" => \"eu-west-1\",\n ],\n ),\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"region_policy":{"allowed_regions":[{"csp":"aws","region":"us-east-1"},{"csp":"aws","region":"eu-west-1"}]}}'' "$ELASTICSEARCH_URL/_inference/_region_policy"' - lang: C# source: "var response = await client.Inference\n .PutRegionPolicyAsync(d1 => d1\n .RegionPolicy(d2 => d2\n .AllowedRegions(d3 => d3\n .Csp(\"aws\")\n .Region(\"us-east-1\"), d3 => d3\n .Csp(\"aws\")\n .Region(\"eu-west-1\")\n )\n )\n );" - lang: Java source: "client.inference().putRegionPolicy(p -> p\n .regionPolicy(r -> r\n .allowedRegions(List.of(CspRegion.of(c -> c\n .csp(\"aws\")\n .region(\"us-east-1\")\n ),CspRegion.of(c -> c\n .csp(\"aws\")\n .region(\"eu-west-1\")\n )))\n )\n);\n" PutRegionPolicyRequestExample2: summary: A region policy allowing specific geographic areas description: Run `PUT _inference/_region_policy` to restrict inference to a specific set of geographic areas. value: "{\n \"region_policy\": {\n \"allowed_geos\": [\"us\", \"eu\"]\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/_region_policy\n{\n \"region_policy\": {\n \"allowed_geos\": [\"us\", \"eu\"]\n }\n}" - lang: Python source: "resp = client.inference.put_region_policy(\n region_policy={\n \"allowed_geos\": [\n \"us\",\n \"eu\"\n ]\n },\n)" - lang: JavaScript source: "const response = await client.inference.putRegionPolicy({\n region_policy: {\n allowed_geos: [\"us\", \"eu\"],\n },\n});" - lang: Ruby source: "response = client.inference.put_region_policy(\n body: {\n \"region_policy\": {\n \"allowed_geos\": [\n \"us\",\n \"eu\"\n ]\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->putRegionPolicy([\n \"body\" => [\n \"region_policy\" => [\n \"allowed_geos\" => array(\n \"us\",\n \"eu\",\n ),\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"region_policy":{"allowed_geos":["us","eu"]}}'' "$ELASTICSEARCH_URL/_inference/_region_policy"' - lang: C# source: "var response = await client.Inference\n .PutRegionPolicyAsync(d1 => d1\n .RegionPolicy(d2 => d2\n .AllowedGeos(\"us\", \"eu\")\n )\n );" - lang: Java source: "client.inference().putRegionPolicy(p -> p\n .regionPolicy(r -> r\n .allowedGeos(List.of(\"us\",\"eu\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.RegionPolicyDoc' examples: PutRegionPolicyResponseExample1: summary: A region policy allowing specific cloud service provider regions description: A successful response when creating a region policy that allows specific cloud service provider regions. value: "{\n \"region_policy\": {\n \"allowed_regions\": [\n { \"csp\": \"aws\", \"region\": \"us-east-1\" },\n { \"csp\": \"aws\", \"region\": \"eu-west-1\" }\n ]\n },\n \"created_at\": \"2026-07-13T12:00:00.000Z\",\n \"created_by\": \"inference_user\"\n}" x-state: Generally available; Added in 9.5.0 x-codeSamples: - lang: Console source: "PUT _inference/_region_policy\n{\n \"region_policy\": {\n \"allowed_regions\": [\n { \"csp\": \"aws\", \"region\": \"us-east-1\" },\n { \"csp\": \"aws\", \"region\": \"eu-west-1\" }\n ]\n }\n}" - lang: Python source: "resp = client.inference.put_region_policy(\n region_policy={\n \"allowed_regions\": [\n {\n \"csp\": \"aws\",\n \"region\": \"us-east-1\"\n },\n {\n \"csp\": \"aws\",\n \"region\": \"eu-west-1\"\n }\n ]\n },\n)" - lang: JavaScript source: "const response = await client.inference.putRegionPolicy({\n region_policy: {\n allowed_regions: [\n {\n csp: \"aws\",\n region: \"us-east-1\",\n },\n {\n csp: \"aws\",\n region: \"eu-west-1\",\n },\n ],\n },\n});" - lang: Ruby source: "response = client.inference.put_region_policy(\n body: {\n \"region_policy\": {\n \"allowed_regions\": [\n {\n \"csp\": \"aws\",\n \"region\": \"us-east-1\"\n },\n {\n \"csp\": \"aws\",\n \"region\": \"eu-west-1\"\n }\n ]\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->putRegionPolicy([\n \"body\" => [\n \"region_policy\" => [\n \"allowed_regions\" => array(\n [\n \"csp\" => \"aws\",\n \"region\" => \"us-east-1\",\n ],\n [\n \"csp\" => \"aws\",\n \"region\" => \"eu-west-1\",\n ],\n ),\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"region_policy":{"allowed_regions":[{"csp":"aws","region":"us-east-1"},{"csp":"aws","region":"eu-west-1"}]}}'' "$ELASTICSEARCH_URL/_inference/_region_policy"' - lang: C# source: "var response = await client.Inference\n .PutRegionPolicyAsync(d1 => d1\n .RegionPolicy(d2 => d2\n .AllowedRegions(d3 => d3\n .Csp(\"aws\")\n .Region(\"us-east-1\"), d3 => d3\n .Csp(\"aws\")\n .Region(\"eu-west-1\")\n )\n )\n );" - lang: Java source: "client.inference().putRegionPolicy(p -> p\n .regionPolicy(r -> r\n .allowedRegions(List.of(CspRegion.of(c -> c\n .csp(\"aws\")\n .region(\"us-east-1\")\n ),CspRegion.of(c -> c\n .csp(\"aws\")\n .region(\"eu-west-1\")\n )))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name delete: tags: - inference summary: Delete the inference region policy description: "\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-delete-region-policy responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: DeleteRegionPolicyResponseExample1: summary: A deleted region policy description: A successful response when deleting the region policy. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 9.5.0 x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/document_extraction/{inference_id}': post: tags: - inference summary: Perform document extraction inference on the service description: "Extract the content of documents, such as PDFs or images of documents, into a textual format.\n\n## Required authorization\n\n* Cluster privileges: `monitor_inference`\n" operationId: inference-document-extraction parameters: - name: inference_id in: path description: The unique identifier for the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: The amount of time to wait for the inference request to complete. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 120s requestBody: content: application/json: schema: required: - input type: object properties: input: allOf: - $ref: '#/components/schemas/inference.document_extraction.DocumentExtractionInput' description: "The documents to extract the content from.\nEither a `content` object or an array of `content` objects.\n\n`content` object example:\n```\n\"input\": {\n \"content\": {\n \"type\": \"pdf\",\n \"format\": \"base64\",\n \"value\": \"data:application/pdf;base64,...\"\n }\n}\n```\n`content` object array example:\n```\n\"input\": [\n {\n \"content\": {\n \"type\": \"pdf\",\n \"format\": \"base64\",\n \"value\": \"data:application/pdf;base64,...\"\n }\n },\n {\n \"content\": {\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/scanned-page.png\"\n }\n }\n]\n```" task_settings: allOf: - $ref: '#/components/schemas/inference.document_extraction.DocumentExtractionTaskSettings' description: "Task settings for the individual inference request.\nThese settings are specific to the task type you specified and override the task settings specified when initializing the service." examples: DocumentExtractionRequestExample1: summary: Document extraction task description: Run `POST _inference/document_extraction/my-document-extraction-endpoint` to extract the content of the example PDF document value: "{\n \"input\": [\n {\n \"content\": {\n \"type\": \"pdf\",\n \"format\": \"base64\",\n \"value\": \"data:application/pdf;base64,...\"\n }\n }\n ]\n}" x-codeSamples: - lang: Console source: "POST _inference/document_extraction/my-document-extraction-endpoint\n{\n \"input\": [\n {\n \"content\": {\n \"type\": \"pdf\",\n \"format\": \"base64\",\n \"value\": \"data:application/pdf;base64,...\"\n }\n }\n ]\n}" - lang: Python source: "resp = client.inference.document_extraction(\n inference_id=\"my-document-extraction-endpoint\",\n input=[\n {\n \"content\": {\n \"type\": \"pdf\",\n \"format\": \"base64\",\n \"value\": \"data:application/pdf;base64,...\"\n }\n }\n ],\n)" - lang: JavaScript source: "const response = await client.inference.documentExtraction({\n inference_id: \"my-document-extraction-endpoint\",\n input: [\n {\n content: {\n type: \"pdf\",\n format: \"base64\",\n value: \"data:application/pdf;base64,...\",\n },\n },\n ],\n});" - lang: Ruby source: "response = client.inference.document_extraction(\n inference_id: \"my-document-extraction-endpoint\",\n body: {\n \"input\": [\n {\n \"content\": {\n \"type\": \"pdf\",\n \"format\": \"base64\",\n \"value\": \"data:application/pdf;base64,...\"\n }\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->inference()->documentExtraction([\n \"inference_id\" => \"my-document-extraction-endpoint\",\n \"body\" => [\n \"input\" => array(\n [\n \"content\" => [\n \"type\" => \"pdf\",\n \"format\" => \"base64\",\n \"value\" => \"data:application/pdf;base64,...\",\n ],\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"input":[{"content":{"type":"pdf","format":"base64","value":"data:application/pdf;base64,..."}}]}'' "$ELASTICSEARCH_URL/_inference/document_extraction/my-document-extraction-endpoint"' - lang: C# source: "var response = await client.Inference\n .DocumentExtractionAsync(inferenceId: \"my-document-extraction-endpoint\", d1 => d1\n .Input(d2 => d2\n .Content(d3 => d3\n .Format(DocumentExtractionContentFormat.Base64)\n .Type(DocumentExtractionContentType.Pdf)\n .Value(\"data:application/pdf;base64,...\")\n )\n )\n );" DocumentExtractionRequestExample2: summary: Document extraction task using the url format and task settings description: Run `POST _inference/document_extraction/my-document-extraction-endpoint` to extract the content of an image of a document referenced by URL as markdown. value: "{\n \"input\": {\n \"content\": {\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/scanned-page.png\"\n }\n },\n \"task_settings\": {\n \"output_format\": \"markdown\"\n }\n}" x-codeSamples: - lang: Console source: "POST _inference/document_extraction/my-document-extraction-endpoint\n{\n \"input\": {\n \"content\": {\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/scanned-page.png\"\n }\n },\n \"task_settings\": {\n \"output_format\": \"markdown\"\n }\n}" - lang: Python source: "resp = client.inference.document_extraction(\n inference_id=\"my-document-extraction-endpoint\",\n input={\n \"content\": {\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/scanned-page.png\"\n }\n },\n task_settings={\n \"output_format\": \"markdown\"\n },\n)" - lang: JavaScript source: "const response = await client.inference.documentExtraction({\n inference_id: \"my-document-extraction-endpoint\",\n input: {\n content: {\n type: \"image\",\n format: \"url\",\n value: \"https://example.com/scanned-page.png\",\n },\n },\n task_settings: {\n output_format: \"markdown\",\n },\n});" - lang: Ruby source: "response = client.inference.document_extraction(\n inference_id: \"my-document-extraction-endpoint\",\n body: {\n \"input\": {\n \"content\": {\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/scanned-page.png\"\n }\n },\n \"task_settings\": {\n \"output_format\": \"markdown\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->documentExtraction([\n \"inference_id\" => \"my-document-extraction-endpoint\",\n \"body\" => [\n \"input\" => [\n \"content\" => [\n \"type\" => \"image\",\n \"format\" => \"url\",\n \"value\" => \"https://example.com/scanned-page.png\",\n ],\n ],\n \"task_settings\" => [\n \"output_format\" => \"markdown\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"input":{"content":{"type":"image","format":"url","value":"https://example.com/scanned-page.png"}},"task_settings":{"output_format":"markdown"}}'' "$ELASTICSEARCH_URL/_inference/document_extraction/my-document-extraction-endpoint"' - lang: C# source: "var response = await client.Inference\n .DocumentExtractionAsync(inferenceId: \"my-document-extraction-endpoint\", d1 => d1\n .Input(d2 => d2\n .Content(d3 => d3\n .Format(DocumentExtractionContentFormat.Url)\n .Type(DocumentExtractionContentType.Image)\n .Value(\"https://example.com/scanned-page.png\")\n )\n )\n .TaskSettings(d2 => d2\n .OutputFormat(DocumentExtractionOutputFormat.Markdown)\n )\n );" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.DocumentExtractionInferenceResult' examples: DocumentExtractionResponseExample1: summary: Document extraction task description: "An abbreviated response from `POST _inference/document_extraction/my-document-extraction-endpoint`.\n" value: "{\n \"document_extraction\": [\n {\n \"content\": \"# Annual Report 2025\\n\\n...\",\n \"format\": \"markdown\",\n \"metadata\": {\n \"title\": \"Annual Report 2025\"\n }\n }\n ]\n}" x-state: Experimental; Added in 9.6.0 x-codeSamples: - lang: Console source: "POST _inference/document_extraction/my-document-extraction-endpoint\n{\n \"input\": [\n {\n \"content\": {\n \"type\": \"pdf\",\n \"format\": \"base64\",\n \"value\": \"data:application/pdf;base64,...\"\n }\n }\n ]\n}" - lang: Python source: "resp = client.inference.document_extraction(\n inference_id=\"my-document-extraction-endpoint\",\n input=[\n {\n \"content\": {\n \"type\": \"pdf\",\n \"format\": \"base64\",\n \"value\": \"data:application/pdf;base64,...\"\n }\n }\n ],\n)" - lang: JavaScript source: "const response = await client.inference.documentExtraction({\n inference_id: \"my-document-extraction-endpoint\",\n input: [\n {\n content: {\n type: \"pdf\",\n format: \"base64\",\n value: \"data:application/pdf;base64,...\",\n },\n },\n ],\n});" - lang: Ruby source: "response = client.inference.document_extraction(\n inference_id: \"my-document-extraction-endpoint\",\n body: {\n \"input\": [\n {\n \"content\": {\n \"type\": \"pdf\",\n \"format\": \"base64\",\n \"value\": \"data:application/pdf;base64,...\"\n }\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->inference()->documentExtraction([\n \"inference_id\" => \"my-document-extraction-endpoint\",\n \"body\" => [\n \"input\" => array(\n [\n \"content\" => [\n \"type\" => \"pdf\",\n \"format\" => \"base64\",\n \"value\" => \"data:application/pdf;base64,...\",\n ],\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"input":[{"content":{"type":"pdf","format":"base64","value":"data:application/pdf;base64,..."}}]}'' "$ELASTICSEARCH_URL/_inference/document_extraction/my-document-extraction-endpoint"' - lang: C# source: "var response = await client.Inference\n .DocumentExtractionAsync(inferenceId: \"my-document-extraction-endpoint\", d1 => d1\n .Input(d2 => d2\n .Content(d3 => d3\n .Format(DocumentExtractionContentFormat.Base64)\n .Type(DocumentExtractionContentType.Pdf)\n .Value(\"data:application/pdf;base64,...\")\n )\n )\n );" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/embedding/{inference_id}': post: tags: - inference summary: Perform dense embedding inference on the service description: "\n\n## Required authorization\n\n* Cluster privileges: `monitor_inference`\n" operationId: inference-embedding parameters: - name: inference_id in: path description: The inference Id required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference request to complete. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: $ref: '#/components/schemas/inference._types.RequestEmbedding' examples: EmbeddingRequestExample1: summary: Multimodal embedding task description: Run `POST _inference/embedding/my-multimodal-endpoint` to generate embeddings from the example text and image value: "{\n \"input\": [\n {\n \"content\": {\n \"type\": \"image\",\n \"format\": \"base64\",\n \"value\": \"data:image/jpeg;base64,...\"\n }\n },\n {\n \"content\": {\n \"type\": \"text\",\n \"value\": \"Some text to create an embedding\"\n }\n }\n ]\n}" x-codeSamples: - lang: Console source: "POST _inference/embedding/my-multimodal-endpoint\n{\n \"input\": [\n {\n \"content\": {\n \"type\": \"image\",\n \"format\": \"base64\",\n \"value\": \"data:image/jpeg;base64,...\"\n }\n },\n {\n \"content\": {\n \"type\": \"text\",\n \"value\": \"Some text to create an embedding\"\n }\n }\n ]\n}" - lang: Python source: "resp = client.inference.embedding(\n inference_id=\"my-multimodal-endpoint\",\n embedding={\n \"input\": [\n {\n \"content\": {\n \"type\": \"image\",\n \"format\": \"base64\",\n \"value\": \"data:image/jpeg;base64,...\"\n }\n },\n {\n \"content\": {\n \"type\": \"text\",\n \"value\": \"Some text to create an embedding\"\n }\n }\n ]\n },\n)" - lang: JavaScript source: "const response = await client.inference.embedding({\n inference_id: \"my-multimodal-endpoint\",\n embedding: {\n input: [\n {\n content: {\n type: \"image\",\n format: \"base64\",\n value: \"data:image/jpeg;base64,...\",\n },\n },\n {\n content: {\n type: \"text\",\n value: \"Some text to create an embedding\",\n },\n },\n ],\n },\n});" - lang: Ruby source: "response = client.inference.embedding(\n inference_id: \"my-multimodal-endpoint\",\n body: {\n \"input\": [\n {\n \"content\": {\n \"type\": \"image\",\n \"format\": \"base64\",\n \"value\": \"data:image/jpeg;base64,...\"\n }\n },\n {\n \"content\": {\n \"type\": \"text\",\n \"value\": \"Some text to create an embedding\"\n }\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->inference()->embedding([\n \"inference_id\" => \"my-multimodal-endpoint\",\n \"body\" => [\n \"input\" => array(\n [\n \"content\" => [\n \"type\" => \"image\",\n \"format\" => \"base64\",\n \"value\" => \"data:image/jpeg;base64,...\",\n ],\n ],\n [\n \"content\" => [\n \"type\" => \"text\",\n \"value\" => \"Some text to create an embedding\",\n ],\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"input":[{"content":{"type":"image","format":"base64","value":"data:image/jpeg;base64,..."}},{"content":{"type":"text","value":"Some text to create an embedding"}}]}'' "$ELASTICSEARCH_URL/_inference/embedding/my-multimodal-endpoint"' - lang: Java source: "client.inference().embedding(e -> e\n .inferenceId(\"my-multimodal-endpoint\")\n .embedding(em -> em\n .input(i -> i\n .content(List.of(EmbeddingContentObject.of(emb -> emb\n .content(c -> c\n .type(EmbeddingContentType.Image)\n .format(EmbeddingContentFormat.Base64)\n .value(\"data:image/jpeg;base64,...\")\n )\n ),EmbeddingContentObject.of(emb -> emb\n .content(c -> c\n .type(EmbeddingContentType.Text)\n .value(\"Some text to create an embedding\")\n )\n )))\n )\n )\n);\n" EmbeddingRequestExample2: summary: Text-only embedding task description: Run `POST _inference/embedding/my-text-only-endpoint` to generate embeddings from the example text value: "{\n \"input\": [\"The first text\", \"The second text\"]\n}" x-codeSamples: - lang: Console source: "POST _inference/embedding/my-text-only-endpoint\n{\n \"input\": [\"The first text\", \"The second text\"]\n}" - lang: Python source: "resp = client.inference.embedding(\n inference_id=\"my-text-only-endpoint\",\n embedding={\n \"input\": [\n \"The first text\",\n \"The second text\"\n ]\n },\n)" - lang: JavaScript source: "const response = await client.inference.embedding({\n inference_id: \"my-text-only-endpoint\",\n embedding: {\n input: [\"The first text\", \"The second text\"],\n },\n});" - lang: Ruby source: "response = client.inference.embedding(\n inference_id: \"my-text-only-endpoint\",\n body: {\n \"input\": [\n \"The first text\",\n \"The second text\"\n ]\n }\n)" - lang: PHP source: "$resp = $client->inference()->embedding([\n \"inference_id\" => \"my-text-only-endpoint\",\n \"body\" => [\n \"input\" => array(\n \"The first text\",\n \"The second text\",\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"input":["The first text","The second text"]}'' "$ELASTICSEARCH_URL/_inference/embedding/my-text-only-endpoint"' - lang: C# source: "var response = await client.Inference\n .EmbeddingAsync(inferenceId: \"my-text-only-endpoint\", d1 => d1\n .Embedding(d2 => d2\n .Input(new string[] { \"The first text\", \"The second text\" })\n )\n );" EmbeddingRequestExample3: summary: Embedding task using multiple items grouped under a single content object description: Run `POST _inference/embedding/my-multimodal-endpoint` to generate a single embedding from the example text and image. Multiple items in a single `content` object are available in Elasticsearch 9.5.0 and later. value: "{\n \"input\": [\n {\n \"content\": [\n {\n \"type\": \"image\",\n \"format\": \"base64\",\n \"value\": \"data:image/jpeg;base64,...\"\n },\n {\n \"type\": \"text\",\n \"value\": \"Some text to create an embedding\"\n }\n ]\n }\n ]\n}" x-codeSamples: - lang: Console source: "POST _inference/embedding/my-multimodal-endpoint\n{\n \"input\": [\n {\n \"content\": [\n {\n \"type\": \"image\",\n \"format\": \"base64\",\n \"value\": \"data:image/jpeg;base64,...\"\n },\n {\n \"type\": \"text\",\n \"value\": \"Some text to create an embedding\"\n }\n ]\n }\n ]\n}" - lang: Python source: "resp = client.inference.embedding(\n inference_id=\"my-multimodal-endpoint\",\n embedding={\n \"input\": [\n {\n \"content\": [\n {\n \"type\": \"image\",\n \"format\": \"base64\",\n \"value\": \"data:image/jpeg;base64,...\"\n },\n {\n \"type\": \"text\",\n \"value\": \"Some text to create an embedding\"\n }\n ]\n }\n ]\n },\n)" - lang: JavaScript source: "const response = await client.inference.embedding({\n inference_id: \"my-multimodal-endpoint\",\n embedding: {\n input: [\n {\n content: [\n {\n type: \"image\",\n format: \"base64\",\n value: \"data:image/jpeg;base64,...\",\n },\n {\n type: \"text\",\n value: \"Some text to create an embedding\",\n },\n ],\n },\n ],\n },\n});" - lang: Ruby source: "response = client.inference.embedding(\n inference_id: \"my-multimodal-endpoint\",\n body: {\n \"input\": [\n {\n \"content\": [\n {\n \"type\": \"image\",\n \"format\": \"base64\",\n \"value\": \"data:image/jpeg;base64,...\"\n },\n {\n \"type\": \"text\",\n \"value\": \"Some text to create an embedding\"\n }\n ]\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->inference()->embedding([\n \"inference_id\" => \"my-multimodal-endpoint\",\n \"body\" => [\n \"input\" => array(\n [\n \"content\" => array(\n [\n \"type\" => \"image\",\n \"format\" => \"base64\",\n \"value\" => \"data:image/jpeg;base64,...\",\n ],\n [\n \"type\" => \"text\",\n \"value\" => \"Some text to create an embedding\",\n ],\n ),\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"input":[{"content":[{"type":"image","format":"base64","value":"data:image/jpeg;base64,..."},{"type":"text","value":"Some text to create an embedding"}]}]}'' "$ELASTICSEARCH_URL/_inference/embedding/my-multimodal-endpoint"' - lang: Java source: "client.inference().embedding(e -> e\n .inferenceId(\"my-multimodal-endpoint\")\n .embedding(em -> em\n .input(i -> i\n .content(c -> c\n .content(List.of(EmbeddingContentObjectItem.of(emb -> emb\n .type(EmbeddingContentType.Image)\n .format(EmbeddingContentFormat.Base64)\n .value(\"data:image/jpeg;base64,...\")\n ),EmbeddingContentObjectItem.of(emb -> emb\n .type(EmbeddingContentType.Text)\n .value(\"Some text to create an embedding\")\n )))\n )\n )\n )\n);\n" EmbeddingRequestExample4: summary: Embedding task using the url format description: Run `POST _inference/embedding/my-multimodal-endpoint` to generate an embedding from an image referenced by URL. The `url` format is available in Elasticsearch 9.6.0 and later. value: "{\n \"input\": {\n \"content\": {\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/image.jpg\"\n }\n }\n}" x-codeSamples: - lang: Console source: "POST _inference/embedding/my-multimodal-endpoint\n{\n \"input\": {\n \"content\": {\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/image.jpg\"\n }\n }\n}" - lang: Python source: "resp = client.inference.embedding(\n inference_id=\"my-multimodal-endpoint\",\n embedding={\n \"input\": {\n \"content\": {\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/image.jpg\"\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.embedding({\n inference_id: \"my-multimodal-endpoint\",\n embedding: {\n input: {\n content: {\n type: \"image\",\n format: \"url\",\n value: \"https://example.com/image.jpg\",\n },\n },\n },\n});" - lang: Ruby source: "response = client.inference.embedding(\n inference_id: \"my-multimodal-endpoint\",\n body: {\n \"input\": {\n \"content\": {\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/image.jpg\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->embedding([\n \"inference_id\" => \"my-multimodal-endpoint\",\n \"body\" => [\n \"input\" => [\n \"content\" => [\n \"type\" => \"image\",\n \"format\" => \"url\",\n \"value\" => \"https://example.com/image.jpg\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"input":{"content":{"type":"image","format":"url","value":"https://example.com/image.jpg"}}}'' "$ELASTICSEARCH_URL/_inference/embedding/my-multimodal-endpoint"' - lang: C# source: "var response = await client.Inference\n .EmbeddingAsync(inferenceId: \"my-multimodal-endpoint\", d1 => d1\n .Embedding(d2 => d2\n .Input(new EmbeddingContentObject[] { new()\n {\n Content = [new EmbeddingContentObjectItem()\n {\n Format = EmbeddingContentFormat.Url,\n Type = EmbeddingContentType.Image,\n Value = \"https://example.com/image.jpg\"\n }]\n } })\n )\n );" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.EmbeddingInferenceResult' examples: EmbeddingResponseExample1: summary: Multimodal embedding task description: "An abbreviated response from `POST _inference/embedding/my-multimodal-endpoint`.\n" value: "{\n \"embeddings\": [\n {\n \"embedding\": [\n -0.0189209,\n -0.04174805,\n 0.00854492,\n 0.01556396,\n 0.01928711,\n -0.00616455,\n -0.00460815,\n 0.01477051,\n -0.00656128,\n 0.05419922\n ]\n },\n {\n \"embedding\": [\n -0.01379395,\n -0.02368164,\n 0.01068115,\n 0.0279541,\n 0.01043701,\n -7.7057E-4,\n 0.04150391,\n 0.00836182,\n -0.01135254,\n 0.0246582\n ]\n }\n ]\n}" EmbeddingResponseExample2: summary: Text-only embedding task description: "An abbreviated response from `POST _inference/embedding/my-text-only-endpoint`.\n" value: "{\n \"embeddings\": [\n {\n \"embedding\": [\n 0.00854492,\n -0.00616455,\n -0.0189209,\n 0.01556396,\n -0.00460815,\n 0.01477051,\n -0.04174805,\n 0.01928711,\n -0.00656128,\n 0.05419922\n ]\n },\n {\n \"embedding\": [\n -0.01135254,\n 0.0279541,\n -0.02368164,\n 0.01068115,\n 0.01043701,\n 0.04150391,\n 0.00836182,\n -7.7057E-4,\n -0.01379395,\n 0.0246582\n ]\n }\n ]\n}" x-state: Experimental; Added in 9.4.0 x-codeSamples: - lang: Console source: "POST _inference/embedding/my-multimodal-endpoint\n{\n \"input\": [\n {\n \"content\": {\n \"type\": \"image\",\n \"format\": \"base64\",\n \"value\": \"data:image/jpeg;base64,...\"\n }\n },\n {\n \"content\": {\n \"type\": \"text\",\n \"value\": \"Some text to create an embedding\"\n }\n }\n ]\n}" - lang: Python source: "resp = client.inference.embedding(\n inference_id=\"my-multimodal-endpoint\",\n embedding={\n \"input\": [\n {\n \"content\": {\n \"type\": \"image\",\n \"format\": \"base64\",\n \"value\": \"data:image/jpeg;base64,...\"\n }\n },\n {\n \"content\": {\n \"type\": \"text\",\n \"value\": \"Some text to create an embedding\"\n }\n }\n ]\n },\n)" - lang: JavaScript source: "const response = await client.inference.embedding({\n inference_id: \"my-multimodal-endpoint\",\n embedding: {\n input: [\n {\n content: {\n type: \"image\",\n format: \"base64\",\n value: \"data:image/jpeg;base64,...\",\n },\n },\n {\n content: {\n type: \"text\",\n value: \"Some text to create an embedding\",\n },\n },\n ],\n },\n});" - lang: Ruby source: "response = client.inference.embedding(\n inference_id: \"my-multimodal-endpoint\",\n body: {\n \"input\": [\n {\n \"content\": {\n \"type\": \"image\",\n \"format\": \"base64\",\n \"value\": \"data:image/jpeg;base64,...\"\n }\n },\n {\n \"content\": {\n \"type\": \"text\",\n \"value\": \"Some text to create an embedding\"\n }\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->inference()->embedding([\n \"inference_id\" => \"my-multimodal-endpoint\",\n \"body\" => [\n \"input\" => array(\n [\n \"content\" => [\n \"type\" => \"image\",\n \"format\" => \"base64\",\n \"value\" => \"data:image/jpeg;base64,...\",\n ],\n ],\n [\n \"content\" => [\n \"type\" => \"text\",\n \"value\" => \"Some text to create an embedding\",\n ],\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"input":[{"content":{"type":"image","format":"base64","value":"data:image/jpeg;base64,..."}},{"content":{"type":"text","value":"Some text to create an embedding"}}]}'' "$ELASTICSEARCH_URL/_inference/embedding/my-multimodal-endpoint"' - lang: Java source: "client.inference().embedding(e -> e\n .inferenceId(\"my-multimodal-endpoint\")\n .embedding(em -> em\n .input(i -> i\n .content(List.of(EmbeddingContentObject.of(emb -> emb\n .content(c -> c\n .type(EmbeddingContentType.Image)\n .format(EmbeddingContentFormat.Base64)\n .value(\"data:image/jpeg;base64,...\")\n )\n ),EmbeddingContentObject.of(emb -> emb\n .content(c -> c\n .type(EmbeddingContentType.Text)\n .value(\"Some text to create an embedding\")\n )\n )))\n )\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/chat_completion/{inference_id}': post: tags: - inference summary: Perform non-streaming chat completion inference on the service description: "The chat completion inference API enables rich responses for chat completion tasks.\nIt only works with the `chat_completion` task type.\n\nNOTE: The `chat_completion` task type supports both streaming and non-streaming.\nThe Chat completion inference API provides more comprehensive customization options through more fields and function calling support.\nTo determine whether a given inference service supports this task type, please see the page for that service.\n\nThese services support non-streaming chat completion inference:\n- AI21\n- Azure OpenAI\n- Deepseek\n- Elastic\n- FireworksAI\n- Groq\n- Huggingface\n- IBMWatsonX\n- Llama\n- Mistral\n- NVIDIA\n- OpenAI\n- OpenShiftAI\n\n## Required authorization\n\n* Cluster privileges: `monitor_inference`\n" operationId: inference-non-streaming-chat-completion parameters: - name: inference_id in: path description: The inference Id required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference request to complete. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 120s requestBody: content: application/json: schema: $ref: '#/components/schemas/inference._types.RequestChatCompletion' examples: PostChatCompletionRequestExample1: summary: A non-streaming chat completion task description: Run `POST _inference/chat_completion/openai-completion` to perform a chat completion on the example question with non-streaming. value: "{\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n}" x-codeSamples: - lang: Console source: "POST _inference/chat_completion/openai-completion\n{\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n}" - lang: Python source: "resp = client.inference.non_streaming_chat_completion(\n inference_id=\"openai-completion\",\n chat_completion_request={\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n },\n)" - lang: JavaScript source: "const response = await client.inference.nonStreamingChatCompletion({\n inference_id: \"openai-completion\",\n chat_completion_request: {\n model: \"gpt-4o\",\n messages: [\n {\n role: \"user\",\n content: \"What is Elastic?\",\n },\n ],\n },\n});" - lang: Ruby source: "response = client.inference.non_streaming_chat_completion(\n inference_id: \"openai-completion\",\n body: {\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->inference()->nonStreamingChatCompletion([\n \"inference_id\" => \"openai-completion\",\n \"body\" => [\n \"model\" => \"gpt-4o\",\n \"messages\" => array(\n [\n \"role\" => \"user\",\n \"content\" => \"What is Elastic?\",\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"model":"gpt-4o","messages":[{"role":"user","content":"What is Elastic?"}]}'' "$ELASTICSEARCH_URL/_inference/chat_completion/openai-completion"' - lang: C# source: "var response = await client.Inference\n .NonStreamingChatCompletionAsync(inferenceId: \"openai-completion\", d1 => d1\n .ChatCompletionRequest(d2 => d2\n .Messages(d3 => d3\n .Content(\"What is Elastic?\")\n .Role(\"user\")\n )\n .Model(\"gpt-4o\")\n )\n );" PostChatCompletionRequestExample2: summary: A non-streaming chat completion task with tool_calls description: Run `POST _inference/chat_completion/openai-completion` to perform a non-streaming chat completion using an Assistant message with `tool_calls`. value: "{\n \"messages\": [\n {\n \"role\": \"assistant\",\n \"content\": \"Let's find out what the weather is\",\n \"tool_calls\": [ \n {\n \"id\": \"call_KcAjWtAww20AihPHphUh46Gd\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"arguments\": \"{\\\"location\\\":\\\"Boston, MA\\\"}\"\n }\n }\n ]\n },\n { \n \"role\": \"tool\",\n \"content\": \"The weather is cold\",\n \"tool_call_id\": \"call_KcAjWtAww20AihPHphUh46Gd\"\n }\n ]\n}" x-codeSamples: - lang: Console source: "POST _inference/chat_completion/openai-completion\n{\n \"messages\": [\n {\n \"role\": \"assistant\",\n \"content\": \"Let's find out what the weather is\",\n \"tool_calls\": [ \n {\n \"id\": \"call_KcAjWtAww20AihPHphUh46Gd\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"arguments\": \"{\\\"location\\\":\\\"Boston, MA\\\"}\"\n }\n }\n ]\n },\n { \n \"role\": \"tool\",\n \"content\": \"The weather is cold\",\n \"tool_call_id\": \"call_KcAjWtAww20AihPHphUh46Gd\"\n }\n ]\n}" - lang: Python source: "resp = client.inference.non_streaming_chat_completion(\n inference_id=\"openai-completion\",\n chat_completion_request={\n \"messages\": [\n {\n \"role\": \"assistant\",\n \"content\": \"Let's find out what the weather is\",\n \"tool_calls\": [\n {\n \"id\": \"call_KcAjWtAww20AihPHphUh46Gd\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"arguments\": \"{\\\"location\\\":\\\"Boston, MA\\\"}\"\n }\n }\n ]\n },\n {\n \"role\": \"tool\",\n \"content\": \"The weather is cold\",\n \"tool_call_id\": \"call_KcAjWtAww20AihPHphUh46Gd\"\n }\n ]\n },\n)" - lang: JavaScript source: "const response = await client.inference.nonStreamingChatCompletion({\n inference_id: \"openai-completion\",\n chat_completion_request: {\n messages: [\n {\n role: \"assistant\",\n content: \"Let's find out what the weather is\",\n tool_calls: [\n {\n id: \"call_KcAjWtAww20AihPHphUh46Gd\",\n type: \"function\",\n function: {\n name: \"get_current_weather\",\n arguments: '{\"location\":\"Boston, MA\"}',\n },\n },\n ],\n },\n {\n role: \"tool\",\n content: \"The weather is cold\",\n tool_call_id: \"call_KcAjWtAww20AihPHphUh46Gd\",\n },\n ],\n },\n});" - lang: Ruby source: "response = client.inference.non_streaming_chat_completion(\n inference_id: \"openai-completion\",\n body: {\n \"messages\": [\n {\n \"role\": \"assistant\",\n \"content\": \"Let's find out what the weather is\",\n \"tool_calls\": [\n {\n \"id\": \"call_KcAjWtAww20AihPHphUh46Gd\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"arguments\": \"{\\\"location\\\":\\\"Boston, MA\\\"}\"\n }\n }\n ]\n },\n {\n \"role\": \"tool\",\n \"content\": \"The weather is cold\",\n \"tool_call_id\": \"call_KcAjWtAww20AihPHphUh46Gd\"\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->inference()->nonStreamingChatCompletion([\n \"inference_id\" => \"openai-completion\",\n \"body\" => [\n \"messages\" => array(\n [\n \"role\" => \"assistant\",\n \"content\" => \"Let's find out what the weather is\",\n \"tool_calls\" => array(\n [\n \"id\" => \"call_KcAjWtAww20AihPHphUh46Gd\",\n \"type\" => \"function\",\n \"function\" => [\n \"name\" => \"get_current_weather\",\n \"arguments\" => \"{\\\"location\\\":\\\"Boston, MA\\\"}\",\n ],\n ],\n ),\n ],\n [\n \"role\" => \"tool\",\n \"content\" => \"The weather is cold\",\n \"tool_call_id\" => \"call_KcAjWtAww20AihPHphUh46Gd\",\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"messages":[{"role":"assistant","content":"Let''"''"''s find out what the weather is","tool_calls":[{"id":"call_KcAjWtAww20AihPHphUh46Gd","type":"function","function":{"name":"get_current_weather","arguments":"{\"location\":\"Boston, MA\"}"}}]},{"role":"tool","content":"The weather is cold","tool_call_id":"call_KcAjWtAww20AihPHphUh46Gd"}]}'' "$ELASTICSEARCH_URL/_inference/chat_completion/openai-completion"' - lang: C# source: "var response = await client.Inference\n .NonStreamingChatCompletionAsync(inferenceId: \"openai-completion\", d1 => d1\n .ChatCompletionRequest(d2 => d2\n .Messages(d3 => d3\n .Content(\"Let's find out what the weather is\")\n .Role(\"assistant\")\n .ToolCalls(d4 => d4\n .Function(d5 => d5\n .Arguments(\"{\\\"location\\\":\\\"Boston, MA\\\"}\")\n .Name(\"get_current_weather\")\n )\n .Id(\"call_KcAjWtAww20AihPHphUh46Gd\")\n .Type(\"function\")\n ), d3 => d3\n .Content(\"The weather is cold\")\n .Role(\"tool\")\n .ToolCallId(\"call_KcAjWtAww20AihPHphUh46Gd\")\n )\n )\n );" PostChatCompletionRequestExample3: summary: A non-streaming chat completion task with tools and tool_calls description: Run `POST _inference/chat_completion/openai-completion` to perform a non-streaming chat completion using a User message with `tools` and `tool_choice`. value: "{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What's the price of a scarf?\"\n }\n ]\n }\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\",\n \"description\": \"Get the current price of a item\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"id\": \"123\"\n }\n }\n }\n }\n }\n ],\n \"tool_choice\": {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\"\n }\n }\n}" x-codeSamples: - lang: Console source: "POST _inference/chat_completion/openai-completion\n{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What's the price of a scarf?\"\n }\n ]\n }\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\",\n \"description\": \"Get the current price of a item\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"id\": \"123\"\n }\n }\n }\n }\n }\n ],\n \"tool_choice\": {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\"\n }\n }\n}" - lang: Python source: "resp = client.inference.non_streaming_chat_completion(\n inference_id=\"openai-completion\",\n chat_completion_request={\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What's the price of a scarf?\"\n }\n ]\n }\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\",\n \"description\": \"Get the current price of a item\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"id\": \"123\"\n }\n }\n }\n }\n }\n ],\n \"tool_choice\": {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\"\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.nonStreamingChatCompletion({\n inference_id: \"openai-completion\",\n chat_completion_request: {\n messages: [\n {\n role: \"user\",\n content: [\n {\n type: \"text\",\n text: \"What's the price of a scarf?\",\n },\n ],\n },\n ],\n tools: [\n {\n type: \"function\",\n function: {\n name: \"get_current_price\",\n description: \"Get the current price of a item\",\n parameters: {\n type: \"object\",\n properties: {\n item: {\n id: \"123\",\n },\n },\n },\n },\n },\n ],\n tool_choice: {\n type: \"function\",\n function: {\n name: \"get_current_price\",\n },\n },\n },\n});" - lang: Ruby source: "response = client.inference.non_streaming_chat_completion(\n inference_id: \"openai-completion\",\n body: {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What's the price of a scarf?\"\n }\n ]\n }\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\",\n \"description\": \"Get the current price of a item\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"id\": \"123\"\n }\n }\n }\n }\n }\n ],\n \"tool_choice\": {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->nonStreamingChatCompletion([\n \"inference_id\" => \"openai-completion\",\n \"body\" => [\n \"messages\" => array(\n [\n \"role\" => \"user\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"What's the price of a scarf?\",\n ],\n ),\n ],\n ),\n \"tools\" => array(\n [\n \"type\" => \"function\",\n \"function\" => [\n \"name\" => \"get_current_price\",\n \"description\" => \"Get the current price of a item\",\n \"parameters\" => [\n \"type\" => \"object\",\n \"properties\" => [\n \"item\" => [\n \"id\" => \"123\",\n ],\n ],\n ],\n ],\n ],\n ),\n \"tool_choice\" => [\n \"type\" => \"function\",\n \"function\" => [\n \"name\" => \"get_current_price\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"messages":[{"role":"user","content":[{"type":"text","text":"What''"''"''s the price of a scarf?"}]}],"tools":[{"type":"function","function":{"name":"get_current_price","description":"Get the current price of a item","parameters":{"type":"object","properties":{"item":{"id":"123"}}}}}],"tool_choice":{"type":"function","function":{"name":"get_current_price"}}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/openai-completion"' PostChatCompletionRequestExample4: summary: A non-streaming chat completion task with `effort` parameter defined reasoning description: 'Run `POST _inference/chat_completion/reasoning-chat-completion` to perform a non-streaming chat completion task, using both `effort` parameter based reasoning configuration and including reasoning generated by the model on previous step.' value: "{\n \"messages\": [{\n \"role\": \"user\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n }, {\n \"role\": \"assistant\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [{\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n }, {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n }, {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n }, {\n \"role\": \"user\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"effort\": \"high\",\n \"summary\": \"detailed\",\n \"exclude\": false\n }\n}" x-codeSamples: - lang: Console source: "POST _inference/chat_completion/reasoning-chat-completion\n{\n \"messages\": [{\n \"role\": \"user\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n }, {\n \"role\": \"assistant\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [{\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n }, {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n }, {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n }, {\n \"role\": \"user\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"effort\": \"high\",\n \"summary\": \"detailed\",\n \"exclude\": false\n }\n}" - lang: Python source: "resp = client.inference.non_streaming_chat_completion(\n inference_id=\"reasoning-chat-completion\",\n chat_completion_request={\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n },\n {\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [\n {\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n },\n {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n },\n {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"effort\": \"high\",\n \"summary\": \"detailed\",\n \"exclude\": False\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.nonStreamingChatCompletion({\n inference_id: \"reasoning-chat-completion\",\n chat_completion_request: {\n messages: [\n {\n role: \"user\",\n content: [\n {\n type: \"text\",\n text: \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\",\n },\n ],\n },\n {\n role: \"assistant\",\n content: [\n {\n type: \"text\",\n text: \"This is the barber paradox. Such a barber cannot logically exist.\",\n },\n ],\n reasoning:\n \"If the barber shaves himself, he should not; if he does not, he should.\",\n reasoning_details: [\n {\n type: \"reasoning.encrypted\",\n data: \"[REDACTED]\",\n },\n {\n type: \"reasoning.summary\",\n summary: \"Barber shaving himself creates contradiction\",\n },\n {\n type: \"reasoning.text\",\n text: \"If the barber shaves himself, he should not; if he does not, he should.\",\n signature: \"sig_123\",\n },\n ],\n },\n {\n role: \"user\",\n content: [\n {\n type: \"text\",\n text: \"What if there are 2 barbers?\",\n },\n ],\n },\n ],\n reasoning: {\n effort: \"high\",\n summary: \"detailed\",\n exclude: false,\n },\n },\n});" - lang: Ruby source: "response = client.inference.non_streaming_chat_completion(\n inference_id: \"reasoning-chat-completion\",\n body: {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n },\n {\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [\n {\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n },\n {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n },\n {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"effort\": \"high\",\n \"summary\": \"detailed\",\n \"exclude\": false\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->nonStreamingChatCompletion([\n \"inference_id\" => \"reasoning-chat-completion\",\n \"body\" => [\n \"messages\" => array(\n [\n \"role\" => \"user\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\",\n ],\n ),\n ],\n [\n \"role\" => \"assistant\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"This is the barber paradox. Such a barber cannot logically exist.\",\n ],\n ),\n \"reasoning\" => \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\" => array(\n [\n \"type\" => \"reasoning.encrypted\",\n \"data\" => \"[REDACTED]\",\n ],\n [\n \"type\" => \"reasoning.summary\",\n \"summary\" => \"Barber shaving himself creates contradiction\",\n ],\n [\n \"type\" => \"reasoning.text\",\n \"text\" => \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\" => \"sig_123\",\n ],\n ),\n ],\n [\n \"role\" => \"user\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"What if there are 2 barbers?\",\n ],\n ),\n ],\n ),\n \"reasoning\" => [\n \"effort\" => \"high\",\n \"summary\" => \"detailed\",\n \"exclude\" => false,\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"messages":[{"role":"user","content":[{"type":"text","text":"Barber shaves all those, who do not shave themselves. Who shaves the barber?"}]},{"role":"assistant","content":[{"type":"text","text":"This is the barber paradox. Such a barber cannot logically exist."}],"reasoning":"If the barber shaves himself, he should not; if he does not, he should.","reasoning_details":[{"type":"reasoning.encrypted","data":"[REDACTED]"},{"type":"reasoning.summary","summary":"Barber shaving himself creates contradiction"},{"type":"reasoning.text","text":"If the barber shaves himself, he should not; if he does not, he should.","signature":"sig_123"}]},{"role":"user","content":[{"type":"text","text":"What if there are 2 barbers?"}]}],"reasoning":{"effort":"high","summary":"detailed","exclude":false}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/reasoning-chat-completion"' PostChatCompletionRequestExample5: summary: A non-streaming chat completion task with `enabled` parameter defined reasoning description: 'Run `POST _inference/chat_completion/reasoning-chat-completion` to perform a non-streaming chat completion task, using both `enabled` parameter based reasoning configuration and including reasoning generated by the model on previous step.' value: "{\n \"messages\": [{\n \"role\": \"user\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n }, {\n \"role\": \"assistant\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [{\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n }, {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n }, {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n }, {\n \"role\": \"user\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"enabled\": true,\n \"summary\": \"detailed\",\n \"exclude\": false\n }\n}" x-codeSamples: - lang: Console source: "POST _inference/chat_completion/reasoning-chat-completion\n{\n \"messages\": [{\n \"role\": \"user\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n }, {\n \"role\": \"assistant\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [{\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n }, {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n }, {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n }, {\n \"role\": \"user\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"enabled\": true,\n \"summary\": \"detailed\",\n \"exclude\": false\n }\n}" - lang: Python source: "resp = client.inference.non_streaming_chat_completion(\n inference_id=\"reasoning-chat-completion\",\n chat_completion_request={\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n },\n {\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [\n {\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n },\n {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n },\n {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"enabled\": True,\n \"summary\": \"detailed\",\n \"exclude\": False\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.nonStreamingChatCompletion({\n inference_id: \"reasoning-chat-completion\",\n chat_completion_request: {\n messages: [\n {\n role: \"user\",\n content: [\n {\n type: \"text\",\n text: \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\",\n },\n ],\n },\n {\n role: \"assistant\",\n content: [\n {\n type: \"text\",\n text: \"This is the barber paradox. Such a barber cannot logically exist.\",\n },\n ],\n reasoning:\n \"If the barber shaves himself, he should not; if he does not, he should.\",\n reasoning_details: [\n {\n type: \"reasoning.encrypted\",\n data: \"[REDACTED]\",\n },\n {\n type: \"reasoning.summary\",\n summary: \"Barber shaving himself creates contradiction\",\n },\n {\n type: \"reasoning.text\",\n text: \"If the barber shaves himself, he should not; if he does not, he should.\",\n signature: \"sig_123\",\n },\n ],\n },\n {\n role: \"user\",\n content: [\n {\n type: \"text\",\n text: \"What if there are 2 barbers?\",\n },\n ],\n },\n ],\n reasoning: {\n enabled: true,\n summary: \"detailed\",\n exclude: false,\n },\n },\n});" - lang: Ruby source: "response = client.inference.non_streaming_chat_completion(\n inference_id: \"reasoning-chat-completion\",\n body: {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n },\n {\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [\n {\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n },\n {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n },\n {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"enabled\": true,\n \"summary\": \"detailed\",\n \"exclude\": false\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->nonStreamingChatCompletion([\n \"inference_id\" => \"reasoning-chat-completion\",\n \"body\" => [\n \"messages\" => array(\n [\n \"role\" => \"user\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\",\n ],\n ),\n ],\n [\n \"role\" => \"assistant\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"This is the barber paradox. Such a barber cannot logically exist.\",\n ],\n ),\n \"reasoning\" => \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\" => array(\n [\n \"type\" => \"reasoning.encrypted\",\n \"data\" => \"[REDACTED]\",\n ],\n [\n \"type\" => \"reasoning.summary\",\n \"summary\" => \"Barber shaving himself creates contradiction\",\n ],\n [\n \"type\" => \"reasoning.text\",\n \"text\" => \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\" => \"sig_123\",\n ],\n ),\n ],\n [\n \"role\" => \"user\",\n \"content\" => array(\n [\n \"type\" => \"text\",\n \"text\" => \"What if there are 2 barbers?\",\n ],\n ),\n ],\n ),\n \"reasoning\" => [\n \"enabled\" => true,\n \"summary\" => \"detailed\",\n \"exclude\" => false,\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"messages":[{"role":"user","content":[{"type":"text","text":"Barber shaves all those, who do not shave themselves. Who shaves the barber?"}]},{"role":"assistant","content":[{"type":"text","text":"This is the barber paradox. Such a barber cannot logically exist."}],"reasoning":"If the barber shaves himself, he should not; if he does not, he should.","reasoning_details":[{"type":"reasoning.encrypted","data":"[REDACTED]"},{"type":"reasoning.summary","summary":"Barber shaving himself creates contradiction"},{"type":"reasoning.text","text":"If the barber shaves himself, he should not; if he does not, he should.","signature":"sig_123"}]},{"role":"user","content":[{"type":"text","text":"What if there are 2 barbers?"}]}],"reasoning":{"enabled":true,"summary":"detailed","exclude":false}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/reasoning-chat-completion"' required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.ChatCompletionInferenceResult' examples: PostChatCompletionResponseExample1: summary: A non-streaming chat completion response description: "A successful response from `POST _inference/chat_completion/openai-completion` for a plain user message. The `object` field is `chat.completion` (as opposed to `chat.completion.chunk` in streaming responses). The `message` wrapper contains the model-generated text. Usage statistics include per-category token breakdowns when available.\n" value: "{\n \"id\": \"chatcmpl-Ae0TWsy2VPnSfBbv5UztnSdYUMFP3\",\n \"choices\": [\n {\n \"message\": {\n \"content\": \"Elastic is a company that provides a range of software solutions for search, logging, security, and analytics, built around the open-source Elasticsearch engine.\",\n \"role\": \"assistant\"\n },\n \"finish_reason\": \"stop\",\n \"index\": 0\n }\n ],\n \"model\": \"gpt-4o-2024-08-06\",\n \"object\": \"chat.completion\",\n \"usage\": {\n \"completion_tokens\": 34,\n \"prompt_tokens\": 14,\n \"total_tokens\": 48,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n }\n}" PostChatCompletionResponseExample2: summary: A non-streaming chat completion response with tool calls description: "A successful response from `POST _inference/chat_completion/openai-completion` when the model decides to call a tool. The `message` contains `tool_calls` instead of `content`, and `finish_reason` is `tool_calls`. Each tool call includes an `index`, an `id`, the function `name` and `arguments` (as a JSON string), and a `type`.\n" value: "{\n \"id\": \"chatcmpl-Ae0TWsy2VPnSfBbv5UztnSdYUMFP3\",\n \"choices\": [\n {\n \"message\": {\n \"role\": \"assistant\",\n \"tool_calls\": [\n {\n \"index\": 0,\n \"id\": \"call_KcAjWtAww20AihPHphUh46Gd\",\n \"function\": {\n \"arguments\": \"{\\\"item\\\":\\\"scarf\\\"}\",\n \"name\": \"get_current_price\"\n },\n \"type\": \"function\"\n }\n ]\n },\n \"finish_reason\": \"tool_calls\",\n \"index\": 0\n }\n ],\n \"model\": \"gpt-4o-2024-08-06\",\n \"object\": \"chat.completion\",\n \"usage\": {\n \"completion_tokens\": 19,\n \"prompt_tokens\": 135,\n \"total_tokens\": 154,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n }\n}" PostChatCompletionResponseExample3: summary: A non-streaming chat completion response with reasoning details description: "A successful response from `POST _inference/chat_completion/reasoning-chat-completion` when the model returns structured reasoning data alongside its answer. The `message` includes a `reasoning` plaintext summary and a `reasoning_details` array covering all three detail types: `reasoning.encrypted` (opaque data), `reasoning.summary` (human-readable summary), and `reasoning.text` (full reasoning text with a verification signature). Currently supported only for the `elastic` provider.\n" value: "{\n \"id\": \"chatcmpl-910TWsy2VPnSfBbv5UztnSdYUJA10\",\n \"choices\": [\n {\n \"message\": {\n \"content\": \"With two barbers, the paradox disappears — each barber can shave the other.\",\n \"role\": \"assistant\",\n \"reasoning\": \"The contradiction only arises when a single barber must decide whether to shave himself. Two barbers eliminate the self-reference.\",\n \"reasoning_details\": [\n {\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n },\n {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Two barbers can shave each other, avoiding the self-reference paradox.\"\n },\n {\n \"type\": \"reasoning.text\",\n \"text\": \"The contradiction only arises when a single barber must decide whether to shave himself. Two barbers eliminate the self-reference.\",\n \"signature\": \"sig_example\"\n }\n ]\n },\n \"finish_reason\": \"stop\",\n \"index\": 0\n }\n ],\n \"model\": \"openai-gpt-oss-120b\",\n \"object\": \"chat.completion\",\n \"usage\": {\n \"completion_tokens\": 38,\n \"prompt_tokens\": 74,\n \"total_tokens\": 112,\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 10\n }\n }\n}" x-state: Generally available; Added in 9.6.0 x-codeSamples: - lang: Console source: "POST _inference/chat_completion/openai-completion\n{\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n}" - lang: Python source: "resp = client.inference.non_streaming_chat_completion(\n inference_id=\"openai-completion\",\n chat_completion_request={\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n },\n)" - lang: JavaScript source: "const response = await client.inference.nonStreamingChatCompletion({\n inference_id: \"openai-completion\",\n chat_completion_request: {\n model: \"gpt-4o\",\n messages: [\n {\n role: \"user\",\n content: \"What is Elastic?\",\n },\n ],\n },\n});" - lang: Ruby source: "response = client.inference.non_streaming_chat_completion(\n inference_id: \"openai-completion\",\n body: {\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->inference()->nonStreamingChatCompletion([\n \"inference_id\" => \"openai-completion\",\n \"body\" => [\n \"model\" => \"gpt-4o\",\n \"messages\" => array(\n [\n \"role\" => \"user\",\n \"content\" => \"What is Elastic?\",\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"model":"gpt-4o","messages":[{"role":"user","content":"What is Elastic?"}]}'' "$ELASTICSEARCH_URL/_inference/chat_completion/openai-completion"' - lang: C# source: "var response = await client.Inference\n .NonStreamingChatCompletionAsync(inferenceId: \"openai-completion\", d1 => d1\n .ChatCompletionRequest(d2 => d2\n .Messages(d3 => d3\n .Content(\"What is Elastic?\")\n .Role(\"user\")\n )\n .Model(\"gpt-4o\")\n )\n );" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{ai21_inference_id}': put: tags: - inference summary: Create a AI21 inference endpoint description: "Create an inference endpoint to perform an inference task with the `ai21` service.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-ai21 parameters: - name: task_type in: path description: The type of the inference task that the model will perform. required: true schema: $ref: '#/components/schemas/inference._types.Ai21TaskType' - name: ai21_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: service: allOf: - $ref: '#/components/schemas/inference._types.Ai21ServiceType' description: 'The type of service supported for the specified task type. In this case, `ai21`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.Ai21ServiceSettings' description: Settings used to install the inference model. These settings are specific to the `ai21` service. examples: PutAi21RequestExample1: description: Run `PUT _inference/completion/ai21-completion` to create an AI21 inference endpoint that performs a `completion` task. value: "{\n \"service\": \"ai21\",\n \"service_settings\": {\n \"api_key\": \"ai21-api-key\",\n \"model_id\": \"jamba-large\" \n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/ai21-completion\n{\n \"service\": \"ai21\",\n \"service_settings\": {\n \"api_key\": \"ai21-api-key\",\n \"model_id\": \"jamba-large\" \n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"ai21-completion\",\n inference_config={\n \"service\": \"ai21\",\n \"service_settings\": {\n \"api_key\": \"ai21-api-key\",\n \"model_id\": \"jamba-large\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"ai21-completion\",\n inference_config: {\n service: \"ai21\",\n service_settings: {\n api_key: \"ai21-api-key\",\n model_id: \"jamba-large\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"ai21-completion\",\n body: {\n \"service\": \"ai21\",\n \"service_settings\": {\n \"api_key\": \"ai21-api-key\",\n \"model_id\": \"jamba-large\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"ai21-completion\",\n \"body\" => [\n \"service\" => \"ai21\",\n \"service_settings\" => [\n \"api_key\" => \"ai21-api-key\",\n \"model_id\" => \"jamba-large\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"ai21","service_settings":{"api_key":"ai21-api-key","model_id":"jamba-large"}}'' "$ELASTICSEARCH_URL/_inference/completion/ai21-completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"ai21-completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"ai21\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"ai21-api-key\",\n \"model_id\": \"jamba-large\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"ai21-completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"ai21\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"ai21-api-key\",\"model_id\":\"jamba-large\"}\n\"\"\"))\n )\n);\n" PutAi21RequestExample2: description: Run `PUT _inference/chat-completion/ai21-chat-completion` to create a AI21 inference endpoint that performs a `chat_completion` task. value: "{\n \"service\": \"ai21\",\n \"service_settings\": {\n \"api_key\": \"ai21-api-key\",\n \"model_id\": \"jamba-mini\" \n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/chat_completion/ai21-chat-completion\n{\n \"service\": \"ai21\",\n \"service_settings\": {\n \"api_key\": \"ai21-api-key\",\n \"model_id\": \"jamba-mini\" \n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"chat_completion\",\n inference_id=\"ai21-chat-completion\",\n inference_config={\n \"service\": \"ai21\",\n \"service_settings\": {\n \"api_key\": \"ai21-api-key\",\n \"model_id\": \"jamba-mini\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"chat_completion\",\n inference_id: \"ai21-chat-completion\",\n inference_config: {\n service: \"ai21\",\n service_settings: {\n api_key: \"ai21-api-key\",\n model_id: \"jamba-mini\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"chat_completion\",\n inference_id: \"ai21-chat-completion\",\n body: {\n \"service\": \"ai21\",\n \"service_settings\": {\n \"api_key\": \"ai21-api-key\",\n \"model_id\": \"jamba-mini\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"chat_completion\",\n \"inference_id\" => \"ai21-chat-completion\",\n \"body\" => [\n \"service\" => \"ai21\",\n \"service_settings\" => [\n \"api_key\" => \"ai21-api-key\",\n \"model_id\" => \"jamba-mini\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"ai21","service_settings":{"api_key":"ai21-api-key","model_id":"jamba-mini"}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/ai21-chat-completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"ai21-chat-completion\",\n TaskType = TaskType.ChatCompletion,\n InferenceConfig = new()\n {\n Service = \"ai21\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"ai21-api-key\",\n \"model_id\": \"jamba-mini\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"ai21-chat-completion\")\n .taskType(TaskType.ChatCompletion)\n .inferenceConfig(i -> i\n .service(\"ai21\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"ai21-api-key\",\"model_id\":\"jamba-mini\"}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoAi21' x-state: Generally available; Added in 9.2.0 x-codeSamples: - lang: Console source: "PUT _inference/completion/ai21-completion\n{\n \"service\": \"ai21\",\n \"service_settings\": {\n \"api_key\": \"ai21-api-key\",\n \"model_id\": \"jamba-large\" \n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"ai21-completion\",\n inference_config={\n \"service\": \"ai21\",\n \"service_settings\": {\n \"api_key\": \"ai21-api-key\",\n \"model_id\": \"jamba-large\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"ai21-completion\",\n inference_config: {\n service: \"ai21\",\n service_settings: {\n api_key: \"ai21-api-key\",\n model_id: \"jamba-large\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"ai21-completion\",\n body: {\n \"service\": \"ai21\",\n \"service_settings\": {\n \"api_key\": \"ai21-api-key\",\n \"model_id\": \"jamba-large\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"ai21-completion\",\n \"body\" => [\n \"service\" => \"ai21\",\n \"service_settings\" => [\n \"api_key\" => \"ai21-api-key\",\n \"model_id\" => \"jamba-large\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"ai21","service_settings":{"api_key":"ai21-api-key","model_id":"jamba-large"}}'' "$ELASTICSEARCH_URL/_inference/completion/ai21-completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"ai21-completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"ai21\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"ai21-api-key\",\n \"model_id\": \"jamba-large\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"ai21-completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"ai21\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"ai21-api-key\",\"model_id\":\"jamba-large\"}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{alibabacloud_inference_id}': put: tags: - inference summary: Create an AlibabaCloud AI Search inference endpoint description: "Create an inference endpoint to perform an inference task with the `alibabacloud-ai-search` service.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-alibabacloud parameters: - name: task_type in: path description: The type of the inference task that the model will perform. required: true schema: $ref: '#/components/schemas/inference._types.AlibabaCloudTaskType' - name: alibabacloud_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: chunking_settings: allOf: - $ref: '#/components/schemas/inference._types.InferenceChunkingSettings' description: "The chunking configuration object.\nApplies only to the `sparse_embedding` or `text_embedding` task types.\nNot applicable to the `rerank` or `completion` task types." externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config service: allOf: - $ref: '#/components/schemas/inference._types.AlibabaCloudServiceType' description: 'The type of service supported for the specified task type. In this case, `alibabacloud-ai-search`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.AlibabaCloudServiceSettings' description: Settings used to install the inference model. These settings are specific to the `alibabacloud-ai-search` service. task_settings: allOf: - $ref: '#/components/schemas/inference._types.AlibabaCloudTaskSettings' description: "Settings to configure the inference task.\nThese settings are specific to the task type you specified." examples: PutAlibabaCloudRequestExample1: summary: A completion task description: Run `PUT _inference/completion/alibabacloud_ai_search_completion` to create an inference endpoint that performs a completion task. value: "{\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"host\" : \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-qwen-turbo\",\n \"workspace\" : \"default\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/alibabacloud_ai_search_completion\n{\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"host\" : \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-qwen-turbo\",\n \"workspace\" : \"default\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"alibabacloud_ai_search_completion\",\n inference_config={\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-qwen-turbo\",\n \"workspace\": \"default\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"alibabacloud_ai_search_completion\",\n inference_config: {\n service: \"alibabacloud-ai-search\",\n service_settings: {\n host: \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n api_key: \"AlibabaCloud-API-Key\",\n service_id: \"ops-qwen-turbo\",\n workspace: \"default\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"alibabacloud_ai_search_completion\",\n body: {\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-qwen-turbo\",\n \"workspace\": \"default\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"alibabacloud_ai_search_completion\",\n \"body\" => [\n \"service\" => \"alibabacloud-ai-search\",\n \"service_settings\" => [\n \"host\" => \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"api_key\" => \"AlibabaCloud-API-Key\",\n \"service_id\" => \"ops-qwen-turbo\",\n \"workspace\" => \"default\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"alibabacloud-ai-search","service_settings":{"host":"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com","api_key":"AlibabaCloud-API-Key","service_id":"ops-qwen-turbo","workspace":"default"}}'' "$ELASTICSEARCH_URL/_inference/completion/alibabacloud_ai_search_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"alibabacloud_ai_search_completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"alibabacloud-ai-search\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-qwen-turbo\",\n \"workspace\": \"default\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"alibabacloud_ai_search_completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"alibabacloud-ai-search\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"host\":\"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\"api_key\":\"AlibabaCloud-API-Key\",\"service_id\":\"ops-qwen-turbo\",\"workspace\":\"default\"}\n\"\"\"))\n )\n);\n" PutAlibabaCloudRequestExample2: summary: A rerank task description: Run `PUT _inference/rerank/alibabacloud_ai_search_rerank` to create an inference endpoint that performs a rerank task. value: "{\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-bge-reranker-larger\",\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"workspace\": \"default\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/rerank/alibabacloud_ai_search_rerank\n{\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-bge-reranker-larger\",\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"workspace\": \"default\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"alibabacloud_ai_search_rerank\",\n inference_config={\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-bge-reranker-larger\",\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"workspace\": \"default\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"alibabacloud_ai_search_rerank\",\n inference_config: {\n service: \"alibabacloud-ai-search\",\n service_settings: {\n api_key: \"AlibabaCloud-API-Key\",\n service_id: \"ops-bge-reranker-larger\",\n host: \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n workspace: \"default\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"alibabacloud_ai_search_rerank\",\n body: {\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-bge-reranker-larger\",\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"workspace\": \"default\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"alibabacloud_ai_search_rerank\",\n \"body\" => [\n \"service\" => \"alibabacloud-ai-search\",\n \"service_settings\" => [\n \"api_key\" => \"AlibabaCloud-API-Key\",\n \"service_id\" => \"ops-bge-reranker-larger\",\n \"host\" => \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"workspace\" => \"default\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"alibabacloud-ai-search","service_settings":{"api_key":"AlibabaCloud-API-Key","service_id":"ops-bge-reranker-larger","host":"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com","workspace":"default"}}'' "$ELASTICSEARCH_URL/_inference/rerank/alibabacloud_ai_search_rerank"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"alibabacloud_ai_search_rerank\",\n TaskType = TaskType.Rerank,\n InferenceConfig = new()\n {\n Service = \"alibabacloud-ai-search\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-bge-reranker-larger\",\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"workspace\": \"default\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"alibabacloud_ai_search_rerank\")\n .taskType(TaskType.Rerank)\n .inferenceConfig(i -> i\n .service(\"alibabacloud-ai-search\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"AlibabaCloud-API-Key\",\"service_id\":\"ops-bge-reranker-larger\",\"host\":\"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\"workspace\":\"default\"}\n\"\"\"))\n )\n);\n" PutAlibabaCloudRequestExample3: summary: A sparse embedding task description: Run `PUT _inference/sparse_embedding/alibabacloud_ai_search_sparse` to create an inference endpoint that performs perform a sparse embedding task. value: "{\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-text-sparse-embedding-001\",\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"workspace\": \"default\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/sparse_embedding/alibabacloud_ai_search_sparse\n{\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-text-sparse-embedding-001\",\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"workspace\": \"default\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"sparse_embedding\",\n inference_id=\"alibabacloud_ai_search_sparse\",\n inference_config={\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-text-sparse-embedding-001\",\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"workspace\": \"default\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"sparse_embedding\",\n inference_id: \"alibabacloud_ai_search_sparse\",\n inference_config: {\n service: \"alibabacloud-ai-search\",\n service_settings: {\n api_key: \"AlibabaCloud-API-Key\",\n service_id: \"ops-text-sparse-embedding-001\",\n host: \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n workspace: \"default\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"sparse_embedding\",\n inference_id: \"alibabacloud_ai_search_sparse\",\n body: {\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-text-sparse-embedding-001\",\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"workspace\": \"default\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"alibabacloud_ai_search_sparse\",\n \"body\" => [\n \"service\" => \"alibabacloud-ai-search\",\n \"service_settings\" => [\n \"api_key\" => \"AlibabaCloud-API-Key\",\n \"service_id\" => \"ops-text-sparse-embedding-001\",\n \"host\" => \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"workspace\" => \"default\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"alibabacloud-ai-search","service_settings":{"api_key":"AlibabaCloud-API-Key","service_id":"ops-text-sparse-embedding-001","host":"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com","workspace":"default"}}'' "$ELASTICSEARCH_URL/_inference/sparse_embedding/alibabacloud_ai_search_sparse"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"alibabacloud_ai_search_sparse\",\n TaskType = TaskType.SparseEmbedding,\n InferenceConfig = new()\n {\n Service = \"alibabacloud-ai-search\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-text-sparse-embedding-001\",\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"workspace\": \"default\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"alibabacloud_ai_search_sparse\")\n .taskType(TaskType.SparseEmbedding)\n .inferenceConfig(i -> i\n .service(\"alibabacloud-ai-search\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"AlibabaCloud-API-Key\",\"service_id\":\"ops-text-sparse-embedding-001\",\"host\":\"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\"workspace\":\"default\"}\n\"\"\"))\n )\n);\n" PutAlibabaCloudRequestExample4: summary: A text embedding task description: Run `PUT _inference/text_embedding/alibabacloud_ai_search_embeddings` to create an inference endpoint that performs a text embedding task. value: "{\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-text-embedding-001\",\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"workspace\": \"default\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/alibabacloud_ai_search_embeddings\n{\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-text-embedding-001\",\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"workspace\": \"default\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"alibabacloud_ai_search_embeddings\",\n inference_config={\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-text-embedding-001\",\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"workspace\": \"default\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"alibabacloud_ai_search_embeddings\",\n inference_config: {\n service: \"alibabacloud-ai-search\",\n service_settings: {\n api_key: \"AlibabaCloud-API-Key\",\n service_id: \"ops-text-embedding-001\",\n host: \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n workspace: \"default\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"alibabacloud_ai_search_embeddings\",\n body: {\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-text-embedding-001\",\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"workspace\": \"default\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"alibabacloud_ai_search_embeddings\",\n \"body\" => [\n \"service\" => \"alibabacloud-ai-search\",\n \"service_settings\" => [\n \"api_key\" => \"AlibabaCloud-API-Key\",\n \"service_id\" => \"ops-text-embedding-001\",\n \"host\" => \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"workspace\" => \"default\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"alibabacloud-ai-search","service_settings":{"api_key":"AlibabaCloud-API-Key","service_id":"ops-text-embedding-001","host":"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com","workspace":"default"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/alibabacloud_ai_search_embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"alibabacloud_ai_search_embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"alibabacloud-ai-search\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-text-embedding-001\",\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"workspace\": \"default\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"alibabacloud_ai_search_embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"alibabacloud-ai-search\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"AlibabaCloud-API-Key\",\"service_id\":\"ops-text-embedding-001\",\"host\":\"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\"workspace\":\"default\"}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoAlibabaCloudAI' x-state: Generally available; Added in 8.16.0 x-codeSamples: - lang: Console source: "PUT _inference/completion/alibabacloud_ai_search_completion\n{\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"host\" : \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-qwen-turbo\",\n \"workspace\" : \"default\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"alibabacloud_ai_search_completion\",\n inference_config={\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-qwen-turbo\",\n \"workspace\": \"default\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"alibabacloud_ai_search_completion\",\n inference_config: {\n service: \"alibabacloud-ai-search\",\n service_settings: {\n host: \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n api_key: \"AlibabaCloud-API-Key\",\n service_id: \"ops-qwen-turbo\",\n workspace: \"default\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"alibabacloud_ai_search_completion\",\n body: {\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-qwen-turbo\",\n \"workspace\": \"default\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"alibabacloud_ai_search_completion\",\n \"body\" => [\n \"service\" => \"alibabacloud-ai-search\",\n \"service_settings\" => [\n \"host\" => \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"api_key\" => \"AlibabaCloud-API-Key\",\n \"service_id\" => \"ops-qwen-turbo\",\n \"workspace\" => \"default\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"alibabacloud-ai-search","service_settings":{"host":"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com","api_key":"AlibabaCloud-API-Key","service_id":"ops-qwen-turbo","workspace":"default"}}'' "$ELASTICSEARCH_URL/_inference/completion/alibabacloud_ai_search_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"alibabacloud_ai_search_completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"alibabacloud-ai-search\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-qwen-turbo\",\n \"workspace\": \"default\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"alibabacloud_ai_search_completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"alibabacloud-ai-search\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"host\":\"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\"api_key\":\"AlibabaCloud-API-Key\",\"service_id\":\"ops-qwen-turbo\",\"workspace\":\"default\"}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{amazonbedrock_inference_id}': put: tags: - inference summary: Create an Amazon Bedrock inference endpoint description: "Create an inference endpoint to perform an inference task with the `amazonbedrock` service.\n\n>info\n> You need to provide the access and secret keys only once, during the inference model creation. The get inference API does not retrieve your access or secret keys. After creating the inference model, you cannot change the associated key pairs. If you want to use a different access and secret key pair, delete the inference model and recreate it with the same name and the updated keys.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-amazonbedrock parameters: - name: task_type in: path description: The type of the inference task that the model will perform. required: true schema: $ref: '#/components/schemas/inference._types.AmazonBedrockTaskType' - name: amazonbedrock_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: chunking_settings: allOf: - $ref: '#/components/schemas/inference._types.InferenceChunkingSettings' description: "The chunking configuration object.\nApplies only to the `text_embedding` task type.\nNot applicable to the `chat_completion` and `completion` task types." externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config service: allOf: - $ref: '#/components/schemas/inference._types.AmazonBedrockServiceType' description: 'The type of service supported for the specified task type. In this case, `amazonbedrock`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.AmazonBedrockServiceSettings' description: Settings used to install the inference model. These settings are specific to the `amazonbedrock` service. task_settings: allOf: - $ref: '#/components/schemas/inference._types.AmazonBedrockTaskSettings' description: "Settings to configure the inference task.\nThese settings are specific to the task type you specified." examples: PutAmazonBedrockRequestExample1: summary: A text embedding task description: Run `PUT _inference/text_embedding/amazon_bedrock_embeddings` to create an inference endpoint that performs a text embedding task. value: "{\n \"service\": \"amazonbedrock\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-embed-text-v2:0\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/amazon_bedrock_embeddings\n{\n \"service\": \"amazonbedrock\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-embed-text-v2:0\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"amazon_bedrock_embeddings\",\n inference_config={\n \"service\": \"amazonbedrock\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-embed-text-v2:0\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"amazon_bedrock_embeddings\",\n inference_config: {\n service: \"amazonbedrock\",\n service_settings: {\n access_key: \"AWS-access-key\",\n secret_key: \"AWS-secret-key\",\n region: \"us-east-1\",\n provider: \"amazontitan\",\n model: \"amazon.titan-embed-text-v2:0\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"amazon_bedrock_embeddings\",\n body: {\n \"service\": \"amazonbedrock\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-embed-text-v2:0\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"amazon_bedrock_embeddings\",\n \"body\" => [\n \"service\" => \"amazonbedrock\",\n \"service_settings\" => [\n \"access_key\" => \"AWS-access-key\",\n \"secret_key\" => \"AWS-secret-key\",\n \"region\" => \"us-east-1\",\n \"provider\" => \"amazontitan\",\n \"model\" => \"amazon.titan-embed-text-v2:0\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"amazonbedrock","service_settings":{"access_key":"AWS-access-key","secret_key":"AWS-secret-key","region":"us-east-1","provider":"amazontitan","model":"amazon.titan-embed-text-v2:0"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/amazon_bedrock_embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"amazon_bedrock_embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"amazonbedrock\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-embed-text-v2:0\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"amazon_bedrock_embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"amazonbedrock\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"access_key\":\"AWS-access-key\",\"secret_key\":\"AWS-secret-key\",\"region\":\"us-east-1\",\"provider\":\"amazontitan\",\"model\":\"amazon.titan-embed-text-v2:0\"}\n\"\"\"))\n )\n);\n" PutAmazonBedrockRequestExample2: summary: A completion task description: Run `PUT _inference/completion/amazon_bedrock_completion` to create an inference endpoint to perform a completion task. value: "{\n \"service\": \"amazonbedrock\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-text-premier-v1:0\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/amazon_bedrock_completion\n{\n \"service\": \"amazonbedrock\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-text-premier-v1:0\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"amazon_bedrock_completion\",\n inference_config={\n \"service\": \"amazonbedrock\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-text-premier-v1:0\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"amazon_bedrock_completion\",\n inference_config: {\n service: \"amazonbedrock\",\n service_settings: {\n access_key: \"AWS-access-key\",\n secret_key: \"AWS-secret-key\",\n region: \"us-east-1\",\n provider: \"amazontitan\",\n model: \"amazon.titan-text-premier-v1:0\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"amazon_bedrock_completion\",\n body: {\n \"service\": \"amazonbedrock\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-text-premier-v1:0\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"amazon_bedrock_completion\",\n \"body\" => [\n \"service\" => \"amazonbedrock\",\n \"service_settings\" => [\n \"access_key\" => \"AWS-access-key\",\n \"secret_key\" => \"AWS-secret-key\",\n \"region\" => \"us-east-1\",\n \"provider\" => \"amazontitan\",\n \"model\" => \"amazon.titan-text-premier-v1:0\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"amazonbedrock","service_settings":{"access_key":"AWS-access-key","secret_key":"AWS-secret-key","region":"us-east-1","provider":"amazontitan","model":"amazon.titan-text-premier-v1:0"}}'' "$ELASTICSEARCH_URL/_inference/completion/amazon_bedrock_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"amazon_bedrock_completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"amazonbedrock\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-text-premier-v1:0\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"amazon_bedrock_completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"amazonbedrock\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"access_key\":\"AWS-access-key\",\"secret_key\":\"AWS-secret-key\",\"region\":\"us-east-1\",\"provider\":\"amazontitan\",\"model\":\"amazon.titan-text-premier-v1:0\"}\n\"\"\"))\n )\n);\n" PutAmazonBedrockRequestExample3: summary: A chat completion task description: Run `PUT _inference/chat_completion/amazon_bedrock_chat_completion` to create an inference endpoint to perform a chat completion task. value: "{\n \"service\": \"amazonbedrock\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-text-premier-v1:0\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/chat_completion/amazon_bedrock_chat_completion\n{\n \"service\": \"amazonbedrock\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-text-premier-v1:0\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"chat_completion\",\n inference_id=\"amazon_bedrock_chat_completion\",\n inference_config={\n \"service\": \"amazonbedrock\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-text-premier-v1:0\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"chat_completion\",\n inference_id: \"amazon_bedrock_chat_completion\",\n inference_config: {\n service: \"amazonbedrock\",\n service_settings: {\n access_key: \"AWS-access-key\",\n secret_key: \"AWS-secret-key\",\n region: \"us-east-1\",\n provider: \"amazontitan\",\n model: \"amazon.titan-text-premier-v1:0\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"chat_completion\",\n inference_id: \"amazon_bedrock_chat_completion\",\n body: {\n \"service\": \"amazonbedrock\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-text-premier-v1:0\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"chat_completion\",\n \"inference_id\" => \"amazon_bedrock_chat_completion\",\n \"body\" => [\n \"service\" => \"amazonbedrock\",\n \"service_settings\" => [\n \"access_key\" => \"AWS-access-key\",\n \"secret_key\" => \"AWS-secret-key\",\n \"region\" => \"us-east-1\",\n \"provider\" => \"amazontitan\",\n \"model\" => \"amazon.titan-text-premier-v1:0\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"amazonbedrock","service_settings":{"access_key":"AWS-access-key","secret_key":"AWS-secret-key","region":"us-east-1","provider":"amazontitan","model":"amazon.titan-text-premier-v1:0"}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/amazon_bedrock_chat_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"amazon_bedrock_chat_completion\",\n TaskType = TaskType.ChatCompletion,\n InferenceConfig = new()\n {\n Service = \"amazonbedrock\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-text-premier-v1:0\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"amazon_bedrock_chat_completion\")\n .taskType(TaskType.ChatCompletion)\n .inferenceConfig(i -> i\n .service(\"amazonbedrock\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"access_key\":\"AWS-access-key\",\"secret_key\":\"AWS-secret-key\",\"region\":\"us-east-1\",\"provider\":\"amazontitan\",\"model\":\"amazon.titan-text-premier-v1:0\"}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoAmazonBedrock' x-state: Generally available; Added in 8.12.0 x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/amazon_bedrock_embeddings\n{\n \"service\": \"amazonbedrock\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-embed-text-v2:0\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"amazon_bedrock_embeddings\",\n inference_config={\n \"service\": \"amazonbedrock\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-embed-text-v2:0\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"amazon_bedrock_embeddings\",\n inference_config: {\n service: \"amazonbedrock\",\n service_settings: {\n access_key: \"AWS-access-key\",\n secret_key: \"AWS-secret-key\",\n region: \"us-east-1\",\n provider: \"amazontitan\",\n model: \"amazon.titan-embed-text-v2:0\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"amazon_bedrock_embeddings\",\n body: {\n \"service\": \"amazonbedrock\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-embed-text-v2:0\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"amazon_bedrock_embeddings\",\n \"body\" => [\n \"service\" => \"amazonbedrock\",\n \"service_settings\" => [\n \"access_key\" => \"AWS-access-key\",\n \"secret_key\" => \"AWS-secret-key\",\n \"region\" => \"us-east-1\",\n \"provider\" => \"amazontitan\",\n \"model\" => \"amazon.titan-embed-text-v2:0\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"amazonbedrock","service_settings":{"access_key":"AWS-access-key","secret_key":"AWS-secret-key","region":"us-east-1","provider":"amazontitan","model":"amazon.titan-embed-text-v2:0"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/amazon_bedrock_embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"amazon_bedrock_embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"amazonbedrock\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-embed-text-v2:0\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"amazon_bedrock_embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"amazonbedrock\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"access_key\":\"AWS-access-key\",\"secret_key\":\"AWS-secret-key\",\"region\":\"us-east-1\",\"provider\":\"amazontitan\",\"model\":\"amazon.titan-embed-text-v2:0\"}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{amazonsagemaker_inference_id}': put: tags: - inference summary: Create an Amazon SageMaker inference endpoint description: "Create an inference endpoint to perform an inference task with the `amazon_sagemaker` service.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-amazonsagemaker parameters: - name: task_type in: path description: The type of the inference task that the model will perform. required: true schema: $ref: '#/components/schemas/inference._types.TaskTypeAmazonSageMaker' - name: amazonsagemaker_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: chunking_settings: allOf: - $ref: '#/components/schemas/inference._types.InferenceChunkingSettings' description: "The chunking configuration object.\nApplies only to the `sparse_embedding` or `text_embedding` task types.\nNot applicable to the `rerank`, `completion`, or `chat_completion` task types." externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config service: allOf: - $ref: '#/components/schemas/inference._types.AmazonSageMakerServiceType' description: 'The type of service supported for the specified task type. In this case, `amazon_sagemaker`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.AmazonSageMakerServiceSettings' description: "Settings used to install the inference model.\nThese settings are specific to the `amazon_sagemaker` service and `service_settings.api` you specified." task_settings: allOf: - $ref: '#/components/schemas/inference._types.AmazonSageMakerTaskSettings' description: "Settings to configure the inference task.\nThese settings are specific to the task type and `service_settings.api` you specified." examples: PutAmazonSageMakerRequestExample1: summary: A text embedding task description: Run `PUT _inference/text_embedding/amazon_sagemaker_embeddings` to create an inference endpoint that performs a text embedding task. value: "{\n \"service\": \"amazon_sagemaker\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\",\n \"dimensions\": 384,\n \"element_type\": \"float\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/amazon_sagemaker_embeddings\n{\n \"service\": \"amazon_sagemaker\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\",\n \"dimensions\": 384,\n \"element_type\": \"float\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"amazon_sagemaker_embeddings\",\n inference_config={\n \"service\": \"amazon_sagemaker\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\",\n \"dimensions\": 384,\n \"element_type\": \"float\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"amazon_sagemaker_embeddings\",\n inference_config: {\n service: \"amazon_sagemaker\",\n service_settings: {\n access_key: \"AWS-access-key\",\n secret_key: \"AWS-secret-key\",\n region: \"us-east-1\",\n api: \"elastic\",\n endpoint_name: \"my-endpoint\",\n dimensions: 384,\n element_type: \"float\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"amazon_sagemaker_embeddings\",\n body: {\n \"service\": \"amazon_sagemaker\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\",\n \"dimensions\": 384,\n \"element_type\": \"float\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"amazon_sagemaker_embeddings\",\n \"body\" => [\n \"service\" => \"amazon_sagemaker\",\n \"service_settings\" => [\n \"access_key\" => \"AWS-access-key\",\n \"secret_key\" => \"AWS-secret-key\",\n \"region\" => \"us-east-1\",\n \"api\" => \"elastic\",\n \"endpoint_name\" => \"my-endpoint\",\n \"dimensions\" => 384,\n \"element_type\" => \"float\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"amazon_sagemaker","service_settings":{"access_key":"AWS-access-key","secret_key":"AWS-secret-key","region":"us-east-1","api":"elastic","endpoint_name":"my-endpoint","dimensions":384,"element_type":"float"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/amazon_sagemaker_embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"amazon_sagemaker_embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"amazon_sagemaker\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\",\n \"dimensions\": 384,\n \"element_type\": \"float\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"amazon_sagemaker_embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"amazon_sagemaker\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"access_key\":\"AWS-access-key\",\"secret_key\":\"AWS-secret-key\",\"region\":\"us-east-1\",\"api\":\"elastic\",\"endpoint_name\":\"my-endpoint\",\"dimensions\":384,\"element_type\":\"float\"}\n\"\"\"))\n )\n);\n" PutAmazonSageMakerRequestExample2: summary: A completion task description: Run `PUT _inference/completion/amazon_sagemaker_completion` to create an inference endpoint that performs a completion task. value: "{\n \"service\": \"amazon_sagemaker\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/amazon_sagemaker_completion\n{\n \"service\": \"amazon_sagemaker\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"amazon_sagemaker_completion\",\n inference_config={\n \"service\": \"amazon_sagemaker\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"amazon_sagemaker_completion\",\n inference_config: {\n service: \"amazon_sagemaker\",\n service_settings: {\n access_key: \"AWS-access-key\",\n secret_key: \"AWS-secret-key\",\n region: \"us-east-1\",\n api: \"elastic\",\n endpoint_name: \"my-endpoint\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"amazon_sagemaker_completion\",\n body: {\n \"service\": \"amazon_sagemaker\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"amazon_sagemaker_completion\",\n \"body\" => [\n \"service\" => \"amazon_sagemaker\",\n \"service_settings\" => [\n \"access_key\" => \"AWS-access-key\",\n \"secret_key\" => \"AWS-secret-key\",\n \"region\" => \"us-east-1\",\n \"api\" => \"elastic\",\n \"endpoint_name\" => \"my-endpoint\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"amazon_sagemaker","service_settings":{"access_key":"AWS-access-key","secret_key":"AWS-secret-key","region":"us-east-1","api":"elastic","endpoint_name":"my-endpoint"}}'' "$ELASTICSEARCH_URL/_inference/completion/amazon_sagemaker_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"amazon_sagemaker_completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"amazon_sagemaker\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"amazon_sagemaker_completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"amazon_sagemaker\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"access_key\":\"AWS-access-key\",\"secret_key\":\"AWS-secret-key\",\"region\":\"us-east-1\",\"api\":\"elastic\",\"endpoint_name\":\"my-endpoint\"}\n\"\"\"))\n )\n);\n" PutAmazonSageMakerRequestExample3: summary: A chat completion task description: Run `PUT _inference/chat_completion/amazon_sagemaker_chat_completion` to create an inference endpoint that performs a chat completion task. value: "{\n \"service\": \"amazon_sagemaker\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/chat_completion/amazon_sagemaker_chat_completion\n{\n \"service\": \"amazon_sagemaker\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"chat_completion\",\n inference_id=\"amazon_sagemaker_chat_completion\",\n inference_config={\n \"service\": \"amazon_sagemaker\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"chat_completion\",\n inference_id: \"amazon_sagemaker_chat_completion\",\n inference_config: {\n service: \"amazon_sagemaker\",\n service_settings: {\n access_key: \"AWS-access-key\",\n secret_key: \"AWS-secret-key\",\n region: \"us-east-1\",\n api: \"elastic\",\n endpoint_name: \"my-endpoint\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"chat_completion\",\n inference_id: \"amazon_sagemaker_chat_completion\",\n body: {\n \"service\": \"amazon_sagemaker\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"chat_completion\",\n \"inference_id\" => \"amazon_sagemaker_chat_completion\",\n \"body\" => [\n \"service\" => \"amazon_sagemaker\",\n \"service_settings\" => [\n \"access_key\" => \"AWS-access-key\",\n \"secret_key\" => \"AWS-secret-key\",\n \"region\" => \"us-east-1\",\n \"api\" => \"elastic\",\n \"endpoint_name\" => \"my-endpoint\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"amazon_sagemaker","service_settings":{"access_key":"AWS-access-key","secret_key":"AWS-secret-key","region":"us-east-1","api":"elastic","endpoint_name":"my-endpoint"}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/amazon_sagemaker_chat_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"amazon_sagemaker_chat_completion\",\n TaskType = TaskType.ChatCompletion,\n InferenceConfig = new()\n {\n Service = \"amazon_sagemaker\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"amazon_sagemaker_chat_completion\")\n .taskType(TaskType.ChatCompletion)\n .inferenceConfig(i -> i\n .service(\"amazon_sagemaker\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"access_key\":\"AWS-access-key\",\"secret_key\":\"AWS-secret-key\",\"region\":\"us-east-1\",\"api\":\"elastic\",\"endpoint_name\":\"my-endpoint\"}\n\"\"\"))\n )\n);\n" PutAmazonSageMakerRequestExample4: summary: A sparse embedding task description: Run `PUT _inference/sparse_embedding/amazon_sagemaker_sparse_embedding` to create an inference endpoint that performs a sparse embedding task. value: "{\n \"service\": \"amazon_sagemaker\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/sparse_embedding/amazon_sagemaker_sparse_embedding\n{\n \"service\": \"amazon_sagemaker\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"sparse_embedding\",\n inference_id=\"amazon_sagemaker_sparse_embedding\",\n inference_config={\n \"service\": \"amazon_sagemaker\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"sparse_embedding\",\n inference_id: \"amazon_sagemaker_sparse_embedding\",\n inference_config: {\n service: \"amazon_sagemaker\",\n service_settings: {\n access_key: \"AWS-access-key\",\n secret_key: \"AWS-secret-key\",\n region: \"us-east-1\",\n api: \"elastic\",\n endpoint_name: \"my-endpoint\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"sparse_embedding\",\n inference_id: \"amazon_sagemaker_sparse_embedding\",\n body: {\n \"service\": \"amazon_sagemaker\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"amazon_sagemaker_sparse_embedding\",\n \"body\" => [\n \"service\" => \"amazon_sagemaker\",\n \"service_settings\" => [\n \"access_key\" => \"AWS-access-key\",\n \"secret_key\" => \"AWS-secret-key\",\n \"region\" => \"us-east-1\",\n \"api\" => \"elastic\",\n \"endpoint_name\" => \"my-endpoint\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"amazon_sagemaker","service_settings":{"access_key":"AWS-access-key","secret_key":"AWS-secret-key","region":"us-east-1","api":"elastic","endpoint_name":"my-endpoint"}}'' "$ELASTICSEARCH_URL/_inference/sparse_embedding/amazon_sagemaker_sparse_embedding"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"amazon_sagemaker_sparse_embedding\",\n TaskType = TaskType.SparseEmbedding,\n InferenceConfig = new()\n {\n Service = \"amazon_sagemaker\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"amazon_sagemaker_sparse_embedding\")\n .taskType(TaskType.SparseEmbedding)\n .inferenceConfig(i -> i\n .service(\"amazon_sagemaker\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"access_key\":\"AWS-access-key\",\"secret_key\":\"AWS-secret-key\",\"region\":\"us-east-1\",\"api\":\"elastic\",\"endpoint_name\":\"my-endpoint\"}\n\"\"\"))\n )\n);\n" PutAmazonSageMakerRequestExample5: summary: A rerank task description: Run `PUT _inference/rerank/amazon_sagemaker_rerank` to create an inference endpoint that performs a rerank task. value: "{\n \"service\": \"amazon_sagemaker\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/rerank/amazon_sagemaker_rerank\n{\n \"service\": \"amazon_sagemaker\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"amazon_sagemaker_rerank\",\n inference_config={\n \"service\": \"amazon_sagemaker\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"amazon_sagemaker_rerank\",\n inference_config: {\n service: \"amazon_sagemaker\",\n service_settings: {\n access_key: \"AWS-access-key\",\n secret_key: \"AWS-secret-key\",\n region: \"us-east-1\",\n api: \"elastic\",\n endpoint_name: \"my-endpoint\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"amazon_sagemaker_rerank\",\n body: {\n \"service\": \"amazon_sagemaker\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"amazon_sagemaker_rerank\",\n \"body\" => [\n \"service\" => \"amazon_sagemaker\",\n \"service_settings\" => [\n \"access_key\" => \"AWS-access-key\",\n \"secret_key\" => \"AWS-secret-key\",\n \"region\" => \"us-east-1\",\n \"api\" => \"elastic\",\n \"endpoint_name\" => \"my-endpoint\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"amazon_sagemaker","service_settings":{"access_key":"AWS-access-key","secret_key":"AWS-secret-key","region":"us-east-1","api":"elastic","endpoint_name":"my-endpoint"}}'' "$ELASTICSEARCH_URL/_inference/rerank/amazon_sagemaker_rerank"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"amazon_sagemaker_rerank\",\n TaskType = TaskType.Rerank,\n InferenceConfig = new()\n {\n Service = \"amazon_sagemaker\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"amazon_sagemaker_rerank\")\n .taskType(TaskType.Rerank)\n .inferenceConfig(i -> i\n .service(\"amazon_sagemaker\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"access_key\":\"AWS-access-key\",\"secret_key\":\"AWS-secret-key\",\"region\":\"us-east-1\",\"api\":\"elastic\",\"endpoint_name\":\"my-endpoint\"}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoAmazonSageMaker' x-state: Generally available; Added in 9.1.0 x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/amazon_sagemaker_embeddings\n{\n \"service\": \"amazon_sagemaker\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\",\n \"dimensions\": 384,\n \"element_type\": \"float\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"amazon_sagemaker_embeddings\",\n inference_config={\n \"service\": \"amazon_sagemaker\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\",\n \"dimensions\": 384,\n \"element_type\": \"float\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"amazon_sagemaker_embeddings\",\n inference_config: {\n service: \"amazon_sagemaker\",\n service_settings: {\n access_key: \"AWS-access-key\",\n secret_key: \"AWS-secret-key\",\n region: \"us-east-1\",\n api: \"elastic\",\n endpoint_name: \"my-endpoint\",\n dimensions: 384,\n element_type: \"float\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"amazon_sagemaker_embeddings\",\n body: {\n \"service\": \"amazon_sagemaker\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\",\n \"dimensions\": 384,\n \"element_type\": \"float\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"amazon_sagemaker_embeddings\",\n \"body\" => [\n \"service\" => \"amazon_sagemaker\",\n \"service_settings\" => [\n \"access_key\" => \"AWS-access-key\",\n \"secret_key\" => \"AWS-secret-key\",\n \"region\" => \"us-east-1\",\n \"api\" => \"elastic\",\n \"endpoint_name\" => \"my-endpoint\",\n \"dimensions\" => 384,\n \"element_type\" => \"float\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"amazon_sagemaker","service_settings":{"access_key":"AWS-access-key","secret_key":"AWS-secret-key","region":"us-east-1","api":"elastic","endpoint_name":"my-endpoint","dimensions":384,"element_type":"float"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/amazon_sagemaker_embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"amazon_sagemaker_embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"amazon_sagemaker\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"api\": \"elastic\",\n \"endpoint_name\": \"my-endpoint\",\n \"dimensions\": 384,\n \"element_type\": \"float\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"amazon_sagemaker_embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"amazon_sagemaker\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"access_key\":\"AWS-access-key\",\"secret_key\":\"AWS-secret-key\",\"region\":\"us-east-1\",\"api\":\"elastic\",\"endpoint_name\":\"my-endpoint\",\"dimensions\":384,\"element_type\":\"float\"}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{anthropic_inference_id}': put: tags: - inference summary: Create an Anthropic inference endpoint description: "Create an inference endpoint to perform an inference task with the `anthropic` service.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-anthropic parameters: - name: task_type in: path description: "The task type.\nThe valid task types for the model to perform are `completion` and `chat_completion`.\nNOTE: The `chat_completion` task type only supports streaming and only through the _stream API." required: true schema: $ref: '#/components/schemas/inference._types.AnthropicTaskType' - name: anthropic_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: service: allOf: - $ref: '#/components/schemas/inference._types.AnthropicServiceType' description: 'The type of service supported for the specified task type. In this case, `anthropic`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.AnthropicServiceSettings' description: Settings used to install the inference model. These settings are specific to the `anthropic` service. task_settings: allOf: - $ref: '#/components/schemas/inference._types.AnthropicTaskSettings' description: "Settings to configure the inference task.\nThese settings are specific to the task type you specified." examples: PutAnthropicChatCompletionRequestExample1: description: Run `PUT _inference/chat_completion/anthropic_chat_completion` to create an inference endpoint that performs a chat completion task. value: "{\n \"service\": \"anthropic\",\n \"service_settings\": {\n \"api_key\": \"Anthropic-Api-Key\",\n \"model_id\": \"claude-sonnet-4-5\"\n },\n \"task_settings\": {\n \"max_tokens\": 1024\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/chat_completion/anthropic_chat_completion\n{\n \"service\": \"anthropic\",\n \"service_settings\": {\n \"api_key\": \"Anthropic-Api-Key\",\n \"model_id\": \"claude-sonnet-4-5\"\n },\n \"task_settings\": {\n \"max_tokens\": 1024\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"chat_completion\",\n inference_id=\"anthropic_chat_completion\",\n inference_config={\n \"service\": \"anthropic\",\n \"service_settings\": {\n \"api_key\": \"Anthropic-Api-Key\",\n \"model_id\": \"claude-sonnet-4-5\"\n },\n \"task_settings\": {\n \"max_tokens\": 1024\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"chat_completion\",\n inference_id: \"anthropic_chat_completion\",\n inference_config: {\n service: \"anthropic\",\n service_settings: {\n api_key: \"Anthropic-Api-Key\",\n model_id: \"claude-sonnet-4-5\",\n },\n task_settings: {\n max_tokens: 1024,\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"chat_completion\",\n inference_id: \"anthropic_chat_completion\",\n body: {\n \"service\": \"anthropic\",\n \"service_settings\": {\n \"api_key\": \"Anthropic-Api-Key\",\n \"model_id\": \"claude-sonnet-4-5\"\n },\n \"task_settings\": {\n \"max_tokens\": 1024\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"chat_completion\",\n \"inference_id\" => \"anthropic_chat_completion\",\n \"body\" => [\n \"service\" => \"anthropic\",\n \"service_settings\" => [\n \"api_key\" => \"Anthropic-Api-Key\",\n \"model_id\" => \"claude-sonnet-4-5\",\n ],\n \"task_settings\" => [\n \"max_tokens\" => 1024,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"anthropic","service_settings":{"api_key":"Anthropic-Api-Key","model_id":"claude-sonnet-4-5"},"task_settings":{"max_tokens":1024}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/anthropic_chat_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"anthropic_chat_completion\",\n TaskType = TaskType.ChatCompletion,\n InferenceConfig = new()\n {\n Service = \"anthropic\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"Anthropic-Api-Key\",\n \"model_id\": \"claude-sonnet-4-5\"\n }\n \"\"\"),\n TaskSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"max_tokens\": 1024\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"anthropic_chat_completion\")\n .taskType(TaskType.ChatCompletion)\n .inferenceConfig(i -> i\n .service(\"anthropic\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"Anthropic-Api-Key\",\"model_id\":\"claude-sonnet-4-5\"}\n\"\"\"))\n .taskSettings(JsonData.fromJson(\"\"\"\n{\"max_tokens\":1024}\n\"\"\"))\n )\n);\n" PutAnthropicRequestExample1: description: Run `PUT _inference/completion/anthropic_completion` to create an inference endpoint that performs a completion task. value: "{\n \"service\": \"anthropic\",\n \"service_settings\": {\n \"api_key\": \"Anthropic-Api-Key\",\n \"model_id\": \"Model-ID\"\n },\n \"task_settings\": {\n \"max_tokens\": 1024\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/anthropic_completion\n{\n \"service\": \"anthropic\",\n \"service_settings\": {\n \"api_key\": \"Anthropic-Api-Key\",\n \"model_id\": \"Model-ID\"\n },\n \"task_settings\": {\n \"max_tokens\": 1024\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"anthropic_completion\",\n inference_config={\n \"service\": \"anthropic\",\n \"service_settings\": {\n \"api_key\": \"Anthropic-Api-Key\",\n \"model_id\": \"Model-ID\"\n },\n \"task_settings\": {\n \"max_tokens\": 1024\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"anthropic_completion\",\n inference_config: {\n service: \"anthropic\",\n service_settings: {\n api_key: \"Anthropic-Api-Key\",\n model_id: \"Model-ID\",\n },\n task_settings: {\n max_tokens: 1024,\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"anthropic_completion\",\n body: {\n \"service\": \"anthropic\",\n \"service_settings\": {\n \"api_key\": \"Anthropic-Api-Key\",\n \"model_id\": \"Model-ID\"\n },\n \"task_settings\": {\n \"max_tokens\": 1024\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"anthropic_completion\",\n \"body\" => [\n \"service\" => \"anthropic\",\n \"service_settings\" => [\n \"api_key\" => \"Anthropic-Api-Key\",\n \"model_id\" => \"Model-ID\",\n ],\n \"task_settings\" => [\n \"max_tokens\" => 1024,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"anthropic","service_settings":{"api_key":"Anthropic-Api-Key","model_id":"Model-ID"},"task_settings":{"max_tokens":1024}}'' "$ELASTICSEARCH_URL/_inference/completion/anthropic_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"anthropic_completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"anthropic\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"Anthropic-Api-Key\",\n \"model_id\": \"Model-ID\"\n }\n \"\"\"),\n TaskSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"max_tokens\": 1024\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"anthropic_completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"anthropic\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"Anthropic-Api-Key\",\"model_id\":\"Model-ID\"}\n\"\"\"))\n .taskSettings(JsonData.fromJson(\"\"\"\n{\"max_tokens\":1024}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoAnthropic' x-state: Generally available; Added in 8.16.0 x-codeSamples: - lang: Console source: "PUT _inference/chat_completion/anthropic_chat_completion\n{\n \"service\": \"anthropic\",\n \"service_settings\": {\n \"api_key\": \"Anthropic-Api-Key\",\n \"model_id\": \"claude-sonnet-4-5\"\n },\n \"task_settings\": {\n \"max_tokens\": 1024\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"chat_completion\",\n inference_id=\"anthropic_chat_completion\",\n inference_config={\n \"service\": \"anthropic\",\n \"service_settings\": {\n \"api_key\": \"Anthropic-Api-Key\",\n \"model_id\": \"claude-sonnet-4-5\"\n },\n \"task_settings\": {\n \"max_tokens\": 1024\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"chat_completion\",\n inference_id: \"anthropic_chat_completion\",\n inference_config: {\n service: \"anthropic\",\n service_settings: {\n api_key: \"Anthropic-Api-Key\",\n model_id: \"claude-sonnet-4-5\",\n },\n task_settings: {\n max_tokens: 1024,\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"chat_completion\",\n inference_id: \"anthropic_chat_completion\",\n body: {\n \"service\": \"anthropic\",\n \"service_settings\": {\n \"api_key\": \"Anthropic-Api-Key\",\n \"model_id\": \"claude-sonnet-4-5\"\n },\n \"task_settings\": {\n \"max_tokens\": 1024\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"chat_completion\",\n \"inference_id\" => \"anthropic_chat_completion\",\n \"body\" => [\n \"service\" => \"anthropic\",\n \"service_settings\" => [\n \"api_key\" => \"Anthropic-Api-Key\",\n \"model_id\" => \"claude-sonnet-4-5\",\n ],\n \"task_settings\" => [\n \"max_tokens\" => 1024,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"anthropic","service_settings":{"api_key":"Anthropic-Api-Key","model_id":"claude-sonnet-4-5"},"task_settings":{"max_tokens":1024}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/anthropic_chat_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"anthropic_chat_completion\",\n TaskType = TaskType.ChatCompletion,\n InferenceConfig = new()\n {\n Service = \"anthropic\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"Anthropic-Api-Key\",\n \"model_id\": \"claude-sonnet-4-5\"\n }\n \"\"\"),\n TaskSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"max_tokens\": 1024\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"anthropic_chat_completion\")\n .taskType(TaskType.ChatCompletion)\n .inferenceConfig(i -> i\n .service(\"anthropic\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"Anthropic-Api-Key\",\"model_id\":\"claude-sonnet-4-5\"}\n\"\"\"))\n .taskSettings(JsonData.fromJson(\"\"\"\n{\"max_tokens\":1024}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{azureaistudio_inference_id}': put: tags: - inference summary: Create an Azure AI studio inference endpoint description: "Create an inference endpoint to perform an inference task with the `azureaistudio` service.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-azureaistudio parameters: - name: task_type in: path description: The type of the inference task that the model will perform. required: true schema: $ref: '#/components/schemas/inference._types.AzureAiStudioTaskType' - name: azureaistudio_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: chunking_settings: allOf: - $ref: '#/components/schemas/inference._types.InferenceChunkingSettings' description: "The chunking configuration object.\nApplies only to the `text_embedding` task type.\nNot applicable to the `rerank` or `completion` task types." externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config service: allOf: - $ref: '#/components/schemas/inference._types.AzureAiStudioServiceType' description: 'The type of service supported for the specified task type. In this case, `azureaistudio`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.AzureAiStudioServiceSettings' description: Settings used to install the inference model. These settings are specific to the `azureaistudio` service. task_settings: allOf: - $ref: '#/components/schemas/inference._types.AzureAiStudioTaskSettings' description: "Settings to configure the inference task.\nThese settings are specific to the task type you specified." examples: PutAzureAiStudioRequestExample1: summary: A text embedding task description: 'Run `PUT _inference/text_embedding/azure_ai_studio_embeddings` to create an inference endpoint that performs a text_embedding task. Note that you do not specify a model here, as it is defined already in the Azure AI Studio deployment.' value: "{\n \"service\": \"azureaistudio\",\n \"service_settings\": {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-Uri\",\n \"provider\": \"openai\",\n \"endpoint_type\": \"token\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/azure_ai_studio_embeddings\n{\n \"service\": \"azureaistudio\",\n \"service_settings\": {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-Uri\",\n \"provider\": \"openai\",\n \"endpoint_type\": \"token\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"azure_ai_studio_embeddings\",\n inference_config={\n \"service\": \"azureaistudio\",\n \"service_settings\": {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-Uri\",\n \"provider\": \"openai\",\n \"endpoint_type\": \"token\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"azure_ai_studio_embeddings\",\n inference_config: {\n service: \"azureaistudio\",\n service_settings: {\n api_key: \"Azure-AI-Studio-API-key\",\n target: \"Target-Uri\",\n provider: \"openai\",\n endpoint_type: \"token\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"azure_ai_studio_embeddings\",\n body: {\n \"service\": \"azureaistudio\",\n \"service_settings\": {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-Uri\",\n \"provider\": \"openai\",\n \"endpoint_type\": \"token\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"azure_ai_studio_embeddings\",\n \"body\" => [\n \"service\" => \"azureaistudio\",\n \"service_settings\" => [\n \"api_key\" => \"Azure-AI-Studio-API-key\",\n \"target\" => \"Target-Uri\",\n \"provider\" => \"openai\",\n \"endpoint_type\" => \"token\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"azureaistudio","service_settings":{"api_key":"Azure-AI-Studio-API-key","target":"Target-Uri","provider":"openai","endpoint_type":"token"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/azure_ai_studio_embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"azure_ai_studio_embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"azureaistudio\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-Uri\",\n \"provider\": \"openai\",\n \"endpoint_type\": \"token\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"azure_ai_studio_embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"azureaistudio\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"Azure-AI-Studio-API-key\",\"target\":\"Target-Uri\",\"provider\":\"openai\",\"endpoint_type\":\"token\"}\n\"\"\"))\n )\n);\n" PutAzureAiStudioRequestExample2: summary: A completion task description: Run `PUT _inference/completion/azure_ai_studio_completion` to create an inference endpoint that performs a completion task. value: "{\n \"service\": \"azureaistudio\",\n \"service_settings\": {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-URI\",\n \"provider\": \"databricks\",\n \"endpoint_type\": \"realtime\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/azure_ai_studio_completion\n{\n \"service\": \"azureaistudio\",\n \"service_settings\": {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-URI\",\n \"provider\": \"databricks\",\n \"endpoint_type\": \"realtime\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"azure_ai_studio_completion\",\n inference_config={\n \"service\": \"azureaistudio\",\n \"service_settings\": {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-URI\",\n \"provider\": \"databricks\",\n \"endpoint_type\": \"realtime\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"azure_ai_studio_completion\",\n inference_config: {\n service: \"azureaistudio\",\n service_settings: {\n api_key: \"Azure-AI-Studio-API-key\",\n target: \"Target-URI\",\n provider: \"databricks\",\n endpoint_type: \"realtime\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"azure_ai_studio_completion\",\n body: {\n \"service\": \"azureaistudio\",\n \"service_settings\": {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-URI\",\n \"provider\": \"databricks\",\n \"endpoint_type\": \"realtime\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"azure_ai_studio_completion\",\n \"body\" => [\n \"service\" => \"azureaistudio\",\n \"service_settings\" => [\n \"api_key\" => \"Azure-AI-Studio-API-key\",\n \"target\" => \"Target-URI\",\n \"provider\" => \"databricks\",\n \"endpoint_type\" => \"realtime\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"azureaistudio","service_settings":{"api_key":"Azure-AI-Studio-API-key","target":"Target-URI","provider":"databricks","endpoint_type":"realtime"}}'' "$ELASTICSEARCH_URL/_inference/completion/azure_ai_studio_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"azure_ai_studio_completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"azureaistudio\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-URI\",\n \"provider\": \"databricks\",\n \"endpoint_type\": \"realtime\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"azure_ai_studio_completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"azureaistudio\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"Azure-AI-Studio-API-key\",\"target\":\"Target-URI\",\"provider\":\"databricks\",\"endpoint_type\":\"realtime\"}\n\"\"\"))\n )\n);\n" PutAzureAiStudioRequestExample3: summary: A rerank task description: Run `PUT _inference/rerank/azure_ai_studio_rerank` to create an inference endpoint that performs a rerank task. value: "{\n \"service\": \"azureaistudio\",\n \"service_settings\": {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-URI\",\n \"provider\": \"cohere\",\n \"endpoint_type\": \"token\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/rerank/azure_ai_studio_rerank\n{\n \"service\": \"azureaistudio\",\n \"service_settings\": {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-URI\",\n \"provider\": \"cohere\",\n \"endpoint_type\": \"token\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"azure_ai_studio_rerank\",\n inference_config={\n \"service\": \"azureaistudio\",\n \"service_settings\": {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-URI\",\n \"provider\": \"cohere\",\n \"endpoint_type\": \"token\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"azure_ai_studio_rerank\",\n inference_config: {\n service: \"azureaistudio\",\n service_settings: {\n api_key: \"Azure-AI-Studio-API-key\",\n target: \"Target-URI\",\n provider: \"cohere\",\n endpoint_type: \"token\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"azure_ai_studio_rerank\",\n body: {\n \"service\": \"azureaistudio\",\n \"service_settings\": {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-URI\",\n \"provider\": \"cohere\",\n \"endpoint_type\": \"token\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"azure_ai_studio_rerank\",\n \"body\" => [\n \"service\" => \"azureaistudio\",\n \"service_settings\" => [\n \"api_key\" => \"Azure-AI-Studio-API-key\",\n \"target\" => \"Target-URI\",\n \"provider\" => \"cohere\",\n \"endpoint_type\" => \"token\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"azureaistudio","service_settings":{"api_key":"Azure-AI-Studio-API-key","target":"Target-URI","provider":"cohere","endpoint_type":"token"}}'' "$ELASTICSEARCH_URL/_inference/rerank/azure_ai_studio_rerank"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"azure_ai_studio_rerank\",\n TaskType = TaskType.Rerank,\n InferenceConfig = new()\n {\n Service = \"azureaistudio\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-URI\",\n \"provider\": \"cohere\",\n \"endpoint_type\": \"token\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"azure_ai_studio_rerank\")\n .taskType(TaskType.Rerank)\n .inferenceConfig(i -> i\n .service(\"azureaistudio\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"Azure-AI-Studio-API-key\",\"target\":\"Target-URI\",\"provider\":\"cohere\",\"endpoint_type\":\"token\"}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoAzureAIStudio' x-state: Generally available; Added in 8.14.0 x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/azure_ai_studio_embeddings\n{\n \"service\": \"azureaistudio\",\n \"service_settings\": {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-Uri\",\n \"provider\": \"openai\",\n \"endpoint_type\": \"token\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"azure_ai_studio_embeddings\",\n inference_config={\n \"service\": \"azureaistudio\",\n \"service_settings\": {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-Uri\",\n \"provider\": \"openai\",\n \"endpoint_type\": \"token\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"azure_ai_studio_embeddings\",\n inference_config: {\n service: \"azureaistudio\",\n service_settings: {\n api_key: \"Azure-AI-Studio-API-key\",\n target: \"Target-Uri\",\n provider: \"openai\",\n endpoint_type: \"token\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"azure_ai_studio_embeddings\",\n body: {\n \"service\": \"azureaistudio\",\n \"service_settings\": {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-Uri\",\n \"provider\": \"openai\",\n \"endpoint_type\": \"token\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"azure_ai_studio_embeddings\",\n \"body\" => [\n \"service\" => \"azureaistudio\",\n \"service_settings\" => [\n \"api_key\" => \"Azure-AI-Studio-API-key\",\n \"target\" => \"Target-Uri\",\n \"provider\" => \"openai\",\n \"endpoint_type\" => \"token\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"azureaistudio","service_settings":{"api_key":"Azure-AI-Studio-API-key","target":"Target-Uri","provider":"openai","endpoint_type":"token"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/azure_ai_studio_embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"azure_ai_studio_embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"azureaistudio\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-Uri\",\n \"provider\": \"openai\",\n \"endpoint_type\": \"token\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"azure_ai_studio_embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"azureaistudio\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"Azure-AI-Studio-API-key\",\"target\":\"Target-Uri\",\"provider\":\"openai\",\"endpoint_type\":\"token\"}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{azureopenai_inference_id}': put: tags: - inference summary: Create an Azure OpenAI inference endpoint description: "Create an inference endpoint to perform an inference task with the `azureopenai` service.\n\nThe list of chat completion models that you can choose from in your Azure OpenAI deployment include:\n\n* [GPT-4 and GPT-4 Turbo models](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models?tabs=global-standard%2Cstandard-chat-completions#gpt-4-and-gpt-4-turbo-models)\n* [GPT-3.5](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models?tabs=global-standard%2Cstandard-chat-completions#gpt-35)\n\nThe list of embeddings models that you can choose from in your deployment can be found in the [Azure models documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models?tabs=global-standard%2Cstandard-chat-completions#embeddings).\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-azureopenai parameters: - name: task_type in: path description: "The type of the inference task that the model will perform.\nNOTE: The `chat_completion` task type only supports streaming and only through the _stream API." required: true schema: $ref: '#/components/schemas/inference._types.AzureOpenAITaskType' - name: azureopenai_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: chunking_settings: allOf: - $ref: '#/components/schemas/inference._types.InferenceChunkingSettings' description: "The chunking configuration object.\nApplies only to the `text_embedding` task type.\nNot applicable to the `completion` and `chat_completion` task types." externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config service: allOf: - $ref: '#/components/schemas/inference._types.AzureOpenAIServiceType' description: 'The type of service supported for the specified task type. In this case, `azureopenai`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.AzureOpenAIServiceSettings' description: Settings used to install the inference model. These settings are specific to the `azureopenai` service. task_settings: allOf: - $ref: '#/components/schemas/inference._types.AzureOpenAITaskSettings' description: "Settings to configure the inference task.\nThese settings are specific to the task type you specified." examples: PutAzureOpenAiRequestExample1: summary: A text embedding task description: 'Run `PUT _inference/text_embedding/azure_openai_embeddings` to create an inference endpoint that performs a `text_embedding` task. You do not specify a model, as it is defined already in the Azure OpenAI deployment.' value: "{\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/azure_openai_embeddings\n{\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"azure_openai_embeddings\",\n inference_config={\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"azure_openai_embeddings\",\n inference_config: {\n service: \"azureopenai\",\n service_settings: {\n api_key: \"Api-Key\",\n resource_name: \"Resource-name\",\n deployment_id: \"Deployment-id\",\n api_version: \"2024-02-01\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"azure_openai_embeddings\",\n body: {\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"azure_openai_embeddings\",\n \"body\" => [\n \"service\" => \"azureopenai\",\n \"service_settings\" => [\n \"api_key\" => \"Api-Key\",\n \"resource_name\" => \"Resource-name\",\n \"deployment_id\" => \"Deployment-id\",\n \"api_version\" => \"2024-02-01\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"azureopenai","service_settings":{"api_key":"Api-Key","resource_name":"Resource-name","deployment_id":"Deployment-id","api_version":"2024-02-01"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/azure_openai_embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"azure_openai_embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"azureopenai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"azure_openai_embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"azureopenai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"Api-Key\",\"resource_name\":\"Resource-name\",\"deployment_id\":\"Deployment-id\",\"api_version\":\"2024-02-01\"}\n\"\"\"))\n )\n);\n" PutAzureOpenAiRequestExample2: summary: A completion task description: Run `PUT _inference/completion/azure_openai_completion` to create an inference endpoint that performs a `completion` task. value: "{\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/azure_openai_completion\n{\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"azure_openai_completion\",\n inference_config={\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"azure_openai_completion\",\n inference_config: {\n service: \"azureopenai\",\n service_settings: {\n api_key: \"Api-Key\",\n resource_name: \"Resource-name\",\n deployment_id: \"Deployment-id\",\n api_version: \"2024-02-01\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"azure_openai_completion\",\n body: {\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"azure_openai_completion\",\n \"body\" => [\n \"service\" => \"azureopenai\",\n \"service_settings\" => [\n \"api_key\" => \"Api-Key\",\n \"resource_name\" => \"Resource-name\",\n \"deployment_id\" => \"Deployment-id\",\n \"api_version\" => \"2024-02-01\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"azureopenai","service_settings":{"api_key":"Api-Key","resource_name":"Resource-name","deployment_id":"Deployment-id","api_version":"2024-02-01"}}'' "$ELASTICSEARCH_URL/_inference/completion/azure_openai_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"azure_openai_completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"azureopenai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"azure_openai_completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"azureopenai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"Api-Key\",\"resource_name\":\"Resource-name\",\"deployment_id\":\"Deployment-id\",\"api_version\":\"2024-02-01\"}\n\"\"\"))\n )\n);\n" PutAzureOpenAiRequestExample3: summary: A chat completion task description: Run `PUT _inference/chat_completion/azure_openai_chat_completion` to create an inference endpoint that performs a `chat_completion` task. value: "{\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/chat_completion/azure_openai_chat_completion\n{\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"chat_completion\",\n inference_id=\"azure_openai_chat_completion\",\n inference_config={\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"chat_completion\",\n inference_id: \"azure_openai_chat_completion\",\n inference_config: {\n service: \"azureopenai\",\n service_settings: {\n api_key: \"Api-Key\",\n resource_name: \"Resource-name\",\n deployment_id: \"Deployment-id\",\n api_version: \"2024-02-01\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"chat_completion\",\n inference_id: \"azure_openai_chat_completion\",\n body: {\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"chat_completion\",\n \"inference_id\" => \"azure_openai_chat_completion\",\n \"body\" => [\n \"service\" => \"azureopenai\",\n \"service_settings\" => [\n \"api_key\" => \"Api-Key\",\n \"resource_name\" => \"Resource-name\",\n \"deployment_id\" => \"Deployment-id\",\n \"api_version\" => \"2024-02-01\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"azureopenai","service_settings":{"api_key":"Api-Key","resource_name":"Resource-name","deployment_id":"Deployment-id","api_version":"2024-02-01"}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/azure_openai_chat_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"azure_openai_chat_completion\",\n TaskType = TaskType.ChatCompletion,\n InferenceConfig = new()\n {\n Service = \"azureopenai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"azure_openai_chat_completion\")\n .taskType(TaskType.ChatCompletion)\n .inferenceConfig(i -> i\n .service(\"azureopenai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"Api-Key\",\"resource_name\":\"Resource-name\",\"deployment_id\":\"Deployment-id\",\"api_version\":\"2024-02-01\"}\n\"\"\"))\n )\n);\n" PutAzureOpenAiRequestExample4: summary: A text embedding task with OAuth 2.0 authorization and custom headers description: 'Run `PUT _inference/text_embedding/azure_openai_embeddings` to create an inference endpoint that performs a `text_embedding` task. You do not specify a model, as it is defined already in the Azure OpenAI deployment.' value: "{\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_version\": \"2023-05-15\",\n \"client_id\": \"12345\",\n \"client_secret\": \"secret\",\n \"deployment_id\": \"Deployment-id\",\n \"resource_name\": \"Resource-name\",\n \"scopes\": [\"Scope-1\", \"Scope-2\"],\n \"tenant_id\": \"tenant id\"\n },\n \"task_settings\": {\n \"headers\": {\n \"Custom-Header-Key\": \"Custom header value\"\n }\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/azure_openai_embeddings\n{\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_version\": \"2023-05-15\",\n \"client_id\": \"12345\",\n \"client_secret\": \"secret\",\n \"deployment_id\": \"Deployment-id\",\n \"resource_name\": \"Resource-name\",\n \"scopes\": [\"Scope-1\", \"Scope-2\"],\n \"tenant_id\": \"tenant id\"\n },\n \"task_settings\": {\n \"headers\": {\n \"Custom-Header-Key\": \"Custom header value\"\n }\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"azure_openai_embeddings\",\n inference_config={\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_version\": \"2023-05-15\",\n \"client_id\": \"12345\",\n \"client_secret\": \"secret\",\n \"deployment_id\": \"Deployment-id\",\n \"resource_name\": \"Resource-name\",\n \"scopes\": [\n \"Scope-1\",\n \"Scope-2\"\n ],\n \"tenant_id\": \"tenant id\"\n },\n \"task_settings\": {\n \"headers\": {\n \"Custom-Header-Key\": \"Custom header value\"\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"azure_openai_embeddings\",\n inference_config: {\n service: \"azureopenai\",\n service_settings: {\n api_version: \"2023-05-15\",\n client_id: \"12345\",\n client_secret: \"secret\",\n deployment_id: \"Deployment-id\",\n resource_name: \"Resource-name\",\n scopes: [\"Scope-1\", \"Scope-2\"],\n tenant_id: \"tenant id\",\n },\n task_settings: {\n headers: {\n \"Custom-Header-Key\": \"Custom header value\",\n },\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"azure_openai_embeddings\",\n body: {\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_version\": \"2023-05-15\",\n \"client_id\": \"12345\",\n \"client_secret\": \"secret\",\n \"deployment_id\": \"Deployment-id\",\n \"resource_name\": \"Resource-name\",\n \"scopes\": [\n \"Scope-1\",\n \"Scope-2\"\n ],\n \"tenant_id\": \"tenant id\"\n },\n \"task_settings\": {\n \"headers\": {\n \"Custom-Header-Key\": \"Custom header value\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"azure_openai_embeddings\",\n \"body\" => [\n \"service\" => \"azureopenai\",\n \"service_settings\" => [\n \"api_version\" => \"2023-05-15\",\n \"client_id\" => \"12345\",\n \"client_secret\" => \"secret\",\n \"deployment_id\" => \"Deployment-id\",\n \"resource_name\" => \"Resource-name\",\n \"scopes\" => array(\n \"Scope-1\",\n \"Scope-2\",\n ),\n \"tenant_id\" => \"tenant id\",\n ],\n \"task_settings\" => [\n \"headers\" => [\n \"Custom-Header-Key\" => \"Custom header value\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"azureopenai","service_settings":{"api_version":"2023-05-15","client_id":"12345","client_secret":"secret","deployment_id":"Deployment-id","resource_name":"Resource-name","scopes":["Scope-1","Scope-2"],"tenant_id":"tenant id"},"task_settings":{"headers":{"Custom-Header-Key":"Custom header value"}}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/azure_openai_embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"azure_openai_embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"azureopenai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_version\": \"2023-05-15\",\n \"client_id\": \"12345\",\n \"client_secret\": \"secret\",\n \"deployment_id\": \"Deployment-id\",\n \"resource_name\": \"Resource-name\",\n \"scopes\": [\n \"Scope-1\",\n \"Scope-2\"\n ],\n \"tenant_id\": \"tenant id\"\n }\n \"\"\"),\n TaskSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"headers\": {\n \"Custom-Header-Key\": \"Custom header value\"\n }\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"azure_openai_embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"azureopenai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_version\":\"2023-05-15\",\"client_id\":\"12345\",\"client_secret\":\"secret\",\"deployment_id\":\"Deployment-id\",\"resource_name\":\"Resource-name\",\"scopes\":[\"Scope-1\",\"Scope-2\"],\"tenant_id\":\"tenant id\"}\n\"\"\"))\n .taskSettings(JsonData.fromJson(\"\"\"\n{\"headers\":{\"Custom-Header-Key\":\"Custom header value\"}}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoAzureOpenAI' examples: PutAzureOpenAiResponseExample1: summary: A text embedding task description: A successful response when creating an Azure OpenAI `text_embedding` inference endpoint. value: "{\n \"inference_id\": \"azure_openai_embeddings\",\n \"task_type\": \"text_embedding\",\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\",\n \"rate_limit\": {\n \"requests_per_minute\": 1140\n },\n \"dimensions\": 1536,\n \"similarity\": \"dot_product\"\n },\n \"chunking_settings\": {\n \"strategy\": \"sentence\",\n \"max_chunk_size\": 250,\n \"sentence_overlap\": 1\n }\n}" PutAzureOpenAiResponseExample2: summary: A completion task description: A successful response when creating an Azure OpenAI `completion` inference endpoint. value: "{\n \"inference_id\": \"azure_openai_completion\",\n \"task_type\": \"completion\",\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\",\n \"rate_limit\": {\n \"requests_per_minute\": 120\n }\n }\n}" PutAzureOpenAiResponseExample3: summary: A chat completion task description: A successful response when creating an Azure OpenAI `chat_completion` inference endpoint. value: "{\n \"inference_id\": \"azure_openai_chat_completion\",\n \"task_type\": \"chat_completion\",\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\",\n \"rate_limit\": {\n \"requests_per_minute\": 120\n }\n }\n}" x-state: Generally available; Added in 8.14.0 x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/azure_openai_embeddings\n{\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"azure_openai_embeddings\",\n inference_config={\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"azure_openai_embeddings\",\n inference_config: {\n service: \"azureopenai\",\n service_settings: {\n api_key: \"Api-Key\",\n resource_name: \"Resource-name\",\n deployment_id: \"Deployment-id\",\n api_version: \"2024-02-01\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"azure_openai_embeddings\",\n body: {\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"azure_openai_embeddings\",\n \"body\" => [\n \"service\" => \"azureopenai\",\n \"service_settings\" => [\n \"api_key\" => \"Api-Key\",\n \"resource_name\" => \"Resource-name\",\n \"deployment_id\" => \"Deployment-id\",\n \"api_version\" => \"2024-02-01\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"azureopenai","service_settings":{"api_key":"Api-Key","resource_name":"Resource-name","deployment_id":"Deployment-id","api_version":"2024-02-01"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/azure_openai_embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"azure_openai_embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"azureopenai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"azure_openai_embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"azureopenai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"Api-Key\",\"resource_name\":\"Resource-name\",\"deployment_id\":\"Deployment-id\",\"api_version\":\"2024-02-01\"}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{cohere_inference_id}': put: tags: - inference summary: Create a Cohere inference endpoint description: "Create an inference endpoint to perform an inference task with the `cohere` service.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-cohere parameters: - name: task_type in: path description: The type of the inference task that the model will perform. required: true schema: $ref: '#/components/schemas/inference._types.CohereTaskType' - name: cohere_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: chunking_settings: allOf: - $ref: '#/components/schemas/inference._types.InferenceChunkingSettings' description: "The chunking configuration object.\nApplies only to the `text_embedding` task type.\nNot applicable to the `rerank` or `completion` task type." externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config service: allOf: - $ref: '#/components/schemas/inference._types.CohereServiceType' description: 'The type of service supported for the specified task type. In this case, `cohere`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.CohereServiceSettings' description: "Settings used to install the inference model.\nThese settings are specific to the `cohere` service." task_settings: allOf: - $ref: '#/components/schemas/inference._types.CohereTaskSettings' description: "Settings to configure the inference task.\nThese settings are specific to the task type you specified." examples: PutCohereRequestExample1: summary: A text embedding task description: Run `PUT _inference/text_embedding/cohere-embeddings` to create an inference endpoint that performs a text embedding task. value: "{\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-Api-key\",\n \"model_id\": \"embed-english-light-v3.0\",\n \"embedding_type\": \"byte\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/cohere-embeddings\n{\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-Api-key\",\n \"model_id\": \"embed-english-light-v3.0\",\n \"embedding_type\": \"byte\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"cohere-embeddings\",\n inference_config={\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-Api-key\",\n \"model_id\": \"embed-english-light-v3.0\",\n \"embedding_type\": \"byte\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"cohere-embeddings\",\n inference_config: {\n service: \"cohere\",\n service_settings: {\n api_key: \"Cohere-Api-key\",\n model_id: \"embed-english-light-v3.0\",\n embedding_type: \"byte\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"cohere-embeddings\",\n body: {\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-Api-key\",\n \"model_id\": \"embed-english-light-v3.0\",\n \"embedding_type\": \"byte\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"cohere-embeddings\",\n \"body\" => [\n \"service\" => \"cohere\",\n \"service_settings\" => [\n \"api_key\" => \"Cohere-Api-key\",\n \"model_id\" => \"embed-english-light-v3.0\",\n \"embedding_type\" => \"byte\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"cohere","service_settings":{"api_key":"Cohere-Api-key","model_id":"embed-english-light-v3.0","embedding_type":"byte"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/cohere-embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"cohere-embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"cohere\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"Cohere-Api-key\",\n \"model_id\": \"embed-english-light-v3.0\",\n \"embedding_type\": \"byte\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"cohere-embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"cohere\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"Cohere-Api-key\",\"model_id\":\"embed-english-light-v3.0\",\"embedding_type\":\"byte\"}\n\"\"\"))\n )\n);\n" PutCohereRequestExample2: summary: A rerank task description: Run `PUT _inference/rerank/cohere-rerank` to create an inference endpoint that performs a rerank task. value: "{\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-API-key\",\n \"model_id\": \"rerank-english-v3.0\"\n },\n \"task_settings\": {\n \"top_n\": 10,\n \"return_documents\": true\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/rerank/cohere-rerank\n{\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-API-key\",\n \"model_id\": \"rerank-english-v3.0\"\n },\n \"task_settings\": {\n \"top_n\": 10,\n \"return_documents\": true\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"cohere-rerank\",\n inference_config={\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-API-key\",\n \"model_id\": \"rerank-english-v3.0\"\n },\n \"task_settings\": {\n \"top_n\": 10,\n \"return_documents\": True\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"cohere-rerank\",\n inference_config: {\n service: \"cohere\",\n service_settings: {\n api_key: \"Cohere-API-key\",\n model_id: \"rerank-english-v3.0\",\n },\n task_settings: {\n top_n: 10,\n return_documents: true,\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"cohere-rerank\",\n body: {\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-API-key\",\n \"model_id\": \"rerank-english-v3.0\"\n },\n \"task_settings\": {\n \"top_n\": 10,\n \"return_documents\": true\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"cohere-rerank\",\n \"body\" => [\n \"service\" => \"cohere\",\n \"service_settings\" => [\n \"api_key\" => \"Cohere-API-key\",\n \"model_id\" => \"rerank-english-v3.0\",\n ],\n \"task_settings\" => [\n \"top_n\" => 10,\n \"return_documents\" => true,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"cohere","service_settings":{"api_key":"Cohere-API-key","model_id":"rerank-english-v3.0"},"task_settings":{"top_n":10,"return_documents":true}}'' "$ELASTICSEARCH_URL/_inference/rerank/cohere-rerank"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"cohere-rerank\",\n TaskType = TaskType.Rerank,\n InferenceConfig = new()\n {\n Service = \"cohere\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"Cohere-API-key\",\n \"model_id\": \"rerank-english-v3.0\"\n }\n \"\"\"),\n TaskSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"top_n\": 10,\n \"return_documents\": true\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"cohere-rerank\")\n .taskType(TaskType.Rerank)\n .inferenceConfig(i -> i\n .service(\"cohere\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"Cohere-API-key\",\"model_id\":\"rerank-english-v3.0\"}\n\"\"\"))\n .taskSettings(JsonData.fromJson(\"\"\"\n{\"top_n\":10,\"return_documents\":true}\n\"\"\"))\n )\n);\n" PutCohereRequestExample3: summary: A completion task description: Run `PUT _inference/completion/cohere-completion` to create an inference endpoint that performs a completion task. value: "{\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-API-key\",\n \"model_id\": \"command-a-03-2025\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/cohere-completion\n{\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-API-key\",\n \"model_id\": \"command-a-03-2025\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"cohere-completion\",\n inference_config={\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-API-key\",\n \"model_id\": \"command-a-03-2025\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"cohere-completion\",\n inference_config: {\n service: \"cohere\",\n service_settings: {\n api_key: \"Cohere-API-key\",\n model_id: \"command-a-03-2025\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"cohere-completion\",\n body: {\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-API-key\",\n \"model_id\": \"command-a-03-2025\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"cohere-completion\",\n \"body\" => [\n \"service\" => \"cohere\",\n \"service_settings\" => [\n \"api_key\" => \"Cohere-API-key\",\n \"model_id\" => \"command-a-03-2025\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"cohere","service_settings":{"api_key":"Cohere-API-key","model_id":"command-a-03-2025"}}'' "$ELASTICSEARCH_URL/_inference/completion/cohere-completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"cohere-completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"cohere\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"Cohere-API-key\",\n \"model_id\": \"command-a-03-2025\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"cohere-completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"cohere\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"Cohere-API-key\",\"model_id\":\"command-a-03-2025\"}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoCohere' x-state: Generally available; Added in 8.13.0 x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/cohere-embeddings\n{\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-Api-key\",\n \"model_id\": \"embed-english-light-v3.0\",\n \"embedding_type\": \"byte\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"cohere-embeddings\",\n inference_config={\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-Api-key\",\n \"model_id\": \"embed-english-light-v3.0\",\n \"embedding_type\": \"byte\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"cohere-embeddings\",\n inference_config: {\n service: \"cohere\",\n service_settings: {\n api_key: \"Cohere-Api-key\",\n model_id: \"embed-english-light-v3.0\",\n embedding_type: \"byte\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"cohere-embeddings\",\n body: {\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-Api-key\",\n \"model_id\": \"embed-english-light-v3.0\",\n \"embedding_type\": \"byte\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"cohere-embeddings\",\n \"body\" => [\n \"service\" => \"cohere\",\n \"service_settings\" => [\n \"api_key\" => \"Cohere-Api-key\",\n \"model_id\" => \"embed-english-light-v3.0\",\n \"embedding_type\" => \"byte\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"cohere","service_settings":{"api_key":"Cohere-Api-key","model_id":"embed-english-light-v3.0","embedding_type":"byte"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/cohere-embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"cohere-embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"cohere\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"Cohere-Api-key\",\n \"model_id\": \"embed-english-light-v3.0\",\n \"embedding_type\": \"byte\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"cohere-embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"cohere\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"Cohere-Api-key\",\"model_id\":\"embed-english-light-v3.0\",\"embedding_type\":\"byte\"}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{contextualai_inference_id}': put: tags: - inference summary: Create an Contextual AI inference endpoint description: "Create an inference endpoint to perform an inference task with the `contexualai` service.\n\nTo review the available `rerank` models, refer to .\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-contextualai parameters: - name: task_type in: path description: The type of the inference task that the model will perform. required: true schema: $ref: '#/components/schemas/inference._types.TaskTypeContextualAI' - name: contextualai_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: service: allOf: - $ref: '#/components/schemas/inference._types.ContextualAIServiceType' description: 'The type of service supported for the specified task type. In this case, `contextualai`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.ContextualAIServiceSettings' description: Settings used to install the inference model. These settings are specific to the `contextualai` service. task_settings: allOf: - $ref: '#/components/schemas/inference._types.ContextualAITaskSettings' description: "Settings to configure the inference task.\nThese settings are specific to the task type you specified." examples: PutContextualAiRequestExample1: summary: A rerank task description: Run `PUT _inference/rerank/contextualai-rerank` to create an inference endpoint for rerank tasks using the Contextual AI service. value: "{\n \"service\": \"contextualai\",\n \"service_settings\": {\n \"api_key\": \"ContextualAI-Api-key\",\n \"model_id\": \"ctxl-rerank-v2-instruct-multilingual-mini\"\n },\n \"task_settings\": {\n \"instruction\": \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\": 3\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/rerank/contextualai-rerank\n{\n \"service\": \"contextualai\",\n \"service_settings\": {\n \"api_key\": \"ContextualAI-Api-key\",\n \"model_id\": \"ctxl-rerank-v2-instruct-multilingual-mini\"\n },\n \"task_settings\": {\n \"instruction\": \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\": 3\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"contextualai-rerank\",\n inference_config={\n \"service\": \"contextualai\",\n \"service_settings\": {\n \"api_key\": \"ContextualAI-Api-key\",\n \"model_id\": \"ctxl-rerank-v2-instruct-multilingual-mini\"\n },\n \"task_settings\": {\n \"instruction\": \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\": 3\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"contextualai-rerank\",\n inference_config: {\n service: \"contextualai\",\n service_settings: {\n api_key: \"ContextualAI-Api-key\",\n model_id: \"ctxl-rerank-v2-instruct-multilingual-mini\",\n },\n task_settings: {\n instruction:\n \"Rerank the following documents based on their relevance to the query.\",\n top_k: 3,\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"contextualai-rerank\",\n body: {\n \"service\": \"contextualai\",\n \"service_settings\": {\n \"api_key\": \"ContextualAI-Api-key\",\n \"model_id\": \"ctxl-rerank-v2-instruct-multilingual-mini\"\n },\n \"task_settings\": {\n \"instruction\": \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\": 3\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"contextualai-rerank\",\n \"body\" => [\n \"service\" => \"contextualai\",\n \"service_settings\" => [\n \"api_key\" => \"ContextualAI-Api-key\",\n \"model_id\" => \"ctxl-rerank-v2-instruct-multilingual-mini\",\n ],\n \"task_settings\" => [\n \"instruction\" => \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\" => 3,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"contextualai","service_settings":{"api_key":"ContextualAI-Api-key","model_id":"ctxl-rerank-v2-instruct-multilingual-mini"},"task_settings":{"instruction":"Rerank the following documents based on their relevance to the query.","top_k":3}}'' "$ELASTICSEARCH_URL/_inference/rerank/contextualai-rerank"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"contextualai-rerank\",\n TaskType = TaskType.Rerank,\n InferenceConfig = new()\n {\n Service = \"contextualai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"ContextualAI-Api-key\",\n \"model_id\": \"ctxl-rerank-v2-instruct-multilingual-mini\"\n }\n \"\"\"),\n TaskSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"instruction\": \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\": 3\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"contextualai-rerank\")\n .taskType(TaskType.Rerank)\n .inferenceConfig(i -> i\n .service(\"contextualai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"ContextualAI-Api-key\",\"model_id\":\"ctxl-rerank-v2-instruct-multilingual-mini\"}\n\"\"\"))\n .taskSettings(JsonData.fromJson(\"\"\"\n{\"instruction\":\"Rerank the following documents based on their relevance to the query.\",\"top_k\":3}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoContextualAi' x-state: Generally available; Added in 9.2.0 x-codeSamples: - lang: Console source: "PUT _inference/rerank/contextualai-rerank\n{\n \"service\": \"contextualai\",\n \"service_settings\": {\n \"api_key\": \"ContextualAI-Api-key\",\n \"model_id\": \"ctxl-rerank-v2-instruct-multilingual-mini\"\n },\n \"task_settings\": {\n \"instruction\": \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\": 3\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"contextualai-rerank\",\n inference_config={\n \"service\": \"contextualai\",\n \"service_settings\": {\n \"api_key\": \"ContextualAI-Api-key\",\n \"model_id\": \"ctxl-rerank-v2-instruct-multilingual-mini\"\n },\n \"task_settings\": {\n \"instruction\": \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\": 3\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"contextualai-rerank\",\n inference_config: {\n service: \"contextualai\",\n service_settings: {\n api_key: \"ContextualAI-Api-key\",\n model_id: \"ctxl-rerank-v2-instruct-multilingual-mini\",\n },\n task_settings: {\n instruction:\n \"Rerank the following documents based on their relevance to the query.\",\n top_k: 3,\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"contextualai-rerank\",\n body: {\n \"service\": \"contextualai\",\n \"service_settings\": {\n \"api_key\": \"ContextualAI-Api-key\",\n \"model_id\": \"ctxl-rerank-v2-instruct-multilingual-mini\"\n },\n \"task_settings\": {\n \"instruction\": \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\": 3\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"contextualai-rerank\",\n \"body\" => [\n \"service\" => \"contextualai\",\n \"service_settings\" => [\n \"api_key\" => \"ContextualAI-Api-key\",\n \"model_id\" => \"ctxl-rerank-v2-instruct-multilingual-mini\",\n ],\n \"task_settings\" => [\n \"instruction\" => \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\" => 3,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"contextualai","service_settings":{"api_key":"ContextualAI-Api-key","model_id":"ctxl-rerank-v2-instruct-multilingual-mini"},"task_settings":{"instruction":"Rerank the following documents based on their relevance to the query.","top_k":3}}'' "$ELASTICSEARCH_URL/_inference/rerank/contextualai-rerank"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"contextualai-rerank\",\n TaskType = TaskType.Rerank,\n InferenceConfig = new()\n {\n Service = \"contextualai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"ContextualAI-Api-key\",\n \"model_id\": \"ctxl-rerank-v2-instruct-multilingual-mini\"\n }\n \"\"\"),\n TaskSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"instruction\": \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\": 3\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"contextualai-rerank\")\n .taskType(TaskType.Rerank)\n .inferenceConfig(i -> i\n .service(\"contextualai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"ContextualAI-Api-key\",\"model_id\":\"ctxl-rerank-v2-instruct-multilingual-mini\"}\n\"\"\"))\n .taskSettings(JsonData.fromJson(\"\"\"\n{\"instruction\":\"Rerank the following documents based on their relevance to the query.\",\"top_k\":3}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{custom_inference_id}': put: tags: - inference summary: Create a custom inference endpoint description: "The custom service gives more control over how to interact with external inference services that aren't explicitly supported through dedicated integrations.\nThe custom service gives you the ability to define the headers, url, query parameters, request body, and secrets.\nThe custom service supports the template replacement functionality, which enables you to define a template that can be replaced with the value associated with that key.\nTemplates are portions of a string that start with `${` and end with `}`.\nThe parameters `secret_parameters` and `task_settings` are checked for keys for template replacement. Template replacement is supported in the `request`, `headers`, `url`, and `query_parameters`.\nIf the definition (key) is not found for a template, an error message is returned.\nIn case of an endpoint definition like the following:\n```\nPUT _inference/text_embedding/test-text-embedding\n{\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"...endpoints.huggingface.cloud/v1/embeddings\",\n \"headers\": {\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json\"\n },\n \"request\": \"{\\\"input\\\": ${input}}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\":\"$.data[*].embedding[*]\"\n }\n }\n }\n}\n```\nTo replace `${api_key}` the `secret_parameters` and `task_settings` are checked for a key named `api_key`.\n\n> info\n> Templates should not be surrounded by quotes.\n\nPre-defined templates:\n* `${input}` refers to the array of input strings that comes from the `input` field of the subsequent inference requests.\n* `${input_type}` refers to the input type translation values.\n* `${query}` refers to the query field used specifically for reranking tasks.\n* `${top_n}` refers to the `top_n` field available when performing rerank requests.\n* `${return_documents}` refers to the `return_documents` field available when performing rerank requests.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-custom parameters: - name: task_type in: path description: The type of the inference task that the model will perform. required: true schema: $ref: '#/components/schemas/inference._types.CustomTaskType' - name: custom_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: required: - service - service_settings type: object properties: chunking_settings: allOf: - $ref: '#/components/schemas/inference._types.InferenceChunkingSettings' description: "The chunking configuration object.\nApplies only to the `sparse_embedding` or `text_embedding` task types.\nNot applicable to the `rerank` or `completion` task types." externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config service: allOf: - $ref: '#/components/schemas/inference._types.CustomServiceType' description: 'The type of service supported for the specified task type. In this case, `custom`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.CustomServiceSettings' description: "Settings used to install the inference model.\nThese settings are specific to the `custom` service." task_settings: allOf: - $ref: '#/components/schemas/inference._types.CustomTaskSettings' description: "Settings to configure the inference task.\nThese settings are specific to the task type you specified." examples: PutCustomRequestExample1: summary: Custom text embedding task (OpenAI) description: Run `PUT _inference/text_embedding/custom-embeddings` to create an inference endpoint that performs a text embedding task. value: "{\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"https://api.openai.com/v1/embeddings\",\n \"headers\": {\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json;charset=utf-8\"\n },\n \"request\": \"{\\\"input\\\": ${input}, \\\"model\\\": \\\"text-embedding-3-small\\\"}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\": \"$.data[*].embedding[*]\"\n }\n }\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/custom-embeddings\n{\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"https://api.openai.com/v1/embeddings\",\n \"headers\": {\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json;charset=utf-8\"\n },\n \"request\": \"{\\\"input\\\": ${input}, \\\"model\\\": \\\"text-embedding-3-small\\\"}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\": \"$.data[*].embedding[*]\"\n }\n }\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"custom-embeddings\",\n inference_config={\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"https://api.openai.com/v1/embeddings\",\n \"headers\": {\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json;charset=utf-8\"\n },\n \"request\": \"{\\\"input\\\": ${input}, \\\"model\\\": \\\"text-embedding-3-small\\\"}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\": \"$.data[*].embedding[*]\"\n }\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"custom-embeddings\",\n inference_config: {\n service: \"custom\",\n service_settings: {\n secret_parameters: {\n api_key: \"\",\n },\n url: \"https://api.openai.com/v1/embeddings\",\n headers: {\n Authorization: \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json;charset=utf-8\",\n },\n request: '{\"input\": ${input}, \"model\": \"text-embedding-3-small\"}',\n response: {\n json_parser: {\n text_embeddings: \"$.data[*].embedding[*]\",\n },\n },\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"custom-embeddings\",\n body: {\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"https://api.openai.com/v1/embeddings\",\n \"headers\": {\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json;charset=utf-8\"\n },\n \"request\": \"{\\\"input\\\": ${input}, \\\"model\\\": \\\"text-embedding-3-small\\\"}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\": \"$.data[*].embedding[*]\"\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"custom-embeddings\",\n \"body\" => [\n \"service\" => \"custom\",\n \"service_settings\" => [\n \"secret_parameters\" => [\n \"api_key\" => \"\",\n ],\n \"url\" => \"https://api.openai.com/v1/embeddings\",\n \"headers\" => [\n \"Authorization\" => \"Bearer \\${api_key}\",\n \"Content-Type\" => \"application/json;charset=utf-8\",\n ],\n \"request\" => \"{\\\"input\\\": \\${input}, \\\"model\\\": \\\"text-embedding-3-small\\\"}\",\n \"response\" => [\n \"json_parser\" => [\n \"text_embeddings\" => \"$.data[*].embedding[*]\",\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"custom","service_settings":{"secret_parameters":{"api_key":""},"url":"https://api.openai.com/v1/embeddings","headers":{"Authorization":"Bearer ${api_key}","Content-Type":"application/json;charset=utf-8"},"request":"{\"input\": ${input}, \"model\": \"text-embedding-3-small\"}","response":{"json_parser":{"text_embeddings":"$.data[*].embedding[*]"}}}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/custom-embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"custom-embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"custom\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"secret_parameters\": {\n \"api_key\": \"\\u003Capi key\\u003E\"\n },\n \"url\": \"https://api.openai.com/v1/embeddings\",\n \"headers\": {\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json;charset=utf-8\"\n },\n \"request\": \"{\\u0022input\\u0022: ${input}, \\u0022model\\u0022: \\u0022text-embedding-3-small\\u0022}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\": \"$.data[*].embedding[*]\"\n }\n }\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"custom-embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"custom\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"secret_parameters\":{\"api_key\":\"\"},\"url\":\"https://api.openai.com/v1/embeddings\",\"headers\":{\"Authorization\":\"Bearer ${api_key}\",\"Content-Type\":\"application/json;charset=utf-8\"},\"request\":\"{\\\"input\\\": ${input}, \\\"model\\\": \\\"text-embedding-3-small\\\"}\",\"response\":{\"json_parser\":{\"text_embeddings\":\"$.data[*].embedding[*]\"}}}\n\"\"\"))\n )\n);\n" PutCustomRequestExample2: summary: Custom rerank task (Cohere APIv2) description: Run `PUT _inference/rerank/custom-rerank` to create an inference endpoint that performs a rerank task. value: "{\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"https://api.cohere.com/v2/rerank\",\n \"headers\": {\n \"Authorization\": \"bearer ${api_key}\",\n \"Content-Type\": \"application/json\"\n },\n \"request\": \"{\\\"documents\\\": ${input}, \\\"query\\\": ${query}, \\\"model\\\": \\\"rerank-v3.5\\\"}\",\n \"response\": {\n \"json_parser\": {\n \"reranked_index\":\"$.results[*].index\",\n \"relevance_score\":\"$.results[*].relevance_score\"\n }\n }\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/rerank/custom-rerank\n{\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"https://api.cohere.com/v2/rerank\",\n \"headers\": {\n \"Authorization\": \"bearer ${api_key}\",\n \"Content-Type\": \"application/json\"\n },\n \"request\": \"{\\\"documents\\\": ${input}, \\\"query\\\": ${query}, \\\"model\\\": \\\"rerank-v3.5\\\"}\",\n \"response\": {\n \"json_parser\": {\n \"reranked_index\":\"$.results[*].index\",\n \"relevance_score\":\"$.results[*].relevance_score\"\n }\n }\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"custom-rerank\",\n inference_config={\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"https://api.cohere.com/v2/rerank\",\n \"headers\": {\n \"Authorization\": \"bearer ${api_key}\",\n \"Content-Type\": \"application/json\"\n },\n \"request\": \"{\\\"documents\\\": ${input}, \\\"query\\\": ${query}, \\\"model\\\": \\\"rerank-v3.5\\\"}\",\n \"response\": {\n \"json_parser\": {\n \"reranked_index\": \"$.results[*].index\",\n \"relevance_score\": \"$.results[*].relevance_score\"\n }\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"custom-rerank\",\n inference_config: {\n service: \"custom\",\n service_settings: {\n secret_parameters: {\n api_key: \"\",\n },\n url: \"https://api.cohere.com/v2/rerank\",\n headers: {\n Authorization: \"bearer ${api_key}\",\n \"Content-Type\": \"application/json\",\n },\n request:\n '{\"documents\": ${input}, \"query\": ${query}, \"model\": \"rerank-v3.5\"}',\n response: {\n json_parser: {\n reranked_index: \"$.results[*].index\",\n relevance_score: \"$.results[*].relevance_score\",\n },\n },\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"custom-rerank\",\n body: {\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"https://api.cohere.com/v2/rerank\",\n \"headers\": {\n \"Authorization\": \"bearer ${api_key}\",\n \"Content-Type\": \"application/json\"\n },\n \"request\": \"{\\\"documents\\\": ${input}, \\\"query\\\": ${query}, \\\"model\\\": \\\"rerank-v3.5\\\"}\",\n \"response\": {\n \"json_parser\": {\n \"reranked_index\": \"$.results[*].index\",\n \"relevance_score\": \"$.results[*].relevance_score\"\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"custom-rerank\",\n \"body\" => [\n \"service\" => \"custom\",\n \"service_settings\" => [\n \"secret_parameters\" => [\n \"api_key\" => \"\",\n ],\n \"url\" => \"https://api.cohere.com/v2/rerank\",\n \"headers\" => [\n \"Authorization\" => \"bearer \\${api_key}\",\n \"Content-Type\" => \"application/json\",\n ],\n \"request\" => \"{\\\"documents\\\": \\${input}, \\\"query\\\": \\${query}, \\\"model\\\": \\\"rerank-v3.5\\\"}\",\n \"response\" => [\n \"json_parser\" => [\n \"reranked_index\" => \"$.results[*].index\",\n \"relevance_score\" => \"$.results[*].relevance_score\",\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"custom","service_settings":{"secret_parameters":{"api_key":""},"url":"https://api.cohere.com/v2/rerank","headers":{"Authorization":"bearer ${api_key}","Content-Type":"application/json"},"request":"{\"documents\": ${input}, \"query\": ${query}, \"model\": \"rerank-v3.5\"}","response":{"json_parser":{"reranked_index":"$.results[*].index","relevance_score":"$.results[*].relevance_score"}}}}'' "$ELASTICSEARCH_URL/_inference/rerank/custom-rerank"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"custom-rerank\",\n TaskType = TaskType.Rerank,\n InferenceConfig = new()\n {\n Service = \"custom\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"secret_parameters\": {\n \"api_key\": \"\\u003Capi key\\u003E\"\n },\n \"url\": \"https://api.cohere.com/v2/rerank\",\n \"headers\": {\n \"Authorization\": \"bearer ${api_key}\",\n \"Content-Type\": \"application/json\"\n },\n \"request\": \"{\\u0022documents\\u0022: ${input}, \\u0022query\\u0022: ${query}, \\u0022model\\u0022: \\u0022rerank-v3.5\\u0022}\",\n \"response\": {\n \"json_parser\": {\n \"reranked_index\": \"$.results[*].index\",\n \"relevance_score\": \"$.results[*].relevance_score\"\n }\n }\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"custom-rerank\")\n .taskType(TaskType.Rerank)\n .inferenceConfig(i -> i\n .service(\"custom\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"secret_parameters\":{\"api_key\":\"\"},\"url\":\"https://api.cohere.com/v2/rerank\",\"headers\":{\"Authorization\":\"bearer ${api_key}\",\"Content-Type\":\"application/json\"},\"request\":\"{\\\"documents\\\": ${input}, \\\"query\\\": ${query}, \\\"model\\\": \\\"rerank-v3.5\\\"}\",\"response\":{\"json_parser\":{\"reranked_index\":\"$.results[*].index\",\"relevance_score\":\"$.results[*].relevance_score\"}}}\n\"\"\"))\n )\n);\n" PutCustomRequestExample3: summary: Custom text embedding task (Cohere APIv2) description: Run `PUT _inference/text_embedding/custom-text-embedding` to create an inference endpoint that performs a text embedding task. value: "{\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"https://api.cohere.com/v2/embed\",\n \"headers\": {\n \"Authorization\": \"bearer ${api_key}\",\n \"Content-Type\": \"application/json\"\n },\n \"request\": \"{\\\"texts\\\": ${input}, \\\"model\\\": \\\"embed-v4.0\\\", \\\"input_type\\\": ${input_type}}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\":\"$.embeddings.float[*]\"\n }\n },\n \"input_type\": {\n \"translation\": {\n \"ingest\": \"search_document\",\n \"search\": \"search_query\"\n },\n \"default\": \"search_document\"\n }\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/custom-text-embedding\n{\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"https://api.cohere.com/v2/embed\",\n \"headers\": {\n \"Authorization\": \"bearer ${api_key}\",\n \"Content-Type\": \"application/json\"\n },\n \"request\": \"{\\\"texts\\\": ${input}, \\\"model\\\": \\\"embed-v4.0\\\", \\\"input_type\\\": ${input_type}}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\":\"$.embeddings.float[*]\"\n }\n },\n \"input_type\": {\n \"translation\": {\n \"ingest\": \"search_document\",\n \"search\": \"search_query\"\n },\n \"default\": \"search_document\"\n }\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"custom-text-embedding\",\n inference_config={\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"https://api.cohere.com/v2/embed\",\n \"headers\": {\n \"Authorization\": \"bearer ${api_key}\",\n \"Content-Type\": \"application/json\"\n },\n \"request\": \"{\\\"texts\\\": ${input}, \\\"model\\\": \\\"embed-v4.0\\\", \\\"input_type\\\": ${input_type}}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\": \"$.embeddings.float[*]\"\n }\n },\n \"input_type\": {\n \"translation\": {\n \"ingest\": \"search_document\",\n \"search\": \"search_query\"\n },\n \"default\": \"search_document\"\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"custom-text-embedding\",\n inference_config: {\n service: \"custom\",\n service_settings: {\n secret_parameters: {\n api_key: \"\",\n },\n url: \"https://api.cohere.com/v2/embed\",\n headers: {\n Authorization: \"bearer ${api_key}\",\n \"Content-Type\": \"application/json\",\n },\n request:\n '{\"texts\": ${input}, \"model\": \"embed-v4.0\", \"input_type\": ${input_type}}',\n response: {\n json_parser: {\n text_embeddings: \"$.embeddings.float[*]\",\n },\n },\n input_type: {\n translation: {\n ingest: \"search_document\",\n search: \"search_query\",\n },\n default: \"search_document\",\n },\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"custom-text-embedding\",\n body: {\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"https://api.cohere.com/v2/embed\",\n \"headers\": {\n \"Authorization\": \"bearer ${api_key}\",\n \"Content-Type\": \"application/json\"\n },\n \"request\": \"{\\\"texts\\\": ${input}, \\\"model\\\": \\\"embed-v4.0\\\", \\\"input_type\\\": ${input_type}}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\": \"$.embeddings.float[*]\"\n }\n },\n \"input_type\": {\n \"translation\": {\n \"ingest\": \"search_document\",\n \"search\": \"search_query\"\n },\n \"default\": \"search_document\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"custom-text-embedding\",\n \"body\" => [\n \"service\" => \"custom\",\n \"service_settings\" => [\n \"secret_parameters\" => [\n \"api_key\" => \"\",\n ],\n \"url\" => \"https://api.cohere.com/v2/embed\",\n \"headers\" => [\n \"Authorization\" => \"bearer \\${api_key}\",\n \"Content-Type\" => \"application/json\",\n ],\n \"request\" => \"{\\\"texts\\\": \\${input}, \\\"model\\\": \\\"embed-v4.0\\\", \\\"input_type\\\": \\${input_type}}\",\n \"response\" => [\n \"json_parser\" => [\n \"text_embeddings\" => \"$.embeddings.float[*]\",\n ],\n ],\n \"input_type\" => [\n \"translation\" => [\n \"ingest\" => \"search_document\",\n \"search\" => \"search_query\",\n ],\n \"default\" => \"search_document\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"custom","service_settings":{"secret_parameters":{"api_key":""},"url":"https://api.cohere.com/v2/embed","headers":{"Authorization":"bearer ${api_key}","Content-Type":"application/json"},"request":"{\"texts\": ${input}, \"model\": \"embed-v4.0\", \"input_type\": ${input_type}}","response":{"json_parser":{"text_embeddings":"$.embeddings.float[*]"}},"input_type":{"translation":{"ingest":"search_document","search":"search_query"},"default":"search_document"}}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/custom-text-embedding"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"custom-text-embedding\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"custom\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"secret_parameters\": {\n \"api_key\": \"\\u003Capi key\\u003E\"\n },\n \"url\": \"https://api.cohere.com/v2/embed\",\n \"headers\": {\n \"Authorization\": \"bearer ${api_key}\",\n \"Content-Type\": \"application/json\"\n },\n \"request\": \"{\\u0022texts\\u0022: ${input}, \\u0022model\\u0022: \\u0022embed-v4.0\\u0022, \\u0022input_type\\u0022: ${input_type}}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\": \"$.embeddings.float[*]\"\n }\n },\n \"input_type\": {\n \"translation\": {\n \"ingest\": \"search_document\",\n \"search\": \"search_query\"\n },\n \"default\": \"search_document\"\n }\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"custom-text-embedding\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"custom\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"secret_parameters\":{\"api_key\":\"\"},\"url\":\"https://api.cohere.com/v2/embed\",\"headers\":{\"Authorization\":\"bearer ${api_key}\",\"Content-Type\":\"application/json\"},\"request\":\"{\\\"texts\\\": ${input}, \\\"model\\\": \\\"embed-v4.0\\\", \\\"input_type\\\": ${input_type}}\",\"response\":{\"json_parser\":{\"text_embeddings\":\"$.embeddings.float[*]\"}},\"input_type\":{\"translation\":{\"ingest\":\"search_document\",\"search\":\"search_query\"},\"default\":\"search_document\"}}\n\"\"\"))\n )\n);\n" PutCustomRequestExample4: summary: Custom rerank task (Jina AI) description: Run `PUT _inference/rerank/custom-rerank-jina` to create an inference endpoint that performs a rerank task. value: "{\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n }, \n \"url\": \"https://api.jina.ai/v1/rerank\",\n \"headers\": {\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer ${api_key}\"\n },\n \"request\": \"{\\\"model\\\": \\\"jina-reranker-v2-base-multilingual\\\",\\\"query\\\": ${query},\\\"documents\\\":${input}}\",\n \"response\": {\n \"json_parser\": {\n \"relevance_score\": \"$.results[*].relevance_score\",\n \"reranked_index\": \"$.results[*].index\"\n }\n }\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/rerank/custom-rerank-jina\n{\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n }, \n \"url\": \"https://api.jina.ai/v1/rerank\",\n \"headers\": {\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer ${api_key}\"\n },\n \"request\": \"{\\\"model\\\": \\\"jina-reranker-v2-base-multilingual\\\",\\\"query\\\": ${query},\\\"documents\\\":${input}}\",\n \"response\": {\n \"json_parser\": {\n \"relevance_score\": \"$.results[*].relevance_score\",\n \"reranked_index\": \"$.results[*].index\"\n }\n }\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"custom-rerank-jina\",\n inference_config={\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"https://api.jina.ai/v1/rerank\",\n \"headers\": {\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer ${api_key}\"\n },\n \"request\": \"{\\\"model\\\": \\\"jina-reranker-v2-base-multilingual\\\",\\\"query\\\": ${query},\\\"documents\\\":${input}}\",\n \"response\": {\n \"json_parser\": {\n \"relevance_score\": \"$.results[*].relevance_score\",\n \"reranked_index\": \"$.results[*].index\"\n }\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"custom-rerank-jina\",\n inference_config: {\n service: \"custom\",\n service_settings: {\n secret_parameters: {\n api_key: \"\",\n },\n url: \"https://api.jina.ai/v1/rerank\",\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: \"Bearer ${api_key}\",\n },\n request:\n '{\"model\": \"jina-reranker-v2-base-multilingual\",\"query\": ${query},\"documents\":${input}}',\n response: {\n json_parser: {\n relevance_score: \"$.results[*].relevance_score\",\n reranked_index: \"$.results[*].index\",\n },\n },\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"custom-rerank-jina\",\n body: {\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"https://api.jina.ai/v1/rerank\",\n \"headers\": {\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer ${api_key}\"\n },\n \"request\": \"{\\\"model\\\": \\\"jina-reranker-v2-base-multilingual\\\",\\\"query\\\": ${query},\\\"documents\\\":${input}}\",\n \"response\": {\n \"json_parser\": {\n \"relevance_score\": \"$.results[*].relevance_score\",\n \"reranked_index\": \"$.results[*].index\"\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"custom-rerank-jina\",\n \"body\" => [\n \"service\" => \"custom\",\n \"service_settings\" => [\n \"secret_parameters\" => [\n \"api_key\" => \"\",\n ],\n \"url\" => \"https://api.jina.ai/v1/rerank\",\n \"headers\" => [\n \"Content-Type\" => \"application/json\",\n \"Authorization\" => \"Bearer \\${api_key}\",\n ],\n \"request\" => \"{\\\"model\\\": \\\"jina-reranker-v2-base-multilingual\\\",\\\"query\\\": \\${query},\\\"documents\\\":\\${input}}\",\n \"response\" => [\n \"json_parser\" => [\n \"relevance_score\" => \"$.results[*].relevance_score\",\n \"reranked_index\" => \"$.results[*].index\",\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"custom","service_settings":{"secret_parameters":{"api_key":""},"url":"https://api.jina.ai/v1/rerank","headers":{"Content-Type":"application/json","Authorization":"Bearer ${api_key}"},"request":"{\"model\": \"jina-reranker-v2-base-multilingual\",\"query\": ${query},\"documents\":${input}}","response":{"json_parser":{"relevance_score":"$.results[*].relevance_score","reranked_index":"$.results[*].index"}}}}'' "$ELASTICSEARCH_URL/_inference/rerank/custom-rerank-jina"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"custom-rerank-jina\",\n TaskType = TaskType.Rerank,\n InferenceConfig = new()\n {\n Service = \"custom\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"secret_parameters\": {\n \"api_key\": \"\\u003Capi key\\u003E\"\n },\n \"url\": \"https://api.jina.ai/v1/rerank\",\n \"headers\": {\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer ${api_key}\"\n },\n \"request\": \"{\\u0022model\\u0022: \\u0022jina-reranker-v2-base-multilingual\\u0022,\\u0022query\\u0022: ${query},\\u0022documents\\u0022:${input}}\",\n \"response\": {\n \"json_parser\": {\n \"relevance_score\": \"$.results[*].relevance_score\",\n \"reranked_index\": \"$.results[*].index\"\n }\n }\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"custom-rerank-jina\")\n .taskType(TaskType.Rerank)\n .inferenceConfig(i -> i\n .service(\"custom\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"secret_parameters\":{\"api_key\":\"\"},\"url\":\"https://api.jina.ai/v1/rerank\",\"headers\":{\"Content-Type\":\"application/json\",\"Authorization\":\"Bearer ${api_key}\"},\"request\":\"{\\\"model\\\": \\\"jina-reranker-v2-base-multilingual\\\",\\\"query\\\": ${query},\\\"documents\\\":${input}}\",\"response\":{\"json_parser\":{\"relevance_score\":\"$.results[*].relevance_score\",\"reranked_index\":\"$.results[*].index\"}}}\n\"\"\"))\n )\n);\n" PutCustomRequestExample5: summary: Custom text embedding task (Hugging Face) description: Run `PUT _inference/text_embedding/custom-text-embedding-hf` to create an inference endpoint that performs a text embedding task by using the Qwen/Qwen3-Embedding-8B model. value: "{\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"/v1/embeddings\",\n \"headers\": {\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json\"\n },\n \"request\": \"{\\\"input\\\": ${input}}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\":\"$.data[*].embedding[*]\"\n }\n }\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/custom-text-embedding-hf\n{\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"/v1/embeddings\",\n \"headers\": {\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json\"\n },\n \"request\": \"{\\\"input\\\": ${input}}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\":\"$.data[*].embedding[*]\"\n }\n }\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"custom-text-embedding-hf\",\n inference_config={\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"/v1/embeddings\",\n \"headers\": {\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json\"\n },\n \"request\": \"{\\\"input\\\": ${input}}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\": \"$.data[*].embedding[*]\"\n }\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"custom-text-embedding-hf\",\n inference_config: {\n service: \"custom\",\n service_settings: {\n secret_parameters: {\n api_key: \"\",\n },\n url: \"/v1/embeddings\",\n headers: {\n Authorization: \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json\",\n },\n request: '{\"input\": ${input}}',\n response: {\n json_parser: {\n text_embeddings: \"$.data[*].embedding[*]\",\n },\n },\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"custom-text-embedding-hf\",\n body: {\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"/v1/embeddings\",\n \"headers\": {\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json\"\n },\n \"request\": \"{\\\"input\\\": ${input}}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\": \"$.data[*].embedding[*]\"\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"custom-text-embedding-hf\",\n \"body\" => [\n \"service\" => \"custom\",\n \"service_settings\" => [\n \"secret_parameters\" => [\n \"api_key\" => \"\",\n ],\n \"url\" => \"/v1/embeddings\",\n \"headers\" => [\n \"Authorization\" => \"Bearer \\${api_key}\",\n \"Content-Type\" => \"application/json\",\n ],\n \"request\" => \"{\\\"input\\\": \\${input}}\",\n \"response\" => [\n \"json_parser\" => [\n \"text_embeddings\" => \"$.data[*].embedding[*]\",\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"custom","service_settings":{"secret_parameters":{"api_key":""},"url":"/v1/embeddings","headers":{"Authorization":"Bearer ${api_key}","Content-Type":"application/json"},"request":"{\"input\": ${input}}","response":{"json_parser":{"text_embeddings":"$.data[*].embedding[*]"}}}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/custom-text-embedding-hf"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"custom-text-embedding-hf\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"custom\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"secret_parameters\": {\n \"api_key\": \"\\u003Capi key\\u003E\"\n },\n \"url\": \"\\u003Cdedicated inference endpoint on HF\\u003E/v1/embeddings\",\n \"headers\": {\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json\"\n },\n \"request\": \"{\\u0022input\\u0022: ${input}}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\": \"$.data[*].embedding[*]\"\n }\n }\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"custom-text-embedding-hf\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"custom\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"secret_parameters\":{\"api_key\":\"\"},\"url\":\"/v1/embeddings\",\"headers\":{\"Authorization\":\"Bearer ${api_key}\",\"Content-Type\":\"application/json\"},\"request\":\"{\\\"input\\\": ${input}}\",\"response\":{\"json_parser\":{\"text_embeddings\":\"$.data[*].embedding[*]\"}}}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoCustom' x-state: Generally available; Added in 8.19.0 x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/custom-embeddings\n{\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"https://api.openai.com/v1/embeddings\",\n \"headers\": {\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json;charset=utf-8\"\n },\n \"request\": \"{\\\"input\\\": ${input}, \\\"model\\\": \\\"text-embedding-3-small\\\"}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\": \"$.data[*].embedding[*]\"\n }\n }\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"custom-embeddings\",\n inference_config={\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"https://api.openai.com/v1/embeddings\",\n \"headers\": {\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json;charset=utf-8\"\n },\n \"request\": \"{\\\"input\\\": ${input}, \\\"model\\\": \\\"text-embedding-3-small\\\"}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\": \"$.data[*].embedding[*]\"\n }\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"custom-embeddings\",\n inference_config: {\n service: \"custom\",\n service_settings: {\n secret_parameters: {\n api_key: \"\",\n },\n url: \"https://api.openai.com/v1/embeddings\",\n headers: {\n Authorization: \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json;charset=utf-8\",\n },\n request: '{\"input\": ${input}, \"model\": \"text-embedding-3-small\"}',\n response: {\n json_parser: {\n text_embeddings: \"$.data[*].embedding[*]\",\n },\n },\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"custom-embeddings\",\n body: {\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"https://api.openai.com/v1/embeddings\",\n \"headers\": {\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json;charset=utf-8\"\n },\n \"request\": \"{\\\"input\\\": ${input}, \\\"model\\\": \\\"text-embedding-3-small\\\"}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\": \"$.data[*].embedding[*]\"\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"custom-embeddings\",\n \"body\" => [\n \"service\" => \"custom\",\n \"service_settings\" => [\n \"secret_parameters\" => [\n \"api_key\" => \"\",\n ],\n \"url\" => \"https://api.openai.com/v1/embeddings\",\n \"headers\" => [\n \"Authorization\" => \"Bearer \\${api_key}\",\n \"Content-Type\" => \"application/json;charset=utf-8\",\n ],\n \"request\" => \"{\\\"input\\\": \\${input}, \\\"model\\\": \\\"text-embedding-3-small\\\"}\",\n \"response\" => [\n \"json_parser\" => [\n \"text_embeddings\" => \"$.data[*].embedding[*]\",\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"custom","service_settings":{"secret_parameters":{"api_key":""},"url":"https://api.openai.com/v1/embeddings","headers":{"Authorization":"Bearer ${api_key}","Content-Type":"application/json;charset=utf-8"},"request":"{\"input\": ${input}, \"model\": \"text-embedding-3-small\"}","response":{"json_parser":{"text_embeddings":"$.data[*].embedding[*]"}}}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/custom-embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"custom-embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"custom\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"secret_parameters\": {\n \"api_key\": \"\\u003Capi key\\u003E\"\n },\n \"url\": \"https://api.openai.com/v1/embeddings\",\n \"headers\": {\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json;charset=utf-8\"\n },\n \"request\": \"{\\u0022input\\u0022: ${input}, \\u0022model\\u0022: \\u0022text-embedding-3-small\\u0022}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\": \"$.data[*].embedding[*]\"\n }\n }\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"custom-embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"custom\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"secret_parameters\":{\"api_key\":\"\"},\"url\":\"https://api.openai.com/v1/embeddings\",\"headers\":{\"Authorization\":\"Bearer ${api_key}\",\"Content-Type\":\"application/json;charset=utf-8\"},\"request\":\"{\\\"input\\\": ${input}, \\\"model\\\": \\\"text-embedding-3-small\\\"}\",\"response\":{\"json_parser\":{\"text_embeddings\":\"$.data[*].embedding[*]\"}}}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{deepseek_inference_id}': put: tags: - inference summary: Create a DeepSeek inference endpoint description: "Create an inference endpoint to perform an inference task with the `deepseek` service.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-deepseek parameters: - name: task_type in: path description: The type of the inference task that the model will perform. required: true schema: $ref: '#/components/schemas/inference._types.TaskTypeDeepSeek' - name: deepseek_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: service: allOf: - $ref: '#/components/schemas/inference._types.DeepSeekServiceType' description: 'The type of service supported for the specified task type. In this case, `deepseek`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.DeepSeekServiceSettings' description: "Settings used to install the inference model.\nThese settings are specific to the `deepseek` service." required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoDeepSeek' x-state: Generally available; Added in 9.1.0 x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{elasticsearch_inference_id}': put: tags: - inference summary: Create an Elasticsearch inference endpoint description: "Create an inference endpoint to perform an inference task with the `elasticsearch` service.\n\n> info\n> Your Elasticsearch deployment contains preconfigured ELSER and E5 inference endpoints, you only need to create the enpoints using the API if you want to customize the settings.\n\nIf you use the ELSER or the E5 model through the `elasticsearch` service, the API request will automatically download and deploy the model if it isn't downloaded yet.\n\n> info\n> You might see a 502 bad gateway error in the response when using the Kibana Console. This error usually just reflects a timeout, while the model downloads in the background. You can check the download progress in the Machine Learning UI. If using the Python client, you can set the timeout parameter to a higher value.\n\nAfter creating the endpoint, wait for the model deployment to complete before using it.\nTo verify the deployment status, use the get trained model statistics API.\nLook for `\"state\": \"fully_allocated\"` in the response and ensure that the `\"allocation_count\"` matches the `\"target_allocation_count\"`.\nAvoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-elasticsearch parameters: - name: task_type in: path description: The type of the inference task that the model will perform. required: true schema: $ref: '#/components/schemas/inference._types.ElasticsearchTaskType' - name: elasticsearch_inference_id in: path description: "The unique identifier of the inference endpoint.\nThe must not match the `model_id`." required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: chunking_settings: allOf: - $ref: '#/components/schemas/inference._types.InferenceChunkingSettings' description: "The chunking configuration object.\nApplies only to the `sparse_embedding` and `text_embedding` task types.\nNot applicable to the `rerank` task type." externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config service: allOf: - $ref: '#/components/schemas/inference._types.ElasticsearchServiceType' description: 'The type of service supported for the specified task type. In this case, `elasticsearch`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.ElasticsearchServiceSettings' description: Settings used to install the inference model. These settings are specific to the `elasticsearch` service. task_settings: allOf: - $ref: '#/components/schemas/inference._types.ElasticsearchTaskSettings' description: "Settings to configure the inference task.\nThese settings are specific to the task type you specified." examples: PutElasticsearchRequestExample1: summary: ELSER sparse embedding task description: Run `PUT _inference/sparse_embedding/my-elser-model` to create an inference endpoint that performs a `sparse_embedding` task. The `model_id` must be the ID of one of the built-in ELSER models. The API will automatically download the ELSER model if it isn't already downloaded and then deploy the model. value: "{\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"adaptive_allocations\": { \n \"enabled\": true,\n \"min_number_of_allocations\": 1,\n \"max_number_of_allocations\": 4\n },\n \"num_threads\": 1,\n \"model_id\": \".elser_model_2\" \n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/sparse_embedding/my-elser-model\n{\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"adaptive_allocations\": { \n \"enabled\": true,\n \"min_number_of_allocations\": 1,\n \"max_number_of_allocations\": 4\n },\n \"num_threads\": 1,\n \"model_id\": \".elser_model_2\" \n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"sparse_embedding\",\n inference_id=\"my-elser-model\",\n inference_config={\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"adaptive_allocations\": {\n \"enabled\": True,\n \"min_number_of_allocations\": 1,\n \"max_number_of_allocations\": 4\n },\n \"num_threads\": 1,\n \"model_id\": \".elser_model_2\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n inference_config: {\n service: \"elasticsearch\",\n service_settings: {\n adaptive_allocations: {\n enabled: true,\n min_number_of_allocations: 1,\n max_number_of_allocations: 4,\n },\n num_threads: 1,\n model_id: \".elser_model_2\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n body: {\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"adaptive_allocations\": {\n \"enabled\": true,\n \"min_number_of_allocations\": 1,\n \"max_number_of_allocations\": 4\n },\n \"num_threads\": 1,\n \"model_id\": \".elser_model_2\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"my-elser-model\",\n \"body\" => [\n \"service\" => \"elasticsearch\",\n \"service_settings\" => [\n \"adaptive_allocations\" => [\n \"enabled\" => true,\n \"min_number_of_allocations\" => 1,\n \"max_number_of_allocations\" => 4,\n ],\n \"num_threads\" => 1,\n \"model_id\" => \".elser_model_2\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"elasticsearch","service_settings":{"adaptive_allocations":{"enabled":true,"min_number_of_allocations":1,"max_number_of_allocations":4},"num_threads":1,"model_id":".elser_model_2"}}'' "$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"my-elser-model\",\n TaskType = TaskType.SparseEmbedding,\n InferenceConfig = new()\n {\n Service = \"elasticsearch\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"adaptive_allocations\": {\n \"enabled\": true,\n \"min_number_of_allocations\": 1,\n \"max_number_of_allocations\": 4\n },\n \"num_threads\": 1,\n \"model_id\": \".elser_model_2\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"my-elser-model\")\n .taskType(TaskType.SparseEmbedding)\n .inferenceConfig(i -> i\n .service(\"elasticsearch\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"adaptive_allocations\":{\"enabled\":true,\"min_number_of_allocations\":1,\"max_number_of_allocations\":4},\"num_threads\":1,\"model_id\":\".elser_model_2\"}\n\"\"\"))\n )\n);\n" PutElasticsearchRequestExample2: summary: Elastic rerank task description: 'Run `PUT _inference/rerank/my-elastic-rerank` to create an inference endpoint that performs a rerank task using the built-in Elastic Rerank cross-encoder model. The `model_id` must be `.rerank-v1`, which is the ID of the built-in Elastic Rerank model. The API will automatically download the Elastic Rerank model if it isn''t already downloaded and then deploy the model. Once deployed, the model can be used for semantic re-ranking with a `text_similarity_reranker` retriever.' value: "{\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"model_id\": \".rerank-v1\", \n \"num_threads\": 1,\n \"adaptive_allocations\": { \n \"enabled\": true,\n \"min_number_of_allocations\": 1,\n \"max_number_of_allocations\": 4\n }\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/rerank/my-elastic-rerank\n{\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"model_id\": \".rerank-v1\", \n \"num_threads\": 1,\n \"adaptive_allocations\": { \n \"enabled\": true,\n \"min_number_of_allocations\": 1,\n \"max_number_of_allocations\": 4\n }\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"my-elastic-rerank\",\n inference_config={\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"model_id\": \".rerank-v1\",\n \"num_threads\": 1,\n \"adaptive_allocations\": {\n \"enabled\": True,\n \"min_number_of_allocations\": 1,\n \"max_number_of_allocations\": 4\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"my-elastic-rerank\",\n inference_config: {\n service: \"elasticsearch\",\n service_settings: {\n model_id: \".rerank-v1\",\n num_threads: 1,\n adaptive_allocations: {\n enabled: true,\n min_number_of_allocations: 1,\n max_number_of_allocations: 4,\n },\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"my-elastic-rerank\",\n body: {\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"model_id\": \".rerank-v1\",\n \"num_threads\": 1,\n \"adaptive_allocations\": {\n \"enabled\": true,\n \"min_number_of_allocations\": 1,\n \"max_number_of_allocations\": 4\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"my-elastic-rerank\",\n \"body\" => [\n \"service\" => \"elasticsearch\",\n \"service_settings\" => [\n \"model_id\" => \".rerank-v1\",\n \"num_threads\" => 1,\n \"adaptive_allocations\" => [\n \"enabled\" => true,\n \"min_number_of_allocations\" => 1,\n \"max_number_of_allocations\" => 4,\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"elasticsearch","service_settings":{"model_id":".rerank-v1","num_threads":1,"adaptive_allocations":{"enabled":true,"min_number_of_allocations":1,"max_number_of_allocations":4}}}'' "$ELASTICSEARCH_URL/_inference/rerank/my-elastic-rerank"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"my-elastic-rerank\",\n TaskType = TaskType.Rerank,\n InferenceConfig = new()\n {\n Service = \"elasticsearch\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"model_id\": \".rerank-v1\",\n \"num_threads\": 1,\n \"adaptive_allocations\": {\n \"enabled\": true,\n \"min_number_of_allocations\": 1,\n \"max_number_of_allocations\": 4\n }\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"my-elastic-rerank\")\n .taskType(TaskType.Rerank)\n .inferenceConfig(i -> i\n .service(\"elasticsearch\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"model_id\":\".rerank-v1\",\"num_threads\":1,\"adaptive_allocations\":{\"enabled\":true,\"min_number_of_allocations\":1,\"max_number_of_allocations\":4}}\n\"\"\"))\n )\n);\n" PutElasticsearchRequestExample3: summary: E5 text embedding task description: Run `PUT _inference/text_embedding/my-e5-model` to create an inference endpoint that performs a `text_embedding` task. The `model_id` must be the ID of one of the built-in E5 models. The API will automatically download the E5 model if it isn't already downloaded and then deploy the model. value: "{\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"num_allocations\": 1,\n \"num_threads\": 1,\n \"model_id\": \".multilingual-e5-small\" \n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/my-e5-model\n{\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"num_allocations\": 1,\n \"num_threads\": 1,\n \"model_id\": \".multilingual-e5-small\" \n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"my-e5-model\",\n inference_config={\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"num_allocations\": 1,\n \"num_threads\": 1,\n \"model_id\": \".multilingual-e5-small\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"my-e5-model\",\n inference_config: {\n service: \"elasticsearch\",\n service_settings: {\n num_allocations: 1,\n num_threads: 1,\n model_id: \".multilingual-e5-small\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"my-e5-model\",\n body: {\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"num_allocations\": 1,\n \"num_threads\": 1,\n \"model_id\": \".multilingual-e5-small\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"my-e5-model\",\n \"body\" => [\n \"service\" => \"elasticsearch\",\n \"service_settings\" => [\n \"num_allocations\" => 1,\n \"num_threads\" => 1,\n \"model_id\" => \".multilingual-e5-small\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"elasticsearch","service_settings":{"num_allocations":1,"num_threads":1,"model_id":".multilingual-e5-small"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/my-e5-model"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"my-e5-model\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"elasticsearch\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"num_allocations\": 1,\n \"num_threads\": 1,\n \"model_id\": \".multilingual-e5-small\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"my-e5-model\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"elasticsearch\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"num_allocations\":1,\"num_threads\":1,\"model_id\":\".multilingual-e5-small\"}\n\"\"\"))\n )\n);\n" PutElasticsearchRequestExample4: summary: Eland text embedding task description: Run `PUT _inference/text_embedding/my-msmarco-minilm-model` to create an inference endpoint that performs a `text_embedding` task with a model that was uploaded by Eland. value: "{\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"num_allocations\": 1,\n \"num_threads\": 1,\n \"model_id\": \"msmarco-MiniLM-L12-cos-v5\" \n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/my-msmarco-minilm-model\n{\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"num_allocations\": 1,\n \"num_threads\": 1,\n \"model_id\": \"msmarco-MiniLM-L12-cos-v5\" \n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"my-msmarco-minilm-model\",\n inference_config={\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"num_allocations\": 1,\n \"num_threads\": 1,\n \"model_id\": \"msmarco-MiniLM-L12-cos-v5\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"my-msmarco-minilm-model\",\n inference_config: {\n service: \"elasticsearch\",\n service_settings: {\n num_allocations: 1,\n num_threads: 1,\n model_id: \"msmarco-MiniLM-L12-cos-v5\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"my-msmarco-minilm-model\",\n body: {\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"num_allocations\": 1,\n \"num_threads\": 1,\n \"model_id\": \"msmarco-MiniLM-L12-cos-v5\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"my-msmarco-minilm-model\",\n \"body\" => [\n \"service\" => \"elasticsearch\",\n \"service_settings\" => [\n \"num_allocations\" => 1,\n \"num_threads\" => 1,\n \"model_id\" => \"msmarco-MiniLM-L12-cos-v5\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"elasticsearch","service_settings":{"num_allocations":1,"num_threads":1,"model_id":"msmarco-MiniLM-L12-cos-v5"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/my-msmarco-minilm-model"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"my-msmarco-minilm-model\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"elasticsearch\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"num_allocations\": 1,\n \"num_threads\": 1,\n \"model_id\": \"msmarco-MiniLM-L12-cos-v5\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"my-msmarco-minilm-model\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"elasticsearch\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"num_allocations\":1,\"num_threads\":1,\"model_id\":\"msmarco-MiniLM-L12-cos-v5\"}\n\"\"\"))\n )\n);\n" PutElasticsearchRequestExample5: summary: Adaptive allocation description: Run `PUT _inference/text_embedding/my-e5-model` to create an inference endpoint that performs a `text_embedding` task and to configure adaptive allocations. The API request will automatically download the E5 model if it isn't already downloaded and then deploy the model. value: "{\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"adaptive_allocations\": {\n \"enabled\": true,\n \"min_number_of_allocations\": 3,\n \"max_number_of_allocations\": 10\n },\n \"num_threads\": 1,\n \"model_id\": \".multilingual-e5-small\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/my-e5-model\n{\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"adaptive_allocations\": {\n \"enabled\": true,\n \"min_number_of_allocations\": 3,\n \"max_number_of_allocations\": 10\n },\n \"num_threads\": 1,\n \"model_id\": \".multilingual-e5-small\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"my-e5-model\",\n inference_config={\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"adaptive_allocations\": {\n \"enabled\": True,\n \"min_number_of_allocations\": 3,\n \"max_number_of_allocations\": 10\n },\n \"num_threads\": 1,\n \"model_id\": \".multilingual-e5-small\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"my-e5-model\",\n inference_config: {\n service: \"elasticsearch\",\n service_settings: {\n adaptive_allocations: {\n enabled: true,\n min_number_of_allocations: 3,\n max_number_of_allocations: 10,\n },\n num_threads: 1,\n model_id: \".multilingual-e5-small\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"my-e5-model\",\n body: {\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"adaptive_allocations\": {\n \"enabled\": true,\n \"min_number_of_allocations\": 3,\n \"max_number_of_allocations\": 10\n },\n \"num_threads\": 1,\n \"model_id\": \".multilingual-e5-small\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"my-e5-model\",\n \"body\" => [\n \"service\" => \"elasticsearch\",\n \"service_settings\" => [\n \"adaptive_allocations\" => [\n \"enabled\" => true,\n \"min_number_of_allocations\" => 3,\n \"max_number_of_allocations\" => 10,\n ],\n \"num_threads\" => 1,\n \"model_id\" => \".multilingual-e5-small\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"elasticsearch","service_settings":{"adaptive_allocations":{"enabled":true,"min_number_of_allocations":3,"max_number_of_allocations":10},"num_threads":1,"model_id":".multilingual-e5-small"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/my-e5-model"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"my-e5-model\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"elasticsearch\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"adaptive_allocations\": {\n \"enabled\": true,\n \"min_number_of_allocations\": 3,\n \"max_number_of_allocations\": 10\n },\n \"num_threads\": 1,\n \"model_id\": \".multilingual-e5-small\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"my-e5-model\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"elasticsearch\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"adaptive_allocations\":{\"enabled\":true,\"min_number_of_allocations\":3,\"max_number_of_allocations\":10},\"num_threads\":1,\"model_id\":\".multilingual-e5-small\"}\n\"\"\"))\n )\n);\n" PutElasticsearchRequestExample6: summary: Existing model deployment description: Run `PUT _inference/sparse_embedding/use_existing_deployment` to use an already existing model deployment when creating an inference endpoint. value: "{\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"deployment_id\": \".elser_model_2\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/sparse_embedding/use_existing_deployment\n{\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"deployment_id\": \".elser_model_2\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"sparse_embedding\",\n inference_id=\"use_existing_deployment\",\n inference_config={\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"deployment_id\": \".elser_model_2\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"sparse_embedding\",\n inference_id: \"use_existing_deployment\",\n inference_config: {\n service: \"elasticsearch\",\n service_settings: {\n deployment_id: \".elser_model_2\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"sparse_embedding\",\n inference_id: \"use_existing_deployment\",\n body: {\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"deployment_id\": \".elser_model_2\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"use_existing_deployment\",\n \"body\" => [\n \"service\" => \"elasticsearch\",\n \"service_settings\" => [\n \"deployment_id\" => \".elser_model_2\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"elasticsearch","service_settings":{"deployment_id":".elser_model_2"}}'' "$ELASTICSEARCH_URL/_inference/sparse_embedding/use_existing_deployment"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"use_existing_deployment\",\n TaskType = TaskType.SparseEmbedding,\n InferenceConfig = new()\n {\n Service = \"elasticsearch\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"deployment_id\": \".elser_model_2\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"use_existing_deployment\")\n .taskType(TaskType.SparseEmbedding)\n .inferenceConfig(i -> i\n .service(\"elasticsearch\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"deployment_id\":\".elser_model_2\"}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoElasticsearch' examples: PutElasticsearchResponseExample1: description: "A successful response from `PUT _inference/sparse_embedding/use_existing_deployment`. It contains the model ID and the threads and allocations settings from the model deployment.\n" value: "{\n \"inference_id\": \"use_existing_deployment\",\n \"task_type\": \"sparse_embedding\",\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"num_allocations\": 2,\n \"num_threads\": 1,\n \"model_id\": \".elser_model_2\",\n \"deployment_id\": \".elser_model_2\"\n },\n \"chunking_settings\": {\n \"strategy\": \"sentence\",\n \"max_chunk_size\": 250,\n \"sentence_overlap\": 1\n }\n}" x-state: Generally available; Added in 8.13.0 x-codeSamples: - lang: Console source: "PUT _inference/sparse_embedding/my-elser-model\n{\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"adaptive_allocations\": { \n \"enabled\": true,\n \"min_number_of_allocations\": 1,\n \"max_number_of_allocations\": 4\n },\n \"num_threads\": 1,\n \"model_id\": \".elser_model_2\" \n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"sparse_embedding\",\n inference_id=\"my-elser-model\",\n inference_config={\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"adaptive_allocations\": {\n \"enabled\": True,\n \"min_number_of_allocations\": 1,\n \"max_number_of_allocations\": 4\n },\n \"num_threads\": 1,\n \"model_id\": \".elser_model_2\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n inference_config: {\n service: \"elasticsearch\",\n service_settings: {\n adaptive_allocations: {\n enabled: true,\n min_number_of_allocations: 1,\n max_number_of_allocations: 4,\n },\n num_threads: 1,\n model_id: \".elser_model_2\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n body: {\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"adaptive_allocations\": {\n \"enabled\": true,\n \"min_number_of_allocations\": 1,\n \"max_number_of_allocations\": 4\n },\n \"num_threads\": 1,\n \"model_id\": \".elser_model_2\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"my-elser-model\",\n \"body\" => [\n \"service\" => \"elasticsearch\",\n \"service_settings\" => [\n \"adaptive_allocations\" => [\n \"enabled\" => true,\n \"min_number_of_allocations\" => 1,\n \"max_number_of_allocations\" => 4,\n ],\n \"num_threads\" => 1,\n \"model_id\" => \".elser_model_2\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"elasticsearch","service_settings":{"adaptive_allocations":{"enabled":true,"min_number_of_allocations":1,"max_number_of_allocations":4},"num_threads":1,"model_id":".elser_model_2"}}'' "$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"my-elser-model\",\n TaskType = TaskType.SparseEmbedding,\n InferenceConfig = new()\n {\n Service = \"elasticsearch\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"adaptive_allocations\": {\n \"enabled\": true,\n \"min_number_of_allocations\": 1,\n \"max_number_of_allocations\": 4\n },\n \"num_threads\": 1,\n \"model_id\": \".elser_model_2\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"my-elser-model\")\n .taskType(TaskType.SparseEmbedding)\n .inferenceConfig(i -> i\n .service(\"elasticsearch\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"adaptive_allocations\":{\"enabled\":true,\"min_number_of_allocations\":1,\"max_number_of_allocations\":4},\"num_threads\":1,\"model_id\":\".elser_model_2\"}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{elser_inference_id}': put: tags: - inference summary: Create an ELSER inference endpoint description: "Create an inference endpoint to perform an inference task with the `elser` service.\nYou can also deploy ELSER by using the Elasticsearch inference integration.\n\n> info\n> Your Elasticsearch deployment contains a preconfigured ELSER inference endpoint, you only need to create the enpoint using the API if you want to customize the settings.\n\nThe API request will automatically download and deploy the ELSER model if it isn't already downloaded.\n\n> info\n> You might see a 502 bad gateway error in the response when using the Kibana Console. This error usually just reflects a timeout, while the model downloads in the background. You can check the download progress in the Machine Learning UI. If using the Python client, you can set the timeout parameter to a higher value.\n\nAfter creating the endpoint, wait for the model deployment to complete before using it.\nTo verify the deployment status, use the get trained model statistics API.\nLook for `\"state\": \"fully_allocated\"` in the response and ensure that the `\"allocation_count\"` matches the `\"target_allocation_count\"`.\nAvoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-elser parameters: - name: task_type in: path description: The type of the inference task that the model will perform. required: true schema: $ref: '#/components/schemas/inference._types.ElserTaskType' - name: elser_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: chunking_settings: allOf: - $ref: '#/components/schemas/inference._types.InferenceChunkingSettings' description: "The chunking configuration object.\nNote that for ELSER endpoints, the max_chunk_size may not exceed `300`." externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config service: allOf: - $ref: '#/components/schemas/inference._types.ElserServiceType' description: 'The type of service supported for the specified task type. In this case, `elser`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.ElserServiceSettings' description: Settings used to install the inference model. These settings are specific to the `elser` service. examples: PutElserRequestExample1: summary: A sparse embedding task description: Run `PUT _inference/sparse_embedding/my-elser-model` to create an inference endpoint that performs a `sparse_embedding` task. The request will automatically download the ELSER model if it isn't already downloaded and then deploy the model. value: "{\n \"service\": \"elser\",\n \"service_settings\": {\n \"num_allocations\": 1,\n \"num_threads\": 1\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/sparse_embedding/my-elser-model\n{\n \"service\": \"elser\",\n \"service_settings\": {\n \"num_allocations\": 1,\n \"num_threads\": 1\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"sparse_embedding\",\n inference_id=\"my-elser-model\",\n inference_config={\n \"service\": \"elser\",\n \"service_settings\": {\n \"num_allocations\": 1,\n \"num_threads\": 1\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n inference_config: {\n service: \"elser\",\n service_settings: {\n num_allocations: 1,\n num_threads: 1,\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n body: {\n \"service\": \"elser\",\n \"service_settings\": {\n \"num_allocations\": 1,\n \"num_threads\": 1\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"my-elser-model\",\n \"body\" => [\n \"service\" => \"elser\",\n \"service_settings\" => [\n \"num_allocations\" => 1,\n \"num_threads\" => 1,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"elser","service_settings":{"num_allocations":1,"num_threads":1}}'' "$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"my-elser-model\",\n TaskType = TaskType.SparseEmbedding,\n InferenceConfig = new()\n {\n Service = \"elser\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"num_allocations\": 1,\n \"num_threads\": 1\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"my-elser-model\")\n .taskType(TaskType.SparseEmbedding)\n .inferenceConfig(i -> i\n .service(\"elser\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"num_allocations\":1,\"num_threads\":1}\n\"\"\"))\n )\n);\n" PutElserRequestExample2: summary: Adaptive allocations description: 'Run `PUT _inference/sparse_embedding/my-elser-model` to create an inference endpoint that performs a `sparse_embedding` task with adaptive allocations. When adaptive allocations are enabled, the number of allocations of the model is set automatically based on the current load.' value: "{\n \"service\": \"elser\",\n \"service_settings\": {\n \"adaptive_allocations\": {\n \"enabled\": true,\n \"min_number_of_allocations\": 3,\n \"max_number_of_allocations\": 10\n },\n \"num_threads\": 1\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/sparse_embedding/my-elser-model\n{\n \"service\": \"elser\",\n \"service_settings\": {\n \"adaptive_allocations\": {\n \"enabled\": true,\n \"min_number_of_allocations\": 3,\n \"max_number_of_allocations\": 10\n },\n \"num_threads\": 1\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"sparse_embedding\",\n inference_id=\"my-elser-model\",\n inference_config={\n \"service\": \"elser\",\n \"service_settings\": {\n \"adaptive_allocations\": {\n \"enabled\": True,\n \"min_number_of_allocations\": 3,\n \"max_number_of_allocations\": 10\n },\n \"num_threads\": 1\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n inference_config: {\n service: \"elser\",\n service_settings: {\n adaptive_allocations: {\n enabled: true,\n min_number_of_allocations: 3,\n max_number_of_allocations: 10,\n },\n num_threads: 1,\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n body: {\n \"service\": \"elser\",\n \"service_settings\": {\n \"adaptive_allocations\": {\n \"enabled\": true,\n \"min_number_of_allocations\": 3,\n \"max_number_of_allocations\": 10\n },\n \"num_threads\": 1\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"my-elser-model\",\n \"body\" => [\n \"service\" => \"elser\",\n \"service_settings\" => [\n \"adaptive_allocations\" => [\n \"enabled\" => true,\n \"min_number_of_allocations\" => 3,\n \"max_number_of_allocations\" => 10,\n ],\n \"num_threads\" => 1,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"elser","service_settings":{"adaptive_allocations":{"enabled":true,"min_number_of_allocations":3,"max_number_of_allocations":10},"num_threads":1}}'' "$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"my-elser-model\",\n TaskType = TaskType.SparseEmbedding,\n InferenceConfig = new()\n {\n Service = \"elser\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"adaptive_allocations\": {\n \"enabled\": true,\n \"min_number_of_allocations\": 3,\n \"max_number_of_allocations\": 10\n },\n \"num_threads\": 1\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"my-elser-model\")\n .taskType(TaskType.SparseEmbedding)\n .inferenceConfig(i -> i\n .service(\"elser\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"adaptive_allocations\":{\"enabled\":true,\"min_number_of_allocations\":3,\"max_number_of_allocations\":10},\"num_threads\":1}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoELSER' examples: PutElserResponseExample1: description: A successful response when creating an ELSER inference endpoint. value: "{\n \"inference_id\": \"my-elser-model\",\n \"task_type\": \"sparse_embedding\",\n \"service\": \"elser\",\n \"service_settings\": {\n \"num_allocations\": 1,\n \"num_threads\": 1\n },\n \"task_settings\": {}\n}" deprecated: true x-state: Generally available; Added in 8.11.0 x-codeSamples: - lang: Console source: "PUT _inference/sparse_embedding/my-elser-model\n{\n \"service\": \"elser\",\n \"service_settings\": {\n \"num_allocations\": 1,\n \"num_threads\": 1\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"sparse_embedding\",\n inference_id=\"my-elser-model\",\n inference_config={\n \"service\": \"elser\",\n \"service_settings\": {\n \"num_allocations\": 1,\n \"num_threads\": 1\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n inference_config: {\n service: \"elser\",\n service_settings: {\n num_allocations: 1,\n num_threads: 1,\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n body: {\n \"service\": \"elser\",\n \"service_settings\": {\n \"num_allocations\": 1,\n \"num_threads\": 1\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"my-elser-model\",\n \"body\" => [\n \"service\" => \"elser\",\n \"service_settings\" => [\n \"num_allocations\" => 1,\n \"num_threads\" => 1,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"elser","service_settings":{"num_allocations":1,"num_threads":1}}'' "$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"my-elser-model\",\n TaskType = TaskType.SparseEmbedding,\n InferenceConfig = new()\n {\n Service = \"elser\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"num_allocations\": 1,\n \"num_threads\": 1\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"my-elser-model\")\n .taskType(TaskType.SparseEmbedding)\n .inferenceConfig(i -> i\n .service(\"elser\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"num_allocations\":1,\"num_threads\":1}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{fireworksai_inference_id}': put: tags: - inference summary: Create a Fireworks AI inference endpoint description: "Create an inference endpoint to perform an inference task with the `fireworksai` service.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-fireworksai parameters: - name: task_type in: path description: The type of the inference task that the model will perform. required: true schema: $ref: '#/components/schemas/inference._types.FireworksAITaskType' - name: fireworksai_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: chunking_settings: allOf: - $ref: '#/components/schemas/inference._types.InferenceChunkingSettings' description: "The chunking configuration object.\nApplies only to the `text_embedding` task type.\nNot applicable to the `completion` or `chat_completion` task types." externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config service: allOf: - $ref: '#/components/schemas/inference._types.FireworksAIServiceType' description: 'The type of service supported for the specified task type. In this case, `fireworksai`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.FireworksAIServiceSettings' description: Settings used to install the inference model. These settings are specific to the `fireworksai` service. task_settings: allOf: - $ref: '#/components/schemas/inference._types.FireworksAITaskSettings' description: "Settings to configure the inference task.\nApplies only to the `completion` or `chat_completion` task types.\nNot applicable to the `text_embedding` task type.\nThese settings are specific to the task type you specified." examples: PutFireworksAiRequestExample1: summary: Create an endpoint for text embedding tasks description: Run `PUT _inference/text_embedding/my-fireworks-embeddings` to create an inference endpoint that performs a `text_embedding` task. value: "{\n \"service\": \"fireworksai\",\n \"service_settings\": {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"fireworks/qwen3-embedding-8b\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/my-fireworks-embeddings\n{\n \"service\": \"fireworksai\",\n \"service_settings\": {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"fireworks/qwen3-embedding-8b\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"my-fireworks-embeddings\",\n inference_config={\n \"service\": \"fireworksai\",\n \"service_settings\": {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"fireworks/qwen3-embedding-8b\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"my-fireworks-embeddings\",\n inference_config: {\n service: \"fireworksai\",\n service_settings: {\n api_key: \"your-api-key\",\n model_id: \"fireworks/qwen3-embedding-8b\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"my-fireworks-embeddings\",\n body: {\n \"service\": \"fireworksai\",\n \"service_settings\": {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"fireworks/qwen3-embedding-8b\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"my-fireworks-embeddings\",\n \"body\" => [\n \"service\" => \"fireworksai\",\n \"service_settings\" => [\n \"api_key\" => \"your-api-key\",\n \"model_id\" => \"fireworks/qwen3-embedding-8b\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"fireworksai","service_settings":{"api_key":"your-api-key","model_id":"fireworks/qwen3-embedding-8b"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/my-fireworks-embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"my-fireworks-embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"fireworksai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"fireworks/qwen3-embedding-8b\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"my-fireworks-embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"fireworksai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"your-api-key\",\"model_id\":\"fireworks/qwen3-embedding-8b\"}\n\"\"\"))\n )\n);\n" PutFireworksAiRequestExample2: summary: Create an endpoint for text embedding tasks with optional settings description: 'Create a Fireworks AI text embedding endpoint with custom dimensions, similarity, and rate limit.' value: "{\n \"service\": \"fireworksai\",\n \"service_settings\": {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"fireworks/qwen3-embedding-8b\",\n \"dimensions\": 1024,\n \"similarity\": \"cosine\",\n \"rate_limit\": {\n \"requests_per_minute\": 6000\n }\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/my-fireworks-embeddings\n{\n \"service\": \"fireworksai\",\n \"service_settings\": {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"fireworks/qwen3-embedding-8b\",\n \"dimensions\": 1024,\n \"similarity\": \"cosine\",\n \"rate_limit\": {\n \"requests_per_minute\": 6000\n }\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"my-fireworks-embeddings\",\n inference_config={\n \"service\": \"fireworksai\",\n \"service_settings\": {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"fireworks/qwen3-embedding-8b\",\n \"dimensions\": 1024,\n \"similarity\": \"cosine\",\n \"rate_limit\": {\n \"requests_per_minute\": 6000\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"my-fireworks-embeddings\",\n inference_config: {\n service: \"fireworksai\",\n service_settings: {\n api_key: \"your-api-key\",\n model_id: \"fireworks/qwen3-embedding-8b\",\n dimensions: 1024,\n similarity: \"cosine\",\n rate_limit: {\n requests_per_minute: 6000,\n },\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"my-fireworks-embeddings\",\n body: {\n \"service\": \"fireworksai\",\n \"service_settings\": {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"fireworks/qwen3-embedding-8b\",\n \"dimensions\": 1024,\n \"similarity\": \"cosine\",\n \"rate_limit\": {\n \"requests_per_minute\": 6000\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"my-fireworks-embeddings\",\n \"body\" => [\n \"service\" => \"fireworksai\",\n \"service_settings\" => [\n \"api_key\" => \"your-api-key\",\n \"model_id\" => \"fireworks/qwen3-embedding-8b\",\n \"dimensions\" => 1024,\n \"similarity\" => \"cosine\",\n \"rate_limit\" => [\n \"requests_per_minute\" => 6000,\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"fireworksai","service_settings":{"api_key":"your-api-key","model_id":"fireworks/qwen3-embedding-8b","dimensions":1024,"similarity":"cosine","rate_limit":{"requests_per_minute":6000}}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/my-fireworks-embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"my-fireworks-embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"fireworksai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"fireworks/qwen3-embedding-8b\",\n \"dimensions\": 1024,\n \"similarity\": \"cosine\",\n \"rate_limit\": {\n \"requests_per_minute\": 6000\n }\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"my-fireworks-embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"fireworksai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"your-api-key\",\"model_id\":\"fireworks/qwen3-embedding-8b\",\"dimensions\":1024,\"similarity\":\"cosine\",\"rate_limit\":{\"requests_per_minute\":6000}}\n\"\"\"))\n )\n);\n" PutFireworksAiRequestExample3: summary: Create an endpoint for chat completion tasks description: Run `PUT _inference/chat_completion/my-fireworks-chat` to create an inference endpoint that performs a `chat_completion` task. value: "{\n \"service\": \"fireworksai\",\n \"service_settings\": {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"accounts/fireworks/models/deepseek-v3p1\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/chat_completion/my-fireworks-chat\n{\n \"service\": \"fireworksai\",\n \"service_settings\": {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"accounts/fireworks/models/deepseek-v3p1\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"chat_completion\",\n inference_id=\"my-fireworks-chat\",\n inference_config={\n \"service\": \"fireworksai\",\n \"service_settings\": {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"accounts/fireworks/models/deepseek-v3p1\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"chat_completion\",\n inference_id: \"my-fireworks-chat\",\n inference_config: {\n service: \"fireworksai\",\n service_settings: {\n api_key: \"your-api-key\",\n model_id: \"accounts/fireworks/models/deepseek-v3p1\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"chat_completion\",\n inference_id: \"my-fireworks-chat\",\n body: {\n \"service\": \"fireworksai\",\n \"service_settings\": {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"accounts/fireworks/models/deepseek-v3p1\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"chat_completion\",\n \"inference_id\" => \"my-fireworks-chat\",\n \"body\" => [\n \"service\" => \"fireworksai\",\n \"service_settings\" => [\n \"api_key\" => \"your-api-key\",\n \"model_id\" => \"accounts/fireworks/models/deepseek-v3p1\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"fireworksai","service_settings":{"api_key":"your-api-key","model_id":"accounts/fireworks/models/deepseek-v3p1"}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/my-fireworks-chat"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"my-fireworks-chat\",\n TaskType = TaskType.ChatCompletion,\n InferenceConfig = new()\n {\n Service = \"fireworksai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"accounts/fireworks/models/deepseek-v3p1\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"my-fireworks-chat\")\n .taskType(TaskType.ChatCompletion)\n .inferenceConfig(i -> i\n .service(\"fireworksai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"your-api-key\",\"model_id\":\"accounts/fireworks/models/deepseek-v3p1\"}\n\"\"\"))\n )\n);\n" PutFireworksAiRequestExample4: summary: Create an endpoint for completion tasks description: Run `PUT _inference/completion/my-fireworks-completion` to create an inference endpoint that performs a `completion` task. value: "{\n \"service\": \"fireworksai\",\n \"service_settings\": {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"accounts/fireworks/models/deepseek-v3p1\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/my-fireworks-completion\n{\n \"service\": \"fireworksai\",\n \"service_settings\": {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"accounts/fireworks/models/deepseek-v3p1\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"my-fireworks-completion\",\n inference_config={\n \"service\": \"fireworksai\",\n \"service_settings\": {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"accounts/fireworks/models/deepseek-v3p1\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"my-fireworks-completion\",\n inference_config: {\n service: \"fireworksai\",\n service_settings: {\n api_key: \"your-api-key\",\n model_id: \"accounts/fireworks/models/deepseek-v3p1\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"my-fireworks-completion\",\n body: {\n \"service\": \"fireworksai\",\n \"service_settings\": {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"accounts/fireworks/models/deepseek-v3p1\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"my-fireworks-completion\",\n \"body\" => [\n \"service\" => \"fireworksai\",\n \"service_settings\" => [\n \"api_key\" => \"your-api-key\",\n \"model_id\" => \"accounts/fireworks/models/deepseek-v3p1\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"fireworksai","service_settings":{"api_key":"your-api-key","model_id":"accounts/fireworks/models/deepseek-v3p1"}}'' "$ELASTICSEARCH_URL/_inference/completion/my-fireworks-completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"my-fireworks-completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"fireworksai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"accounts/fireworks/models/deepseek-v3p1\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"my-fireworks-completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"fireworksai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"your-api-key\",\"model_id\":\"accounts/fireworks/models/deepseek-v3p1\"}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoFireworksAI' examples: PutFireworksAiResponseExample1: summary: Response for created text embedding endpoint description: A successful response when creating a Fireworks AI `text_embedding` inference endpoint. value: "{\n \"inference_id\": \"my-fireworks-embeddings\",\n \"task_type\": \"text_embedding\",\n \"service\": \"fireworksai\",\n \"service_settings\": {\n \"model_id\": \"fireworks/qwen3-embedding-8b\",\n \"url\": \"https://api.fireworks.ai/inference/v1/embeddings\",\n \"similarity\": \"cosine\",\n \"dimensions\": 4096,\n \"rate_limit\": {\n \"requests_per_minute\": 6000\n }\n },\n \"chunking_settings\": {\n \"strategy\": \"sentence\",\n \"max_chunk_size\": 250,\n \"sentence_overlap\": 1\n }\n}" PutFireworksAiResponseExample2: summary: Response for created completion endpoint description: A successful response when creating a Fireworks AI `chat_completion` inference endpoint. value: "{\n \"inference_id\": \"my-fireworks-chat\",\n \"task_type\": \"chat_completion\",\n \"service\": \"fireworksai\",\n \"service_settings\": {\n \"model_id\": \"accounts/fireworks/models/deepseek-v3p1\",\n \"rate_limit\": {\n \"requests_per_minute\": 6000\n }\n }\n}" x-state: Generally available; Added in 9.4.0 x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/my-fireworks-embeddings\n{\n \"service\": \"fireworksai\",\n \"service_settings\": {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"fireworks/qwen3-embedding-8b\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"my-fireworks-embeddings\",\n inference_config={\n \"service\": \"fireworksai\",\n \"service_settings\": {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"fireworks/qwen3-embedding-8b\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"my-fireworks-embeddings\",\n inference_config: {\n service: \"fireworksai\",\n service_settings: {\n api_key: \"your-api-key\",\n model_id: \"fireworks/qwen3-embedding-8b\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"my-fireworks-embeddings\",\n body: {\n \"service\": \"fireworksai\",\n \"service_settings\": {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"fireworks/qwen3-embedding-8b\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"my-fireworks-embeddings\",\n \"body\" => [\n \"service\" => \"fireworksai\",\n \"service_settings\" => [\n \"api_key\" => \"your-api-key\",\n \"model_id\" => \"fireworks/qwen3-embedding-8b\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"fireworksai","service_settings":{"api_key":"your-api-key","model_id":"fireworks/qwen3-embedding-8b"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/my-fireworks-embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"my-fireworks-embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"fireworksai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"your-api-key\",\n \"model_id\": \"fireworks/qwen3-embedding-8b\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"my-fireworks-embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"fireworksai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"your-api-key\",\"model_id\":\"fireworks/qwen3-embedding-8b\"}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{googleaistudio_inference_id}': put: tags: - inference summary: Create an Google AI Studio inference endpoint description: "Create an inference endpoint to perform an inference task with the `googleaistudio` service.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-googleaistudio parameters: - name: task_type in: path description: The type of the inference task that the model will perform. required: true schema: $ref: '#/components/schemas/inference._types.GoogleAiStudioTaskType' - name: googleaistudio_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: chunking_settings: allOf: - $ref: '#/components/schemas/inference._types.InferenceChunkingSettings' description: "The chunking configuration object.\nApplies only to the `text_embedding` task type.\nNot applicable to the `completion` task type." externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config service: allOf: - $ref: '#/components/schemas/inference._types.GoogleAiServiceType' description: 'The type of service supported for the specified task type. In this case, `googleaistudio`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.GoogleAiStudioServiceSettings' description: Settings used to install the inference model. These settings are specific to the `googleaistudio` service. examples: PutGoogleAiStudioRequestExample1: summary: A completion task description: Run `PUT _inference/completion/google_ai_studio_completion` to create an inference endpoint to perform a `completion` task type. value: "{\n \"service\": \"googleaistudio\",\n \"service_settings\": {\n \"api_key\": \"api-key\",\n \"model_id\": \"model-id\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/google_ai_studio_completion\n{\n \"service\": \"googleaistudio\",\n \"service_settings\": {\n \"api_key\": \"api-key\",\n \"model_id\": \"model-id\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"google_ai_studio_completion\",\n inference_config={\n \"service\": \"googleaistudio\",\n \"service_settings\": {\n \"api_key\": \"api-key\",\n \"model_id\": \"model-id\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"google_ai_studio_completion\",\n inference_config: {\n service: \"googleaistudio\",\n service_settings: {\n api_key: \"api-key\",\n model_id: \"model-id\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"google_ai_studio_completion\",\n body: {\n \"service\": \"googleaistudio\",\n \"service_settings\": {\n \"api_key\": \"api-key\",\n \"model_id\": \"model-id\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"google_ai_studio_completion\",\n \"body\" => [\n \"service\" => \"googleaistudio\",\n \"service_settings\" => [\n \"api_key\" => \"api-key\",\n \"model_id\" => \"model-id\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googleaistudio","service_settings":{"api_key":"api-key","model_id":"model-id"}}'' "$ELASTICSEARCH_URL/_inference/completion/google_ai_studio_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_ai_studio_completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"googleaistudio\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"api-key\",\n \"model_id\": \"model-id\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_ai_studio_completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"googleaistudio\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"api-key\",\"model_id\":\"model-id\"}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoGoogleAIStudio' x-state: Generally available; Added in 8.15.0 x-codeSamples: - lang: Console source: "PUT _inference/completion/google_ai_studio_completion\n{\n \"service\": \"googleaistudio\",\n \"service_settings\": {\n \"api_key\": \"api-key\",\n \"model_id\": \"model-id\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"google_ai_studio_completion\",\n inference_config={\n \"service\": \"googleaistudio\",\n \"service_settings\": {\n \"api_key\": \"api-key\",\n \"model_id\": \"model-id\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"google_ai_studio_completion\",\n inference_config: {\n service: \"googleaistudio\",\n service_settings: {\n api_key: \"api-key\",\n model_id: \"model-id\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"google_ai_studio_completion\",\n body: {\n \"service\": \"googleaistudio\",\n \"service_settings\": {\n \"api_key\": \"api-key\",\n \"model_id\": \"model-id\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"google_ai_studio_completion\",\n \"body\" => [\n \"service\" => \"googleaistudio\",\n \"service_settings\" => [\n \"api_key\" => \"api-key\",\n \"model_id\" => \"model-id\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googleaistudio","service_settings":{"api_key":"api-key","model_id":"model-id"}}'' "$ELASTICSEARCH_URL/_inference/completion/google_ai_studio_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_ai_studio_completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"googleaistudio\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"api-key\",\n \"model_id\": \"model-id\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_ai_studio_completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"googleaistudio\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"api-key\",\"model_id\":\"model-id\"}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{googlevertexai_inference_id}': put: tags: - inference summary: Create a Google Vertex AI inference endpoint description: "Create an inference endpoint to perform an inference task with the `googlevertexai` service.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-googlevertexai parameters: - name: task_type in: path description: The type of the inference task that the model will perform. required: true schema: $ref: '#/components/schemas/inference._types.GoogleVertexAITaskType' - name: googlevertexai_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: chunking_settings: allOf: - $ref: '#/components/schemas/inference._types.InferenceChunkingSettings' description: "The chunking configuration object.\nApplies only to the `text_embedding` task type.\nNot applicable to the `rerank`, `completion`, or `chat_completion` task types." externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config service: allOf: - $ref: '#/components/schemas/inference._types.GoogleVertexAIServiceType' description: 'The type of service supported for the specified task type. In this case, `googlevertexai`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.GoogleVertexAIServiceSettings' description: Settings used to install the inference model. These settings are specific to the `googlevertexai` service. task_settings: allOf: - $ref: '#/components/schemas/inference._types.GoogleVertexAITaskSettings' description: "Settings to configure the inference task.\nThese settings are specific to the task type you specified." examples: PutGoogleVertexAiRequestExample1: summary: A text embedding task description: Run `PUT _inference/text_embedding/google_vertex_ai_embeddings` to create an inference endpoint to perform a `text_embedding` task type. value: "{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"service_account_json\": \"service-account-json\",\n \"model_id\": \"model-id\",\n \"location\": \"location\",\n \"project_id\": \"project-id\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/google_vertex_ai_embeddingss\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"service_account_json\": \"service-account-json\",\n \"model_id\": \"model-id\",\n \"location\": \"location\",\n \"project_id\": \"project-id\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"google_vertex_ai_embeddingss\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"service_account_json\": \"service-account-json\",\n \"model_id\": \"model-id\",\n \"location\": \"location\",\n \"project_id\": \"project-id\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"google_vertex_ai_embeddingss\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n service_account_json: \"service-account-json\",\n model_id: \"model-id\",\n location: \"location\",\n project_id: \"project-id\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"google_vertex_ai_embeddingss\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"service_account_json\": \"service-account-json\",\n \"model_id\": \"model-id\",\n \"location\": \"location\",\n \"project_id\": \"project-id\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"google_vertex_ai_embeddingss\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"service_account_json\" => \"service-account-json\",\n \"model_id\" => \"model-id\",\n \"location\" => \"location\",\n \"project_id\" => \"project-id\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"service_account_json":"service-account-json","model_id":"model-id","location":"location","project_id":"project-id"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/google_vertex_ai_embeddingss"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_vertex_ai_embeddingss\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"service_account_json\": \"service-account-json\",\n \"model_id\": \"model-id\",\n \"location\": \"location\",\n \"project_id\": \"project-id\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_vertex_ai_embeddingss\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"service_account_json\":\"service-account-json\",\"model_id\":\"model-id\",\"location\":\"location\",\"project_id\":\"project-id\"}\n\"\"\"))\n )\n);\n" PutGoogleVertexAiRequestExample10: summary: A chat_completion task for Google Model Garden Meta shared endpoint with single streaming URL provided description: Run `PUT _inference/chat_completion/google_model_garden_meta_chat_completion` to create an inference endpoint to perform a `chat_completion` task using Meta's model hosted on Google Model Garden shared endpoint with single streaming URL provided. See the endpoint's `Sample request` page for the variable values used in the URL. value: "{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/chat_completion/google_model_garden_meta_chat_completion\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"chat_completion\",\n inference_id=\"google_model_garden_meta_chat_completion\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"chat_completion\",\n inference_id: \"google_model_garden_meta_chat_completion\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n provider: \"meta\",\n service_account_json: \"service-account-json\",\n streaming_url:\n \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"chat_completion\",\n inference_id: \"google_model_garden_meta_chat_completion\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"chat_completion\",\n \"inference_id\" => \"google_model_garden_meta_chat_completion\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"provider\" => \"meta\",\n \"service_account_json\" => \"service-account-json\",\n \"streaming_url\" => \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"provider":"meta","service_account_json":"service-account-json","streaming_url":"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions"}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/google_model_garden_meta_chat_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_model_garden_meta_chat_completion\",\n TaskType = TaskType.ChatCompletion,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"provider\": \"meta\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_model_garden_meta_chat_completion\")\n .taskType(TaskType.ChatCompletion)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"provider\":\"meta\",\"service_account_json\":\"service-account-json\",\"streaming_url\":\"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"}\n\"\"\"))\n )\n);\n" PutGoogleVertexAiRequestExample11: summary: A completion task for Google Model Garden Hugging Face dedicated endpoint with single URL provided for both streaming and non-streaming tasks description: Run `PUT _inference/completion/google_model_garden_hugging_face_completion` to create an inference endpoint to perform a `completion` task using Hugging Face's model hosted on Google Model Garden dedicated endpoint with single URL provided for both streaming and non-streaming tasks. See the endpoint's `Sample request` page for the variable values used in the URL. value: "{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"hugging_face\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/google_model_garden_hugging_face_completion\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"hugging_face\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"google_model_garden_hugging_face_completion\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"hugging_face\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"google_model_garden_hugging_face_completion\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n provider: \"hugging_face\",\n service_account_json: \"service-account-json\",\n url: \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"google_model_garden_hugging_face_completion\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"hugging_face\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"google_model_garden_hugging_face_completion\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"provider\" => \"hugging_face\",\n \"service_account_json\" => \"service-account-json\",\n \"url\" => \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"provider":"hugging_face","service_account_json":"service-account-json","url":"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions"}}'' "$ELASTICSEARCH_URL/_inference/completion/google_model_garden_hugging_face_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_model_garden_hugging_face_completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"provider\": \"hugging_face\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_model_garden_hugging_face_completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"provider\":\"hugging_face\",\"service_account_json\":\"service-account-json\",\"url\":\"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"}\n\"\"\"))\n )\n);\n" PutGoogleVertexAiRequestExample12: summary: A chat_completion task for Google Model Garden Hugging Face dedicated endpoint with single streaming URL provided description: Run `PUT _inference/chat_completion/google_model_garden_hugging_face_chat_completion` to create an inference endpoint to perform a `chat_completion` task using Hugging Face's model hosted on Google Model Garden dedicated endpoint with single streaming URL provided. See the endpoint's `Sample request` page for the variable values used in the URL. value: "{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"hugging_face\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/chat_completion/google_model_garden_hugging_face_chat_completion\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"hugging_face\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"chat_completion\",\n inference_id=\"google_model_garden_hugging_face_chat_completion\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"hugging_face\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"chat_completion\",\n inference_id: \"google_model_garden_hugging_face_chat_completion\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n provider: \"hugging_face\",\n service_account_json: \"service-account-json\",\n streaming_url:\n \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"chat_completion\",\n inference_id: \"google_model_garden_hugging_face_chat_completion\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"hugging_face\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"chat_completion\",\n \"inference_id\" => \"google_model_garden_hugging_face_chat_completion\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"provider\" => \"hugging_face\",\n \"service_account_json\" => \"service-account-json\",\n \"streaming_url\" => \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"provider":"hugging_face","service_account_json":"service-account-json","streaming_url":"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions"}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/google_model_garden_hugging_face_chat_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_model_garden_hugging_face_chat_completion\",\n TaskType = TaskType.ChatCompletion,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"provider\": \"hugging_face\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_model_garden_hugging_face_chat_completion\")\n .taskType(TaskType.ChatCompletion)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"provider\":\"hugging_face\",\"service_account_json\":\"service-account-json\",\"streaming_url\":\"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"}\n\"\"\"))\n )\n);\n" PutGoogleVertexAiRequestExample13: summary: A completion task for Google Model Garden Hugging Face shared endpoint with single URL provided for both streaming and non-streaming tasks description: Run `PUT _inference/completion/google_model_garden_hugging_face_completion` to create an inference endpoint to perform a `completion` task using Hugging Face's model hosted on Google Model Garden shared endpoint with single URL provided for both streaming and non-streaming tasks. See the endpoint's `Sample request` page for the variable values used in the URL. value: "{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"hugging_face\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/google_model_garden_hugging_face_completion\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"hugging_face\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"google_model_garden_hugging_face_completion\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"hugging_face\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"google_model_garden_hugging_face_completion\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n provider: \"hugging_face\",\n service_account_json: \"service-account-json\",\n url: \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"google_model_garden_hugging_face_completion\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"hugging_face\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"google_model_garden_hugging_face_completion\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"provider\" => \"hugging_face\",\n \"service_account_json\" => \"service-account-json\",\n \"url\" => \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"provider":"hugging_face","service_account_json":"service-account-json","url":"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions"}}'' "$ELASTICSEARCH_URL/_inference/completion/google_model_garden_hugging_face_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_model_garden_hugging_face_completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"provider\": \"hugging_face\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_model_garden_hugging_face_completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"provider\":\"hugging_face\",\"service_account_json\":\"service-account-json\",\"url\":\"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"}\n\"\"\"))\n )\n);\n" PutGoogleVertexAiRequestExample14: summary: A chat_completion task for Google Model Garden Hugging Face shared endpoint with single streaming URL provided description: Run `PUT _inference/chat_completion/google_model_garden_hugging_face_chat_completion` to create an inference endpoint to perform a `chat_completion` task using Hugging Face's model hosted on Google Model Garden shared endpoint with single streaming URL provided. See the endpoint's `Sample request` page for the variable values used in the URL. value: "{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"hugging_face\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/chat_completion/google_model_garden_hugging_face_chat_completion\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"hugging_face\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"chat_completion\",\n inference_id=\"google_model_garden_hugging_face_chat_completion\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"hugging_face\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"chat_completion\",\n inference_id: \"google_model_garden_hugging_face_chat_completion\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n provider: \"hugging_face\",\n service_account_json: \"service-account-json\",\n streaming_url:\n \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"chat_completion\",\n inference_id: \"google_model_garden_hugging_face_chat_completion\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"hugging_face\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"chat_completion\",\n \"inference_id\" => \"google_model_garden_hugging_face_chat_completion\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"provider\" => \"hugging_face\",\n \"service_account_json\" => \"service-account-json\",\n \"streaming_url\" => \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"provider":"hugging_face","service_account_json":"service-account-json","streaming_url":"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions"}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/google_model_garden_hugging_face_chat_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_model_garden_hugging_face_chat_completion\",\n TaskType = TaskType.ChatCompletion,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"provider\": \"hugging_face\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_model_garden_hugging_face_chat_completion\")\n .taskType(TaskType.ChatCompletion)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"provider\":\"hugging_face\",\"service_account_json\":\"service-account-json\",\"streaming_url\":\"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"}\n\"\"\"))\n )\n);\n" PutGoogleVertexAiRequestExample15: summary: A completion task for Google Model Garden Mistral serverless endpoint with separate URLs for streaming and non-streaming tasks description: Run `PUT _inference/completion/google_model_garden_mistral_completion` to create an inference endpoint to perform a `completion` task using Mistral's serverless model hosted on Google Model Garden with separate URLs for streaming and non-streaming tasks. See the Mistral model documentation for instructions on how to construct URLs. value: "{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"model_id\": \"mistral-small-2503\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:rawPredict\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:streamRawPredict\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/google_model_garden_mistral_completion\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"model_id\": \"mistral-small-2503\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:rawPredict\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:streamRawPredict\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"google_model_garden_mistral_completion\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"model_id\": \"mistral-small-2503\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:rawPredict\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:streamRawPredict\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"google_model_garden_mistral_completion\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n provider: \"mistral\",\n model_id: \"mistral-small-2503\",\n service_account_json: \"service-account-json\",\n url: \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:rawPredict\",\n streaming_url:\n \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:streamRawPredict\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"google_model_garden_mistral_completion\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"model_id\": \"mistral-small-2503\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:rawPredict\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:streamRawPredict\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"google_model_garden_mistral_completion\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"provider\" => \"mistral\",\n \"model_id\" => \"mistral-small-2503\",\n \"service_account_json\" => \"service-account-json\",\n \"url\" => \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:rawPredict\",\n \"streaming_url\" => \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:streamRawPredict\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"provider":"mistral","model_id":"mistral-small-2503","service_account_json":"service-account-json","url":"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:rawPredict","streaming_url":"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:streamRawPredict"}}'' "$ELASTICSEARCH_URL/_inference/completion/google_model_garden_mistral_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_model_garden_mistral_completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"provider\": \"mistral\",\n \"model_id\": \"mistral-small-2503\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:rawPredict\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:streamRawPredict\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_model_garden_mistral_completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"provider\":\"mistral\",\"model_id\":\"mistral-small-2503\",\"service_account_json\":\"service-account-json\",\"url\":\"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:rawPredict\",\"streaming_url\":\"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:streamRawPredict\"}\n\"\"\"))\n )\n);\n" PutGoogleVertexAiRequestExample16: summary: A chat_completion task for Google Model Garden Mistral serverless endpoint with single streaming URL provided description: Run `PUT _inference/chat_completion/google_model_garden_mistral_chat_completion` to create an inference endpoint to perform a `chat_completion` task using Mistral's serverless model hosted on Google Model Garden with single streaming URL provided. See the Mistral model documentation for instructions on how to construct the URL. value: "{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"model_id\": \"mistral-small-2503\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:streamRawPredict\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/chat_completion/google_model_garden_mistral_chat_completion\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"model_id\": \"mistral-small-2503\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:streamRawPredict\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"chat_completion\",\n inference_id=\"google_model_garden_mistral_chat_completion\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"model_id\": \"mistral-small-2503\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:streamRawPredict\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"chat_completion\",\n inference_id: \"google_model_garden_mistral_chat_completion\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n provider: \"mistral\",\n model_id: \"mistral-small-2503\",\n service_account_json: \"service-account-json\",\n streaming_url:\n \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:streamRawPredict\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"chat_completion\",\n inference_id: \"google_model_garden_mistral_chat_completion\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"model_id\": \"mistral-small-2503\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:streamRawPredict\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"chat_completion\",\n \"inference_id\" => \"google_model_garden_mistral_chat_completion\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"provider\" => \"mistral\",\n \"model_id\" => \"mistral-small-2503\",\n \"service_account_json\" => \"service-account-json\",\n \"streaming_url\" => \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:streamRawPredict\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"provider":"mistral","model_id":"mistral-small-2503","service_account_json":"service-account-json","streaming_url":"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:streamRawPredict"}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/google_model_garden_mistral_chat_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_model_garden_mistral_chat_completion\",\n TaskType = TaskType.ChatCompletion,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"provider\": \"mistral\",\n \"model_id\": \"mistral-small-2503\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:streamRawPredict\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_model_garden_mistral_chat_completion\")\n .taskType(TaskType.ChatCompletion)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"provider\":\"mistral\",\"model_id\":\"mistral-small-2503\",\"service_account_json\":\"service-account-json\",\"streaming_url\":\"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/mistralai/models/%MODEL_ID%:streamRawPredict\"}\n\"\"\"))\n )\n);\n" PutGoogleVertexAiRequestExample17: summary: A completion task for Google Model Garden Mistral dedicated endpoint with single URL provided for both streaming and non-streaming tasks description: Run `PUT _inference/completion/google_model_garden_mistral_completion` to create an inference endpoint to perform a `completion` task using Mistral's model hosted on Google Model Garden dedicated endpoint with single URL provided for both streaming and non-streaming tasks. See the endpoint's `Sample request` page for the variable values used in the URL. value: "{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/google_model_garden_mistral_completion\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"google_model_garden_mistral_completion\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"google_model_garden_mistral_completion\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n provider: \"mistral\",\n service_account_json: \"service-account-json\",\n url: \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"google_model_garden_mistral_completion\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"google_model_garden_mistral_completion\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"provider\" => \"mistral\",\n \"service_account_json\" => \"service-account-json\",\n \"url\" => \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"provider":"mistral","service_account_json":"service-account-json","url":"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions"}}'' "$ELASTICSEARCH_URL/_inference/completion/google_model_garden_mistral_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_model_garden_mistral_completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"provider\": \"mistral\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_model_garden_mistral_completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"provider\":\"mistral\",\"service_account_json\":\"service-account-json\",\"url\":\"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"}\n\"\"\"))\n )\n);\n" PutGoogleVertexAiRequestExample18: summary: A chat_completion task for Google Model Garden Mistral dedicated endpoint with single streaming URL provided description: Run `PUT _inference/chat_completion/google_model_garden_mistral_chat_completion` to create an inference endpoint to perform a `chat_completion` task using Mistral's model hosted on Google Model Garden dedicated endpoint with single streaming URL provided. See the endpoint's `Sample request` page for the variable values used in the URL. value: "{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/chat_completion/google_model_garden_mistral_chat_completion\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"chat_completion\",\n inference_id=\"google_model_garden_mistral_chat_completion\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"chat_completion\",\n inference_id: \"google_model_garden_mistral_chat_completion\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n provider: \"mistral\",\n service_account_json: \"service-account-json\",\n streaming_url:\n \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"chat_completion\",\n inference_id: \"google_model_garden_mistral_chat_completion\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"chat_completion\",\n \"inference_id\" => \"google_model_garden_mistral_chat_completion\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"provider\" => \"mistral\",\n \"service_account_json\" => \"service-account-json\",\n \"streaming_url\" => \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"provider":"mistral","service_account_json":"service-account-json","streaming_url":"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions"}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/google_model_garden_mistral_chat_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_model_garden_mistral_chat_completion\",\n TaskType = TaskType.ChatCompletion,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"provider\": \"mistral\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_model_garden_mistral_chat_completion\")\n .taskType(TaskType.ChatCompletion)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"provider\":\"mistral\",\"service_account_json\":\"service-account-json\",\"streaming_url\":\"https://%ENDPOINT_ID%.%LOCATION_ID%-%PROJECT_ID%.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"}\n\"\"\"))\n )\n);\n" PutGoogleVertexAiRequestExample19: summary: A completion task for Google Model Garden Mistral shared endpoint with single URL provided for both streaming and non-streaming tasks description: Run `PUT _inference/completion/google_model_garden_mistral_completion` to create an inference endpoint to perform a `completion` task using Mistral's model hosted on Google Model Garden shared endpoint with single URL provided for both streaming and non-streaming tasks. See the endpoint's `Sample request` page for the variable values used in the URL. value: "{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/google_model_garden_mistral_completion\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"google_model_garden_mistral_completion\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"google_model_garden_mistral_completion\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n provider: \"mistral\",\n service_account_json: \"service-account-json\",\n url: \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"google_model_garden_mistral_completion\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"google_model_garden_mistral_completion\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"provider\" => \"mistral\",\n \"service_account_json\" => \"service-account-json\",\n \"url\" => \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"provider":"mistral","service_account_json":"service-account-json","url":"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions"}}'' "$ELASTICSEARCH_URL/_inference/completion/google_model_garden_mistral_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_model_garden_mistral_completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"provider\": \"mistral\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_model_garden_mistral_completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"provider\":\"mistral\",\"service_account_json\":\"service-account-json\",\"url\":\"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"}\n\"\"\"))\n )\n);\n" PutGoogleVertexAiRequestExample2: summary: A rerank task description: Run `PUT _inference/rerank/google_vertex_ai_rerank` to create an inference endpoint to perform a `rerank` task type. value: "{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"service_account_json\": \"service-account-json\",\n \"project_id\": \"project-id\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/rerank/google_vertex_ai_rerank\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"service_account_json\": \"service-account-json\",\n \"project_id\": \"project-id\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"google_vertex_ai_rerank\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"service_account_json\": \"service-account-json\",\n \"project_id\": \"project-id\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"google_vertex_ai_rerank\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n service_account_json: \"service-account-json\",\n project_id: \"project-id\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"google_vertex_ai_rerank\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"service_account_json\": \"service-account-json\",\n \"project_id\": \"project-id\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"google_vertex_ai_rerank\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"service_account_json\" => \"service-account-json\",\n \"project_id\" => \"project-id\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"service_account_json":"service-account-json","project_id":"project-id"}}'' "$ELASTICSEARCH_URL/_inference/rerank/google_vertex_ai_rerank"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_vertex_ai_rerank\",\n TaskType = TaskType.Rerank,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"service_account_json\": \"service-account-json\",\n \"project_id\": \"project-id\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_vertex_ai_rerank\")\n .taskType(TaskType.Rerank)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"service_account_json\":\"service-account-json\",\"project_id\":\"project-id\"}\n\"\"\"))\n )\n);\n" PutGoogleVertexAiRequestExample20: summary: A chat_completion task for Google Model Garden Mistral shared endpoint with single streaming URL provided description: Run `PUT _inference/chat_completion/google_model_garden_mistral_chat_completion` to create an inference endpoint to perform a `chat_completion` task using Mistral's model hosted on Google Model Garden shared endpoint with single streaming URL provided. See the endpoint's `Sample request` page for the variable values used in the URL. value: "{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/chat_completion/google_model_garden_mistral_chat_completion\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"chat_completion\",\n inference_id=\"google_model_garden_mistral_chat_completion\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"chat_completion\",\n inference_id: \"google_model_garden_mistral_chat_completion\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n provider: \"mistral\",\n service_account_json: \"service-account-json\",\n streaming_url:\n \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"chat_completion\",\n inference_id: \"google_model_garden_mistral_chat_completion\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"mistral\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"chat_completion\",\n \"inference_id\" => \"google_model_garden_mistral_chat_completion\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"provider\" => \"mistral\",\n \"service_account_json\" => \"service-account-json\",\n \"streaming_url\" => \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"provider":"mistral","service_account_json":"service-account-json","streaming_url":"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions"}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/google_model_garden_mistral_chat_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_model_garden_mistral_chat_completion\",\n TaskType = TaskType.ChatCompletion,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"provider\": \"mistral\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_model_garden_mistral_chat_completion\")\n .taskType(TaskType.ChatCompletion)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"provider\":\"mistral\",\"service_account_json\":\"service-account-json\",\"streaming_url\":\"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"}\n\"\"\"))\n )\n);\n" PutGoogleVertexAiRequestExample21: summary: A completion task for Google Model Garden AI21 serverless endpoint with separate URLs for streaming and non-streaming tasks description: Run `PUT _inference/completion/google_model_garden_ai21_completion` to create an inference endpoint to perform a `completion` task using AI21's model hosted on Google Model Garden serverless endpoint with separate URLs for streaming and non-streaming tasks. See the AI21 model documentation for instructions on how to construct URLs. value: "{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"ai21\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:rawPredict\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:streamRawPredict\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/google_model_garden_ai21_completion\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"ai21\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:rawPredict\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:streamRawPredict\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"google_model_garden_ai21_completion\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"ai21\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:rawPredict\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:streamRawPredict\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"google_model_garden_ai21_completion\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n provider: \"ai21\",\n service_account_json: \"service-account-json\",\n url: \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:rawPredict\",\n streaming_url:\n \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:streamRawPredict\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"google_model_garden_ai21_completion\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"ai21\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:rawPredict\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:streamRawPredict\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"google_model_garden_ai21_completion\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"provider\" => \"ai21\",\n \"service_account_json\" => \"service-account-json\",\n \"url\" => \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:rawPredict\",\n \"streaming_url\" => \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:streamRawPredict\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"provider":"ai21","service_account_json":"service-account-json","url":"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:rawPredict","streaming_url":"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:streamRawPredict"}}'' "$ELASTICSEARCH_URL/_inference/completion/google_model_garden_ai21_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_model_garden_ai21_completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"provider\": \"ai21\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:rawPredict\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:streamRawPredict\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_model_garden_ai21_completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"provider\":\"ai21\",\"service_account_json\":\"service-account-json\",\"url\":\"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:rawPredict\",\"streaming_url\":\"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:streamRawPredict\"}\n\"\"\"))\n )\n);\n" PutGoogleVertexAiRequestExample22: summary: A chat_completion task for Google Model Garden AI21 serverless endpoint with single streaming URL provided description: Run `PUT _inference/chat_completion/google_model_garden_ai21_chat_completion` to create an inference endpoint to perform a `chat_completion` task using AI21's model hosted on Google Model Garden serverless endpoint with single streaming URL provided. See the AI21 model documentation for instructions on how to construct URLs. value: "{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"ai21\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:streamRawPredict\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/chat_completion/google_model_garden_ai21_chat_completion\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"ai21\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:streamRawPredict\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"chat_completion\",\n inference_id=\"google_model_garden_ai21_chat_completion\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"ai21\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:streamRawPredict\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"chat_completion\",\n inference_id: \"google_model_garden_ai21_chat_completion\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n provider: \"ai21\",\n service_account_json: \"service-account-json\",\n streaming_url:\n \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:streamRawPredict\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"chat_completion\",\n inference_id: \"google_model_garden_ai21_chat_completion\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"ai21\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:streamRawPredict\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"chat_completion\",\n \"inference_id\" => \"google_model_garden_ai21_chat_completion\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"provider\" => \"ai21\",\n \"service_account_json\" => \"service-account-json\",\n \"streaming_url\" => \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:streamRawPredict\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"provider":"ai21","service_account_json":"service-account-json","streaming_url":"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:streamRawPredict"}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/google_model_garden_ai21_chat_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_model_garden_ai21_chat_completion\",\n TaskType = TaskType.ChatCompletion,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"provider\": \"ai21\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:streamRawPredict\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_model_garden_ai21_chat_completion\")\n .taskType(TaskType.ChatCompletion)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"provider\":\"ai21\",\"service_account_json\":\"service-account-json\",\"streaming_url\":\"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/ai21/models/%MODEL_ID%:streamRawPredict\"}\n\"\"\"))\n )\n);\n" PutGoogleVertexAiRequestExample23: summary: A text embedding task targeting the global endpoint description: Run `PUT _inference/text_embedding/google_vertex_ai_embeddings_global` to create an inference endpoint that performs a `text_embedding` task against the Google Vertex AI global endpoint. Omit `location` to target the global endpoint (`https://aiplatform.googleapis.com`) instead of a regional one. value: "{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"service_account_json\": \"service-account-json\",\n \"model_id\": \"model-id\",\n \"project_id\": \"project-id\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/google_vertex_ai_embeddings_global\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"service_account_json\": \"service-account-json\",\n \"model_id\": \"model-id\",\n \"project_id\": \"project-id\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"google_vertex_ai_embeddings_global\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"service_account_json\": \"service-account-json\",\n \"model_id\": \"model-id\",\n \"project_id\": \"project-id\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"google_vertex_ai_embeddings_global\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n service_account_json: \"service-account-json\",\n model_id: \"model-id\",\n project_id: \"project-id\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"google_vertex_ai_embeddings_global\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"service_account_json\": \"service-account-json\",\n \"model_id\": \"model-id\",\n \"project_id\": \"project-id\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"google_vertex_ai_embeddings_global\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"service_account_json\" => \"service-account-json\",\n \"model_id\" => \"model-id\",\n \"project_id\" => \"project-id\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"service_account_json":"service-account-json","model_id":"model-id","project_id":"project-id"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/google_vertex_ai_embeddings_global"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_vertex_ai_embeddings_global\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"service_account_json\": \"service-account-json\",\n \"model_id\": \"model-id\",\n \"project_id\": \"project-id\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_vertex_ai_embeddings_global\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"service_account_json\":\"service-account-json\",\"model_id\":\"model-id\",\"project_id\":\"project-id\"}\n\"\"\"))\n )\n);\n" PutGoogleVertexAiRequestExample3: summary: A completion task for Google Model Garden Anthropic serverless endpoint with separate URLs for streaming and non-streaming tasks description: Run `PUT _inference/completion/google_model_garden_anthropic_completion` to create an inference endpoint to perform a `completion` task using Anthropic's serverless model hosted on Google Model Garden with separate URLs for streaming and non-streaming tasks. See the Anthropic model documentation for instructions on how to construct URLs. value: "{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"anthropic\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:rawPredict\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:streamRawPredict\"\n },\n \"task_settings\": {\n \"max_tokens\": 128\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/google_model_garden_anthropic_completion\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"anthropic\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:rawPredict\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:streamRawPredict\"\n },\n \"task_settings\": {\n \"max_tokens\": 128\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"google_model_garden_anthropic_completion\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"anthropic\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:rawPredict\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:streamRawPredict\"\n },\n \"task_settings\": {\n \"max_tokens\": 128\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"google_model_garden_anthropic_completion\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n provider: \"anthropic\",\n service_account_json: \"service-account-json\",\n url: \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:rawPredict\",\n streaming_url:\n \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:streamRawPredict\",\n },\n task_settings: {\n max_tokens: 128,\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"google_model_garden_anthropic_completion\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"anthropic\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:rawPredict\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:streamRawPredict\"\n },\n \"task_settings\": {\n \"max_tokens\": 128\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"google_model_garden_anthropic_completion\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"provider\" => \"anthropic\",\n \"service_account_json\" => \"service-account-json\",\n \"url\" => \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:rawPredict\",\n \"streaming_url\" => \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:streamRawPredict\",\n ],\n \"task_settings\" => [\n \"max_tokens\" => 128,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"provider":"anthropic","service_account_json":"service-account-json","url":"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:rawPredict","streaming_url":"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:streamRawPredict"},"task_settings":{"max_tokens":128}}'' "$ELASTICSEARCH_URL/_inference/completion/google_model_garden_anthropic_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_model_garden_anthropic_completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"provider\": \"anthropic\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:rawPredict\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:streamRawPredict\"\n }\n \"\"\"),\n TaskSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"max_tokens\": 128\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_model_garden_anthropic_completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"provider\":\"anthropic\",\"service_account_json\":\"service-account-json\",\"url\":\"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:rawPredict\",\"streaming_url\":\"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:streamRawPredict\"}\n\"\"\"))\n .taskSettings(JsonData.fromJson(\"\"\"\n{\"max_tokens\":128}\n\"\"\"))\n )\n);\n" PutGoogleVertexAiRequestExample4: summary: A chat_completion task for Google Model Garden Anthropic serverless endpoint with single streaming URL provided description: Run `PUT _inference/chat_completion/google_model_garden_anthropic_chat_completion` to create an inference endpoint to perform a `chat_completion` task using Anthropic's serverless model hosted on Google Model Garden with single streaming URL provided. See the Anthropic model documentation for instructions on how to construct the URL. value: "{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"anthropic\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:streamRawPredict\"\n },\n \"task_settings\": {\n \"max_tokens\": 128\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/chat_completion/google_model_garden_anthropic_chat_completion\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"anthropic\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:streamRawPredict\"\n },\n \"task_settings\": {\n \"max_tokens\": 128\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"chat_completion\",\n inference_id=\"google_model_garden_anthropic_chat_completion\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"anthropic\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:streamRawPredict\"\n },\n \"task_settings\": {\n \"max_tokens\": 128\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"chat_completion\",\n inference_id: \"google_model_garden_anthropic_chat_completion\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n provider: \"anthropic\",\n service_account_json: \"service-account-json\",\n streaming_url:\n \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:streamRawPredict\",\n },\n task_settings: {\n max_tokens: 128,\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"chat_completion\",\n inference_id: \"google_model_garden_anthropic_chat_completion\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"anthropic\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:streamRawPredict\"\n },\n \"task_settings\": {\n \"max_tokens\": 128\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"chat_completion\",\n \"inference_id\" => \"google_model_garden_anthropic_chat_completion\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"provider\" => \"anthropic\",\n \"service_account_json\" => \"service-account-json\",\n \"streaming_url\" => \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:streamRawPredict\",\n ],\n \"task_settings\" => [\n \"max_tokens\" => 128,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"provider":"anthropic","service_account_json":"service-account-json","streaming_url":"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:streamRawPredict"},"task_settings":{"max_tokens":128}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/google_model_garden_anthropic_chat_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_model_garden_anthropic_chat_completion\",\n TaskType = TaskType.ChatCompletion,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"provider\": \"anthropic\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:streamRawPredict\"\n }\n \"\"\"),\n TaskSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"max_tokens\": 128\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_model_garden_anthropic_chat_completion\")\n .taskType(TaskType.ChatCompletion)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"provider\":\"anthropic\",\"service_account_json\":\"service-account-json\",\"streaming_url\":\"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/publishers/anthropic/models/%MODEL_ID%:streamRawPredict\"}\n\"\"\"))\n .taskSettings(JsonData.fromJson(\"\"\"\n{\"max_tokens\":128}\n\"\"\"))\n )\n);\n" PutGoogleVertexAiRequestExample5: summary: A completion task for Google Model Garden Meta serverless endpoint with single URL provided for both streaming and non-streaming tasks description: Run `PUT _inference/completion/google_model_garden_meta_completion` to create an inference endpoint to perform a `completion` task using Meta's serverless model hosted on Google Model Garden with single URL provided for both streaming and non-streaming tasks. See the Meta model documentation for instructions on how to construct the URL. value: "{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"model_id\": \"meta/llama-3.3-70b-instruct-maas\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/openapi/chat/completions\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/google_model_garden_meta_completion\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"model_id\": \"meta/llama-3.3-70b-instruct-maas\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/openapi/chat/completions\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"google_model_garden_meta_completion\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"model_id\": \"meta/llama-3.3-70b-instruct-maas\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/openapi/chat/completions\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"google_model_garden_meta_completion\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n provider: \"meta\",\n model_id: \"meta/llama-3.3-70b-instruct-maas\",\n service_account_json: \"service-account-json\",\n url: \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/openapi/chat/completions\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"google_model_garden_meta_completion\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"model_id\": \"meta/llama-3.3-70b-instruct-maas\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/openapi/chat/completions\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"google_model_garden_meta_completion\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"provider\" => \"meta\",\n \"model_id\" => \"meta/llama-3.3-70b-instruct-maas\",\n \"service_account_json\" => \"service-account-json\",\n \"url\" => \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/openapi/chat/completions\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"provider":"meta","model_id":"meta/llama-3.3-70b-instruct-maas","service_account_json":"service-account-json","url":"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/openapi/chat/completions"}}'' "$ELASTICSEARCH_URL/_inference/completion/google_model_garden_meta_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_model_garden_meta_completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"provider\": \"meta\",\n \"model_id\": \"meta/llama-3.3-70b-instruct-maas\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/openapi/chat/completions\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_model_garden_meta_completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"provider\":\"meta\",\"model_id\":\"meta/llama-3.3-70b-instruct-maas\",\"service_account_json\":\"service-account-json\",\"url\":\"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/openapi/chat/completions\"}\n\"\"\"))\n )\n);\n" PutGoogleVertexAiRequestExample6: summary: A chat_completion task for Google Model Garden Meta serverless endpoint with single streaming URL provided description: Run `PUT _inference/chat_completion/google_model_garden_meta_chat_completion` to create an inference endpoint to perform a `chat_completion` task using Meta's serverless model hosted on Google Model Garden with single streaming URL provided. See the Meta model documentation for instructions on how to construct the URL. value: "{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"model_id\": \"meta/llama-3.3-70b-instruct-maas\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/openapi/chat/completions\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/chat_completion/google_model_garden_meta_chat_completion\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"model_id\": \"meta/llama-3.3-70b-instruct-maas\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/openapi/chat/completions\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"chat_completion\",\n inference_id=\"google_model_garden_meta_chat_completion\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"model_id\": \"meta/llama-3.3-70b-instruct-maas\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/openapi/chat/completions\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"chat_completion\",\n inference_id: \"google_model_garden_meta_chat_completion\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n provider: \"meta\",\n model_id: \"meta/llama-3.3-70b-instruct-maas\",\n service_account_json: \"service-account-json\",\n streaming_url:\n \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/openapi/chat/completions\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"chat_completion\",\n inference_id: \"google_model_garden_meta_chat_completion\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"model_id\": \"meta/llama-3.3-70b-instruct-maas\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/openapi/chat/completions\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"chat_completion\",\n \"inference_id\" => \"google_model_garden_meta_chat_completion\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"provider\" => \"meta\",\n \"model_id\" => \"meta/llama-3.3-70b-instruct-maas\",\n \"service_account_json\" => \"service-account-json\",\n \"streaming_url\" => \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/openapi/chat/completions\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"provider":"meta","model_id":"meta/llama-3.3-70b-instruct-maas","service_account_json":"service-account-json","streaming_url":"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/openapi/chat/completions"}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/google_model_garden_meta_chat_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_model_garden_meta_chat_completion\",\n TaskType = TaskType.ChatCompletion,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"provider\": \"meta\",\n \"model_id\": \"meta/llama-3.3-70b-instruct-maas\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/openapi/chat/completions\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_model_garden_meta_chat_completion\")\n .taskType(TaskType.ChatCompletion)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"provider\":\"meta\",\"model_id\":\"meta/llama-3.3-70b-instruct-maas\",\"service_account_json\":\"service-account-json\",\"streaming_url\":\"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/openapi/chat/completions\"}\n\"\"\"))\n )\n);\n" PutGoogleVertexAiRequestExample7: summary: A completion task for Google Model Garden Meta dedicated endpoint with single URL provided for both streaming and non-streaming tasks description: Run `PUT _inference/completion/google_model_garden_meta_completion` to create an inference endpoint to perform a `completion` task using Meta's model hosted on Google Model Garden dedicated endpoint with single URL provided for both streaming and non-streaming tasks. See the endpoint's `Sample request` page for the variable values used in the URL. value: "{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-fasttryout.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/google_model_garden_meta_completion\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-fasttryout.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"google_model_garden_meta_completion\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-fasttryout.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"google_model_garden_meta_completion\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n provider: \"meta\",\n service_account_json: \"service-account-json\",\n url: \"https://%ENDPOINT_ID%.%LOCATION_ID%-fasttryout.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"google_model_garden_meta_completion\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-fasttryout.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"google_model_garden_meta_completion\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"provider\" => \"meta\",\n \"service_account_json\" => \"service-account-json\",\n \"url\" => \"https://%ENDPOINT_ID%.%LOCATION_ID%-fasttryout.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"provider":"meta","service_account_json":"service-account-json","url":"https://%ENDPOINT_ID%.%LOCATION_ID%-fasttryout.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions"}}'' "$ELASTICSEARCH_URL/_inference/completion/google_model_garden_meta_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_model_garden_meta_completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"provider\": \"meta\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-fasttryout.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_model_garden_meta_completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"provider\":\"meta\",\"service_account_json\":\"service-account-json\",\"url\":\"https://%ENDPOINT_ID%.%LOCATION_ID%-fasttryout.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"}\n\"\"\"))\n )\n);\n" PutGoogleVertexAiRequestExample8: summary: A chat_completion task for Google Model Garden Meta dedicated endpoint with single streaming URL provided description: Run `PUT _inference/chat_completion/google_model_garden_meta_chat_completion` to create an inference endpoint to perform a `chat_completion` task using Meta's model hosted on Google Model Garden dedicated endpoint with single streaming URL provided. See the endpoint's `Sample request` page for the variable values used in the URL. value: "{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-fasttryout.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/chat_completion/google_model_garden_meta_chat_completion\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-fasttryout.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"chat_completion\",\n inference_id=\"google_model_garden_meta_chat_completion\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-fasttryout.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"chat_completion\",\n inference_id: \"google_model_garden_meta_chat_completion\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n provider: \"meta\",\n service_account_json: \"service-account-json\",\n streaming_url:\n \"https://%ENDPOINT_ID%.%LOCATION_ID%-fasttryout.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"chat_completion\",\n inference_id: \"google_model_garden_meta_chat_completion\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-fasttryout.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"chat_completion\",\n \"inference_id\" => \"google_model_garden_meta_chat_completion\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"provider\" => \"meta\",\n \"service_account_json\" => \"service-account-json\",\n \"streaming_url\" => \"https://%ENDPOINT_ID%.%LOCATION_ID%-fasttryout.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"provider":"meta","service_account_json":"service-account-json","streaming_url":"https://%ENDPOINT_ID%.%LOCATION_ID%-fasttryout.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions"}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/google_model_garden_meta_chat_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_model_garden_meta_chat_completion\",\n TaskType = TaskType.ChatCompletion,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"provider\": \"meta\",\n \"service_account_json\": \"service-account-json\",\n \"streaming_url\": \"https://%ENDPOINT_ID%.%LOCATION_ID%-fasttryout.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_model_garden_meta_chat_completion\")\n .taskType(TaskType.ChatCompletion)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"provider\":\"meta\",\"service_account_json\":\"service-account-json\",\"streaming_url\":\"https://%ENDPOINT_ID%.%LOCATION_ID%-fasttryout.prediction.vertexai.goog/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"}\n\"\"\"))\n )\n);\n" PutGoogleVertexAiRequestExample9: summary: A completion task for Google Model Garden Meta shared endpoint with single URL provided for both streaming and non-streaming tasks description: Run `PUT _inference/completion/google_model_garden_meta_completion` to create an inference endpoint to perform a `completion` task using Meta's model hosted on Google Model Garden shared endpoint with single URL provided for both streaming and non-streaming tasks. See the endpoint's `Sample request` page for the variable values used in the URL. value: "{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/google_model_garden_meta_completion\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"google_model_garden_meta_completion\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"google_model_garden_meta_completion\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n provider: \"meta\",\n service_account_json: \"service-account-json\",\n url: \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"google_model_garden_meta_completion\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"provider\": \"meta\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"google_model_garden_meta_completion\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"provider\" => \"meta\",\n \"service_account_json\" => \"service-account-json\",\n \"url\" => \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"provider":"meta","service_account_json":"service-account-json","url":"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions"}}'' "$ELASTICSEARCH_URL/_inference/completion/google_model_garden_meta_completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_model_garden_meta_completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"provider\": \"meta\",\n \"service_account_json\": \"service-account-json\",\n \"url\": \"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_model_garden_meta_completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"provider\":\"meta\",\"service_account_json\":\"service-account-json\",\"url\":\"https://%LOCATION_ID%-aiplatform.googleapis.com/v1/projects/%PROJECT_ID%/locations/%LOCATION_ID%/endpoints/%ENDPOINT_ID%/chat/completions\"}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoGoogleVertexAI' x-state: Generally available; Added in 8.15.0 x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/google_vertex_ai_embeddingss\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"service_account_json\": \"service-account-json\",\n \"model_id\": \"model-id\",\n \"location\": \"location\",\n \"project_id\": \"project-id\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"google_vertex_ai_embeddingss\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"service_account_json\": \"service-account-json\",\n \"model_id\": \"model-id\",\n \"location\": \"location\",\n \"project_id\": \"project-id\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"google_vertex_ai_embeddingss\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n service_account_json: \"service-account-json\",\n model_id: \"model-id\",\n location: \"location\",\n project_id: \"project-id\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"google_vertex_ai_embeddingss\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"service_account_json\": \"service-account-json\",\n \"model_id\": \"model-id\",\n \"location\": \"location\",\n \"project_id\": \"project-id\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"google_vertex_ai_embeddingss\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"service_account_json\" => \"service-account-json\",\n \"model_id\" => \"model-id\",\n \"location\" => \"location\",\n \"project_id\" => \"project-id\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"googlevertexai","service_settings":{"service_account_json":"service-account-json","model_id":"model-id","location":"location","project_id":"project-id"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/google_vertex_ai_embeddingss"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"google_vertex_ai_embeddingss\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"googlevertexai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"service_account_json\": \"service-account-json\",\n \"model_id\": \"model-id\",\n \"location\": \"location\",\n \"project_id\": \"project-id\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"google_vertex_ai_embeddingss\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"googlevertexai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"service_account_json\":\"service-account-json\",\"model_id\":\"model-id\",\"location\":\"location\",\"project_id\":\"project-id\"}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{groq_inference_id}': put: tags: - inference summary: Create a Groq inference endpoint description: "Create an inference endpoint to perform an inference task with the `groq` service.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-groq parameters: - name: task_type in: path description: The type of the inference task that the model will perform. required: true schema: $ref: '#/components/schemas/inference._types.GroqTaskType' - name: groq_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: service: allOf: - $ref: '#/components/schemas/inference._types.GroqServiceType' description: 'The type of service supported for the specified task type. In this case, `groq`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.GroqServiceSettings' description: Settings used to install the inference model. These settings are specific to the `groq` service. examples: PutGroqRequestExample1: description: Run `PUT _inference/chat_completion/groq-chat-completion` to create a Groq inference endpoint that performs a `chat_completion` task. value: "{\n \"service\": \"groq\",\n \"service_settings\": {\n \"api_key\": \"groq-api-key\",\n \"model_id\": \"llama-3.3-70b-versatile\" \n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/chat_completion/groq-chat-completion\n{\n \"service\": \"groq\",\n \"service_settings\": {\n \"api_key\": \"groq-api-key\",\n \"model_id\": \"llama-3.3-70b-versatile\" \n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"chat_completion\",\n inference_id=\"groq-chat-completion\",\n inference_config={\n \"service\": \"groq\",\n \"service_settings\": {\n \"api_key\": \"groq-api-key\",\n \"model_id\": \"llama-3.3-70b-versatile\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"chat_completion\",\n inference_id: \"groq-chat-completion\",\n inference_config: {\n service: \"groq\",\n service_settings: {\n api_key: \"groq-api-key\",\n model_id: \"llama-3.3-70b-versatile\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"chat_completion\",\n inference_id: \"groq-chat-completion\",\n body: {\n \"service\": \"groq\",\n \"service_settings\": {\n \"api_key\": \"groq-api-key\",\n \"model_id\": \"llama-3.3-70b-versatile\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"chat_completion\",\n \"inference_id\" => \"groq-chat-completion\",\n \"body\" => [\n \"service\" => \"groq\",\n \"service_settings\" => [\n \"api_key\" => \"groq-api-key\",\n \"model_id\" => \"llama-3.3-70b-versatile\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"groq","service_settings":{"api_key":"groq-api-key","model_id":"llama-3.3-70b-versatile"}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/groq-chat-completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"groq-chat-completion\",\n TaskType = TaskType.ChatCompletion,\n InferenceConfig = new()\n {\n Service = \"groq\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"groq-api-key\",\n \"model_id\": \"llama-3.3-70b-versatile\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"groq-chat-completion\")\n .taskType(TaskType.ChatCompletion)\n .inferenceConfig(i -> i\n .service(\"groq\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"groq-api-key\",\"model_id\":\"llama-3.3-70b-versatile\"}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoGroq' x-state: Generally available; Added in 9.3.0 x-codeSamples: - lang: Console source: "PUT _inference/chat_completion/groq-chat-completion\n{\n \"service\": \"groq\",\n \"service_settings\": {\n \"api_key\": \"groq-api-key\",\n \"model_id\": \"llama-3.3-70b-versatile\" \n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"chat_completion\",\n inference_id=\"groq-chat-completion\",\n inference_config={\n \"service\": \"groq\",\n \"service_settings\": {\n \"api_key\": \"groq-api-key\",\n \"model_id\": \"llama-3.3-70b-versatile\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"chat_completion\",\n inference_id: \"groq-chat-completion\",\n inference_config: {\n service: \"groq\",\n service_settings: {\n api_key: \"groq-api-key\",\n model_id: \"llama-3.3-70b-versatile\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"chat_completion\",\n inference_id: \"groq-chat-completion\",\n body: {\n \"service\": \"groq\",\n \"service_settings\": {\n \"api_key\": \"groq-api-key\",\n \"model_id\": \"llama-3.3-70b-versatile\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"chat_completion\",\n \"inference_id\" => \"groq-chat-completion\",\n \"body\" => [\n \"service\" => \"groq\",\n \"service_settings\" => [\n \"api_key\" => \"groq-api-key\",\n \"model_id\" => \"llama-3.3-70b-versatile\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"groq","service_settings":{"api_key":"groq-api-key","model_id":"llama-3.3-70b-versatile"}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/groq-chat-completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"groq-chat-completion\",\n TaskType = TaskType.ChatCompletion,\n InferenceConfig = new()\n {\n Service = \"groq\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"groq-api-key\",\n \"model_id\": \"llama-3.3-70b-versatile\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"groq-chat-completion\")\n .taskType(TaskType.ChatCompletion)\n .inferenceConfig(i -> i\n .service(\"groq\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"groq-api-key\",\"model_id\":\"llama-3.3-70b-versatile\"}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{huggingface_inference_id}': put: tags: - inference summary: Create a Hugging Face inference endpoint description: "Create an inference endpoint to perform an inference task with the `hugging_face` service.\nSupported tasks include: `text_embedding`, `completion`, and `chat_completion`.\n\nTo configure the endpoint, first visit the Hugging Face Inference Endpoints page and create a new endpoint.\nSelect a model that supports the task you intend to use.\n\nFor Elastic's `text_embedding` task:\nThe selected model must support the `Sentence Embeddings` task. On the new endpoint creation page, select the `Sentence Embeddings` task under the `Advanced Configuration` section.\nAfter the endpoint has initialized, copy the generated endpoint URL.\nRecommended models for `text_embedding` task:\n\n* `all-MiniLM-L6-v2`\n* `all-MiniLM-L12-v2`\n* `all-mpnet-base-v2`\n* `e5-base-v2`\n* `e5-small-v2`\n* `multilingual-e5-base`\n* `multilingual-e5-small`\n\nFor Elastic's `chat_completion` and `completion` tasks:\nThe selected model must support the `Text Generation` task and expose OpenAI API. HuggingFace supports both serverless and dedicated endpoints for `Text Generation`. When creating dedicated endpoint select the `Text Generation` task.\nAfter the endpoint is initialized (for dedicated) or ready (for serverless), ensure it supports the OpenAI API and includes `/v1/chat/completions` part in URL. Then, copy the full endpoint URL for use.\nRecommended models for `chat_completion` and `completion` tasks:\n\n* `Mistral-7B-Instruct-v0.2`\n* `QwQ-32B`\n* `Phi-3-mini-128k-instruct`\n\nFor Elastic's `rerank` task:\nThe selected model must support the `sentence-ranking` task and expose OpenAI API.\nHuggingFace supports only dedicated (not serverless) endpoints for `Rerank` so far.\nAfter the endpoint is initialized, copy the full endpoint URL for use.\nTested models for `rerank` task:\n\n* `bge-reranker-base`\n* `jina-reranker-v1-turbo-en-GGUF`\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-hugging-face parameters: - name: task_type in: path description: The type of the inference task that the model will perform. required: true schema: $ref: '#/components/schemas/inference._types.HuggingFaceTaskType' - name: huggingface_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: chunking_settings: allOf: - $ref: '#/components/schemas/inference._types.InferenceChunkingSettings' description: "The chunking configuration object.\nApplies only to the `text_embedding` task type.\nNot applicable to the `rerank`, `completion`, or `chat_completion` task types." externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config service: allOf: - $ref: '#/components/schemas/inference._types.HuggingFaceServiceType' description: 'The type of service supported for the specified task type. In this case, `hugging_face`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.HuggingFaceServiceSettings' description: Settings used to install the inference model. These settings are specific to the `hugging_face` service. task_settings: allOf: - $ref: '#/components/schemas/inference._types.HuggingFaceTaskSettings' description: "Settings to configure the inference task.\nThese settings are specific to the task type you specified." examples: PutHuggingFaceRequestExample1: summary: A text embedding task description: Run `PUT _inference/text_embedding/hugging-face-embeddings` to create an inference endpoint that performs a `text_embedding` task type. value: "{\n \"service\": \"hugging_face\",\n \"service_settings\": {\n \"api_key\": \"hugging-face-access-token\", \n \"url\": \"url-endpoint\" \n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/hugging-face-embeddings\n{\n \"service\": \"hugging_face\",\n \"service_settings\": {\n \"api_key\": \"hugging-face-access-token\", \n \"url\": \"url-endpoint\" \n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"hugging-face-embeddings\",\n inference_config={\n \"service\": \"hugging_face\",\n \"service_settings\": {\n \"api_key\": \"hugging-face-access-token\",\n \"url\": \"url-endpoint\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"hugging-face-embeddings\",\n inference_config: {\n service: \"hugging_face\",\n service_settings: {\n api_key: \"hugging-face-access-token\",\n url: \"url-endpoint\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"hugging-face-embeddings\",\n body: {\n \"service\": \"hugging_face\",\n \"service_settings\": {\n \"api_key\": \"hugging-face-access-token\",\n \"url\": \"url-endpoint\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"hugging-face-embeddings\",\n \"body\" => [\n \"service\" => \"hugging_face\",\n \"service_settings\" => [\n \"api_key\" => \"hugging-face-access-token\",\n \"url\" => \"url-endpoint\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"hugging_face","service_settings":{"api_key":"hugging-face-access-token","url":"url-endpoint"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/hugging-face-embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"hugging-face-embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"hugging_face\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"hugging-face-access-token\",\n \"url\": \"url-endpoint\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"hugging-face-embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"hugging_face\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"hugging-face-access-token\",\"url\":\"url-endpoint\"}\n\"\"\"))\n )\n);\n" PutHuggingFaceRequestExample2: summary: A rerank task description: Run `PUT _inference/rerank/hugging-face-rerank` to create an inference endpoint that performs a `rerank` task type. value: "{\n \"service\": \"hugging_face\",\n \"service_settings\": {\n \"api_key\": \"hugging-face-access-token\", \n \"url\": \"url-endpoint\" \n },\n \"task_settings\": {\n \"return_documents\": true,\n \"top_n\": 3\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/rerank/hugging-face-rerank\n{\n \"service\": \"hugging_face\",\n \"service_settings\": {\n \"api_key\": \"hugging-face-access-token\", \n \"url\": \"url-endpoint\" \n },\n \"task_settings\": {\n \"return_documents\": true,\n \"top_n\": 3\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"hugging-face-rerank\",\n inference_config={\n \"service\": \"hugging_face\",\n \"service_settings\": {\n \"api_key\": \"hugging-face-access-token\",\n \"url\": \"url-endpoint\"\n },\n \"task_settings\": {\n \"return_documents\": True,\n \"top_n\": 3\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"hugging-face-rerank\",\n inference_config: {\n service: \"hugging_face\",\n service_settings: {\n api_key: \"hugging-face-access-token\",\n url: \"url-endpoint\",\n },\n task_settings: {\n return_documents: true,\n top_n: 3,\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"hugging-face-rerank\",\n body: {\n \"service\": \"hugging_face\",\n \"service_settings\": {\n \"api_key\": \"hugging-face-access-token\",\n \"url\": \"url-endpoint\"\n },\n \"task_settings\": {\n \"return_documents\": true,\n \"top_n\": 3\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"hugging-face-rerank\",\n \"body\" => [\n \"service\" => \"hugging_face\",\n \"service_settings\" => [\n \"api_key\" => \"hugging-face-access-token\",\n \"url\" => \"url-endpoint\",\n ],\n \"task_settings\" => [\n \"return_documents\" => true,\n \"top_n\" => 3,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"hugging_face","service_settings":{"api_key":"hugging-face-access-token","url":"url-endpoint"},"task_settings":{"return_documents":true,"top_n":3}}'' "$ELASTICSEARCH_URL/_inference/rerank/hugging-face-rerank"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"hugging-face-rerank\",\n TaskType = TaskType.Rerank,\n InferenceConfig = new()\n {\n Service = \"hugging_face\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"hugging-face-access-token\",\n \"url\": \"url-endpoint\"\n }\n \"\"\"),\n TaskSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"return_documents\": true,\n \"top_n\": 3\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"hugging-face-rerank\")\n .taskType(TaskType.Rerank)\n .inferenceConfig(i -> i\n .service(\"hugging_face\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"hugging-face-access-token\",\"url\":\"url-endpoint\"}\n\"\"\"))\n .taskSettings(JsonData.fromJson(\"\"\"\n{\"return_documents\":true,\"top_n\":3}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoHuggingFace' x-state: Generally available; Added in 8.12.0 x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/hugging-face-embeddings\n{\n \"service\": \"hugging_face\",\n \"service_settings\": {\n \"api_key\": \"hugging-face-access-token\", \n \"url\": \"url-endpoint\" \n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"hugging-face-embeddings\",\n inference_config={\n \"service\": \"hugging_face\",\n \"service_settings\": {\n \"api_key\": \"hugging-face-access-token\",\n \"url\": \"url-endpoint\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"hugging-face-embeddings\",\n inference_config: {\n service: \"hugging_face\",\n service_settings: {\n api_key: \"hugging-face-access-token\",\n url: \"url-endpoint\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"hugging-face-embeddings\",\n body: {\n \"service\": \"hugging_face\",\n \"service_settings\": {\n \"api_key\": \"hugging-face-access-token\",\n \"url\": \"url-endpoint\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"hugging-face-embeddings\",\n \"body\" => [\n \"service\" => \"hugging_face\",\n \"service_settings\" => [\n \"api_key\" => \"hugging-face-access-token\",\n \"url\" => \"url-endpoint\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"hugging_face","service_settings":{"api_key":"hugging-face-access-token","url":"url-endpoint"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/hugging-face-embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"hugging-face-embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"hugging_face\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"hugging-face-access-token\",\n \"url\": \"url-endpoint\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"hugging-face-embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"hugging_face\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"hugging-face-access-token\",\"url\":\"url-endpoint\"}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{jinaai_inference_id}': put: tags: - inference summary: Create an JinaAI inference endpoint description: "Create an inference endpoint to perform an inference task with the `jinaai` service.\n\nTo review the available `rerank` models, refer to .\nTo review the available `embedding` and `text_embedding` models, refer to .\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-jinaai parameters: - name: task_type in: path description: The type of the inference task that the model will perform. required: true schema: $ref: '#/components/schemas/inference._types.JinaAITaskType' - name: jinaai_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: chunking_settings: allOf: - $ref: '#/components/schemas/inference._types.InferenceChunkingSettings' description: "The chunking configuration object.\nApplies only to the `embedding` and text_embedding` task types.\nNot applicable to the `rerank` task type." externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config service: allOf: - $ref: '#/components/schemas/inference._types.JinaAIServiceType' description: 'The type of service supported for the specified task type. In this case, `jinaai`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.JinaAIServiceSettings' description: Settings used to install the inference model. These settings are specific to the `jinaai` service. task_settings: allOf: - $ref: '#/components/schemas/inference._types.JinaAITaskSettings' description: "Settings to configure the inference task.\nThese settings are specific to the task type you specified." examples: PutJinaAiRequestExample1: summary: A text embedding task description: Run `PUT _inference/text_embedding/jinaai-embeddings` to create an inference endpoint for text embedding tasks using the JinaAI service. value: "{\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v3\",\n \"api_key\": \"JinaAi-Api-key\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/jinaai-embeddings\n{\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v3\",\n \"api_key\": \"JinaAi-Api-key\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"jinaai-embeddings\",\n inference_config={\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v3\",\n \"api_key\": \"JinaAi-Api-key\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"jinaai-embeddings\",\n inference_config: {\n service: \"jinaai\",\n service_settings: {\n model_id: \"jina-embeddings-v3\",\n api_key: \"JinaAi-Api-key\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"jinaai-embeddings\",\n body: {\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v3\",\n \"api_key\": \"JinaAi-Api-key\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"jinaai-embeddings\",\n \"body\" => [\n \"service\" => \"jinaai\",\n \"service_settings\" => [\n \"model_id\" => \"jina-embeddings-v3\",\n \"api_key\" => \"JinaAi-Api-key\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"jinaai","service_settings":{"model_id":"jina-embeddings-v3","api_key":"JinaAi-Api-key"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/jinaai-embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"jinaai-embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"jinaai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"model_id\": \"jina-embeddings-v3\",\n \"api_key\": \"JinaAi-Api-key\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"jinaai-embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"jinaai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"model_id\":\"jina-embeddings-v3\",\"api_key\":\"JinaAi-Api-key\"}\n\"\"\"))\n )\n);\n" PutJinaAiRequestExample2: summary: A rerank task description: Run `PUT _inference/rerank/jinaai-rerank` to create an inference endpoint for rerank tasks using the JinaAI service. value: "{\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"api_key\": \"JinaAI-Api-key\",\n \"model_id\": \"jina-reranker-v2-base-multilingual\"\n },\n \"task_settings\": {\n \"top_n\": 10,\n \"return_documents\": true\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/rerank/jinaai-rerank\n{\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"api_key\": \"JinaAI-Api-key\",\n \"model_id\": \"jina-reranker-v2-base-multilingual\"\n },\n \"task_settings\": {\n \"top_n\": 10,\n \"return_documents\": true\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"jinaai-rerank\",\n inference_config={\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"api_key\": \"JinaAI-Api-key\",\n \"model_id\": \"jina-reranker-v2-base-multilingual\"\n },\n \"task_settings\": {\n \"top_n\": 10,\n \"return_documents\": True\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"jinaai-rerank\",\n inference_config: {\n service: \"jinaai\",\n service_settings: {\n api_key: \"JinaAI-Api-key\",\n model_id: \"jina-reranker-v2-base-multilingual\",\n },\n task_settings: {\n top_n: 10,\n return_documents: true,\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"jinaai-rerank\",\n body: {\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"api_key\": \"JinaAI-Api-key\",\n \"model_id\": \"jina-reranker-v2-base-multilingual\"\n },\n \"task_settings\": {\n \"top_n\": 10,\n \"return_documents\": true\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"jinaai-rerank\",\n \"body\" => [\n \"service\" => \"jinaai\",\n \"service_settings\" => [\n \"api_key\" => \"JinaAI-Api-key\",\n \"model_id\" => \"jina-reranker-v2-base-multilingual\",\n ],\n \"task_settings\" => [\n \"top_n\" => 10,\n \"return_documents\" => true,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"jinaai","service_settings":{"api_key":"JinaAI-Api-key","model_id":"jina-reranker-v2-base-multilingual"},"task_settings":{"top_n":10,"return_documents":true}}'' "$ELASTICSEARCH_URL/_inference/rerank/jinaai-rerank"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"jinaai-rerank\",\n TaskType = TaskType.Rerank,\n InferenceConfig = new()\n {\n Service = \"jinaai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"JinaAI-Api-key\",\n \"model_id\": \"jina-reranker-v2-base-multilingual\"\n }\n \"\"\"),\n TaskSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"top_n\": 10,\n \"return_documents\": true\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"jinaai-rerank\")\n .taskType(TaskType.Rerank)\n .inferenceConfig(i -> i\n .service(\"jinaai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"JinaAI-Api-key\",\"model_id\":\"jina-reranker-v2-base-multilingual\"}\n\"\"\"))\n .taskSettings(JsonData.fromJson(\"\"\"\n{\"top_n\":10,\"return_documents\":true}\n\"\"\"))\n )\n);\n" PutJinaAiRequestExample3: summary: An embedding task using a multimodal model description: Run `PUT _inference/embedding/jinaai-embeddings-multimodal` to create an inference endpoint for embedding tasks using an embedding model that supports multimodal inputs (e.g. `jina-embeddings-v4`) via the JinaAI service. value: "{\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v4\",\n \"api_key\": \"JinaAi-Api-key\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/embedding/jinaai-embeddings-multimodal\n{\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v4\",\n \"api_key\": \"JinaAi-Api-key\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"embedding\",\n inference_id=\"jinaai-embeddings-multimodal\",\n inference_config={\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v4\",\n \"api_key\": \"JinaAi-Api-key\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"embedding\",\n inference_id: \"jinaai-embeddings-multimodal\",\n inference_config: {\n service: \"jinaai\",\n service_settings: {\n model_id: \"jina-embeddings-v4\",\n api_key: \"JinaAi-Api-key\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"embedding\",\n inference_id: \"jinaai-embeddings-multimodal\",\n body: {\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v4\",\n \"api_key\": \"JinaAi-Api-key\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"embedding\",\n \"inference_id\" => \"jinaai-embeddings-multimodal\",\n \"body\" => [\n \"service\" => \"jinaai\",\n \"service_settings\" => [\n \"model_id\" => \"jina-embeddings-v4\",\n \"api_key\" => \"JinaAi-Api-key\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"jinaai","service_settings":{"model_id":"jina-embeddings-v4","api_key":"JinaAi-Api-key"}}'' "$ELASTICSEARCH_URL/_inference/embedding/jinaai-embeddings-multimodal"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"jinaai-embeddings-multimodal\",\n TaskType = TaskType.Embedding,\n InferenceConfig = new()\n {\n Service = \"jinaai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"model_id\": \"jina-embeddings-v4\",\n \"api_key\": \"JinaAi-Api-key\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"jinaai-embeddings-multimodal\")\n .taskType(TaskType.Embedding)\n .inferenceConfig(i -> i\n .service(\"jinaai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"model_id\":\"jina-embeddings-v4\",\"api_key\":\"JinaAi-Api-key\"}\n\"\"\"))\n )\n);\n" PutJinaAiRequestExample4: summary: An embedding task using a non-multimodal model description: Run `PUT _inference/embedding/jinaai-embeddings-text-only` to create an inference endpoint for embedding tasks using an embedding model that does not support multimodal inputs (e.g. `jina-embeddings-v3`) via the JinaAI service. value: "{\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v3\",\n \"api_key\": \"JinaAi-Api-key\",\n \"multimodal_model\": false\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/embedding/jinaai-embeddings-text-only\n{\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v3\",\n \"api_key\": \"JinaAi-Api-key\",\n \"multimodal_model\": false\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"embedding\",\n inference_id=\"jinaai-embeddings-text-only\",\n inference_config={\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v3\",\n \"api_key\": \"JinaAi-Api-key\",\n \"multimodal_model\": False\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"embedding\",\n inference_id: \"jinaai-embeddings-text-only\",\n inference_config: {\n service: \"jinaai\",\n service_settings: {\n model_id: \"jina-embeddings-v3\",\n api_key: \"JinaAi-Api-key\",\n multimodal_model: false,\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"embedding\",\n inference_id: \"jinaai-embeddings-text-only\",\n body: {\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v3\",\n \"api_key\": \"JinaAi-Api-key\",\n \"multimodal_model\": false\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"embedding\",\n \"inference_id\" => \"jinaai-embeddings-text-only\",\n \"body\" => [\n \"service\" => \"jinaai\",\n \"service_settings\" => [\n \"model_id\" => \"jina-embeddings-v3\",\n \"api_key\" => \"JinaAi-Api-key\",\n \"multimodal_model\" => false,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"jinaai","service_settings":{"model_id":"jina-embeddings-v3","api_key":"JinaAi-Api-key","multimodal_model":false}}'' "$ELASTICSEARCH_URL/_inference/embedding/jinaai-embeddings-text-only"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"jinaai-embeddings-text-only\",\n TaskType = TaskType.Embedding,\n InferenceConfig = new()\n {\n Service = \"jinaai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"model_id\": \"jina-embeddings-v3\",\n \"api_key\": \"JinaAi-Api-key\",\n \"multimodal_model\": false\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"jinaai-embeddings-text-only\")\n .taskType(TaskType.Embedding)\n .inferenceConfig(i -> i\n .service(\"jinaai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"model_id\":\"jina-embeddings-v3\",\"api_key\":\"JinaAi-Api-key\",\"multimodal_model\":false}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoJinaAi' examples: PutJinaAiResponseExample1: summary: A text embedding task description: A successful response when creating a JinaAI `text_embedding` inference endpoint. value: "{\n \"inference_id\": \"jinaai-embeddings\",\n \"task_type\": \"text_embedding\",\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v3\",\n \"rate_limit\": {\n \"requests_per_minute\": 2000\n },\n \"dimensions\": 1024,\n \"embedding_type\": \"float\",\n \"similarity\": \"dot_product\"\n },\n \"chunking_settings\": {\n \"strategy\": \"sentence\",\n \"max_chunk_size\": 250,\n \"sentence_overlap\": 1\n }\n}" PutJinaAiResponseExample2: summary: A rerank task description: A successful response when creating a JinaAI `rerank` inference endpoint. value: "{\n \"inference_id\": \"jinaai-rerank\",\n \"task_type\": \"rerank\",\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-reranker-v2-base-multilingual\",\n \"rate_limit\": {\n \"requests_per_minute\": 2000\n }\n },\n \"task_settings\": {\n \"top_n\": 10,\n \"return_documents\": true\n }\n}" PutJinaAiResponseExample3: summary: An embedding task using a multimodal model description: A successful response when creating a JinaAI `embedding` inference endpoint. value: "{\n \"inference_id\": \"jinaai-embeddings-multimodal\",\n \"task_type\": \"embedding\",\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v4\",\n \"rate_limit\": {\n \"requests_per_minute\": 2000\n },\n \"dimensions\": 2048,\n \"embedding_type\": \"float\",\n \"similarity\": \"dot_product\",\n \"multimodal_model\": true\n },\n \"chunking_settings\": {\n \"strategy\": \"sentence\",\n \"max_chunk_size\": 250,\n \"sentence_overlap\": 1\n }\n}" PutJinaAiResponseExample4: summary: An embedding task using a non-multimodal model description: A successful response when creating a JinaAI `embedding` inference endpoint with a model that does not support multimodal inputs. value: "{\n \"inference_id\": \"jinaai-embeddings-text-only\",\n \"task_type\": \"embedding\",\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v3\",\n \"rate_limit\": {\n \"requests_per_minute\": 2000\n },\n \"dimensions\": 1024,\n \"embedding_type\": \"float\",\n \"similarity\": \"dot_product\",\n \"multimodal_model\": false\n },\n \"chunking_settings\": {\n \"strategy\": \"sentence\",\n \"max_chunk_size\": 250,\n \"sentence_overlap\": 1\n }\n}" x-state: Generally available; Added in 8.18.0 x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/jinaai-embeddings\n{\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v3\",\n \"api_key\": \"JinaAi-Api-key\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"jinaai-embeddings\",\n inference_config={\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v3\",\n \"api_key\": \"JinaAi-Api-key\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"jinaai-embeddings\",\n inference_config: {\n service: \"jinaai\",\n service_settings: {\n model_id: \"jina-embeddings-v3\",\n api_key: \"JinaAi-Api-key\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"jinaai-embeddings\",\n body: {\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v3\",\n \"api_key\": \"JinaAi-Api-key\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"jinaai-embeddings\",\n \"body\" => [\n \"service\" => \"jinaai\",\n \"service_settings\" => [\n \"model_id\" => \"jina-embeddings-v3\",\n \"api_key\" => \"JinaAi-Api-key\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"jinaai","service_settings":{"model_id":"jina-embeddings-v3","api_key":"JinaAi-Api-key"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/jinaai-embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"jinaai-embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"jinaai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"model_id\": \"jina-embeddings-v3\",\n \"api_key\": \"JinaAi-Api-key\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"jinaai-embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"jinaai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"model_id\":\"jina-embeddings-v3\",\"api_key\":\"JinaAi-Api-key\"}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{llama_inference_id}': put: tags: - inference summary: Create a Llama inference endpoint description: "Create an inference endpoint to perform an inference task with the `llama` service.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-llama parameters: - name: task_type in: path description: The type of the inference task that the model will perform. required: true schema: $ref: '#/components/schemas/inference._types.LlamaTaskType' - name: llama_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: chunking_settings: allOf: - $ref: '#/components/schemas/inference._types.InferenceChunkingSettings' description: "The chunking configuration object.\nApplies only to the `text_embedding` task type.\nNot applicable to the `completion` or `chat_completion` task types." externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config service: allOf: - $ref: '#/components/schemas/inference._types.LlamaServiceType' description: 'The type of service supported for the specified task type. In this case, `llama`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.LlamaServiceSettings' description: Settings used to install the inference model. These settings are specific to the `llama` service. examples: PutLlamaRequestExample1: description: Run `PUT _inference/text_embedding/llama-text-embedding` to create a Llama inference endpoint that performs a `text_embedding` task. value: "{\n \"service\": \"llama\",\n \"service_settings\": {\n \"url\": \"http://localhost:8321/v1/inference/embeddings\",\n \"dimensions\": 384,\n \"model_id\": \"all-MiniLM-L6-v2\" \n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/llama-text-embedding\n{\n \"service\": \"llama\",\n \"service_settings\": {\n \"url\": \"http://localhost:8321/v1/inference/embeddings\",\n \"dimensions\": 384,\n \"model_id\": \"all-MiniLM-L6-v2\" \n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"llama-text-embedding\",\n inference_config={\n \"service\": \"llama\",\n \"service_settings\": {\n \"url\": \"http://localhost:8321/v1/inference/embeddings\",\n \"dimensions\": 384,\n \"model_id\": \"all-MiniLM-L6-v2\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"llama-text-embedding\",\n inference_config: {\n service: \"llama\",\n service_settings: {\n url: \"http://localhost:8321/v1/inference/embeddings\",\n dimensions: 384,\n model_id: \"all-MiniLM-L6-v2\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"llama-text-embedding\",\n body: {\n \"service\": \"llama\",\n \"service_settings\": {\n \"url\": \"http://localhost:8321/v1/inference/embeddings\",\n \"dimensions\": 384,\n \"model_id\": \"all-MiniLM-L6-v2\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"llama-text-embedding\",\n \"body\" => [\n \"service\" => \"llama\",\n \"service_settings\" => [\n \"url\" => \"http://localhost:8321/v1/inference/embeddings\",\n \"dimensions\" => 384,\n \"model_id\" => \"all-MiniLM-L6-v2\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"llama","service_settings":{"url":"http://localhost:8321/v1/inference/embeddings","dimensions":384,"model_id":"all-MiniLM-L6-v2"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/llama-text-embedding"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"llama-text-embedding\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"llama\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"url\": \"http://localhost:8321/v1/inference/embeddings\",\n \"dimensions\": 384,\n \"model_id\": \"all-MiniLM-L6-v2\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"llama-text-embedding\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"llama\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"url\":\"http://localhost:8321/v1/inference/embeddings\",\"dimensions\":384,\"model_id\":\"all-MiniLM-L6-v2\"}\n\"\"\"))\n )\n);\n" PutLlamaRequestExample2: description: Run `PUT _inference/completion/llama-completion` to create a Llama inference endpoint that performs a `completion` task. value: "{\n \"service\": \"llama\",\n \"service_settings\": {\n \"url\": \"http://localhost:8321/v1/openai/v1/chat/completions\",\n \"model_id\": \"llama3.2:3b\" \n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/llama-completion\n{\n \"service\": \"llama\",\n \"service_settings\": {\n \"url\": \"http://localhost:8321/v1/openai/v1/chat/completions\",\n \"model_id\": \"llama3.2:3b\" \n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"llama-completion\",\n inference_config={\n \"service\": \"llama\",\n \"service_settings\": {\n \"url\": \"http://localhost:8321/v1/openai/v1/chat/completions\",\n \"model_id\": \"llama3.2:3b\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"llama-completion\",\n inference_config: {\n service: \"llama\",\n service_settings: {\n url: \"http://localhost:8321/v1/openai/v1/chat/completions\",\n model_id: \"llama3.2:3b\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"llama-completion\",\n body: {\n \"service\": \"llama\",\n \"service_settings\": {\n \"url\": \"http://localhost:8321/v1/openai/v1/chat/completions\",\n \"model_id\": \"llama3.2:3b\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"llama-completion\",\n \"body\" => [\n \"service\" => \"llama\",\n \"service_settings\" => [\n \"url\" => \"http://localhost:8321/v1/openai/v1/chat/completions\",\n \"model_id\" => \"llama3.2:3b\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"llama","service_settings":{"url":"http://localhost:8321/v1/openai/v1/chat/completions","model_id":"llama3.2:3b"}}'' "$ELASTICSEARCH_URL/_inference/completion/llama-completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"llama-completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"llama\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"url\": \"http://localhost:8321/v1/openai/v1/chat/completions\",\n \"model_id\": \"llama3.2:3b\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"llama-completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"llama\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"url\":\"http://localhost:8321/v1/openai/v1/chat/completions\",\"model_id\":\"llama3.2:3b\"}\n\"\"\"))\n )\n);\n" PutLlamaRequestExample3: description: Run `PUT _inference/chat_completion/llama-chat-completion` to create a Llama inference endpoint that performs a `chat_completion` task. value: "{\n \"service\": \"llama\",\n \"service_settings\": {\n \"url\": \"http://localhost:8321/v1/openai/v1/chat/completions\",\n \"model_id\": \"llama3.2:3b\" \n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/chat_completion/llama-chat-completion\n{\n \"service\": \"llama\",\n \"service_settings\": {\n \"url\": \"http://localhost:8321/v1/openai/v1/chat/completions\",\n \"model_id\": \"llama3.2:3b\" \n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"chat_completion\",\n inference_id=\"llama-chat-completion\",\n inference_config={\n \"service\": \"llama\",\n \"service_settings\": {\n \"url\": \"http://localhost:8321/v1/openai/v1/chat/completions\",\n \"model_id\": \"llama3.2:3b\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"chat_completion\",\n inference_id: \"llama-chat-completion\",\n inference_config: {\n service: \"llama\",\n service_settings: {\n url: \"http://localhost:8321/v1/openai/v1/chat/completions\",\n model_id: \"llama3.2:3b\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"chat_completion\",\n inference_id: \"llama-chat-completion\",\n body: {\n \"service\": \"llama\",\n \"service_settings\": {\n \"url\": \"http://localhost:8321/v1/openai/v1/chat/completions\",\n \"model_id\": \"llama3.2:3b\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"chat_completion\",\n \"inference_id\" => \"llama-chat-completion\",\n \"body\" => [\n \"service\" => \"llama\",\n \"service_settings\" => [\n \"url\" => \"http://localhost:8321/v1/openai/v1/chat/completions\",\n \"model_id\" => \"llama3.2:3b\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"llama","service_settings":{"url":"http://localhost:8321/v1/openai/v1/chat/completions","model_id":"llama3.2:3b"}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/llama-chat-completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"llama-chat-completion\",\n TaskType = TaskType.ChatCompletion,\n InferenceConfig = new()\n {\n Service = \"llama\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"url\": \"http://localhost:8321/v1/openai/v1/chat/completions\",\n \"model_id\": \"llama3.2:3b\"\n }\n \"\"\")\n }\n });" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoLlama' x-state: Generally available; Added in 9.2.0 x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/llama-text-embedding\n{\n \"service\": \"llama\",\n \"service_settings\": {\n \"url\": \"http://localhost:8321/v1/inference/embeddings\",\n \"dimensions\": 384,\n \"model_id\": \"all-MiniLM-L6-v2\" \n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"llama-text-embedding\",\n inference_config={\n \"service\": \"llama\",\n \"service_settings\": {\n \"url\": \"http://localhost:8321/v1/inference/embeddings\",\n \"dimensions\": 384,\n \"model_id\": \"all-MiniLM-L6-v2\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"llama-text-embedding\",\n inference_config: {\n service: \"llama\",\n service_settings: {\n url: \"http://localhost:8321/v1/inference/embeddings\",\n dimensions: 384,\n model_id: \"all-MiniLM-L6-v2\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"llama-text-embedding\",\n body: {\n \"service\": \"llama\",\n \"service_settings\": {\n \"url\": \"http://localhost:8321/v1/inference/embeddings\",\n \"dimensions\": 384,\n \"model_id\": \"all-MiniLM-L6-v2\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"llama-text-embedding\",\n \"body\" => [\n \"service\" => \"llama\",\n \"service_settings\" => [\n \"url\" => \"http://localhost:8321/v1/inference/embeddings\",\n \"dimensions\" => 384,\n \"model_id\" => \"all-MiniLM-L6-v2\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"llama","service_settings":{"url":"http://localhost:8321/v1/inference/embeddings","dimensions":384,"model_id":"all-MiniLM-L6-v2"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/llama-text-embedding"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"llama-text-embedding\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"llama\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"url\": \"http://localhost:8321/v1/inference/embeddings\",\n \"dimensions\": 384,\n \"model_id\": \"all-MiniLM-L6-v2\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"llama-text-embedding\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"llama\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"url\":\"http://localhost:8321/v1/inference/embeddings\",\"dimensions\":384,\"model_id\":\"all-MiniLM-L6-v2\"}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{mistral_inference_id}': put: tags: - inference summary: Create a Mistral inference endpoint description: "Create an inference endpoint to perform an inference task with the `mistral` service.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-mistral parameters: - name: task_type in: path description: The type of the inference task that the model will perform. required: true schema: $ref: '#/components/schemas/inference._types.MistralTaskType' - name: mistral_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: chunking_settings: allOf: - $ref: '#/components/schemas/inference._types.InferenceChunkingSettings' description: "The chunking configuration object.\nApplies only to the `text_embedding` task type.\nNot applicable to the `completion` or `chat_completion` task types." externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config service: allOf: - $ref: '#/components/schemas/inference._types.MistralServiceType' description: 'The type of service supported for the specified task type. In this case, `mistral`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.MistralServiceSettings' description: Settings used to install the inference model. These settings are specific to the `mistral` service. examples: PutMistralRequestExample1: description: Run `PUT _inference/text_embedding/mistral-embeddings-test` to create a Mistral inference endpoint that performs a text embedding task. value: "{\n \"service\": \"mistral\",\n \"service_settings\": {\n \"api_key\": \"Mistral-API-Key\",\n \"model\": \"mistral-embed\" \n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/mistral-embeddings-test\n{\n \"service\": \"mistral\",\n \"service_settings\": {\n \"api_key\": \"Mistral-API-Key\",\n \"model\": \"mistral-embed\" \n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"mistral-embeddings-test\",\n inference_config={\n \"service\": \"mistral\",\n \"service_settings\": {\n \"api_key\": \"Mistral-API-Key\",\n \"model\": \"mistral-embed\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"mistral-embeddings-test\",\n inference_config: {\n service: \"mistral\",\n service_settings: {\n api_key: \"Mistral-API-Key\",\n model: \"mistral-embed\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"mistral-embeddings-test\",\n body: {\n \"service\": \"mistral\",\n \"service_settings\": {\n \"api_key\": \"Mistral-API-Key\",\n \"model\": \"mistral-embed\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"mistral-embeddings-test\",\n \"body\" => [\n \"service\" => \"mistral\",\n \"service_settings\" => [\n \"api_key\" => \"Mistral-API-Key\",\n \"model\" => \"mistral-embed\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"mistral","service_settings":{"api_key":"Mistral-API-Key","model":"mistral-embed"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/mistral-embeddings-test"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"mistral-embeddings-test\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"mistral\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"Mistral-API-Key\",\n \"model\": \"mistral-embed\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"mistral-embeddings-test\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"mistral\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"Mistral-API-Key\",\"model\":\"mistral-embed\"}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoMistral' x-state: Generally available; Added in 8.15.0 x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/mistral-embeddings-test\n{\n \"service\": \"mistral\",\n \"service_settings\": {\n \"api_key\": \"Mistral-API-Key\",\n \"model\": \"mistral-embed\" \n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"mistral-embeddings-test\",\n inference_config={\n \"service\": \"mistral\",\n \"service_settings\": {\n \"api_key\": \"Mistral-API-Key\",\n \"model\": \"mistral-embed\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"mistral-embeddings-test\",\n inference_config: {\n service: \"mistral\",\n service_settings: {\n api_key: \"Mistral-API-Key\",\n model: \"mistral-embed\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"mistral-embeddings-test\",\n body: {\n \"service\": \"mistral\",\n \"service_settings\": {\n \"api_key\": \"Mistral-API-Key\",\n \"model\": \"mistral-embed\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"mistral-embeddings-test\",\n \"body\" => [\n \"service\" => \"mistral\",\n \"service_settings\" => [\n \"api_key\" => \"Mistral-API-Key\",\n \"model\" => \"mistral-embed\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"mistral","service_settings":{"api_key":"Mistral-API-Key","model":"mistral-embed"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/mistral-embeddings-test"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"mistral-embeddings-test\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"mistral\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"Mistral-API-Key\",\n \"model\": \"mistral-embed\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"mistral-embeddings-test\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"mistral\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"Mistral-API-Key\",\"model\":\"mistral-embed\"}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{nvidia_inference_id}': put: tags: - inference summary: Create an Nvidia inference endpoint description: "Create an inference endpoint to perform an inference task with the `nvidia` service.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-nvidia parameters: - name: task_type in: path description: "The type of the inference task that the model will perform.\nNOTE: The `chat_completion` task type only supports streaming and only through the _stream API." required: true schema: $ref: '#/components/schemas/inference._types.NvidiaTaskType' - name: nvidia_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: chunking_settings: allOf: - $ref: '#/components/schemas/inference._types.InferenceChunkingSettings' description: "The chunking configuration object.\nApplies only to the `text_embedding` task type.\nNot applicable to the `rerank`, `completion`, or `chat_completion` task types." externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config service: allOf: - $ref: '#/components/schemas/inference._types.NvidiaServiceType' description: 'The type of service supported for the specified task type. In this case, `nvidia`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.NvidiaServiceSettings' description: Settings used to install the inference model. These settings are specific to the `nvidia` service. task_settings: allOf: - $ref: '#/components/schemas/inference._types.NvidiaTaskSettings' description: "Settings to configure the inference task.\nApplies only to the `text_embedding` task type.\nNot applicable to the `rerank`, `completion`, or `chat_completion` task types.\nThese settings are specific to the task type you specified." examples: PutNvidiaRequestExample1: summary: A text embedding task description: Run `PUT _inference/text_embedding/nvidia-text-embedding` to create an inference endpoint that performs a `text_embedding` task. value: "{\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"url\": \"nvidia-embeddings-url\",\n \"api_key\": \"nvidia-embeddings-token\",\n \"model_id\": \"nvidia/llama-3.2-nv-embedqa-1b-v2\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/nvidia-text-embedding\n{\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"url\": \"nvidia-embeddings-url\",\n \"api_key\": \"nvidia-embeddings-token\",\n \"model_id\": \"nvidia/llama-3.2-nv-embedqa-1b-v2\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"nvidia-text-embedding\",\n inference_config={\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"url\": \"nvidia-embeddings-url\",\n \"api_key\": \"nvidia-embeddings-token\",\n \"model_id\": \"nvidia/llama-3.2-nv-embedqa-1b-v2\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"nvidia-text-embedding\",\n inference_config: {\n service: \"nvidia\",\n service_settings: {\n url: \"nvidia-embeddings-url\",\n api_key: \"nvidia-embeddings-token\",\n model_id: \"nvidia/llama-3.2-nv-embedqa-1b-v2\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"nvidia-text-embedding\",\n body: {\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"url\": \"nvidia-embeddings-url\",\n \"api_key\": \"nvidia-embeddings-token\",\n \"model_id\": \"nvidia/llama-3.2-nv-embedqa-1b-v2\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"nvidia-text-embedding\",\n \"body\" => [\n \"service\" => \"nvidia\",\n \"service_settings\" => [\n \"url\" => \"nvidia-embeddings-url\",\n \"api_key\" => \"nvidia-embeddings-token\",\n \"model_id\" => \"nvidia/llama-3.2-nv-embedqa-1b-v2\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"nvidia","service_settings":{"url":"nvidia-embeddings-url","api_key":"nvidia-embeddings-token","model_id":"nvidia/llama-3.2-nv-embedqa-1b-v2"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/nvidia-text-embedding"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"nvidia-text-embedding\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"nvidia\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"url\": \"nvidia-embeddings-url\",\n \"api_key\": \"nvidia-embeddings-token\",\n \"model_id\": \"nvidia/llama-3.2-nv-embedqa-1b-v2\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"nvidia-text-embedding\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"nvidia\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"url\":\"nvidia-embeddings-url\",\"api_key\":\"nvidia-embeddings-token\",\"model_id\":\"nvidia/llama-3.2-nv-embedqa-1b-v2\"}\n\"\"\"))\n )\n);\n" PutNvidiaRequestExample2: summary: A text embedding task with custom `task_settings` and no `url` parameter description: 'Run `PUT _inference/text_embedding/nvidia-text-embedding` to create an inference endpoint that performs a `text_embedding` task, specifying custom `task_settings` and omitting the `url` parameter if model is accessible via default NVIDIA endpoint.' value: "{\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"model_id\": \"nvidia/llama-3.2-nv-embedqa-1b-v2\",\n \"api_key\": \"nvidia-text-embeddings-token\"\n },\n \"task_settings\": {\n \"input_type\": \"ingest\",\n \"truncate\": \"start\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/nvidia-text-embedding\n{\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"model_id\": \"nvidia/llama-3.2-nv-embedqa-1b-v2\",\n \"api_key\": \"nvidia-text-embeddings-token\"\n },\n \"task_settings\": {\n \"input_type\": \"ingest\",\n \"truncate\": \"start\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"nvidia-text-embedding\",\n inference_config={\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"model_id\": \"nvidia/llama-3.2-nv-embedqa-1b-v2\",\n \"api_key\": \"nvidia-text-embeddings-token\"\n },\n \"task_settings\": {\n \"input_type\": \"ingest\",\n \"truncate\": \"start\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"nvidia-text-embedding\",\n inference_config: {\n service: \"nvidia\",\n service_settings: {\n model_id: \"nvidia/llama-3.2-nv-embedqa-1b-v2\",\n api_key: \"nvidia-text-embeddings-token\",\n },\n task_settings: {\n input_type: \"ingest\",\n truncate: \"start\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"nvidia-text-embedding\",\n body: {\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"model_id\": \"nvidia/llama-3.2-nv-embedqa-1b-v2\",\n \"api_key\": \"nvidia-text-embeddings-token\"\n },\n \"task_settings\": {\n \"input_type\": \"ingest\",\n \"truncate\": \"start\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"nvidia-text-embedding\",\n \"body\" => [\n \"service\" => \"nvidia\",\n \"service_settings\" => [\n \"model_id\" => \"nvidia/llama-3.2-nv-embedqa-1b-v2\",\n \"api_key\" => \"nvidia-text-embeddings-token\",\n ],\n \"task_settings\" => [\n \"input_type\" => \"ingest\",\n \"truncate\" => \"start\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"nvidia","service_settings":{"model_id":"nvidia/llama-3.2-nv-embedqa-1b-v2","api_key":"nvidia-text-embeddings-token"},"task_settings":{"input_type":"ingest","truncate":"start"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/nvidia-text-embedding"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"nvidia-text-embedding\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"nvidia\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"model_id\": \"nvidia/llama-3.2-nv-embedqa-1b-v2\",\n \"api_key\": \"nvidia-text-embeddings-token\"\n }\n \"\"\"),\n TaskSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"input_type\": \"ingest\",\n \"truncate\": \"start\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"nvidia-text-embedding\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"nvidia\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"model_id\":\"nvidia/llama-3.2-nv-embedqa-1b-v2\",\"api_key\":\"nvidia-text-embeddings-token\"}\n\"\"\"))\n .taskSettings(JsonData.fromJson(\"\"\"\n{\"input_type\":\"ingest\",\"truncate\":\"start\"}\n\"\"\"))\n )\n);\n" PutNvidiaRequestExample3: summary: A completion task description: Run `PUT _inference/completion/nvidia-completion` to create an inference endpoint that performs a `completion` task. value: "{\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"url\": \"nvidia-completion-url\",\n \"api_key\": \"nvidia-completion-token\",\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/nvidia-completion\n{\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"url\": \"nvidia-completion-url\",\n \"api_key\": \"nvidia-completion-token\",\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"nvidia-completion\",\n inference_config={\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"url\": \"nvidia-completion-url\",\n \"api_key\": \"nvidia-completion-token\",\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"nvidia-completion\",\n inference_config: {\n service: \"nvidia\",\n service_settings: {\n url: \"nvidia-completion-url\",\n api_key: \"nvidia-completion-token\",\n model_id: \"microsoft/phi-3-mini-128k-instruct\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"nvidia-completion\",\n body: {\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"url\": \"nvidia-completion-url\",\n \"api_key\": \"nvidia-completion-token\",\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"nvidia-completion\",\n \"body\" => [\n \"service\" => \"nvidia\",\n \"service_settings\" => [\n \"url\" => \"nvidia-completion-url\",\n \"api_key\" => \"nvidia-completion-token\",\n \"model_id\" => \"microsoft/phi-3-mini-128k-instruct\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"nvidia","service_settings":{"url":"nvidia-completion-url","api_key":"nvidia-completion-token","model_id":"microsoft/phi-3-mini-128k-instruct"}}'' "$ELASTICSEARCH_URL/_inference/completion/nvidia-completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"nvidia-completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"nvidia\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"url\": \"nvidia-completion-url\",\n \"api_key\": \"nvidia-completion-token\",\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"nvidia-completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"nvidia\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"url\":\"nvidia-completion-url\",\"api_key\":\"nvidia-completion-token\",\"model_id\":\"microsoft/phi-3-mini-128k-instruct\"}\n\"\"\"))\n )\n);\n" PutNvidiaRequestExample4: summary: A completion task without `url` parameter description: 'Run `PUT _inference/completion/nvidia-completion` to create an inference endpoint that performs a `completion` task, omitting the `url` parameter if model is accessible via default NVIDIA endpoint.' value: "{\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"api_key\": \"nvidia-completion-token\",\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/nvidia-completion\n{\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"api_key\": \"nvidia-completion-token\",\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"nvidia-completion\",\n inference_config={\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"api_key\": \"nvidia-completion-token\",\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"nvidia-completion\",\n inference_config: {\n service: \"nvidia\",\n service_settings: {\n api_key: \"nvidia-completion-token\",\n model_id: \"microsoft/phi-3-mini-128k-instruct\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"nvidia-completion\",\n body: {\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"api_key\": \"nvidia-completion-token\",\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"nvidia-completion\",\n \"body\" => [\n \"service\" => \"nvidia\",\n \"service_settings\" => [\n \"api_key\" => \"nvidia-completion-token\",\n \"model_id\" => \"microsoft/phi-3-mini-128k-instruct\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"nvidia","service_settings":{"api_key":"nvidia-completion-token","model_id":"microsoft/phi-3-mini-128k-instruct"}}'' "$ELASTICSEARCH_URL/_inference/completion/nvidia-completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"nvidia-completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"nvidia\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"nvidia-completion-token\",\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"nvidia-completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"nvidia\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"nvidia-completion-token\",\"model_id\":\"microsoft/phi-3-mini-128k-instruct\"}\n\"\"\"))\n )\n);\n" PutNvidiaRequestExample5: summary: A chat completion task description: Run `PUT _inference/chat_completion/nvidia-chat-completion` to create an inference endpoint that performs a `chat_completion` task. value: "{\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"url\": \"nvidia-chat-completion-url\",\n \"api_key\": \"nvidia-chat-completion-token\",\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/chat_completion/nvidia-chat-completion\n{\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"url\": \"nvidia-chat-completion-url\",\n \"api_key\": \"nvidia-chat-completion-token\",\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"chat_completion\",\n inference_id=\"nvidia-chat-completion\",\n inference_config={\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"url\": \"nvidia-chat-completion-url\",\n \"api_key\": \"nvidia-chat-completion-token\",\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"chat_completion\",\n inference_id: \"nvidia-chat-completion\",\n inference_config: {\n service: \"nvidia\",\n service_settings: {\n url: \"nvidia-chat-completion-url\",\n api_key: \"nvidia-chat-completion-token\",\n model_id: \"microsoft/phi-3-mini-128k-instruct\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"chat_completion\",\n inference_id: \"nvidia-chat-completion\",\n body: {\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"url\": \"nvidia-chat-completion-url\",\n \"api_key\": \"nvidia-chat-completion-token\",\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"chat_completion\",\n \"inference_id\" => \"nvidia-chat-completion\",\n \"body\" => [\n \"service\" => \"nvidia\",\n \"service_settings\" => [\n \"url\" => \"nvidia-chat-completion-url\",\n \"api_key\" => \"nvidia-chat-completion-token\",\n \"model_id\" => \"microsoft/phi-3-mini-128k-instruct\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"nvidia","service_settings":{"url":"nvidia-chat-completion-url","api_key":"nvidia-chat-completion-token","model_id":"microsoft/phi-3-mini-128k-instruct"}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/nvidia-chat-completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"nvidia-chat-completion\",\n TaskType = TaskType.ChatCompletion,\n InferenceConfig = new()\n {\n Service = \"nvidia\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"url\": \"nvidia-chat-completion-url\",\n \"api_key\": \"nvidia-chat-completion-token\",\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"nvidia-chat-completion\")\n .taskType(TaskType.ChatCompletion)\n .inferenceConfig(i -> i\n .service(\"nvidia\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"url\":\"nvidia-chat-completion-url\",\"api_key\":\"nvidia-chat-completion-token\",\"model_id\":\"microsoft/phi-3-mini-128k-instruct\"}\n\"\"\"))\n )\n);\n" PutNvidiaRequestExample6: summary: A chat completion task without `url` parameter description: 'Run `PUT _inference/chat_completion/nvidia-chat-completion` to create an inference endpoint that performs a `chat_completion` task, omitting the `url` parameter if model is accessible via default NVIDIA endpoint.' value: "{\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"api_key\": \"nvidia-chat-completion-token\",\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/chat_completion/nvidia-chat-completion\n{\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"api_key\": \"nvidia-chat-completion-token\",\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"chat_completion\",\n inference_id=\"nvidia-chat-completion\",\n inference_config={\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"api_key\": \"nvidia-chat-completion-token\",\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"chat_completion\",\n inference_id: \"nvidia-chat-completion\",\n inference_config: {\n service: \"nvidia\",\n service_settings: {\n api_key: \"nvidia-chat-completion-token\",\n model_id: \"microsoft/phi-3-mini-128k-instruct\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"chat_completion\",\n inference_id: \"nvidia-chat-completion\",\n body: {\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"api_key\": \"nvidia-chat-completion-token\",\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"chat_completion\",\n \"inference_id\" => \"nvidia-chat-completion\",\n \"body\" => [\n \"service\" => \"nvidia\",\n \"service_settings\" => [\n \"api_key\" => \"nvidia-chat-completion-token\",\n \"model_id\" => \"microsoft/phi-3-mini-128k-instruct\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"nvidia","service_settings":{"api_key":"nvidia-chat-completion-token","model_id":"microsoft/phi-3-mini-128k-instruct"}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/nvidia-chat-completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"nvidia-chat-completion\",\n TaskType = TaskType.ChatCompletion,\n InferenceConfig = new()\n {\n Service = \"nvidia\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"nvidia-chat-completion-token\",\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"nvidia-chat-completion\")\n .taskType(TaskType.ChatCompletion)\n .inferenceConfig(i -> i\n .service(\"nvidia\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"nvidia-chat-completion-token\",\"model_id\":\"microsoft/phi-3-mini-128k-instruct\"}\n\"\"\"))\n )\n);\n" PutNvidiaRequestExample7: summary: A rerank task description: Run `PUT _inference/rerank/nvidia-rerank` to create an inference endpoint that performs a `rerank` task. value: "{\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"url\": \"nvidia-rerank-url\",\n \"api_key\": \"nvidia-rerank-token\",\n \"model_id\": \"nv-rerank-qa-mistral-4b:1\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/rerank/nvidia-rerank\n{\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"url\": \"nvidia-rerank-url\",\n \"api_key\": \"nvidia-rerank-token\",\n \"model_id\": \"nv-rerank-qa-mistral-4b:1\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"nvidia-rerank\",\n inference_config={\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"url\": \"nvidia-rerank-url\",\n \"api_key\": \"nvidia-rerank-token\",\n \"model_id\": \"nv-rerank-qa-mistral-4b:1\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"nvidia-rerank\",\n inference_config: {\n service: \"nvidia\",\n service_settings: {\n url: \"nvidia-rerank-url\",\n api_key: \"nvidia-rerank-token\",\n model_id: \"nv-rerank-qa-mistral-4b:1\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"nvidia-rerank\",\n body: {\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"url\": \"nvidia-rerank-url\",\n \"api_key\": \"nvidia-rerank-token\",\n \"model_id\": \"nv-rerank-qa-mistral-4b:1\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"nvidia-rerank\",\n \"body\" => [\n \"service\" => \"nvidia\",\n \"service_settings\" => [\n \"url\" => \"nvidia-rerank-url\",\n \"api_key\" => \"nvidia-rerank-token\",\n \"model_id\" => \"nv-rerank-qa-mistral-4b:1\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"nvidia","service_settings":{"url":"nvidia-rerank-url","api_key":"nvidia-rerank-token","model_id":"nv-rerank-qa-mistral-4b:1"}}'' "$ELASTICSEARCH_URL/_inference/rerank/nvidia-rerank"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"nvidia-rerank\",\n TaskType = TaskType.Rerank,\n InferenceConfig = new()\n {\n Service = \"nvidia\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"url\": \"nvidia-rerank-url\",\n \"api_key\": \"nvidia-rerank-token\",\n \"model_id\": \"nv-rerank-qa-mistral-4b:1\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"nvidia-rerank\")\n .taskType(TaskType.Rerank)\n .inferenceConfig(i -> i\n .service(\"nvidia\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"url\":\"nvidia-rerank-url\",\"api_key\":\"nvidia-rerank-token\",\"model_id\":\"nv-rerank-qa-mistral-4b:1\"}\n\"\"\"))\n )\n);\n" PutNvidiaRequestExample8: summary: A rerank task without `url` parameter description: 'Run `PUT _inference/rerank/nvidia-rerank` to create an inference endpoint that performs a `rerank` task, omitting the `url` parameter if model is accessible via default NVIDIA endpoint.' value: "{\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"api_key\": \"nvidia-rerank-token\",\n \"model_id\": \"nv-rerank-qa-mistral-4b:1\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/rerank/nvidia-rerank\n{\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"api_key\": \"nvidia-rerank-token\",\n \"model_id\": \"nv-rerank-qa-mistral-4b:1\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"nvidia-rerank\",\n inference_config={\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"api_key\": \"nvidia-rerank-token\",\n \"model_id\": \"nv-rerank-qa-mistral-4b:1\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"nvidia-rerank\",\n inference_config: {\n service: \"nvidia\",\n service_settings: {\n api_key: \"nvidia-rerank-token\",\n model_id: \"nv-rerank-qa-mistral-4b:1\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"nvidia-rerank\",\n body: {\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"api_key\": \"nvidia-rerank-token\",\n \"model_id\": \"nv-rerank-qa-mistral-4b:1\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"nvidia-rerank\",\n \"body\" => [\n \"service\" => \"nvidia\",\n \"service_settings\" => [\n \"api_key\" => \"nvidia-rerank-token\",\n \"model_id\" => \"nv-rerank-qa-mistral-4b:1\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"nvidia","service_settings":{"api_key":"nvidia-rerank-token","model_id":"nv-rerank-qa-mistral-4b:1"}}'' "$ELASTICSEARCH_URL/_inference/rerank/nvidia-rerank"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"nvidia-rerank\",\n TaskType = TaskType.Rerank,\n InferenceConfig = new()\n {\n Service = \"nvidia\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"nvidia-rerank-token\",\n \"model_id\": \"nv-rerank-qa-mistral-4b:1\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"nvidia-rerank\")\n .taskType(TaskType.Rerank)\n .inferenceConfig(i -> i\n .service(\"nvidia\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"nvidia-rerank-token\",\"model_id\":\"nv-rerank-qa-mistral-4b:1\"}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoNvidia' examples: PutNvidiaResponseExample1: summary: A text embedding task description: A successful response when creating an Nvidia `text_embedding` inference endpoint. value: "{\n \"inference_id\": \"nvidia-text-embedding\",\n \"task_type\": \"text_embedding\",\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"model_id\": \"nvidia/llama-3.2-nv-embedqa-1b-v2\",\n \"url\": \"nvidia-embeddings-url\",\n \"rate_limit\": {\n \"requests_per_minute\": 3000\n },\n \"dimensions\": 2048,\n \"similarity\": \"dot_product\"\n },\n \"chunking_settings\": {\n \"strategy\": \"sentence\",\n \"max_chunk_size\": 250,\n \"sentence_overlap\": 1\n }\n}" PutNvidiaResponseExample2: summary: A text embedding task with custom `task_settings` and no `url` parameter description: A successful response when creating an Nvidia `text_embedding` inference endpoint with custom `task_settings` and no `url` parameter. value: "{\n \"inference_id\": \"nvidia-text-embedding\",\n \"task_type\": \"text_embedding\",\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"model_id\": \"nvidia/llama-3.2-nv-embedqa-1b-v2\",\n \"rate_limit\": {\n \"requests_per_minute\": 3000\n },\n \"dimensions\": 2048,\n \"similarity\": \"dot_product\"\n },\n \"task_settings\": {\n \"input_type\": \"ingest\",\n \"truncate\": \"start\"\n },\n \"chunking_settings\": {\n \"strategy\": \"sentence\",\n \"max_chunk_size\": 250,\n \"sentence_overlap\": 1\n }\n}" PutNvidiaResponseExample3: summary: A completion task description: A successful response when creating an Nvidia `completion` inference endpoint. value: "{\n \"inference_id\": \"nvidia-completion\",\n \"task_type\": \"completion\",\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\",\n \"url\": \"nvidia-completion-url\",\n \"rate_limit\": {\n \"requests_per_minute\": 3000\n }\n }\n}" PutNvidiaResponseExample4: summary: A completion task without `url` parameter description: A successful response when creating an Nvidia `completion` inference endpoint without `url` parameter. value: "{\n \"inference_id\": \"nvidia-completion\",\n \"task_type\": \"completion\",\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\",\n \"rate_limit\": {\n \"requests_per_minute\": 3000\n }\n }\n}" PutNvidiaResponseExample5: summary: A chat completion task description: A successful response when creating an Nvidia `chat_completion` inference endpoint. value: "{\n \"inference_id\": \"nvidia-chat-completion\",\n \"task_type\": \"chat_completion\",\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\",\n \"url\": \"nvidia-chat-completion-url\",\n \"rate_limit\": {\n \"requests_per_minute\": 3000\n }\n }\n}" PutNvidiaResponseExample6: summary: A chat completion task without `url` parameter description: A successful response when creating an Nvidia `chat_completion` inference endpoint without `url` parameter. value: "{\n \"inference_id\": \"nvidia-chat-completion\",\n \"task_type\": \"chat_completion\",\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"model_id\": \"microsoft/phi-3-mini-128k-instruct\",\n \"rate_limit\": {\n \"requests_per_minute\": 3000\n }\n }\n}" PutNvidiaResponseExample7: summary: A rerank task description: A successful response when creating an Nvidia `rerank` inference endpoint. value: "{\n \"inference_id\": \"nvidia-rerank\",\n \"task_type\": \"rerank\",\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"model_id\": \"nv-rerank-qa-mistral-4b:1\",\n \"url\": \"nvidia-rerank-url\",\n \"rate_limit\": {\n \"requests_per_minute\": 3000\n }\n }\n}" PutNvidiaResponseExample8: summary: A rerank task without `url` parameter description: A successful response when creating an Nvidia `rerank` inference endpoint without `url` parameter. value: "{\n \"inference_id\": \"nvidia-rerank\",\n \"task_type\": \"rerank\",\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"model_id\": \"nv-rerank-qa-mistral-4b:1\",\n \"rate_limit\": {\n \"requests_per_minute\": 3000\n }\n }\n}" x-state: Generally available; Added in 9.3.0 x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/nvidia-text-embedding\n{\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"url\": \"nvidia-embeddings-url\",\n \"api_key\": \"nvidia-embeddings-token\",\n \"model_id\": \"nvidia/llama-3.2-nv-embedqa-1b-v2\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"nvidia-text-embedding\",\n inference_config={\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"url\": \"nvidia-embeddings-url\",\n \"api_key\": \"nvidia-embeddings-token\",\n \"model_id\": \"nvidia/llama-3.2-nv-embedqa-1b-v2\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"nvidia-text-embedding\",\n inference_config: {\n service: \"nvidia\",\n service_settings: {\n url: \"nvidia-embeddings-url\",\n api_key: \"nvidia-embeddings-token\",\n model_id: \"nvidia/llama-3.2-nv-embedqa-1b-v2\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"nvidia-text-embedding\",\n body: {\n \"service\": \"nvidia\",\n \"service_settings\": {\n \"url\": \"nvidia-embeddings-url\",\n \"api_key\": \"nvidia-embeddings-token\",\n \"model_id\": \"nvidia/llama-3.2-nv-embedqa-1b-v2\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"nvidia-text-embedding\",\n \"body\" => [\n \"service\" => \"nvidia\",\n \"service_settings\" => [\n \"url\" => \"nvidia-embeddings-url\",\n \"api_key\" => \"nvidia-embeddings-token\",\n \"model_id\" => \"nvidia/llama-3.2-nv-embedqa-1b-v2\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"nvidia","service_settings":{"url":"nvidia-embeddings-url","api_key":"nvidia-embeddings-token","model_id":"nvidia/llama-3.2-nv-embedqa-1b-v2"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/nvidia-text-embedding"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"nvidia-text-embedding\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"nvidia\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"url\": \"nvidia-embeddings-url\",\n \"api_key\": \"nvidia-embeddings-token\",\n \"model_id\": \"nvidia/llama-3.2-nv-embedqa-1b-v2\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"nvidia-text-embedding\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"nvidia\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"url\":\"nvidia-embeddings-url\",\"api_key\":\"nvidia-embeddings-token\",\"model_id\":\"nvidia/llama-3.2-nv-embedqa-1b-v2\"}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{openai_inference_id}': put: tags: - inference summary: Create an OpenAI inference endpoint description: "Create an inference endpoint to perform an inference task with the `openai` service or `openai` compatible APIs.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-openai parameters: - name: task_type in: path description: "The type of the inference task that the model will perform.\nNOTE: The `chat_completion` task type only supports streaming and only through the _stream API." required: true schema: $ref: '#/components/schemas/inference._types.OpenAITaskType' - name: openai_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: chunking_settings: allOf: - $ref: '#/components/schemas/inference._types.InferenceChunkingSettings' description: "The chunking configuration object.\nApplies only to the `text_embedding` task type.\nNot applicable to the `completion` or `chat_completion` task types." externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config service: allOf: - $ref: '#/components/schemas/inference._types.OpenAIServiceType' description: 'The type of service supported for the specified task type. In this case, `openai`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.OpenAIServiceSettings' description: Settings used to install the inference model. These settings are specific to the `openai` service. task_settings: allOf: - $ref: '#/components/schemas/inference._types.OpenAITaskSettings' description: "Settings to configure the inference task.\nThese settings are specific to the task type you specified." examples: PutOpenAiRequestExample1: summary: A text embedding task description: Run `PUT _inference/text_embedding/openai-embeddings` to create an inference endpoint that performs a `text_embedding` task. The embeddings created by requests to this endpoint will have 128 dimensions. value: "{\n \"service\": \"openai\",\n \"service_settings\": {\n \"api_key\": \"OpenAI-API-Key\",\n \"model_id\": \"text-embedding-3-small\",\n \"dimensions\": 128\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/openai-embeddings\n{\n \"service\": \"openai\",\n \"service_settings\": {\n \"api_key\": \"OpenAI-API-Key\",\n \"model_id\": \"text-embedding-3-small\",\n \"dimensions\": 128\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"openai-embeddings\",\n inference_config={\n \"service\": \"openai\",\n \"service_settings\": {\n \"api_key\": \"OpenAI-API-Key\",\n \"model_id\": \"text-embedding-3-small\",\n \"dimensions\": 128\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"openai-embeddings\",\n inference_config: {\n service: \"openai\",\n service_settings: {\n api_key: \"OpenAI-API-Key\",\n model_id: \"text-embedding-3-small\",\n dimensions: 128,\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"openai-embeddings\",\n body: {\n \"service\": \"openai\",\n \"service_settings\": {\n \"api_key\": \"OpenAI-API-Key\",\n \"model_id\": \"text-embedding-3-small\",\n \"dimensions\": 128\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"openai-embeddings\",\n \"body\" => [\n \"service\" => \"openai\",\n \"service_settings\" => [\n \"api_key\" => \"OpenAI-API-Key\",\n \"model_id\" => \"text-embedding-3-small\",\n \"dimensions\" => 128,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"openai","service_settings":{"api_key":"OpenAI-API-Key","model_id":"text-embedding-3-small","dimensions":128}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/openai-embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"openai-embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"openai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"OpenAI-API-Key\",\n \"model_id\": \"text-embedding-3-small\",\n \"dimensions\": 128\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"openai-embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"openai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"OpenAI-API-Key\",\"model_id\":\"text-embedding-3-small\",\"dimensions\":128}\n\"\"\"))\n )\n);\n" PutOpenAiRequestExample2: summary: A completion task description: Run `PUT _inference/completion/openai-completion` to create an inference endpoint to perform a `completion` task type. value: "{\n \"service\": \"openai\",\n \"service_settings\": {\n \"api_key\": \"OpenAI-API-Key\",\n \"model_id\": \"gpt-3.5-turbo\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/openai-completion\n{\n \"service\": \"openai\",\n \"service_settings\": {\n \"api_key\": \"OpenAI-API-Key\",\n \"model_id\": \"gpt-3.5-turbo\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"openai-completion\",\n inference_config={\n \"service\": \"openai\",\n \"service_settings\": {\n \"api_key\": \"OpenAI-API-Key\",\n \"model_id\": \"gpt-3.5-turbo\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"openai-completion\",\n inference_config: {\n service: \"openai\",\n service_settings: {\n api_key: \"OpenAI-API-Key\",\n model_id: \"gpt-3.5-turbo\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"openai-completion\",\n body: {\n \"service\": \"openai\",\n \"service_settings\": {\n \"api_key\": \"OpenAI-API-Key\",\n \"model_id\": \"gpt-3.5-turbo\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"openai-completion\",\n \"body\" => [\n \"service\" => \"openai\",\n \"service_settings\" => [\n \"api_key\" => \"OpenAI-API-Key\",\n \"model_id\" => \"gpt-3.5-turbo\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"openai","service_settings":{"api_key":"OpenAI-API-Key","model_id":"gpt-3.5-turbo"}}'' "$ELASTICSEARCH_URL/_inference/completion/openai-completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"openai-completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"openai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"OpenAI-API-Key\",\n \"model_id\": \"gpt-3.5-turbo\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"openai-completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"openai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"OpenAI-API-Key\",\"model_id\":\"gpt-3.5-turbo\"}\n\"\"\"))\n )\n);\n" PutOpenAiRequestExample3: summary: A text embedding task with OAuth 2.0 authorization description: Run `PUT _inference/text_embedding/openai-embeddings` to create an inference endpoint that performs a `text_embedding` task. The requests to this endpoint will use OAuth 2.0 authorization. value: "{\n \"service\": \"openai\",\n \"service_settings\": {\n \"model_id\": \"text-embedding-3-small\",\n \"client_id\": \"test_client_id\",\n \"scopes\": [\"scope1\", \"scope2\"],\n \"client_secret\": \"secret\",\n \"token_url\": \"http://localhost:8080/token\",\n \"url\": \"https://api.openai.com/v1/embeddings\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/openai-embeddings\n{\n \"service\": \"openai\",\n \"service_settings\": {\n \"model_id\": \"text-embedding-3-small\",\n \"client_id\": \"test_client_id\",\n \"scopes\": [\"scope1\", \"scope2\"],\n \"client_secret\": \"secret\",\n \"token_url\": \"http://localhost:8080/token\",\n \"url\": \"https://api.openai.com/v1/embeddings\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"openai-embeddings\",\n inference_config={\n \"service\": \"openai\",\n \"service_settings\": {\n \"model_id\": \"text-embedding-3-small\",\n \"client_id\": \"test_client_id\",\n \"scopes\": [\n \"scope1\",\n \"scope2\"\n ],\n \"client_secret\": \"secret\",\n \"token_url\": \"http://localhost:8080/token\",\n \"url\": \"https://api.openai.com/v1/embeddings\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"openai-embeddings\",\n inference_config: {\n service: \"openai\",\n service_settings: {\n model_id: \"text-embedding-3-small\",\n client_id: \"test_client_id\",\n scopes: [\"scope1\", \"scope2\"],\n client_secret: \"secret\",\n token_url: \"http://localhost:8080/token\",\n url: \"https://api.openai.com/v1/embeddings\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"openai-embeddings\",\n body: {\n \"service\": \"openai\",\n \"service_settings\": {\n \"model_id\": \"text-embedding-3-small\",\n \"client_id\": \"test_client_id\",\n \"scopes\": [\n \"scope1\",\n \"scope2\"\n ],\n \"client_secret\": \"secret\",\n \"token_url\": \"http://localhost:8080/token\",\n \"url\": \"https://api.openai.com/v1/embeddings\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"openai-embeddings\",\n \"body\" => [\n \"service\" => \"openai\",\n \"service_settings\" => [\n \"model_id\" => \"text-embedding-3-small\",\n \"client_id\" => \"test_client_id\",\n \"scopes\" => array(\n \"scope1\",\n \"scope2\",\n ),\n \"client_secret\" => \"secret\",\n \"token_url\" => \"http://localhost:8080/token\",\n \"url\" => \"https://api.openai.com/v1/embeddings\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"openai","service_settings":{"model_id":"text-embedding-3-small","client_id":"test_client_id","scopes":["scope1","scope2"],"client_secret":"secret","token_url":"http://localhost:8080/token","url":"https://api.openai.com/v1/embeddings"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/openai-embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"openai-embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"openai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"model_id\": \"text-embedding-3-small\",\n \"client_id\": \"test_client_id\",\n \"scopes\": [\n \"scope1\",\n \"scope2\"\n ],\n \"client_secret\": \"secret\",\n \"token_url\": \"http://localhost:8080/token\",\n \"url\": \"https://api.openai.com/v1/embeddings\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"openai-embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"openai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"model_id\":\"text-embedding-3-small\",\"client_id\":\"test_client_id\",\"scopes\":[\"scope1\",\"scope2\"],\"client_secret\":\"secret\",\"token_url\":\"http://localhost:8080/token\",\"url\":\"https://api.openai.com/v1/embeddings\"}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoOpenAI' x-state: Generally available; Added in 8.12.0 x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/openai-embeddings\n{\n \"service\": \"openai\",\n \"service_settings\": {\n \"api_key\": \"OpenAI-API-Key\",\n \"model_id\": \"text-embedding-3-small\",\n \"dimensions\": 128\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"openai-embeddings\",\n inference_config={\n \"service\": \"openai\",\n \"service_settings\": {\n \"api_key\": \"OpenAI-API-Key\",\n \"model_id\": \"text-embedding-3-small\",\n \"dimensions\": 128\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"openai-embeddings\",\n inference_config: {\n service: \"openai\",\n service_settings: {\n api_key: \"OpenAI-API-Key\",\n model_id: \"text-embedding-3-small\",\n dimensions: 128,\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"openai-embeddings\",\n body: {\n \"service\": \"openai\",\n \"service_settings\": {\n \"api_key\": \"OpenAI-API-Key\",\n \"model_id\": \"text-embedding-3-small\",\n \"dimensions\": 128\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"openai-embeddings\",\n \"body\" => [\n \"service\" => \"openai\",\n \"service_settings\" => [\n \"api_key\" => \"OpenAI-API-Key\",\n \"model_id\" => \"text-embedding-3-small\",\n \"dimensions\" => 128,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"openai","service_settings":{"api_key":"OpenAI-API-Key","model_id":"text-embedding-3-small","dimensions":128}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/openai-embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"openai-embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"openai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"OpenAI-API-Key\",\n \"model_id\": \"text-embedding-3-small\",\n \"dimensions\": 128\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"openai-embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"openai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"OpenAI-API-Key\",\"model_id\":\"text-embedding-3-small\",\"dimensions\":128}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{openshiftai_inference_id}': put: tags: - inference summary: Create an OpenShift AI inference endpoint description: "Create an inference endpoint to perform an inference task with the `openshift_ai` service.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-openshift-ai parameters: - name: task_type in: path description: "The type of the inference task that the model will perform.\nNOTE: The `chat_completion` task type only supports streaming and only through the _stream API." required: true schema: $ref: '#/components/schemas/inference._types.OpenShiftAiTaskType' - name: openshiftai_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: chunking_settings: allOf: - $ref: '#/components/schemas/inference._types.InferenceChunkingSettings' description: "The chunking configuration object.\nApplies only to the `text_embedding` task type.\nNot applicable to the `rerank`, `completion`, or `chat_completion` task types." externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config service: allOf: - $ref: '#/components/schemas/inference._types.OpenShiftAiServiceType' description: 'The type of service supported for the specified task type. In this case, `openshift_ai`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.OpenShiftAiServiceSettings' description: Settings used to install the inference model. These settings are specific to the `openshift_ai` service. task_settings: allOf: - $ref: '#/components/schemas/inference._types.OpenShiftAiTaskSettings' description: "Settings to configure the inference task.\nApplies only to the `rerank` task type.\nNot applicable to the `text_embedding`, `completion`, or `chat_completion` task types.\nThese settings are specific to the task type you specified." examples: PutOpenShiftAiRequestExample1: summary: A text embedding task description: Run `PUT _inference/text_embedding/openshift-ai-text-embedding` to create an inference endpoint that performs a `text_embedding` task. value: "{\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-embeddings-url\",\n \"api_key\": \"openshift-ai-embeddings-token\",\n \"model_id\": \"gritlm-7b\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/openshift-ai-text-embedding\n{\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-embeddings-url\",\n \"api_key\": \"openshift-ai-embeddings-token\",\n \"model_id\": \"gritlm-7b\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"openshift-ai-text-embedding\",\n inference_config={\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-embeddings-url\",\n \"api_key\": \"openshift-ai-embeddings-token\",\n \"model_id\": \"gritlm-7b\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"openshift-ai-text-embedding\",\n inference_config: {\n service: \"openshift_ai\",\n service_settings: {\n url: \"openshift-ai-embeddings-url\",\n api_key: \"openshift-ai-embeddings-token\",\n model_id: \"gritlm-7b\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"openshift-ai-text-embedding\",\n body: {\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-embeddings-url\",\n \"api_key\": \"openshift-ai-embeddings-token\",\n \"model_id\": \"gritlm-7b\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"openshift-ai-text-embedding\",\n \"body\" => [\n \"service\" => \"openshift_ai\",\n \"service_settings\" => [\n \"url\" => \"openshift-ai-embeddings-url\",\n \"api_key\" => \"openshift-ai-embeddings-token\",\n \"model_id\" => \"gritlm-7b\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"openshift_ai","service_settings":{"url":"openshift-ai-embeddings-url","api_key":"openshift-ai-embeddings-token","model_id":"gritlm-7b"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/openshift-ai-text-embedding"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"openshift-ai-text-embedding\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"openshift_ai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"url\": \"openshift-ai-embeddings-url\",\n \"api_key\": \"openshift-ai-embeddings-token\",\n \"model_id\": \"gritlm-7b\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"openshift-ai-text-embedding\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"openshift_ai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"url\":\"openshift-ai-embeddings-url\",\"api_key\":\"openshift-ai-embeddings-token\",\"model_id\":\"gritlm-7b\"}\n\"\"\"))\n )\n);\n" PutOpenShiftAiRequestExample2: summary: A completion task description: Run `PUT _inference/completion/openshift-ai-completion` to create an inference endpoint that performs a `completion` task. value: "{\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-completion-url\",\n \"api_key\": \"openshift-ai-completion-token\",\n \"model_id\": \"llama-31-8b-instruct\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/completion/openshift-ai-completion\n{\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-completion-url\",\n \"api_key\": \"openshift-ai-completion-token\",\n \"model_id\": \"llama-31-8b-instruct\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"openshift-ai-completion\",\n inference_config={\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-completion-url\",\n \"api_key\": \"openshift-ai-completion-token\",\n \"model_id\": \"llama-31-8b-instruct\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"openshift-ai-completion\",\n inference_config: {\n service: \"openshift_ai\",\n service_settings: {\n url: \"openshift-ai-completion-url\",\n api_key: \"openshift-ai-completion-token\",\n model_id: \"llama-31-8b-instruct\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"openshift-ai-completion\",\n body: {\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-completion-url\",\n \"api_key\": \"openshift-ai-completion-token\",\n \"model_id\": \"llama-31-8b-instruct\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"openshift-ai-completion\",\n \"body\" => [\n \"service\" => \"openshift_ai\",\n \"service_settings\" => [\n \"url\" => \"openshift-ai-completion-url\",\n \"api_key\" => \"openshift-ai-completion-token\",\n \"model_id\" => \"llama-31-8b-instruct\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"openshift_ai","service_settings":{"url":"openshift-ai-completion-url","api_key":"openshift-ai-completion-token","model_id":"llama-31-8b-instruct"}}'' "$ELASTICSEARCH_URL/_inference/completion/openshift-ai-completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"openshift-ai-completion\",\n TaskType = TaskType.Completion,\n InferenceConfig = new()\n {\n Service = \"openshift_ai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"url\": \"openshift-ai-completion-url\",\n \"api_key\": \"openshift-ai-completion-token\",\n \"model_id\": \"llama-31-8b-instruct\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"openshift-ai-completion\")\n .taskType(TaskType.Completion)\n .inferenceConfig(i -> i\n .service(\"openshift_ai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"url\":\"openshift-ai-completion-url\",\"api_key\":\"openshift-ai-completion-token\",\"model_id\":\"llama-31-8b-instruct\"}\n\"\"\"))\n )\n);\n" PutOpenShiftAiRequestExample3: summary: A chat completion task description: Run `PUT _inference/chat_completion/openshift-ai-chat-completion` to create an inference endpoint that performs a `chat_completion` task. value: "{\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-chat-completion-url\",\n \"api_key\": \"openshift-ai-chat-completion-token\",\n \"model_id\": \"llama-31-8b-instruct\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/chat_completion/openshift-ai-chat-completion\n{\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-chat-completion-url\",\n \"api_key\": \"openshift-ai-chat-completion-token\",\n \"model_id\": \"llama-31-8b-instruct\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"chat_completion\",\n inference_id=\"openshift-ai-chat-completion\",\n inference_config={\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-chat-completion-url\",\n \"api_key\": \"openshift-ai-chat-completion-token\",\n \"model_id\": \"llama-31-8b-instruct\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"chat_completion\",\n inference_id: \"openshift-ai-chat-completion\",\n inference_config: {\n service: \"openshift_ai\",\n service_settings: {\n url: \"openshift-ai-chat-completion-url\",\n api_key: \"openshift-ai-chat-completion-token\",\n model_id: \"llama-31-8b-instruct\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"chat_completion\",\n inference_id: \"openshift-ai-chat-completion\",\n body: {\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-chat-completion-url\",\n \"api_key\": \"openshift-ai-chat-completion-token\",\n \"model_id\": \"llama-31-8b-instruct\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"chat_completion\",\n \"inference_id\" => \"openshift-ai-chat-completion\",\n \"body\" => [\n \"service\" => \"openshift_ai\",\n \"service_settings\" => [\n \"url\" => \"openshift-ai-chat-completion-url\",\n \"api_key\" => \"openshift-ai-chat-completion-token\",\n \"model_id\" => \"llama-31-8b-instruct\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"openshift_ai","service_settings":{"url":"openshift-ai-chat-completion-url","api_key":"openshift-ai-chat-completion-token","model_id":"llama-31-8b-instruct"}}'' "$ELASTICSEARCH_URL/_inference/chat_completion/openshift-ai-chat-completion"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"openshift-ai-chat-completion\",\n TaskType = TaskType.ChatCompletion,\n InferenceConfig = new()\n {\n Service = \"openshift_ai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"url\": \"openshift-ai-chat-completion-url\",\n \"api_key\": \"openshift-ai-chat-completion-token\",\n \"model_id\": \"llama-31-8b-instruct\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"openshift-ai-chat-completion\")\n .taskType(TaskType.ChatCompletion)\n .inferenceConfig(i -> i\n .service(\"openshift_ai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"url\":\"openshift-ai-chat-completion-url\",\"api_key\":\"openshift-ai-chat-completion-token\",\"model_id\":\"llama-31-8b-instruct\"}\n\"\"\"))\n )\n);\n" PutOpenShiftAiRequestExample4: summary: A rerank task description: Run `PUT _inference/rerank/openshift-ai-rerank` to create an inference endpoint that performs a `rerank` task. value: "{\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-rerank-url\",\n \"api_key\": \"openshift-ai-rerank-token\",\n \"model_id\": \"bge-reranker-v2-m3\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/rerank/openshift-ai-rerank\n{\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-rerank-url\",\n \"api_key\": \"openshift-ai-rerank-token\",\n \"model_id\": \"bge-reranker-v2-m3\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"openshift-ai-rerank\",\n inference_config={\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-rerank-url\",\n \"api_key\": \"openshift-ai-rerank-token\",\n \"model_id\": \"bge-reranker-v2-m3\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"openshift-ai-rerank\",\n inference_config: {\n service: \"openshift_ai\",\n service_settings: {\n url: \"openshift-ai-rerank-url\",\n api_key: \"openshift-ai-rerank-token\",\n model_id: \"bge-reranker-v2-m3\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"openshift-ai-rerank\",\n body: {\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-rerank-url\",\n \"api_key\": \"openshift-ai-rerank-token\",\n \"model_id\": \"bge-reranker-v2-m3\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"openshift-ai-rerank\",\n \"body\" => [\n \"service\" => \"openshift_ai\",\n \"service_settings\" => [\n \"url\" => \"openshift-ai-rerank-url\",\n \"api_key\" => \"openshift-ai-rerank-token\",\n \"model_id\" => \"bge-reranker-v2-m3\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"openshift_ai","service_settings":{"url":"openshift-ai-rerank-url","api_key":"openshift-ai-rerank-token","model_id":"bge-reranker-v2-m3"}}'' "$ELASTICSEARCH_URL/_inference/rerank/openshift-ai-rerank"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"openshift-ai-rerank\",\n TaskType = TaskType.Rerank,\n InferenceConfig = new()\n {\n Service = \"openshift_ai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"url\": \"openshift-ai-rerank-url\",\n \"api_key\": \"openshift-ai-rerank-token\",\n \"model_id\": \"bge-reranker-v2-m3\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"openshift-ai-rerank\")\n .taskType(TaskType.Rerank)\n .inferenceConfig(i -> i\n .service(\"openshift_ai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"url\":\"openshift-ai-rerank-url\",\"api_key\":\"openshift-ai-rerank-token\",\"model_id\":\"bge-reranker-v2-m3\"}\n\"\"\"))\n )\n);\n" PutOpenShiftAiRequestExample5: summary: A rerank task with custom `task_settings` and omitted `model_id` description: 'Run `PUT _inference/rerank/openshift-ai-rerank` to create an inference endpoint that performs a `rerank` task, specifying custom `task_settings` and omitting the `model_id` if deployed model doesn''t require it.' value: "{\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-rerank-url\",\n \"api_key\": \"openshift-ai-rerank-token\"\n },\n \"task_settings\": {\n \"return_documents\": true,\n \"top_n\": 2\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/rerank/openshift-ai-rerank\n{\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-rerank-url\",\n \"api_key\": \"openshift-ai-rerank-token\"\n },\n \"task_settings\": {\n \"return_documents\": true,\n \"top_n\": 2\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"openshift-ai-rerank\",\n inference_config={\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-rerank-url\",\n \"api_key\": \"openshift-ai-rerank-token\"\n },\n \"task_settings\": {\n \"return_documents\": True,\n \"top_n\": 2\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"openshift-ai-rerank\",\n inference_config: {\n service: \"openshift_ai\",\n service_settings: {\n url: \"openshift-ai-rerank-url\",\n api_key: \"openshift-ai-rerank-token\",\n },\n task_settings: {\n return_documents: true,\n top_n: 2,\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"openshift-ai-rerank\",\n body: {\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-rerank-url\",\n \"api_key\": \"openshift-ai-rerank-token\"\n },\n \"task_settings\": {\n \"return_documents\": true,\n \"top_n\": 2\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"openshift-ai-rerank\",\n \"body\" => [\n \"service\" => \"openshift_ai\",\n \"service_settings\" => [\n \"url\" => \"openshift-ai-rerank-url\",\n \"api_key\" => \"openshift-ai-rerank-token\",\n ],\n \"task_settings\" => [\n \"return_documents\" => true,\n \"top_n\" => 2,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"openshift_ai","service_settings":{"url":"openshift-ai-rerank-url","api_key":"openshift-ai-rerank-token"},"task_settings":{"return_documents":true,"top_n":2}}'' "$ELASTICSEARCH_URL/_inference/rerank/openshift-ai-rerank"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"openshift-ai-rerank\",\n TaskType = TaskType.Rerank,\n InferenceConfig = new()\n {\n Service = \"openshift_ai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"url\": \"openshift-ai-rerank-url\",\n \"api_key\": \"openshift-ai-rerank-token\"\n }\n \"\"\"),\n TaskSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"return_documents\": true,\n \"top_n\": 2\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"openshift-ai-rerank\")\n .taskType(TaskType.Rerank)\n .inferenceConfig(i -> i\n .service(\"openshift_ai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"url\":\"openshift-ai-rerank-url\",\"api_key\":\"openshift-ai-rerank-token\"}\n\"\"\"))\n .taskSettings(JsonData.fromJson(\"\"\"\n{\"return_documents\":true,\"top_n\":2}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoOpenShiftAi' examples: PutOpenShiftAiResponseExample1: summary: A text embedding task description: A successful response when creating an OpenShift AI `text_embedding` inference endpoint. value: "{\n \"inference_id\": \"openshift-ai-text-embedding\",\n \"task_type\": \"text_embedding\",\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"model_id\": \"gritlm-7b\",\n \"url\": \"openshift-ai-embeddings-url\",\n \"rate_limit\": {\n \"requests_per_minute\": 3000\n },\n \"dimensions\": 4096,\n \"similarity\": \"dot_product\",\n \"dimensions_set_by_user\": false\n },\n \"chunking_settings\": {\n \"strategy\": \"sentence\",\n \"max_chunk_size\": 250,\n \"sentence_overlap\": 1\n }\n}" PutOpenShiftAiResponseExample2: summary: A completion task description: A successful response when creating an OpenShift AI `completion` inference endpoint. value: "{\n \"inference_id\": \"openshift-ai-completion\",\n \"task_type\": \"completion\",\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"model_id\": \"llama-31-8b-instruct\",\n \"url\": \"openshift-ai-completion-url\",\n \"rate_limit\": {\n \"requests_per_minute\": 3000\n }\n }\n}" PutOpenShiftAiResponseExample3: summary: A chat completion task description: A successful response when creating an OpenShift AI `chat_completion` inference endpoint. value: "{\n \"inference_id\": \"openshift-ai-chat-completion\",\n \"task_type\": \"chat_completion\",\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"model_id\": \"llama-31-8b-instruct\",\n \"url\": \"openshift-ai-chat-completion-url\",\n \"rate_limit\": {\n \"requests_per_minute\": 3000\n }\n }\n}" PutOpenShiftAiResponseExample4: summary: A rerank task description: A successful response when creating an OpenShift AI `rerank` inference endpoint. value: "{\n \"inference_id\": \"openshift-ai-rerank\",\n \"task_type\": \"rerank\",\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"model_id\": \"bge-reranker-v2-m3\",\n \"url\": \"openshift-ai-rerank-url\",\n \"rate_limit\": {\n \"requests_per_minute\": 3000\n }\n }\n}" PutOpenShiftAiResponseExample5: summary: A rerank task with custom `task_settings` and omitted `model_id` description: A successful response when creating an OpenShift AI `rerank` inference endpoint with custom `task_settings` and omitted `model_id` value: "{\n \"inference_id\": \"openshift-ai-rerank\",\n \"task_type\": \"rerank\",\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-rerank-url\",\n \"rate_limit\": {\n \"requests_per_minute\": 3000\n }\n },\n \"task_settings\": {\n \"return_documents\": true,\n \"top_n\": 2\n }\n}" x-state: Generally available; Added in 9.3.0 x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/openshift-ai-text-embedding\n{\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-embeddings-url\",\n \"api_key\": \"openshift-ai-embeddings-token\",\n \"model_id\": \"gritlm-7b\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"openshift-ai-text-embedding\",\n inference_config={\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-embeddings-url\",\n \"api_key\": \"openshift-ai-embeddings-token\",\n \"model_id\": \"gritlm-7b\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"openshift-ai-text-embedding\",\n inference_config: {\n service: \"openshift_ai\",\n service_settings: {\n url: \"openshift-ai-embeddings-url\",\n api_key: \"openshift-ai-embeddings-token\",\n model_id: \"gritlm-7b\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"openshift-ai-text-embedding\",\n body: {\n \"service\": \"openshift_ai\",\n \"service_settings\": {\n \"url\": \"openshift-ai-embeddings-url\",\n \"api_key\": \"openshift-ai-embeddings-token\",\n \"model_id\": \"gritlm-7b\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"openshift-ai-text-embedding\",\n \"body\" => [\n \"service\" => \"openshift_ai\",\n \"service_settings\" => [\n \"url\" => \"openshift-ai-embeddings-url\",\n \"api_key\" => \"openshift-ai-embeddings-token\",\n \"model_id\" => \"gritlm-7b\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"openshift_ai","service_settings":{"url":"openshift-ai-embeddings-url","api_key":"openshift-ai-embeddings-token","model_id":"gritlm-7b"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/openshift-ai-text-embedding"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"openshift-ai-text-embedding\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"openshift_ai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"url\": \"openshift-ai-embeddings-url\",\n \"api_key\": \"openshift-ai-embeddings-token\",\n \"model_id\": \"gritlm-7b\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"openshift-ai-text-embedding\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"openshift_ai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"url\":\"openshift-ai-embeddings-url\",\"api_key\":\"openshift-ai-embeddings-token\",\"model_id\":\"gritlm-7b\"}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{voyageai_inference_id}': put: tags: - inference summary: Create a VoyageAI inference endpoint description: "Create an inference endpoint to perform an inference task with the `voyageai` service.\n\nAvoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-voyageai parameters: - name: task_type in: path description: The type of the inference task that the model will perform. required: true schema: $ref: '#/components/schemas/inference._types.VoyageAITaskType' - name: voyageai_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: chunking_settings: allOf: - $ref: '#/components/schemas/inference._types.InferenceChunkingSettings' description: "The chunking configuration object.\nApplies only to the `text_embedding` task type.\nNot applicable to the `rerank` task type." externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config service: allOf: - $ref: '#/components/schemas/inference._types.VoyageAIServiceType' description: 'The type of service supported for the specified task type. In this case, `voyageai`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.VoyageAIServiceSettings' description: Settings used to install the inference model. These settings are specific to the `voyageai` service. task_settings: allOf: - $ref: '#/components/schemas/inference._types.VoyageAITaskSettings' description: "Settings to configure the inference task.\nThese settings are specific to the task type you specified." examples: PutVoyageAIRequestExample1: summary: A text embedding task description: Run `PUT _inference/text_embedding/voyageai-embeddings` to create an inference endpoint that performs a `text_embedding` task. The embeddings created by requests to this endpoint will have 512 dimensions. value: "{\n \"service\": \"voyageai\",\n \"service_settings\": {\n \"model_id\": \"voyage-3-large\",\n \"dimensions\": 512\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/openai-embeddings\n{\n \"service\": \"voyageai\",\n \"service_settings\": {\n \"model_id\": \"voyage-3-large\",\n \"dimensions\": 512\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"openai-embeddings\",\n inference_config={\n \"service\": \"voyageai\",\n \"service_settings\": {\n \"model_id\": \"voyage-3-large\",\n \"dimensions\": 512\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"openai-embeddings\",\n inference_config: {\n service: \"voyageai\",\n service_settings: {\n model_id: \"voyage-3-large\",\n dimensions: 512,\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"openai-embeddings\",\n body: {\n \"service\": \"voyageai\",\n \"service_settings\": {\n \"model_id\": \"voyage-3-large\",\n \"dimensions\": 512\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"openai-embeddings\",\n \"body\" => [\n \"service\" => \"voyageai\",\n \"service_settings\" => [\n \"model_id\" => \"voyage-3-large\",\n \"dimensions\" => 512,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"voyageai","service_settings":{"model_id":"voyage-3-large","dimensions":512}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/openai-embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"openai-embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"voyageai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"model_id\": \"voyage-3-large\",\n \"dimensions\": 512\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"openai-embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"voyageai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"model_id\":\"voyage-3-large\",\"dimensions\":512}\n\"\"\"))\n )\n);\n" PutVoyageAIRequestExample2: summary: A rerank task description: Run `PUT _inference/rerank/voyageai-rerank` to create an inference endpoint that performs a `rerank` task. value: "{\n \"service\": \"voyageai\",\n \"service_settings\": {\n \"model_id\": \"rerank-2\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/rerank/voyageai-rerank\n{\n \"service\": \"voyageai\",\n \"service_settings\": {\n \"model_id\": \"rerank-2\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"voyageai-rerank\",\n inference_config={\n \"service\": \"voyageai\",\n \"service_settings\": {\n \"model_id\": \"rerank-2\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"voyageai-rerank\",\n inference_config: {\n service: \"voyageai\",\n service_settings: {\n model_id: \"rerank-2\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"voyageai-rerank\",\n body: {\n \"service\": \"voyageai\",\n \"service_settings\": {\n \"model_id\": \"rerank-2\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"voyageai-rerank\",\n \"body\" => [\n \"service\" => \"voyageai\",\n \"service_settings\" => [\n \"model_id\" => \"rerank-2\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"voyageai","service_settings":{"model_id":"rerank-2"}}'' "$ELASTICSEARCH_URL/_inference/rerank/voyageai-rerank"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"voyageai-rerank\",\n TaskType = TaskType.Rerank,\n InferenceConfig = new()\n {\n Service = \"voyageai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"model_id\": \"rerank-2\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"voyageai-rerank\")\n .taskType(TaskType.Rerank)\n .inferenceConfig(i -> i\n .service(\"voyageai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"model_id\":\"rerank-2\"}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoVoyageAI' x-state: Generally available; Added in 8.19.0 x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/openai-embeddings\n{\n \"service\": \"voyageai\",\n \"service_settings\": {\n \"model_id\": \"voyage-3-large\",\n \"dimensions\": 512\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"openai-embeddings\",\n inference_config={\n \"service\": \"voyageai\",\n \"service_settings\": {\n \"model_id\": \"voyage-3-large\",\n \"dimensions\": 512\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"openai-embeddings\",\n inference_config: {\n service: \"voyageai\",\n service_settings: {\n model_id: \"voyage-3-large\",\n dimensions: 512,\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"openai-embeddings\",\n body: {\n \"service\": \"voyageai\",\n \"service_settings\": {\n \"model_id\": \"voyage-3-large\",\n \"dimensions\": 512\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"openai-embeddings\",\n \"body\" => [\n \"service\" => \"voyageai\",\n \"service_settings\" => [\n \"model_id\" => \"voyage-3-large\",\n \"dimensions\" => 512,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"voyageai","service_settings":{"model_id":"voyage-3-large","dimensions":512}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/openai-embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"openai-embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"voyageai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"model_id\": \"voyage-3-large\",\n \"dimensions\": 512\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"openai-embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"voyageai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"model_id\":\"voyage-3-large\",\"dimensions\":512}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{watsonx_inference_id}': put: tags: - inference summary: Create a Watsonx inference endpoint description: "Create an inference endpoint to perform an inference task with the `watsonxai` service.\nYou need an IBM Cloud Databases for Elasticsearch deployment to use the `watsonxai` inference service.\nYou can provision one through the IBM catalog, the Cloud Databases CLI plug-in, the Cloud Databases API, or Terraform.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-put-watsonx parameters: - name: task_type in: path description: The type of the inference task that the model will perform. required: true schema: $ref: '#/components/schemas/inference._types.WatsonxTaskType' - name: watsonx_inference_id in: path description: The unique identifier of the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference endpoint to be created. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - service - service_settings type: object properties: chunking_settings: allOf: - $ref: '#/components/schemas/inference._types.InferenceChunkingSettings' description: "The chunking configuration object.\nApplies only to the `text_embedding` task type.\nNot applicable to the `rerank`, `completion` or `chat_completion` task types." externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config service: allOf: - $ref: '#/components/schemas/inference._types.WatsonxServiceType' description: 'The type of service supported for the specified task type. In this case, `watsonxai`.' service_settings: allOf: - $ref: '#/components/schemas/inference._types.WatsonxServiceSettings' description: Settings used to install the inference model. These settings are specific to the `watsonxai` service. examples: PutWatsonxRequestExample1: description: Run `PUT _inference/text_embedding/watsonx-embeddings` to create an Watonsx inference endpoint that performs a text embedding task. value: "{\n \"service\": \"watsonxai\",\n \"service_settings\": {\n \"api_key\": \"Watsonx-API-Key\", \n \"url\": \"Wastonx-URL\", \n \"model_id\": \"ibm/slate-30m-english-rtrvr\",\n \"project_id\": \"IBM-Cloud-ID\", \n \"api_version\": \"2024-03-14\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/watsonx-embeddings\n{\n \"service\": \"watsonxai\",\n \"service_settings\": {\n \"api_key\": \"Watsonx-API-Key\", \n \"url\": \"Wastonx-URL\", \n \"model_id\": \"ibm/slate-30m-english-rtrvr\",\n \"project_id\": \"IBM-Cloud-ID\", \n \"api_version\": \"2024-03-14\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"watsonx-embeddings\",\n inference_config={\n \"service\": \"watsonxai\",\n \"service_settings\": {\n \"api_key\": \"Watsonx-API-Key\",\n \"url\": \"Wastonx-URL\",\n \"model_id\": \"ibm/slate-30m-english-rtrvr\",\n \"project_id\": \"IBM-Cloud-ID\",\n \"api_version\": \"2024-03-14\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"watsonx-embeddings\",\n inference_config: {\n service: \"watsonxai\",\n service_settings: {\n api_key: \"Watsonx-API-Key\",\n url: \"Wastonx-URL\",\n model_id: \"ibm/slate-30m-english-rtrvr\",\n project_id: \"IBM-Cloud-ID\",\n api_version: \"2024-03-14\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"watsonx-embeddings\",\n body: {\n \"service\": \"watsonxai\",\n \"service_settings\": {\n \"api_key\": \"Watsonx-API-Key\",\n \"url\": \"Wastonx-URL\",\n \"model_id\": \"ibm/slate-30m-english-rtrvr\",\n \"project_id\": \"IBM-Cloud-ID\",\n \"api_version\": \"2024-03-14\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"watsonx-embeddings\",\n \"body\" => [\n \"service\" => \"watsonxai\",\n \"service_settings\" => [\n \"api_key\" => \"Watsonx-API-Key\",\n \"url\" => \"Wastonx-URL\",\n \"model_id\" => \"ibm/slate-30m-english-rtrvr\",\n \"project_id\" => \"IBM-Cloud-ID\",\n \"api_version\" => \"2024-03-14\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"watsonxai","service_settings":{"api_key":"Watsonx-API-Key","url":"Wastonx-URL","model_id":"ibm/slate-30m-english-rtrvr","project_id":"IBM-Cloud-ID","api_version":"2024-03-14"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/watsonx-embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"watsonx-embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"watsonxai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"Watsonx-API-Key\",\n \"url\": \"Wastonx-URL\",\n \"model_id\": \"ibm/slate-30m-english-rtrvr\",\n \"project_id\": \"IBM-Cloud-ID\",\n \"api_version\": \"2024-03-14\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"watsonx-embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"watsonxai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"Watsonx-API-Key\",\"url\":\"Wastonx-URL\",\"model_id\":\"ibm/slate-30m-english-rtrvr\",\"project_id\":\"IBM-Cloud-ID\",\"api_version\":\"2024-03-14\"}\n\"\"\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfoWatsonx' x-state: Generally available; Added in 8.16.0 x-codeSamples: - lang: Console source: "PUT _inference/text_embedding/watsonx-embeddings\n{\n \"service\": \"watsonxai\",\n \"service_settings\": {\n \"api_key\": \"Watsonx-API-Key\", \n \"url\": \"Wastonx-URL\", \n \"model_id\": \"ibm/slate-30m-english-rtrvr\",\n \"project_id\": \"IBM-Cloud-ID\", \n \"api_version\": \"2024-03-14\"\n }\n}" - lang: Python source: "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"watsonx-embeddings\",\n inference_config={\n \"service\": \"watsonxai\",\n \"service_settings\": {\n \"api_key\": \"Watsonx-API-Key\",\n \"url\": \"Wastonx-URL\",\n \"model_id\": \"ibm/slate-30m-english-rtrvr\",\n \"project_id\": \"IBM-Cloud-ID\",\n \"api_version\": \"2024-03-14\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"watsonx-embeddings\",\n inference_config: {\n service: \"watsonxai\",\n service_settings: {\n api_key: \"Watsonx-API-Key\",\n url: \"Wastonx-URL\",\n model_id: \"ibm/slate-30m-english-rtrvr\",\n project_id: \"IBM-Cloud-ID\",\n api_version: \"2024-03-14\",\n },\n },\n});" - lang: Ruby source: "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"watsonx-embeddings\",\n body: {\n \"service\": \"watsonxai\",\n \"service_settings\": {\n \"api_key\": \"Watsonx-API-Key\",\n \"url\": \"Wastonx-URL\",\n \"model_id\": \"ibm/slate-30m-english-rtrvr\",\n \"project_id\": \"IBM-Cloud-ID\",\n \"api_version\": \"2024-03-14\"\n }\n }\n)" - lang: PHP source: "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"watsonx-embeddings\",\n \"body\" => [\n \"service\" => \"watsonxai\",\n \"service_settings\" => [\n \"api_key\" => \"Watsonx-API-Key\",\n \"url\" => \"Wastonx-URL\",\n \"model_id\" => \"ibm/slate-30m-english-rtrvr\",\n \"project_id\" => \"IBM-Cloud-ID\",\n \"api_version\" => \"2024-03-14\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service":"watsonxai","service_settings":{"api_key":"Watsonx-API-Key","url":"Wastonx-URL","model_id":"ibm/slate-30m-english-rtrvr","project_id":"IBM-Cloud-ID","api_version":"2024-03-14"}}'' "$ELASTICSEARCH_URL/_inference/text_embedding/watsonx-embeddings"' - lang: C# source: "var response = await client.Inference\n .PutAsync(new PutInferenceRequest()\n {\n InferenceId = \"watsonx-embeddings\",\n TaskType = TaskType.TextEmbedding,\n InferenceConfig = new()\n {\n Service = \"watsonxai\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"Watsonx-API-Key\",\n \"url\": \"Wastonx-URL\",\n \"model_id\": \"ibm/slate-30m-english-rtrvr\",\n \"project_id\": \"IBM-Cloud-ID\",\n \"api_version\": \"2024-03-14\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().put(p -> p\n .inferenceId(\"watsonx-embeddings\")\n .taskType(TaskType.TextEmbedding)\n .inferenceConfig(i -> i\n .service(\"watsonxai\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"Watsonx-API-Key\",\"url\":\"Wastonx-URL\",\"model_id\":\"ibm/slate-30m-english-rtrvr\",\"project_id\":\"IBM-Cloud-ID\",\"api_version\":\"2024-03-14\"}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/rerank/{inference_id}': post: tags: - inference summary: Perform reranking inference on the service description: "\n\n## Required authorization\n\n* Cluster privileges: `monitor_inference`\n" operationId: inference-rerank parameters: - name: inference_id in: path description: The unique identifier for the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: The amount of time to wait for the inference request to complete. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - query - input type: object properties: query: allOf: - $ref: '#/components/schemas/inference.rerank.RerankQuery' description: "Query input.\nThe query can be specified as a single string, or as an object.\nThe object form additionally allows specifying non-text inputs, such as images.\n\n> info\n> Only the `elastic` service currently supports non-text queries for the `rerank` task. For all other services, the query must be a string.\n\nstring example:\n```\n\"query\": \"some query text\"\n```\nobject example:\n```\n\"query\": {\n \"type\": \"image\",\n \"format\": \"base64\",\n \"value\": \"data:image/jpeg;base64,...\"\n}\n```\nobject example using the `url` format (available in Elasticsearch 9.6.0 and later):\n```\n\"query\": {\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/image.jpg\"\n}\n```" input: allOf: - $ref: '#/components/schemas/inference.rerank.RerankInput' description: "The documents to rank.\nThe input can be specified as a single string or an array of strings, or as an object or an array of objects.\nThe object form additionally allows specifying non-text inputs, such as images.\n\n> info\n> Only the `elastic` service currently supports non-text inputs for the `rerank` task. For all other services, the input must be a string or an array of strings.\n\nstring example:\n```\n\"input\": \"some document text\"\n```\nstring array example:\n```\n\"input\": [\"some document text\", \"some more document text\"]\n```\nobject example:\n```\n\"input\": {\n \"type\": \"image\",\n \"format\": \"base64\",\n \"value\": \"data:image/jpeg;base64,...\"\n}\n```\nobject array example:\n```\n\"input\": [\n {\n \"type\": \"text\",\n \"format\": \"text\",\n \"value\": \"some document text\"\n },\n {\n \"type\": \"image\",\n \"format\": \"base64\",\n \"value\": \"data:image/jpeg;base64,...\"\n }\n]\n```\nobject array example using the `url` format (available in Elasticsearch 9.6.0 and later):\n```\n\"input\": [\n {\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/image.jpg\"\n }\n]\n```" return_documents: type: boolean description: Include the document text in the response. top_n: type: number description: Limit the response to the top N documents. task_settings: allOf: - $ref: '#/components/schemas/inference._types.TaskSettings' description: "Task settings for the individual inference request.\nThese settings are specific to the task type you specified and override the task settings specified when initializing the service." examples: RerankRequestExample1: summary: Rerank task description: Run `POST _inference/rerank/cohere_rerank` to perform reranking on the example input. value: "{\n \"input\": [\"luke\", \"like\", \"leia\", \"chewy\",\"r2d2\", \"star\", \"wars\"],\n \"query\": \"star wars main character\"\n}" x-codeSamples: - lang: Console source: "POST _inference/rerank/cohere_rerank\n{\n \"input\": [\"luke\", \"like\", \"leia\", \"chewy\",\"r2d2\", \"star\", \"wars\"],\n \"query\": \"star wars main character\"\n}" - lang: Python source: "resp = client.inference.rerank(\n inference_id=\"cohere_rerank\",\n input=[\n \"luke\",\n \"like\",\n \"leia\",\n \"chewy\",\n \"r2d2\",\n \"star\",\n \"wars\"\n ],\n query=\"star wars main character\",\n)" - lang: JavaScript source: "const response = await client.inference.rerank({\n inference_id: \"cohere_rerank\",\n input: [\"luke\", \"like\", \"leia\", \"chewy\", \"r2d2\", \"star\", \"wars\"],\n query: \"star wars main character\",\n});" - lang: Ruby source: "response = client.inference.rerank(\n inference_id: \"cohere_rerank\",\n body: {\n \"input\": [\n \"luke\",\n \"like\",\n \"leia\",\n \"chewy\",\n \"r2d2\",\n \"star\",\n \"wars\"\n ],\n \"query\": \"star wars main character\"\n }\n)" - lang: PHP source: "$resp = $client->inference()->rerank([\n \"inference_id\" => \"cohere_rerank\",\n \"body\" => [\n \"input\" => array(\n \"luke\",\n \"like\",\n \"leia\",\n \"chewy\",\n \"r2d2\",\n \"star\",\n \"wars\",\n ),\n \"query\" => \"star wars main character\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"input":["luke","like","leia","chewy","r2d2","star","wars"],"query":"star wars main character"}'' "$ELASTICSEARCH_URL/_inference/rerank/cohere_rerank"' - lang: C# source: "var response = await client.Inference\n .RerankAsync(inferenceId: \"cohere_rerank\", d1 => d1\n .Input(new string[] { \"luke\", \"like\", \"leia\", \"chewy\", \"r2d2\", \"star\", \"wars\" })\n .Query(\"star wars main character\")\n );" - lang: Java source: "client.inference().rerank(r -> r\n .inferenceId(\"cohere_rerank\")\n .input(i -> i\n .string(List.of(\"luke\",\"like\",\"leia\",\"chewy\",\"r2d2\",\"star\",\"wars\"))\n )\n .query(q -> q\n .string(\"star wars main character\")\n )\n);\n" RerankRequestExample2: summary: Rerank task description: Run `POST _inference/rerank/bge-reranker-base-mkn` to perform reranking on the example input via Hugging Face value: "{\n \"input\": [\"luke\", \"like\", \"leia\", \"chewy\",\"r2d2\", \"star\", \"wars\"],\n \"query\": \"star wars main character\",\n \"return_documents\": false,\n \"top_n\": 2\n}" x-codeSamples: - lang: Console source: "POST _inference/rerank/bge-reranker-base-mkn\n{\n \"input\": [\"luke\", \"like\", \"leia\", \"chewy\",\"r2d2\", \"star\", \"wars\"],\n \"query\": \"star wars main character\",\n \"return_documents\": false,\n \"top_n\": 2\n}" - lang: Python source: "resp = client.inference.rerank(\n inference_id=\"bge-reranker-base-mkn\",\n input=[\n \"luke\",\n \"like\",\n \"leia\",\n \"chewy\",\n \"r2d2\",\n \"star\",\n \"wars\"\n ],\n query=\"star wars main character\",\n return_documents=False,\n top_n=2,\n)" - lang: JavaScript source: "const response = await client.inference.rerank({\n inference_id: \"bge-reranker-base-mkn\",\n input: [\"luke\", \"like\", \"leia\", \"chewy\", \"r2d2\", \"star\", \"wars\"],\n query: \"star wars main character\",\n return_documents: false,\n top_n: 2,\n});" - lang: Ruby source: "response = client.inference.rerank(\n inference_id: \"bge-reranker-base-mkn\",\n body: {\n \"input\": [\n \"luke\",\n \"like\",\n \"leia\",\n \"chewy\",\n \"r2d2\",\n \"star\",\n \"wars\"\n ],\n \"query\": \"star wars main character\",\n \"return_documents\": false,\n \"top_n\": 2\n }\n)" - lang: PHP source: "$resp = $client->inference()->rerank([\n \"inference_id\" => \"bge-reranker-base-mkn\",\n \"body\" => [\n \"input\" => array(\n \"luke\",\n \"like\",\n \"leia\",\n \"chewy\",\n \"r2d2\",\n \"star\",\n \"wars\",\n ),\n \"query\" => \"star wars main character\",\n \"return_documents\" => false,\n \"top_n\" => 2,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"input":["luke","like","leia","chewy","r2d2","star","wars"],"query":"star wars main character","return_documents":false,"top_n":2}'' "$ELASTICSEARCH_URL/_inference/rerank/bge-reranker-base-mkn"' - lang: C# source: "var response = await client.Inference\n .RerankAsync(inferenceId: \"bge-reranker-base-mkn\", d1 => d1\n .Input(new string[] { \"luke\", \"like\", \"leia\", \"chewy\", \"r2d2\", \"star\", \"wars\" })\n .Query(\"star wars main character\")\n .ReturnDocuments(false)\n .TopN(2)\n );" - lang: Java source: "client.inference().rerank(r -> r\n .inferenceId(\"bge-reranker-base-mkn\")\n .input(i -> i\n .string(List.of(\"luke\",\"like\",\"leia\",\"chewy\",\"r2d2\",\"star\",\"wars\"))\n )\n .query(q -> q\n .string(\"star wars main character\")\n )\n .returnDocuments(false)\n .topN(2)\n);\n" RerankRequestExample3: summary: Rerank task description: Run `POST _inference/rerank/bge-reranker-base-mkn` to perform reranking on the example input via Hugging Face value: "{\n \"input\": [\"luke\", \"like\", \"leia\", \"chewy\",\"r2d2\", \"star\", \"wars\"],\n \"query\": \"star wars main character\",\n \"return_documents\": true,\n \"top_n\": 3\n}" x-codeSamples: - lang: Console source: "POST _inference/rerank/bge-reranker-base-mkn\n{\n \"input\": [\"luke\", \"like\", \"leia\", \"chewy\",\"r2d2\", \"star\", \"wars\"],\n \"query\": \"star wars main character\",\n \"return_documents\": true,\n \"top_n\": 3\n}" - lang: Python source: "resp = client.inference.rerank(\n inference_id=\"bge-reranker-base-mkn\",\n input=[\n \"luke\",\n \"like\",\n \"leia\",\n \"chewy\",\n \"r2d2\",\n \"star\",\n \"wars\"\n ],\n query=\"star wars main character\",\n return_documents=True,\n top_n=3,\n)" - lang: JavaScript source: "const response = await client.inference.rerank({\n inference_id: \"bge-reranker-base-mkn\",\n input: [\"luke\", \"like\", \"leia\", \"chewy\", \"r2d2\", \"star\", \"wars\"],\n query: \"star wars main character\",\n return_documents: true,\n top_n: 3,\n});" - lang: Ruby source: "response = client.inference.rerank(\n inference_id: \"bge-reranker-base-mkn\",\n body: {\n \"input\": [\n \"luke\",\n \"like\",\n \"leia\",\n \"chewy\",\n \"r2d2\",\n \"star\",\n \"wars\"\n ],\n \"query\": \"star wars main character\",\n \"return_documents\": true,\n \"top_n\": 3\n }\n)" - lang: PHP source: "$resp = $client->inference()->rerank([\n \"inference_id\" => \"bge-reranker-base-mkn\",\n \"body\" => [\n \"input\" => array(\n \"luke\",\n \"like\",\n \"leia\",\n \"chewy\",\n \"r2d2\",\n \"star\",\n \"wars\",\n ),\n \"query\" => \"star wars main character\",\n \"return_documents\" => true,\n \"top_n\" => 3,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"input":["luke","like","leia","chewy","r2d2","star","wars"],"query":"star wars main character","return_documents":true,"top_n":3}'' "$ELASTICSEARCH_URL/_inference/rerank/bge-reranker-base-mkn"' - lang: C# source: "var response = await client.Inference\n .RerankAsync(inferenceId: \"bge-reranker-base-mkn\", d1 => d1\n .Input(new string[] { \"luke\", \"like\", \"leia\", \"chewy\", \"r2d2\", \"star\", \"wars\" })\n .Query(\"star wars main character\")\n .ReturnDocuments(true)\n .TopN(3)\n );" - lang: Java source: "client.inference().rerank(r -> r\n .inferenceId(\"bge-reranker-base-mkn\")\n .input(i -> i\n .string(List.of(\"luke\",\"like\",\"leia\",\"chewy\",\"r2d2\",\"star\",\"wars\"))\n )\n .query(q -> q\n .string(\"star wars main character\")\n )\n .returnDocuments(true)\n .topN(3)\n);\n" RerankRequestExample4: summary: Rerank task using the url format description: Run `POST _inference/rerank/my-multimodal-rerank-endpoint` to rank text documents against an image query referenced by URL. The `url` format is available in Elasticsearch 9.6.0 and later. value: "{\n \"query\": {\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/image.jpg\"\n },\n \"input\": [\"some document text\", \"some more document text\"],\n \"top_n\": 2\n}" x-codeSamples: - lang: Console source: "POST _inference/rerank/my-multimodal-rerank-endpoint\n{\n \"query\": {\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/image.jpg\"\n },\n \"input\": [\"some document text\", \"some more document text\"],\n \"top_n\": 2\n}" - lang: Python source: "resp = client.inference.rerank(\n inference_id=\"my-multimodal-rerank-endpoint\",\n query={\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/image.jpg\"\n },\n input=[\n \"some document text\",\n \"some more document text\"\n ],\n top_n=2,\n)" - lang: JavaScript source: "const response = await client.inference.rerank({\n inference_id: \"my-multimodal-rerank-endpoint\",\n query: {\n type: \"image\",\n format: \"url\",\n value: \"https://example.com/image.jpg\",\n },\n input: [\"some document text\", \"some more document text\"],\n top_n: 2,\n});" - lang: Ruby source: "response = client.inference.rerank(\n inference_id: \"my-multimodal-rerank-endpoint\",\n body: {\n \"query\": {\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/image.jpg\"\n },\n \"input\": [\n \"some document text\",\n \"some more document text\"\n ],\n \"top_n\": 2\n }\n)" - lang: PHP source: "$resp = $client->inference()->rerank([\n \"inference_id\" => \"my-multimodal-rerank-endpoint\",\n \"body\" => [\n \"query\" => [\n \"type\" => \"image\",\n \"format\" => \"url\",\n \"value\" => \"https://example.com/image.jpg\",\n ],\n \"input\" => array(\n \"some document text\",\n \"some more document text\",\n ),\n \"top_n\" => 2,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":{"type":"image","format":"url","value":"https://example.com/image.jpg"},"input":["some document text","some more document text"],"top_n":2}'' "$ELASTICSEARCH_URL/_inference/rerank/my-multimodal-rerank-endpoint"' - lang: C# source: "var response = await client.Inference\n .RerankAsync(inferenceId: \"my-multimodal-rerank-endpoint\", d1 => d1\n .Input(new string[] { \"some document text\", \"some more document text\" })\n .Query(new RerankInputObject()\n {\n Format = RerankInputFormat.Url,\n Type = RerankInputType.Image,\n Value = \"https://example.com/image.jpg\"\n })\n .TopN(2)\n );" RerankRequestExample5: summary: Rerank task using the url format for inputs description: Run `POST _inference/rerank/my-multimodal-rerank-endpoint` to rank image documents referenced by URL against a text query. The `url` format is available in Elasticsearch 9.6.0 and later. value: "{\n \"query\": \"a photo of a cat\",\n \"input\": [\n {\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/image1.jpg\"\n },\n {\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/image2.jpg\"\n }\n ],\n \"top_n\": 2\n}" x-codeSamples: - lang: Console source: "POST _inference/rerank/my-multimodal-rerank-endpoint\n{\n \"query\": \"a photo of a cat\",\n \"input\": [\n {\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/image1.jpg\"\n },\n {\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/image2.jpg\"\n }\n ],\n \"top_n\": 2\n}" - lang: Python source: "resp = client.inference.rerank(\n inference_id=\"my-multimodal-rerank-endpoint\",\n query=\"a photo of a cat\",\n input=[\n {\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/image1.jpg\"\n },\n {\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/image2.jpg\"\n }\n ],\n top_n=2,\n)" - lang: JavaScript source: "const response = await client.inference.rerank({\n inference_id: \"my-multimodal-rerank-endpoint\",\n query: \"a photo of a cat\",\n input: [\n {\n type: \"image\",\n format: \"url\",\n value: \"https://example.com/image1.jpg\",\n },\n {\n type: \"image\",\n format: \"url\",\n value: \"https://example.com/image2.jpg\",\n },\n ],\n top_n: 2,\n});" - lang: Ruby source: "response = client.inference.rerank(\n inference_id: \"my-multimodal-rerank-endpoint\",\n body: {\n \"query\": \"a photo of a cat\",\n \"input\": [\n {\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/image1.jpg\"\n },\n {\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/image2.jpg\"\n }\n ],\n \"top_n\": 2\n }\n)" - lang: PHP source: "$resp = $client->inference()->rerank([\n \"inference_id\" => \"my-multimodal-rerank-endpoint\",\n \"body\" => [\n \"query\" => \"a photo of a cat\",\n \"input\" => array(\n [\n \"type\" => \"image\",\n \"format\" => \"url\",\n \"value\" => \"https://example.com/image1.jpg\",\n ],\n [\n \"type\" => \"image\",\n \"format\" => \"url\",\n \"value\" => \"https://example.com/image2.jpg\",\n ],\n ),\n \"top_n\" => 2,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":"a photo of a cat","input":[{"type":"image","format":"url","value":"https://example.com/image1.jpg"},{"type":"image","format":"url","value":"https://example.com/image2.jpg"}],"top_n":2}'' "$ELASTICSEARCH_URL/_inference/rerank/my-multimodal-rerank-endpoint"' required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.RerankedInferenceResult' examples: RerankResponseExample1: summary: Rerank task description: "A successful response from `POST _inference/rerank/cohere_rerank`.\n" value: "{\n \"rerank\": [\n {\n \"index\": \"2\",\n \"relevance_score\": \"0.011597361\",\n \"text\": \"leia\"\n },\n {\n \"index\": \"0\",\n \"relevance_score\": \"0.006338922\",\n \"text\": \"luke\"\n },\n {\n \"index\": \"5\",\n \"relevance_score\": \"0.0016166499\",\n \"text\": \"star\"\n },\n {\n \"index\": \"4\",\n \"relevance_score\": \"0.0011695103\",\n \"text\": \"r2d2\"\n },\n {\n \"index\": \"1\",\n \"relevance_score\": \"5.614787E-4\",\n \"text\": \"like\"\n },\n {\n \"index\": \"6\",\n \"relevance_score\": \"3.7850367E-4\",\n \"text\": \"wars\"\n },\n {\n \"index\": \"3\",\n \"relevance_score\": \"1.2508839E-5\",\n \"text\": \"chewy\"\n }\n ]\n}" RerankResponseExample2: summary: Rerank task description: "A successful response from `POST _inference/rerank/bge-reranker-base-mkn`.\n" value: "{\n \"rerank\": [\n {\n \"index\": 6,\n \"relevance_score\": 0.50955844\n },\n {\n \"index\": 5,\n \"relevance_score\": 0.084341794\n }\n ]\n}" RerankResponseExample3: summary: Rerank task description: "A successful response from `POST _inference/rerank/bge-reranker-base-mkn`.\n" value: "{\n \"rerank\": [\n {\n \"index\": 6,\n \"relevance_score\": 0.50955844,\n \"text\": \"wars\"\n },\n {\n \"index\": 5,\n \"relevance_score\": 0.084341794,\n \"text\": \"star\"\n },\n {\n \"index\": 3,\n \"relevance_score\": 0.004520818,\n \"text\": \"chewy\"\n }\n ]\n}" x-state: Generally available; Added in 8.11.0 x-codeSamples: - lang: Console source: "POST _inference/rerank/cohere_rerank\n{\n \"input\": [\"luke\", \"like\", \"leia\", \"chewy\",\"r2d2\", \"star\", \"wars\"],\n \"query\": \"star wars main character\"\n}" - lang: Python source: "resp = client.inference.rerank(\n inference_id=\"cohere_rerank\",\n input=[\n \"luke\",\n \"like\",\n \"leia\",\n \"chewy\",\n \"r2d2\",\n \"star\",\n \"wars\"\n ],\n query=\"star wars main character\",\n)" - lang: JavaScript source: "const response = await client.inference.rerank({\n inference_id: \"cohere_rerank\",\n input: [\"luke\", \"like\", \"leia\", \"chewy\", \"r2d2\", \"star\", \"wars\"],\n query: \"star wars main character\",\n});" - lang: Ruby source: "response = client.inference.rerank(\n inference_id: \"cohere_rerank\",\n body: {\n \"input\": [\n \"luke\",\n \"like\",\n \"leia\",\n \"chewy\",\n \"r2d2\",\n \"star\",\n \"wars\"\n ],\n \"query\": \"star wars main character\"\n }\n)" - lang: PHP source: "$resp = $client->inference()->rerank([\n \"inference_id\" => \"cohere_rerank\",\n \"body\" => [\n \"input\" => array(\n \"luke\",\n \"like\",\n \"leia\",\n \"chewy\",\n \"r2d2\",\n \"star\",\n \"wars\",\n ),\n \"query\" => \"star wars main character\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"input":["luke","like","leia","chewy","r2d2","star","wars"],"query":"star wars main character"}'' "$ELASTICSEARCH_URL/_inference/rerank/cohere_rerank"' - lang: C# source: "var response = await client.Inference\n .RerankAsync(inferenceId: \"cohere_rerank\", d1 => d1\n .Input(new string[] { \"luke\", \"like\", \"leia\", \"chewy\", \"r2d2\", \"star\", \"wars\" })\n .Query(\"star wars main character\")\n );" - lang: Java source: "client.inference().rerank(r -> r\n .inferenceId(\"cohere_rerank\")\n .input(i -> i\n .string(List.of(\"luke\",\"like\",\"leia\",\"chewy\",\"r2d2\",\"star\",\"wars\"))\n )\n .query(q -> q\n .string(\"star wars main character\")\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/sparse_embedding/{inference_id}': post: tags: - inference summary: Perform sparse embedding inference on the service description: "\n\n## Required authorization\n\n* Cluster privileges: `monitor_inference`\n" operationId: inference-sparse-embedding parameters: - name: inference_id in: path description: The inference Id required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference request to complete. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - input type: object properties: input: oneOf: - type: string - type: array items: type: string description: "Inference input.\nEither a string or an array of strings." task_settings: allOf: - $ref: '#/components/schemas/inference._types.TaskSettings' description: Task settings for the individual inference request. These settings are specific to the you specified and override the task settings specified when initializing the service. examples: SparseEmbeddingRequestExample1: summary: Sparse embedding task description: Run `POST _inference/sparse_embedding/my-elser-model` to perform sparse embedding on the example sentence. value: "{\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\"\n}" x-codeSamples: - lang: Console source: "POST _inference/sparse_embedding/my-elser-model\n{\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\"\n}" - lang: Python source: "resp = client.inference.sparse_embedding(\n inference_id=\"my-elser-model\",\n input=\"The sky above the port was the color of television tuned to a dead channel.\",\n)" - lang: JavaScript source: "const response = await client.inference.sparseEmbedding({\n inference_id: \"my-elser-model\",\n input:\n \"The sky above the port was the color of television tuned to a dead channel.\",\n});" - lang: Ruby source: "response = client.inference.sparse_embedding(\n inference_id: \"my-elser-model\",\n body: {\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\"\n }\n)" - lang: PHP source: "$resp = $client->inference()->sparseEmbedding([\n \"inference_id\" => \"my-elser-model\",\n \"body\" => [\n \"input\" => \"The sky above the port was the color of television tuned to a dead channel.\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"input":"The sky above the port was the color of television tuned to a dead channel."}'' "$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model"' - lang: C# source: "var response = await client.Inference\n .SparseEmbeddingAsync(inferenceId: \"my-elser-model\", d1 => d1\n .Input(\"The sky above the port was the color of television tuned to a dead channel.\")\n );" - lang: Java source: "client.inference().sparseEmbedding(s -> s\n .inferenceId(\"my-elser-model\")\n .input(\"The sky above the port was the color of television tuned to a dead channel.\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.SparseEmbeddingInferenceResult' examples: SparseEmbeddingResponseExample1: summary: Sparse embedding task description: "An abbreviated response from `POST _inference/sparse_embedding/my-elser-model`.\n" value: "{\n \"sparse_embedding\": [\n {\n \"is_truncated\": false,\n \"embedding\": {\n \"port\": 2.1259406,\n \"sky\": 1.7073475,\n \"color\": 1.6922266,\n \"dead\": 1.6247464,\n \"television\": 1.3525393,\n \"above\": 1.2425821,\n \"tuned\": 1.1440028,\n \"colors\": 1.1218185,\n \"tv\": 1.0111054,\n \"ports\": 1.0067928,\n \"poem\": 1.0042328,\n \"channel\": 0.99471164,\n \"tune\": 0.96235967,\n \"scene\": 0.9020516\n }\n }\n ]\n}" x-state: Generally available; Added in 8.11.0 x-codeSamples: - lang: Console source: "POST _inference/sparse_embedding/my-elser-model\n{\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\"\n}" - lang: Python source: "resp = client.inference.sparse_embedding(\n inference_id=\"my-elser-model\",\n input=\"The sky above the port was the color of television tuned to a dead channel.\",\n)" - lang: JavaScript source: "const response = await client.inference.sparseEmbedding({\n inference_id: \"my-elser-model\",\n input:\n \"The sky above the port was the color of television tuned to a dead channel.\",\n});" - lang: Ruby source: "response = client.inference.sparse_embedding(\n inference_id: \"my-elser-model\",\n body: {\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\"\n }\n)" - lang: PHP source: "$resp = $client->inference()->sparseEmbedding([\n \"inference_id\" => \"my-elser-model\",\n \"body\" => [\n \"input\" => \"The sky above the port was the color of television tuned to a dead channel.\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"input":"The sky above the port was the color of television tuned to a dead channel."}'' "$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model"' - lang: C# source: "var response = await client.Inference\n .SparseEmbeddingAsync(inferenceId: \"my-elser-model\", d1 => d1\n .Input(\"The sky above the port was the color of television tuned to a dead channel.\")\n );" - lang: Java source: "client.inference().sparseEmbedding(s -> s\n .inferenceId(\"my-elser-model\")\n .input(\"The sky above the port was the color of television tuned to a dead channel.\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/completion/{inference_id}/_stream': post: tags: - inference summary: Perform streaming completion inference on the service description: "Get real-time responses for completion tasks by delivering answers incrementally, reducing response times during computation.\nThis API works only with the completion task type.\n\nIMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face. For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs.\n\nThis API requires the `monitor_inference` cluster privilege (the built-in `inference_admin` and `inference_user` roles grant this privilege). You must use a client that supports streaming.\n\n## Required authorization\n\n* Cluster privileges: `monitor_inference`\n" operationId: inference-stream-completion parameters: - name: inference_id in: path description: The unique identifier for the inference endpoint. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: The amount of time to wait for the inference request to complete. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - input type: object properties: input: oneOf: - type: string - type: array items: type: string description: "The text on which you want to perform the inference task.\nIt can be a single string or an array.\n\nNOTE: Inference endpoints for the completion task type currently only support a single string as input." task_settings: allOf: - $ref: '#/components/schemas/inference._types.TaskSettings' description: Task settings for the individual inference request. These settings are specific to the you specified and override the task settings specified when initializing the service. examples: StreamInferenceRequestExample1: summary: Perform a completion task description: Run `POST _inference/completion/openai-completion/_stream` to perform a completion on the example question with streaming. value: "{\n \"input\": \"What is Elastic?\"\n}" x-codeSamples: - lang: Console source: "POST _inference/completion/openai-completion/_stream\n{\n \"input\": \"What is Elastic?\"\n}" - lang: Python source: "resp = client.inference.stream_completion(\n inference_id=\"openai-completion\",\n input=\"What is Elastic?\",\n)" - lang: JavaScript source: "const response = await client.inference.streamCompletion({\n inference_id: \"openai-completion\",\n input: \"What is Elastic?\",\n});" - lang: Ruby source: "response = client.inference.stream_completion(\n inference_id: \"openai-completion\",\n body: {\n \"input\": \"What is Elastic?\"\n }\n)" - lang: PHP source: "$resp = $client->inference()->streamCompletion([\n \"inference_id\" => \"openai-completion\",\n \"body\" => [\n \"input\" => \"What is Elastic?\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"input":"What is Elastic?"}'' "$ELASTICSEARCH_URL/_inference/completion/openai-completion/_stream"' - lang: C# source: "var response = await client.Inference\n .StreamCompletionAsync(inferenceId: \"openai-completion\", d1 => d1\n .Input(\"What is Elastic?\")\n );" - lang: Java source: "client.inference().streamCompletion(s -> s\n .inferenceId(\"openai-completion\")\n .input(\"What is Elastic?\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.StreamResult' x-state: Generally available; Added in 8.16.0 x-codeSamples: - lang: Console source: "POST _inference/completion/openai-completion/_stream\n{\n \"input\": \"What is Elastic?\"\n}" - lang: Python source: "resp = client.inference.stream_completion(\n inference_id=\"openai-completion\",\n input=\"What is Elastic?\",\n)" - lang: JavaScript source: "const response = await client.inference.streamCompletion({\n inference_id: \"openai-completion\",\n input: \"What is Elastic?\",\n});" - lang: Ruby source: "response = client.inference.stream_completion(\n inference_id: \"openai-completion\",\n body: {\n \"input\": \"What is Elastic?\"\n }\n)" - lang: PHP source: "$resp = $client->inference()->streamCompletion([\n \"inference_id\" => \"openai-completion\",\n \"body\" => [\n \"input\" => \"What is Elastic?\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"input":"What is Elastic?"}'' "$ELASTICSEARCH_URL/_inference/completion/openai-completion/_stream"' - lang: C# source: "var response = await client.Inference\n .StreamCompletionAsync(inferenceId: \"openai-completion\", d1 => d1\n .Input(\"What is Elastic?\")\n );" - lang: Java source: "client.inference().streamCompletion(s -> s\n .inferenceId(\"openai-completion\")\n .input(\"What is Elastic?\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/text_embedding/{inference_id}': post: tags: - inference summary: Perform text embedding inference on the service description: "\n\n## Required authorization\n\n* Cluster privileges: `monitor_inference`\n" operationId: inference-text-embedding parameters: - name: inference_id in: path description: The inference Id required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Specifies the amount of time to wait for the inference request to complete. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - input type: object properties: input: oneOf: - type: string - type: array items: type: string description: "Inference input.\nEither a string or an array of strings." input_type: type: string description: "The input data type for the text embedding model. Possible values include:\n* `SEARCH`\n* `INGEST`\n* `CLASSIFICATION`\n* `CLUSTERING`\nNot all services support all values. Unsupported values will trigger a validation exception.\nAccepted values depend on the configured inference service, refer to the relevant service-specific documentation for more info.\n\n> info\n> The `input_type` parameter specified on the root level of the request body will take precedence over the `input_type` parameter specified in `task_settings`." task_settings: allOf: - $ref: '#/components/schemas/inference._types.TaskSettings' description: Task settings for the individual inference request. These settings are specific to the you specified and override the task settings specified when initializing the service. examples: TextEmbeddingRequestExample1: summary: Text embedding task description: 'Run `POST _inference/text_embedding/my-cohere-endpoint` to perform text embedding on the example sentence using the Cohere integration,' value: "{\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\",\n \"input_type\": \"ingest\"\n}" x-codeSamples: - lang: Console source: "POST _inference/text_embedding/my-cohere-endpoint\n{\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\",\n \"input_type\": \"ingest\"\n}" - lang: Python source: "resp = client.inference.text_embedding(\n inference_id=\"my-cohere-endpoint\",\n input=\"The sky above the port was the color of television tuned to a dead channel.\",\n input_type=\"ingest\",\n)" - lang: JavaScript source: "const response = await client.inference.textEmbedding({\n inference_id: \"my-cohere-endpoint\",\n input:\n \"The sky above the port was the color of television tuned to a dead channel.\",\n input_type: \"ingest\",\n});" - lang: Ruby source: "response = client.inference.text_embedding(\n inference_id: \"my-cohere-endpoint\",\n body: {\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\",\n \"input_type\": \"ingest\"\n }\n)" - lang: PHP source: "$resp = $client->inference()->textEmbedding([\n \"inference_id\" => \"my-cohere-endpoint\",\n \"body\" => [\n \"input\" => \"The sky above the port was the color of television tuned to a dead channel.\",\n \"input_type\" => \"ingest\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"input":"The sky above the port was the color of television tuned to a dead channel.","input_type":"ingest"}'' "$ELASTICSEARCH_URL/_inference/text_embedding/my-cohere-endpoint"' - lang: C# source: "var response = await client.Inference\n .TextEmbeddingAsync(inferenceId: \"my-cohere-endpoint\", d1 => d1\n .Input(\"The sky above the port was the color of television tuned to a dead channel.\")\n .InputType(\"ingest\")\n );" - lang: Java source: "client.inference().textEmbedding(t -> t\n .inferenceId(\"my-cohere-endpoint\")\n .input(\"The sky above the port was the color of television tuned to a dead channel.\")\n .inputType(\"ingest\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.TextEmbeddingInferenceResult' examples: TextEmbeddingResponseExample1: summary: Text embedding task description: "An abbreviated response from `POST _inference/text_embedding/my-text-embedding-endpoint`.\n" value: "{\n \"text_embedding\": [\n {\n \"embedding\": [\n 0.018569946,\n -0.036895752,\n 0.01486969,\n -0.0045204163,\n -0.04385376,\n 0.0075950623,\n 0.04260254,\n -0.004005432,\n 0.007865906,\n 0.030792236,\n -0.050476074,\n 0.011795044,\n -0.011642456,\n -0.010070801\n ]\n }\n ]\n}" x-state: Generally available; Added in 8.11.0 x-codeSamples: - lang: Console source: "POST _inference/text_embedding/my-cohere-endpoint\n{\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\",\n \"input_type\": \"ingest\"\n}" - lang: Python source: "resp = client.inference.text_embedding(\n inference_id=\"my-cohere-endpoint\",\n input=\"The sky above the port was the color of television tuned to a dead channel.\",\n input_type=\"ingest\",\n)" - lang: JavaScript source: "const response = await client.inference.textEmbedding({\n inference_id: \"my-cohere-endpoint\",\n input:\n \"The sky above the port was the color of television tuned to a dead channel.\",\n input_type: \"ingest\",\n});" - lang: Ruby source: "response = client.inference.text_embedding(\n inference_id: \"my-cohere-endpoint\",\n body: {\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\",\n \"input_type\": \"ingest\"\n }\n)" - lang: PHP source: "$resp = $client->inference()->textEmbedding([\n \"inference_id\" => \"my-cohere-endpoint\",\n \"body\" => [\n \"input\" => \"The sky above the port was the color of television tuned to a dead channel.\",\n \"input_type\" => \"ingest\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"input":"The sky above the port was the color of television tuned to a dead channel.","input_type":"ingest"}'' "$ELASTICSEARCH_URL/_inference/text_embedding/my-cohere-endpoint"' - lang: C# source: "var response = await client.Inference\n .TextEmbeddingAsync(inferenceId: \"my-cohere-endpoint\", d1 => d1\n .Input(\"The sky above the port was the color of television tuned to a dead channel.\")\n .InputType(\"ingest\")\n );" - lang: Java source: "client.inference().textEmbedding(t -> t\n .inferenceId(\"my-cohere-endpoint\")\n .input(\"The sky above the port was the color of television tuned to a dead channel.\")\n .inputType(\"ingest\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_inference/{task_type}/{inference_id}/_update': put: tags: - inference summary: "Update an inference endpoint\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_inference/{inference_id}/_update\n
\n
\n PUT\n /_inference/{task_type}/{inference_id}/_update\n
\n \n\nModify `task_settings`, secrets (within `service_settings`), or `num_allocations` for an inference endpoint, depending on the specific endpoint service and `task_type`.\n\nIMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face.\nFor built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models.\nHowever, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n" operationId: inference-update parameters: - $ref: '#/components/parameters/inference.update-task_type' - $ref: '#/components/parameters/inference.update-inference_id' - $ref: '#/components/parameters/inference.update-timeout' requestBody: $ref: '#/components/requestBodies/inference.update' responses: '200': $ref: '#/components/responses/inference.update-200' x-state: Generally available; Added in 8.17.0 x-codeSamples: - lang: Console source: "PUT _inference/my-inference-endpoint/_update\n{\n \"service_settings\": {\n \"api_key\": \"\"\n },\n\"service\": \"example-service\"\n}" - lang: Python source: "resp = client.inference.update(\n inference_id=\"my-inference-endpoint\",\n inference_config={\n \"service_settings\": {\n \"api_key\": \"\"\n },\n \"service\": \"example-service\"\n },\n)" - lang: JavaScript source: "const response = await client.inference.update({\n inference_id: \"my-inference-endpoint\",\n inference_config: {\n service_settings: {\n api_key: \"\",\n },\n service: \"example-service\",\n },\n});" - lang: Ruby source: "response = client.inference.update(\n inference_id: \"my-inference-endpoint\",\n body: {\n \"service_settings\": {\n \"api_key\": \"\"\n },\n \"service\": \"example-service\"\n }\n)" - lang: PHP source: "$resp = $client->inference()->update([\n \"inference_id\" => \"my-inference-endpoint\",\n \"body\" => [\n \"service_settings\" => [\n \"api_key\" => \"\",\n ],\n \"service\" => \"example-service\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"service_settings":{"api_key":""},"service":"example-service"}'' "$ELASTICSEARCH_URL/_inference/my-inference-endpoint/_update"' - lang: C# source: "var response = await client.Inference\n .UpdateAsync(new UpdateInferenceRequest()\n {\n InferenceId = \"my-inference-endpoint\",\n InferenceConfig = new()\n {\n Service = \"example-service\",\n ServiceSettings = JsonSerializer.Deserialize(\"\"\"\n {\n \"api_key\": \"\\u003CAPI_KEY\\u003E\"\n }\n \"\"\")\n }\n });" - lang: Java source: "client.inference().update(u -> u\n .inferenceId(\"my-inference-endpoint\")\n .inferenceConfig(i -> i\n .service(\"example-service\")\n .serviceSettings(JsonData.fromJson(\"\"\"\n{\"api_key\":\"\"}\n\"\"\"))\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name /: get: tags: - info summary: Get cluster info description: "Get basic build, version, and cluster information.\n::: In Serverless, `version.number` always reports the next target Elasticsearch release version at the time of the request. Serverless does not track to a traditional release versioning model; it is continuously updated. The version number is provided to maintain compatibility with existing clients, but it is not meaningful for assessing feature availability. Clients should detect a Serverless environment by checking for `build_flavor: serverless`.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" externalDocs: description: Learn about Serverless differences url: https://www.elastic.co/docs/deploy-manage/deploy/elastic-cloud/differences-from-other-elasticsearch-offerings x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/rest-api-root.html operationId: info responses: '200': description: '' content: application/json: schema: required: - cluster_name - cluster_uuid - name - tagline - version type: object properties: cluster_name: allOf: - $ref: '#/components/schemas/_types.Name' description: The responding cluster's name. cluster_uuid: allOf: - $ref: '#/components/schemas/_types.Uuid' name: allOf: - $ref: '#/components/schemas/_types.Name' description: The responding node's name. tagline: type: string version: allOf: - $ref: '#/components/schemas/_types.ElasticsearchVersionInfo' description: 'Version information for the Elasticsearch cluster. In Serverless, `version.number` always reports the next target Elasticsearch release version at the time of the request, not an actual deployed version. The version number is provided to maintain client compatibility but is not meaningful for assessing feature availability. Use `build_flavor: serverless` to detect a Serverless environment.' examples: RootNodeInfoResponseExample1: summary: Stack response description: A successful response from `GET /`. value: "{\n \"name\": \"instance-0000000000\",\n \"cluster_name\": \"my_test_cluster\",\n \"cluster_uuid\": \"zk-HjQtYQGyL3NFSSu7InA\",\n \"version\": {\n \"number\": \"9.1.0\",\n \"build_flavor\": \"default\",\n \"build_type\": \"docker\",\n \"build_hash\": 0,\n \"build_date\": \"2025-07-09T22:10:13.578Z\",\n \"build_snapshot\": false,\n \"lucene_version\": \"10.2.2\",\n \"minimum_wire_compatibility_version\": \"8.19.0\",\n \"minimum_index_compatibility_version\": \"8.0.0\"\n },\n \"tagline\": \"You Know, for Search\"\n}" RootNodeInfoResponseExample2: summary: Serverless response description: 'A successful response from `GET /` on Serverless. The `version.number` shown here is illustrative; Serverless always reports the next target Elasticsearch release version at the time of the request, so the actual value will differ from this example.' value: "{\n \"name\": \"serverless\",\n \"cluster_name\": \"my_test_serverless_cluster\",\n \"cluster_uuid\": \"8xx0pi24Squnf4PFDOAtwg\",\n \"version\": {\n \"number\": \"9.4.0\",\n \"build_flavor\": \"serverless\",\n \"build_type\": \"docker\",\n \"build_hash\": \"6b73650b7c4192d4a7ef1d75a368dad7d28f1ae0\",\n \"build_date\": \"2026-03-31T12:25:05.021Z\",\n \"build_snapshot\": false,\n \"lucene_version\": \"10.4.0\",\n \"minimum_wire_compatibility_version\": \"9.4.0\",\n \"minimum_index_compatibility_version\": \"9.4.0\"\n },\n \"tagline\": \"You Know, for Search\"\n}" x-state: Generally available x-codeSamples: - lang: Console source: "GET /\n" - lang: Python source: resp = client.info() - lang: JavaScript source: const response = await client.info(); - lang: Ruby source: response = client.info - lang: PHP source: $resp = $client->info(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/"' - lang: C# source: var response = await client.InfoAsync(); - lang: Java source: "client.info();\n" x-metaTags: - content: Elasticsearch name: product_name head: tags: - cluster summary: Ping the cluster description: Get information about whether the cluster is running. operationId: ping responses: '200': description: '' content: application/json: { } x-state: Generally available x-metaTags: - content: Elasticsearch name: product_name '/_ingest/geoip/database/{id}': get: tags: - ingest summary: "Get GeoIP database configurations\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ingest/geoip/database\n
\n
\n GET\n /_ingest/geoip/database/{id}\n
\n \n\nGet information about one or more IP geolocation database configurations.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: ingest-get-geoip-database parameters: - $ref: '#/components/parameters/ingest.get_geoip_database-id' responses: '200': $ref: '#/components/responses/ingest.get_geoip_database-200' x-state: Generally available; Added in 8.15.0 x-metaTags: - content: Elasticsearch name: product_name put: tags: - ingest summary: Create or update a GeoIP database configuration description: "Refer to the create or update IP geolocation database configuration API.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: ingest-put-geoip-database parameters: - name: id in: path description: ID of the database configuration to create or update. required: true schema: $ref: '#/components/schemas/_types.Id' - name: master_timeout in: query description: "Period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: 'Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - name - maxmind type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' description: The provider-assigned name of the IP geolocation database to download. maxmind: allOf: - $ref: '#/components/schemas/ingest._types.Maxmind' description: "The configuration necessary to identify which IP geolocation provider to use to download the database, as well as any provider-specific configuration necessary for such downloading.\nAt present, the only supported provider is maxmind, and the maxmind provider requires that an account_id (string) is configured." required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 8.15.0 x-metaTags: - content: Elasticsearch name: product_name delete: tags: - ingest summary: Delete GeoIP database configurations description: "Delete one or more IP geolocation database configurations.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: ingest-delete-geoip-database parameters: - name: id in: path description: A comma-separated list of geoip database configurations to delete required: true schema: $ref: '#/components/schemas/_types.Ids' - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: 'The period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 8.15.0 x-metaTags: - content: Elasticsearch name: product_name '/_ingest/ip_location/database/{id}': get: tags: - ingest summary: "Get IP geolocation database configurations\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ingest/ip_location/database\n
\n
\n GET\n /_ingest/ip_location/database/{id}\n
\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: ingest-get-ip-location-database parameters: - $ref: '#/components/parameters/ingest.get_ip_location_database-id' responses: '200': $ref: '#/components/responses/ingest.get_ip_location_database-200' x-state: Generally available; Added in 8.15.0 x-codeSamples: - lang: Console source: "GET /_ingest/ip_location/database/my-database-id\n" - lang: Python source: "resp = client.ingest.get_ip_location_database(\n id=\"my-database-id\",\n)" - lang: JavaScript source: "const response = await client.ingest.getIpLocationDatabase({\n id: \"my-database-id\",\n});" - lang: Ruby source: "response = client.ingest.get_ip_location_database(\n id: \"my-database-id\"\n)" - lang: PHP source: "$resp = $client->ingest()->getIpLocationDatabase([\n \"id\" => \"my-database-id\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ingest/ip_location/database/my-database-id"' - lang: C# source: "var response = await client.Ingest\n .GetIpLocationDatabaseAsync(d1 => d1\n .Id(new[] { \"my-database-id\" })\n );" - lang: Java source: "client.ingest().getIpLocationDatabase(g -> g\n .id(\"my-database-id\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - ingest summary: Create or update an IP geolocation database configuration description: "\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: ingest-put-ip-location-database parameters: - name: id in: path description: The database configuration identifier. required: true schema: $ref: '#/components/schemas/_types.Id' - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error.\nA value of `-1` indicates that the request should never time out." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "The period to wait for a response from all relevant nodes in the cluster after updating the cluster metadata.\nIf no response is received before the timeout expires, the cluster metadata update still applies but the response indicates that it was not completely acknowledged.\nA value of `-1` indicates that the request should never time out." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: $ref: '#/components/schemas/ingest._types.DatabaseConfiguration' examples: IngestPutIpLocationDatabaseExample1: description: An example body for a `PUT _ingest/ip_location/database/my-database-1` request. value: "{\n \"name\": \"GeoIP2-Domain\",\n \"maxmind\": {\n \"account_id\": \"1234567\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _ingest/ip_location/database/my-database-1\n{\n \"name\": \"GeoIP2-Domain\",\n \"maxmind\": {\n \"account_id\": \"1234567\"\n }\n}" - lang: Python source: "resp = client.ingest.put_ip_location_database(\n id=\"my-database-1\",\n configuration={\n \"name\": \"GeoIP2-Domain\",\n \"maxmind\": {\n \"account_id\": \"1234567\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.ingest.putIpLocationDatabase({\n id: \"my-database-1\",\n configuration: {\n name: \"GeoIP2-Domain\",\n maxmind: {\n account_id: \"1234567\",\n },\n },\n});" - lang: Ruby source: "response = client.ingest.put_ip_location_database(\n id: \"my-database-1\",\n body: {\n \"name\": \"GeoIP2-Domain\",\n \"maxmind\": {\n \"account_id\": \"1234567\"\n }\n }\n)" - lang: PHP source: "$resp = $client->ingest()->putIpLocationDatabase([\n \"id\" => \"my-database-1\",\n \"body\" => [\n \"name\" => \"GeoIP2-Domain\",\n \"maxmind\" => [\n \"account_id\" => \"1234567\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"name":"GeoIP2-Domain","maxmind":{"account_id":"1234567"}}'' "$ELASTICSEARCH_URL/_ingest/ip_location/database/my-database-1"' - lang: C# source: "var response = await client.Ingest\n .PutIpLocationDatabaseAsync(id: \"my-database-1\", d1 => d1\n .Configuration(d2 => d2\n .Name(\"GeoIP2-Domain\")\n .Maxmind(d3 => d3\n .AccountId(\"1234567\")\n )\n )\n );" - lang: Java source: "client.ingest().putIpLocationDatabase(p -> p\n .id(\"my-database-1\")\n .configuration(c -> c\n .maxmind(m -> m\n .accountId(\"1234567\")\n )\n .name(\"GeoIP2-Domain\")\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 8.15.0 x-codeSamples: - lang: Console source: "PUT _ingest/ip_location/database/my-database-1\n{\n \"name\": \"GeoIP2-Domain\",\n \"maxmind\": {\n \"account_id\": \"1234567\"\n }\n}" - lang: Python source: "resp = client.ingest.put_ip_location_database(\n id=\"my-database-1\",\n configuration={\n \"name\": \"GeoIP2-Domain\",\n \"maxmind\": {\n \"account_id\": \"1234567\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.ingest.putIpLocationDatabase({\n id: \"my-database-1\",\n configuration: {\n name: \"GeoIP2-Domain\",\n maxmind: {\n account_id: \"1234567\",\n },\n },\n});" - lang: Ruby source: "response = client.ingest.put_ip_location_database(\n id: \"my-database-1\",\n body: {\n \"name\": \"GeoIP2-Domain\",\n \"maxmind\": {\n \"account_id\": \"1234567\"\n }\n }\n)" - lang: PHP source: "$resp = $client->ingest()->putIpLocationDatabase([\n \"id\" => \"my-database-1\",\n \"body\" => [\n \"name\" => \"GeoIP2-Domain\",\n \"maxmind\" => [\n \"account_id\" => \"1234567\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"name":"GeoIP2-Domain","maxmind":{"account_id":"1234567"}}'' "$ELASTICSEARCH_URL/_ingest/ip_location/database/my-database-1"' - lang: C# source: "var response = await client.Ingest\n .PutIpLocationDatabaseAsync(id: \"my-database-1\", d1 => d1\n .Configuration(d2 => d2\n .Name(\"GeoIP2-Domain\")\n .Maxmind(d3 => d3\n .AccountId(\"1234567\")\n )\n )\n );" - lang: Java source: "client.ingest().putIpLocationDatabase(p -> p\n .id(\"my-database-1\")\n .configuration(c -> c\n .maxmind(m -> m\n .accountId(\"1234567\")\n )\n .name(\"GeoIP2-Domain\")\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - ingest summary: Delete IP geolocation database configurations description: "\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: ingest-delete-ip-location-database parameters: - name: id in: path description: A comma-separated list of IP location database configurations. required: true schema: $ref: '#/components/schemas/_types.Ids' - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error.\nA value of `-1` indicates that the request should never time out." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "The period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error.\nA value of `-1` indicates that the request should never time out." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 8.15.0 x-codeSamples: - lang: Console source: "DELETE /_ingest/ip_location/database/my-database-id\n" - lang: Python source: "resp = client.ingest.delete_ip_location_database(\n id=\"my-database-id\",\n)" - lang: JavaScript source: "const response = await client.ingest.deleteIpLocationDatabase({\n id: \"my-database-id\",\n});" - lang: Ruby source: "response = client.ingest.delete_ip_location_database(\n id: \"my-database-id\"\n)" - lang: PHP source: "$resp = $client->ingest()->deleteIpLocationDatabase([\n \"id\" => \"my-database-id\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ingest/ip_location/database/my-database-id"' - lang: C# source: 'var response = await client.Ingest.DeleteIpLocationDatabaseAsync(id: new[] { "my-database-id" });' - lang: Java source: "client.ingest().deleteIpLocationDatabase(d -> d\n .id(\"my-database-id\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_ingest/pipeline/{id}': get: tags: - ingest summary: "Get pipelines\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ingest/pipeline\n
\n
\n GET\n /_ingest/pipeline/{id}\n
\n \n\nGet information about one or more ingest pipelines.\nThis API returns a local reference of the pipeline.\n\n## Required authorization\n\n* Cluster privileges: `read_pipeline`,`manage_ingest_pipelines`\n" externalDocs: description: About ingest pipelines url: https://www.elastic.co/docs/manage-data/ingest/transform-enrich/ingest-pipelines x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/get-pipeline-api.html operationId: ingest-get-pipeline parameters: - $ref: '#/components/parameters/ingest.get_pipeline-id' - $ref: '#/components/parameters/ingest.get_pipeline-master_timeout' - $ref: '#/components/parameters/ingest.get_pipeline-summary' responses: '200': $ref: '#/components/responses/ingest.get_pipeline-200' x-state: Generally available; Added in 5.0.0 x-codeSamples: - lang: Console source: "GET /_ingest/pipeline/my-pipeline-id\n" - lang: Python source: "resp = client.ingest.get_pipeline(\n id=\"my-pipeline-id\",\n)" - lang: JavaScript source: "const response = await client.ingest.getPipeline({\n id: \"my-pipeline-id\",\n});" - lang: Ruby source: "response = client.ingest.get_pipeline(\n id: \"my-pipeline-id\"\n)" - lang: PHP source: "$resp = $client->ingest()->getPipeline([\n \"id\" => \"my-pipeline-id\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ingest/pipeline/my-pipeline-id"' - lang: C# source: "var response = await client.Ingest\n .GetPipelineAsync(d1 => d1\n .Id(\"my-pipeline-id\")\n );" - lang: Java source: "client.ingest().getPipeline(g -> g\n .id(\"my-pipeline-id\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - ingest summary: Create or update a pipeline description: "Changes made using this API take effect immediately.\n\n## Required authorization\n\n* Cluster privileges: `manage_pipeline`,`manage_ingest_pipelines`\n" externalDocs: description: About ingest pipelines url: https://www.elastic.co/docs/manage-data/ingest/transform-enrich/ingest-pipelines operationId: ingest-put-pipeline parameters: - name: id in: path description: ID of the ingest pipeline to create or update. required: true schema: $ref: '#/components/schemas/_types.Id' - name: master_timeout in: query description: 'Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: 'Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: if_version in: query description: Required version for optimistic concurrency control for pipeline updates schema: type: number requestBody: content: application/json: schema: type: object properties: _meta: allOf: - $ref: '#/components/schemas/_types.Metadata' description: Optional metadata about the ingest pipeline. May have any contents. This map is not automatically generated by Elasticsearch. description: type: string description: Description of the ingest pipeline. on_failure: type: array items: $ref: '#/components/schemas/ingest._types.ProcessorContainer' description: 'Processors to run immediately after a processor failure. Each processor supports a processor-level `on_failure` value. If a processor without an `on_failure` value fails, Elasticsearch uses this pipeline-level parameter as a fallback. The processors in this parameter run sequentially in the order specified. Elasticsearch will not attempt to run the pipeline''s remaining processors.' processors: type: array items: $ref: '#/components/schemas/ingest._types.ProcessorContainer' description: Processors used to perform transformations on documents before indexing. Processors run sequentially in the order specified. version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' description: Version number used by external systems to track ingest pipelines. This parameter is intended for external systems only. Elasticsearch does not use or validate pipeline version numbers. deprecated: type: boolean description: "Marks this ingest pipeline as deprecated.\nWhen a deprecated ingest pipeline is referenced as the default or final pipeline when creating or updating a non-deprecated index template, Elasticsearch will emit a deprecation warning." default: false field_access_pattern: allOf: - $ref: '#/components/schemas/ingest._types.FieldAccessPattern' description: Controls how processors in this pipeline should read and write data on a document's source. default: classic x-state: Generally available; Added in 9.2.0 examples: PutPipelineRequestExample1: summary: Create an ingest pipeline. value: "{\n \"description\" : \"My optional pipeline description\",\n \"processors\" : [\n {\n \"set\" : {\n \"description\" : \"My optional processor description\",\n \"field\": \"my-keyword-field\",\n \"value\": \"foo\"\n }\n }\n ]\n}" x-codeSamples: - lang: Console source: "PUT _ingest/pipeline/my-pipeline-id\n{\n \"description\" : \"My optional pipeline description\",\n \"processors\" : [\n {\n \"set\" : {\n \"description\" : \"My optional processor description\",\n \"field\": \"my-keyword-field\",\n \"value\": \"foo\"\n }\n }\n ]\n}" - lang: Python source: "resp = client.ingest.put_pipeline(\n id=\"my-pipeline-id\",\n description=\"My optional pipeline description\",\n processors=[\n {\n \"set\": {\n \"description\": \"My optional processor description\",\n \"field\": \"my-keyword-field\",\n \"value\": \"foo\"\n }\n }\n ],\n)" - lang: JavaScript source: "const response = await client.ingest.putPipeline({\n id: \"my-pipeline-id\",\n description: \"My optional pipeline description\",\n processors: [\n {\n set: {\n description: \"My optional processor description\",\n field: \"my-keyword-field\",\n value: \"foo\",\n },\n },\n ],\n});" - lang: Ruby source: "response = client.ingest.put_pipeline(\n id: \"my-pipeline-id\",\n body: {\n \"description\": \"My optional pipeline description\",\n \"processors\": [\n {\n \"set\": {\n \"description\": \"My optional processor description\",\n \"field\": \"my-keyword-field\",\n \"value\": \"foo\"\n }\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->ingest()->putPipeline([\n \"id\" => \"my-pipeline-id\",\n \"body\" => [\n \"description\" => \"My optional pipeline description\",\n \"processors\" => array(\n [\n \"set\" => [\n \"description\" => \"My optional processor description\",\n \"field\" => \"my-keyword-field\",\n \"value\" => \"foo\",\n ],\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"description":"My optional pipeline description","processors":[{"set":{"description":"My optional processor description","field":"my-keyword-field","value":"foo"}}]}'' "$ELASTICSEARCH_URL/_ingest/pipeline/my-pipeline-id"' - lang: C# source: "var response = await client.Ingest\n .PutPipelineAsync(id: \"my-pipeline-id\", d1 => d1\n .Description(\"My optional pipeline description\")\n .Processors(d2 => d2\n .Set(d3 => d3\n .Description(\"My optional processor description\")\n .Field(x => x.MyKeywordField)\n .Value(\"foo\")\n )\n )\n );" - lang: Java source: "client.ingest().putPipeline(p -> p\n .description(\"My optional pipeline description\")\n .id(\"my-pipeline-id\")\n .processors(pr -> pr\n .set(s -> s\n .field(\"my-keyword-field\")\n .value(JsonData.fromJson(\"\\\"foo\\\"\"))\n .description(\"My optional processor description\")\n )\n )\n);\n" PutPipelineRequestExample2: summary: Create an ingest pipeline with metadata. description: You can use the `_meta` parameter to add arbitrary metadata to a pipeline. value: "{\n \"description\" : \"My optional pipeline description\",\n \"processors\" : [\n {\n \"set\" : {\n \"description\" : \"My optional processor description\",\n \"field\": \"my-keyword-field\",\n \"value\": \"foo\"\n }\n }\n ],\n \"_meta\": {\n \"reason\": \"set my-keyword-field to foo\",\n \"serialization\": {\n \"class\": \"MyPipeline\",\n \"id\": 10\n }\n }\n}" x-codeSamples: - lang: Console source: "PUT /_ingest/pipeline/my-pipeline-id\n{\n \"description\" : \"My optional pipeline description\",\n \"processors\" : [\n {\n \"set\" : {\n \"description\" : \"My optional processor description\",\n \"field\": \"my-keyword-field\",\n \"value\": \"foo\"\n }\n }\n ],\n \"_meta\": {\n \"reason\": \"set my-keyword-field to foo\",\n \"serialization\": {\n \"class\": \"MyPipeline\",\n \"id\": 10\n }\n }\n}" - lang: Python source: "resp = client.ingest.put_pipeline(\n id=\"my-pipeline-id\",\n description=\"My optional pipeline description\",\n processors=[\n {\n \"set\": {\n \"description\": \"My optional processor description\",\n \"field\": \"my-keyword-field\",\n \"value\": \"foo\"\n }\n }\n ],\n meta={\n \"reason\": \"set my-keyword-field to foo\",\n \"serialization\": {\n \"class\": \"MyPipeline\",\n \"id\": 10\n }\n },\n)" - lang: JavaScript source: "const response = await client.ingest.putPipeline({\n id: \"my-pipeline-id\",\n description: \"My optional pipeline description\",\n processors: [\n {\n set: {\n description: \"My optional processor description\",\n field: \"my-keyword-field\",\n value: \"foo\",\n },\n },\n ],\n _meta: {\n reason: \"set my-keyword-field to foo\",\n serialization: {\n class: \"MyPipeline\",\n id: 10,\n },\n },\n});" - lang: Ruby source: "response = client.ingest.put_pipeline(\n id: \"my-pipeline-id\",\n body: {\n \"description\": \"My optional pipeline description\",\n \"processors\": [\n {\n \"set\": {\n \"description\": \"My optional processor description\",\n \"field\": \"my-keyword-field\",\n \"value\": \"foo\"\n }\n }\n ],\n \"_meta\": {\n \"reason\": \"set my-keyword-field to foo\",\n \"serialization\": {\n \"class\": \"MyPipeline\",\n \"id\": 10\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->ingest()->putPipeline([\n \"id\" => \"my-pipeline-id\",\n \"body\" => [\n \"description\" => \"My optional pipeline description\",\n \"processors\" => array(\n [\n \"set\" => [\n \"description\" => \"My optional processor description\",\n \"field\" => \"my-keyword-field\",\n \"value\" => \"foo\",\n ],\n ],\n ),\n \"_meta\" => [\n \"reason\" => \"set my-keyword-field to foo\",\n \"serialization\" => [\n \"class\" => \"MyPipeline\",\n \"id\" => 10,\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"description":"My optional pipeline description","processors":[{"set":{"description":"My optional processor description","field":"my-keyword-field","value":"foo"}}],"_meta":{"reason":"set my-keyword-field to foo","serialization":{"class":"MyPipeline","id":10}}}'' "$ELASTICSEARCH_URL/_ingest/pipeline/my-pipeline-id"' - lang: C# source: "var response = await client.Ingest\n .PutPipelineAsync(id: \"my-pipeline-id\", d1 => d1\n .Description(\"My optional pipeline description\")\n .Meta(new Dictionary()\n {\n { \"reason\", \"set my-keyword-field to foo\" },\n { \"serialization\", JsonSerializer.Deserialize(\"\"\"\n {\n \"class\": \"MyPipeline\",\n \"id\": 10\n }\n \"\"\") }\n })\n .Processors(d2 => d2\n .Set(d3 => d3\n .Description(\"My optional processor description\")\n .Field(x => x.MyKeywordField)\n .Value(\"foo\")\n )\n )\n );" - lang: Java source: "client.ingest().putPipeline(p -> p\n .meta(Map.of(\"serialization\", JsonData.fromJson(\"\"\"\n{\"class\":\"MyPipeline\",\"id\":10}\n\"\"\"),\"reason\", JsonData.fromJson(\"\\\"set my-keyword-field to foo\\\"\")))\n .description(\"My optional pipeline description\")\n .id(\"my-pipeline-id\")\n .processors(pr -> pr\n .set(s -> s\n .field(\"my-keyword-field\")\n .value(JsonData.fromJson(\"\\\"foo\\\"\"))\n .description(\"My optional processor description\")\n )\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 5.0.0 x-codeSamples: - lang: Console source: "PUT _ingest/pipeline/my-pipeline-id\n{\n \"description\" : \"My optional pipeline description\",\n \"processors\" : [\n {\n \"set\" : {\n \"description\" : \"My optional processor description\",\n \"field\": \"my-keyword-field\",\n \"value\": \"foo\"\n }\n }\n ]\n}" - lang: Python source: "resp = client.ingest.put_pipeline(\n id=\"my-pipeline-id\",\n description=\"My optional pipeline description\",\n processors=[\n {\n \"set\": {\n \"description\": \"My optional processor description\",\n \"field\": \"my-keyword-field\",\n \"value\": \"foo\"\n }\n }\n ],\n)" - lang: JavaScript source: "const response = await client.ingest.putPipeline({\n id: \"my-pipeline-id\",\n description: \"My optional pipeline description\",\n processors: [\n {\n set: {\n description: \"My optional processor description\",\n field: \"my-keyword-field\",\n value: \"foo\",\n },\n },\n ],\n});" - lang: Ruby source: "response = client.ingest.put_pipeline(\n id: \"my-pipeline-id\",\n body: {\n \"description\": \"My optional pipeline description\",\n \"processors\": [\n {\n \"set\": {\n \"description\": \"My optional processor description\",\n \"field\": \"my-keyword-field\",\n \"value\": \"foo\"\n }\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->ingest()->putPipeline([\n \"id\" => \"my-pipeline-id\",\n \"body\" => [\n \"description\" => \"My optional pipeline description\",\n \"processors\" => array(\n [\n \"set\" => [\n \"description\" => \"My optional processor description\",\n \"field\" => \"my-keyword-field\",\n \"value\" => \"foo\",\n ],\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"description":"My optional pipeline description","processors":[{"set":{"description":"My optional processor description","field":"my-keyword-field","value":"foo"}}]}'' "$ELASTICSEARCH_URL/_ingest/pipeline/my-pipeline-id"' - lang: C# source: "var response = await client.Ingest\n .PutPipelineAsync(id: \"my-pipeline-id\", d1 => d1\n .Description(\"My optional pipeline description\")\n .Processors(d2 => d2\n .Set(d3 => d3\n .Description(\"My optional processor description\")\n .Field(x => x.MyKeywordField)\n .Value(\"foo\")\n )\n )\n );" - lang: Java source: "client.ingest().putPipeline(p -> p\n .description(\"My optional pipeline description\")\n .id(\"my-pipeline-id\")\n .processors(pr -> pr\n .set(s -> s\n .field(\"my-keyword-field\")\n .value(JsonData.fromJson(\"\\\"foo\\\"\"))\n .description(\"My optional processor description\")\n )\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - ingest summary: Delete pipelines description: "Delete one or more ingest pipelines.\n\n## Required authorization\n\n* Cluster privileges: `manage_pipeline`,`manage_ingest_pipelines`\n" externalDocs: description: About ingest pipelines url: https://www.elastic.co/docs/manage-data/ingest/transform-enrich/ingest-pipelines x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/delete-pipeline-api.html operationId: ingest-delete-pipeline parameters: - name: id in: path description: "Pipeline ID or wildcard expression of pipeline IDs used to limit the request.\nTo delete all ingest pipelines in a cluster, use a value of `*`." required: true schema: $ref: '#/components/schemas/_types.Id' - name: master_timeout in: query description: "Period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "Period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 5.0.0 x-codeSamples: - lang: Console source: "DELETE /_ingest/pipeline/my-pipeline-id\n" - lang: Python source: "resp = client.ingest.delete_pipeline(\n id=\"my-pipeline-id\",\n)" - lang: JavaScript source: "const response = await client.ingest.deletePipeline({\n id: \"my-pipeline-id\",\n});" - lang: Ruby source: "response = client.ingest.delete_pipeline(\n id: \"my-pipeline-id\"\n)" - lang: PHP source: "$resp = $client->ingest()->deletePipeline([\n \"id\" => \"my-pipeline-id\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ingest/pipeline/my-pipeline-id"' - lang: C# source: 'var response = await client.Ingest.DeletePipelineAsync(id: "my-pipeline-id");' - lang: Java source: "client.ingest().deletePipeline(d -> d\n .id(\"my-pipeline-id\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_ingest/geoip/stats: get: tags: - ingest summary: Get GeoIP statistics description: "Get download statistics for GeoIP2 databases that are used with the GeoIP processor.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" externalDocs: description: More about the GeoIP processor url: https://www.elastic.co/docs/reference/enrich-processor/geoip-processor operationId: ingest-geo-ip-stats responses: '200': description: '' content: application/json: schema: required: - stats - nodes type: object properties: stats: allOf: - $ref: '#/components/schemas/ingest.geo_ip_stats.GeoIpDownloadStatistics' description: Download statistics for all GeoIP2 databases. nodes: type: object additionalProperties: $ref: '#/components/schemas/ingest.geo_ip_stats.GeoIpNodeDatabases' description: Downloaded GeoIP2 databases for each node. x-state: Generally available; Added in 7.13.0 x-codeSamples: - lang: Console source: "GET _ingest/geoip/stats\n" - lang: Python source: resp = client.ingest.geo_ip_stats() - lang: JavaScript source: const response = await client.ingest.geoIpStats(); - lang: Ruby source: response = client.ingest.geo_ip_stats - lang: PHP source: $resp = $client->ingest()->geoIpStats(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ingest/geoip/stats"' - lang: C# source: var response = await client.Ingest.GeoIpStatsAsync(); - lang: Java source: "client.ingest().geoIpStats();\n" x-metaTags: - content: Elasticsearch name: product_name /_ingest/processor/grok: get: tags: - ingest summary: Run a grok processor description: "Extract structured fields out of a single text field within a document.\nYou must choose which field to extract matched fields from, as well as the grok pattern you expect will match.\nA grok pattern is like a regular expression that supports aliased expressions that can be reused.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" externalDocs: description: More about the Grok processor url: https://www.elastic.co/docs/reference/enrich-processor/grok-processor operationId: ingest-processor-grok responses: '200': description: '' content: application/json: schema: required: - patterns type: object properties: patterns: type: object additionalProperties: type: string x-state: Generally available; Added in 6.1.0 x-codeSamples: - lang: Console source: "GET _ingest/processor/grok\n" - lang: Python source: resp = client.ingest.processor_grok() - lang: JavaScript source: const response = await client.ingest.processorGrok(); - lang: Ruby source: response = client.ingest.processor_grok - lang: PHP source: $resp = $client->ingest()->processorGrok(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ingest/processor/grok"' - lang: C# source: var response = await client.Ingest.ProcessorGrokAsync(); - lang: Java source: "client.ingest().processorGrok();\n" x-metaTags: - content: Elasticsearch name: product_name '/_ingest/pipeline/{id}/_simulate': post: tags: - ingest summary: "Simulate a pipeline\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ingest/pipeline/_simulate\n
\n
\n POST\n /_ingest/pipeline/_simulate\n
\n
\n GET\n /_ingest/pipeline/{id}/_simulate\n
\n
\n POST\n /_ingest/pipeline/{id}/_simulate\n
\n \n\nRun an ingest pipeline against a set of provided documents.\nYou can either specify an existing pipeline to use with the provided documents or supply a pipeline definition in the body of the request.\n\n## Required authorization\n\n* Cluster privileges: `read_pipeline`\n" operationId: ingest-simulate parameters: - $ref: '#/components/parameters/ingest.simulate-id' - $ref: '#/components/parameters/ingest.simulate-verbose' requestBody: $ref: '#/components/requestBodies/ingest.simulate' responses: '200': $ref: '#/components/responses/ingest.simulate-200' x-state: Generally available; Added in 5.0.0 x-codeSamples: - lang: Console source: "POST /_ingest/pipeline/_simulate\n{\n \"pipeline\" :\n {\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\" : {\n \"field\" : \"field2\",\n \"value\" : \"_value\"\n }\n }\n ]\n },\n \"docs\": [\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n}" - lang: Python source: "resp = client.ingest.simulate(\n pipeline={\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\": {\n \"field\": \"field2\",\n \"value\": \"_value\"\n }\n }\n ]\n },\n docs=[\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ],\n)" - lang: JavaScript source: "const response = await client.ingest.simulate({\n pipeline: {\n description: \"_description\",\n processors: [\n {\n set: {\n field: \"field2\",\n value: \"_value\",\n },\n },\n ],\n },\n docs: [\n {\n _index: \"index\",\n _id: \"id\",\n _source: {\n foo: \"bar\",\n },\n },\n {\n _index: \"index\",\n _id: \"id\",\n _source: {\n foo: \"rab\",\n },\n },\n ],\n});" - lang: Ruby source: "response = client.ingest.simulate(\n body: {\n \"pipeline\": {\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\": {\n \"field\": \"field2\",\n \"value\": \"_value\"\n }\n }\n ]\n },\n \"docs\": [\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->ingest()->simulate([\n \"body\" => [\n \"pipeline\" => [\n \"description\" => \"_description\",\n \"processors\" => array(\n [\n \"set\" => [\n \"field\" => \"field2\",\n \"value\" => \"_value\",\n ],\n ],\n ),\n ],\n \"docs\" => array(\n [\n \"_index\" => \"index\",\n \"_id\" => \"id\",\n \"_source\" => [\n \"foo\" => \"bar\",\n ],\n ],\n [\n \"_index\" => \"index\",\n \"_id\" => \"id\",\n \"_source\" => [\n \"foo\" => \"rab\",\n ],\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"pipeline":{"description":"_description","processors":[{"set":{"field":"field2","value":"_value"}}]},"docs":[{"_index":"index","_id":"id","_source":{"foo":"bar"}},{"_index":"index","_id":"id","_source":{"foo":"rab"}}]}'' "$ELASTICSEARCH_URL/_ingest/pipeline/_simulate"' - lang: C# source: "var response = await client.Ingest\n .SimulateAsync(d1 => d1\n .Docs(d2 => d2\n .Id(\"id\")\n .Index(\"index\")\n .Source(JsonSerializer.Deserialize(\"\"\"\n {\n \"foo\": \"bar\"\n }\n \"\"\")), d2 => d2\n .Id(\"id\")\n .Index(\"index\")\n .Source(JsonSerializer.Deserialize(\"\"\"\n {\n \"foo\": \"rab\"\n }\n \"\"\"))\n )\n .Pipeline(d2 => d2\n .Description(\"_description\")\n .Processors(d3 => d3\n .Set(d4 => d4\n .Field(x => x.Field2)\n .Value(\"_value\")\n )\n )\n )\n );" - lang: Java source: "client.ingest().simulate(s -> s\n .docs(List.of(Document.of(d -> d\n .id(\"id\")\n .index(\"index\")\n .source(JsonData.fromJson(\"\"\"\n{\"foo\":\"bar\"}\n\"\"\"))\n ),Document.of(d -> d\n .id(\"id\")\n .index(\"index\")\n .source(JsonData.fromJson(\"\"\"\n{\"foo\":\"rab\"}\n\"\"\"))\n )))\n .pipeline(p -> p\n .description(\"_description\")\n .processors(pr -> pr\n .set(se -> se\n .field(\"field2\")\n .value(JsonData.fromJson(\"\\\"_value\\\"\"))\n )\n )\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_knn_eval': post: tags: - search summary: "Evaluate kNN search settings\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /{index}/_knn_eval\n
\n
\n POST\n /{index}/_knn_eval\n
\n \n\nEstimate the recall and cost of approximate kNN search configurations on a `dense_vector` field against a more thorough baseline.\nThe field must use the `bbq_disk` index type, and must not be inside a nested object.\n\nEach `knn_settings` entry reports the mean recall of the baseline's top `k`, not of relevance judgments, plus included and excluded query counts and cost totals.\nA query is excluded from the mean recall when the candidate finds a document scoring above the baseline's lowest top `k` score.\nA baseline returning fewer than `k` hits fails that query, because recall at `k` is undefined.\nAll configurations run against one point in time.\n\nThe default baseline uses a `visit_percentage` of 20 and a `rescore_vector.oversample` of 100.\nAn exact full-precision baseline must be requested explicitly with `allow_exact_baseline`, and is limited to 100 million vector-by-query comparisons.\n\nThe request is refused when the `search.knn_eval.enabled` cluster setting or the `index.knn_eval.enabled` index setting is `false`.\n\n## Required authorization\n\n* Index privileges: `read`,`view_index_metadata`\n" operationId: knn-eval parameters: - $ref: '#/components/parameters/knn_eval-index' - $ref: '#/components/parameters/knn_eval-ignore_unavailable' - $ref: '#/components/parameters/knn_eval-allow_no_indices' - $ref: '#/components/parameters/knn_eval-expand_wildcards' - $ref: '#/components/parameters/knn_eval-wait_for_completion' requestBody: $ref: '#/components/requestBodies/knn_eval' responses: '200': $ref: '#/components/responses/knn_eval-200' x-state: Experimental; Added in 9.6.0 x-codeSamples: - lang: Console source: "POST my-index/_knn_eval\n{\n \"field\": \"my_vector\",\n \"k\": 10,\n \"query_source\": {\n \"from\": \"docs\",\n \"size\": 100,\n \"seed\": 42\n },\n \"knn_settings\": [\n { \"visit_percentage\": 1 },\n { \"visit_percentage\": 5 }\n ]\n}" - lang: Python source: "resp = client.knn_eval(\n index=\"my-index\",\n field=\"my_vector\",\n k=10,\n query_source={\n \"from\": \"docs\",\n \"size\": 100,\n \"seed\": 42\n },\n knn_settings=[\n {\n \"visit_percentage\": 1\n },\n {\n \"visit_percentage\": 5\n }\n ],\n)" - lang: JavaScript source: "const response = await client.knnEval({\n index: \"my-index\",\n field: \"my_vector\",\n k: 10,\n query_source: {\n from: \"docs\",\n size: 100,\n seed: 42,\n },\n knn_settings: [\n {\n visit_percentage: 1,\n },\n {\n visit_percentage: 5,\n },\n ],\n});" - lang: Ruby source: "response = client.knn_eval(\n index: \"my-index\",\n body: {\n \"field\": \"my_vector\",\n \"k\": 10,\n \"query_source\": {\n \"from\": \"docs\",\n \"size\": 100,\n \"seed\": 42\n },\n \"knn_settings\": [\n {\n \"visit_percentage\": 1\n },\n {\n \"visit_percentage\": 5\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->knnEval([\n \"index\" => \"my-index\",\n \"body\" => [\n \"field\" => \"my_vector\",\n \"k\" => 10,\n \"query_source\" => [\n \"from\" => \"docs\",\n \"size\" => 100,\n \"seed\" => 42,\n ],\n \"knn_settings\" => array(\n [\n \"visit_percentage\" => 1,\n ],\n [\n \"visit_percentage\" => 5,\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"field":"my_vector","k":10,"query_source":{"from":"docs","size":100,"seed":42},"knn_settings":[{"visit_percentage":1},{"visit_percentage":5}]}'' "$ELASTICSEARCH_URL/my-index/_knn_eval"' - lang: C# source: "var response = await client\n .KnnEvalAsync(indices: new[] { \"my-index\" }, d1 => d1\n .Field(x => x.MyVector)\n .K(10)\n .KnnSettings(d2 => d2\n .VisitPercentage(1f), d2 => d2\n .VisitPercentage(5f)\n )\n .QuerySource(new KnnEvalDocsQuerySource()\n {\n Seed = 42,\n Size = 100\n })\n );" x-metaTags: - content: Elasticsearch name: product_name /_license: get: tags: - license summary: Get license information description: "Get information about your Elastic license including its type, its status, when it was issued, and when it expires.\n\n>info\n> If the master node is generating a new cluster state, the get license API may return a `404 Not Found` response.\n> If you receive an unexpected 404 response after cluster startup, wait a short period and retry the request.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: license-get parameters: - name: accept_enterprise in: query description: "If `true`, this parameter returns enterprise for Enterprise license types. If `false`, this parameter returns platinum for both platinum and enterprise license types. This behavior is maintained for backwards compatibility.\nThis parameter is deprecated and will always be set to true in 8.x." deprecated: true schema: type: boolean default: true - name: local in: query description: "Specifies whether to retrieve local information.\nFrom 9.2 onwards the default value is `true`, which means the information is retrieved from the responding node.\nIn earlier versions the default is `false`, which means the information is retrieved from the elected master node." schema: type: boolean default: true responses: '200': description: '' content: application/json: schema: required: - license type: object properties: license: allOf: - $ref: '#/components/schemas/license.get.LicenseInformation' examples: GetLicenseResponseExample1: description: A successful response from `GET /_license`. value: "{\n \"license\" : {\n \"status\" : \"active\",\n \"uid\" : \"cbff45e7-c553-41f7-ae4f-9205eabd80xx\",\n \"type\" : \"trial\",\n \"issue_date\" : \"2018-10-20T22:05:12.332Z\",\n \"issue_date_in_millis\" : 1540073112332,\n \"expiry_date\" : \"2018-11-19T22:05:12.332Z\",\n \"expiry_date_in_millis\" : 1542665112332,\n \"max_nodes\" : 1000,\n \"max_resource_units\" : null,\n \"issued_to\" : \"test\",\n \"issuer\" : \"elasticsearch\",\n \"start_date_in_millis\" : -1\n }\n}" x-state: Generally available x-codeSamples: - lang: Console source: "GET /_license\n" - lang: Python source: resp = client.license.get() - lang: JavaScript source: const response = await client.license.get(); - lang: Ruby source: response = client.license.get - lang: PHP source: $resp = $client->license()->get(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_license"' - lang: C# source: var response = await client.LicenseManagement.GetAsync(); - lang: Java source: "client.license().get(g -> g);\n" x-metaTags: - content: Elasticsearch name: product_name post: tags: - license summary: "Update the license\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_license\n
\n
\n POST\n /_license\n
\n \n\nYou can update your license at runtime without shutting down your nodes.\nLicense updates take effect immediately.\nIf the license you are installing does not support all of the features that were available with your previous license, however, you are notified in the response.\nYou must then re-submit the API request with the acknowledge parameter set to true.\n\nNOTE: If Elasticsearch security features are enabled and you are installing a gold or higher license, you must enable TLS on the transport networking layer before you install the license.\nIf the operator privileges feature is enabled, only operator users can use this API.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: license-post parameters: - $ref: '#/components/parameters/license.post-acknowledge' - $ref: '#/components/parameters/license.post-master_timeout' - $ref: '#/components/parameters/license.post-timeout' requestBody: $ref: '#/components/requestBodies/license.post' responses: '200': $ref: '#/components/responses/license.post-200' x-state: Generally available x-codeSamples: - lang: Console source: "PUT _license\n{\n \"licenses\": [\n {\n \"uid\":\"893361dc-9749-4997-93cb-802e3d7fa4xx\",\n \"type\":\"basic\",\n \"issue_date_in_millis\":1411948800000,\n \"expiry_date_in_millis\":1914278399999,\n \"max_nodes\":1,\n \"issued_to\":\"issuedTo\",\n \"issuer\":\"issuer\",\n \"signature\":\"xx\"\n }\n ]\n}" - lang: Python source: "resp = client.license.post(\n licenses=[\n {\n \"uid\": \"893361dc-9749-4997-93cb-802e3d7fa4xx\",\n \"type\": \"basic\",\n \"issue_date_in_millis\": 1411948800000,\n \"expiry_date_in_millis\": 1914278399999,\n \"max_nodes\": 1,\n \"issued_to\": \"issuedTo\",\n \"issuer\": \"issuer\",\n \"signature\": \"xx\"\n }\n ],\n)" - lang: JavaScript source: "const response = await client.license.post({\n licenses: [\n {\n uid: \"893361dc-9749-4997-93cb-802e3d7fa4xx\",\n type: \"basic\",\n issue_date_in_millis: 1411948800000,\n expiry_date_in_millis: 1914278399999,\n max_nodes: 1,\n issued_to: \"issuedTo\",\n issuer: \"issuer\",\n signature: \"xx\",\n },\n ],\n});" - lang: Ruby source: "response = client.license.post(\n body: {\n \"licenses\": [\n {\n \"uid\": \"893361dc-9749-4997-93cb-802e3d7fa4xx\",\n \"type\": \"basic\",\n \"issue_date_in_millis\": 1411948800000,\n \"expiry_date_in_millis\": 1914278399999,\n \"max_nodes\": 1,\n \"issued_to\": \"issuedTo\",\n \"issuer\": \"issuer\",\n \"signature\": \"xx\"\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->license()->post([\n \"body\" => [\n \"licenses\" => array(\n [\n \"uid\" => \"893361dc-9749-4997-93cb-802e3d7fa4xx\",\n \"type\" => \"basic\",\n \"issue_date_in_millis\" => 1411948800000,\n \"expiry_date_in_millis\" => 1914278399999,\n \"max_nodes\" => 1,\n \"issued_to\" => \"issuedTo\",\n \"issuer\" => \"issuer\",\n \"signature\" => \"xx\",\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"licenses":[{"uid":"893361dc-9749-4997-93cb-802e3d7fa4xx","type":"basic","issue_date_in_millis":1411948800000,"expiry_date_in_millis":1914278399999,"max_nodes":1,"issued_to":"issuedTo","issuer":"issuer","signature":"xx"}]}'' "$ELASTICSEARCH_URL/_license"' - lang: C# source: "var response = await client.LicenseManagement\n .PostAsync(d1 => d1\n .Licenses(d2 => d2\n .ExpiryDateInMillis(DateTimeOffset.Parse(\"2030-08-29T23:59:59.9990000+00:00\", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind))\n .IssueDateInMillis(DateTimeOffset.Parse(\"2014-09-29T00:00:00.0000000+00:00\", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind))\n .IssuedTo(\"issuedTo\")\n .Issuer(\"issuer\")\n .MaxNodes(1L)\n .Signature(\"xx\")\n .Type(LicenseType.Basic)\n .Uid(\"893361dc-9749-4997-93cb-802e3d7fa4xx\")\n )\n );" - lang: Java source: "client.license().post(p -> p\n .licenses(l -> l\n .expiryDateInMillis(1914278399999L)\n .issueDateInMillis(1411948800000L)\n .issuedTo(\"issuedTo\")\n .issuer(\"issuer\")\n .maxNodes(1L)\n .signature(\"xx\")\n .type(LicenseType.Basic)\n .uid(\"893361dc-9749-4997-93cb-802e3d7fa4xx\")\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - license summary: Delete the license description: "When the license expires, your subscription level reverts to Basic.\n\nIf the operator privileges feature is enabled, only operator users can use this API.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" externalDocs: description: About managing your license url: https://www.elastic.co/docs/deploy-manage/license/manage-your-license-in-self-managed-cluster x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/delete-license.html operationId: license-delete parameters: - name: master_timeout in: query description: The period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: 'The period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available x-codeSamples: - lang: Console source: "DELETE /_license\n" - lang: Python source: resp = client.license.delete() - lang: JavaScript source: const response = await client.license.delete(); - lang: Ruby source: response = client.license.delete - lang: PHP source: $resp = $client->license()->delete(); - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_license"' - lang: C# source: var response = await client.LicenseManagement.DeleteAsync(); - lang: Java source: "client.license().delete(d -> d);\n" x-metaTags: - content: Elasticsearch name: product_name /_license/basic_status: get: tags: - license summary: Get the basic license status description: "\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: license-get-basic-status responses: '200': description: '' content: application/json: schema: required: - eligible_to_start_basic type: object properties: eligible_to_start_basic: type: boolean examples: GetBasicLicenseStatusResponseExample1: description: A successful response from `GET /_license/basic_status`. value: "{\n \"eligible_to_start_basic\": true\n}" x-state: Generally available; Added in 6.3.0 x-codeSamples: - lang: Console source: "GET /_license/basic_status\n" - lang: Python source: resp = client.license.get_basic_status() - lang: JavaScript source: const response = await client.license.getBasicStatus(); - lang: Ruby source: response = client.license.get_basic_status - lang: PHP source: $resp = $client->license()->getBasicStatus(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_license/basic_status"' - lang: C# source: var response = await client.LicenseManagement.GetBasicStatusAsync(); - lang: Java source: "client.license().getBasicStatus();\n" x-metaTags: - content: Elasticsearch name: product_name /_license/trial_status: get: tags: - license summary: Get the trial status description: "\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: license-get-trial-status responses: '200': description: '' content: application/json: schema: required: - eligible_to_start_trial type: object properties: eligible_to_start_trial: type: boolean examples: GetTrialLicenseStatusResponseExample1: description: A successful response from `GET /_license/trial_status`. value: "{\n \"eligible_to_start_trial\": true\n}" x-state: Generally available; Added in 6.1.0 x-codeSamples: - lang: Console source: "GET /_license/trial_status\n" - lang: Python source: resp = client.license.get_trial_status() - lang: JavaScript source: const response = await client.license.getTrialStatus(); - lang: Ruby source: response = client.license.get_trial_status - lang: PHP source: $resp = $client->license()->getTrialStatus(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_license/trial_status"' - lang: C# source: var response = await client.LicenseManagement.GetTrialStatusAsync(); - lang: Java source: "client.license().getTrialStatus();\n" x-metaTags: - content: Elasticsearch name: product_name /_license/start_basic: post: tags: - license summary: Start a basic license description: "Start an indefinite basic license, which gives access to all the basic features.\n\nNOTE: In order to start a basic license, you must not currently have a basic license.\n\nIf the basic license does not support all of the features that are available with your current license, however, you are notified in the response.\nYou must then re-submit the API request with the `acknowledge` parameter set to `true`.\n\nTo check the status of your basic license, use the get basic license API.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: license-post-start-basic parameters: - name: acknowledge in: query description: 'To start a basic license, you must accept the acknowledge messages and set this parameter to `true`.' schema: type: boolean default: false - name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: 'Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - acknowledged - basic_was_started type: object properties: acknowledged: type: boolean basic_was_started: type: boolean error_message: type: string type: allOf: - $ref: '#/components/schemas/license._types.LicenseType' acknowledge: type: object additionalProperties: oneOf: - type: string - type: array items: type: string examples: StartBasicLicenseResponseExample1: description: 'A successful response from `POST /_license/start_basic?acknowledge=true`. If you currently have a license with more features than a basic license and you start a basic license, you must pass the acknowledge parameter.' value: "{\n \"basic_was_started\": true,\n \"acknowledged\": true\n}" x-state: Generally available; Added in 6.3.0 x-codeSamples: - lang: Console source: "POST /_license/start_basic?acknowledge=true\n" - lang: Python source: "resp = client.license.post_start_basic(\n acknowledge=True,\n)" - lang: JavaScript source: "const response = await client.license.postStartBasic({\n acknowledge: \"true\",\n});" - lang: Ruby source: "response = client.license.post_start_basic(\n acknowledge: \"true\"\n)" - lang: PHP source: "$resp = $client->license()->postStartBasic([\n \"acknowledge\" => \"true\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_license/start_basic?acknowledge=true"' - lang: C# source: "var response = await client.LicenseManagement\n .PostStartBasicAsync(d1 => d1\n .Acknowledge(true)\n );" - lang: Java source: "client.license().postStartBasic(p -> p\n .acknowledge(true)\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_license/start_trial: post: tags: - license summary: Start a trial description: "Start a 30-day trial, which gives access to all subscription features.\n\nNOTE: You are allowed to start a trial only if your cluster has not already activated a trial for the current major product version.\nFor example, if you have already activated a trial for v8.0, you cannot start a new trial until v9.0. You can, however, request an extended trial at https://www.elastic.co/trialextension.\n\nTo check the status of your trial, use the get trial status API.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: license-post-start-trial parameters: - name: acknowledge in: query description: 'To start a trial, you must accept the acknowledge messages and set this parameter to `true`.' schema: type: boolean default: false - name: type in: query description: The type of trial license to generate schema: type: string default: trial - name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - acknowledged - trial_was_started type: object properties: acknowledged: type: boolean error_message: type: string trial_was_started: type: boolean type: allOf: - $ref: '#/components/schemas/license._types.LicenseType' examples: StartTrialLicenseResponseExample1: description: A successful response from `POST /_license/start_trial?acknowledge=true`. value: "{\n \"trial_was_started\": true,\n \"acknowledged\": true\n}" x-state: Generally available; Added in 6.1.0 x-codeSamples: - lang: Console source: "POST /_license/start_trial?acknowledge=true\n" - lang: Python source: "resp = client.license.post_start_trial(\n acknowledge=True,\n)" - lang: JavaScript source: "const response = await client.license.postStartTrial({\n acknowledge: \"true\",\n});" - lang: Ruby source: "response = client.license.post_start_trial(\n acknowledge: \"true\"\n)" - lang: PHP source: "$resp = $client->license()->postStartTrial([\n \"acknowledge\" => \"true\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_license/start_trial?acknowledge=true"' - lang: C# source: "var response = await client.LicenseManagement\n .PostStartTrialAsync(d1 => d1\n .Acknowledge(true)\n );" - lang: Java source: "client.license().postStartTrial(p -> p\n .acknowledge(true)\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_reindex: get: tags: - reindex summary: Get information about all currently running reindex tasks description: "Reindex tasks that are mid-relocation between nodes are reported once,\nunder their original task ID, so callers do not see duplicates across the relocation chain.\n\nIf the API returns a HTTP status of `200 OK`, but `node_failures` or `task_failures` are non-empty in the body, the listing is not a complete authoritative listing and may be missing tasks.\n\n## Required authorization\n\n* Cluster privileges: `monitor`,`monitor_reindex`,`manage_reindex`\n" operationId: list-reindex parameters: - name: detailed in: query description: 'If `true`, include detailed task status information in the response.' schema: type: boolean default: false responses: '200': description: '' content: application/json: schema: required: - reindex type: object properties: reindex: type: array items: $ref: '#/components/schemas/_types.ReindexTaskInfo' description: The list of currently running reindex tasks. task_failures: type: array items: $ref: '#/components/schemas/_types.TaskFailure' description: Per-task failures encountered while listing reindex tasks. Tasks that failed are not included in the `reindex` array. node_failures: type: array items: $ref: '#/components/schemas/_types.ErrorCause' description: "Node-level failures encountered while listing reindex tasks.\nTypically populated when a node disconnects or stops responding mid-request,\nreindex tasks running on such nodes will be missing from the `reindex` array for the duration of the disruption." examples: ListReindexResponseExample1: summary: One running task description: A successful response from `GET _reindex` listing a single currently running reindex task. value: "{\n \"reindex\": [\n {\n \"id\": \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n \"start_time_in_millis\": 1762190000000,\n \"running_time_in_nanos\": 4200000000,\n \"cancelled\": false\n }\n ]\n}" ListReindexResponseExample2: summary: One running task with detailed status description: "A successful response from `GET _reindex?detailed=true&human=true`, including the per-task `status` block.\n" value: "{\n \"reindex\": [\n {\n \"id\": \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n \"description\": \"reindex from [my-source-index] to [my-dest-index]\",\n \"start_time_in_millis\": 1762190000000,\n \"start_time\": \"2025-11-03T17:13:20.000Z\",\n \"running_time_in_nanos\": 4200000000,\n \"running_time\": \"4.2s\",\n \"cancelled\": false,\n \"status\": {\n \"batches\": 4,\n \"deleted\": 0,\n \"noops\": 0,\n \"requests_per_second\": -1.0,\n \"retries\": {\n \"bulk\": 0,\n \"search\": 0\n },\n \"throttled_millis\": 0,\n \"throttled_until_millis\": 0,\n \"total\": 11500,\n \"updated\": 0,\n \"version_conflicts\": 0,\n \"created\": 4000\n }\n }\n ]\n}" ListReindexResponseNodeFailureExample1: summary: Partial list with node failure (HTTP 200) description: "`GET _reindex` always returns `200 OK`. If a node stops responding during the listing call, `node_failures` may be populated and tasks that were running on that node can be missing from `reindex` for that response. You may retry.\n" value: "{\n \"reindex\": [\n {\n \"id\": \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n \"start_time_in_millis\": 1762190000000,\n \"running_time_in_nanos\": 4200000000,\n \"cancelled\": false\n }\n ],\n \"node_failures\": [\n {\n \"type\": \"failed_node_exception\",\n \"reason\": \"Failed node [xNqz7mM2RkqY8vP1nL0wQ]\",\n \"node_id\": \"xNqz7mM2RkqY8vP1nL0wQ\",\n \"caused_by\": {\n \"type\": \"node_not_connected_exception\",\n \"reason\": \"Node not connected\",\n \"node_id\": \"xNqz7mM2RkqY8vP1nL0wQ\"\n }\n }\n ]\n}" x-state: Generally available; Added in 9.5.0 x-codeSamples: - lang: Console source: "GET _reindex\n" - lang: Python source: resp = client.list_reindex() - lang: JavaScript source: const response = await client.listReindex(); - lang: Ruby source: response = client.list_reindex - lang: PHP source: $resp = $client->listReindex(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_reindex"' - lang: C# source: var response = await client.ListReindexAsync(); - lang: Java source: "client.listReindex(l -> l);\n" x-metaTags: - content: Elasticsearch name: product_name post: tags: - document summary: Reindex documents description: "Copy documents from a source to a destination.\nYou can copy all documents to the destination index or reindex a subset of the documents.\nThe source can be any existing index, alias, or data stream.\nThe destination must differ from the source.\nFor example, you cannot reindex a data stream into itself.\n\nIMPORTANT: Reindex requires `_source` to be enabled for all documents in the source.\nThe destination should be configured as wanted before calling the reindex API.\nReindex does not copy the settings from the source or its associated template.\nMappings, shard counts, and replicas, for example, must be configured ahead of time.\n\nIf the Elasticsearch security features are enabled, you must have the following security privileges:\n\n* The `read` index privilege for the source data stream, index, or alias.\n* The `write` index privilege for the destination data stream, index, or index alias.\n* To automatically create a data stream or index with a reindex API request, you must have the `auto_configure`, `create_index`, or `manage` index privilege for the destination data stream, index, or alias.\n* If reindexing from a remote cluster, the `source.remote.user` must have the `monitor` cluster privilege and the `read` index privilege for the source data stream, index, or alias.\n\nIf reindexing from a remote cluster into a cluster using Elastic Stack, you must explicitly allow the remote host using the `reindex.remote.whitelist` node setting on the destination cluster.\nIf reindexing from a remote cluster into an Elastic Cloud Serverless project, only remote hosts from [Elastic Cloud Hosted and Elastic Cloud Serverless](https://cloud.elastic.co/registration?page=docs&placement=docs-body) are allowed.\nAutomatic data stream creation requires a matching index template with data stream enabled.\n\nThe `dest` element can be configured like the index API to control optimistic concurrency control.\nOmitting `version_type` or setting it to `internal` causes Elasticsearch to blindly dump documents into the destination, overwriting any that happen to have the same ID.\n\nSetting `version_type` to `external` causes Elasticsearch to preserve the `version` from the source, create any documents that are missing, and update any documents that have an older version in the destination than they do in the source.\n\nSetting `op_type` to `create` causes the reindex API to create only missing documents in the destination.\nAll existing documents will cause a version conflict.\n\nIMPORTANT: Because data streams are append-only, any reindex request to a destination data stream must have an `op_type` of `create`.\nA reindex can only add new documents to a destination data stream.\nIt cannot update existing documents in a destination data stream.\n\nBy default, version conflicts abort the reindex process.\nTo continue reindexing if there are conflicts, set the `conflicts` request body property to `proceed`.\nIn this case, the response includes a count of the version conflicts that were encountered.\nNote that the handling of other error types is unaffected by the `conflicts` property.\nAdditionally, if you opt to count version conflicts, the operation could attempt to reindex more documents from the source than `max_docs` until it has successfully indexed `max_docs` documents into the target or it has gone through every document in the source query.\n\nIt's recommended to reindex on indices with a green status. Reindexing can fail when a node shuts down or crashes.\n* When requested with `wait_for_completion=true` (default), the request fails if the node shuts down.\n* When requested with `wait_for_completion=false`, a task id is returned, for use with the task management APIs. The task may disappear or fail if the node shuts down.\nWhen retrying a failed reindex operation, it might be necessary to set `conflicts=proceed` or to first delete the partial destination index.\nAdditionally, dry runs, checking disk space, and fetching index recovery information can help address the root cause.\n\nRefer to the linked documentation for examples of how to reindex documents.\n\n## Required authorization\n\n* Index privileges: `read`,`write`\n" externalDocs: description: About reindexing indices examples url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/reindex-indices x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/docs-reindex.html operationId: reindex parameters: - name: refresh in: query description: 'If `true`, the request refreshes affected shards to make this operation visible to search.' schema: type: boolean default: false - name: requests_per_second in: query description: "The maximum number of documents to index per second, across the entire reindex operation (including slices).\nIt can be either `-1` to turn off throttling or any decimal number like `1.7` or `12` to throttle to that level." schema: type: number default: -1 - name: scroll in: query description: "The period of time that a consistent view of the index should be maintained for scrolled search.\nIn serverless, and stack versions >= v9.5.0, we use PIT rather than scroll for pagination.\nWe only use scroll for reindexing from remote clusters that are older than v7.10.0.\nTherefore, this parameter is ignored unless you are reindexing from a remote cluster that is older than v7.10.0." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 5m - name: slices in: query description: "The number of slices this task should be divided into.\nIt defaults to one slice, which means the task isn't sliced into subtasks.\n\nReindex supports sliced scroll to parallelize the reindexing process.\nThis parallelization can improve efficiency and provide a convenient way to break the request down into smaller parts.\n\nNOTE: Reindexing from remote clusters does not support manual or automatic slicing.\n\nIf set to `auto`, Elasticsearch chooses the number of slices to use.\nThis setting will use one slice per shard, up to a certain limit.\nIf there are multiple sources, it will choose the number of slices based on the index or backing index with the smallest number of shards." schema: allOf: - $ref: '#/components/schemas/_types.Slices' default: '1' - name: max_docs in: query description: "The maximum number of documents to reindex.\nBy default, all documents are reindexed.\nIf it is a value less then or equal to `scroll_size`, a scroll will not be used to retrieve the results for the operation.\n\nIf `conflicts` is set to `proceed`, the reindex operation could attempt to reindex more documents from the source than `max_docs` until it has successfully indexed `max_docs` documents into the target or it has gone through every document in the source query.\n\nIf `slices` is set, the `max_docs` limit is split evenly across the slices.\nIf the number of documents in the source is equal to or slightly more than `max_docs`, this could result in slightly fewer than `max_docs` documents being reindexed, due to skew in the slicing." schema: type: number - name: timeout in: query description: "The period each indexing waits for automatic index creation, dynamic mapping updates, and waiting for active shards.\nBy default, Elasticsearch waits for at least one minute before failing.\nThe actual wait time could be longer, particularly when multiple waits occur." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 1m - name: wait_for_active_shards in: query description: "The number of shard copies that must be active before proceeding with the operation.\nSet it to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`).\nThe default value is one, which means it waits for each primary shard to be active." schema: allOf: - $ref: '#/components/schemas/_types.WaitForActiveShards' default: '1' - name: wait_for_completion in: query description: "If `true`, the request blocks until the operation is complete. If your requested reindex operation is complex or time-consuming,\nit might timeout due to transport-layer limitations. While the reindex will continue to be processed by the cluster, your\nclient will not receive updates on status automatically after timeout. Set this option `true` if you anticipate a long-running reindex." schema: type: boolean default: true - name: require_alias in: query description: 'If `true`, the destination must be an index alias.' schema: type: boolean default: false requestBody: content: application/json: schema: required: - dest - source type: object properties: conflicts: allOf: - $ref: '#/components/schemas/_types.Conflicts' description: "Indicates whether to continue reindexing even when there are conflicts.\n\nSupported values include:\n - `abort`: Stop reindexing if there are conflicts.\n - `proceed`: Continue reindexing even if there are conflicts.\n\n" default: abort dest: allOf: - $ref: '#/components/schemas/_global.reindex.Destination' description: The destination you are copying to. max_docs: type: number description: "The maximum number of documents to reindex.\nBy default, all documents are reindexed.\nIf it is a value less then or equal to `scroll_size`, a scroll will not be used to retrieve the results for the operation.\n\nIf `conflicts` is set to `proceed`, the reindex operation could attempt to reindex more documents from the source than `max_docs` until it has successfully indexed `max_docs` documents into the target or it has gone through every document in the source query." script: allOf: - $ref: '#/components/schemas/_types.Script' description: The script to run to update the document source or metadata when reindexing. source: allOf: - $ref: '#/components/schemas/_global.reindex.Source' description: The source you are copying from. examples: ReindexRequestExample1: summary: Reindex multiple sources description: "Run `POST _reindex` to reindex from multiple sources. The `index` attribute in source can be a list, which enables you to copy from lots of sources in one request. This example copies documents from the `my-index-000001` and `my-index-000002` indices.\n" value: "{\n \"source\": {\n \"index\": [\"my-index-000001\", \"my-index-000002\"]\n },\n \"dest\": {\n \"index\": \"my-new-index-000002\"\n }\n}" x-codeSamples: - lang: Console source: "POST _reindex\n{\n \"source\": {\n \"index\": [\"my-index-000001\", \"my-index-000002\"]\n },\n \"dest\": {\n \"index\": \"my-new-index-000002\"\n }\n}" - lang: Python source: "resp = client.reindex(\n source={\n \"index\": [\n \"my-index-000001\",\n \"my-index-000002\"\n ]\n },\n dest={\n \"index\": \"my-new-index-000002\"\n },\n)" - lang: JavaScript source: "const response = await client.reindex({\n source: {\n index: [\"my-index-000001\", \"my-index-000002\"],\n },\n dest: {\n index: \"my-new-index-000002\",\n },\n});" - lang: Ruby source: "response = client.reindex(\n body: {\n \"source\": {\n \"index\": [\n \"my-index-000001\",\n \"my-index-000002\"\n ]\n },\n \"dest\": {\n \"index\": \"my-new-index-000002\"\n }\n }\n)" - lang: PHP source: "$resp = $client->reindex([\n \"body\" => [\n \"source\" => [\n \"index\" => array(\n \"my-index-000001\",\n \"my-index-000002\",\n ),\n ],\n \"dest\" => [\n \"index\" => \"my-new-index-000002\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"index":["my-index-000001","my-index-000002"]},"dest":{"index":"my-new-index-000002"}}'' "$ELASTICSEARCH_URL/_reindex"' - lang: C# source: "var response = await client\n .ReindexAsync(d1 => d1\n .Dest(d2 => d2\n .Index(\"my-new-index-000002\")\n )\n .Source(d2 => d2\n .Indices(new[] { \"my-index-000001\", \"my-index-000002\" })\n )\n );" - lang: Java source: "client.reindex(r -> r\n .dest(d -> d\n .index(\"my-new-index-000002\")\n )\n .source(s -> s\n .index(List.of(\"my-index-000001\",\"my-index-000002\"))\n )\n);\n" ReindexRequestExample10: summary: Reindex with Painless description: "You can use Painless to reindex daily indices to apply a new template to the existing documents. The script extracts the date from the index name and creates a new index with `-1` appended. For example, all data from `metricbeat-2016.05.31` will be reindexed into `metricbeat-2016.05.31-1`.\n" value: "{\n \"source\": {\n \"index\": \"metricbeat-*\"\n },\n \"dest\": {\n \"index\": \"metricbeat\"\n },\n \"script\": {\n \"lang\": \"painless\",\n \"source\": \"ctx._index = 'metricbeat-' + (ctx._index.substring('metricbeat-'.length(), ctx._index.length())) + '-1'\"\n }\n}" x-codeSamples: - lang: Console source: "POST _reindex\n{\n \"source\": {\n \"index\": \"metricbeat-*\"\n },\n \"dest\": {\n \"index\": \"metricbeat\"\n },\n \"script\": {\n \"lang\": \"painless\",\n \"source\": \"ctx._index = 'metricbeat-' + (ctx._index.substring('metricbeat-'.length(), ctx._index.length())) + '-1'\"\n }\n}" - lang: Python source: "resp = client.reindex(\n source={\n \"index\": \"metricbeat-*\"\n },\n dest={\n \"index\": \"metricbeat\"\n },\n script={\n \"lang\": \"painless\",\n \"source\": \"ctx._index = 'metricbeat-' + (ctx._index.substring('metricbeat-'.length(), ctx._index.length())) + '-1'\"\n },\n)" - lang: JavaScript source: "const response = await client.reindex({\n source: {\n index: \"metricbeat-*\",\n },\n dest: {\n index: \"metricbeat\",\n },\n script: {\n lang: \"painless\",\n source:\n \"ctx._index = 'metricbeat-' + (ctx._index.substring('metricbeat-'.length(), ctx._index.length())) + '-1'\",\n },\n});" - lang: Ruby source: "response = client.reindex(\n body: {\n \"source\": {\n \"index\": \"metricbeat-*\"\n },\n \"dest\": {\n \"index\": \"metricbeat\"\n },\n \"script\": {\n \"lang\": \"painless\",\n \"source\": \"ctx._index = 'metricbeat-' + (ctx._index.substring('metricbeat-'.length(), ctx._index.length())) + '-1'\"\n }\n }\n)" - lang: PHP source: "$resp = $client->reindex([\n \"body\" => [\n \"source\" => [\n \"index\" => \"metricbeat-*\",\n ],\n \"dest\" => [\n \"index\" => \"metricbeat\",\n ],\n \"script\" => [\n \"lang\" => \"painless\",\n \"source\" => \"ctx._index = 'metricbeat-' + (ctx._index.substring('metricbeat-'.length(), ctx._index.length())) + '-1'\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"index":"metricbeat-*"},"dest":{"index":"metricbeat"},"script":{"lang":"painless","source":"ctx._index = ''"''"''metricbeat-''"''"'' + (ctx._index.substring(''"''"''metricbeat-''"''"''.length(), ctx._index.length())) + ''"''"''-1''"''"''"}}'' "$ELASTICSEARCH_URL/_reindex"' - lang: C# source: "var response = await client\n .ReindexAsync(d1 => d1\n .Dest(d2 => d2\n .Index(\"metricbeat\")\n )\n .Script(d2 => d2\n .Lang(ScriptLanguage.Painless)\n .Source(\"ctx._index = 'metricbeat-' + (ctx._index.substring('metricbeat-'.length(), ctx._index.length())) + '-1'\")\n )\n .Source(d2 => d2\n .Indices(new[] { \"metricbeat-*\" })\n )\n );" - lang: Java source: "client.reindex(r -> r\n .dest(d -> d\n .index(\"metricbeat\")\n )\n .script(s -> s\n .source(so -> so\n .scriptString(\"ctx._index = 'metricbeat-' + (ctx._index.substring('metricbeat-'.length(), ctx._index.length())) + '-1'\")\n )\n .lang(\"painless\")\n )\n .source(so -> so\n .index(\"metricbeat-*\")\n )\n);\n" ReindexRequestExample11: summary: Reindex a random subset description: "Run `POST _reindex` to extract a random subset of the source for testing. You might need to adjust the `min_score` value depending on the relative amount of data extracted from source.\n" value: "{\n \"max_docs\": 10,\n \"source\": {\n \"index\": \"my-index-000001\",\n \"query\": {\n \"function_score\" : {\n \"random_score\" : {},\n \"min_score\" : 0.9\n }\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" x-codeSamples: - lang: Console source: "POST _reindex\n{\n \"max_docs\": 10,\n \"source\": {\n \"index\": \"my-index-000001\",\n \"query\": {\n \"function_score\" : {\n \"random_score\" : {},\n \"min_score\" : 0.9\n }\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - lang: Python source: "resp = client.reindex(\n max_docs=10,\n source={\n \"index\": \"my-index-000001\",\n \"query\": {\n \"function_score\": {\n \"random_score\": {},\n \"min_score\": 0.9\n }\n }\n },\n dest={\n \"index\": \"my-new-index-000001\"\n },\n)" - lang: JavaScript source: "const response = await client.reindex({\n max_docs: 10,\n source: {\n index: \"my-index-000001\",\n query: {\n function_score: {\n random_score: {},\n min_score: 0.9,\n },\n },\n },\n dest: {\n index: \"my-new-index-000001\",\n },\n});" - lang: Ruby source: "response = client.reindex(\n body: {\n \"max_docs\": 10,\n \"source\": {\n \"index\": \"my-index-000001\",\n \"query\": {\n \"function_score\": {\n \"random_score\": {},\n \"min_score\": 0.9\n }\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n }\n)" - lang: PHP source: "$resp = $client->reindex([\n \"body\" => [\n \"max_docs\" => 10,\n \"source\" => [\n \"index\" => \"my-index-000001\",\n \"query\" => [\n \"function_score\" => [\n \"random_score\" => new ArrayObject([]),\n \"min_score\" => 0.9,\n ],\n ],\n ],\n \"dest\" => [\n \"index\" => \"my-new-index-000001\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"max_docs":10,"source":{"index":"my-index-000001","query":{"function_score":{"random_score":{},"min_score":0.9}}},"dest":{"index":"my-new-index-000001"}}'' "$ELASTICSEARCH_URL/_reindex"' - lang: C# source: "var response = await client\n .ReindexAsync(d1 => d1\n .Dest(d2 => d2\n .Index(\"my-new-index-000001\")\n )\n .MaxDocs(10L)\n .Source(d2 => d2\n .Indices(new[] { \"my-index-000001\" })\n .Query(d3 => d3\n .FunctionScore(d4 => d4\n .MinScore(0.9d)\n )\n )\n )\n );" - lang: Java source: "client.reindex(r -> r\n .dest(d -> d\n .index(\"my-new-index-000001\")\n )\n .maxDocs(10L)\n .source(s -> s\n .index(\"my-index-000001\")\n .query(q -> q\n .functionScore(f -> f\n .minScore(0.9D)\n )\n )\n )\n);\n" ReindexRequestExample12: summary: Reindex modified documents description: "Run `POST _reindex` to modify documents during reindexing. This example bumps the version of the source document.\n" value: "{\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\",\n \"version_type\": \"external\"\n },\n \"script\": {\n \"source\": \"if (ctx._source.foo == 'bar') {ctx._version++; ctx._source.remove('foo')}\",\n \"lang\": \"painless\"\n }\n}" x-codeSamples: - lang: Console source: "POST _reindex\n{\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\",\n \"version_type\": \"external\"\n },\n \"script\": {\n \"source\": \"if (ctx._source.foo == 'bar') {ctx._version++; ctx._source.remove('foo')}\",\n \"lang\": \"painless\"\n }\n}" - lang: Python source: "resp = client.reindex(\n source={\n \"index\": \"my-index-000001\"\n },\n dest={\n \"index\": \"my-new-index-000001\",\n \"version_type\": \"external\"\n },\n script={\n \"source\": \"if (ctx._source.foo == 'bar') {ctx._version++; ctx._source.remove('foo')}\",\n \"lang\": \"painless\"\n },\n)" - lang: JavaScript source: "const response = await client.reindex({\n source: {\n index: \"my-index-000001\",\n },\n dest: {\n index: \"my-new-index-000001\",\n version_type: \"external\",\n },\n script: {\n source:\n \"if (ctx._source.foo == 'bar') {ctx._version++; ctx._source.remove('foo')}\",\n lang: \"painless\",\n },\n});" - lang: Ruby source: "response = client.reindex(\n body: {\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\",\n \"version_type\": \"external\"\n },\n \"script\": {\n \"source\": \"if (ctx._source.foo == 'bar') {ctx._version++; ctx._source.remove('foo')}\",\n \"lang\": \"painless\"\n }\n }\n)" - lang: PHP source: "$resp = $client->reindex([\n \"body\" => [\n \"source\" => [\n \"index\" => \"my-index-000001\",\n ],\n \"dest\" => [\n \"index\" => \"my-new-index-000001\",\n \"version_type\" => \"external\",\n ],\n \"script\" => [\n \"source\" => \"if (ctx._source.foo == 'bar') {ctx._version++; ctx._source.remove('foo')}\",\n \"lang\" => \"painless\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"index":"my-index-000001"},"dest":{"index":"my-new-index-000001","version_type":"external"},"script":{"source":"if (ctx._source.foo == ''"''"''bar''"''"'') {ctx._version++; ctx._source.remove(''"''"''foo''"''"'')}","lang":"painless"}}'' "$ELASTICSEARCH_URL/_reindex"' - lang: C# source: "var response = await client\n .ReindexAsync(d1 => d1\n .Dest(d2 => d2\n .Index(\"my-new-index-000001\")\n .VersionType(VersionType.External)\n )\n .Script(d2 => d2\n .Lang(ScriptLanguage.Painless)\n .Source(\"if (ctx._source.foo == 'bar') {ctx._version++; ctx._source.remove('foo')}\")\n )\n .Source(d2 => d2\n .Indices(new[] { \"my-index-000001\" })\n )\n );" - lang: Java source: "client.reindex(r -> r\n .dest(d -> d\n .index(\"my-new-index-000001\")\n .versionType(VersionType.External)\n )\n .script(s -> s\n .source(so -> so\n .scriptString(\"if (ctx._source.foo == 'bar') {ctx._version++; ctx._source.remove('foo')}\")\n )\n .lang(\"painless\")\n )\n .source(so -> so\n .index(\"my-index-000001\")\n )\n);\n" ReindexRequestExample13: summary: Reindex from remote on Elastic Cloud description: "When using Elastic Cloud, you can run `POST _reindex` and authenticate against a remote cluster with an API key.\n" value: "{\n \"source\": {\n \"remote\": {\n \"host\": \"http://otherhost:9200\",\n \"username\": \"user\",\n \"password\": \"pass\"\n },\n \"index\": \"my-index-000001\",\n \"query\": {\n \"match\": {\n \"test\": \"data\"\n }\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" x-codeSamples: - lang: Console source: "POST _reindex\n{\n \"source\": {\n \"remote\": {\n \"host\": \"http://otherhost:9200\",\n \"username\": \"user\",\n \"password\": \"pass\"\n },\n \"index\": \"my-index-000001\",\n \"query\": {\n \"match\": {\n \"test\": \"data\"\n }\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - lang: Python source: "resp = client.reindex(\n source={\n \"remote\": {\n \"host\": \"http://otherhost:9200\",\n \"username\": \"user\",\n \"password\": \"pass\"\n },\n \"index\": \"my-index-000001\",\n \"query\": {\n \"match\": {\n \"test\": \"data\"\n }\n }\n },\n dest={\n \"index\": \"my-new-index-000001\"\n },\n)" - lang: JavaScript source: "const response = await client.reindex({\n source: {\n remote: {\n host: \"http://otherhost:9200\",\n username: \"user\",\n password: \"pass\",\n },\n index: \"my-index-000001\",\n query: {\n match: {\n test: \"data\",\n },\n },\n },\n dest: {\n index: \"my-new-index-000001\",\n },\n});" - lang: Ruby source: "response = client.reindex(\n body: {\n \"source\": {\n \"remote\": {\n \"host\": \"http://otherhost:9200\",\n \"username\": \"user\",\n \"password\": \"pass\"\n },\n \"index\": \"my-index-000001\",\n \"query\": {\n \"match\": {\n \"test\": \"data\"\n }\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n }\n)" - lang: PHP source: "$resp = $client->reindex([\n \"body\" => [\n \"source\" => [\n \"remote\" => [\n \"host\" => \"http://otherhost:9200\",\n \"username\" => \"user\",\n \"password\" => \"pass\",\n ],\n \"index\" => \"my-index-000001\",\n \"query\" => [\n \"match\" => [\n \"test\" => \"data\",\n ],\n ],\n ],\n \"dest\" => [\n \"index\" => \"my-new-index-000001\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"remote":{"host":"http://otherhost:9200","username":"user","password":"pass"},"index":"my-index-000001","query":{"match":{"test":"data"}}},"dest":{"index":"my-new-index-000001"}}'' "$ELASTICSEARCH_URL/_reindex"' - lang: C# source: "var response = await client\n .ReindexAsync(d1 => d1\n .Dest(d2 => d2\n .Index(\"my-new-index-000001\")\n )\n .Source(d2 => d2\n .Indices(new[] { \"my-index-000001\" })\n .Query(d3 => d3\n .Match(d4 => d4\n .Field(x => x.Test)\n .Query(\"data\")\n )\n )\n .Remote(d3 => d3\n .Host(\"http://otherhost:9200\")\n .Password(\"pass\")\n .Username(\"user\")\n )\n )\n );" - lang: Java source: "client.reindex(r -> r\n .dest(d -> d\n .index(\"my-new-index-000001\")\n )\n .source(s -> s\n .index(\"my-index-000001\")\n .query(q -> q\n .match(m -> m\n .field(\"test\")\n .query(FieldValue.of(\"data\"))\n )\n )\n .remote(re -> re\n .host(\"http://otherhost:9200\")\n .username(\"user\")\n .password(\"pass\")\n )\n )\n);\n" ReindexRequestExample2: summary: Manual slicing description: "Run `POST _reindex` to slice a reindex request manually. Provide a slice ID and total number of slices to each request.\n" value: "{\n \"source\": {\n \"index\": \"my-index-000001\",\n \"slice\": {\n \"id\": 0,\n \"max\": 2\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" x-codeSamples: - lang: Console source: "POST _reindex\n{\n \"source\": {\n \"index\": \"my-index-000001\",\n \"slice\": {\n \"id\": 0,\n \"max\": 2\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - lang: Python source: "resp = client.reindex(\n source={\n \"index\": \"my-index-000001\",\n \"slice\": {\n \"id\": 0,\n \"max\": 2\n }\n },\n dest={\n \"index\": \"my-new-index-000001\"\n },\n)" - lang: JavaScript source: "const response = await client.reindex({\n source: {\n index: \"my-index-000001\",\n slice: {\n id: 0,\n max: 2,\n },\n },\n dest: {\n index: \"my-new-index-000001\",\n },\n});" - lang: Ruby source: "response = client.reindex(\n body: {\n \"source\": {\n \"index\": \"my-index-000001\",\n \"slice\": {\n \"id\": 0,\n \"max\": 2\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n }\n)" - lang: PHP source: "$resp = $client->reindex([\n \"body\" => [\n \"source\" => [\n \"index\" => \"my-index-000001\",\n \"slice\" => [\n \"id\" => 0,\n \"max\" => 2,\n ],\n ],\n \"dest\" => [\n \"index\" => \"my-new-index-000001\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"index":"my-index-000001","slice":{"id":0,"max":2}},"dest":{"index":"my-new-index-000001"}}'' "$ELASTICSEARCH_URL/_reindex"' - lang: C# source: "var response = await client\n .ReindexAsync(d1 => d1\n .Dest(d2 => d2\n .Index(\"my-new-index-000001\")\n )\n .Source(d2 => d2\n .Indices(new[] { \"my-index-000001\" })\n .Slice(d3 => d3\n .Id(0L)\n .Max(2)\n )\n )\n );" - lang: Java source: "client.reindex(r -> r\n .dest(d -> d\n .index(\"my-new-index-000001\")\n )\n .source(s -> s\n .index(\"my-index-000001\")\n .slice(sl -> sl\n .id(\"0\")\n .max(2)\n )\n )\n);\n" ReindexRequestExample3: summary: Automatic slicing description: "Run `POST _reindex?slices=5&refresh` to automatically parallelize using sliced scroll to slice on `_id`. The `slices` parameter specifies the number of slices to use.\n" value: "{\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" x-codeSamples: - lang: Console source: "POST _reindex?slices=5&refresh\n{\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - lang: Python source: "resp = client.reindex(\n slices=\"5\",\n refresh=True,\n source={\n \"index\": \"my-index-000001\"\n },\n dest={\n \"index\": \"my-new-index-000001\"\n },\n)" - lang: JavaScript source: "const response = await client.reindex({\n slices: 5,\n refresh: \"true\",\n source: {\n index: \"my-index-000001\",\n },\n dest: {\n index: \"my-new-index-000001\",\n },\n});" - lang: Ruby source: "response = client.reindex(\n slices: \"5\",\n refresh: \"true\",\n body: {\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n }\n)" - lang: PHP source: "$resp = $client->reindex([\n \"slices\" => \"5\",\n \"refresh\" => \"true\",\n \"body\" => [\n \"source\" => [\n \"index\" => \"my-index-000001\",\n ],\n \"dest\" => [\n \"index\" => \"my-new-index-000001\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"index":"my-index-000001"},"dest":{"index":"my-new-index-000001"}}'' "$ELASTICSEARCH_URL/_reindex?slices=5&refresh"' - lang: C# source: "var response = await client\n .ReindexAsync(d1 => d1\n .Refresh(true)\n .Slices(new Slices(5))\n .Dest(d2 => d2\n .Index(\"my-new-index-000001\")\n )\n .Source(d2 => d2\n .Indices(new[] { \"my-index-000001\" })\n )\n );" - lang: Java source: "client.reindex(r -> r\n .dest(d -> d\n .index(\"my-new-index-000001\")\n )\n .refresh(true)\n .slices(s -> s\n .value(5)\n )\n .source(so -> so\n .index(\"my-index-000001\")\n )\n);\n" ReindexRequestExample4: summary: Routing description: "By default if reindex sees a document with routing then the routing is preserved unless it's changed by the script. You can set `routing` on the `dest` request to change this behavior. In this example, run `POST _reindex` to copy all documents from the `source` with the company name `cat` into the `dest` with routing set to `cat`.\n" value: "{\n \"source\": {\n \"index\": \"source\",\n \"query\": {\n \"match\": {\n \"company\": \"cat\"\n }\n }\n },\n \"dest\": {\n \"index\": \"dest\",\n \"routing\": \"=cat\"\n }\n}" x-codeSamples: - lang: Console source: "POST _reindex\n{\n \"source\": {\n \"index\": \"source\",\n \"query\": {\n \"match\": {\n \"company\": \"cat\"\n }\n }\n },\n \"dest\": {\n \"index\": \"dest\",\n \"routing\": \"=cat\"\n }\n}" - lang: Python source: "resp = client.reindex(\n source={\n \"index\": \"source\",\n \"query\": {\n \"match\": {\n \"company\": \"cat\"\n }\n }\n },\n dest={\n \"index\": \"dest\",\n \"routing\": \"=cat\"\n },\n)" - lang: JavaScript source: "const response = await client.reindex({\n source: {\n index: \"source\",\n query: {\n match: {\n company: \"cat\",\n },\n },\n },\n dest: {\n index: \"dest\",\n routing: \"=cat\",\n },\n});" - lang: Ruby source: "response = client.reindex(\n body: {\n \"source\": {\n \"index\": \"source\",\n \"query\": {\n \"match\": {\n \"company\": \"cat\"\n }\n }\n },\n \"dest\": {\n \"index\": \"dest\",\n \"routing\": \"=cat\"\n }\n }\n)" - lang: PHP source: "$resp = $client->reindex([\n \"body\" => [\n \"source\" => [\n \"index\" => \"source\",\n \"query\" => [\n \"match\" => [\n \"company\" => \"cat\",\n ],\n ],\n ],\n \"dest\" => [\n \"index\" => \"dest\",\n \"routing\" => \"=cat\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"index":"source","query":{"match":{"company":"cat"}}},"dest":{"index":"dest","routing":"=cat"}}'' "$ELASTICSEARCH_URL/_reindex"' - lang: C# source: "var response = await client\n .ReindexAsync(d1 => d1\n .Dest(d2 => d2\n .Index(\"dest\")\n .Routing(\"=cat\")\n )\n .Source(d2 => d2\n .Indices(new[] { \"source\" })\n .Query(d3 => d3\n .Match(d4 => d4\n .Field(x => x.Company)\n .Query(\"cat\")\n )\n )\n )\n );" - lang: Java source: "client.reindex(r -> r\n .dest(d -> d\n .index(\"dest\")\n .routing(\"=cat\")\n )\n .source(s -> s\n .index(\"source\")\n .query(q -> q\n .match(m -> m\n .field(\"company\")\n .query(FieldValue.of(\"cat\"))\n )\n )\n )\n);\n" ReindexRequestExample5: summary: Ingest pipelines description: Run `POST _reindex` and use the ingest pipelines feature. value: "{\n \"source\": {\n \"index\": \"source\"\n },\n \"dest\": {\n \"index\": \"dest\",\n \"pipeline\": \"some_ingest_pipeline\"\n }\n}" x-codeSamples: - lang: Console source: "POST _reindex\n{\n \"source\": {\n \"index\": \"source\"\n },\n \"dest\": {\n \"index\": \"dest\",\n \"pipeline\": \"some_ingest_pipeline\"\n }\n}" - lang: Python source: "resp = client.reindex(\n source={\n \"index\": \"source\"\n },\n dest={\n \"index\": \"dest\",\n \"pipeline\": \"some_ingest_pipeline\"\n },\n)" - lang: JavaScript source: "const response = await client.reindex({\n source: {\n index: \"source\",\n },\n dest: {\n index: \"dest\",\n pipeline: \"some_ingest_pipeline\",\n },\n});" - lang: Ruby source: "response = client.reindex(\n body: {\n \"source\": {\n \"index\": \"source\"\n },\n \"dest\": {\n \"index\": \"dest\",\n \"pipeline\": \"some_ingest_pipeline\"\n }\n }\n)" - lang: PHP source: "$resp = $client->reindex([\n \"body\" => [\n \"source\" => [\n \"index\" => \"source\",\n ],\n \"dest\" => [\n \"index\" => \"dest\",\n \"pipeline\" => \"some_ingest_pipeline\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"index":"source"},"dest":{"index":"dest","pipeline":"some_ingest_pipeline"}}'' "$ELASTICSEARCH_URL/_reindex"' - lang: C# source: "var response = await client\n .ReindexAsync(d1 => d1\n .Dest(d2 => d2\n .Index(\"dest\")\n .Pipeline(\"some_ingest_pipeline\")\n )\n .Source(d2 => d2\n .Indices(new[] { \"source\" })\n )\n );" - lang: Java source: "client.reindex(r -> r\n .dest(d -> d\n .index(\"dest\")\n .pipeline(\"some_ingest_pipeline\")\n )\n .source(s -> s\n .index(\"source\")\n )\n);\n" ReindexRequestExample6: summary: Reindex with a query description: "Run `POST _reindex` and add a query to the `source` to limit the documents to reindex. For example, this request copies documents into `my-new-index-000001` only if they have a `user.id` of `kimchy`.\n" value: "{\n \"source\": {\n \"index\": \"my-index-000001\",\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" x-codeSamples: - lang: Console source: "POST _reindex\n{\n \"source\": {\n \"index\": \"my-index-000001\",\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - lang: Python source: "resp = client.reindex(\n source={\n \"index\": \"my-index-000001\",\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n },\n dest={\n \"index\": \"my-new-index-000001\"\n },\n)" - lang: JavaScript source: "const response = await client.reindex({\n source: {\n index: \"my-index-000001\",\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n },\n dest: {\n index: \"my-new-index-000001\",\n },\n});" - lang: Ruby source: "response = client.reindex(\n body: {\n \"source\": {\n \"index\": \"my-index-000001\",\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n }\n)" - lang: PHP source: "$resp = $client->reindex([\n \"body\" => [\n \"source\" => [\n \"index\" => \"my-index-000001\",\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n \"dest\" => [\n \"index\" => \"my-new-index-000001\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"index":"my-index-000001","query":{"term":{"user.id":"kimchy"}}},"dest":{"index":"my-new-index-000001"}}'' "$ELASTICSEARCH_URL/_reindex"' - lang: C# source: "var response = await client\n .ReindexAsync(d1 => d1\n .Dest(d2 => d2\n .Index(\"my-new-index-000001\")\n )\n .Source(d2 => d2\n .Indices(new[] { \"my-index-000001\" })\n .Query(d3 => d3\n .Term(d4 => d4\n .Field(x => x.User.Id)\n .Value(\"kimchy\")\n )\n )\n )\n );" - lang: Java source: "client.reindex(r -> r\n .dest(d -> d\n .index(\"my-new-index-000001\")\n )\n .source(s -> s\n .index(\"my-index-000001\")\n .query(q -> q\n .term(t -> t\n .field(\"user.id\")\n .value(FieldValue.of(\"kimchy\"))\n )\n )\n )\n);\n" ReindexRequestExample7: summary: Reindex with max_docs description: "You can limit the number of processed documents by setting `max_docs`. For example, run `POST _reindex` to copy a single document from `my-index-000001` to `my-new-index-000001`.\n" value: "{\n \"max_docs\": 1,\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" x-codeSamples: - lang: Console source: "POST _reindex\n{\n \"max_docs\": 1,\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - lang: Python source: "resp = client.reindex(\n max_docs=1,\n source={\n \"index\": \"my-index-000001\"\n },\n dest={\n \"index\": \"my-new-index-000001\"\n },\n)" - lang: JavaScript source: "const response = await client.reindex({\n max_docs: 1,\n source: {\n index: \"my-index-000001\",\n },\n dest: {\n index: \"my-new-index-000001\",\n },\n});" - lang: Ruby source: "response = client.reindex(\n body: {\n \"max_docs\": 1,\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n }\n)" - lang: PHP source: "$resp = $client->reindex([\n \"body\" => [\n \"max_docs\" => 1,\n \"source\" => [\n \"index\" => \"my-index-000001\",\n ],\n \"dest\" => [\n \"index\" => \"my-new-index-000001\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"max_docs":1,"source":{"index":"my-index-000001"},"dest":{"index":"my-new-index-000001"}}'' "$ELASTICSEARCH_URL/_reindex"' - lang: C# source: "var response = await client\n .ReindexAsync(d1 => d1\n .Dest(d2 => d2\n .Index(\"my-new-index-000001\")\n )\n .MaxDocs(1L)\n .Source(d2 => d2\n .Indices(new[] { \"my-index-000001\" })\n )\n );" - lang: Java source: "client.reindex(r -> r\n .dest(d -> d\n .index(\"my-new-index-000001\")\n )\n .maxDocs(1L)\n .source(s -> s\n .index(\"my-index-000001\")\n )\n);\n" ReindexRequestExample8: summary: Reindex selected fields description: "You can use source filtering to reindex a subset of the fields in the original documents. For example, run `POST _reindex` the reindex only the `user.id` and `_doc` fields of each document.\n" value: "{\n \"source\": {\n \"index\": \"my-index-000001\",\n \"_source\": [\"user.id\", \"_doc\"]\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" x-codeSamples: - lang: Console source: "POST _reindex\n{\n \"source\": {\n \"index\": \"my-index-000001\",\n \"_source\": [\"user.id\", \"_doc\"]\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - lang: Python source: "resp = client.reindex(\n source={\n \"index\": \"my-index-000001\",\n \"_source\": [\n \"user.id\",\n \"_doc\"\n ]\n },\n dest={\n \"index\": \"my-new-index-000001\"\n },\n)" - lang: JavaScript source: "const response = await client.reindex({\n source: {\n index: \"my-index-000001\",\n _source: [\"user.id\", \"_doc\"],\n },\n dest: {\n index: \"my-new-index-000001\",\n },\n});" - lang: Ruby source: "response = client.reindex(\n body: {\n \"source\": {\n \"index\": \"my-index-000001\",\n \"_source\": [\n \"user.id\",\n \"_doc\"\n ]\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n }\n)" - lang: PHP source: "$resp = $client->reindex([\n \"body\" => [\n \"source\" => [\n \"index\" => \"my-index-000001\",\n \"_source\" => array(\n \"user.id\",\n \"_doc\",\n ),\n ],\n \"dest\" => [\n \"index\" => \"my-new-index-000001\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"index":"my-index-000001","_source":["user.id","_doc"]},"dest":{"index":"my-new-index-000001"}}'' "$ELASTICSEARCH_URL/_reindex"' - lang: C# source: "var response = await client\n .ReindexAsync(d1 => d1\n .Dest(d2 => d2\n .Index(\"my-new-index-000001\")\n )\n .Source(d2 => d2\n .Indices(new[] { \"my-index-000001\" })\n .SourceFields(new SourceConfig(new SourceFilter()\n {\n Includes = global::Elastic.Clients.Elasticsearch.Infer.Fields(x => x.User.Id, x => x.Doc)\n }))\n )\n );" - lang: Java source: "client.reindex(r -> r\n .dest(d -> d\n .index(\"my-new-index-000001\")\n )\n .source(s -> s\n .index(\"my-index-000001\")\n .sourceFields(so -> so\n .filter(f -> f\n .includes(List.of(\"user.id\",\"_doc\"))\n )\n )\n )\n);\n" ReindexRequestExample9: summary: Reindex new field names description: "A reindex operation can build a copy of an index with renamed fields. If your index has documents with `text` and `flag` fields, you can change the latter field name to `tag` during the reindex.\n" value: "{\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n },\n \"script\": {\n \"source\": \"ctx._source.tag = ctx._source.remove(\\\"flag\\\")\"\n }\n}" x-codeSamples: - lang: Console source: "POST _reindex\n{\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n },\n \"script\": {\n \"source\": \"ctx._source.tag = ctx._source.remove(\\\"flag\\\")\"\n }\n}" - lang: Python source: "resp = client.reindex(\n source={\n \"index\": \"my-index-000001\"\n },\n dest={\n \"index\": \"my-new-index-000001\"\n },\n script={\n \"source\": \"ctx._source.tag = ctx._source.remove(\\\"flag\\\")\"\n },\n)" - lang: JavaScript source: "const response = await client.reindex({\n source: {\n index: \"my-index-000001\",\n },\n dest: {\n index: \"my-new-index-000001\",\n },\n script: {\n source: 'ctx._source.tag = ctx._source.remove(\"flag\")',\n },\n});" - lang: Ruby source: "response = client.reindex(\n body: {\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n },\n \"script\": {\n \"source\": \"ctx._source.tag = ctx._source.remove(\\\"flag\\\")\"\n }\n }\n)" - lang: PHP source: "$resp = $client->reindex([\n \"body\" => [\n \"source\" => [\n \"index\" => \"my-index-000001\",\n ],\n \"dest\" => [\n \"index\" => \"my-new-index-000001\",\n ],\n \"script\" => [\n \"source\" => \"ctx._source.tag = ctx._source.remove(\\\"flag\\\")\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"index":"my-index-000001"},"dest":{"index":"my-new-index-000001"},"script":{"source":"ctx._source.tag = ctx._source.remove(\"flag\")"}}'' "$ELASTICSEARCH_URL/_reindex"' - lang: C# source: "var response = await client\n .ReindexAsync(d1 => d1\n .Dest(d2 => d2\n .Index(\"my-new-index-000001\")\n )\n .Script(d2 => d2\n .Source(\"ctx._source.tag = ctx._source.remove(\\\"flag\\\")\")\n )\n .Source(d2 => d2\n .Indices(new[] { \"my-index-000001\" })\n )\n );" - lang: Java source: "client.reindex(r -> r\n .dest(d -> d\n .index(\"my-new-index-000001\")\n )\n .script(s -> s\n .source(so -> so\n .scriptString(\"ctx._source.tag = ctx._source.remove(\"flag\")\")\n )\n )\n .source(so -> so\n .index(\"my-index-000001\")\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: type: object properties: batches: type: number description: The number of scroll responses that were pulled back by the reindex. created: type: number description: The number of documents that were successfully created. deleted: type: number description: The number of documents that were successfully deleted. failures: type: array items: $ref: '#/components/schemas/_types.BulkByPaginatedSearchFailure' description: "If there were any unrecoverable errors during the process, it is an array of those failures.\nIf this array is not empty, the request ended because of those failures.\nReindex is implemented using batches and any failure causes the entire process to end but all failures in the current batch are collected into the array.\nYou can use the `conflicts` option to prevent the reindex from ending on version conflicts." noops: type: number description: The number of documents that were ignored because the script used for the reindex returned a `noop` value for `ctx.op`. retries: allOf: - $ref: '#/components/schemas/_types.Retries' description: The number of retries attempted by reindex. requests_per_second: type: number description: The number of requests per second effectively run during the reindex. slice_id: type: number slices: type: array items: $ref: '#/components/schemas/_types.ReindexStatus' description: Status of each slice if the reindex was sliced task: allOf: - $ref: '#/components/schemas/_types.TaskId' throttled_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: The number of milliseconds the request slept to conform to `requests_per_second`. throttled_until_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: "This field should always be equal to zero in a reindex response.\nIt has meaning only when using the task API, where it indicates the next time (in milliseconds since epoch) that a throttled request will be run again in order to conform to `requests_per_second`." timed_out: type: boolean description: 'If any of the requests that ran during the reindex timed out, it is `true`.' took: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: The total milliseconds the entire operation took. total: type: number description: The number of documents that were successfully processed. updated: type: number description: "The number of documents that were successfully updated.\nThat is to say, a document with the same ID already existed before the reindex updated it." version_conflicts: type: number description: The number of version conflicts that occurred. x-state: Generally available; Added in 2.3.0 x-codeSamples: - lang: Console source: "POST _reindex\n{\n \"source\": {\n \"index\": [\"my-index-000001\", \"my-index-000002\"]\n },\n \"dest\": {\n \"index\": \"my-new-index-000002\"\n }\n}" - lang: Python source: "resp = client.reindex(\n source={\n \"index\": [\n \"my-index-000001\",\n \"my-index-000002\"\n ]\n },\n dest={\n \"index\": \"my-new-index-000002\"\n },\n)" - lang: JavaScript source: "const response = await client.reindex({\n source: {\n index: [\"my-index-000001\", \"my-index-000002\"],\n },\n dest: {\n index: \"my-new-index-000002\",\n },\n});" - lang: Ruby source: "response = client.reindex(\n body: {\n \"source\": {\n \"index\": [\n \"my-index-000001\",\n \"my-index-000002\"\n ]\n },\n \"dest\": {\n \"index\": \"my-new-index-000002\"\n }\n }\n)" - lang: PHP source: "$resp = $client->reindex([\n \"body\" => [\n \"source\" => [\n \"index\" => array(\n \"my-index-000001\",\n \"my-index-000002\",\n ),\n ],\n \"dest\" => [\n \"index\" => \"my-new-index-000002\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"index":["my-index-000001","my-index-000002"]},"dest":{"index":"my-new-index-000002"}}'' "$ELASTICSEARCH_URL/_reindex"' - lang: C# source: "var response = await client\n .ReindexAsync(d1 => d1\n .Dest(d2 => d2\n .Index(\"my-new-index-000002\")\n )\n .Source(d2 => d2\n .Indices(new[] { \"my-index-000001\", \"my-index-000002\" })\n )\n );" - lang: Java source: "client.reindex(r -> r\n .dest(d -> d\n .index(\"my-new-index-000002\")\n )\n .source(s -> s\n .index(List.of(\"my-index-000001\",\"my-index-000002\"))\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_logstash/pipeline/{id}': get: tags: - logstash summary: "Get Logstash pipelines\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_logstash/pipeline\n
\n
\n GET\n /_logstash/pipeline/{id}\n
\n \n\nGet pipelines that are used for Logstash Central Management.\n\n## Required authorization\n\n* Cluster privileges: `manage_logstash_pipelines`\n" externalDocs: description: Centralized pipeline management url: https://www.elastic.co/docs/reference/logstash/logstash-centralized-pipeline-management x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/logstash-api-get-pipeline.html operationId: logstash-get-pipeline parameters: - $ref: '#/components/parameters/logstash.get_pipeline-id' responses: '200': $ref: '#/components/responses/logstash.get_pipeline-200' x-state: Generally available; Added in 7.12.0 x-codeSamples: - lang: Console source: "GET _logstash/pipeline/my_pipeline\n" - lang: Python source: "resp = client.logstash.get_pipeline(\n id=\"my_pipeline\",\n)" - lang: JavaScript source: "const response = await client.logstash.getPipeline({\n id: \"my_pipeline\",\n});" - lang: Ruby source: "response = client.logstash.get_pipeline(\n id: \"my_pipeline\"\n)" - lang: PHP source: "$resp = $client->logstash()->getPipeline([\n \"id\" => \"my_pipeline\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_logstash/pipeline/my_pipeline"' - lang: Java source: "client.logstash().getPipeline(g -> g\n .id(\"my_pipeline\")\n);\n" x-metaTags: - content: 'Elasticsearch, Logstash' name: product_name put: tags: - logstash summary: Create or update a Logstash pipeline description: "Create a pipeline that is used for Logstash Central Management.\nIf the specified pipeline exists, it is replaced.\n\n## Required authorization\n\n* Cluster privileges: `manage_logstash_pipelines`\n" externalDocs: description: Centralized pipeline management url: https://www.elastic.co/docs/reference/logstash/logstash-centralized-pipeline-management x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/logstash-api-put-pipeline.html operationId: logstash-put-pipeline parameters: - name: id in: path description: "An identifier for the pipeline.\nPipeline IDs must begin with a letter or underscore and contain only letters, underscores, dashes, hyphens and numbers." required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: $ref: '#/components/schemas/logstash._types.Pipeline' examples: LogstashPutPipelineRequestExample1: summary: Create a pipeline description: Run `PUT _logstash/pipeline/my_pipeline` to create a pipeline. value: "{\n \"description\": \"Sample pipeline for illustration purposes\",\n \"last_modified\": \"2021-01-02T02:50:51.250Z\",\n \"pipeline_metadata\": {\n \"type\": \"logstash_pipeline\",\n \"version\": 1\n },\n \"username\": \"elastic\",\n \"pipeline\": \"input {}\\\\n filter { grok {} }\\\\n output {}\",\n \"pipeline_settings\": {\n \"pipeline.workers\": 1,\n \"pipeline.batch.size\": 125,\n \"pipeline.batch.delay\": 50,\n \"queue.type\": \"memory\",\n \"queue.max_bytes\": \"1gb\",\n \"queue.checkpoint.writes\": 1024\n }\n}" x-codeSamples: - lang: Console source: "PUT _logstash/pipeline/my_pipeline\n{\n \"description\": \"Sample pipeline for illustration purposes\",\n \"last_modified\": \"2021-01-02T02:50:51.250Z\",\n \"pipeline_metadata\": {\n \"type\": \"logstash_pipeline\",\n \"version\": 1\n },\n \"username\": \"elastic\",\n \"pipeline\": \"input {}\\\\n filter { grok {} }\\\\n output {}\",\n \"pipeline_settings\": {\n \"pipeline.workers\": 1,\n \"pipeline.batch.size\": 125,\n \"pipeline.batch.delay\": 50,\n \"queue.type\": \"memory\",\n \"queue.max_bytes\": \"1gb\",\n \"queue.checkpoint.writes\": 1024\n }\n}" - lang: Python source: "resp = client.logstash.put_pipeline(\n id=\"my_pipeline\",\n pipeline={\n \"description\": \"Sample pipeline for illustration purposes\",\n \"last_modified\": \"2021-01-02T02:50:51.250Z\",\n \"pipeline_metadata\": {\n \"type\": \"logstash_pipeline\",\n \"version\": 1\n },\n \"username\": \"elastic\",\n \"pipeline\": \"input {}\\\\n filter { grok {} }\\\\n output {}\",\n \"pipeline_settings\": {\n \"pipeline.workers\": 1,\n \"pipeline.batch.size\": 125,\n \"pipeline.batch.delay\": 50,\n \"queue.type\": \"memory\",\n \"queue.max_bytes\": \"1gb\",\n \"queue.checkpoint.writes\": 1024\n }\n },\n)" - lang: JavaScript source: "const response = await client.logstash.putPipeline({\n id: \"my_pipeline\",\n pipeline: {\n description: \"Sample pipeline for illustration purposes\",\n last_modified: \"2021-01-02T02:50:51.250Z\",\n pipeline_metadata: {\n type: \"logstash_pipeline\",\n version: 1,\n },\n username: \"elastic\",\n pipeline: \"input {}\\\\n filter { grok {} }\\\\n output {}\",\n pipeline_settings: {\n \"pipeline.workers\": 1,\n \"pipeline.batch.size\": 125,\n \"pipeline.batch.delay\": 50,\n \"queue.type\": \"memory\",\n \"queue.max_bytes\": \"1gb\",\n \"queue.checkpoint.writes\": 1024,\n },\n },\n});" - lang: Ruby source: "response = client.logstash.put_pipeline(\n id: \"my_pipeline\",\n body: {\n \"description\": \"Sample pipeline for illustration purposes\",\n \"last_modified\": \"2021-01-02T02:50:51.250Z\",\n \"pipeline_metadata\": {\n \"type\": \"logstash_pipeline\",\n \"version\": 1\n },\n \"username\": \"elastic\",\n \"pipeline\": \"input {}\\\\n filter { grok {} }\\\\n output {}\",\n \"pipeline_settings\": {\n \"pipeline.workers\": 1,\n \"pipeline.batch.size\": 125,\n \"pipeline.batch.delay\": 50,\n \"queue.type\": \"memory\",\n \"queue.max_bytes\": \"1gb\",\n \"queue.checkpoint.writes\": 1024\n }\n }\n)" - lang: PHP source: "$resp = $client->logstash()->putPipeline([\n \"id\" => \"my_pipeline\",\n \"body\" => [\n \"description\" => \"Sample pipeline for illustration purposes\",\n \"last_modified\" => \"2021-01-02T02:50:51.250Z\",\n \"pipeline_metadata\" => [\n \"type\" => \"logstash_pipeline\",\n \"version\" => 1,\n ],\n \"username\" => \"elastic\",\n \"pipeline\" => \"input {}\\\\n filter { grok {} }\\\\n output {}\",\n \"pipeline_settings\" => [\n \"pipeline.workers\" => 1,\n \"pipeline.batch.size\" => 125,\n \"pipeline.batch.delay\" => 50,\n \"queue.type\" => \"memory\",\n \"queue.max_bytes\" => \"1gb\",\n \"queue.checkpoint.writes\" => 1024,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"description":"Sample pipeline for illustration purposes","last_modified":"2021-01-02T02:50:51.250Z","pipeline_metadata":{"type":"logstash_pipeline","version":1},"username":"elastic","pipeline":"input {}\\n filter { grok {} }\\n output {}","pipeline_settings":{"pipeline.workers":1,"pipeline.batch.size":125,"pipeline.batch.delay":50,"queue.type":"memory","queue.max_bytes":"1gb","queue.checkpoint.writes":1024}}'' "$ELASTICSEARCH_URL/_logstash/pipeline/my_pipeline"' - lang: Java source: "client.logstash().putPipeline(p -> p\n .id(\"my_pipeline\")\n .pipeline(pi -> pi\n .description(\"Sample pipeline for illustration purposes\")\n .lastModified(DateTime.of(\"2021-01-02T02:50:51.250Z\"))\n .pipeline(\"input {}\\n filter { grok {} }\\n output {}\")\n .pipelineMetadata(pip -> pip\n .type(\"logstash_pipeline\")\n .version(\"1\")\n )\n .pipelineSettings(pip -> pip\n .pipelineWorkers(1)\n .pipelineBatchSize(125)\n .pipelineBatchDelay(50)\n .queueType(\"memory\")\n .queueMaxBytes(\"1gb\")\n .queueCheckpointWrites(1024)\n )\n .username(\"elastic\")\n )\n);\n" required: true responses: '200': description: '' content: application/json: { } x-state: Generally available; Added in 7.12.0 x-codeSamples: - lang: Console source: "PUT _logstash/pipeline/my_pipeline\n{\n \"description\": \"Sample pipeline for illustration purposes\",\n \"last_modified\": \"2021-01-02T02:50:51.250Z\",\n \"pipeline_metadata\": {\n \"type\": \"logstash_pipeline\",\n \"version\": 1\n },\n \"username\": \"elastic\",\n \"pipeline\": \"input {}\\\\n filter { grok {} }\\\\n output {}\",\n \"pipeline_settings\": {\n \"pipeline.workers\": 1,\n \"pipeline.batch.size\": 125,\n \"pipeline.batch.delay\": 50,\n \"queue.type\": \"memory\",\n \"queue.max_bytes\": \"1gb\",\n \"queue.checkpoint.writes\": 1024\n }\n}" - lang: Python source: "resp = client.logstash.put_pipeline(\n id=\"my_pipeline\",\n pipeline={\n \"description\": \"Sample pipeline for illustration purposes\",\n \"last_modified\": \"2021-01-02T02:50:51.250Z\",\n \"pipeline_metadata\": {\n \"type\": \"logstash_pipeline\",\n \"version\": 1\n },\n \"username\": \"elastic\",\n \"pipeline\": \"input {}\\\\n filter { grok {} }\\\\n output {}\",\n \"pipeline_settings\": {\n \"pipeline.workers\": 1,\n \"pipeline.batch.size\": 125,\n \"pipeline.batch.delay\": 50,\n \"queue.type\": \"memory\",\n \"queue.max_bytes\": \"1gb\",\n \"queue.checkpoint.writes\": 1024\n }\n },\n)" - lang: JavaScript source: "const response = await client.logstash.putPipeline({\n id: \"my_pipeline\",\n pipeline: {\n description: \"Sample pipeline for illustration purposes\",\n last_modified: \"2021-01-02T02:50:51.250Z\",\n pipeline_metadata: {\n type: \"logstash_pipeline\",\n version: 1,\n },\n username: \"elastic\",\n pipeline: \"input {}\\\\n filter { grok {} }\\\\n output {}\",\n pipeline_settings: {\n \"pipeline.workers\": 1,\n \"pipeline.batch.size\": 125,\n \"pipeline.batch.delay\": 50,\n \"queue.type\": \"memory\",\n \"queue.max_bytes\": \"1gb\",\n \"queue.checkpoint.writes\": 1024,\n },\n },\n});" - lang: Ruby source: "response = client.logstash.put_pipeline(\n id: \"my_pipeline\",\n body: {\n \"description\": \"Sample pipeline for illustration purposes\",\n \"last_modified\": \"2021-01-02T02:50:51.250Z\",\n \"pipeline_metadata\": {\n \"type\": \"logstash_pipeline\",\n \"version\": 1\n },\n \"username\": \"elastic\",\n \"pipeline\": \"input {}\\\\n filter { grok {} }\\\\n output {}\",\n \"pipeline_settings\": {\n \"pipeline.workers\": 1,\n \"pipeline.batch.size\": 125,\n \"pipeline.batch.delay\": 50,\n \"queue.type\": \"memory\",\n \"queue.max_bytes\": \"1gb\",\n \"queue.checkpoint.writes\": 1024\n }\n }\n)" - lang: PHP source: "$resp = $client->logstash()->putPipeline([\n \"id\" => \"my_pipeline\",\n \"body\" => [\n \"description\" => \"Sample pipeline for illustration purposes\",\n \"last_modified\" => \"2021-01-02T02:50:51.250Z\",\n \"pipeline_metadata\" => [\n \"type\" => \"logstash_pipeline\",\n \"version\" => 1,\n ],\n \"username\" => \"elastic\",\n \"pipeline\" => \"input {}\\\\n filter { grok {} }\\\\n output {}\",\n \"pipeline_settings\" => [\n \"pipeline.workers\" => 1,\n \"pipeline.batch.size\" => 125,\n \"pipeline.batch.delay\" => 50,\n \"queue.type\" => \"memory\",\n \"queue.max_bytes\" => \"1gb\",\n \"queue.checkpoint.writes\" => 1024,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"description":"Sample pipeline for illustration purposes","last_modified":"2021-01-02T02:50:51.250Z","pipeline_metadata":{"type":"logstash_pipeline","version":1},"username":"elastic","pipeline":"input {}\\n filter { grok {} }\\n output {}","pipeline_settings":{"pipeline.workers":1,"pipeline.batch.size":125,"pipeline.batch.delay":50,"queue.type":"memory","queue.max_bytes":"1gb","queue.checkpoint.writes":1024}}'' "$ELASTICSEARCH_URL/_logstash/pipeline/my_pipeline"' - lang: Java source: "client.logstash().putPipeline(p -> p\n .id(\"my_pipeline\")\n .pipeline(pi -> pi\n .description(\"Sample pipeline for illustration purposes\")\n .lastModified(DateTime.of(\"2021-01-02T02:50:51.250Z\"))\n .pipeline(\"input {}\\n filter { grok {} }\\n output {}\")\n .pipelineMetadata(pip -> pip\n .type(\"logstash_pipeline\")\n .version(\"1\")\n )\n .pipelineSettings(pip -> pip\n .pipelineWorkers(1)\n .pipelineBatchSize(125)\n .pipelineBatchDelay(50)\n .queueType(\"memory\")\n .queueMaxBytes(\"1gb\")\n .queueCheckpointWrites(1024)\n )\n .username(\"elastic\")\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Logstash' name: product_name delete: tags: - logstash summary: Delete a Logstash pipeline description: "Delete a pipeline that is used for Logstash Central Management.\nIf the request succeeds, you receive an empty response with an appropriate status code.\n\n## Required authorization\n\n* Cluster privileges: `manage_logstash_pipelines`\n" externalDocs: description: Centralized pipeline management url: https://www.elastic.co/docs/reference/logstash/logstash-centralized-pipeline-management x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/logstash-api-delete-pipeline.html operationId: logstash-delete-pipeline parameters: - name: id in: path description: An identifier for the pipeline. required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: { } x-state: Generally available; Added in 7.12.0 x-codeSamples: - lang: Console source: "DELETE _logstash/pipeline/my_pipeline\n" - lang: Python source: "resp = client.logstash.delete_pipeline(\n id=\"my_pipeline\",\n)" - lang: JavaScript source: "const response = await client.logstash.deletePipeline({\n id: \"my_pipeline\",\n});" - lang: Ruby source: "response = client.logstash.delete_pipeline(\n id: \"my_pipeline\"\n)" - lang: PHP source: "$resp = $client->logstash()->deletePipeline([\n \"id\" => \"my_pipeline\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_logstash/pipeline/my_pipeline"' - lang: Java source: "client.logstash().deletePipeline(d -> d\n .id(\"my_pipeline\")\n);\n" x-metaTags: - content: 'Elasticsearch, Logstash' name: product_name '/{index}/_mget': post: tags: - document summary: "Get multiple documents\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_mget\n
\n
\n POST\n /_mget\n
\n
\n GET\n /{index}/_mget\n
\n
\n POST\n /{index}/_mget\n
\n \n\nGet multiple JSON documents by ID from one or more indices.\nIf you specify an index in the request URI, you only need to specify the document IDs in the request body.\nTo ensure fast responses, this multi get (mget) API responds with partial results if one or more shards fail.\n\n**Filter source fields**\n\nBy default, the `_source` field is returned for every document (if stored).\nUse the `_source` and `_source_include` or `source_exclude` attributes to filter what fields are returned for a particular document.\nYou can include the `_source`, `_source_includes`, and `_source_excludes` query parameters in the request URI to specify the defaults to use when there are no per-document instructions.\n\n**Get stored fields**\n\nUse the `stored_fields` attribute to specify the set of stored fields you want to retrieve.\nAny requested fields that are not stored are ignored.\nYou can include the `stored_fields` query parameter in the request URI to specify the defaults to use when there are no per-document instructions.\n\n## Required authorization\n\n* Index privileges: `read`\n" operationId: mget parameters: - $ref: '#/components/parameters/mget-index' - $ref: '#/components/parameters/mget-preference' - $ref: '#/components/parameters/mget-realtime' - $ref: '#/components/parameters/mget-refresh' - $ref: '#/components/parameters/mget-routing' - $ref: '#/components/parameters/mget-_source' - $ref: '#/components/parameters/mget-_source_excludes' - $ref: '#/components/parameters/mget-_source_includes' - $ref: '#/components/parameters/mget-stored_fields' requestBody: $ref: '#/components/requestBodies/mget' responses: '200': $ref: '#/components/responses/mget-200' x-state: Generally available; Added in 1.3.0 x-codeSamples: - lang: Console source: "GET /my-index-000001/_mget\n{\n \"docs\": [\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ]\n}" - lang: Python source: "resp = client.mget(\n index=\"my-index-000001\",\n docs=[\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ],\n)" - lang: JavaScript source: "const response = await client.mget({\n index: \"my-index-000001\",\n docs: [\n {\n _id: \"1\",\n },\n {\n _id: \"2\",\n },\n ],\n});" - lang: Ruby source: "response = client.mget(\n index: \"my-index-000001\",\n body: {\n \"docs\": [\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->mget([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"docs\" => array(\n [\n \"_id\" => \"1\",\n ],\n [\n \"_id\" => \"2\",\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"docs":[{"_id":"1"},{"_id":"2"}]}'' "$ELASTICSEARCH_URL/my-index-000001/_mget"' - lang: C# source: "var response = await client\n .MultiGetAsync(d1 => d1\n .Index(\"my-index-000001\")\n .Docs(d2 => d2\n .Id(\"1\"), d2 => d2\n .Id(\"2\")\n )\n );" - lang: Java source: "client.mget(m -> m\n .docs(List.of(MultiGetOperation.of(mu -> mu\n .id(\"1\")\n ),MultiGetOperation.of(mu -> mu\n .id(\"2\")\n )))\n .index(\"my-index-000001\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_migration/deprecations': get: tags: - migration summary: "Get deprecation information\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_migration/deprecations\n
\n
\n GET\n /{index}/_migration/deprecations\n
\n \n\nReturns information about deprecated features which are in use in the cluster.\nThe reported features include cluster, node, and index level settings that will be removed or changed in the next major version.\nYou must address the reported issues before upgrading to the next major version.\nHowever, no action is required when upgrading within the current major version.\nDeprecated features remain fully supported and will continue to work in the current version, and when upgrading to a newer minor or patch release in the same major version.\nUse this API to review your usage of these features and migrate away from them at your own pace, before upgrading to a new major version.\n\n> info\n> This API is designed for indirect use by the [Upgrade Assistant](https://www.elastic.co/docs/deploy-manage/upgrade/prepare-to-upgrade/upgrade-assistant).\n> We recommend learning about deprecated features using the Upgrade Assistant rather than calling this API directly.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: migration-deprecations parameters: - $ref: '#/components/parameters/migration.deprecations-index' responses: '200': $ref: '#/components/responses/migration.deprecations-200' x-state: Generally available; Added in 6.1.0 x-codeSamples: - lang: Console source: "GET /_migration/deprecations\n" - lang: Python source: resp = client.migration.deprecations() - lang: JavaScript source: const response = await client.migration.deprecations(); - lang: Ruby source: response = client.migration.deprecations - lang: PHP source: $resp = $client->migration()->deprecations(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_migration/deprecations"' - lang: Java source: "client.migration().deprecations(d -> d);\n" x-metaTags: - content: Elasticsearch name: product_name /_migration/system_features: get: tags: - migration summary: Get feature migration information description: "Version upgrades sometimes require changes to how features store configuration information and data in system indices.\nCheck which features need to be migrated and the status of any migrations that are in progress.\n\nTIP: This API is designed for indirect use by the Upgrade Assistant.\nYou are strongly recommended to use the Upgrade Assistant.\n\n## Required authorization\n\n* Index privileges: `manage`\n* Cluster privileges: `manage`\n" operationId: migration-get-feature-upgrade-status responses: '200': description: '' content: application/json: schema: required: - features - migration_status type: object properties: features: type: array items: $ref: '#/components/schemas/migration.get_feature_upgrade_status.MigrationFeature' migration_status: allOf: - $ref: '#/components/schemas/migration.get_feature_upgrade_status.MigrationStatus' examples: GetFeatureUpgradeStatusResponseExample1: description: A successful response from `GET /_migration/system_features`. value: "{\n \"features\" : [\n {\n \"feature_name\" : \"async_search\",\n \"minimum_index_version\" : \"8100099\",\n \"migration_status\" : \"NO_MIGRATION_NEEDED\",\n \"indices\" : [ ]\n },\n {\n \"feature_name\" : \"enrich\",\n \"minimum_index_version\" : \"8100099\",\n \"migration_status\" : \"NO_MIGRATION_NEEDED\",\n \"indices\" : [ ]\n },\n {\n \"feature_name\" : \"ent_search\",\n \"minimum_index_version\" : \"8100099\",\n \"migration_status\" : \"NO_MIGRATION_NEEDED\",\n \"indices\" : [ ]\n },\n {\n \"feature_name\" : \"fleet\",\n \"minimum_index_version\" : \"8100099\",\n \"migration_status\" : \"NO_MIGRATION_NEEDED\",\n \"indices\" : [ ]\n },\n {\n \"feature_name\" : \"geoip\",\n \"minimum_index_version\" : \"8100099\",\n \"migration_status\" : \"NO_MIGRATION_NEEDED\",\n \"indices\" : [ ]\n },\n {\n \"feature_name\" : \"kibana\",\n \"minimum_index_version\" : \"8100099\",\n \"migration_status\" : \"NO_MIGRATION_NEEDED\",\n \"indices\" : [ ]\n },\n {\n \"feature_name\" : \"logstash_management\",\n \"minimum_index_version\" : \"8100099\",\n \"migration_status\" : \"NO_MIGRATION_NEEDED\",\n \"indices\" : [ ]\n },\n {\n \"feature_name\" : \"machine_learning\",\n \"minimum_index_version\" : \"8100099\",\n \"migration_status\" : \"NO_MIGRATION_NEEDED\",\n \"indices\" : [ ]\n },\n {\n \"feature_name\" : \"searchable_snapshots\",\n \"minimum_index_version\" : \"8100099\",\n \"migration_status\" : \"NO_MIGRATION_NEEDED\",\n \"indices\" : [ ]\n },\n {\n \"feature_name\" : \"security\",\n \"minimum_index_version\" : \"8100099\",\n \"migration_status\" : \"NO_MIGRATION_NEEDED\",\n \"indices\" : [ ]\n },\n {\n \"feature_name\" : \"synonyms\",\n \"minimum_index_version\" : \"8100099\",\n \"migration_status\" : \"NO_MIGRATION_NEEDED\",\n \"indices\" : [ ]\n },\n {\n \"feature_name\" : \"tasks\",\n \"minimum_index_version\" : \"8100099\",\n \"migration_status\" : \"NO_MIGRATION_NEEDED\",\n \"indices\" : [ ]\n },\n {\n \"feature_name\" : \"transform\",\n \"minimum_index_version\" : \"8100099\",\n \"migration_status\" : \"NO_MIGRATION_NEEDED\",\n \"indices\" : [ ]\n },\n {\n \"feature_name\" : \"watcher\",\n \"minimum_index_version\" : \"8100099\",\n \"migration_status\" : \"NO_MIGRATION_NEEDED\",\n \"indices\" : [ ]\n }\n ],\n \"migration_status\" : \"NO_MIGRATION_NEEDED\"\n}" x-state: Generally available; Added in 7.16.0 x-codeSamples: - lang: Console source: "GET /_migration/system_features\n" - lang: Python source: resp = client.migration.get_feature_upgrade_status() - lang: JavaScript source: const response = await client.migration.getFeatureUpgradeStatus(); - lang: Ruby source: response = client.migration.get_feature_upgrade_status - lang: PHP source: $resp = $client->migration()->getFeatureUpgradeStatus(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_migration/system_features"' - lang: Java source: "client.migration().getFeatureUpgradeStatus();\n" x-metaTags: - content: Elasticsearch name: product_name post: tags: - migration summary: Start the feature migration description: "Version upgrades sometimes require changes to how features store configuration information and data in system indices.\nThis API starts the automatic migration process.\n\nSome functionality might be temporarily unavailable during the migration process.\n\nTIP: The API is designed for indirect use by the Upgrade Assistant. We strongly recommend you use the Upgrade Assistant.\n\n## Required authorization\n\n* Index privileges: `manage`\n* Cluster privileges: `manage`\n" operationId: migration-post-feature-upgrade responses: '200': description: '' content: application/json: schema: required: - accepted type: object properties: accepted: type: boolean features: type: array items: $ref: '#/components/schemas/migration.post_feature_upgrade.MigrationFeature' reason: type: string examples: PostFeatureUpgradeResponseExample1: description: "When you run `POST /_migration/system_features` to start the migration process, the response lists the features that will be migrated.\n" value: "{\n \"accepted\" : true,\n \"features\" : [\n {\n \"feature_name\" : \"security\"\n }\n ]\n}" x-state: Generally available; Added in 7.16.0 x-codeSamples: - lang: Console source: "POST /_migration/system_features\n" - lang: Python source: resp = client.migration.post_feature_upgrade() - lang: JavaScript source: const response = await client.migration.postFeatureUpgrade(); - lang: Ruby source: response = client.migration.post_feature_upgrade - lang: PHP source: $resp = $client->migration()->postFeatureUpgrade(); - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_migration/system_features"' - lang: Java source: "client.migration().postFeatureUpgrade();\n" x-metaTags: - content: Elasticsearch name: product_name '/_ml/trained_models/{model_id}/deployment/cache/_clear': post: tags: - ml trained model summary: Clear trained model deployment cache description: "Cache will be cleared on all nodes where the trained model is assigned.\nA trained model deployment may have an inference cache enabled.\nAs requests are handled by each allocated node, their responses may be cached on that individual node.\nCalling this API clears the caches without restarting the deployment.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-clear-trained-model-deployment-cache parameters: - name: model_id in: path description: The unique identifier of the trained model. required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: required: - cleared type: object properties: cleared: type: boolean examples: MlClearTrainedModelDeploymentCacheResponseExample1: description: A successful response when clearing the inference cache. value: "{\n \"cleared\": true\n}" x-state: Generally available; Added in 8.5.0 x-codeSamples: - lang: Console source: "POST _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/cache/_clear\n" - lang: Python source: "resp = client.ml.clear_trained_model_deployment_cache(\n model_id=\"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n)" - lang: JavaScript source: "const response = await client.ml.clearTrainedModelDeploymentCache({\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n});" - lang: Ruby source: "response = client.ml.clear_trained_model_deployment_cache(\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\"\n)" - lang: PHP source: "$resp = $client->ml()->clearTrainedModelDeploymentCache([\n \"model_id\" => \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/cache/_clear"' - lang: C# source: 'var response = await client.MachineLearning.ClearTrainedModelDeploymentCacheAsync(modelId: "elastic__distilbert-base-uncased-finetuned-conll03-english");' - lang: Java source: "client.ml().clearTrainedModelDeploymentCache(c -> c\n .modelId(\"elastic__distilbert-base-uncased-finetuned-conll03-english\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/anomaly_detectors/{job_id}/_close': post: tags: - ml anomaly summary: Close anomaly detection jobs description: "A job can be opened and closed multiple times throughout its lifecycle. A closed job cannot receive data or perform analysis operations, but you can still explore and navigate results.\nWhen you close a job, it runs housekeeping tasks such as pruning the model history, flushing buffers, calculating final results and persisting the model snapshots. Depending upon the size of the job, it could take several minutes to close and the equivalent time to re-open. After it is closed, the job has a minimal overhead on the cluster except for maintaining its meta data. Therefore it is a best practice to close jobs that are no longer required to process data.\nIf you close an anomaly detection job whose datafeed is running, the request first tries to stop the datafeed. This behavior is equivalent to calling stop datafeed API with the same timeout and force parameters as the close job request.\nWhen a datafeed that has a specified end date stops, it automatically closes its associated job.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-close-job parameters: - name: job_id in: path description: 'Identifier for the anomaly detection job. It can be a job identifier, a group name, or a wildcard expression. You can close multiple anomaly detection jobs in a single API request by using a group name, a comma-separated list of jobs, or a wildcard expression. You can close all jobs by using `_all` or by specifying `*` as the job identifier.' required: true schema: $ref: '#/components/schemas/_types.Id' - name: allow_no_match in: query description: "Specifies what to do when the request: contains wildcard expressions and there are no jobs that match; contains the `_all` string or no identifiers and there are no matches; or contains wildcard expressions and there are only partial matches. By default, it returns an empty jobs array when there are no matches and the subset of results when there are partial matches.\nIf `false`, the request returns a 404 status code when there are no matches or only partial matches." schema: type: boolean default: true - name: force in: query description: "Use to close a failed job, or to forcefully close a job which has not responded to its initial close request; the request returns without performing the associated actions such as flushing buffers and persisting the model snapshots.\nIf you want the job to be in a consistent state after the close job API returns, do not set to `true`. This parameter should be used only in situations where the job has already failed or where you are not interested in results the job might have recently produced or might produce in the future." schema: type: boolean default: false - name: timeout in: query description: Controls the time to wait until a job has closed. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30m requestBody: content: application/json: schema: type: object properties: allow_no_match: type: boolean description: Refer to the description for the `allow_no_match` query parameter. default: true force: type: boolean description: Refer to the descriptiion for the `force` query parameter. default: false timeout: allOf: - $ref: '#/components/schemas/_types.Duration' description: Refer to the description for the `timeout` query parameter. default: 30m responses: '200': description: '' content: application/json: schema: required: - closed type: object properties: closed: type: boolean examples: MlCloseJobResponseExample1: description: A successful response when closing anomaly detection jobs. value: "{\n \"closed\": true\n}" x-state: Generally available; Added in 5.4.0 x-codeSamples: - lang: Console source: "POST _ml/anomaly_detectors/low_request_rate/_close\n" - lang: Python source: "resp = client.ml.close_job(\n job_id=\"low_request_rate\",\n)" - lang: JavaScript source: "const response = await client.ml.closeJob({\n job_id: \"low_request_rate\",\n});" - lang: Ruby source: "response = client.ml.close_job(\n job_id: \"low_request_rate\"\n)" - lang: PHP source: "$resp = $client->ml()->closeJob([\n \"job_id\" => \"low_request_rate\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/_close"' - lang: C# source: 'var response = await client.MachineLearning.CloseJobAsync(jobId: "low_request_rate");' - lang: Java source: "client.ml().closeJob(c -> c\n .jobId(\"low_request_rate\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/calendars/{calendar_id}': put: tags: - ml anomaly summary: Create a calendar description: "\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-put-calendar parameters: - name: calendar_id in: path description: A string that uniquely identifies a calendar. required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: type: object properties: job_ids: type: array items: $ref: '#/components/schemas/_types.Id' description: An array of anomaly detection job identifiers. description: type: string description: A description of the calendar. responses: '200': description: '' content: application/json: schema: required: - calendar_id - job_ids type: object properties: calendar_id: allOf: - $ref: '#/components/schemas/_types.Id' description: A string that uniquely identifies a calendar. description: type: string description: A description of the calendar. job_ids: allOf: - $ref: '#/components/schemas/_types.Ids' description: A list of anomaly detection job identifiers or group names. x-state: Generally available; Added in 6.2.0 x-codeSamples: - lang: Console source: "PUT _ml/calendars/planned-outages\n" - lang: Python source: "resp = client.ml.put_calendar(\n calendar_id=\"planned-outages\",\n)" - lang: JavaScript source: "const response = await client.ml.putCalendar({\n calendar_id: \"planned-outages\",\n});" - lang: Ruby source: "response = client.ml.put_calendar(\n calendar_id: \"planned-outages\"\n)" - lang: PHP source: "$resp = $client->ml()->putCalendar([\n \"calendar_id\" => \"planned-outages\",\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/calendars/planned-outages"' - lang: C# source: 'var response = await client.MachineLearning.PutCalendarAsync(calendarId: "planned-outages");' - lang: Java source: "client.ml().putCalendar(p -> p\n .calendarId(\"planned-outages\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name post: tags: - ml anomaly summary: "Get calendar configuration info\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ml/calendars\n
\n
\n POST\n /_ml/calendars\n
\n
\n GET\n /_ml/calendars/{calendar_id}\n
\n
\n POST\n /_ml/calendars/{calendar_id}\n
\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: ml-get-calendars parameters: - $ref: '#/components/parameters/ml.get_calendars-calendar_id' - $ref: '#/components/parameters/ml.get_calendars-from' - $ref: '#/components/parameters/ml.get_calendars-size' requestBody: $ref: '#/components/requestBodies/ml.get_calendars' responses: '200': $ref: '#/components/responses/ml.get_calendars-200' x-state: Generally available; Added in 6.2.0 x-codeSamples: - lang: Console source: "GET _ml/calendars/planned-outages\n" - lang: Python source: "resp = client.ml.get_calendars(\n calendar_id=\"planned-outages\",\n)" - lang: JavaScript source: "const response = await client.ml.getCalendars({\n calendar_id: \"planned-outages\",\n});" - lang: Ruby source: "response = client.ml.get_calendars(\n calendar_id: \"planned-outages\"\n)" - lang: PHP source: "$resp = $client->ml()->getCalendars([\n \"calendar_id\" => \"planned-outages\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/calendars/planned-outages"' - lang: C# source: "var response = await client.MachineLearning\n .GetCalendarsAsync(d1 => d1\n .CalendarId(\"planned-outages\")\n );" - lang: Java source: "client.ml().getCalendars(g -> g\n .calendarId(\"planned-outages\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name delete: tags: - ml anomaly summary: Delete a calendar description: "Remove all scheduled events from a calendar, then delete it.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-delete-calendar parameters: - name: calendar_id in: path description: A string that uniquely identifies a calendar. required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: MlDeleteCalendarResponseExample1: description: A successful response when deleting a calendar. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 6.2.0 x-codeSamples: - lang: Console source: "DELETE _ml/calendars/planned-outages\n" - lang: Python source: "resp = client.ml.delete_calendar(\n calendar_id=\"planned-outages\",\n)" - lang: JavaScript source: "const response = await client.ml.deleteCalendar({\n calendar_id: \"planned-outages\",\n});" - lang: Ruby source: "response = client.ml.delete_calendar(\n calendar_id: \"planned-outages\"\n)" - lang: PHP source: "$resp = $client->ml()->deleteCalendar([\n \"calendar_id\" => \"planned-outages\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/calendars/planned-outages"' - lang: C# source: 'var response = await client.MachineLearning.DeleteCalendarAsync(calendarId: "planned-outages");' - lang: Java source: "client.ml().deleteCalendar(d -> d\n .calendarId(\"planned-outages\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/calendars/{calendar_id}/events/{event_id}': delete: tags: - ml anomaly summary: Delete events from a calendar description: "\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-delete-calendar-event parameters: - name: calendar_id in: path description: A string that uniquely identifies a calendar. required: true schema: $ref: '#/components/schemas/_types.Id' - name: event_id in: path description: "Identifier for the scheduled event.\nYou can obtain this identifier by using the get calendar events API." required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: MlDeleteCalendarEventResponseExample1: description: A successful response when deleting a calendar event. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 6.2.0 x-codeSamples: - lang: Console source: "DELETE _ml/calendars/planned-outages/events/LS8LJGEBMTCMA-qz49st\n" - lang: Python source: "resp = client.ml.delete_calendar_event(\n calendar_id=\"planned-outages\",\n event_id=\"LS8LJGEBMTCMA-qz49st\",\n)" - lang: JavaScript source: "const response = await client.ml.deleteCalendarEvent({\n calendar_id: \"planned-outages\",\n event_id: \"LS8LJGEBMTCMA-qz49st\",\n});" - lang: Ruby source: "response = client.ml.delete_calendar_event(\n calendar_id: \"planned-outages\",\n event_id: \"LS8LJGEBMTCMA-qz49st\"\n)" - lang: PHP source: "$resp = $client->ml()->deleteCalendarEvent([\n \"calendar_id\" => \"planned-outages\",\n \"event_id\" => \"LS8LJGEBMTCMA-qz49st\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/calendars/planned-outages/events/LS8LJGEBMTCMA-qz49st"' - lang: C# source: 'var response = await client.MachineLearning.DeleteCalendarEventAsync(calendarId: "planned-outages", eventId: "LS8LJGEBMTCMA-qz49st");' - lang: Java source: "client.ml().deleteCalendarEvent(d -> d\n .calendarId(\"planned-outages\")\n .eventId(\"LS8LJGEBMTCMA-qz49st\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/calendars/{calendar_id}/jobs/{job_id}': put: tags: - ml anomaly summary: Add anomaly detection job to calendar description: "\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-put-calendar-job parameters: - name: calendar_id in: path description: A string that uniquely identifies a calendar. required: true schema: $ref: '#/components/schemas/_types.Id' - name: job_id in: path description: 'An identifier for the anomaly detection jobs. It can be a job identifier, a group name, or a comma-separated list of jobs or groups.' required: true schema: $ref: '#/components/schemas/_types.Ids' responses: '200': description: '' content: application/json: schema: required: - calendar_id - job_ids type: object properties: calendar_id: allOf: - $ref: '#/components/schemas/_types.Id' description: A string that uniquely identifies a calendar. description: type: string description: A description of the calendar. job_ids: allOf: - $ref: '#/components/schemas/_types.Ids' description: A list of anomaly detection job identifiers or group names. x-state: Generally available; Added in 6.2.0 x-codeSamples: - lang: Console source: "PUT _ml/calendars/planned-outages/jobs/total-requests\n" - lang: Python source: "resp = client.ml.put_calendar_job(\n calendar_id=\"planned-outages\",\n job_id=\"total-requests\",\n)" - lang: JavaScript source: "const response = await client.ml.putCalendarJob({\n calendar_id: \"planned-outages\",\n job_id: \"total-requests\",\n});" - lang: Ruby source: "response = client.ml.put_calendar_job(\n calendar_id: \"planned-outages\",\n job_id: \"total-requests\"\n)" - lang: PHP source: "$resp = $client->ml()->putCalendarJob([\n \"calendar_id\" => \"planned-outages\",\n \"job_id\" => \"total-requests\",\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/calendars/planned-outages/jobs/total-requests"' - lang: C# source: 'var response = await client.MachineLearning.PutCalendarJobAsync(calendarId: "planned-outages", jobId: new[] { "total-requests" });' - lang: Java source: "client.ml().putCalendarJob(p -> p\n .calendarId(\"planned-outages\")\n .jobId(\"total-requests\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name delete: tags: - ml anomaly summary: Delete anomaly jobs from a calendar description: "\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-delete-calendar-job parameters: - name: calendar_id in: path description: A string that uniquely identifies a calendar. required: true schema: $ref: '#/components/schemas/_types.Id' - name: job_id in: path description: "An identifier for the anomaly detection jobs. It can be a job identifier, a group name, or a\ncomma-separated list of jobs or groups." required: true schema: $ref: '#/components/schemas/_types.Ids' responses: '200': description: '' content: application/json: schema: required: - calendar_id - job_ids type: object properties: calendar_id: allOf: - $ref: '#/components/schemas/_types.Id' description: A string that uniquely identifies a calendar. description: type: string description: A description of the calendar. job_ids: allOf: - $ref: '#/components/schemas/_types.Ids' description: A list of anomaly detection job identifiers or group names. examples: MlDeleteCalendarJobResponseExample1: description: A successful response when deleting an anomaly detection job from a calendar. value: "{\n \"calendar_id\": \"planned-outages\",\n \"job_ids\": []\n}" x-state: Generally available; Added in 6.2.0 x-codeSamples: - lang: Console source: "DELETE _ml/calendars/planned-outages/jobs/total-requests\n" - lang: Python source: "resp = client.ml.delete_calendar_job(\n calendar_id=\"planned-outages\",\n job_id=\"total-requests\",\n)" - lang: JavaScript source: "const response = await client.ml.deleteCalendarJob({\n calendar_id: \"planned-outages\",\n job_id: \"total-requests\",\n});" - lang: Ruby source: "response = client.ml.delete_calendar_job(\n calendar_id: \"planned-outages\",\n job_id: \"total-requests\"\n)" - lang: PHP source: "$resp = $client->ml()->deleteCalendarJob([\n \"calendar_id\" => \"planned-outages\",\n \"job_id\" => \"total-requests\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/calendars/planned-outages/jobs/total-requests"' - lang: C# source: 'var response = await client.MachineLearning.DeleteCalendarJobAsync(calendarId: "planned-outages", jobId: new[] { "total-requests" });' - lang: Java source: "client.ml().deleteCalendarJob(d -> d\n .calendarId(\"planned-outages\")\n .jobId(\"total-requests\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/data_frame/analytics/{id}': get: tags: - ml data frame summary: "Get data frame analytics job configuration info\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ml/data_frame/analytics\n
\n
\n GET\n /_ml/data_frame/analytics/{id}\n
\n \n\nYou can get information for multiple data frame analytics jobs in a single\nAPI request by using a comma-separated list of data frame analytics jobs or a\nwildcard expression.\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: ml-get-data-frame-analytics parameters: - $ref: '#/components/parameters/ml.get_data_frame_analytics-id' - $ref: '#/components/parameters/ml.get_data_frame_analytics-allow_no_match' - $ref: '#/components/parameters/ml.get_data_frame_analytics-from' - $ref: '#/components/parameters/ml.get_data_frame_analytics-size' - $ref: '#/components/parameters/ml.get_data_frame_analytics-exclude_generated' responses: '200': $ref: '#/components/responses/ml.get_data_frame_analytics-200' x-state: Generally available; Added in 7.3.0 x-codeSamples: - lang: Console source: "GET _ml/data_frame/analytics/loganalytics\n" - lang: Python source: "resp = client.ml.get_data_frame_analytics(\n id=\"loganalytics\",\n)" - lang: JavaScript source: "const response = await client.ml.getDataFrameAnalytics({\n id: \"loganalytics\",\n});" - lang: Ruby source: "response = client.ml.get_data_frame_analytics(\n id: \"loganalytics\"\n)" - lang: PHP source: "$resp = $client->ml()->getDataFrameAnalytics([\n \"id\" => \"loganalytics\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics"' - lang: C# source: "var response = await client.MachineLearning\n .GetDataFrameAnalyticsAsync(d1 => d1\n .Id(\"loganalytics\")\n );" - lang: Java source: "client.ml().getDataFrameAnalytics(g -> g\n .id(\"loganalytics\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name put: tags: - ml data frame summary: Create a data frame analytics job description: "This API creates a data frame analytics job that performs an analysis on the\nsource indices and stores the outcome in a destination index.\nBy default, the query used in the source configuration is `{\"match_all\": {}}`.\n\nIf the destination index does not exist, it is created automatically when you start the job.\n\nIf you supply only a subset of the regression or classification parameters, hyperparameter optimization occurs. It determines a value for each of the undefined parameters.\n\n## Required authorization\n\n* Index privileges: `create_index`,`index`,`manage`,`read`,`view_index_metadata`\n* Cluster privileges: `manage_ml`\n" operationId: ml-put-data-frame-analytics parameters: - name: id in: path description: "Identifier for the data frame analytics job. This identifier can contain\nlowercase alphanumeric characters (a-z and 0-9), hyphens, and\nunderscores. It must start and end with alphanumeric characters." required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: required: - analysis - dest - source type: object properties: allow_lazy_start: type: boolean description: "Specifies whether this job can start when there is insufficient machine\nlearning node capacity for it to be immediately assigned to a node. If\nset to `false` and a machine learning node with capacity to run the job\ncannot be immediately found, the API returns an error. If set to `true`,\nthe API does not return an error; the job waits in the `starting` state\nuntil sufficient machine learning node capacity is available. This\nbehavior is also affected by the cluster-wide\n`xpack.ml.max_lazy_ml_nodes` setting." default: false analysis: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalysisContainer' description: "The analysis configuration, which contains the information necessary to\nperform one of the following types of analysis: classification, outlier\ndetection, or regression." analyzed_fields: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalysisAnalyzedFields' description: "Specifies `includes` and/or `excludes` patterns to select which fields\nwill be included in the analysis. The patterns specified in `excludes`\nare applied last, therefore `excludes` takes precedence. In other words,\nif the same field is specified in both `includes` and `excludes`, then\nthe field will not be included in the analysis. If `analyzed_fields` is\nnot set, only the relevant fields will be included. For example, all the\nnumeric fields for outlier detection.\nThe supported fields vary for each type of analysis. Outlier detection\nrequires numeric or `boolean` data to analyze. The algorithms don’t\nsupport missing values therefore fields that have data types other than\nnumeric or boolean are ignored. Documents where included fields contain\nmissing values, null values, or an array are also ignored. Therefore the\n`dest` index may contain documents that don’t have an outlier score.\nRegression supports fields that are numeric, `boolean`, `text`,\n`keyword`, and `ip` data types. It is also tolerant of missing values.\nFields that are supported are included in the analysis, other fields are\nignored. Documents where included fields contain an array with two or\nmore values are also ignored. Documents in the `dest` index that don’t\ncontain a results field are not included in the regression analysis.\nClassification supports fields that are numeric, `boolean`, `text`,\n`keyword`, and `ip` data types. It is also tolerant of missing values.\nFields that are supported are included in the analysis, other fields are\nignored. Documents where included fields contain an array with two or\nmore values are also ignored. Documents in the `dest` index that don’t\ncontain a results field are not included in the classification analysis.\nClassification analysis can be improved by mapping ordinal variable\nvalues to a single number. For example, in case of age ranges, you can\nmodel the values as `0-14 = 0`, `15-24 = 1`, `25-34 = 2`, and so on." description: type: string description: A description of the job. dest: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalyticsDestination' description: The destination configuration. max_num_threads: type: number description: "The maximum number of threads to be used by the analysis. Using more\nthreads may decrease the time necessary to complete the analysis at the\ncost of using more CPU. Note that the process may use additional threads\nfor operational functionality other than the analysis itself." default: 1 _meta: allOf: - $ref: '#/components/schemas/_types.Metadata' model_memory_limit: type: string description: "The approximate maximum amount of memory resources that are permitted for\nanalytical processing. If your `elasticsearch.yml` file contains an\n`xpack.ml.max_model_memory_limit` setting, an error occurs when you try\nto create data frame analytics jobs that have `model_memory_limit` values\ngreater than that setting." default: 1gb source: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalyticsSource' description: The configuration of how to source the analysis data. headers: allOf: - $ref: '#/components/schemas/_types.HttpHeaders' x-state: Generally available; Added in 8.0.0 version: allOf: - $ref: '#/components/schemas/_types.VersionString' x-state: Generally available; Added in 7.16.0 examples: MlPutDataFrameAnalyticsExample1: description: An example body for a `PUT _ml/data_frame/analytics/model-flight-delays-pre` request. value: "{\n \"source\": {\n \"index\": [\n \"kibana_sample_data_flights\"\n ],\n \"query\": {\n \"range\": {\n \"DistanceKilometers\": {\n \"gt\": 0\n }\n }\n },\n \"_source\": {\n \"includes\": [],\n \"excludes\": [\n \"FlightDelay\",\n \"FlightDelayType\"\n ]\n }\n },\n \"dest\": {\n \"index\": \"df-flight-delays\",\n \"results_field\": \"ml-results\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"FlightDelayMin\",\n \"training_percent\": 90\n }\n },\n \"analyzed_fields\": {\n \"includes\": [],\n \"excludes\": [\n \"FlightNum\"\n ]\n },\n \"model_memory_limit\": \"100mb\"\n}" x-codeSamples: - lang: Console source: "PUT _ml/data_frame/analytics/model-flight-delays-pre\n{\n \"source\": {\n \"index\": [\n \"kibana_sample_data_flights\"\n ],\n \"query\": {\n \"range\": {\n \"DistanceKilometers\": {\n \"gt\": 0\n }\n }\n },\n \"_source\": {\n \"includes\": [],\n \"excludes\": [\n \"FlightDelay\",\n \"FlightDelayType\"\n ]\n }\n },\n \"dest\": {\n \"index\": \"df-flight-delays\",\n \"results_field\": \"ml-results\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"FlightDelayMin\",\n \"training_percent\": 90\n }\n },\n \"analyzed_fields\": {\n \"includes\": [],\n \"excludes\": [\n \"FlightNum\"\n ]\n },\n \"model_memory_limit\": \"100mb\"\n}" - lang: Python source: "resp = client.ml.put_data_frame_analytics(\n id=\"model-flight-delays-pre\",\n source={\n \"index\": [\n \"kibana_sample_data_flights\"\n ],\n \"query\": {\n \"range\": {\n \"DistanceKilometers\": {\n \"gt\": 0\n }\n }\n },\n \"_source\": {\n \"includes\": [],\n \"excludes\": [\n \"FlightDelay\",\n \"FlightDelayType\"\n ]\n }\n },\n dest={\n \"index\": \"df-flight-delays\",\n \"results_field\": \"ml-results\"\n },\n analysis={\n \"regression\": {\n \"dependent_variable\": \"FlightDelayMin\",\n \"training_percent\": 90\n }\n },\n analyzed_fields={\n \"includes\": [],\n \"excludes\": [\n \"FlightNum\"\n ]\n },\n model_memory_limit=\"100mb\",\n)" - lang: JavaScript source: "const response = await client.ml.putDataFrameAnalytics({\n id: \"model-flight-delays-pre\",\n source: {\n index: [\"kibana_sample_data_flights\"],\n query: {\n range: {\n DistanceKilometers: {\n gt: 0,\n },\n },\n },\n _source: {\n includes: [],\n excludes: [\"FlightDelay\", \"FlightDelayType\"],\n },\n },\n dest: {\n index: \"df-flight-delays\",\n results_field: \"ml-results\",\n },\n analysis: {\n regression: {\n dependent_variable: \"FlightDelayMin\",\n training_percent: 90,\n },\n },\n analyzed_fields: {\n includes: [],\n excludes: [\"FlightNum\"],\n },\n model_memory_limit: \"100mb\",\n});" - lang: Ruby source: "response = client.ml.put_data_frame_analytics(\n id: \"model-flight-delays-pre\",\n body: {\n \"source\": {\n \"index\": [\n \"kibana_sample_data_flights\"\n ],\n \"query\": {\n \"range\": {\n \"DistanceKilometers\": {\n \"gt\": 0\n }\n }\n },\n \"_source\": {\n \"includes\": [],\n \"excludes\": [\n \"FlightDelay\",\n \"FlightDelayType\"\n ]\n }\n },\n \"dest\": {\n \"index\": \"df-flight-delays\",\n \"results_field\": \"ml-results\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"FlightDelayMin\",\n \"training_percent\": 90\n }\n },\n \"analyzed_fields\": {\n \"includes\": [],\n \"excludes\": [\n \"FlightNum\"\n ]\n },\n \"model_memory_limit\": \"100mb\"\n }\n)" - lang: PHP source: "$resp = $client->ml()->putDataFrameAnalytics([\n \"id\" => \"model-flight-delays-pre\",\n \"body\" => [\n \"source\" => [\n \"index\" => array(\n \"kibana_sample_data_flights\",\n ),\n \"query\" => [\n \"range\" => [\n \"DistanceKilometers\" => [\n \"gt\" => 0,\n ],\n ],\n ],\n \"_source\" => [\n \"includes\" => array(\n ),\n \"excludes\" => array(\n \"FlightDelay\",\n \"FlightDelayType\",\n ),\n ],\n ],\n \"dest\" => [\n \"index\" => \"df-flight-delays\",\n \"results_field\" => \"ml-results\",\n ],\n \"analysis\" => [\n \"regression\" => [\n \"dependent_variable\" => \"FlightDelayMin\",\n \"training_percent\" => 90,\n ],\n ],\n \"analyzed_fields\" => [\n \"includes\" => array(\n ),\n \"excludes\" => array(\n \"FlightNum\",\n ),\n ],\n \"model_memory_limit\" => \"100mb\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"index":["kibana_sample_data_flights"],"query":{"range":{"DistanceKilometers":{"gt":0}}},"_source":{"includes":[],"excludes":["FlightDelay","FlightDelayType"]}},"dest":{"index":"df-flight-delays","results_field":"ml-results"},"analysis":{"regression":{"dependent_variable":"FlightDelayMin","training_percent":90}},"analyzed_fields":{"includes":[],"excludes":["FlightNum"]},"model_memory_limit":"100mb"}'' "$ELASTICSEARCH_URL/_ml/data_frame/analytics/model-flight-delays-pre"' - lang: C# source: "var response = await client.MachineLearning\n .PutDataFrameAnalyticsAsync(id: \"model-flight-delays-pre\", d1 => d1\n .Analysis(d2 => d2\n .Regression(d3 => d3\n .DependentVariable(\"FlightDelayMin\")\n .TrainingPercent(new Percentage(90f))\n )\n )\n .AnalyzedFields(d2 => d2\n .Excludes(\"FlightNum\")\n .Includes()\n )\n .Dest(d2 => d2\n .Index(\"df-flight-delays\")\n .ResultsField(x => x.MlResults)\n )\n .ModelMemoryLimit(\"100mb\")\n .Source(d2 => d2\n .Indices(new[] { \"kibana_sample_data_flights\" })\n .Query(d3 => d3\n .Range(new UntypedRangeQuery()\n {\n Field = global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.DistanceKilometers),\n Gt = 0\n })\n )\n .Source(d3 => d3\n .Excludes(\"FlightDelay\", \"FlightDelayType\")\n .Includes()\n )\n )\n );" - lang: Java source: "client.ml().putDataFrameAnalytics(p -> p\n .analysis(a -> a\n .regression(r -> r\n .dependentVariable(\"FlightDelayMin\")\n .trainingPercent(\"90\")\n )\n )\n .analyzedFields(an -> an\n .includes(List.of())\n .excludes(\"FlightNum\")\n )\n .dest(d -> d\n .index(\"df-flight-delays\")\n .resultsField(\"ml-results\")\n )\n .id(\"model-flight-delays-pre\")\n .modelMemoryLimit(\"100mb\")\n .source(s -> s\n .index(\"kibana_sample_data_flights\")\n .query(q -> q\n .range(r -> r\n .untyped(u -> u\n .field(\"DistanceKilometers\")\n .gt(JsonData.fromJson(\"0\"))\n )\n )\n )\n .source(so -> so\n .includes(List.of())\n .excludes(List.of(\"FlightDelay\",\"FlightDelayType\"))\n )\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - allow_lazy_start - analysis - create_time - dest - id - max_num_threads - model_memory_limit - source - version type: object properties: authorization: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalyticsAuthorization' allow_lazy_start: type: boolean analysis: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalysisContainer' analyzed_fields: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalysisAnalyzedFields' create_time: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: type: string dest: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalyticsDestination' id: allOf: - $ref: '#/components/schemas/_types.Id' max_num_threads: type: number _meta: allOf: - $ref: '#/components/schemas/_types.Metadata' model_memory_limit: type: string source: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalyticsSource' version: allOf: - $ref: '#/components/schemas/_types.VersionString' x-state: Generally available; Added in 7.3.0 x-codeSamples: - lang: Console source: "PUT _ml/data_frame/analytics/model-flight-delays-pre\n{\n \"source\": {\n \"index\": [\n \"kibana_sample_data_flights\"\n ],\n \"query\": {\n \"range\": {\n \"DistanceKilometers\": {\n \"gt\": 0\n }\n }\n },\n \"_source\": {\n \"includes\": [],\n \"excludes\": [\n \"FlightDelay\",\n \"FlightDelayType\"\n ]\n }\n },\n \"dest\": {\n \"index\": \"df-flight-delays\",\n \"results_field\": \"ml-results\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"FlightDelayMin\",\n \"training_percent\": 90\n }\n },\n \"analyzed_fields\": {\n \"includes\": [],\n \"excludes\": [\n \"FlightNum\"\n ]\n },\n \"model_memory_limit\": \"100mb\"\n}" - lang: Python source: "resp = client.ml.put_data_frame_analytics(\n id=\"model-flight-delays-pre\",\n source={\n \"index\": [\n \"kibana_sample_data_flights\"\n ],\n \"query\": {\n \"range\": {\n \"DistanceKilometers\": {\n \"gt\": 0\n }\n }\n },\n \"_source\": {\n \"includes\": [],\n \"excludes\": [\n \"FlightDelay\",\n \"FlightDelayType\"\n ]\n }\n },\n dest={\n \"index\": \"df-flight-delays\",\n \"results_field\": \"ml-results\"\n },\n analysis={\n \"regression\": {\n \"dependent_variable\": \"FlightDelayMin\",\n \"training_percent\": 90\n }\n },\n analyzed_fields={\n \"includes\": [],\n \"excludes\": [\n \"FlightNum\"\n ]\n },\n model_memory_limit=\"100mb\",\n)" - lang: JavaScript source: "const response = await client.ml.putDataFrameAnalytics({\n id: \"model-flight-delays-pre\",\n source: {\n index: [\"kibana_sample_data_flights\"],\n query: {\n range: {\n DistanceKilometers: {\n gt: 0,\n },\n },\n },\n _source: {\n includes: [],\n excludes: [\"FlightDelay\", \"FlightDelayType\"],\n },\n },\n dest: {\n index: \"df-flight-delays\",\n results_field: \"ml-results\",\n },\n analysis: {\n regression: {\n dependent_variable: \"FlightDelayMin\",\n training_percent: 90,\n },\n },\n analyzed_fields: {\n includes: [],\n excludes: [\"FlightNum\"],\n },\n model_memory_limit: \"100mb\",\n});" - lang: Ruby source: "response = client.ml.put_data_frame_analytics(\n id: \"model-flight-delays-pre\",\n body: {\n \"source\": {\n \"index\": [\n \"kibana_sample_data_flights\"\n ],\n \"query\": {\n \"range\": {\n \"DistanceKilometers\": {\n \"gt\": 0\n }\n }\n },\n \"_source\": {\n \"includes\": [],\n \"excludes\": [\n \"FlightDelay\",\n \"FlightDelayType\"\n ]\n }\n },\n \"dest\": {\n \"index\": \"df-flight-delays\",\n \"results_field\": \"ml-results\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"FlightDelayMin\",\n \"training_percent\": 90\n }\n },\n \"analyzed_fields\": {\n \"includes\": [],\n \"excludes\": [\n \"FlightNum\"\n ]\n },\n \"model_memory_limit\": \"100mb\"\n }\n)" - lang: PHP source: "$resp = $client->ml()->putDataFrameAnalytics([\n \"id\" => \"model-flight-delays-pre\",\n \"body\" => [\n \"source\" => [\n \"index\" => array(\n \"kibana_sample_data_flights\",\n ),\n \"query\" => [\n \"range\" => [\n \"DistanceKilometers\" => [\n \"gt\" => 0,\n ],\n ],\n ],\n \"_source\" => [\n \"includes\" => array(\n ),\n \"excludes\" => array(\n \"FlightDelay\",\n \"FlightDelayType\",\n ),\n ],\n ],\n \"dest\" => [\n \"index\" => \"df-flight-delays\",\n \"results_field\" => \"ml-results\",\n ],\n \"analysis\" => [\n \"regression\" => [\n \"dependent_variable\" => \"FlightDelayMin\",\n \"training_percent\" => 90,\n ],\n ],\n \"analyzed_fields\" => [\n \"includes\" => array(\n ),\n \"excludes\" => array(\n \"FlightNum\",\n ),\n ],\n \"model_memory_limit\" => \"100mb\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"index":["kibana_sample_data_flights"],"query":{"range":{"DistanceKilometers":{"gt":0}}},"_source":{"includes":[],"excludes":["FlightDelay","FlightDelayType"]}},"dest":{"index":"df-flight-delays","results_field":"ml-results"},"analysis":{"regression":{"dependent_variable":"FlightDelayMin","training_percent":90}},"analyzed_fields":{"includes":[],"excludes":["FlightNum"]},"model_memory_limit":"100mb"}'' "$ELASTICSEARCH_URL/_ml/data_frame/analytics/model-flight-delays-pre"' - lang: C# source: "var response = await client.MachineLearning\n .PutDataFrameAnalyticsAsync(id: \"model-flight-delays-pre\", d1 => d1\n .Analysis(d2 => d2\n .Regression(d3 => d3\n .DependentVariable(\"FlightDelayMin\")\n .TrainingPercent(new Percentage(90f))\n )\n )\n .AnalyzedFields(d2 => d2\n .Excludes(\"FlightNum\")\n .Includes()\n )\n .Dest(d2 => d2\n .Index(\"df-flight-delays\")\n .ResultsField(x => x.MlResults)\n )\n .ModelMemoryLimit(\"100mb\")\n .Source(d2 => d2\n .Indices(new[] { \"kibana_sample_data_flights\" })\n .Query(d3 => d3\n .Range(new UntypedRangeQuery()\n {\n Field = global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.DistanceKilometers),\n Gt = 0\n })\n )\n .Source(d3 => d3\n .Excludes(\"FlightDelay\", \"FlightDelayType\")\n .Includes()\n )\n )\n );" - lang: Java source: "client.ml().putDataFrameAnalytics(p -> p\n .analysis(a -> a\n .regression(r -> r\n .dependentVariable(\"FlightDelayMin\")\n .trainingPercent(\"90\")\n )\n )\n .analyzedFields(an -> an\n .includes(List.of())\n .excludes(\"FlightNum\")\n )\n .dest(d -> d\n .index(\"df-flight-delays\")\n .resultsField(\"ml-results\")\n )\n .id(\"model-flight-delays-pre\")\n .modelMemoryLimit(\"100mb\")\n .source(s -> s\n .index(\"kibana_sample_data_flights\")\n .query(q -> q\n .range(r -> r\n .untyped(u -> u\n .field(\"DistanceKilometers\")\n .gt(JsonData.fromJson(\"0\"))\n )\n )\n )\n .source(so -> so\n .includes(List.of())\n .excludes(List.of(\"FlightDelay\",\"FlightDelayType\"))\n )\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name delete: tags: - ml data frame summary: Delete a data frame analytics job description: "\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-delete-data-frame-analytics parameters: - name: id in: path description: Identifier for the data frame analytics job. required: true schema: $ref: '#/components/schemas/_types.Id' - name: force in: query description: 'If `true`, it deletes a job that is not stopped; this method is quicker than stopping and deleting the job.' schema: type: boolean default: false - name: timeout in: query description: The time to wait for the job to be deleted. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 1m responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: MlDeleteDataFrameAnalyticsResponseExample1: description: A successful response when deleting a data frame analytics job. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 7.3.0 x-codeSamples: - lang: Console source: "DELETE _ml/data_frame/analytics/loganalytics\n" - lang: Python source: "resp = client.ml.delete_data_frame_analytics(\n id=\"loganalytics\",\n)" - lang: JavaScript source: "const response = await client.ml.deleteDataFrameAnalytics({\n id: \"loganalytics\",\n});" - lang: Ruby source: "response = client.ml.delete_data_frame_analytics(\n id: \"loganalytics\"\n)" - lang: PHP source: "$resp = $client->ml()->deleteDataFrameAnalytics([\n \"id\" => \"loganalytics\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics"' - lang: C# source: 'var response = await client.MachineLearning.DeleteDataFrameAnalyticsAsync(id: "loganalytics");' - lang: Java source: "client.ml().deleteDataFrameAnalytics(d -> d\n .id(\"loganalytics\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/datafeeds/{datafeed_id}': get: tags: - ml anomaly summary: "Get datafeeds configuration info\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ml/datafeeds\n
\n
\n GET\n /_ml/datafeeds/{datafeed_id}\n
\n \n\nYou can get information for multiple datafeeds in a single API request by\nusing a comma-separated list of datafeeds or a wildcard expression. You can\nget information for all datafeeds by using `_all`, by specifying `*` as the\n``, or by omitting the ``.\nThis API returns a maximum of 10,000 datafeeds.\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: ml-get-datafeeds parameters: - $ref: '#/components/parameters/ml.get_datafeeds-datafeed_id' - $ref: '#/components/parameters/ml.get_datafeeds-allow_no_match' - $ref: '#/components/parameters/ml.get_datafeeds-exclude_generated' responses: '200': $ref: '#/components/responses/ml.get_datafeeds-200' x-state: Generally available; Added in 5.5.0 x-codeSamples: - lang: Console source: "GET _ml/datafeeds/datafeed-high_sum_total_sales\n" - lang: Python source: "resp = client.ml.get_datafeeds(\n datafeed_id=\"datafeed-high_sum_total_sales\",\n)" - lang: JavaScript source: "const response = await client.ml.getDatafeeds({\n datafeed_id: \"datafeed-high_sum_total_sales\",\n});" - lang: Ruby source: "response = client.ml.get_datafeeds(\n datafeed_id: \"datafeed-high_sum_total_sales\"\n)" - lang: PHP source: "$resp = $client->ml()->getDatafeeds([\n \"datafeed_id\" => \"datafeed-high_sum_total_sales\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-high_sum_total_sales"' - lang: C# source: "var response = await client.MachineLearning\n .GetDatafeedsAsync(d1 => d1\n .DatafeedId(new[] { \"datafeed-high_sum_total_sales\" })\n );" - lang: Java source: "client.ml().getDatafeeds(g -> g\n .datafeedId(\"datafeed-high_sum_total_sales\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name put: tags: - ml anomaly summary: Create a datafeed description: "Datafeeds retrieve data from Elasticsearch for analysis by an anomaly detection job.\nYou can associate only one datafeed with each anomaly detection job.\nThe datafeed contains a query that runs at a defined interval (`frequency`).\nIf you are concerned about delayed data, you can add a delay (`query_delay') at each interval.\nBy default, the datafeed uses the following query: `{\"match_all\": {\"boost\": 1}}`.\n\nWhen Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had\nat the time of creation and runs the query using those same roles. If you provide secondary authorization headers,\nthose credentials are used instead.\nYou must use Kibana, this API, or the create anomaly detection jobs API to create a datafeed. Do not add a datafeed\ndirectly to the `.ml-config` index. Do not give users `write` privileges on the `.ml-config` index.\n\n## Required authorization\n\n* Index privileges: `read`\n* Cluster privileges: `manage_ml`\n" operationId: ml-put-datafeed parameters: - name: datafeed_id in: path description: "A numerical character string that uniquely identifies the datafeed.\nThis identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.\nIt must start and end with alphanumeric characters." required: true schema: $ref: '#/components/schemas/_types.Id' - name: allow_no_indices in: query description: "A setting that does two separate checks on the index expression.\nIf `false`, the request returns an error (1) if any wildcard expression\n(including `_all` and `*`) resolves to zero matching indices or (2) if the\ncomplete set of resolved indices, aliases or data streams is empty after all\nexpressions are evaluated. If `true`, index expressions that resolve to no\nindices are allowed and the request returns an empty result." schema: type: boolean default: true - name: expand_wildcards in: query description: "Type of index that wildcard patterns can match. If the request can target data streams, this argument determines\nwhether wildcard expressions match hidden data streams. Supports comma-separated values.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: open - name: ignore_throttled in: query description: 'If true, concrete, expanded, or aliased indices are ignored when frozen.' deprecated: true schema: type: boolean default: true - name: ignore_unavailable in: query description: "If `false`, the request returns an error if it targets a concrete (non-wildcarded)\nindex, alias, or data stream that is missing, closed, or otherwise unavailable.\nIf `true`, unavailable concrete targets are silently ignored." schema: type: boolean default: false requestBody: content: application/json: schema: type: object properties: aggregations: type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.AggregationContainer' description: "If set, the datafeed performs aggregation searches.\nSupport for aggregations is limited and should be used only with low cardinality data." chunking_config: allOf: - $ref: '#/components/schemas/ml._types.ChunkingConfig' description: "Datafeeds might be required to search over long time periods, for several months or years.\nThis search is split into time chunks in order to ensure the load on Elasticsearch is managed.\nChunking configuration controls how the size of these time chunks are calculated;\nit is an advanced configuration option." delayed_data_check_config: allOf: - $ref: '#/components/schemas/ml._types.DelayedDataCheckConfig' description: "Specifies whether the datafeed checks for missing data and the size of the window.\nThe datafeed can optionally search over indices that have already been read in an effort to determine whether\nany data has subsequently been added to the index. If missing data is found, it is a good indication that the\n`query_delay` is set too low and the data is being indexed after the datafeed has passed that moment in time.\nThis check runs only on real-time datafeeds." frequency: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The interval at which scheduled queries are made while the datafeed runs in real time.\nThe default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible\nfraction of the bucket span. When `frequency` is shorter than the bucket span, interim results for the last\n(partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses\naggregations, this value must be divisible by the interval of the date histogram aggregation." indices: allOf: - $ref: '#/components/schemas/_types.Indices' description: "An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the master\nnodes and the machine learning nodes must have the `remote_cluster_client` role." indices_options: allOf: - $ref: '#/components/schemas/_types.IndicesOptions' description: Specifies index expansion options that are used during search job_id: allOf: - $ref: '#/components/schemas/_types.Id' description: Identifier for the anomaly detection job. max_empty_searches: type: number description: "If a real-time datafeed has never seen any data (including during any initial training period), it automatically\nstops and closes the associated job after this many real-time searches return no documents. In other words,\nit stops after `frequency` times `max_empty_searches` of real-time operation. If not set, a datafeed with no\nend time that sees no data remains started until it is explicitly stopped. By default, it is not set." max_consecutive_extraction_failures: type: number description: "The maximum number of consecutive real-time data extraction failures the datafeed tolerates before it\nautomatically stops itself, leaving the associated job open. The consecutive-failure counter resets on any\ncycle that extracts successfully, including empty-data cycles. If not set, the threshold defaults to roughly\none day's worth of searches based on the datafeed `frequency` (floored at 1). Set to `-1` to disable auto-stop\nand retry indefinitely. Values of `0` or less than `-1` are rejected." query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: "The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an\nElasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this\nobject is passed verbatim to Elasticsearch." default: '{"match_all": {"boost": 1}}' query_delay: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might\nnot be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default\nvalue is randomly selected between `60s` and `120s`. This randomness improves the query performance\nwhen there are multiple jobs running on the same node." runtime_mappings: allOf: - $ref: '#/components/schemas/_types.mapping.RuntimeFields' description: Specifies runtime fields for the datafeed search. script_fields: type: object additionalProperties: $ref: '#/components/schemas/_types.ScriptField' description: "Specifies scripts that evaluate custom expressions and returns script fields to the datafeed.\nThe detector configuration objects in a job can contain functions that use these script fields." scroll_size: type: number description: "The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations.\nThe maximum value is the value of `index.max_result_window`, which is 10,000 by default." default: 1000 headers: allOf: - $ref: '#/components/schemas/_types.HttpHeaders' x-state: Generally available; Added in 8.0.0 examples: MlPutDatafeedExample1: description: An example body for a `PUT _ml/datafeeds/datafeed-test-job?pretty` request. value: "{\n \"indices\": [\n \"kibana_sample_data_logs\"\n ],\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n \"job_id\": \"test-job\"\n}" x-codeSamples: - lang: Console source: "PUT _ml/datafeeds/datafeed-test-job?pretty\n{\n \"indices\": [\n \"kibana_sample_data_logs\"\n ],\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n \"job_id\": \"test-job\"\n}" - lang: Python source: "resp = client.ml.put_datafeed(\n datafeed_id=\"datafeed-test-job\",\n pretty=True,\n indices=[\n \"kibana_sample_data_logs\"\n ],\n query={\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n job_id=\"test-job\",\n)" - lang: JavaScript source: "const response = await client.ml.putDatafeed({\n datafeed_id: \"datafeed-test-job\",\n pretty: \"true\",\n indices: [\"kibana_sample_data_logs\"],\n query: {\n bool: {\n must: [\n {\n match_all: {},\n },\n ],\n },\n },\n job_id: \"test-job\",\n});" - lang: Ruby source: "response = client.ml.put_datafeed(\n datafeed_id: \"datafeed-test-job\",\n pretty: \"true\",\n body: {\n \"indices\": [\n \"kibana_sample_data_logs\"\n ],\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n \"job_id\": \"test-job\"\n }\n)" - lang: PHP source: "$resp = $client->ml()->putDatafeed([\n \"datafeed_id\" => \"datafeed-test-job\",\n \"pretty\" => \"true\",\n \"body\" => [\n \"indices\" => array(\n \"kibana_sample_data_logs\",\n ),\n \"query\" => [\n \"bool\" => [\n \"must\" => array(\n [\n \"match_all\" => new ArrayObject([]),\n ],\n ),\n ],\n ],\n \"job_id\" => \"test-job\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"indices":["kibana_sample_data_logs"],"query":{"bool":{"must":[{"match_all":{}}]}},"job_id":"test-job"}'' "$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-test-job?pretty"' - lang: C# source: "var response = await client.MachineLearning\n .PutDatafeedAsync(datafeedId: \"datafeed-test-job\", d1 => d1\n .Indices(new[] { \"kibana_sample_data_logs\" })\n .JobId(\"test-job\")\n .Query(d2 => d2\n .Bool(d3 => d3\n .Must(d4 => d4\n .MatchAll()\n )\n )\n )\n );" - lang: Java source: "client.ml().putDatafeed(p -> p\n .datafeedId(\"datafeed-test-job\")\n .indices(\"kibana_sample_data_logs\")\n .jobId(\"test-job\")\n .query(q -> q\n .bool(b -> b\n .must(m -> m\n .matchAll(ma -> ma)\n )\n )\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - chunking_config - datafeed_id - indices - job_id - query - query_delay - scroll_size type: object properties: aggregations: type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.AggregationContainer' authorization: allOf: - $ref: '#/components/schemas/ml._types.DatafeedAuthorization' chunking_config: allOf: - $ref: '#/components/schemas/ml._types.ChunkingConfig' delayed_data_check_config: allOf: - $ref: '#/components/schemas/ml._types.DelayedDataCheckConfig' datafeed_id: allOf: - $ref: '#/components/schemas/_types.Id' frequency: allOf: - $ref: '#/components/schemas/_types.Duration' indices: type: array items: type: string job_id: allOf: - $ref: '#/components/schemas/_types.Id' indices_options: allOf: - $ref: '#/components/schemas/_types.IndicesOptions' max_empty_searches: type: number max_consecutive_extraction_failures: type: number query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' query_delay: allOf: - $ref: '#/components/schemas/_types.Duration' runtime_mappings: allOf: - $ref: '#/components/schemas/_types.mapping.RuntimeFields' script_fields: type: object additionalProperties: $ref: '#/components/schemas/_types.ScriptField' scroll_size: type: number x-state: Generally available; Added in 5.4.0 x-codeSamples: - lang: Console source: "PUT _ml/datafeeds/datafeed-test-job?pretty\n{\n \"indices\": [\n \"kibana_sample_data_logs\"\n ],\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n \"job_id\": \"test-job\"\n}" - lang: Python source: "resp = client.ml.put_datafeed(\n datafeed_id=\"datafeed-test-job\",\n pretty=True,\n indices=[\n \"kibana_sample_data_logs\"\n ],\n query={\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n job_id=\"test-job\",\n)" - lang: JavaScript source: "const response = await client.ml.putDatafeed({\n datafeed_id: \"datafeed-test-job\",\n pretty: \"true\",\n indices: [\"kibana_sample_data_logs\"],\n query: {\n bool: {\n must: [\n {\n match_all: {},\n },\n ],\n },\n },\n job_id: \"test-job\",\n});" - lang: Ruby source: "response = client.ml.put_datafeed(\n datafeed_id: \"datafeed-test-job\",\n pretty: \"true\",\n body: {\n \"indices\": [\n \"kibana_sample_data_logs\"\n ],\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n \"job_id\": \"test-job\"\n }\n)" - lang: PHP source: "$resp = $client->ml()->putDatafeed([\n \"datafeed_id\" => \"datafeed-test-job\",\n \"pretty\" => \"true\",\n \"body\" => [\n \"indices\" => array(\n \"kibana_sample_data_logs\",\n ),\n \"query\" => [\n \"bool\" => [\n \"must\" => array(\n [\n \"match_all\" => new ArrayObject([]),\n ],\n ),\n ],\n ],\n \"job_id\" => \"test-job\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"indices":["kibana_sample_data_logs"],"query":{"bool":{"must":[{"match_all":{}}]}},"job_id":"test-job"}'' "$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-test-job?pretty"' - lang: C# source: "var response = await client.MachineLearning\n .PutDatafeedAsync(datafeedId: \"datafeed-test-job\", d1 => d1\n .Indices(new[] { \"kibana_sample_data_logs\" })\n .JobId(\"test-job\")\n .Query(d2 => d2\n .Bool(d3 => d3\n .Must(d4 => d4\n .MatchAll()\n )\n )\n )\n );" - lang: Java source: "client.ml().putDatafeed(p -> p\n .datafeedId(\"datafeed-test-job\")\n .indices(\"kibana_sample_data_logs\")\n .jobId(\"test-job\")\n .query(q -> q\n .bool(b -> b\n .must(m -> m\n .matchAll(ma -> ma)\n )\n )\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name delete: tags: - ml anomaly summary: Delete a datafeed description: "\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-delete-datafeed parameters: - name: datafeed_id in: path description: "A numerical character string that uniquely identifies the datafeed. This\nidentifier can contain lowercase alphanumeric characters (a-z and 0-9),\nhyphens, and underscores. It must start and end with alphanumeric\ncharacters." required: true schema: $ref: '#/components/schemas/_types.Id' - name: force in: query description: "Use to forcefully delete a started datafeed; this method is quicker than\nstopping and deleting the datafeed." schema: type: boolean responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: MlDeleteDatafeedResponseExample1: description: A successful response when deleting a datafeed. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 5.4.0 x-codeSamples: - lang: Console source: "DELETE _ml/datafeeds/datafeed-total-requests\n" - lang: Python source: "resp = client.ml.delete_datafeed(\n datafeed_id=\"datafeed-total-requests\",\n)" - lang: JavaScript source: "const response = await client.ml.deleteDatafeed({\n datafeed_id: \"datafeed-total-requests\",\n});" - lang: Ruby source: "response = client.ml.delete_datafeed(\n datafeed_id: \"datafeed-total-requests\"\n)" - lang: PHP source: "$resp = $client->ml()->deleteDatafeed([\n \"datafeed_id\" => \"datafeed-total-requests\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-total-requests"' - lang: C# source: 'var response = await client.MachineLearning.DeleteDatafeedAsync(datafeedId: "datafeed-total-requests");' - lang: Java source: "client.ml().deleteDatafeed(d -> d\n .datafeedId(\"datafeed-total-requests\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/_delete_expired_data/{job_id}': delete: tags: - ml anomaly summary: "Delete expired ML data\n" description: "**All methods and paths for this operation:**\n\n
\n DELETE\n /_ml/_delete_expired_data\n
\n
\n DELETE\n /_ml/_delete_expired_data/{job_id}\n
\n \n\nDelete all job results, model snapshots and forecast data that have exceeded\ntheir retention days period. Machine learning state documents that are not\nassociated with any job are also deleted.\nYou can limit the request to a single or set of anomaly detection jobs by\nusing a job identifier, a group name, a comma-separated list of jobs, or a\nwildcard expression. You can delete expired data for all anomaly detection\njobs by using `_all`, by specifying `*` as the ``, or by omitting the\n``.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-delete-expired-data parameters: - $ref: '#/components/parameters/ml.delete_expired_data-job_id' - $ref: '#/components/parameters/ml.delete_expired_data-requests_per_second' - $ref: '#/components/parameters/ml.delete_expired_data-timeout' requestBody: $ref: '#/components/requestBodies/ml.delete_expired_data' responses: '200': $ref: '#/components/responses/ml.delete_expired_data-200' x-state: Generally available; Added in 5.4.0 x-codeSamples: - lang: Console source: "DELETE _ml/_delete_expired_data?timeout=1h\n" - lang: Python source: "resp = client.ml.delete_expired_data(\n timeout=\"1h\",\n)" - lang: JavaScript source: "const response = await client.ml.deleteExpiredData({\n timeout: \"1h\",\n});" - lang: Ruby source: "response = client.ml.delete_expired_data(\n timeout: \"1h\"\n)" - lang: PHP source: "$resp = $client->ml()->deleteExpiredData([\n \"timeout\" => \"1h\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/_delete_expired_data?timeout=1h"' - lang: C# source: var response = await client.MachineLearning.DeleteExpiredDataAsync(); - lang: Java source: "client.ml().deleteExpiredData(d -> d\n .timeout(t -> t\n .time(\"1h\")\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/filters/{filter_id}': get: tags: - ml anomaly summary: "Get filters\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ml/filters\n
\n
\n GET\n /_ml/filters/{filter_id}\n
\n \n\nYou can get a single filter or all filters.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-get-filters parameters: - $ref: '#/components/parameters/ml.get_filters-filter_id' - $ref: '#/components/parameters/ml.get_filters-from' - $ref: '#/components/parameters/ml.get_filters-size' responses: '200': $ref: '#/components/responses/ml.get_filters-200' x-state: Generally available; Added in 5.5.0 x-codeSamples: - lang: Console source: "GET _ml/filters/safe_domains\n" - lang: Python source: "resp = client.ml.get_filters(\n filter_id=\"safe_domains\",\n)" - lang: JavaScript source: "const response = await client.ml.getFilters({\n filter_id: \"safe_domains\",\n});" - lang: Ruby source: "response = client.ml.get_filters(\n filter_id: \"safe_domains\"\n)" - lang: PHP source: "$resp = $client->ml()->getFilters([\n \"filter_id\" => \"safe_domains\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/filters/safe_domains"' - lang: C# source: "var response = await client.MachineLearning\n .GetFiltersAsync(d1 => d1\n .FilterId(new[] { \"safe_domains\" })\n );" - lang: Java source: "client.ml().getFilters(g -> g\n .filterId(\"safe_domains\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name put: tags: - ml anomaly summary: Create a filter description: "A filter contains a list of strings. It can be used by one or more anomaly detection jobs.\nSpecifically, filters are referenced in the `custom_rules` property of detector configuration objects.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-put-filter parameters: - name: filter_id in: path description: A string that uniquely identifies a filter. required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: type: object properties: description: type: string description: A description of the filter. items: type: array items: type: string description: "The items of the filter. A wildcard `*` can be used at the beginning or the end of an item.\nUp to 10000 items are allowed in each filter." examples: MlPutFilterExample1: description: An example body for a `PUT _ml/filters/safe_domains` request. value: "{\n \"description\": \"A list of safe domains\",\n \"items\": [\"*.google.com\", \"wikipedia.org\"]\n}" x-codeSamples: - lang: Console source: "PUT _ml/filters/safe_domains\n{\n \"description\": \"A list of safe domains\",\n \"items\": [\"*.google.com\", \"wikipedia.org\"]\n}" - lang: Python source: "resp = client.ml.put_filter(\n filter_id=\"safe_domains\",\n description=\"A list of safe domains\",\n items=[\n \"*.google.com\",\n \"wikipedia.org\"\n ],\n)" - lang: JavaScript source: "const response = await client.ml.putFilter({\n filter_id: \"safe_domains\",\n description: \"A list of safe domains\",\n items: [\"*.google.com\", \"wikipedia.org\"],\n});" - lang: Ruby source: "response = client.ml.put_filter(\n filter_id: \"safe_domains\",\n body: {\n \"description\": \"A list of safe domains\",\n \"items\": [\n \"*.google.com\",\n \"wikipedia.org\"\n ]\n }\n)" - lang: PHP source: "$resp = $client->ml()->putFilter([\n \"filter_id\" => \"safe_domains\",\n \"body\" => [\n \"description\" => \"A list of safe domains\",\n \"items\" => array(\n \"*.google.com\",\n \"wikipedia.org\",\n ),\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"description":"A list of safe domains","items":["*.google.com","wikipedia.org"]}'' "$ELASTICSEARCH_URL/_ml/filters/safe_domains"' - lang: C# source: "var response = await client.MachineLearning\n .PutFilterAsync(filterId: \"safe_domains\", d1 => d1\n .Description(\"A list of safe domains\")\n .Items(\"*.google.com\", \"wikipedia.org\")\n );" - lang: Java source: "client.ml().putFilter(p -> p\n .description(\"A list of safe domains\")\n .filterId(\"safe_domains\")\n .items(List.of(\"*.google.com\",\"wikipedia.org\"))\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - description - filter_id - items type: object properties: description: type: string filter_id: allOf: - $ref: '#/components/schemas/_types.Id' items: type: array items: type: string x-state: Generally available; Added in 5.4.0 x-codeSamples: - lang: Console source: "PUT _ml/filters/safe_domains\n{\n \"description\": \"A list of safe domains\",\n \"items\": [\"*.google.com\", \"wikipedia.org\"]\n}" - lang: Python source: "resp = client.ml.put_filter(\n filter_id=\"safe_domains\",\n description=\"A list of safe domains\",\n items=[\n \"*.google.com\",\n \"wikipedia.org\"\n ],\n)" - lang: JavaScript source: "const response = await client.ml.putFilter({\n filter_id: \"safe_domains\",\n description: \"A list of safe domains\",\n items: [\"*.google.com\", \"wikipedia.org\"],\n});" - lang: Ruby source: "response = client.ml.put_filter(\n filter_id: \"safe_domains\",\n body: {\n \"description\": \"A list of safe domains\",\n \"items\": [\n \"*.google.com\",\n \"wikipedia.org\"\n ]\n }\n)" - lang: PHP source: "$resp = $client->ml()->putFilter([\n \"filter_id\" => \"safe_domains\",\n \"body\" => [\n \"description\" => \"A list of safe domains\",\n \"items\" => array(\n \"*.google.com\",\n \"wikipedia.org\",\n ),\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"description":"A list of safe domains","items":["*.google.com","wikipedia.org"]}'' "$ELASTICSEARCH_URL/_ml/filters/safe_domains"' - lang: C# source: "var response = await client.MachineLearning\n .PutFilterAsync(filterId: \"safe_domains\", d1 => d1\n .Description(\"A list of safe domains\")\n .Items(\"*.google.com\", \"wikipedia.org\")\n );" - lang: Java source: "client.ml().putFilter(p -> p\n .description(\"A list of safe domains\")\n .filterId(\"safe_domains\")\n .items(List.of(\"*.google.com\",\"wikipedia.org\"))\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name delete: tags: - ml anomaly summary: Delete a filter description: "If an anomaly detection job references the filter, you cannot delete the\nfilter. You must update or delete the job before you can delete the filter.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-delete-filter parameters: - name: filter_id in: path description: A string that uniquely identifies a filter. required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: MlDeleteFilterResponseExample1: description: A successful response when deleting a filter. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 5.4.0 x-codeSamples: - lang: Console source: "DELETE _ml/filters/safe_domains\n" - lang: Python source: "resp = client.ml.delete_filter(\n filter_id=\"safe_domains\",\n)" - lang: JavaScript source: "const response = await client.ml.deleteFilter({\n filter_id: \"safe_domains\",\n});" - lang: Ruby source: "response = client.ml.delete_filter(\n filter_id: \"safe_domains\"\n)" - lang: PHP source: "$resp = $client->ml()->deleteFilter([\n \"filter_id\" => \"safe_domains\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/filters/safe_domains"' - lang: C# source: 'var response = await client.MachineLearning.DeleteFilterAsync(filterId: "safe_domains");' - lang: Java source: "client.ml().deleteFilter(d -> d\n .filterId(\"safe_domains\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/anomaly_detectors/{job_id}/_forecast/{forecast_id}': delete: tags: - ml anomaly summary: "Delete forecasts from a job\n" description: "**All methods and paths for this operation:**\n\n
\n DELETE\n /_ml/anomaly_detectors/{job_id}/_forecast\n
\n
\n DELETE\n /_ml/anomaly_detectors/{job_id}/_forecast/{forecast_id}\n
\n \n\nBy default, forecasts are retained for 14 days. You can specify a\ndifferent retention period with the `expires_in` parameter in the forecast\njobs API. The delete forecast API enables you to delete one or more\nforecasts before they expire.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-delete-forecast parameters: - $ref: '#/components/parameters/ml.delete_forecast-job_id' - $ref: '#/components/parameters/ml.delete_forecast-forecast_id' - $ref: '#/components/parameters/ml.delete_forecast-allow_no_forecasts' - $ref: '#/components/parameters/ml.delete_forecast-timeout' responses: '200': $ref: '#/components/responses/ml.delete_forecast-200' x-state: Generally available; Added in 6.5.0 x-codeSamples: - lang: Console source: "DELETE _ml/anomaly_detectors/total-requests/_forecast/_all\n" - lang: Python source: "resp = client.ml.delete_forecast(\n job_id=\"total-requests\",\n forecast_id=\"_all\",\n)" - lang: JavaScript source: "const response = await client.ml.deleteForecast({\n job_id: \"total-requests\",\n forecast_id: \"_all\",\n});" - lang: Ruby source: "response = client.ml.delete_forecast(\n job_id: \"total-requests\",\n forecast_id: \"_all\"\n)" - lang: PHP source: "$resp = $client->ml()->deleteForecast([\n \"job_id\" => \"total-requests\",\n \"forecast_id\" => \"_all\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/anomaly_detectors/total-requests/_forecast/_all"' - lang: C# source: "var response = await client.MachineLearning\n .DeleteForecastAsync(new DeleteForecastRequest()\n {\n ForecastId = \"_all\",\n JobId = \"total-requests\"\n });" - lang: Java source: "client.ml().deleteForecast(d -> d\n .forecastId(\"_all\")\n .jobId(\"total-requests\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/anomaly_detectors/{job_id}': get: tags: - ml anomaly summary: "Get anomaly detection jobs configuration info\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ml/anomaly_detectors\n
\n
\n GET\n /_ml/anomaly_detectors/{job_id}\n
\n \n\nYou can get information for multiple anomaly detection jobs in a single API\nrequest by using a group name, a comma-separated list of jobs, or a wildcard\nexpression. You can get information for all anomaly detection jobs by using\n`_all`, by specifying `*` as the ``, or by omitting the ``.\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: ml-get-jobs parameters: - $ref: '#/components/parameters/ml.get_jobs-job_id' - $ref: '#/components/parameters/ml.get_jobs-allow_no_match' - $ref: '#/components/parameters/ml.get_jobs-exclude_generated' responses: '200': $ref: '#/components/responses/ml.get_jobs-200' x-state: Generally available; Added in 5.5.0 x-codeSamples: - lang: Console source: "GET _ml/anomaly_detectors/high_sum_total_sales\n" - lang: Python source: "resp = client.ml.get_jobs(\n job_id=\"high_sum_total_sales\",\n)" - lang: JavaScript source: "const response = await client.ml.getJobs({\n job_id: \"high_sum_total_sales\",\n});" - lang: Ruby source: "response = client.ml.get_jobs(\n job_id: \"high_sum_total_sales\"\n)" - lang: PHP source: "$resp = $client->ml()->getJobs([\n \"job_id\" => \"high_sum_total_sales\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/anomaly_detectors/high_sum_total_sales"' - lang: C# source: "var response = await client.MachineLearning\n .GetJobsAsync(d1 => d1\n .JobId(new[] { \"high_sum_total_sales\" })\n );" - lang: Java source: "client.ml().getJobs(g -> g\n .jobId(\"high_sum_total_sales\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name put: tags: - ml anomaly summary: Create an anomaly detection job description: "If you include a `datafeed_config`, you must have read index privileges on the source index.\nIf you include a `datafeed_config` but do not provide a query, the datafeed uses `{\"match_all\": {\"boost\": 1}}`.\n\n## Required authorization\n\n* Index privileges: `read`\n* Cluster privileges: `manage_ml`\n" operationId: ml-put-job parameters: - name: job_id in: path description: 'The identifier for the anomaly detection job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.' required: true schema: $ref: '#/components/schemas/_types.Id' - name: allow_no_indices in: query description: "A setting that does two separate checks on the index expression.\nIf `false`, the request returns an error (1) if any wildcard expression\n(including `_all` and `*`) resolves to zero matching indices or (2) if the\ncomplete set of resolved indices, aliases or data streams is empty after all\nexpressions are evaluated. If `true`, index expressions that resolve to no\nindices are allowed and the request returns an empty result." schema: type: boolean default: true - name: expand_wildcards in: query description: "Type of index that wildcard patterns can match. If the request can target data streams, this argument determines\nwhether wildcard expressions match hidden data streams. Supports comma-separated values.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: open - name: ignore_throttled in: query description: 'If `true`, concrete, expanded or aliased indices are ignored when frozen.' deprecated: true schema: type: boolean default: true - name: ignore_unavailable in: query description: "If `false`, the request returns an error if it targets a concrete (non-wildcarded)\nindex, alias, or data stream that is missing, closed, or otherwise unavailable.\nIf `true`, unavailable concrete targets are silently ignored." schema: type: boolean default: false requestBody: content: application/json: schema: required: - analysis_config - data_description type: object properties: allow_lazy_open: type: boolean description: 'Advanced configuration option. Specifies whether this job can open when there is insufficient machine learning node capacity for it to be immediately assigned to a node. By default, if a machine learning node with capacity to run the job cannot immediately be found, the open anomaly detection jobs API returns an error. However, this is also subject to the cluster-wide `xpack.ml.max_lazy_ml_nodes` setting. If this option is set to true, the open anomaly detection jobs API does not return an error and the job waits in the opening state until sufficient machine learning node capacity is available.' default: false analysis_config: allOf: - $ref: '#/components/schemas/ml._types.AnalysisConfig' description: 'Specifies how to analyze the data. After you create a job, you cannot change the analysis configuration; all the properties are informational.' analysis_limits: allOf: - $ref: '#/components/schemas/ml._types.AnalysisLimits' description: 'Limits can be applied for the resources required to hold the mathematical models in memory. These limits are approximate and can be set per job. They do not control the memory used by other processes, for example the Elasticsearch Java processes.' background_persist_interval: allOf: - $ref: '#/components/schemas/_types.Duration' description: 'Advanced configuration option. The time between each periodic persistence of the model. The default value is a randomized value between 3 to 4 hours, which avoids all jobs persisting at exactly the same time. The smallest allowed value is 1 hour. For very large models (several GB), persistence could take 10-20 minutes, so do not set the `background_persist_interval` value too low.' custom_settings: allOf: - $ref: '#/components/schemas/ml._types.CustomSettings' description: Advanced configuration option. Contains custom meta data about the job. daily_model_snapshot_retention_after_days: type: number description: 'Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies a period of time (in days) after which only the first snapshot per day is retained. This period is relative to the timestamp of the most recent snapshot for this job. Valid values range from 0 to `model_snapshot_retention_days`.' default: 1 data_description: allOf: - $ref: '#/components/schemas/ml._types.DataDescription' description: 'Defines the format of the input data when you send data to the job by using the post data API. Note that when configure a datafeed, these properties are automatically set. When data is received via the post data API, it is not stored in Elasticsearch. Only the results for anomaly detection are retained.' datafeed_config: allOf: - $ref: '#/components/schemas/ml._types.DatafeedConfig' description: 'Defines a datafeed for the anomaly detection job. If Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had at the time of creation and runs the query using those same roles. If you provide secondary authorization headers, those credentials are used instead.' description: type: string description: A description of the job. job_id: allOf: - $ref: '#/components/schemas/_types.Id' description: 'The identifier for the anomaly detection job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.' groups: type: array items: type: string description: A list of job groups. A job can belong to no groups or many. model_plot_config: allOf: - $ref: '#/components/schemas/ml._types.ModelPlotConfig' description: 'This advanced configuration option stores model information along with the results. It provides a more detailed view into anomaly detection. If you enable model plot it can add considerable overhead to the performance of the system; it is not feasible for jobs with many entities. Model plot provides a simplified and indicative view of the model and its bounds. It does not display complex features such as multivariate correlations or multimodal data. As such, anomalies may occasionally be reported which cannot be seen in the model plot. Model plot config can be configured when the job is created or updated later. It must be disabled if performance issues are experienced.' model_snapshot_retention_days: type: number description: 'Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies the maximum period of time (in days) that snapshots are retained. This period is relative to the timestamp of the most recent snapshot for this job. By default, snapshots ten days older than the newest snapshot are deleted.' default: 10 renormalization_window_days: type: number description: 'Advanced configuration option. The period over which adjustments to the score are applied, as new data is seen. The default value is the longer of 30 days or 100 bucket spans.' results_index_name: allOf: - $ref: '#/components/schemas/_types.IndexName' description: 'A text string that affects the name of the machine learning results index. By default, the job generates an index named `.ml-anomalies-shared`.' default: shared results_retention_days: type: number description: 'Advanced configuration option. The period of time (in days) that results are retained. Age is calculated relative to the timestamp of the latest bucket result. If this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch. The default value is null, which means all results are retained. Annotations generated by the system also count as results for retention purposes; they are deleted after the same number of days as results. Annotations added by users are retained forever.' examples: MlPutJobRequestExample1: description: A request to create an anomaly detection job and datafeed. value: "{\n \"analysis_config\": {\n \"bucket_span\": \"15m\",\n \"detectors\": [\n {\n \"detector_description\": \"Sum of bytes\",\n \"function\": \"sum\",\n \"field_name\": \"bytes\"\n }\n ]\n },\n \"data_description\": {\n \"time_field\": \"timestamp\",\n \"time_format\": \"epoch_ms\"\n },\n \"analysis_limits\": {\n \"model_memory_limit\": \"11MB\"\n },\n \"model_plot_config\": {\n \"enabled\": true,\n \"annotations_enabled\": true\n },\n \"results_index_name\": \"test-job1\",\n \"datafeed_config\": {\n \"indices\": [\n \"kibana_sample_data_logs\"\n ],\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n \"runtime_mappings\": {\n \"hour_of_day\": {\n \"type\": \"long\",\n \"script\": {\n \"source\": \"emit(doc['timestamp'].value.getHour());\"\n }\n }\n },\n \"datafeed_id\": \"datafeed-test-job1\"\n }\n}" x-codeSamples: - lang: Console source: "PUT /_ml/anomaly_detectors/job-01\n{\n \"analysis_config\": {\n \"bucket_span\": \"15m\",\n \"detectors\": [\n {\n \"detector_description\": \"Sum of bytes\",\n \"function\": \"sum\",\n \"field_name\": \"bytes\"\n }\n ]\n },\n \"data_description\": {\n \"time_field\": \"timestamp\",\n \"time_format\": \"epoch_ms\"\n },\n \"analysis_limits\": {\n \"model_memory_limit\": \"11MB\"\n },\n \"model_plot_config\": {\n \"enabled\": true,\n \"annotations_enabled\": true\n },\n \"results_index_name\": \"test-job1\",\n \"datafeed_config\": {\n \"indices\": [\n \"kibana_sample_data_logs\"\n ],\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n \"runtime_mappings\": {\n \"hour_of_day\": {\n \"type\": \"long\",\n \"script\": {\n \"source\": \"emit(doc['timestamp'].value.getHour());\"\n }\n }\n },\n \"datafeed_id\": \"datafeed-test-job1\"\n }\n}" - lang: Python source: "resp = client.ml.put_job(\n job_id=\"job-01\",\n analysis_config={\n \"bucket_span\": \"15m\",\n \"detectors\": [\n {\n \"detector_description\": \"Sum of bytes\",\n \"function\": \"sum\",\n \"field_name\": \"bytes\"\n }\n ]\n },\n data_description={\n \"time_field\": \"timestamp\",\n \"time_format\": \"epoch_ms\"\n },\n analysis_limits={\n \"model_memory_limit\": \"11MB\"\n },\n model_plot_config={\n \"enabled\": True,\n \"annotations_enabled\": True\n },\n results_index_name=\"test-job1\",\n datafeed_config={\n \"indices\": [\n \"kibana_sample_data_logs\"\n ],\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n \"runtime_mappings\": {\n \"hour_of_day\": {\n \"type\": \"long\",\n \"script\": {\n \"source\": \"emit(doc['timestamp'].value.getHour());\"\n }\n }\n },\n \"datafeed_id\": \"datafeed-test-job1\"\n },\n)" - lang: JavaScript source: "const response = await client.ml.putJob({\n job_id: \"job-01\",\n analysis_config: {\n bucket_span: \"15m\",\n detectors: [\n {\n detector_description: \"Sum of bytes\",\n function: \"sum\",\n field_name: \"bytes\",\n },\n ],\n },\n data_description: {\n time_field: \"timestamp\",\n time_format: \"epoch_ms\",\n },\n analysis_limits: {\n model_memory_limit: \"11MB\",\n },\n model_plot_config: {\n enabled: true,\n annotations_enabled: true,\n },\n results_index_name: \"test-job1\",\n datafeed_config: {\n indices: [\"kibana_sample_data_logs\"],\n query: {\n bool: {\n must: [\n {\n match_all: {},\n },\n ],\n },\n },\n runtime_mappings: {\n hour_of_day: {\n type: \"long\",\n script: {\n source: \"emit(doc['timestamp'].value.getHour());\",\n },\n },\n },\n datafeed_id: \"datafeed-test-job1\",\n },\n});" - lang: Ruby source: "response = client.ml.put_job(\n job_id: \"job-01\",\n body: {\n \"analysis_config\": {\n \"bucket_span\": \"15m\",\n \"detectors\": [\n {\n \"detector_description\": \"Sum of bytes\",\n \"function\": \"sum\",\n \"field_name\": \"bytes\"\n }\n ]\n },\n \"data_description\": {\n \"time_field\": \"timestamp\",\n \"time_format\": \"epoch_ms\"\n },\n \"analysis_limits\": {\n \"model_memory_limit\": \"11MB\"\n },\n \"model_plot_config\": {\n \"enabled\": true,\n \"annotations_enabled\": true\n },\n \"results_index_name\": \"test-job1\",\n \"datafeed_config\": {\n \"indices\": [\n \"kibana_sample_data_logs\"\n ],\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n \"runtime_mappings\": {\n \"hour_of_day\": {\n \"type\": \"long\",\n \"script\": {\n \"source\": \"emit(doc['timestamp'].value.getHour());\"\n }\n }\n },\n \"datafeed_id\": \"datafeed-test-job1\"\n }\n }\n)" - lang: PHP source: "$resp = $client->ml()->putJob([\n \"job_id\" => \"job-01\",\n \"body\" => [\n \"analysis_config\" => [\n \"bucket_span\" => \"15m\",\n \"detectors\" => array(\n [\n \"detector_description\" => \"Sum of bytes\",\n \"function\" => \"sum\",\n \"field_name\" => \"bytes\",\n ],\n ),\n ],\n \"data_description\" => [\n \"time_field\" => \"timestamp\",\n \"time_format\" => \"epoch_ms\",\n ],\n \"analysis_limits\" => [\n \"model_memory_limit\" => \"11MB\",\n ],\n \"model_plot_config\" => [\n \"enabled\" => true,\n \"annotations_enabled\" => true,\n ],\n \"results_index_name\" => \"test-job1\",\n \"datafeed_config\" => [\n \"indices\" => array(\n \"kibana_sample_data_logs\",\n ),\n \"query\" => [\n \"bool\" => [\n \"must\" => array(\n [\n \"match_all\" => new ArrayObject([]),\n ],\n ),\n ],\n ],\n \"runtime_mappings\" => [\n \"hour_of_day\" => [\n \"type\" => \"long\",\n \"script\" => [\n \"source\" => \"emit(doc['timestamp'].value.getHour());\",\n ],\n ],\n ],\n \"datafeed_id\" => \"datafeed-test-job1\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"analysis_config":{"bucket_span":"15m","detectors":[{"detector_description":"Sum of bytes","function":"sum","field_name":"bytes"}]},"data_description":{"time_field":"timestamp","time_format":"epoch_ms"},"analysis_limits":{"model_memory_limit":"11MB"},"model_plot_config":{"enabled":true,"annotations_enabled":true},"results_index_name":"test-job1","datafeed_config":{"indices":["kibana_sample_data_logs"],"query":{"bool":{"must":[{"match_all":{}}]}},"runtime_mappings":{"hour_of_day":{"type":"long","script":{"source":"emit(doc[''"''"''timestamp''"''"''].value.getHour());"}}},"datafeed_id":"datafeed-test-job1"}}'' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/job-01"' - lang: C# source: "var response = await client.MachineLearning\n .PutJobAsync(jobId: \"job-01\", d1 => d1\n .AnalysisConfig(d2 => d2\n .BucketSpan(\"15m\")\n .Detectors(d3 => d3\n .DetectorDescription(\"Sum of bytes\")\n .FieldName(x => x.Bytes)\n .Function(\"sum\")\n )\n )\n .AnalysisLimits(d2 => d2\n .ModelMemoryLimit(new ByteSize(\"11MB\"))\n )\n .DataDescription(d2 => d2\n .TimeField(x => x.Timestamp)\n .TimeFormat(\"epoch_ms\")\n )\n .DatafeedConfig(d2 => d2\n .DatafeedId(\"datafeed-test-job1\")\n .Indices(new[] { \"kibana_sample_data_logs\" })\n .Query(d3 => d3\n .Bool(d4 => d4\n .Must(d5 => d5\n .MatchAll()\n )\n )\n )\n .RuntimeMappings(d3 => d3\n .Add(global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.HourOfDay), d4 => d4\n .Script(d5 => d5\n .Source(\"emit(doc['timestamp'].value.getHour());\")\n )\n .Type(RuntimeFieldType.Long)\n )\n )\n )\n .ModelPlotConfig(d2 => d2\n .AnnotationsEnabled(true)\n .Enabled(true)\n )\n .ResultsIndexName(\"test-job1\")\n );" - lang: Java source: "client.ml().putJob(p -> p\n .analysisConfig(a -> a\n .bucketSpan(b -> b\n .time(\"15m\")\n )\n .detectors(d -> d\n .detectorDescription(\"Sum of bytes\")\n .fieldName(\"bytes\")\n .function(\"sum\")\n )\n )\n .analysisLimits(an -> an\n .modelMemoryLimit(\"11MB\")\n )\n .dataDescription(d -> d\n .timeField(\"timestamp\")\n .timeFormat(\"epoch_ms\")\n )\n .datafeedConfig(d -> d\n .datafeedId(\"datafeed-test-job1\")\n .indices(\"kibana_sample_data_logs\")\n .query(q -> q\n .bool(b -> b\n .must(m -> m\n .matchAll(ma -> ma)\n )\n )\n )\n .runtimeMappings(\"hour_of_day\", r -> r\n .script(s -> s\n .source(so -> so\n .scriptString(\"emit(doc['timestamp'].value.getHour());\")\n )\n )\n .type(RuntimeFieldType.Long)\n )\n )\n .jobId(\"job-01\")\n .modelPlotConfig(m -> m\n .annotationsEnabled(true)\n .enabled(true)\n )\n .resultsIndexName(\"test-job1\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - allow_lazy_open - analysis_config - analysis_limits - create_time - daily_model_snapshot_retention_after_days - data_description - job_id - job_type - job_version - model_snapshot_retention_days - results_index_name type: object properties: allow_lazy_open: type: boolean analysis_config: allOf: - $ref: '#/components/schemas/ml._types.AnalysisConfigRead' analysis_limits: allOf: - $ref: '#/components/schemas/ml._types.AnalysisLimits' background_persist_interval: allOf: - $ref: '#/components/schemas/_types.Duration' create_time: allOf: - $ref: '#/components/schemas/_types.DateTime' custom_settings: allOf: - $ref: '#/components/schemas/ml._types.CustomSettings' daily_model_snapshot_retention_after_days: type: number data_description: allOf: - $ref: '#/components/schemas/ml._types.DataDescription' datafeed_config: allOf: - $ref: '#/components/schemas/ml._types.Datafeed' description: type: string groups: type: array items: type: string job_id: allOf: - $ref: '#/components/schemas/_types.Id' job_type: type: string job_version: type: string model_plot_config: allOf: - $ref: '#/components/schemas/ml._types.ModelPlotConfig' model_snapshot_id: allOf: - $ref: '#/components/schemas/_types.Id' model_snapshot_retention_days: type: number renormalization_window_days: type: number results_index_name: type: string results_retention_days: type: number examples: MlPutJobResponseExample1: description: A successful response when creating an anomaly detection job and datafeed. value: "{\n \"job_id\": \"test-job1\",\n \"job_type\": \"anomaly_detector\",\n \"job_version\": \"8.4.0\",\n \"create_time\": 1656087283340,\n \"datafeed_config\": {\n \"datafeed_id\": \"datafeed-test-job1\",\n \"job_id\": \"test-job1\",\n \"authorization\": {\n \"roles\": [\n \"superuser\"\n ]\n },\n \"query_delay\": \"61499ms\",\n \"chunking_config\": {\n \"mode\": \"auto\"\n },\n \"indices_options\": {\n \"expand_wildcards\": [\n \"open\"\n ],\n \"ignore_unavailable\": false,\n \"allow_no_indices\": true,\n \"ignore_throttled\": true\n },\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n \"indices\": [\n \"kibana_sample_data_logs\"\n ],\n \"scroll_size\": 1000,\n \"delayed_data_check_config\": {\n \"enabled\": true\n },\n \"runtime_mappings\": {\n \"hour_of_day\": {\n \"type\": \"long\",\n \"script\": {\n \"source\": \"emit(doc['timestamp'].value.getHour());\"\n }\n }\n }\n },\n \"analysis_config\": {\n \"bucket_span\": \"15m\",\n \"detectors\": [\n {\n \"detector_description\": \"Sum of bytes\",\n \"function\": \"sum\",\n \"field_name\": \"bytes\",\n \"detector_index\": 0\n }\n ],\n \"influencers\": [],\n \"model_prune_window\": \"30d\"\n },\n \"analysis_limits\": {\n \"model_memory_limit\": \"11mb\",\n \"categorization_examples_limit\": 4\n },\n \"data_description\": {\n \"time_field\": \"timestamp\",\n \"time_format\": \"epoch_ms\"\n },\n \"model_plot_config\": {\n \"enabled\": true,\n \"annotations_enabled\": true\n },\n \"model_snapshot_retention_days\": 10,\n \"daily_model_snapshot_retention_after_days\": 1,\n \"results_index_name\": \"custom-test-job1\",\n \"allow_lazy_open\": false\n}" x-state: Generally available; Added in 5.4.0 x-codeSamples: - lang: Console source: "PUT /_ml/anomaly_detectors/job-01\n{\n \"analysis_config\": {\n \"bucket_span\": \"15m\",\n \"detectors\": [\n {\n \"detector_description\": \"Sum of bytes\",\n \"function\": \"sum\",\n \"field_name\": \"bytes\"\n }\n ]\n },\n \"data_description\": {\n \"time_field\": \"timestamp\",\n \"time_format\": \"epoch_ms\"\n },\n \"analysis_limits\": {\n \"model_memory_limit\": \"11MB\"\n },\n \"model_plot_config\": {\n \"enabled\": true,\n \"annotations_enabled\": true\n },\n \"results_index_name\": \"test-job1\",\n \"datafeed_config\": {\n \"indices\": [\n \"kibana_sample_data_logs\"\n ],\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n \"runtime_mappings\": {\n \"hour_of_day\": {\n \"type\": \"long\",\n \"script\": {\n \"source\": \"emit(doc['timestamp'].value.getHour());\"\n }\n }\n },\n \"datafeed_id\": \"datafeed-test-job1\"\n }\n}" - lang: Python source: "resp = client.ml.put_job(\n job_id=\"job-01\",\n analysis_config={\n \"bucket_span\": \"15m\",\n \"detectors\": [\n {\n \"detector_description\": \"Sum of bytes\",\n \"function\": \"sum\",\n \"field_name\": \"bytes\"\n }\n ]\n },\n data_description={\n \"time_field\": \"timestamp\",\n \"time_format\": \"epoch_ms\"\n },\n analysis_limits={\n \"model_memory_limit\": \"11MB\"\n },\n model_plot_config={\n \"enabled\": True,\n \"annotations_enabled\": True\n },\n results_index_name=\"test-job1\",\n datafeed_config={\n \"indices\": [\n \"kibana_sample_data_logs\"\n ],\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n \"runtime_mappings\": {\n \"hour_of_day\": {\n \"type\": \"long\",\n \"script\": {\n \"source\": \"emit(doc['timestamp'].value.getHour());\"\n }\n }\n },\n \"datafeed_id\": \"datafeed-test-job1\"\n },\n)" - lang: JavaScript source: "const response = await client.ml.putJob({\n job_id: \"job-01\",\n analysis_config: {\n bucket_span: \"15m\",\n detectors: [\n {\n detector_description: \"Sum of bytes\",\n function: \"sum\",\n field_name: \"bytes\",\n },\n ],\n },\n data_description: {\n time_field: \"timestamp\",\n time_format: \"epoch_ms\",\n },\n analysis_limits: {\n model_memory_limit: \"11MB\",\n },\n model_plot_config: {\n enabled: true,\n annotations_enabled: true,\n },\n results_index_name: \"test-job1\",\n datafeed_config: {\n indices: [\"kibana_sample_data_logs\"],\n query: {\n bool: {\n must: [\n {\n match_all: {},\n },\n ],\n },\n },\n runtime_mappings: {\n hour_of_day: {\n type: \"long\",\n script: {\n source: \"emit(doc['timestamp'].value.getHour());\",\n },\n },\n },\n datafeed_id: \"datafeed-test-job1\",\n },\n});" - lang: Ruby source: "response = client.ml.put_job(\n job_id: \"job-01\",\n body: {\n \"analysis_config\": {\n \"bucket_span\": \"15m\",\n \"detectors\": [\n {\n \"detector_description\": \"Sum of bytes\",\n \"function\": \"sum\",\n \"field_name\": \"bytes\"\n }\n ]\n },\n \"data_description\": {\n \"time_field\": \"timestamp\",\n \"time_format\": \"epoch_ms\"\n },\n \"analysis_limits\": {\n \"model_memory_limit\": \"11MB\"\n },\n \"model_plot_config\": {\n \"enabled\": true,\n \"annotations_enabled\": true\n },\n \"results_index_name\": \"test-job1\",\n \"datafeed_config\": {\n \"indices\": [\n \"kibana_sample_data_logs\"\n ],\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n \"runtime_mappings\": {\n \"hour_of_day\": {\n \"type\": \"long\",\n \"script\": {\n \"source\": \"emit(doc['timestamp'].value.getHour());\"\n }\n }\n },\n \"datafeed_id\": \"datafeed-test-job1\"\n }\n }\n)" - lang: PHP source: "$resp = $client->ml()->putJob([\n \"job_id\" => \"job-01\",\n \"body\" => [\n \"analysis_config\" => [\n \"bucket_span\" => \"15m\",\n \"detectors\" => array(\n [\n \"detector_description\" => \"Sum of bytes\",\n \"function\" => \"sum\",\n \"field_name\" => \"bytes\",\n ],\n ),\n ],\n \"data_description\" => [\n \"time_field\" => \"timestamp\",\n \"time_format\" => \"epoch_ms\",\n ],\n \"analysis_limits\" => [\n \"model_memory_limit\" => \"11MB\",\n ],\n \"model_plot_config\" => [\n \"enabled\" => true,\n \"annotations_enabled\" => true,\n ],\n \"results_index_name\" => \"test-job1\",\n \"datafeed_config\" => [\n \"indices\" => array(\n \"kibana_sample_data_logs\",\n ),\n \"query\" => [\n \"bool\" => [\n \"must\" => array(\n [\n \"match_all\" => new ArrayObject([]),\n ],\n ),\n ],\n ],\n \"runtime_mappings\" => [\n \"hour_of_day\" => [\n \"type\" => \"long\",\n \"script\" => [\n \"source\" => \"emit(doc['timestamp'].value.getHour());\",\n ],\n ],\n ],\n \"datafeed_id\" => \"datafeed-test-job1\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"analysis_config":{"bucket_span":"15m","detectors":[{"detector_description":"Sum of bytes","function":"sum","field_name":"bytes"}]},"data_description":{"time_field":"timestamp","time_format":"epoch_ms"},"analysis_limits":{"model_memory_limit":"11MB"},"model_plot_config":{"enabled":true,"annotations_enabled":true},"results_index_name":"test-job1","datafeed_config":{"indices":["kibana_sample_data_logs"],"query":{"bool":{"must":[{"match_all":{}}]}},"runtime_mappings":{"hour_of_day":{"type":"long","script":{"source":"emit(doc[''"''"''timestamp''"''"''].value.getHour());"}}},"datafeed_id":"datafeed-test-job1"}}'' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/job-01"' - lang: C# source: "var response = await client.MachineLearning\n .PutJobAsync(jobId: \"job-01\", d1 => d1\n .AnalysisConfig(d2 => d2\n .BucketSpan(\"15m\")\n .Detectors(d3 => d3\n .DetectorDescription(\"Sum of bytes\")\n .FieldName(x => x.Bytes)\n .Function(\"sum\")\n )\n )\n .AnalysisLimits(d2 => d2\n .ModelMemoryLimit(new ByteSize(\"11MB\"))\n )\n .DataDescription(d2 => d2\n .TimeField(x => x.Timestamp)\n .TimeFormat(\"epoch_ms\")\n )\n .DatafeedConfig(d2 => d2\n .DatafeedId(\"datafeed-test-job1\")\n .Indices(new[] { \"kibana_sample_data_logs\" })\n .Query(d3 => d3\n .Bool(d4 => d4\n .Must(d5 => d5\n .MatchAll()\n )\n )\n )\n .RuntimeMappings(d3 => d3\n .Add(global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.HourOfDay), d4 => d4\n .Script(d5 => d5\n .Source(\"emit(doc['timestamp'].value.getHour());\")\n )\n .Type(RuntimeFieldType.Long)\n )\n )\n )\n .ModelPlotConfig(d2 => d2\n .AnnotationsEnabled(true)\n .Enabled(true)\n )\n .ResultsIndexName(\"test-job1\")\n );" - lang: Java source: "client.ml().putJob(p -> p\n .analysisConfig(a -> a\n .bucketSpan(b -> b\n .time(\"15m\")\n )\n .detectors(d -> d\n .detectorDescription(\"Sum of bytes\")\n .fieldName(\"bytes\")\n .function(\"sum\")\n )\n )\n .analysisLimits(an -> an\n .modelMemoryLimit(\"11MB\")\n )\n .dataDescription(d -> d\n .timeField(\"timestamp\")\n .timeFormat(\"epoch_ms\")\n )\n .datafeedConfig(d -> d\n .datafeedId(\"datafeed-test-job1\")\n .indices(\"kibana_sample_data_logs\")\n .query(q -> q\n .bool(b -> b\n .must(m -> m\n .matchAll(ma -> ma)\n )\n )\n )\n .runtimeMappings(\"hour_of_day\", r -> r\n .script(s -> s\n .source(so -> so\n .scriptString(\"emit(doc['timestamp'].value.getHour());\")\n )\n )\n .type(RuntimeFieldType.Long)\n )\n )\n .jobId(\"job-01\")\n .modelPlotConfig(m -> m\n .annotationsEnabled(true)\n .enabled(true)\n )\n .resultsIndexName(\"test-job1\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name delete: tags: - ml anomaly summary: Delete an anomaly detection job description: "All job configuration, model state and results are deleted.\nIt is not currently possible to delete multiple jobs using wildcards or a\ncomma separated list. If you delete a job that has a datafeed, the request\nfirst tries to delete the datafeed. This behavior is equivalent to calling\nthe delete datafeed API with the same timeout and force parameters as the\ndelete job request.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-delete-job parameters: - name: job_id in: path description: Identifier for the anomaly detection job. required: true schema: $ref: '#/components/schemas/_types.Id' - name: force in: query description: "Use to forcefully delete an opened job; this method is quicker than\nclosing and deleting the job." schema: type: boolean default: false - name: delete_user_annotations in: query description: "Specifies whether annotations that have been added by the\nuser should be deleted along with any auto-generated annotations when the job is\nreset." schema: type: boolean default: false - name: wait_for_completion in: query description: "Specifies whether the request should return immediately or wait until the\njob deletion completes." schema: type: boolean default: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: MlDeleteJobResponseExample1: summary: Delete job description: A successful response when deleting an anomaly detection job. value: "{\n \"acknowledged\": true\n}" MlDeleteJobResponseExample2: summary: Delete job asynchronously description: "A successful response when deleting an anomaly detection job asynchronously. When the `wait_for_completion` query parameter is set to `false`, the response contains an identifier for the job deletion task.\n" value: "{\n \"task\": \"oTUltX4IQMOUUVeiohTt8A:39\"\n}" x-state: Generally available; Added in 5.4.0 x-codeSamples: - lang: Console source: "DELETE _ml/anomaly_detectors/total-requests\n" - lang: Python source: "resp = client.ml.delete_job(\n job_id=\"total-requests\",\n)" - lang: JavaScript source: "const response = await client.ml.deleteJob({\n job_id: \"total-requests\",\n});" - lang: Ruby source: "response = client.ml.delete_job(\n job_id: \"total-requests\"\n)" - lang: PHP source: "$resp = $client->ml()->deleteJob([\n \"job_id\" => \"total-requests\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/anomaly_detectors/total-requests"' - lang: C# source: 'var response = await client.MachineLearning.DeleteJobAsync(jobId: "total-requests");' - lang: Java source: "client.ml().deleteJob(d -> d\n .jobId(\"total-requests\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}': post: tags: - ml anomaly summary: "Get model snapshots info\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ml/anomaly_detectors/{job_id}/model_snapshots\n
\n
\n POST\n /_ml/anomaly_detectors/{job_id}/model_snapshots\n
\n
\n GET\n /_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}\n
\n
\n POST\n /_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}\n
\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: ml-get-model-snapshots parameters: - $ref: '#/components/parameters/ml.get_model_snapshots-job_id' - $ref: '#/components/parameters/ml.get_model_snapshots-snapshot_id' - $ref: '#/components/parameters/ml.get_model_snapshots-desc' - $ref: '#/components/parameters/ml.get_model_snapshots-end' - $ref: '#/components/parameters/ml.get_model_snapshots-from' - $ref: '#/components/parameters/ml.get_model_snapshots-size' - $ref: '#/components/parameters/ml.get_model_snapshots-sort' - $ref: '#/components/parameters/ml.get_model_snapshots-start' requestBody: $ref: '#/components/requestBodies/ml.get_model_snapshots' responses: '200': $ref: '#/components/responses/ml.get_model_snapshots-200' x-state: Generally available; Added in 5.4.0 x-codeSamples: - lang: Console source: "GET _ml/anomaly_detectors/high_sum_total_sales/model_snapshots\n{\n \"start\": \"1575402236000\"\n}" - lang: Python source: "resp = client.ml.get_model_snapshots(\n job_id=\"high_sum_total_sales\",\n start=\"1575402236000\",\n)" - lang: JavaScript source: "const response = await client.ml.getModelSnapshots({\n job_id: \"high_sum_total_sales\",\n start: 1575402236000,\n});" - lang: Ruby source: "response = client.ml.get_model_snapshots(\n job_id: \"high_sum_total_sales\",\n body: {\n \"start\": \"1575402236000\"\n }\n)" - lang: PHP source: "$resp = $client->ml()->getModelSnapshots([\n \"job_id\" => \"high_sum_total_sales\",\n \"body\" => [\n \"start\" => \"1575402236000\",\n ],\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"start":"1575402236000"}'' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/high_sum_total_sales/model_snapshots"' - lang: C# source: "var response = await client.MachineLearning\n .GetModelSnapshotsAsync(new GetModelSnapshotsRequest()\n {\n JobId = \"high_sum_total_sales\",\n Start = DateTimeOffset.Parse(\"2019-12-03T19:43:56.0000000+00:00\", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind)\n });" - lang: Java source: "client.ml().getModelSnapshots(g -> g\n .jobId(\"high_sum_total_sales\")\n .start(DateTime.of(\"1575402236000\"))\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name delete: tags: - ml anomaly summary: Delete a model snapshot description: "You cannot delete the active model snapshot. To delete that snapshot, first\nrevert to a different one. To identify the active model snapshot, refer to\nthe `model_snapshot_id` in the results from the get jobs API.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-delete-model-snapshot parameters: - name: job_id in: path description: Identifier for the anomaly detection job. required: true schema: $ref: '#/components/schemas/_types.Id' - name: snapshot_id in: path description: Identifier for the model snapshot. required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: MlDeleteModelSnapshotResponseExample1: description: A successful response when deleting an existing model snapshot. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 5.4.0 x-codeSamples: - lang: Console source: "DELETE _ml/anomaly_detectors/farequote/model_snapshots/1491948163\n" - lang: Python source: "resp = client.ml.delete_model_snapshot(\n job_id=\"farequote\",\n snapshot_id=\"1491948163\",\n)" - lang: JavaScript source: "const response = await client.ml.deleteModelSnapshot({\n job_id: \"farequote\",\n snapshot_id: 1491948163,\n});" - lang: Ruby source: "response = client.ml.delete_model_snapshot(\n job_id: \"farequote\",\n snapshot_id: \"1491948163\"\n)" - lang: PHP source: "$resp = $client->ml()->deleteModelSnapshot([\n \"job_id\" => \"farequote\",\n \"snapshot_id\" => \"1491948163\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/anomaly_detectors/farequote/model_snapshots/1491948163"' - lang: C# source: 'var response = await client.MachineLearning.DeleteModelSnapshotAsync(jobId: "farequote", snapshotId: "1491948163");' - lang: Java source: "client.ml().deleteModelSnapshot(d -> d\n .jobId(\"farequote\")\n .snapshotId(\"1491948163\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/trained_models/{model_id}': get: tags: - ml trained model summary: "Get trained model configuration info\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ml/trained_models\n
\n
\n GET\n /_ml/trained_models/{model_id}\n
\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: ml-get-trained-models parameters: - $ref: '#/components/parameters/ml.get_trained_models-model_id' - $ref: '#/components/parameters/ml.get_trained_models-allow_no_match' - $ref: '#/components/parameters/ml.get_trained_models-decompress_definition' - $ref: '#/components/parameters/ml.get_trained_models-exclude_generated' - $ref: '#/components/parameters/ml.get_trained_models-from' - $ref: '#/components/parameters/ml.get_trained_models-include' - $ref: '#/components/parameters/ml.get_trained_models-size' - $ref: '#/components/parameters/ml.get_trained_models-tags' responses: '200': $ref: '#/components/responses/ml.get_trained_models-200' x-state: Generally available; Added in 7.10.0 x-codeSamples: - lang: Console source: "GET _ml/trained_models/\n" - lang: Python source: resp = client.ml.get_trained_models() - lang: JavaScript source: const response = await client.ml.getTrainedModels(); - lang: Ruby source: response = client.ml.get_trained_models - lang: PHP source: $resp = $client->ml()->getTrainedModels(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/trained_models/"' - lang: C# source: var response = await client.MachineLearning.GetTrainedModelsAsync(); - lang: Java source: "client.ml().getTrainedModels(g -> g);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name put: tags: - ml trained model summary: Create a trained model description: "Enable you to supply a trained model that is not created by data frame analytics.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-put-trained-model parameters: - name: model_id in: path description: The unique identifier of the trained model. required: true schema: $ref: '#/components/schemas/_types.Id' - name: defer_definition_decompression in: query description: "If set to `true` and a `compressed_definition` is provided,\nthe request defers definition decompression and skips relevant\nvalidations." schema: type: boolean default: false x-state: Generally available; Added in 8.0.0 - name: wait_for_completion in: query description: "Whether to wait for all child operations (e.g. model download)\nto complete." schema: type: boolean default: false x-state: Generally available; Added in 8.8.0 requestBody: content: application/json: schema: type: object properties: compressed_definition: type: string description: "The compressed (GZipped and Base64 encoded) inference definition of the\nmodel. If compressed_definition is specified, then definition cannot be\nspecified." definition: allOf: - $ref: '#/components/schemas/ml.put_trained_model.Definition' description: "The inference definition for the model. If definition is specified, then\ncompressed_definition cannot be specified." description: type: string description: A human-readable description of the inference trained model. inference_config: allOf: - $ref: '#/components/schemas/ml._types.InferenceConfigCreateContainer' description: "The default configuration for inference. This can be either a regression\nor classification configuration. It must match the underlying\ndefinition.trained_model's target_type. For pre-packaged models such as\nELSER the config is not required." input: allOf: - $ref: '#/components/schemas/ml.put_trained_model.Input' description: The input field names for the model definition. metadata: type: object description: An object map that contains metadata about the model. model_type: allOf: - $ref: '#/components/schemas/ml._types.TrainedModelType' description: "The model type.\n\nSupported values include:\n - `tree_ensemble`: The model definition is an ensemble model of decision trees.\n - `lang_ident`: A special type reserved for language identification models.\n - `pytorch`: The stored definition is a PyTorch (specifically a TorchScript) model.\nCurrently only NLP models are supported.\n\n" default: tree_ensemble model_size_bytes: type: number description: "The estimated memory usage in bytes to keep the trained model in memory.\nThis property is supported only if defer_definition_decompression is true\nor the model definition is not supplied." platform_architecture: type: string description: "The platform architecture (if applicable) of the trained mode. If the model\nonly works on one platform, because it is heavily optimized for a particular\nprocessor architecture and OS combination, then this field specifies which.\nThe format of the string must match the platform identifiers used by Elasticsearch,\nso one of, `linux-x86_64`, `linux-aarch64`, `darwin-aarch64`,\nor `windows-x86_64`. For portable models (those that work independent of processor\narchitecture or OS features), leave this field unset." tags: type: array items: type: string description: An array of tags to organize the model. prefix_strings: allOf: - $ref: '#/components/schemas/ml._types.TrainedModelPrefixStrings' description: Optional prefix strings applied at inference x-state: Generally available; Added in 8.12.0 required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/ml._types.TrainedModelConfig' x-state: Generally available; Added in 7.10.0 x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name delete: tags: - ml trained model summary: Delete an unreferenced trained model description: "The request deletes a trained inference model that is not referenced by an ingest pipeline.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-delete-trained-model parameters: - name: model_id in: path description: The unique identifier of the trained model. required: true schema: $ref: '#/components/schemas/_types.Id' - name: force in: query description: Forcefully deletes a trained model that is referenced by ingest pipelines or has a started deployment. schema: type: boolean - name: timeout in: query description: 'Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: MlDeleteTrainedModelResponseExample1: description: A successful response when deleting an existing trained inference model. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 7.10.0 x-codeSamples: - lang: Console source: "DELETE _ml/trained_models/regression-job-one-1574775307356\n" - lang: Python source: "resp = client.ml.delete_trained_model(\n model_id=\"regression-job-one-1574775307356\",\n)" - lang: JavaScript source: "const response = await client.ml.deleteTrainedModel({\n model_id: \"regression-job-one-1574775307356\",\n});" - lang: Ruby source: "response = client.ml.delete_trained_model(\n model_id: \"regression-job-one-1574775307356\"\n)" - lang: PHP source: "$resp = $client->ml()->deleteTrainedModel([\n \"model_id\" => \"regression-job-one-1574775307356\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/trained_models/regression-job-one-1574775307356"' - lang: C# source: 'var response = await client.MachineLearning.DeleteTrainedModelAsync(modelId: "regression-job-one-1574775307356");' - lang: Java source: "client.ml().deleteTrainedModel(d -> d\n .modelId(\"regression-job-one-1574775307356\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/trained_models/{model_id}/model_aliases/{model_alias}': put: tags: - ml trained model summary: Create or update a trained model alias description: "A trained model alias is a logical name used to reference a single trained\nmodel.\nYou can use aliases instead of trained model identifiers to make it easier to\nreference your models. For example, you can use aliases in inference\naggregations and processors.\nAn alias must be unique and refer to only a single trained model. However,\nyou can have multiple aliases for each trained model.\nIf you use this API to update an alias such that it references a different\ntrained model ID and the model uses a different type of data frame analytics,\nan error occurs. For example, this situation occurs if you have a trained\nmodel for regression analysis and a trained model for classification\nanalysis; you cannot reassign an alias from one type of trained model to\nanother.\nIf you use this API to update an alias and there are very few input fields in\ncommon between the old and new trained models for the model alias, the API\nreturns a warning.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-put-trained-model-alias parameters: - name: model_id in: path description: The identifier for the trained model that the alias refers to. required: true schema: $ref: '#/components/schemas/_types.Id' - name: model_alias in: path description: The alias to create or update. This value cannot end in numbers. required: true schema: $ref: '#/components/schemas/_types.Name' - name: reassign in: query description: "Specifies whether the alias gets reassigned to the specified trained\nmodel if it is already assigned to a different model. If the alias is\nalready assigned and this parameter is false, the API returns an error." schema: type: boolean default: false responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 7.13.0 x-codeSamples: - lang: Console source: "PUT _ml/trained_models/flight-delay-prediction-1574775339910/model_aliases/flight_delay_model\n" - lang: Python source: "resp = client.ml.put_trained_model_alias(\n model_id=\"flight-delay-prediction-1574775339910\",\n model_alias=\"flight_delay_model\",\n)" - lang: JavaScript source: "const response = await client.ml.putTrainedModelAlias({\n model_id: \"flight-delay-prediction-1574775339910\",\n model_alias: \"flight_delay_model\",\n});" - lang: Ruby source: "response = client.ml.put_trained_model_alias(\n model_id: \"flight-delay-prediction-1574775339910\",\n model_alias: \"flight_delay_model\"\n)" - lang: PHP source: "$resp = $client->ml()->putTrainedModelAlias([\n \"model_id\" => \"flight-delay-prediction-1574775339910\",\n \"model_alias\" => \"flight_delay_model\",\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/trained_models/flight-delay-prediction-1574775339910/model_aliases/flight_delay_model"' - lang: C# source: 'var response = await client.MachineLearning.PutTrainedModelAliasAsync(modelId: "flight-delay-prediction-1574775339910", modelAlias: "flight_delay_model");' - lang: Java source: "client.ml().putTrainedModelAlias(p -> p\n .modelAlias(\"flight_delay_model\")\n .modelId(\"flight-delay-prediction-1574775339910\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name delete: tags: - ml trained model summary: Delete a trained model alias description: "This API deletes an existing model alias that refers to a trained model. If\nthe model alias is missing or refers to a model other than the one identified\nby the `model_id`, this API returns an error.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-delete-trained-model-alias parameters: - name: model_id in: path description: The trained model ID to which the model alias refers. required: true schema: $ref: '#/components/schemas/_types.Id' - name: model_alias in: path description: The model alias to delete. required: true schema: $ref: '#/components/schemas/_types.Name' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: MlDeleteTrainedModelAliasResponseExample1: description: A successful response when deleting a trained model alias. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 7.13.0 x-codeSamples: - lang: Console source: "DELETE _ml/trained_models/flight-delay-prediction-1574775339910/model_aliases/flight_delay_model\n" - lang: Python source: "resp = client.ml.delete_trained_model_alias(\n model_id=\"flight-delay-prediction-1574775339910\",\n model_alias=\"flight_delay_model\",\n)" - lang: JavaScript source: "const response = await client.ml.deleteTrainedModelAlias({\n model_id: \"flight-delay-prediction-1574775339910\",\n model_alias: \"flight_delay_model\",\n});" - lang: Ruby source: "response = client.ml.delete_trained_model_alias(\n model_id: \"flight-delay-prediction-1574775339910\",\n model_alias: \"flight_delay_model\"\n)" - lang: PHP source: "$resp = $client->ml()->deleteTrainedModelAlias([\n \"model_id\" => \"flight-delay-prediction-1574775339910\",\n \"model_alias\" => \"flight_delay_model\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/trained_models/flight-delay-prediction-1574775339910/model_aliases/flight_delay_model"' - lang: C# source: 'var response = await client.MachineLearning.DeleteTrainedModelAliasAsync(modelId: "flight-delay-prediction-1574775339910", modelAlias: "flight_delay_model");' - lang: Java source: "client.ml().deleteTrainedModelAlias(d -> d\n .modelAlias(\"flight_delay_model\")\n .modelId(\"flight-delay-prediction-1574775339910\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name /_ml/anomaly_detectors/_estimate_model_memory: post: tags: - ml anomaly summary: Estimate job model memory usage description: "Make an estimation of the memory usage for an anomaly detection job model.\nThe estimate is based on analysis configuration details for the job and cardinality\nestimates for the fields it references.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-estimate-model-memory requestBody: content: application/json: schema: type: object properties: analysis_config: allOf: - $ref: '#/components/schemas/ml._types.AnalysisConfig' description: "For a list of the properties that you can specify in the\n`analysis_config` component of the body of this API." max_bucket_cardinality: type: object additionalProperties: type: number description: "Estimates of the highest cardinality in a single bucket that is observed\nfor influencer fields over the time period that the job analyzes data.\nTo produce a good answer, values must be provided for all influencer\nfields. Providing values for fields that are not listed as `influencers`\nhas no effect on the estimation." overall_cardinality: type: object additionalProperties: type: number description: "Estimates of the cardinality that is observed for fields over the whole\ntime period that the job analyzes data. To produce a good answer, values\nmust be provided for fields referenced in the `by_field_name`,\n`over_field_name` and `partition_field_name` of any detectors. Providing\nvalues for other fields has no effect on the estimation. It can be\nomitted from the request if no detectors have a `by_field_name`,\n`over_field_name` or `partition_field_name`." examples: MlEstimateModelMemoryRequestExample1: description: Run `POST _ml/anomaly_detectors/_estimate_model_memory` to estimate the model memory limit based on the analysis configuration details provided in the request body. value: "{\n \"analysis_config\": {\n \"bucket_span\": \"5m\",\n \"detectors\": [\n {\n \"function\": \"sum\",\n \"field_name\": \"bytes\",\n \"by_field_name\": \"status\",\n \"partition_field_name\": \"app\"\n }\n ],\n \"influencers\": [\n \"source_ip\",\n \"dest_ip\"\n ]\n },\n \"overall_cardinality\": {\n \"status\": 10,\n \"app\": 50\n },\n \"max_bucket_cardinality\": {\n \"source_ip\": 300,\n \"dest_ip\": 30\n }\n}" x-codeSamples: - lang: Console source: "POST _ml/anomaly_detectors/_estimate_model_memory\n{\n \"analysis_config\": {\n \"bucket_span\": \"5m\",\n \"detectors\": [\n {\n \"function\": \"sum\",\n \"field_name\": \"bytes\",\n \"by_field_name\": \"status\",\n \"partition_field_name\": \"app\"\n }\n ],\n \"influencers\": [\n \"source_ip\",\n \"dest_ip\"\n ]\n },\n \"overall_cardinality\": {\n \"status\": 10,\n \"app\": 50\n },\n \"max_bucket_cardinality\": {\n \"source_ip\": 300,\n \"dest_ip\": 30\n }\n}" - lang: Python source: "resp = client.ml.estimate_model_memory(\n analysis_config={\n \"bucket_span\": \"5m\",\n \"detectors\": [\n {\n \"function\": \"sum\",\n \"field_name\": \"bytes\",\n \"by_field_name\": \"status\",\n \"partition_field_name\": \"app\"\n }\n ],\n \"influencers\": [\n \"source_ip\",\n \"dest_ip\"\n ]\n },\n overall_cardinality={\n \"status\": 10,\n \"app\": 50\n },\n max_bucket_cardinality={\n \"source_ip\": 300,\n \"dest_ip\": 30\n },\n)" - lang: JavaScript source: "const response = await client.ml.estimateModelMemory({\n analysis_config: {\n bucket_span: \"5m\",\n detectors: [\n {\n function: \"sum\",\n field_name: \"bytes\",\n by_field_name: \"status\",\n partition_field_name: \"app\",\n },\n ],\n influencers: [\"source_ip\", \"dest_ip\"],\n },\n overall_cardinality: {\n status: 10,\n app: 50,\n },\n max_bucket_cardinality: {\n source_ip: 300,\n dest_ip: 30,\n },\n});" - lang: Ruby source: "response = client.ml.estimate_model_memory(\n body: {\n \"analysis_config\": {\n \"bucket_span\": \"5m\",\n \"detectors\": [\n {\n \"function\": \"sum\",\n \"field_name\": \"bytes\",\n \"by_field_name\": \"status\",\n \"partition_field_name\": \"app\"\n }\n ],\n \"influencers\": [\n \"source_ip\",\n \"dest_ip\"\n ]\n },\n \"overall_cardinality\": {\n \"status\": 10,\n \"app\": 50\n },\n \"max_bucket_cardinality\": {\n \"source_ip\": 300,\n \"dest_ip\": 30\n }\n }\n)" - lang: PHP source: "$resp = $client->ml()->estimateModelMemory([\n \"body\" => [\n \"analysis_config\" => [\n \"bucket_span\" => \"5m\",\n \"detectors\" => array(\n [\n \"function\" => \"sum\",\n \"field_name\" => \"bytes\",\n \"by_field_name\" => \"status\",\n \"partition_field_name\" => \"app\",\n ],\n ),\n \"influencers\" => array(\n \"source_ip\",\n \"dest_ip\",\n ),\n ],\n \"overall_cardinality\" => [\n \"status\" => 10,\n \"app\" => 50,\n ],\n \"max_bucket_cardinality\" => [\n \"source_ip\" => 300,\n \"dest_ip\" => 30,\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"analysis_config":{"bucket_span":"5m","detectors":[{"function":"sum","field_name":"bytes","by_field_name":"status","partition_field_name":"app"}],"influencers":["source_ip","dest_ip"]},"overall_cardinality":{"status":10,"app":50},"max_bucket_cardinality":{"source_ip":300,"dest_ip":30}}'' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/_estimate_model_memory"' - lang: C# source: "var response = await client.MachineLearning\n .EstimateModelMemoryAsync(d1 => d1\n .AnalysisConfig(d2 => d2\n .BucketSpan(\"5m\")\n .Detectors(d3 => d3\n .ByFieldName(x => x.Status)\n .FieldName(x => x.Bytes)\n .Function(\"sum\")\n .PartitionFieldName(x => x.App)\n )\n .Influencers(x => x.SourceIp, x => x.DestIp)\n )\n .MaxBucketCardinality(new Dictionary()\n {\n { global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.SourceIp), 300L },\n { global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.DestIp), 30L }\n })\n .OverallCardinality(new Dictionary()\n {\n { global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.Status), 10L },\n { global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.App), 50L }\n })\n );" - lang: Java source: "client.ml().estimateModelMemory(e -> e\n .analysisConfig(a -> a\n .bucketSpan(b -> b\n .time(\"5m\")\n )\n .detectors(d -> d\n .byFieldName(\"status\")\n .fieldName(\"bytes\")\n .function(\"sum\")\n .partitionFieldName(\"app\")\n )\n .influencers(List.of(\"source_ip\",\"dest_ip\"))\n )\n .maxBucketCardinality(Map.of(\"dest_ip\", 30L,\"source_ip\", 300L))\n .overallCardinality(Map.of(\"app\", 50L,\"status\", 10L))\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - model_memory_estimate type: object properties: model_memory_estimate: type: string examples: MlEstimateModelMemoryResponseExample1: description: A successful response from `POST _ml/anomaly_detectors/_estimate_model_memory`. value: "{\n \"model_memory_estimate\": \"21mb\"\n}" x-state: Generally available; Added in 7.7.0 x-codeSamples: - lang: Console source: "POST _ml/anomaly_detectors/_estimate_model_memory\n{\n \"analysis_config\": {\n \"bucket_span\": \"5m\",\n \"detectors\": [\n {\n \"function\": \"sum\",\n \"field_name\": \"bytes\",\n \"by_field_name\": \"status\",\n \"partition_field_name\": \"app\"\n }\n ],\n \"influencers\": [\n \"source_ip\",\n \"dest_ip\"\n ]\n },\n \"overall_cardinality\": {\n \"status\": 10,\n \"app\": 50\n },\n \"max_bucket_cardinality\": {\n \"source_ip\": 300,\n \"dest_ip\": 30\n }\n}" - lang: Python source: "resp = client.ml.estimate_model_memory(\n analysis_config={\n \"bucket_span\": \"5m\",\n \"detectors\": [\n {\n \"function\": \"sum\",\n \"field_name\": \"bytes\",\n \"by_field_name\": \"status\",\n \"partition_field_name\": \"app\"\n }\n ],\n \"influencers\": [\n \"source_ip\",\n \"dest_ip\"\n ]\n },\n overall_cardinality={\n \"status\": 10,\n \"app\": 50\n },\n max_bucket_cardinality={\n \"source_ip\": 300,\n \"dest_ip\": 30\n },\n)" - lang: JavaScript source: "const response = await client.ml.estimateModelMemory({\n analysis_config: {\n bucket_span: \"5m\",\n detectors: [\n {\n function: \"sum\",\n field_name: \"bytes\",\n by_field_name: \"status\",\n partition_field_name: \"app\",\n },\n ],\n influencers: [\"source_ip\", \"dest_ip\"],\n },\n overall_cardinality: {\n status: 10,\n app: 50,\n },\n max_bucket_cardinality: {\n source_ip: 300,\n dest_ip: 30,\n },\n});" - lang: Ruby source: "response = client.ml.estimate_model_memory(\n body: {\n \"analysis_config\": {\n \"bucket_span\": \"5m\",\n \"detectors\": [\n {\n \"function\": \"sum\",\n \"field_name\": \"bytes\",\n \"by_field_name\": \"status\",\n \"partition_field_name\": \"app\"\n }\n ],\n \"influencers\": [\n \"source_ip\",\n \"dest_ip\"\n ]\n },\n \"overall_cardinality\": {\n \"status\": 10,\n \"app\": 50\n },\n \"max_bucket_cardinality\": {\n \"source_ip\": 300,\n \"dest_ip\": 30\n }\n }\n)" - lang: PHP source: "$resp = $client->ml()->estimateModelMemory([\n \"body\" => [\n \"analysis_config\" => [\n \"bucket_span\" => \"5m\",\n \"detectors\" => array(\n [\n \"function\" => \"sum\",\n \"field_name\" => \"bytes\",\n \"by_field_name\" => \"status\",\n \"partition_field_name\" => \"app\",\n ],\n ),\n \"influencers\" => array(\n \"source_ip\",\n \"dest_ip\",\n ),\n ],\n \"overall_cardinality\" => [\n \"status\" => 10,\n \"app\" => 50,\n ],\n \"max_bucket_cardinality\" => [\n \"source_ip\" => 300,\n \"dest_ip\" => 30,\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"analysis_config":{"bucket_span":"5m","detectors":[{"function":"sum","field_name":"bytes","by_field_name":"status","partition_field_name":"app"}],"influencers":["source_ip","dest_ip"]},"overall_cardinality":{"status":10,"app":50},"max_bucket_cardinality":{"source_ip":300,"dest_ip":30}}'' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/_estimate_model_memory"' - lang: C# source: "var response = await client.MachineLearning\n .EstimateModelMemoryAsync(d1 => d1\n .AnalysisConfig(d2 => d2\n .BucketSpan(\"5m\")\n .Detectors(d3 => d3\n .ByFieldName(x => x.Status)\n .FieldName(x => x.Bytes)\n .Function(\"sum\")\n .PartitionFieldName(x => x.App)\n )\n .Influencers(x => x.SourceIp, x => x.DestIp)\n )\n .MaxBucketCardinality(new Dictionary()\n {\n { global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.SourceIp), 300L },\n { global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.DestIp), 30L }\n })\n .OverallCardinality(new Dictionary()\n {\n { global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.Status), 10L },\n { global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.App), 50L }\n })\n );" - lang: Java source: "client.ml().estimateModelMemory(e -> e\n .analysisConfig(a -> a\n .bucketSpan(b -> b\n .time(\"5m\")\n )\n .detectors(d -> d\n .byFieldName(\"status\")\n .fieldName(\"bytes\")\n .function(\"sum\")\n .partitionFieldName(\"app\")\n )\n .influencers(List.of(\"source_ip\",\"dest_ip\"))\n )\n .maxBucketCardinality(Map.of(\"dest_ip\", 30L,\"source_ip\", 300L))\n .overallCardinality(Map.of(\"app\", 50L,\"status\", 10L))\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name /_ml/data_frame/_evaluate: post: tags: - ml data frame summary: Evaluate data frame analytics description: "The API packages together commonly used evaluation metrics for various types\nof machine learning features. This has been designed for use on indexes\ncreated by data frame analytics. Evaluation requires both a ground truth\nfield and an analytics result field to be present.\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: ml-evaluate-data-frame requestBody: content: application/json: schema: required: - evaluation - index type: object properties: evaluation: allOf: - $ref: '#/components/schemas/ml._types.DataframeEvaluationContainer' description: Defines the type of evaluation you want to perform. index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: Defines the `index` in which the evaluation will be performed. query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: A query clause that retrieves a subset of data from the source index. examples: MlEvaluateDataFrameRequestExample1: summary: Classification example 1 description: "Run `POST _ml/data_frame/_evaluate` to evaluate a a classification job for an annotated index. The `actual_field` contains the ground truth for classification. The `predicted_field` contains the predicted value calculated by the classification analysis.\n" value: "{\n \"index\": \"animal_classification\",\n \"evaluation\": {\n \"classification\": {\n \"actual_field\": \"animal_class\",\n \"predicted_field\": \"ml.animal_class_prediction\",\n \"metrics\": {\n \"multiclass_confusion_matrix\": {}\n }\n }\n }\n}" x-codeSamples: - lang: Console source: "POST _ml/data_frame/_evaluate\n{\n \"index\": \"animal_classification\",\n \"evaluation\": {\n \"classification\": {\n \"actual_field\": \"animal_class\",\n \"predicted_field\": \"ml.animal_class_prediction\",\n \"metrics\": {\n \"multiclass_confusion_matrix\": {}\n }\n }\n }\n}" - lang: Python source: "resp = client.ml.evaluate_data_frame(\n index=\"animal_classification\",\n evaluation={\n \"classification\": {\n \"actual_field\": \"animal_class\",\n \"predicted_field\": \"ml.animal_class_prediction\",\n \"metrics\": {\n \"multiclass_confusion_matrix\": {}\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.ml.evaluateDataFrame({\n index: \"animal_classification\",\n evaluation: {\n classification: {\n actual_field: \"animal_class\",\n predicted_field: \"ml.animal_class_prediction\",\n metrics: {\n multiclass_confusion_matrix: {},\n },\n },\n },\n});" - lang: Ruby source: "response = client.ml.evaluate_data_frame(\n body: {\n \"index\": \"animal_classification\",\n \"evaluation\": {\n \"classification\": {\n \"actual_field\": \"animal_class\",\n \"predicted_field\": \"ml.animal_class_prediction\",\n \"metrics\": {\n \"multiclass_confusion_matrix\": {}\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->ml()->evaluateDataFrame([\n \"body\" => [\n \"index\" => \"animal_classification\",\n \"evaluation\" => [\n \"classification\" => [\n \"actual_field\" => \"animal_class\",\n \"predicted_field\" => \"ml.animal_class_prediction\",\n \"metrics\" => [\n \"multiclass_confusion_matrix\" => new ArrayObject([]),\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"index":"animal_classification","evaluation":{"classification":{"actual_field":"animal_class","predicted_field":"ml.animal_class_prediction","metrics":{"multiclass_confusion_matrix":{}}}}}'' "$ELASTICSEARCH_URL/_ml/data_frame/_evaluate"' - lang: C# source: "var response = await client.MachineLearning\n .EvaluateDataFrameAsync(d1 => d1\n .Evaluation(d2 => d2\n .Classification(d3 => d3\n .ActualField(x => x.AnimalClass)\n .Metrics(d4 => d4\n .MulticlassConfusionMatrix(new Dictionary() { })\n )\n .PredictedField(x => x.Ml.AnimalClassPrediction)\n )\n )\n .Index(\"animal_classification\")\n );" - lang: Java source: "client.ml().evaluateDataFrame(e -> e\n .evaluation(ev -> ev\n .classification(c -> c\n .actualField(\"animal_class\")\n .predictedField(\"ml.animal_class_prediction\")\n .metrics(m -> m\n .multiclassConfusionMatrix(Map.of())\n )\n )\n )\n .index(\"animal_classification\")\n);\n" MlEvaluateDataFrameRequestExample2: summary: Classification example 2 description: "Run `POST _ml/data_frame/_evaluate` to evaluate a classification job with AUC ROC metrics for an annotated index. The `actual_field` contains the ground truth value for the actual animal classification. This is required in order to evaluate results. The `class_name` specifies the class name that is treated as positive during the evaluation, all the other classes are treated as negative.\n" value: "{\n \"index\": \"animal_classification\",\n \"evaluation\": {\n \"classification\": {\n \"actual_field\": \"animal_class\",\n \"metrics\": {\n \"auc_roc\": {\n \"class_name\": \"dog\"\n }\n }\n }\n }\n}" x-codeSamples: - lang: Console source: "POST _ml/data_frame/_evaluate\n{\n \"index\": \"animal_classification\",\n \"evaluation\": {\n \"classification\": {\n \"actual_field\": \"animal_class\",\n \"metrics\": {\n \"auc_roc\": {\n \"class_name\": \"dog\"\n }\n }\n }\n }\n}" - lang: Python source: "resp = client.ml.evaluate_data_frame(\n index=\"animal_classification\",\n evaluation={\n \"classification\": {\n \"actual_field\": \"animal_class\",\n \"metrics\": {\n \"auc_roc\": {\n \"class_name\": \"dog\"\n }\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.ml.evaluateDataFrame({\n index: \"animal_classification\",\n evaluation: {\n classification: {\n actual_field: \"animal_class\",\n metrics: {\n auc_roc: {\n class_name: \"dog\",\n },\n },\n },\n },\n});" - lang: Ruby source: "response = client.ml.evaluate_data_frame(\n body: {\n \"index\": \"animal_classification\",\n \"evaluation\": {\n \"classification\": {\n \"actual_field\": \"animal_class\",\n \"metrics\": {\n \"auc_roc\": {\n \"class_name\": \"dog\"\n }\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->ml()->evaluateDataFrame([\n \"body\" => [\n \"index\" => \"animal_classification\",\n \"evaluation\" => [\n \"classification\" => [\n \"actual_field\" => \"animal_class\",\n \"metrics\" => [\n \"auc_roc\" => [\n \"class_name\" => \"dog\",\n ],\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"index":"animal_classification","evaluation":{"classification":{"actual_field":"animal_class","metrics":{"auc_roc":{"class_name":"dog"}}}}}'' "$ELASTICSEARCH_URL/_ml/data_frame/_evaluate"' - lang: C# source: "var response = await client.MachineLearning\n .EvaluateDataFrameAsync(d1 => d1\n .Evaluation(d2 => d2\n .Classification(d3 => d3\n .ActualField(x => x.AnimalClass)\n .Metrics(d4 => d4\n .AucRoc(d5 => d5\n .ClassName(\"dog\")\n )\n )\n )\n )\n .Index(\"animal_classification\")\n );" - lang: Java source: "client.ml().evaluateDataFrame(e -> e\n .evaluation(ev -> ev\n .classification(c -> c\n .actualField(\"animal_class\")\n .metrics(m -> m\n .aucRoc(a -> a\n .className(\"dog\")\n )\n )\n )\n )\n .index(\"animal_classification\")\n);\n" MlEvaluateDataFrameRequestExample3: summary: Outlier detection description: "Run `POST _ml/data_frame/_evaluate` to evaluate an outlier detection job for an annotated index.\n" value: "{\n \"index\": \"my_analytics_dest_index\",\n \"evaluation\": {\n \"outlier_detection\": {\n \"actual_field\": \"is_outlier\",\n \"predicted_probability_field\": \"ml.outlier_score\"\n }\n }\n}" x-codeSamples: - lang: Console source: "POST _ml/data_frame/_evaluate\n{\n \"index\": \"my_analytics_dest_index\",\n \"evaluation\": {\n \"outlier_detection\": {\n \"actual_field\": \"is_outlier\",\n \"predicted_probability_field\": \"ml.outlier_score\"\n }\n }\n}" - lang: Python source: "resp = client.ml.evaluate_data_frame(\n index=\"my_analytics_dest_index\",\n evaluation={\n \"outlier_detection\": {\n \"actual_field\": \"is_outlier\",\n \"predicted_probability_field\": \"ml.outlier_score\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.ml.evaluateDataFrame({\n index: \"my_analytics_dest_index\",\n evaluation: {\n outlier_detection: {\n actual_field: \"is_outlier\",\n predicted_probability_field: \"ml.outlier_score\",\n },\n },\n});" - lang: Ruby source: "response = client.ml.evaluate_data_frame(\n body: {\n \"index\": \"my_analytics_dest_index\",\n \"evaluation\": {\n \"outlier_detection\": {\n \"actual_field\": \"is_outlier\",\n \"predicted_probability_field\": \"ml.outlier_score\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->ml()->evaluateDataFrame([\n \"body\" => [\n \"index\" => \"my_analytics_dest_index\",\n \"evaluation\" => [\n \"outlier_detection\" => [\n \"actual_field\" => \"is_outlier\",\n \"predicted_probability_field\" => \"ml.outlier_score\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"index":"my_analytics_dest_index","evaluation":{"outlier_detection":{"actual_field":"is_outlier","predicted_probability_field":"ml.outlier_score"}}}'' "$ELASTICSEARCH_URL/_ml/data_frame/_evaluate"' - lang: C# source: "var response = await client.MachineLearning\n .EvaluateDataFrameAsync(d1 => d1\n .Evaluation(d2 => d2\n .OutlierDetection(d3 => d3\n .ActualField(x => x.IsOutlier)\n .PredictedProbabilityField(x => x.Ml.OutlierScore)\n )\n )\n .Index(\"my_analytics_dest_index\")\n );" - lang: Java source: "client.ml().evaluateDataFrame(e -> e\n .evaluation(ev -> ev\n .outlierDetection(o -> o\n .actualField(\"is_outlier\")\n .predictedProbabilityField(\"ml.outlier_score\")\n )\n )\n .index(\"my_analytics_dest_index\")\n);\n" MlEvaluateDataFrameRequestExample4: summary: Regression example 1 description: "Run `POST _ml/data_frame/_evaluate` to evaluate the testing error of a regression job for an annotated index. The term query in the body limits evaluation to be performed on the test split only. The `actual_field` contains the ground truth for house prices. The `predicted_field` contains the house price calculated by the regression analysis.\n" value: "{\n \"index\": \"house_price_predictions\",\n \"query\": {\n \"bool\": {\n \"filter\": [\n {\n \"term\": {\n \"ml.is_training\": false\n }\n }\n ]\n }\n },\n \"evaluation\": {\n \"regression\": {\n \"actual_field\": \"price\",\n \"predicted_field\": \"ml.price_prediction\",\n \"metrics\": {\n \"r_squared\": {},\n \"mse\": {},\n \"msle\": {\n \"offset\": 10\n },\n \"huber\": {\n \"delta\": 1.5\n }\n }\n }\n }\n}" x-codeSamples: - lang: Console source: "POST _ml/data_frame/_evaluate\n{\n \"index\": \"house_price_predictions\",\n \"query\": {\n \"bool\": {\n \"filter\": [\n {\n \"term\": {\n \"ml.is_training\": false\n }\n }\n ]\n }\n },\n \"evaluation\": {\n \"regression\": {\n \"actual_field\": \"price\",\n \"predicted_field\": \"ml.price_prediction\",\n \"metrics\": {\n \"r_squared\": {},\n \"mse\": {},\n \"msle\": {\n \"offset\": 10\n },\n \"huber\": {\n \"delta\": 1.5\n }\n }\n }\n }\n}" - lang: Python source: "resp = client.ml.evaluate_data_frame(\n index=\"house_price_predictions\",\n query={\n \"bool\": {\n \"filter\": [\n {\n \"term\": {\n \"ml.is_training\": False\n }\n }\n ]\n }\n },\n evaluation={\n \"regression\": {\n \"actual_field\": \"price\",\n \"predicted_field\": \"ml.price_prediction\",\n \"metrics\": {\n \"r_squared\": {},\n \"mse\": {},\n \"msle\": {\n \"offset\": 10\n },\n \"huber\": {\n \"delta\": 1.5\n }\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.ml.evaluateDataFrame({\n index: \"house_price_predictions\",\n query: {\n bool: {\n filter: [\n {\n term: {\n \"ml.is_training\": false,\n },\n },\n ],\n },\n },\n evaluation: {\n regression: {\n actual_field: \"price\",\n predicted_field: \"ml.price_prediction\",\n metrics: {\n r_squared: {},\n mse: {},\n msle: {\n offset: 10,\n },\n huber: {\n delta: 1.5,\n },\n },\n },\n },\n});" - lang: Ruby source: "response = client.ml.evaluate_data_frame(\n body: {\n \"index\": \"house_price_predictions\",\n \"query\": {\n \"bool\": {\n \"filter\": [\n {\n \"term\": {\n \"ml.is_training\": false\n }\n }\n ]\n }\n },\n \"evaluation\": {\n \"regression\": {\n \"actual_field\": \"price\",\n \"predicted_field\": \"ml.price_prediction\",\n \"metrics\": {\n \"r_squared\": {},\n \"mse\": {},\n \"msle\": {\n \"offset\": 10\n },\n \"huber\": {\n \"delta\": 1.5\n }\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->ml()->evaluateDataFrame([\n \"body\" => [\n \"index\" => \"house_price_predictions\",\n \"query\" => [\n \"bool\" => [\n \"filter\" => array(\n [\n \"term\" => [\n \"ml.is_training\" => false,\n ],\n ],\n ),\n ],\n ],\n \"evaluation\" => [\n \"regression\" => [\n \"actual_field\" => \"price\",\n \"predicted_field\" => \"ml.price_prediction\",\n \"metrics\" => [\n \"r_squared\" => new ArrayObject([]),\n \"mse\" => new ArrayObject([]),\n \"msle\" => [\n \"offset\" => 10,\n ],\n \"huber\" => [\n \"delta\" => 1.5,\n ],\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"index":"house_price_predictions","query":{"bool":{"filter":[{"term":{"ml.is_training":false}}]}},"evaluation":{"regression":{"actual_field":"price","predicted_field":"ml.price_prediction","metrics":{"r_squared":{},"mse":{},"msle":{"offset":10},"huber":{"delta":1.5}}}}}'' "$ELASTICSEARCH_URL/_ml/data_frame/_evaluate"' - lang: C# source: "var response = await client.MachineLearning\n .EvaluateDataFrameAsync(d1 => d1\n .Evaluation(d2 => d2\n .Regression(d3 => d3\n .ActualField(x => x.Price)\n .Metrics(d4 => d4\n .Huber(d5 => d5\n .Delta(1.5d)\n )\n .Mse(new Dictionary() { })\n .Msle(d5 => d5\n .Offset(10d)\n )\n .RSquared(new Dictionary() { })\n )\n .PredictedField(x => x.Ml.PricePrediction)\n )\n )\n .Index(\"house_price_predictions\")\n .Query(d2 => d2\n .Bool(d3 => d3\n .Filter(d4 => d4\n .Term(d5 => d5\n .Field(x => x.Ml.IsTraining)\n .Value(false)\n )\n )\n )\n )\n );" - lang: Java source: "client.ml().evaluateDataFrame(e -> e\n .evaluation(ev -> ev\n .regression(r -> r\n .actualField(\"price\")\n .predictedField(\"ml.price_prediction\")\n .metrics(m -> m\n .mse(Map.of())\n .msle(ms -> ms\n .offset(10.0D)\n )\n .huber(h -> h\n .delta(1.5D)\n )\n .rSquared(Map.of())\n )\n )\n )\n .index(\"house_price_predictions\")\n .query(q -> q\n .bool(b -> b\n .filter(f -> f\n .term(t -> t\n .field(\"ml.is_training\")\n .value(FieldValue.of(false))\n )\n )\n )\n )\n);\n" MlEvaluateDataFrameRequestExample5: summary: Regression example 2 description: "Run `POST _ml/data_frame/_evaluate` to evaluate the training error of a regression job for an annotated index. The term query in the body limits evaluation to be performed on the training split only. The `actual_field` contains the ground truth for house prices. The `predicted_field` contains the house price calculated by the regression analysis.\n" value: "{\n \"index\": \"house_price_predictions\",\n \"query\": {\n \"term\": {\n \"ml.is_training\": {\n \"value\": true\n }\n }\n },\n \"evaluation\": {\n \"regression\": {\n \"actual_field\": \"price\",\n \"predicted_field\": \"ml.price_prediction\",\n \"metrics\": {\n \"r_squared\": {},\n \"mse\": {},\n \"msle\": {},\n \"huber\": {}\n }\n }\n }\n}" x-codeSamples: - lang: Console source: "POST _ml/data_frame/_evaluate\n{\n \"index\": \"house_price_predictions\",\n \"query\": {\n \"term\": {\n \"ml.is_training\": {\n \"value\": true\n }\n }\n },\n \"evaluation\": {\n \"regression\": {\n \"actual_field\": \"price\",\n \"predicted_field\": \"ml.price_prediction\",\n \"metrics\": {\n \"r_squared\": {},\n \"mse\": {},\n \"msle\": {},\n \"huber\": {}\n }\n }\n }\n}" - lang: Python source: "resp = client.ml.evaluate_data_frame(\n index=\"house_price_predictions\",\n query={\n \"term\": {\n \"ml.is_training\": {\n \"value\": True\n }\n }\n },\n evaluation={\n \"regression\": {\n \"actual_field\": \"price\",\n \"predicted_field\": \"ml.price_prediction\",\n \"metrics\": {\n \"r_squared\": {},\n \"mse\": {},\n \"msle\": {},\n \"huber\": {}\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.ml.evaluateDataFrame({\n index: \"house_price_predictions\",\n query: {\n term: {\n \"ml.is_training\": {\n value: true,\n },\n },\n },\n evaluation: {\n regression: {\n actual_field: \"price\",\n predicted_field: \"ml.price_prediction\",\n metrics: {\n r_squared: {},\n mse: {},\n msle: {},\n huber: {},\n },\n },\n },\n});" - lang: Ruby source: "response = client.ml.evaluate_data_frame(\n body: {\n \"index\": \"house_price_predictions\",\n \"query\": {\n \"term\": {\n \"ml.is_training\": {\n \"value\": true\n }\n }\n },\n \"evaluation\": {\n \"regression\": {\n \"actual_field\": \"price\",\n \"predicted_field\": \"ml.price_prediction\",\n \"metrics\": {\n \"r_squared\": {},\n \"mse\": {},\n \"msle\": {},\n \"huber\": {}\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->ml()->evaluateDataFrame([\n \"body\" => [\n \"index\" => \"house_price_predictions\",\n \"query\" => [\n \"term\" => [\n \"ml.is_training\" => [\n \"value\" => true,\n ],\n ],\n ],\n \"evaluation\" => [\n \"regression\" => [\n \"actual_field\" => \"price\",\n \"predicted_field\" => \"ml.price_prediction\",\n \"metrics\" => [\n \"r_squared\" => new ArrayObject([]),\n \"mse\" => new ArrayObject([]),\n \"msle\" => new ArrayObject([]),\n \"huber\" => new ArrayObject([]),\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"index":"house_price_predictions","query":{"term":{"ml.is_training":{"value":true}}},"evaluation":{"regression":{"actual_field":"price","predicted_field":"ml.price_prediction","metrics":{"r_squared":{},"mse":{},"msle":{},"huber":{}}}}}'' "$ELASTICSEARCH_URL/_ml/data_frame/_evaluate"' - lang: C# source: "var response = await client.MachineLearning\n .EvaluateDataFrameAsync(d1 => d1\n .Evaluation(d2 => d2\n .Regression(d3 => d3\n .ActualField(x => x.Price)\n .Metrics(d4 => d4\n .Huber()\n .Mse(new Dictionary() { })\n .Msle()\n .RSquared(new Dictionary() { })\n )\n .PredictedField(x => x.Ml.PricePrediction)\n )\n )\n .Index(\"house_price_predictions\")\n .Query(d2 => d2\n .Term(d3 => d3\n .Field(x => x.Ml.IsTraining)\n .Value(true)\n )\n )\n );" - lang: Java source: "client.ml().evaluateDataFrame(e -> e\n .evaluation(ev -> ev\n .regression(r -> r\n .actualField(\"price\")\n .predictedField(\"ml.price_prediction\")\n .metrics(m -> m\n .mse(Map.of())\n .msle(ms -> ms)\n .huber(h -> h)\n .rSquared(Map.of())\n )\n )\n )\n .index(\"house_price_predictions\")\n .query(q -> q\n .term(t -> t\n .field(\"ml.is_training\")\n .value(FieldValue.of(true))\n )\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: type: object properties: classification: allOf: - $ref: '#/components/schemas/ml.evaluate_data_frame.DataframeClassificationSummary' description: "Evaluation results for a classification analysis.\nIt outputs a prediction that identifies to which of the classes each document belongs." outlier_detection: allOf: - $ref: '#/components/schemas/ml.evaluate_data_frame.DataframeOutlierDetectionSummary' description: "Evaluation results for an outlier detection analysis.\nIt outputs the probability that each document is an outlier." regression: allOf: - $ref: '#/components/schemas/ml.evaluate_data_frame.DataframeRegressionSummary' description: Evaluation results for a regression analysis which outputs a prediction of values. examples: MlEvaluateDataFrameResponseExample1: summary: Classification example 1 description: "A succesful response from `POST _ml/data_frame/_evaluate` to evaluate a classification analysis job for an annotated index. The `actual_class` contains the name of the class the analysis tried to predict. The `actual_class_doc_count` is the number of documents in the index belonging to the `actual_class`. The `predicted_classes` object contains the list of the predicted classes and the number of predictions associated with the class.\n" value: "{\n \"classification\": {\n \"multiclass_confusion_matrix\": {\n \"confusion_matrix\": [\n {\n \"actual_class\": \"cat\",\n \"actual_class_doc_count\": 12,\n \"predicted_classes\": [\n {\n \"predicted_class\": \"cat\",\n \"count\": 12\n },\n {\n \"predicted_class\": \"dog\",\n \"count\": 0\n }\n ],\n \"other_predicted_class_doc_count\": 0\n },\n {\n \"actual_class\": \"dog\",\n \"actual_class_doc_count\": 11,\n \"predicted_classes\": [\n {\n \"predicted_class\": \"dog\",\n \"count\": 7\n },\n {\n \"predicted_class\": \"cat\",\n \"count\": 4\n }\n ],\n \"other_predicted_class_doc_count\": 0\n }\n ],\n \"other_actual_class_count\": 0\n }\n }\n}" MlEvaluateDataFrameResponseExample2: summary: Classification example 2 description: "A succesful response from `POST _ml/data_frame/_evaluate` to evaluate a classification analysis job with the AUC ROC metrics for an annotated index.\n" value: "{\n \"classification\": {\n \"auc_roc\": {\n \"value\": 0.8941788639536681\n }\n }\n}" MlEvaluateDataFrameResponseExample3: summary: Outlier detection description: A successful response from `POST _ml/data_frame/_evaluate` to evaluate an outlier detection job. value: "{\n \"outlier_detection\": {\n \"auc_roc\": {\n \"value\": 0.9258475774641445\n },\n \"confusion_matrix\": {\n \"0.25\": {\n \"tp\": 5,\n \"fp\": 9,\n \"tn\": 204,\n \"fn\": 5\n },\n \"0.5\": {\n \"tp\": 1,\n \"fp\": 5,\n \"tn\": 208,\n \"fn\": 9\n },\n \"0.75\": {\n \"tp\": 0,\n \"fp\": 4,\n \"tn\": 209,\n \"fn\": 10\n }\n },\n \"precision\": {\n \"0.25\": 0.35714285714285715,\n \"0.5\": 0.16666666666666666,\n \"0.75\": 0\n },\n \"recall\": {\n \"0.25\": 0.5,\n \"0.5\": 0.1,\n \"0.75\": 0\n }\n }\n}" x-state: Generally available; Added in 7.3.0 x-codeSamples: - lang: Console source: "POST _ml/data_frame/_evaluate\n{\n \"index\": \"animal_classification\",\n \"evaluation\": {\n \"classification\": {\n \"actual_field\": \"animal_class\",\n \"predicted_field\": \"ml.animal_class_prediction\",\n \"metrics\": {\n \"multiclass_confusion_matrix\": {}\n }\n }\n }\n}" - lang: Python source: "resp = client.ml.evaluate_data_frame(\n index=\"animal_classification\",\n evaluation={\n \"classification\": {\n \"actual_field\": \"animal_class\",\n \"predicted_field\": \"ml.animal_class_prediction\",\n \"metrics\": {\n \"multiclass_confusion_matrix\": {}\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.ml.evaluateDataFrame({\n index: \"animal_classification\",\n evaluation: {\n classification: {\n actual_field: \"animal_class\",\n predicted_field: \"ml.animal_class_prediction\",\n metrics: {\n multiclass_confusion_matrix: {},\n },\n },\n },\n});" - lang: Ruby source: "response = client.ml.evaluate_data_frame(\n body: {\n \"index\": \"animal_classification\",\n \"evaluation\": {\n \"classification\": {\n \"actual_field\": \"animal_class\",\n \"predicted_field\": \"ml.animal_class_prediction\",\n \"metrics\": {\n \"multiclass_confusion_matrix\": {}\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->ml()->evaluateDataFrame([\n \"body\" => [\n \"index\" => \"animal_classification\",\n \"evaluation\" => [\n \"classification\" => [\n \"actual_field\" => \"animal_class\",\n \"predicted_field\" => \"ml.animal_class_prediction\",\n \"metrics\" => [\n \"multiclass_confusion_matrix\" => new ArrayObject([]),\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"index":"animal_classification","evaluation":{"classification":{"actual_field":"animal_class","predicted_field":"ml.animal_class_prediction","metrics":{"multiclass_confusion_matrix":{}}}}}'' "$ELASTICSEARCH_URL/_ml/data_frame/_evaluate"' - lang: C# source: "var response = await client.MachineLearning\n .EvaluateDataFrameAsync(d1 => d1\n .Evaluation(d2 => d2\n .Classification(d3 => d3\n .ActualField(x => x.AnimalClass)\n .Metrics(d4 => d4\n .MulticlassConfusionMatrix(new Dictionary() { })\n )\n .PredictedField(x => x.Ml.AnimalClassPrediction)\n )\n )\n .Index(\"animal_classification\")\n );" - lang: Java source: "client.ml().evaluateDataFrame(e -> e\n .evaluation(ev -> ev\n .classification(c -> c\n .actualField(\"animal_class\")\n .predictedField(\"ml.animal_class_prediction\")\n .metrics(m -> m\n .multiclassConfusionMatrix(Map.of())\n )\n )\n )\n .index(\"animal_classification\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/data_frame/analytics/{id}/_explain': post: tags: - ml data frame summary: "Explain data frame analytics config\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ml/data_frame/analytics/_explain\n
\n
\n POST\n /_ml/data_frame/analytics/_explain\n
\n
\n GET\n /_ml/data_frame/analytics/{id}/_explain\n
\n
\n POST\n /_ml/data_frame/analytics/{id}/_explain\n
\n \n\nThis API provides explanations for a data frame analytics config that either\nexists already or one that has not been created yet. The following\nexplanations are provided:\n* which fields are included or not in the analysis and why,\n* how much memory is estimated to be required. The estimate can be used when deciding the appropriate value for model_memory_limit setting later on.\nIf you have object fields or fields that are excluded via source filtering, they are not included in the explanation.\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: ml-explain-data-frame-analytics parameters: - $ref: '#/components/parameters/ml.explain_data_frame_analytics-id' requestBody: $ref: '#/components/requestBodies/ml.explain_data_frame_analytics' responses: '200': $ref: '#/components/responses/ml.explain_data_frame_analytics-200' x-state: Generally available; Added in 7.3.0 x-codeSamples: - lang: Console source: "POST _ml/data_frame/analytics/_explain\n{\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n}" - lang: Python source: "resp = client.ml.explain_data_frame_analytics(\n source={\n \"index\": \"houses_sold_last_10_yrs\"\n },\n analysis={\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.ml.explainDataFrameAnalytics({\n source: {\n index: \"houses_sold_last_10_yrs\",\n },\n analysis: {\n regression: {\n dependent_variable: \"price\",\n },\n },\n});" - lang: Ruby source: "response = client.ml.explain_data_frame_analytics(\n body: {\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->ml()->explainDataFrameAnalytics([\n \"body\" => [\n \"source\" => [\n \"index\" => \"houses_sold_last_10_yrs\",\n ],\n \"analysis\" => [\n \"regression\" => [\n \"dependent_variable\" => \"price\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"index":"houses_sold_last_10_yrs"},"analysis":{"regression":{"dependent_variable":"price"}}}'' "$ELASTICSEARCH_URL/_ml/data_frame/analytics/_explain"' - lang: C# source: "var response = await client.MachineLearning\n .ExplainDataFrameAnalyticsAsync(d1 => d1\n .Analysis(d2 => d2\n .Regression(d3 => d3\n .DependentVariable(\"price\")\n )\n )\n .Source(d2 => d2\n .Indices(new[] { \"houses_sold_last_10_yrs\" })\n )\n );" - lang: Java source: "client.ml().explainDataFrameAnalytics(e -> e\n .analysis(a -> a\n .regression(r -> r\n .dependentVariable(\"price\")\n )\n )\n .source(s -> s\n .index(\"houses_sold_last_10_yrs\")\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/anomaly_detectors/{job_id}/_flush': post: tags: - ml anomaly summary: Force buffered data to be processed description: "The flush jobs API is only applicable when sending data for analysis using\nthe post data API. Depending on the content of the buffer, then it might\nadditionally calculate new results. Both flush and close operations are\nsimilar, however the flush is more efficient if you are expecting to send\nmore data for analysis. When flushing, the job remains open and is available\nto continue analyzing data. A close operation additionally prunes and\npersists the model state to disk and the job must be opened again before\nanalyzing further data.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-flush-job parameters: - name: job_id in: path description: Identifier for the anomaly detection job. required: true schema: $ref: '#/components/schemas/_types.Id' - name: advance_time in: query description: "Specifies to advance to a particular time value. Results are generated\nand the model is updated for data from the specified time interval." schema: $ref: '#/components/schemas/_types.DateTime' - name: calc_interim in: query description: "If true, calculates the interim results for the most recent bucket or all\nbuckets within the latency period." schema: type: boolean - name: end in: query description: "When used in conjunction with `calc_interim` and `start`, specifies the\nrange of buckets on which to calculate interim results." schema: $ref: '#/components/schemas/_types.DateTime' - name: skip_time in: query description: "Specifies to skip to a particular time value. Results are not generated\nand the model is not updated for data from the specified time interval." schema: $ref: '#/components/schemas/_types.DateTime' - name: start in: query description: "When used in conjunction with `calc_interim`, specifies the range of\nbuckets on which to calculate interim results." schema: $ref: '#/components/schemas/_types.DateTime' requestBody: content: application/json: schema: type: object properties: advance_time: allOf: - $ref: '#/components/schemas/_types.DateTime' description: Refer to the description for the `advance_time` query parameter. calc_interim: type: boolean description: Refer to the description for the `calc_interim` query parameter. end: allOf: - $ref: '#/components/schemas/_types.DateTime' description: Refer to the description for the `end` query parameter. skip_time: allOf: - $ref: '#/components/schemas/_types.DateTime' description: Refer to the description for the `skip_time` query parameter. start: allOf: - $ref: '#/components/schemas/_types.DateTime' description: Refer to the description for the `start` query parameter. examples: MlFlushJobExample1: description: An example body for a `POST _ml/anomaly_detectors/low_request_rate/_flush` request. value: "{\n \"calc_interim\": true\n}" x-codeSamples: - lang: Console source: "POST _ml/anomaly_detectors/low_request_rate/_flush\n{\n \"calc_interim\": true\n}" - lang: Python source: "resp = client.ml.flush_job(\n job_id=\"low_request_rate\",\n calc_interim=True,\n)" - lang: JavaScript source: "const response = await client.ml.flushJob({\n job_id: \"low_request_rate\",\n calc_interim: true,\n});" - lang: Ruby source: "response = client.ml.flush_job(\n job_id: \"low_request_rate\",\n body: {\n \"calc_interim\": true\n }\n)" - lang: PHP source: "$resp = $client->ml()->flushJob([\n \"job_id\" => \"low_request_rate\",\n \"body\" => [\n \"calc_interim\" => true,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"calc_interim":true}'' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/_flush"' - lang: C# source: "var response = await client.MachineLearning\n .FlushJobAsync(jobId: \"low_request_rate\", d1 => d1\n .CalcInterim(true)\n );" - lang: Java source: "client.ml().flushJob(f -> f\n .calcInterim(true)\n .jobId(\"low_request_rate\")\n);\n" responses: '200': description: '' content: application/json: schema: required: - flushed type: object properties: flushed: type: boolean last_finalized_bucket_end: type: number description: "Provides the timestamp (in milliseconds since the epoch) of the end of\nthe last bucket that was processed." deprecated: true x-state: Generally available; Added in 5.4.0 x-codeSamples: - lang: Console source: "POST _ml/anomaly_detectors/low_request_rate/_flush\n{\n \"calc_interim\": true\n}" - lang: Python source: "resp = client.ml.flush_job(\n job_id=\"low_request_rate\",\n calc_interim=True,\n)" - lang: JavaScript source: "const response = await client.ml.flushJob({\n job_id: \"low_request_rate\",\n calc_interim: true,\n});" - lang: Ruby source: "response = client.ml.flush_job(\n job_id: \"low_request_rate\",\n body: {\n \"calc_interim\": true\n }\n)" - lang: PHP source: "$resp = $client->ml()->flushJob([\n \"job_id\" => \"low_request_rate\",\n \"body\" => [\n \"calc_interim\" => true,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"calc_interim":true}'' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/_flush"' - lang: C# source: "var response = await client.MachineLearning\n .FlushJobAsync(jobId: \"low_request_rate\", d1 => d1\n .CalcInterim(true)\n );" - lang: Java source: "client.ml().flushJob(f -> f\n .calcInterim(true)\n .jobId(\"low_request_rate\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/anomaly_detectors/{job_id}/_forecast': post: tags: - ml anomaly summary: Predict future behavior of a time series description: "Forecasts are not supported for jobs that perform population analysis; an\nerror occurs if you try to create a forecast for a job that has an\n`over_field_name` in its configuration. Forcasts predict future behavior\nbased on historical data.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-forecast parameters: - name: job_id in: path description: "Identifier for the anomaly detection job. The job must be open when you\ncreate a forecast; otherwise, an error occurs." required: true schema: $ref: '#/components/schemas/_types.Id' - name: duration in: query description: "A period of time that indicates how far into the future to forecast. For\nexample, `30d` corresponds to 30 days. The forecast starts at the last\nrecord that was processed." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 1d - name: expires_in in: query description: "The period of time that forecast results are retained. After a forecast\nexpires, the results are deleted. If set to a value of 0, the forecast is\nnever automatically deleted." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 14d - name: max_model_memory in: query description: "The maximum memory the forecast can use. If the forecast needs to use\nmore than the provided amount, it will spool to disk. Default is 20mb,\nmaximum is 500mb and minimum is 1mb. If set to 40% or more of the job’s\nconfigured memory limit, it is automatically reduced to below that\namount." schema: type: string default: 20mb requestBody: content: application/json: schema: type: object properties: duration: allOf: - $ref: '#/components/schemas/_types.Duration' description: Refer to the description for the `duration` query parameter. default: 1d expires_in: allOf: - $ref: '#/components/schemas/_types.Duration' description: Refer to the description for the `expires_in` query parameter. default: 14d max_model_memory: type: string description: Refer to the description for the `max_model_memory` query parameter. default: 20mb examples: MlForecastExample1: description: An example body for a `POST _ml/anomaly_detectors/low_request_rate/_forecast` request. value: "{\n \"duration\": \"10d\"\n}" x-codeSamples: - lang: Console source: "POST _ml/anomaly_detectors/low_request_rate/_forecast\n{\n \"duration\": \"10d\"\n}" - lang: Python source: "resp = client.ml.forecast(\n job_id=\"low_request_rate\",\n duration=\"10d\",\n)" - lang: JavaScript source: "const response = await client.ml.forecast({\n job_id: \"low_request_rate\",\n duration: \"10d\",\n});" - lang: Ruby source: "response = client.ml.forecast(\n job_id: \"low_request_rate\",\n body: {\n \"duration\": \"10d\"\n }\n)" - lang: PHP source: "$resp = $client->ml()->forecast([\n \"job_id\" => \"low_request_rate\",\n \"body\" => [\n \"duration\" => \"10d\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"duration":"10d"}'' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/_forecast"' - lang: C# source: "var response = await client.MachineLearning\n .ForecastAsync(jobId: \"low_request_rate\", d1 => d1\n .Duration(\"10d\")\n );" - lang: Java source: "client.ml().forecast(f -> f\n .duration(d -> d\n .time(\"10d\")\n )\n .jobId(\"low_request_rate\")\n);\n" responses: '200': description: '' content: application/json: schema: required: - acknowledged - forecast_id type: object properties: acknowledged: type: boolean forecast_id: allOf: - $ref: '#/components/schemas/_types.Id' x-state: Generally available; Added in 6.1.0 x-codeSamples: - lang: Console source: "POST _ml/anomaly_detectors/low_request_rate/_forecast\n{\n \"duration\": \"10d\"\n}" - lang: Python source: "resp = client.ml.forecast(\n job_id=\"low_request_rate\",\n duration=\"10d\",\n)" - lang: JavaScript source: "const response = await client.ml.forecast({\n job_id: \"low_request_rate\",\n duration: \"10d\",\n});" - lang: Ruby source: "response = client.ml.forecast(\n job_id: \"low_request_rate\",\n body: {\n \"duration\": \"10d\"\n }\n)" - lang: PHP source: "$resp = $client->ml()->forecast([\n \"job_id\" => \"low_request_rate\",\n \"body\" => [\n \"duration\" => \"10d\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"duration":"10d"}'' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/_forecast"' - lang: C# source: "var response = await client.MachineLearning\n .ForecastAsync(jobId: \"low_request_rate\", d1 => d1\n .Duration(\"10d\")\n );" - lang: Java source: "client.ml().forecast(f -> f\n .duration(d -> d\n .time(\"10d\")\n )\n .jobId(\"low_request_rate\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/anomaly_detectors/{job_id}/results/buckets/{timestamp}': post: tags: - ml anomaly summary: "Get anomaly detection job results for buckets\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ml/anomaly_detectors/{job_id}/results/buckets\n
\n
\n POST\n /_ml/anomaly_detectors/{job_id}/results/buckets\n
\n
\n GET\n /_ml/anomaly_detectors/{job_id}/results/buckets/{timestamp}\n
\n
\n POST\n /_ml/anomaly_detectors/{job_id}/results/buckets/{timestamp}\n
\n \n\nThe API presents a chronological view of the records, grouped by bucket.\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: ml-get-buckets parameters: - $ref: '#/components/parameters/ml.get_buckets-job_id' - $ref: '#/components/parameters/ml.get_buckets-timestamp' - $ref: '#/components/parameters/ml.get_buckets-anomaly_score' - $ref: '#/components/parameters/ml.get_buckets-desc' - $ref: '#/components/parameters/ml.get_buckets-end' - $ref: '#/components/parameters/ml.get_buckets-exclude_interim' - $ref: '#/components/parameters/ml.get_buckets-expand' - $ref: '#/components/parameters/ml.get_buckets-from' - $ref: '#/components/parameters/ml.get_buckets-size' - $ref: '#/components/parameters/ml.get_buckets-sort' - $ref: '#/components/parameters/ml.get_buckets-start' requestBody: $ref: '#/components/requestBodies/ml.get_buckets' responses: '200': $ref: '#/components/responses/ml.get_buckets-200' x-state: Generally available; Added in 5.4.0 x-codeSamples: - lang: Console source: "GET _ml/anomaly_detectors/low_request_rate/results/buckets\n{\n \"anomaly_score\": 80,\n \"start\": \"1454530200001\"\n}" - lang: Python source: "resp = client.ml.get_buckets(\n job_id=\"low_request_rate\",\n anomaly_score=80,\n start=\"1454530200001\",\n)" - lang: JavaScript source: "const response = await client.ml.getBuckets({\n job_id: \"low_request_rate\",\n anomaly_score: 80,\n start: 1454530200001,\n});" - lang: Ruby source: "response = client.ml.get_buckets(\n job_id: \"low_request_rate\",\n body: {\n \"anomaly_score\": 80,\n \"start\": \"1454530200001\"\n }\n)" - lang: PHP source: "$resp = $client->ml()->getBuckets([\n \"job_id\" => \"low_request_rate\",\n \"body\" => [\n \"anomaly_score\" => 80,\n \"start\" => \"1454530200001\",\n ],\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"anomaly_score":80,"start":"1454530200001"}'' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/results/buckets"' - lang: C# source: "var response = await client.MachineLearning\n .GetBucketsAsync(new GetBucketsRequest()\n {\n JobId = \"low_request_rate\",\n AnomalyScore = 80d,\n Start = DateTimeOffset.Parse(\"2016-02-03T20:10:00.0010000+00:00\", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind)\n });" - lang: Java source: "client.ml().getBuckets(g -> g\n .anomalyScore(80.0D)\n .jobId(\"low_request_rate\")\n .start(DateTime.of(\"1454530200001\"))\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/calendars/{calendar_id}/events': get: tags: - ml anomaly summary: Get info about events in calendars description: "\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: ml-get-calendar-events parameters: - name: calendar_id in: path description: A string that uniquely identifies a calendar. You can get information for multiple calendars by using a comma-separated list of ids or a wildcard expression. You can get information for all calendars by using `_all` or `*` or by omitting the calendar identifier. required: true schema: $ref: '#/components/schemas/_types.Id' - name: end in: query description: Specifies to get events with timestamps earlier than this time. schema: $ref: '#/components/schemas/_types.DateTime' - name: from in: query description: Skips the specified number of events. schema: type: number default: 0 - name: job_id in: query description: Specifies to get events for a specific anomaly detection job identifier or job group. It must be used with a calendar identifier of `_all` or `*`. schema: $ref: '#/components/schemas/_types.Id' - name: size in: query description: Specifies the maximum number of events to obtain. schema: type: number default: 100 - name: start in: query description: Specifies to get events with timestamps after this time. schema: $ref: '#/components/schemas/_types.DateTime' responses: '200': description: '' content: application/json: schema: required: - count - events type: object properties: count: type: number events: type: array items: $ref: '#/components/schemas/ml._types.CalendarEvent' x-state: Generally available; Added in 6.2.0 x-codeSamples: - lang: Console source: "GET _ml/calendars/planned-outages/events\n" - lang: Python source: "resp = client.ml.get_calendar_events(\n calendar_id=\"planned-outages\",\n)" - lang: JavaScript source: "const response = await client.ml.getCalendarEvents({\n calendar_id: \"planned-outages\",\n});" - lang: Ruby source: "response = client.ml.get_calendar_events(\n calendar_id: \"planned-outages\"\n)" - lang: PHP source: "$resp = $client->ml()->getCalendarEvents([\n \"calendar_id\" => \"planned-outages\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/calendars/planned-outages/events"' - lang: C# source: 'var response = await client.MachineLearning.GetCalendarEventsAsync(calendarId: "planned-outages");' - lang: Java source: "client.ml().getCalendarEvents(g -> g\n .calendarId(\"planned-outages\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name post: tags: - ml anomaly summary: Add scheduled events to the calendar description: "\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-post-calendar-events parameters: - name: calendar_id in: path description: A string that uniquely identifies a calendar. required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: required: - events type: object properties: events: type: array items: $ref: '#/components/schemas/ml._types.CalendarEvent' description: A list of one of more scheduled events. The event’s start and end times can be specified as integer milliseconds since the epoch or as a string in ISO 8601 format. examples: MlPostCalendarEventsExample1: description: An example body for a `POST _ml/calendars/planned-outages/events` request. value: "{\n \"events\" : [\n {\"description\": \"event 1\", \"start_time\": 1513641600000, \"end_time\": 1513728000000},\n {\"description\": \"event 2\", \"start_time\": 1513814400000, \"end_time\": 1513900800000},\n {\"description\": \"event 3\", \"start_time\": 1514160000000, \"end_time\": 1514246400000}\n ]\n}" x-codeSamples: - lang: Console source: "POST _ml/calendars/planned-outages/events\n{\n \"events\" : [\n {\"description\": \"event 1\", \"start_time\": 1513641600000, \"end_time\": 1513728000000},\n {\"description\": \"event 2\", \"start_time\": 1513814400000, \"end_time\": 1513900800000},\n {\"description\": \"event 3\", \"start_time\": 1514160000000, \"end_time\": 1514246400000}\n ]\n}" - lang: Python source: "resp = client.ml.post_calendar_events(\n calendar_id=\"planned-outages\",\n events=[\n {\n \"description\": \"event 1\",\n \"start_time\": 1513641600000,\n \"end_time\": 1513728000000\n },\n {\n \"description\": \"event 2\",\n \"start_time\": 1513814400000,\n \"end_time\": 1513900800000\n },\n {\n \"description\": \"event 3\",\n \"start_time\": 1514160000000,\n \"end_time\": 1514246400000\n }\n ],\n)" - lang: JavaScript source: "const response = await client.ml.postCalendarEvents({\n calendar_id: \"planned-outages\",\n events: [\n {\n description: \"event 1\",\n start_time: 1513641600000,\n end_time: 1513728000000,\n },\n {\n description: \"event 2\",\n start_time: 1513814400000,\n end_time: 1513900800000,\n },\n {\n description: \"event 3\",\n start_time: 1514160000000,\n end_time: 1514246400000,\n },\n ],\n});" - lang: Ruby source: "response = client.ml.post_calendar_events(\n calendar_id: \"planned-outages\",\n body: {\n \"events\": [\n {\n \"description\": \"event 1\",\n \"start_time\": 1513641600000,\n \"end_time\": 1513728000000\n },\n {\n \"description\": \"event 2\",\n \"start_time\": 1513814400000,\n \"end_time\": 1513900800000\n },\n {\n \"description\": \"event 3\",\n \"start_time\": 1514160000000,\n \"end_time\": 1514246400000\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->ml()->postCalendarEvents([\n \"calendar_id\" => \"planned-outages\",\n \"body\" => [\n \"events\" => array(\n [\n \"description\" => \"event 1\",\n \"start_time\" => 1513641600000,\n \"end_time\" => 1513728000000,\n ],\n [\n \"description\" => \"event 2\",\n \"start_time\" => 1513814400000,\n \"end_time\" => 1513900800000,\n ],\n [\n \"description\" => \"event 3\",\n \"start_time\" => 1514160000000,\n \"end_time\" => 1514246400000,\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"events":[{"description":"event 1","start_time":1513641600000,"end_time":1513728000000},{"description":"event 2","start_time":1513814400000,"end_time":1513900800000},{"description":"event 3","start_time":1514160000000,"end_time":1514246400000}]}'' "$ELASTICSEARCH_URL/_ml/calendars/planned-outages/events"' - lang: C# source: "var response = await client.MachineLearning\n .PostCalendarEventsAsync(calendarId: \"planned-outages\", d1 => d1\n .Events(d2 => d2\n .Description(\"event 1\")\n .EndTime(DateTimeOffset.Parse(\"2017-12-20T00:00:00.0000000+00:00\", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind))\n .StartTime(DateTimeOffset.Parse(\"2017-12-19T00:00:00.0000000+00:00\", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind)), d2 => d2\n .Description(\"event 2\")\n .EndTime(DateTimeOffset.Parse(\"2017-12-22T00:00:00.0000000+00:00\", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind))\n .StartTime(DateTimeOffset.Parse(\"2017-12-21T00:00:00.0000000+00:00\", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind)), d2 => d2\n .Description(\"event 3\")\n .EndTime(DateTimeOffset.Parse(\"2017-12-26T00:00:00.0000000+00:00\", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind))\n .StartTime(DateTimeOffset.Parse(\"2017-12-25T00:00:00.0000000+00:00\", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind))\n )\n );" - lang: Java source: "client.ml().postCalendarEvents(p -> p\n .calendarId(\"planned-outages\")\n .events(List.of(CalendarEvent.of(c -> c\n .description(\"event 1\")\n .endTime(DateTime.ofEpochMilli(1513728000000L))\n .startTime(DateTime.ofEpochMilli(1513641600000L))\n ),CalendarEvent.of(c -> c\n .description(\"event 2\")\n .endTime(DateTime.ofEpochMilli(1513900800000L))\n .startTime(DateTime.ofEpochMilli(1513814400000L))\n ),CalendarEvent.of(c -> c\n .description(\"event 3\")\n .endTime(DateTime.ofEpochMilli(1514246400000L))\n .startTime(DateTime.ofEpochMilli(1514160000000L))\n )))\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - events type: object properties: events: type: array items: $ref: '#/components/schemas/ml._types.CalendarEvent' x-state: Generally available; Added in 6.2.0 x-codeSamples: - lang: Console source: "POST _ml/calendars/planned-outages/events\n{\n \"events\" : [\n {\"description\": \"event 1\", \"start_time\": 1513641600000, \"end_time\": 1513728000000},\n {\"description\": \"event 2\", \"start_time\": 1513814400000, \"end_time\": 1513900800000},\n {\"description\": \"event 3\", \"start_time\": 1514160000000, \"end_time\": 1514246400000}\n ]\n}" - lang: Python source: "resp = client.ml.post_calendar_events(\n calendar_id=\"planned-outages\",\n events=[\n {\n \"description\": \"event 1\",\n \"start_time\": 1513641600000,\n \"end_time\": 1513728000000\n },\n {\n \"description\": \"event 2\",\n \"start_time\": 1513814400000,\n \"end_time\": 1513900800000\n },\n {\n \"description\": \"event 3\",\n \"start_time\": 1514160000000,\n \"end_time\": 1514246400000\n }\n ],\n)" - lang: JavaScript source: "const response = await client.ml.postCalendarEvents({\n calendar_id: \"planned-outages\",\n events: [\n {\n description: \"event 1\",\n start_time: 1513641600000,\n end_time: 1513728000000,\n },\n {\n description: \"event 2\",\n start_time: 1513814400000,\n end_time: 1513900800000,\n },\n {\n description: \"event 3\",\n start_time: 1514160000000,\n end_time: 1514246400000,\n },\n ],\n});" - lang: Ruby source: "response = client.ml.post_calendar_events(\n calendar_id: \"planned-outages\",\n body: {\n \"events\": [\n {\n \"description\": \"event 1\",\n \"start_time\": 1513641600000,\n \"end_time\": 1513728000000\n },\n {\n \"description\": \"event 2\",\n \"start_time\": 1513814400000,\n \"end_time\": 1513900800000\n },\n {\n \"description\": \"event 3\",\n \"start_time\": 1514160000000,\n \"end_time\": 1514246400000\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->ml()->postCalendarEvents([\n \"calendar_id\" => \"planned-outages\",\n \"body\" => [\n \"events\" => array(\n [\n \"description\" => \"event 1\",\n \"start_time\" => 1513641600000,\n \"end_time\" => 1513728000000,\n ],\n [\n \"description\" => \"event 2\",\n \"start_time\" => 1513814400000,\n \"end_time\" => 1513900800000,\n ],\n [\n \"description\" => \"event 3\",\n \"start_time\" => 1514160000000,\n \"end_time\" => 1514246400000,\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"events":[{"description":"event 1","start_time":1513641600000,"end_time":1513728000000},{"description":"event 2","start_time":1513814400000,"end_time":1513900800000},{"description":"event 3","start_time":1514160000000,"end_time":1514246400000}]}'' "$ELASTICSEARCH_URL/_ml/calendars/planned-outages/events"' - lang: C# source: "var response = await client.MachineLearning\n .PostCalendarEventsAsync(calendarId: \"planned-outages\", d1 => d1\n .Events(d2 => d2\n .Description(\"event 1\")\n .EndTime(DateTimeOffset.Parse(\"2017-12-20T00:00:00.0000000+00:00\", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind))\n .StartTime(DateTimeOffset.Parse(\"2017-12-19T00:00:00.0000000+00:00\", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind)), d2 => d2\n .Description(\"event 2\")\n .EndTime(DateTimeOffset.Parse(\"2017-12-22T00:00:00.0000000+00:00\", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind))\n .StartTime(DateTimeOffset.Parse(\"2017-12-21T00:00:00.0000000+00:00\", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind)), d2 => d2\n .Description(\"event 3\")\n .EndTime(DateTimeOffset.Parse(\"2017-12-26T00:00:00.0000000+00:00\", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind))\n .StartTime(DateTimeOffset.Parse(\"2017-12-25T00:00:00.0000000+00:00\", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind))\n )\n );" - lang: Java source: "client.ml().postCalendarEvents(p -> p\n .calendarId(\"planned-outages\")\n .events(List.of(CalendarEvent.of(c -> c\n .description(\"event 1\")\n .endTime(DateTime.ofEpochMilli(1513728000000L))\n .startTime(DateTime.ofEpochMilli(1513641600000L))\n ),CalendarEvent.of(c -> c\n .description(\"event 2\")\n .endTime(DateTime.ofEpochMilli(1513900800000L))\n .startTime(DateTime.ofEpochMilli(1513814400000L))\n ),CalendarEvent.of(c -> c\n .description(\"event 3\")\n .endTime(DateTime.ofEpochMilli(1514246400000L))\n .startTime(DateTime.ofEpochMilli(1514160000000L))\n )))\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/anomaly_detectors/{job_id}/results/categories/{category_id}': post: tags: - ml anomaly summary: "Get anomaly detection job results for categories\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ml/anomaly_detectors/{job_id}/results/categories\n
\n
\n POST\n /_ml/anomaly_detectors/{job_id}/results/categories\n
\n
\n GET\n /_ml/anomaly_detectors/{job_id}/results/categories/{category_id}\n
\n
\n POST\n /_ml/anomaly_detectors/{job_id}/results/categories/{category_id}\n
\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: ml-get-categories parameters: - $ref: '#/components/parameters/ml.get_categories-job_id' - $ref: '#/components/parameters/ml.get_categories-category_id' - $ref: '#/components/parameters/ml.get_categories-from' - $ref: '#/components/parameters/ml.get_categories-partition_field_value' - $ref: '#/components/parameters/ml.get_categories-size' requestBody: $ref: '#/components/requestBodies/ml.get_categories' responses: '200': $ref: '#/components/responses/ml.get_categories-200' x-state: Generally available; Added in 5.4.0 x-codeSamples: - lang: Console source: "GET _ml/anomaly_detectors/esxi_log/results/categories\n{\n \"page\":{\n \"size\": 1\n }\n}" - lang: Python source: "resp = client.ml.get_categories(\n job_id=\"esxi_log\",\n page={\n \"size\": 1\n },\n)" - lang: JavaScript source: "const response = await client.ml.getCategories({\n job_id: \"esxi_log\",\n page: {\n size: 1,\n },\n});" - lang: Ruby source: "response = client.ml.get_categories(\n job_id: \"esxi_log\",\n body: {\n \"page\": {\n \"size\": 1\n }\n }\n)" - lang: PHP source: "$resp = $client->ml()->getCategories([\n \"job_id\" => \"esxi_log\",\n \"body\" => [\n \"page\" => [\n \"size\" => 1,\n ],\n ],\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"page":{"size":1}}'' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/esxi_log/results/categories"' - lang: C# source: "var response = await client.MachineLearning\n .GetCategoriesAsync(new GetCategoriesRequest()\n {\n JobId = \"esxi_log\",\n Page = new()\n {\n Size = 1\n }\n });" - lang: Java source: "client.ml().getCategories(g -> g\n .jobId(\"esxi_log\")\n .page(p -> p\n .size(1)\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/data_frame/analytics/{id}/_stats': get: tags: - ml data frame summary: "Get data frame analytics job stats\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ml/data_frame/analytics/_stats\n
\n
\n GET\n /_ml/data_frame/analytics/{id}/_stats\n
\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: ml-get-data-frame-analytics-stats parameters: - $ref: '#/components/parameters/ml.get_data_frame_analytics_stats-id' - $ref: '#/components/parameters/ml.get_data_frame_analytics_stats-allow_no_match' - $ref: '#/components/parameters/ml.get_data_frame_analytics_stats-from' - $ref: '#/components/parameters/ml.get_data_frame_analytics_stats-size' - $ref: '#/components/parameters/ml.get_data_frame_analytics_stats-verbose' responses: '200': $ref: '#/components/responses/ml.get_data_frame_analytics_stats-200' x-state: Generally available; Added in 7.3.0 x-codeSamples: - lang: Console source: "GET _ml/data_frame/analytics/weblog-outliers/_stats\n" - lang: Python source: "resp = client.ml.get_data_frame_analytics_stats(\n id=\"weblog-outliers\",\n)" - lang: JavaScript source: "const response = await client.ml.getDataFrameAnalyticsStats({\n id: \"weblog-outliers\",\n});" - lang: Ruby source: "response = client.ml.get_data_frame_analytics_stats(\n id: \"weblog-outliers\"\n)" - lang: PHP source: "$resp = $client->ml()->getDataFrameAnalyticsStats([\n \"id\" => \"weblog-outliers\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/data_frame/analytics/weblog-outliers/_stats"' - lang: C# source: "var response = await client.MachineLearning\n .GetDataFrameAnalyticsStatsAsync(d1 => d1\n .Id(\"weblog-outliers\")\n );" - lang: Java source: "client.ml().getDataFrameAnalyticsStats(g -> g\n .id(\"weblog-outliers\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/datafeeds/{datafeed_id}/_stats': get: tags: - ml anomaly summary: "Get datafeed stats\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ml/datafeeds/_stats\n
\n
\n GET\n /_ml/datafeeds/{datafeed_id}/_stats\n
\n \n\nYou can get statistics for multiple datafeeds in a single API request by\nusing a comma-separated list of datafeeds or a wildcard expression. You can\nget statistics for all datafeeds by using `_all`, by specifying `*` as the\n``, or by omitting the ``. If the datafeed is stopped, the\nonly information you receive is the `datafeed_id` and the `state`.\nThis API returns a maximum of 10,000 datafeeds.\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: ml-get-datafeed-stats parameters: - $ref: '#/components/parameters/ml.get_datafeed_stats-datafeed_id' - $ref: '#/components/parameters/ml.get_datafeed_stats-allow_no_match' responses: '200': $ref: '#/components/responses/ml.get_datafeed_stats-200' x-state: Generally available; Added in 5.5.0 x-codeSamples: - lang: Console source: "GET _ml/datafeeds/datafeed-high_sum_total_sales/_stats\n" - lang: Python source: "resp = client.ml.get_datafeed_stats(\n datafeed_id=\"datafeed-high_sum_total_sales\",\n)" - lang: JavaScript source: "const response = await client.ml.getDatafeedStats({\n datafeed_id: \"datafeed-high_sum_total_sales\",\n});" - lang: Ruby source: "response = client.ml.get_datafeed_stats(\n datafeed_id: \"datafeed-high_sum_total_sales\"\n)" - lang: PHP source: "$resp = $client->ml()->getDatafeedStats([\n \"datafeed_id\" => \"datafeed-high_sum_total_sales\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-high_sum_total_sales/_stats"' - lang: C# source: "var response = await client.MachineLearning\n .GetDatafeedStatsAsync(d1 => d1\n .DatafeedId(new[] { \"datafeed-high_sum_total_sales\" })\n );" - lang: Java source: "client.ml().getDatafeedStats(g -> g\n .datafeedId(\"datafeed-high_sum_total_sales\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/anomaly_detectors/{job_id}/results/influencers': post: tags: - ml anomaly summary: "Get anomaly detection job results for influencers\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ml/anomaly_detectors/{job_id}/results/influencers\n
\n
\n POST\n /_ml/anomaly_detectors/{job_id}/results/influencers\n
\n \n\nInfluencers are the entities that have contributed to, or are to blame for,\nthe anomalies. Influencer results are available only if an\n`influencer_field_name` is specified in the job configuration.\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: ml-get-influencers parameters: - $ref: '#/components/parameters/ml.get_influencers-job_id' - $ref: '#/components/parameters/ml.get_influencers-desc' - $ref: '#/components/parameters/ml.get_influencers-end' - $ref: '#/components/parameters/ml.get_influencers-exclude_interim' - $ref: '#/components/parameters/ml.get_influencers-influencer_score' - $ref: '#/components/parameters/ml.get_influencers-from' - $ref: '#/components/parameters/ml.get_influencers-size' - $ref: '#/components/parameters/ml.get_influencers-sort' - $ref: '#/components/parameters/ml.get_influencers-start' requestBody: $ref: '#/components/requestBodies/ml.get_influencers' responses: '200': $ref: '#/components/responses/ml.get_influencers-200' x-state: Generally available; Added in 5.4.0 x-codeSamples: - lang: Console source: "GET _ml/anomaly_detectors/high_sum_total_sales/results/influencers?desc=true&sort=\"influencer_score\"\n" - lang: Python source: "resp = client.ml.get_influencers(\n job_id=\"high_sum_total_sales\",\n desc=True,\n sort=\"\\\"influencer_score\\\"\",\n)" - lang: JavaScript source: "const response = await client.ml.getInfluencers({\n job_id: \"high_sum_total_sales\",\n desc: \"true\",\n sort: '\"influencer_score\"',\n});" - lang: Ruby source: "response = client.ml.get_influencers(\n job_id: \"high_sum_total_sales\",\n desc: \"true\",\n sort: \"\\\"influencer_score\\\"\"\n)" - lang: PHP source: "$resp = $client->ml()->getInfluencers([\n \"job_id\" => \"high_sum_total_sales\",\n \"desc\" => \"true\",\n \"sort\" => \"\\\"influencer_score\\\"\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/anomaly_detectors/high_sum_total_sales/results/influencers?desc=true&sort="influencer_score""' - lang: C# source: "var response = await client.MachineLearning\n .GetInfluencersAsync(jobId: \"high_sum_total_sales\", d1 => d1\n .Desc(true)\n .Sort(\"\\\"influencer_score\\\"\")\n );" - lang: Java source: "client.ml().getInfluencers(g -> g\n .desc(true)\n .jobId(\"high_sum_total_sales\")\n .sort(\"\"influencer_score\"\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/anomaly_detectors/{job_id}/_stats': get: tags: - ml anomaly summary: "Get anomaly detection job stats\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ml/anomaly_detectors/_stats\n
\n
\n GET\n /_ml/anomaly_detectors/{job_id}/_stats\n
\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: ml-get-job-stats parameters: - $ref: '#/components/parameters/ml.get_job_stats-job_id' - $ref: '#/components/parameters/ml.get_job_stats-allow_no_match' responses: '200': $ref: '#/components/responses/ml.get_job_stats-200' x-state: Generally available; Added in 5.5.0 x-codeSamples: - lang: Console source: "GET _ml/anomaly_detectors/low_request_rate/_stats\n" - lang: Python source: "resp = client.ml.get_job_stats(\n job_id=\"low_request_rate\",\n)" - lang: JavaScript source: "const response = await client.ml.getJobStats({\n job_id: \"low_request_rate\",\n});" - lang: Ruby source: "response = client.ml.get_job_stats(\n job_id: \"low_request_rate\"\n)" - lang: PHP source: "$resp = $client->ml()->getJobStats([\n \"job_id\" => \"low_request_rate\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/_stats"' - lang: C# source: "var response = await client.MachineLearning\n .GetJobStatsAsync(d1 => d1\n .JobId(\"low_request_rate\")\n );" - lang: Java source: "client.ml().getJobStats(g -> g\n .jobId(\"low_request_rate\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/memory/{node_id}/_stats': get: tags: - ml summary: "Get machine learning memory usage info\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ml/memory/_stats\n
\n
\n GET\n /_ml/memory/{node_id}/_stats\n
\n \n\nGet information about how machine learning jobs and trained models are using memory,\non each node, both within the JVM heap, and natively, outside of the JVM.\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: ml-get-memory-stats parameters: - $ref: '#/components/parameters/ml.get_memory_stats-node_id' - $ref: '#/components/parameters/ml.get_memory_stats-master_timeout' - $ref: '#/components/parameters/ml.get_memory_stats-timeout' responses: '200': $ref: '#/components/responses/ml.get_memory_stats-200' x-state: Generally available; Added in 8.2.0 x-codeSamples: - lang: Console source: "GET _ml/memory/_stats?human\n" - lang: Python source: "resp = client.ml.get_memory_stats(\n human=True,\n)" - lang: JavaScript source: "const response = await client.ml.getMemoryStats({\n human: \"true\",\n});" - lang: Ruby source: "response = client.ml.get_memory_stats(\n human: \"true\"\n)" - lang: PHP source: "$resp = $client->ml()->getMemoryStats([\n \"human\" => \"true\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/memory/_stats?human"' - lang: C# source: var response = await client.MachineLearning.GetMemoryStatsAsync(); - lang: Java source: "client.ml().getMemoryStats(g -> g);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_upgrade/_stats': get: tags: - ml anomaly summary: Get anomaly detection job model snapshot upgrade usage info description: "\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: ml-get-model-snapshot-upgrade-stats parameters: - name: job_id in: path description: Identifier for the anomaly detection job. required: true schema: $ref: '#/components/schemas/_types.Id' - name: snapshot_id in: path description: "A numerical character string that uniquely identifies the model snapshot. You can get information for multiple\nsnapshots by using a comma-separated list or a wildcard expression. You can get all snapshots by using `_all`,\nby specifying `*` as the snapshot ID, or by omitting the snapshot ID." required: true schema: $ref: '#/components/schemas/_types.Id' - name: allow_no_match in: query description: "Specifies what to do when the request:\n\n - Contains wildcard expressions and there are no jobs that match.\n - Contains the _all string or no identifiers and there are no matches.\n - Contains wildcard expressions and there are only partial matches.\n\nThe default value is true, which returns an empty jobs array when there are no matches and the subset of results\nwhen there are partial matches. If this parameter is false, the request returns a 404 status code when there are\nno matches or only partial matches." schema: type: boolean responses: '200': description: '' content: application/json: schema: required: - count - model_snapshot_upgrades type: object properties: count: type: number model_snapshot_upgrades: type: array items: $ref: '#/components/schemas/ml._types.ModelSnapshotUpgrade' x-state: Generally available; Added in 7.16.0 x-codeSamples: - lang: Console source: "GET _ml/anomaly_detectors/low_request_rate/model_snapshots/_all/_upgrade/_stats\n" - lang: Python source: "resp = client.ml.get_model_snapshot_upgrade_stats(\n job_id=\"low_request_rate\",\n snapshot_id=\"_all\",\n)" - lang: JavaScript source: "const response = await client.ml.getModelSnapshotUpgradeStats({\n job_id: \"low_request_rate\",\n snapshot_id: \"_all\",\n});" - lang: Ruby source: "response = client.ml.get_model_snapshot_upgrade_stats(\n job_id: \"low_request_rate\",\n snapshot_id: \"_all\"\n)" - lang: PHP source: "$resp = $client->ml()->getModelSnapshotUpgradeStats([\n \"job_id\" => \"low_request_rate\",\n \"snapshot_id\" => \"_all\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/model_snapshots/_all/_upgrade/_stats"' - lang: C# source: 'var response = await client.MachineLearning.GetModelSnapshotUpgradeStatsAsync(jobId: "low_request_rate", snapshotId: "_all");' - lang: Java source: "client.ml().getModelSnapshotUpgradeStats(g -> g\n .jobId(\"low_request_rate\")\n .snapshotId(\"_all\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/anomaly_detectors/{job_id}/results/overall_buckets': post: tags: - ml anomaly summary: "Get overall bucket results\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ml/anomaly_detectors/{job_id}/results/overall_buckets\n
\n
\n POST\n /_ml/anomaly_detectors/{job_id}/results/overall_buckets\n
\n \n\nRetrievs overall bucket results that summarize the bucket results of\nmultiple anomaly detection jobs.\n\nThe `overall_score` is calculated by combining the scores of all the\nbuckets within the overall bucket span. First, the maximum\n`anomaly_score` per anomaly detection job in the overall bucket is\ncalculated. Then the `top_n` of those scores are averaged to result in\nthe `overall_score`. This means that you can fine-tune the\n`overall_score` so that it is more or less sensitive to the number of\njobs that detect an anomaly at the same time. For example, if you set\n`top_n` to `1`, the `overall_score` is the maximum bucket score in the\noverall bucket. Alternatively, if you set `top_n` to the number of jobs,\nthe `overall_score` is high only when all jobs detect anomalies in that\noverall bucket. If you set the `bucket_span` parameter (to a value\ngreater than its default), the `overall_score` is the maximum\n`overall_score` of the overall buckets that have a span equal to the\njobs' largest bucket span.\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: ml-get-overall-buckets parameters: - $ref: '#/components/parameters/ml.get_overall_buckets-job_id' - $ref: '#/components/parameters/ml.get_overall_buckets-allow_no_match' - $ref: '#/components/parameters/ml.get_overall_buckets-bucket_span' - $ref: '#/components/parameters/ml.get_overall_buckets-end' - $ref: '#/components/parameters/ml.get_overall_buckets-exclude_interim' - $ref: '#/components/parameters/ml.get_overall_buckets-overall_score' - $ref: '#/components/parameters/ml.get_overall_buckets-start' - $ref: '#/components/parameters/ml.get_overall_buckets-top_n' requestBody: $ref: '#/components/requestBodies/ml.get_overall_buckets' responses: '200': $ref: '#/components/responses/ml.get_overall_buckets-200' x-state: Generally available; Added in 6.1.0 x-codeSamples: - lang: Console source: "GET _ml/anomaly_detectors/job-*/results/overall_buckets\n{\n \"overall_score\": 80,\n \"start\": \"1403532000000\"\n}" - lang: Python source: "resp = client.ml.get_overall_buckets(\n job_id=\"job-*\",\n overall_score=80,\n start=\"1403532000000\",\n)" - lang: JavaScript source: "const response = await client.ml.getOverallBuckets({\n job_id: \"job-*\",\n overall_score: 80,\n start: 1403532000000,\n});" - lang: Ruby source: "response = client.ml.get_overall_buckets(\n job_id: \"job-*\",\n body: {\n \"overall_score\": 80,\n \"start\": \"1403532000000\"\n }\n)" - lang: PHP source: "$resp = $client->ml()->getOverallBuckets([\n \"job_id\" => \"job-*\",\n \"body\" => [\n \"overall_score\" => 80,\n \"start\" => \"1403532000000\",\n ],\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"overall_score":80,"start":"1403532000000"}'' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/job-*/results/overall_buckets"' - lang: C# source: "var response = await client.MachineLearning\n .GetOverallBucketsAsync(jobId: \"job-*\", d1 => d1\n .OverallScore(80d)\n .Start(DateTimeOffset.Parse(\"2014-06-23T14:00:00.0000000+00:00\", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind))\n );" - lang: Java source: "client.ml().getOverallBuckets(g -> g\n .jobId(\"job-*\")\n .overallScore(80.0D)\n .start(DateTime.of(\"1403532000000\"))\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/anomaly_detectors/{job_id}/results/records': post: tags: - ml anomaly summary: "Get anomaly records for an anomaly detection job\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ml/anomaly_detectors/{job_id}/results/records\n
\n
\n POST\n /_ml/anomaly_detectors/{job_id}/results/records\n
\n \n\nRecords contain the detailed analytical results. They describe the anomalous\nactivity that has been identified in the input data based on the detector\nconfiguration.\nThere can be many anomaly records depending on the characteristics and size\nof the input data. In practice, there are often too many to be able to\nmanually process them. The machine learning features therefore perform a\nsophisticated aggregation of the anomaly records into buckets.\nThe number of record results depends on the number of anomalies found in each\nbucket, which relates to the number of time series being modeled and the\nnumber of detectors.\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: ml-get-records parameters: - $ref: '#/components/parameters/ml.get_records-job_id' - $ref: '#/components/parameters/ml.get_records-desc' - $ref: '#/components/parameters/ml.get_records-end' - $ref: '#/components/parameters/ml.get_records-exclude_interim' - $ref: '#/components/parameters/ml.get_records-from' - $ref: '#/components/parameters/ml.get_records-record_score' - $ref: '#/components/parameters/ml.get_records-size' - $ref: '#/components/parameters/ml.get_records-sort' - $ref: '#/components/parameters/ml.get_records-start' requestBody: $ref: '#/components/requestBodies/ml.get_records' responses: '200': $ref: '#/components/responses/ml.get_records-200' x-state: Generally available; Added in 5.4.0 x-codeSamples: - lang: Console source: "GET _ml/anomaly_detectors/low_request_rate/results/records\n{\n \"sort\": \"record_score\",\n \"desc\": true,\n \"start\": \"1454944100000\"\n}" - lang: Python source: "resp = client.ml.get_records(\n job_id=\"low_request_rate\",\n sort=\"record_score\",\n desc=True,\n start=\"1454944100000\",\n)" - lang: JavaScript source: "const response = await client.ml.getRecords({\n job_id: \"low_request_rate\",\n sort: \"record_score\",\n desc: true,\n start: 1454944100000,\n});" - lang: Ruby source: "response = client.ml.get_records(\n job_id: \"low_request_rate\",\n body: {\n \"sort\": \"record_score\",\n \"desc\": true,\n \"start\": \"1454944100000\"\n }\n)" - lang: PHP source: "$resp = $client->ml()->getRecords([\n \"job_id\" => \"low_request_rate\",\n \"body\" => [\n \"sort\" => \"record_score\",\n \"desc\" => true,\n \"start\" => \"1454944100000\",\n ],\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"sort":"record_score","desc":true,"start":"1454944100000"}'' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/results/records"' - lang: C# source: "var response = await client.MachineLearning\n .GetRecordsAsync(jobId: \"low_request_rate\", d1 => d1\n .Desc(true)\n .Sort(x => x.RecordScore)\n .Start(DateTimeOffset.Parse(\"2016-02-08T15:08:20.0000000+00:00\", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind))\n );" - lang: Java source: "client.ml().getRecords(g -> g\n .desc(true)\n .jobId(\"low_request_rate\")\n .sort(\"record_score\")\n .start(DateTime.of(\"1454944100000\"))\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/trained_models/{model_id}/_stats': get: tags: - ml trained model summary: "Get trained models usage info\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ml/trained_models/_stats\n
\n
\n GET\n /_ml/trained_models/{model_id}/_stats\n
\n \n\nYou can get usage information for multiple trained\nmodels in a single API request by using a comma-separated list of model IDs or a wildcard expression.\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: ml-get-trained-models-stats parameters: - $ref: '#/components/parameters/ml.get_trained_models_stats-model_id' - $ref: '#/components/parameters/ml.get_trained_models_stats-allow_no_match' - $ref: '#/components/parameters/ml.get_trained_models_stats-from' - $ref: '#/components/parameters/ml.get_trained_models_stats-size' responses: '200': $ref: '#/components/responses/ml.get_trained_models_stats-200' x-state: Generally available; Added in 7.10.0 x-codeSamples: - lang: Console source: "GET _ml/trained_models/_stats\n" - lang: Python source: resp = client.ml.get_trained_models_stats() - lang: JavaScript source: const response = await client.ml.getTrainedModelsStats(); - lang: Ruby source: response = client.ml.get_trained_models_stats - lang: PHP source: $resp = $client->ml()->getTrainedModelsStats(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/trained_models/_stats"' - lang: C# source: var response = await client.MachineLearning.GetTrainedModelsStatsAsync(); - lang: Java source: "client.ml().getTrainedModelsStats(g -> g);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/trained_models/{model_id}/_infer': post: tags: - ml trained model summary: Evaluate a trained model description: "\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: ml-infer-trained-model parameters: - name: model_id in: path description: The unique identifier of the trained model. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Controls the amount of time to wait for inference results. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 10s requestBody: content: application/json: schema: required: - docs type: object properties: docs: type: array items: type: object additionalProperties: type: object description: "An array of objects to pass to the model for inference. The objects should contain a fields matching your\nconfigured trained model input. Typically, for NLP models, the field name is `text_field`.\nCurrently, for NLP models, only a single value is allowed." inference_config: allOf: - $ref: '#/components/schemas/ml._types.InferenceConfigUpdateContainer' description: The inference configuration updates to apply on the API call examples: MlInferTrainedModelExample1: description: An example body for a `POST _ml/trained_models/lang_ident_model_1/_infer` request. value: "{\n \"docs\":[{\"text\": \"The fool doth think he is wise, but the wise man knows himself to be a fool.\"}]\n}" x-codeSamples: - lang: Console source: "POST _ml/trained_models/lang_ident_model_1/_infer\n{\n \"docs\":[{\"text\": \"The fool doth think he is wise, but the wise man knows himself to be a fool.\"}]\n}" - lang: Python source: "resp = client.ml.infer_trained_model(\n model_id=\"lang_ident_model_1\",\n docs=[\n {\n \"text\": \"The fool doth think he is wise, but the wise man knows himself to be a fool.\"\n }\n ],\n)" - lang: JavaScript source: "const response = await client.ml.inferTrainedModel({\n model_id: \"lang_ident_model_1\",\n docs: [\n {\n text: \"The fool doth think he is wise, but the wise man knows himself to be a fool.\",\n },\n ],\n});" - lang: Ruby source: "response = client.ml.infer_trained_model(\n model_id: \"lang_ident_model_1\",\n body: {\n \"docs\": [\n {\n \"text\": \"The fool doth think he is wise, but the wise man knows himself to be a fool.\"\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->ml()->inferTrainedModel([\n \"model_id\" => \"lang_ident_model_1\",\n \"body\" => [\n \"docs\" => array(\n [\n \"text\" => \"The fool doth think he is wise, but the wise man knows himself to be a fool.\",\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"docs":[{"text":"The fool doth think he is wise, but the wise man knows himself to be a fool."}]}'' "$ELASTICSEARCH_URL/_ml/trained_models/lang_ident_model_1/_infer"' - lang: C# source: "var response = await client.MachineLearning\n .InferTrainedModelAsync(modelId: \"lang_ident_model_1\", d1 => d1\n .Docs([new Dictionary()\n {\n { \"text\", \"The fool doth think he is wise, but the wise man knows himself to be a fool.\" }\n }])\n );" - lang: Java source: "client.ml().inferTrainedModel(i -> i\n .docs(Map.of(\"text\", JsonData.fromJson(\"\\\"The fool doth think he is wise, but the wise man knows himself to be a fool.\\\"\")))\n .modelId(\"lang_ident_model_1\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - inference_results type: object properties: inference_results: type: array items: $ref: '#/components/schemas/ml._types.InferenceResponseResult' x-state: Generally available; Added in 8.3.0 x-codeSamples: - lang: Console source: "POST _ml/trained_models/lang_ident_model_1/_infer\n{\n \"docs\":[{\"text\": \"The fool doth think he is wise, but the wise man knows himself to be a fool.\"}]\n}" - lang: Python source: "resp = client.ml.infer_trained_model(\n model_id=\"lang_ident_model_1\",\n docs=[\n {\n \"text\": \"The fool doth think he is wise, but the wise man knows himself to be a fool.\"\n }\n ],\n)" - lang: JavaScript source: "const response = await client.ml.inferTrainedModel({\n model_id: \"lang_ident_model_1\",\n docs: [\n {\n text: \"The fool doth think he is wise, but the wise man knows himself to be a fool.\",\n },\n ],\n});" - lang: Ruby source: "response = client.ml.infer_trained_model(\n model_id: \"lang_ident_model_1\",\n body: {\n \"docs\": [\n {\n \"text\": \"The fool doth think he is wise, but the wise man knows himself to be a fool.\"\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->ml()->inferTrainedModel([\n \"model_id\" => \"lang_ident_model_1\",\n \"body\" => [\n \"docs\" => array(\n [\n \"text\" => \"The fool doth think he is wise, but the wise man knows himself to be a fool.\",\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"docs":[{"text":"The fool doth think he is wise, but the wise man knows himself to be a fool."}]}'' "$ELASTICSEARCH_URL/_ml/trained_models/lang_ident_model_1/_infer"' - lang: C# source: "var response = await client.MachineLearning\n .InferTrainedModelAsync(modelId: \"lang_ident_model_1\", d1 => d1\n .Docs([new Dictionary()\n {\n { \"text\", \"The fool doth think he is wise, but the wise man knows himself to be a fool.\" }\n }])\n );" - lang: Java source: "client.ml().inferTrainedModel(i -> i\n .docs(Map.of(\"text\", JsonData.fromJson(\"\\\"The fool doth think he is wise, but the wise man knows himself to be a fool.\\\"\")))\n .modelId(\"lang_ident_model_1\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name /_ml/info: get: tags: - ml summary: Get machine learning information description: "Get defaults and limits used by machine learning.\nThis endpoint is designed to be used by a user interface that needs to fully\nunderstand machine learning configurations where some options are not\nspecified, meaning that the defaults should be used. This endpoint may be\nused to find out what those defaults are. It also provides information about\nthe maximum size of machine learning jobs that could run in the current\ncluster configuration.\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: ml-info responses: '200': description: '' content: application/json: schema: required: - defaults - limits - upgrade_mode - native_code type: object properties: defaults: allOf: - $ref: '#/components/schemas/ml.info.Defaults' limits: allOf: - $ref: '#/components/schemas/ml.info.Limits' upgrade_mode: type: boolean native_code: allOf: - $ref: '#/components/schemas/ml.info.NativeCode' x-state: Generally available; Added in 6.3.0 x-codeSamples: - lang: Console source: "GET _ml/info\n" - lang: Python source: resp = client.ml.info() - lang: JavaScript source: const response = await client.ml.info(); - lang: Ruby source: response = client.ml.info - lang: PHP source: $resp = $client->ml()->info(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/info"' - lang: C# source: var response = await client.MachineLearning.InfoAsync(); - lang: Java source: "client.ml().info();\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/anomaly_detectors/{job_id}/_open': post: tags: - ml anomaly summary: Open anomaly detection jobs description: "An anomaly detection job must be opened to be ready to receive and analyze\ndata. It can be opened and closed multiple times throughout its lifecycle.\nWhen you open a new job, it starts with an empty model.\nWhen you open an existing job, the most recent model state is automatically\nloaded. The job is ready to resume its analysis from where it left off, once\nnew data is received.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-open-job parameters: - name: job_id in: path description: Identifier for the anomaly detection job. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Controls the time to wait until a job has opened. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30m requestBody: content: application/json: schema: type: object properties: timeout: allOf: - $ref: '#/components/schemas/_types.Duration' description: Refer to the description for the `timeout` query parameter. default: 30m examples: MlOpenJobRequestExample1: description: "A request to open anomaly detection jobs. The timeout specifies to wait 35 minutes for the job to open.\n" value: "{\n \"timeout\": \"35m\"\n}" x-codeSamples: - lang: Console source: "POST /_ml/anomaly_detectors/job-01/_open\n{\n \"timeout\": \"35m\"\n}" - lang: Python source: "resp = client.ml.open_job(\n job_id=\"job-01\",\n timeout=\"35m\",\n)" - lang: JavaScript source: "const response = await client.ml.openJob({\n job_id: \"job-01\",\n timeout: \"35m\",\n});" - lang: Ruby source: "response = client.ml.open_job(\n job_id: \"job-01\",\n body: {\n \"timeout\": \"35m\"\n }\n)" - lang: PHP source: "$resp = $client->ml()->openJob([\n \"job_id\" => \"job-01\",\n \"body\" => [\n \"timeout\" => \"35m\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"timeout":"35m"}'' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/job-01/_open"' - lang: C# source: "var response = await client.MachineLearning\n .OpenJobAsync(jobId: \"job-01\", d1 => d1\n .Timeout(\"35m\")\n );" - lang: Java source: "client.ml().openJob(o -> o\n .jobId(\"job-01\")\n .timeout(t -> t\n .time(\"35m\")\n )\n);\n" responses: '200': description: '' content: application/json: schema: required: - opened - node type: object properties: opened: type: boolean node: allOf: - $ref: '#/components/schemas/_types.NodeId' description: "The ID of the node that the job was started on. In serverless this will be the \"serverless\".\nIf the job is allowed to open lazily and has not yet been assigned to a node, this value is an empty string." examples: MlOpenJobResponseExample1: description: A successful response when opening an anomaly detection job. value: "{\n \"opened\": true,\n \"node\": \"node-1\"\n}" x-state: Generally available; Added in 5.4.0 x-codeSamples: - lang: Console source: "POST /_ml/anomaly_detectors/job-01/_open\n{\n \"timeout\": \"35m\"\n}" - lang: Python source: "resp = client.ml.open_job(\n job_id=\"job-01\",\n timeout=\"35m\",\n)" - lang: JavaScript source: "const response = await client.ml.openJob({\n job_id: \"job-01\",\n timeout: \"35m\",\n});" - lang: Ruby source: "response = client.ml.open_job(\n job_id: \"job-01\",\n body: {\n \"timeout\": \"35m\"\n }\n)" - lang: PHP source: "$resp = $client->ml()->openJob([\n \"job_id\" => \"job-01\",\n \"body\" => [\n \"timeout\" => \"35m\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"timeout":"35m"}'' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/job-01/_open"' - lang: C# source: "var response = await client.MachineLearning\n .OpenJobAsync(jobId: \"job-01\", d1 => d1\n .Timeout(\"35m\")\n );" - lang: Java source: "client.ml().openJob(o -> o\n .jobId(\"job-01\")\n .timeout(t -> t\n .time(\"35m\")\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/anomaly_detectors/{job_id}/_data': post: tags: - ml anomaly summary: Send data to an anomaly detection job for analysis description: "IMPORTANT: For each job, data can be accepted from only a single connection at a time.\nIt is not currently possible to post data to multiple jobs using wildcards or a comma-separated list.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-post-data parameters: - name: job_id in: path description: Identifier for the anomaly detection job. The job must have a state of open to receive and process the data. required: true schema: $ref: '#/components/schemas/_types.Id' - name: reset_end in: query description: Specifies the end of the bucket resetting range. schema: $ref: '#/components/schemas/_types.DateTime' - name: reset_start in: query description: Specifies the start of the bucket resetting range. schema: $ref: '#/components/schemas/_types.DateTime' requestBody: content: application/json: schema: type: array items: type: object required: true responses: '200': description: '' content: application/json: schema: required: - job_id - processed_record_count - processed_field_count - input_bytes - input_field_count - invalid_date_count - missing_field_count - out_of_order_timestamp_count - empty_bucket_count - sparse_bucket_count - bucket_count - input_record_count type: object properties: job_id: allOf: - $ref: '#/components/schemas/_types.Id' processed_record_count: type: number processed_field_count: type: number input_bytes: type: number input_field_count: type: number invalid_date_count: type: number missing_field_count: type: number out_of_order_timestamp_count: type: number empty_bucket_count: type: number sparse_bucket_count: type: number bucket_count: type: number earliest_record_timestamp: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' latest_record_timestamp: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' last_data_time: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' latest_empty_bucket_timestamp: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' latest_sparse_bucket_timestamp: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' input_record_count: type: number log_time: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' deprecated: true x-state: Generally available; Added in 5.4.0 x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/data_frame/analytics/{id}/_preview': post: tags: - ml data frame summary: "Preview features used by data frame analytics\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ml/data_frame/analytics/_preview\n
\n
\n POST\n /_ml/data_frame/analytics/_preview\n
\n
\n GET\n /_ml/data_frame/analytics/{id}/_preview\n
\n
\n POST\n /_ml/data_frame/analytics/{id}/_preview\n
\n \n\nPreview the extracted features used by a data frame analytics config.\n\n## Required authorization\n\n* Cluster privileges: `monitor_ml`\n" operationId: ml-preview-data-frame-analytics parameters: - $ref: '#/components/parameters/ml.preview_data_frame_analytics-id' requestBody: $ref: '#/components/requestBodies/ml.preview_data_frame_analytics' responses: '200': $ref: '#/components/responses/ml.preview_data_frame_analytics-200' x-state: Generally available; Added in 7.13.0 x-codeSamples: - lang: Console source: "POST _ml/data_frame/analytics/_preview\n{\n \"config\": {\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n }\n}" - lang: Python source: "resp = client.ml.preview_data_frame_analytics(\n config={\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.ml.previewDataFrameAnalytics({\n config: {\n source: {\n index: \"houses_sold_last_10_yrs\",\n },\n analysis: {\n regression: {\n dependent_variable: \"price\",\n },\n },\n },\n});" - lang: Ruby source: "response = client.ml.preview_data_frame_analytics(\n body: {\n \"config\": {\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->ml()->previewDataFrameAnalytics([\n \"body\" => [\n \"config\" => [\n \"source\" => [\n \"index\" => \"houses_sold_last_10_yrs\",\n ],\n \"analysis\" => [\n \"regression\" => [\n \"dependent_variable\" => \"price\",\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"config":{"source":{"index":"houses_sold_last_10_yrs"},"analysis":{"regression":{"dependent_variable":"price"}}}}'' "$ELASTICSEARCH_URL/_ml/data_frame/analytics/_preview"' - lang: C# source: "var response = await client.MachineLearning\n .PreviewDataFrameAnalyticsAsync(d1 => d1\n .Config(d2 => d2\n .Analysis(d3 => d3\n .Regression(d4 => d4\n .DependentVariable(\"price\")\n )\n )\n .Source(d3 => d3\n .Indices(new[] { \"houses_sold_last_10_yrs\" })\n )\n )\n );" - lang: Java source: "client.ml().previewDataFrameAnalytics(p -> p\n .config(c -> c\n .source(s -> s\n .index(\"houses_sold_last_10_yrs\")\n )\n .analysis(a -> a\n .regression(r -> r\n .dependentVariable(\"price\")\n )\n )\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/datafeeds/{datafeed_id}/_preview': post: tags: - ml anomaly summary: "Preview a datafeed\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ml/datafeeds/_preview\n
\n
\n POST\n /_ml/datafeeds/_preview\n
\n
\n GET\n /_ml/datafeeds/{datafeed_id}/_preview\n
\n
\n POST\n /_ml/datafeeds/{datafeed_id}/_preview\n
\n \n\nThis API returns the first \"page\" of search results from a datafeed.\nYou can preview an existing datafeed or provide configuration details for a datafeed\nand anomaly detection job in the API. The preview shows the structure of the data\nthat will be passed to the anomaly detection engine.\nIMPORTANT: When Elasticsearch security features are enabled, the preview uses the credentials of the user that\ncalled the API. However, when the datafeed starts it uses the roles of the last user that created or updated the\ndatafeed. To get a preview that accurately reflects the behavior of the datafeed, use the appropriate credentials.\nYou can also use secondary authorization headers to supply the credentials.\n\n## Required authorization\n\n* Index privileges: `read`\n* Cluster privileges: `manage_ml`\n" operationId: ml-preview-datafeed parameters: - $ref: '#/components/parameters/ml.preview_datafeed-datafeed_id' - $ref: '#/components/parameters/ml.preview_datafeed-start' - $ref: '#/components/parameters/ml.preview_datafeed-end' requestBody: $ref: '#/components/requestBodies/ml.preview_datafeed' responses: '200': $ref: '#/components/responses/ml.preview_datafeed-200' x-state: Generally available; Added in 5.4.0 x-codeSamples: - lang: Console source: "GET _ml/datafeeds/datafeed-high_sum_total_sales/_preview\n" - lang: Python source: "resp = client.ml.preview_datafeed(\n datafeed_id=\"datafeed-high_sum_total_sales\",\n)" - lang: JavaScript source: "const response = await client.ml.previewDatafeed({\n datafeed_id: \"datafeed-high_sum_total_sales\",\n});" - lang: Ruby source: "response = client.ml.preview_datafeed(\n datafeed_id: \"datafeed-high_sum_total_sales\"\n)" - lang: PHP source: "$resp = $client->ml()->previewDatafeed([\n \"datafeed_id\" => \"datafeed-high_sum_total_sales\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-high_sum_total_sales/_preview"' - lang: C# source: "var response = await client.MachineLearning\n .PreviewDatafeedAsync(d1 => d1\n .DatafeedId(\"datafeed-high_sum_total_sales\")\n );" - lang: Java source: "client.ml().previewDatafeed(p -> p\n .datafeedId(\"datafeed-high_sum_total_sales\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/trained_models/{model_id}/definition/{part}': put: tags: - ml trained model summary: Create part of a trained model definition description: "\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-put-trained-model-definition-part parameters: - name: model_id in: path description: The unique identifier of the trained model. required: true schema: $ref: '#/components/schemas/_types.Id' - name: part in: path description: "The definition part number. When the definition is loaded for inference the definition parts are streamed in the\norder of their part number. The first part must be `0` and the final part must be `total_parts - 1`." required: true schema: type: number requestBody: content: application/json: schema: required: - definition - total_definition_length - total_parts type: object properties: definition: type: string description: The definition part for the model. Must be a base64 encoded string. total_definition_length: type: number description: The total uncompressed definition length in bytes. Not base64 encoded. total_parts: type: number description: The total number of parts that will be uploaded. Must be greater than 0. examples: MlPutTrainedModelDefinitionPartExample1: description: An example body for a `PUT _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/definition/0` request. value: "{\n \"definition\": \"...\",\n \"total_definition_length\": 265632637,\n \"total_parts\": 64\n}" x-codeSamples: - lang: Console source: "PUT _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/definition/0\n{\n \"definition\": \"...\",\n \"total_definition_length\": 265632637,\n \"total_parts\": 64\n}" - lang: Python source: "resp = client.ml.put_trained_model_definition_part(\n model_id=\"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n part=\"0\",\n definition=\"...\",\n total_definition_length=265632637,\n total_parts=64,\n)" - lang: JavaScript source: "const response = await client.ml.putTrainedModelDefinitionPart({\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n part: 0,\n definition: \"...\",\n total_definition_length: 265632637,\n total_parts: 64,\n});" - lang: Ruby source: "response = client.ml.put_trained_model_definition_part(\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n part: \"0\",\n body: {\n \"definition\": \"...\",\n \"total_definition_length\": 265632637,\n \"total_parts\": 64\n }\n)" - lang: PHP source: "$resp = $client->ml()->putTrainedModelDefinitionPart([\n \"model_id\" => \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n \"part\" => \"0\",\n \"body\" => [\n \"definition\" => \"...\",\n \"total_definition_length\" => 265632637,\n \"total_parts\" => 64,\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"definition":"...","total_definition_length":265632637,"total_parts":64}'' "$ELASTICSEARCH_URL/_ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/definition/0"' - lang: C# source: "var response = await client.MachineLearning\n .PutTrainedModelDefinitionPartAsync(modelId: \"elastic__distilbert-base-uncased-finetuned-conll03-english\", part: 0, d1 => d1\n .Definition(\"...\")\n .TotalDefinitionLength(265632637L)\n .TotalParts(64)\n );" - lang: Java source: "client.ml().putTrainedModelDefinitionPart(p -> p\n .definition(\"...\")\n .modelId(\"elastic__distilbert-base-uncased-finetuned-conll03-english\")\n .part(0)\n .totalDefinitionLength(265632637L)\n .totalParts(64)\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 8.0.0 x-codeSamples: - lang: Console source: "PUT _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/definition/0\n{\n \"definition\": \"...\",\n \"total_definition_length\": 265632637,\n \"total_parts\": 64\n}" - lang: Python source: "resp = client.ml.put_trained_model_definition_part(\n model_id=\"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n part=\"0\",\n definition=\"...\",\n total_definition_length=265632637,\n total_parts=64,\n)" - lang: JavaScript source: "const response = await client.ml.putTrainedModelDefinitionPart({\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n part: 0,\n definition: \"...\",\n total_definition_length: 265632637,\n total_parts: 64,\n});" - lang: Ruby source: "response = client.ml.put_trained_model_definition_part(\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n part: \"0\",\n body: {\n \"definition\": \"...\",\n \"total_definition_length\": 265632637,\n \"total_parts\": 64\n }\n)" - lang: PHP source: "$resp = $client->ml()->putTrainedModelDefinitionPart([\n \"model_id\" => \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n \"part\" => \"0\",\n \"body\" => [\n \"definition\" => \"...\",\n \"total_definition_length\" => 265632637,\n \"total_parts\" => 64,\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"definition":"...","total_definition_length":265632637,"total_parts":64}'' "$ELASTICSEARCH_URL/_ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/definition/0"' - lang: C# source: "var response = await client.MachineLearning\n .PutTrainedModelDefinitionPartAsync(modelId: \"elastic__distilbert-base-uncased-finetuned-conll03-english\", part: 0, d1 => d1\n .Definition(\"...\")\n .TotalDefinitionLength(265632637L)\n .TotalParts(64)\n );" - lang: Java source: "client.ml().putTrainedModelDefinitionPart(p -> p\n .definition(\"...\")\n .modelId(\"elastic__distilbert-base-uncased-finetuned-conll03-english\")\n .part(0)\n .totalDefinitionLength(265632637L)\n .totalParts(64)\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/trained_models/{model_id}/vocabulary': put: tags: - ml trained model summary: Create a trained model vocabulary description: "This API is supported only for natural language processing (NLP) models.\nThe vocabulary is stored in the index as described in `inference_config.*.vocabulary` of the trained model definition.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-put-trained-model-vocabulary parameters: - name: model_id in: path description: The unique identifier of the trained model. required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: required: - vocabulary type: object properties: vocabulary: type: array items: type: string description: 'The model vocabulary, which must not be empty.' merges: type: array items: type: string description: The optional model merges if required by the tokenizer. x-state: Generally available; Added in 8.2.0 scores: type: array items: type: number description: The optional vocabulary value scores if required by the tokenizer. x-state: Generally available; Added in 8.9.0 examples: MlPutTrainedModelVocabularyExample1: description: An example body for a `PUT _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/vocabulary` request. value: "{\n \"vocabulary\": [\n \"[PAD]\",\n \"[unused0]\",\n ]\n}" x-codeSamples: - lang: Console source: "PUT _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/vocabulary\n{\n \"vocabulary\": [\n \"[PAD]\",\n \"[unused0]\",\n ]\n}" - lang: Python source: "resp = client.ml.put_trained_model_vocabulary(\n model_id=\"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n vocabulary=[\n \"[PAD]\",\n \"[unused0]\"\n ],\n)" - lang: JavaScript source: "const response = await client.ml.putTrainedModelVocabulary({\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n vocabulary: [\"[PAD]\", \"[unused0]\"],\n});" - lang: Ruby source: "response = client.ml.put_trained_model_vocabulary(\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n body: {\n \"vocabulary\": [\n \"[PAD]\",\n \"[unused0]\"\n ]\n }\n)" - lang: PHP source: "$resp = $client->ml()->putTrainedModelVocabulary([\n \"model_id\" => \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n \"body\" => [\n \"vocabulary\" => array(\n \"[PAD]\",\n \"[unused0]\",\n ),\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"vocabulary":["[PAD]","[unused0]"]}'' "$ELASTICSEARCH_URL/_ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/vocabulary"' - lang: C# source: "var response = await client.MachineLearning\n .PutTrainedModelVocabularyAsync(modelId: \"elastic__distilbert-base-uncased-finetuned-conll03-english\", d1 => d1\n .Vocabulary(\"[PAD]\", \"[unused0]\")\n );" - lang: Java source: "client.ml().putTrainedModelVocabulary(p -> p\n .modelId(\"elastic__distilbert-base-uncased-finetuned-conll03-english\")\n .vocabulary(List.of(\"[PAD]\",\"[unused0]\"))\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 8.0.0 x-codeSamples: - lang: Console source: "PUT _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/vocabulary\n{\n \"vocabulary\": [\n \"[PAD]\",\n \"[unused0]\",\n ]\n}" - lang: Python source: "resp = client.ml.put_trained_model_vocabulary(\n model_id=\"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n vocabulary=[\n \"[PAD]\",\n \"[unused0]\"\n ],\n)" - lang: JavaScript source: "const response = await client.ml.putTrainedModelVocabulary({\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n vocabulary: [\"[PAD]\", \"[unused0]\"],\n});" - lang: Ruby source: "response = client.ml.put_trained_model_vocabulary(\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n body: {\n \"vocabulary\": [\n \"[PAD]\",\n \"[unused0]\"\n ]\n }\n)" - lang: PHP source: "$resp = $client->ml()->putTrainedModelVocabulary([\n \"model_id\" => \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n \"body\" => [\n \"vocabulary\" => array(\n \"[PAD]\",\n \"[unused0]\",\n ),\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"vocabulary":["[PAD]","[unused0]"]}'' "$ELASTICSEARCH_URL/_ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/vocabulary"' - lang: C# source: "var response = await client.MachineLearning\n .PutTrainedModelVocabularyAsync(modelId: \"elastic__distilbert-base-uncased-finetuned-conll03-english\", d1 => d1\n .Vocabulary(\"[PAD]\", \"[unused0]\")\n );" - lang: Java source: "client.ml().putTrainedModelVocabulary(p -> p\n .modelId(\"elastic__distilbert-base-uncased-finetuned-conll03-english\")\n .vocabulary(List.of(\"[PAD]\",\"[unused0]\"))\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/anomaly_detectors/{job_id}/_reset': post: tags: - ml anomaly summary: Reset an anomaly detection job description: "All model state and results are deleted. The job is ready to start over as if\nit had just been created.\nIt is not currently possible to reset multiple jobs using wildcards or a\ncomma separated list.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-reset-job parameters: - name: job_id in: path description: The ID of the job to reset. required: true schema: $ref: '#/components/schemas/_types.Id' - name: wait_for_completion in: query description: "Should this request wait until the operation has completed before\nreturning." schema: type: boolean default: true - name: delete_user_annotations in: query description: "Specifies whether annotations that have been added by the\nuser should be deleted along with any auto-generated annotations when the job is\nreset." schema: type: boolean default: false responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 7.14.0 x-codeSamples: - lang: Console source: "POST _ml/anomaly_detectors/total-requests/_reset\n" - lang: Python source: "resp = client.ml.reset_job(\n job_id=\"total-requests\",\n)" - lang: JavaScript source: "const response = await client.ml.resetJob({\n job_id: \"total-requests\",\n});" - lang: Ruby source: "response = client.ml.reset_job(\n job_id: \"total-requests\"\n)" - lang: PHP source: "$resp = $client->ml()->resetJob([\n \"job_id\" => \"total-requests\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/anomaly_detectors/total-requests/_reset"' - lang: C# source: 'var response = await client.MachineLearning.ResetJobAsync(jobId: "total-requests");' - lang: Java source: "client.ml().resetJob(r -> r\n .jobId(\"total-requests\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_revert': post: tags: - ml anomaly summary: Revert to a snapshot description: "The machine learning features react quickly to anomalous input, learning new\nbehaviors in data. Highly anomalous input increases the variance in the\nmodels whilst the system learns whether this is a new step-change in behavior\nor a one-off event. In the case where this anomalous input is known to be a\none-off, then it might be appropriate to reset the model state to a time\nbefore this event. For example, you might consider reverting to a saved\nsnapshot after Black Friday or a critical system failure.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-revert-model-snapshot parameters: - name: job_id in: path description: Identifier for the anomaly detection job. required: true schema: $ref: '#/components/schemas/_types.Id' - name: snapshot_id in: path description: "You can specify `empty` as the . Reverting to the empty\nsnapshot means the anomaly detection job starts learning a new model from\nscratch when it is started." required: true schema: $ref: '#/components/schemas/_types.Id' - name: delete_intervening_results in: query description: "If true, deletes the results in the time period between the latest\nresults and the time of the reverted snapshot. It also resets the model\nto accept records for this time period. If you choose not to delete\nintervening results when reverting a snapshot, the job will not accept\ninput data that is older than the current time. If you want to resend\ndata, then delete the intervening results." schema: type: boolean default: false requestBody: content: application/json: schema: type: object properties: delete_intervening_results: type: boolean description: Refer to the description for the `delete_intervening_results` query parameter. default: false examples: MlRevertModelSnapshotExample1: description: An example body for a `POST _ml/anomaly_detectors/low_request_rate/model_snapshots/1637092688/_revert` request. value: "{\n \"delete_intervening_results\": true\n}" x-codeSamples: - lang: Console source: "POST _ml/anomaly_detectors/low_request_rate/model_snapshots/1637092688/_revert\n{\n \"delete_intervening_results\": true\n}" - lang: Python source: "resp = client.ml.revert_model_snapshot(\n job_id=\"low_request_rate\",\n snapshot_id=\"1637092688\",\n delete_intervening_results=True,\n)" - lang: JavaScript source: "const response = await client.ml.revertModelSnapshot({\n job_id: \"low_request_rate\",\n snapshot_id: 1637092688,\n delete_intervening_results: true,\n});" - lang: Ruby source: "response = client.ml.revert_model_snapshot(\n job_id: \"low_request_rate\",\n snapshot_id: \"1637092688\",\n body: {\n \"delete_intervening_results\": true\n }\n)" - lang: PHP source: "$resp = $client->ml()->revertModelSnapshot([\n \"job_id\" => \"low_request_rate\",\n \"snapshot_id\" => \"1637092688\",\n \"body\" => [\n \"delete_intervening_results\" => true,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"delete_intervening_results":true}'' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/model_snapshots/1637092688/_revert"' - lang: C# source: "var response = await client.MachineLearning\n .RevertModelSnapshotAsync(jobId: \"low_request_rate\", snapshotId: \"1637092688\", d1 => d1\n .DeleteInterveningResults(true)\n );" - lang: Java source: "client.ml().revertModelSnapshot(r -> r\n .deleteInterveningResults(true)\n .jobId(\"low_request_rate\")\n .snapshotId(\"1637092688\")\n);\n" responses: '200': description: '' content: application/json: schema: required: - model type: object properties: model: allOf: - $ref: '#/components/schemas/ml._types.ModelSnapshot' x-state: Generally available; Added in 5.4.0 x-codeSamples: - lang: Console source: "POST _ml/anomaly_detectors/low_request_rate/model_snapshots/1637092688/_revert\n{\n \"delete_intervening_results\": true\n}" - lang: Python source: "resp = client.ml.revert_model_snapshot(\n job_id=\"low_request_rate\",\n snapshot_id=\"1637092688\",\n delete_intervening_results=True,\n)" - lang: JavaScript source: "const response = await client.ml.revertModelSnapshot({\n job_id: \"low_request_rate\",\n snapshot_id: 1637092688,\n delete_intervening_results: true,\n});" - lang: Ruby source: "response = client.ml.revert_model_snapshot(\n job_id: \"low_request_rate\",\n snapshot_id: \"1637092688\",\n body: {\n \"delete_intervening_results\": true\n }\n)" - lang: PHP source: "$resp = $client->ml()->revertModelSnapshot([\n \"job_id\" => \"low_request_rate\",\n \"snapshot_id\" => \"1637092688\",\n \"body\" => [\n \"delete_intervening_results\" => true,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"delete_intervening_results":true}'' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/model_snapshots/1637092688/_revert"' - lang: C# source: "var response = await client.MachineLearning\n .RevertModelSnapshotAsync(jobId: \"low_request_rate\", snapshotId: \"1637092688\", d1 => d1\n .DeleteInterveningResults(true)\n );" - lang: Java source: "client.ml().revertModelSnapshot(r -> r\n .deleteInterveningResults(true)\n .jobId(\"low_request_rate\")\n .snapshotId(\"1637092688\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name /_ml/set_upgrade_mode: post: tags: - ml summary: Set upgrade_mode for ML indices description: "Sets a cluster wide upgrade_mode setting that prepares machine learning\nindices for an upgrade.\nWhen upgrading your cluster, in some circumstances you must restart your\nnodes and reindex your machine learning indices. In those circumstances,\nthere must be no machine learning jobs running. You can close the machine\nlearning jobs, do the upgrade, then open all the jobs again. Alternatively,\nyou can use this API to temporarily halt tasks associated with the jobs and\ndatafeeds and prevent new jobs from opening. You can also use this API\nduring upgrades that do not require you to reindex your machine learning\nindices, though stopping jobs is not a requirement in that case.\nYou can see the current value for the upgrade_mode setting by using the get\nmachine learning info API.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-set-upgrade-mode parameters: - name: enabled in: query description: "When `true`, it enables `upgrade_mode` which temporarily halts all job\nand datafeed tasks and prohibits new job and datafeed tasks from\nstarting." schema: type: boolean default: false - name: timeout in: query description: The time to wait for the request to be completed. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 6.7.0 x-codeSamples: - lang: Console source: "POST _ml/set_upgrade_mode?enabled=true\n" - lang: Python source: "resp = client.ml.set_upgrade_mode(\n enabled=True,\n)" - lang: JavaScript source: "const response = await client.ml.setUpgradeMode({\n enabled: \"true\",\n});" - lang: Ruby source: "response = client.ml.set_upgrade_mode(\n enabled: \"true\"\n)" - lang: PHP source: "$resp = $client->ml()->setUpgradeMode([\n \"enabled\" => \"true\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/set_upgrade_mode?enabled=true"' - lang: C# source: "var response = await client.MachineLearning\n .SetUpgradeModeAsync(d1 => d1\n .Enabled(true)\n );" - lang: Java source: "client.ml().setUpgradeMode(s -> s\n .enabled(true)\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/data_frame/analytics/{id}/_start': post: tags: - ml data frame summary: Start a data frame analytics job description: "A data frame analytics job can be started and stopped multiple times\nthroughout its lifecycle.\nIf the destination index does not exist, it is created automatically the\nfirst time you start the data frame analytics job. The\n`index.number_of_shards` and `index.number_of_replicas` settings for the\ndestination index are copied from the source index. If there are multiple\nsource indices, the destination index copies the highest setting values. The\nmappings for the destination index are also copied from the source indices.\nIf there are any mapping conflicts, the job fails to start.\nIf the destination index exists, it is used as is. You can therefore set up\nthe destination index in advance with custom settings and mappings.\n\n## Required authorization\n\n* Index privileges: `create_index`,`index`,`manage`,`read`,`view_index_metadata`\n* Cluster privileges: `manage_ml`\n" operationId: ml-start-data-frame-analytics parameters: - name: id in: path description: "Identifier for the data frame analytics job. This identifier can contain\nlowercase alphanumeric characters (a-z and 0-9), hyphens, and\nunderscores. It must start and end with alphanumeric characters." required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: "Controls the amount of time to wait until the data frame analytics job\nstarts." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 20s requestBody: content: application/json: schema: type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: 'If provided, must be the same identifier as in the path.' timeout: allOf: - $ref: '#/components/schemas/_types.Duration' description: "Controls the amount of time to wait until the data frame analytics job\nstarts." default: 20s responses: '200': description: '' content: application/json: schema: required: - acknowledged - node type: object properties: acknowledged: type: boolean node: allOf: - $ref: '#/components/schemas/_types.NodeId' description: "The ID of the node that the job was started on. If the job is allowed to open lazily and has not yet been assigned to a node, this value is an empty string.\nThe node ID of the node the job has been assigned to, or\nan empty string if it hasn't been assigned to a node. In\nserverless if the job has been assigned to run then the\nnode ID will be \"serverless\"." x-state: Generally available; Added in 7.3.0 x-codeSamples: - lang: Console source: "POST _ml/data_frame/analytics/loganalytics/_start\n" - lang: Python source: "resp = client.ml.start_data_frame_analytics(\n id=\"loganalytics\",\n)" - lang: JavaScript source: "const response = await client.ml.startDataFrameAnalytics({\n id: \"loganalytics\",\n});" - lang: Ruby source: "response = client.ml.start_data_frame_analytics(\n id: \"loganalytics\"\n)" - lang: PHP source: "$resp = $client->ml()->startDataFrameAnalytics([\n \"id\" => \"loganalytics\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics/_start"' - lang: C# source: 'var response = await client.MachineLearning.StartDataFrameAnalyticsAsync(id: "loganalytics");' - lang: Java source: "client.ml().startDataFrameAnalytics(s -> s\n .id(\"loganalytics\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/datafeeds/{datafeed_id}/_start': post: tags: - ml anomaly summary: Start datafeeds description: "A datafeed must be started in order to retrieve data from Elasticsearch. A datafeed can be started and stopped\nmultiple times throughout its lifecycle.\n\nBefore you can start a datafeed, the anomaly detection job must be open. Otherwise, an error occurs.\n\nIf you restart a stopped datafeed, it continues processing input data from the next millisecond after it was stopped.\nIf new data was indexed for that exact millisecond between stopping and starting, it will be ignored.\n\nWhen Elasticsearch security features are enabled, your datafeed remembers which roles the last user to create or\nupdate it had at the time of creation or update and runs the query using those same roles. If you provided secondary\nauthorization headers when you created or updated the datafeed, those credentials are used instead.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-start-datafeed parameters: - name: datafeed_id in: path description: "A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase\nalphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric\ncharacters." required: true schema: $ref: '#/components/schemas/_types.Id' - name: end in: query description: "The time that the datafeed should end, which can be specified by using one of the following formats:\n\n* ISO 8601 format with milliseconds, for example `2017-01-22T06:00:00.000Z`\n* ISO 8601 format without milliseconds, for example `2017-01-22T06:00:00+00:00`\n* Milliseconds since the epoch, for example `1485061200000`\n\nDate-time arguments using either of the ISO 8601 formats must have a time zone designator, where `Z` is accepted\nas an abbreviation for UTC time. When a URL is expected (for example, in browsers), the `+` used in time zone\ndesignators must be encoded as `%2B`.\nThe end time value is exclusive. If you do not specify an end time, the datafeed\nruns continuously." schema: $ref: '#/components/schemas/_types.DateTime' - name: start in: query description: "The time that the datafeed should begin, which can be specified by using the same formats as the `end` parameter.\nThis value is inclusive.\nIf you do not specify a start time and the datafeed is associated with a new anomaly detection job, the analysis\nstarts from the earliest time for which data is available.\nIf you restart a stopped datafeed and specify a start value that is earlier than the timestamp of the latest\nprocessed record, the datafeed continues from 1 millisecond after the timestamp of the latest processed record." schema: $ref: '#/components/schemas/_types.DateTime' - name: timeout in: query description: Specifies the amount of time to wait until a datafeed starts. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 20s requestBody: content: application/json: schema: type: object properties: end: allOf: - $ref: '#/components/schemas/_types.DateTime' description: Refer to the description for the `end` query parameter. start: allOf: - $ref: '#/components/schemas/_types.DateTime' description: Refer to the description for the `start` query parameter. timeout: allOf: - $ref: '#/components/schemas/_types.Duration' description: Refer to the description for the `timeout` query parameter. default: 20s examples: MlStartDatafeedExample1: description: An example body for a `POST _ml/datafeeds/datafeed-low_request_rate/_start` request. value: "{\n \"start\": \"2019-04-07T18:22:16Z\"\n}" x-codeSamples: - lang: Console source: "POST _ml/datafeeds/datafeed-low_request_rate/_start\n{\n \"start\": \"2019-04-07T18:22:16Z\"\n}" - lang: Python source: "resp = client.ml.start_datafeed(\n datafeed_id=\"datafeed-low_request_rate\",\n start=\"2019-04-07T18:22:16Z\",\n)" - lang: JavaScript source: "const response = await client.ml.startDatafeed({\n datafeed_id: \"datafeed-low_request_rate\",\n start: \"2019-04-07T18:22:16Z\",\n});" - lang: Ruby source: "response = client.ml.start_datafeed(\n datafeed_id: \"datafeed-low_request_rate\",\n body: {\n \"start\": \"2019-04-07T18:22:16Z\"\n }\n)" - lang: PHP source: "$resp = $client->ml()->startDatafeed([\n \"datafeed_id\" => \"datafeed-low_request_rate\",\n \"body\" => [\n \"start\" => \"2019-04-07T18:22:16Z\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"start":"2019-04-07T18:22:16Z"}'' "$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-low_request_rate/_start"' - lang: C# source: "var response = await client.MachineLearning\n .StartDatafeedAsync(datafeedId: \"datafeed-low_request_rate\", d1 => d1\n .Start(DateTimeOffset.Parse(\"2019-04-07T18:22:16.0000000+00:00\", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind))\n );" - lang: Java source: "client.ml().startDatafeed(s -> s\n .datafeedId(\"datafeed-low_request_rate\")\n .start(DateTime.of(\"2019-04-07T18:22:16Z\"))\n);\n" responses: '200': description: '' content: application/json: schema: required: - node - started type: object properties: node: allOf: - $ref: '#/components/schemas/_types.NodeIds' description: "The ID of the node that the job was started on. In serverless this will be the \"serverless\".\nIf the job is allowed to open lazily and has not yet been assigned to a node, this value is an empty string." started: type: boolean description: 'For a successful response, this value is always `true`. On failure, an exception is returned instead.' x-state: Generally available; Added in 5.5.0 x-codeSamples: - lang: Console source: "POST _ml/datafeeds/datafeed-low_request_rate/_start\n{\n \"start\": \"2019-04-07T18:22:16Z\"\n}" - lang: Python source: "resp = client.ml.start_datafeed(\n datafeed_id=\"datafeed-low_request_rate\",\n start=\"2019-04-07T18:22:16Z\",\n)" - lang: JavaScript source: "const response = await client.ml.startDatafeed({\n datafeed_id: \"datafeed-low_request_rate\",\n start: \"2019-04-07T18:22:16Z\",\n});" - lang: Ruby source: "response = client.ml.start_datafeed(\n datafeed_id: \"datafeed-low_request_rate\",\n body: {\n \"start\": \"2019-04-07T18:22:16Z\"\n }\n)" - lang: PHP source: "$resp = $client->ml()->startDatafeed([\n \"datafeed_id\" => \"datafeed-low_request_rate\",\n \"body\" => [\n \"start\" => \"2019-04-07T18:22:16Z\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"start":"2019-04-07T18:22:16Z"}'' "$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-low_request_rate/_start"' - lang: C# source: "var response = await client.MachineLearning\n .StartDatafeedAsync(datafeedId: \"datafeed-low_request_rate\", d1 => d1\n .Start(DateTimeOffset.Parse(\"2019-04-07T18:22:16.0000000+00:00\", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind))\n );" - lang: Java source: "client.ml().startDatafeed(s -> s\n .datafeedId(\"datafeed-low_request_rate\")\n .start(DateTime.of(\"2019-04-07T18:22:16Z\"))\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/trained_models/{model_id}/deployment/_start': post: tags: - ml trained model summary: Start a trained model deployment description: "It allocates the model to every machine learning node.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-start-trained-model-deployment parameters: - name: model_id in: path description: 'The unique identifier of the trained model. Currently, only PyTorch models are supported.' required: true schema: $ref: '#/components/schemas/_types.Id' - name: cache_size in: query description: "The inference cache size (in memory outside the JVM heap) per node for the model.\nThe default value is the same size as the `model_size_bytes`. To disable the cache,\n`0b` can be provided." schema: $ref: '#/components/schemas/_types.ByteSize' - name: deployment_id in: query description: A unique identifier for the deployment of the model. schema: type: string x-state: Generally available; Added in 8.8.0 - name: number_of_allocations in: query description: "The number of model allocations on each node where the model is deployed.\nAll allocations on a node share the same copy of the model in memory but use\na separate set of threads to evaluate the model.\nIncreasing this value generally increases the throughput.\nIf this setting is greater than the number of hardware threads\nit will automatically be changed to a value less than the number of hardware threads.\nIf adaptive_allocations is enabled, do not set this value, because it’s automatically set." schema: type: number default: 1 - name: priority in: query description: The deployment priority schema: $ref: '#/components/schemas/ml._types.TrainingPriority' - name: queue_capacity in: query description: "Specifies the number of inference requests that are allowed in the queue. After the number of requests exceeds\nthis value, new requests are rejected with a 429 error." schema: type: number default: 1024 - name: threads_per_allocation in: query description: "Sets the number of threads used by each model allocation during inference. This generally increases\nthe inference speed. The inference process is a compute-bound process; any number\ngreater than the number of available hardware threads on the machine does not increase the\ninference speed. If this setting is greater than the number of hardware threads\nit will automatically be changed to a value less than the number of hardware threads." schema: type: number default: 1 - name: timeout in: query description: Specifies the amount of time to wait for the model to deploy. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 20s - name: wait_for in: query description: "Specifies the allocation status to wait for before returning.\n\nSupported values include:\n - `started`: The trained model is started on at least one node.\n - `starting`: Trained model deployment is starting but it is not yet deployed on any nodes.\n - `fully_allocated`: Trained model deployment has started on all valid nodes.\n\n" schema: allOf: - $ref: '#/components/schemas/ml._types.DeploymentAllocationState' default: started requestBody: content: application/json: schema: type: object properties: adaptive_allocations: allOf: - $ref: '#/components/schemas/ml._types.AdaptiveAllocationsSettings' description: "Adaptive allocations configuration. When enabled, the number of allocations\nis set based on the current load.\nIf adaptive_allocations is enabled, do not set the number of allocations manually." responses: '200': description: '' content: application/json: schema: required: - assignment type: object properties: assignment: allOf: - $ref: '#/components/schemas/ml._types.TrainedModelAssignment' x-state: Generally available; Added in 8.0.0 x-codeSamples: - lang: Console source: "POST _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/_start?wait_for=started&timeout=1m\n" - lang: Python source: "resp = client.ml.start_trained_model_deployment(\n model_id=\"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n wait_for=\"started\",\n timeout=\"1m\",\n)" - lang: JavaScript source: "const response = await client.ml.startTrainedModelDeployment({\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n wait_for: \"started\",\n timeout: \"1m\",\n});" - lang: Ruby source: "response = client.ml.start_trained_model_deployment(\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n wait_for: \"started\",\n timeout: \"1m\"\n)" - lang: PHP source: "$resp = $client->ml()->startTrainedModelDeployment([\n \"model_id\" => \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n \"wait_for\" => \"started\",\n \"timeout\" => \"1m\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/_start?wait_for=started&timeout=1m"' - lang: C# source: "var response = await client.MachineLearning\n .StartTrainedModelDeploymentAsync(modelId: \"elastic__distilbert-base-uncased-finetuned-conll03-english\", d1 => d1\n .Timeout(\"1m\")\n .WaitFor(DeploymentAllocationState.Started)\n );" - lang: Java source: "client.ml().startTrainedModelDeployment(s -> s\n .modelId(\"elastic__distilbert-base-uncased-finetuned-conll03-english\")\n .timeout(t -> t\n .time(\"1m\")\n )\n .waitFor(DeploymentAllocationState.Started)\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/data_frame/analytics/{id}/_stop': post: tags: - ml data frame summary: Stop data frame analytics jobs description: "A data frame analytics job can be started and stopped multiple times\nthroughout its lifecycle.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-stop-data-frame-analytics parameters: - name: id in: path description: "Identifier for the data frame analytics job. This identifier can contain\nlowercase alphanumeric characters (a-z and 0-9), hyphens, and\nunderscores. It must start and end with alphanumeric characters." required: true schema: $ref: '#/components/schemas/_types.Id' - name: allow_no_match in: query description: "Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no data frame analytics\njobs that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is true, which returns an empty data_frame_analytics\narray when there are no matches and the subset of results when there are\npartial matches. If this parameter is false, the request returns a 404\nstatus code when there are no matches or only partial matches." schema: type: boolean default: true - name: force in: query description: 'If true, the data frame analytics job is stopped forcefully.' schema: type: boolean default: false - name: timeout in: query description: "Controls the amount of time to wait until the data frame analytics job\nstops. Defaults to 20 seconds." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 20s requestBody: content: application/json: schema: type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: 'If provided, must be the same identifier as in the path.' allow_no_match: type: boolean description: "Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no data frame analytics\njobs that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is true, which returns an empty data_frame_analytics\narray when there are no matches and the subset of results when there are\npartial matches. If this parameter is false, the request returns a 404\nstatus code when there are no matches or only partial matches." default: true force: type: boolean description: 'If true, the data frame analytics job is stopped forcefully.' default: false timeout: allOf: - $ref: '#/components/schemas/_types.Duration' description: "Controls the amount of time to wait until the data frame analytics job\nstops. Defaults to 20 seconds." default: 20s responses: '200': description: '' content: application/json: schema: required: - stopped type: object properties: stopped: type: boolean x-state: Generally available; Added in 7.3.0 x-codeSamples: - lang: Console source: "POST _ml/data_frame/analytics/loganalytics/_stop\n" - lang: Python source: "resp = client.ml.stop_data_frame_analytics(\n id=\"loganalytics\",\n)" - lang: JavaScript source: "const response = await client.ml.stopDataFrameAnalytics({\n id: \"loganalytics\",\n});" - lang: Ruby source: "response = client.ml.stop_data_frame_analytics(\n id: \"loganalytics\"\n)" - lang: PHP source: "$resp = $client->ml()->stopDataFrameAnalytics([\n \"id\" => \"loganalytics\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics/_stop"' - lang: C# source: 'var response = await client.MachineLearning.StopDataFrameAnalyticsAsync(id: "loganalytics");' - lang: Java source: "client.ml().stopDataFrameAnalytics(s -> s\n .id(\"loganalytics\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/datafeeds/{datafeed_id}/_stop': post: tags: - ml anomaly summary: Stop datafeeds description: "A datafeed that is stopped ceases to retrieve data from Elasticsearch. A datafeed can be started and stopped\nmultiple times throughout its lifecycle.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-stop-datafeed parameters: - name: datafeed_id in: path description: "Identifier for the datafeed. You can stop multiple datafeeds in a single API request by using a comma-separated\nlist of datafeeds or a wildcard expression. You can close all datafeeds by using `_all` or by specifying `*` as\nthe identifier." required: true schema: $ref: '#/components/schemas/_types.Id' - name: allow_no_match in: query description: "Specifies what to do when the request:\n\n* Contains wildcard expressions and there are no datafeeds that match.\n* Contains the `_all` string or no identifiers and there are no matches.\n* Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the API returns an empty datafeeds array when there are no matches and the subset of results when\nthere are partial matches. If `false`, the API returns a 404 status code when there are no matches or only\npartial matches." schema: type: boolean default: true - name: force in: query description: 'If `true`, the datafeed is stopped forcefully.' schema: type: boolean default: false - name: timeout in: query description: Specifies the amount of time to wait until a datafeed stops. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 20s - name: close_job in: query description: If `true` the job associated with the datafeed is closed. schema: type: boolean default: false requestBody: content: application/json: schema: type: object properties: allow_no_match: type: boolean description: Refer to the description for the `allow_no_match` query parameter. default: true force: type: boolean description: Refer to the description for the `force` query parameter. default: false timeout: allOf: - $ref: '#/components/schemas/_types.Duration' description: Refer to the description for the `timeout` query parameter. default: 20s close_job: type: boolean description: Refer to the description for the `close_job` query parameter. default: false examples: MlStopDatafeedExample1: description: An example body for a `POST _ml/datafeeds/datafeed-low_request_rate/_stop` request. value: "{\n \"timeout\": \"30s\"\n}" x-codeSamples: - lang: Console source: "POST _ml/datafeeds/datafeed-low_request_rate/_stop\n{\n \"timeout\": \"30s\"\n}" - lang: Python source: "resp = client.ml.stop_datafeed(\n datafeed_id=\"datafeed-low_request_rate\",\n timeout=\"30s\",\n)" - lang: JavaScript source: "const response = await client.ml.stopDatafeed({\n datafeed_id: \"datafeed-low_request_rate\",\n timeout: \"30s\",\n});" - lang: Ruby source: "response = client.ml.stop_datafeed(\n datafeed_id: \"datafeed-low_request_rate\",\n body: {\n \"timeout\": \"30s\"\n }\n)" - lang: PHP source: "$resp = $client->ml()->stopDatafeed([\n \"datafeed_id\" => \"datafeed-low_request_rate\",\n \"body\" => [\n \"timeout\" => \"30s\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"timeout":"30s"}'' "$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-low_request_rate/_stop"' - lang: C# source: "var response = await client.MachineLearning\n .StopDatafeedAsync(datafeedId: \"datafeed-low_request_rate\", d1 => d1\n .Timeout(\"30s\")\n );" - lang: Java source: "client.ml().stopDatafeed(s -> s\n .datafeedId(\"datafeed-low_request_rate\")\n .timeout(t -> t\n .time(\"30s\")\n )\n);\n" responses: '200': description: '' content: application/json: schema: required: - stopped type: object properties: stopped: type: boolean x-state: Generally available; Added in 5.4.0 x-codeSamples: - lang: Console source: "POST _ml/datafeeds/datafeed-low_request_rate/_stop\n{\n \"timeout\": \"30s\"\n}" - lang: Python source: "resp = client.ml.stop_datafeed(\n datafeed_id=\"datafeed-low_request_rate\",\n timeout=\"30s\",\n)" - lang: JavaScript source: "const response = await client.ml.stopDatafeed({\n datafeed_id: \"datafeed-low_request_rate\",\n timeout: \"30s\",\n});" - lang: Ruby source: "response = client.ml.stop_datafeed(\n datafeed_id: \"datafeed-low_request_rate\",\n body: {\n \"timeout\": \"30s\"\n }\n)" - lang: PHP source: "$resp = $client->ml()->stopDatafeed([\n \"datafeed_id\" => \"datafeed-low_request_rate\",\n \"body\" => [\n \"timeout\" => \"30s\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"timeout":"30s"}'' "$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-low_request_rate/_stop"' - lang: C# source: "var response = await client.MachineLearning\n .StopDatafeedAsync(datafeedId: \"datafeed-low_request_rate\", d1 => d1\n .Timeout(\"30s\")\n );" - lang: Java source: "client.ml().stopDatafeed(s -> s\n .datafeedId(\"datafeed-low_request_rate\")\n .timeout(t -> t\n .time(\"30s\")\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/trained_models/{model_id}/deployment/_stop': post: tags: - ml trained model summary: Stop a trained model deployment description: "\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-stop-trained-model-deployment parameters: - name: model_id in: path description: The unique identifier of the trained model. required: true schema: $ref: '#/components/schemas/_types.Id' - name: allow_no_match in: query description: "Specifies what to do when the request: contains wildcard expressions and there are no deployments that match;\ncontains the `_all` string or no identifiers and there are no matches; or contains wildcard expressions and\nthere are only partial matches. By default, it returns an empty array when there are no matches and the subset of results when there are partial matches.\nIf `false`, the request returns a 404 status code when there are no matches or only partial matches." schema: type: boolean default: true - name: force in: query description: "Forcefully stops the deployment, even if it is used by ingest pipelines. You can't use these pipelines until you\nrestart the model deployment." schema: type: boolean default: false requestBody: content: application/json: schema: type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: 'If provided, must be the same identifier as in the path.' allow_no_match: type: boolean description: "Specifies what to do when the request: contains wildcard expressions and there are no deployments that match;\ncontains the `_all` string or no identifiers and there are no matches; or contains wildcard expressions and\nthere are only partial matches. By default, it returns an empty array when there are no matches and the subset of results when there are partial matches.\nIf `false`, the request returns a 404 status code when there are no matches or only partial matches." default: true force: type: boolean description: "Forcefully stops the deployment, even if it is used by ingest pipelines. You can't use these pipelines until you\nrestart the model deployment." default: false responses: '200': description: '' content: application/json: schema: required: - stopped type: object properties: stopped: type: boolean x-state: Generally available; Added in 8.0.0 x-codeSamples: - lang: Console source: "POST _ml/trained_models/my_model_for_search/deployment/_stop\n" - lang: Python source: "resp = client.ml.stop_trained_model_deployment(\n model_id=\"my_model_for_search\",\n)" - lang: JavaScript source: "const response = await client.ml.stopTrainedModelDeployment({\n model_id: \"my_model_for_search\",\n});" - lang: Ruby source: "response = client.ml.stop_trained_model_deployment(\n model_id: \"my_model_for_search\"\n)" - lang: PHP source: "$resp = $client->ml()->stopTrainedModelDeployment([\n \"model_id\" => \"my_model_for_search\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/trained_models/my_model_for_search/deployment/_stop"' - lang: C# source: 'var response = await client.MachineLearning.StopTrainedModelDeploymentAsync(modelId: "my_model_for_search");' - lang: Java source: "client.ml().stopTrainedModelDeployment(s -> s\n .modelId(\"my_model_for_search\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/data_frame/analytics/{id}/_update': post: tags: - ml data frame summary: Update a data frame analytics job description: "\n\n## Required authorization\n\n* Index privileges: `read`,`create_index`,`manage`,`index`,`view_index_metadata`\n* Cluster privileges: `manage_ml`\n" operationId: ml-update-data-frame-analytics parameters: - name: id in: path description: "Identifier for the data frame analytics job. This identifier can contain\nlowercase alphanumeric characters (a-z and 0-9), hyphens, and\nunderscores. It must start and end with alphanumeric characters." required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: type: object properties: description: type: string description: A description of the job. model_memory_limit: type: string description: "The approximate maximum amount of memory resources that are permitted for\nanalytical processing. If your `elasticsearch.yml` file contains an\n`xpack.ml.max_model_memory_limit` setting, an error occurs when you try\nto create data frame analytics jobs that have `model_memory_limit` values\ngreater than that setting." default: 1gb max_num_threads: type: number description: "The maximum number of threads to be used by the analysis. Using more\nthreads may decrease the time necessary to complete the analysis at the\ncost of using more CPU. Note that the process may use additional threads\nfor operational functionality other than the analysis itself." default: 1 allow_lazy_start: type: boolean description: "Specifies whether this job can start when there is insufficient machine\nlearning node capacity for it to be immediately assigned to a node." default: false examples: MlUpdateDataFrameAnalyticsExample1: description: An example body for a `POST _ml/data_frame/analytics/loganalytics/_update` request. value: "{\n \"model_memory_limit\": \"200mb\"\n}" x-codeSamples: - lang: Console source: "POST _ml/data_frame/analytics/loganalytics/_update\n{\n \"model_memory_limit\": \"200mb\"\n}" - lang: Python source: "resp = client.ml.update_data_frame_analytics(\n id=\"loganalytics\",\n model_memory_limit=\"200mb\",\n)" - lang: JavaScript source: "const response = await client.ml.updateDataFrameAnalytics({\n id: \"loganalytics\",\n model_memory_limit: \"200mb\",\n});" - lang: Ruby source: "response = client.ml.update_data_frame_analytics(\n id: \"loganalytics\",\n body: {\n \"model_memory_limit\": \"200mb\"\n }\n)" - lang: PHP source: "$resp = $client->ml()->updateDataFrameAnalytics([\n \"id\" => \"loganalytics\",\n \"body\" => [\n \"model_memory_limit\" => \"200mb\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"model_memory_limit":"200mb"}'' "$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics/_update"' - lang: C# source: "var response = await client.MachineLearning\n .UpdateDataFrameAnalyticsAsync(id: \"loganalytics\", d1 => d1\n .ModelMemoryLimit(\"200mb\")\n );" - lang: Java source: "client.ml().updateDataFrameAnalytics(u -> u\n .id(\"loganalytics\")\n .modelMemoryLimit(\"200mb\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - allow_lazy_start - analysis - create_time - dest - id - max_num_threads - model_memory_limit - source - version type: object properties: authorization: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalyticsAuthorization' allow_lazy_start: type: boolean analysis: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalysisContainer' analyzed_fields: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalysisAnalyzedFields' create_time: type: number description: type: string dest: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalyticsDestination' id: allOf: - $ref: '#/components/schemas/_types.Id' max_num_threads: type: number model_memory_limit: type: string source: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalyticsSource' version: allOf: - $ref: '#/components/schemas/_types.VersionString' x-state: Generally available; Added in 7.3.0 x-codeSamples: - lang: Console source: "POST _ml/data_frame/analytics/loganalytics/_update\n{\n \"model_memory_limit\": \"200mb\"\n}" - lang: Python source: "resp = client.ml.update_data_frame_analytics(\n id=\"loganalytics\",\n model_memory_limit=\"200mb\",\n)" - lang: JavaScript source: "const response = await client.ml.updateDataFrameAnalytics({\n id: \"loganalytics\",\n model_memory_limit: \"200mb\",\n});" - lang: Ruby source: "response = client.ml.update_data_frame_analytics(\n id: \"loganalytics\",\n body: {\n \"model_memory_limit\": \"200mb\"\n }\n)" - lang: PHP source: "$resp = $client->ml()->updateDataFrameAnalytics([\n \"id\" => \"loganalytics\",\n \"body\" => [\n \"model_memory_limit\" => \"200mb\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"model_memory_limit":"200mb"}'' "$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics/_update"' - lang: C# source: "var response = await client.MachineLearning\n .UpdateDataFrameAnalyticsAsync(id: \"loganalytics\", d1 => d1\n .ModelMemoryLimit(\"200mb\")\n );" - lang: Java source: "client.ml().updateDataFrameAnalytics(u -> u\n .id(\"loganalytics\")\n .modelMemoryLimit(\"200mb\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/datafeeds/{datafeed_id}/_update': post: tags: - ml anomaly summary: Update a datafeed description: "You must stop and start the datafeed for the changes to be applied.\nWhen Elasticsearch security features are enabled, your datafeed remembers which roles the user who updated it had at\nthe time of the update and runs the query using those same roles. If you provide secondary authorization headers,\nthose credentials are used instead.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-update-datafeed parameters: - name: datafeed_id in: path description: "A numerical character string that uniquely identifies the datafeed.\nThis identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.\nIt must start and end with alphanumeric characters." required: true schema: $ref: '#/components/schemas/_types.Id' - name: allow_no_indices in: query description: "A setting that does two separate checks on the index expression.\nIf `false`, the request returns an error (1) if any wildcard expression\n(including `_all` and `*`) resolves to zero matching indices or (2) if the\ncomplete set of resolved indices, aliases or data streams is empty after all\nexpressions are evaluated. If `true`, index expressions that resolve to no\nindices are allowed and the request returns an empty result." schema: type: boolean default: true - name: expand_wildcards in: query description: "Type of index that wildcard patterns can match. If the request can target data streams, this argument determines\nwhether wildcard expressions match hidden data streams. Supports comma-separated values.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: open - name: ignore_throttled in: query description: 'If `true`, concrete, expanded or aliased indices are ignored when frozen.' deprecated: true schema: type: boolean default: true - name: ignore_unavailable in: query description: "If `false`, the request returns an error if it targets a concrete (non-wildcarded)\nindex, alias, or data stream that is missing, closed, or otherwise unavailable.\nIf `true`, unavailable concrete targets are silently ignored." schema: type: boolean default: false requestBody: content: application/json: schema: type: object properties: aggregations: type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.AggregationContainer' description: "If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only\nwith low cardinality data." chunking_config: allOf: - $ref: '#/components/schemas/ml._types.ChunkingConfig' description: "Datafeeds might search over long time periods, for several months or years. This search is split into time\nchunks in order to ensure the load on Elasticsearch is managed. Chunking configuration controls how the size of\nthese time chunks are calculated; it is an advanced configuration option." delayed_data_check_config: allOf: - $ref: '#/components/schemas/ml._types.DelayedDataCheckConfig' description: "Specifies whether the datafeed checks for missing data and the size of the window. The datafeed can optionally\nsearch over indices that have already been read in an effort to determine whether any data has subsequently been\nadded to the index. If missing data is found, it is a good indication that the `query_delay` is set too low and\nthe data is being indexed after the datafeed has passed that moment in time. This check runs only on real-time\ndatafeeds." frequency: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The interval at which scheduled queries are made while the datafeed runs in real time. The default value is\neither the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket\nspan. When `frequency` is shorter than the bucket span, interim results for the last (partial) bucket are\nwritten then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value\nmust be divisible by the interval of the date histogram aggregation." indices: type: array items: type: string description: "An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine\nlearning nodes must have the `remote_cluster_client` role." indices_options: allOf: - $ref: '#/components/schemas/_types.IndicesOptions' description: Specifies index expansion options that are used during search. job_id: allOf: - $ref: '#/components/schemas/_types.Id' max_empty_searches: type: number description: "If a real-time datafeed has never seen any data (including during any initial training period), it automatically\nstops and closes the associated job after this many real-time searches return no documents. In other words,\nit stops after `frequency` times `max_empty_searches` of real-time operation. If not set, a datafeed with no\nend time that sees no data remains started until it is explicitly stopped. By default, it is not set." max_consecutive_extraction_failures: type: number description: "The maximum number of consecutive real-time data extraction failures the datafeed tolerates before it\nautomatically stops itself, leaving the associated job open. The consecutive-failure counter resets on any\ncycle that extracts successfully, including empty-data cycles. If not set, the threshold defaults to roughly\none day's worth of searches based on the datafeed `frequency` (floored at 1). Set to `-1` to disable auto-stop\nand retry indefinitely. Values of `0` or less than `-1` are rejected." query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: "The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an\nElasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this\nobject is passed verbatim to Elasticsearch. Note that if you change the query, the analyzed data is also\nchanged. Therefore, the time required to learn might be long and the understandability of the results is\nunpredictable. If you want to make significant changes to the source data, it is recommended that you\nclone the job and datafeed and make the amendments in the clone. Let both run in parallel and close one\nwhen you are satisfied with the results of the job." default: '{"match_all": {"boost": 1}}' query_delay: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might\nnot be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default\nvalue is randomly selected between `60s` and `120s`. This randomness improves the query performance\nwhen there are multiple jobs running on the same node." runtime_mappings: allOf: - $ref: '#/components/schemas/_types.mapping.RuntimeFields' description: Specifies runtime fields for the datafeed search. script_fields: type: object additionalProperties: $ref: '#/components/schemas/_types.ScriptField' description: "Specifies scripts that evaluate custom expressions and returns script fields to the datafeed.\nThe detector configuration objects in a job can contain functions that use these script fields." scroll_size: type: number description: "The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations.\nThe maximum value is the value of `index.max_result_window`." default: 1000 examples: MlUpdateDatafeedExample1: description: An example body for a `POST _ml/datafeeds/datafeed-test-job/_update` request. value: "{\n \"query\": {\n \"term\": {\n \"geo.src\": \"US\"\n }\n }\n}" x-codeSamples: - lang: Console source: "POST _ml/datafeeds/datafeed-test-job/_update\n{\n \"query\": {\n \"term\": {\n \"geo.src\": \"US\"\n }\n }\n}" - lang: Python source: "resp = client.ml.update_datafeed(\n datafeed_id=\"datafeed-test-job\",\n query={\n \"term\": {\n \"geo.src\": \"US\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.ml.updateDatafeed({\n datafeed_id: \"datafeed-test-job\",\n query: {\n term: {\n \"geo.src\": \"US\",\n },\n },\n});" - lang: Ruby source: "response = client.ml.update_datafeed(\n datafeed_id: \"datafeed-test-job\",\n body: {\n \"query\": {\n \"term\": {\n \"geo.src\": \"US\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->ml()->updateDatafeed([\n \"datafeed_id\" => \"datafeed-test-job\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"geo.src\" => \"US\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":{"term":{"geo.src":"US"}}}'' "$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-test-job/_update"' - lang: C# source: "var response = await client.MachineLearning\n .UpdateDatafeedAsync(datafeedId: \"datafeed-test-job\", d1 => d1\n .Query(d2 => d2\n .Term(d3 => d3\n .Field(x => x.Geo.Src)\n .Value(\"US\")\n )\n )\n );" - lang: Java source: "client.ml().updateDatafeed(u -> u\n .datafeedId(\"datafeed-test-job\")\n .query(q -> q\n .term(t -> t\n .field(\"geo.src\")\n .value(FieldValue.of(\"US\"))\n )\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - chunking_config - datafeed_id - indices - job_id - query - query_delay - scroll_size type: object properties: authorization: allOf: - $ref: '#/components/schemas/ml._types.DatafeedAuthorization' aggregations: type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.AggregationContainer' chunking_config: allOf: - $ref: '#/components/schemas/ml._types.ChunkingConfig' delayed_data_check_config: allOf: - $ref: '#/components/schemas/ml._types.DelayedDataCheckConfig' datafeed_id: allOf: - $ref: '#/components/schemas/_types.Id' frequency: allOf: - $ref: '#/components/schemas/_types.Duration' description: 'The interval at which scheduled queries are made while the datafeed runs in real time. The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket span. For example: `150s`. When `frequency` is shorter than the bucket span, interim results for the last (partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value must be divisible by the interval of the date histogram aggregation.' indices: type: array items: type: string indices_options: allOf: - $ref: '#/components/schemas/_types.IndicesOptions' job_id: allOf: - $ref: '#/components/schemas/_types.Id' max_empty_searches: type: number max_consecutive_extraction_failures: type: number query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' query_delay: allOf: - $ref: '#/components/schemas/_types.Duration' runtime_mappings: allOf: - $ref: '#/components/schemas/_types.mapping.RuntimeFields' script_fields: type: object additionalProperties: $ref: '#/components/schemas/_types.ScriptField' scroll_size: type: number x-state: Generally available; Added in 6.4.0 x-codeSamples: - lang: Console source: "POST _ml/datafeeds/datafeed-test-job/_update\n{\n \"query\": {\n \"term\": {\n \"geo.src\": \"US\"\n }\n }\n}" - lang: Python source: "resp = client.ml.update_datafeed(\n datafeed_id=\"datafeed-test-job\",\n query={\n \"term\": {\n \"geo.src\": \"US\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.ml.updateDatafeed({\n datafeed_id: \"datafeed-test-job\",\n query: {\n term: {\n \"geo.src\": \"US\",\n },\n },\n});" - lang: Ruby source: "response = client.ml.update_datafeed(\n datafeed_id: \"datafeed-test-job\",\n body: {\n \"query\": {\n \"term\": {\n \"geo.src\": \"US\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->ml()->updateDatafeed([\n \"datafeed_id\" => \"datafeed-test-job\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"geo.src\" => \"US\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":{"term":{"geo.src":"US"}}}'' "$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-test-job/_update"' - lang: C# source: "var response = await client.MachineLearning\n .UpdateDatafeedAsync(datafeedId: \"datafeed-test-job\", d1 => d1\n .Query(d2 => d2\n .Term(d3 => d3\n .Field(x => x.Geo.Src)\n .Value(\"US\")\n )\n )\n );" - lang: Java source: "client.ml().updateDatafeed(u -> u\n .datafeedId(\"datafeed-test-job\")\n .query(q -> q\n .term(t -> t\n .field(\"geo.src\")\n .value(FieldValue.of(\"US\"))\n )\n )\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/filters/{filter_id}/_update': post: tags: - ml anomaly summary: Update a filter description: "Updates the description of a filter, adds items, or removes items from the list.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-update-filter parameters: - name: filter_id in: path description: A string that uniquely identifies a filter. required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: type: object properties: add_items: type: array items: type: string description: The items to add to the filter. description: type: string description: A description for the filter. remove_items: type: array items: type: string description: The items to remove from the filter. examples: MlUpdateFilterExample1: description: An example body for a `POST _ml/filters/safe_domains/_update` request. value: "{\n \"description\": \"Updated list of domains\",\n \"add_items\": [\"*.myorg.com\"],\n \"remove_items\": [\"wikipedia.org\"]\n}" x-codeSamples: - lang: Console source: "POST _ml/filters/safe_domains/_update\n{\n \"description\": \"Updated list of domains\",\n \"add_items\": [\"*.myorg.com\"],\n \"remove_items\": [\"wikipedia.org\"]\n}" - lang: Python source: "resp = client.ml.update_filter(\n filter_id=\"safe_domains\",\n description=\"Updated list of domains\",\n add_items=[\n \"*.myorg.com\"\n ],\n remove_items=[\n \"wikipedia.org\"\n ],\n)" - lang: JavaScript source: "const response = await client.ml.updateFilter({\n filter_id: \"safe_domains\",\n description: \"Updated list of domains\",\n add_items: [\"*.myorg.com\"],\n remove_items: [\"wikipedia.org\"],\n});" - lang: Ruby source: "response = client.ml.update_filter(\n filter_id: \"safe_domains\",\n body: {\n \"description\": \"Updated list of domains\",\n \"add_items\": [\n \"*.myorg.com\"\n ],\n \"remove_items\": [\n \"wikipedia.org\"\n ]\n }\n)" - lang: PHP source: "$resp = $client->ml()->updateFilter([\n \"filter_id\" => \"safe_domains\",\n \"body\" => [\n \"description\" => \"Updated list of domains\",\n \"add_items\" => array(\n \"*.myorg.com\",\n ),\n \"remove_items\" => array(\n \"wikipedia.org\",\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"description":"Updated list of domains","add_items":["*.myorg.com"],"remove_items":["wikipedia.org"]}'' "$ELASTICSEARCH_URL/_ml/filters/safe_domains/_update"' - lang: C# source: "var response = await client.MachineLearning\n .UpdateFilterAsync(filterId: \"safe_domains\", d1 => d1\n .AddItems(\"*.myorg.com\")\n .Description(\"Updated list of domains\")\n .RemoveItems(\"wikipedia.org\")\n );" - lang: Java source: "client.ml().updateFilter(u -> u\n .addItems(\"*.myorg.com\")\n .description(\"Updated list of domains\")\n .filterId(\"safe_domains\")\n .removeItems(\"wikipedia.org\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - description - filter_id - items type: object properties: description: type: string filter_id: allOf: - $ref: '#/components/schemas/_types.Id' items: type: array items: type: string x-state: Generally available; Added in 6.4.0 x-codeSamples: - lang: Console source: "POST _ml/filters/safe_domains/_update\n{\n \"description\": \"Updated list of domains\",\n \"add_items\": [\"*.myorg.com\"],\n \"remove_items\": [\"wikipedia.org\"]\n}" - lang: Python source: "resp = client.ml.update_filter(\n filter_id=\"safe_domains\",\n description=\"Updated list of domains\",\n add_items=[\n \"*.myorg.com\"\n ],\n remove_items=[\n \"wikipedia.org\"\n ],\n)" - lang: JavaScript source: "const response = await client.ml.updateFilter({\n filter_id: \"safe_domains\",\n description: \"Updated list of domains\",\n add_items: [\"*.myorg.com\"],\n remove_items: [\"wikipedia.org\"],\n});" - lang: Ruby source: "response = client.ml.update_filter(\n filter_id: \"safe_domains\",\n body: {\n \"description\": \"Updated list of domains\",\n \"add_items\": [\n \"*.myorg.com\"\n ],\n \"remove_items\": [\n \"wikipedia.org\"\n ]\n }\n)" - lang: PHP source: "$resp = $client->ml()->updateFilter([\n \"filter_id\" => \"safe_domains\",\n \"body\" => [\n \"description\" => \"Updated list of domains\",\n \"add_items\" => array(\n \"*.myorg.com\",\n ),\n \"remove_items\" => array(\n \"wikipedia.org\",\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"description":"Updated list of domains","add_items":["*.myorg.com"],"remove_items":["wikipedia.org"]}'' "$ELASTICSEARCH_URL/_ml/filters/safe_domains/_update"' - lang: C# source: "var response = await client.MachineLearning\n .UpdateFilterAsync(filterId: \"safe_domains\", d1 => d1\n .AddItems(\"*.myorg.com\")\n .Description(\"Updated list of domains\")\n .RemoveItems(\"wikipedia.org\")\n );" - lang: Java source: "client.ml().updateFilter(u -> u\n .addItems(\"*.myorg.com\")\n .description(\"Updated list of domains\")\n .filterId(\"safe_domains\")\n .removeItems(\"wikipedia.org\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/anomaly_detectors/{job_id}/_update': post: tags: - ml anomaly summary: Update an anomaly detection job description: "Updates certain properties of an anomaly detection job.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-update-job parameters: - name: job_id in: path description: Identifier for the job. required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: type: object properties: allow_lazy_open: type: boolean description: "Advanced configuration option. Specifies whether this job can open when\nthere is insufficient machine learning node capacity for it to be\nimmediately assigned to a node. If `false` and a machine learning node\nwith capacity to run the job cannot immediately be found, the open\nanomaly detection jobs API returns an error. However, this is also\nsubject to the cluster-wide `xpack.ml.max_lazy_ml_nodes` setting. If this\noption is set to `true`, the open anomaly detection jobs API does not\nreturn an error and the job waits in the opening state until sufficient\nmachine learning node capacity is available." default: false analysis_limits: allOf: - $ref: '#/components/schemas/ml._types.AnalysisMemoryLimit' background_persist_interval: allOf: - $ref: '#/components/schemas/_types.Duration' description: "Advanced configuration option. The time between each periodic persistence\nof the model.\nThe default value is a randomized value between 3 to 4 hours, which\navoids all jobs persisting at exactly the same time. The smallest allowed\nvalue is 1 hour.\nFor very large models (several GB), persistence could take 10-20 minutes,\nso do not set the value too low.\nIf the job is open when you make the update, you must stop the datafeed,\nclose the job, then reopen the job and restart the datafeed for the\nchanges to take effect." custom_settings: type: object additionalProperties: type: object description: "Advanced configuration option. Contains custom meta data about the job.\nFor example, it can contain custom URL information as shown in Adding\ncustom URLs to machine learning results." categorization_filters: type: array items: type: string description: type: string description: A description of the job. model_plot_config: allOf: - $ref: '#/components/schemas/ml._types.ModelPlotConfig' model_prune_window: allOf: - $ref: '#/components/schemas/_types.Duration' daily_model_snapshot_retention_after_days: type: number description: "Advanced configuration option, which affects the automatic removal of old\nmodel snapshots for this job. It specifies a period of time (in days)\nafter which only the first snapshot per day is retained. This period is\nrelative to the timestamp of the most recent snapshot for this job. Valid\nvalues range from 0 to `model_snapshot_retention_days`. For jobs created\nbefore version 7.8.0, the default value matches\n`model_snapshot_retention_days`." default: 1 model_snapshot_retention_days: type: number description: "Advanced configuration option, which affects the automatic removal of old\nmodel snapshots for this job. It specifies the maximum period of time (in\ndays) that snapshots are retained. This period is relative to the\ntimestamp of the most recent snapshot for this job." default: 10 renormalization_window_days: type: number description: "Advanced configuration option. The period over which adjustments to the\nscore are applied, as new data is seen." results_retention_days: type: number description: "Advanced configuration option. The period of time (in days) that results\nare retained. Age is calculated relative to the timestamp of the latest\nbucket result. If this property has a non-null value, once per day at\n00:30 (server time), results that are the specified number of days older\nthan the latest bucket result are deleted from Elasticsearch. The default\nvalue is null, which means all results are retained." groups: type: array items: type: string description: A list of job groups. A job can belong to no groups or many. detectors: oneOf: - $ref: '#/components/schemas/ml._types.DetectorUpdate' - type: array items: $ref: '#/components/schemas/ml._types.DetectorUpdate' description: A detector update object or an array of detector update objects. per_partition_categorization: allOf: - $ref: '#/components/schemas/ml._types.PerPartitionCategorization' description: Settings related to how categorization interacts with partition fields. examples: MlUpdateJobExample1: description: An example body for a `POST _ml/anomaly_detectors/low_request_rate/_update` request. value: "{\n \"description\":\"An updated job\",\n \"detectors\": {\n \"detector_index\": 0,\n \"description\": \"An updated detector description\"\n },\n \"groups\": [\"kibana_sample_data\",\"kibana_sample_web_logs\"],\n \"model_plot_config\": {\n \"enabled\": true\n },\n \"renormalization_window_days\": 30,\n \"background_persist_interval\": \"2h\",\n \"model_snapshot_retention_days\": 7,\n \"results_retention_days\": 60\n}" x-codeSamples: - lang: Console source: "POST _ml/anomaly_detectors/low_request_rate/_update\n{\n \"description\":\"An updated job\",\n \"detectors\": {\n \"detector_index\": 0,\n \"description\": \"An updated detector description\"\n },\n \"groups\": [\"kibana_sample_data\",\"kibana_sample_web_logs\"],\n \"model_plot_config\": {\n \"enabled\": true\n },\n \"renormalization_window_days\": 30,\n \"background_persist_interval\": \"2h\",\n \"model_snapshot_retention_days\": 7,\n \"results_retention_days\": 60\n}" - lang: Python source: "resp = client.ml.update_job(\n job_id=\"low_request_rate\",\n description=\"An updated job\",\n detectors={\n \"detector_index\": 0,\n \"description\": \"An updated detector description\"\n },\n groups=[\n \"kibana_sample_data\",\n \"kibana_sample_web_logs\"\n ],\n model_plot_config={\n \"enabled\": True\n },\n renormalization_window_days=30,\n background_persist_interval=\"2h\",\n model_snapshot_retention_days=7,\n results_retention_days=60,\n)" - lang: JavaScript source: "const response = await client.ml.updateJob({\n job_id: \"low_request_rate\",\n description: \"An updated job\",\n detectors: {\n detector_index: 0,\n description: \"An updated detector description\",\n },\n groups: [\"kibana_sample_data\", \"kibana_sample_web_logs\"],\n model_plot_config: {\n enabled: true,\n },\n renormalization_window_days: 30,\n background_persist_interval: \"2h\",\n model_snapshot_retention_days: 7,\n results_retention_days: 60,\n});" - lang: Ruby source: "response = client.ml.update_job(\n job_id: \"low_request_rate\",\n body: {\n \"description\": \"An updated job\",\n \"detectors\": {\n \"detector_index\": 0,\n \"description\": \"An updated detector description\"\n },\n \"groups\": [\n \"kibana_sample_data\",\n \"kibana_sample_web_logs\"\n ],\n \"model_plot_config\": {\n \"enabled\": true\n },\n \"renormalization_window_days\": 30,\n \"background_persist_interval\": \"2h\",\n \"model_snapshot_retention_days\": 7,\n \"results_retention_days\": 60\n }\n)" - lang: PHP source: "$resp = $client->ml()->updateJob([\n \"job_id\" => \"low_request_rate\",\n \"body\" => [\n \"description\" => \"An updated job\",\n \"detectors\" => [\n \"detector_index\" => 0,\n \"description\" => \"An updated detector description\",\n ],\n \"groups\" => array(\n \"kibana_sample_data\",\n \"kibana_sample_web_logs\",\n ),\n \"model_plot_config\" => [\n \"enabled\" => true,\n ],\n \"renormalization_window_days\" => 30,\n \"background_persist_interval\" => \"2h\",\n \"model_snapshot_retention_days\" => 7,\n \"results_retention_days\" => 60,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"description":"An updated job","detectors":{"detector_index":0,"description":"An updated detector description"},"groups":["kibana_sample_data","kibana_sample_web_logs"],"model_plot_config":{"enabled":true},"renormalization_window_days":30,"background_persist_interval":"2h","model_snapshot_retention_days":7,"results_retention_days":60}'' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/_update"' - lang: C# source: "var response = await client.MachineLearning\n .UpdateJobAsync(jobId: \"low_request_rate\", d1 => d1\n .BackgroundPersistInterval(\"2h\")\n .Description(\"An updated job\")\n .Detectors(d2 => d2\n .Description(\"An updated detector description\")\n .DetectorIndex(0)\n )\n .Groups(\"kibana_sample_data\", \"kibana_sample_web_logs\")\n .ModelPlotConfig(d2 => d2\n .Enabled(true)\n )\n .ModelSnapshotRetentionDays(7L)\n .RenormalizationWindowDays(30L)\n .ResultsRetentionDays(60L)\n );" - lang: Java source: "client.ml().updateJob(u -> u\n .backgroundPersistInterval(b -> b\n .time(\"2h\")\n )\n .description(\"An updated job\")\n .detectors(d -> d\n .detectorIndex(0)\n .description(\"An updated detector description\")\n )\n .groups(List.of(\"kibana_sample_data\",\"kibana_sample_web_logs\"))\n .jobId(\"low_request_rate\")\n .modelPlotConfig(m -> m\n .enabled(true)\n )\n .modelSnapshotRetentionDays(7L)\n .renormalizationWindowDays(30L)\n .resultsRetentionDays(60L)\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - allow_lazy_open - analysis_config - analysis_limits - create_time - daily_model_snapshot_retention_after_days - data_description - job_id - job_type - job_version - model_snapshot_retention_days - results_index_name type: object properties: allow_lazy_open: type: boolean analysis_config: allOf: - $ref: '#/components/schemas/ml._types.AnalysisConfigRead' analysis_limits: allOf: - $ref: '#/components/schemas/ml._types.AnalysisLimits' background_persist_interval: allOf: - $ref: '#/components/schemas/_types.Duration' create_time: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' finished_time: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' custom_settings: type: object additionalProperties: type: string daily_model_snapshot_retention_after_days: type: number data_description: allOf: - $ref: '#/components/schemas/ml._types.DataDescription' datafeed_config: allOf: - $ref: '#/components/schemas/ml._types.Datafeed' description: type: string groups: type: array items: type: string job_id: allOf: - $ref: '#/components/schemas/_types.Id' job_type: type: string job_version: allOf: - $ref: '#/components/schemas/_types.VersionString' model_plot_config: allOf: - $ref: '#/components/schemas/ml._types.ModelPlotConfig' model_snapshot_id: allOf: - $ref: '#/components/schemas/_types.Id' model_snapshot_retention_days: type: number renormalization_window_days: type: number results_index_name: allOf: - $ref: '#/components/schemas/_types.IndexName' results_retention_days: type: number x-state: Generally available; Added in 5.5.0 x-codeSamples: - lang: Console source: "POST _ml/anomaly_detectors/low_request_rate/_update\n{\n \"description\":\"An updated job\",\n \"detectors\": {\n \"detector_index\": 0,\n \"description\": \"An updated detector description\"\n },\n \"groups\": [\"kibana_sample_data\",\"kibana_sample_web_logs\"],\n \"model_plot_config\": {\n \"enabled\": true\n },\n \"renormalization_window_days\": 30,\n \"background_persist_interval\": \"2h\",\n \"model_snapshot_retention_days\": 7,\n \"results_retention_days\": 60\n}" - lang: Python source: "resp = client.ml.update_job(\n job_id=\"low_request_rate\",\n description=\"An updated job\",\n detectors={\n \"detector_index\": 0,\n \"description\": \"An updated detector description\"\n },\n groups=[\n \"kibana_sample_data\",\n \"kibana_sample_web_logs\"\n ],\n model_plot_config={\n \"enabled\": True\n },\n renormalization_window_days=30,\n background_persist_interval=\"2h\",\n model_snapshot_retention_days=7,\n results_retention_days=60,\n)" - lang: JavaScript source: "const response = await client.ml.updateJob({\n job_id: \"low_request_rate\",\n description: \"An updated job\",\n detectors: {\n detector_index: 0,\n description: \"An updated detector description\",\n },\n groups: [\"kibana_sample_data\", \"kibana_sample_web_logs\"],\n model_plot_config: {\n enabled: true,\n },\n renormalization_window_days: 30,\n background_persist_interval: \"2h\",\n model_snapshot_retention_days: 7,\n results_retention_days: 60,\n});" - lang: Ruby source: "response = client.ml.update_job(\n job_id: \"low_request_rate\",\n body: {\n \"description\": \"An updated job\",\n \"detectors\": {\n \"detector_index\": 0,\n \"description\": \"An updated detector description\"\n },\n \"groups\": [\n \"kibana_sample_data\",\n \"kibana_sample_web_logs\"\n ],\n \"model_plot_config\": {\n \"enabled\": true\n },\n \"renormalization_window_days\": 30,\n \"background_persist_interval\": \"2h\",\n \"model_snapshot_retention_days\": 7,\n \"results_retention_days\": 60\n }\n)" - lang: PHP source: "$resp = $client->ml()->updateJob([\n \"job_id\" => \"low_request_rate\",\n \"body\" => [\n \"description\" => \"An updated job\",\n \"detectors\" => [\n \"detector_index\" => 0,\n \"description\" => \"An updated detector description\",\n ],\n \"groups\" => array(\n \"kibana_sample_data\",\n \"kibana_sample_web_logs\",\n ),\n \"model_plot_config\" => [\n \"enabled\" => true,\n ],\n \"renormalization_window_days\" => 30,\n \"background_persist_interval\" => \"2h\",\n \"model_snapshot_retention_days\" => 7,\n \"results_retention_days\" => 60,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"description":"An updated job","detectors":{"detector_index":0,"description":"An updated detector description"},"groups":["kibana_sample_data","kibana_sample_web_logs"],"model_plot_config":{"enabled":true},"renormalization_window_days":30,"background_persist_interval":"2h","model_snapshot_retention_days":7,"results_retention_days":60}'' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/_update"' - lang: C# source: "var response = await client.MachineLearning\n .UpdateJobAsync(jobId: \"low_request_rate\", d1 => d1\n .BackgroundPersistInterval(\"2h\")\n .Description(\"An updated job\")\n .Detectors(d2 => d2\n .Description(\"An updated detector description\")\n .DetectorIndex(0)\n )\n .Groups(\"kibana_sample_data\", \"kibana_sample_web_logs\")\n .ModelPlotConfig(d2 => d2\n .Enabled(true)\n )\n .ModelSnapshotRetentionDays(7L)\n .RenormalizationWindowDays(30L)\n .ResultsRetentionDays(60L)\n );" - lang: Java source: "client.ml().updateJob(u -> u\n .backgroundPersistInterval(b -> b\n .time(\"2h\")\n )\n .description(\"An updated job\")\n .detectors(d -> d\n .detectorIndex(0)\n .description(\"An updated detector description\")\n )\n .groups(List.of(\"kibana_sample_data\",\"kibana_sample_web_logs\"))\n .jobId(\"low_request_rate\")\n .modelPlotConfig(m -> m\n .enabled(true)\n )\n .modelSnapshotRetentionDays(7L)\n .renormalizationWindowDays(30L)\n .resultsRetentionDays(60L)\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_update': post: tags: - ml anomaly summary: Update a snapshot description: "Updates certain properties of a snapshot.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-update-model-snapshot parameters: - name: job_id in: path description: Identifier for the anomaly detection job. required: true schema: $ref: '#/components/schemas/_types.Id' - name: snapshot_id in: path description: Identifier for the model snapshot. required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: type: object properties: description: type: string description: A description of the model snapshot. retain: type: boolean description: "If `true`, this snapshot will not be deleted during automatic cleanup of\nsnapshots older than `model_snapshot_retention_days`. However, this\nsnapshot will be deleted when the job is deleted." default: false examples: MlUpdateModelSnapshotExample1: description: An example body for a `POST` request. value: "_ml/anomaly_detectors/it_ops_new_logs/model_snapshots/1491852978/_update\n{\n \"description\": \"Snapshot 1\",\n \"retain\": true\n}" x-codeSamples: - lang: Console source: "POST\n_ml/anomaly_detectors/it_ops_new_logs/model_snapshots/1491852978/_update\n{\n \"description\": \"Snapshot 1\",\n \"retain\": true\n}" - lang: Python source: "resp = client.ml.update_model_snapshot(\n job_id=\"it_ops_new_logs\",\n snapshot_id=\"1491852978\",\n description=\"Snapshot 1\",\n retain=True,\n)" - lang: JavaScript source: "const response = await client.ml.updateModelSnapshot({\n job_id: \"it_ops_new_logs\",\n snapshot_id: 1491852978,\n description: \"Snapshot 1\",\n retain: true,\n});" - lang: Ruby source: "response = client.ml.update_model_snapshot(\n job_id: \"it_ops_new_logs\",\n snapshot_id: \"1491852978\",\n body: {\n \"description\": \"Snapshot 1\",\n \"retain\": true\n }\n)" - lang: PHP source: "$resp = $client->ml()->updateModelSnapshot([\n \"job_id\" => \"it_ops_new_logs\",\n \"snapshot_id\" => \"1491852978\",\n \"body\" => [\n \"description\" => \"Snapshot 1\",\n \"retain\" => true,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"description":"Snapshot 1","retain":true}'' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/it_ops_new_logs/model_snapshots/1491852978/_update"' - lang: C# source: "var response = await client.MachineLearning\n .UpdateModelSnapshotAsync(jobId: \"it_ops_new_logs\", snapshotId: \"1491852978\", d1 => d1\n .Description(\"Snapshot 1\")\n .Retain(true)\n );" - lang: Java source: "client.ml().updateModelSnapshot(u -> u\n .description(\"Snapshot 1\")\n .jobId(\"it_ops_new_logs\")\n .retain(true)\n .snapshotId(\"1491852978\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - acknowledged - model type: object properties: acknowledged: type: boolean model: allOf: - $ref: '#/components/schemas/ml._types.ModelSnapshot' x-state: Generally available; Added in 5.4.0 x-codeSamples: - lang: Console source: "POST\n_ml/anomaly_detectors/it_ops_new_logs/model_snapshots/1491852978/_update\n{\n \"description\": \"Snapshot 1\",\n \"retain\": true\n}" - lang: Python source: "resp = client.ml.update_model_snapshot(\n job_id=\"it_ops_new_logs\",\n snapshot_id=\"1491852978\",\n description=\"Snapshot 1\",\n retain=True,\n)" - lang: JavaScript source: "const response = await client.ml.updateModelSnapshot({\n job_id: \"it_ops_new_logs\",\n snapshot_id: 1491852978,\n description: \"Snapshot 1\",\n retain: true,\n});" - lang: Ruby source: "response = client.ml.update_model_snapshot(\n job_id: \"it_ops_new_logs\",\n snapshot_id: \"1491852978\",\n body: {\n \"description\": \"Snapshot 1\",\n \"retain\": true\n }\n)" - lang: PHP source: "$resp = $client->ml()->updateModelSnapshot([\n \"job_id\" => \"it_ops_new_logs\",\n \"snapshot_id\" => \"1491852978\",\n \"body\" => [\n \"description\" => \"Snapshot 1\",\n \"retain\" => true,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"description":"Snapshot 1","retain":true}'' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/it_ops_new_logs/model_snapshots/1491852978/_update"' - lang: C# source: "var response = await client.MachineLearning\n .UpdateModelSnapshotAsync(jobId: \"it_ops_new_logs\", snapshotId: \"1491852978\", d1 => d1\n .Description(\"Snapshot 1\")\n .Retain(true)\n );" - lang: Java source: "client.ml().updateModelSnapshot(u -> u\n .description(\"Snapshot 1\")\n .jobId(\"it_ops_new_logs\")\n .retain(true)\n .snapshotId(\"1491852978\")\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/trained_models/{model_id}/deployment/_update': post: tags: - ml trained model summary: Update a trained model deployment description: "\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-update-trained-model-deployment parameters: - name: model_id in: path description: 'The unique identifier of the trained model. Currently, only PyTorch models are supported.' required: true schema: $ref: '#/components/schemas/_types.Id' - name: number_of_allocations in: query description: "The number of model allocations on each node where the model is deployed.\nAll allocations on a node share the same copy of the model in memory but use\na separate set of threads to evaluate the model.\nIncreasing this value generally increases the throughput.\nIf this setting is greater than the number of hardware threads\nit will automatically be changed to a value less than the number of hardware threads." schema: type: number default: 1 requestBody: content: application/json: schema: type: object properties: number_of_allocations: type: number description: "The number of model allocations on each node where the model is deployed.\nAll allocations on a node share the same copy of the model in memory but use\na separate set of threads to evaluate the model.\nIncreasing this value generally increases the throughput.\nIf this setting is greater than the number of hardware threads\nit will automatically be changed to a value less than the number of hardware threads.\nIf adaptive_allocations is enabled, do not set this value, because it’s automatically set." default: 1 adaptive_allocations: allOf: - $ref: '#/components/schemas/ml._types.AdaptiveAllocationsSettings' description: "Adaptive allocations configuration. When enabled, the number of allocations\nis set based on the current load.\nIf adaptive_allocations is enabled, do not set the number of allocations manually." examples: MlUpdateTrainedModelDeploymentExample1: description: An example body for a `POST _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/_update` request. value: "{\n \"number_of_allocations\": 4\n}" x-codeSamples: - lang: Console source: "POST _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/_update\n{\n \"number_of_allocations\": 4\n}" - lang: Python source: "resp = client.ml.update_trained_model_deployment(\n model_id=\"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n number_of_allocations=4,\n)" - lang: JavaScript source: "const response = await client.ml.updateTrainedModelDeployment({\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n number_of_allocations: 4,\n});" - lang: Ruby source: "response = client.ml.update_trained_model_deployment(\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n body: {\n \"number_of_allocations\": 4\n }\n)" - lang: PHP source: "$resp = $client->ml()->updateTrainedModelDeployment([\n \"model_id\" => \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n \"body\" => [\n \"number_of_allocations\" => 4,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"number_of_allocations":4}'' "$ELASTICSEARCH_URL/_ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/_update"' - lang: C# source: "var response = await client.MachineLearning\n .UpdateTrainedModelDeploymentAsync(modelId: \"elastic__distilbert-base-uncased-finetuned-conll03-english\", d1 => d1\n .NumberOfAllocations(4)\n );" - lang: Java source: "client.ml().updateTrainedModelDeployment(u -> u\n .modelId(\"elastic__distilbert-base-uncased-finetuned-conll03-english\")\n .numberOfAllocations(4)\n);\n" responses: '200': description: '' content: application/json: schema: required: - assignment type: object properties: assignment: allOf: - $ref: '#/components/schemas/ml._types.TrainedModelAssignment' x-state: Generally available; Added in 8.6.0 x-codeSamples: - lang: Console source: "POST _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/_update\n{\n \"number_of_allocations\": 4\n}" - lang: Python source: "resp = client.ml.update_trained_model_deployment(\n model_id=\"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n number_of_allocations=4,\n)" - lang: JavaScript source: "const response = await client.ml.updateTrainedModelDeployment({\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n number_of_allocations: 4,\n});" - lang: Ruby source: "response = client.ml.update_trained_model_deployment(\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n body: {\n \"number_of_allocations\": 4\n }\n)" - lang: PHP source: "$resp = $client->ml()->updateTrainedModelDeployment([\n \"model_id\" => \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n \"body\" => [\n \"number_of_allocations\" => 4,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"number_of_allocations":4}'' "$ELASTICSEARCH_URL/_ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/_update"' - lang: C# source: "var response = await client.MachineLearning\n .UpdateTrainedModelDeploymentAsync(modelId: \"elastic__distilbert-base-uncased-finetuned-conll03-english\", d1 => d1\n .NumberOfAllocations(4)\n );" - lang: Java source: "client.ml().updateTrainedModelDeployment(u -> u\n .modelId(\"elastic__distilbert-base-uncased-finetuned-conll03-english\")\n .numberOfAllocations(4)\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_upgrade': post: tags: - ml anomaly summary: Upgrade a snapshot description: "Upgrade an anomaly detection model snapshot to the latest major version.\nOver time, older snapshot formats are deprecated and removed. Anomaly\ndetection jobs support only snapshots that are from the current or previous\nmajor version.\nThis API provides a means to upgrade a snapshot to the current major version.\nThis aids in preparing the cluster for an upgrade to the next major version.\nOnly one snapshot per anomaly detection job can be upgraded at a time and the\nupgraded snapshot cannot be the current snapshot of the anomaly detection\njob.\n\n## Required authorization\n\n* Cluster privileges: `manage_ml`\n" operationId: ml-upgrade-job-snapshot parameters: - name: job_id in: path description: Identifier for the anomaly detection job. required: true schema: $ref: '#/components/schemas/_types.Id' - name: snapshot_id in: path description: A numerical character string that uniquely identifies the model snapshot. required: true schema: $ref: '#/components/schemas/_types.Id' - name: wait_for_completion in: query description: "When true, the API won’t respond until the upgrade is complete.\nOtherwise, it responds as soon as the upgrade task is assigned to a node." schema: type: boolean default: false - name: timeout in: query description: Controls the time to wait for the request to complete. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30m responses: '200': description: '' content: application/json: schema: required: - node - completed type: object properties: node: allOf: - $ref: '#/components/schemas/_types.NodeId' description: The ID of the node that the upgrade task was started on if it is still running. In serverless this will be the "serverless". completed: type: boolean description: 'When true, this means the task is complete. When false, it is still running.' x-state: Generally available; Added in 5.4.0 x-codeSamples: - lang: Console source: "POST _ml/anomaly_detectors/low_request_rate/model_snapshots/1828371/_upgrade?timeout=45m&wait_for_completion=true\n" - lang: Python source: "resp = client.ml.upgrade_job_snapshot(\n job_id=\"low_request_rate\",\n snapshot_id=\"1828371\",\n timeout=\"45m\",\n wait_for_completion=True,\n)" - lang: JavaScript source: "const response = await client.ml.upgradeJobSnapshot({\n job_id: \"low_request_rate\",\n snapshot_id: 1828371,\n timeout: \"45m\",\n wait_for_completion: \"true\",\n});" - lang: Ruby source: "response = client.ml.upgrade_job_snapshot(\n job_id: \"low_request_rate\",\n snapshot_id: \"1828371\",\n timeout: \"45m\",\n wait_for_completion: \"true\"\n)" - lang: PHP source: "$resp = $client->ml()->upgradeJobSnapshot([\n \"job_id\" => \"low_request_rate\",\n \"snapshot_id\" => \"1828371\",\n \"timeout\" => \"45m\",\n \"wait_for_completion\" => \"true\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/model_snapshots/1828371/_upgrade?timeout=45m&wait_for_completion=true"' - lang: C# source: "var response = await client.MachineLearning\n .UpgradeJobSnapshotAsync(jobId: \"low_request_rate\", snapshotId: \"1828371\", d1 => d1\n .Timeout(\"45m\")\n .WaitForCompletion(true)\n );" - lang: Java source: "client.ml().upgradeJobSnapshot(u -> u\n .jobId(\"low_request_rate\")\n .snapshotId(\"1828371\")\n .timeout(t -> t\n .time(\"45m\")\n )\n .waitForCompletion(true)\n);\n" x-metaTags: - content: 'Elasticsearch, Machine Learning' name: product_name '/{index}/_msearch': post: tags: - search summary: "Run multiple searches\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_msearch\n
\n
\n POST\n /_msearch\n
\n
\n GET\n /{index}/_msearch\n
\n
\n POST\n /{index}/_msearch\n
\n \n\nThe format of the request is similar to the bulk API format and makes use of the newline delimited JSON (NDJSON) format.\nThe structure is as follows:\n\n```\nheader\\n\nbody\\n\nheader\\n\nbody\\n\n```\n\nThis structure is specifically optimized to reduce parsing if a specific search ends up redirected to another node.\n\nIMPORTANT: The final line of data must end with a newline character `\\n`.\nEach newline character may be preceded by a carriage return `\\r`.\nWhen sending requests to this endpoint the `Content-Type` header should be set to `application/x-ndjson`.\n\n## Required authorization\n\n* Index privileges: `read`\n" operationId: msearch parameters: - $ref: '#/components/parameters/msearch-index' - $ref: '#/components/parameters/msearch-allow_no_indices' - $ref: '#/components/parameters/msearch-ccs_minimize_roundtrips' - $ref: '#/components/parameters/msearch-expand_wildcards' - $ref: '#/components/parameters/msearch-ignore_throttled' - $ref: '#/components/parameters/msearch-ignore_unavailable' - $ref: '#/components/parameters/msearch-include_named_queries_score' - $ref: '#/components/parameters/msearch-index_' - $ref: '#/components/parameters/msearch-max_concurrent_searches' - $ref: '#/components/parameters/msearch-max_concurrent_shard_requests' - $ref: '#/components/parameters/msearch-pre_filter_shard_size' - $ref: '#/components/parameters/msearch-rest_total_hits_as_int' - $ref: '#/components/parameters/msearch-routing' - $ref: '#/components/parameters/msearch-search_type' - $ref: '#/components/parameters/msearch-typed_keys' requestBody: $ref: '#/components/requestBodies/msearch' responses: '200': $ref: '#/components/responses/msearch-200' x-state: Generally available; Added in 1.3.0 x-codeSamples: - lang: Console source: "GET my-index-000001/_msearch\n{ }\n{\"query\" : {\"match\" : { \"message\": \"this is a test\"}}}\n{\"index\": \"my-index-000002\"}\n{\"query\" : {\"match_all\" : {}}}" - lang: Python source: "resp = client.msearch(\n index=\"my-index-000001\",\n searches=[\n {},\n {\n \"query\": {\n \"match\": {\n \"message\": \"this is a test\"\n }\n }\n },\n {\n \"index\": \"my-index-000002\"\n },\n {\n \"query\": {\n \"match_all\": {}\n }\n }\n ],\n)" - lang: JavaScript source: "const response = await client.msearch({\n index: \"my-index-000001\",\n searches: [\n {},\n {\n query: {\n match: {\n message: \"this is a test\",\n },\n },\n },\n {\n index: \"my-index-000002\",\n },\n {\n query: {\n match_all: {},\n },\n },\n ],\n});" - lang: Ruby source: "response = client.msearch(\n index: \"my-index-000001\",\n body: [\n {},\n {\n \"query\": {\n \"match\": {\n \"message\": \"this is a test\"\n }\n }\n },\n {\n \"index\": \"my-index-000002\"\n },\n {\n \"query\": {\n \"match_all\": {}\n }\n }\n ]\n)" - lang: PHP source: "$resp = $client->msearch([\n \"index\" => \"my-index-000001\",\n \"body\" => array(\n new ArrayObject([]),\n [\n \"query\" => [\n \"match\" => [\n \"message\" => \"this is a test\",\n ],\n ],\n ],\n [\n \"index\" => \"my-index-000002\",\n ],\n [\n \"query\" => [\n \"match_all\" => new ArrayObject([]),\n ],\n ],\n ),\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/x-ndjson" -d $''{}\n{"query":{"match":{"message":"this is a test"}}}\n{"index":"my-index-000002"}\n{"query":{"match_all":{}}}\n'' "$ELASTICSEARCH_URL/my-index-000001/_msearch"' - lang: C# source: "var response = await client\n .MultiSearchAsync(d1 => d1\n .Indices(new[] { \"my-index-000001\" })\n .Searches([new SearchRequestItem(new MultisearchHeader(), new MultisearchBody()\n {\n Query = new Query()\n {\n Match = new()\n {\n Field = global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.Message),\n Query = \"this is a test\"\n }\n }\n }), new SearchRequestItem(new MultisearchHeader()\n {\n Indices = new[] { \"my-index-000002\" }\n }, new MultisearchBody()\n {\n Query = new Query()\n {\n MatchAll = new()\n }\n })])\n );" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_msearch/template': post: tags: - search summary: "Run multiple templated searches\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_msearch/template\n
\n
\n POST\n /_msearch/template\n
\n
\n GET\n /{index}/_msearch/template\n
\n
\n POST\n /{index}/_msearch/template\n
\n \n\nRun multiple templated searches with a single request.\nIf you are providing a text file or text input to `curl`, use the `--data-binary` flag instead of `-d` to preserve newlines.\nFor example:\n\n```\n$ cat requests\n{ \"index\": \"my-index\" }\n{ \"id\": \"my-search-template\", \"params\": { \"query_string\": \"hello world\", \"from\": 0, \"size\": 10 }}\n{ \"index\": \"my-other-index\" }\n{ \"id\": \"my-other-search-template\", \"params\": { \"query_type\": \"match_all\" }}\n\n$ curl -H \"Content-Type: application/x-ndjson\" -XGET localhost:9200/_msearch/template --data-binary \"@requests\"; echo\n```\n\n## Required authorization\n\n* Index privileges: `read`\n" externalDocs: description: More about searching templates url: https://www.elastic.co/docs/solutions/search/search-templates x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/multi-search-template.html operationId: msearch-template parameters: - $ref: '#/components/parameters/msearch_template-index' - $ref: '#/components/parameters/msearch_template-ccs_minimize_roundtrips' - $ref: '#/components/parameters/msearch_template-max_concurrent_searches' - $ref: '#/components/parameters/msearch_template-search_type' - $ref: '#/components/parameters/msearch_template-rest_total_hits_as_int' - $ref: '#/components/parameters/msearch_template-typed_keys' requestBody: $ref: '#/components/requestBodies/msearch_template' responses: '200': $ref: '#/components/responses/msearch_template-200' x-state: Generally available; Added in 5.0.0 x-codeSamples: - lang: Console source: "GET my-index/_msearch/template\n{ }\n{ \"id\": \"my-search-template\", \"params\": { \"query_string\": \"hello world\", \"from\": 0, \"size\": 10 }}\n{ }\n{ \"id\": \"my-other-search-template\", \"params\": { \"query_type\": \"match_all\" }}" - lang: Python source: "resp = client.msearch_template(\n index=\"my-index\",\n search_templates=[\n {},\n {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n },\n {},\n {\n \"id\": \"my-other-search-template\",\n \"params\": {\n \"query_type\": \"match_all\"\n }\n }\n ],\n)" - lang: JavaScript source: "const response = await client.msearchTemplate({\n index: \"my-index\",\n search_templates: [\n {},\n {\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 0,\n size: 10,\n },\n },\n {},\n {\n id: \"my-other-search-template\",\n params: {\n query_type: \"match_all\",\n },\n },\n ],\n});" - lang: Ruby source: "response = client.msearch_template(\n index: \"my-index\",\n body: [\n {},\n {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n },\n {},\n {\n \"id\": \"my-other-search-template\",\n \"params\": {\n \"query_type\": \"match_all\"\n }\n }\n ]\n)" - lang: PHP source: "$resp = $client->msearchTemplate([\n \"index\" => \"my-index\",\n \"body\" => array(\n new ArrayObject([]),\n [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 0,\n \"size\" => 10,\n ],\n ],\n new ArrayObject([]),\n [\n \"id\" => \"my-other-search-template\",\n \"params\" => [\n \"query_type\" => \"match_all\",\n ],\n ],\n ),\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/x-ndjson" -d $''{}\n{"id":"my-search-template","params":{"query_string":"hello world","from":0,"size":10}}\n{}\n{"id":"my-other-search-template","params":{"query_type":"match_all"}}\n'' "$ELASTICSEARCH_URL/my-index/_msearch/template"' - lang: C# source: "var response = await client\n .MultiSearchTemplateAsync(d1 => d1\n .Indices(new[] { \"my-index\" })\n .SearchTemplates([new SearchTemplateRequestItem(new MultisearchHeader(), new TemplateConfig()\n {\n Id = \"my-search-template\",\n Params = new Dictionary()\n {\n { \"query_string\", \"hello world\" },\n { \"from\", 0 },\n { \"size\", 10 }\n }\n }), new SearchTemplateRequestItem(new MultisearchHeader(), new TemplateConfig()\n {\n Id = \"my-other-search-template\",\n Params = new Dictionary()\n {\n { \"query_type\", \"match_all\" }\n }\n })])\n );" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_mtermvectors': post: tags: - document summary: "Get multiple term vectors\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_mtermvectors\n
\n
\n POST\n /_mtermvectors\n
\n
\n GET\n /{index}/_mtermvectors\n
\n
\n POST\n /{index}/_mtermvectors\n
\n \n\nGet multiple term vectors with a single request.\nYou can specify existing documents by index and ID or provide artificial documents in the body of the request.\nYou can specify the index in the request body or request URI.\nThe response contains a `docs` array with all the fetched termvectors.\nEach element has the structure provided by the termvectors API.\n\n**Artificial documents**\n\nYou can also use `mtermvectors` to generate term vectors for artificial documents provided in the body of the request.\nThe mapping used is determined by the specified `_index`.\n\n## Required authorization\n\n* Index privileges: `read`\n" operationId: mtermvectors parameters: - $ref: '#/components/parameters/mtermvectors-index' - $ref: '#/components/parameters/mtermvectors-ids' - $ref: '#/components/parameters/mtermvectors-fields' - $ref: '#/components/parameters/mtermvectors-field_statistics' - $ref: '#/components/parameters/mtermvectors-offsets' - $ref: '#/components/parameters/mtermvectors-payloads' - $ref: '#/components/parameters/mtermvectors-positions' - $ref: '#/components/parameters/mtermvectors-preference' - $ref: '#/components/parameters/mtermvectors-realtime' - $ref: '#/components/parameters/mtermvectors-routing' - $ref: '#/components/parameters/mtermvectors-term_statistics' - $ref: '#/components/parameters/mtermvectors-version' - $ref: '#/components/parameters/mtermvectors-version_type' requestBody: $ref: '#/components/requestBodies/mtermvectors' responses: '200': $ref: '#/components/responses/mtermvectors-200' x-state: Generally available x-codeSamples: - lang: Console source: "POST /my-index-000001/_mtermvectors\n{\n \"docs\": [\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": true\n },\n {\n \"_id\": \"1\"\n }\n ]\n}" - lang: Python source: "resp = client.mtermvectors(\n index=\"my-index-000001\",\n docs=[\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": True\n },\n {\n \"_id\": \"1\"\n }\n ],\n)" - lang: JavaScript source: "const response = await client.mtermvectors({\n index: \"my-index-000001\",\n docs: [\n {\n _id: \"2\",\n fields: [\"message\"],\n term_statistics: true,\n },\n {\n _id: \"1\",\n },\n ],\n});" - lang: Ruby source: "response = client.mtermvectors(\n index: \"my-index-000001\",\n body: {\n \"docs\": [\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": true\n },\n {\n \"_id\": \"1\"\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->mtermvectors([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"docs\" => array(\n [\n \"_id\" => \"2\",\n \"fields\" => array(\n \"message\",\n ),\n \"term_statistics\" => true,\n ],\n [\n \"_id\" => \"1\",\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"docs":[{"_id":"2","fields":["message"],"term_statistics":true},{"_id":"1"}]}'' "$ELASTICSEARCH_URL/my-index-000001/_mtermvectors"' - lang: C# source: "var response = await client\n .MtermvectorsAsync(d1 => d1\n .Index(\"my-index-000001\")\n .Docs(d2 => d2\n .Fields(x => x.Message)\n .Id(\"2\")\n .TermStatistics(true), d2 => d2\n .Id(\"1\")\n )\n );" - lang: Java source: "client.mtermvectors(m -> m\n .docs(List.of(MultiTermVectorsOperation.of(mu -> mu\n .id(\"2\")\n .fields(\"message\")\n .termStatistics(true)\n ),MultiTermVectorsOperation.of(mu -> mu\n .id(\"1\")\n )))\n .index(\"my-index-000001\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_nodes/{node_id}/_repositories_metering/{max_archive_version}': delete: tags: - cluster summary: Clear the archived repositories metering description: "Clear the archived repositories metering information in the cluster.\n\n## Required authorization\n\n* Cluster privileges: `monitor`,`manage`\n" operationId: nodes-clear-repositories-metering-archive parameters: - name: node_id in: path description: Comma-separated list of node IDs or names used to limit returned information. required: true schema: $ref: '#/components/schemas/_types.NodeIds' - name: max_archive_version in: path description: Specifies the maximum `archive_version` to be cleared from the archive. required: true schema: type: number responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/nodes.clear_repositories_metering_archive.ResponseBase' x-state: Experimental; Added in 7.16.0 x-metaTags: - content: Elasticsearch name: product_name '/_nodes/{node_id}/_repositories_metering': get: tags: - cluster summary: Get cluster repositories metering description: "Get repositories metering information for a cluster.\nThis API exposes monotonically non-decreasing counters and it is expected that clients would durably store the information needed to compute aggregations over a period of time.\nAdditionally, the information exposed by this API is volatile, meaning that it will not be present after node restarts.\n\n## Required authorization\n\n* Cluster privileges: `monitor`,`manage`\n" operationId: nodes-get-repositories-metering-info parameters: - name: node_id in: path description: Comma-separated list of node IDs or names used to limit returned information. required: true schema: $ref: '#/components/schemas/_types.NodeIds' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/nodes.get_repositories_metering_info.ResponseBase' x-state: Experimental; Added in 7.16.0 x-metaTags: - content: Elasticsearch name: product_name '/_nodes/{node_id}/hot_threads': get: tags: - cluster summary: "Get the hot threads for nodes\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_nodes/hot_threads\n
\n
\n GET\n /_nodes/{node_id}/hot_threads\n
\n \n\nGet a breakdown of the hot threads on each selected node in the cluster.\nThe output is plain text with a breakdown of the top hot threads for each node.\n\n## Required authorization\n\n* Cluster privileges: `monitor`,`manage`\n" operationId: nodes-hot-threads parameters: - $ref: '#/components/parameters/nodes.hot_threads-node_id' - $ref: '#/components/parameters/nodes.hot_threads-ignore_idle_threads' - $ref: '#/components/parameters/nodes.hot_threads-interval' - $ref: '#/components/parameters/nodes.hot_threads-snapshots' - $ref: '#/components/parameters/nodes.hot_threads-threads' - $ref: '#/components/parameters/nodes.hot_threads-timeout' - $ref: '#/components/parameters/nodes.hot_threads-type' - $ref: '#/components/parameters/nodes.hot_threads-sort' responses: '200': $ref: '#/components/responses/nodes.hot_threads-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET /_nodes/hot_threads\n" - lang: Python source: resp = client.nodes.hot_threads() - lang: JavaScript source: const response = await client.nodes.hotThreads(); - lang: Ruby source: response = client.nodes.hot_threads - lang: PHP source: $resp = $client->nodes()->hotThreads(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_nodes/hot_threads"' - lang: C# source: var response = await client.Nodes.HotThreadsAsync(); - lang: Java source: "client.nodes().hotThreads(h -> h);\n" x-metaTags: - content: Elasticsearch name: product_name '/_nodes/{node_id}/{metric}': get: tags: - cluster summary: "Get node information\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_nodes\n
\n
\n GET\n /_nodes/{metric}\n
\n
\n GET\n /_nodes/{node_id}\n
\n
\n GET\n /_nodes/{node_id}/{metric}\n
\n \n\nBy default, the API returns all attributes and core settings for cluster nodes.\n\n## Required authorization\n\n* Cluster privileges: `monitor`,`manage`\n" operationId: nodes-info parameters: - $ref: '#/components/parameters/nodes.info-node_id' - $ref: '#/components/parameters/nodes.info-metric' - $ref: '#/components/parameters/nodes.info-flat_settings' - $ref: '#/components/parameters/nodes.info-timeout' responses: '200': $ref: '#/components/responses/nodes.info-200' x-state: Generally available; Added in 1.3.0 x-codeSamples: - lang: Console source: "GET _nodes/_all/jvm\n" - lang: Python source: "resp = client.nodes.info(\n node_id=\"_all\",\n metric=\"jvm\",\n)" - lang: JavaScript source: "const response = await client.nodes.info({\n node_id: \"_all\",\n metric: \"jvm\",\n});" - lang: Ruby source: "response = client.nodes.info(\n node_id: \"_all\",\n metric: \"jvm\"\n)" - lang: PHP source: "$resp = $client->nodes()->info([\n \"node_id\" => \"_all\",\n \"metric\" => \"jvm\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_nodes/_all/jvm"' - lang: C# source: "var response = await client.Nodes\n .InfoAsync(d1 => d1\n .Metric(NodesInfoMetric.Jvm)\n .NodeId(\"_all\")\n );" - lang: Java source: "client.nodes().info(i -> i\n .metric(NodesInfoMetric.Jvm)\n .nodeId(\"_all\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_nodes/{node_id}/reload_secure_settings': post: tags: - cluster summary: "Reload the keystore on nodes in the cluster\n" description: "**All methods and paths for this operation:**\n\n
\n POST\n /_nodes/reload_secure_settings\n
\n
\n POST\n /_nodes/{node_id}/reload_secure_settings\n
\n \n\nSecure settings are stored in an on-disk keystore. Certain of these settings are reloadable.\nThat is, you can change them on disk and reload them without restarting any nodes in the cluster.\nWhen you have updated reloadable secure settings in your keystore, you can use this API to reload those settings on each node.\n\nWhen the Elasticsearch keystore is password protected and not simply obfuscated, you must provide the password for the keystore when you reload the secure settings.\nReloading the settings for the whole cluster assumes that the keystores for all nodes are protected with the same password; this method is allowed only when inter-node communications are encrypted.\nAlternatively, you can reload the secure settings on each node by locally accessing the API and passing the node-specific Elasticsearch keystore password.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: nodes-reload-secure-settings parameters: - $ref: '#/components/parameters/nodes.reload_secure_settings-node_id' - $ref: '#/components/parameters/nodes.reload_secure_settings-timeout' requestBody: $ref: '#/components/requestBodies/nodes.reload_secure_settings' responses: '200': $ref: '#/components/responses/nodes.reload_secure_settings-200' x-state: Generally available; Added in 6.5.0 x-codeSamples: - lang: Console source: "POST _nodes/reload_secure_settings\n{\n \"secure_settings_password\": \"keystore-password\"\n}" - lang: Python source: "resp = client.nodes.reload_secure_settings(\n secure_settings_password=\"keystore-password\",\n)" - lang: JavaScript source: "const response = await client.nodes.reloadSecureSettings({\n secure_settings_password: \"keystore-password\",\n});" - lang: Ruby source: "response = client.nodes.reload_secure_settings(\n body: {\n \"secure_settings_password\": \"keystore-password\"\n }\n)" - lang: PHP source: "$resp = $client->nodes()->reloadSecureSettings([\n \"body\" => [\n \"secure_settings_password\" => \"keystore-password\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"secure_settings_password":"keystore-password"}'' "$ELASTICSEARCH_URL/_nodes/reload_secure_settings"' - lang: C# source: "var response = await client.Nodes\n .ReloadSecureSettingsAsync(d1 => d1\n .SecureSettingsPassword(\"keystore-password\")\n );" - lang: Java source: "client.nodes().reloadSecureSettings(r -> r\n .secureSettingsPassword(\"keystore-password\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_nodes/{node_id}/stats/{metric}/{index_metric}': get: tags: - cluster summary: "Get node statistics\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_nodes/stats\n
\n
\n GET\n /_nodes/stats/{metric}\n
\n
\n GET\n /_nodes/{node_id}/stats\n
\n
\n GET\n /_nodes/{node_id}/stats/{metric}\n
\n
\n GET\n /_nodes/stats/{metric}/{index_metric}\n
\n
\n GET\n /_nodes/{node_id}/stats/{metric}/{index_metric}\n
\n \n\nGet statistics for nodes in a cluster.\nBy default, all stats are returned. You can limit the returned information by using metrics.\n\n## Required authorization\n\n* Cluster privileges: `monitor`,`manage`\n" operationId: nodes-stats parameters: - $ref: '#/components/parameters/nodes.stats-node_id' - $ref: '#/components/parameters/nodes.stats-metric' - $ref: '#/components/parameters/nodes.stats-index_metric' - $ref: '#/components/parameters/nodes.stats-completion_fields' - $ref: '#/components/parameters/nodes.stats-fielddata_fields' - $ref: '#/components/parameters/nodes.stats-fields' - $ref: '#/components/parameters/nodes.stats-groups' - $ref: '#/components/parameters/nodes.stats-include_segment_file_sizes' - $ref: '#/components/parameters/nodes.stats-level' - $ref: '#/components/parameters/nodes.stats-timeout' - $ref: '#/components/parameters/nodes.stats-types' - $ref: '#/components/parameters/nodes.stats-include_unloaded_segments' responses: '200': $ref: '#/components/responses/nodes.stats-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET _nodes/stats/process?filter_path=**.max_file_descriptors\n" - lang: Python source: "resp = client.nodes.stats(\n metric=\"process\",\n filter_path=\"**.max_file_descriptors\",\n)" - lang: JavaScript source: "const response = await client.nodes.stats({\n metric: \"process\",\n filter_path: \"**.max_file_descriptors\",\n});" - lang: Ruby source: "response = client.nodes.stats(\n metric: \"process\",\n filter_path: \"**.max_file_descriptors\"\n)" - lang: PHP source: "$resp = $client->nodes()->stats([\n \"metric\" => \"process\",\n \"filter_path\" => \"**.max_file_descriptors\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_nodes/stats/process?filter_path=**.max_file_descriptors"' - lang: C# source: "var response = await client.Nodes\n .StatsAsync(d1 => d1\n .Metric(NodeStatsMetric.Process)\n );" - lang: Java source: "client.nodes().stats(s -> s\n .metric(NodeStatsMetric.Process)\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_nodes/{node_id}/usage/{metric}': get: tags: - cluster summary: "Get feature usage information\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_nodes/usage\n
\n
\n GET\n /_nodes/usage/{metric}\n
\n
\n GET\n /_nodes/{node_id}/usage\n
\n
\n GET\n /_nodes/{node_id}/usage/{metric}\n
\n\n## Required authorization\n\n* Cluster privileges: `monitor`,`manage`\n" operationId: nodes-usage parameters: - $ref: '#/components/parameters/nodes.usage-node_id' - $ref: '#/components/parameters/nodes.usage-metric' - $ref: '#/components/parameters/nodes.usage-timeout' responses: '200': $ref: '#/components/responses/nodes.usage-200' x-state: Generally available; Added in 6.0.0 x-codeSamples: - lang: Console source: "GET _nodes/usage\n" - lang: Python source: resp = client.nodes.usage() - lang: JavaScript source: const response = await client.nodes.usage(); - lang: Ruby source: response = client.nodes.usage - lang: PHP source: $resp = $client->nodes()->usage(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_nodes/usage"' - lang: C# source: var response = await client.Nodes.UsageAsync(); - lang: Java source: "client.nodes().usage(u -> u);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_pit': post: tags: - search summary: Open a point in time description: "A search request by default runs against the most recent visible data of the target indices,\nwhich is called point in time. Elasticsearch pit (point in time) is a lightweight view into the\nstate of the data as it existed when initiated. In some cases, it’s preferred to perform multiple\nsearch requests using the same point in time. For example, if refreshes happen between\n`search_after` requests, then the results of those requests might not be consistent as changes happening\nbetween searches are only visible to the more recent point in time.\n\nA point in time must be opened explicitly before being used in search requests.\n\nA subsequent search request with the `pit` parameter must not specify `index`, `routing`, or `preference` values as these parameters are copied from the point in time.\n\nJust like regular searches, you can use `from` and `size` to page through point in time search results, up to the first 10,000 hits.\nIf you want to retrieve more hits, use PIT with `search_after`.\n\nIMPORTANT: Each search request against a PIT returns in its response a `pit_id` field which may be different from the identifier you originally supplied.\nAlways use the most recently-received PIT identifier for the next request.\nIf you make concurrent search requests against the same PIT, Elasticsearch can return several different `pit_id` values in its responses.\nIn that case, use any of these values for later requests, preferring more recently-received values whenever possible.\n\nWhen a PIT that contains shard failures is used in a search request, the missing are always reported in the search response as a `NoShardAvailableActionException` exception.\nTo get rid of these exceptions, a new PIT needs to be created so that shards missing from the previous PIT can be handled, assuming they become available in the meantime.\n\n**Keeping point in time alive**\n\nThe `keep_alive` parameter, which is passed to a open point in time request and search request, extends the time to live of the corresponding point in time.\nThe value does not need to be long enough to process all data — it just needs to be long enough for the next request.\n\nNormally, the background merge process optimizes the index by merging together smaller segments to create new, bigger segments.\nOnce the smaller segments are no longer needed they are deleted.\nHowever, open point-in-times prevent the old segments from being deleted since they are still in use.\n\nTIP: Keeping older segments alive means that more disk space and file handles are needed.\nEnsure that you have configured your nodes to have ample free file handles.\n\nAdditionally, if a segment contains deleted or updated documents then the point in time must keep track of whether each document in the segment was live at the time of the initial search request.\nEnsure that your nodes have sufficient heap space if you have many open point-in-times on an index that is subject to ongoing deletes or updates.\nNote that a point-in-time doesn't prevent its associated indices from being deleted.\nYou can check how many point-in-times (that is, search contexts) are open with the nodes stats API.\n\n## Required authorization\n\n* Index privileges: `read`\n" operationId: open-point-in-time parameters: - name: index in: path description: A comma-separated list of index names to open point in time; use `_all` or empty string to perform the operation on all indices required: true schema: $ref: '#/components/schemas/_types.Indices' - name: keep_alive in: query description: Extend the length of time that the point in time persists. required: true schema: $ref: '#/components/schemas/_types.Duration' - name: ignore_unavailable in: query description: "If `false`, the request returns an error if it targets a concrete (non-wildcarded)\nindex, alias, or data stream that is missing, closed, or otherwise unavailable.\nIf `true`, unavailable concrete targets are silently ignored." schema: type: boolean default: false - name: preference in: query description: "The node or shard the operation should be performed on.\nBy default, it is random." schema: type: string - name: routing in: query description: "A custom value that is used to route operations to a specific shard.\nNot allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead." schema: $ref: '#/components/schemas/_types.Routing' - name: expand_wildcards in: query description: "The type of index that wildcard patterns can match.\nIf the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.\nIt supports comma-separated values, such as `open,hidden`.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: open - name: allow_partial_search_results in: query description: "Indicates whether the point in time tolerates unavailable shards or shard failures when initially creating the PIT.\nIf `false`, creating a point in time request when a shard is missing or unavailable will throw an exception.\nIf `true`, the point in time will contain all the shards that are available at the time of the request." schema: type: boolean default: false - name: max_concurrent_shard_requests in: query description: Maximum number of concurrent shard requests that each sub-search request executes per node. schema: type: number default: 5 requestBody: content: application/json: schema: type: object properties: index_filter: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: Filter indices if the provided query rewrites to `match_none` on every shard. responses: '200': description: '' content: application/json: schema: required: - _shards - id type: object properties: _shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' description: Shards used to create the PIT id: allOf: - $ref: '#/components/schemas/_types.Id' _clusters: allOf: - $ref: '#/components/schemas/_types.ClusterStatistics' description: "Metadata about the clusters involved in the request, returned when the request targets\none or more remote clusters." x-state: Generally available; Added in 9.5.0 examples: OpenPointInTimeResponseExample1: description: "A successful response from `POST /my-index-000001/_pit?keep_alive=1m&allow_partial_search_results=true`. It includes a summary of the total number of shards, as well as the number of successful shards when creating the PIT.\n" value: "{\n \"id\": \"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA=\",\n \"_shards\": {\n \"total\": 10,\n \"successful\": 10,\n \"skipped\": 0,\n \"failed\": 0\n }\n}" x-state: Generally available; Added in 7.10.0 x-codeSamples: - lang: Console source: "POST /my-index-000001/_pit?keep_alive=1m&allow_partial_search_results=true\n" - lang: Python source: "resp = client.open_point_in_time(\n index=\"my-index-000001\",\n keep_alive=\"1m\",\n allow_partial_search_results=True,\n)" - lang: JavaScript source: "const response = await client.openPointInTime({\n index: \"my-index-000001\",\n keep_alive: \"1m\",\n allow_partial_search_results: \"true\",\n});" - lang: Ruby source: "response = client.open_point_in_time(\n index: \"my-index-000001\",\n keep_alive: \"1m\",\n allow_partial_search_results: \"true\"\n)" - lang: PHP source: "$resp = $client->openPointInTime([\n \"index\" => \"my-index-000001\",\n \"keep_alive\" => \"1m\",\n \"allow_partial_search_results\" => \"true\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_pit?keep_alive=1m&allow_partial_search_results=true"' - lang: C# source: "var response = await client\n .OpenPointInTimeAsync(indices: new[] { \"my-index-000001\" }, d1 => d1\n .AllowPartialSearchResults(true)\n .KeepAlive(\"1m\")\n );" - lang: Java source: "client.openPointInTime(o -> o\n .allowPartialSearchResults(true)\n .index(\"my-index-000001\")\n .keepAlive(k -> k\n .time(\"1m\")\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_scripts/{id}/{context}': post: tags: - script summary: "Create or update a script or search template\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_scripts/{id}\n
\n
\n POST\n /_scripts/{id}\n
\n
\n PUT\n /_scripts/{id}/{context}\n
\n
\n POST\n /_scripts/{id}/{context}\n
\n \n\nCreates or updates a stored script or search template.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" externalDocs: description: More about searching templates url: https://www.elastic.co/docs/solutions/search/search-templates x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/create-stored-script-api.html operationId: put-script parameters: - $ref: '#/components/parameters/put_script-id' - $ref: '#/components/parameters/put_script-context' - $ref: '#/components/parameters/put_script-context_' - $ref: '#/components/parameters/put_script-master_timeout' - $ref: '#/components/parameters/put_script-timeout' requestBody: $ref: '#/components/requestBodies/put_script' responses: '200': $ref: '#/components/responses/put_script-200' x-state: Generally available x-codeSamples: - lang: Console source: "PUT _scripts/my-search-template\n{\n \"script\": {\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n }\n}" - lang: Python source: "resp = client.put_script(\n id=\"my-search-template\",\n script={\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.putScript({\n id: \"my-search-template\",\n script: {\n lang: \"mustache\",\n source: {\n query: {\n match: {\n message: \"{{query_string}}\",\n },\n },\n from: \"{{from}}\",\n size: \"{{size}}\",\n },\n },\n});" - lang: Ruby source: "response = client.put_script(\n id: \"my-search-template\",\n body: {\n \"script\": {\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->putScript([\n \"id\" => \"my-search-template\",\n \"body\" => [\n \"script\" => [\n \"lang\" => \"mustache\",\n \"source\" => [\n \"query\" => [\n \"match\" => [\n \"message\" => \"{{query_string}}\",\n ],\n ],\n \"from\" => \"{{from}}\",\n \"size\" => \"{{size}}\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"script":{"lang":"mustache","source":{"query":{"match":{"message":"{{query_string}}"}},"from":"{{from}}","size":"{{size}}"}}}'' "$ELASTICSEARCH_URL/_scripts/my-search-template"' x-metaTags: - content: Elasticsearch name: product_name '/_query_rules/{ruleset_id}/_rule/{rule_id}': get: tags: - query_rules summary: Get a query rule description: "Get details about a query rule within a query ruleset.\n\n## Required authorization\n\n* Cluster privileges: `manage_search_query_rules`\n" externalDocs: description: About seeing rules and rulesets url: https://www.elastic.co/docs/solutions/search/query-rules-ui#accessing-the-query-rules-ui x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/get-query-rule.html operationId: query-rules-get-rule parameters: - name: ruleset_id in: path description: The unique identifier of the query ruleset containing the rule to retrieve required: true schema: $ref: '#/components/schemas/_types.Id' - name: rule_id in: path description: The unique identifier of the query rule within the specified ruleset to retrieve required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/query_rules._types.QueryRule' examples: QueryRuleGetResponseExample1: description: A successful response from `GET _query_rules/my-ruleset/_rule/my-rule1`. value: "{\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"query_string\",\n \"values\": [\n \"pugs\",\n \"puggles\"\n ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n}" x-state: Generally available; Added in 8.15.0 x-codeSamples: - lang: Console source: "GET _query_rules/my-ruleset/_rule/my-rule1\n" - lang: Python source: "resp = client.query_rules.get_rule(\n ruleset_id=\"my-ruleset\",\n rule_id=\"my-rule1\",\n)" - lang: JavaScript source: "const response = await client.queryRules.getRule({\n ruleset_id: \"my-ruleset\",\n rule_id: \"my-rule1\",\n});" - lang: Ruby source: "response = client.query_rules.get_rule(\n ruleset_id: \"my-ruleset\",\n rule_id: \"my-rule1\"\n)" - lang: PHP source: "$resp = $client->queryRules()->getRule([\n \"ruleset_id\" => \"my-ruleset\",\n \"rule_id\" => \"my-rule1\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_query_rules/my-ruleset/_rule/my-rule1"' - lang: C# source: 'var response = await client.QueryRules.GetRuleAsync(rulesetId: "my-ruleset", ruleId: "my-rule1");' - lang: Java source: "client.queryRules().getRule(g -> g\n .ruleId(\"my-rule1\")\n .rulesetId(\"my-ruleset\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - query_rules summary: Create or update a query rule description: "Create or update a query rule within a query ruleset.\n\nIMPORTANT: Due to limitations within pinned queries, you can only pin documents using ids or docs, but cannot use both in single rule.\nIt is advised to use one or the other in query rulesets, to avoid errors.\nAdditionally, pinned queries have a maximum limit of 100 pinned hits.\nIf multiple matching rules pin more than 100 documents, only the first 100 documents are pinned in the order they are specified in the ruleset.\n\n## Required authorization\n\n* Cluster privileges: `manage_search_query_rules`\n" externalDocs: description: About editing rules and rulesets url: https://www.elastic.co/docs/solutions/search/query-rules-ui#edit-a-rule x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/put-query-rule.html operationId: query-rules-put-rule parameters: - name: ruleset_id in: path description: The unique identifier of the query ruleset containing the rule to be created or updated. required: true schema: $ref: '#/components/schemas/_types.Id' - name: rule_id in: path description: The unique identifier of the query rule within the specified ruleset to be created or updated. required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: required: - type - criteria - actions type: object properties: type: allOf: - $ref: '#/components/schemas/query_rules._types.QueryRuleType' description: The type of rule. criteria: oneOf: - $ref: '#/components/schemas/query_rules._types.QueryRuleCriteria' - type: array items: $ref: '#/components/schemas/query_rules._types.QueryRuleCriteria' description: "The criteria that must be met for the rule to be applied.\nIf multiple criteria are specified for a rule, all criteria must be met for the rule to be applied." actions: allOf: - $ref: '#/components/schemas/query_rules._types.QueryRuleActions' description: "The actions to take when the rule is matched.\nThe format of this action depends on the rule type." priority: type: number examples: QueryRulePutRequestExample1: description: "Run `POST _query_rules/my-ruleset/_test` to test a ruleset. Provide the match criteria that you want to test against.\n" value: "{\n \"match_criteria\": {\n \"query_string\": \"puggles\"\n }\n}" x-codeSamples: - lang: Console source: "POST _query_rules/my-ruleset/_test\n{\n \"match_criteria\": {\n \"query_string\": \"puggles\"\n }\n}" - lang: Python source: "resp = client.query_rules.test(\n ruleset_id=\"my-ruleset\",\n match_criteria={\n \"query_string\": \"puggles\"\n },\n)" - lang: JavaScript source: "const response = await client.queryRules.test({\n ruleset_id: \"my-ruleset\",\n match_criteria: {\n query_string: \"puggles\",\n },\n});" - lang: Ruby source: "response = client.query_rules.test(\n ruleset_id: \"my-ruleset\",\n body: {\n \"match_criteria\": {\n \"query_string\": \"puggles\"\n }\n }\n)" - lang: PHP source: "$resp = $client->queryRules()->test([\n \"ruleset_id\" => \"my-ruleset\",\n \"body\" => [\n \"match_criteria\" => [\n \"query_string\" => \"puggles\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"match_criteria":{"query_string":"puggles"}}'' "$ELASTICSEARCH_URL/_query_rules/my-ruleset/_test"' - lang: C# source: "var response = await client.QueryRules\n .TestAsync(rulesetId: \"my-ruleset\", d1 => d1\n .MatchCriteria(new Dictionary()\n {\n { \"query_string\", \"puggles\" }\n })\n );" - lang: Java source: "client.queryRules().test(t -> t\n .matchCriteria(\"query_string\", JsonData.fromJson(\"\\\"puggles\\\"\"))\n .rulesetId(\"my-ruleset\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - result type: object properties: result: allOf: - $ref: '#/components/schemas/_types.Result' x-state: Generally available; Added in 8.15.0 x-codeSamples: - lang: Console source: "POST _query_rules/my-ruleset/_test\n{\n \"match_criteria\": {\n \"query_string\": \"puggles\"\n }\n}" - lang: Python source: "resp = client.query_rules.test(\n ruleset_id=\"my-ruleset\",\n match_criteria={\n \"query_string\": \"puggles\"\n },\n)" - lang: JavaScript source: "const response = await client.queryRules.test({\n ruleset_id: \"my-ruleset\",\n match_criteria: {\n query_string: \"puggles\",\n },\n});" - lang: Ruby source: "response = client.query_rules.test(\n ruleset_id: \"my-ruleset\",\n body: {\n \"match_criteria\": {\n \"query_string\": \"puggles\"\n }\n }\n)" - lang: PHP source: "$resp = $client->queryRules()->test([\n \"ruleset_id\" => \"my-ruleset\",\n \"body\" => [\n \"match_criteria\" => [\n \"query_string\" => \"puggles\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"match_criteria":{"query_string":"puggles"}}'' "$ELASTICSEARCH_URL/_query_rules/my-ruleset/_test"' - lang: C# source: "var response = await client.QueryRules\n .TestAsync(rulesetId: \"my-ruleset\", d1 => d1\n .MatchCriteria(new Dictionary()\n {\n { \"query_string\", \"puggles\" }\n })\n );" - lang: Java source: "client.queryRules().test(t -> t\n .matchCriteria(\"query_string\", JsonData.fromJson(\"\\\"puggles\\\"\"))\n .rulesetId(\"my-ruleset\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - query_rules summary: Delete a query rule description: "Delete a query rule within a query ruleset.\nThis is a destructive action that is only recoverable by re-adding the same rule with the create or update query rule API.\n\n## Required authorization\n\n* Cluster privileges: `manage_search_query_rules`\n" externalDocs: description: About deleting a query rule url: https://www.elastic.co/docs/solutions/search/query-rules-ui#delete-a-rule x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/delete-query-rule.html operationId: query-rules-delete-rule parameters: - name: ruleset_id in: path description: The unique identifier of the query ruleset containing the rule to delete required: true schema: $ref: '#/components/schemas/_types.Id' - name: rule_id in: path description: The unique identifier of the query rule within the specified ruleset to delete required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 8.15.0 x-codeSamples: - lang: Console source: "DELETE _query_rules/my-ruleset/_rule/my-rule1\n" - lang: Python source: "resp = client.query_rules.delete_rule(\n ruleset_id=\"my-ruleset\",\n rule_id=\"my-rule1\",\n)" - lang: JavaScript source: "const response = await client.queryRules.deleteRule({\n ruleset_id: \"my-ruleset\",\n rule_id: \"my-rule1\",\n});" - lang: Ruby source: "response = client.query_rules.delete_rule(\n ruleset_id: \"my-ruleset\",\n rule_id: \"my-rule1\"\n)" - lang: PHP source: "$resp = $client->queryRules()->deleteRule([\n \"ruleset_id\" => \"my-ruleset\",\n \"rule_id\" => \"my-rule1\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_query_rules/my-ruleset/_rule/my-rule1"' - lang: C# source: 'var response = await client.QueryRules.DeleteRuleAsync(rulesetId: "my-ruleset", ruleId: "my-rule1");' - lang: Java source: "client.queryRules().deleteRule(d -> d\n .ruleId(\"my-rule1\")\n .rulesetId(\"my-ruleset\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_query_rules/{ruleset_id}': get: tags: - query_rules summary: Get a query ruleset description: "Get details about a query ruleset.\n\n## Required authorization\n\n* Cluster privileges: `manage_search_query_rules`\n" externalDocs: description: About seeing rules and rulesets url: https://www.elastic.co/docs/solutions/search/query-rules-ui#accessing-the-query-rules-ui x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/get-query-ruleset.html operationId: query-rules-get-ruleset parameters: - name: ruleset_id in: path description: The unique identifier of the query ruleset required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/query_rules._types.QueryRuleset' examples: QueryRulesetGetResponseExample1: description: A successful response from `GET _query_rules/my-ruleset/`. value: "{\n \"ruleset_id\": \"my-ruleset\",\n \"rules\": [\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"query_string\",\n \"values\": [ \"pugs\", \"puggles\" ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"query_string\",\n \"values\": [ \"rescue dogs\" ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ]\n}" x-state: Generally available; Added in 8.10.0 x-codeSamples: - lang: Console source: "GET _query_rules/my-ruleset/\n" - lang: Python source: "resp = client.query_rules.get_ruleset(\n ruleset_id=\"my-ruleset\",\n)" - lang: JavaScript source: "const response = await client.queryRules.getRuleset({\n ruleset_id: \"my-ruleset\",\n});" - lang: Ruby source: "response = client.query_rules.get_ruleset(\n ruleset_id: \"my-ruleset\"\n)" - lang: PHP source: "$resp = $client->queryRules()->getRuleset([\n \"ruleset_id\" => \"my-ruleset\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_query_rules/my-ruleset/"' - lang: C# source: 'var response = await client.QueryRules.GetRulesetAsync(rulesetId: "my-ruleset");' - lang: Java source: "client.queryRules().getRuleset(g -> g\n .rulesetId(\"my-ruleset\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - query_rules summary: Create or update a query ruleset description: "There is a limit of 100 rules per ruleset.\nThis limit can be increased by using the `xpack.applications.rules.max_rules_per_ruleset` cluster setting.\n\nIMPORTANT: Due to limitations within pinned queries, you can only select documents using `ids` or `docs`, but cannot use both in single rule.\nIt is advised to use one or the other in query rulesets, to avoid errors.\nAdditionally, pinned queries have a maximum limit of 100 pinned hits.\nIf multiple matching rules pin more than 100 documents, only the first 100 documents are pinned in the order they are specified in the ruleset.\n\n## Required authorization\n\n* Cluster privileges: `manage_search_query_rules`\n" externalDocs: description: About editing rules and rulesets url: https://www.elastic.co/docs/solutions/search/query-rules-ui#edit-a-rule x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/put-query-ruleset.html operationId: query-rules-put-ruleset parameters: - name: ruleset_id in: path description: The unique identifier of the query ruleset to be created or updated. required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: required: - rules type: object properties: rules: oneOf: - $ref: '#/components/schemas/query_rules._types.QueryRule' - type: array items: $ref: '#/components/schemas/query_rules._types.QueryRule' examples: QueryRulesetPutRequestExample1: description: "Run `PUT _query_rules/my-ruleset` to create a new query ruleset. Two rules are associated with `my-ruleset`. `my-rule1` will pin documents with IDs `id1` and `id2` when `user_query` contains `pugs` or `puggles` and `user_country` exactly matches `us`. `my-rule2` will exclude documents from different specified indices with IDs `id3` and `id4` when the `query_string` fuzzily matches `rescue dogs`.\n" value: "{\n \"rules\": [\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [ \"pugs\", \"puggles\" ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [ \"us\" ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [ \"rescue dogs\" ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ]\n}" x-codeSamples: - lang: Console source: "PUT _query_rules/my-ruleset\n{\n \"rules\": [\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [ \"pugs\", \"puggles\" ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [ \"us\" ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [ \"rescue dogs\" ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ]\n}" - lang: Python source: "resp = client.query_rules.put_ruleset(\n ruleset_id=\"my-ruleset\",\n rules=[\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"pugs\",\n \"puggles\"\n ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [\n \"us\"\n ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"rescue dogs\"\n ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ],\n)" - lang: JavaScript source: "const response = await client.queryRules.putRuleset({\n ruleset_id: \"my-ruleset\",\n rules: [\n {\n rule_id: \"my-rule1\",\n type: \"pinned\",\n criteria: [\n {\n type: \"contains\",\n metadata: \"user_query\",\n values: [\"pugs\", \"puggles\"],\n },\n {\n type: \"exact\",\n metadata: \"user_country\",\n values: [\"us\"],\n },\n ],\n actions: {\n ids: [\"id1\", \"id2\"],\n },\n },\n {\n rule_id: \"my-rule2\",\n type: \"pinned\",\n criteria: [\n {\n type: \"fuzzy\",\n metadata: \"user_query\",\n values: [\"rescue dogs\"],\n },\n ],\n actions: {\n docs: [\n {\n _index: \"index1\",\n _id: \"id3\",\n },\n {\n _index: \"index2\",\n _id: \"id4\",\n },\n ],\n },\n },\n ],\n});" - lang: Ruby source: "response = client.query_rules.put_ruleset(\n ruleset_id: \"my-ruleset\",\n body: {\n \"rules\": [\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"pugs\",\n \"puggles\"\n ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [\n \"us\"\n ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"rescue dogs\"\n ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->queryRules()->putRuleset([\n \"ruleset_id\" => \"my-ruleset\",\n \"body\" => [\n \"rules\" => array(\n [\n \"rule_id\" => \"my-rule1\",\n \"type\" => \"pinned\",\n \"criteria\" => array(\n [\n \"type\" => \"contains\",\n \"metadata\" => \"user_query\",\n \"values\" => array(\n \"pugs\",\n \"puggles\",\n ),\n ],\n [\n \"type\" => \"exact\",\n \"metadata\" => \"user_country\",\n \"values\" => array(\n \"us\",\n ),\n ],\n ),\n \"actions\" => [\n \"ids\" => array(\n \"id1\",\n \"id2\",\n ),\n ],\n ],\n [\n \"rule_id\" => \"my-rule2\",\n \"type\" => \"pinned\",\n \"criteria\" => array(\n [\n \"type\" => \"fuzzy\",\n \"metadata\" => \"user_query\",\n \"values\" => array(\n \"rescue dogs\",\n ),\n ],\n ),\n \"actions\" => [\n \"docs\" => array(\n [\n \"_index\" => \"index1\",\n \"_id\" => \"id3\",\n ],\n [\n \"_index\" => \"index2\",\n \"_id\" => \"id4\",\n ],\n ),\n ],\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"rules":[{"rule_id":"my-rule1","type":"pinned","criteria":[{"type":"contains","metadata":"user_query","values":["pugs","puggles"]},{"type":"exact","metadata":"user_country","values":["us"]}],"actions":{"ids":["id1","id2"]}},{"rule_id":"my-rule2","type":"pinned","criteria":[{"type":"fuzzy","metadata":"user_query","values":["rescue dogs"]}],"actions":{"docs":[{"_index":"index1","_id":"id3"},{"_index":"index2","_id":"id4"}]}}]}'' "$ELASTICSEARCH_URL/_query_rules/my-ruleset"' - lang: C# source: "var response = await client.QueryRules\n .PutRulesetAsync(rulesetId: \"my-ruleset\", d1 => d1\n .Rules(d2 => d2\n .Actions(d3 => d3\n .Ids([\"id1\", \"id2\"])\n )\n .Criteria(d3 => d3\n .Metadata(\"user_query\")\n .Type(QueryRuleCriteriaType.Contains)\n .Values([\"pugs\", \"puggles\"]), d3 => d3\n .Metadata(\"user_country\")\n .Type(QueryRuleCriteriaType.Exact)\n .Values([\"us\"])\n )\n .RuleId(\"my-rule1\")\n .Type(QueryRuleType.Pinned), d2 => d2\n .Actions(d3 => d3\n .Docs(d4 => d4\n .Id(\"id3\")\n .Index(\"index1\"), d4 => d4\n .Id(\"id4\")\n .Index(\"index2\")\n )\n )\n .Criteria(d3 => d3\n .Metadata(\"user_query\")\n .Type(QueryRuleCriteriaType.Fuzzy)\n .Values([\"rescue dogs\"])\n )\n .RuleId(\"my-rule2\")\n .Type(QueryRuleType.Pinned)\n )\n );" - lang: Java source: "client.queryRules().putRuleset(p -> p\n .rules(List.of(QueryRule.queryRuleOf(q -> q\n .ruleId(\"my-rule1\")\n .type(QueryRuleType.Pinned)\n .criteria(List.of(QueryRuleCriteria.of(qu -> qu\n .type(QueryRuleCriteriaType.Contains)\n .metadata(\"user_query\")\n .values(List.of(JsonData.fromJson(\"\\\"pugs\\\"\"),JsonData.fromJson(\"\\\"puggles\\\"\")))\n ),QueryRuleCriteria.of(qu -> qu\n .type(QueryRuleCriteriaType.Exact)\n .metadata(\"user_country\")\n .values(JsonData.fromJson(\"\\\"us\\\"\"))\n )))\n .actions(a -> a\n .ids(List.of(\"id1\",\"id2\"))\n )\n ),QueryRule.queryRuleOf(q -> q\n .ruleId(\"my-rule2\")\n .type(QueryRuleType.Pinned)\n .criteria(c -> c\n .type(QueryRuleCriteriaType.Fuzzy)\n .metadata(\"user_query\")\n .values(JsonData.fromJson(\"\\\"rescue dogs\\\"\"))\n )\n .actions(a -> a\n .docs(List.of(PinnedDoc.of(pi -> pi\n .id(\"id3\")\n .index(\"index1\")\n ),PinnedDoc.of(pi -> pi\n .id(\"id4\")\n .index(\"index2\")\n )))\n )\n )))\n .rulesetId(\"my-ruleset\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - result type: object properties: result: allOf: - $ref: '#/components/schemas/_types.Result' x-state: Generally available; Added in 8.10.0 x-codeSamples: - lang: Console source: "PUT _query_rules/my-ruleset\n{\n \"rules\": [\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [ \"pugs\", \"puggles\" ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [ \"us\" ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [ \"rescue dogs\" ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ]\n}" - lang: Python source: "resp = client.query_rules.put_ruleset(\n ruleset_id=\"my-ruleset\",\n rules=[\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"pugs\",\n \"puggles\"\n ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [\n \"us\"\n ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"rescue dogs\"\n ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ],\n)" - lang: JavaScript source: "const response = await client.queryRules.putRuleset({\n ruleset_id: \"my-ruleset\",\n rules: [\n {\n rule_id: \"my-rule1\",\n type: \"pinned\",\n criteria: [\n {\n type: \"contains\",\n metadata: \"user_query\",\n values: [\"pugs\", \"puggles\"],\n },\n {\n type: \"exact\",\n metadata: \"user_country\",\n values: [\"us\"],\n },\n ],\n actions: {\n ids: [\"id1\", \"id2\"],\n },\n },\n {\n rule_id: \"my-rule2\",\n type: \"pinned\",\n criteria: [\n {\n type: \"fuzzy\",\n metadata: \"user_query\",\n values: [\"rescue dogs\"],\n },\n ],\n actions: {\n docs: [\n {\n _index: \"index1\",\n _id: \"id3\",\n },\n {\n _index: \"index2\",\n _id: \"id4\",\n },\n ],\n },\n },\n ],\n});" - lang: Ruby source: "response = client.query_rules.put_ruleset(\n ruleset_id: \"my-ruleset\",\n body: {\n \"rules\": [\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"pugs\",\n \"puggles\"\n ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [\n \"us\"\n ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"rescue dogs\"\n ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->queryRules()->putRuleset([\n \"ruleset_id\" => \"my-ruleset\",\n \"body\" => [\n \"rules\" => array(\n [\n \"rule_id\" => \"my-rule1\",\n \"type\" => \"pinned\",\n \"criteria\" => array(\n [\n \"type\" => \"contains\",\n \"metadata\" => \"user_query\",\n \"values\" => array(\n \"pugs\",\n \"puggles\",\n ),\n ],\n [\n \"type\" => \"exact\",\n \"metadata\" => \"user_country\",\n \"values\" => array(\n \"us\",\n ),\n ],\n ),\n \"actions\" => [\n \"ids\" => array(\n \"id1\",\n \"id2\",\n ),\n ],\n ],\n [\n \"rule_id\" => \"my-rule2\",\n \"type\" => \"pinned\",\n \"criteria\" => array(\n [\n \"type\" => \"fuzzy\",\n \"metadata\" => \"user_query\",\n \"values\" => array(\n \"rescue dogs\",\n ),\n ],\n ),\n \"actions\" => [\n \"docs\" => array(\n [\n \"_index\" => \"index1\",\n \"_id\" => \"id3\",\n ],\n [\n \"_index\" => \"index2\",\n \"_id\" => \"id4\",\n ],\n ),\n ],\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"rules":[{"rule_id":"my-rule1","type":"pinned","criteria":[{"type":"contains","metadata":"user_query","values":["pugs","puggles"]},{"type":"exact","metadata":"user_country","values":["us"]}],"actions":{"ids":["id1","id2"]}},{"rule_id":"my-rule2","type":"pinned","criteria":[{"type":"fuzzy","metadata":"user_query","values":["rescue dogs"]}],"actions":{"docs":[{"_index":"index1","_id":"id3"},{"_index":"index2","_id":"id4"}]}}]}'' "$ELASTICSEARCH_URL/_query_rules/my-ruleset"' - lang: C# source: "var response = await client.QueryRules\n .PutRulesetAsync(rulesetId: \"my-ruleset\", d1 => d1\n .Rules(d2 => d2\n .Actions(d3 => d3\n .Ids([\"id1\", \"id2\"])\n )\n .Criteria(d3 => d3\n .Metadata(\"user_query\")\n .Type(QueryRuleCriteriaType.Contains)\n .Values([\"pugs\", \"puggles\"]), d3 => d3\n .Metadata(\"user_country\")\n .Type(QueryRuleCriteriaType.Exact)\n .Values([\"us\"])\n )\n .RuleId(\"my-rule1\")\n .Type(QueryRuleType.Pinned), d2 => d2\n .Actions(d3 => d3\n .Docs(d4 => d4\n .Id(\"id3\")\n .Index(\"index1\"), d4 => d4\n .Id(\"id4\")\n .Index(\"index2\")\n )\n )\n .Criteria(d3 => d3\n .Metadata(\"user_query\")\n .Type(QueryRuleCriteriaType.Fuzzy)\n .Values([\"rescue dogs\"])\n )\n .RuleId(\"my-rule2\")\n .Type(QueryRuleType.Pinned)\n )\n );" - lang: Java source: "client.queryRules().putRuleset(p -> p\n .rules(List.of(QueryRule.queryRuleOf(q -> q\n .ruleId(\"my-rule1\")\n .type(QueryRuleType.Pinned)\n .criteria(List.of(QueryRuleCriteria.of(qu -> qu\n .type(QueryRuleCriteriaType.Contains)\n .metadata(\"user_query\")\n .values(List.of(JsonData.fromJson(\"\\\"pugs\\\"\"),JsonData.fromJson(\"\\\"puggles\\\"\")))\n ),QueryRuleCriteria.of(qu -> qu\n .type(QueryRuleCriteriaType.Exact)\n .metadata(\"user_country\")\n .values(JsonData.fromJson(\"\\\"us\\\"\"))\n )))\n .actions(a -> a\n .ids(List.of(\"id1\",\"id2\"))\n )\n ),QueryRule.queryRuleOf(q -> q\n .ruleId(\"my-rule2\")\n .type(QueryRuleType.Pinned)\n .criteria(c -> c\n .type(QueryRuleCriteriaType.Fuzzy)\n .metadata(\"user_query\")\n .values(JsonData.fromJson(\"\\\"rescue dogs\\\"\"))\n )\n .actions(a -> a\n .docs(List.of(PinnedDoc.of(pi -> pi\n .id(\"id3\")\n .index(\"index1\")\n ),PinnedDoc.of(pi -> pi\n .id(\"id4\")\n .index(\"index2\")\n )))\n )\n )))\n .rulesetId(\"my-ruleset\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - query_rules summary: Delete a query ruleset description: "Remove a query ruleset and its associated data.\nThis is a destructive action that is not recoverable.\n\n## Required authorization\n\n* Cluster privileges: `manage_search_query_rules`\n" externalDocs: description: About deleting a query ruleset url: https://www.elastic.co/docs/solutions/search/query-rules-ui#delete-a-ruleset x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/delete-query-ruleset.html operationId: query-rules-delete-ruleset parameters: - name: ruleset_id in: path description: The unique identifier of the query ruleset to delete required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 8.10.0 x-codeSamples: - lang: Console source: "DELETE _query_rules/my-ruleset/\n" - lang: Python source: "resp = client.query_rules.delete_ruleset(\n ruleset_id=\"my-ruleset\",\n)" - lang: JavaScript source: "const response = await client.queryRules.deleteRuleset({\n ruleset_id: \"my-ruleset\",\n});" - lang: Ruby source: "response = client.query_rules.delete_ruleset(\n ruleset_id: \"my-ruleset\"\n)" - lang: PHP source: "$resp = $client->queryRules()->deleteRuleset([\n \"ruleset_id\" => \"my-ruleset\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_query_rules/my-ruleset/"' - lang: C# source: 'var response = await client.QueryRules.DeleteRulesetAsync(rulesetId: "my-ruleset");' - lang: Java source: "client.queryRules().deleteRuleset(d -> d\n .rulesetId(\"my-ruleset\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_query_rules: get: tags: - query_rules summary: Get all query rulesets description: "Get summarized information about the query rulesets.\n\n## Required authorization\n\n* Cluster privileges: `manage_search_query_rules`\n" externalDocs: description: About seeing rules and rulesets url: https://www.elastic.co/docs/solutions/search/query-rules-ui#accessing-the-query-rules-ui x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/list-query-rulesets.html operationId: query-rules-list-rulesets parameters: - name: from in: query description: The offset from the first result to fetch. schema: type: number default: 0 - name: size in: query description: The maximum number of results to retrieve. schema: type: number default: 100 responses: '200': description: '' content: application/json: schema: required: - count - results type: object properties: count: type: number results: type: array items: $ref: '#/components/schemas/query_rules.list_rulesets.QueryRulesetListItem' examples: QueryRulesetListResponseExample1: description: A successful response from `GET _query_rules/?from=0&size=3`. value: "{\n \"count\": 3,\n \"results\": [\n {\n \"ruleset_id\": \"ruleset-1\",\n \"rule_total_count\": 1,\n \"rule_criteria_types_counts\": {\n \"exact\": 1\n }\n },\n {\n \"ruleset_id\": \"ruleset-2\",\n \"rule_total_count\": 2,\n \"rule_criteria_types_counts\": {\n \"exact\": 1,\n \"fuzzy\": 1\n }\n },\n {\n \"ruleset_id\": \"ruleset-3\",\n \"rule_total_count\": 3,\n \"rule_criteria_types_counts\": {\n \"exact\": 1,\n \"fuzzy\": 2\n }\n }\n ]\n}" x-state: Generally available; Added in 8.10.0 x-codeSamples: - lang: Console source: "GET _query_rules/?from=0&size=3\n" - lang: Python source: "resp = client.query_rules.list_rulesets(\n from_=\"0\",\n size=\"3\",\n)" - lang: JavaScript source: "const response = await client.queryRules.listRulesets({\n from: 0,\n size: 3,\n});" - lang: Ruby source: "response = client.query_rules.list_rulesets(\n from: \"0\",\n size: \"3\"\n)" - lang: PHP source: "$resp = $client->queryRules()->listRulesets([\n \"from\" => \"0\",\n \"size\" => \"3\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_query_rules/?from=0&size=3"' - lang: C# source: "var response = await client.QueryRules\n .ListRulesetsAsync(d1 => d1\n .From(0)\n .Size(3)\n );" - lang: Java source: "client.queryRules().listRulesets(l -> l\n .from(0)\n .size(3)\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_query_rules/{ruleset_id}/_test': post: tags: - query_rules summary: Test a query ruleset description: "Evaluate match criteria against a query ruleset to identify the rules that would match that criteria.\n\n## Required authorization\n\n* Cluster privileges: `manage_search_query_rules`\n" operationId: query-rules-test parameters: - name: ruleset_id in: path description: The unique identifier of the query ruleset to be created or updated required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: required: - match_criteria type: object properties: match_criteria: type: object additionalProperties: type: object description: "The match criteria to apply to rules in the given query ruleset.\nMatch criteria should match the keys defined in the `criteria.metadata` field of the rule." examples: QueryRulesetTestRequestExample1: description: "Run `PUT _query_rules/my-ruleset` to create a new query ruleset. Two rules are associated with `my-ruleset`. `my-rule1` will pin documents with IDs `id1` and `id2` when `user_query` contains `pugs` or `puggles` and `user_country` exactly matches `us`. `my-rule2` will exclude documents from different specified indices with IDs `id3` and `id4` when the `query_string` fuzzily matches `rescue dogs`.\n" value: "{\n \"rules\": [\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [ \"pugs\", \"puggles\" ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [ \"us\" ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [ \"rescue dogs\" ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ]\n}" x-codeSamples: - lang: Console source: "PUT _query_rules/my-ruleset\n{\n \"rules\": [\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [ \"pugs\", \"puggles\" ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [ \"us\" ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [ \"rescue dogs\" ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ]\n}" - lang: Python source: "resp = client.query_rules.put_ruleset(\n ruleset_id=\"my-ruleset\",\n rules=[\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"pugs\",\n \"puggles\"\n ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [\n \"us\"\n ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"rescue dogs\"\n ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ],\n)" - lang: JavaScript source: "const response = await client.queryRules.putRuleset({\n ruleset_id: \"my-ruleset\",\n rules: [\n {\n rule_id: \"my-rule1\",\n type: \"pinned\",\n criteria: [\n {\n type: \"contains\",\n metadata: \"user_query\",\n values: [\"pugs\", \"puggles\"],\n },\n {\n type: \"exact\",\n metadata: \"user_country\",\n values: [\"us\"],\n },\n ],\n actions: {\n ids: [\"id1\", \"id2\"],\n },\n },\n {\n rule_id: \"my-rule2\",\n type: \"pinned\",\n criteria: [\n {\n type: \"fuzzy\",\n metadata: \"user_query\",\n values: [\"rescue dogs\"],\n },\n ],\n actions: {\n docs: [\n {\n _index: \"index1\",\n _id: \"id3\",\n },\n {\n _index: \"index2\",\n _id: \"id4\",\n },\n ],\n },\n },\n ],\n});" - lang: Ruby source: "response = client.query_rules.put_ruleset(\n ruleset_id: \"my-ruleset\",\n body: {\n \"rules\": [\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"pugs\",\n \"puggles\"\n ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [\n \"us\"\n ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"rescue dogs\"\n ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->queryRules()->putRuleset([\n \"ruleset_id\" => \"my-ruleset\",\n \"body\" => [\n \"rules\" => array(\n [\n \"rule_id\" => \"my-rule1\",\n \"type\" => \"pinned\",\n \"criteria\" => array(\n [\n \"type\" => \"contains\",\n \"metadata\" => \"user_query\",\n \"values\" => array(\n \"pugs\",\n \"puggles\",\n ),\n ],\n [\n \"type\" => \"exact\",\n \"metadata\" => \"user_country\",\n \"values\" => array(\n \"us\",\n ),\n ],\n ),\n \"actions\" => [\n \"ids\" => array(\n \"id1\",\n \"id2\",\n ),\n ],\n ],\n [\n \"rule_id\" => \"my-rule2\",\n \"type\" => \"pinned\",\n \"criteria\" => array(\n [\n \"type\" => \"fuzzy\",\n \"metadata\" => \"user_query\",\n \"values\" => array(\n \"rescue dogs\",\n ),\n ],\n ),\n \"actions\" => [\n \"docs\" => array(\n [\n \"_index\" => \"index1\",\n \"_id\" => \"id3\",\n ],\n [\n \"_index\" => \"index2\",\n \"_id\" => \"id4\",\n ],\n ),\n ],\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"rules":[{"rule_id":"my-rule1","type":"pinned","criteria":[{"type":"contains","metadata":"user_query","values":["pugs","puggles"]},{"type":"exact","metadata":"user_country","values":["us"]}],"actions":{"ids":["id1","id2"]}},{"rule_id":"my-rule2","type":"pinned","criteria":[{"type":"fuzzy","metadata":"user_query","values":["rescue dogs"]}],"actions":{"docs":[{"_index":"index1","_id":"id3"},{"_index":"index2","_id":"id4"}]}}]}'' "$ELASTICSEARCH_URL/_query_rules/my-ruleset"' - lang: C# source: "var response = await client.QueryRules\n .PutRulesetAsync(rulesetId: \"my-ruleset\", d1 => d1\n .Rules(d2 => d2\n .Actions(d3 => d3\n .Ids([\"id1\", \"id2\"])\n )\n .Criteria(d3 => d3\n .Metadata(\"user_query\")\n .Type(QueryRuleCriteriaType.Contains)\n .Values([\"pugs\", \"puggles\"]), d3 => d3\n .Metadata(\"user_country\")\n .Type(QueryRuleCriteriaType.Exact)\n .Values([\"us\"])\n )\n .RuleId(\"my-rule1\")\n .Type(QueryRuleType.Pinned), d2 => d2\n .Actions(d3 => d3\n .Docs(d4 => d4\n .Id(\"id3\")\n .Index(\"index1\"), d4 => d4\n .Id(\"id4\")\n .Index(\"index2\")\n )\n )\n .Criteria(d3 => d3\n .Metadata(\"user_query\")\n .Type(QueryRuleCriteriaType.Fuzzy)\n .Values([\"rescue dogs\"])\n )\n .RuleId(\"my-rule2\")\n .Type(QueryRuleType.Pinned)\n )\n );" - lang: Java source: "client.queryRules().putRuleset(p -> p\n .rules(List.of(QueryRule.queryRuleOf(q -> q\n .ruleId(\"my-rule1\")\n .type(QueryRuleType.Pinned)\n .criteria(List.of(QueryRuleCriteria.of(qu -> qu\n .type(QueryRuleCriteriaType.Contains)\n .metadata(\"user_query\")\n .values(List.of(JsonData.fromJson(\"\\\"pugs\\\"\"),JsonData.fromJson(\"\\\"puggles\\\"\")))\n ),QueryRuleCriteria.of(qu -> qu\n .type(QueryRuleCriteriaType.Exact)\n .metadata(\"user_country\")\n .values(JsonData.fromJson(\"\\\"us\\\"\"))\n )))\n .actions(a -> a\n .ids(List.of(\"id1\",\"id2\"))\n )\n ),QueryRule.queryRuleOf(q -> q\n .ruleId(\"my-rule2\")\n .type(QueryRuleType.Pinned)\n .criteria(c -> c\n .type(QueryRuleCriteriaType.Fuzzy)\n .metadata(\"user_query\")\n .values(JsonData.fromJson(\"\\\"rescue dogs\\\"\"))\n )\n .actions(a -> a\n .docs(List.of(PinnedDoc.of(pi -> pi\n .id(\"id3\")\n .index(\"index1\")\n ),PinnedDoc.of(pi -> pi\n .id(\"id4\")\n .index(\"index2\")\n )))\n )\n )))\n .rulesetId(\"my-ruleset\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - total_matched_rules - matched_rules type: object properties: total_matched_rules: type: number matched_rules: type: array items: $ref: '#/components/schemas/query_rules.test.QueryRulesetMatchedRule' examples: QueryRulesetTestResponseExample1: description: A successful response from `POST _query_rules/my-ruleset/_test`. value: "{\n \"total_matched_rules\": 1,\n \"matched_rules\": [\n {\n \"ruleset_id\": \"my-ruleset\",\n \"rule_id\": \"my-rule1\"\n }\n ]\n}" x-state: Generally available; Added in 8.10.0 x-codeSamples: - lang: Console source: "PUT _query_rules/my-ruleset\n{\n \"rules\": [\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [ \"pugs\", \"puggles\" ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [ \"us\" ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [ \"rescue dogs\" ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ]\n}" - lang: Python source: "resp = client.query_rules.put_ruleset(\n ruleset_id=\"my-ruleset\",\n rules=[\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"pugs\",\n \"puggles\"\n ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [\n \"us\"\n ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"rescue dogs\"\n ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ],\n)" - lang: JavaScript source: "const response = await client.queryRules.putRuleset({\n ruleset_id: \"my-ruleset\",\n rules: [\n {\n rule_id: \"my-rule1\",\n type: \"pinned\",\n criteria: [\n {\n type: \"contains\",\n metadata: \"user_query\",\n values: [\"pugs\", \"puggles\"],\n },\n {\n type: \"exact\",\n metadata: \"user_country\",\n values: [\"us\"],\n },\n ],\n actions: {\n ids: [\"id1\", \"id2\"],\n },\n },\n {\n rule_id: \"my-rule2\",\n type: \"pinned\",\n criteria: [\n {\n type: \"fuzzy\",\n metadata: \"user_query\",\n values: [\"rescue dogs\"],\n },\n ],\n actions: {\n docs: [\n {\n _index: \"index1\",\n _id: \"id3\",\n },\n {\n _index: \"index2\",\n _id: \"id4\",\n },\n ],\n },\n },\n ],\n});" - lang: Ruby source: "response = client.query_rules.put_ruleset(\n ruleset_id: \"my-ruleset\",\n body: {\n \"rules\": [\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"pugs\",\n \"puggles\"\n ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [\n \"us\"\n ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"rescue dogs\"\n ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->queryRules()->putRuleset([\n \"ruleset_id\" => \"my-ruleset\",\n \"body\" => [\n \"rules\" => array(\n [\n \"rule_id\" => \"my-rule1\",\n \"type\" => \"pinned\",\n \"criteria\" => array(\n [\n \"type\" => \"contains\",\n \"metadata\" => \"user_query\",\n \"values\" => array(\n \"pugs\",\n \"puggles\",\n ),\n ],\n [\n \"type\" => \"exact\",\n \"metadata\" => \"user_country\",\n \"values\" => array(\n \"us\",\n ),\n ],\n ),\n \"actions\" => [\n \"ids\" => array(\n \"id1\",\n \"id2\",\n ),\n ],\n ],\n [\n \"rule_id\" => \"my-rule2\",\n \"type\" => \"pinned\",\n \"criteria\" => array(\n [\n \"type\" => \"fuzzy\",\n \"metadata\" => \"user_query\",\n \"values\" => array(\n \"rescue dogs\",\n ),\n ],\n ),\n \"actions\" => [\n \"docs\" => array(\n [\n \"_index\" => \"index1\",\n \"_id\" => \"id3\",\n ],\n [\n \"_index\" => \"index2\",\n \"_id\" => \"id4\",\n ],\n ),\n ],\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"rules":[{"rule_id":"my-rule1","type":"pinned","criteria":[{"type":"contains","metadata":"user_query","values":["pugs","puggles"]},{"type":"exact","metadata":"user_country","values":["us"]}],"actions":{"ids":["id1","id2"]}},{"rule_id":"my-rule2","type":"pinned","criteria":[{"type":"fuzzy","metadata":"user_query","values":["rescue dogs"]}],"actions":{"docs":[{"_index":"index1","_id":"id3"},{"_index":"index2","_id":"id4"}]}}]}'' "$ELASTICSEARCH_URL/_query_rules/my-ruleset"' - lang: C# source: "var response = await client.QueryRules\n .PutRulesetAsync(rulesetId: \"my-ruleset\", d1 => d1\n .Rules(d2 => d2\n .Actions(d3 => d3\n .Ids([\"id1\", \"id2\"])\n )\n .Criteria(d3 => d3\n .Metadata(\"user_query\")\n .Type(QueryRuleCriteriaType.Contains)\n .Values([\"pugs\", \"puggles\"]), d3 => d3\n .Metadata(\"user_country\")\n .Type(QueryRuleCriteriaType.Exact)\n .Values([\"us\"])\n )\n .RuleId(\"my-rule1\")\n .Type(QueryRuleType.Pinned), d2 => d2\n .Actions(d3 => d3\n .Docs(d4 => d4\n .Id(\"id3\")\n .Index(\"index1\"), d4 => d4\n .Id(\"id4\")\n .Index(\"index2\")\n )\n )\n .Criteria(d3 => d3\n .Metadata(\"user_query\")\n .Type(QueryRuleCriteriaType.Fuzzy)\n .Values([\"rescue dogs\"])\n )\n .RuleId(\"my-rule2\")\n .Type(QueryRuleType.Pinned)\n )\n );" - lang: Java source: "client.queryRules().putRuleset(p -> p\n .rules(List.of(QueryRule.queryRuleOf(q -> q\n .ruleId(\"my-rule1\")\n .type(QueryRuleType.Pinned)\n .criteria(List.of(QueryRuleCriteria.of(qu -> qu\n .type(QueryRuleCriteriaType.Contains)\n .metadata(\"user_query\")\n .values(List.of(JsonData.fromJson(\"\\\"pugs\\\"\"),JsonData.fromJson(\"\\\"puggles\\\"\")))\n ),QueryRuleCriteria.of(qu -> qu\n .type(QueryRuleCriteriaType.Exact)\n .metadata(\"user_country\")\n .values(JsonData.fromJson(\"\\\"us\\\"\"))\n )))\n .actions(a -> a\n .ids(List.of(\"id1\",\"id2\"))\n )\n ),QueryRule.queryRuleOf(q -> q\n .ruleId(\"my-rule2\")\n .type(QueryRuleType.Pinned)\n .criteria(c -> c\n .type(QueryRuleCriteriaType.Fuzzy)\n .metadata(\"user_query\")\n .values(JsonData.fromJson(\"\\\"rescue dogs\\\"\"))\n )\n .actions(a -> a\n .docs(List.of(PinnedDoc.of(pi -> pi\n .id(\"id3\")\n .index(\"index1\")\n ),PinnedDoc.of(pi -> pi\n .id(\"id4\")\n .index(\"index2\")\n )))\n )\n )))\n .rulesetId(\"my-ruleset\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_rank_eval': post: tags: - search summary: "Evaluate ranked search results\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_rank_eval\n
\n
\n POST\n /_rank_eval\n
\n
\n GET\n /{index}/_rank_eval\n
\n
\n POST\n /{index}/_rank_eval\n
\n \n\nEvaluate the quality of ranked search results over a set of typical search queries.\n\n## Required authorization\n\n* Index privileges: `read`\n" externalDocs: description: More about ranking evaluation url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/search-rank-eval x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/search-rank-eval.html operationId: rank-eval parameters: - $ref: '#/components/parameters/rank_eval-index' - $ref: '#/components/parameters/rank_eval-allow_no_indices' - $ref: '#/components/parameters/rank_eval-expand_wildcards' - $ref: '#/components/parameters/rank_eval-ignore_unavailable' - $ref: '#/components/parameters/rank_eval-search_type' requestBody: $ref: '#/components/requestBodies/rank_eval' responses: '200': $ref: '#/components/responses/rank_eval-200' x-state: Generally available; Added in 6.2.0 x-codeSamples: - lang: Console source: "GET /my-index-000001/_rank_eval\n{\n \"requests\": [\n {\n \"id\": \"JFK query\",\n \"request\": { \"query\": { \"match_all\": {} } },\n \"ratings\": []\n } ],\n \"metric\": {\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": false\n }\n }\n}" - lang: Python source: "resp = client.rank_eval(\n index=\"my-index-000001\",\n requests=[\n {\n \"id\": \"JFK query\",\n \"request\": {\n \"query\": {\n \"match_all\": {}\n }\n },\n \"ratings\": []\n }\n ],\n metric={\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": False\n }\n },\n)" - lang: JavaScript source: "const response = await client.rankEval({\n index: \"my-index-000001\",\n requests: [\n {\n id: \"JFK query\",\n request: {\n query: {\n match_all: {},\n },\n },\n ratings: [],\n },\n ],\n metric: {\n precision: {\n k: 20,\n relevant_rating_threshold: 1,\n ignore_unlabeled: false,\n },\n },\n});" - lang: Ruby source: "response = client.rank_eval(\n index: \"my-index-000001\",\n body: {\n \"requests\": [\n {\n \"id\": \"JFK query\",\n \"request\": {\n \"query\": {\n \"match_all\": {}\n }\n },\n \"ratings\": []\n }\n ],\n \"metric\": {\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": false\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->rankEval([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"requests\" => array(\n [\n \"id\" => \"JFK query\",\n \"request\" => [\n \"query\" => [\n \"match_all\" => new ArrayObject([]),\n ],\n ],\n \"ratings\" => array(\n ),\n ],\n ),\n \"metric\" => [\n \"precision\" => [\n \"k\" => 20,\n \"relevant_rating_threshold\" => 1,\n \"ignore_unlabeled\" => false,\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"requests":[{"id":"JFK query","request":{"query":{"match_all":{}}},"ratings":[]}],"metric":{"precision":{"k":20,"relevant_rating_threshold":1,"ignore_unlabeled":false}}}'' "$ELASTICSEARCH_URL/my-index-000001/_rank_eval"' - lang: C# source: "var response = await client\n .RankEvalAsync(d1 => d1\n .Indices(new[] { \"my-index-000001\" })\n .Metric(d2 => d2\n .Precision(d3 => d3\n .IgnoreUnlabeled(false)\n .K(20)\n .RelevantRatingThreshold(1)\n )\n )\n .Requests(d2 => d2\n .Id(\"JFK query\")\n .Ratings(new List())\n .Request(d3 => d3\n .Query(d4 => d4\n .MatchAll()\n )\n )\n )\n );" - lang: Java source: "client.rankEval(r -> r\n .index(\"my-index-000001\")\n .metric(m -> m\n .precision(p -> p\n .ignoreUnlabeled(false)\n .relevantRatingThreshold(1)\n .k(20)\n )\n )\n .requests(re -> re\n .id(\"JFK query\")\n .request(req -> req\n .query(q -> q\n .matchAll(m -> m)\n )\n )\n .ratings(List.of())\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_reindex/{task_id}/_rethrottle': post: tags: - document summary: Throttle a reindex operation description: "Change the maximum number of documents to index per second for a particular reindex operation.\nFor example, to unthrottle to unlimited documents per second:\n\n```\nPOST _reindex/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1\n```\n\nRethrottling that speeds up the query takes effect immediately.\nRethrottling that slows down the query will take effect after completing the current batch of documents.\nThis behavior prevents scroll timeouts.\n\nThis API follows reindex tasks across node-shutdown relocations, so callers can keep using\nthe original task ID throughout the lifetime of the operation.\nThe relocated task ID is also accepted and is followed transparently.\nIn either case, returned task IDs and timings reflect the original task, not its relocated successor.\n\nThe rethrottle may not have been applied to any tasks if either `node_failures` or `task_failures` are non-empty, or if the response contains\nno successfully rethrottled tasks — that is, no entries under `nodes` (returned with the default\n`group_by=nodes` in stack) or under `tasks` (returned in serverless, or in stack with\n`group_by=none` or `group_by=parents`).\n\n## Required authorization\n\n* Cluster privileges: `manage_reindex`\n" operationId: reindex-rethrottle parameters: - name: task_id in: path description: "The task identifier, returned when creating a reindex task, or by listing tasks via\n`GET /_reindex` or `GET /_tasks`.\nIn stack, can be either the original task ID or the task ID of the relocated task." required: true schema: $ref: '#/components/schemas/_types.Id' - name: requests_per_second in: query description: "The maximum number of documents to index per second, across the entire reindex operation (including slices).\nIt can be either `-1` to turn off throttling or any decimal number like `1.7` or `12` to throttle to that level." required: true schema: type: number - name: group_by in: query description: "The way to group the tasks in the response.\nWe recommend setting this to `none`, which provides the cleanest response format.\n\nSupported values include:\n - `nodes`: Group tasks by node ID.\n - `parents`: Group tasks by parent task ID.\n - `none`: Do not group tasks.\n\n" schema: allOf: - $ref: '#/components/schemas/tasks._types.GroupBy' default: nodes x-state: Generally available responses: '200': description: '' content: application/json: schema: type: object properties: node_failures: type: array items: $ref: '#/components/schemas/_types.ErrorCause' description: "Node-level failures encountered while applying the rethrottle request.\nWill return a `failed_node_exception` wrapping a `no_such_node_exception`,\nif a node handling the task either never existed, or has left the cluster, and one of the following is true:\n1. The task has completed.\n2. The task cannot be found.\n\nNote: Rethrottle handles relocations, so it should succeed if the task can be found and has not completed." task_failures: type: array items: $ref: '#/components/schemas/_types.TaskFailure' description: "Per-task failures encountered while applying the rethrottle.\nIf a rethrottle is attempted during a relocation handoff, the failure object reports `status: SERVICE_UNAVAILABLE` (the HTTP response itself is still `200 OK`).\nIn this case, the request can be retried until success." nodes: type: object additionalProperties: $ref: '#/components/schemas/_global.reindex_rethrottle.ReindexNode' description: 'Tasks grouped by node, returned only when `group_by=nodes` (the default).' tasks: allOf: - $ref: '#/components/schemas/_global.reindex_rethrottle.ReindexTasks' description: "The tasks that were successfully rethrottled.\nAlways returned in serverless.\nReturned with `group_by=none` or `group_by=parents` in stack." examples: ReindexRethrottleResponseExample1: summary: Successful rethrottle description: "A successful response from `POST _reindex/{task_id}/_rethrottle?requests_per_second=10`. This is the response shape always returned in serverless, and in stack only when `group_by=none`. Task IDs and timings reflect the original task across node-shutdown relocations.\n" value: "{\n \"tasks\": [\n {\n \"node\": \"r1A2WoRbTwKZ516z6NEs5A\",\n \"id\": 36619,\n \"type\": \"transport\",\n \"action\": \"indices:data/write/reindex\",\n \"status\": {\n \"total\": 11500,\n \"updated\": 0,\n \"created\": 4000,\n \"deleted\": 0,\n \"batches\": 4,\n \"version_conflicts\": 0,\n \"noops\": 0,\n \"retries\": {\n \"bulk\": 0,\n \"search\": 0\n },\n \"throttled_millis\": 0,\n \"requests_per_second\": 10.0,\n \"throttled_until_millis\": 0\n },\n \"description\": \"reindex from [my-source-index] to [my-dest-index]\",\n \"start_time_in_millis\": 1762190000000,\n \"running_time_in_nanos\": 4200000000,\n \"cancellable\": true,\n \"headers\": {}\n }\n ]\n}" ReindexRethrottleResponseExample2: summary: Task ID's node is not in the cluster description: "A successful response from `POST _reindex/{task_id}/_rethrottle` when the task ID's node is not in the cluster (for example, the node was shut down without relocation, or the task ID was never valid). The empty `tasks` array and `failed_node_exception` wrapping a `no_such_node_exception` indicate the task is gone.\n" value: "{\n \"node_failures\": [\n {\n \"type\": \"failed_node_exception\",\n \"reason\": \"Failed node [non_existing_node]\",\n \"node_id\": \"non_existing_node\",\n \"caused_by\": {\n \"type\": \"no_such_node_exception\",\n \"reason\": \"No such node [non_existing_node]\",\n \"node_id\": \"non_existing_node\"\n }\n }\n ],\n \"tasks\": []\n}" ReindexRethrottleResponseRelocationExample1: summary: Rethrottle during relocation (HTTP 200) description: "While the HTTP status remains `200 OK`, a rethrottle sent during a node-shutdown relocation handoff can return `task_failures` with `status: SERVICE_UNAVAILABLE` and a `status_exception` cause. Retry with the same task ID; the retry follows the relocated task until it succeeds.\n" value: "{\n \"task_failures\": [\n {\n \"task_id\": 36619,\n \"node_id\": \"r1A2WoRbTwKZ516z6NEs5A\",\n \"status\": \"SERVICE_UNAVAILABLE\",\n \"reason\": {\n \"type\": \"status_exception\",\n \"reason\": \"cannot rethrottle, task is being relocated\"\n }\n }\n ],\n \"tasks\": {}\n}" x-state: Generally available; Added in 2.4.0 x-codeSamples: - lang: Console source: "POST _reindex/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1\n" - lang: Python source: "resp = client.reindex_rethrottle(\n task_id=\"r1A2WoRbTwKZ516z6NEs5A:36619\",\n requests_per_second=\"-1\",\n)" - lang: JavaScript source: "const response = await client.reindexRethrottle({\n task_id: \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n requests_per_second: \"-1\",\n});" - lang: Ruby source: "response = client.reindex_rethrottle(\n task_id: \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n requests_per_second: \"-1\"\n)" - lang: PHP source: "$resp = $client->reindexRethrottle([\n \"task_id\" => \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n \"requests_per_second\" => \"-1\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_reindex/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1"' - lang: C# source: "var response = await client\n .ReindexRethrottleAsync(taskId: \"r1A2WoRbTwKZ516z6NEs5A:36619\", d1 => d1\n .RequestsPerSecond(-1f)\n );" - lang: Java source: "client.reindexRethrottle(r -> r\n .requestsPerSecond(-1.0F)\n .taskId(\"r1A2WoRbTwKZ516z6NEs5A:36619\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_render/template/{id}': post: tags: - search summary: "Render a search template\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_render/template\n
\n
\n POST\n /_render/template\n
\n
\n GET\n /_render/template/{id}\n
\n
\n POST\n /_render/template/{id}\n
\n \n\nRender a search template as a search request body.\n\n## Required authorization\n\n* Index privileges: `read`\n" operationId: render-search-template parameters: - $ref: '#/components/parameters/render_search_template-id' requestBody: $ref: '#/components/requestBodies/render_search_template' responses: '200': $ref: '#/components/responses/render_search_template-200' x-state: Generally available x-codeSamples: - lang: Console source: "POST _render/template\n{\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n }\n}" - lang: Python source: "resp = client.render_search_template(\n id=\"my-search-template\",\n params={\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n },\n)" - lang: JavaScript source: "const response = await client.renderSearchTemplate({\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 20,\n size: 10,\n },\n});" - lang: Ruby source: "response = client.render_search_template(\n body: {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n }\n }\n)" - lang: PHP source: "$resp = $client->renderSearchTemplate([\n \"body\" => [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 20,\n \"size\" => 10,\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"id":"my-search-template","params":{"query_string":"hello world","from":20,"size":10}}'' "$ELASTICSEARCH_URL/_render/template"' - lang: C# source: "var response = await client\n .RenderSearchTemplateAsync(d1 => d1\n .Id(\"my-search-template\")\n .Params(new Dictionary()\n {\n { \"query_string\", \"hello world\" },\n { \"from\", 20 },\n { \"size\", 10 }\n })\n );" - lang: Java source: "client.renderSearchTemplate(r -> r\n .id(\"my-search-template\")\n .params(Map.of(\"size\", JsonData.fromJson(\"10\"),\"from\", JsonData.fromJson(\"20\"),\"query_string\", JsonData.fromJson(\"\\\"hello world\\\"\")))\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_rollup/job/{id}': get: tags: - rollup summary: "Get rollup job information\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_rollup/job\n
\n
\n GET\n /_rollup/job/{id}\n
\n \n\nGet the configuration, stats, and status of rollup jobs.\n\nNOTE: This API returns only active (both `STARTED` and `STOPPED`) jobs.\nIf a job was created, ran for a while, then was deleted, the API does not return any details about it.\nFor details about a historical rollup job, the rollup capabilities API may be more useful.\n\n## Required authorization\n\n* Cluster privileges: `monitor_rollup`\n" operationId: rollup-get-jobs parameters: - $ref: '#/components/parameters/rollup.get_jobs-id' responses: '200': $ref: '#/components/responses/rollup.get_jobs-200' deprecated: true x-state: Experimental; Added in 6.3.0 x-codeSamples: - lang: Console source: "GET _rollup/job/sensor\n" - lang: Python source: "resp = client.rollup.get_jobs(\n id=\"sensor\",\n)" - lang: JavaScript source: "const response = await client.rollup.getJobs({\n id: \"sensor\",\n});" - lang: Ruby source: "response = client.perform_request(\n \"GET\",\n \"/_rollup/job/sensor\",\n {},\n)" - lang: PHP source: "$resp = $client->rollup()->getJobs([\n \"id\" => \"sensor\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_rollup/job/sensor"' - lang: C# source: "var response = await client.Rollup\n .GetJobsAsync(d1 => d1\n .Id(\"sensor\")\n );" - lang: Java source: "client.rollup().getJobs(g -> g\n .id(\"sensor\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - rollup summary: Create a rollup job description: "WARNING: From 8.15.0, calling this API in a cluster with no rollup usage will fail with a message about the deprecation and planned removal of rollup features. A cluster needs to contain either a rollup job or a rollup index in order for this API to be allowed to run.\n\nThe rollup job configuration contains all the details about how the job should run, when it indexes documents, and what future queries will be able to run against the rollup index.\n\nThere are three main sections to the job configuration: the logistical details about the job (for example, the cron schedule), the fields that are used for grouping, and what metrics to collect for each group.\n\nJobs are created in a `STOPPED` state. You can start them with the start rollup jobs API.\n\n## Required authorization\n\n* Cluster privileges: `manage`,`manage_rollup`\n" operationId: rollup-put-job parameters: - name: id in: path description: "Identifier for the rollup job. This can be any alphanumeric string and uniquely identifies the\ndata that is associated with the rollup job. The ID is persistent; it is stored with the rolled\nup data. If you create a job, let it run for a while, then delete the job, the data that the job\nrolled up is still be associated with this job ID. You cannot create a new job with the same ID\nsince that could lead to problems with mismatched job configurations." required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: required: - cron - groups - index_pattern - page_size - rollup_index type: object properties: cron: type: string description: "A cron string which defines the intervals when the rollup job should be executed. When the interval\ntriggers, the indexer attempts to rollup the data in the index pattern. The cron pattern is unrelated\nto the time interval of the data being rolled up. For example, you may wish to create hourly rollups\nof your document but to only run the indexer on a daily basis at midnight, as defined by the cron. The\ncron pattern is defined just like a Watcher cron schedule." groups: allOf: - $ref: '#/components/schemas/rollup._types.Groupings' description: "Defines the grouping fields and aggregations that are defined for this rollup job. These fields will then be\navailable later for aggregating into buckets. These aggs and fields can be used in any combination. Think of\nthe groups configuration as defining a set of tools that can later be used in aggregations to partition the\ndata. Unlike raw data, we have to think ahead to which fields and aggregations might be used. Rollups provide\nenough flexibility that you simply need to determine which fields are needed, not in what order they are needed." index_pattern: type: string description: "The index or index pattern to roll up. Supports wildcard-style patterns (`logstash-*`). The job attempts to\nrollup the entire index or index-pattern." metrics: type: array items: $ref: '#/components/schemas/rollup._types.FieldMetric' description: "Defines the metrics to collect for each grouping tuple. By default, only the doc_counts are collected for each\ngroup. To make rollup useful, you will often add metrics like averages, mins, maxes, etc. Metrics are defined\non a per-field basis and for each field you configure which metric should be collected." page_size: type: number description: "The number of bucket results that are processed on each iteration of the rollup indexer. A larger value tends\nto execute faster, but requires more memory during processing. This value has no effect on how the data is\nrolled up; it is merely used for tweaking the speed or memory cost of the indexer." rollup_index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: The index that contains the rollup results. The index can be shared with other rollup jobs. The data is stored so that it doesn’t interfere with unrelated jobs. timeout: allOf: - $ref: '#/components/schemas/_types.Duration' description: Time to wait for the request to complete. default: 20s headers: allOf: - $ref: '#/components/schemas/_types.HttpHeaders' examples: CreateRollupJobRequestExample1: description: "Run `PUT _rollup/job/sensor` to create a rollup job that targets the `sensor-*` index pattern. This configuration enables date histograms to be used on the `timestamp` field and terms aggregations to be used on the `node` field. This configuration defines metrics over two fields: `temperature` and `voltage`. For the `temperature` field, it collects the `min`, `max`, and `sum` of the temperature. For `voltage`, it collects the `average`.\n" value: "{\n \"index_pattern\": \"sensor-*\",\n \"rollup_index\": \"sensor_rollup\",\n \"cron\": \"*/30 * * * * ?\",\n \"page_size\": 1000,\n \"groups\": {\n \"date_histogram\": {\n \"field\": \"timestamp\",\n \"fixed_interval\": \"1h\",\n \"delay\": \"7d\"\n },\n \"terms\": {\n \"fields\": [ \"node\" ]\n }\n },\n \"metrics\": [\n {\n \"field\": \"temperature\",\n \"metrics\": [ \"min\", \"max\", \"sum\" ]\n },\n {\n \"field\": \"voltage\",\n \"metrics\": [ \"avg\" ]\n }\n ]\n}" x-codeSamples: - lang: Console source: "PUT _rollup/job/sensor\n{\n \"index_pattern\": \"sensor-*\",\n \"rollup_index\": \"sensor_rollup\",\n \"cron\": \"*/30 * * * * ?\",\n \"page_size\": 1000,\n \"groups\": {\n \"date_histogram\": {\n \"field\": \"timestamp\",\n \"fixed_interval\": \"1h\",\n \"delay\": \"7d\"\n },\n \"terms\": {\n \"fields\": [ \"node\" ]\n }\n },\n \"metrics\": [\n {\n \"field\": \"temperature\",\n \"metrics\": [ \"min\", \"max\", \"sum\" ]\n },\n {\n \"field\": \"voltage\",\n \"metrics\": [ \"avg\" ]\n }\n ]\n}" - lang: Python source: "resp = client.rollup.put_job(\n id=\"sensor\",\n index_pattern=\"sensor-*\",\n rollup_index=\"sensor_rollup\",\n cron=\"*/30 * * * * ?\",\n page_size=1000,\n groups={\n \"date_histogram\": {\n \"field\": \"timestamp\",\n \"fixed_interval\": \"1h\",\n \"delay\": \"7d\"\n },\n \"terms\": {\n \"fields\": [\n \"node\"\n ]\n }\n },\n metrics=[\n {\n \"field\": \"temperature\",\n \"metrics\": [\n \"min\",\n \"max\",\n \"sum\"\n ]\n },\n {\n \"field\": \"voltage\",\n \"metrics\": [\n \"avg\"\n ]\n }\n ],\n)" - lang: JavaScript source: "const response = await client.rollup.putJob({\n id: \"sensor\",\n index_pattern: \"sensor-*\",\n rollup_index: \"sensor_rollup\",\n cron: \"*/30 * * * * ?\",\n page_size: 1000,\n groups: {\n date_histogram: {\n field: \"timestamp\",\n fixed_interval: \"1h\",\n delay: \"7d\",\n },\n terms: {\n fields: [\"node\"],\n },\n },\n metrics: [\n {\n field: \"temperature\",\n metrics: [\"min\", \"max\", \"sum\"],\n },\n {\n field: \"voltage\",\n metrics: [\"avg\"],\n },\n ],\n});" - lang: Ruby source: "response = client.perform_request(\n \"PUT\",\n \"/_rollup/job/sensor\",\n {},\n {\n \"index_pattern\": \"sensor-*\",\n \"rollup_index\": \"sensor_rollup\",\n \"cron\": \"*/30 * * * * ?\",\n \"page_size\": 1000,\n \"groups\": {\n \"date_histogram\": {\n \"field\": \"timestamp\",\n \"fixed_interval\": \"1h\",\n \"delay\": \"7d\"\n },\n \"terms\": {\n \"fields\": [\n \"node\"\n ]\n }\n },\n \"metrics\": [\n {\n \"field\": \"temperature\",\n \"metrics\": [\n \"min\",\n \"max\",\n \"sum\"\n ]\n },\n {\n \"field\": \"voltage\",\n \"metrics\": [\n \"avg\"\n ]\n }\n ]\n },\n { \"Content-Type\": \"application/json\" },\n)" - lang: PHP source: "$resp = $client->rollup()->putJob([\n \"id\" => \"sensor\",\n \"body\" => [\n \"index_pattern\" => \"sensor-*\",\n \"rollup_index\" => \"sensor_rollup\",\n \"cron\" => \"*/30 * * * * ?\",\n \"page_size\" => 1000,\n \"groups\" => [\n \"date_histogram\" => [\n \"field\" => \"timestamp\",\n \"fixed_interval\" => \"1h\",\n \"delay\" => \"7d\",\n ],\n \"terms\" => [\n \"fields\" => array(\n \"node\",\n ),\n ],\n ],\n \"metrics\" => array(\n [\n \"field\" => \"temperature\",\n \"metrics\" => array(\n \"min\",\n \"max\",\n \"sum\",\n ),\n ],\n [\n \"field\" => \"voltage\",\n \"metrics\" => array(\n \"avg\",\n ),\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"index_pattern":"sensor-*","rollup_index":"sensor_rollup","cron":"*/30 * * * * ?","page_size":1000,"groups":{"date_histogram":{"field":"timestamp","fixed_interval":"1h","delay":"7d"},"terms":{"fields":["node"]}},"metrics":[{"field":"temperature","metrics":["min","max","sum"]},{"field":"voltage","metrics":["avg"]}]}'' "$ELASTICSEARCH_URL/_rollup/job/sensor"' - lang: C# source: "var response = await client.Rollup\n .PutJobAsync(id: \"sensor\", d1 => d1\n .Cron(\"*/30 * * * * ?\")\n .Groups(d2 => d2\n .DateHistogram(d3 => d3\n .Delay(\"7d\")\n .Field(x => x.Timestamp)\n .FixedInterval(\"1h\")\n )\n .Terms(d3 => d3\n .Fields(x => x.Node)\n )\n )\n .IndexPattern(\"sensor-*\")\n .Metrics(d2 => d2\n .Field(x => x.Temperature)\n .Metrics(Metric.Min, Metric.Max, Metric.Sum), d2 => d2\n .Field(x => x.Voltage)\n .Metrics(Metric.Avg)\n )\n .PageSize(1000)\n .RollupIndex(\"sensor_rollup\")\n );" - lang: Java source: "client.rollup().putJob(p -> p\n .cron(\"*/30 * * * * ?\")\n .groups(g -> g\n .dateHistogram(d -> d\n .delay(de -> de\n .time(\"7d\")\n )\n .field(\"timestamp\")\n .fixedInterval(f -> f\n .time(\"1h\")\n )\n )\n .terms(t -> t\n .fields(\"node\")\n )\n )\n .id(\"sensor\")\n .indexPattern(\"sensor-*\")\n .metrics(List.of(FieldMetric.of(f -> f\n .field(\"temperature\")\n .metrics(List.of(Metric.Min,Metric.Max,Metric.Sum))\n ),FieldMetric.of(f -> f\n .field(\"voltage\")\n .metrics(Metric.Avg)\n )))\n .pageSize(1000)\n .rollupIndex(\"sensor_rollup\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: CreateRollupJobResponseExample1: value: "{\n \"acknowledged\": true\n}" deprecated: true x-state: Experimental; Added in 6.3.0 x-codeSamples: - lang: Console source: "PUT _rollup/job/sensor\n{\n \"index_pattern\": \"sensor-*\",\n \"rollup_index\": \"sensor_rollup\",\n \"cron\": \"*/30 * * * * ?\",\n \"page_size\": 1000,\n \"groups\": {\n \"date_histogram\": {\n \"field\": \"timestamp\",\n \"fixed_interval\": \"1h\",\n \"delay\": \"7d\"\n },\n \"terms\": {\n \"fields\": [ \"node\" ]\n }\n },\n \"metrics\": [\n {\n \"field\": \"temperature\",\n \"metrics\": [ \"min\", \"max\", \"sum\" ]\n },\n {\n \"field\": \"voltage\",\n \"metrics\": [ \"avg\" ]\n }\n ]\n}" - lang: Python source: "resp = client.rollup.put_job(\n id=\"sensor\",\n index_pattern=\"sensor-*\",\n rollup_index=\"sensor_rollup\",\n cron=\"*/30 * * * * ?\",\n page_size=1000,\n groups={\n \"date_histogram\": {\n \"field\": \"timestamp\",\n \"fixed_interval\": \"1h\",\n \"delay\": \"7d\"\n },\n \"terms\": {\n \"fields\": [\n \"node\"\n ]\n }\n },\n metrics=[\n {\n \"field\": \"temperature\",\n \"metrics\": [\n \"min\",\n \"max\",\n \"sum\"\n ]\n },\n {\n \"field\": \"voltage\",\n \"metrics\": [\n \"avg\"\n ]\n }\n ],\n)" - lang: JavaScript source: "const response = await client.rollup.putJob({\n id: \"sensor\",\n index_pattern: \"sensor-*\",\n rollup_index: \"sensor_rollup\",\n cron: \"*/30 * * * * ?\",\n page_size: 1000,\n groups: {\n date_histogram: {\n field: \"timestamp\",\n fixed_interval: \"1h\",\n delay: \"7d\",\n },\n terms: {\n fields: [\"node\"],\n },\n },\n metrics: [\n {\n field: \"temperature\",\n metrics: [\"min\", \"max\", \"sum\"],\n },\n {\n field: \"voltage\",\n metrics: [\"avg\"],\n },\n ],\n});" - lang: Ruby source: "response = client.perform_request(\n \"PUT\",\n \"/_rollup/job/sensor\",\n {},\n {\n \"index_pattern\": \"sensor-*\",\n \"rollup_index\": \"sensor_rollup\",\n \"cron\": \"*/30 * * * * ?\",\n \"page_size\": 1000,\n \"groups\": {\n \"date_histogram\": {\n \"field\": \"timestamp\",\n \"fixed_interval\": \"1h\",\n \"delay\": \"7d\"\n },\n \"terms\": {\n \"fields\": [\n \"node\"\n ]\n }\n },\n \"metrics\": [\n {\n \"field\": \"temperature\",\n \"metrics\": [\n \"min\",\n \"max\",\n \"sum\"\n ]\n },\n {\n \"field\": \"voltage\",\n \"metrics\": [\n \"avg\"\n ]\n }\n ]\n },\n { \"Content-Type\": \"application/json\" },\n)" - lang: PHP source: "$resp = $client->rollup()->putJob([\n \"id\" => \"sensor\",\n \"body\" => [\n \"index_pattern\" => \"sensor-*\",\n \"rollup_index\" => \"sensor_rollup\",\n \"cron\" => \"*/30 * * * * ?\",\n \"page_size\" => 1000,\n \"groups\" => [\n \"date_histogram\" => [\n \"field\" => \"timestamp\",\n \"fixed_interval\" => \"1h\",\n \"delay\" => \"7d\",\n ],\n \"terms\" => [\n \"fields\" => array(\n \"node\",\n ),\n ],\n ],\n \"metrics\" => array(\n [\n \"field\" => \"temperature\",\n \"metrics\" => array(\n \"min\",\n \"max\",\n \"sum\",\n ),\n ],\n [\n \"field\" => \"voltage\",\n \"metrics\" => array(\n \"avg\",\n ),\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"index_pattern":"sensor-*","rollup_index":"sensor_rollup","cron":"*/30 * * * * ?","page_size":1000,"groups":{"date_histogram":{"field":"timestamp","fixed_interval":"1h","delay":"7d"},"terms":{"fields":["node"]}},"metrics":[{"field":"temperature","metrics":["min","max","sum"]},{"field":"voltage","metrics":["avg"]}]}'' "$ELASTICSEARCH_URL/_rollup/job/sensor"' - lang: C# source: "var response = await client.Rollup\n .PutJobAsync(id: \"sensor\", d1 => d1\n .Cron(\"*/30 * * * * ?\")\n .Groups(d2 => d2\n .DateHistogram(d3 => d3\n .Delay(\"7d\")\n .Field(x => x.Timestamp)\n .FixedInterval(\"1h\")\n )\n .Terms(d3 => d3\n .Fields(x => x.Node)\n )\n )\n .IndexPattern(\"sensor-*\")\n .Metrics(d2 => d2\n .Field(x => x.Temperature)\n .Metrics(Metric.Min, Metric.Max, Metric.Sum), d2 => d2\n .Field(x => x.Voltage)\n .Metrics(Metric.Avg)\n )\n .PageSize(1000)\n .RollupIndex(\"sensor_rollup\")\n );" - lang: Java source: "client.rollup().putJob(p -> p\n .cron(\"*/30 * * * * ?\")\n .groups(g -> g\n .dateHistogram(d -> d\n .delay(de -> de\n .time(\"7d\")\n )\n .field(\"timestamp\")\n .fixedInterval(f -> f\n .time(\"1h\")\n )\n )\n .terms(t -> t\n .fields(\"node\")\n )\n )\n .id(\"sensor\")\n .indexPattern(\"sensor-*\")\n .metrics(List.of(FieldMetric.of(f -> f\n .field(\"temperature\")\n .metrics(List.of(Metric.Min,Metric.Max,Metric.Sum))\n ),FieldMetric.of(f -> f\n .field(\"voltage\")\n .metrics(Metric.Avg)\n )))\n .pageSize(1000)\n .rollupIndex(\"sensor_rollup\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - rollup summary: Delete a rollup job description: "A job must be stopped before it can be deleted.\nIf you attempt to delete a started job, an error occurs.\nSimilarly, if you attempt to delete a nonexistent job, an exception occurs.\n\nIMPORTANT: When you delete a job, you remove only the process that is actively monitoring and rolling up data.\nThe API does not delete any previously rolled up data.\nThis is by design; a user may wish to roll up a static data set.\nBecause the data set is static, after it has been fully rolled up there is no need to keep the indexing rollup job around (as there will be no new data).\nThus the job can be deleted, leaving behind the rolled up data for analysis.\nIf you wish to also remove the rollup data and the rollup index contains the data for only a single job, you can delete the whole rollup index.\nIf the rollup index stores data from several jobs, you must issue a delete-by-query that targets the rollup job's identifier in the rollup index. For example:\n\n```\nPOST my_rollup_index/_delete_by_query\n{\n \"query\": {\n \"term\": {\n \"_rollup.id\": \"the_rollup_job_id\"\n }\n }\n}\n```\n\n## Required authorization\n\n* Cluster privileges: `manage_rollup`\n" operationId: rollup-delete-job parameters: - name: id in: path description: Identifier for the job. required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: required: - acknowledged type: object properties: acknowledged: type: boolean task_failures: type: array items: $ref: '#/components/schemas/_types.TaskFailure' examples: DeleteRollupJobResponseExample1: description: A successful response from `DELETE _rollup/job/sensor`. value: "{\n \"acknowledged\": true\n}" deprecated: true x-state: Experimental; Added in 6.3.0 x-codeSamples: - lang: Console source: "DELETE _rollup/job/sensor\n" - lang: Python source: "resp = client.rollup.delete_job(\n id=\"sensor\",\n)" - lang: JavaScript source: "const response = await client.rollup.deleteJob({\n id: \"sensor\",\n});" - lang: Ruby source: "response = client.perform_request(\n \"DELETE\",\n \"/_rollup/job/sensor\",\n {},\n)" - lang: PHP source: "$resp = $client->rollup()->deleteJob([\n \"id\" => \"sensor\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_rollup/job/sensor"' - lang: C# source: 'var response = await client.Rollup.DeleteJobAsync(id: "sensor");' - lang: Java source: "client.rollup().deleteJob(d -> d\n .id(\"sensor\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_rollup/data/{id}': get: tags: - rollup summary: "Get the rollup job capabilities\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_rollup/data\n
\n
\n GET\n /_rollup/data/{id}\n
\n \n\nGet the capabilities of any rollup jobs that have been configured for a specific index or index pattern.\n\nThis API is useful because a rollup job is often configured to rollup only a subset of fields from the source index.\nFurthermore, only certain aggregations can be configured for various fields, leading to a limited subset of functionality depending on that configuration.\nThis API enables you to inspect an index and determine:\n\n1. Does this index have associated rollup data somewhere in the cluster?\n2. If yes to the first question, what fields were rolled up, what aggregations can be performed, and where does the data live?\n\n## Required authorization\n\n* Cluster privileges: `monitor_rollup`\n" operationId: rollup-get-rollup-caps parameters: - $ref: '#/components/parameters/rollup.get_rollup_caps-id' responses: '200': $ref: '#/components/responses/rollup.get_rollup_caps-200' deprecated: true x-state: Experimental; Added in 6.3.0 x-codeSamples: - lang: Console source: "GET _rollup/data/sensor-*\n" - lang: Python source: "resp = client.rollup.get_rollup_caps(\n id=\"sensor-*\",\n)" - lang: JavaScript source: "const response = await client.rollup.getRollupCaps({\n id: \"sensor-*\",\n});" - lang: Ruby source: "response = client.perform_request(\n \"GET\",\n \"/_rollup/data/sensor-*\",\n {},\n)" - lang: PHP source: "$resp = $client->rollup()->getRollupCaps([\n \"id\" => \"sensor-*\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_rollup/data/sensor-*"' - lang: C# source: "var response = await client.Rollup\n .GetRollupCapsAsync(d1 => d1\n .Id(\"sensor-*\")\n );" - lang: Java source: "client.rollup().getRollupCaps(g -> g\n .id(\"sensor-*\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_rollup/data': get: tags: - rollup summary: Get the rollup index capabilities description: "Get the rollup capabilities of all jobs inside of a rollup index.\nA single rollup index may store the data for multiple rollup jobs and may have a variety of capabilities depending on those jobs. This API enables you to determine:\n\n* What jobs are stored in an index (or indices specified via a pattern)?\n* What target indices were rolled up, what fields were used in those rollups, and what aggregations can be performed on each job?\n\n## Required authorization\n\n* Index privileges: `read`\n" operationId: rollup-get-rollup-index-caps parameters: - name: index in: path description: "Data stream or index to check for rollup capabilities.\nWildcard (`*`) expressions are supported." required: true schema: $ref: '#/components/schemas/_types.Ids' responses: '200': description: '' content: application/json: schema: type: object additionalProperties: $ref: '#/components/schemas/rollup.get_rollup_index_caps.IndexCapabilities' examples: GetRollupIndexCapabilitiesResponseExample1: description: "A successful response from `GET /sensor_rollup/_rollup/data`. The response contains the rollup job ID, the index that holds the rolled data, and the index pattern that the job was targeting. It also shows a list of fields that contain data eligible for rollup searches. For example, you can use a `min`, `max`, or `sum` aggregation on the `temperature` field, but only a `date_histogram` on `timestamp`.\n" value: "{\n \"sensor_rollup\" : {\n \"rollup_jobs\" : [\n {\n \"job_id\" : \"sensor\",\n \"rollup_index\" : \"sensor_rollup\",\n \"index_pattern\" : \"sensor-*\",\n \"fields\" : {\n \"node\" : [\n {\n \"agg\" : \"terms\"\n }\n ],\n \"temperature\" : [\n {\n \"agg\" : \"min\"\n },\n {\n \"agg\" : \"max\"\n },\n {\n \"agg\" : \"sum\"\n }\n ],\n \"timestamp\" : [\n {\n \"agg\" : \"date_histogram\",\n \"time_zone\" : \"UTC\",\n \"fixed_interval\" : \"1h\",\n \"delay\": \"7d\"\n }\n ],\n \"voltage\" : [\n {\n \"agg\" : \"avg\"\n }\n ]\n }\n }\n ]\n }\n}" deprecated: true x-state: Experimental; Added in 6.4.0 x-codeSamples: - lang: Console source: "GET /sensor_rollup/_rollup/data\n" - lang: Python source: "resp = client.rollup.get_rollup_index_caps(\n index=\"sensor_rollup\",\n)" - lang: JavaScript source: "const response = await client.rollup.getRollupIndexCaps({\n index: \"sensor_rollup\",\n});" - lang: Ruby source: "response = client.perform_request(\n \"GET\",\n \"/sensor_rollup/_rollup/data\",\n {},\n)" - lang: PHP source: "$resp = $client->rollup()->getRollupIndexCaps([\n \"index\" => \"sensor_rollup\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/sensor_rollup/_rollup/data"' - lang: C# source: 'var response = await client.Rollup.GetRollupIndexCapsAsync(index: new[] { "sensor_rollup" });' - lang: Java source: "client.rollup().getRollupIndexCaps(g -> g\n .index(\"sensor_rollup\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_rollup_search': post: tags: - rollup summary: "Search rolled-up data\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /{index}/_rollup_search\n
\n
\n POST\n /{index}/_rollup_search\n
\n \n\nThe rollup search endpoint is needed because, internally, rolled-up documents utilize a different document structure than the original data.\nIt rewrites standard Query DSL into a format that matches the rollup documents then takes the response and rewrites it back to what a client would expect given the original query.\n\nThe request body supports a subset of features from the regular search API.\nThe following functionality is not available:\n\n`size`: Because rollups work on pre-aggregated data, no search hits can be returned and so size must be set to zero or omitted entirely.\n`highlighter`, `suggestors`, `post_filter`, `profile`, `explain`: These are similarly disallowed.\n\nFor more detailed examples of using the rollup search API, including querying rolled-up data only or combining rolled-up and live data, refer to the External documentation." externalDocs: description: Getting started with rollups url: https://www.elastic.co/docs/manage-data/lifecycle/rollup/getting-started-api#historical-only-search-example x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/rollup-search.html operationId: rollup-rollup-search parameters: - $ref: '#/components/parameters/rollup.rollup_search-index' - $ref: '#/components/parameters/rollup.rollup_search-rest_total_hits_as_int' - $ref: '#/components/parameters/rollup.rollup_search-typed_keys' requestBody: $ref: '#/components/requestBodies/rollup.rollup_search' responses: '200': $ref: '#/components/responses/rollup.rollup_search-200' deprecated: true x-state: Experimental; Added in 6.3.0 x-codeSamples: - lang: Console source: "GET /sensor_rollup/_rollup_search\n{\n \"size\": 0,\n \"aggregations\": {\n \"max_temperature\": {\n \"max\": {\n \"field\": \"temperature\"\n }\n }\n }\n}" - lang: Python source: "resp = client.rollup.rollup_search(\n index=\"sensor_rollup\",\n size=0,\n aggregations={\n \"max_temperature\": {\n \"max\": {\n \"field\": \"temperature\"\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.rollup.rollupSearch({\n index: \"sensor_rollup\",\n size: 0,\n aggregations: {\n max_temperature: {\n max: {\n field: \"temperature\",\n },\n },\n },\n});" - lang: Ruby source: "response = client.perform_request(\n \"GET\",\n \"/sensor_rollup/_rollup_search\",\n {},\n {\n \"size\": 0,\n \"aggregations\": {\n \"max_temperature\": {\n \"max\": {\n \"field\": \"temperature\"\n }\n }\n }\n },\n { \"Content-Type\": \"application/json\" },\n)" - lang: PHP source: "$resp = $client->rollup()->rollupSearch([\n \"index\" => \"sensor_rollup\",\n \"body\" => [\n \"size\" => 0,\n \"aggregations\" => [\n \"max_temperature\" => [\n \"max\" => [\n \"field\" => \"temperature\",\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"size":0,"aggregations":{"max_temperature":{"max":{"field":"temperature"}}}}'' "$ELASTICSEARCH_URL/sensor_rollup/_rollup_search"' - lang: C# source: "var response = await client.Rollup\n .RollupSearchAsync(indices: new[] { \"sensor_rollup\" }, d1 => d1\n .Aggregations(d2 => d2\n .Add(\"max_temperature\", d3 => d3\n .Max(d4 => d4\n .Field(x => x.Temperature)\n )\n )\n )\n .Size(0)\n );" - lang: Java source: "client.rollup().rollupSearch(r -> r\n .aggregations(\"max_temperature\", a -> a\n .max(m -> m\n .field(\"temperature\")\n )\n )\n .index(\"sensor_rollup\")\n .size(0)\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_rollup/job/{id}/_start': post: tags: - rollup summary: Start rollup jobs description: "If you try to start a job that does not exist, an exception occurs.\nIf you try to start a job that is already started, nothing happens.\n\n## Required authorization\n\n* Cluster privileges: `manage_rollup`\n" operationId: rollup-start-job parameters: - name: id in: path description: Identifier for the rollup job. required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: required: - started type: object properties: started: type: boolean examples: StartRollupJobResponseExample1: description: A successful response from `POST _rollup/job/sensor/_start`. value: "{\n \"started\": true\n}" deprecated: true x-state: Experimental; Added in 6.3.0 x-codeSamples: - lang: Console source: "POST _rollup/job/sensor/_start\n" - lang: Python source: "resp = client.rollup.start_job(\n id=\"sensor\",\n)" - lang: JavaScript source: "const response = await client.rollup.startJob({\n id: \"sensor\",\n});" - lang: Ruby source: "response = client.perform_request(\n \"POST\",\n \"/_rollup/job/sensor/_start\",\n {},\n)" - lang: PHP source: "$resp = $client->rollup()->startJob([\n \"id\" => \"sensor\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_rollup/job/sensor/_start"' - lang: C# source: 'var response = await client.Rollup.StartJobAsync(id: "sensor");' - lang: Java source: "client.rollup().startJob(s -> s\n .id(\"sensor\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_rollup/job/{id}/_stop': post: tags: - rollup summary: Stop rollup jobs description: "If you try to stop a job that does not exist, an exception occurs.\nIf you try to stop a job that is already stopped, nothing happens.\n\nSince only a stopped job can be deleted, it can be useful to block the API until the indexer has fully stopped.\nThis is accomplished with the `wait_for_completion` query parameter, and optionally a timeout. For example:\n\n```\nPOST _rollup/job/sensor/_stop?wait_for_completion=true&timeout=10s\n```\nThe parameter blocks the API call from returning until either the job has moved to STOPPED or the specified time has elapsed.\nIf the specified time elapses without the job moving to STOPPED, a timeout exception occurs.\n\n## Required authorization\n\n* Cluster privileges: `manage_rollup`\n" operationId: rollup-stop-job parameters: - name: id in: path description: Identifier for the rollup job. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: "If `wait_for_completion` is `true`, the API blocks for (at maximum) the specified duration while waiting for the job to stop.\nIf more than `timeout` time has passed, the API throws a timeout exception.\nNOTE: Even if a timeout occurs, the stop request is still processing and eventually moves the job to STOPPED.\nThe timeout simply means the API call itself timed out while waiting for the status change." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: wait_for_completion in: query description: "If set to `true`, causes the API to block until the indexer state completely stops.\nIf set to `false`, the API returns immediately and the indexer is stopped asynchronously in the background." schema: type: boolean default: false responses: '200': description: '' content: application/json: schema: required: - stopped type: object properties: stopped: type: boolean deprecated: true x-state: Experimental; Added in 6.3.0 x-codeSamples: - lang: Console source: "POST _rollup/job/sensor/_stop?wait_for_completion=true&timeout=10s\n" - lang: Python source: "resp = client.rollup.stop_job(\n id=\"sensor\",\n wait_for_completion=True,\n timeout=\"10s\",\n)" - lang: JavaScript source: "const response = await client.rollup.stopJob({\n id: \"sensor\",\n wait_for_completion: \"true\",\n timeout: \"10s\",\n});" - lang: Ruby source: "response = client.perform_request(\n \"POST\",\n \"/_rollup/job/sensor/_stop\",\n {\n \"wait_for_completion\": \"true\",\n \"timeout\": \"10s\"\n },\n)" - lang: PHP source: "$resp = $client->rollup()->stopJob([\n \"id\" => \"sensor\",\n \"wait_for_completion\" => \"true\",\n \"timeout\" => \"10s\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_rollup/job/sensor/_stop?wait_for_completion=true&timeout=10s"' - lang: C# source: "var response = await client.Rollup\n .StopJobAsync(id: \"sensor\", d1 => d1\n .Timeout(\"10s\")\n .WaitForCompletion(true)\n );" - lang: Java source: "client.rollup().stopJob(s -> s\n .id(\"sensor\")\n .timeout(t -> t\n .time(\"10s\")\n )\n .waitForCompletion(true)\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_scripts/painless/_execute: post: tags: - script summary: "Run a script\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_scripts/painless/_execute\n
\n
\n POST\n /_scripts/painless/_execute\n
\n \n\nRuns a script and returns a result.\nUse this API to build and test scripts, such as when defining a script for a runtime field.\nThis API requires very few dependencies and is especially useful if you don't have permissions to write documents on a cluster.\n\nThe API uses several _contexts_, which control how scripts are run, what variables are available at runtime, and what the return type is.\n\nEach context requires a script, but additional parameters depend on the context you're using for that script." operationId: scripts-painless-execute requestBody: $ref: '#/components/requestBodies/scripts_painless_execute' responses: '200': $ref: '#/components/responses/scripts_painless_execute-200' x-state: Experimental; Added in 6.3.0 x-codeSamples: - lang: Console source: "POST /_scripts/painless/_execute\n{\n \"script\": {\n \"source\": \"params.count / params.total\",\n \"params\": {\n \"count\": 100.0,\n \"total\": 1000.0\n }\n }\n}" - lang: Python source: "resp = client.scripts_painless_execute(\n script={\n \"source\": \"params.count / params.total\",\n \"params\": {\n \"count\": 100,\n \"total\": 1000\n }\n },\n)" - lang: JavaScript source: "const response = await client.scriptsPainlessExecute({\n script: {\n source: \"params.count / params.total\",\n params: {\n count: 100,\n total: 1000,\n },\n },\n});" - lang: Ruby source: "response = client.scripts_painless_execute(\n body: {\n \"script\": {\n \"source\": \"params.count / params.total\",\n \"params\": {\n \"count\": 100,\n \"total\": 1000\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->scriptsPainlessExecute([\n \"body\" => [\n \"script\" => [\n \"source\" => \"params.count / params.total\",\n \"params\" => [\n \"count\" => 100,\n \"total\" => 1000,\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"script":{"source":"params.count / params.total","params":{"count":100,"total":1000}}}'' "$ELASTICSEARCH_URL/_scripts/painless/_execute"' - lang: C# source: "var response = await client\n .ScriptsPainlessExecuteAsync(d1 => d1\n .Script(d2 => d2\n .Params(new Dictionary()\n {\n { \"count\", 100 },\n { \"total\", 1000 }\n })\n .Source(\"params.count / params.total\")\n )\n );" - lang: Java source: "client.scriptsPainlessExecute(s -> s\n .script(sc -> sc\n .source(so -> so\n .scriptString(\"params.count / params.total\")\n )\n .params(Map.of(\"total\", JsonData.fromJson(\"1000\"),\"count\", JsonData.fromJson(\"100\")))\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_search': post: tags: - search summary: "Run a search\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_search\n
\n
\n POST\n /_search\n
\n
\n GET\n /{index}/_search\n
\n
\n POST\n /{index}/_search\n
\n \n\nGet search hits that match the query defined in the request.\nYou can provide search queries using the `q` query string parameter or the request body.\nIf both are specified, only the query parameter is used.\n\nIf the Elasticsearch security features are enabled, you must have the read index privilege for the target data stream, index, or alias. For cross-cluster search, refer to the documentation about configuring CCS privileges.\nTo search a point in time (PIT) for an alias, you must have the `read` index privilege for the alias's data streams or indices.\n\n**Search slicing**\n\nWhen paging through a large number of documents, it can be helpful to split the search into multiple slices to consume them independently with the `slice` and `pit` properties.\nBy default the splitting is done first on the shards, then locally on each shard.\n\nFor instance if the number of shards is equal to 2 and you request 4 slices, the slices 0 and 2 are assigned to the first shard and the slices 1 and 3 are assigned to the second shard.\n\nIMPORTANT: The same point-in-time ID should be used for all slices.\nIf different PIT IDs are used, slices can overlap and miss documents.\nThis situation can occur because, by default, the splitting criterion is based on Lucene document IDs, which are not stable across changes to the index.\n\n## Required authorization\n\n* Index privileges: `read`\n" externalDocs: description: About adding remote clusters url: https://www.elastic.co/docs/deploy-manage/remote-clusters/remote-clusters-cert#remote-clusters-privileges-ccs x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/search-search.html operationId: search parameters: - $ref: '#/components/parameters/search-index' - $ref: '#/components/parameters/search-allow_no_indices' - $ref: '#/components/parameters/search-allow_partial_search_results' - $ref: '#/components/parameters/search-analyzer' - $ref: '#/components/parameters/search-analyze_wildcard' - $ref: '#/components/parameters/search-batched_reduce_size' - $ref: '#/components/parameters/search-ccs_minimize_roundtrips' - $ref: '#/components/parameters/search-default_operator' - $ref: '#/components/parameters/search-df' - $ref: '#/components/parameters/search-docvalue_fields' - $ref: '#/components/parameters/search-expand_wildcards' - $ref: '#/components/parameters/search-explain' - $ref: '#/components/parameters/search-ignore_throttled' - $ref: '#/components/parameters/search-ignore_unavailable' - $ref: '#/components/parameters/search-include_named_queries_score' - $ref: '#/components/parameters/search-lenient' - $ref: '#/components/parameters/search-max_concurrent_shard_requests' - $ref: '#/components/parameters/search-preference' - $ref: '#/components/parameters/search-pre_filter_shard_size' - $ref: '#/components/parameters/search-request_cache' - $ref: '#/components/parameters/search-routing' - $ref: '#/components/parameters/search-scroll' - $ref: '#/components/parameters/search-search_type' - $ref: '#/components/parameters/search-stats' - $ref: '#/components/parameters/search-stored_fields' - $ref: '#/components/parameters/search-suggest_field' - $ref: '#/components/parameters/search-suggest_mode' - $ref: '#/components/parameters/search-suggest_size' - $ref: '#/components/parameters/search-suggest_text' - $ref: '#/components/parameters/search-terminate_after' - $ref: '#/components/parameters/search-timeout' - $ref: '#/components/parameters/search-track_total_hits' - $ref: '#/components/parameters/search-track_scores' - $ref: '#/components/parameters/search-typed_keys' - $ref: '#/components/parameters/search-rest_total_hits_as_int' - $ref: '#/components/parameters/search-version' - $ref: '#/components/parameters/search-_source' - $ref: '#/components/parameters/search-_source_excludes' - $ref: '#/components/parameters/search-_source_exclude_vectors' - $ref: '#/components/parameters/search-_source_includes' - $ref: '#/components/parameters/search-seq_no_primary_term' - $ref: '#/components/parameters/search-q' - $ref: '#/components/parameters/search-size' - $ref: '#/components/parameters/search-from' - $ref: '#/components/parameters/search-sort' requestBody: $ref: '#/components/requestBodies/search' responses: '200': $ref: '#/components/responses/search-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET /my-index-000001/_search?from=40&size=20\n{\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n}" - lang: Python source: "resp = client.search(\n index=\"my-index-000001\",\n from_=\"40\",\n size=\"20\",\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.search({\n index: \"my-index-000001\",\n from: 40,\n size: 20,\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n});" - lang: Ruby source: "response = client.search(\n index: \"my-index-000001\",\n from: \"40\",\n size: \"20\",\n body: {\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->search([\n \"index\" => \"my-index-000001\",\n \"from\" => \"40\",\n \"size\" => \"20\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":{"term":{"user.id":"kimchy"}}}'' "$ELASTICSEARCH_URL/my-index-000001/_search?from=40&size=20"' - lang: C# source: "var response = await client\n .SearchAsync(d1 => d1\n .Indices(new[] { \"my-index-000001\" })\n .Query(d2 => d2\n .Term(d3 => d3\n .Field(x => x.User.Id)\n .Value(\"kimchy\")\n )\n )\n );" - lang: Java source: "client.search(s -> s\n .from(40)\n .index(\"my-index-000001\")\n .query(q -> q\n .term(t -> t\n .field(\"user.id\")\n .value(FieldValue.of(\"kimchy\"))\n )\n )\n .size(20)\n,Void.class);\n" x-metaTags: - content: Elasticsearch name: product_name '/_application/search_application/{name}': get: tags: - search_application summary: Get search application details description: "\n\n## Required authorization\n\n* Cluster privileges: `manage_search_application`\n" operationId: search-application-get parameters: - name: name in: path description: The name of the search application required: true schema: $ref: '#/components/schemas/_types.Name' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/search_application._types.SearchApplication' examples: SearchApplicationGetResponseExample1: description: A sucessful response from `GET _application/search_application/my-app/`. value: "{\n \"name\": \"my-app\",\n \"indices\": [ \"index1\", \"index2\" ],\n \"updated_at_millis\": 1682105622204,\n \"template\": {\n \"script\": {\n \"source\": {\n \"query\": {\n \"query_string\": {\n \"query\": \"{{query_string}}\",\n \"default_field\": \"{{default_field}}\"\n }\n }\n },\n \"lang\": \"mustache\",\n \"options\": {\n \"content_type\": \"application/json;charset=utf-8\"\n },\n \"params\": {\n \"query_string\": \"*\",\n \"default_field\": \"*\"\n }\n }\n }\n}" x-state: Beta; Added in 8.8.0 x-codeSamples: - lang: Console source: "GET _application/search_application/my-app/\n" - lang: Python source: "resp = client.search_application.get(\n name=\"my-app\",\n)" - lang: JavaScript source: "const response = await client.searchApplication.get({\n name: \"my-app\",\n});" - lang: Ruby source: "response = client.search_application.get(\n name: \"my-app\"\n)" - lang: PHP source: "$resp = $client->searchApplication()->get([\n \"name\" => \"my-app\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_application/search_application/my-app/"' - lang: C# source: 'var response = await client.SearchApplication.GetAsync(name: "my-app");' - lang: Java source: "client.searchApplication().get(g -> g\n .name(\"my-app\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - search_application summary: Create or update a search application description: "\n\n## Required authorization\n\n* Index privileges: `manage`\n* Cluster privileges: `manage_search_application`\n" operationId: search-application-put parameters: - name: name in: path description: The name of the search application to be created or updated. required: true schema: $ref: '#/components/schemas/_types.Name' - name: create in: query description: 'If `true`, this request cannot replace or update existing Search Applications.' schema: type: boolean default: false requestBody: content: application/json: schema: $ref: '#/components/schemas/search_application._types.SearchApplicationParameters' examples: SearchApplicationPutRequestExample1: description: "Run `PUT _application/search_application/my-app` to create or update a search application called `my-app`. When the dictionary parameter is specified, the search application search API will perform the following parameter validation: it accepts only the `query_string` and `default_field` parameters; it verifies that `query_string` and `default_field` are both strings; it accepts `default_field` only if it takes the values title or description. If the parameters are not valid, the search application search API will return an error.\n" value: "{\n \"indices\": [ \"index1\", \"index2\" ],\n \"template\": {\n \"script\": {\n \"source\": {\n \"query\": {\n \"query_string\": {\n \"query\": \"{{query_string}}\",\n \"default_field\": \"{{default_field}}\"\n }\n }\n },\n \"params\": {\n \"query_string\": \"*\",\n \"default_field\": \"*\"\n }\n },\n \"dictionary\": {\n \"properties\": {\n \"query_string\": {\n \"type\": \"string\"\n },\n \"default_field\": {\n \"type\": \"string\",\n \"enum\": [\n \"title\",\n \"description\"\n ]\n },\n \"additionalProperties\": false\n },\n \"required\": [\n \"query_string\"\n ]\n }\n }\n}" x-codeSamples: - lang: Console source: "PUT _application/search_application/my-app\n{\n \"indices\": [ \"index1\", \"index2\" ],\n \"template\": {\n \"script\": {\n \"source\": {\n \"query\": {\n \"query_string\": {\n \"query\": \"{{query_string}}\",\n \"default_field\": \"{{default_field}}\"\n }\n }\n },\n \"params\": {\n \"query_string\": \"*\",\n \"default_field\": \"*\"\n }\n },\n \"dictionary\": {\n \"properties\": {\n \"query_string\": {\n \"type\": \"string\"\n },\n \"default_field\": {\n \"type\": \"string\",\n \"enum\": [\n \"title\",\n \"description\"\n ]\n },\n \"additionalProperties\": false\n },\n \"required\": [\n \"query_string\"\n ]\n }\n }\n}" - lang: Python source: "resp = client.search_application.put(\n name=\"my-app\",\n search_application={\n \"indices\": [\n \"index1\",\n \"index2\"\n ],\n \"template\": {\n \"script\": {\n \"source\": {\n \"query\": {\n \"query_string\": {\n \"query\": \"{{query_string}}\",\n \"default_field\": \"{{default_field}}\"\n }\n }\n },\n \"params\": {\n \"query_string\": \"*\",\n \"default_field\": \"*\"\n }\n },\n \"dictionary\": {\n \"properties\": {\n \"query_string\": {\n \"type\": \"string\"\n },\n \"default_field\": {\n \"type\": \"string\",\n \"enum\": [\n \"title\",\n \"description\"\n ]\n },\n \"additionalProperties\": False\n },\n \"required\": [\n \"query_string\"\n ]\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.searchApplication.put({\n name: \"my-app\",\n search_application: {\n indices: [\"index1\", \"index2\"],\n template: {\n script: {\n source: {\n query: {\n query_string: {\n query: \"{{query_string}}\",\n default_field: \"{{default_field}}\",\n },\n },\n },\n params: {\n query_string: \"*\",\n default_field: \"*\",\n },\n },\n dictionary: {\n properties: {\n query_string: {\n type: \"string\",\n },\n default_field: {\n type: \"string\",\n enum: [\"title\", \"description\"],\n },\n additionalProperties: false,\n },\n required: [\"query_string\"],\n },\n },\n },\n});" - lang: Ruby source: "response = client.search_application.put(\n name: \"my-app\",\n body: {\n \"indices\": [\n \"index1\",\n \"index2\"\n ],\n \"template\": {\n \"script\": {\n \"source\": {\n \"query\": {\n \"query_string\": {\n \"query\": \"{{query_string}}\",\n \"default_field\": \"{{default_field}}\"\n }\n }\n },\n \"params\": {\n \"query_string\": \"*\",\n \"default_field\": \"*\"\n }\n },\n \"dictionary\": {\n \"properties\": {\n \"query_string\": {\n \"type\": \"string\"\n },\n \"default_field\": {\n \"type\": \"string\",\n \"enum\": [\n \"title\",\n \"description\"\n ]\n },\n \"additionalProperties\": false\n },\n \"required\": [\n \"query_string\"\n ]\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->searchApplication()->put([\n \"name\" => \"my-app\",\n \"body\" => [\n \"indices\" => array(\n \"index1\",\n \"index2\",\n ),\n \"template\" => [\n \"script\" => [\n \"source\" => [\n \"query\" => [\n \"query_string\" => [\n \"query\" => \"{{query_string}}\",\n \"default_field\" => \"{{default_field}}\",\n ],\n ],\n ],\n \"params\" => [\n \"query_string\" => \"*\",\n \"default_field\" => \"*\",\n ],\n ],\n \"dictionary\" => [\n \"properties\" => [\n \"query_string\" => [\n \"type\" => \"string\",\n ],\n \"default_field\" => [\n \"type\" => \"string\",\n \"enum\" => array(\n \"title\",\n \"description\",\n ),\n ],\n \"additionalProperties\" => false,\n ],\n \"required\" => array(\n \"query_string\",\n ),\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"indices":["index1","index2"],"template":{"script":{"source":{"query":{"query_string":{"query":"{{query_string}}","default_field":"{{default_field}}"}}},"params":{"query_string":"*","default_field":"*"}},"dictionary":{"properties":{"query_string":{"type":"string"},"default_field":{"type":"string","enum":["title","description"]},"additionalProperties":false},"required":["query_string"]}}}'' "$ELASTICSEARCH_URL/_application/search_application/my-app"' - lang: Java source: "client.searchApplication().put(p -> p\n .name(\"my-app\")\n .searchApplication(s -> s\n .indices(List.of(\"index1\",\"index2\"))\n .template(t -> t\n .script(sc -> sc\n .source(so -> so\n .scriptTemplate(scr -> scr\n .query(q -> q\n .queryString(qu -> qu\n .defaultField(\"{{default_field}}\")\n .query(\"\"\"\n {{query_string}}\n \"\"\")\n )\n )\n )\n )\n .params(Map.of(\"default_field\", JsonData.fromJson(\"\\\"*\\\"\"),\"query_string\", JsonData.fromJson(\"\\\"*\\\"\")))\n )\n )\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - result type: object properties: result: allOf: - $ref: '#/components/schemas/_types.Result' x-state: Beta; Added in 8.8.0 x-codeSamples: - lang: Console source: "PUT _application/search_application/my-app\n{\n \"indices\": [ \"index1\", \"index2\" ],\n \"template\": {\n \"script\": {\n \"source\": {\n \"query\": {\n \"query_string\": {\n \"query\": \"{{query_string}}\",\n \"default_field\": \"{{default_field}}\"\n }\n }\n },\n \"params\": {\n \"query_string\": \"*\",\n \"default_field\": \"*\"\n }\n },\n \"dictionary\": {\n \"properties\": {\n \"query_string\": {\n \"type\": \"string\"\n },\n \"default_field\": {\n \"type\": \"string\",\n \"enum\": [\n \"title\",\n \"description\"\n ]\n },\n \"additionalProperties\": false\n },\n \"required\": [\n \"query_string\"\n ]\n }\n }\n}" - lang: Python source: "resp = client.search_application.put(\n name=\"my-app\",\n search_application={\n \"indices\": [\n \"index1\",\n \"index2\"\n ],\n \"template\": {\n \"script\": {\n \"source\": {\n \"query\": {\n \"query_string\": {\n \"query\": \"{{query_string}}\",\n \"default_field\": \"{{default_field}}\"\n }\n }\n },\n \"params\": {\n \"query_string\": \"*\",\n \"default_field\": \"*\"\n }\n },\n \"dictionary\": {\n \"properties\": {\n \"query_string\": {\n \"type\": \"string\"\n },\n \"default_field\": {\n \"type\": \"string\",\n \"enum\": [\n \"title\",\n \"description\"\n ]\n },\n \"additionalProperties\": False\n },\n \"required\": [\n \"query_string\"\n ]\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.searchApplication.put({\n name: \"my-app\",\n search_application: {\n indices: [\"index1\", \"index2\"],\n template: {\n script: {\n source: {\n query: {\n query_string: {\n query: \"{{query_string}}\",\n default_field: \"{{default_field}}\",\n },\n },\n },\n params: {\n query_string: \"*\",\n default_field: \"*\",\n },\n },\n dictionary: {\n properties: {\n query_string: {\n type: \"string\",\n },\n default_field: {\n type: \"string\",\n enum: [\"title\", \"description\"],\n },\n additionalProperties: false,\n },\n required: [\"query_string\"],\n },\n },\n },\n});" - lang: Ruby source: "response = client.search_application.put(\n name: \"my-app\",\n body: {\n \"indices\": [\n \"index1\",\n \"index2\"\n ],\n \"template\": {\n \"script\": {\n \"source\": {\n \"query\": {\n \"query_string\": {\n \"query\": \"{{query_string}}\",\n \"default_field\": \"{{default_field}}\"\n }\n }\n },\n \"params\": {\n \"query_string\": \"*\",\n \"default_field\": \"*\"\n }\n },\n \"dictionary\": {\n \"properties\": {\n \"query_string\": {\n \"type\": \"string\"\n },\n \"default_field\": {\n \"type\": \"string\",\n \"enum\": [\n \"title\",\n \"description\"\n ]\n },\n \"additionalProperties\": false\n },\n \"required\": [\n \"query_string\"\n ]\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->searchApplication()->put([\n \"name\" => \"my-app\",\n \"body\" => [\n \"indices\" => array(\n \"index1\",\n \"index2\",\n ),\n \"template\" => [\n \"script\" => [\n \"source\" => [\n \"query\" => [\n \"query_string\" => [\n \"query\" => \"{{query_string}}\",\n \"default_field\" => \"{{default_field}}\",\n ],\n ],\n ],\n \"params\" => [\n \"query_string\" => \"*\",\n \"default_field\" => \"*\",\n ],\n ],\n \"dictionary\" => [\n \"properties\" => [\n \"query_string\" => [\n \"type\" => \"string\",\n ],\n \"default_field\" => [\n \"type\" => \"string\",\n \"enum\" => array(\n \"title\",\n \"description\",\n ),\n ],\n \"additionalProperties\" => false,\n ],\n \"required\" => array(\n \"query_string\",\n ),\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"indices":["index1","index2"],"template":{"script":{"source":{"query":{"query_string":{"query":"{{query_string}}","default_field":"{{default_field}}"}}},"params":{"query_string":"*","default_field":"*"}},"dictionary":{"properties":{"query_string":{"type":"string"},"default_field":{"type":"string","enum":["title","description"]},"additionalProperties":false},"required":["query_string"]}}}'' "$ELASTICSEARCH_URL/_application/search_application/my-app"' - lang: Java source: "client.searchApplication().put(p -> p\n .name(\"my-app\")\n .searchApplication(s -> s\n .indices(List.of(\"index1\",\"index2\"))\n .template(t -> t\n .script(sc -> sc\n .source(so -> so\n .scriptTemplate(scr -> scr\n .query(q -> q\n .queryString(qu -> qu\n .defaultField(\"{{default_field}}\")\n .query(\"\"\"\n {{query_string}}\n \"\"\")\n )\n )\n )\n )\n .params(Map.of(\"default_field\", JsonData.fromJson(\"\\\"*\\\"\"),\"query_string\", JsonData.fromJson(\"\\\"*\\\"\")))\n )\n )\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - search_application summary: Delete a search application description: "Remove a search application and its associated alias. Indices attached to the search application are not removed.\n\n## Required authorization\n\n* Index privileges: `manage`\n* Cluster privileges: `manage_search_application`\n" operationId: search-application-delete parameters: - name: name in: path description: The name of the search application to delete. required: true schema: $ref: '#/components/schemas/_types.Name' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Beta; Added in 8.8.0 x-codeSamples: - lang: Console source: "DELETE _application/search_application/my-app/\n" - lang: Python source: "resp = client.search_application.delete(\n name=\"my-app\",\n)" - lang: JavaScript source: "const response = await client.searchApplication.delete({\n name: \"my-app\",\n});" - lang: Ruby source: "response = client.search_application.delete(\n name: \"my-app\"\n)" - lang: PHP source: "$resp = $client->searchApplication()->delete([\n \"name\" => \"my-app\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_application/search_application/my-app/"' - lang: C# source: 'var response = await client.SearchApplication.DeleteAsync(name: "my-app");' - lang: Java source: "client.searchApplication().delete(d -> d\n .name(\"my-app\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_application/analytics/{name}': get: tags: - analytics summary: "Get behavioral analytics collections\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_application/analytics\n
\n
\n GET\n /_application/analytics/{name}\n
" operationId: search-application-get-behavioral-analytics parameters: - $ref: '#/components/parameters/search_application.get_behavioral_analytics-name' responses: '200': $ref: '#/components/responses/search_application.get_behavioral_analytics-200' deprecated: true x-state: Experimental; Added in 8.8.0 x-codeSamples: - lang: Console source: "GET _application/analytics/my*\n" - lang: Python source: "resp = client.search_application.get_behavioral_analytics(\n name=\"my*\",\n)" - lang: JavaScript source: "const response = await client.searchApplication.getBehavioralAnalytics({\n name: \"my*\",\n});" - lang: Ruby source: "response = client.search_application.get_behavioral_analytics(\n name: \"my*\"\n)" - lang: PHP source: "$resp = $client->searchApplication()->getBehavioralAnalytics([\n \"name\" => \"my*\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_application/analytics/my*"' - lang: C# source: "var response = await client.SearchApplication\n .GetBehavioralAnalyticsAsync(d1 => d1\n .Name([\"my*\"])\n );" - lang: Java source: "client.searchApplication().getBehavioralAnalytics(g -> g\n .name(\"my*\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - analytics summary: Create a behavioral analytics collection operationId: search-application-put-behavioral-analytics parameters: - name: name in: path description: The name of the analytics collection to be created or updated. required: true schema: $ref: '#/components/schemas/_types.Name' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/search_application.put_behavioral_analytics.AnalyticsAcknowledgeResponseBase' deprecated: true x-state: Experimental; Added in 8.8.0 x-codeSamples: - lang: Console source: "PUT _application/analytics/my_analytics_collection\n" - lang: Python source: "resp = client.search_application.put_behavioral_analytics(\n name=\"my_analytics_collection\",\n)" - lang: JavaScript source: "const response = await client.searchApplication.putBehavioralAnalytics({\n name: \"my_analytics_collection\",\n});" - lang: Ruby source: "response = client.search_application.put_behavioral_analytics(\n name: \"my_analytics_collection\"\n)" - lang: PHP source: "$resp = $client->searchApplication()->putBehavioralAnalytics([\n \"name\" => \"my_analytics_collection\",\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_application/analytics/my_analytics_collection"' - lang: C# source: 'var response = await client.SearchApplication.PutBehavioralAnalyticsAsync(name: "my_analytics_collection");' - lang: Java source: "client.searchApplication().putBehavioralAnalytics(p -> p\n .name(\"my_analytics_collection\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - analytics summary: Delete a behavioral analytics collection description: The associated data stream is also deleted. operationId: search-application-delete-behavioral-analytics parameters: - name: name in: path description: The name of the analytics collection to be deleted required: true schema: $ref: '#/components/schemas/_types.Name' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' deprecated: true x-state: Experimental; Added in 8.8.0 x-codeSamples: - lang: Console source: "DELETE _application/analytics/my_analytics_collection/\n" - lang: Python source: "resp = client.search_application.delete_behavioral_analytics(\n name=\"my_analytics_collection\",\n)" - lang: JavaScript source: "const response = await client.searchApplication.deleteBehavioralAnalytics({\n name: \"my_analytics_collection\",\n});" - lang: Ruby source: "response = client.search_application.delete_behavioral_analytics(\n name: \"my_analytics_collection\"\n)" - lang: PHP source: "$resp = $client->searchApplication()->deleteBehavioralAnalytics([\n \"name\" => \"my_analytics_collection\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_application/analytics/my_analytics_collection/"' - lang: C# source: 'var response = await client.SearchApplication.DeleteBehavioralAnalyticsAsync(name: "my_analytics_collection");' - lang: Java source: "client.searchApplication().deleteBehavioralAnalytics(d -> d\n .name(\"my_analytics_collection\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_application/search_application: get: tags: - search_application summary: Get search applications description: "Get information about search applications.\n\n## Required authorization\n\n* Cluster privileges: `manage_search_application`\n" operationId: search-application-list parameters: - name: q in: query description: Query in the Lucene query string syntax. schema: type: string - name: from in: query description: Starting offset. schema: type: number default: 0 - name: size in: query description: Specifies a max number of results to get. schema: type: number responses: '200': description: '' content: application/json: schema: required: - count - results type: object properties: count: type: number results: type: array items: $ref: '#/components/schemas/search_application._types.SearchApplication' examples: SearchApplicationsListResponseExample1: description: A succesful response from `GET _application/search_application?from=0&size=3&q=app*` returns the first three search applications whose names start with `app`. value: "{\n \"count\": 2,\n \"results\": [\n {\n \"name\": \"app-1\",\n \"updated_at_millis\": 1690981129366\n },\n {\n \"name\": \"app-2\",\n \"updated_at_millis\": 1691501823939\n }\n ]\n}" x-state: Beta; Added in 8.8.0 x-codeSamples: - lang: Console source: "GET _application/search_application?from=0&size=3&q=app*\n" - lang: Python source: "resp = client.search_application.list(\n from_=\"0\",\n size=\"3\",\n q=\"app*\",\n)" - lang: JavaScript source: "const response = await client.searchApplication.list({\n from: 0,\n size: 3,\n q: \"app*\",\n});" - lang: Ruby source: "response = client.search_application.list(\n from: \"0\",\n size: \"3\",\n q: \"app*\"\n)" - lang: PHP source: "$resp = $client->searchApplication()->list([\n \"from\" => \"0\",\n \"size\" => \"3\",\n \"q\" => \"app*\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_application/search_application?from=0&size=3&q=app*"' - lang: C# source: "var response = await client.SearchApplication\n .ListAsync(d1 => d1\n .From(0)\n .QueryLuceneSyntax(\"app*\")\n .Size(3)\n );" - lang: Java source: "client.searchApplication().list(l -> l\n .from(0)\n .q(\"app*\")\n .size(3)\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_application/analytics/{collection_name}/event/{event_type}': post: tags: - analytics summary: Create a behavioral analytics collection event externalDocs: description: About behavioral analytics events url: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/behavioral-analytics-event-reference.html x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/post-analytics-collection-event.html operationId: search-application-post-behavioral-analytics-event parameters: - name: collection_name in: path description: The name of the behavioral analytics collection. required: true schema: $ref: '#/components/schemas/_types.Name' - name: event_type in: path description: The analytics event type. required: true schema: $ref: '#/components/schemas/search_application._types.EventType' - name: debug in: query description: Whether the response type has to include more details schema: type: boolean requestBody: content: application/json: schema: type: object examples: BehavioralAnalyticsEventPostRequestExample1: description: Run `POST _application/analytics/my_analytics_collection/event/search_click` to send a `search_click` event to an analytics collection called `my_analytics_collection`. value: "{\n \"session\": {\n \"id\": \"1797ca95-91c9-4e2e-b1bd-9c38e6f386a9\"\n },\n \"user\": {\n \"id\": \"5f26f01a-bbee-4202-9298-81261067abbd\"\n },\n \"search\":{\n \"query\": \"search term\",\n \"results\": {\n \"items\": [\n {\n \"document\": {\n \"id\": \"123\",\n \"index\": \"products\"\n }\n }\n ],\n \"total_results\": 10\n },\n \"sort\": {\n \"name\": \"relevance\"\n },\n \"search_application\": \"website\"\n },\n \"document\":{\n \"id\": \"123\",\n \"index\": \"products\"\n }\n}" x-codeSamples: - lang: Console source: "POST _application/analytics/my_analytics_collection/event/search_click\n{\n \"session\": {\n \"id\": \"1797ca95-91c9-4e2e-b1bd-9c38e6f386a9\"\n },\n \"user\": {\n \"id\": \"5f26f01a-bbee-4202-9298-81261067abbd\"\n },\n \"search\":{\n \"query\": \"search term\",\n \"results\": {\n \"items\": [\n {\n \"document\": {\n \"id\": \"123\",\n \"index\": \"products\"\n }\n }\n ],\n \"total_results\": 10\n },\n \"sort\": {\n \"name\": \"relevance\"\n },\n \"search_application\": \"website\"\n },\n \"document\":{\n \"id\": \"123\",\n \"index\": \"products\"\n }\n}" - lang: Python source: "resp = client.search_application.post_behavioral_analytics_event(\n collection_name=\"my_analytics_collection\",\n event_type=\"search_click\",\n payload={\n \"session\": {\n \"id\": \"1797ca95-91c9-4e2e-b1bd-9c38e6f386a9\"\n },\n \"user\": {\n \"id\": \"5f26f01a-bbee-4202-9298-81261067abbd\"\n },\n \"search\": {\n \"query\": \"search term\",\n \"results\": {\n \"items\": [\n {\n \"document\": {\n \"id\": \"123\",\n \"index\": \"products\"\n }\n }\n ],\n \"total_results\": 10\n },\n \"sort\": {\n \"name\": \"relevance\"\n },\n \"search_application\": \"website\"\n },\n \"document\": {\n \"id\": \"123\",\n \"index\": \"products\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.searchApplication.postBehavioralAnalyticsEvent({\n collection_name: \"my_analytics_collection\",\n event_type: \"search_click\",\n payload: {\n session: {\n id: \"1797ca95-91c9-4e2e-b1bd-9c38e6f386a9\",\n },\n user: {\n id: \"5f26f01a-bbee-4202-9298-81261067abbd\",\n },\n search: {\n query: \"search term\",\n results: {\n items: [\n {\n document: {\n id: \"123\",\n index: \"products\",\n },\n },\n ],\n total_results: 10,\n },\n sort: {\n name: \"relevance\",\n },\n search_application: \"website\",\n },\n document: {\n id: \"123\",\n index: \"products\",\n },\n },\n});" - lang: Ruby source: "response = client.search_application.post_behavioral_analytics_event(\n collection_name: \"my_analytics_collection\",\n event_type: \"search_click\",\n body: {\n \"session\": {\n \"id\": \"1797ca95-91c9-4e2e-b1bd-9c38e6f386a9\"\n },\n \"user\": {\n \"id\": \"5f26f01a-bbee-4202-9298-81261067abbd\"\n },\n \"search\": {\n \"query\": \"search term\",\n \"results\": {\n \"items\": [\n {\n \"document\": {\n \"id\": \"123\",\n \"index\": \"products\"\n }\n }\n ],\n \"total_results\": 10\n },\n \"sort\": {\n \"name\": \"relevance\"\n },\n \"search_application\": \"website\"\n },\n \"document\": {\n \"id\": \"123\",\n \"index\": \"products\"\n }\n }\n)" - lang: PHP source: "$resp = $client->searchApplication()->postBehavioralAnalyticsEvent([\n \"collection_name\" => \"my_analytics_collection\",\n \"event_type\" => \"search_click\",\n \"body\" => [\n \"session\" => [\n \"id\" => \"1797ca95-91c9-4e2e-b1bd-9c38e6f386a9\",\n ],\n \"user\" => [\n \"id\" => \"5f26f01a-bbee-4202-9298-81261067abbd\",\n ],\n \"search\" => [\n \"query\" => \"search term\",\n \"results\" => [\n \"items\" => array(\n [\n \"document\" => [\n \"id\" => \"123\",\n \"index\" => \"products\",\n ],\n ],\n ),\n \"total_results\" => 10,\n ],\n \"sort\" => [\n \"name\" => \"relevance\",\n ],\n \"search_application\" => \"website\",\n ],\n \"document\" => [\n \"id\" => \"123\",\n \"index\" => \"products\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"session":{"id":"1797ca95-91c9-4e2e-b1bd-9c38e6f386a9"},"user":{"id":"5f26f01a-bbee-4202-9298-81261067abbd"},"search":{"query":"search term","results":{"items":[{"document":{"id":"123","index":"products"}}],"total_results":10},"sort":{"name":"relevance"},"search_application":"website"},"document":{"id":"123","index":"products"}}'' "$ELASTICSEARCH_URL/_application/analytics/my_analytics_collection/event/search_click"' - lang: C# source: "var response = await client.SearchApplication\n .PostBehavioralAnalyticsEventAsync(collectionName: \"my_analytics_collection\", eventType: EventType.SearchClick, d1 => d1\n .Payload(JsonSerializer.Deserialize(\"\"\"\n {\n \"session\": {\n \"id\": \"1797ca95-91c9-4e2e-b1bd-9c38e6f386a9\"\n },\n \"user\": {\n \"id\": \"5f26f01a-bbee-4202-9298-81261067abbd\"\n },\n \"search\": {\n \"query\": \"search term\",\n \"results\": {\n \"items\": [\n {\n \"document\": {\n \"id\": \"123\",\n \"index\": \"products\"\n }\n }\n ],\n \"total_results\": 10\n },\n \"sort\": {\n \"name\": \"relevance\"\n },\n \"search_application\": \"website\"\n },\n \"document\": {\n \"id\": \"123\",\n \"index\": \"products\"\n }\n }\n \"\"\"))\n );" - lang: Java source: "client.searchApplication().postBehavioralAnalyticsEvent(p -> p\n .collectionName(\"my_analytics_collection\")\n .eventType(EventType.SearchClick)\n .payload(JsonData.fromJson(\"\"\"\n{\"session\":{\"id\":\"1797ca95-91c9-4e2e-b1bd-9c38e6f386a9\"},\"user\":{\"id\":\"5f26f01a-bbee-4202-9298-81261067abbd\"},\"search\":{\"query\":\"search term\",\"results\":{\"items\":[{\"document\":{\"id\":\"123\",\"index\":\"products\"}}],\"total_results\":10},\"sort\":{\"name\":\"relevance\"},\"search_application\":\"website\"},\"document\":{\"id\":\"123\",\"index\":\"products\"}}\n\"\"\"))\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - accepted type: object properties: accepted: type: boolean event: type: object '202': description: "\nEvent has been accepted and will be ingested." '400': description: "\nEither the event type is unknown or the event payload contains invalid data." '404': description: "\nAnalytics collection does not exist." deprecated: true x-state: Experimental x-codeSamples: - lang: Console source: "POST _application/analytics/my_analytics_collection/event/search_click\n{\n \"session\": {\n \"id\": \"1797ca95-91c9-4e2e-b1bd-9c38e6f386a9\"\n },\n \"user\": {\n \"id\": \"5f26f01a-bbee-4202-9298-81261067abbd\"\n },\n \"search\":{\n \"query\": \"search term\",\n \"results\": {\n \"items\": [\n {\n \"document\": {\n \"id\": \"123\",\n \"index\": \"products\"\n }\n }\n ],\n \"total_results\": 10\n },\n \"sort\": {\n \"name\": \"relevance\"\n },\n \"search_application\": \"website\"\n },\n \"document\":{\n \"id\": \"123\",\n \"index\": \"products\"\n }\n}" - lang: Python source: "resp = client.search_application.post_behavioral_analytics_event(\n collection_name=\"my_analytics_collection\",\n event_type=\"search_click\",\n payload={\n \"session\": {\n \"id\": \"1797ca95-91c9-4e2e-b1bd-9c38e6f386a9\"\n },\n \"user\": {\n \"id\": \"5f26f01a-bbee-4202-9298-81261067abbd\"\n },\n \"search\": {\n \"query\": \"search term\",\n \"results\": {\n \"items\": [\n {\n \"document\": {\n \"id\": \"123\",\n \"index\": \"products\"\n }\n }\n ],\n \"total_results\": 10\n },\n \"sort\": {\n \"name\": \"relevance\"\n },\n \"search_application\": \"website\"\n },\n \"document\": {\n \"id\": \"123\",\n \"index\": \"products\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.searchApplication.postBehavioralAnalyticsEvent({\n collection_name: \"my_analytics_collection\",\n event_type: \"search_click\",\n payload: {\n session: {\n id: \"1797ca95-91c9-4e2e-b1bd-9c38e6f386a9\",\n },\n user: {\n id: \"5f26f01a-bbee-4202-9298-81261067abbd\",\n },\n search: {\n query: \"search term\",\n results: {\n items: [\n {\n document: {\n id: \"123\",\n index: \"products\",\n },\n },\n ],\n total_results: 10,\n },\n sort: {\n name: \"relevance\",\n },\n search_application: \"website\",\n },\n document: {\n id: \"123\",\n index: \"products\",\n },\n },\n});" - lang: Ruby source: "response = client.search_application.post_behavioral_analytics_event(\n collection_name: \"my_analytics_collection\",\n event_type: \"search_click\",\n body: {\n \"session\": {\n \"id\": \"1797ca95-91c9-4e2e-b1bd-9c38e6f386a9\"\n },\n \"user\": {\n \"id\": \"5f26f01a-bbee-4202-9298-81261067abbd\"\n },\n \"search\": {\n \"query\": \"search term\",\n \"results\": {\n \"items\": [\n {\n \"document\": {\n \"id\": \"123\",\n \"index\": \"products\"\n }\n }\n ],\n \"total_results\": 10\n },\n \"sort\": {\n \"name\": \"relevance\"\n },\n \"search_application\": \"website\"\n },\n \"document\": {\n \"id\": \"123\",\n \"index\": \"products\"\n }\n }\n)" - lang: PHP source: "$resp = $client->searchApplication()->postBehavioralAnalyticsEvent([\n \"collection_name\" => \"my_analytics_collection\",\n \"event_type\" => \"search_click\",\n \"body\" => [\n \"session\" => [\n \"id\" => \"1797ca95-91c9-4e2e-b1bd-9c38e6f386a9\",\n ],\n \"user\" => [\n \"id\" => \"5f26f01a-bbee-4202-9298-81261067abbd\",\n ],\n \"search\" => [\n \"query\" => \"search term\",\n \"results\" => [\n \"items\" => array(\n [\n \"document\" => [\n \"id\" => \"123\",\n \"index\" => \"products\",\n ],\n ],\n ),\n \"total_results\" => 10,\n ],\n \"sort\" => [\n \"name\" => \"relevance\",\n ],\n \"search_application\" => \"website\",\n ],\n \"document\" => [\n \"id\" => \"123\",\n \"index\" => \"products\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"session":{"id":"1797ca95-91c9-4e2e-b1bd-9c38e6f386a9"},"user":{"id":"5f26f01a-bbee-4202-9298-81261067abbd"},"search":{"query":"search term","results":{"items":[{"document":{"id":"123","index":"products"}}],"total_results":10},"sort":{"name":"relevance"},"search_application":"website"},"document":{"id":"123","index":"products"}}'' "$ELASTICSEARCH_URL/_application/analytics/my_analytics_collection/event/search_click"' - lang: C# source: "var response = await client.SearchApplication\n .PostBehavioralAnalyticsEventAsync(collectionName: \"my_analytics_collection\", eventType: EventType.SearchClick, d1 => d1\n .Payload(JsonSerializer.Deserialize(\"\"\"\n {\n \"session\": {\n \"id\": \"1797ca95-91c9-4e2e-b1bd-9c38e6f386a9\"\n },\n \"user\": {\n \"id\": \"5f26f01a-bbee-4202-9298-81261067abbd\"\n },\n \"search\": {\n \"query\": \"search term\",\n \"results\": {\n \"items\": [\n {\n \"document\": {\n \"id\": \"123\",\n \"index\": \"products\"\n }\n }\n ],\n \"total_results\": 10\n },\n \"sort\": {\n \"name\": \"relevance\"\n },\n \"search_application\": \"website\"\n },\n \"document\": {\n \"id\": \"123\",\n \"index\": \"products\"\n }\n }\n \"\"\"))\n );" - lang: Java source: "client.searchApplication().postBehavioralAnalyticsEvent(p -> p\n .collectionName(\"my_analytics_collection\")\n .eventType(EventType.SearchClick)\n .payload(JsonData.fromJson(\"\"\"\n{\"session\":{\"id\":\"1797ca95-91c9-4e2e-b1bd-9c38e6f386a9\"},\"user\":{\"id\":\"5f26f01a-bbee-4202-9298-81261067abbd\"},\"search\":{\"query\":\"search term\",\"results\":{\"items\":[{\"document\":{\"id\":\"123\",\"index\":\"products\"}}],\"total_results\":10},\"sort\":{\"name\":\"relevance\"},\"search_application\":\"website\"},\"document\":{\"id\":\"123\",\"index\":\"products\"}}\n\"\"\"))\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_application/search_application/{name}/_render_query': post: tags: - search_application summary: Render a search application query description: "Generate an Elasticsearch query using the specified query parameters and the search template associated with the search application or a default template if none is specified.\nIf a parameter used in the search template is not specified in `params`, the parameter's default value will be used.\nThe API returns the specific Elasticsearch query that would be generated and run by calling the search application search API.\n\nYou must have `read` privileges on the backing alias of the search application." operationId: search-application-render-query parameters: - name: name in: path description: The name of the search application to render teh query for. required: true schema: $ref: '#/components/schemas/_types.Name' requestBody: content: application/json: schema: type: object properties: params: type: object additionalProperties: type: object examples: SearchApplicationsRenderQueryRequestExample1: description: Run `POST _application/search_application/my-app/_render_query` to generate a query for a search application called `my-app` that uses the search template. value: "{\n \"params\": {\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n }\n}" x-codeSamples: - lang: Console source: "POST _application/search_application/my-app/_render_query\n{\n \"params\": {\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n }\n}" - lang: Python source: "resp = client.search_application.render_query(\n name=\"my-app\",\n params={\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n },\n)" - lang: JavaScript source: "const response = await client.searchApplication.renderQuery({\n name: \"my-app\",\n params: {\n query_string: \"my first query\",\n text_fields: [\n {\n name: \"title\",\n boost: 5,\n },\n {\n name: \"description\",\n boost: 1,\n },\n ],\n },\n});" - lang: Ruby source: "response = client.search_application.render_query(\n name: \"my-app\",\n body: {\n \"params\": {\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n }\n }\n)" - lang: PHP source: "$resp = $client->searchApplication()->renderQuery([\n \"name\" => \"my-app\",\n \"body\" => [\n \"params\" => [\n \"query_string\" => \"my first query\",\n \"text_fields\" => array(\n [\n \"name\" => \"title\",\n \"boost\" => 5,\n ],\n [\n \"name\" => \"description\",\n \"boost\" => 1,\n ],\n ),\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"params":{"query_string":"my first query","text_fields":[{"name":"title","boost":5},{"name":"description","boost":1}]}}'' "$ELASTICSEARCH_URL/_application/search_application/my-app/_render_query"' - lang: C# source: "var response = await client.SearchApplication\n .RenderQueryAsync(name: \"my-app\", d1 => d1\n .Params(new Dictionary()\n {\n { \"query_string\", \"my first query\" },\n { \"text_fields\", JsonSerializer.Deserialize(\"\"\"\n [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n \"\"\") }\n })\n );" - lang: Java source: "client.searchApplication().renderQuery(r -> r\n .name(\"my-app\")\n .params(Map.of(\"text_fields\", JsonData.fromJson(\"\"\"\n[{\"name\":\"title\",\"boost\":5},{\"name\":\"description\",\"boost\":1}]\n\"\"\"),\"query_string\", JsonData.fromJson(\"\\\"my first query\\\"\")))\n);\n" responses: '200': description: '' content: application/json: schema: type: object examples: SearchApplicationsRenderQueryResponseExample1: description: 'A successful response for generating a query for a search application. The `from`, `size`, and `explain` parameters were not specified in the request, so the default values specified in the search template are used.' value: "{\n \"from\": 0,\n \"size\": 10,\n \"query\": {\n \"multi_match\": {\n \"query\": \"my first query\",\n \"fields\": [\n \"description^1.0\",\n \"title^5.0\"\n ]\n }\n },\n \"explain\": false\n}" x-state: Experimental; Added in 8.9.0 x-codeSamples: - lang: Console source: "POST _application/search_application/my-app/_render_query\n{\n \"params\": {\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n }\n}" - lang: Python source: "resp = client.search_application.render_query(\n name=\"my-app\",\n params={\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n },\n)" - lang: JavaScript source: "const response = await client.searchApplication.renderQuery({\n name: \"my-app\",\n params: {\n query_string: \"my first query\",\n text_fields: [\n {\n name: \"title\",\n boost: 5,\n },\n {\n name: \"description\",\n boost: 1,\n },\n ],\n },\n});" - lang: Ruby source: "response = client.search_application.render_query(\n name: \"my-app\",\n body: {\n \"params\": {\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n }\n }\n)" - lang: PHP source: "$resp = $client->searchApplication()->renderQuery([\n \"name\" => \"my-app\",\n \"body\" => [\n \"params\" => [\n \"query_string\" => \"my first query\",\n \"text_fields\" => array(\n [\n \"name\" => \"title\",\n \"boost\" => 5,\n ],\n [\n \"name\" => \"description\",\n \"boost\" => 1,\n ],\n ),\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"params":{"query_string":"my first query","text_fields":[{"name":"title","boost":5},{"name":"description","boost":1}]}}'' "$ELASTICSEARCH_URL/_application/search_application/my-app/_render_query"' - lang: C# source: "var response = await client.SearchApplication\n .RenderQueryAsync(name: \"my-app\", d1 => d1\n .Params(new Dictionary()\n {\n { \"query_string\", \"my first query\" },\n { \"text_fields\", JsonSerializer.Deserialize(\"\"\"\n [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n \"\"\") }\n })\n );" - lang: Java source: "client.searchApplication().renderQuery(r -> r\n .name(\"my-app\")\n .params(Map.of(\"text_fields\", JsonData.fromJson(\"\"\"\n[{\"name\":\"title\",\"boost\":5},{\"name\":\"description\",\"boost\":1}]\n\"\"\"),\"query_string\", JsonData.fromJson(\"\\\"my first query\\\"\")))\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_application/search_application/{name}/_search': post: tags: - search_application summary: "Run a search application search\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_application/search_application/{name}/_search\n
\n
\n POST\n /_application/search_application/{name}/_search\n
\n \n\nGenerate and run an Elasticsearch query that uses the specified query parameteter and the search template associated with the search application or default template.\nUnspecified template parameters are assigned their default values if applicable." operationId: search-application-search parameters: - $ref: '#/components/parameters/search_application.search-name' - $ref: '#/components/parameters/search_application.search-typed_keys' requestBody: $ref: '#/components/requestBodies/search_application.search' responses: '200': $ref: '#/components/responses/search_application.search-200' x-state: Beta; Added in 8.8.0 x-codeSamples: - lang: Console source: "POST _application/search_application/my-app/_search\n{\n \"params\": {\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\"name\": \"title\", \"boost\": 5},\n {\"name\": \"description\", \"boost\": 1}\n ]\n }\n}" - lang: Python source: "resp = client.search_application.search(\n name=\"my-app\",\n params={\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n },\n)" - lang: JavaScript source: "const response = await client.searchApplication.search({\n name: \"my-app\",\n params: {\n query_string: \"my first query\",\n text_fields: [\n {\n name: \"title\",\n boost: 5,\n },\n {\n name: \"description\",\n boost: 1,\n },\n ],\n },\n});" - lang: Ruby source: "response = client.search_application.search(\n name: \"my-app\",\n body: {\n \"params\": {\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n }\n }\n)" - lang: PHP source: "$resp = $client->searchApplication()->search([\n \"name\" => \"my-app\",\n \"body\" => [\n \"params\" => [\n \"query_string\" => \"my first query\",\n \"text_fields\" => array(\n [\n \"name\" => \"title\",\n \"boost\" => 5,\n ],\n [\n \"name\" => \"description\",\n \"boost\" => 1,\n ],\n ),\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"params":{"query_string":"my first query","text_fields":[{"name":"title","boost":5},{"name":"description","boost":1}]}}'' "$ELASTICSEARCH_URL/_application/search_application/my-app/_search"' - lang: C# source: "var response = await client.SearchApplication\n .SearchAsync(name: \"my-app\", d1 => d1\n .Params(new Dictionary()\n {\n { \"query_string\", \"my first query\" },\n { \"text_fields\", JsonSerializer.Deserialize(\"\"\"\n [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n \"\"\") }\n })\n );" - lang: Java source: "client.searchApplication().search(s -> s\n .name(\"my-app\")\n .params(Map.of(\"text_fields\", JsonData.fromJson(\"\"\"\n[{\"name\":\"title\",\"boost\":5},{\"name\":\"description\",\"boost\":1}]\n\"\"\"),\"query_string\", JsonData.fromJson(\"\\\"my first query\\\"\")))\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_mvt/{field}/{zoom}/{x}/{y}': get: tags: - search summary: "Search a vector tile\n" description: "**All methods and paths for this operation:**\n\n
\n POST\n /{index}/_mvt/{field}/{zoom}/{x}/{y}\n
\n
\n GET\n /{index}/_mvt/{field}/{zoom}/{x}/{y}\n
\n \n\nSearch a vector tile for geospatial values.\nBefore using this API, you should be familiar with the Mapbox vector tile specification.\nThe API returns results as a binary mapbox vector tile.\n\nInternally, Elasticsearch translates a vector tile search API request into a search containing:\n\n* A `geo_bounding_box` query on the ``. The query uses the `//` tile as a bounding box.\n* A `geotile_grid` or `geohex_grid` aggregation on the ``. The `grid_agg` parameter determines the aggregation type. The aggregation uses the `//` tile as a bounding box.\n* Optionally, a `geo_bounds` aggregation on the ``. The search only includes this aggregation if the `exact_bounds` parameter is `true`.\n* If the optional parameter `with_labels` is `true`, the internal search will include a dynamic runtime field that calls the `getLabelPosition` function of the geometry doc value. This enables the generation of new point features containing suggested geometry labels, so that, for example, multi-polygons will have only one label.\n\nThe API returns results as a binary Mapbox vector tile.\nMapbox vector tiles are encoded as Google Protobufs (PBF). By default, the tile contains three layers:\n\n* A `hits` layer containing a feature for each `` value matching the `geo_bounding_box` query.\n* An `aggs` layer containing a feature for each cell of the `geotile_grid` or `geohex_grid`. The layer only contains features for cells with matching data.\n* A meta layer containing:\n * A feature containing a bounding box. By default, this is the bounding box of the tile.\n * Value ranges for any sub-aggregations on the `geotile_grid` or `geohex_grid`.\n * Metadata for the search.\n\nThe API only returns features that can display at its zoom level.\nFor example, if a polygon feature has no area at its zoom level, the API omits it.\nThe API returns errors as UTF-8 encoded JSON.\n\nIMPORTANT: You can specify several options for this API as either a query parameter or request body parameter.\nIf you specify both parameters, the query parameter takes precedence.\n\n**Grid precision for geotile**\n\nFor a `grid_agg` of `geotile`, you can use cells in the `aggs` layer as tiles for lower zoom levels.\n`grid_precision` represents the additional zoom levels available through these cells. The final precision is computed by as follows: ` + grid_precision`.\nFor example, if `` is 7 and `grid_precision` is 8, then the `geotile_grid` aggregation will use a precision of 15.\nThe maximum final precision is 29.\nThe `grid_precision` also determines the number of cells for the grid as follows: `(2^grid_precision) x (2^grid_precision)`.\nFor example, a value of 8 divides the tile into a grid of 256 x 256 cells.\nThe `aggs` layer only contains features for cells with matching data.\n\n**Grid precision for geohex**\n\nFor a `grid_agg` of `geohex`, Elasticsearch uses `` and `grid_precision` to calculate a final precision as follows: ` + grid_precision`.\n\nThis precision determines the H3 resolution of the hexagonal cells produced by the `geohex` aggregation.\nThe following table maps the H3 resolution for each precision.\nFor example, if `` is 3 and `grid_precision` is 3, the precision is 6.\nAt a precision of 6, hexagonal cells have an H3 resolution of 2.\nIf `` is 3 and `grid_precision` is 4, the precision is 7.\nAt a precision of 7, hexagonal cells have an H3 resolution of 3.\n\n| Precision | Unique tile bins | H3 resolution | Unique hex bins |\tRatio |\n| --------- | ---------------- | ------------- | ----------------| ----- |\n| 1 | 4 | 0 | 122 | 30.5 |\n| 2 | 16 | 0 | 122 | 7.625 |\n| 3 | 64 | 1 | 842 | 13.15625 |\n| 4 | 256 | 1 | 842 | 3.2890625 |\n| 5 | 1024 | 2 | 5882 | 5.744140625 |\n| 6 | 4096 | 2 | 5882 | 1.436035156 |\n| 7 | 16384 | 3 | 41162 | 2.512329102 |\n| 8 | 65536 | 3 | 41162 | 0.6280822754 |\n| 9 | 262144 | 4 | 288122 | 1.099098206 |\n| 10 | 1048576 | 4 | 288122 | 0.2747745514 |\n| 11 | 4194304 | 5 | 2016842 | 0.4808526039 |\n| 12 | 16777216 | 6 | 14117882 | 0.8414913416 |\n| 13 | 67108864 | 6 | 14117882 | 0.2103728354 |\n| 14 | 268435456 | 7 | 98825162 | 0.3681524172 |\n| 15 | 1073741824 | 8 | 691776122 | 0.644266719 |\n| 16 | 4294967296 | 8 | 691776122 | 0.1610666797 |\n| 17 | 17179869184 | 9 | 4842432842 | 0.2818666889 |\n| 18 | 68719476736 | 10 | 33897029882 | 0.4932667053 |\n| 19 | 274877906944 | 11 | 237279209162 | 0.8632167343 |\n| 20 | 1099511627776 | 11 | 237279209162 | 0.2158041836 |\n| 21 | 4398046511104 | 12 | 1660954464122 | 0.3776573213 |\n| 22 | 17592186044416 | 13 | 11626681248842 | 0.6609003122 |\n| 23 | 70368744177664 | 13 | 11626681248842 | 0.165225078 |\n| 24 | 281474976710656 | 14 | 81386768741882 | 0.2891438866 |\n| 25 | 1125899906842620 | 15 | 569707381193162 | 0.5060018015 |\n| 26 | 4503599627370500 | 15 | 569707381193162 | 0.1265004504 |\n| 27 | 18014398509482000 | 15 | 569707381193162 | 0.03162511259 |\n| 28 | 72057594037927900 | 15 | 569707381193162 | 0.007906278149 |\n| 29 | 288230376151712000 | 15 | 569707381193162 | 0.001976569537 |\n\nHexagonal cells don't align perfectly on a vector tile.\nSome cells may intersect more than one vector tile.\nTo compute the H3 resolution for each precision, Elasticsearch compares the average density of hexagonal bins at each resolution with the average density of tile bins at each zoom level.\nElasticsearch uses the H3 resolution that is closest to the corresponding geotile density.\n\nLearn how to use the vector tile search API with practical examples in the [Vector tile search examples](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/vector-tile-search) guide.\n\n## Required authorization\n\n* Index privileges: `read`\n" externalDocs: description: More about mapbox vector tiles url: https://github.com/mapbox/vector-tile-spec/blob/master/README.md x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/search-vector-tile-api.html operationId: search-mvt parameters: - $ref: '#/components/parameters/search_mvt-index' - $ref: '#/components/parameters/search_mvt-field' - $ref: '#/components/parameters/search_mvt-zoom' - $ref: '#/components/parameters/search_mvt-x' - $ref: '#/components/parameters/search_mvt-y' - $ref: '#/components/parameters/search_mvt-exact_bounds' - $ref: '#/components/parameters/search_mvt-extent' - $ref: '#/components/parameters/search_mvt-grid_agg' - $ref: '#/components/parameters/search_mvt-grid_precision' - $ref: '#/components/parameters/search_mvt-grid_type' - $ref: '#/components/parameters/search_mvt-size' - $ref: '#/components/parameters/search_mvt-track_total_hits' - $ref: '#/components/parameters/search_mvt-with_labels' requestBody: $ref: '#/components/requestBodies/search_mvt' responses: '200': $ref: '#/components/responses/search_mvt-200' x-state: Generally available; Added in 7.15.0 x-codeSamples: - lang: Console source: "GET museums/_mvt/location/13/4207/2692\n{\n \"grid_agg\": \"geotile\",\n \"grid_precision\": 2,\n \"fields\": [\n \"name\",\n \"price\"\n ],\n \"query\": {\n \"term\": {\n \"included\": true\n }\n },\n \"aggs\": {\n \"min_price\": {\n \"min\": {\n \"field\": \"price\"\n }\n },\n \"max_price\": {\n \"max\": {\n \"field\": \"price\"\n }\n },\n \"avg_price\": {\n \"avg\": {\n \"field\": \"price\"\n }\n }\n }\n}" - lang: Python source: "resp = client.search_mvt(\n index=\"museums\",\n field=\"location\",\n zoom=\"13\",\n x=\"4207\",\n y=\"2692\",\n grid_agg=\"geotile\",\n grid_precision=2,\n fields=[\n \"name\",\n \"price\"\n ],\n query={\n \"term\": {\n \"included\": True\n }\n },\n aggs={\n \"min_price\": {\n \"min\": {\n \"field\": \"price\"\n }\n },\n \"max_price\": {\n \"max\": {\n \"field\": \"price\"\n }\n },\n \"avg_price\": {\n \"avg\": {\n \"field\": \"price\"\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.searchMvt({\n index: \"museums\",\n field: \"location\",\n zoom: 13,\n x: 4207,\n y: 2692,\n grid_agg: \"geotile\",\n grid_precision: 2,\n fields: [\"name\", \"price\"],\n query: {\n term: {\n included: true,\n },\n },\n aggs: {\n min_price: {\n min: {\n field: \"price\",\n },\n },\n max_price: {\n max: {\n field: \"price\",\n },\n },\n avg_price: {\n avg: {\n field: \"price\",\n },\n },\n },\n});" - lang: Ruby source: "response = client.search_mvt(\n index: \"museums\",\n field: \"location\",\n zoom: \"13\",\n x: \"4207\",\n y: \"2692\",\n body: {\n \"grid_agg\": \"geotile\",\n \"grid_precision\": 2,\n \"fields\": [\n \"name\",\n \"price\"\n ],\n \"query\": {\n \"term\": {\n \"included\": true\n }\n },\n \"aggs\": {\n \"min_price\": {\n \"min\": {\n \"field\": \"price\"\n }\n },\n \"max_price\": {\n \"max\": {\n \"field\": \"price\"\n }\n },\n \"avg_price\": {\n \"avg\": {\n \"field\": \"price\"\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->searchMvt([\n \"index\" => \"museums\",\n \"field\" => \"location\",\n \"zoom\" => \"13\",\n \"x\" => \"4207\",\n \"y\" => \"2692\",\n \"body\" => [\n \"grid_agg\" => \"geotile\",\n \"grid_precision\" => 2,\n \"fields\" => array(\n \"name\",\n \"price\",\n ),\n \"query\" => [\n \"term\" => [\n \"included\" => true,\n ],\n ],\n \"aggs\" => [\n \"min_price\" => [\n \"min\" => [\n \"field\" => \"price\",\n ],\n ],\n \"max_price\" => [\n \"max\" => [\n \"field\" => \"price\",\n ],\n ],\n \"avg_price\" => [\n \"avg\" => [\n \"field\" => \"price\",\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"grid_agg":"geotile","grid_precision":2,"fields":["name","price"],"query":{"term":{"included":true}},"aggs":{"min_price":{"min":{"field":"price"}},"max_price":{"max":{"field":"price"}},"avg_price":{"avg":{"field":"price"}}}}'' "$ELASTICSEARCH_URL/museums/_mvt/location/13/4207/2692"' - lang: C# source: "var response = await client\n .SearchMvtAsync(indices: new[] { \"museums\" }, field: global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.Location), zoom: 13, x: 4207, y: 2692, d1 => d1\n .Aggs(d2 => d2\n .Add(\"min_price\", d3 => d3\n .Min(d4 => d4\n .Field(x => x.Price)\n )\n )\n .Add(\"max_price\", d3 => d3\n .Max(d4 => d4\n .Field(x => x.Price)\n )\n )\n .Add(\"avg_price\", d3 => d3\n .Avg(d4 => d4\n .Field(x => x.Price)\n )\n )\n )\n .Fields(x => x.Name, x => x.Price)\n .GridAgg(GridAggregationType.Geotile)\n .GridPrecision(2)\n .Query(d2 => d2\n .Term(d3 => d3\n .Field(x => x.Included)\n .Value(true)\n )\n )\n );" - lang: Java source: "client.searchMvt(s -> s\n .aggs(Map.of(\"max_price\", Aggregation.of(a -> a\n .max(m -> m\n .field(\"price\")\n )\n ),\"min_price\", Aggregation.of(ag -> ag\n .min(m -> m\n .field(\"price\")\n )\n ),\"avg_price\", Aggregation.of(agg -> agg\n .avg(av -> av\n .field(\"price\")\n )\n )))\n .field(\"location\")\n .fields(List.of(\"name\",\"price\"))\n .gridAgg(GridAggregationType.Geotile)\n .gridPrecision(2)\n .index(\"museums\")\n .query(q -> q\n .term(t -> t\n .field(\"included\")\n .value(FieldValue.of(true))\n )\n )\n .x(4207)\n .y(2692)\n .zoom(13)\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_search_shards': post: tags: - search summary: "Get the search shards\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_search_shards\n
\n
\n POST\n /_search_shards\n
\n
\n GET\n /{index}/_search_shards\n
\n
\n POST\n /{index}/_search_shards\n
\n \n\nGet the indices and shards that a search request would be run against.\nThis information can be useful for working out issues or planning optimizations with routing and shard preferences.\nWhen filtered aliases are used, the filter is returned as part of the `indices` section.\n\nIf the Elasticsearch security features are enabled, you must have the `view_index_metadata` or `manage` index privilege for the target data stream, index, or alias.\n\n## Required authorization\n\n* Index privileges: `view_index_metadata`\n" operationId: search-shards parameters: - $ref: '#/components/parameters/search_shards-index' - $ref: '#/components/parameters/search_shards-allow_no_indices' - $ref: '#/components/parameters/search_shards-expand_wildcards' - $ref: '#/components/parameters/search_shards-ignore_unavailable' - $ref: '#/components/parameters/search_shards-local' - $ref: '#/components/parameters/search_shards-master_timeout' - $ref: '#/components/parameters/search_shards-preference' - $ref: '#/components/parameters/search_shards-routing' responses: '200': $ref: '#/components/responses/search_shards-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET /my-index-000001/_search_shards\n" - lang: Python source: "resp = client.search_shards(\n index=\"my-index-000001\",\n)" - lang: JavaScript source: "const response = await client.searchShards({\n index: \"my-index-000001\",\n});" - lang: Ruby source: "response = client.search_shards(\n index: \"my-index-000001\"\n)" - lang: PHP source: "$resp = $client->searchShards([\n \"index\" => \"my-index-000001\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_search_shards"' - lang: C# source: "var response = await client\n .SearchShardsAsync(d1 => d1\n .Indices(new[] { \"my-index-000001\" })\n );" - lang: Java source: "client.searchShards(s -> s\n .index(\"my-index-000001\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_search/template': post: tags: - search summary: "Run a search with a search template\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_search/template\n
\n
\n POST\n /_search/template\n
\n
\n GET\n /{index}/_search/template\n
\n
\n POST\n /{index}/_search/template\n
\n\n## Required authorization\n\n* Index privileges: `read`\n" externalDocs: description: More about searching templates url: https://www.elastic.co/docs/solutions/search/search-templates x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/search-template-api.html operationId: search-template parameters: - $ref: '#/components/parameters/search_template-index' - $ref: '#/components/parameters/search_template-allow_no_indices' - $ref: '#/components/parameters/search_template-ccs_minimize_roundtrips' - $ref: '#/components/parameters/search_template-expand_wildcards' - $ref: '#/components/parameters/search_template-explain' - $ref: '#/components/parameters/search_template-ignore_throttled' - $ref: '#/components/parameters/search_template-ignore_unavailable' - $ref: '#/components/parameters/search_template-preference' - $ref: '#/components/parameters/search_template-profile' - $ref: '#/components/parameters/search_template-routing' - $ref: '#/components/parameters/search_template-scroll' - $ref: '#/components/parameters/search_template-search_type' - $ref: '#/components/parameters/search_template-rest_total_hits_as_int' - $ref: '#/components/parameters/search_template-typed_keys' requestBody: $ref: '#/components/requestBodies/search_template' responses: '200': $ref: '#/components/responses/search_template-200' x-state: Generally available; Added in 2.0.0 x-codeSamples: - lang: Console source: "GET my-index/_search/template\n{\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n}" - lang: Python source: "resp = client.search_template(\n index=\"my-index\",\n id=\"my-search-template\",\n params={\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n },\n)" - lang: JavaScript source: "const response = await client.searchTemplate({\n index: \"my-index\",\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 0,\n size: 10,\n },\n});" - lang: Ruby source: "response = client.search_template(\n index: \"my-index\",\n body: {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n }\n)" - lang: PHP source: "$resp = $client->searchTemplate([\n \"index\" => \"my-index\",\n \"body\" => [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 0,\n \"size\" => 10,\n ],\n ],\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"id":"my-search-template","params":{"query_string":"hello world","from":0,"size":10}}'' "$ELASTICSEARCH_URL/my-index/_search/template"' - lang: C# source: "var response = await client\n .SearchTemplateAsync(d1 => d1\n .Indices(new[] { \"my-index\" })\n .Id(\"my-search-template\")\n .Params(new Dictionary()\n {\n { \"query_string\", \"hello world\" },\n { \"from\", 0 },\n { \"size\", 10 }\n })\n );" - lang: Java source: "client.searchTemplate(s -> s\n .id(\"my-search-template\")\n .index(\"my-index\")\n .params(Map.of(\"size\", JsonData.fromJson(\"10\"),\"from\", JsonData.fromJson(\"0\"),\"query_string\", JsonData.fromJson(\"\\\"hello world\\\"\")))\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_searchable_snapshots/{node_id}/cache/stats': get: tags: - searchable_snapshots summary: "Get cache statistics\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_searchable_snapshots/cache/stats\n
\n
\n GET\n /_searchable_snapshots/{node_id}/cache/stats\n
\n \n\nGet statistics about the shared cache for partially mounted indices.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" externalDocs: description: More about searchable snapshots url: https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore/searchable-snapshots x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/searchable-snapshots-api-cache-stats.html operationId: searchable-snapshots-cache-stats parameters: - $ref: '#/components/parameters/searchable_snapshots.cache_stats-node_id' responses: '200': $ref: '#/components/responses/searchable_snapshots.cache_stats-200' x-state: Experimental; Added in 7.13.0 x-codeSamples: - lang: Console source: "GET /_searchable_snapshots/cache/stats\n" - lang: Python source: resp = client.searchable_snapshots.cache_stats() - lang: JavaScript source: const response = await client.searchableSnapshots.cacheStats(); - lang: Ruby source: response = client.searchable_snapshots.cache_stats - lang: PHP source: $resp = $client->searchableSnapshots()->cacheStats(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_searchable_snapshots/cache/stats"' - lang: C# source: var response = await client.SearchableSnapshots.CacheStatsAsync(); - lang: Java source: "client.searchableSnapshots().cacheStats(c -> c);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_searchable_snapshots/cache/clear': post: tags: - searchable_snapshots summary: "Clear the searchable snapshots shared cache\n" description: "**All methods and paths for this operation:**\n\n
\n POST\n /_searchable_snapshots/cache/clear\n
\n
\n POST\n /{index}/_searchable_snapshots/cache/clear\n
\n \n\nClear indices and data streams from the shared cache for partially mounted indices.\n\n## Required authorization\n\n* Index privileges: `manage`\n* Cluster privileges: `manage`\n" externalDocs: description: More about searchable snapshots url: https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore/searchable-snapshots x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/searchable-snapshots-api-clear-cache.html operationId: searchable-snapshots-clear-cache parameters: - $ref: '#/components/parameters/searchable_snapshots.clear_cache-index' - $ref: '#/components/parameters/searchable_snapshots.clear_cache-expand_wildcards' - $ref: '#/components/parameters/searchable_snapshots.clear_cache-allow_no_indices' - $ref: '#/components/parameters/searchable_snapshots.clear_cache-ignore_unavailable' responses: '200': $ref: '#/components/responses/searchable_snapshots.clear_cache-200' x-state: Experimental; Added in 7.10.0 x-codeSamples: - lang: Console source: "POST /my-index/_searchable_snapshots/cache/clear\n" - lang: Python source: "resp = client.searchable_snapshots.clear_cache(\n index=\"my-index\",\n)" - lang: JavaScript source: "const response = await client.searchableSnapshots.clearCache({\n index: \"my-index\",\n});" - lang: Ruby source: "response = client.searchable_snapshots.clear_cache(\n index: \"my-index\"\n)" - lang: PHP source: "$resp = $client->searchableSnapshots()->clearCache([\n \"index\" => \"my-index\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index/_searchable_snapshots/cache/clear"' - lang: C# source: "var response = await client.SearchableSnapshots\n .ClearCacheAsync(d1 => d1\n .Indices(new[] { \"my-index\" })\n );" - lang: Java source: "client.searchableSnapshots().clearCache(c -> c\n .index(\"my-index\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_snapshot/{repository}/{snapshot}/_mount': post: tags: - searchable_snapshots summary: Mount a snapshot description: "Mount a snapshot as a searchable snapshot index.\nDo not use this API for snapshots managed by index lifecycle management (ILM).\nManually mounting ILM-managed snapshots can interfere with ILM processes.\n\n## Required authorization\n\n* Index privileges: `manage`\n* Cluster privileges: `manage`\n" operationId: searchable-snapshots-mount parameters: - name: repository in: path description: The name of the repository containing the snapshot of the index to mount. required: true schema: $ref: '#/components/schemas/_types.Name' - name: snapshot in: path description: The name of the snapshot of the index to mount. required: true schema: $ref: '#/components/schemas/_types.Name' - name: master_timeout in: query description: "The period to wait for the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nTo indicate that the request should never timeout, set it to `-1`." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: wait_for_completion in: query description: 'If true, the request blocks until the operation is complete.' schema: type: boolean default: false - name: storage in: query description: "The mount option for the searchable snapshot index.\nFor further information on mount options, refer to: [Mount options](https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore/searchable-snapshots#searchable-snapshot-mount-storage-options)\n\nSupported values include:\n - `full_copy`: Fully caches the snapshotted index’s shards in the Elasticsearch cluster.\n - `shared_cache`: Uses a local cache containing only recently searched parts of the snapshotted index’s data.\n\n" schema: allOf: - $ref: '#/components/schemas/searchable_snapshots.mount.StorageOption' default: full_copy requestBody: content: application/json: schema: required: - index type: object properties: index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: "The name of the index contained in the snapshot whose data is to be mounted.\nIf no `renamed_index` is specified, this name will also be used to create the new index." renamed_index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: The name of the index that will be created. index_settings: type: object additionalProperties: type: object description: The settings that should be added to the index when it is mounted. ignore_index_settings: type: array items: type: string description: The names of settings that should be removed from the index when it is mounted. examples: SearchableSnapshotsMountSnapshotRequestExample1: description: "Run `POST /_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true` to mount the index `my_docs` from an existing snapshot named `my_snapshot` stored in `my_repository` as a new index `docs`.\n" value: "{\n \"index\": \"my_docs\",\n \"renamed_index\": \"docs\",\n \"index_settings\": {\n \"index.number_of_replicas\": 0\n },\n \"ignore_index_settings\": [ \"index.refresh_interval\" ]\n}" x-codeSamples: - lang: Console source: "POST /_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true\n{\n \"index\": \"my_docs\",\n \"renamed_index\": \"docs\",\n \"index_settings\": {\n \"index.number_of_replicas\": 0\n },\n \"ignore_index_settings\": [ \"index.refresh_interval\" ]\n}" - lang: Python source: "resp = client.searchable_snapshots.mount(\n repository=\"my_repository\",\n snapshot=\"my_snapshot\",\n wait_for_completion=True,\n index=\"my_docs\",\n renamed_index=\"docs\",\n index_settings={\n \"index.number_of_replicas\": 0\n },\n ignore_index_settings=[\n \"index.refresh_interval\"\n ],\n)" - lang: JavaScript source: "const response = await client.searchableSnapshots.mount({\n repository: \"my_repository\",\n snapshot: \"my_snapshot\",\n wait_for_completion: \"true\",\n index: \"my_docs\",\n renamed_index: \"docs\",\n index_settings: {\n \"index.number_of_replicas\": 0,\n },\n ignore_index_settings: [\"index.refresh_interval\"],\n});" - lang: Ruby source: "response = client.searchable_snapshots.mount(\n repository: \"my_repository\",\n snapshot: \"my_snapshot\",\n wait_for_completion: \"true\",\n body: {\n \"index\": \"my_docs\",\n \"renamed_index\": \"docs\",\n \"index_settings\": {\n \"index.number_of_replicas\": 0\n },\n \"ignore_index_settings\": [\n \"index.refresh_interval\"\n ]\n }\n)" - lang: PHP source: "$resp = $client->searchableSnapshots()->mount([\n \"repository\" => \"my_repository\",\n \"snapshot\" => \"my_snapshot\",\n \"wait_for_completion\" => \"true\",\n \"body\" => [\n \"index\" => \"my_docs\",\n \"renamed_index\" => \"docs\",\n \"index_settings\" => [\n \"index.number_of_replicas\" => 0,\n ],\n \"ignore_index_settings\" => array(\n \"index.refresh_interval\",\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"index":"my_docs","renamed_index":"docs","index_settings":{"index.number_of_replicas":0},"ignore_index_settings":["index.refresh_interval"]}'' "$ELASTICSEARCH_URL/_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true"' - lang: C# source: "var response = await client.SearchableSnapshots\n .MountAsync(repository: \"my_repository\", snapshot: \"my_snapshot\", d1 => d1\n .WaitForCompletion(true)\n .IgnoreIndexSettings(\"index.refresh_interval\")\n .Index(\"my_docs\")\n .IndexSettings(new Dictionary()\n {\n { \"index.number_of_replicas\", 0 }\n })\n .RenamedIndex(\"docs\")\n );" - lang: Java source: "client.searchableSnapshots().mount(m -> m\n .ignoreIndexSettings(\"index.refresh_interval\")\n .index(\"my_docs\")\n .indexSettings(\"index.number_of_replicas\", JsonData.fromJson(\"0\"))\n .renamedIndex(\"docs\")\n .repository(\"my_repository\")\n .snapshot(\"my_snapshot\")\n .waitForCompletion(true)\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - snapshot type: object properties: snapshot: allOf: - $ref: '#/components/schemas/searchable_snapshots.mount.MountedSnapshot' x-state: Generally available; Added in 7.10.0 x-codeSamples: - lang: Console source: "POST /_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true\n{\n \"index\": \"my_docs\",\n \"renamed_index\": \"docs\",\n \"index_settings\": {\n \"index.number_of_replicas\": 0\n },\n \"ignore_index_settings\": [ \"index.refresh_interval\" ]\n}" - lang: Python source: "resp = client.searchable_snapshots.mount(\n repository=\"my_repository\",\n snapshot=\"my_snapshot\",\n wait_for_completion=True,\n index=\"my_docs\",\n renamed_index=\"docs\",\n index_settings={\n \"index.number_of_replicas\": 0\n },\n ignore_index_settings=[\n \"index.refresh_interval\"\n ],\n)" - lang: JavaScript source: "const response = await client.searchableSnapshots.mount({\n repository: \"my_repository\",\n snapshot: \"my_snapshot\",\n wait_for_completion: \"true\",\n index: \"my_docs\",\n renamed_index: \"docs\",\n index_settings: {\n \"index.number_of_replicas\": 0,\n },\n ignore_index_settings: [\"index.refresh_interval\"],\n});" - lang: Ruby source: "response = client.searchable_snapshots.mount(\n repository: \"my_repository\",\n snapshot: \"my_snapshot\",\n wait_for_completion: \"true\",\n body: {\n \"index\": \"my_docs\",\n \"renamed_index\": \"docs\",\n \"index_settings\": {\n \"index.number_of_replicas\": 0\n },\n \"ignore_index_settings\": [\n \"index.refresh_interval\"\n ]\n }\n)" - lang: PHP source: "$resp = $client->searchableSnapshots()->mount([\n \"repository\" => \"my_repository\",\n \"snapshot\" => \"my_snapshot\",\n \"wait_for_completion\" => \"true\",\n \"body\" => [\n \"index\" => \"my_docs\",\n \"renamed_index\" => \"docs\",\n \"index_settings\" => [\n \"index.number_of_replicas\" => 0,\n ],\n \"ignore_index_settings\" => array(\n \"index.refresh_interval\",\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"index":"my_docs","renamed_index":"docs","index_settings":{"index.number_of_replicas":0},"ignore_index_settings":["index.refresh_interval"]}'' "$ELASTICSEARCH_URL/_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true"' - lang: C# source: "var response = await client.SearchableSnapshots\n .MountAsync(repository: \"my_repository\", snapshot: \"my_snapshot\", d1 => d1\n .WaitForCompletion(true)\n .IgnoreIndexSettings(\"index.refresh_interval\")\n .Index(\"my_docs\")\n .IndexSettings(new Dictionary()\n {\n { \"index.number_of_replicas\", 0 }\n })\n .RenamedIndex(\"docs\")\n );" - lang: Java source: "client.searchableSnapshots().mount(m -> m\n .ignoreIndexSettings(\"index.refresh_interval\")\n .index(\"my_docs\")\n .indexSettings(\"index.number_of_replicas\", JsonData.fromJson(\"0\"))\n .renamedIndex(\"docs\")\n .repository(\"my_repository\")\n .snapshot(\"my_snapshot\")\n .waitForCompletion(true)\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_searchable_snapshots/stats': get: tags: - searchable_snapshots summary: "Get searchable snapshot statistics\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_searchable_snapshots/stats\n
\n
\n GET\n /{index}/_searchable_snapshots/stats\n
\n\n## Required authorization\n\n* Index privileges: `manage`\n* Cluster privileges: `manage`\n" operationId: searchable-snapshots-stats parameters: - $ref: '#/components/parameters/searchable_snapshots.stats-index' - $ref: '#/components/parameters/searchable_snapshots.stats-level' responses: '200': $ref: '#/components/responses/searchable_snapshots.stats-200' x-state: Generally available; Added in 7.10.0 x-codeSamples: - lang: Console source: "GET /my-index/_searchable_snapshots/stats\n" - lang: Python source: "resp = client.searchable_snapshots.stats(\n index=\"my-index\",\n)" - lang: JavaScript source: "const response = await client.searchableSnapshots.stats({\n index: \"my-index\",\n});" - lang: Ruby source: "response = client.searchable_snapshots.stats(\n index: \"my-index\"\n)" - lang: PHP source: "$resp = $client->searchableSnapshots()->stats([\n \"index\" => \"my-index\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index/_searchable_snapshots/stats"' - lang: C# source: "var response = await client.SearchableSnapshots\n .StatsAsync(d1 => d1\n .Indices(new[] { \"my-index\" })\n );" - lang: Java source: "client.searchableSnapshots().stats(s -> s\n .index(\"my-index\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/profile/_activate: post: tags: - security summary: Activate a user profile description: "Create or update a user profile on behalf of another user.\n\nNOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions.\nIndividual users and external applications should not call this API directly.\nThe calling application must have either an `access_token` or a combination of `username` and `password` for the user that the profile document is intended for.\nElastic reserves the right to change or remove this feature in future releases without prior notice.\n\nThis API creates or updates a profile document for end users with information that is extracted from the user's authentication object including `username`, `full_name,` `roles`, and the authentication realm.\nFor example, in the JWT `access_token` case, the profile user's `username` is extracted from the JWT token claim pointed to by the `claims.principal` setting of the JWT realm that authenticated the token.\n\nWhen updating a profile document, the API enables the document if it was disabled.\nAny updates do not change existing content for either the `labels` or `data` fields.\n\n## Required authorization\n\n* Cluster privileges: `manage_user_profile`\n" operationId: security-activate-user-profile requestBody: content: application/json: schema: required: - grant_type type: object properties: access_token: type: string description: "The user's Elasticsearch access token or JWT.\nBoth `access` and `id` JWT token types are supported and they depend on the underlying JWT realm configuration.\nIf you specify the `access_token` grant type, this parameter is required.\nIt is not valid with other grant types." grant_type: allOf: - $ref: '#/components/schemas/security._types.GrantType' description: "The type of grant.\n\nSupported values include:\n - `password`: In this type of grant, you must supply the user ID and password for which you want to create the API key.\n - `access_token`: In this type of grant, you must supply an access token that was created by the Elasticsearch token service.\nIf you are activating a user profile, you can alternatively supply a JWT (either a JWT `access_token` or a JWT `id_token`).\n\n" password: type: string description: "The user's password.\nIf you specify the `password` grant type, this parameter is required.\nIt is not valid with other grant types." username: type: string description: "The username that identifies the user.\nIf you specify the `password` grant type, this parameter is required.\nIt is not valid with other grant types." examples: ActivateUserProfileRequestExample1: description: "Run `POST /_security/profile/_activate` to activate a user profile.\n" value: "{\n \"grant_type\": \"password\",\n \"username\" : \"jacknich\",\n \"password\" : \"l0ng-r4nd0m-p@ssw0rd\"\n}" x-codeSamples: - lang: Console source: "POST /_security/profile/_activate\n{\n \"grant_type\": \"password\",\n \"username\" : \"jacknich\",\n \"password\" : \"l0ng-r4nd0m-p@ssw0rd\"\n}" - lang: Python source: "resp = client.security.activate_user_profile(\n grant_type=\"password\",\n username=\"jacknich\",\n password=\"l0ng-r4nd0m-p@ssw0rd\",\n)" - lang: JavaScript source: "const response = await client.security.activateUserProfile({\n grant_type: \"password\",\n username: \"jacknich\",\n password: \"l0ng-r4nd0m-p@ssw0rd\",\n});" - lang: Ruby source: "response = client.security.activate_user_profile(\n body: {\n \"grant_type\": \"password\",\n \"username\": \"jacknich\",\n \"password\": \"l0ng-r4nd0m-p@ssw0rd\"\n }\n)" - lang: PHP source: "$resp = $client->security()->activateUserProfile([\n \"body\" => [\n \"grant_type\" => \"password\",\n \"username\" => \"jacknich\",\n \"password\" => \"l0ng-r4nd0m-p@ssw0rd\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"grant_type":"password","username":"jacknich","password":"l0ng-r4nd0m-p@ssw0rd"}'' "$ELASTICSEARCH_URL/_security/profile/_activate"' - lang: C# source: "var response = await client.Security\n .ActivateUserProfileAsync(d1 => d1\n .GrantType(GrantType.Password)\n .Password(\"l0ng-r4nd0m-p@ssw0rd\")\n .Username(\"jacknich\")\n );" - lang: Java source: "client.security().activateUserProfile(a -> a\n .grantType(GrantType.Password)\n .password(\"l0ng-r4nd0m-p@ssw0rd\")\n .username(\"jacknich\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/security._types.UserProfileWithMetadata' examples: ActivateUserProfileResponseExample1: description: A successful response from `POST /_security/profile/_activate`. value: "{\n \"uid\": \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n \"enabled\": true,\n \"last_synchronized\": 1642650651037,\n \"user\": {\n \"username\": \"jacknich\",\n \"roles\": [\n \"admin\", \"other_role1\"\n ],\n \"realm_name\": \"native\",\n \"full_name\": \"Jack Nicholson\",\n \"email\": \"jacknich@example.com\"\n },\n \"labels\": {},\n \"data\": {},\n \"_doc\": {\n \"_primary_term\": 88,\n \"_seq_no\": 66\n }\n}" x-state: Generally available; Added in 8.2.0 x-codeSamples: - lang: Console source: "POST /_security/profile/_activate\n{\n \"grant_type\": \"password\",\n \"username\" : \"jacknich\",\n \"password\" : \"l0ng-r4nd0m-p@ssw0rd\"\n}" - lang: Python source: "resp = client.security.activate_user_profile(\n grant_type=\"password\",\n username=\"jacknich\",\n password=\"l0ng-r4nd0m-p@ssw0rd\",\n)" - lang: JavaScript source: "const response = await client.security.activateUserProfile({\n grant_type: \"password\",\n username: \"jacknich\",\n password: \"l0ng-r4nd0m-p@ssw0rd\",\n});" - lang: Ruby source: "response = client.security.activate_user_profile(\n body: {\n \"grant_type\": \"password\",\n \"username\": \"jacknich\",\n \"password\": \"l0ng-r4nd0m-p@ssw0rd\"\n }\n)" - lang: PHP source: "$resp = $client->security()->activateUserProfile([\n \"body\" => [\n \"grant_type\" => \"password\",\n \"username\" => \"jacknich\",\n \"password\" => \"l0ng-r4nd0m-p@ssw0rd\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"grant_type":"password","username":"jacknich","password":"l0ng-r4nd0m-p@ssw0rd"}'' "$ELASTICSEARCH_URL/_security/profile/_activate"' - lang: C# source: "var response = await client.Security\n .ActivateUserProfileAsync(d1 => d1\n .GrantType(GrantType.Password)\n .Password(\"l0ng-r4nd0m-p@ssw0rd\")\n .Username(\"jacknich\")\n );" - lang: Java source: "client.security().activateUserProfile(a -> a\n .grantType(GrantType.Password)\n .password(\"l0ng-r4nd0m-p@ssw0rd\")\n .username(\"jacknich\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/_authenticate: get: tags: - security summary: Authenticate a user description: "Authenticates a user and returns information about the authenticated user.\nInclude the user information in a [basic auth header](https://en.wikipedia.org/wiki/Basic_access_authentication).\nA successful call returns a JSON structure that shows user information such as their username, the roles that are assigned to the user, any assigned metadata, and information about the realms that authenticated and authorized the user.\nIf the user cannot be authenticated, this API returns a 401 status code." operationId: security-authenticate responses: '200': description: '' content: application/json: schema: required: - authentication_realm - lookup_realm - metadata - roles - username - enabled - authentication_type type: object properties: api_key: allOf: - $ref: '#/components/schemas/security.authenticate.AuthenticateApiKey' authentication_realm: allOf: - $ref: '#/components/schemas/security._types.RealmInfo' email: oneOf: - type: string - type: - 'null' - string full_name: oneOf: - $ref: '#/components/schemas/_types.Name' - type: - 'null' - string lookup_realm: allOf: - $ref: '#/components/schemas/security._types.RealmInfo' metadata: allOf: - $ref: '#/components/schemas/_types.Metadata' roles: type: array items: type: string username: allOf: - $ref: '#/components/schemas/_types.Username' enabled: type: boolean authentication_type: type: string token: allOf: - $ref: '#/components/schemas/security.authenticate.Token' x-state: Generally available; Added in 7.14.0 examples: SecurityAuthenticateResponseExample1: description: A successful response from `GET /_security/_authenticate`. value: "{\n \"username\": \"rdeniro\",\n \"roles\": [\n \"admin\"\n ],\n \"full_name\": null,\n \"email\": null,\n \"metadata\": { },\n \"enabled\": true,\n \"authentication_realm\": {\n \"name\" : \"file\",\n \"type\" : \"file\"\n },\n \"lookup_realm\": {\n \"name\" : \"file\",\n \"type\" : \"file\"\n },\n \"authentication_type\": \"realm\"\n}" SecurityAuthenticateResponseExample2: description: A successful response from `GET /_security/_authenticate` for access token authentication. value: "{\n \"username\": \"0000000001\",\n \"roles\": [\n \"admin\"\n ],\n \"full_name\": \"Peter Parker\",\n \"email\": \"spider-man@marvel.com\",\n \"metadata\": {},\n \"enabled\": true,\n \"authentication_realm\": {\n \"name\": \"cloud-saml-kibana\",\n \"type\": \"saml\"\n },\n \"lookup_realm\": {\n \"name\": \"cloud-saml-kibana\",\n \"type\": \"saml\"\n },\n \"authentication_type\": \"token\",\n \"token\": {\n \"managed_by\": \"cloud\"\n }\n}" SecurityAuthenticateResponseExample3: description: A successful response from `GET /_security/_authenticate` for service account token authentication. value: "{\n \"username\": \"elastic/fleet-server\",\n \"roles\": [ ],\n \"full_name\": \"Service account - elastic/fleet-server\",\n \"email\": null,\n \"metadata\": {\n \"_elastic_service_account\": true\n },\n \"enabled\": true,\n \"authentication_realm\": {\n \"name\": \"_service_account\",\n \"type\": \"_service_account\"\n },\n \"lookup_realm\": {\n \"name\": \"_service_account\",\n \"type\": \"_service_account\"\n },\n \"authentication_type\": \"token\",\n \"token\": {\n \"type\": \"_service_account_index\",\n \"name\": \"token_abcd1234\",\n \"managed_by\": \"elasticsearch\"\n }\n}" x-state: Generally available; Added in 5.5.0 x-codeSamples: - lang: Console source: "GET /_security/_authenticate\n" - lang: Python source: resp = client.security.authenticate() - lang: JavaScript source: const response = await client.security.authenticate(); - lang: Ruby source: response = client.security.authenticate - lang: PHP source: $resp = $client->security()->authenticate(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/_authenticate"' - lang: C# source: var response = await client.Security.AuthenticateAsync(); - lang: Java source: "client.security().authenticate();\n" x-metaTags: - content: Elasticsearch name: product_name /_security/role: post: tags: - security summary: Bulk create or update roles description: "The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.\nThe bulk create or update roles API cannot update roles that are defined in roles files.\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" operationId: security-bulk-put-role parameters: - name: refresh in: query description: 'If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.' schema: $ref: '#/components/schemas/_types.Refresh' requestBody: content: application/json: schema: required: - roles type: object properties: roles: type: object additionalProperties: $ref: '#/components/schemas/security._types.RoleDescriptor' description: A dictionary of role name to RoleDescriptor objects to add or update examples: SecurityBulkPutRoleRequestExample1: summary: Bulk role success description: "Run `POST /_security/role` to add roles called `my_admin_role` and `my_user_role`.\n" value: "{\n \"roles\": {\n \"my_admin_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\n \"all\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n },\n \"my_user_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\"\n ],\n \"privileges\": [\n \"read\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n }\n }\n}" x-codeSamples: - lang: Console source: "POST /_security/role\n{\n \"roles\": {\n \"my_admin_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\n \"all\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n },\n \"my_user_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\"\n ],\n \"privileges\": [\n \"read\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n }\n }\n}" - lang: Python source: "resp = client.security.bulk_put_role(\n roles={\n \"my_admin_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\n \"all\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n },\n \"my_user_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\"\n ],\n \"privileges\": [\n \"read\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.security.bulkPutRole({\n roles: {\n my_admin_role: {\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index1\", \"index2\"],\n privileges: [\"all\"],\n field_security: {\n grant: [\"title\", \"body\"],\n },\n query: '{\"match\": {\"title\": \"foo\"}}',\n },\n ],\n applications: [\n {\n application: \"myapp\",\n privileges: [\"admin\", \"read\"],\n resources: [\"*\"],\n },\n ],\n run_as: [\"other_user\"],\n metadata: {\n version: 1,\n },\n },\n my_user_role: {\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index1\"],\n privileges: [\"read\"],\n field_security: {\n grant: [\"title\", \"body\"],\n },\n query: '{\"match\": {\"title\": \"foo\"}}',\n },\n ],\n applications: [\n {\n application: \"myapp\",\n privileges: [\"admin\", \"read\"],\n resources: [\"*\"],\n },\n ],\n run_as: [\"other_user\"],\n metadata: {\n version: 1,\n },\n },\n },\n});" - lang: Ruby source: "response = client.security.bulk_put_role(\n body: {\n \"roles\": {\n \"my_admin_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\n \"all\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n },\n \"my_user_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\"\n ],\n \"privileges\": [\n \"read\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->bulkPutRole([\n \"body\" => [\n \"roles\" => [\n \"my_admin_role\" => [\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index1\",\n \"index2\",\n ),\n \"privileges\" => array(\n \"all\",\n ),\n \"field_security\" => [\n \"grant\" => array(\n \"title\",\n \"body\",\n ),\n ],\n \"query\" => \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\",\n ],\n ),\n \"applications\" => array(\n [\n \"application\" => \"myapp\",\n \"privileges\" => array(\n \"admin\",\n \"read\",\n ),\n \"resources\" => array(\n \"*\",\n ),\n ],\n ),\n \"run_as\" => array(\n \"other_user\",\n ),\n \"metadata\" => [\n \"version\" => 1,\n ],\n ],\n \"my_user_role\" => [\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index1\",\n ),\n \"privileges\" => array(\n \"read\",\n ),\n \"field_security\" => [\n \"grant\" => array(\n \"title\",\n \"body\",\n ),\n ],\n \"query\" => \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\",\n ],\n ),\n \"applications\" => array(\n [\n \"application\" => \"myapp\",\n \"privileges\" => array(\n \"admin\",\n \"read\",\n ),\n \"resources\" => array(\n \"*\",\n ),\n ],\n ),\n \"run_as\" => array(\n \"other_user\",\n ),\n \"metadata\" => [\n \"version\" => 1,\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"roles":{"my_admin_role":{"cluster":["all"],"indices":[{"names":["index1","index2"],"privileges":["all"],"field_security":{"grant":["title","body"]},"query":"{\"match\": {\"title\": \"foo\"}}"}],"applications":[{"application":"myapp","privileges":["admin","read"],"resources":["*"]}],"run_as":["other_user"],"metadata":{"version":1}},"my_user_role":{"cluster":["all"],"indices":[{"names":["index1"],"privileges":["read"],"field_security":{"grant":["title","body"]},"query":"{\"match\": {\"title\": \"foo\"}}"}],"applications":[{"application":"myapp","privileges":["admin","read"],"resources":["*"]}],"run_as":["other_user"],"metadata":{"version":1}}}}'' "$ELASTICSEARCH_URL/_security/role"' - lang: C# source: "var response = await client.Security\n .BulkPutRoleAsync(d1 => d1\n .Roles(d2 => d2\n .Add(\"my_admin_role\", d3 => d3\n .Applications(d4 => d4\n .Application(\"myapp\")\n .Privileges(\"admin\", \"read\")\n .Resources(\"*\")\n )\n .Cluster(ClusterPrivilege.All)\n .Indices(d4 => d4\n .FieldSecurity(d5 => d5\n .Grant(x => x.Title, x => x.Body)\n )\n .Names([\"index1\", \"index2\"])\n .Privileges(IndexPrivilege.All)\n .Query(\"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\")\n )\n .Metadata(new Dictionary()\n {\n { \"version\", 1 }\n })\n .RunAs(\"other_user\")\n )\n .Add(\"my_user_role\", d3 => d3\n .Applications(d4 => d4\n .Application(\"myapp\")\n .Privileges(\"admin\", \"read\")\n .Resources(\"*\")\n )\n .Cluster(ClusterPrivilege.All)\n .Indices(d4 => d4\n .FieldSecurity(d5 => d5\n .Grant(x => x.Title, x => x.Body)\n )\n .Names([\"index1\"])\n .Privileges(IndexPrivilege.Read)\n .Query(\"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\")\n )\n .Metadata(new Dictionary()\n {\n { \"version\", 1 }\n })\n .RunAs(\"other_user\")\n )\n )\n );" - lang: Java source: "client.security().bulkPutRole(b -> b\n .roles(Map.of(\"my_admin_role\", RoleDescriptor.roleDescriptorOf(r -> r\n .cluster(\"all\")\n .indices(i -> i\n .fieldSecurity(f -> f\n .grant(List.of(\"title\",\"body\"))\n )\n .names(List.of(\"index1\",\"index2\"))\n .privileges(\"all\")\n .query(q -> q\n .match(m -> m\n .field(\"title\")\n .query(FieldValue.of(\"foo\"))\n )\n )\n )\n .applications(a -> a\n .application(\"myapp\")\n .privileges(List.of(\"admin\",\"read\"))\n .resources(\"*\")\n )\n .metadata(\"version\", JsonData.fromJson(\"1\"))\n .runAs(\"other_user\")\n ),\"my_user_role\", RoleDescriptor.roleDescriptorOf(ro -> ro\n .cluster(\"all\")\n .indices(i -> i\n .fieldSecurity(f -> f\n .grant(List.of(\"title\",\"body\"))\n )\n .names(\"index1\")\n .privileges(\"read\")\n .query(q -> q\n .match(m -> m\n .field(\"title\")\n .query(FieldValue.of(\"foo\"))\n )\n )\n )\n .applications(a -> a\n .application(\"myapp\")\n .privileges(List.of(\"admin\",\"read\"))\n .resources(\"*\")\n )\n .metadata(\"version\", JsonData.fromJson(\"1\"))\n .runAs(\"other_user\")\n )))\n);\n" SecurityBulkPutRoleRequestExample2: summary: Bulk role errors description: "Because errors are handled individually for each role create or update, the API allows partial success. For example, `POST /_security/role` would throw an error for `my_admin_role` because the privilege `bad_cluster_privilege` doesn't exist, but would be successful for the `my_user_role`.\n" value: "{\n \"roles\": {\n \"my_admin_role\": {\n \"cluster\": [\n \"bad_cluster_privilege\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\"all\"],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n },\n \"my_user_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\"\n ],\n \"privileges\": [\n \"read\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n }\n }\n}" x-codeSamples: - lang: Console source: "POST /_security/role\n{\n \"roles\": {\n \"my_admin_role\": {\n \"cluster\": [\n \"bad_cluster_privilege\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\"all\"],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n },\n \"my_user_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\"\n ],\n \"privileges\": [\n \"read\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n }\n }\n}" - lang: Python source: "resp = client.security.bulk_put_role(\n roles={\n \"my_admin_role\": {\n \"cluster\": [\n \"bad_cluster_privilege\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\n \"all\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n },\n \"my_user_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\"\n ],\n \"privileges\": [\n \"read\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.security.bulkPutRole({\n roles: {\n my_admin_role: {\n cluster: [\"bad_cluster_privilege\"],\n indices: [\n {\n names: [\"index1\", \"index2\"],\n privileges: [\"all\"],\n field_security: {\n grant: [\"title\", \"body\"],\n },\n query: '{\"match\": {\"title\": \"foo\"}}',\n },\n ],\n applications: [\n {\n application: \"myapp\",\n privileges: [\"admin\", \"read\"],\n resources: [\"*\"],\n },\n ],\n run_as: [\"other_user\"],\n metadata: {\n version: 1,\n },\n },\n my_user_role: {\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index1\"],\n privileges: [\"read\"],\n field_security: {\n grant: [\"title\", \"body\"],\n },\n query: '{\"match\": {\"title\": \"foo\"}}',\n },\n ],\n applications: [\n {\n application: \"myapp\",\n privileges: [\"admin\", \"read\"],\n resources: [\"*\"],\n },\n ],\n run_as: [\"other_user\"],\n metadata: {\n version: 1,\n },\n },\n },\n});" - lang: Ruby source: "response = client.security.bulk_put_role(\n body: {\n \"roles\": {\n \"my_admin_role\": {\n \"cluster\": [\n \"bad_cluster_privilege\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\n \"all\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n },\n \"my_user_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\"\n ],\n \"privileges\": [\n \"read\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->bulkPutRole([\n \"body\" => [\n \"roles\" => [\n \"my_admin_role\" => [\n \"cluster\" => array(\n \"bad_cluster_privilege\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index1\",\n \"index2\",\n ),\n \"privileges\" => array(\n \"all\",\n ),\n \"field_security\" => [\n \"grant\" => array(\n \"title\",\n \"body\",\n ),\n ],\n \"query\" => \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\",\n ],\n ),\n \"applications\" => array(\n [\n \"application\" => \"myapp\",\n \"privileges\" => array(\n \"admin\",\n \"read\",\n ),\n \"resources\" => array(\n \"*\",\n ),\n ],\n ),\n \"run_as\" => array(\n \"other_user\",\n ),\n \"metadata\" => [\n \"version\" => 1,\n ],\n ],\n \"my_user_role\" => [\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index1\",\n ),\n \"privileges\" => array(\n \"read\",\n ),\n \"field_security\" => [\n \"grant\" => array(\n \"title\",\n \"body\",\n ),\n ],\n \"query\" => \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\",\n ],\n ),\n \"applications\" => array(\n [\n \"application\" => \"myapp\",\n \"privileges\" => array(\n \"admin\",\n \"read\",\n ),\n \"resources\" => array(\n \"*\",\n ),\n ],\n ),\n \"run_as\" => array(\n \"other_user\",\n ),\n \"metadata\" => [\n \"version\" => 1,\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"roles":{"my_admin_role":{"cluster":["bad_cluster_privilege"],"indices":[{"names":["index1","index2"],"privileges":["all"],"field_security":{"grant":["title","body"]},"query":"{\"match\": {\"title\": \"foo\"}}"}],"applications":[{"application":"myapp","privileges":["admin","read"],"resources":["*"]}],"run_as":["other_user"],"metadata":{"version":1}},"my_user_role":{"cluster":["all"],"indices":[{"names":["index1"],"privileges":["read"],"field_security":{"grant":["title","body"]},"query":"{\"match\": {\"title\": \"foo\"}}"}],"applications":[{"application":"myapp","privileges":["admin","read"],"resources":["*"]}],"run_as":["other_user"],"metadata":{"version":1}}}}'' "$ELASTICSEARCH_URL/_security/role"' - lang: C# source: "var response = await client.Security\n .BulkPutRoleAsync(d1 => d1\n .Roles(d2 => d2\n .Add(\"my_admin_role\", d3 => d3\n .Applications(d4 => d4\n .Application(\"myapp\")\n .Privileges(\"admin\", \"read\")\n .Resources(\"*\")\n )\n .Cluster(new ClusterPrivilege(\"bad_cluster_privilege\"))\n .Indices(d4 => d4\n .FieldSecurity(d5 => d5\n .Grant(x => x.Title, x => x.Body)\n )\n .Names([\"index1\", \"index2\"])\n .Privileges(IndexPrivilege.All)\n .Query(\"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\")\n )\n .Metadata(new Dictionary()\n {\n { \"version\", 1 }\n })\n .RunAs(\"other_user\")\n )\n .Add(\"my_user_role\", d3 => d3\n .Applications(d4 => d4\n .Application(\"myapp\")\n .Privileges(\"admin\", \"read\")\n .Resources(\"*\")\n )\n .Cluster(ClusterPrivilege.All)\n .Indices(d4 => d4\n .FieldSecurity(d5 => d5\n .Grant(x => x.Title, x => x.Body)\n )\n .Names([\"index1\"])\n .Privileges(IndexPrivilege.Read)\n .Query(\"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\")\n )\n .Metadata(new Dictionary()\n {\n { \"version\", 1 }\n })\n .RunAs(\"other_user\")\n )\n )\n );" - lang: Java source: "client.security().bulkPutRole(b -> b\n .roles(Map.of(\"my_admin_role\", RoleDescriptor.roleDescriptorOf(r -> r\n .cluster(\"bad_cluster_privilege\")\n .indices(i -> i\n .fieldSecurity(f -> f\n .grant(List.of(\"title\",\"body\"))\n )\n .names(List.of(\"index1\",\"index2\"))\n .privileges(\"all\")\n .query(q -> q\n .match(m -> m\n .field(\"title\")\n .query(FieldValue.of(\"foo\"))\n )\n )\n )\n .applications(a -> a\n .application(\"myapp\")\n .privileges(List.of(\"admin\",\"read\"))\n .resources(\"*\")\n )\n .metadata(\"version\", JsonData.fromJson(\"1\"))\n .runAs(\"other_user\")\n ),\"my_user_role\", RoleDescriptor.roleDescriptorOf(ro -> ro\n .cluster(\"all\")\n .indices(i -> i\n .fieldSecurity(f -> f\n .grant(List.of(\"title\",\"body\"))\n )\n .names(\"index1\")\n .privileges(\"read\")\n .query(q -> q\n .match(m -> m\n .field(\"title\")\n .query(FieldValue.of(\"foo\"))\n )\n )\n )\n .applications(a -> a\n .application(\"myapp\")\n .privileges(List.of(\"admin\",\"read\"))\n .resources(\"*\")\n )\n .metadata(\"version\", JsonData.fromJson(\"1\"))\n .runAs(\"other_user\")\n )))\n);\n" SecurityBulkPutRoleRequestExample3: summary: Role example 3 description: Run `POST /_security/role/only_remote_access_role` to configure a role with remote indices and remote cluster privileges for a remote cluster. value: "{\n \"remote_indices\": [\n {\n \"clusters\": [\"my_remote\"], \n \"names\": [\"logs*\"], \n \"privileges\": [\"read\", \"read_cross_cluster\", \"view_index_metadata\"] \n }\n ],\n \"remote_cluster\": [\n {\n \"clusters\": [\"my_remote\"], \n \"privileges\": [\"monitor_stats\"] \n }\n ]\n}" x-codeSamples: - lang: Console source: "POST /_security/role/only_remote_access_role\n{\n \"remote_indices\": [\n {\n \"clusters\": [\"my_remote\"], \n \"names\": [\"logs*\"], \n \"privileges\": [\"read\", \"read_cross_cluster\", \"view_index_metadata\"] \n }\n ],\n \"remote_cluster\": [\n {\n \"clusters\": [\"my_remote\"], \n \"privileges\": [\"monitor_stats\"] \n }\n ]\n}" - lang: Python source: "resp = client.security.put_role(\n name=\"only_remote_access_role\",\n remote_indices=[\n {\n \"clusters\": [\n \"my_remote\"\n ],\n \"names\": [\n \"logs*\"\n ],\n \"privileges\": [\n \"read\",\n \"read_cross_cluster\",\n \"view_index_metadata\"\n ]\n }\n ],\n remote_cluster=[\n {\n \"clusters\": [\n \"my_remote\"\n ],\n \"privileges\": [\n \"monitor_stats\"\n ]\n }\n ],\n)" - lang: JavaScript source: "const response = await client.security.putRole({\n name: \"only_remote_access_role\",\n remote_indices: [\n {\n clusters: [\"my_remote\"],\n names: [\"logs*\"],\n privileges: [\"read\", \"read_cross_cluster\", \"view_index_metadata\"],\n },\n ],\n remote_cluster: [\n {\n clusters: [\"my_remote\"],\n privileges: [\"monitor_stats\"],\n },\n ],\n});" - lang: Ruby source: "response = client.security.put_role(\n name: \"only_remote_access_role\",\n body: {\n \"remote_indices\": [\n {\n \"clusters\": [\n \"my_remote\"\n ],\n \"names\": [\n \"logs*\"\n ],\n \"privileges\": [\n \"read\",\n \"read_cross_cluster\",\n \"view_index_metadata\"\n ]\n }\n ],\n \"remote_cluster\": [\n {\n \"clusters\": [\n \"my_remote\"\n ],\n \"privileges\": [\n \"monitor_stats\"\n ]\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->security()->putRole([\n \"name\" => \"only_remote_access_role\",\n \"body\" => [\n \"remote_indices\" => array(\n [\n \"clusters\" => array(\n \"my_remote\",\n ),\n \"names\" => array(\n \"logs*\",\n ),\n \"privileges\" => array(\n \"read\",\n \"read_cross_cluster\",\n \"view_index_metadata\",\n ),\n ],\n ),\n \"remote_cluster\" => array(\n [\n \"clusters\" => array(\n \"my_remote\",\n ),\n \"privileges\" => array(\n \"monitor_stats\",\n ),\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"remote_indices":[{"clusters":["my_remote"],"names":["logs*"],"privileges":["read","read_cross_cluster","view_index_metadata"]}],"remote_cluster":[{"clusters":["my_remote"],"privileges":["monitor_stats"]}]}'' "$ELASTICSEARCH_URL/_security/role/only_remote_access_role"' - lang: C# source: "var response = await client.Security\n .PutRoleAsync(name: \"only_remote_access_role\", d1 => d1\n .RemoteCluster(d2 => d2\n .Clusters(new[] { \"my_remote\" })\n .Privileges(RemoteClusterPrivilege.MonitorStats)\n )\n .RemoteIndices(d2 => d2\n .Clusters(new[] { \"my_remote\" })\n .Names([\"logs*\"])\n .Privileges(IndexPrivilege.Read, IndexPrivilege.ReadCrossCluster, IndexPrivilege.ViewIndexMetadata)\n )\n );" - lang: Java source: "client.security().putRole(p -> p\n .name(\"only_remote_access_role\")\n .remoteCluster(r -> r\n .clusters(\"my_remote\")\n .privileges(RemoteClusterPrivilege.MonitorStats)\n )\n .remoteIndices(r -> r\n .clusters(\"my_remote\")\n .names(\"logs*\")\n .privileges(List.of(\"read\",\"read_cross_cluster\",\"view_index_metadata\"))\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: type: object properties: created: type: array items: type: string description: Array of created roles updated: type: array items: type: string description: Array of updated roles noop: type: array items: type: string description: Array of role names without any changes errors: allOf: - $ref: '#/components/schemas/security._types.BulkError' description: Present if any updates resulted in errors examples: SecurityBulkPutRoleResponseExample1: summary: A successful response description: "A successful response from `POST /_security/role/my_admin_role` returns a JSON structure that shows whether the role has been created, updated, or had no changes made.\n" value: "{\n \"created\": [ \n \"my_admin_role\", \n \"my_user_role\"\n ]\n}" SecurityBulkPutRoleResponseExample2: summary: A partially successful response description: "A partially successful response from `POST /_security/role`. Errors are handled individually for each role create or update, thus the API allows partial success. In this example, the creation of the `my_user_role` role succeeds and the `my_admin_role` role fails.\n" value: "{\n \"created\": [\n \"my_user_role\" \n ],\n \"errors\": { \n \"count\": 1, \n \"details\": {\n \"my_admin_role\": { \n \"type\": \"action_request_validation_exception\",\n \"reason\": \"Validation Failed: 1: unknown cluster privilege [bad_cluster_privilege]. a privilege must be either one of the predefined cluster privilege names [manage_own_api_key,manage_data_stream_global_retention,monitor_data_stream_global_retention,none,cancel_task,cross_cluster_replication,cross_cluster_search,delegate_pki,grant_api_key,manage_autoscaling,manage_index_templates,manage_logstash_pipelines,manage_oidc,manage_saml,manage_search_application,manage_search_query_rules,manage_search_synonyms,manage_service_account,manage_token,manage_user_profile,monitor_connector,monitor_enrich,monitor_inference,monitor_ml,monitor_rollup,monitor_snapshot,monitor_stats,monitor_text_structure,monitor_watcher,post_behavioral_analytics_event,read_ccr,read_connector_secrets,read_fleet_secrets,read_ilm,read_pipeline,read_security,read_slm,transport_client,write_connector_secrets,write_fleet_secrets,create_snapshot,manage_behavioral_analytics,manage_ccr,manage_connector,manage_enrich,manage_ilm,manage_inference,manage_ml,manage_rollup,manage_slm,manage_watcher,monitor_data_frame_transforms,monitor_transform,manage_api_key,manage_ingest_pipelines,manage_pipeline,manage_data_frame_transforms,manage_transform,manage_security,monitor,manage,all] or a pattern over one of the available cluster actions;\"\n }\n }\n }\n}" x-state: Generally available; Added in 8.15.0 x-codeSamples: - lang: Console source: "POST /_security/role\n{\n \"roles\": {\n \"my_admin_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\n \"all\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n },\n \"my_user_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\"\n ],\n \"privileges\": [\n \"read\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n }\n }\n}" - lang: Python source: "resp = client.security.bulk_put_role(\n roles={\n \"my_admin_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\n \"all\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n },\n \"my_user_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\"\n ],\n \"privileges\": [\n \"read\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.security.bulkPutRole({\n roles: {\n my_admin_role: {\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index1\", \"index2\"],\n privileges: [\"all\"],\n field_security: {\n grant: [\"title\", \"body\"],\n },\n query: '{\"match\": {\"title\": \"foo\"}}',\n },\n ],\n applications: [\n {\n application: \"myapp\",\n privileges: [\"admin\", \"read\"],\n resources: [\"*\"],\n },\n ],\n run_as: [\"other_user\"],\n metadata: {\n version: 1,\n },\n },\n my_user_role: {\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index1\"],\n privileges: [\"read\"],\n field_security: {\n grant: [\"title\", \"body\"],\n },\n query: '{\"match\": {\"title\": \"foo\"}}',\n },\n ],\n applications: [\n {\n application: \"myapp\",\n privileges: [\"admin\", \"read\"],\n resources: [\"*\"],\n },\n ],\n run_as: [\"other_user\"],\n metadata: {\n version: 1,\n },\n },\n },\n});" - lang: Ruby source: "response = client.security.bulk_put_role(\n body: {\n \"roles\": {\n \"my_admin_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\n \"all\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n },\n \"my_user_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\"\n ],\n \"privileges\": [\n \"read\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->bulkPutRole([\n \"body\" => [\n \"roles\" => [\n \"my_admin_role\" => [\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index1\",\n \"index2\",\n ),\n \"privileges\" => array(\n \"all\",\n ),\n \"field_security\" => [\n \"grant\" => array(\n \"title\",\n \"body\",\n ),\n ],\n \"query\" => \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\",\n ],\n ),\n \"applications\" => array(\n [\n \"application\" => \"myapp\",\n \"privileges\" => array(\n \"admin\",\n \"read\",\n ),\n \"resources\" => array(\n \"*\",\n ),\n ],\n ),\n \"run_as\" => array(\n \"other_user\",\n ),\n \"metadata\" => [\n \"version\" => 1,\n ],\n ],\n \"my_user_role\" => [\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index1\",\n ),\n \"privileges\" => array(\n \"read\",\n ),\n \"field_security\" => [\n \"grant\" => array(\n \"title\",\n \"body\",\n ),\n ],\n \"query\" => \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\",\n ],\n ),\n \"applications\" => array(\n [\n \"application\" => \"myapp\",\n \"privileges\" => array(\n \"admin\",\n \"read\",\n ),\n \"resources\" => array(\n \"*\",\n ),\n ],\n ),\n \"run_as\" => array(\n \"other_user\",\n ),\n \"metadata\" => [\n \"version\" => 1,\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"roles":{"my_admin_role":{"cluster":["all"],"indices":[{"names":["index1","index2"],"privileges":["all"],"field_security":{"grant":["title","body"]},"query":"{\"match\": {\"title\": \"foo\"}}"}],"applications":[{"application":"myapp","privileges":["admin","read"],"resources":["*"]}],"run_as":["other_user"],"metadata":{"version":1}},"my_user_role":{"cluster":["all"],"indices":[{"names":["index1"],"privileges":["read"],"field_security":{"grant":["title","body"]},"query":"{\"match\": {\"title\": \"foo\"}}"}],"applications":[{"application":"myapp","privileges":["admin","read"],"resources":["*"]}],"run_as":["other_user"],"metadata":{"version":1}}}}'' "$ELASTICSEARCH_URL/_security/role"' - lang: C# source: "var response = await client.Security\n .BulkPutRoleAsync(d1 => d1\n .Roles(d2 => d2\n .Add(\"my_admin_role\", d3 => d3\n .Applications(d4 => d4\n .Application(\"myapp\")\n .Privileges(\"admin\", \"read\")\n .Resources(\"*\")\n )\n .Cluster(ClusterPrivilege.All)\n .Indices(d4 => d4\n .FieldSecurity(d5 => d5\n .Grant(x => x.Title, x => x.Body)\n )\n .Names([\"index1\", \"index2\"])\n .Privileges(IndexPrivilege.All)\n .Query(\"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\")\n )\n .Metadata(new Dictionary()\n {\n { \"version\", 1 }\n })\n .RunAs(\"other_user\")\n )\n .Add(\"my_user_role\", d3 => d3\n .Applications(d4 => d4\n .Application(\"myapp\")\n .Privileges(\"admin\", \"read\")\n .Resources(\"*\")\n )\n .Cluster(ClusterPrivilege.All)\n .Indices(d4 => d4\n .FieldSecurity(d5 => d5\n .Grant(x => x.Title, x => x.Body)\n )\n .Names([\"index1\"])\n .Privileges(IndexPrivilege.Read)\n .Query(\"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\")\n )\n .Metadata(new Dictionary()\n {\n { \"version\", 1 }\n })\n .RunAs(\"other_user\")\n )\n )\n );" - lang: Java source: "client.security().bulkPutRole(b -> b\n .roles(Map.of(\"my_admin_role\", RoleDescriptor.roleDescriptorOf(r -> r\n .cluster(\"all\")\n .indices(i -> i\n .fieldSecurity(f -> f\n .grant(List.of(\"title\",\"body\"))\n )\n .names(List.of(\"index1\",\"index2\"))\n .privileges(\"all\")\n .query(q -> q\n .match(m -> m\n .field(\"title\")\n .query(FieldValue.of(\"foo\"))\n )\n )\n )\n .applications(a -> a\n .application(\"myapp\")\n .privileges(List.of(\"admin\",\"read\"))\n .resources(\"*\")\n )\n .metadata(\"version\", JsonData.fromJson(\"1\"))\n .runAs(\"other_user\")\n ),\"my_user_role\", RoleDescriptor.roleDescriptorOf(ro -> ro\n .cluster(\"all\")\n .indices(i -> i\n .fieldSecurity(f -> f\n .grant(List.of(\"title\",\"body\"))\n )\n .names(\"index1\")\n .privileges(\"read\")\n .query(q -> q\n .match(m -> m\n .field(\"title\")\n .query(FieldValue.of(\"foo\"))\n )\n )\n )\n .applications(a -> a\n .application(\"myapp\")\n .privileges(List.of(\"admin\",\"read\"))\n .resources(\"*\")\n )\n .metadata(\"version\", JsonData.fromJson(\"1\"))\n .runAs(\"other_user\")\n )))\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - security summary: Bulk delete roles description: "The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.\nThe bulk delete roles API cannot delete roles that are defined in roles files.\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" operationId: security-bulk-delete-role parameters: - name: refresh in: query description: 'If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.' schema: $ref: '#/components/schemas/_types.Refresh' requestBody: content: application/json: schema: required: - names type: object properties: names: type: array items: type: string description: An array of role names to delete examples: SecurityBulkDeleteRoleRequestExample1: summary: Bulk delete example 1 description: "Run DELETE /_security/role` to delete `my_admin_role` and `my_user_role` roles.\n" value: "{\n \"names\": [\"my_admin_role\", \"my_user_role\"]\n}" x-codeSamples: - lang: Console source: "DELETE /_security/role\n{\n \"names\": [\"my_admin_role\", \"my_user_role\"]\n}" - lang: Python source: "resp = client.security.bulk_delete_role(\n names=[\n \"my_admin_role\",\n \"my_user_role\"\n ],\n)" - lang: JavaScript source: "const response = await client.security.bulkDeleteRole({\n names: [\"my_admin_role\", \"my_user_role\"],\n});" - lang: Ruby source: "response = client.security.bulk_delete_role(\n body: {\n \"names\": [\n \"my_admin_role\",\n \"my_user_role\"\n ]\n }\n)" - lang: PHP source: "$resp = $client->security()->bulkDeleteRole([\n \"body\" => [\n \"names\" => array(\n \"my_admin_role\",\n \"my_user_role\",\n ),\n ],\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"names":["my_admin_role","my_user_role"]}'' "$ELASTICSEARCH_URL/_security/role"' - lang: C# source: "var response = await client.Security\n .BulkDeleteRoleAsync(d1 => d1\n .Names(\"my_admin_role\", \"my_user_role\")\n );" - lang: Java source: "client.security().bulkDeleteRole(b -> b\n .names(List.of(\"my_admin_role\",\"my_user_role\"))\n);\n" required: true responses: '200': description: '' content: application/json: schema: type: object properties: deleted: type: array items: type: string description: Array of deleted roles not_found: type: array items: type: string description: Array of roles that could not be found errors: allOf: - $ref: '#/components/schemas/security._types.BulkError' description: Present if any deletes resulted in errors examples: SecurityBulkDeleteRoleResponseExample1: summary: A successful response description: A successful response from `DELETE /_security/role`. value: "{\n \"deleted\": [\n \"my_admin_role\",\n \"my_user_role\"\n ]\n}" SecurityBulkDeleteRoleResponseExample2: summary: A response with not_found roles description: "A partially successful response from `DELETE /_security/role`. If a role cannot be found, it appears in the `not_found` list in the response.\n" value: "{\n \"deleted\": [\n \"my_admin_role\"\n ],\n \"not_found\": [\n \"not_an_existing_role\"\n ]\n}" SecurityBulkDeleteRoleResponseExample3: summary: A response with errors description: "A partially successful response from `DELETE /_security/role`. If part of a request fails or is invalid, the response includes `errors`.\n" value: "{\n \"deleted\": [\n \"my_admin_role\"\n ],\n \"errors\": {\n \"count\": 1,\n \"details\": {\n \"superuser\": {\n \"type\": \"illegal_argument_exception\",\n \"reason\": \"role [superuser] is reserved and cannot be deleted\"\n }\n }\n }\n}" x-state: Generally available; Added in 8.15.0 x-codeSamples: - lang: Console source: "DELETE /_security/role\n{\n \"names\": [\"my_admin_role\", \"my_user_role\"]\n}" - lang: Python source: "resp = client.security.bulk_delete_role(\n names=[\n \"my_admin_role\",\n \"my_user_role\"\n ],\n)" - lang: JavaScript source: "const response = await client.security.bulkDeleteRole({\n names: [\"my_admin_role\", \"my_user_role\"],\n});" - lang: Ruby source: "response = client.security.bulk_delete_role(\n body: {\n \"names\": [\n \"my_admin_role\",\n \"my_user_role\"\n ]\n }\n)" - lang: PHP source: "$resp = $client->security()->bulkDeleteRole([\n \"body\" => [\n \"names\" => array(\n \"my_admin_role\",\n \"my_user_role\",\n ),\n ],\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"names":["my_admin_role","my_user_role"]}'' "$ELASTICSEARCH_URL/_security/role"' - lang: C# source: "var response = await client.Security\n .BulkDeleteRoleAsync(d1 => d1\n .Names(\"my_admin_role\", \"my_user_role\")\n );" - lang: Java source: "client.security().bulkDeleteRole(b -> b\n .names(List.of(\"my_admin_role\",\"my_user_role\"))\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/api_key/_bulk_update: post: tags: - security summary: Bulk update API keys description: "Update the attributes for multiple API keys.\n\nIMPORTANT: It is not possible to use an API key as the authentication credential for this API. To update API keys, the owner user's credentials are required.\n\nThis API is similar to the update API key API but enables you to apply the same update to multiple API keys in one API call. This operation can greatly improve performance over making individual updates.\n\nIt is not possible to update expired or invalidated API keys.\n\nThis API supports updates to API key access scope, metadata and expiration.\nThe access scope of each API key is derived from the `role_descriptors` you specify in the request and a snapshot of the owner user's permissions at the time of the request.\nThe snapshot of the owner's permissions is updated automatically on every call.\n\nIMPORTANT: If you don't specify `role_descriptors` in the request, a call to this API might still change an API key's access scope. This change can occur if the owner user's permissions have changed since the API key was created or last modified.\n\nA successful request returns a JSON structure that contains the IDs of all updated API keys, the IDs of API keys that already had the requested changes and did not require an update, and error details for any failed update.\n\n## Required authorization\n\n* Cluster privileges: `manage_own_api_key`\n" operationId: security-bulk-update-api-keys requestBody: content: application/json: schema: required: - ids type: object properties: expiration: allOf: - $ref: '#/components/schemas/_types.Duration' description: "Expiration time for the API keys.\nBy default, API keys never expire.\nThis property can be omitted to leave the value unchanged." ids: oneOf: - type: string - type: array items: type: string description: The API key identifiers. metadata: allOf: - $ref: '#/components/schemas/_types.Metadata' description: "Arbitrary nested metadata to associate with the API keys.\nWithin the `metadata` object, top-level keys beginning with an underscore (`_`) are reserved for system usage.\nAny information specified with this parameter fully replaces metadata previously associated with the API key." role_descriptors: type: object additionalProperties: $ref: '#/components/schemas/security._types.RoleDescriptor' description: "The role descriptors to assign to the API keys.\nAn API key's effective permissions are an intersection of its assigned privileges and the point-in-time snapshot of permissions of the owner user.\nYou can assign new privileges by specifying them in this parameter.\nTo remove assigned privileges, supply the `role_descriptors` parameter as an empty object `{}`.\nIf an API key has no assigned privileges, it inherits the owner user's full permissions.\nThe snapshot of the owner's permissions is always updated, whether you supply the `role_descriptors` parameter.\nThe structure of a role descriptor is the same as the request for the create API keys API." examples: SecurityBulkUpdateApiKeysRequestExample1: description: Assign new role descriptors and metadata and update the expiration time for two API keys. value: "{\n \"ids\": [\n \"VuaCfGcBCdbkQm-e5aOx\",\n \"H3_AhoIBA9hmeQJdg7ij\"\n ],\n \"role_descriptors\": {\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\n \"*\"\n ],\n \"privileges\": [\n \"write\"\n ]\n }\n ]\n }\n },\n \"metadata\": {\n \"environment\": {\n \"level\": 2,\n \"trusted\": true,\n \"tags\": [\n \"production\"\n ]\n }\n },\n \"expiration\": \"30d\"\n}" x-codeSamples: - lang: Console source: "POST /_security/api_key/_bulk_update\n{\n \"ids\": [\n \"VuaCfGcBCdbkQm-e5aOx\",\n \"H3_AhoIBA9hmeQJdg7ij\"\n ],\n \"role_descriptors\": {\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\n \"*\"\n ],\n \"privileges\": [\n \"write\"\n ]\n }\n ]\n }\n },\n \"metadata\": {\n \"environment\": {\n \"level\": 2,\n \"trusted\": true,\n \"tags\": [\n \"production\"\n ]\n }\n },\n \"expiration\": \"30d\"\n}" - lang: Python source: "resp = client.security.bulk_update_api_keys(\n ids=[\n \"VuaCfGcBCdbkQm-e5aOx\",\n \"H3_AhoIBA9hmeQJdg7ij\"\n ],\n role_descriptors={\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\n \"*\"\n ],\n \"privileges\": [\n \"write\"\n ]\n }\n ]\n }\n },\n metadata={\n \"environment\": {\n \"level\": 2,\n \"trusted\": True,\n \"tags\": [\n \"production\"\n ]\n }\n },\n expiration=\"30d\",\n)" - lang: JavaScript source: "const response = await client.security.bulkUpdateApiKeys({\n ids: [\"VuaCfGcBCdbkQm-e5aOx\", \"H3_AhoIBA9hmeQJdg7ij\"],\n role_descriptors: {\n \"role-a\": {\n indices: [\n {\n names: [\"*\"],\n privileges: [\"write\"],\n },\n ],\n },\n },\n metadata: {\n environment: {\n level: 2,\n trusted: true,\n tags: [\"production\"],\n },\n },\n expiration: \"30d\",\n});" - lang: Ruby source: "response = client.security.bulk_update_api_keys(\n body: {\n \"ids\": [\n \"VuaCfGcBCdbkQm-e5aOx\",\n \"H3_AhoIBA9hmeQJdg7ij\"\n ],\n \"role_descriptors\": {\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\n \"*\"\n ],\n \"privileges\": [\n \"write\"\n ]\n }\n ]\n }\n },\n \"metadata\": {\n \"environment\": {\n \"level\": 2,\n \"trusted\": true,\n \"tags\": [\n \"production\"\n ]\n }\n },\n \"expiration\": \"30d\"\n }\n)" - lang: PHP source: "$resp = $client->security()->bulkUpdateApiKeys([\n \"body\" => [\n \"ids\" => array(\n \"VuaCfGcBCdbkQm-e5aOx\",\n \"H3_AhoIBA9hmeQJdg7ij\",\n ),\n \"role_descriptors\" => [\n \"role-a\" => [\n \"indices\" => array(\n [\n \"names\" => array(\n \"*\",\n ),\n \"privileges\" => array(\n \"write\",\n ),\n ],\n ),\n ],\n ],\n \"metadata\" => [\n \"environment\" => [\n \"level\" => 2,\n \"trusted\" => true,\n \"tags\" => array(\n \"production\",\n ),\n ],\n ],\n \"expiration\" => \"30d\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"ids":["VuaCfGcBCdbkQm-e5aOx","H3_AhoIBA9hmeQJdg7ij"],"role_descriptors":{"role-a":{"indices":[{"names":["*"],"privileges":["write"]}]}},"metadata":{"environment":{"level":2,"trusted":true,"tags":["production"]}},"expiration":"30d"}'' "$ELASTICSEARCH_URL/_security/api_key/_bulk_update"' - lang: C# source: "var response = await client.Security\n .BulkUpdateApiKeysAsync(d1 => d1\n .Expiration(\"30d\")\n .Ids(\"VuaCfGcBCdbkQm-e5aOx\", \"H3_AhoIBA9hmeQJdg7ij\")\n .Metadata(new Dictionary()\n {\n { \"environment\", JsonSerializer.Deserialize(\"\"\"\n {\n \"level\": 2,\n \"trusted\": true,\n \"tags\": [\n \"production\"\n ]\n }\n \"\"\") }\n })\n .RoleDescriptors(d2 => d2\n .Add(\"role-a\", d3 => d3\n .Indices(d4 => d4\n .Names([\"*\"])\n .Privileges(IndexPrivilege.Write)\n )\n )\n )\n );" - lang: Java source: "client.security().bulkUpdateApiKeys(b -> b\n .expiration(e -> e\n .time(\"30d\")\n )\n .ids(List.of(\"VuaCfGcBCdbkQm-e5aOx\",\"H3_AhoIBA9hmeQJdg7ij\"))\n .metadata(\"environment\", JsonData.fromJson(\"\"\"\n{\"level\":2,\"trusted\":true,\"tags\":[\"production\"]}\n\"\"\"))\n .roleDescriptors(\"role-a\", r -> r\n .indices(i -> i\n .names(\"*\")\n .privileges(\"write\")\n )\n )\n);\n" SecurityBulkUpdateApiKeysRequestExample2: description: 'Remove the previously assigned permissions for two API keys, making them inherit the owner user''s full permissions.' value: "{\n \"ids\": [\n \"VuaCfGcBCdbkQm-e5aOx\",\n \"H3_AhoIBA9hmeQJdg7ij\"\n ],\n \"role_descriptors\": {}\n}" x-codeSamples: - lang: Console source: "POST /_security/api_key/_bulk_update\n{\n \"ids\": [\n \"VuaCfGcBCdbkQm-e5aOx\",\n \"H3_AhoIBA9hmeQJdg7ij\"\n ],\n \"role_descriptors\": {}\n}" - lang: Python source: "resp = client.security.bulk_update_api_keys(\n ids=[\n \"VuaCfGcBCdbkQm-e5aOx\",\n \"H3_AhoIBA9hmeQJdg7ij\"\n ],\n role_descriptors={},\n)" - lang: JavaScript source: "const response = await client.security.bulkUpdateApiKeys({\n ids: [\"VuaCfGcBCdbkQm-e5aOx\", \"H3_AhoIBA9hmeQJdg7ij\"],\n role_descriptors: {},\n});" - lang: Ruby source: "response = client.security.bulk_update_api_keys(\n body: {\n \"ids\": [\n \"VuaCfGcBCdbkQm-e5aOx\",\n \"H3_AhoIBA9hmeQJdg7ij\"\n ],\n \"role_descriptors\": {}\n }\n)" - lang: PHP source: "$resp = $client->security()->bulkUpdateApiKeys([\n \"body\" => [\n \"ids\" => array(\n \"VuaCfGcBCdbkQm-e5aOx\",\n \"H3_AhoIBA9hmeQJdg7ij\",\n ),\n \"role_descriptors\" => new ArrayObject([]),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"ids":["VuaCfGcBCdbkQm-e5aOx","H3_AhoIBA9hmeQJdg7ij"],"role_descriptors":{}}'' "$ELASTICSEARCH_URL/_security/api_key/_bulk_update"' - lang: C# source: "var response = await client.Security\n .BulkUpdateApiKeysAsync(d1 => d1\n .Ids(\"VuaCfGcBCdbkQm-e5aOx\", \"H3_AhoIBA9hmeQJdg7ij\")\n .RoleDescriptors()\n );" - lang: Java source: "client.security().bulkUpdateApiKeys(b -> b\n .ids(List.of(\"VuaCfGcBCdbkQm-e5aOx\",\"H3_AhoIBA9hmeQJdg7ij\"))\n .roleDescriptors(Map.of())\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - noops - updated type: object properties: errors: allOf: - $ref: '#/components/schemas/security._types.BulkError' noops: type: array items: type: string updated: type: array items: type: string examples: SecurityBulkUpdateApiKeysResponseExample1: description: A successful response from updating two API keys. value: "{\n \"updated\": [\n \"VuaCfGcBCdbkQm-e5aOx\",\n \"H3_AhoIBA9hmeQJdg7ij\"\n ],\n \"noops\": []\n}" x-state: Generally available; Added in 8.5.0 x-codeSamples: - lang: Console source: "POST /_security/api_key/_bulk_update\n{\n \"ids\": [\n \"VuaCfGcBCdbkQm-e5aOx\",\n \"H3_AhoIBA9hmeQJdg7ij\"\n ],\n \"role_descriptors\": {\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\n \"*\"\n ],\n \"privileges\": [\n \"write\"\n ]\n }\n ]\n }\n },\n \"metadata\": {\n \"environment\": {\n \"level\": 2,\n \"trusted\": true,\n \"tags\": [\n \"production\"\n ]\n }\n },\n \"expiration\": \"30d\"\n}" - lang: Python source: "resp = client.security.bulk_update_api_keys(\n ids=[\n \"VuaCfGcBCdbkQm-e5aOx\",\n \"H3_AhoIBA9hmeQJdg7ij\"\n ],\n role_descriptors={\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\n \"*\"\n ],\n \"privileges\": [\n \"write\"\n ]\n }\n ]\n }\n },\n metadata={\n \"environment\": {\n \"level\": 2,\n \"trusted\": True,\n \"tags\": [\n \"production\"\n ]\n }\n },\n expiration=\"30d\",\n)" - lang: JavaScript source: "const response = await client.security.bulkUpdateApiKeys({\n ids: [\"VuaCfGcBCdbkQm-e5aOx\", \"H3_AhoIBA9hmeQJdg7ij\"],\n role_descriptors: {\n \"role-a\": {\n indices: [\n {\n names: [\"*\"],\n privileges: [\"write\"],\n },\n ],\n },\n },\n metadata: {\n environment: {\n level: 2,\n trusted: true,\n tags: [\"production\"],\n },\n },\n expiration: \"30d\",\n});" - lang: Ruby source: "response = client.security.bulk_update_api_keys(\n body: {\n \"ids\": [\n \"VuaCfGcBCdbkQm-e5aOx\",\n \"H3_AhoIBA9hmeQJdg7ij\"\n ],\n \"role_descriptors\": {\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\n \"*\"\n ],\n \"privileges\": [\n \"write\"\n ]\n }\n ]\n }\n },\n \"metadata\": {\n \"environment\": {\n \"level\": 2,\n \"trusted\": true,\n \"tags\": [\n \"production\"\n ]\n }\n },\n \"expiration\": \"30d\"\n }\n)" - lang: PHP source: "$resp = $client->security()->bulkUpdateApiKeys([\n \"body\" => [\n \"ids\" => array(\n \"VuaCfGcBCdbkQm-e5aOx\",\n \"H3_AhoIBA9hmeQJdg7ij\",\n ),\n \"role_descriptors\" => [\n \"role-a\" => [\n \"indices\" => array(\n [\n \"names\" => array(\n \"*\",\n ),\n \"privileges\" => array(\n \"write\",\n ),\n ],\n ),\n ],\n ],\n \"metadata\" => [\n \"environment\" => [\n \"level\" => 2,\n \"trusted\" => true,\n \"tags\" => array(\n \"production\",\n ),\n ],\n ],\n \"expiration\" => \"30d\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"ids":["VuaCfGcBCdbkQm-e5aOx","H3_AhoIBA9hmeQJdg7ij"],"role_descriptors":{"role-a":{"indices":[{"names":["*"],"privileges":["write"]}]}},"metadata":{"environment":{"level":2,"trusted":true,"tags":["production"]}},"expiration":"30d"}'' "$ELASTICSEARCH_URL/_security/api_key/_bulk_update"' - lang: C# source: "var response = await client.Security\n .BulkUpdateApiKeysAsync(d1 => d1\n .Expiration(\"30d\")\n .Ids(\"VuaCfGcBCdbkQm-e5aOx\", \"H3_AhoIBA9hmeQJdg7ij\")\n .Metadata(new Dictionary()\n {\n { \"environment\", JsonSerializer.Deserialize(\"\"\"\n {\n \"level\": 2,\n \"trusted\": true,\n \"tags\": [\n \"production\"\n ]\n }\n \"\"\") }\n })\n .RoleDescriptors(d2 => d2\n .Add(\"role-a\", d3 => d3\n .Indices(d4 => d4\n .Names([\"*\"])\n .Privileges(IndexPrivilege.Write)\n )\n )\n )\n );" - lang: Java source: "client.security().bulkUpdateApiKeys(b -> b\n .expiration(e -> e\n .time(\"30d\")\n )\n .ids(List.of(\"VuaCfGcBCdbkQm-e5aOx\",\"H3_AhoIBA9hmeQJdg7ij\"))\n .metadata(\"environment\", JsonData.fromJson(\"\"\"\n{\"level\":2,\"trusted\":true,\"tags\":[\"production\"]}\n\"\"\"))\n .roleDescriptors(\"role-a\", r -> r\n .indices(i -> i\n .names(\"*\")\n .privileges(\"write\")\n )\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_security/user/{username}/_password': post: tags: - security summary: "Change passwords\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_security/user/_password\n
\n
\n POST\n /_security/user/_password\n
\n
\n PUT\n /_security/user/{username}/_password\n
\n
\n POST\n /_security/user/{username}/_password\n
\n \n\nChange the passwords of users in the native realm and built-in users." operationId: security-change-password parameters: - $ref: '#/components/parameters/security.change_password-username' - $ref: '#/components/parameters/security.change_password-refresh' requestBody: $ref: '#/components/requestBodies/security.change_password' responses: '200': $ref: '#/components/responses/security.change_password-200' x-state: Generally available x-codeSamples: - lang: Console source: "POST /_security/user/jacknich/_password\n{\n \"password\" : \"new-test-password\"\n}" - lang: Python source: "resp = client.security.change_password(\n username=\"jacknich\",\n password=\"new-test-password\",\n)" - lang: JavaScript source: "const response = await client.security.changePassword({\n username: \"jacknich\",\n password: \"new-test-password\",\n});" - lang: Ruby source: "response = client.security.change_password(\n username: \"jacknich\",\n body: {\n \"password\": \"new-test-password\"\n }\n)" - lang: PHP source: "$resp = $client->security()->changePassword([\n \"username\" => \"jacknich\",\n \"body\" => [\n \"password\" => \"new-test-password\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"password":"new-test-password"}'' "$ELASTICSEARCH_URL/_security/user/jacknich/_password"' - lang: C# source: "var response = await client.Security\n .ChangePasswordAsync(d1 => d1\n .Username(\"jacknich\")\n .Password(\"new-test-password\")\n );" - lang: Java source: "client.security().changePassword(c -> c\n .password(\"new-test-password\")\n .username(\"jacknich\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_security/api_key/{ids}/_clear_cache': post: tags: - security summary: Clear the API key cache description: "Evict a subset of all entries from the API key cache.\nThe cache is also automatically cleared on state changes of the security index.\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" operationId: security-clear-api-key-cache parameters: - name: ids in: path description: "Comma-separated list of API key IDs to evict from the API key cache.\nTo evict all API keys, use `*`.\nDoes not support other wildcard patterns." required: true schema: $ref: '#/components/schemas/_types.Ids' responses: '200': description: '' content: application/json: schema: required: - _nodes - cluster_name - nodes type: object properties: _nodes: allOf: - $ref: '#/components/schemas/_types.NodeStatistics' cluster_name: allOf: - $ref: '#/components/schemas/_types.Name' nodes: type: object additionalProperties: $ref: '#/components/schemas/security._types.ClusterNode' x-state: Generally available; Added in 7.10.0 x-codeSamples: - lang: Console source: "POST /_security/api_key/yVGMr3QByxdh1MSaicYx/_clear_cache\n" - lang: Python source: "resp = client.security.clear_api_key_cache(\n ids=\"yVGMr3QByxdh1MSaicYx\",\n)" - lang: JavaScript source: "const response = await client.security.clearApiKeyCache({\n ids: \"yVGMr3QByxdh1MSaicYx\",\n});" - lang: Ruby source: "response = client.security.clear_api_key_cache(\n ids: \"yVGMr3QByxdh1MSaicYx\"\n)" - lang: PHP source: "$resp = $client->security()->clearApiKeyCache([\n \"ids\" => \"yVGMr3QByxdh1MSaicYx\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/api_key/yVGMr3QByxdh1MSaicYx/_clear_cache"' - lang: C# source: 'var response = await client.Security.ClearApiKeyCacheAsync(ids: new[] { "yVGMr3QByxdh1MSaicYx" });' - lang: Java source: "client.security().clearApiKeyCache(c -> c\n .ids(\"yVGMr3QByxdh1MSaicYx\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_security/privilege/{application}/_clear_cache': post: tags: - security summary: Clear the privileges cache description: "Evict privileges from the native application privilege cache.\nThe cache is also automatically cleared for applications that have their privileges updated.\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" operationId: security-clear-cached-privileges parameters: - name: application in: path description: "A comma-separated list of applications.\nTo clear all applications, use an asterism (`*`).\nIt does not support other wildcard patterns." required: true schema: $ref: '#/components/schemas/_types.Names' responses: '200': description: '' content: application/json: schema: required: - _nodes - cluster_name - nodes type: object properties: _nodes: allOf: - $ref: '#/components/schemas/_types.NodeStatistics' cluster_name: allOf: - $ref: '#/components/schemas/_types.Name' nodes: type: object additionalProperties: $ref: '#/components/schemas/security._types.ClusterNode' x-state: Generally available; Added in 7.9.0 x-codeSamples: - lang: Console source: "POST /_security/privilege/myapp/_clear_cache\n" - lang: Python source: "resp = client.security.clear_cached_privileges(\n application=\"myapp\",\n)" - lang: JavaScript source: "const response = await client.security.clearCachedPrivileges({\n application: \"myapp\",\n});" - lang: Ruby source: "response = client.security.clear_cached_privileges(\n application: \"myapp\"\n)" - lang: PHP source: "$resp = $client->security()->clearCachedPrivileges([\n \"application\" => \"myapp\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/privilege/myapp/_clear_cache"' - lang: C# source: 'var response = await client.Security.ClearCachedPrivilegesAsync(application: new[] { "myapp" });' - lang: Java source: "client.security().clearCachedPrivileges(c -> c\n .application(\"myapp\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_security/realm/{realms}/_clear_cache': post: tags: - security summary: Clear the user cache description: "Evict users from the user cache.\nYou can completely clear the cache or evict specific users.\n\nUser credentials are cached in memory on each node to avoid connecting to a remote authentication service or hitting the disk for every incoming request.\nThere are realm settings that you can use to configure the user cache.\nFor more information, refer to the documentation about controlling the user cache.\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" externalDocs: description: About controlling the user cache url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/controlling-user-cache x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-clear-cache.html operationId: security-clear-cached-realms parameters: - name: realms in: path description: "A comma-separated list of realms.\nTo clear all realms, use an asterisk (`*`).\nIt does not support other wildcard patterns." required: true schema: $ref: '#/components/schemas/_types.Names' - name: usernames in: query description: "A comma-separated list of the users to clear from the cache.\nIf you do not specify this parameter, the API evicts all users from the user cache." schema: type: array items: type: string responses: '200': description: '' content: application/json: schema: required: - _nodes - cluster_name - nodes type: object properties: _nodes: allOf: - $ref: '#/components/schemas/_types.NodeStatistics' cluster_name: allOf: - $ref: '#/components/schemas/_types.Name' nodes: type: object additionalProperties: $ref: '#/components/schemas/security._types.ClusterNode' x-state: Generally available x-codeSamples: - lang: Console source: "POST /_security/realm/default_file/_clear_cache\n" - lang: Python source: "resp = client.security.clear_cached_realms(\n realms=\"default_file\",\n)" - lang: JavaScript source: "const response = await client.security.clearCachedRealms({\n realms: \"default_file\",\n});" - lang: Ruby source: "response = client.security.clear_cached_realms(\n realms: \"default_file\"\n)" - lang: PHP source: "$resp = $client->security()->clearCachedRealms([\n \"realms\" => \"default_file\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/realm/default_file/_clear_cache"' - lang: C# source: 'var response = await client.Security.ClearCachedRealmsAsync(realms: new[] { "default_file" });' - lang: Java source: "client.security().clearCachedRealms(c -> c\n .realms(\"default_file\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_security/role/{name}/_clear_cache': post: tags: - security summary: Clear the roles cache description: "Evict roles from the native role cache.\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" operationId: security-clear-cached-roles parameters: - name: name in: path description: "A comma-separated list of roles to evict from the role cache.\nTo evict all roles, use an asterisk (`*`).\nIt does not support other wildcard patterns." required: true schema: $ref: '#/components/schemas/_types.Names' responses: '200': description: '' content: application/json: schema: required: - _nodes - cluster_name - nodes type: object properties: _nodes: allOf: - $ref: '#/components/schemas/_types.NodeStatistics' cluster_name: allOf: - $ref: '#/components/schemas/_types.Name' nodes: type: object additionalProperties: $ref: '#/components/schemas/security._types.ClusterNode' x-state: Generally available x-codeSamples: - lang: Console source: "POST /_security/role/my_admin_role/_clear_cache\n" - lang: Python source: "resp = client.security.clear_cached_roles(\n name=\"my_admin_role\",\n)" - lang: JavaScript source: "const response = await client.security.clearCachedRoles({\n name: \"my_admin_role\",\n});" - lang: Ruby source: "response = client.security.clear_cached_roles(\n name: \"my_admin_role\"\n)" - lang: PHP source: "$resp = $client->security()->clearCachedRoles([\n \"name\" => \"my_admin_role\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/role/my_admin_role/_clear_cache"' - lang: C# source: 'var response = await client.Security.ClearCachedRolesAsync(name: new[] { "my_admin_role" });' - lang: Java source: "client.security().clearCachedRoles(c -> c\n .name(\"my_admin_role\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_security/service/{namespace}/{service}/credential/token/{name}/_clear_cache': post: tags: - security summary: Clear service account token caches description: "Evict a subset of all entries from the service account token caches.\nTwo separate caches exist for service account tokens: one cache for tokens backed by the `service_tokens` file, and another for tokens backed by the `.security` index.\nThis API clears matching entries from both caches.\n\nThe cache for service account tokens backed by the `.security` index is cleared automatically on state changes of the security index.\nThe cache for tokens backed by the `service_tokens` file is cleared automatically on file changes.\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" externalDocs: description: More about service accounts url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/service-accounts x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-clear-service-token-caches.html operationId: security-clear-cached-service-tokens parameters: - name: namespace in: path description: 'The namespace, which is a top-level grouping of service accounts.' required: true schema: $ref: '#/components/schemas/_types.Namespace' - name: service in: path description: 'The name of the service, which must be unique within its namespace.' required: true schema: $ref: '#/components/schemas/_types.Service' - name: name in: path description: "A comma-separated list of token names to evict from the service account token caches.\nUse a wildcard (`*`) to evict all tokens that belong to a service account.\nIt does not support other wildcard patterns." required: true schema: $ref: '#/components/schemas/_types.Names' responses: '200': description: '' content: application/json: schema: required: - _nodes - cluster_name - nodes type: object properties: _nodes: allOf: - $ref: '#/components/schemas/_types.NodeStatistics' cluster_name: allOf: - $ref: '#/components/schemas/_types.Name' nodes: type: object additionalProperties: $ref: '#/components/schemas/security._types.ClusterNode' x-state: Generally available x-codeSamples: - lang: Console source: "POST /_security/service/elastic/fleet-server/credential/token/token1/_clear_cache\n" - lang: Python source: "resp = client.security.clear_cached_service_tokens(\n namespace=\"elastic\",\n service=\"fleet-server\",\n name=\"token1\",\n)" - lang: JavaScript source: "const response = await client.security.clearCachedServiceTokens({\n namespace: \"elastic\",\n service: \"fleet-server\",\n name: \"token1\",\n});" - lang: Ruby source: "response = client.security.clear_cached_service_tokens(\n namespace: \"elastic\",\n service: \"fleet-server\",\n name: \"token1\"\n)" - lang: PHP source: "$resp = $client->security()->clearCachedServiceTokens([\n \"namespace\" => \"elastic\",\n \"service\" => \"fleet-server\",\n \"name\" => \"token1\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/service/elastic/fleet-server/credential/token/token1/_clear_cache"' - lang: C# source: 'var response = await client.Security.ClearCachedServiceTokensAsync(@namespace: "elastic", service: "fleet-server", name: new[] { "token1" });' - lang: Java source: "client.security().clearCachedServiceTokens(c -> c\n .name(\"token1\")\n .namespace(\"elastic\")\n .service(\"fleet-server\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/api_key/clone: put: tags: - security summary: "Clone an API key\n" description: "**All methods and paths for this operation:**\n\n
\n POST\n /_security/api_key/clone\n
\n
\n PUT\n /_security/api_key/clone\n
\n \n\nCreate a copy of an existing API key with a new ID.\nThe cloned key inherits the role descriptors of the source key.\nThis is intended for applications (such as Kibana) that need to\ncreate API keys on behalf of a user using an existing API key credential,\nsince derived API keys (API keys created by API keys) are not otherwise supported.\n\n## Required authorization\n\n* Cluster privileges: `clone_api_key`\n" operationId: security-clone-api-key parameters: - $ref: '#/components/parameters/security.clone_api_key-refresh' requestBody: $ref: '#/components/requestBodies/security.clone_api_key' responses: '200': $ref: '#/components/responses/security.clone_api_key-200' x-state: Experimental; Added in 9.4.0 x-metaTags: - content: Elasticsearch name: product_name /_security/api_key: get: tags: - security summary: Get API key information description: "Retrieves information for one or more API keys.\nNOTE: If you have only the `manage_own_api_key` privilege, this API returns only the API keys that you own.\nIf you have `read_security`, `manage_api_key` or greater privileges (including `manage_security`), this API returns all API keys regardless of ownership.\n\n## Required authorization\n\n* Cluster privileges: `manage_own_api_key`,`read_security`\n" operationId: security-get-api-key parameters: - name: id in: query description: "An API key id.\nThis parameter cannot be used with any of `name`, `realm_name` or `username`." schema: $ref: '#/components/schemas/_types.Id' - name: name in: query description: "An API key name.\nThis parameter cannot be used with any of `id`, `realm_name` or `username`.\nIt supports prefix search with wildcard." schema: $ref: '#/components/schemas/_types.Name' - name: owner in: query description: "A boolean flag that can be used to query API keys owned by the currently authenticated user.\nThe `realm_name` or `username` parameters cannot be specified when this parameter is set to `true` as they are assumed to be the currently authenticated ones." schema: type: boolean default: false - name: realm_name in: query description: "The name of an authentication realm.\nThis parameter cannot be used with either `id` or `name` or when `owner` flag is set to `true`." schema: $ref: '#/components/schemas/_types.Name' - name: username in: query description: "The username of a user.\nThis parameter cannot be used with either `id` or `name` or when `owner` flag is set to `true`." schema: $ref: '#/components/schemas/_types.Username' - name: with_limited_by in: query description: "Return the snapshot of the owner user's role descriptors\nassociated with the API key. An API key's actual\npermission is the intersection of its assigned role\ndescriptors and the owner user's role descriptors." schema: type: boolean default: false x-state: Generally available; Added in 8.5.0 - name: active_only in: query description: 'A boolean flag that can be used to query API keys that are currently active. An API key is considered active if it is neither invalidated, nor expired at query time. You can specify this together with other parameters such as `owner` or `name`. If `active_only` is false, the response will include both active and inactive (expired or invalidated) keys.' schema: type: boolean default: false x-state: Generally available; Added in 8.10.0 - name: with_profile_uid in: query description: 'Determines whether to also retrieve the profile uid, for the API key owner principal, if it exists.' schema: type: boolean default: false x-state: Generally available; Added in 8.14.0 responses: '200': description: '' content: application/json: schema: required: - api_keys type: object properties: api_keys: type: array items: $ref: '#/components/schemas/security._types.ApiKey' examples: SecurityGetApiKeyResponseExample1: summary: Get a key by ID description: A successful response from `GET /_security/api_key?id=VuaCfGcBCdbkQm-e5aOx&with_limited_by=true`. value: "{\n \"api_keys\": [ \n {\n \"id\": \"VuaCfGcBCdbkQm-e5aOx\", \n \"name\": \"my-api-key\", \n \"creation\": 1548550550158, \n \"expiration\": 1548551550158, \n \"invalidated\": false, \n \"username\": \"myuser\", \n \"realm\": \"native1\", \n \"realm_type\": \"native\",\n \"metadata\": { \n \"application\": \"myapp\"\n },\n \"role_descriptors\": { }, \n \"limited_by\": [ \n {\n \"role-power-user\": {\n \"cluster\": [\n \"monitor\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"*\"\n ],\n \"privileges\": [\n \"read\"\n ],\n \"allow_restricted_indices\": false\n }\n ],\n \"applications\": [ ],\n \"run_as\": [ ],\n \"metadata\": { },\n \"transient_metadata\": {\n \"enabled\": true\n }\n }\n }\n ]\n }\n ]\n}" SecurityGetApiKeyResponseExample2: summary: Get all keys for a user description: "A successful response from `GET /_security/api_key?username=myuser&realm_name=native1`. The response contains all API keys for the user `myuser` in the `native1` realm.\n" value: "{\n \"api_keys\": [\n {\n \"id\": \"0GF5GXsBCXxz2eDxWwFN\",\n \"name\": \"hadoop_myuser_key\",\n \"creation\": 1548550550158,\n \"expiration\": 1548551550158,\n \"invalidated\": false,\n \"username\": \"myuser\",\n \"realm\": \"native1\",\n \"realm_type\": \"native\",\n \"metadata\": {\n \"application\": \"myapp\"\n },\n \"role_descriptors\": {\n \"role-a\": {\n \"cluster\": [\n \"monitor\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-a\"\n ],\n \"privileges\": [\n \"read\"\n ],\n \"allow_restricted_indices\": false\n }\n ],\n \"applications\": [ ],\n \"run_as\": [ ],\n \"metadata\": { },\n \"transient_metadata\": {\n \"enabled\": true\n }\n }\n }\n },\n {\n \"id\": \"6wHJmcQpReKBa42EHV5SBw\",\n \"name\": \"api-key-name-2\",\n \"creation\": 1548550550158,\n \"invalidated\": false,\n \"username\": \"user-y\",\n \"realm\": \"realm-2\",\n \"metadata\": {},\n \"role_descriptors\": { }\n }\n ]\n}" x-state: Generally available; Added in 6.7.0 x-codeSamples: - lang: Console source: "GET /_security/api_key?username=myuser&realm_name=native1\n" - lang: Python source: "resp = client.security.get_api_key(\n username=\"myuser\",\n realm_name=\"native1\",\n)" - lang: JavaScript source: "const response = await client.security.getApiKey({\n username: \"myuser\",\n realm_name: \"native1\",\n});" - lang: Ruby source: "response = client.security.get_api_key(\n username: \"myuser\",\n realm_name: \"native1\"\n)" - lang: PHP source: "$resp = $client->security()->getApiKey([\n \"username\" => \"myuser\",\n \"realm_name\" => \"native1\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/api_key?username=myuser&realm_name=native1"' - lang: C# source: "var response = await client.Security\n .GetApiKeyAsync(d1 => d1\n .RealmName(\"native1\")\n .Username(\"myuser\")\n );" - lang: Java source: "client.security().getApiKey(g -> g\n .realmName(\"native1\")\n .username(\"myuser\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name post: tags: - security summary: "Create an API key\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_security/api_key\n
\n
\n POST\n /_security/api_key\n
\n \n\nCreate an API key for access without requiring basic authentication.\n\nIMPORTANT: If the credential that is used to authenticate this request is an API key, the derived API key cannot have any privileges.\nIf you specify privileges, the API returns an error.\n\nA successful request returns a JSON structure that contains the API key, its unique id, and its name.\nIf applicable, it also returns expiration information for the API key in milliseconds.\n\nNOTE: By default, API keys never expire. You can specify expiration information when you create the API keys.\n\nThe API keys are created by the Elasticsearch API key service, which is automatically enabled.\nTo configure or turn off the API key service, refer to API key service setting documentation.\n\n## Required authorization\n\n* Cluster privileges: `manage_own_api_key`\n" externalDocs: description: About API key service settings url: https://www.elastic.co/docs/reference/elasticsearch/configuration-reference/security-settings#api-key-service-settings x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-create-api-key.html operationId: security-create-api-key parameters: - $ref: '#/components/parameters/security.create_api_key-refresh' requestBody: $ref: '#/components/requestBodies/security.create_api_key' responses: '200': $ref: '#/components/responses/security.create_api_key-200' x-state: Generally available; Added in 6.7.0 x-codeSamples: - lang: Console source: "POST /_security/api_key\n{\n \"name\": \"my-api-key\",\n \"expiration\": \"1d\", \n \"role_descriptors\": { \n \"role-a\": {\n \"cluster\": [\"all\"],\n \"indices\": [\n {\n \"names\": [\"index-a*\"],\n \"privileges\": [\"read\"]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\"all\"],\n \"indices\": [\n {\n \"names\": [\"index-b*\"],\n \"privileges\": [\"all\"]\n }\n ]\n }\n },\n \"metadata\": {\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\"dev\", \"staging\"]\n }\n }\n}" - lang: Python source: "resp = client.security.create_api_key(\n name=\"my-api-key\",\n expiration=\"1d\",\n role_descriptors={\n \"role-a\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-a*\"\n ],\n \"privileges\": [\n \"read\"\n ]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-b*\"\n ],\n \"privileges\": [\n \"all\"\n ]\n }\n ]\n }\n },\n metadata={\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": True,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n },\n)" - lang: JavaScript source: "const response = await client.security.createApiKey({\n name: \"my-api-key\",\n expiration: \"1d\",\n role_descriptors: {\n \"role-a\": {\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index-a*\"],\n privileges: [\"read\"],\n },\n ],\n },\n \"role-b\": {\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index-b*\"],\n privileges: [\"all\"],\n },\n ],\n },\n },\n metadata: {\n application: \"my-application\",\n environment: {\n level: 1,\n trusted: true,\n tags: [\"dev\", \"staging\"],\n },\n },\n});" - lang: Ruby source: "response = client.security.create_api_key(\n body: {\n \"name\": \"my-api-key\",\n \"expiration\": \"1d\",\n \"role_descriptors\": {\n \"role-a\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-a*\"\n ],\n \"privileges\": [\n \"read\"\n ]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-b*\"\n ],\n \"privileges\": [\n \"all\"\n ]\n }\n ]\n }\n },\n \"metadata\": {\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->createApiKey([\n \"body\" => [\n \"name\" => \"my-api-key\",\n \"expiration\" => \"1d\",\n \"role_descriptors\" => [\n \"role-a\" => [\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index-a*\",\n ),\n \"privileges\" => array(\n \"read\",\n ),\n ],\n ),\n ],\n \"role-b\" => [\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index-b*\",\n ),\n \"privileges\" => array(\n \"all\",\n ),\n ],\n ),\n ],\n ],\n \"metadata\" => [\n \"application\" => \"my-application\",\n \"environment\" => [\n \"level\" => 1,\n \"trusted\" => true,\n \"tags\" => array(\n \"dev\",\n \"staging\",\n ),\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"name":"my-api-key","expiration":"1d","role_descriptors":{"role-a":{"cluster":["all"],"indices":[{"names":["index-a*"],"privileges":["read"]}]},"role-b":{"cluster":["all"],"indices":[{"names":["index-b*"],"privileges":["all"]}]}},"metadata":{"application":"my-application","environment":{"level":1,"trusted":true,"tags":["dev","staging"]}}}'' "$ELASTICSEARCH_URL/_security/api_key"' - lang: C# source: "var response = await client.Security\n .CreateApiKeyAsync(d1 => d1\n .Expiration(\"1d\")\n .Metadata(new Dictionary()\n {\n { \"application\", \"my-application\" },\n { \"environment\", JsonSerializer.Deserialize(\"\"\"\n {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n \"\"\") }\n })\n .Name(\"my-api-key\")\n .RoleDescriptors(d2 => d2\n .Add(\"role-a\", d3 => d3\n .Cluster(ClusterPrivilege.All)\n .Indices(d4 => d4\n .Names([\"index-a*\"])\n .Privileges(IndexPrivilege.Read)\n )\n )\n .Add(\"role-b\", d3 => d3\n .Cluster(ClusterPrivilege.All)\n .Indices(d4 => d4\n .Names([\"index-b*\"])\n .Privileges(IndexPrivilege.All)\n )\n )\n )\n );" - lang: Java source: "client.security().createApiKey(c -> c\n .expiration(e -> e\n .time(\"1d\")\n )\n .metadata(Map.of(\"environment\", JsonData.fromJson(\"\"\"\n{\"level\":1,\"trusted\":true,\"tags\":[\"dev\",\"staging\"]}\n\"\"\"),\"application\", JsonData.fromJson(\"\\\"my-application\\\"\")))\n .name(\"my-api-key\")\n .roleDescriptors(Map.of(\"role-b\", RoleDescriptor.roleDescriptorOf(r -> r\n .cluster(\"all\")\n .indices(i -> i\n .names(\"index-b*\")\n .privileges(\"all\")\n )\n ),\"role-a\", RoleDescriptor.roleDescriptorOf(r -> r\n .cluster(\"all\")\n .indices(i -> i\n .names(\"index-a*\")\n .privileges(\"read\")\n )\n )))\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - security summary: Invalidate API keys description: "This API invalidates API keys created by the create API key or grant API key APIs.\nInvalidated API keys fail authentication, but they can still be viewed using the get API key information and query API key information APIs, for at least the configured retention period, until they are automatically deleted.\n\nTo use this API, you must have at least the `manage_security`, `manage_api_key`, or `manage_own_api_key` cluster privileges.\nThe `manage_security` privilege allows deleting any API key, including both REST and cross cluster API keys.\nThe `manage_api_key` privilege allows deleting any REST API key, but not cross cluster API keys.\nThe `manage_own_api_key` only allows deleting REST API keys that are owned by the user.\nIn addition, with the `manage_own_api_key` privilege, an invalidation request must be issued in one of the three formats:\n\n- Set the parameter `owner=true`.\n- Or, set both `username` and `realm_name` to match the user's identity.\n- Or, if the request is issued by an API key, that is to say an API key invalidates itself, specify its ID in the `ids` field.\n\n## Required authorization\n\n* Cluster privileges: `manage_api_key`,`manage_own_api_key`\n" operationId: security-invalidate-api-key requestBody: content: application/json: schema: type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' ids: type: array items: $ref: '#/components/schemas/_types.Id' description: "A list of API key ids.\nThis parameter cannot be used with any of `name`, `realm_name`, or `username`." name: allOf: - $ref: '#/components/schemas/_types.Name' description: "An API key name.\nThis parameter cannot be used with any of `ids`, `realm_name` or `username`." owner: type: boolean description: "Query API keys owned by the currently authenticated user.\nThe `realm_name` or `username` parameters cannot be specified when this parameter is set to `true` as they are assumed to be the currently authenticated ones.\n\nNOTE: At least one of `ids`, `name`, `username`, and `realm_name` must be specified if `owner` is `false`." default: false realm_name: type: string description: "The name of an authentication realm.\nThis parameter cannot be used with either `ids` or `name`, or when `owner` flag is set to `true`." username: allOf: - $ref: '#/components/schemas/_types.Username' description: "The username of a user.\nThis parameter cannot be used with either `ids` or `name` or when `owner` flag is set to `true`." examples: SecurityInvalidateApiKeyRequestExample1: summary: API keys by ID description: Run `DELETE /_security/api_key` to invalidate the API keys identified by ID. value: "{\n \"ids\" : [ \"VuaCfGcBCdbkQm-e5aOx\" ]\n}" x-codeSamples: - lang: Console source: "DELETE /_security/api_key\n{\n \"ids\" : [ \"VuaCfGcBCdbkQm-e5aOx\" ]\n}" - lang: Python source: "resp = client.security.invalidate_api_key(\n ids=[\n \"VuaCfGcBCdbkQm-e5aOx\"\n ],\n)" - lang: JavaScript source: "const response = await client.security.invalidateApiKey({\n ids: [\"VuaCfGcBCdbkQm-e5aOx\"],\n});" - lang: Ruby source: "response = client.security.invalidate_api_key(\n body: {\n \"ids\": [\n \"VuaCfGcBCdbkQm-e5aOx\"\n ]\n }\n)" - lang: PHP source: "$resp = $client->security()->invalidateApiKey([\n \"body\" => [\n \"ids\" => array(\n \"VuaCfGcBCdbkQm-e5aOx\",\n ),\n ],\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"ids":["VuaCfGcBCdbkQm-e5aOx"]}'' "$ELASTICSEARCH_URL/_security/api_key"' - lang: C# source: "var response = await client.Security\n .InvalidateApiKeyAsync(d1 => d1\n .Ids([\"VuaCfGcBCdbkQm-e5aOx\"])\n );" - lang: Java source: "client.security().invalidateApiKey(i -> i\n .ids(\"VuaCfGcBCdbkQm-e5aOx\")\n);\n" SecurityInvalidateApiKeyRequestExample2: summary: API keys by name description: Run `DELETE /_security/api_key` to invalidate the API keys identified by name. value: "{\n \"name\" : \"my-api-key\"\n}" x-codeSamples: - lang: Console source: "DELETE /_security/api_key\n{\n \"name\" : \"my-api-key\"\n}" - lang: Python source: "resp = client.security.invalidate_api_key(\n name=\"my-api-key\",\n)" - lang: JavaScript source: "const response = await client.security.invalidateApiKey({\n name: \"my-api-key\",\n});" - lang: Ruby source: "response = client.security.invalidate_api_key(\n body: {\n \"name\": \"my-api-key\"\n }\n)" - lang: PHP source: "$resp = $client->security()->invalidateApiKey([\n \"body\" => [\n \"name\" => \"my-api-key\",\n ],\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"name":"my-api-key"}'' "$ELASTICSEARCH_URL/_security/api_key"' - lang: C# source: "var response = await client.Security\n .InvalidateApiKeyAsync(d1 => d1\n .Name(\"my-api-key\")\n );" - lang: Java source: "client.security().invalidateApiKey(i -> i\n .name(\"my-api-key\")\n);\n" SecurityInvalidateApiKeyRequestExample3: summary: API keys by realm description: Run `DELETE /_security/api_key` to invalidate all API keys for the `native1` realm. value: "{\n \"realm_name\" : \"native1\"\n}" x-codeSamples: - lang: Console source: "DELETE /_security/api_key\n{\n \"realm_name\" : \"native1\"\n}" - lang: Python source: "resp = client.security.invalidate_api_key(\n realm_name=\"native1\",\n)" - lang: JavaScript source: "const response = await client.security.invalidateApiKey({\n realm_name: \"native1\",\n});" - lang: Ruby source: "response = client.security.invalidate_api_key(\n body: {\n \"realm_name\": \"native1\"\n }\n)" - lang: PHP source: "$resp = $client->security()->invalidateApiKey([\n \"body\" => [\n \"realm_name\" => \"native1\",\n ],\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"realm_name":"native1"}'' "$ELASTICSEARCH_URL/_security/api_key"' - lang: C# source: "var response = await client.Security\n .InvalidateApiKeyAsync(d1 => d1\n .RealmName(\"native1\")\n );" - lang: Java source: "client.security().invalidateApiKey(i -> i\n .realmName(\"native1\")\n);\n" SecurityInvalidateApiKeyRequestExample4: summary: API keys by user description: Run `DELETE /_security/api_key` to invalidate all API keys for the user `myuser` in all realms. value: "{\n \"username\" : \"myuser\"\n}" x-codeSamples: - lang: Console source: "DELETE /_security/api_key\n{\n \"username\" : \"myuser\"\n}" - lang: Python source: "resp = client.security.invalidate_api_key(\n username=\"myuser\",\n)" - lang: JavaScript source: "const response = await client.security.invalidateApiKey({\n username: \"myuser\",\n});" - lang: Ruby source: "response = client.security.invalidate_api_key(\n body: {\n \"username\": \"myuser\"\n }\n)" - lang: PHP source: "$resp = $client->security()->invalidateApiKey([\n \"body\" => [\n \"username\" => \"myuser\",\n ],\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"username":"myuser"}'' "$ELASTICSEARCH_URL/_security/api_key"' - lang: C# source: "var response = await client.Security\n .InvalidateApiKeyAsync(d1 => d1\n .Username(\"myuser\")\n );" - lang: Java source: "client.security().invalidateApiKey(i -> i\n .username(\"myuser\")\n);\n" SecurityInvalidateApiKeyRequestExample5: summary: API keys by ID and owner description: Run `DELETE /_security/api_key` to invalidate the API keys identified by ID if they are owned by the currently authenticated user. value: "{\n \"ids\" : [\"VuaCfGcBCdbkQm-e5aOx\"],\n \"owner\" : \"true\"\n}" x-codeSamples: - lang: Console source: "DELETE /_security/api_key\n{\n \"ids\" : [\"VuaCfGcBCdbkQm-e5aOx\"],\n \"owner\" : \"true\"\n}" - lang: Python source: "resp = client.security.invalidate_api_key(\n ids=[\n \"VuaCfGcBCdbkQm-e5aOx\"\n ],\n owner=True,\n)" - lang: JavaScript source: "const response = await client.security.invalidateApiKey({\n ids: [\"VuaCfGcBCdbkQm-e5aOx\"],\n owner: \"true\",\n});" - lang: Ruby source: "response = client.security.invalidate_api_key(\n body: {\n \"ids\": [\n \"VuaCfGcBCdbkQm-e5aOx\"\n ],\n \"owner\": \"true\"\n }\n)" - lang: PHP source: "$resp = $client->security()->invalidateApiKey([\n \"body\" => [\n \"ids\" => array(\n \"VuaCfGcBCdbkQm-e5aOx\",\n ),\n \"owner\" => \"true\",\n ],\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"ids":["VuaCfGcBCdbkQm-e5aOx"],"owner":"true"}'' "$ELASTICSEARCH_URL/_security/api_key"' - lang: C# source: "var response = await client.Security\n .InvalidateApiKeyAsync(d1 => d1\n .Ids([\"VuaCfGcBCdbkQm-e5aOx\"])\n .Owner(true)\n );" - lang: Java source: "client.security().invalidateApiKey(i -> i\n .ids(\"VuaCfGcBCdbkQm-e5aOx\")\n .owner(true)\n);\n" SecurityInvalidateApiKeyRequestExample6: summary: API keys by user and realm description: Run `DELETE /_security/api_key` to invalidate all API keys for the user `myuser` in the `native1` realm . value: "{\n \"username\" : \"myuser\",\n \"realm_name\" : \"native1\"\n}" x-codeSamples: - lang: Console source: "DELETE /_security/api_key\n{\n \"username\" : \"myuser\",\n \"realm_name\" : \"native1\"\n}" - lang: Python source: "resp = client.security.invalidate_api_key(\n username=\"myuser\",\n realm_name=\"native1\",\n)" - lang: JavaScript source: "const response = await client.security.invalidateApiKey({\n username: \"myuser\",\n realm_name: \"native1\",\n});" - lang: Ruby source: "response = client.security.invalidate_api_key(\n body: {\n \"username\": \"myuser\",\n \"realm_name\": \"native1\"\n }\n)" - lang: PHP source: "$resp = $client->security()->invalidateApiKey([\n \"body\" => [\n \"username\" => \"myuser\",\n \"realm_name\" => \"native1\",\n ],\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"username":"myuser","realm_name":"native1"}'' "$ELASTICSEARCH_URL/_security/api_key"' - lang: C# source: "var response = await client.Security\n .InvalidateApiKeyAsync(d1 => d1\n .RealmName(\"native1\")\n .Username(\"myuser\")\n );" - lang: Java source: "client.security().invalidateApiKey(i -> i\n .realmName(\"native1\")\n .username(\"myuser\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - error_count - invalidated_api_keys - previously_invalidated_api_keys type: object properties: error_count: type: number description: The number of errors that were encountered when invalidating the API keys. error_details: type: array items: $ref: '#/components/schemas/_types.ErrorCause' description: "Details about the errors.\nThis field is not present in the response when `error_count` is `0`." invalidated_api_keys: type: array items: type: string description: The IDs of the API keys that were invalidated as part of this request. previously_invalidated_api_keys: type: array items: type: string description: The IDs of the API keys that were already invalidated. examples: SecurityInvalidateApiKeyResponseExample1: description: "A successful response from `DELETE /_security/api_key`.\n" value: "{\n \"invalidated_api_keys\": [ \n \"api-key-id-1\"\n ],\n \"previously_invalidated_api_keys\": [ \n \"api-key-id-2\",\n \"api-key-id-3\"\n ],\n \"error_count\": 2, \n \"error_details\": [ \n {\n \"type\": \"exception\",\n \"reason\": \"error occurred while invalidating api keys\",\n \"caused_by\": {\n \"type\": \"illegal_argument_exception\",\n \"reason\": \"invalid api key id\"\n }\n },\n {\n \"type\": \"exception\",\n \"reason\": \"error occurred while invalidating api keys\",\n \"caused_by\": {\n \"type\": \"illegal_argument_exception\",\n \"reason\": \"invalid api key id\"\n }\n }\n ]\n}" x-state: Generally available; Added in 6.7.0 x-codeSamples: - lang: Console source: "DELETE /_security/api_key\n{\n \"ids\" : [ \"VuaCfGcBCdbkQm-e5aOx\" ]\n}" - lang: Python source: "resp = client.security.invalidate_api_key(\n ids=[\n \"VuaCfGcBCdbkQm-e5aOx\"\n ],\n)" - lang: JavaScript source: "const response = await client.security.invalidateApiKey({\n ids: [\"VuaCfGcBCdbkQm-e5aOx\"],\n});" - lang: Ruby source: "response = client.security.invalidate_api_key(\n body: {\n \"ids\": [\n \"VuaCfGcBCdbkQm-e5aOx\"\n ]\n }\n)" - lang: PHP source: "$resp = $client->security()->invalidateApiKey([\n \"body\" => [\n \"ids\" => array(\n \"VuaCfGcBCdbkQm-e5aOx\",\n ),\n ],\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"ids":["VuaCfGcBCdbkQm-e5aOx"]}'' "$ELASTICSEARCH_URL/_security/api_key"' - lang: C# source: "var response = await client.Security\n .InvalidateApiKeyAsync(d1 => d1\n .Ids([\"VuaCfGcBCdbkQm-e5aOx\"])\n );" - lang: Java source: "client.security().invalidateApiKey(i -> i\n .ids(\"VuaCfGcBCdbkQm-e5aOx\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/cross_cluster/api_key: post: tags: - security summary: Create a cross-cluster API key description: "Create an API key of the `cross_cluster` type for the API key based remote cluster access.\nA `cross_cluster` API key cannot be used to authenticate through the REST interface.\n\nIMPORTANT: To authenticate this request you must use a credential that is not an API key. Even if you use an API key that has the required privilege, the API returns an error.\n\nCross-cluster API keys are created by the Elasticsearch API key service, which is automatically enabled.\n\nNOTE: Unlike REST API keys, a cross-cluster API key does not capture permissions of the authenticated user. The API key’s effective permission is exactly as specified with the `access` property.\n\nA successful request returns a JSON structure that contains the API key, its unique ID, and its name. If applicable, it also returns expiration information for the API key in milliseconds.\n\nBy default, API keys never expire. You can specify expiration information when you create the API keys.\n\nCross-cluster API keys can only be updated with the update cross-cluster API key API.\nAttempting to update them with the update REST API key API or the bulk update REST API keys API will result in an error.\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" externalDocs: description: About adding remote clusters url: https://www.elastic.co/docs/deploy-manage/remote-clusters/remote-clusters-api-key x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-create-cross-cluster-api-key.html operationId: security-create-cross-cluster-api-key requestBody: content: application/json: schema: required: - access - name type: object properties: access: allOf: - $ref: '#/components/schemas/security._types.Access' description: "The access to be granted to this API key.\nThe access is composed of permissions for cross-cluster search and cross-cluster replication.\nAt least one of them must be specified.\n\nNOTE: No explicit privileges should be specified for either search or replication access.\nThe creation process automatically converts the access specification to a role descriptor which has relevant privileges assigned accordingly." expiration: allOf: - $ref: '#/components/schemas/_types.Duration' description: "Expiration time for the API key.\nBy default, API keys never expire." metadata: allOf: - $ref: '#/components/schemas/_types.Metadata' description: "Arbitrary metadata that you want to associate with the API key.\nIt supports nested data structure.\nWithin the metadata object, keys beginning with `_` are reserved for system usage." name: allOf: - $ref: '#/components/schemas/_types.Name' description: Specifies the name for this API key. certificate_identity: type: string description: "The certificate identity to associate with this API key.\nThis field is used to restrict the API key to connections authenticated by a specific TLS certificate.\nThe value should match the certificate's distinguished name (DN) pattern." examples: CreateCrossClusterApiKeyRequestExample1: description: "Run `POST /_security/cross_cluster/api_key` to create a cross-cluster API key.\n" value: "{\n \"name\": \"my-cross-cluster-api-key\",\n \"expiration\": \"1d\", \n \"access\": {\n \"search\": [ \n {\n \"names\": [\"logs*\"]\n }\n ],\n \"replication\": [ \n {\n \"names\": [\"archive*\"]\n }\n ]\n },\n \"metadata\": {\n \"description\": \"phase one\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\"dev\", \"staging\"]\n }\n }\n}" x-codeSamples: - lang: Console source: "POST /_security/cross_cluster/api_key\n{\n \"name\": \"my-cross-cluster-api-key\",\n \"expiration\": \"1d\", \n \"access\": {\n \"search\": [ \n {\n \"names\": [\"logs*\"]\n }\n ],\n \"replication\": [ \n {\n \"names\": [\"archive*\"]\n }\n ]\n },\n \"metadata\": {\n \"description\": \"phase one\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\"dev\", \"staging\"]\n }\n }\n}" - lang: Python source: "resp = client.security.create_cross_cluster_api_key(\n name=\"my-cross-cluster-api-key\",\n expiration=\"1d\",\n access={\n \"search\": [\n {\n \"names\": [\n \"logs*\"\n ]\n }\n ],\n \"replication\": [\n {\n \"names\": [\n \"archive*\"\n ]\n }\n ]\n },\n metadata={\n \"description\": \"phase one\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": True,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n },\n)" - lang: JavaScript source: "const response = await client.security.createCrossClusterApiKey({\n name: \"my-cross-cluster-api-key\",\n expiration: \"1d\",\n access: {\n search: [\n {\n names: [\"logs*\"],\n },\n ],\n replication: [\n {\n names: [\"archive*\"],\n },\n ],\n },\n metadata: {\n description: \"phase one\",\n environment: {\n level: 1,\n trusted: true,\n tags: [\"dev\", \"staging\"],\n },\n },\n});" - lang: Ruby source: "response = client.security.create_cross_cluster_api_key(\n body: {\n \"name\": \"my-cross-cluster-api-key\",\n \"expiration\": \"1d\",\n \"access\": {\n \"search\": [\n {\n \"names\": [\n \"logs*\"\n ]\n }\n ],\n \"replication\": [\n {\n \"names\": [\n \"archive*\"\n ]\n }\n ]\n },\n \"metadata\": {\n \"description\": \"phase one\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->createCrossClusterApiKey([\n \"body\" => [\n \"name\" => \"my-cross-cluster-api-key\",\n \"expiration\" => \"1d\",\n \"access\" => [\n \"search\" => array(\n [\n \"names\" => array(\n \"logs*\",\n ),\n ],\n ),\n \"replication\" => array(\n [\n \"names\" => array(\n \"archive*\",\n ),\n ],\n ),\n ],\n \"metadata\" => [\n \"description\" => \"phase one\",\n \"environment\" => [\n \"level\" => 1,\n \"trusted\" => true,\n \"tags\" => array(\n \"dev\",\n \"staging\",\n ),\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"name":"my-cross-cluster-api-key","expiration":"1d","access":{"search":[{"names":["logs*"]}],"replication":[{"names":["archive*"]}]},"metadata":{"description":"phase one","environment":{"level":1,"trusted":true,"tags":["dev","staging"]}}}'' "$ELASTICSEARCH_URL/_security/cross_cluster/api_key"' - lang: C# source: "var response = await client.Security\n .CreateCrossClusterApiKeyAsync(d1 => d1\n .Access(d2 => d2\n .Replication(d3 => d3\n .Names([\"archive*\"])\n )\n .Search(d3 => d3\n .Names([\"logs*\"])\n )\n )\n .Expiration(\"1d\")\n .Metadata(new Dictionary()\n {\n { \"description\", \"phase one\" },\n { \"environment\", JsonSerializer.Deserialize(\"\"\"\n {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n \"\"\") }\n })\n .Name(\"my-cross-cluster-api-key\")\n );" - lang: Java source: "client.security().createCrossClusterApiKey(c -> c\n .access(a -> a\n .replication(r -> r\n .names(\"archive*\")\n )\n .search(s -> s\n .names(\"logs*\")\n )\n )\n .expiration(e -> e\n .time(\"1d\")\n )\n .metadata(Map.of(\"environment\", JsonData.fromJson(\"\"\"\n{\"level\":1,\"trusted\":true,\"tags\":[\"dev\",\"staging\"]}\n\"\"\"),\"description\", JsonData.fromJson(\"\\\"phase one\\\"\")))\n .name(\"my-cross-cluster-api-key\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - api_key - id - name - encoded type: object properties: api_key: type: string description: Generated API key. expiration: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: Expiration in milliseconds for the API key. id: allOf: - $ref: '#/components/schemas/_types.Id' description: Unique ID for this API key. name: allOf: - $ref: '#/components/schemas/_types.Name' description: Specifies the name for this API key. encoded: type: string description: "API key credentials which is the base64-encoding of\nthe UTF-8 representation of `id` and `api_key` joined\nby a colon (`:`)." examples: CreateCrossClusterApiKeyResponseExample1: description: "A successful response from `POST /_security/service/elastic/fleet-server/credential/token`.\n" value: "{\n \"created\": true,\n \"token\": {\n \"name\": \"Jk5J1HgBuyBK5TpDrdo4\",\n \"value\": \"AAEAAWVsYXN0aWM...vZmxlZXQtc2VydmVyL3Rva2VuMTo3TFdaSDZ\"\n }\n}" x-state: Generally available x-codeSamples: - lang: Console source: "POST /_security/cross_cluster/api_key\n{\n \"name\": \"my-cross-cluster-api-key\",\n \"expiration\": \"1d\", \n \"access\": {\n \"search\": [ \n {\n \"names\": [\"logs*\"]\n }\n ],\n \"replication\": [ \n {\n \"names\": [\"archive*\"]\n }\n ]\n },\n \"metadata\": {\n \"description\": \"phase one\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\"dev\", \"staging\"]\n }\n }\n}" - lang: Python source: "resp = client.security.create_cross_cluster_api_key(\n name=\"my-cross-cluster-api-key\",\n expiration=\"1d\",\n access={\n \"search\": [\n {\n \"names\": [\n \"logs*\"\n ]\n }\n ],\n \"replication\": [\n {\n \"names\": [\n \"archive*\"\n ]\n }\n ]\n },\n metadata={\n \"description\": \"phase one\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": True,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n },\n)" - lang: JavaScript source: "const response = await client.security.createCrossClusterApiKey({\n name: \"my-cross-cluster-api-key\",\n expiration: \"1d\",\n access: {\n search: [\n {\n names: [\"logs*\"],\n },\n ],\n replication: [\n {\n names: [\"archive*\"],\n },\n ],\n },\n metadata: {\n description: \"phase one\",\n environment: {\n level: 1,\n trusted: true,\n tags: [\"dev\", \"staging\"],\n },\n },\n});" - lang: Ruby source: "response = client.security.create_cross_cluster_api_key(\n body: {\n \"name\": \"my-cross-cluster-api-key\",\n \"expiration\": \"1d\",\n \"access\": {\n \"search\": [\n {\n \"names\": [\n \"logs*\"\n ]\n }\n ],\n \"replication\": [\n {\n \"names\": [\n \"archive*\"\n ]\n }\n ]\n },\n \"metadata\": {\n \"description\": \"phase one\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->createCrossClusterApiKey([\n \"body\" => [\n \"name\" => \"my-cross-cluster-api-key\",\n \"expiration\" => \"1d\",\n \"access\" => [\n \"search\" => array(\n [\n \"names\" => array(\n \"logs*\",\n ),\n ],\n ),\n \"replication\" => array(\n [\n \"names\" => array(\n \"archive*\",\n ),\n ],\n ),\n ],\n \"metadata\" => [\n \"description\" => \"phase one\",\n \"environment\" => [\n \"level\" => 1,\n \"trusted\" => true,\n \"tags\" => array(\n \"dev\",\n \"staging\",\n ),\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"name":"my-cross-cluster-api-key","expiration":"1d","access":{"search":[{"names":["logs*"]}],"replication":[{"names":["archive*"]}]},"metadata":{"description":"phase one","environment":{"level":1,"trusted":true,"tags":["dev","staging"]}}}'' "$ELASTICSEARCH_URL/_security/cross_cluster/api_key"' - lang: C# source: "var response = await client.Security\n .CreateCrossClusterApiKeyAsync(d1 => d1\n .Access(d2 => d2\n .Replication(d3 => d3\n .Names([\"archive*\"])\n )\n .Search(d3 => d3\n .Names([\"logs*\"])\n )\n )\n .Expiration(\"1d\")\n .Metadata(new Dictionary()\n {\n { \"description\", \"phase one\" },\n { \"environment\", JsonSerializer.Deserialize(\"\"\"\n {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n \"\"\") }\n })\n .Name(\"my-cross-cluster-api-key\")\n );" - lang: Java source: "client.security().createCrossClusterApiKey(c -> c\n .access(a -> a\n .replication(r -> r\n .names(\"archive*\")\n )\n .search(s -> s\n .names(\"logs*\")\n )\n )\n .expiration(e -> e\n .time(\"1d\")\n )\n .metadata(Map.of(\"environment\", JsonData.fromJson(\"\"\"\n{\"level\":1,\"trusted\":true,\"tags\":[\"dev\",\"staging\"]}\n\"\"\"),\"description\", JsonData.fromJson(\"\\\"phase one\\\"\")))\n .name(\"my-cross-cluster-api-key\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_security/service/{namespace}/{service}/credential/token/{name}': post: tags: - security summary: "Create a service account token\n" description: "**All methods and paths for this operation:**\n\n
\n POST\n /_security/service/{namespace}/{service}/credential/token\n
\n
\n PUT\n /_security/service/{namespace}/{service}/credential/token/{name}\n
\n
\n POST\n /_security/service/{namespace}/{service}/credential/token/{name}\n
\n \n\nCreate a service accounts token for access without requiring basic authentication.\nThis route serves both kinds of service account, but the privileges differ: `manage_service_account` authorizes tokens of built-in accounts in the `elastic` namespace only, and tokens of a user-managed account require `manage_security`.\n\nNOTE: Service account tokens never expire.\nYou must actively delete them if they are no longer needed.\n\nIMPORTANT: On Serverless, non-operator users can create tokens for only `elastic/fleet-server` and `elastic/fleet-server-remote`.\nCreating tokens for any other service account requires operator privileges.\n\n## Required authorization\n\n* Cluster privileges: `manage_service_account`\n" externalDocs: description: More about service accounts url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/service-accounts x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-create-service-token.html operationId: security-create-service-token parameters: - $ref: '#/components/parameters/security.create_service_token-namespace' - $ref: '#/components/parameters/security.create_service_token-service' - $ref: '#/components/parameters/security.create_service_token-name' - $ref: '#/components/parameters/security.create_service_token-refresh' responses: '200': $ref: '#/components/responses/security.create_service_token-200' x-state: Generally available x-codeSamples: - lang: Console source: "POST /_security/service/elastic/fleet-server/credential/token/token1\n" - lang: Python source: "resp = client.security.create_service_token(\n namespace=\"elastic\",\n service=\"fleet-server\",\n name=\"token1\",\n)" - lang: JavaScript source: "const response = await client.security.createServiceToken({\n namespace: \"elastic\",\n service: \"fleet-server\",\n name: \"token1\",\n});" - lang: Ruby source: "response = client.security.create_service_token(\n namespace: \"elastic\",\n service: \"fleet-server\",\n name: \"token1\"\n)" - lang: PHP source: "$resp = $client->security()->createServiceToken([\n \"namespace\" => \"elastic\",\n \"service\" => \"fleet-server\",\n \"name\" => \"token1\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/service/elastic/fleet-server/credential/token/token1"' - lang: C# source: "var response = await client.Security\n .CreateServiceTokenAsync(new CreateServiceTokenRequest()\n {\n Name = \"token1\",\n Namespace = \"elastic\",\n Service = \"fleet-server\"\n });" - lang: Java source: "client.security().createServiceToken(c -> c\n .name(\"token1\")\n .namespace(\"elastic\")\n .service(\"fleet-server\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - security summary: Delete service account tokens description: "Delete service account tokens for a service in a specified namespace.\nThis route serves both kinds of service account, but the privileges differ: `manage_service_account` authorizes tokens of built-in accounts in the `elastic` namespace only, and tokens of a user-managed account require `manage_security`.\n\nIMPORTANT: On Serverless, non-operator users can delete tokens for only `elastic/fleet-server` and `elastic/fleet-server-remote`.\nDeleting tokens for any other service account requires operator privileges.\n\n## Required authorization\n\n* Cluster privileges: `manage_service_account`\n" externalDocs: description: More about service accounts url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/service-accounts x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-delete-service-token.html operationId: security-delete-service-token parameters: - name: namespace in: path description: 'The namespace, which is a top-level grouping of service accounts.' required: true schema: $ref: '#/components/schemas/_types.Namespace' - name: service in: path description: The service name. required: true schema: $ref: '#/components/schemas/_types.Service' - name: name in: path description: The name of the service account token. required: true schema: $ref: '#/components/schemas/_types.Name' - name: refresh in: query description: 'If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.' schema: $ref: '#/components/schemas/_types.Refresh' responses: '200': description: '' content: application/json: schema: required: - found type: object properties: found: type: boolean description: "If the service account token is successfully deleted, the request returns `{\"found\": true}`.\nOtherwise, the response will have status code 404 and `found` is set to `false`." examples: DeleteServiceTokenResponseExample1: description: "A successful response from `DELETE /_security/service/elastic/fleet-server/credential/token/token42`.\n" value: "{\n \"found\" : true\n}" x-state: Generally available; Added in 5.5.0 x-codeSamples: - lang: Console source: "DELETE /_security/service/elastic/fleet-server/credential/token/token42\n" - lang: Python source: "resp = client.security.delete_service_token(\n namespace=\"elastic\",\n service=\"fleet-server\",\n name=\"token42\",\n)" - lang: JavaScript source: "const response = await client.security.deleteServiceToken({\n namespace: \"elastic\",\n service: \"fleet-server\",\n name: \"token42\",\n});" - lang: Ruby source: "response = client.security.delete_service_token(\n namespace: \"elastic\",\n service: \"fleet-server\",\n name: \"token42\"\n)" - lang: PHP source: "$resp = $client->security()->deleteServiceToken([\n \"namespace\" => \"elastic\",\n \"service\" => \"fleet-server\",\n \"name\" => \"token42\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/service/elastic/fleet-server/credential/token/token42"' - lang: C# source: 'var response = await client.Security.DeleteServiceTokenAsync(@namespace: "elastic", service: "fleet-server", name: "token42");' - lang: Java source: "client.security().deleteServiceToken(d -> d\n .name(\"token42\")\n .namespace(\"elastic\")\n .service(\"fleet-server\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/delegate_pki: post: tags: - security summary: Delegate PKI authentication description: "This API implements the exchange of an X509Certificate chain for an Elasticsearch access token.\nThe certificate chain is validated, according to RFC 5280, by sequentially considering the trust configuration of every installed PKI realm that has `delegation.enabled` set to `true`.\nA successfully trusted client certificate is also subject to the validation of the subject distinguished name according to thw `username_pattern` of the respective realm.\n\nThis API is called by smart and trusted proxies, such as Kibana, which terminate the user's TLS session but still want to authenticate the user by using a PKI realm—-​as if the user connected directly to Elasticsearch.\n\nIMPORTANT: The association between the subject public key in the target certificate and the corresponding private key is not validated.\nThis is part of the TLS authentication process and it is delegated to the proxy that calls this API.\nThe proxy is trusted to have performed the TLS authentication and this API translates that authentication into an Elasticsearch access token.\n\n## Required authorization\n\n* Cluster privileges: `all`\n" externalDocs: description: Learn more about pki url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/pki x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-delegate-pki-authentication.html operationId: security-delegate-pki requestBody: content: application/json: schema: required: - x509_certificate_chain type: object properties: x509_certificate_chain: type: array items: type: string description: "The X509Certificate chain, which is represented as an ordered string array.\nEach string in the array is a base64-encoded (Section 4 of RFC4648 - not base64url-encoded) of the certificate's DER encoding.\n\nThe first element is the target certificate that contains the subject distinguished name that is requesting access.\nThis may be followed by additional certificates; each subsequent certificate is used to certify the previous one." examples: SecurityDelegatePkiRequestExample1: description: Delegate a one element certificate chain. value: "{\n\"x509_certificate_chain\": [\"MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==\"]\n}" x-codeSamples: - lang: Console source: "POST /_security/delegate_pki\n{\n\"x509_certificate_chain\": [\"MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==\"]\n}" - lang: Python source: "resp = client.security.delegate_pki(\n x509_certificate_chain=[\n \"MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==\"\n ],\n)" - lang: JavaScript source: "const response = await client.security.delegatePki({\n x509_certificate_chain: [\n \"MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==\",\n ],\n});" - lang: Ruby source: "response = client.security.delegate_pki(\n body: {\n \"x509_certificate_chain\": [\n \"MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==\"\n ]\n }\n)" - lang: PHP source: "$requestFactory = Psr17FactoryDiscovery::findRequestFactory();\n$streamFactory = Psr17FactoryDiscovery::findStreamFactory();\n$request = $requestFactory->createRequest(\n \"POST\",\n \"/_security/delegate_pki\",\n);\n$request = $request->withHeader(\"Content-Type\", \"application/json\");\n$request = $request->withBody($streamFactory->createStream(\n json_encode([\n \"x509_certificate_chain\" => array(\n \"MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==\",\n ),\n ]),\n));\n$resp = $client->sendRequest($request);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"x509_certificate_chain":["MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g=="]}'' "$ELASTICSEARCH_URL/_security/delegate_pki"' - lang: C# source: "var response = await client.Security\n .DelegatePkiAsync(d1 => d1\n .X509CertificateChain(\"MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==\")\n );" - lang: Java source: "client.security().delegatePki(d -> d\n .x509CertificateChain(\"MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - access_token - expires_in - type type: object properties: access_token: type: string description: An access token associated with the subject distinguished name of the client's certificate. expires_in: type: number description: The amount of time (in seconds) before the token expires. type: type: string description: The type of token. authentication: allOf: - $ref: '#/components/schemas/security.delegate_pki.Authentication' examples: SecurityDelegatePkiResponseExample1: description: A successful response from delegating a one element certificate chain. value: "{\n \"access_token\": \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n \"type\": \"Bearer\",\n \"expires_in\": 1200,\n \"authentication\": {\n \"username\": \"Elasticsearch Test Client\",\n \"roles\": [],\n \"full_name\": null,\n \"email\": null,\n \"metadata\": {\n \"pki_dn\": \"O=org, OU=Elasticsearch, CN=Elasticsearch Test Client\",\n \"pki_delegated_by_user\": \"test_admin\",\n \"pki_delegated_by_realm\": \"file\"\n },\n \"enabled\": true,\n \"authentication_realm\": {\n \"name\": \"pki1\",\n \"type\": \"pki\"\n },\n \"lookup_realm\": {\n \"name\": \"pki1\",\n \"type\": \"pki\"\n },\n \"authentication_type\": \"realm\"\n }\n}" x-state: Generally available; Added in 7.4.0 x-codeSamples: - lang: Console source: "POST /_security/delegate_pki\n{\n\"x509_certificate_chain\": [\"MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==\"]\n}" - lang: Python source: "resp = client.security.delegate_pki(\n x509_certificate_chain=[\n \"MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==\"\n ],\n)" - lang: JavaScript source: "const response = await client.security.delegatePki({\n x509_certificate_chain: [\n \"MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==\",\n ],\n});" - lang: Ruby source: "response = client.security.delegate_pki(\n body: {\n \"x509_certificate_chain\": [\n \"MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==\"\n ]\n }\n)" - lang: PHP source: "$requestFactory = Psr17FactoryDiscovery::findRequestFactory();\n$streamFactory = Psr17FactoryDiscovery::findStreamFactory();\n$request = $requestFactory->createRequest(\n \"POST\",\n \"/_security/delegate_pki\",\n);\n$request = $request->withHeader(\"Content-Type\", \"application/json\");\n$request = $request->withBody($streamFactory->createStream(\n json_encode([\n \"x509_certificate_chain\" => array(\n \"MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==\",\n ),\n ]),\n));\n$resp = $client->sendRequest($request);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"x509_certificate_chain":["MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g=="]}'' "$ELASTICSEARCH_URL/_security/delegate_pki"' - lang: C# source: "var response = await client.Security\n .DelegatePkiAsync(d1 => d1\n .X509CertificateChain(\"MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==\")\n );" - lang: Java source: "client.security().delegatePki(d -> d\n .x509CertificateChain(\"MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_security/privilege/{application}/{name}': get: tags: - security summary: "Get application privileges\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_security/privilege\n
\n
\n GET\n /_security/privilege/{application}\n
\n
\n GET\n /_security/privilege/{application}/{name}\n
\n \n\nTo use this API, you must have one of the following privileges:\n\n* The `read_security` cluster privilege (or a greater privilege such as `manage_security` or `all`).\n* The \"Manage Application Privileges\" global privilege for the application being referenced in the request.\n\n## Required authorization\n\n* Cluster privileges: `read_security`\n" externalDocs: description: About Elasticsearch privileges url: https://www.elastic.co/docs/reference/elasticsearch/security-privileges x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-get-privileges.html operationId: security-get-privileges parameters: - $ref: '#/components/parameters/security.get_privileges-application' - $ref: '#/components/parameters/security.get_privileges-name' responses: '200': $ref: '#/components/responses/security.get_privileges-200' x-state: Generally available; Added in 6.4.0 x-codeSamples: - lang: Console source: "GET /_security/privilege/myapp/read\n" - lang: Python source: "resp = client.security.get_privileges(\n application=\"myapp\",\n name=\"read\",\n)" - lang: JavaScript source: "const response = await client.security.getPrivileges({\n application: \"myapp\",\n name: \"read\",\n});" - lang: Ruby source: "response = client.security.get_privileges(\n application: \"myapp\",\n name: \"read\"\n)" - lang: PHP source: "$resp = $client->security()->getPrivileges([\n \"application\" => \"myapp\",\n \"name\" => \"read\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/privilege/myapp/read"' - lang: C# source: "var response = await client.Security\n .GetPrivilegesAsync(d1 => d1\n .Application(\"myapp\")\n .Name(new[] { \"read\" })\n );" - lang: Java source: "client.security().getPrivileges(g -> g\n .application(\"myapp\")\n .name(\"read\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - security summary: Delete application privileges description: "To use this API, you must have one of the following privileges:\n\n* The `manage_security` cluster privilege (or a greater privilege such as `all`).\n* The \"Manage Application Privileges\" global privilege for the application being referenced in the request.\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" externalDocs: description: About Elasticsearch privileges url: https://www.elastic.co/docs/reference/elasticsearch/security-privileges x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-delete-privilege.html operationId: security-delete-privileges parameters: - name: application in: path description: "The name of the application.\nApplication privileges are always associated with exactly one application." required: true schema: $ref: '#/components/schemas/_types.Name' - name: name in: path description: The name of the privilege. required: true schema: $ref: '#/components/schemas/_types.Names' - name: refresh in: query description: 'If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.' schema: $ref: '#/components/schemas/_types.Refresh' responses: '200': description: '' content: application/json: schema: type: object additionalProperties: type: object additionalProperties: $ref: '#/components/schemas/security.delete_privileges.FoundStatus' examples: SecurityDeletePrivilegesResponseExample1: description: "A successful response from `DELETE /_security/privilege/myapp/read`. If the privilege is successfully deleted, `found` is set to `true`.\n" value: "{\n \"myapp\": {\n \"read\": {\n \"found\" : true\n }\n }\n}" x-state: Generally available; Added in 6.4.0 x-codeSamples: - lang: Console source: "DELETE /_security/privilege/myapp/read\n" - lang: Python source: "resp = client.security.delete_privileges(\n application=\"myapp\",\n name=\"read\",\n)" - lang: JavaScript source: "const response = await client.security.deletePrivileges({\n application: \"myapp\",\n name: \"read\",\n});" - lang: Ruby source: "response = client.security.delete_privileges(\n application: \"myapp\",\n name: \"read\"\n)" - lang: PHP source: "$resp = $client->security()->deletePrivileges([\n \"application\" => \"myapp\",\n \"name\" => \"read\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/privilege/myapp/read"' - lang: C# source: 'var response = await client.Security.DeletePrivilegesAsync(application: "myapp", name: new[] { "read" });' - lang: Java source: "client.security().deletePrivileges(d -> d\n .application(\"myapp\")\n .name(\"read\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_security/role/{name}': get: tags: - security summary: "Get roles\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_security/role\n
\n
\n GET\n /_security/role/{name}\n
\n \n\nGet roles in the native realm.\nThe role management APIs are generally the preferred way to manage roles, rather than using file-based role management.\nThe get roles API cannot retrieve roles that are defined in roles files.\n\n## Required authorization\n\n* Cluster privileges: `read_security`\n" operationId: security-get-role parameters: - $ref: '#/components/parameters/security.get_role-name' - $ref: '#/components/parameters/security.get_role-include_implicit' responses: '200': $ref: '#/components/responses/security.get_role-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET /_security/role/my_admin_role\n" - lang: Python source: "resp = client.security.get_role(\n name=\"my_admin_role\",\n)" - lang: JavaScript source: "const response = await client.security.getRole({\n name: \"my_admin_role\",\n});" - lang: Ruby source: "response = client.security.get_role(\n name: \"my_admin_role\"\n)" - lang: PHP source: "$resp = $client->security()->getRole([\n \"name\" => \"my_admin_role\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/role/my_admin_role"' - lang: C# source: "var response = await client.Security\n .GetRoleAsync(d1 => d1\n .Name(new[] { \"my_admin_role\" })\n );" - lang: Java source: "client.security().getRole(g -> g\n .name(\"my_admin_role\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name post: tags: - security summary: "Create or update roles\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_security/role/{name}\n
\n
\n POST\n /_security/role/{name}\n
\n \n\nThe role management APIs are generally the preferred way to manage roles in the native realm, rather than using file-based role management.\nThe create or update roles API cannot update roles that are defined in roles files.\nFile-based role management is not available in Elastic Serverless.\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" externalDocs: description: More about defining roles url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/defining-roles x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-put-role.html operationId: security-put-role parameters: - $ref: '#/components/parameters/security.put_role-name' - $ref: '#/components/parameters/security.put_role-refresh' requestBody: $ref: '#/components/requestBodies/security.put_role' responses: '200': $ref: '#/components/responses/security.put_role-200' x-state: Generally available x-codeSamples: - lang: Console source: "POST /_security/role/my_admin_role\n{\n \"description\": \"Grants full access to all management features within the cluster.\",\n \"cluster\": [\"all\"],\n \"indices\": [\n {\n \"names\": [ \"index1\", \"index2\" ],\n \"privileges\": [\"all\"],\n \"field_security\" : { // optional\n \"grant\" : [ \"title\", \"body\" ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\" // optional\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [ \"admin\", \"read\" ],\n \"resources\": [ \"*\" ]\n }\n ],\n \"run_as\": [ \"other_user\" ], // optional\n \"metadata\" : { // optional\n \"version\" : 1\n }\n}" - lang: Python source: "resp = client.security.put_role(\n name=\"my_admin_role\",\n description=\"Grants full access to all management features within the cluster.\",\n cluster=[\n \"all\"\n ],\n indices=[\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\n \"all\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n applications=[\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n run_as=[\n \"other_user\"\n ],\n metadata={\n \"version\": 1\n },\n)" - lang: JavaScript source: "const response = await client.security.putRole({\n name: \"my_admin_role\",\n description:\n \"Grants full access to all management features within the cluster.\",\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index1\", \"index2\"],\n privileges: [\"all\"],\n field_security: {\n grant: [\"title\", \"body\"],\n },\n query: '{\"match\": {\"title\": \"foo\"}}',\n },\n ],\n applications: [\n {\n application: \"myapp\",\n privileges: [\"admin\", \"read\"],\n resources: [\"*\"],\n },\n ],\n run_as: [\"other_user\"],\n metadata: {\n version: 1,\n },\n});" - lang: Ruby source: "response = client.security.put_role(\n name: \"my_admin_role\",\n body: {\n \"description\": \"Grants full access to all management features within the cluster.\",\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\n \"all\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->putRole([\n \"name\" => \"my_admin_role\",\n \"body\" => [\n \"description\" => \"Grants full access to all management features within the cluster.\",\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index1\",\n \"index2\",\n ),\n \"privileges\" => array(\n \"all\",\n ),\n \"field_security\" => [\n \"grant\" => array(\n \"title\",\n \"body\",\n ),\n ],\n \"query\" => \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\",\n ],\n ),\n \"applications\" => array(\n [\n \"application\" => \"myapp\",\n \"privileges\" => array(\n \"admin\",\n \"read\",\n ),\n \"resources\" => array(\n \"*\",\n ),\n ],\n ),\n \"run_as\" => array(\n \"other_user\",\n ),\n \"metadata\" => [\n \"version\" => 1,\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"description":"Grants full access to all management features within the cluster.","cluster":["all"],"indices":[{"names":["index1","index2"],"privileges":["all"],"field_security":{"grant":["title","body"]},"query":"{\"match\": {\"title\": \"foo\"}}"}],"applications":[{"application":"myapp","privileges":["admin","read"],"resources":["*"]}],"run_as":["other_user"],"metadata":{"version":1}}'' "$ELASTICSEARCH_URL/_security/role/my_admin_role"' - lang: C# source: "var response = await client.Security\n .PutRoleAsync(name: \"my_admin_role\", d1 => d1\n .Applications(d2 => d2\n .Application(\"myapp\")\n .Privileges(\"admin\", \"read\")\n .Resources(\"*\")\n )\n .Cluster(ClusterPrivilege.All)\n .Description(\"Grants full access to all management features within the cluster.\")\n .Indices(d2 => d2\n .FieldSecurity(d3 => d3\n .Grant(x => x.Title, x => x.Body)\n )\n .Names([\"index1\", \"index2\"])\n .Privileges(IndexPrivilege.All)\n .Query(\"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\")\n )\n .Metadata(new Dictionary()\n {\n { \"version\", 1 }\n })\n .RunAs(\"other_user\")\n );" - lang: Java source: "client.security().putRole(p -> p\n .applications(a -> a\n .application(\"myapp\")\n .privileges(List.of(\"admin\",\"read\"))\n .resources(\"*\")\n )\n .cluster(\"all\")\n .description(\"Grants full access to all management features within the cluster.\")\n .indices(i -> i\n .fieldSecurity(f -> f\n .grant(List.of(\"title\",\"body\"))\n )\n .names(List.of(\"index1\",\"index2\"))\n .privileges(\"all\")\n .query(q -> q\n .match(m -> m\n .field(\"title\")\n .query(FieldValue.of(\"foo\"))\n )\n )\n )\n .metadata(\"version\", JsonData.fromJson(\"1\"))\n .name(\"my_admin_role\")\n .runAs(\"other_user\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - security summary: Delete roles description: "Delete roles in the native realm.\nThe role management APIs are generally the preferred way to manage roles, rather than using file-based role management.\nThe delete roles API cannot remove roles that are defined in roles files.\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" operationId: security-delete-role parameters: - name: name in: path description: The name of the role. required: true schema: $ref: '#/components/schemas/_types.Name' - name: refresh in: query description: 'If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.' schema: $ref: '#/components/schemas/_types.Refresh' responses: '200': description: '' content: application/json: schema: required: - found type: object properties: found: type: boolean description: "If the role is successfully deleted, `found` is `true`.\nOtherwise, `found` is `false`." examples: SecurityDeleteRoleResponseExample1: description: "A successful response from `DELETE /_security/role/my_admin_role`. If the role is successfully deleted, `found` is set to `true`.\n" value: "{\n \"found\" : true\n}" x-state: Generally available x-codeSamples: - lang: Console source: "DELETE /_security/role/my_admin_role\n" - lang: Python source: "resp = client.security.delete_role(\n name=\"my_admin_role\",\n)" - lang: JavaScript source: "const response = await client.security.deleteRole({\n name: \"my_admin_role\",\n});" - lang: Ruby source: "response = client.security.delete_role(\n name: \"my_admin_role\"\n)" - lang: PHP source: "$resp = $client->security()->deleteRole([\n \"name\" => \"my_admin_role\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/role/my_admin_role"' - lang: C# source: 'var response = await client.Security.DeleteRoleAsync(name: "my_admin_role");' - lang: Java source: "client.security().deleteRole(d -> d\n .name(\"my_admin_role\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_security/role_mapping/{name}': get: tags: - security summary: "Get role mappings\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_security/role_mapping\n
\n
\n GET\n /_security/role_mapping/{name}\n
\n \n\nRole mappings define which roles are assigned to each user.\nThe role mapping APIs are generally the preferred way to manage role mappings rather than using role mapping files.\nThe get role mappings API cannot retrieve role mappings that are defined in role mapping files.\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" externalDocs: description: About mapping users to roles url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/mapping-users-groups-to-roles x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-get-role-mapping.html operationId: security-get-role-mapping parameters: - $ref: '#/components/parameters/security.get_role_mapping-name' responses: '200': $ref: '#/components/responses/security.get_role_mapping-200' x-state: Generally available; Added in 5.5.0 x-codeSamples: - lang: Console source: "GET /_security/role_mapping/mapping1\n" - lang: Python source: "resp = client.security.get_role_mapping(\n name=\"mapping1\",\n)" - lang: JavaScript source: "const response = await client.security.getRoleMapping({\n name: \"mapping1\",\n});" - lang: Ruby source: "response = client.security.get_role_mapping(\n name: \"mapping1\"\n)" - lang: PHP source: "$resp = $client->security()->getRoleMapping([\n \"name\" => \"mapping1\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/role_mapping/mapping1"' - lang: C# source: "var response = await client.Security\n .GetRoleMappingAsync(d1 => d1\n .Name(new[] { \"mapping1\" })\n );" - lang: Java source: "client.security().getRoleMapping(g -> g\n .name(\"mapping1\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name post: tags: - security summary: "Create or update role mappings\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_security/role_mapping/{name}\n
\n
\n POST\n /_security/role_mapping/{name}\n
\n \n\nRole mappings define which roles are assigned to each user.\nEach mapping has rules that identify users and a list of roles that are granted to those users.\nThe role mapping APIs are generally the preferred way to manage role mappings rather than using role mapping files. The create or update role mappings API cannot update role mappings that are defined in role mapping files.\n\nNOTE: This API does not create roles. Rather, it maps users to existing roles.\nRoles can be created by using the create or update roles API or roles files.\n\n**Role templates**\n\nThe most common use for role mappings is to create a mapping from a known value on the user to a fixed role name.\nFor example, all users in the `cn=admin,dc=example,dc=com` LDAP group should be given the superuser role in Elasticsearch.\nThe `roles` field is used for this purpose.\n\nFor more complex needs, it is possible to use Mustache templates to dynamically determine the names of the roles that should be granted to the user.\nThe `role_templates` field is used for this purpose.\n\nNOTE: To use role templates successfully, the relevant scripting feature must be enabled.\nOtherwise, all attempts to create a role mapping with role templates fail.\n\nAll of the user fields that are available in the role mapping rules are also available in the role templates.\nThus it is possible to assign a user to a role that reflects their username, their groups, or the name of the realm to which they authenticated.\n\nBy default a template is evaluated to produce a single string that is the name of the role which should be assigned to the user.\nIf the format of the template is set to \"json\" then the template is expected to produce a JSON string or an array of JSON strings for the role names.\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" externalDocs: description: About mapping users to roles url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/mapping-users-groups-to-roles x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-put-role-mapping.html operationId: security-put-role-mapping parameters: - $ref: '#/components/parameters/security.put_role_mapping-name' - $ref: '#/components/parameters/security.put_role_mapping-refresh' requestBody: $ref: '#/components/requestBodies/security.put_role_mapping' responses: '200': $ref: '#/components/responses/security.put_role_mapping-200' x-state: Generally available; Added in 5.5.0 x-codeSamples: - lang: Console source: "POST /_security/role_mapping/mapping1\n{\n \"roles\": [ \"user\"],\n \"enabled\": true, \n \"rules\": {\n \"field\" : { \"username\" : \"*\" }\n },\n \"metadata\" : { \n \"version\" : 1\n }\n}" - lang: Python source: "resp = client.security.put_role_mapping(\n name=\"mapping1\",\n roles=[\n \"user\"\n ],\n enabled=True,\n rules={\n \"field\": {\n \"username\": \"*\"\n }\n },\n metadata={\n \"version\": 1\n },\n)" - lang: JavaScript source: "const response = await client.security.putRoleMapping({\n name: \"mapping1\",\n roles: [\"user\"],\n enabled: true,\n rules: {\n field: {\n username: \"*\",\n },\n },\n metadata: {\n version: 1,\n },\n});" - lang: Ruby source: "response = client.security.put_role_mapping(\n name: \"mapping1\",\n body: {\n \"roles\": [\n \"user\"\n ],\n \"enabled\": true,\n \"rules\": {\n \"field\": {\n \"username\": \"*\"\n }\n },\n \"metadata\": {\n \"version\": 1\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->putRoleMapping([\n \"name\" => \"mapping1\",\n \"body\" => [\n \"roles\" => array(\n \"user\",\n ),\n \"enabled\" => true,\n \"rules\" => [\n \"field\" => [\n \"username\" => \"*\",\n ],\n ],\n \"metadata\" => [\n \"version\" => 1,\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"roles":["user"],"enabled":true,"rules":{"field":{"username":"*"}},"metadata":{"version":1}}'' "$ELASTICSEARCH_URL/_security/role_mapping/mapping1"' - lang: C# source: "var response = await client.Security\n .PutRoleMappingAsync(name: \"mapping1\", d1 => d1\n .Enabled(true)\n .Metadata(new Dictionary()\n {\n { \"version\", 1 }\n })\n .Roles(\"user\")\n .Rules(d2 => d2\n .Field(new KeyValuePair>(global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.Username), [\"*\"]))\n )\n );" - lang: Java source: "client.security().putRoleMapping(p -> p\n .enabled(true)\n .metadata(\"version\", JsonData.fromJson(\"1\"))\n .name(\"mapping1\")\n .roles(\"user\")\n .rules(r -> r\n .field(NamedValue.of(\"username\",List.of(FieldValue.of(\"*\"))))\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - security summary: Delete role mappings description: "Role mappings define which roles are assigned to each user.\nThe role mapping APIs are generally the preferred way to manage role mappings rather than using role mapping files.\nThe delete role mappings API cannot remove role mappings that are defined in role mapping files.\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" externalDocs: description: About mapping users to roles url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/mapping-users-groups-to-roles x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-delete-role-mapping.html operationId: security-delete-role-mapping parameters: - name: name in: path description: "The distinct name that identifies the role mapping.\nThe name is used solely as an identifier to facilitate interaction via the API; it does not affect the behavior of the mapping in any way." required: true schema: $ref: '#/components/schemas/_types.Name' - name: refresh in: query description: 'If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.' schema: $ref: '#/components/schemas/_types.Refresh' responses: '200': description: '' content: application/json: schema: required: - found type: object properties: found: type: boolean description: "If the mapping is successfully deleted, `found` is `true`.\nOtherwise, `found` is `false`." examples: SecurityDeleteRoleMappingResponseExample1: description: "A successful response from `DELETE /_security/role_mapping/mapping1`. If the mapping is successfully deleted, `found` is `true`.\n" value: "{\n \"found\" : true\n}" x-state: Generally available; Added in 5.5.0 x-codeSamples: - lang: Console source: "DELETE /_security/role_mapping/mapping1\n" - lang: Python source: "resp = client.security.delete_role_mapping(\n name=\"mapping1\",\n)" - lang: JavaScript source: "const response = await client.security.deleteRoleMapping({\n name: \"mapping1\",\n});" - lang: Ruby source: "response = client.security.delete_role_mapping(\n name: \"mapping1\"\n)" - lang: PHP source: "$resp = $client->security()->deleteRoleMapping([\n \"name\" => \"mapping1\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/role_mapping/mapping1"' - lang: C# source: 'var response = await client.Security.DeleteRoleMappingAsync(name: "mapping1");' - lang: Java source: "client.security().deleteRoleMapping(d -> d\n .name(\"mapping1\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_security/user/{username}': get: tags: - security summary: "Get users\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_security/user\n
\n
\n GET\n /_security/user/{username}\n
\n \n\nGet information about users in the native realm and built-in users.\n\n## Required authorization\n\n* Cluster privileges: `read_security`\n" operationId: security-get-user parameters: - $ref: '#/components/parameters/security.get_user-username' - $ref: '#/components/parameters/security.get_user-with_profile_uid' responses: '200': $ref: '#/components/responses/security.get_user-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET /_security/user/jacknich?with_profile_uid=true\n" - lang: Python source: "resp = client.security.get_user(\n username=\"jacknich\",\n with_profile_uid=True,\n)" - lang: JavaScript source: "const response = await client.security.getUser({\n username: \"jacknich\",\n with_profile_uid: \"true\",\n});" - lang: Ruby source: "response = client.security.get_user(\n username: \"jacknich\",\n with_profile_uid: \"true\"\n)" - lang: PHP source: "$resp = $client->security()->getUser([\n \"username\" => \"jacknich\",\n \"with_profile_uid\" => \"true\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/user/jacknich?with_profile_uid=true"' - lang: C# source: "var response = await client.Security\n .GetUserAsync(d1 => d1\n .Username([\"jacknich\"])\n .WithProfileUid(true)\n );" - lang: Java source: "client.security().getUser(g -> g\n .username(\"jacknich\")\n .withProfileUid(true)\n);\n" x-metaTags: - content: Elasticsearch name: product_name post: tags: - security summary: "Create or update users\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_security/user/{username}\n
\n
\n POST\n /_security/user/{username}\n
\n \n\nAdd and update users in the native realm.\nA password is required for adding a new user but is optional when updating an existing user.\nTo change a user's password without updating any other fields, use the change password API.\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" operationId: security-put-user parameters: - $ref: '#/components/parameters/security.put_user-username' - $ref: '#/components/parameters/security.put_user-refresh' requestBody: $ref: '#/components/requestBodies/security.put_user' responses: '200': $ref: '#/components/responses/security.put_user-200' x-state: Generally available x-codeSamples: - lang: Console source: "POST /_security/user/jacknich\n{\n \"password\" : \"l0ng-r4nd0m-p@ssw0rd\",\n \"roles\" : [ \"admin\", \"other_role1\" ],\n \"full_name\" : \"Jack Nicholson\",\n \"email\" : \"jacknich@example.com\",\n \"metadata\" : {\n \"intelligence\" : 7\n }\n}" - lang: Python source: "resp = client.security.put_user(\n username=\"jacknich\",\n password=\"l0ng-r4nd0m-p@ssw0rd\",\n roles=[\n \"admin\",\n \"other_role1\"\n ],\n full_name=\"Jack Nicholson\",\n email=\"jacknich@example.com\",\n metadata={\n \"intelligence\": 7\n },\n)" - lang: JavaScript source: "const response = await client.security.putUser({\n username: \"jacknich\",\n password: \"l0ng-r4nd0m-p@ssw0rd\",\n roles: [\"admin\", \"other_role1\"],\n full_name: \"Jack Nicholson\",\n email: \"jacknich@example.com\",\n metadata: {\n intelligence: 7,\n },\n});" - lang: Ruby source: "response = client.security.put_user(\n username: \"jacknich\",\n body: {\n \"password\": \"l0ng-r4nd0m-p@ssw0rd\",\n \"roles\": [\n \"admin\",\n \"other_role1\"\n ],\n \"full_name\": \"Jack Nicholson\",\n \"email\": \"jacknich@example.com\",\n \"metadata\": {\n \"intelligence\": 7\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->putUser([\n \"username\" => \"jacknich\",\n \"body\" => [\n \"password\" => \"l0ng-r4nd0m-p@ssw0rd\",\n \"roles\" => array(\n \"admin\",\n \"other_role1\",\n ),\n \"full_name\" => \"Jack Nicholson\",\n \"email\" => \"jacknich@example.com\",\n \"metadata\" => [\n \"intelligence\" => 7,\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"password":"l0ng-r4nd0m-p@ssw0rd","roles":["admin","other_role1"],"full_name":"Jack Nicholson","email":"jacknich@example.com","metadata":{"intelligence":7}}'' "$ELASTICSEARCH_URL/_security/user/jacknich"' - lang: C# source: "var response = await client.Security\n .PutUserAsync(username: \"jacknich\", d1 => d1\n .Email(\"jacknich@example.com\")\n .FullName(\"Jack Nicholson\")\n .Metadata(new Dictionary()\n {\n { \"intelligence\", 7 }\n })\n .Password(\"l0ng-r4nd0m-p@ssw0rd\")\n .Roles(\"admin\", \"other_role1\")\n );" - lang: Java source: "client.security().putUser(p -> p\n .email(\"jacknich@example.com\")\n .fullName(\"Jack Nicholson\")\n .metadata(\"intelligence\", JsonData.fromJson(\"7\"))\n .password(\"l0ng-r4nd0m-p@ssw0rd\")\n .roles(List.of(\"admin\",\"other_role1\"))\n .username(\"jacknich\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - security summary: Delete users description: "Delete users from the native realm.\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" operationId: security-delete-user parameters: - name: username in: path description: An identifier for the user. required: true schema: $ref: '#/components/schemas/_types.Username' - name: refresh in: query description: 'If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.' schema: $ref: '#/components/schemas/_types.Refresh' responses: '200': description: '' content: application/json: schema: required: - found type: object properties: found: type: boolean description: "If the user is successfully deleted, the request returns `{\"found\": true}`.\nOtherwise, `found` is set to `false`." examples: SecurityDeleteUserResponseExample1: description: "A successful response from `DELETE /_security/user/jacknich`.\n" value: "{\n \"found\" : true\n}" x-state: Generally available x-codeSamples: - lang: Console source: "DELETE /_security/user/jacknich\n" - lang: Python source: "resp = client.security.delete_user(\n username=\"jacknich\",\n)" - lang: JavaScript source: "const response = await client.security.deleteUser({\n username: \"jacknich\",\n});" - lang: Ruby source: "response = client.security.delete_user(\n username: \"jacknich\"\n)" - lang: PHP source: "$resp = $client->security()->deleteUser([\n \"username\" => \"jacknich\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/user/jacknich"' - lang: C# source: 'var response = await client.Security.DeleteUserAsync(username: "jacknich");' - lang: Java source: "client.security().deleteUser(d -> d\n .username(\"jacknich\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_security/service/{namespace}/{service}': get: tags: - security summary: "Get service accounts\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_security/service\n
\n
\n GET\n /_security/service/{namespace}\n
\n
\n GET\n /_security/service/{namespace}/{service}\n
\n \n\nGet a list of service accounts that match the provided path parameters.\nBuilt-in service accounts ship with Elasticsearch in the `elastic` namespace; user-managed service accounts are created with the put user-managed service account API.\n\nNOTE: When `type` is omitted, a request without a namespace reports built-in accounts only, which preserves the response of a whole-cluster listing.\nA request scoped to a namespace reports both kinds, so an account you created is found without naming its kind.\n\n## Required authorization\n\n* Cluster privileges: `manage_service_account`\n" externalDocs: description: More about service accounts url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/service-accounts x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-get-service-accounts.html operationId: security-get-service-accounts parameters: - $ref: '#/components/parameters/security.get_service_accounts-namespace' - $ref: '#/components/parameters/security.get_service_accounts-service' - $ref: '#/components/parameters/security.get_service_accounts-type' - $ref: '#/components/parameters/security.get_service_accounts-with_profile_uid' responses: '200': $ref: '#/components/responses/security.get_service_accounts-200' x-state: Generally available; Added in 7.13.0 x-codeSamples: - lang: Console source: "GET /_security/service/elastic/fleet-server\n" - lang: Python source: "resp = client.security.get_service_accounts(\n namespace=\"elastic\",\n service=\"fleet-server\",\n)" - lang: JavaScript source: "const response = await client.security.getServiceAccounts({\n namespace: \"elastic\",\n service: \"fleet-server\",\n});" - lang: Ruby source: "response = client.security.get_service_accounts(\n namespace: \"elastic\",\n service: \"fleet-server\"\n)" - lang: PHP source: "$resp = $client->security()->getServiceAccounts([\n \"namespace\" => \"elastic\",\n \"service\" => \"fleet-server\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/service/elastic/fleet-server"' - lang: C# source: "var response = await client.Security\n .GetServiceAccountsAsync(d1 => d1\n .Namespace(\"elastic\")\n .Service(\"fleet-server\")\n );" - lang: Java source: "client.security().getServiceAccounts(g -> g\n .namespace(\"elastic\")\n .service(\"fleet-server\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - security summary: Create user-managed service accounts description: "Create a service account in a namespace of your own, or replace one that already exists.\nA replacement is not a partial update: every write applies the defaults, so an account that was disabled and is then written again without `enabled` comes back enabled.\n\nCreating an account whose name still has leftover service tokens is rejected.\nDelete those tokens first.\n\nNOTE: The `elastic` namespace is reserved for the built-in service accounts that ship with Elasticsearch.\nThe `manage_service_account` privilege does not authorize this API.\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" externalDocs: description: More about service accounts url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/service-accounts operationId: security-put-user-managed-service-account parameters: - name: namespace in: path description: "The namespace, which is a top-level grouping of service accounts.\nIt must start with a letter or digit and can contain only letters, digits, hyphens, and underscores, up to a maximum of 128 characters.\nIt cannot be `elastic`, which is reserved for built-in service accounts." required: true schema: $ref: '#/components/schemas/_types.Namespace' - name: service in: path description: "The service name.\nIt must start with a letter or digit and can contain only letters, digits, hyphens, and underscores, up to a maximum of 128 characters." required: true schema: $ref: '#/components/schemas/_types.Service' - name: refresh in: query description: 'If `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `true` then refresh the affected shards to make this operation visible to search, if `false` then do nothing with refreshes.' schema: allOf: - $ref: '#/components/schemas/_types.Refresh' default: wait_for requestBody: content: application/json: schema: required: - roles type: object properties: roles: type: array items: type: string description: "The names of the roles to grant to the service account, up to a maximum of 1000.\nThe roles are resolved when the account authenticates, so they do not have to exist yet." enabled: type: boolean description: "Whether the account can authenticate.\nTokens can still be created for a disabled account; they just cannot be used until the account is enabled." default: true description: type: string description: "A free-text description of the account, as sent on the last PUT of the account.\nIt has no meaning to Elasticsearch. Absent when the account has no description." examples: PutUserManagedServiceAccountRequestExample1: summary: Create a user-managed service account description: "Run `PUT /_security/service/my-namespace/my-service` to create a service account that is granted the `my_role` role and can authenticate.\n" value: "{\n \"roles\": [\n \"my_role\"\n ],\n \"enabled\": true\n}" x-codeSamples: - lang: Console source: "PUT /_security/service/my-namespace/my-service\n{\n \"roles\": [\n \"my_role\"\n ],\n \"enabled\": true\n}" - lang: Python source: "resp = client.security.put_user_managed_service_account(\n namespace=\"my-namespace\",\n service=\"my-service\",\n roles=[\n \"my_role\"\n ],\n enabled=True,\n)" - lang: JavaScript source: "const response = await client.security.putUserManagedServiceAccount({\n namespace: \"my-namespace\",\n service: \"my-service\",\n roles: [\"my_role\"],\n enabled: true,\n});" - lang: Ruby source: "response = client.security.put_user_managed_service_account(\n namespace: \"my-namespace\",\n service: \"my-service\",\n body: {\n \"roles\": [\n \"my_role\"\n ],\n \"enabled\": true\n }\n)" - lang: PHP source: "$resp = $client->security()->putUserManagedServiceAccount([\n \"namespace\" => \"my-namespace\",\n \"service\" => \"my-service\",\n \"body\" => [\n \"roles\" => array(\n \"my_role\",\n ),\n \"enabled\" => true,\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"roles":["my_role"],"enabled":true}'' "$ELASTICSEARCH_URL/_security/service/my-namespace/my-service"' - lang: C# source: "var response = await client.Security\n .PutUserManagedServiceAccountAsync(@namespace: \"my-namespace\", service: \"my-service\", d1 => d1\n .Enabled(true)\n .Roles(\"my_role\")\n );" required: true responses: '200': description: '' content: application/json: schema: required: - created type: object properties: created: type: boolean description: "A successful call returns a JSON structure that shows whether the service account has been created or updated.\nWhen an existing service account is replaced, `created` is set to `false`." examples: PutUserManagedServiceAccountResponseExample1: description: "A successful response from `PUT /_security/service/my-namespace/my-service`.\n" value: "{\n \"created\": true\n}" x-state: Generally available; Added in 9.6.0 x-codeSamples: - lang: Console source: "PUT /_security/service/my-namespace/my-service\n{\n \"roles\": [\n \"my_role\"\n ],\n \"enabled\": true\n}" - lang: Python source: "resp = client.security.put_user_managed_service_account(\n namespace=\"my-namespace\",\n service=\"my-service\",\n roles=[\n \"my_role\"\n ],\n enabled=True,\n)" - lang: JavaScript source: "const response = await client.security.putUserManagedServiceAccount({\n namespace: \"my-namespace\",\n service: \"my-service\",\n roles: [\"my_role\"],\n enabled: true,\n});" - lang: Ruby source: "response = client.security.put_user_managed_service_account(\n namespace: \"my-namespace\",\n service: \"my-service\",\n body: {\n \"roles\": [\n \"my_role\"\n ],\n \"enabled\": true\n }\n)" - lang: PHP source: "$resp = $client->security()->putUserManagedServiceAccount([\n \"namespace\" => \"my-namespace\",\n \"service\" => \"my-service\",\n \"body\" => [\n \"roles\" => array(\n \"my_role\",\n ),\n \"enabled\" => true,\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"roles":["my_role"],"enabled":true}'' "$ELASTICSEARCH_URL/_security/service/my-namespace/my-service"' - lang: C# source: "var response = await client.Security\n .PutUserManagedServiceAccountAsync(@namespace: \"my-namespace\", service: \"my-service\", d1 => d1\n .Enabled(true)\n .Roles(\"my_role\")\n );" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - security summary: Delete user-managed service accounts description: "Delete a service account from a namespace of your own.\n\nDeleting an account that still has service tokens is rejected unless `force` is `true`.\nA forced delete leaves the tokens behind: they cannot authenticate while no account of that name exists, and recreating the account is rejected until they are deleted.\n\nNOTE: The `elastic` namespace is reserved for the built-in service accounts that ship with Elasticsearch.\nA name that no user-managed service account could have is rejected rather than reported as not found.\nThe `manage_service_account` privilege does not authorize this API.\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" externalDocs: description: More about service accounts url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/service-accounts operationId: security-delete-user-managed-service-account parameters: - name: namespace in: path description: "The namespace, which is a top-level grouping of service accounts.\nIt must start with a letter or digit and can contain only letters, digits, hyphens, and underscores, up to a maximum of 128 characters.\nIt cannot be `elastic`, which is reserved for built-in service accounts." required: true schema: $ref: '#/components/schemas/_types.Namespace' - name: service in: path description: "The service name.\nIt must start with a letter or digit and can contain only letters, digits, hyphens, and underscores, up to a maximum of 128 characters." required: true schema: $ref: '#/components/schemas/_types.Service' - name: refresh in: query description: 'If `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `true` then refresh the affected shards to make this operation visible to search, if `false` then do nothing with refreshes.' schema: allOf: - $ref: '#/components/schemas/_types.Refresh' default: wait_for - name: force in: query description: "If `false` (the default), deleting a service account that still has service tokens is rejected.\nIf `true`, the account is deleted and its tokens are left in place." schema: type: boolean default: false responses: '200': description: '' content: application/json: schema: required: - found type: object properties: found: type: boolean description: "If the service account is successfully deleted, the request returns `{\"found\": true}`.\nOtherwise, the response will have status code 404 and `found` is set to `false`." examples: DeleteUserManagedServiceAccountResponseExample1: description: "A successful response from `DELETE /_security/service/my-namespace/my-service`.\n" value: "{\n \"found\": true\n}" x-state: Generally available; Added in 9.6.0 x-codeSamples: - lang: Console source: "DELETE /_security/service/my-namespace/my-service\n" - lang: Python source: "resp = client.security.delete_user_managed_service_account(\n namespace=\"my-namespace\",\n service=\"my-service\",\n)" - lang: JavaScript source: "const response = await client.security.deleteUserManagedServiceAccount({\n namespace: \"my-namespace\",\n service: \"my-service\",\n});" - lang: Ruby source: "response = client.security.delete_user_managed_service_account(\n namespace: \"my-namespace\",\n service: \"my-service\"\n)" - lang: PHP source: "$resp = $client->security()->deleteUserManagedServiceAccount([\n \"namespace\" => \"my-namespace\",\n \"service\" => \"my-service\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/service/my-namespace/my-service"' - lang: C# source: 'var response = await client.Security.DeleteUserManagedServiceAccountAsync(@namespace: "my-namespace", service: "my-service");' x-metaTags: - content: Elasticsearch name: product_name '/_security/user/{username}/_disable': post: tags: - security summary: "Disable users\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_security/user/{username}/_disable\n
\n
\n POST\n /_security/user/{username}/_disable\n
\n \n\nDisable users in the native realm.\nBy default, when you create users, they are enabled.\nYou can use this API to revoke a user's access to Elasticsearch.\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" operationId: security-disable-user parameters: - $ref: '#/components/parameters/security.disable_user-username' - $ref: '#/components/parameters/security.disable_user-refresh' responses: '200': $ref: '#/components/responses/security.disable_user-200' x-state: Generally available x-codeSamples: - lang: Console source: "PUT /_security/user/jacknich/_disable\n" - lang: Python source: "resp = client.security.disable_user(\n username=\"jacknich\",\n)" - lang: JavaScript source: "const response = await client.security.disableUser({\n username: \"jacknich\",\n});" - lang: Ruby source: "response = client.security.disable_user(\n username: \"jacknich\"\n)" - lang: PHP source: "$resp = $client->security()->disableUser([\n \"username\" => \"jacknich\",\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/user/jacknich/_disable"' - lang: C# source: 'var response = await client.Security.DisableUserAsync(username: "jacknich");' - lang: Java source: "client.security().disableUser(d -> d\n .username(\"jacknich\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_security/profile/{uid}/_disable': post: tags: - security summary: "Disable a user profile\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_security/profile/{uid}/_disable\n
\n
\n POST\n /_security/profile/{uid}/_disable\n
\n \n\nDisable user profiles so that they are not visible in user profile searches.\n\nNOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions.\nIndividual users and external applications should not call this API directly.\nElastic reserves the right to change or remove this feature in future releases without prior notice.\n\nWhen you activate a user profile, its automatically enabled and visible in user profile searches. You can use the disable user profile API to disable a user profile so it’s not visible in these searches.\nTo re-enable a disabled user profile, use the enable user profile API .\n\n## Required authorization\n\n* Cluster privileges: `manage_user_profile`\n" operationId: security-disable-user-profile parameters: - $ref: '#/components/parameters/security.disable_user_profile-uid' - $ref: '#/components/parameters/security.disable_user_profile-refresh' responses: '200': $ref: '#/components/responses/security.disable_user_profile-200' x-state: Generally available; Added in 8.2.0 x-codeSamples: - lang: Console source: "POST /_security/profile/u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0/_disable\n" - lang: Python source: "resp = client.security.disable_user_profile(\n uid=\"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n)" - lang: JavaScript source: "const response = await client.security.disableUserProfile({\n uid: \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n});" - lang: Ruby source: "response = client.security.disable_user_profile(\n uid: \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\"\n)" - lang: PHP source: "$resp = $client->security()->disableUserProfile([\n \"uid\" => \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/profile/u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0/_disable"' - lang: C# source: 'var response = await client.Security.DisableUserProfileAsync(uid: "u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0");' - lang: Java source: "client.security().disableUserProfile(d -> d\n .uid(\"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_security/user/{username}/_enable': post: tags: - security summary: "Enable users\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_security/user/{username}/_enable\n
\n
\n POST\n /_security/user/{username}/_enable\n
\n \n\nEnable users in the native realm.\nBy default, when you create users, they are enabled.\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" operationId: security-enable-user parameters: - $ref: '#/components/parameters/security.enable_user-username' - $ref: '#/components/parameters/security.enable_user-refresh' responses: '200': $ref: '#/components/responses/security.enable_user-200' x-state: Generally available x-codeSamples: - lang: Console source: "PUT _security/user/logstash_system/_enable\n" - lang: Python source: "resp = client.security.enable_user(\n username=\"logstash_system\",\n)" - lang: JavaScript source: "const response = await client.security.enableUser({\n username: \"logstash_system\",\n});" - lang: Ruby source: "response = client.security.enable_user(\n username: \"logstash_system\"\n)" - lang: PHP source: "$resp = $client->security()->enableUser([\n \"username\" => \"logstash_system\",\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/user/logstash_system/_enable"' - lang: C# source: 'var response = await client.Security.EnableUserAsync(username: "logstash_system");' - lang: Java source: "client.security().enableUser(e -> e\n .username(\"logstash_system\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_security/profile/{uid}/_enable': post: tags: - security summary: "Enable a user profile\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_security/profile/{uid}/_enable\n
\n
\n POST\n /_security/profile/{uid}/_enable\n
\n \n\nEnable user profiles to make them visible in user profile searches.\n\nNOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions.\nIndividual users and external applications should not call this API directly.\nElastic reserves the right to change or remove this feature in future releases without prior notice.\n\nWhen you activate a user profile, it's automatically enabled and visible in user profile searches.\nIf you later disable the user profile, you can use the enable user profile API to make the profile visible in these searches again.\n\n## Required authorization\n\n* Cluster privileges: `manage_user_profile`\n" operationId: security-enable-user-profile parameters: - $ref: '#/components/parameters/security.enable_user_profile-uid' - $ref: '#/components/parameters/security.enable_user_profile-refresh' responses: '200': $ref: '#/components/responses/security.enable_user_profile-200' x-state: Generally available; Added in 8.2.0 x-codeSamples: - lang: Console source: "POST /_security/profile/u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0/_enable\n" - lang: Python source: "resp = client.security.enable_user_profile(\n uid=\"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n)" - lang: JavaScript source: "const response = await client.security.enableUserProfile({\n uid: \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n});" - lang: Ruby source: "response = client.security.enable_user_profile(\n uid: \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\"\n)" - lang: PHP source: "$resp = $client->security()->enableUserProfile([\n \"uid\" => \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/profile/u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0/_enable"' - lang: C# source: 'var response = await client.Security.EnableUserProfileAsync(uid: "u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0");' - lang: Java source: "client.security().enableUserProfile(e -> e\n .uid(\"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/enroll/kibana: get: tags: - security summary: Enroll Kibana description: "Enable a Kibana instance to configure itself for communication with a secured Elasticsearch cluster.\n\nNOTE: This API is currently intended for internal use only by Kibana.\nKibana uses this API internally to configure itself for communications with an Elasticsearch cluster that already has security features enabled." operationId: security-enroll-kibana responses: '200': description: '' content: application/json: schema: required: - token - http_ca type: object properties: token: allOf: - $ref: '#/components/schemas/security.enroll_kibana.Token' http_ca: type: string description: "The CA certificate used to sign the node certificates that Elasticsearch uses for TLS on the HTTP layer.\nThe certificate is returned as a Base64 encoded string of the ASN.1 DER encoding of the certificate." examples: EnrollKibanaResponseExample1: description: A successful response from `GET /_security/enroll/kibana`. value: "{\n \"token\" : {\n \"name\" : \"enroll-process-token-1629123923000\", \n \"value\": \"AAEAAWVsYXN0aWM...vZmxlZXQtc2VydmVyL3Rva2VuMTo3TFdaSDZ\" \n },\n \"http_ca\" : \"MIIJlAIBAzVoGCSqGSIb3...vsDfsA3UZBAjEPfhubpQysAICAA=\", \n}" x-state: Generally available; Added in 8.0.0 x-codeSamples: - lang: Console source: "GET /_security/enroll/kibana\n" - lang: Python source: resp = client.security.enroll_kibana() - lang: JavaScript source: const response = await client.security.enrollKibana(); - lang: Ruby source: response = client.security.enroll_kibana - lang: PHP source: $resp = $client->security()->enrollKibana(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/enroll/kibana"' - lang: C# source: var response = await client.Security.EnrollKibanaAsync(); - lang: Java source: "client.security().enrollKibana();\n" x-metaTags: - content: Elasticsearch name: product_name /_security/enroll/node: get: tags: - security summary: Enroll a node description: "Enroll a new node to allow it to join an existing cluster with security features enabled.\n\nThe response contains all the necessary information for the joining node to bootstrap discovery and security related settings so that it can successfully join the cluster.\nThe response contains key and certificate material that allows the caller to generate valid signed certificates for the HTTP layer of all nodes in the cluster." operationId: security-enroll-node responses: '200': description: '' content: application/json: schema: required: - http_ca_key - http_ca_cert - transport_ca_cert - transport_key - transport_cert - nodes_addresses type: object properties: http_ca_key: type: string description: 'The CA private key that can be used by the new node in order to sign its certificate for the HTTP layer, as a Base64 encoded string of the ASN.1 DER encoding of the key.' http_ca_cert: type: string description: 'The CA certificate that can be used by the new node in order to sign its certificate for the HTTP layer, as a Base64 encoded string of the ASN.1 DER encoding of the certificate.' transport_ca_cert: type: string description: 'The CA certificate that is used to sign the TLS certificate for the transport layer, as a Base64 encoded string of the ASN.1 DER encoding of the certificate.' transport_key: type: string description: 'The private key that the node can use for TLS for its transport layer, as a Base64 encoded string of the ASN.1 DER encoding of the key.' transport_cert: type: string description: 'The certificate that the node can use for TLS for its transport layer, as a Base64 encoded string of the ASN.1 DER encoding of the certificate.' nodes_addresses: type: array items: type: string description: A list of transport addresses in the form of `host:port` for the nodes that are already members of the cluster. examples: EnrollNodeResponseExample1: description: A successful response from `PGET /security/enroll/node`. value: "{\n \"http_ca_key\" : \"MIIJlAIBAzCCCVoGCSqGSIb3DQEHAaCCCUsEgglHMIIJQzCCA98GCSqGSIb3DQ....vsDfsA3UZBAjEPfhubpQysAICCAA=\", \n \"http_ca_cert\" : \"MIIJlAIBAzCCCVoGCSqGSIb3DQEHAaCCCUsEgglHMIIJQzCCA98GCSqGSIb3DQ....vsDfsA3UZBAjEPfhubpQysAICCAA=\", \n \"transport_ca_cert\" : \"MIIJlAIBAzCCCVoGCSqGSIb3DQEHAaCCCUsEgglHMIIJQzCCA98GCSqG....vsDfsA3UZBAjEPfhubpQysAICCAA=\", \n \"transport_key\" : \"MIIEJgIBAzCCA98GCSqGSIb3DQEHAaCCA9AEggPMMIIDyDCCA8QGCSqGSIb3....YuEiOXvqZ6jxuVSQ0CAwGGoA==\", \n \"transport_cert\" : \"MIIEJgIBAzCCA98GCSqGSIb3DQEHAaCCA9AEggPMMIIDyDCCA8QGCSqGSIb3....YuEiOXvqZ6jxuVSQ0CAwGGoA==\", \n \"nodes_addresses\" : [ \n \"192.168.1.2:9300\"\n ]\n}" x-state: Generally available; Added in 8.0.0 x-metaTags: - content: Elasticsearch name: product_name /_security/privilege/_builtin: get: tags: - security summary: Get builtin privileges description: "Get the list of cluster privileges and index privileges that are available in this version of Elasticsearch.\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" externalDocs: description: About Elasticsearch privileges url: https://www.elastic.co/docs/reference/elasticsearch/security-privileges x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-get-builtin-privileges.html operationId: security-get-builtin-privileges responses: '200': description: '' content: application/json: schema: required: - cluster - index - remote_cluster type: object properties: cluster: type: array items: $ref: '#/components/schemas/security._types.ClusterPrivilege' description: The list of cluster privileges that are understood by this version of Elasticsearch. index: type: array items: $ref: '#/components/schemas/_types.IndexName' description: The list of index privileges that are understood by this version of Elasticsearch. remote_cluster: type: array items: $ref: '#/components/schemas/security._types.RemoteClusterPrivilege' description: The list of remote_cluster privileges that are understood by this version of Elasticsearch. x-state: Generally available; Added in 8.15.0 examples: SecurityGetBuiltinPrivilegesResponseExample1: description: A successful response from `GET /_security/privilege/_builtin`. value: "{\n \"cluster\" : [\n \"all\",\n \"cancel_task\",\n \"create_snapshot\",\n \"cross_cluster_replication\",\n \"cross_cluster_search\",\n \"delegate_pki\",\n \"grant_api_key\",\n \"manage\",\n \"manage_api_key\",\n \"manage_autoscaling\",\n \"manage_behavioral_analytics\",\n \"manage_ccr\",\n \"manage_connector\",\n \"manage_data_frame_transforms\",\n \"manage_data_stream_global_retention\",\n \"manage_enrich\",\n \"manage_ilm\",\n \"manage_index_templates\",\n \"manage_inference\",\n \"manage_ingest_pipelines\",\n \"manage_logstash_pipelines\",\n \"manage_ml\",\n \"manage_oidc\",\n \"manage_own_api_key\",\n \"manage_pipeline\",\n \"manage_rollup\",\n \"manage_saml\",\n \"manage_search_application\",\n \"manage_search_query_rules\",\n \"manage_search_synonyms\",\n \"manage_security\",\n \"manage_service_account\",\n \"manage_slm\",\n \"manage_token\",\n \"manage_transform\",\n \"manage_user_profile\",\n \"manage_watcher\",\n \"monitor\",\n \"monitor_connector\",\n \"monitor_data_frame_transforms\",\n \"monitor_data_stream_global_retention\",\n \"monitor_enrich\",\n \"monitor_inference\",\n \"monitor_ml\",\n \"monitor_rollup\",\n \"monitor_snapshot\",\n \"monitor_stats\",\n \"monitor_text_structure\",\n \"monitor_transform\",\n \"monitor_watcher\",\n \"none\",\n \"post_behavioral_analytics_event\",\n \"read_ccr\",\n \"read_connector_secrets\",\n \"read_fleet_secrets\",\n \"read_ilm\",\n \"read_pipeline\",\n \"read_security\",\n \"read_slm\",\n \"transport_client\",\n \"write_connector_secrets\",\n \"write_fleet_secrets\"\n ],\n \"index\" : [\n \"all\",\n \"auto_configure\",\n \"create\",\n \"create_doc\",\n \"create_index\",\n \"cross_cluster_replication\",\n \"cross_cluster_replication_internal\",\n \"delete\",\n \"delete_index\",\n \"index\",\n \"maintenance\",\n \"manage\",\n \"manage_data_stream_lifecycle\",\n \"manage_follow_index\",\n \"manage_ilm\",\n \"manage_leader_index\",\n \"monitor\",\n \"none\",\n \"read\",\n \"read_cross_cluster\",\n \"view_index_metadata\",\n \"write\"\n ],\n \"remote_cluster\" : [\n \"monitor_enrich\",\n \"monitor_stats\"\n ]\n}" x-state: Generally available; Added in 7.3.0 x-codeSamples: - lang: Console source: "GET /_security/privilege/_builtin\n" - lang: Python source: resp = client.security.get_builtin_privileges() - lang: JavaScript source: const response = await client.security.getBuiltinPrivileges(); - lang: Ruby source: response = client.security.get_builtin_privileges - lang: PHP source: $resp = $client->security()->getBuiltinPrivileges(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/privilege/_builtin"' - lang: C# source: var response = await client.Security.GetBuiltinPrivilegesAsync(); - lang: Java source: "client.security().getBuiltinPrivileges();\n" x-metaTags: - content: Elasticsearch name: product_name '/_security/service/{namespace}/{service}/credential': get: tags: - security summary: Get service account credentials description: "To use this API, you must have at least the `read_security` cluster privilege (or a greater privilege such as `manage_service_account` or `manage_security`).\n\nThe response includes service account tokens that were created with the create service account tokens API as well as file-backed tokens from all nodes of the cluster.\n\nNOTE: For tokens backed by the `service_tokens` file, the API collects them from all nodes of the cluster.\nTokens with the same name from different nodes are assumed to be the same token and are only counted once towards the total number of service tokens.\n\n## Required authorization\n\n* Cluster privileges: `read_security`\n" externalDocs: description: More about service accounts url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/service-accounts x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-get-service-credentials.html operationId: security-get-service-credentials parameters: - name: namespace in: path description: The name of the namespace. required: true schema: $ref: '#/components/schemas/_types.Namespace' - name: service in: path description: The service name. required: true schema: $ref: '#/components/schemas/_types.Name' responses: '200': description: '' content: application/json: schema: required: - service_account - count - tokens - nodes_credentials type: object properties: service_account: type: string count: type: number tokens: type: object additionalProperties: $ref: '#/components/schemas/_types.Metadata' nodes_credentials: allOf: - $ref: '#/components/schemas/security.get_service_credentials.NodesCredentials' description: Service account credentials collected from all nodes of the cluster. examples: GetServiceCredentialsResponseExample1: description: "A successful response from `GET /_security/service/elastic/fleet-server/credential`. The response contains all credentials for the `elastic/fleet-server` service account.\n" value: "{\n \"service_account\": \"elastic/fleet-server\",\n \"count\": 3,\n \"tokens\": {\n \"token1\": {}, \n \"token42\": {} \n },\n \"nodes_credentials\": { \n \"_nodes\": { \n \"total\": 3,\n \"successful\": 3,\n \"failed\": 0\n },\n \"file_tokens\": { \n \"my-token\": {\n \"nodes\": [ \"node0\", \"node1\" ] \n }\n }\n }\n}" x-state: Generally available; Added in 7.13.0 x-codeSamples: - lang: Console source: "GET /_security/service/elastic/fleet-server/credential\n" - lang: Python source: "resp = client.security.get_service_credentials(\n namespace=\"elastic\",\n service=\"fleet-server\",\n)" - lang: JavaScript source: "const response = await client.security.getServiceCredentials({\n namespace: \"elastic\",\n service: \"fleet-server\",\n});" - lang: Ruby source: "response = client.security.get_service_credentials(\n namespace: \"elastic\",\n service: \"fleet-server\"\n)" - lang: PHP source: "$resp = $client->security()->getServiceCredentials([\n \"namespace\" => \"elastic\",\n \"service\" => \"fleet-server\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/service/elastic/fleet-server/credential"' - lang: C# source: 'var response = await client.Security.GetServiceCredentialsAsync(@namespace: "elastic", service: "fleet-server");' - lang: Java source: "client.security().getServiceCredentials(g -> g\n .namespace(\"elastic\")\n .service(\"fleet-server\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/settings: get: tags: - security summary: Get security index settings description: "Get the user-configurable settings for the security internal index (`.security` and associated indices).\nOnly a subset of the index settings — those that are user-configurable—will be shown.\nThis includes:\n\n* `index.auto_expand_replicas`\n* `index.number_of_replicas`\n\n## Required authorization\n\n* Cluster privileges: `read_security`\n" operationId: security-get-settings parameters: - name: master_timeout in: query description: "Period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - security - security-profile - security-tokens type: object properties: security: allOf: - $ref: '#/components/schemas/security._types.SecuritySettings' description: 'Settings for the index used for most security configuration, including native realm users and roles configured with the API.' security-profile: allOf: - $ref: '#/components/schemas/security._types.SecuritySettings' description: Settings for the index used to store profile information. security-tokens: allOf: - $ref: '#/components/schemas/security._types.SecuritySettings' description: Settings for the index used to store tokens. x-state: Generally available x-codeSamples: - lang: Console source: "GET /_security/settings\n" - lang: Python source: resp = client.security.get_settings() - lang: JavaScript source: const response = await client.security.getSettings(); - lang: Ruby source: response = client.security.get_settings - lang: PHP source: $resp = $client->security()->getSettings(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/settings"' - lang: C# source: var response = await client.Security.GetSettingsAsync(); - lang: Java source: "client.security().getSettings(g -> g);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - security summary: Update security index settings description: "Update the user-configurable settings for the security internal index (`.security` and associated indices). Only a subset of settings are allowed to be modified. This includes `index.auto_expand_replicas` and `index.number_of_replicas`.\n\nNOTE: If `index.auto_expand_replicas` is set, `index.number_of_replicas` will be ignored during updates.\n\nIf a specific index is not in use on the system and settings are provided for it, the request will be rejected.\nThis API does not yet support configuring the settings for indices before they are in use.\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" operationId: security-update-settings parameters: - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "The period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: $ref: '#/components/schemas/_types.Duration' requestBody: content: application/json: schema: type: object properties: security: allOf: - $ref: '#/components/schemas/security._types.SecuritySettings' description: 'Settings for the index used for most security configuration, including native realm users and roles configured with the API.' security-profile: allOf: - $ref: '#/components/schemas/security._types.SecuritySettings' description: Settings for the index used to store profile information. security-tokens: allOf: - $ref: '#/components/schemas/security._types.SecuritySettings' description: Settings for the index used to store tokens. examples: SecurityUpdateSettingsRequestExample1: description: Run `PUT /_security/settings` to modify the security settings. value: "{\n \"security\": {\n \"index\": {\n \"auto_expand_replicas\": \"0-all\"\n }\n },\n \"security-tokens\": {\n \"index\": {\n \"auto_expand_replicas\": \"0-all\"\n } \n },\n \"security-profile\": {\n \"index\": {\n \"auto_expand_replicas\": \"0-all\"\n } \n }\n}" x-codeSamples: - lang: Console source: "PUT /_security/settings\n{\n \"security\": {\n \"index\": {\n \"auto_expand_replicas\": \"0-all\"\n }\n },\n \"security-tokens\": {\n \"index\": {\n \"auto_expand_replicas\": \"0-all\"\n } \n },\n \"security-profile\": {\n \"index\": {\n \"auto_expand_replicas\": \"0-all\"\n } \n }\n}" - lang: Python source: "resp = client.security.update_settings(\n security={\n \"index\": {\n \"auto_expand_replicas\": \"0-all\"\n }\n },\n security_tokens={\n \"index\": {\n \"auto_expand_replicas\": \"0-all\"\n }\n },\n security_profile={\n \"index\": {\n \"auto_expand_replicas\": \"0-all\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.security.updateSettings({\n security: {\n index: {\n auto_expand_replicas: \"0-all\",\n },\n },\n \"security-tokens\": {\n index: {\n auto_expand_replicas: \"0-all\",\n },\n },\n \"security-profile\": {\n index: {\n auto_expand_replicas: \"0-all\",\n },\n },\n});" - lang: Ruby source: "response = client.security.update_settings(\n body: {\n \"security\": {\n \"index\": {\n \"auto_expand_replicas\": \"0-all\"\n }\n },\n \"security-tokens\": {\n \"index\": {\n \"auto_expand_replicas\": \"0-all\"\n }\n },\n \"security-profile\": {\n \"index\": {\n \"auto_expand_replicas\": \"0-all\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->updateSettings([\n \"body\" => [\n \"security\" => [\n \"index\" => [\n \"auto_expand_replicas\" => \"0-all\",\n ],\n ],\n \"security-tokens\" => [\n \"index\" => [\n \"auto_expand_replicas\" => \"0-all\",\n ],\n ],\n \"security-profile\" => [\n \"index\" => [\n \"auto_expand_replicas\" => \"0-all\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"security":{"index":{"auto_expand_replicas":"0-all"}},"security-tokens":{"index":{"auto_expand_replicas":"0-all"}},"security-profile":{"index":{"auto_expand_replicas":"0-all"}}}'' "$ELASTICSEARCH_URL/_security/settings"' - lang: C# source: "var response = await client.Security\n .UpdateSettingsAsync(d1 => d1\n .Security(d2 => d2\n .Index(d3 => d3\n .AutoExpandReplicas(\"0-all\")\n )\n )\n .SecurityProfile(d2 => d2\n .Index(d3 => d3\n .AutoExpandReplicas(\"0-all\")\n )\n )\n .SecurityTokens(d2 => d2\n .Index(d3 => d3\n .AutoExpandReplicas(\"0-all\")\n )\n )\n );" - lang: Java source: "client.security().updateSettings(u -> u\n .security(s -> s\n .index(i -> i\n .otherSettings(Map.of())\n .autoExpandReplicas(\"0-all\")\n )\n )\n .securityProfile(s -> s\n .index(i -> i\n .otherSettings(Map.of())\n .autoExpandReplicas(\"0-all\")\n )\n )\n .securityTokens(s -> s\n .index(i -> i\n .otherSettings(Map.of())\n .autoExpandReplicas(\"0-all\")\n )\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - acknowledged type: object properties: acknowledged: type: boolean x-state: Generally available x-codeSamples: - lang: Console source: "PUT /_security/settings\n{\n \"security\": {\n \"index\": {\n \"auto_expand_replicas\": \"0-all\"\n }\n },\n \"security-tokens\": {\n \"index\": {\n \"auto_expand_replicas\": \"0-all\"\n } \n },\n \"security-profile\": {\n \"index\": {\n \"auto_expand_replicas\": \"0-all\"\n } \n }\n}" - lang: Python source: "resp = client.security.update_settings(\n security={\n \"index\": {\n \"auto_expand_replicas\": \"0-all\"\n }\n },\n security_tokens={\n \"index\": {\n \"auto_expand_replicas\": \"0-all\"\n }\n },\n security_profile={\n \"index\": {\n \"auto_expand_replicas\": \"0-all\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.security.updateSettings({\n security: {\n index: {\n auto_expand_replicas: \"0-all\",\n },\n },\n \"security-tokens\": {\n index: {\n auto_expand_replicas: \"0-all\",\n },\n },\n \"security-profile\": {\n index: {\n auto_expand_replicas: \"0-all\",\n },\n },\n});" - lang: Ruby source: "response = client.security.update_settings(\n body: {\n \"security\": {\n \"index\": {\n \"auto_expand_replicas\": \"0-all\"\n }\n },\n \"security-tokens\": {\n \"index\": {\n \"auto_expand_replicas\": \"0-all\"\n }\n },\n \"security-profile\": {\n \"index\": {\n \"auto_expand_replicas\": \"0-all\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->updateSettings([\n \"body\" => [\n \"security\" => [\n \"index\" => [\n \"auto_expand_replicas\" => \"0-all\",\n ],\n ],\n \"security-tokens\" => [\n \"index\" => [\n \"auto_expand_replicas\" => \"0-all\",\n ],\n ],\n \"security-profile\" => [\n \"index\" => [\n \"auto_expand_replicas\" => \"0-all\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"security":{"index":{"auto_expand_replicas":"0-all"}},"security-tokens":{"index":{"auto_expand_replicas":"0-all"}},"security-profile":{"index":{"auto_expand_replicas":"0-all"}}}'' "$ELASTICSEARCH_URL/_security/settings"' - lang: C# source: "var response = await client.Security\n .UpdateSettingsAsync(d1 => d1\n .Security(d2 => d2\n .Index(d3 => d3\n .AutoExpandReplicas(\"0-all\")\n )\n )\n .SecurityProfile(d2 => d2\n .Index(d3 => d3\n .AutoExpandReplicas(\"0-all\")\n )\n )\n .SecurityTokens(d2 => d2\n .Index(d3 => d3\n .AutoExpandReplicas(\"0-all\")\n )\n )\n );" - lang: Java source: "client.security().updateSettings(u -> u\n .security(s -> s\n .index(i -> i\n .otherSettings(Map.of())\n .autoExpandReplicas(\"0-all\")\n )\n )\n .securityProfile(s -> s\n .index(i -> i\n .otherSettings(Map.of())\n .autoExpandReplicas(\"0-all\")\n )\n )\n .securityTokens(s -> s\n .index(i -> i\n .otherSettings(Map.of())\n .autoExpandReplicas(\"0-all\")\n )\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/stats: get: tags: - security summary: Get security stats description: "Gather security usage statistics from all node(s) within the cluster.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: security-get-stats responses: '200': description: '' content: application/json: schema: required: - nodes type: object properties: nodes: type: object additionalProperties: $ref: '#/components/schemas/security._types.NodeSecurityStats' description: A map of node IDs to security statistics for that node. examples: SecurityStatsExample1: description: A successful response from `GET /_security/stats`. value: "{\n \"nodes\": {\n \"CLeCBfYETO2mQ1R2Il5-SA\": {\n \"roles\": {\n \"dls\": {\n \"bit_set_cache\": {\n \"count\": 1,\n \"memory\": \"16b\",\n \"memory_in_bytes\": 16,\n \"hits\": 212,\n \"misses\": 1,\n \"evictions\": 0,\n \"hits_time_in_millis\": 5,\n \"misses_time_in_millis\": 0\n }\n }\n }\n }\n }\n}" x-state: Generally available; Added in 9.2.0 x-metaTags: - content: Elasticsearch name: product_name /_security/oauth2/token: post: tags: - security summary: Get a token description: "Create a bearer token for access without requiring basic authentication.\nThe tokens are created by the Elasticsearch Token Service, which is automatically enabled when you configure TLS on the HTTP interface.\nAlternatively, you can explicitly enable the `xpack.security.authc.token.enabled` setting.\nWhen you are running in production mode, a bootstrap check prevents you from enabling the token service unless you also enable TLS on the HTTP interface.\n\nThe get token API takes the same parameters as a typical OAuth 2.0 token API except for the use of a JSON request body.\n\nA successful get token API call returns a JSON structure that contains the access token, the amount of time (seconds) that the token expires in, the type, and the scope if available.\n\nThe tokens returned by the get token API have a finite period of time for which they are valid and after that time period, they can no longer be used.\nThat time period is defined by the `xpack.security.authc.token.timeout` setting.\nIf you want to invalidate a token immediately, you can do so by using the invalidate token API.\n\n## Required authorization\n\n* Cluster privileges: `manage_token`\n" externalDocs: description: More about setting up https url: https://www.elastic.co/docs/deploy-manage/security/set-up-basic-security-plus-https#encrypt-http-communication x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-get-token.html operationId: security-get-token requestBody: content: application/json: schema: type: object properties: grant_type: allOf: - $ref: '#/components/schemas/security.get_token.AccessTokenGrantType' description: "The type of grant.\nSupported grant types are: `password`, `_kerberos`, `client_credentials`, `refresh_token`, and `_user_managed_service_account`.\n\nSupported values include:\n - `password`: This grant type implements the Resource Owner Password Credentials Grant of OAuth2.\nIn this grant, a trusted client exchanges the end user's credentials for an access token and (possibly) a refresh token.\nThe request needs to be made by an authenticated user but happens on behalf of another authenticated user (the one whose credentials are passed as request parameters).\nThis grant type is not suitable or designed for the self-service user creation of tokens.\n - `client_credentials`: This grant type implements the Client Credentials Grant of OAuth2.\nIt is geared for machine to machine communication and is not suitable or designed for the self-service user creation of tokens.\nIt generates only access tokens that cannot be refreshed.\nThe premise is that the entity that uses `client_credentials` has constant access to a set of (client, not end-user) credentials and can authenticate itself at will.\n - `_kerberos`: This grant type is supported internally and implements SPNEGO based Kerberos support.\nThe `_kerberos` grant type may change from version to version.\n - `refresh_token`: This grant type implements the Refresh Token Grant of OAuth2.\nIn this grant a user exchanges a previously issued refresh token for a new access token and a new refresh token.\n - `_user_managed_service_account`: This grant type is supported internally and exchanges a user-managed service account token for an access token that represents that service account.\nThe request must be made by an authenticated caller with the `manage_token` cluster privilege, on behalf of the service account whose token is passed in the `service_account_token` parameter.\nThe service account token is authenticated on every exchange, so a disabled account or an invalidated token is rejected.\nTokens that belong to built-in (`elastic/*`) service accounts are rejected.\nIt generates only access tokens that cannot be refreshed.\nThe `_user_managed_service_account` grant type may change from version to version.\n\n" scope: type: string description: "The scope of the token.\nCurrently tokens are only issued for a scope of FULL regardless of the value sent with the request." password: allOf: - $ref: '#/components/schemas/_types.Password' description: "The user's password.\nIf you specify the `password` grant type, this parameter is required.\nThis parameter is not valid with any other supported grant type." kerberos_ticket: type: string description: "The base64 encoded kerberos ticket.\nIf you specify the `_kerberos` grant type, this parameter is required.\nThis parameter is not valid with any other supported grant type." refresh_token: type: string description: "The string that was returned when you created the token, which enables you to extend its life.\nIf you specify the `refresh_token` grant type, this parameter is required.\nThis parameter is not valid with any other supported grant type." service_account_token: type: string description: "The service account token of a user-managed service account, as returned by the create service account token API.\nIf you specify the `_user_managed_service_account` grant type, this parameter is required.\nThis parameter is not valid with any other supported grant type." x-state: Generally available; Added in 9.6.0 username: allOf: - $ref: '#/components/schemas/_types.Username' description: "The username that identifies the user.\nIf you specify the `password` grant type, this parameter is required.\nThis parameter is not valid with any other supported grant type." examples: GetUserAccessTokenRequestExample1: summary: A client_credentials grant type example description: "Run `POST /_security/oauth2/token` to obtain a token using the `client_credentials` grant type, which simply creates a token as the authenticated user.\n" value: "{\n \"grant_type\" : \"client_credentials\"\n}" x-codeSamples: - lang: Console source: "POST /_security/oauth2/token\n{\n \"grant_type\" : \"client_credentials\"\n}" - lang: Python source: "resp = client.security.get_token(\n grant_type=\"client_credentials\",\n)" - lang: JavaScript source: "const response = await client.security.getToken({\n grant_type: \"client_credentials\",\n});" - lang: Ruby source: "response = client.security.get_token(\n body: {\n \"grant_type\": \"client_credentials\"\n }\n)" - lang: PHP source: "$resp = $client->security()->getToken([\n \"body\" => [\n \"grant_type\" => \"client_credentials\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"grant_type":"client_credentials"}'' "$ELASTICSEARCH_URL/_security/oauth2/token"' - lang: C# source: "var response = await client.Security\n .GetTokenAsync(d1 => d1\n .GrantType(AccessTokenGrantType.ClientCredentials)\n );" - lang: Java source: "client.security().getToken(g -> g\n .grantType(AccessTokenGrantType.ClientCredentials)\n);\n" GetUserAccessTokenRequestExample2: summary: A password grant type example description: "Run `POST /_security/oauth2/token` to obtain a token for the `test_admin` user using the password grant type. This request needs to be made by an authenticated user with sufficient privileges that may or may not be the same as the one whose username is passed in the `username` parameter.\n" value: "{\n \"grant_type\" : \"password\",\n \"username\" : \"test_admin\",\n \"password\" : \"x-pack-test-password\"\n}" x-codeSamples: - lang: Console source: "POST /_security/oauth2/token\n{\n \"grant_type\" : \"password\",\n \"username\" : \"test_admin\",\n \"password\" : \"x-pack-test-password\"\n}" - lang: Python source: "resp = client.security.get_token(\n grant_type=\"password\",\n username=\"test_admin\",\n password=\"x-pack-test-password\",\n)" - lang: JavaScript source: "const response = await client.security.getToken({\n grant_type: \"password\",\n username: \"test_admin\",\n password: \"x-pack-test-password\",\n});" - lang: Ruby source: "response = client.security.get_token(\n body: {\n \"grant_type\": \"password\",\n \"username\": \"test_admin\",\n \"password\": \"x-pack-test-password\"\n }\n)" - lang: PHP source: "$resp = $client->security()->getToken([\n \"body\" => [\n \"grant_type\" => \"password\",\n \"username\" => \"test_admin\",\n \"password\" => \"x-pack-test-password\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"grant_type":"password","username":"test_admin","password":"x-pack-test-password"}'' "$ELASTICSEARCH_URL/_security/oauth2/token"' - lang: C# source: "var response = await client.Security\n .GetTokenAsync(d1 => d1\n .GrantType(AccessTokenGrantType.Password)\n .Password(\"x-pack-test-password\")\n .Username(\"test_admin\")\n );" - lang: Java source: "client.security().getToken(g -> g\n .grantType(AccessTokenGrantType.Password)\n .password(\"x-pack-test-password\")\n .username(\"test_admin\")\n);\n" GetUserAccessTokenRequestExample3: summary: A _user_managed_service_account grant type example description: "Run `POST /_security/oauth2/token` to exchange a user-managed service account token for an access token that represents the `apps/oauth2_worker` service account. This request needs to be made by an authenticated user with the `manage_token` cluster privilege; the service account itself does not need, and should not hold, that privilege.\n" value: "{\n \"grant_type\" : \"_user_managed_service_account\",\n \"service_account_token\" : \"AAEAAWFwcHMvb2F1dGgyX3dvcmtlci9leGNoYW5nZS10b2tlbjpyNVdhVjNiYUxTX2lPRXhRb0VOSDdR\"\n}" x-codeSamples: - lang: Console source: "POST /_security/oauth2/token\n{\n \"grant_type\" : \"_user_managed_service_account\",\n \"service_account_token\" : \"AAEAAWFwcHMvb2F1dGgyX3dvcmtlci9leGNoYW5nZS10b2tlbjpyNVdhVjNiYUxTX2lPRXhRb0VOSDdR\"\n}" - lang: Python source: "resp = client.security.get_token(\n grant_type=\"_user_managed_service_account\",\n service_account_token=\"AAEAAWFwcHMvb2F1dGgyX3dvcmtlci9leGNoYW5nZS10b2tlbjpyNVdhVjNiYUxTX2lPRXhRb0VOSDdR\",\n)" - lang: JavaScript source: "const response = await client.security.getToken({\n grant_type: \"_user_managed_service_account\",\n service_account_token:\n \"AAEAAWFwcHMvb2F1dGgyX3dvcmtlci9leGNoYW5nZS10b2tlbjpyNVdhVjNiYUxTX2lPRXhRb0VOSDdR\",\n});" - lang: Ruby source: "response = client.security.get_token(\n body: {\n \"grant_type\": \"_user_managed_service_account\",\n \"service_account_token\": \"AAEAAWFwcHMvb2F1dGgyX3dvcmtlci9leGNoYW5nZS10b2tlbjpyNVdhVjNiYUxTX2lPRXhRb0VOSDdR\"\n }\n)" - lang: PHP source: "$resp = $client->security()->getToken([\n \"body\" => [\n \"grant_type\" => \"_user_managed_service_account\",\n \"service_account_token\" => \"AAEAAWFwcHMvb2F1dGgyX3dvcmtlci9leGNoYW5nZS10b2tlbjpyNVdhVjNiYUxTX2lPRXhRb0VOSDdR\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"grant_type":"_user_managed_service_account","service_account_token":"AAEAAWFwcHMvb2F1dGgyX3dvcmtlci9leGNoYW5nZS10b2tlbjpyNVdhVjNiYUxTX2lPRXhRb0VOSDdR"}'' "$ELASTICSEARCH_URL/_security/oauth2/token"' - lang: C# source: "var response = await client.Security\n .GetTokenAsync(d1 => d1\n .GrantType(AccessTokenGrantType.UserManagedServiceAccount)\n .ServiceAccountToken(\"AAEAAWFwcHMvb2F1dGgyX3dvcmtlci9leGNoYW5nZS10b2tlbjpyNVdhVjNiYUxTX2lPRXhRb0VOSDdR\")\n );" required: true responses: '200': description: '' content: application/json: schema: required: - access_token - expires_in - type - authentication type: object properties: access_token: type: string expires_in: type: number scope: type: string type: type: string refresh_token: type: string kerberos_authentication_response_token: type: string authentication: allOf: - $ref: '#/components/schemas/security.get_token.AuthenticatedUser' examples: GetUserAccessTokenResponseExample1: summary: A client_credentials grant type example description: A successful response from `POST /_security/oauth2/token`. value: "{\n \"access_token\" : \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n \"type\" : \"Bearer\",\n \"expires_in\" : 1200,\n \"authentication\" : {\n \"username\" : \"test_admin\",\n \"roles\" : [\n \"superuser\"\n ],\n \"full_name\" : null,\n \"email\" : null,\n \"metadata\" : { },\n \"enabled\" : true,\n \"authentication_realm\" : {\n \"name\" : \"file\",\n \"type\" : \"file\"\n },\n \"lookup_realm\" : {\n \"name\" : \"file\",\n \"type\" : \"file\"\n },\n \"authentication_type\" : \"realm\"\n }\n}" GetUserAccessTokenResponseExample2: summary: A password grant type example description: A successful response from `POST /_security/oauth2/token`. value: "{\n \"access_token\" : \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n \"type\" : \"Bearer\",\n \"expires_in\" : 1200,\n \"authentication\" : {\n \"username\" : \"test_admin\",\n \"roles\" : [\n \"superuser\"\n ],\n \"full_name\" : null,\n \"email\" : null,\n \"metadata\" : { },\n \"enabled\" : true,\n \"authentication_realm\" : {\n \"name\" : \"file\",\n \"type\" : \"file\"\n },\n \"lookup_realm\" : {\n \"name\" : \"file\",\n \"type\" : \"file\"\n },\n \"authentication_type\" : \"realm\"\n }\n}" GetUserAccessTokenResponseExample3: summary: A _user_managed_service_account grant type example description: "A successful response from `POST /_security/oauth2/token` for the `_user_managed_service_account` grant type. No `refresh_token` is returned for this grant type; obtain a new access token by exchanging the service account token again.\n" value: "{\n \"access_token\" : \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n \"type\" : \"Bearer\",\n \"expires_in\" : 1200,\n \"authentication\" : {\n \"username\" : \"apps/oauth2_worker\",\n \"roles\" : [\n \"umsa_oauth2_monitor\"\n ],\n \"full_name\" : \"User-managed service account - apps/oauth2_worker\",\n \"email\" : null,\n \"metadata\" : {\n \"_user_managed_service_account\" : true\n },\n \"enabled\" : true,\n \"authentication_realm\" : {\n \"name\" : \"_service_account\",\n \"type\" : \"_service_account\"\n },\n \"lookup_realm\" : {\n \"name\" : \"_service_account\",\n \"type\" : \"_service_account\"\n },\n \"authentication_type\" : \"token\"\n }\n}" x-state: Generally available; Added in 5.5.0 x-codeSamples: - lang: Console source: "POST /_security/oauth2/token\n{\n \"grant_type\" : \"client_credentials\"\n}" - lang: Python source: "resp = client.security.get_token(\n grant_type=\"client_credentials\",\n)" - lang: JavaScript source: "const response = await client.security.getToken({\n grant_type: \"client_credentials\",\n});" - lang: Ruby source: "response = client.security.get_token(\n body: {\n \"grant_type\": \"client_credentials\"\n }\n)" - lang: PHP source: "$resp = $client->security()->getToken([\n \"body\" => [\n \"grant_type\" => \"client_credentials\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"grant_type":"client_credentials"}'' "$ELASTICSEARCH_URL/_security/oauth2/token"' - lang: C# source: "var response = await client.Security\n .GetTokenAsync(d1 => d1\n .GrantType(AccessTokenGrantType.ClientCredentials)\n );" - lang: Java source: "client.security().getToken(g -> g\n .grantType(AccessTokenGrantType.ClientCredentials)\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - security summary: Invalidate a token description: "The access tokens returned by the get token API have a finite period of time for which they are valid.\nAfter that time period, they can no longer be used.\nThe time period is defined by the `xpack.security.authc.token.timeout` setting.\n\nThe refresh tokens returned by the get token API are only valid for 24 hours.\nThey can also be used exactly once.\nIf you want to invalidate one or more access or refresh tokens immediately, use this invalidate token API.\n\nNOTE: While all parameters are optional, at least one of them is required.\nMore specifically, either one of `token` or `refresh_token` parameters is required.\nIf none of these two are specified, then `realm_name` and/or `username` need to be specified." operationId: security-invalidate-token requestBody: content: application/json: schema: type: object properties: token: type: string description: "An access token.\nThis parameter cannot be used if any of `refresh_token`, `realm_name`, or `username` are used." refresh_token: type: string description: "A refresh token.\nThis parameter cannot be used if any of `refresh_token`, `realm_name`, or `username` are used." realm_name: allOf: - $ref: '#/components/schemas/_types.Name' description: "The name of an authentication realm.\nThis parameter cannot be used with either `refresh_token` or `token`." username: allOf: - $ref: '#/components/schemas/_types.Username' description: "The username of a user.\nThis parameter cannot be used with either `refresh_token` or `token`." examples: SecurityInvalidateTokenRequestExample1: summary: Invalidate an access token description: "Run `DELETE /_security/oauth2/token` to invalidate an access token.\n" value: "{\n \"token\" : \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\"\n}" x-codeSamples: - lang: Console source: "DELETE /_security/oauth2/token\n{\n \"token\" : \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\"\n}" - lang: Python source: "resp = client.security.invalidate_token(\n token=\"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n)" - lang: JavaScript source: "const response = await client.security.invalidateToken({\n token:\n \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n});" - lang: Ruby source: "response = client.security.invalidate_token(\n body: {\n \"token\": \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\"\n }\n)" - lang: PHP source: "$resp = $client->security()->invalidateToken([\n \"body\" => [\n \"token\" => \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n ],\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"token":"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ=="}'' "$ELASTICSEARCH_URL/_security/oauth2/token"' - lang: C# source: "var response = await client.Security\n .InvalidateTokenAsync(d1 => d1\n .Token(\"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\")\n );" - lang: Java source: "client.security().invalidateToken(i -> i\n .token(\"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\")\n);\n" SecurityInvalidateTokenRequestExample2: summary: Invalidate a refresh token description: "Run `DELETE /_security/oauth2/token` to invalidate a refresh token.\n" value: "{\n \"refresh_token\" : \"vLBPvmAB6KvwvJZr27cS\"\n}" x-codeSamples: - lang: Console source: "DELETE /_security/oauth2/token\n{\n \"refresh_token\" : \"vLBPvmAB6KvwvJZr27cS\"\n}" - lang: Python source: "resp = client.security.invalidate_token(\n refresh_token=\"vLBPvmAB6KvwvJZr27cS\",\n)" - lang: JavaScript source: "const response = await client.security.invalidateToken({\n refresh_token: \"vLBPvmAB6KvwvJZr27cS\",\n});" - lang: Ruby source: "response = client.security.invalidate_token(\n body: {\n \"refresh_token\": \"vLBPvmAB6KvwvJZr27cS\"\n }\n)" - lang: PHP source: "$resp = $client->security()->invalidateToken([\n \"body\" => [\n \"refresh_token\" => \"vLBPvmAB6KvwvJZr27cS\",\n ],\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"refresh_token":"vLBPvmAB6KvwvJZr27cS"}'' "$ELASTICSEARCH_URL/_security/oauth2/token"' - lang: C# source: "var response = await client.Security\n .InvalidateTokenAsync(d1 => d1\n .RefreshToken(\"vLBPvmAB6KvwvJZr27cS\")\n );" - lang: Java source: "client.security().invalidateToken(i -> i\n .refreshToken(\"vLBPvmAB6KvwvJZr27cS\")\n);\n" SecurityInvalidateTokenRequestExample3: summary: Invalidate tokens by realm description: Run `DELETE /_security/oauth2/token` to invalidate all access tokens and refresh tokens for the `saml1` realm. value: "{\n \"realm_name\" : \"saml1\"\n}" x-codeSamples: - lang: Console source: "DELETE /_security/oauth2/token\n{\n \"realm_name\" : \"saml1\"\n}" - lang: Python source: "resp = client.security.invalidate_token(\n realm_name=\"saml1\",\n)" - lang: JavaScript source: "const response = await client.security.invalidateToken({\n realm_name: \"saml1\",\n});" - lang: Ruby source: "response = client.security.invalidate_token(\n body: {\n \"realm_name\": \"saml1\"\n }\n)" - lang: PHP source: "$resp = $client->security()->invalidateToken([\n \"body\" => [\n \"realm_name\" => \"saml1\",\n ],\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"realm_name":"saml1"}'' "$ELASTICSEARCH_URL/_security/oauth2/token"' - lang: C# source: "var response = await client.Security\n .InvalidateTokenAsync(d1 => d1\n .RealmName(\"saml1\")\n );" - lang: Java source: "client.security().invalidateToken(i -> i\n .realmName(\"saml1\")\n);\n" SecurityInvalidateTokenRequestExample4: summary: Invalidate tokens by user description: Run `DELETE /_security/oauth2/token` to invalidate all access tokens and refresh tokens for the user `myuser` in all realms. value: "{\n \"username\" : \"myuser\"\n}" x-codeSamples: - lang: Console source: "DELETE /_security/oauth2/token\n{\n \"username\" : \"myuser\"\n}" - lang: Python source: "resp = client.security.invalidate_token(\n username=\"myuser\",\n)" - lang: JavaScript source: "const response = await client.security.invalidateToken({\n username: \"myuser\",\n});" - lang: Ruby source: "response = client.security.invalidate_token(\n body: {\n \"username\": \"myuser\"\n }\n)" - lang: PHP source: "$resp = $client->security()->invalidateToken([\n \"body\" => [\n \"username\" => \"myuser\",\n ],\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"username":"myuser"}'' "$ELASTICSEARCH_URL/_security/oauth2/token"' - lang: C# source: "var response = await client.Security\n .InvalidateTokenAsync(d1 => d1\n .Username(\"myuser\")\n );" - lang: Java source: "client.security().invalidateToken(i -> i\n .username(\"myuser\")\n);\n" SecurityInvalidateTokenRequestExample5: summary: Invalidate tokens by user and realm description: Run `DELETE /_security/oauth2/token` to invalidate all access tokens and refresh tokens for the user `myuser` in the `saml1` realm. value: "{\n \"username\" : \"myuser\",\n \"realm_name\" : \"saml1\"\n}" x-codeSamples: - lang: Console source: "DELETE /_security/oauth2/token\n{\n \"username\" : \"myuser\",\n \"realm_name\" : \"saml1\"\n}" - lang: Python source: "resp = client.security.invalidate_token(\n username=\"myuser\",\n realm_name=\"saml1\",\n)" - lang: JavaScript source: "const response = await client.security.invalidateToken({\n username: \"myuser\",\n realm_name: \"saml1\",\n});" - lang: Ruby source: "response = client.security.invalidate_token(\n body: {\n \"username\": \"myuser\",\n \"realm_name\": \"saml1\"\n }\n)" - lang: PHP source: "$resp = $client->security()->invalidateToken([\n \"body\" => [\n \"username\" => \"myuser\",\n \"realm_name\" => \"saml1\",\n ],\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"username":"myuser","realm_name":"saml1"}'' "$ELASTICSEARCH_URL/_security/oauth2/token"' - lang: C# source: "var response = await client.Security\n .InvalidateTokenAsync(d1 => d1\n .RealmName(\"saml1\")\n .Username(\"myuser\")\n );" - lang: Java source: "client.security().invalidateToken(i -> i\n .realmName(\"saml1\")\n .username(\"myuser\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - error_count - invalidated_tokens - previously_invalidated_tokens type: object properties: error_count: type: number description: The number of errors that were encountered when invalidating the tokens. error_details: type: array items: $ref: '#/components/schemas/_types.ErrorCause' description: "Details about the errors.\nThis field is not present in the response when `error_count` is `0`." invalidated_tokens: type: number description: The number of the tokens that were invalidated as part of this request. previously_invalidated_tokens: type: number description: The number of tokens that were already invalidated. examples: SecurityInvalidateTokenResponseExample1: description: "A partially successful response from `DELETE /_security/oauth2/token`. The response includes the number of the tokens that were invalidated, the number of errors that were encountered when invalidating the tokens, and details about these errors.\n" value: "{\n \"invalidated_tokens\":9, \n \"previously_invalidated_tokens\":15, \n \"error_count\":2, \n \"error_details\":[ \n {\n \"type\":\"exception\",\n \"reason\":\"Elasticsearch exception [type=exception, reason=foo]\",\n \"caused_by\":{\n \"type\":\"exception\",\n \"reason\":\"Elasticsearch exception [type=illegal_argument_exception, reason=bar]\"\n }\n },\n {\n \"type\":\"exception\",\n \"reason\":\"Elasticsearch exception [type=exception, reason=boo]\",\n \"caused_by\":{\n \"type\":\"exception\",\n \"reason\":\"Elasticsearch exception [type=illegal_argument_exception, reason=far]\"\n }\n }\n ]\n}" x-state: Generally available; Added in 5.5.0 x-codeSamples: - lang: Console source: "DELETE /_security/oauth2/token\n{\n \"token\" : \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\"\n}" - lang: Python source: "resp = client.security.invalidate_token(\n token=\"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n)" - lang: JavaScript source: "const response = await client.security.invalidateToken({\n token:\n \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n});" - lang: Ruby source: "response = client.security.invalidate_token(\n body: {\n \"token\": \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\"\n }\n)" - lang: PHP source: "$resp = $client->security()->invalidateToken([\n \"body\" => [\n \"token\" => \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n ],\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"token":"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ=="}'' "$ELASTICSEARCH_URL/_security/oauth2/token"' - lang: C# source: "var response = await client.Security\n .InvalidateTokenAsync(d1 => d1\n .Token(\"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\")\n );" - lang: Java source: "client.security().invalidateToken(i -> i\n .token(\"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/user/_privileges: get: tags: - security summary: Get user privileges description: "Get the security privileges for the logged in user.\nAll users can use this API, but only to determine their own privileges.\nTo check the privileges of other users, you must use the run as feature.\nTo check whether a user has a specific list of privileges, use the has privileges API." operationId: security-get-user-privileges responses: '200': description: '' content: application/json: schema: required: - applications - cluster - global - indices - run_as type: object properties: applications: type: array items: $ref: '#/components/schemas/security._types.ApplicationPrivileges' cluster: type: array items: type: string remote_cluster: type: array items: $ref: '#/components/schemas/security._types.RemoteClusterPrivileges' global: type: array items: $ref: '#/components/schemas/security._types.GlobalPrivilege' indices: type: array items: $ref: '#/components/schemas/security._types.UserIndicesPrivileges' remote_indices: type: array items: $ref: '#/components/schemas/security._types.RemoteUserIndicesPrivileges' run_as: type: array items: type: string examples: SecurityGetUserPrivilegesResponseExample1: description: A successful response from `GET /_security/user/_privileges`. value: "{\n \"cluster\" : [\n \"all\"\n ],\n \"global\" : [ ],\n \"indices\" : [\n {\n \"names\" : [\n \"*\"\n ],\n \"privileges\" : [\n \"all\"\n ],\n \"allow_restricted_indices\" : true\n }\n ],\n \"applications\" : [\n {\n \"application\" : \"*\",\n \"privileges\" : [\n \"*\"\n ],\n \"resources\" : [\n \"*\"\n ]\n }\n ],\n \"run_as\" : [\n \"*\"\n ]\n}" x-state: Generally available; Added in 6.5.0 x-codeSamples: - lang: Console source: "GET /_security/user/_privileges\n" - lang: Python source: resp = client.security.get_user_privileges() - lang: JavaScript source: const response = await client.security.getUserPrivileges(); - lang: Ruby source: response = client.security.get_user_privileges - lang: PHP source: $resp = $client->security()->getUserPrivileges(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/user/_privileges"' - lang: C# source: var response = await client.Security.GetUserPrivilegesAsync(); - lang: Java source: "client.security().getUserPrivileges();\n" x-metaTags: - content: Elasticsearch name: product_name '/_security/profile/{uid}': get: tags: - security summary: Get a user profile description: "Get a user's profile using the unique profile ID.\n\nNOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions.\nIndividual users and external applications should not call this API directly.\nElastic reserves the right to change or remove this feature in future releases without prior notice.\n\n## Required authorization\n\n* Cluster privileges: `read_security`\n" operationId: security-get-user-profile parameters: - name: uid in: path description: A unique identifier for the user profile. required: true schema: oneOf: - $ref: '#/components/schemas/security._types.UserProfileId' - type: array items: $ref: '#/components/schemas/security._types.UserProfileId' - name: data in: query description: "A comma-separated list of filters for the `data` field of the profile document.\nTo return all content use `data=*`.\nTo return a subset of content use `data=` to retrieve content nested under the specified ``.\nBy default returns no `data` content." schema: oneOf: - type: string - type: array items: type: string responses: '200': description: '' content: application/json: schema: required: - profiles type: object properties: profiles: type: array items: $ref: '#/components/schemas/security._types.UserProfileWithMetadata' description: "A successful call returns the JSON representation of the user profile and its internal versioning numbers.\nThe API returns an empty object if no profile document is found for the provided `uid`.\nThe content of the data field is not returned by default to avoid deserializing a potential large payload." errors: allOf: - $ref: '#/components/schemas/security.get_user_profile.GetUserProfileErrors' examples: GetUserProfileResponseExample1: summary: Profile details for a UUID description: "A successful response from `GET /_security/profile/u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0`. By default, no content is returned in the `data` field.\n" value: "{\n \"profiles\": [\n {\n \"uid\": \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n \"enabled\": true,\n \"last_synchronized\": 1642650651037,\n \"user\": {\n \"username\": \"jacknich\",\n \"roles\": [\n \"admin\", \"other_role1\"\n ],\n \"realm_name\": \"native\",\n \"full_name\": \"Jack Nicholson\",\n \"email\": \"jacknich@example.com\"\n },\n \"labels\": {\n \"direction\": \"north\"\n },\n \"data\": {}, \n \"_doc\": {\n \"_primary_term\": 88,\n \"_seq_no\": 66\n }\n }\n ]\n}" GetUserProfileResponseExample2: summary: Profile details for a UUID and data key description: "A successful response from `GET /_security/profile/u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0?data=app1.key1`.\n" value: "{\n \"profiles\": [\n {\n \"uid\": \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n \"enabled\": true,\n \"last_synchronized\": 1642650651037,\n \"user\": {\n \"username\": \"jacknich\",\n \"roles\": [\n \"admin\", \"other_role1\"\n ],\n \"realm_name\": \"native\",\n \"full_name\": \"Jack Nicholson\",\n \"email\": \"jacknich@example.com\"\n },\n \"labels\": {\n \"direction\": \"north\"\n },\n \"data\": {\n \"app1\": {\n \"key1\": \"value1\"\n }\n },\n \"_doc\": {\n \"_primary_term\": 88,\n \"_seq_no\": 66\n }\n }\n ]\n}" GetUserProfileResponseExample3: summary: Profile details with errors description: "A response that contains errors that occurred while retrieving user profiles.\n" value: "{\n \"profiles\": [],\n \"errors\": {\n \"count\": 1,\n \"details\": {\n \"u_FmxQt3gr1BBH5wpnz9HkouPj3Q710XkOgg1PWkwLPBW_5\": {\n \"type\": \"resource_not_found_exception\",\n \"reason\": \"profile document not found\"\n }\n }\n }\n}" x-state: Generally available; Added in 8.2.0 x-codeSamples: - lang: Console source: "GET /_security/profile/u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\n" - lang: Python source: "resp = client.security.get_user_profile(\n uid=\"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n)" - lang: JavaScript source: "const response = await client.security.getUserProfile({\n uid: \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n});" - lang: Ruby source: "response = client.security.get_user_profile(\n uid: \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\"\n)" - lang: PHP source: "$resp = $client->security()->getUserProfile([\n \"uid\" => \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/profile/u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0"' - lang: C# source: 'var response = await client.Security.GetUserProfileAsync(uid: ["u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0"]);' - lang: Java source: "client.security().getUserProfile(g -> g\n .uid(\"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/api_key/grant: post: tags: - security summary: Grant an API key description: "Create an API key on behalf of another user.\nThis API is similar to the create API keys API, however it creates the API key for a user that is different than the user that runs the API.\nThe caller must have authentication credentials for the user on whose behalf the API key will be created.\nIt is not possible to use this API to create an API key without that user's credentials.\nThe supported user authentication credential types are:\n\n* username and password\n* Elasticsearch access tokens\n* JWTs\n* service account tokens of user-managed service accounts\n\nThe user, for whom the authentication credentials is provided, can optionally \"run as\" (impersonate) another user.\nIn this case, the API key will be created on behalf of the impersonated user.\nRun as is not supported with the `_user_managed_service_account` grant type.\n\nThis API is intended be used by applications that need to create and manage API keys for end users, but cannot guarantee that those users have permission to create API keys on their own behalf.\nThe API keys are created by the Elasticsearch API key service, which is automatically enabled.\n\nA successful grant API key API call returns a JSON structure that contains the API key, its unique id, and its name.\nIf applicable, it also returns expiration information for the API key in milliseconds.\n\nBy default, API keys never expire. You can specify expiration information when you create the API keys.\n\n## Required authorization\n\n* Cluster privileges: `grant_api_key`\n" operationId: security-grant-api-key parameters: - name: refresh in: query description: "If 'true', Elasticsearch refreshes the affected shards to make this operation\nvisible to search.\nIf 'wait_for', it waits for a refresh to make this operation visible to search.\nIf 'false', nothing is done with refreshes." schema: allOf: - $ref: '#/components/schemas/_types.Refresh' default: 'false' requestBody: content: application/json: schema: required: - api_key - grant_type type: object properties: api_key: allOf: - $ref: '#/components/schemas/security.grant_api_key.GrantApiKey' description: The API key. grant_type: allOf: - $ref: '#/components/schemas/security.grant_api_key.ApiKeyGrantType' description: "The type of grant. Supported grant types are: `access_token`, `password`, and `_user_managed_service_account`.\n\nSupported values include:\n - `access_token`\n - `password`\n - `_user_managed_service_account`: In this type of grant, you must supply a service account token of a user-managed service account in the `service_account_token` parameter.\nThe API key is owned by the service account and is limited by the roles assigned to it.\nThe service account token is authenticated on every grant, so a disabled account or an invalidated token is rejected.\nTokens that belong to built-in (`elastic/*`) service accounts are rejected.\n\n" access_token: type: string description: "The user's access token.\nIf you specify the `access_token` grant type, this parameter is required.\nIt is not valid with other grant types." client_authentication: allOf: - $ref: '#/components/schemas/security.grant_api_key.GrantApiKeyClientAuthentication' description: "The client authentication for a JWT that requires it, which is what is normally sent in the `ES-Client-Authentication` request header.\nIt is valid only with the `access_token` grant type, when the access token is a JWT." x-state: Generally available; Added in 8.12.0 service_account_token: type: string description: "The service account token of a user-managed service account, as returned by the create service account token API.\nIf you specify the `_user_managed_service_account` grant type, this parameter is required.\nIt is not valid with other grant types." x-state: Generally available; Added in 9.6.0 username: allOf: - $ref: '#/components/schemas/_types.Username' description: "The user name that identifies the user.\nIf you specify the `password` grant type, this parameter is required.\nIt is not valid with other grant types." password: allOf: - $ref: '#/components/schemas/_types.Password' description: "The user's password.\nIf you specify the `password` grant type, this parameter is required.\nIt is not valid with other grant types." run_as: allOf: - $ref: '#/components/schemas/_types.Username' description: "The name of the user to be impersonated.\nIt is not valid with the `_user_managed_service_account` grant type." examples: SecurityGrantApiKeyRequestExample1: summary: Grant an API key description: "Run `POST /_security/api_key/grant` to create an API key on behalf of the `test_admin` user.\n" value: "{\n \"grant_type\": \"password\",\n \"username\" : \"test_admin\",\n \"password\" : \"x-pack-test-password\",\n \"api_key\" : {\n \"name\": \"my-api-key\",\n \"expiration\": \"1d\",\n \"role_descriptors\": {\n \"role-a\": {\n \"cluster\": [\"all\"],\n \"indices\": [\n {\n \"names\": [\"index-a*\"],\n \"privileges\": [\"read\"]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\"all\"],\n \"indices\": [\n {\n \"names\": [\"index-b*\"],\n \"privileges\": [\"all\"]\n }\n ]\n }\n },\n \"metadata\": {\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\"dev\", \"staging\"]\n }\n }\n }\n}" x-codeSamples: - lang: Console source: "POST /_security/api_key/grant\n{\n \"grant_type\": \"password\",\n \"username\" : \"test_admin\",\n \"password\" : \"x-pack-test-password\",\n \"api_key\" : {\n \"name\": \"my-api-key\",\n \"expiration\": \"1d\",\n \"role_descriptors\": {\n \"role-a\": {\n \"cluster\": [\"all\"],\n \"indices\": [\n {\n \"names\": [\"index-a*\"],\n \"privileges\": [\"read\"]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\"all\"],\n \"indices\": [\n {\n \"names\": [\"index-b*\"],\n \"privileges\": [\"all\"]\n }\n ]\n }\n },\n \"metadata\": {\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\"dev\", \"staging\"]\n }\n }\n }\n}" - lang: Python source: "resp = client.security.grant_api_key(\n grant_type=\"password\",\n username=\"test_admin\",\n password=\"x-pack-test-password\",\n api_key={\n \"name\": \"my-api-key\",\n \"expiration\": \"1d\",\n \"role_descriptors\": {\n \"role-a\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-a*\"\n ],\n \"privileges\": [\n \"read\"\n ]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-b*\"\n ],\n \"privileges\": [\n \"all\"\n ]\n }\n ]\n }\n },\n \"metadata\": {\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": True,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.security.grantApiKey({\n grant_type: \"password\",\n username: \"test_admin\",\n password: \"x-pack-test-password\",\n api_key: {\n name: \"my-api-key\",\n expiration: \"1d\",\n role_descriptors: {\n \"role-a\": {\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index-a*\"],\n privileges: [\"read\"],\n },\n ],\n },\n \"role-b\": {\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index-b*\"],\n privileges: [\"all\"],\n },\n ],\n },\n },\n metadata: {\n application: \"my-application\",\n environment: {\n level: 1,\n trusted: true,\n tags: [\"dev\", \"staging\"],\n },\n },\n },\n});" - lang: Ruby source: "response = client.security.grant_api_key(\n body: {\n \"grant_type\": \"password\",\n \"username\": \"test_admin\",\n \"password\": \"x-pack-test-password\",\n \"api_key\": {\n \"name\": \"my-api-key\",\n \"expiration\": \"1d\",\n \"role_descriptors\": {\n \"role-a\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-a*\"\n ],\n \"privileges\": [\n \"read\"\n ]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-b*\"\n ],\n \"privileges\": [\n \"all\"\n ]\n }\n ]\n }\n },\n \"metadata\": {\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->grantApiKey([\n \"body\" => [\n \"grant_type\" => \"password\",\n \"username\" => \"test_admin\",\n \"password\" => \"x-pack-test-password\",\n \"api_key\" => [\n \"name\" => \"my-api-key\",\n \"expiration\" => \"1d\",\n \"role_descriptors\" => [\n \"role-a\" => [\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index-a*\",\n ),\n \"privileges\" => array(\n \"read\",\n ),\n ],\n ),\n ],\n \"role-b\" => [\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index-b*\",\n ),\n \"privileges\" => array(\n \"all\",\n ),\n ],\n ),\n ],\n ],\n \"metadata\" => [\n \"application\" => \"my-application\",\n \"environment\" => [\n \"level\" => 1,\n \"trusted\" => true,\n \"tags\" => array(\n \"dev\",\n \"staging\",\n ),\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"grant_type":"password","username":"test_admin","password":"x-pack-test-password","api_key":{"name":"my-api-key","expiration":"1d","role_descriptors":{"role-a":{"cluster":["all"],"indices":[{"names":["index-a*"],"privileges":["read"]}]},"role-b":{"cluster":["all"],"indices":[{"names":["index-b*"],"privileges":["all"]}]}},"metadata":{"application":"my-application","environment":{"level":1,"trusted":true,"tags":["dev","staging"]}}}}'' "$ELASTICSEARCH_URL/_security/api_key/grant"' - lang: C# source: "var response = await client.Security\n .GrantApiKeyAsync(d1 => d1\n .ApiKey(d2 => d2\n .Expiration(\"1d\")\n .Metadata(new Dictionary()\n {\n { \"application\", \"my-application\" },\n { \"environment\", JsonSerializer.Deserialize(\"\"\"\n {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n \"\"\") }\n })\n .Name(\"my-api-key\")\n .RoleDescriptors([new Dictionary()\n {\n { \"role-a\", new()\n {\n Cluster = [ClusterPrivilege.All],\n Indices = [new()\n {\n Names = [\"index-a*\"],\n Privileges = [IndexPrivilege.Read]\n }]\n } },\n { \"role-b\", new()\n {\n Cluster = [ClusterPrivilege.All],\n Indices = [new()\n {\n Names = [\"index-b*\"],\n Privileges = [IndexPrivilege.All]\n }]\n } }\n }])\n )\n .GrantType(ApiKeyGrantType.Password)\n .Password(\"x-pack-test-password\")\n .Username(\"test_admin\")\n );" - lang: Java source: "client.security().grantApiKey(g -> g\n .apiKey(a -> a\n .name(\"my-api-key\")\n .expiration(e -> e\n .time(\"1d\")\n )\n .roleDescriptors(Map.of(\"role-b\", RoleDescriptor.roleDescriptorOf(r -> r\n .cluster(\"all\")\n .indices(i -> i\n .names(\"index-b*\")\n .privileges(\"all\")\n )\n ),\"role-a\", RoleDescriptor.roleDescriptorOf(r -> r\n .cluster(\"all\")\n .indices(i -> i\n .names(\"index-a*\")\n .privileges(\"read\")\n )\n )))\n .metadata(Map.of(\"environment\", JsonData.fromJson(\"\"\"\n{\"level\":1,\"trusted\":true,\"tags\":[\"dev\",\"staging\"]}\n\"\"\"),\"application\", JsonData.fromJson(\"\\\"my-application\\\"\")))\n )\n .grantType(ApiKeyGrantType.Password)\n .password(\"x-pack-test-password\")\n .username(\"test_admin\")\n);\n" SecurityGrantApiKeyRequestExample2: summary: Grant an API key with run_as description: "Run `POST /_security/api_key/grant`. The user (`test_admin`) whose credentials are provided can \"run as\" another user (`test_user`). The API key will be granted to the impersonated user (`test_user`).\n" value: "{\n \"grant_type\": \"password\",\n \"username\" : \"test_admin\", \n \"password\" : \"x-pack-test-password\", \n \"run_as\": \"test_user\", \n \"api_key\" : {\n \"name\": \"another-api-key\"\n }\n}" x-codeSamples: - lang: Console source: "POST /_security/api_key/grant\n{\n \"grant_type\": \"password\",\n \"username\" : \"test_admin\", \n \"password\" : \"x-pack-test-password\", \n \"run_as\": \"test_user\", \n \"api_key\" : {\n \"name\": \"another-api-key\"\n }\n}" - lang: Python source: "resp = client.security.grant_api_key(\n grant_type=\"password\",\n username=\"test_admin\",\n password=\"x-pack-test-password\",\n run_as=\"test_user\",\n api_key={\n \"name\": \"another-api-key\"\n },\n)" - lang: JavaScript source: "const response = await client.security.grantApiKey({\n grant_type: \"password\",\n username: \"test_admin\",\n password: \"x-pack-test-password\",\n run_as: \"test_user\",\n api_key: {\n name: \"another-api-key\",\n },\n});" - lang: Ruby source: "response = client.security.grant_api_key(\n body: {\n \"grant_type\": \"password\",\n \"username\": \"test_admin\",\n \"password\": \"x-pack-test-password\",\n \"run_as\": \"test_user\",\n \"api_key\": {\n \"name\": \"another-api-key\"\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->grantApiKey([\n \"body\" => [\n \"grant_type\" => \"password\",\n \"username\" => \"test_admin\",\n \"password\" => \"x-pack-test-password\",\n \"run_as\" => \"test_user\",\n \"api_key\" => [\n \"name\" => \"another-api-key\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"grant_type":"password","username":"test_admin","password":"x-pack-test-password","run_as":"test_user","api_key":{"name":"another-api-key"}}'' "$ELASTICSEARCH_URL/_security/api_key/grant"' - lang: C# source: "var response = await client.Security\n .GrantApiKeyAsync(d1 => d1\n .ApiKey(d2 => d2\n .Name(\"another-api-key\")\n )\n .GrantType(ApiKeyGrantType.Password)\n .Password(\"x-pack-test-password\")\n .RunAs(\"test_user\")\n .Username(\"test_admin\")\n );" - lang: Java source: "client.security().grantApiKey(g -> g\n .apiKey(a -> a\n .name(\"another-api-key\")\n )\n .grantType(ApiKeyGrantType.Password)\n .password(\"x-pack-test-password\")\n .runAs(\"test_user\")\n .username(\"test_admin\")\n);\n" SecurityGrantApiKeyRequestExample3: summary: Grant an API key to a user-managed service account description: "Run `POST /_security/api_key/grant` to create an API key on behalf of the `apps/worker` user-managed service account, by presenting one of its service account tokens. This request needs to be made by an authenticated user with the `grant_api_key` cluster privilege; the service account itself does not need any API key privileges. The API key is owned by the service account and is limited by the roles assigned to it.\n" value: "{\n \"grant_type\": \"_user_managed_service_account\",\n \"service_account_token\": \"AAEAAWFwcHMvd29ya2VyL3Rva2VuLTE6cjVXYVYzYmFMU19pT0V4UW9FTkg3UQ\",\n \"api_key\": {\n \"name\": \"worker-key\",\n \"expiration\": \"1d\"\n }\n}" x-codeSamples: - lang: Console source: "POST /_security/api_key/grant\n{\n \"grant_type\": \"_user_managed_service_account\",\n \"service_account_token\": \"AAEAAWFwcHMvd29ya2VyL3Rva2VuLTE6cjVXYVYzYmFMU19pT0V4UW9FTkg3UQ\",\n \"api_key\": {\n \"name\": \"worker-key\",\n \"expiration\": \"1d\"\n }\n}" - lang: Python source: "resp = client.security.grant_api_key(\n grant_type=\"_user_managed_service_account\",\n service_account_token=\"AAEAAWFwcHMvd29ya2VyL3Rva2VuLTE6cjVXYVYzYmFMU19pT0V4UW9FTkg3UQ\",\n api_key={\n \"name\": \"worker-key\",\n \"expiration\": \"1d\"\n },\n)" - lang: JavaScript source: "const response = await client.security.grantApiKey({\n grant_type: \"_user_managed_service_account\",\n service_account_token:\n \"AAEAAWFwcHMvd29ya2VyL3Rva2VuLTE6cjVXYVYzYmFMU19pT0V4UW9FTkg3UQ\",\n api_key: {\n name: \"worker-key\",\n expiration: \"1d\",\n },\n});" - lang: Ruby source: "response = client.security.grant_api_key(\n body: {\n \"grant_type\": \"_user_managed_service_account\",\n \"service_account_token\": \"AAEAAWFwcHMvd29ya2VyL3Rva2VuLTE6cjVXYVYzYmFMU19pT0V4UW9FTkg3UQ\",\n \"api_key\": {\n \"name\": \"worker-key\",\n \"expiration\": \"1d\"\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->grantApiKey([\n \"body\" => [\n \"grant_type\" => \"_user_managed_service_account\",\n \"service_account_token\" => \"AAEAAWFwcHMvd29ya2VyL3Rva2VuLTE6cjVXYVYzYmFMU19pT0V4UW9FTkg3UQ\",\n \"api_key\" => [\n \"name\" => \"worker-key\",\n \"expiration\" => \"1d\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"grant_type":"_user_managed_service_account","service_account_token":"AAEAAWFwcHMvd29ya2VyL3Rva2VuLTE6cjVXYVYzYmFMU19pT0V4UW9FTkg3UQ","api_key":{"name":"worker-key","expiration":"1d"}}'' "$ELASTICSEARCH_URL/_security/api_key/grant"' - lang: C# source: "var response = await client.Security\n .GrantApiKeyAsync(d1 => d1\n .ApiKey(d2 => d2\n .Expiration(\"1d\")\n .Name(\"worker-key\")\n )\n .GrantType(ApiKeyGrantType.UserManagedServiceAccount)\n .ServiceAccountToken(\"AAEAAWFwcHMvd29ya2VyL3Rva2VuLTE6cjVXYVYzYmFMU19pT0V4UW9FTkg3UQ\")\n );" required: true responses: '200': description: '' content: application/json: schema: required: - api_key - id - name - encoded type: object properties: api_key: type: string id: allOf: - $ref: '#/components/schemas/_types.Id' name: allOf: - $ref: '#/components/schemas/_types.Name' expiration: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' encoded: type: string x-state: Generally available; Added in 7.9.0 x-codeSamples: - lang: Console source: "POST /_security/api_key/grant\n{\n \"grant_type\": \"password\",\n \"username\" : \"test_admin\",\n \"password\" : \"x-pack-test-password\",\n \"api_key\" : {\n \"name\": \"my-api-key\",\n \"expiration\": \"1d\",\n \"role_descriptors\": {\n \"role-a\": {\n \"cluster\": [\"all\"],\n \"indices\": [\n {\n \"names\": [\"index-a*\"],\n \"privileges\": [\"read\"]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\"all\"],\n \"indices\": [\n {\n \"names\": [\"index-b*\"],\n \"privileges\": [\"all\"]\n }\n ]\n }\n },\n \"metadata\": {\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\"dev\", \"staging\"]\n }\n }\n }\n}" - lang: Python source: "resp = client.security.grant_api_key(\n grant_type=\"password\",\n username=\"test_admin\",\n password=\"x-pack-test-password\",\n api_key={\n \"name\": \"my-api-key\",\n \"expiration\": \"1d\",\n \"role_descriptors\": {\n \"role-a\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-a*\"\n ],\n \"privileges\": [\n \"read\"\n ]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-b*\"\n ],\n \"privileges\": [\n \"all\"\n ]\n }\n ]\n }\n },\n \"metadata\": {\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": True,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.security.grantApiKey({\n grant_type: \"password\",\n username: \"test_admin\",\n password: \"x-pack-test-password\",\n api_key: {\n name: \"my-api-key\",\n expiration: \"1d\",\n role_descriptors: {\n \"role-a\": {\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index-a*\"],\n privileges: [\"read\"],\n },\n ],\n },\n \"role-b\": {\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index-b*\"],\n privileges: [\"all\"],\n },\n ],\n },\n },\n metadata: {\n application: \"my-application\",\n environment: {\n level: 1,\n trusted: true,\n tags: [\"dev\", \"staging\"],\n },\n },\n },\n});" - lang: Ruby source: "response = client.security.grant_api_key(\n body: {\n \"grant_type\": \"password\",\n \"username\": \"test_admin\",\n \"password\": \"x-pack-test-password\",\n \"api_key\": {\n \"name\": \"my-api-key\",\n \"expiration\": \"1d\",\n \"role_descriptors\": {\n \"role-a\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-a*\"\n ],\n \"privileges\": [\n \"read\"\n ]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-b*\"\n ],\n \"privileges\": [\n \"all\"\n ]\n }\n ]\n }\n },\n \"metadata\": {\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->grantApiKey([\n \"body\" => [\n \"grant_type\" => \"password\",\n \"username\" => \"test_admin\",\n \"password\" => \"x-pack-test-password\",\n \"api_key\" => [\n \"name\" => \"my-api-key\",\n \"expiration\" => \"1d\",\n \"role_descriptors\" => [\n \"role-a\" => [\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index-a*\",\n ),\n \"privileges\" => array(\n \"read\",\n ),\n ],\n ),\n ],\n \"role-b\" => [\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index-b*\",\n ),\n \"privileges\" => array(\n \"all\",\n ),\n ],\n ),\n ],\n ],\n \"metadata\" => [\n \"application\" => \"my-application\",\n \"environment\" => [\n \"level\" => 1,\n \"trusted\" => true,\n \"tags\" => array(\n \"dev\",\n \"staging\",\n ),\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"grant_type":"password","username":"test_admin","password":"x-pack-test-password","api_key":{"name":"my-api-key","expiration":"1d","role_descriptors":{"role-a":{"cluster":["all"],"indices":[{"names":["index-a*"],"privileges":["read"]}]},"role-b":{"cluster":["all"],"indices":[{"names":["index-b*"],"privileges":["all"]}]}},"metadata":{"application":"my-application","environment":{"level":1,"trusted":true,"tags":["dev","staging"]}}}}'' "$ELASTICSEARCH_URL/_security/api_key/grant"' - lang: C# source: "var response = await client.Security\n .GrantApiKeyAsync(d1 => d1\n .ApiKey(d2 => d2\n .Expiration(\"1d\")\n .Metadata(new Dictionary()\n {\n { \"application\", \"my-application\" },\n { \"environment\", JsonSerializer.Deserialize(\"\"\"\n {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n \"\"\") }\n })\n .Name(\"my-api-key\")\n .RoleDescriptors([new Dictionary()\n {\n { \"role-a\", new()\n {\n Cluster = [ClusterPrivilege.All],\n Indices = [new()\n {\n Names = [\"index-a*\"],\n Privileges = [IndexPrivilege.Read]\n }]\n } },\n { \"role-b\", new()\n {\n Cluster = [ClusterPrivilege.All],\n Indices = [new()\n {\n Names = [\"index-b*\"],\n Privileges = [IndexPrivilege.All]\n }]\n } }\n }])\n )\n .GrantType(ApiKeyGrantType.Password)\n .Password(\"x-pack-test-password\")\n .Username(\"test_admin\")\n );" - lang: Java source: "client.security().grantApiKey(g -> g\n .apiKey(a -> a\n .name(\"my-api-key\")\n .expiration(e -> e\n .time(\"1d\")\n )\n .roleDescriptors(Map.of(\"role-b\", RoleDescriptor.roleDescriptorOf(r -> r\n .cluster(\"all\")\n .indices(i -> i\n .names(\"index-b*\")\n .privileges(\"all\")\n )\n ),\"role-a\", RoleDescriptor.roleDescriptorOf(r -> r\n .cluster(\"all\")\n .indices(i -> i\n .names(\"index-a*\")\n .privileges(\"read\")\n )\n )))\n .metadata(Map.of(\"environment\", JsonData.fromJson(\"\"\"\n{\"level\":1,\"trusted\":true,\"tags\":[\"dev\",\"staging\"]}\n\"\"\"),\"application\", JsonData.fromJson(\"\\\"my-application\\\"\")))\n )\n .grantType(ApiKeyGrantType.Password)\n .password(\"x-pack-test-password\")\n .username(\"test_admin\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_security/user/{user}/_has_privileges': post: tags: - security summary: "Check user privileges\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_security/user/_has_privileges\n
\n
\n POST\n /_security/user/_has_privileges\n
\n
\n GET\n /_security/user/{user}/_has_privileges\n
\n
\n POST\n /_security/user/{user}/_has_privileges\n
\n \n\nDetermine whether the specified user has a specified list of privileges.\nAll users can use this API, but only to determine their own privileges.\nTo check the privileges of other users, you must use the run as feature." externalDocs: description: About Elasticsearch privileges url: https://www.elastic.co/docs/reference/elasticsearch/security-privileges x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-has-privileges.html operationId: security-has-privileges parameters: - $ref: '#/components/parameters/security.has_privileges-user' requestBody: $ref: '#/components/requestBodies/security.has_privileges' responses: '200': $ref: '#/components/responses/security.has_privileges-200' x-state: Generally available; Added in 6.4.0 x-codeSamples: - lang: Console source: "GET /_security/user/_has_privileges\n{\n \"cluster\": [ \"monitor\", \"manage\" ],\n \"index\" : [\n {\n \"names\": [ \"suppliers\", \"products\" ],\n \"privileges\": [ \"read\" ]\n },\n {\n \"names\": [ \"inventory\" ],\n \"privileges\" : [ \"read\", \"write\" ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\" : [ \"read\", \"data:write/inventory\" ],\n \"resources\" : [ \"product/1852563\" ]\n }\n ]\n}" - lang: Python source: "resp = client.security.has_privileges(\n cluster=[\n \"monitor\",\n \"manage\"\n ],\n index=[\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"read\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n application=[\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ],\n)" - lang: JavaScript source: "const response = await client.security.hasPrivileges({\n cluster: [\"monitor\", \"manage\"],\n index: [\n {\n names: [\"suppliers\", \"products\"],\n privileges: [\"read\"],\n },\n {\n names: [\"inventory\"],\n privileges: [\"read\", \"write\"],\n },\n ],\n application: [\n {\n application: \"inventory_manager\",\n privileges: [\"read\", \"data:write/inventory\"],\n resources: [\"product/1852563\"],\n },\n ],\n});" - lang: Ruby source: "response = client.security.has_privileges(\n body: {\n \"cluster\": [\n \"monitor\",\n \"manage\"\n ],\n \"index\": [\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"read\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->security()->hasPrivileges([\n \"body\" => [\n \"cluster\" => array(\n \"monitor\",\n \"manage\",\n ),\n \"index\" => array(\n [\n \"names\" => array(\n \"suppliers\",\n \"products\",\n ),\n \"privileges\" => array(\n \"read\",\n ),\n ],\n [\n \"names\" => array(\n \"inventory\",\n ),\n \"privileges\" => array(\n \"read\",\n \"write\",\n ),\n ],\n ),\n \"application\" => array(\n [\n \"application\" => \"inventory_manager\",\n \"privileges\" => array(\n \"read\",\n \"data:write/inventory\",\n ),\n \"resources\" => array(\n \"product/1852563\",\n ),\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"cluster":["monitor","manage"],"index":[{"names":["suppliers","products"],"privileges":["read"]},{"names":["inventory"],"privileges":["read","write"]}],"application":[{"application":"inventory_manager","privileges":["read","data:write/inventory"],"resources":["product/1852563"]}]}'' "$ELASTICSEARCH_URL/_security/user/_has_privileges"' - lang: C# source: "var response = await client.Security\n .HasPrivilegesAsync(d1 => d1\n .Application(d2 => d2\n .Application(\"inventory_manager\")\n .Privileges(\"read\", \"data:write/inventory\")\n .Resources(\"product/1852563\")\n )\n .Cluster(ClusterPrivilege.Monitor, ClusterPrivilege.Manage)\n .Index(d2 => d2\n .Names(new[] { \"suppliers\", \"products\" })\n .Privileges(IndexPrivilege.Read), d2 => d2\n .Names(new[] { \"inventory\" })\n .Privileges(IndexPrivilege.Read, IndexPrivilege.Write)\n )\n );" - lang: Java source: "client.security().hasPrivileges(h -> h\n .application(a -> a\n .application(\"inventory_manager\")\n .privileges(List.of(\"read\",\"data:write/inventory\"))\n .resources(\"product/1852563\")\n )\n .cluster(List.of(\"monitor\",\"manage\"))\n .index(List.of(IndexPrivilegesCheck.of(i -> i\n .names(List.of(\"suppliers\",\"products\"))\n .privileges(\"read\")\n ),IndexPrivilegesCheck.of(i -> i\n .names(\"inventory\")\n .privileges(List.of(\"read\",\"write\"))\n )))\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/profile/_has_privileges: post: tags: - security summary: "Check user profile privileges\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_security/profile/_has_privileges\n
\n
\n POST\n /_security/profile/_has_privileges\n
\n \n\nDetermine whether the users associated with the specified user profile IDs have all the requested privileges.\n\nNOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions. Individual users and external applications should not call this API directly.\nElastic reserves the right to change or remove this feature in future releases without prior notice.\n\n## Required authorization\n\n* Cluster privileges: `read_security`\n" externalDocs: description: Learn more about user profiles url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/user-profiles x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-has-privileges-user-profile.html operationId: security-has-privileges-user-profile requestBody: $ref: '#/components/requestBodies/security.has_privileges_user_profile' responses: '200': $ref: '#/components/responses/security.has_privileges_user_profile-200' x-state: Generally available; Added in 8.3.0 x-codeSamples: - lang: Console source: "POST /_security/profile/_has_privileges\n{\n \"uids\": [\n \"u_LQPnxDxEjIH0GOUoFkZr5Y57YUwSkL9Joiq-g4OCbPc_0\",\n \"u_rzRnxDgEHIH0GOUoFkZr5Y27YUwSk19Joiq=g4OCxxB_1\",\n \"u_does-not-exist_0\"\n ],\n \"privileges\": {\n \"cluster\": [ \"monitor\", \"create_snapshot\", \"manage_ml\" ],\n \"index\" : [\n {\n \"names\": [ \"suppliers\", \"products\" ],\n \"privileges\": [ \"create_doc\"]\n },\n {\n \"names\": [ \"inventory\" ],\n \"privileges\" : [ \"read\", \"write\" ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\" : [ \"read\", \"data:write/inventory\" ],\n \"resources\" : [ \"product/1852563\" ]\n }\n ]\n }\n}" - lang: Python source: "resp = client.security.has_privileges_user_profile(\n uids=[\n \"u_LQPnxDxEjIH0GOUoFkZr5Y57YUwSkL9Joiq-g4OCbPc_0\",\n \"u_rzRnxDgEHIH0GOUoFkZr5Y27YUwSk19Joiq=g4OCxxB_1\",\n \"u_does-not-exist_0\"\n ],\n privileges={\n \"cluster\": [\n \"monitor\",\n \"create_snapshot\",\n \"manage_ml\"\n ],\n \"index\": [\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"create_doc\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ]\n },\n)" - lang: JavaScript source: "const response = await client.security.hasPrivilegesUserProfile({\n uids: [\n \"u_LQPnxDxEjIH0GOUoFkZr5Y57YUwSkL9Joiq-g4OCbPc_0\",\n \"u_rzRnxDgEHIH0GOUoFkZr5Y27YUwSk19Joiq=g4OCxxB_1\",\n \"u_does-not-exist_0\",\n ],\n privileges: {\n cluster: [\"monitor\", \"create_snapshot\", \"manage_ml\"],\n index: [\n {\n names: [\"suppliers\", \"products\"],\n privileges: [\"create_doc\"],\n },\n {\n names: [\"inventory\"],\n privileges: [\"read\", \"write\"],\n },\n ],\n application: [\n {\n application: \"inventory_manager\",\n privileges: [\"read\", \"data:write/inventory\"],\n resources: [\"product/1852563\"],\n },\n ],\n },\n});" - lang: Ruby source: "response = client.security.has_privileges_user_profile(\n body: {\n \"uids\": [\n \"u_LQPnxDxEjIH0GOUoFkZr5Y57YUwSkL9Joiq-g4OCbPc_0\",\n \"u_rzRnxDgEHIH0GOUoFkZr5Y27YUwSk19Joiq=g4OCxxB_1\",\n \"u_does-not-exist_0\"\n ],\n \"privileges\": {\n \"cluster\": [\n \"monitor\",\n \"create_snapshot\",\n \"manage_ml\"\n ],\n \"index\": [\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"create_doc\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ]\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->hasPrivilegesUserProfile([\n \"body\" => [\n \"uids\" => array(\n \"u_LQPnxDxEjIH0GOUoFkZr5Y57YUwSkL9Joiq-g4OCbPc_0\",\n \"u_rzRnxDgEHIH0GOUoFkZr5Y27YUwSk19Joiq=g4OCxxB_1\",\n \"u_does-not-exist_0\",\n ),\n \"privileges\" => [\n \"cluster\" => array(\n \"monitor\",\n \"create_snapshot\",\n \"manage_ml\",\n ),\n \"index\" => array(\n [\n \"names\" => array(\n \"suppliers\",\n \"products\",\n ),\n \"privileges\" => array(\n \"create_doc\",\n ),\n ],\n [\n \"names\" => array(\n \"inventory\",\n ),\n \"privileges\" => array(\n \"read\",\n \"write\",\n ),\n ],\n ),\n \"application\" => array(\n [\n \"application\" => \"inventory_manager\",\n \"privileges\" => array(\n \"read\",\n \"data:write/inventory\",\n ),\n \"resources\" => array(\n \"product/1852563\",\n ),\n ],\n ),\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"uids":["u_LQPnxDxEjIH0GOUoFkZr5Y57YUwSkL9Joiq-g4OCbPc_0","u_rzRnxDgEHIH0GOUoFkZr5Y27YUwSk19Joiq=g4OCxxB_1","u_does-not-exist_0"],"privileges":{"cluster":["monitor","create_snapshot","manage_ml"],"index":[{"names":["suppliers","products"],"privileges":["create_doc"]},{"names":["inventory"],"privileges":["read","write"]}],"application":[{"application":"inventory_manager","privileges":["read","data:write/inventory"],"resources":["product/1852563"]}]}}'' "$ELASTICSEARCH_URL/_security/profile/_has_privileges"' - lang: C# source: "var response = await client.Security\n .HasPrivilegesUserProfileAsync(d1 => d1\n .Privileges(d2 => d2\n .Application(d3 => d3\n .Application(\"inventory_manager\")\n .Privileges(\"read\", \"data:write/inventory\")\n .Resources(\"product/1852563\")\n )\n .Cluster(ClusterPrivilege.Monitor, ClusterPrivilege.CreateSnapshot, ClusterPrivilege.ManageMl)\n .Index(d3 => d3\n .Names(new[] { \"suppliers\", \"products\" })\n .Privileges(IndexPrivilege.CreateDoc), d3 => d3\n .Names(new[] { \"inventory\" })\n .Privileges(IndexPrivilege.Read, IndexPrivilege.Write)\n )\n )\n .Uids(\"u_LQPnxDxEjIH0GOUoFkZr5Y57YUwSkL9Joiq-g4OCbPc_0\", \"u_rzRnxDgEHIH0GOUoFkZr5Y27YUwSk19Joiq=g4OCxxB_1\", \"u_does-not-exist_0\")\n );" - lang: Java source: "client.security().hasPrivilegesUserProfile(h -> h\n .privileges(p -> p\n .application(a -> a\n .application(\"inventory_manager\")\n .privileges(List.of(\"read\",\"data:write/inventory\"))\n .resources(\"product/1852563\")\n )\n .cluster(List.of(\"monitor\",\"create_snapshot\",\"manage_ml\"))\n .index(List.of(IndexPrivilegesCheck.of(i -> i\n .names(List.of(\"suppliers\",\"products\"))\n .privileges(\"create_doc\")\n ),IndexPrivilegesCheck.of(i -> i\n .names(\"inventory\")\n .privileges(List.of(\"read\",\"write\"))\n )))\n )\n .uids(List.of(\"u_LQPnxDxEjIH0GOUoFkZr5Y57YUwSkL9Joiq-g4OCbPc_0\",\"u_rzRnxDgEHIH0GOUoFkZr5Y27YUwSk19Joiq=g4OCxxB_1\",\"u_does-not-exist_0\"))\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/oidc/authenticate: post: tags: - security summary: Authenticate OpenID Connect description: "Exchange an OpenID Connect authentication response message for an Elasticsearch internal access token and refresh token that can be subsequently used for authentication.\n\nElasticsearch exposes all the necessary OpenID Connect related functionality with the OpenID Connect APIs.\nThese APIs are used internally by Kibana in order to provide OpenID Connect based authentication, but can also be used by other, custom web applications or other clients." operationId: security-oidc-authenticate requestBody: content: application/json: schema: required: - nonce - redirect_uri - state type: object properties: nonce: type: string description: "Associate a client session with an ID token and mitigate replay attacks.\nThis value needs to be the same as the one that was provided to the `/_security/oidc/prepare` API or the one that was generated by Elasticsearch and included in the response to that call." realm: type: string description: "The name of the OpenID Connect realm.\nThis property is useful in cases where multiple realms are defined." redirect_uri: type: string description: "The URL to which the OpenID Connect Provider redirected the User Agent in response to an authentication request after a successful authentication.\nThis URL must be provided as-is (URL encoded), taken from the body of the response or as the value of a location header in the response from the OpenID Connect Provider." state: type: string description: "Maintain state between the authentication request and the response.\nThis value needs to be the same as the one that was provided to the `/_security/oidc/prepare` API or the one that was generated by Elasticsearch and included in the response to that call." examples: OidcAuthenticateRequestExample1: description: "Run `POST /_security/oidc/authenticate` to exchange the response that was returned from the OpenID Connect Provider after a successful authentication for an Elasticsearch access token and refresh token. This example is from an authentication that uses the authorization code grant flow.\n" value: "{\n \"redirect_uri\" : \"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n \"state\" : \"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n \"nonce\" : \"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM\",\n \"realm\" : \"oidc1\"\n}" x-codeSamples: - lang: Console source: "POST /_security/oidc/authenticate\n{\n \"redirect_uri\" : \"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n \"state\" : \"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n \"nonce\" : \"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM\",\n \"realm\" : \"oidc1\"\n}" - lang: Python source: "resp = client.security.oidc_authenticate(\n redirect_uri=\"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n state=\"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n nonce=\"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM\",\n realm=\"oidc1\",\n)" - lang: JavaScript source: "const response = await client.security.oidcAuthenticate({\n redirect_uri:\n \"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n state: \"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n nonce: \"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM\",\n realm: \"oidc1\",\n});" - lang: Ruby source: "response = client.security.oidc_authenticate(\n body: {\n \"redirect_uri\": \"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n \"state\": \"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n \"nonce\": \"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM\",\n \"realm\": \"oidc1\"\n }\n)" - lang: PHP source: "$resp = $client->security()->oidcAuthenticate([\n \"body\" => [\n \"redirect_uri\" => \"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n \"state\" => \"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n \"nonce\" => \"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM\",\n \"realm\" => \"oidc1\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"redirect_uri":"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I","state":"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I","nonce":"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM","realm":"oidc1"}'' "$ELASTICSEARCH_URL/_security/oidc/authenticate"' - lang: C# source: "var response = await client.Security\n .OidcAuthenticateAsync(d1 => d1\n .Nonce(\"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM\")\n .Realm(\"oidc1\")\n .RedirectUri(\"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\")\n .State(\"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\")\n );" - lang: Java source: "client.security().oidcAuthenticate(o -> o\n .nonce(\"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM\")\n .realm(\"oidc1\")\n .redirectUri(\"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\")\n .state(\"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - access_token - expires_in - refresh_token - type type: object properties: access_token: type: string description: The Elasticsearch access token. expires_in: type: number description: The duration (in seconds) of the tokens. refresh_token: type: string description: The Elasticsearch refresh token. type: type: string description: The type of token. examples: OidcAuthenticateResponseExample1: description: "A successful response from `POST /_security/oidc/authenticate`. It contains the access and refresh tokens that were generated, the token duration (in seconds), and the type.\n" value: "{\n \"access_token\" : \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n \"type\" : \"Bearer\",\n \"expires_in\" : 1200,\n \"refresh_token\": \"vLBPvmAB6KvwvJZr27cS\"\n}" x-state: Generally available x-codeSamples: - lang: Console source: "POST /_security/oidc/authenticate\n{\n \"redirect_uri\" : \"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n \"state\" : \"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n \"nonce\" : \"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM\",\n \"realm\" : \"oidc1\"\n}" - lang: Python source: "resp = client.security.oidc_authenticate(\n redirect_uri=\"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n state=\"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n nonce=\"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM\",\n realm=\"oidc1\",\n)" - lang: JavaScript source: "const response = await client.security.oidcAuthenticate({\n redirect_uri:\n \"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n state: \"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n nonce: \"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM\",\n realm: \"oidc1\",\n});" - lang: Ruby source: "response = client.security.oidc_authenticate(\n body: {\n \"redirect_uri\": \"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n \"state\": \"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n \"nonce\": \"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM\",\n \"realm\": \"oidc1\"\n }\n)" - lang: PHP source: "$resp = $client->security()->oidcAuthenticate([\n \"body\" => [\n \"redirect_uri\" => \"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n \"state\" => \"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n \"nonce\" => \"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM\",\n \"realm\" => \"oidc1\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"redirect_uri":"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I","state":"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I","nonce":"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM","realm":"oidc1"}'' "$ELASTICSEARCH_URL/_security/oidc/authenticate"' - lang: C# source: "var response = await client.Security\n .OidcAuthenticateAsync(d1 => d1\n .Nonce(\"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM\")\n .Realm(\"oidc1\")\n .RedirectUri(\"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\")\n .State(\"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\")\n );" - lang: Java source: "client.security().oidcAuthenticate(o -> o\n .nonce(\"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM\")\n .realm(\"oidc1\")\n .redirectUri(\"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\")\n .state(\"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/oidc/logout: post: tags: - security summary: Logout of OpenID Connect description: "Invalidate an access token and a refresh token that were generated as a response to the `/_security/oidc/authenticate` API.\n\nIf the OpenID Connect authentication realm in Elasticsearch is accordingly configured, the response to this call will contain a URI pointing to the end session endpoint of the OpenID Connect Provider in order to perform single logout.\n\nElasticsearch exposes all the necessary OpenID Connect related functionality with the OpenID Connect APIs.\nThese APIs are used internally by Kibana in order to provide OpenID Connect based authentication, but can also be used by other, custom web applications or other clients." operationId: security-oidc-logout requestBody: content: application/json: schema: required: - token type: object properties: token: type: string description: The access token to be invalidated. refresh_token: type: string description: The refresh token to be invalidated. examples: OidcLogoutRequestExample1: description: Run `POST /_security/oidc/logout` to perform the logout. value: "{\n \"token\" : \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n \"refresh_token\": \"vLBPvmAB6KvwvJZr27cS\"\n}" x-codeSamples: - lang: Console source: "POST /_security/oidc/logout\n{\n \"token\" : \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n \"refresh_token\": \"vLBPvmAB6KvwvJZr27cS\"\n}" - lang: Python source: "resp = client.security.oidc_logout(\n token=\"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n refresh_token=\"vLBPvmAB6KvwvJZr27cS\",\n)" - lang: JavaScript source: "const response = await client.security.oidcLogout({\n token:\n \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n refresh_token: \"vLBPvmAB6KvwvJZr27cS\",\n});" - lang: Ruby source: "response = client.security.oidc_logout(\n body: {\n \"token\": \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n \"refresh_token\": \"vLBPvmAB6KvwvJZr27cS\"\n }\n)" - lang: PHP source: "$resp = $client->security()->oidcLogout([\n \"body\" => [\n \"token\" => \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n \"refresh_token\" => \"vLBPvmAB6KvwvJZr27cS\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"token":"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==","refresh_token":"vLBPvmAB6KvwvJZr27cS"}'' "$ELASTICSEARCH_URL/_security/oidc/logout"' - lang: C# source: "var response = await client.Security\n .OidcLogoutAsync(d1 => d1\n .RefreshToken(\"vLBPvmAB6KvwvJZr27cS\")\n .Token(\"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\")\n );" - lang: Java source: "client.security().oidcLogout(o -> o\n .refreshToken(\"vLBPvmAB6KvwvJZr27cS\")\n .token(\"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - redirect type: object properties: redirect: type: string description: A URI that points to the end session endpoint of the OpenID Connect Provider with all the parameters of the logout request as HTTP GET parameters. examples: OidcLogoutResponseExample1: description: 'A successful response from `POST /_security/oidc/logout`, which contains the URI pointing to the End Session Endpoint of the OpenID Connect Provider with all the parameters of the Logout Request as HTTP GET parameters.' value: "{\n \"redirect\" : \"https://op-provider.org/logout?id_token_hint=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c&post_logout_redirect_uri=http%3A%2F%2Foidc-kibana.elastic.co%2Floggedout&state=lGYK0EcSLjqH6pkT5EVZjC6eIW5YCGgywj2sxROO\"\n}" x-state: Generally available x-codeSamples: - lang: Console source: "POST /_security/oidc/logout\n{\n \"token\" : \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n \"refresh_token\": \"vLBPvmAB6KvwvJZr27cS\"\n}" - lang: Python source: "resp = client.security.oidc_logout(\n token=\"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n refresh_token=\"vLBPvmAB6KvwvJZr27cS\",\n)" - lang: JavaScript source: "const response = await client.security.oidcLogout({\n token:\n \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n refresh_token: \"vLBPvmAB6KvwvJZr27cS\",\n});" - lang: Ruby source: "response = client.security.oidc_logout(\n body: {\n \"token\": \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n \"refresh_token\": \"vLBPvmAB6KvwvJZr27cS\"\n }\n)" - lang: PHP source: "$resp = $client->security()->oidcLogout([\n \"body\" => [\n \"token\" => \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n \"refresh_token\" => \"vLBPvmAB6KvwvJZr27cS\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"token":"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==","refresh_token":"vLBPvmAB6KvwvJZr27cS"}'' "$ELASTICSEARCH_URL/_security/oidc/logout"' - lang: C# source: "var response = await client.Security\n .OidcLogoutAsync(d1 => d1\n .RefreshToken(\"vLBPvmAB6KvwvJZr27cS\")\n .Token(\"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\")\n );" - lang: Java source: "client.security().oidcLogout(o -> o\n .refreshToken(\"vLBPvmAB6KvwvJZr27cS\")\n .token(\"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/oidc/prepare: post: tags: - security summary: Prepare OpenID connect authentication description: "Create an oAuth 2.0 authentication request as a URL string based on the configuration of the OpenID Connect authentication realm in Elasticsearch.\n\nThe response of this API is a URL pointing to the Authorization Endpoint of the configured OpenID Connect Provider, which can be used to redirect the browser of the user in order to continue the authentication process.\n\nElasticsearch exposes all the necessary OpenID Connect related functionality with the OpenID Connect APIs.\nThese APIs are used internally by Kibana in order to provide OpenID Connect based authentication, but can also be used by other, custom web applications or other clients." operationId: security-oidc-prepare-authentication requestBody: content: application/json: schema: type: object properties: iss: type: string description: "In the case of a third party initiated single sign on, this is the issuer identifier for the OP that the RP is to send the authentication request to.\nIt cannot be specified when *realm* is specified.\nOne of *realm* or *iss* is required." login_hint: type: string description: "In the case of a third party initiated single sign on, it is a string value that is included in the authentication request as the *login_hint* parameter.\nThis parameter is not valid when *realm* is specified." nonce: type: string description: "The value used to associate a client session with an ID token and to mitigate replay attacks.\nIf the caller of the API does not provide a value, Elasticsearch will generate one with sufficient entropy and return it in the response." realm: type: string description: "The name of the OpenID Connect realm in Elasticsearch the configuration of which should be used in order to generate the authentication request.\nIt cannot be specified when *iss* is specified.\nOne of *realm* or *iss* is required." state: type: string description: "The value used to maintain state between the authentication request and the response, typically used as a Cross-Site Request Forgery mitigation.\nIf the caller of the API does not provide a value, Elasticsearch will generate one with sufficient entropy and return it in the response." examples: OidcPrepareAuthenticationRequestExample1: summary: Prepare with realm description: "Run `POST /_security/oidc/prepare` to generate an authentication request for the OpenID Connect Realm `oidc1`.\n" value: "{\n \"realm\" : \"oidc1\"\n}" x-codeSamples: - lang: Console source: "POST /_security/oidc/prepare\n{\n \"realm\" : \"oidc1\"\n}" - lang: Python source: "resp = client.security.oidc_prepare_authentication(\n realm=\"oidc1\",\n)" - lang: JavaScript source: "const response = await client.security.oidcPrepareAuthentication({\n realm: \"oidc1\",\n});" - lang: Ruby source: "response = client.security.oidc_prepare_authentication(\n body: {\n \"realm\": \"oidc1\"\n }\n)" - lang: PHP source: "$resp = $client->security()->oidcPrepareAuthentication([\n \"body\" => [\n \"realm\" => \"oidc1\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"realm":"oidc1"}'' "$ELASTICSEARCH_URL/_security/oidc/prepare"' - lang: C# source: "var response = await client.Security\n .OidcPrepareAuthenticationAsync(d1 => d1\n .Realm(\"oidc1\")\n );" - lang: Java source: "client.security().oidcPrepareAuthentication(o -> o\n .realm(\"oidc1\")\n);\n" OidcPrepareAuthenticationRequestExample2: summary: 'Prepare with realm, state, and nonce' description: "Run `POST /_security/oidc/prepare` to generate an authentication request for the OpenID Connect Realm `oidc1`, where the values for the `state` and the `nonce` have been generated by the client.\n" value: "{\n \"realm\" : \"oidc1\",\n \"state\" : \"lGYK0EcSLjqH6pkT5EVZjC6eIW5YCGgywj2sxROO\",\n \"nonce\" : \"zOBXLJGUooRrbLbQk5YCcyC8AXw3iloynvluYhZ5\"\n}" x-codeSamples: - lang: Console source: "POST /_security/oidc/prepare\n{\n \"realm\" : \"oidc1\",\n \"state\" : \"lGYK0EcSLjqH6pkT5EVZjC6eIW5YCGgywj2sxROO\",\n \"nonce\" : \"zOBXLJGUooRrbLbQk5YCcyC8AXw3iloynvluYhZ5\"\n}" - lang: Python source: "resp = client.security.oidc_prepare_authentication(\n realm=\"oidc1\",\n state=\"lGYK0EcSLjqH6pkT5EVZjC6eIW5YCGgywj2sxROO\",\n nonce=\"zOBXLJGUooRrbLbQk5YCcyC8AXw3iloynvluYhZ5\",\n)" - lang: JavaScript source: "const response = await client.security.oidcPrepareAuthentication({\n realm: \"oidc1\",\n state: \"lGYK0EcSLjqH6pkT5EVZjC6eIW5YCGgywj2sxROO\",\n nonce: \"zOBXLJGUooRrbLbQk5YCcyC8AXw3iloynvluYhZ5\",\n});" - lang: Ruby source: "response = client.security.oidc_prepare_authentication(\n body: {\n \"realm\": \"oidc1\",\n \"state\": \"lGYK0EcSLjqH6pkT5EVZjC6eIW5YCGgywj2sxROO\",\n \"nonce\": \"zOBXLJGUooRrbLbQk5YCcyC8AXw3iloynvluYhZ5\"\n }\n)" - lang: PHP source: "$resp = $client->security()->oidcPrepareAuthentication([\n \"body\" => [\n \"realm\" => \"oidc1\",\n \"state\" => \"lGYK0EcSLjqH6pkT5EVZjC6eIW5YCGgywj2sxROO\",\n \"nonce\" => \"zOBXLJGUooRrbLbQk5YCcyC8AXw3iloynvluYhZ5\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"realm":"oidc1","state":"lGYK0EcSLjqH6pkT5EVZjC6eIW5YCGgywj2sxROO","nonce":"zOBXLJGUooRrbLbQk5YCcyC8AXw3iloynvluYhZ5"}'' "$ELASTICSEARCH_URL/_security/oidc/prepare"' - lang: C# source: "var response = await client.Security\n .OidcPrepareAuthenticationAsync(d1 => d1\n .Nonce(\"zOBXLJGUooRrbLbQk5YCcyC8AXw3iloynvluYhZ5\")\n .Realm(\"oidc1\")\n .State(\"lGYK0EcSLjqH6pkT5EVZjC6eIW5YCGgywj2sxROO\")\n );" - lang: Java source: "client.security().oidcPrepareAuthentication(o -> o\n .nonce(\"zOBXLJGUooRrbLbQk5YCcyC8AXw3iloynvluYhZ5\")\n .realm(\"oidc1\")\n .state(\"lGYK0EcSLjqH6pkT5EVZjC6eIW5YCGgywj2sxROO\")\n);\n" OidcPrepareAuthenticationRequestExample3: summary: Prepare by realm description: "Run `POST /_security/oidc/prepare` to generate an authentication request for a third party initiated single sign on. Specify the issuer that should be used for matching the appropriate OpenID Connect Authentication realm.\n" value: "{\n \"iss\" : \"http://127.0.0.1:8080\",\n \"login_hint\": \"this_is_an_opaque_string\"\n}" x-codeSamples: - lang: Console source: "POST /_security/oidc/prepare\n{\n \"iss\" : \"http://127.0.0.1:8080\",\n \"login_hint\": \"this_is_an_opaque_string\"\n}" - lang: Python source: "resp = client.security.oidc_prepare_authentication(\n iss=\"http://127.0.0.1:8080\",\n login_hint=\"this_is_an_opaque_string\",\n)" - lang: JavaScript source: "const response = await client.security.oidcPrepareAuthentication({\n iss: \"http://127.0.0.1:8080\",\n login_hint: \"this_is_an_opaque_string\",\n});" - lang: Ruby source: "response = client.security.oidc_prepare_authentication(\n body: {\n \"iss\": \"http://127.0.0.1:8080\",\n \"login_hint\": \"this_is_an_opaque_string\"\n }\n)" - lang: PHP source: "$resp = $client->security()->oidcPrepareAuthentication([\n \"body\" => [\n \"iss\" => \"http://127.0.0.1:8080\",\n \"login_hint\" => \"this_is_an_opaque_string\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"iss":"http://127.0.0.1:8080","login_hint":"this_is_an_opaque_string"}'' "$ELASTICSEARCH_URL/_security/oidc/prepare"' - lang: C# source: "var response = await client.Security\n .OidcPrepareAuthenticationAsync(d1 => d1\n .Iss(\"http://127.0.0.1:8080\")\n .LoginHint(\"this_is_an_opaque_string\")\n );" - lang: Java source: "client.security().oidcPrepareAuthentication(o -> o\n .iss(\"http://127.0.0.1:8080\")\n .loginHint(\"this_is_an_opaque_string\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - nonce - realm - redirect - state type: object properties: nonce: type: string realm: type: string redirect: type: string description: A URI that points to the authorization endpoint of the OpenID Connect Provider with all the parameters of the authentication request as HTTP GET parameters. state: type: string examples: OidcPrepareAuthenticationResponseExample1: description: "A successful response from `POST /_security/oidc/prepare`. It contains the URI pointing to the Authorization Endpoint of the OpenID Connect Provider with all the parameters of the Authentication Request as HTTP GET parameters.\n" value: "{\n \"redirect\" : \"http://127.0.0.1:8080/c2id-login?scope=openid&response_type=id_token&redirect_uri=https%3A%2F%2Fmy.fantastic.rp%2Fcb&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I&nonce=WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM&client_id=elasticsearch-rp\",\n \"state\" : \"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n \"nonce\" : \"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM\",\n \"realm\" : \"oidc1\"\n}" x-state: Generally available x-codeSamples: - lang: Console source: "POST /_security/oidc/prepare\n{\n \"realm\" : \"oidc1\"\n}" - lang: Python source: "resp = client.security.oidc_prepare_authentication(\n realm=\"oidc1\",\n)" - lang: JavaScript source: "const response = await client.security.oidcPrepareAuthentication({\n realm: \"oidc1\",\n});" - lang: Ruby source: "response = client.security.oidc_prepare_authentication(\n body: {\n \"realm\": \"oidc1\"\n }\n)" - lang: PHP source: "$resp = $client->security()->oidcPrepareAuthentication([\n \"body\" => [\n \"realm\" => \"oidc1\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"realm":"oidc1"}'' "$ELASTICSEARCH_URL/_security/oidc/prepare"' - lang: C# source: "var response = await client.Security\n .OidcPrepareAuthenticationAsync(d1 => d1\n .Realm(\"oidc1\")\n );" - lang: Java source: "client.security().oidcPrepareAuthentication(o -> o\n .realm(\"oidc1\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/privilege: post: tags: - security summary: "Create or update application privileges\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_security/privilege\n
\n
\n POST\n /_security/privilege\n
\n \n\nTo use this API, you must have one of the following privileges:\n\n* The `manage_security` cluster privilege (or a greater privilege such as `all`).\n* The \"Manage Application Privileges\" global privilege for the application being referenced in the request.\n\nApplication names are formed from a prefix, with an optional suffix that conform to the following rules:\n\n* The prefix must begin with a lowercase ASCII letter.\n* The prefix must contain only ASCII letters or digits.\n* The prefix must be at least 3 characters long.\n* If the suffix exists, it must begin with either a dash `-` or `_`.\n* The suffix cannot contain any of the following characters: `\\`, `/`, `*`, `?`, `\"`, `<`, `>`, `|`, `,`, `*`.\n* No part of the name can contain whitespace.\n\nPrivilege names must begin with a lowercase ASCII letter and must contain only ASCII letters and digits along with the characters `_`, `-`, and `.`.\n\nAction names can contain any number of printable ASCII characters and must contain at least one of the following characters: `/`, `*`, `:`.\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" externalDocs: description: About Elasticsearch privileges url: https://www.elastic.co/docs/reference/elasticsearch/security-privileges x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-put-privileges.html operationId: security-put-privileges parameters: - $ref: '#/components/parameters/security.put_privileges-refresh' requestBody: $ref: '#/components/requestBodies/security.put_privileges' responses: '200': $ref: '#/components/responses/security.put_privileges-200' x-state: Generally available; Added in 6.4.0 x-codeSamples: - lang: Console source: "PUT /_security/privilege\n{\n \"myapp\": {\n \"read\": {\n \"actions\": [ \n \"data:read/*\" , \n \"action:login\" ],\n \"metadata\": { \n \"description\": \"Read access to myapp\"\n }\n }\n }\n}" - lang: Python source: "resp = client.security.put_privileges(\n privileges={\n \"myapp\": {\n \"read\": {\n \"actions\": [\n \"data:read/*\",\n \"action:login\"\n ],\n \"metadata\": {\n \"description\": \"Read access to myapp\"\n }\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.security.putPrivileges({\n privileges: {\n myapp: {\n read: {\n actions: [\"data:read/*\", \"action:login\"],\n metadata: {\n description: \"Read access to myapp\",\n },\n },\n },\n },\n});" - lang: Ruby source: "response = client.security.put_privileges(\n body: {\n \"myapp\": {\n \"read\": {\n \"actions\": [\n \"data:read/*\",\n \"action:login\"\n ],\n \"metadata\": {\n \"description\": \"Read access to myapp\"\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->putPrivileges([\n \"body\" => [\n \"myapp\" => [\n \"read\" => [\n \"actions\" => array(\n \"data:read/*\",\n \"action:login\",\n ),\n \"metadata\" => [\n \"description\" => \"Read access to myapp\",\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"myapp":{"read":{"actions":["data:read/*","action:login"],"metadata":{"description":"Read access to myapp"}}}}'' "$ELASTICSEARCH_URL/_security/privilege"' - lang: C# source: "var response = await client.Security\n .PutPrivilegesAsync(d1 => d1\n .Privileges(new Dictionary>()\n {\n { \"myapp\", new Dictionary()\n {\n { \"read\", new()\n {\n Actions = [\"data:read/*\", \"action:login\"],\n Metadata = new Dictionary()\n {\n { \"description\", \"Read access to myapp\" }\n }\n } }\n } }\n })\n );" - lang: Java source: "client.security().putPrivileges(p -> p\n .privileges(\"myapp\", Map.of(\"read\", Actions.of(a -> a\n .actions(List.of(\"data:read/*\",\"action:login\"))\n .metadata(\"description\", JsonData.fromJson(\"\\\"Read access to myapp\\\"\"))\n )))\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/_query/api_key: post: tags: - security summary: "Find API keys with a query\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_security/_query/api_key\n
\n
\n POST\n /_security/_query/api_key\n
\n \n\nGet a paginated list of API keys and their information.\nYou can optionally filter the results with a query.\n\nTo use this API, you must have at least the `manage_own_api_key` or the `read_security` cluster privileges.\nIf you have only the `manage_own_api_key` privilege, this API returns only the API keys that you own.\nIf you have the `read_security`, `manage_api_key`, or greater privileges (including `manage_security`), this API returns all API keys regardless of ownership.\nRefer to the linked documentation for examples of how to find API keys:\n\n## Required authorization\n\n* Cluster privileges: `manage_own_api_key`,`read_security`\n" externalDocs: description: About query API key information url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/query-api-keys x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-query-api-key.html operationId: security-query-api-keys parameters: - $ref: '#/components/parameters/security.query_api_keys-with_limited_by' - $ref: '#/components/parameters/security.query_api_keys-with_profile_uid' - $ref: '#/components/parameters/security.query_api_keys-typed_keys' requestBody: $ref: '#/components/requestBodies/security.query_api_keys' responses: '200': $ref: '#/components/responses/security.query_api_keys-200' x-state: Generally available; Added in 7.15.0 x-codeSamples: - lang: Console source: "GET /_security/_query/api_key?with_limited_by=true\n{\n \"query\": {\n \"ids\": {\n \"values\": [\n \"VuaCfGcBCdbkQm-e5aOx\"\n ]\n }\n }\n}" - lang: Python source: "resp = client.security.query_api_keys(\n with_limited_by=True,\n query={\n \"ids\": {\n \"values\": [\n \"VuaCfGcBCdbkQm-e5aOx\"\n ]\n }\n },\n)" - lang: JavaScript source: "const response = await client.security.queryApiKeys({\n with_limited_by: \"true\",\n query: {\n ids: {\n values: [\"VuaCfGcBCdbkQm-e5aOx\"],\n },\n },\n});" - lang: Ruby source: "response = client.security.query_api_keys(\n with_limited_by: \"true\",\n body: {\n \"query\": {\n \"ids\": {\n \"values\": [\n \"VuaCfGcBCdbkQm-e5aOx\"\n ]\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->queryApiKeys([\n \"with_limited_by\" => \"true\",\n \"body\" => [\n \"query\" => [\n \"ids\" => [\n \"values\" => array(\n \"VuaCfGcBCdbkQm-e5aOx\",\n ),\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":{"ids":{"values":["VuaCfGcBCdbkQm-e5aOx"]}}}'' "$ELASTICSEARCH_URL/_security/_query/api_key?with_limited_by=true"' - lang: C# source: "var response = await client.Security\n .QueryApiKeysAsync(d1 => d1\n .WithLimitedBy(true)\n .Query(d2 => d2\n .Ids(d3 => d3\n .Values(new[] { \"VuaCfGcBCdbkQm-e5aOx\" })\n )\n )\n );" - lang: Java source: "client.security().queryApiKeys(q -> q\n .query(qu -> qu\n .ids(i -> i\n .values(\"VuaCfGcBCdbkQm-e5aOx\")\n )\n )\n .withLimitedBy(true)\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/_query/role: post: tags: - security summary: "Find roles with a query\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_security/_query/role\n
\n
\n POST\n /_security/_query/role\n
\n \n\nGet roles in a paginated manner.\nThe role management APIs are generally the preferred way to manage roles, rather than using file-based role management.\nThe query roles API does not retrieve roles that are defined in roles files, nor built-in ones.\nYou can optionally filter the results with a query.\nAlso, the results can be paginated and sorted.\n\n## Required authorization\n\n* Cluster privileges: `read_security`\n" operationId: security-query-role requestBody: $ref: '#/components/requestBodies/security.query_role' responses: '200': $ref: '#/components/responses/security.query_role-200' x-state: Generally available; Added in 8.15.0 x-codeSamples: - lang: Console source: "POST /_security/_query/role\n{\n \"sort\": [\"name\"]\n}" - lang: Python source: "resp = client.security.query_role(\n sort=[\n \"name\"\n ],\n)" - lang: JavaScript source: "const response = await client.security.queryRole({\n sort: [\"name\"],\n});" - lang: Ruby source: "response = client.security.query_role(\n body: {\n \"sort\": [\n \"name\"\n ]\n }\n)" - lang: PHP source: "$resp = $client->security()->queryRole([\n \"body\" => [\n \"sort\" => array(\n \"name\",\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"sort":["name"]}'' "$ELASTICSEARCH_URL/_security/_query/role"' - lang: C# source: "var response = await client.Security\n .QueryRoleAsync(d1 => d1\n .Sort(d2 => d2\n .Field(d3 => d3\n .Field(x => x.Name)\n )\n )\n );" - lang: Java source: "client.security().queryRole(q -> q\n .sort(s -> s\n .field(f -> f\n .field(\"name\")\n )\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/_query/user: post: tags: - security summary: "Find users with a query\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_security/_query/user\n
\n
\n POST\n /_security/_query/user\n
\n \n\nGet information for users in a paginated manner.\nYou can optionally filter the results with a query.\n\nNOTE: As opposed to the get user API, built-in users are excluded from the result.\nThis API is only for native users.\n\n## Required authorization\n\n* Cluster privileges: `read_security`\n" operationId: security-query-user parameters: - $ref: '#/components/parameters/security.query_user-with_profile_uid' requestBody: $ref: '#/components/requestBodies/security.query_user' responses: '200': $ref: '#/components/responses/security.query_user-200' x-state: Generally available; Added in 8.14.0 x-codeSamples: - lang: Console source: "POST /_security/_query/user?with_profile_uid=true\n{\n \"query\": {\n \"prefix\": {\n \"roles\": \"other\"\n }\n }\n}" - lang: Python source: "resp = client.security.query_user(\n with_profile_uid=True,\n query={\n \"prefix\": {\n \"roles\": \"other\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.security.queryUser({\n with_profile_uid: \"true\",\n query: {\n prefix: {\n roles: \"other\",\n },\n },\n});" - lang: Ruby source: "response = client.security.query_user(\n with_profile_uid: \"true\",\n body: {\n \"query\": {\n \"prefix\": {\n \"roles\": \"other\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->queryUser([\n \"with_profile_uid\" => \"true\",\n \"body\" => [\n \"query\" => [\n \"prefix\" => [\n \"roles\" => \"other\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":{"prefix":{"roles":"other"}}}'' "$ELASTICSEARCH_URL/_security/_query/user?with_profile_uid=true"' - lang: C# source: "var response = await client.Security\n .QueryUserAsync(d1 => d1\n .WithProfileUid(true)\n .Query(d2 => d2\n .Prefix(d3 => d3\n .Field(x => x.Roles)\n .Value(\"other\")\n )\n )\n );" - lang: Java source: "client.security().queryUser(q -> q\n .query(qu -> qu\n .prefix(p -> p\n .field(\"roles\")\n .value(\"other\")\n )\n )\n .withProfileUid(true)\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/saml/authenticate: post: tags: - security summary: Authenticate SAML description: "Submit a SAML response message to Elasticsearch for consumption.\n\nNOTE: This API is intended for use by custom web applications other than Kibana.\nIf you are using Kibana, refer to the documentation for configuring SAML single-sign-on on the Elastic Stack.\n\nThe SAML message that is submitted can be:\n\n* A response to a SAML authentication request that was previously created using the SAML prepare authentication API.\n* An unsolicited SAML message in the case of an IdP-initiated single sign-on (SSO) flow.\n\nIn either case, the SAML message needs to be a base64 encoded XML document with a root element of ``.\n\nAfter successful validation, Elasticsearch responds with an Elasticsearch internal access token and refresh token that can be subsequently used for authentication.\nThis API endpoint essentially exchanges SAML responses that indicate successful authentication in the IdP for Elasticsearch access and refresh tokens, which can be used for authentication against Elasticsearch." externalDocs: description: More about SAML authentication url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/saml x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-saml-authenticate.html operationId: security-saml-authenticate requestBody: content: application/json: schema: required: - content - ids type: object properties: content: type: string description: 'The SAML response as it was sent by the user''s browser, usually a Base64 encoded XML document.' ids: allOf: - $ref: '#/components/schemas/_types.Ids' description: A JSON array with all the valid SAML Request Ids that the caller of the API has for the current user. realm: type: string description: The name of the realm that should authenticate the SAML response. Useful in cases where many SAML realms are defined. examples: SamlAuthenticateRequestExample1: description: "Run `POST /_security/saml/authenticate` to exchange a SAML Response indicating a successful authentication at the SAML IdP for an Elasticsearch access token and refresh token to be used in subsequent requests.\n" value: "{\n \"content\" : \"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....\",\n \"ids\" : [\"4fee3b046395c4e751011e97f8900b5273d56685\"]\n}" x-codeSamples: - lang: Console source: "POST /_security/saml/authenticate\n{\n \"content\" : \"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....\",\n \"ids\" : [\"4fee3b046395c4e751011e97f8900b5273d56685\"]\n}" - lang: Python source: "resp = client.security.saml_authenticate(\n content=\"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....\",\n ids=[\n \"4fee3b046395c4e751011e97f8900b5273d56685\"\n ],\n)" - lang: JavaScript source: "const response = await client.security.samlAuthenticate({\n content:\n \"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....\",\n ids: [\"4fee3b046395c4e751011e97f8900b5273d56685\"],\n});" - lang: Ruby source: "response = client.security.saml_authenticate(\n body: {\n \"content\": \"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....\",\n \"ids\": [\n \"4fee3b046395c4e751011e97f8900b5273d56685\"\n ]\n }\n)" - lang: PHP source: "$resp = $client->security()->samlAuthenticate([\n \"body\" => [\n \"content\" => \"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....\",\n \"ids\" => array(\n \"4fee3b046395c4e751011e97f8900b5273d56685\",\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"content":"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....","ids":["4fee3b046395c4e751011e97f8900b5273d56685"]}'' "$ELASTICSEARCH_URL/_security/saml/authenticate"' - lang: C# source: "var response = await client.Security\n .SamlAuthenticateAsync(d1 => d1\n .Content(\"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....\")\n .Ids(new[] { \"4fee3b046395c4e751011e97f8900b5273d56685\" })\n );" - lang: Java source: "client.security().samlAuthenticate(s -> s\n .content(\"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....\")\n .ids(\"4fee3b046395c4e751011e97f8900b5273d56685\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - access_token - username - expires_in - refresh_token - realm type: object properties: access_token: type: string description: The access token that was generated by Elasticsearch. username: type: string description: The authenticated user's name. expires_in: type: number description: The amount of time (in seconds) left until the token expires. refresh_token: type: string description: The refresh token that was generated by Elasticsearch. realm: type: string description: The name of the realm where the user was authenticated. in_response_to: type: string description: The id of the request that initiated the authentication process. examples: SamlAuthenticateResponseExample1: description: A successful response from `POST /_security/saml/authenticate`. value: "{\n \"access_token\" : \"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3\",\n \"username\" : \"Bearer\",\n \"expires_in\" : 1200,\n \"refresh_token\": \"mJdXLtmvTUSpoLwMvdBt_w\",\n \"realm\": \"saml1\",\n \"in_response_to\": \"4fee3b046395c4e751011e97f8900b5273d56685\"\n}" x-state: Generally available; Added in 7.5.0 x-codeSamples: - lang: Console source: "POST /_security/saml/authenticate\n{\n \"content\" : \"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....\",\n \"ids\" : [\"4fee3b046395c4e751011e97f8900b5273d56685\"]\n}" - lang: Python source: "resp = client.security.saml_authenticate(\n content=\"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....\",\n ids=[\n \"4fee3b046395c4e751011e97f8900b5273d56685\"\n ],\n)" - lang: JavaScript source: "const response = await client.security.samlAuthenticate({\n content:\n \"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....\",\n ids: [\"4fee3b046395c4e751011e97f8900b5273d56685\"],\n});" - lang: Ruby source: "response = client.security.saml_authenticate(\n body: {\n \"content\": \"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....\",\n \"ids\": [\n \"4fee3b046395c4e751011e97f8900b5273d56685\"\n ]\n }\n)" - lang: PHP source: "$resp = $client->security()->samlAuthenticate([\n \"body\" => [\n \"content\" => \"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....\",\n \"ids\" => array(\n \"4fee3b046395c4e751011e97f8900b5273d56685\",\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"content":"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....","ids":["4fee3b046395c4e751011e97f8900b5273d56685"]}'' "$ELASTICSEARCH_URL/_security/saml/authenticate"' - lang: C# source: "var response = await client.Security\n .SamlAuthenticateAsync(d1 => d1\n .Content(\"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....\")\n .Ids(new[] { \"4fee3b046395c4e751011e97f8900b5273d56685\" })\n );" - lang: Java source: "client.security().samlAuthenticate(s -> s\n .content(\"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....\")\n .ids(\"4fee3b046395c4e751011e97f8900b5273d56685\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/saml/complete_logout: post: tags: - security summary: Logout of SAML completely description: "Verifies the logout response sent from the SAML IdP.\n\nNOTE: This API is intended for use by custom web applications other than Kibana.\nIf you are using Kibana, refer to the documentation for configuring SAML single-sign-on on the Elastic Stack.\n\nThe SAML IdP may send a logout response back to the SP after handling the SP-initiated SAML Single Logout.\nThis API verifies the response by ensuring the content is relevant and validating its signature.\nAn empty response is returned if the verification process is successful.\nThe response can be sent by the IdP with either the HTTP-Redirect or the HTTP-Post binding.\nThe caller of this API must prepare the request accordingly so that this API can handle either of them." externalDocs: description: More about SAML authentication url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/saml x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-saml-complete-logout.html operationId: security-saml-complete-logout requestBody: content: application/json: schema: required: - realm - ids type: object properties: realm: type: string description: The name of the SAML realm in Elasticsearch for which the configuration is used to verify the logout response. ids: allOf: - $ref: '#/components/schemas/_types.Ids' description: A JSON array with all the valid SAML Request Ids that the caller of the API has for the current user. query_string: type: string description: 'If the SAML IdP sends the logout response with the HTTP-Redirect binding, this field must be set to the query string of the redirect URI.' content: type: string description: 'If the SAML IdP sends the logout response with the HTTP-Post binding, this field must be set to the value of the SAMLResponse form parameter from the logout response.' examples: SamlCompleteLogoutRequestExample1: summary: HTTP-Redirect binding description: "Run `POST /_security/saml/complete_logout` to verify the logout response sent by the SAML IdP using the HTTP-Redirect binding.\n" value: "{\n \"realm\": \"saml1\",\n \"ids\": [ \"_1c368075e0b3...\" ],\n \"query_string\": \"SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK...\"\n}" x-codeSamples: - lang: Console source: "POST /_security/saml/complete_logout\n{\n \"realm\": \"saml1\",\n \"ids\": [ \"_1c368075e0b3...\" ],\n \"query_string\": \"SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK...\"\n}" - lang: Python source: "resp = client.security.saml_complete_logout(\n realm=\"saml1\",\n ids=[\n \"_1c368075e0b3...\"\n ],\n query_string=\"SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK...\",\n)" - lang: JavaScript source: "const response = await client.security.samlCompleteLogout({\n realm: \"saml1\",\n ids: [\"_1c368075e0b3...\"],\n query_string:\n \"SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK...\",\n});" - lang: Ruby source: "response = client.security.saml_complete_logout(\n body: {\n \"realm\": \"saml1\",\n \"ids\": [\n \"_1c368075e0b3...\"\n ],\n \"query_string\": \"SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK...\"\n }\n)" - lang: PHP source: "$resp = $client->security()->samlCompleteLogout([\n \"body\" => [\n \"realm\" => \"saml1\",\n \"ids\" => array(\n \"_1c368075e0b3...\",\n ),\n \"query_string\" => \"SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK...\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"realm":"saml1","ids":["_1c368075e0b3..."],"query_string":"SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK..."}'' "$ELASTICSEARCH_URL/_security/saml/complete_logout"' - lang: C# source: "var response = await client.Security\n .SamlCompleteLogoutAsync(d1 => d1\n .Ids(new[] { \"_1c368075e0b3...\" })\n .QueryString(\"SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK...\")\n .Realm(\"saml1\")\n );" - lang: Java source: "client.security().samlCompleteLogout(s -> s\n .ids(\"_1c368075e0b3...\")\n .queryString(\"SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK...\")\n .realm(\"saml1\")\n);\n" SamlCompleteLogoutRequestExample2: summary: HTTP-Post binding description: "Run `POST /_security/saml/complete_logout` to verify the logout response sent by the SAML IdP using the HTTP-Post binding.\n" value: "{\n \"realm\": \"saml1\",\n \"ids\": [ \"_1c368075e0b3...\" ],\n \"content\": \"PHNhbWxwOkxvZ291dFJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46...\"\n}" x-codeSamples: - lang: Console source: "POST /_security/saml/complete_logout\n{\n \"realm\": \"saml1\",\n \"ids\": [ \"_1c368075e0b3...\" ],\n \"content\": \"PHNhbWxwOkxvZ291dFJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46...\"\n}" - lang: Python source: "resp = client.security.saml_complete_logout(\n realm=\"saml1\",\n ids=[\n \"_1c368075e0b3...\"\n ],\n content=\"PHNhbWxwOkxvZ291dFJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46...\",\n)" - lang: JavaScript source: "const response = await client.security.samlCompleteLogout({\n realm: \"saml1\",\n ids: [\"_1c368075e0b3...\"],\n content: \"PHNhbWxwOkxvZ291dFJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46...\",\n});" - lang: Ruby source: "response = client.security.saml_complete_logout(\n body: {\n \"realm\": \"saml1\",\n \"ids\": [\n \"_1c368075e0b3...\"\n ],\n \"content\": \"PHNhbWxwOkxvZ291dFJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46...\"\n }\n)" - lang: PHP source: "$resp = $client->security()->samlCompleteLogout([\n \"body\" => [\n \"realm\" => \"saml1\",\n \"ids\" => array(\n \"_1c368075e0b3...\",\n ),\n \"content\" => \"PHNhbWxwOkxvZ291dFJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46...\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"realm":"saml1","ids":["_1c368075e0b3..."],"content":"PHNhbWxwOkxvZ291dFJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46..."}'' "$ELASTICSEARCH_URL/_security/saml/complete_logout"' - lang: C# source: "var response = await client.Security\n .SamlCompleteLogoutAsync(d1 => d1\n .Content(\"PHNhbWxwOkxvZ291dFJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46...\")\n .Ids(new[] { \"_1c368075e0b3...\" })\n .Realm(\"saml1\")\n );" - lang: Java source: "client.security().samlCompleteLogout(s -> s\n .content(\"PHNhbWxwOkxvZ291dFJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46...\")\n .ids(\"_1c368075e0b3...\")\n .realm(\"saml1\")\n);\n" required: true responses: '200': description: '' content: application/json: { } x-state: Generally available; Added in 7.14.0 x-codeSamples: - lang: Console source: "POST /_security/saml/complete_logout\n{\n \"realm\": \"saml1\",\n \"ids\": [ \"_1c368075e0b3...\" ],\n \"query_string\": \"SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK...\"\n}" - lang: Python source: "resp = client.security.saml_complete_logout(\n realm=\"saml1\",\n ids=[\n \"_1c368075e0b3...\"\n ],\n query_string=\"SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK...\",\n)" - lang: JavaScript source: "const response = await client.security.samlCompleteLogout({\n realm: \"saml1\",\n ids: [\"_1c368075e0b3...\"],\n query_string:\n \"SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK...\",\n});" - lang: Ruby source: "response = client.security.saml_complete_logout(\n body: {\n \"realm\": \"saml1\",\n \"ids\": [\n \"_1c368075e0b3...\"\n ],\n \"query_string\": \"SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK...\"\n }\n)" - lang: PHP source: "$resp = $client->security()->samlCompleteLogout([\n \"body\" => [\n \"realm\" => \"saml1\",\n \"ids\" => array(\n \"_1c368075e0b3...\",\n ),\n \"query_string\" => \"SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK...\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"realm":"saml1","ids":["_1c368075e0b3..."],"query_string":"SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK..."}'' "$ELASTICSEARCH_URL/_security/saml/complete_logout"' - lang: C# source: "var response = await client.Security\n .SamlCompleteLogoutAsync(d1 => d1\n .Ids(new[] { \"_1c368075e0b3...\" })\n .QueryString(\"SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK...\")\n .Realm(\"saml1\")\n );" - lang: Java source: "client.security().samlCompleteLogout(s -> s\n .ids(\"_1c368075e0b3...\")\n .queryString(\"SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK...\")\n .realm(\"saml1\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/saml/invalidate: post: tags: - security summary: Invalidate SAML description: "Submit a SAML LogoutRequest message to Elasticsearch for consumption.\n\nNOTE: This API is intended for use by custom web applications other than Kibana.\nIf you are using Kibana, refer to the documentation for configuring SAML single-sign-on on the Elastic Stack.\n\nThe logout request comes from the SAML IdP during an IdP initiated Single Logout.\nThe custom web application can use this API to have Elasticsearch process the `LogoutRequest`.\nAfter successful validation of the request, Elasticsearch invalidates the access token and refresh token that corresponds to that specific SAML principal and provides a URL that contains a SAML LogoutResponse message.\nThus the user can be redirected back to their IdP." externalDocs: description: More about SAML authentication url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/saml x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-saml-invalidate.html operationId: security-saml-invalidate requestBody: content: application/json: schema: required: - query_string type: object properties: acs: type: string description: The Assertion Consumer Service URL that matches the one of the SAML realm in Elasticsearch that should be used. You must specify either this parameter or the `realm` parameter. query_string: type: string description: "The query part of the URL that the user was redirected to by the SAML IdP to initiate the Single Logout.\nThis query should include a single parameter named `SAMLRequest` that contains a SAML logout request that is deflated and Base64 encoded.\nIf the SAML IdP has signed the logout request, the URL should include two extra parameters named `SigAlg` and `Signature` that contain the algorithm used for the signature and the signature value itself.\nIn order for Elasticsearch to be able to verify the IdP's signature, the value of the `query_string` field must be an exact match to the string provided by the browser.\nThe client application must not attempt to parse or process the string in any way." realm: type: string description: The name of the SAML realm in Elasticsearch the configuration. You must specify either this parameter or the `acs` parameter. examples: SamlInvalidateRequestExample1: description: "Run `POST /_security/saml/invalidate` to invalidate all the tokens for realm `saml1` pertaining to the user that is identified in the SAML Logout Request.\n" value: "{\n \"query_string\" : \"SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D\",\n \"realm\" : \"saml1\"\n}" x-codeSamples: - lang: Console source: "POST /_security/saml/invalidate\n{\n \"query_string\" : \"SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D\",\n \"realm\" : \"saml1\"\n}" - lang: Python source: "resp = client.security.saml_invalidate(\n query_string=\"SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D\",\n realm=\"saml1\",\n)" - lang: JavaScript source: "const response = await client.security.samlInvalidate({\n query_string:\n \"SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D\",\n realm: \"saml1\",\n});" - lang: Ruby source: "response = client.security.saml_invalidate(\n body: {\n \"query_string\": \"SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D\",\n \"realm\": \"saml1\"\n }\n)" - lang: PHP source: "$resp = $client->security()->samlInvalidate([\n \"body\" => [\n \"query_string\" => \"SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D\",\n \"realm\" => \"saml1\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query_string":"SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D","realm":"saml1"}'' "$ELASTICSEARCH_URL/_security/saml/invalidate"' - lang: C# source: "var response = await client.Security\n .SamlInvalidateAsync(d1 => d1\n .QueryString(\"SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D\")\n .Realm(\"saml1\")\n );" - lang: Java source: "client.security().samlInvalidate(s -> s\n .queryString(\"SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D\")\n .realm(\"saml1\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - invalidated - realm - redirect type: object properties: invalidated: type: number description: The number of tokens that were invalidated as part of this logout. realm: type: string description: The realm name of the SAML realm in Elasticsearch that authenticated the user. redirect: type: string description: A SAML logout response as a parameter so that the user can be redirected back to the SAML IdP. examples: SamlInvalidateResponseExample1: description: A successful response from `POST /_security/saml/invalidate`. value: "{\n \"redirect\" : \"https://my-idp.org/logout/SAMLResponse=....\",\n \"invalidated\" : 2,\n \"realm\" : \"saml1\"\n}" x-state: Generally available; Added in 7.5.0 x-codeSamples: - lang: Console source: "POST /_security/saml/invalidate\n{\n \"query_string\" : \"SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D\",\n \"realm\" : \"saml1\"\n}" - lang: Python source: "resp = client.security.saml_invalidate(\n query_string=\"SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D\",\n realm=\"saml1\",\n)" - lang: JavaScript source: "const response = await client.security.samlInvalidate({\n query_string:\n \"SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D\",\n realm: \"saml1\",\n});" - lang: Ruby source: "response = client.security.saml_invalidate(\n body: {\n \"query_string\": \"SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D\",\n \"realm\": \"saml1\"\n }\n)" - lang: PHP source: "$resp = $client->security()->samlInvalidate([\n \"body\" => [\n \"query_string\" => \"SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D\",\n \"realm\" => \"saml1\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query_string":"SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D","realm":"saml1"}'' "$ELASTICSEARCH_URL/_security/saml/invalidate"' - lang: C# source: "var response = await client.Security\n .SamlInvalidateAsync(d1 => d1\n .QueryString(\"SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D\")\n .Realm(\"saml1\")\n );" - lang: Java source: "client.security().samlInvalidate(s -> s\n .queryString(\"SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D\")\n .realm(\"saml1\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/saml/logout: post: tags: - security summary: Logout of SAML description: "Submits a request to invalidate an access token and refresh token.\n\nNOTE: This API is intended for use by custom web applications other than Kibana.\nIf you are using Kibana, refer to the documentation for configuring SAML single-sign-on on the Elastic Stack.\n\nThis API invalidates the tokens that were generated for a user by the SAML authenticate API.\nIf the SAML realm in Elasticsearch is configured accordingly and the SAML IdP supports this, the Elasticsearch response contains a URL to redirect the user to the IdP that contains a SAML logout request (starting an SP-initiated SAML Single Logout)." externalDocs: description: More about SAML authentication url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/saml x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-saml-logout.html operationId: security-saml-logout requestBody: content: application/json: schema: required: - token type: object properties: token: type: string description: "The access token that was returned as a response to calling the SAML authenticate API.\nAlternatively, the most recent token that was received after refreshing the original one by using a `refresh_token`." refresh_token: type: string description: "The refresh token that was returned as a response to calling the SAML authenticate API.\nAlternatively, the most recent refresh token that was received after refreshing the original access token." examples: SamlLogoutRequestExample1: description: "Run `POST /_security/saml/logout` to invalidate the pair of tokens that were generated by calling the SAML authenticate API with a successful SAML response.\n" value: "{\n \"token\" : \"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3\",\n \"refresh_token\" : \"mJdXLtmvTUSpoLwMvdBt_w\"\n}" x-codeSamples: - lang: Console source: "POST /_security/saml/logout\n{\n \"token\" : \"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3\",\n \"refresh_token\" : \"mJdXLtmvTUSpoLwMvdBt_w\"\n}" - lang: Python source: "resp = client.security.saml_logout(\n token=\"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3\",\n refresh_token=\"mJdXLtmvTUSpoLwMvdBt_w\",\n)" - lang: JavaScript source: "const response = await client.security.samlLogout({\n token: \"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3\",\n refresh_token: \"mJdXLtmvTUSpoLwMvdBt_w\",\n});" - lang: Ruby source: "response = client.security.saml_logout(\n body: {\n \"token\": \"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3\",\n \"refresh_token\": \"mJdXLtmvTUSpoLwMvdBt_w\"\n }\n)" - lang: PHP source: "$resp = $client->security()->samlLogout([\n \"body\" => [\n \"token\" => \"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3\",\n \"refresh_token\" => \"mJdXLtmvTUSpoLwMvdBt_w\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"token":"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3","refresh_token":"mJdXLtmvTUSpoLwMvdBt_w"}'' "$ELASTICSEARCH_URL/_security/saml/logout"' - lang: C# source: "var response = await client.Security\n .SamlLogoutAsync(d1 => d1\n .RefreshToken(\"mJdXLtmvTUSpoLwMvdBt_w\")\n .Token(\"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3\")\n );" - lang: Java source: "client.security().samlLogout(s -> s\n .refreshToken(\"mJdXLtmvTUSpoLwMvdBt_w\")\n .token(\"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - redirect type: object properties: redirect: type: string description: "A URL that contains a SAML logout request as a parameter.\nYou can use this URL to be redirected back to the SAML IdP and to initiate Single Logout." examples: SamlLogoutResponseExample1: description: A successful response from `POST /_security/saml/logout`. value: "{\n \"redirect\" : \"https://my-idp.org/logout/SAMLRequest=....\"\n}" x-state: Generally available; Added in 7.5.0 x-codeSamples: - lang: Console source: "POST /_security/saml/logout\n{\n \"token\" : \"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3\",\n \"refresh_token\" : \"mJdXLtmvTUSpoLwMvdBt_w\"\n}" - lang: Python source: "resp = client.security.saml_logout(\n token=\"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3\",\n refresh_token=\"mJdXLtmvTUSpoLwMvdBt_w\",\n)" - lang: JavaScript source: "const response = await client.security.samlLogout({\n token: \"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3\",\n refresh_token: \"mJdXLtmvTUSpoLwMvdBt_w\",\n});" - lang: Ruby source: "response = client.security.saml_logout(\n body: {\n \"token\": \"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3\",\n \"refresh_token\": \"mJdXLtmvTUSpoLwMvdBt_w\"\n }\n)" - lang: PHP source: "$resp = $client->security()->samlLogout([\n \"body\" => [\n \"token\" => \"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3\",\n \"refresh_token\" => \"mJdXLtmvTUSpoLwMvdBt_w\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"token":"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3","refresh_token":"mJdXLtmvTUSpoLwMvdBt_w"}'' "$ELASTICSEARCH_URL/_security/saml/logout"' - lang: C# source: "var response = await client.Security\n .SamlLogoutAsync(d1 => d1\n .RefreshToken(\"mJdXLtmvTUSpoLwMvdBt_w\")\n .Token(\"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3\")\n );" - lang: Java source: "client.security().samlLogout(s -> s\n .refreshToken(\"mJdXLtmvTUSpoLwMvdBt_w\")\n .token(\"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/saml/prepare: post: tags: - security summary: Prepare SAML authentication description: "Create a SAML authentication request (``) as a URL string based on the configuration of the respective SAML realm in Elasticsearch.\n\nNOTE: This API is intended for use by custom web applications other than Kibana.\nIf you are using Kibana, refer to the documentation for configuring SAML single-sign-on on the Elastic Stack.\n\nThis API returns a URL pointing to the SAML Identity Provider.\nYou can use the URL to redirect the browser of the user in order to continue the authentication process.\nThe URL includes a single parameter named `SAMLRequest`, which contains a SAML Authentication request that is deflated and Base64 encoded.\nIf the configuration dictates that SAML authentication requests should be signed, the URL has two extra parameters named `SigAlg` and `Signature`.\nThese parameters contain the algorithm used for the signature and the signature value itself.\nIt also returns a random string that uniquely identifies this SAML Authentication request.\nThe caller of this API needs to store this identifier as it needs to be used in a following step of the authentication process." externalDocs: description: More about SAML authentication url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/saml x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-saml-prepare-authentication.html operationId: security-saml-prepare-authentication requestBody: content: application/json: schema: type: object properties: acs: type: string description: "The Assertion Consumer Service URL that matches the one of the SAML realms in Elasticsearch.\nThe realm is used to generate the authentication request. You must specify either this parameter or the `realm` parameter." realm: type: string description: "The name of the SAML realm in Elasticsearch for which the configuration is used to generate the authentication request.\nYou must specify either this parameter or the `acs` parameter." relay_state: type: string description: "A string that will be included in the redirect URL that this API returns as the `RelayState` query parameter.\nIf the Authentication Request is signed, this value is used as part of the signature computation." examples: SamlPrepareAuthenticationRequestExample1: summary: Prepare with a realm description: "Run `POST /_security/saml/prepare` to generate a SAML authentication request for the SAML realm named `saml1`.\n" value: "{\n \"realm\" : \"saml1\"\n}" x-codeSamples: - lang: Console source: "POST /_security/saml/prepare\n{\n \"realm\" : \"saml1\"\n}" - lang: Python source: "resp = client.security.saml_prepare_authentication(\n realm=\"saml1\",\n)" - lang: JavaScript source: "const response = await client.security.samlPrepareAuthentication({\n realm: \"saml1\",\n});" - lang: Ruby source: "response = client.security.saml_prepare_authentication(\n body: {\n \"realm\": \"saml1\"\n }\n)" - lang: PHP source: "$resp = $client->security()->samlPrepareAuthentication([\n \"body\" => [\n \"realm\" => \"saml1\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"realm":"saml1"}'' "$ELASTICSEARCH_URL/_security/saml/prepare"' - lang: C# source: "var response = await client.Security\n .SamlPrepareAuthenticationAsync(d1 => d1\n .Realm(\"saml1\")\n );" - lang: Java source: "client.security().samlPrepareAuthentication(s -> s\n .realm(\"saml1\")\n);\n" SamlPrepareAuthenticationRequestExample2: summary: Prepare with an ACS description: "Run `POST /_security/saml/prepare` to generate a SAML authentication request for the SAML realm with an Assertion Consuming Service (ACS) URL.\n" value: "{\n \"acs\" : \"https://kibana.org/api/security/saml/callback\"\n}" x-codeSamples: - lang: Console source: "POST /_security/saml/prepare\n{\n \"acs\" : \"https://kibana.org/api/security/saml/callback\"\n}" - lang: Python source: "resp = client.security.saml_prepare_authentication(\n acs=\"https://kibana.org/api/security/saml/callback\",\n)" - lang: JavaScript source: "const response = await client.security.samlPrepareAuthentication({\n acs: \"https://kibana.org/api/security/saml/callback\",\n});" - lang: Ruby source: "response = client.security.saml_prepare_authentication(\n body: {\n \"acs\": \"https://kibana.org/api/security/saml/callback\"\n }\n)" - lang: PHP source: "$resp = $client->security()->samlPrepareAuthentication([\n \"body\" => [\n \"acs\" => \"https://kibana.org/api/security/saml/callback\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"acs":"https://kibana.org/api/security/saml/callback"}'' "$ELASTICSEARCH_URL/_security/saml/prepare"' - lang: C# source: "var response = await client.Security\n .SamlPrepareAuthenticationAsync(d1 => d1\n .Acs(\"https://kibana.org/api/security/saml/callback\")\n );" - lang: Java source: "client.security().samlPrepareAuthentication(s -> s\n .acs(\"https://kibana.org/api/security/saml/callback\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - id - realm - redirect type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: A unique identifier for the SAML Request to be stored by the caller of the API. realm: type: string description: The name of the Elasticsearch realm that was used to construct the authentication request. redirect: type: string description: The URL to redirect the user to. examples: SAmlPrepareAuthenticationResponseExample1: description: A successful response from `POST /_security/saml/prepare`. value: "{\n \"redirect\": \"https://my-idp.org/login?SAMLRequest=fVJdc6IwFP0rmbwDgUKLGbFDtc462%2B06FX3Yl50rBJsKCZsbrPbXL6J22hdfk%2FNx7zl3eL%2BvK7ITBqVWCfVdRolQuS6k2iR0mU2dmN6Phgh1FTQ8be2rehH%2FWoGWdESF%2FPST0NYorgElcgW1QG5zvkh%2FPfHAZbwx2upcV5SkiMLYzmqsFba1MAthdjIXy5enhL5a23DPOyo6W7kGBa7cwhZ2gO7G8OiW%2BR400kORt0bag7fzezAlk24eqcD2OxxlsNN5O3MdsW9c6CZnbq7rntF4d3s0D7BaHTZhIWN52P%2BcjiuGRbDU6cdj%2BEjJbJLQv4N4ADdhxBiEZbQuWclY4Q8iABbCXczCdSiKMAC%2FgyO2YqbQgrIJDZg%2FcFjsMD%2Fzb3gUcBa5sR%2F9oWR%2BzuJBqlPG14Jbn0DIf2TZ3Jn%2FXmSUrC5ddQB6bob37uZrJdeF4dIDHV3iuhb70Ptq83kOz53ubDLXlcwPJK0q%2FT42AqxIaAkVCkqm2tRgr49yfJGFU%2FZQ3hy3QyuUpd7obPv97kb%2FAQ%3D%3D\"}\",\n \"realm\": \"saml1\",\n \"id\": \"_989a34500a4f5bf0f00d195aa04a7804b4ed42a1\"\n}" x-state: Generally available; Added in 7.5.0 x-codeSamples: - lang: Console source: "POST /_security/saml/prepare\n{\n \"realm\" : \"saml1\"\n}" - lang: Python source: "resp = client.security.saml_prepare_authentication(\n realm=\"saml1\",\n)" - lang: JavaScript source: "const response = await client.security.samlPrepareAuthentication({\n realm: \"saml1\",\n});" - lang: Ruby source: "response = client.security.saml_prepare_authentication(\n body: {\n \"realm\": \"saml1\"\n }\n)" - lang: PHP source: "$resp = $client->security()->samlPrepareAuthentication([\n \"body\" => [\n \"realm\" => \"saml1\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"realm":"saml1"}'' "$ELASTICSEARCH_URL/_security/saml/prepare"' - lang: C# source: "var response = await client.Security\n .SamlPrepareAuthenticationAsync(d1 => d1\n .Realm(\"saml1\")\n );" - lang: Java source: "client.security().samlPrepareAuthentication(s -> s\n .realm(\"saml1\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_security/saml/metadata/{realm_name}': get: tags: - security summary: Create SAML service provider metadata description: "Generate SAML metadata for a SAML 2.0 Service Provider.\n\nThe SAML 2.0 specification provides a mechanism for Service Providers to describe their capabilities and configuration using a metadata file.\nThis API generates Service Provider metadata based on the configuration of a SAML realm in Elasticsearch." operationId: security-saml-service-provider-metadata parameters: - name: realm_name in: path description: The name of the SAML realm in Elasticsearch. required: true schema: $ref: '#/components/schemas/_types.Name' responses: '200': description: '' content: application/json: schema: required: - metadata type: object properties: metadata: type: string description: An XML string that contains a SAML Service Provider's metadata for the realm. examples: SamlServiceProviderMetadataResponseExample1: description: "A successful response from `POST /_security/profile/u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0/_data`, which indicates that the request is acknowledged.\n" value: "{\n\"metadata\": \"\"\"\">/logout\"/>/api/security/saml/callback\" index=\"1\" isDefault=\"true\"/>\"\"\"\n}" x-state: Generally available; Added in 7.11.0 x-codeSamples: - lang: Console source: "POST /_security/profile/u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0/_data\n" - lang: Python source: "resp = client.security.update_user_profile_data(\n uid=\"u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0\",\n)" - lang: JavaScript source: "const response = await client.security.updateUserProfileData({\n uid: \"u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0\",\n});" - lang: Ruby source: "response = client.security.update_user_profile_data(\n uid: \"u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0\"\n)" - lang: PHP source: "$resp = $client->security()->updateUserProfileData([\n \"uid\" => \"u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/profile/u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0/_data"' - lang: C# source: 'var response = await client.Security.UpdateUserProfileDataAsync(uid: "u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0");' - lang: Java source: "client.security().updateUserProfileData(u -> u\n .uid(\"u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_security/profile/_suggest: post: tags: - security summary: "Suggest a user profile\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_security/profile/_suggest\n
\n
\n POST\n /_security/profile/_suggest\n
\n \n\nGet suggestions for user profiles that match specified search criteria.\n\nNOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions.\nIndividual users and external applications should not call this API directly.\nElastic reserves the right to change or remove this feature in future releases without prior notice.\n\n## Required authorization\n\n* Cluster privileges: `read_security`\n" operationId: security-suggest-user-profiles parameters: - $ref: '#/components/parameters/security.suggest_user_profiles-data' requestBody: $ref: '#/components/requestBodies/security.suggest_user_profiles' responses: '200': $ref: '#/components/responses/security.suggest_user_profiles-200' x-state: Generally available; Added in 8.2.0 x-codeSamples: - lang: Console source: "POST /_security/profile/_suggest\n{\n \"name\": \"jack\", \n \"hint\": {\n \"uids\": [ \n \"u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0\",\n \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\"\n ],\n \"labels\": {\n \"direction\": [\"north\", \"east\"] \n }\n }\n}" - lang: Python source: "resp = client.security.suggest_user_profiles(\n name=\"jack\",\n hint={\n \"uids\": [\n \"u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0\",\n \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\"\n ],\n \"labels\": {\n \"direction\": [\n \"north\",\n \"east\"\n ]\n }\n },\n)" - lang: JavaScript source: "const response = await client.security.suggestUserProfiles({\n name: \"jack\",\n hint: {\n uids: [\n \"u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0\",\n \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n ],\n labels: {\n direction: [\"north\", \"east\"],\n },\n },\n});" - lang: Ruby source: "response = client.security.suggest_user_profiles(\n body: {\n \"name\": \"jack\",\n \"hint\": {\n \"uids\": [\n \"u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0\",\n \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\"\n ],\n \"labels\": {\n \"direction\": [\n \"north\",\n \"east\"\n ]\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->suggestUserProfiles([\n \"body\" => [\n \"name\" => \"jack\",\n \"hint\" => [\n \"uids\" => array(\n \"u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0\",\n \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n ),\n \"labels\" => [\n \"direction\" => array(\n \"north\",\n \"east\",\n ),\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"name":"jack","hint":{"uids":["u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0","u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0"],"labels":{"direction":["north","east"]}}}'' "$ELASTICSEARCH_URL/_security/profile/_suggest"' - lang: C# source: "var response = await client.Security\n .SuggestUserProfilesAsync(d1 => d1\n .Hint(d2 => d2\n .Labels(new Dictionary>()\n {\n { \"direction\", [\"north\", \"east\"] }\n })\n .Uids(\"u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0\", \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\")\n )\n .Name(\"jack\")\n );" - lang: Java source: "client.security().suggestUserProfiles(s -> s\n .hint(h -> h\n .uids(List.of(\"u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0\",\"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\"))\n .labels(\"direction\", List.of(\"north\",\"east\"))\n )\n .name(\"jack\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_security/api_key/{id}': put: tags: - security summary: Update an API key description: "Update attributes of an existing API key.\nThis API supports updates to an API key's access scope, expiration, and metadata.\n\nTo use this API, you must have at least the `manage_own_api_key` cluster privilege.\nUsers can only update API keys that they created or that were granted to them.\nTo update another user’s API key, use the `run_as` feature to submit a request on behalf of another user.\n\nIMPORTANT: It's not possible to use an API key as the authentication credential for this API. The owner user’s credentials are required.\n\nUse this API to update API keys created by the create API key or grant API Key APIs.\nIf you need to apply the same update to many API keys, you can use the bulk update API keys API to reduce overhead.\nIt's not possible to update expired API keys or API keys that have been invalidated by the invalidate API key API.\n\nThe access scope of an API key is derived from the `role_descriptors` you specify in the request and a snapshot of the owner user's permissions at the time of the request.\nThe snapshot of the owner's permissions is updated automatically on every call.\n\nIMPORTANT: If you don't specify `role_descriptors` in the request, a call to this API might still change the API key's access scope.\nThis change can occur if the owner user's permissions have changed since the API key was created or last modified.\n\n## Required authorization\n\n* Cluster privileges: `manage_own_api_key`\n" operationId: security-update-api-key parameters: - name: id in: path description: The ID of the API key to update. required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: type: object properties: role_descriptors: type: object additionalProperties: $ref: '#/components/schemas/security._types.RoleDescriptor' description: "The role descriptors to assign to this API key.\nThe API key's effective permissions are an intersection of its assigned privileges and the point in time snapshot of permissions of the owner user.\nYou can assign new privileges by specifying them in this parameter.\nTo remove assigned privileges, you can supply an empty `role_descriptors` parameter, that is to say, an empty object `{}`.\nIf an API key has no assigned privileges, it inherits the owner user's full permissions.\nThe snapshot of the owner's permissions is always updated, whether you supply the `role_descriptors` parameter or not.\nThe structure of a role descriptor is the same as the request for the create API keys API." metadata: allOf: - $ref: '#/components/schemas/_types.Metadata' description: "Arbitrary metadata that you want to associate with the API key.\nIt supports a nested data structure.\nWithin the metadata object, keys beginning with `_` are reserved for system usage.\nWhen specified, this value fully replaces the metadata previously associated with the API key." expiration: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The expiration time for the API key.\nBy default, API keys never expire.\nThis property can be omitted to leave the expiration unchanged." examples: UpdateApiKeyRequestExample1: summary: Update role and metadata description: "Run `PUT /_security/api_key/VuaCfGcBCdbkQm-e5aOx` to assign new role descriptors and metadata to an API key.\n" value: "{\n \"role_descriptors\": {\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\"*\"],\n \"privileges\": [\"write\"]\n }\n ]\n }\n },\n \"metadata\": {\n \"environment\": {\n \"level\": 2,\n \"trusted\": true,\n \"tags\": [\"production\"]\n }\n }\n}" x-codeSamples: - lang: Console source: "PUT /_security/api_key/VuaCfGcBCdbkQm-e5aOx\n{\n \"role_descriptors\": {\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\"*\"],\n \"privileges\": [\"write\"]\n }\n ]\n }\n },\n \"metadata\": {\n \"environment\": {\n \"level\": 2,\n \"trusted\": true,\n \"tags\": [\"production\"]\n }\n }\n}" - lang: Python source: "resp = client.security.update_api_key(\n id=\"VuaCfGcBCdbkQm-e5aOx\",\n role_descriptors={\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\n \"*\"\n ],\n \"privileges\": [\n \"write\"\n ]\n }\n ]\n }\n },\n metadata={\n \"environment\": {\n \"level\": 2,\n \"trusted\": True,\n \"tags\": [\n \"production\"\n ]\n }\n },\n)" - lang: JavaScript source: "const response = await client.security.updateApiKey({\n id: \"VuaCfGcBCdbkQm-e5aOx\",\n role_descriptors: {\n \"role-a\": {\n indices: [\n {\n names: [\"*\"],\n privileges: [\"write\"],\n },\n ],\n },\n },\n metadata: {\n environment: {\n level: 2,\n trusted: true,\n tags: [\"production\"],\n },\n },\n});" - lang: Ruby source: "response = client.security.update_api_key(\n id: \"VuaCfGcBCdbkQm-e5aOx\",\n body: {\n \"role_descriptors\": {\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\n \"*\"\n ],\n \"privileges\": [\n \"write\"\n ]\n }\n ]\n }\n },\n \"metadata\": {\n \"environment\": {\n \"level\": 2,\n \"trusted\": true,\n \"tags\": [\n \"production\"\n ]\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->updateApiKey([\n \"id\" => \"VuaCfGcBCdbkQm-e5aOx\",\n \"body\" => [\n \"role_descriptors\" => [\n \"role-a\" => [\n \"indices\" => array(\n [\n \"names\" => array(\n \"*\",\n ),\n \"privileges\" => array(\n \"write\",\n ),\n ],\n ),\n ],\n ],\n \"metadata\" => [\n \"environment\" => [\n \"level\" => 2,\n \"trusted\" => true,\n \"tags\" => array(\n \"production\",\n ),\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"role_descriptors":{"role-a":{"indices":[{"names":["*"],"privileges":["write"]}]}},"metadata":{"environment":{"level":2,"trusted":true,"tags":["production"]}}}'' "$ELASTICSEARCH_URL/_security/api_key/VuaCfGcBCdbkQm-e5aOx"' - lang: C# source: "var response = await client.Security\n .UpdateApiKeyAsync(id: \"VuaCfGcBCdbkQm-e5aOx\", d1 => d1\n .Metadata(new Dictionary()\n {\n { \"environment\", JsonSerializer.Deserialize(\"\"\"\n {\n \"level\": 2,\n \"trusted\": true,\n \"tags\": [\n \"production\"\n ]\n }\n \"\"\") }\n })\n .RoleDescriptors(d2 => d2\n .Add(\"role-a\", d3 => d3\n .Indices(d4 => d4\n .Names([\"*\"])\n .Privileges(IndexPrivilege.Write)\n )\n )\n )\n );" - lang: Java source: "client.security().updateApiKey(u -> u\n .id(\"VuaCfGcBCdbkQm-e5aOx\")\n .metadata(\"environment\", JsonData.fromJson(\"\"\"\n{\"level\":2,\"trusted\":true,\"tags\":[\"production\"]}\n\"\"\"))\n .roleDescriptors(\"role-a\", r -> r\n .indices(i -> i\n .names(\"*\")\n .privileges(\"write\")\n )\n )\n);\n" UpdateApiKeyRequestExample2: summary: Remove permissions description: "Run `PUT /_security/api_key/VuaCfGcBCdbkQm-e5aOx` to remove the API key's previously assigned permissions. It will inherit the owner user's full permissions.\n" value: "{\n \"role_descriptors\": {}\n}" x-codeSamples: - lang: Console source: "PUT /_security/api_key/VuaCfGcBCdbkQm-e5aOx\n{\n \"role_descriptors\": {}\n}" - lang: Python source: "resp = client.security.update_api_key(\n id=\"VuaCfGcBCdbkQm-e5aOx\",\n role_descriptors={},\n)" - lang: JavaScript source: "const response = await client.security.updateApiKey({\n id: \"VuaCfGcBCdbkQm-e5aOx\",\n role_descriptors: {},\n});" - lang: Ruby source: "response = client.security.update_api_key(\n id: \"VuaCfGcBCdbkQm-e5aOx\",\n body: {\n \"role_descriptors\": {}\n }\n)" - lang: PHP source: "$resp = $client->security()->updateApiKey([\n \"id\" => \"VuaCfGcBCdbkQm-e5aOx\",\n \"body\" => [\n \"role_descriptors\" => new ArrayObject([]),\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"role_descriptors":{}}'' "$ELASTICSEARCH_URL/_security/api_key/VuaCfGcBCdbkQm-e5aOx"' - lang: C# source: "var response = await client.Security\n .UpdateApiKeyAsync(id: \"VuaCfGcBCdbkQm-e5aOx\", d1 => d1\n .RoleDescriptors()\n );" - lang: Java source: "client.security().updateApiKey(u -> u\n .id(\"VuaCfGcBCdbkQm-e5aOx\")\n .roleDescriptors(Map.of())\n);\n" responses: '200': description: '' content: application/json: schema: required: - updated type: object properties: updated: type: boolean description: "If `true`, the API key was updated.\nIf `false`, the API key didn't change because no change was detected." examples: UpdateApiKeyResponseExample1: summary: Update role and metadata description: "A successful response from `PUT /_security/api_key/VuaCfGcBCdbkQm-e5aOx`. The API key's effective permissions after the update will be the intersection of the supplied role descriptors and the owner user's permissions.\n" value: "{\n \"updated\": true\n}" x-state: Generally available; Added in 8.4.0 x-codeSamples: - lang: Console source: "PUT /_security/api_key/VuaCfGcBCdbkQm-e5aOx\n{\n \"role_descriptors\": {\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\"*\"],\n \"privileges\": [\"write\"]\n }\n ]\n }\n },\n \"metadata\": {\n \"environment\": {\n \"level\": 2,\n \"trusted\": true,\n \"tags\": [\"production\"]\n }\n }\n}" - lang: Python source: "resp = client.security.update_api_key(\n id=\"VuaCfGcBCdbkQm-e5aOx\",\n role_descriptors={\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\n \"*\"\n ],\n \"privileges\": [\n \"write\"\n ]\n }\n ]\n }\n },\n metadata={\n \"environment\": {\n \"level\": 2,\n \"trusted\": True,\n \"tags\": [\n \"production\"\n ]\n }\n },\n)" - lang: JavaScript source: "const response = await client.security.updateApiKey({\n id: \"VuaCfGcBCdbkQm-e5aOx\",\n role_descriptors: {\n \"role-a\": {\n indices: [\n {\n names: [\"*\"],\n privileges: [\"write\"],\n },\n ],\n },\n },\n metadata: {\n environment: {\n level: 2,\n trusted: true,\n tags: [\"production\"],\n },\n },\n});" - lang: Ruby source: "response = client.security.update_api_key(\n id: \"VuaCfGcBCdbkQm-e5aOx\",\n body: {\n \"role_descriptors\": {\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\n \"*\"\n ],\n \"privileges\": [\n \"write\"\n ]\n }\n ]\n }\n },\n \"metadata\": {\n \"environment\": {\n \"level\": 2,\n \"trusted\": true,\n \"tags\": [\n \"production\"\n ]\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->updateApiKey([\n \"id\" => \"VuaCfGcBCdbkQm-e5aOx\",\n \"body\" => [\n \"role_descriptors\" => [\n \"role-a\" => [\n \"indices\" => array(\n [\n \"names\" => array(\n \"*\",\n ),\n \"privileges\" => array(\n \"write\",\n ),\n ],\n ),\n ],\n ],\n \"metadata\" => [\n \"environment\" => [\n \"level\" => 2,\n \"trusted\" => true,\n \"tags\" => array(\n \"production\",\n ),\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"role_descriptors":{"role-a":{"indices":[{"names":["*"],"privileges":["write"]}]}},"metadata":{"environment":{"level":2,"trusted":true,"tags":["production"]}}}'' "$ELASTICSEARCH_URL/_security/api_key/VuaCfGcBCdbkQm-e5aOx"' - lang: C# source: "var response = await client.Security\n .UpdateApiKeyAsync(id: \"VuaCfGcBCdbkQm-e5aOx\", d1 => d1\n .Metadata(new Dictionary()\n {\n { \"environment\", JsonSerializer.Deserialize(\"\"\"\n {\n \"level\": 2,\n \"trusted\": true,\n \"tags\": [\n \"production\"\n ]\n }\n \"\"\") }\n })\n .RoleDescriptors(d2 => d2\n .Add(\"role-a\", d3 => d3\n .Indices(d4 => d4\n .Names([\"*\"])\n .Privileges(IndexPrivilege.Write)\n )\n )\n )\n );" - lang: Java source: "client.security().updateApiKey(u -> u\n .id(\"VuaCfGcBCdbkQm-e5aOx\")\n .metadata(\"environment\", JsonData.fromJson(\"\"\"\n{\"level\":2,\"trusted\":true,\"tags\":[\"production\"]}\n\"\"\"))\n .roleDescriptors(\"role-a\", r -> r\n .indices(i -> i\n .names(\"*\")\n .privileges(\"write\")\n )\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_security/cross_cluster/api_key/{id}': put: tags: - security summary: Update a cross-cluster API key description: "Update the attributes of an existing cross-cluster API key, which is used for API key based remote cluster access.\n\nTo use this API, you must have at least the `manage_security` cluster privilege.\nUsers can only update API keys that they created.\nTo update another user's API key, use the `run_as` feature to submit a request on behalf of another user.\n\nIMPORTANT: It's not possible to use an API key as the authentication credential for this API.\nTo update an API key, the owner user's credentials are required.\n\nIt's not possible to update expired API keys, or API keys that have been invalidated by the invalidate API key API.\n\nThis API supports updates to an API key's access scope, metadata, and expiration.\nThe owner user's information, such as the `username` and `realm`, is also updated automatically on every call.\n\nNOTE: This API cannot update REST API keys, which should be updated by either the update API key or bulk update API keys API.\n\nTo learn more about how to use this API, refer to the [Update cross cluter API key API examples page](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/update-cc-api-key-examples).\n\n## Required authorization\n\n* Cluster privileges: `manage_security`\n" externalDocs: description: About adding remote clusters url: https://www.elastic.co/docs/deploy-manage/remote-clusters/remote-clusters-api-key x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-update-cross-cluster-api-key.html operationId: security-update-cross-cluster-api-key parameters: - name: id in: path description: The ID of the cross-cluster API key to update. required: true schema: $ref: '#/components/schemas/_types.Id' requestBody: content: application/json: schema: required: - access type: object properties: access: allOf: - $ref: '#/components/schemas/security._types.Access' description: "The access to be granted to this API key.\nThe access is composed of permissions for cross cluster search and cross cluster replication.\nAt least one of them must be specified.\nWhen specified, the new access assignment fully replaces the previously assigned access." expiration: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The expiration time for the API key.\nBy default, API keys never expire. This property can be omitted to leave the value unchanged." metadata: allOf: - $ref: '#/components/schemas/_types.Metadata' description: "Arbitrary metadata that you want to associate with the API key.\nIt supports nested data structure.\nWithin the metadata object, keys beginning with `_` are reserved for system usage.\nWhen specified, this information fully replaces metadata previously associated with the API key." certificate_identity: type: string description: "The certificate identity to associate with this API key.\nThis field is used to restrict the API key to connections authenticated by a specific TLS certificate.\nThe value should match the certificate's distinguished name (DN) pattern.\nWhen specified, this fully replaces any previously assigned certificate identity.\nTo clear an existing certificate identity, explicitly set this field to `null`.\nWhen omitted, the existing certificate identity remains unchanged." examples: UpdateCrossClusterApiKeyRequestExample1: description: "Run `PUT /_security/cross_cluster/api_key/VuaCfGcBCdbkQm-e5aOx` to update a cross-cluster API key, assigning it new access scope and metadata.\n" value: "{\n \"access\": {\n \"replication\": [\n {\n \"names\": [\"archive\"]\n }\n ]\n },\n \"metadata\": {\n \"application\": \"replication\"\n }\n}" x-codeSamples: - lang: Console source: "PUT /_security/cross_cluster/api_key/VuaCfGcBCdbkQm-e5aOx\n{\n \"access\": {\n \"replication\": [\n {\n \"names\": [\"archive\"]\n }\n ]\n },\n \"metadata\": {\n \"application\": \"replication\"\n }\n}" - lang: Python source: "resp = client.security.update_cross_cluster_api_key(\n id=\"VuaCfGcBCdbkQm-e5aOx\",\n access={\n \"replication\": [\n {\n \"names\": [\n \"archive\"\n ]\n }\n ]\n },\n metadata={\n \"application\": \"replication\"\n },\n)" - lang: JavaScript source: "const response = await client.security.updateCrossClusterApiKey({\n id: \"VuaCfGcBCdbkQm-e5aOx\",\n access: {\n replication: [\n {\n names: [\"archive\"],\n },\n ],\n },\n metadata: {\n application: \"replication\",\n },\n});" - lang: Ruby source: "response = client.security.update_cross_cluster_api_key(\n id: \"VuaCfGcBCdbkQm-e5aOx\",\n body: {\n \"access\": {\n \"replication\": [\n {\n \"names\": [\n \"archive\"\n ]\n }\n ]\n },\n \"metadata\": {\n \"application\": \"replication\"\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->updateCrossClusterApiKey([\n \"id\" => \"VuaCfGcBCdbkQm-e5aOx\",\n \"body\" => [\n \"access\" => [\n \"replication\" => array(\n [\n \"names\" => array(\n \"archive\",\n ),\n ],\n ),\n ],\n \"metadata\" => [\n \"application\" => \"replication\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"access":{"replication":[{"names":["archive"]}]},"metadata":{"application":"replication"}}'' "$ELASTICSEARCH_URL/_security/cross_cluster/api_key/VuaCfGcBCdbkQm-e5aOx"' - lang: C# source: "var response = await client.Security\n .UpdateCrossClusterApiKeyAsync(id: \"VuaCfGcBCdbkQm-e5aOx\", d1 => d1\n .Access(d2 => d2\n .Replication(d3 => d3\n .Names([\"archive\"])\n )\n )\n .Metadata(new Dictionary()\n {\n { \"application\", \"replication\" }\n })\n );" - lang: Java source: "client.security().updateCrossClusterApiKey(u -> u\n .access(a -> a\n .replication(r -> r\n .names(\"archive\")\n )\n )\n .id(\"VuaCfGcBCdbkQm-e5aOx\")\n .metadata(\"application\", JsonData.fromJson(\"\\\"replication\\\"\"))\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - updated type: object properties: updated: type: boolean description: "If `true`, the API key was updated.\nIf `false`, the API key didn’t change because no change was detected." examples: UpdateCrossClusterApiKeyResponseExample1: description: "A successful response from `PUT /_security/cross_cluster/api_key/VuaCfGcBCdbkQm-e5aOx` that indicates that the API key was updated.\n" value: "{\n \"updated\": true\n}" x-state: Generally available x-codeSamples: - lang: Console source: "PUT /_security/cross_cluster/api_key/VuaCfGcBCdbkQm-e5aOx\n{\n \"access\": {\n \"replication\": [\n {\n \"names\": [\"archive\"]\n }\n ]\n },\n \"metadata\": {\n \"application\": \"replication\"\n }\n}" - lang: Python source: "resp = client.security.update_cross_cluster_api_key(\n id=\"VuaCfGcBCdbkQm-e5aOx\",\n access={\n \"replication\": [\n {\n \"names\": [\n \"archive\"\n ]\n }\n ]\n },\n metadata={\n \"application\": \"replication\"\n },\n)" - lang: JavaScript source: "const response = await client.security.updateCrossClusterApiKey({\n id: \"VuaCfGcBCdbkQm-e5aOx\",\n access: {\n replication: [\n {\n names: [\"archive\"],\n },\n ],\n },\n metadata: {\n application: \"replication\",\n },\n});" - lang: Ruby source: "response = client.security.update_cross_cluster_api_key(\n id: \"VuaCfGcBCdbkQm-e5aOx\",\n body: {\n \"access\": {\n \"replication\": [\n {\n \"names\": [\n \"archive\"\n ]\n }\n ]\n },\n \"metadata\": {\n \"application\": \"replication\"\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->updateCrossClusterApiKey([\n \"id\" => \"VuaCfGcBCdbkQm-e5aOx\",\n \"body\" => [\n \"access\" => [\n \"replication\" => array(\n [\n \"names\" => array(\n \"archive\",\n ),\n ],\n ),\n ],\n \"metadata\" => [\n \"application\" => \"replication\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"access":{"replication":[{"names":["archive"]}]},"metadata":{"application":"replication"}}'' "$ELASTICSEARCH_URL/_security/cross_cluster/api_key/VuaCfGcBCdbkQm-e5aOx"' - lang: C# source: "var response = await client.Security\n .UpdateCrossClusterApiKeyAsync(id: \"VuaCfGcBCdbkQm-e5aOx\", d1 => d1\n .Access(d2 => d2\n .Replication(d3 => d3\n .Names([\"archive\"])\n )\n )\n .Metadata(new Dictionary()\n {\n { \"application\", \"replication\" }\n })\n );" - lang: Java source: "client.security().updateCrossClusterApiKey(u -> u\n .access(a -> a\n .replication(r -> r\n .names(\"archive\")\n )\n )\n .id(\"VuaCfGcBCdbkQm-e5aOx\")\n .metadata(\"application\", JsonData.fromJson(\"\\\"replication\\\"\"))\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_security/profile/{uid}/_data': post: tags: - security summary: "Update user profile data\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_security/profile/{uid}/_data\n
\n
\n POST\n /_security/profile/{uid}/_data\n
\n \n\nUpdate specific data for the user profile that is associated with a unique ID.\n\nNOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions.\nIndividual users and external applications should not call this API directly.\nElastic reserves the right to change or remove this feature in future releases without prior notice.\n\nTo use this API, you must have one of the following privileges:\n\n* The `manage_user_profile` cluster privilege.\n* The `update_profile_data` global privilege for the namespaces that are referenced in the request.\n\nThis API updates the `labels` and `data` fields of an existing user profile document with JSON objects.\nNew keys and their values are added to the profile document and conflicting keys are replaced by data that's included in the request.\n\nFor both labels and data, content is namespaced by the top-level fields.\nThe `update_profile_data` global privilege grants privileges for updating only the allowed namespaces.\n\n## Required authorization\n\n* Cluster privileges: `manage_user_profile`\n" operationId: security-update-user-profile-data parameters: - $ref: '#/components/parameters/security.update_user_profile_data-uid' - $ref: '#/components/parameters/security.update_user_profile_data-if_seq_no' - $ref: '#/components/parameters/security.update_user_profile_data-if_primary_term' - $ref: '#/components/parameters/security.update_user_profile_data-refresh' requestBody: $ref: '#/components/requestBodies/security.update_user_profile_data' responses: '200': $ref: '#/components/responses/security.update_user_profile_data-200' x-state: Generally available; Added in 8.2.0 x-codeSamples: - lang: Console source: "POST /_security/profile/u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0/_data\n{\n \"labels\": {\n \"direction\": \"east\"\n },\n \"data\": {\n \"app1\": {\n \"theme\": \"default\"\n }\n }\n}" - lang: Python source: "resp = client.security.update_user_profile_data(\n uid=\"u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0\",\n labels={\n \"direction\": \"east\"\n },\n data={\n \"app1\": {\n \"theme\": \"default\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.security.updateUserProfileData({\n uid: \"u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0\",\n labels: {\n direction: \"east\",\n },\n data: {\n app1: {\n theme: \"default\",\n },\n },\n});" - lang: Ruby source: "response = client.security.update_user_profile_data(\n uid: \"u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0\",\n body: {\n \"labels\": {\n \"direction\": \"east\"\n },\n \"data\": {\n \"app1\": {\n \"theme\": \"default\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->security()->updateUserProfileData([\n \"uid\" => \"u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0\",\n \"body\" => [\n \"labels\" => [\n \"direction\" => \"east\",\n ],\n \"data\" => [\n \"app1\" => [\n \"theme\" => \"default\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"labels":{"direction":"east"},"data":{"app1":{"theme":"default"}}}'' "$ELASTICSEARCH_URL/_security/profile/u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0/_data"' - lang: C# source: "var response = await client.Security\n .UpdateUserProfileDataAsync(uid: \"u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0\", d1 => d1\n .Data(new Dictionary()\n {\n { \"app1\", JsonSerializer.Deserialize(\"\"\"\n {\n \"theme\": \"default\"\n }\n \"\"\") }\n })\n .Labels(new Dictionary()\n {\n { \"direction\", \"east\" }\n })\n );" - lang: Java source: "client.security().updateUserProfileData(u -> u\n .data(\"app1\", JsonData.fromJson(\"\"\"\n{\"theme\":\"default\"}\n\"\"\"))\n .labels(\"direction\", JsonData.fromJson(\"\\\"east\\\"\"))\n .uid(\"u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_ingest/{index}/_simulate': post: tags: - ingest summary: "Simulate data ingestion\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_ingest/_simulate\n
\n
\n POST\n /_ingest/_simulate\n
\n
\n GET\n /_ingest/{index}/_simulate\n
\n
\n POST\n /_ingest/{index}/_simulate\n
\n \n\nRun ingest pipelines against a set of provided documents, optionally with substitute pipeline definitions, to simulate ingesting data into an index.\n\nThis API is meant to be used for troubleshooting or pipeline development, as it does not actually index any data into Elasticsearch.\n\nThe API runs the default and final pipeline for that index against a set of documents provided in the body of the request.\nIf a pipeline contains a reroute processor, it follows that reroute processor to the new index, running that index's pipelines as well the same way that a non-simulated ingest would.\nNo data is indexed into Elasticsearch.\nInstead, the transformed document is returned, along with the list of pipelines that have been run and the name of the index where the document would have been indexed if this were not a simulation.\nThe transformed document is validated against the mappings that would apply to this index, and any validation error is reported in the result.\n\nThis API differs from the simulate pipeline API in that you specify a single pipeline for that API, and it runs only that one pipeline.\nThe simulate pipeline API is more useful for developing a single pipeline, while the simulate ingest API is more useful for troubleshooting the interaction of the various pipelines that get applied when ingesting into an index.\n\nBy default, the pipeline definitions that are currently in the system are used.\nHowever, you can supply substitute pipeline definitions in the body of the request.\nThese will be used in place of the pipeline definitions that are already in the system. This can be used to replace existing pipeline definitions or to create new ones. The pipeline substitutions are used only within this request.\n\n## Required authorization\n\n* Index privileges: `index`\n" operationId: simulate-ingest parameters: - $ref: '#/components/parameters/simulate.ingest-index' - $ref: '#/components/parameters/simulate.ingest-pipeline' - $ref: '#/components/parameters/simulate.ingest-merge_type' requestBody: $ref: '#/components/requestBodies/simulate.ingest' responses: '200': $ref: '#/components/responses/simulate.ingest-200' x-state: Experimental; Added in 8.12.0 x-codeSamples: - lang: Console source: "POST /_ingest/_simulate\n{\n \"docs\": [\n {\n \"_id\": \"123\",\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_id\": \"456\",\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n}" - lang: Python source: "resp = client.simulate.ingest(\n docs=[\n {\n \"_id\": \"123\",\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_id\": \"456\",\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ],\n)" - lang: JavaScript source: "const response = await client.simulate.ingest({\n docs: [\n {\n _id: \"123\",\n _index: \"my-index\",\n _source: {\n foo: \"bar\",\n },\n },\n {\n _id: \"456\",\n _index: \"my-index\",\n _source: {\n foo: \"rab\",\n },\n },\n ],\n});" - lang: Ruby source: "response = client.simulate.ingest(\n body: {\n \"docs\": [\n {\n \"_id\": \"123\",\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_id\": \"456\",\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n }\n)" - lang: PHP source: "$resp = $client->simulate()->ingest([\n \"body\" => [\n \"docs\" => array(\n [\n \"_id\" => \"123\",\n \"_index\" => \"my-index\",\n \"_source\" => [\n \"foo\" => \"bar\",\n ],\n ],\n [\n \"_id\" => \"456\",\n \"_index\" => \"my-index\",\n \"_source\" => [\n \"foo\" => \"rab\",\n ],\n ],\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"docs":[{"_id":"123","_index":"my-index","_source":{"foo":"bar"}},{"_id":"456","_index":"my-index","_source":{"foo":"rab"}}]}'' "$ELASTICSEARCH_URL/_ingest/_simulate"' - lang: C# source: "var response = await client.Simulate\n .IngestAsync(d1 => d1\n .Docs(d2 => d2\n .Id(\"123\")\n .Index(\"my-index\")\n .Source(JsonSerializer.Deserialize(\"\"\"\n {\n \"foo\": \"bar\"\n }\n \"\"\")), d2 => d2\n .Id(\"456\")\n .Index(\"my-index\")\n .Source(JsonSerializer.Deserialize(\"\"\"\n {\n \"foo\": \"rab\"\n }\n \"\"\"))\n )\n );" - lang: Java source: "client.simulate().ingest(i -> i\n .docs(List.of(Document.of(d -> d\n .id(\"123\")\n .index(\"my-index\")\n .source(JsonData.fromJson(\"\"\"\n{\"foo\":\"bar\"}\n\"\"\"))\n ),Document.of(d -> d\n .id(\"456\")\n .index(\"my-index\")\n .source(JsonData.fromJson(\"\"\"\n{\"foo\":\"rab\"}\n\"\"\"))\n )))\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_slm/policy/{policy_id}': get: tags: - slm summary: "Get policy information\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_slm/policy\n
\n
\n GET\n /_slm/policy/{policy_id}\n
\n \n\nGet snapshot lifecycle policy definitions and information about the latest snapshot attempts.\n\n## Required authorization\n\n* Cluster privileges: `manage_slm`\n" operationId: slm-get-lifecycle parameters: - $ref: '#/components/parameters/slm.get_lifecycle-policy_id' - $ref: '#/components/parameters/slm.get_lifecycle-master_timeout' - $ref: '#/components/parameters/slm.get_lifecycle-timeout' responses: '200': $ref: '#/components/responses/slm.get_lifecycle-200' x-state: Generally available; Added in 7.4.0 x-codeSamples: - lang: Console source: "GET _slm/policy/daily-snapshots?human\n" - lang: Python source: "resp = client.slm.get_lifecycle(\n policy_id=\"daily-snapshots\",\n human=True,\n)" - lang: JavaScript source: "const response = await client.slm.getLifecycle({\n policy_id: \"daily-snapshots\",\n human: \"true\",\n});" - lang: Ruby source: "response = client.slm.get_lifecycle(\n policy_id: \"daily-snapshots\",\n human: \"true\"\n)" - lang: PHP source: "$resp = $client->slm()->getLifecycle([\n \"policy_id\" => \"daily-snapshots\",\n \"human\" => \"true\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_slm/policy/daily-snapshots?human"' - lang: C# source: "var response = await client.SnapshotLifecycleManagement\n .GetLifecycleAsync(d1 => d1\n .PolicyId(new[] { \"daily-snapshots\" })\n );" - lang: Java source: "client.slm().getLifecycle(g -> g\n .policyId(\"daily-snapshots\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - slm summary: Create or update a policy description: "Create or update a snapshot lifecycle policy.\nIf the policy already exists, this request increments the policy version.\nOnly the latest version of a policy is stored.\n\n## Required authorization\n\n* Index privileges: `manage`\n* Cluster privileges: `manage_slm`\n" operationId: slm-put-lifecycle parameters: - name: policy_id in: path description: The identifier for the snapshot lifecycle policy you want to create or update. required: true schema: $ref: '#/components/schemas/_types.Name' - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error.\nTo indicate that the request should never timeout, set it to `-1`." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "The period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error.\nTo indicate that the request should never timeout, set it to `-1`." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: type: object properties: config: allOf: - $ref: '#/components/schemas/slm._types.Configuration' description: Configuration for each snapshot created by the policy. name: allOf: - $ref: '#/components/schemas/_types.Name' description: 'Name automatically assigned to each snapshot created by the policy. Date math is supported. To prevent conflicting snapshot names, a UUID is automatically appended to each snapshot name.' repository: type: string description: Repository used to store snapshots created by this policy. This repository must exist prior to the policy’s creation. You can create a repository using the snapshot repository API. retention: allOf: - $ref: '#/components/schemas/slm._types.Retention' description: Retention rules used to retain and delete snapshots created by the policy. schedule: allOf: - $ref: '#/components/schemas/watcher._types.CronExpression' description: Periodic or absolute schedule at which the policy creates snapshots. SLM applies schedule changes immediately. examples: PutSnapshotLifecycleRequestExample1 copy: summary: Create a policy description: "Run `PUT /_slm/policy/daily-snapshots` to create a lifecycle policy. The `schedule` is when the snapshot should be taken, in this case, 1:30am daily. The `retention` details specify to: keep snapshots for 30 days; always keep at least 5 successful snapshots, even if they're more than 30 days old; keep no more than 50 successful snapshots, even if they're less than 30 days old.\n" value: "{\n \"schedule\": \"0 30 1 * * ?\",\n \"name\": \"\",\n \"repository\": \"my_repository\",\n \"config\": {\n \"indices\": [\"data-*\", \"important\"],\n \"ignore_unavailable\": false,\n \"include_global_state\": false\n },\n \"retention\": {\n \"expire_after\": \"30d\",\n \"min_count\": 5,\n \"max_count\": 50\n }\n}" x-codeSamples: - lang: Console source: "PUT /_slm/policy/daily-snapshots\n{\n \"schedule\": \"0 30 1 * * ?\",\n \"name\": \"\",\n \"repository\": \"my_repository\",\n \"config\": {\n \"indices\": [\"data-*\", \"important\"],\n \"ignore_unavailable\": false,\n \"include_global_state\": false\n },\n \"retention\": {\n \"expire_after\": \"30d\",\n \"min_count\": 5,\n \"max_count\": 50\n }\n}" - lang: Python source: "resp = client.slm.put_lifecycle(\n policy_id=\"daily-snapshots\",\n schedule=\"0 30 1 * * ?\",\n name=\"\",\n repository=\"my_repository\",\n config={\n \"indices\": [\n \"data-*\",\n \"important\"\n ],\n \"ignore_unavailable\": False,\n \"include_global_state\": False\n },\n retention={\n \"expire_after\": \"30d\",\n \"min_count\": 5,\n \"max_count\": 50\n },\n)" - lang: JavaScript source: "const response = await client.slm.putLifecycle({\n policy_id: \"daily-snapshots\",\n schedule: \"0 30 1 * * ?\",\n name: \"\",\n repository: \"my_repository\",\n config: {\n indices: [\"data-*\", \"important\"],\n ignore_unavailable: false,\n include_global_state: false,\n },\n retention: {\n expire_after: \"30d\",\n min_count: 5,\n max_count: 50,\n },\n});" - lang: Ruby source: "response = client.slm.put_lifecycle(\n policy_id: \"daily-snapshots\",\n body: {\n \"schedule\": \"0 30 1 * * ?\",\n \"name\": \"\",\n \"repository\": \"my_repository\",\n \"config\": {\n \"indices\": [\n \"data-*\",\n \"important\"\n ],\n \"ignore_unavailable\": false,\n \"include_global_state\": false\n },\n \"retention\": {\n \"expire_after\": \"30d\",\n \"min_count\": 5,\n \"max_count\": 50\n }\n }\n)" - lang: PHP source: "$resp = $client->slm()->putLifecycle([\n \"policy_id\" => \"daily-snapshots\",\n \"body\" => [\n \"schedule\" => \"0 30 1 * * ?\",\n \"name\" => \"\",\n \"repository\" => \"my_repository\",\n \"config\" => [\n \"indices\" => array(\n \"data-*\",\n \"important\",\n ),\n \"ignore_unavailable\" => false,\n \"include_global_state\" => false,\n ],\n \"retention\" => [\n \"expire_after\" => \"30d\",\n \"min_count\" => 5,\n \"max_count\" => 50,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"schedule":"0 30 1 * * ?","name":"","repository":"my_repository","config":{"indices":["data-*","important"],"ignore_unavailable":false,"include_global_state":false},"retention":{"expire_after":"30d","min_count":5,"max_count":50}}'' "$ELASTICSEARCH_URL/_slm/policy/daily-snapshots"' - lang: C# source: "var response = await client.SnapshotLifecycleManagement\n .PutLifecycleAsync(policyId: \"daily-snapshots\", d1 => d1\n .Config(d2 => d2\n .IgnoreUnavailable(false)\n .IncludeGlobalState(false)\n .Indices(new[] { \"data-*\", \"important\" })\n )\n .Name(\"\")\n .Repository(\"my_repository\")\n .Retention(d2 => d2\n .ExpireAfter(\"30d\")\n .MaxCount(50)\n .MinCount(5)\n )\n .Schedule(\"0 30 1 * * ?\")\n );" - lang: Java source: "client.slm().putLifecycle(p -> p\n .config(c -> c\n .ignoreUnavailable(false)\n .indices(List.of(\"data-*\",\"important\"))\n .includeGlobalState(false)\n )\n .name(\"\")\n .policyId(\"daily-snapshots\")\n .repository(\"my_repository\")\n .retention(r -> r\n .expireAfter(e -> e\n .time(\"30d\")\n )\n .maxCount(50)\n .minCount(5)\n )\n .schedule(\"0 30 1 * * ?\")\n);\n" PutSnapshotLifecycleRequestExample2: summary: Create a policy with intevals description: "Run `PUT /_slm/policy/hourly-snapshots` to create a lifecycle policy that uses interval scheduling. It creates a snapshot once every hour. The first snapshot will be created one hour after the policy is modified, with subsequent snapshots every hour afterward.\n" value: "{\n \"schedule\": \"1h\",\n \"name\": \"\",\n \"repository\": \"my_repository\",\n \"config\": {\n \"indices\": [\"data-*\", \"important\"]\n }\n}" x-codeSamples: - lang: Console source: "PUT /_slm/policy/hourly-snapshots\n{\n \"schedule\": \"1h\",\n \"name\": \"\",\n \"repository\": \"my_repository\",\n \"config\": {\n \"indices\": [\"data-*\", \"important\"]\n }\n}" - lang: Python source: "resp = client.slm.put_lifecycle(\n policy_id=\"hourly-snapshots\",\n schedule=\"1h\",\n name=\"\",\n repository=\"my_repository\",\n config={\n \"indices\": [\n \"data-*\",\n \"important\"\n ]\n },\n)" - lang: JavaScript source: "const response = await client.slm.putLifecycle({\n policy_id: \"hourly-snapshots\",\n schedule: \"1h\",\n name: \"\",\n repository: \"my_repository\",\n config: {\n indices: [\"data-*\", \"important\"],\n },\n});" - lang: Ruby source: "response = client.slm.put_lifecycle(\n policy_id: \"hourly-snapshots\",\n body: {\n \"schedule\": \"1h\",\n \"name\": \"\",\n \"repository\": \"my_repository\",\n \"config\": {\n \"indices\": [\n \"data-*\",\n \"important\"\n ]\n }\n }\n)" - lang: PHP source: "$resp = $client->slm()->putLifecycle([\n \"policy_id\" => \"hourly-snapshots\",\n \"body\" => [\n \"schedule\" => \"1h\",\n \"name\" => \"\",\n \"repository\" => \"my_repository\",\n \"config\" => [\n \"indices\" => array(\n \"data-*\",\n \"important\",\n ),\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"schedule":"1h","name":"","repository":"my_repository","config":{"indices":["data-*","important"]}}'' "$ELASTICSEARCH_URL/_slm/policy/hourly-snapshots"' - lang: C# source: "var response = await client.SnapshotLifecycleManagement\n .PutLifecycleAsync(policyId: \"hourly-snapshots\", d1 => d1\n .Config(d2 => d2\n .Indices(new[] { \"data-*\", \"important\" })\n )\n .Name(\"\")\n .Repository(\"my_repository\")\n .Schedule(\"1h\")\n );" - lang: Java source: "client.slm().putLifecycle(p -> p\n .config(c -> c\n .indices(List.of(\"data-*\",\"important\"))\n )\n .name(\"\")\n .policyId(\"hourly-snapshots\")\n .repository(\"my_repository\")\n .schedule(\"1h\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 7.4.0 x-codeSamples: - lang: Console source: "PUT /_slm/policy/daily-snapshots\n{\n \"schedule\": \"0 30 1 * * ?\",\n \"name\": \"\",\n \"repository\": \"my_repository\",\n \"config\": {\n \"indices\": [\"data-*\", \"important\"],\n \"ignore_unavailable\": false,\n \"include_global_state\": false\n },\n \"retention\": {\n \"expire_after\": \"30d\",\n \"min_count\": 5,\n \"max_count\": 50\n }\n}" - lang: Python source: "resp = client.slm.put_lifecycle(\n policy_id=\"daily-snapshots\",\n schedule=\"0 30 1 * * ?\",\n name=\"\",\n repository=\"my_repository\",\n config={\n \"indices\": [\n \"data-*\",\n \"important\"\n ],\n \"ignore_unavailable\": False,\n \"include_global_state\": False\n },\n retention={\n \"expire_after\": \"30d\",\n \"min_count\": 5,\n \"max_count\": 50\n },\n)" - lang: JavaScript source: "const response = await client.slm.putLifecycle({\n policy_id: \"daily-snapshots\",\n schedule: \"0 30 1 * * ?\",\n name: \"\",\n repository: \"my_repository\",\n config: {\n indices: [\"data-*\", \"important\"],\n ignore_unavailable: false,\n include_global_state: false,\n },\n retention: {\n expire_after: \"30d\",\n min_count: 5,\n max_count: 50,\n },\n});" - lang: Ruby source: "response = client.slm.put_lifecycle(\n policy_id: \"daily-snapshots\",\n body: {\n \"schedule\": \"0 30 1 * * ?\",\n \"name\": \"\",\n \"repository\": \"my_repository\",\n \"config\": {\n \"indices\": [\n \"data-*\",\n \"important\"\n ],\n \"ignore_unavailable\": false,\n \"include_global_state\": false\n },\n \"retention\": {\n \"expire_after\": \"30d\",\n \"min_count\": 5,\n \"max_count\": 50\n }\n }\n)" - lang: PHP source: "$resp = $client->slm()->putLifecycle([\n \"policy_id\" => \"daily-snapshots\",\n \"body\" => [\n \"schedule\" => \"0 30 1 * * ?\",\n \"name\" => \"\",\n \"repository\" => \"my_repository\",\n \"config\" => [\n \"indices\" => array(\n \"data-*\",\n \"important\",\n ),\n \"ignore_unavailable\" => false,\n \"include_global_state\" => false,\n ],\n \"retention\" => [\n \"expire_after\" => \"30d\",\n \"min_count\" => 5,\n \"max_count\" => 50,\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"schedule":"0 30 1 * * ?","name":"","repository":"my_repository","config":{"indices":["data-*","important"],"ignore_unavailable":false,"include_global_state":false},"retention":{"expire_after":"30d","min_count":5,"max_count":50}}'' "$ELASTICSEARCH_URL/_slm/policy/daily-snapshots"' - lang: C# source: "var response = await client.SnapshotLifecycleManagement\n .PutLifecycleAsync(policyId: \"daily-snapshots\", d1 => d1\n .Config(d2 => d2\n .IgnoreUnavailable(false)\n .IncludeGlobalState(false)\n .Indices(new[] { \"data-*\", \"important\" })\n )\n .Name(\"\")\n .Repository(\"my_repository\")\n .Retention(d2 => d2\n .ExpireAfter(\"30d\")\n .MaxCount(50)\n .MinCount(5)\n )\n .Schedule(\"0 30 1 * * ?\")\n );" - lang: Java source: "client.slm().putLifecycle(p -> p\n .config(c -> c\n .ignoreUnavailable(false)\n .indices(List.of(\"data-*\",\"important\"))\n .includeGlobalState(false)\n )\n .name(\"\")\n .policyId(\"daily-snapshots\")\n .repository(\"my_repository\")\n .retention(r -> r\n .expireAfter(e -> e\n .time(\"30d\")\n )\n .maxCount(50)\n .minCount(5)\n )\n .schedule(\"0 30 1 * * ?\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - slm summary: Delete a policy description: "Delete a snapshot lifecycle policy definition.\nThis operation prevents any future snapshots from being taken but does not cancel in-progress snapshots or remove previously-taken snapshots.\n\n## Required authorization\n\n* Cluster privileges: `manage_slm`\n" operationId: slm-delete-lifecycle parameters: - name: policy_id in: path description: The id of the snapshot lifecycle policy to remove required: true schema: $ref: '#/components/schemas/_types.Name' - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "The period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 7.4.0 x-codeSamples: - lang: Console source: "DELETE /_slm/policy/daily-snapshots\n" - lang: Python source: "resp = client.slm.delete_lifecycle(\n policy_id=\"daily-snapshots\",\n)" - lang: JavaScript source: "const response = await client.slm.deleteLifecycle({\n policy_id: \"daily-snapshots\",\n});" - lang: Ruby source: "response = client.slm.delete_lifecycle(\n policy_id: \"daily-snapshots\"\n)" - lang: PHP source: "$resp = $client->slm()->deleteLifecycle([\n \"policy_id\" => \"daily-snapshots\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_slm/policy/daily-snapshots"' - lang: C# source: 'var response = await client.SnapshotLifecycleManagement.DeleteLifecycleAsync(policyId: "daily-snapshots");' - lang: Java source: "client.slm().deleteLifecycle(d -> d\n .policyId(\"daily-snapshots\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_slm/policy/{policy_id}/_execute': put: tags: - slm summary: Run a policy description: "Immediately create a snapshot according to the snapshot lifecycle policy without waiting for the scheduled time.\nThe snapshot policy is normally applied according to its schedule, but you might want to manually run a policy before performing an upgrade or other maintenance.\n\n## Required authorization\n\n* Cluster privileges: `manage_slm`\n" operationId: slm-execute-lifecycle parameters: - name: policy_id in: path description: The id of the snapshot lifecycle policy to be executed required: true schema: $ref: '#/components/schemas/_types.Name' - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "The period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - snapshot_name type: object properties: snapshot_name: allOf: - $ref: '#/components/schemas/_types.Name' examples: ExecuteSnapshotLifecycleResponseExample1: description: "Run `POST /_slm/policy/daily-snapshots/_execute` to take an immediate snapshot according to the `daily-snapshots` policy.\n" value: "{\n \"snapshot_name\": \"daily-snap-2019.04.24-gwrqoo2xtea3q57vvg0uea\"\n}" x-state: Generally available; Added in 7.4.0 x-codeSamples: - lang: Console source: "PUT /_slm/policy/daily-snapshots/_execute\n" - lang: Python source: "resp = client.slm.execute_lifecycle(\n policy_id=\"daily-snapshots\",\n)" - lang: JavaScript source: "const response = await client.slm.executeLifecycle({\n policy_id: \"daily-snapshots\",\n});" - lang: Ruby source: "response = client.slm.execute_lifecycle(\n policy_id: \"daily-snapshots\"\n)" - lang: PHP source: "$resp = $client->slm()->executeLifecycle([\n \"policy_id\" => \"daily-snapshots\",\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_slm/policy/daily-snapshots/_execute"' - lang: C# source: 'var response = await client.SnapshotLifecycleManagement.ExecuteLifecycleAsync(policyId: "daily-snapshots");' - lang: Java source: "client.slm().executeLifecycle(e -> e\n .policyId(\"daily-snapshots\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_slm/_execute_retention: post: tags: - slm summary: Run a retention policy description: "Manually apply the retention policy to force immediate removal of snapshots that are expired according to the snapshot lifecycle policy retention rules.\nThe retention policy is normally applied according to its schedule.\n\n## Required authorization\n\n* Cluster privileges: `manage_slm`\n" operationId: slm-execute-retention parameters: - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "The period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 7.5.0 x-codeSamples: - lang: Console source: "POST _slm/_execute_retention\n" - lang: Python source: resp = client.slm.execute_retention() - lang: JavaScript source: const response = await client.slm.executeRetention(); - lang: Ruby source: response = client.slm.execute_retention - lang: PHP source: $resp = $client->slm()->executeRetention(); - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_slm/_execute_retention"' - lang: C# source: var response = await client.SnapshotLifecycleManagement.ExecuteRetentionAsync(); - lang: Java source: "client.slm().executeRetention(e -> e);\n" x-metaTags: - content: Elasticsearch name: product_name /_slm/stats: get: tags: - slm summary: Get snapshot lifecycle management statistics description: "Get global and policy-level statistics about actions taken by snapshot lifecycle management.\n\n## Required authorization\n\n* Cluster privileges: `manage_slm`\n" operationId: slm-get-stats parameters: - name: master_timeout in: query description: 'Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: 'Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - retention_deletion_time - retention_deletion_time_millis - retention_failed - retention_runs - retention_timed_out - total_snapshots_deleted - total_snapshot_deletion_failures - total_snapshots_failed - total_snapshots_taken - policy_stats type: object properties: retention_deletion_time: allOf: - $ref: '#/components/schemas/_types.Duration' retention_deletion_time_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' retention_failed: type: number retention_runs: type: number retention_timed_out: type: number total_snapshots_deleted: type: number total_snapshot_deletion_failures: type: number total_snapshots_failed: type: number total_snapshots_taken: type: number policy_stats: type: array items: $ref: '#/components/schemas/slm._types.SnapshotPolicyStats' examples: GetSnapshotLifecycleManagementStatsResponseExample1: description: A successful response from `GET /_slm/stats`. value: "{\n \"retention_runs\": 13,\n \"retention_failed\": 0,\n \"retention_timed_out\": 0,\n \"retention_deletion_time\": \"1.4s\",\n \"retention_deletion_time_millis\": 1404,\n \"policy_stats\": [ ],\n \"total_snapshots_taken\": 1,\n \"total_snapshots_failed\": 1,\n \"total_snapshots_deleted\": 0,\n \"total_snapshot_deletion_failures\": 0\n}" x-state: Generally available; Added in 7.5.0 x-codeSamples: - lang: Console source: "GET /_slm/stats\n" - lang: Python source: resp = client.slm.get_stats() - lang: JavaScript source: const response = await client.slm.getStats(); - lang: Ruby source: response = client.slm.get_stats - lang: PHP source: $resp = $client->slm()->getStats(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_slm/stats"' - lang: C# source: var response = await client.SnapshotLifecycleManagement.GetStatsAsync(); - lang: Java source: "client.slm().getStats(g -> g);\n" x-metaTags: - content: Elasticsearch name: product_name /_slm/status: get: tags: - slm summary: Get the snapshot lifecycle management status description: "\n\n## Required authorization\n\n* Cluster privileges: `read_slm`\n" operationId: slm-get-status parameters: - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error.\nTo indicate that the request should never timeout, set it to `-1`." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "The period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error.\nTo indicate that the request should never timeout, set it to `-1`." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - operation_mode type: object properties: operation_mode: allOf: - $ref: '#/components/schemas/_types.LifecycleOperationMode' examples: GetSnapshotLifecycleManagementStatusResponseExample1: description: A successful response from `GET _slm/status`. value: "{\n \"operation_mode\": \"RUNNING\"\n}" x-state: Generally available; Added in 7.6.0 x-codeSamples: - lang: Console source: "GET _slm/status\n" - lang: Python source: resp = client.slm.get_status() - lang: JavaScript source: const response = await client.slm.getStatus(); - lang: Ruby source: response = client.slm.get_status - lang: PHP source: $resp = $client->slm()->getStatus(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_slm/status"' - lang: C# source: var response = await client.SnapshotLifecycleManagement.GetStatusAsync(); - lang: Java source: "client.slm().getStatus(g -> g);\n" x-metaTags: - content: Elasticsearch name: product_name /_slm/start: post: tags: - slm summary: Start snapshot lifecycle management description: "Snapshot lifecycle management (SLM) starts automatically when a cluster is formed.\nManually starting SLM is necessary only if it has been stopped using the stop SLM API.\n\n## Required authorization\n\n* Cluster privileges: `manage_slm`\n" operationId: slm-start parameters: - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error.\nTo indicate that the request should never timeout, set it to `-1`." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "The period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error.\nTo indicate that the request should never timeout, set it to `-1`." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: StartSnapshotLifecycleManagementResponseExample1: description: A successful response from `POST _slm/start`. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 7.6.0 x-codeSamples: - lang: Console source: "POST _slm/start\n" - lang: Python source: resp = client.slm.start() - lang: JavaScript source: const response = await client.slm.start(); - lang: Ruby source: response = client.slm.start - lang: PHP source: $resp = $client->slm()->start(); - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_slm/start"' - lang: C# source: var response = await client.SnapshotLifecycleManagement.StartAsync(); - lang: Java source: "client.slm().start(s -> s);\n" x-metaTags: - content: Elasticsearch name: product_name /_slm/stop: post: tags: - slm summary: Stop snapshot lifecycle management description: "Stop all snapshot lifecycle management (SLM) operations and the SLM plugin.\nThis API is useful when you are performing maintenance on a cluster and need to prevent SLM from performing any actions on your data streams or indices.\nStopping SLM does not stop any snapshots that are in progress.\nYou can manually trigger snapshots with the run snapshot lifecycle policy API even if SLM is stopped.\n\nThe API returns a response as soon as the request is acknowledged, but the plugin might continue to run until in-progress operations complete and it can be safely stopped.\nUse the get snapshot lifecycle management status API to see if SLM is running.\n\n## Required authorization\n\n* Cluster privileges: `manage_slm`\n" operationId: slm-stop parameters: - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error.\nTo indicate that the request should never timeout, set it to `-1`." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "The period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error.\nTo indicate that the request should never timeout, set it to `-1`." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 7.6.0 x-metaTags: - content: Elasticsearch name: product_name '/_snapshot/{repository}/_cleanup': post: tags: - snapshot summary: Clean up the snapshot repository description: "Trigger the review of the contents of a snapshot repository and delete any stale data not referenced by existing snapshots.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" externalDocs: description: About managing snapshot url: https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore/self-managed#snapshots-repository-cleanup x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/clean-up-snapshot-repo-api.html operationId: snapshot-cleanup-repository parameters: - name: repository in: path description: The name of the snapshot repository to clean up. required: true schema: $ref: '#/components/schemas/_types.Name' - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nTo indicate that the request should never timeout, set it to `-1`" schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "The period to wait for a response from all relevant nodes in the cluster after updating the cluster metadata.\nIf no response is received before the timeout expires, the cluster metadata update still applies but the response will indicate that it was not completely acknowledged.\nTo indicate that the request should never timeout, set it to `-1`." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - results type: object properties: results: allOf: - $ref: '#/components/schemas/snapshot.cleanup_repository.CleanupRepositoryResults' description: Statistics for cleanup operations. examples: SnapshotCleanupRepositoryResponseExample1: description: A successful response from `POST /_snapshot/my_repository/_cleanup`. value: "{\n \"results\": {\n \"deleted_bytes\": 20,\n \"deleted_blobs\": 5\n }\n}" x-state: Generally available; Added in 7.4.0 x-codeSamples: - lang: Console source: "POST /_snapshot/my_repository/_cleanup\n" - lang: Python source: "resp = client.snapshot.cleanup_repository(\n name=\"my_repository\",\n)" - lang: JavaScript source: "const response = await client.snapshot.cleanupRepository({\n name: \"my_repository\",\n});" - lang: Ruby source: "response = client.snapshot.cleanup_repository(\n repository: \"my_repository\"\n)" - lang: PHP source: "$resp = $client->snapshot()->cleanupRepository([\n \"repository\" => \"my_repository\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_snapshot/my_repository/_cleanup"' - lang: C# source: 'var response = await client.Snapshot.CleanupRepositoryAsync(name: "my_repository");' - lang: Java source: "client.snapshot().cleanupRepository(c -> c\n .name(\"my_repository\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_snapshot/{repository}/{snapshot}/_clone/{target_snapshot}': put: tags: - snapshot summary: Clone a snapshot description: "Clone part of all of a snapshot into another snapshot in the same repository.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: snapshot-clone parameters: - name: repository in: path description: The name of the snapshot repository that both source and target snapshot belong to. required: true schema: $ref: '#/components/schemas/_types.Name' - name: snapshot in: path description: The source snapshot name. required: true schema: $ref: '#/components/schemas/_types.Name' - name: target_snapshot in: path description: The target snapshot name. required: true schema: $ref: '#/components/schemas/_types.Name' - name: master_timeout in: query description: "The period to wait for the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nTo indicate that the request should never timeout, set it to `-1`." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - indices type: object properties: indices: type: string description: "A comma-separated list of indices to include in the snapshot.\nMulti-target syntax is supported." examples: SnapshotCloneRequestExample1: description: Run `PUT /_snapshot/my_repository/source_snapshot/_clone/target_snapshot` to clone the `source_snapshot` into a new `target_snapshot`. value: "{\n \"indices\": \"index_a,index_b\"\n}" x-codeSamples: - lang: Console source: "PUT /_snapshot/my_repository/source_snapshot/_clone/target_snapshot\n{\n \"indices\": \"index_a,index_b\"\n}" - lang: Python source: "resp = client.snapshot.clone(\n repository=\"my_repository\",\n snapshot=\"source_snapshot\",\n target_snapshot=\"target_snapshot\",\n indices=\"index_a,index_b\",\n)" - lang: JavaScript source: "const response = await client.snapshot.clone({\n repository: \"my_repository\",\n snapshot: \"source_snapshot\",\n target_snapshot: \"target_snapshot\",\n indices: \"index_a,index_b\",\n});" - lang: Ruby source: "response = client.snapshot.clone(\n repository: \"my_repository\",\n snapshot: \"source_snapshot\",\n target_snapshot: \"target_snapshot\",\n body: {\n \"indices\": \"index_a,index_b\"\n }\n)" - lang: PHP source: "$resp = $client->snapshot()->clone([\n \"repository\" => \"my_repository\",\n \"snapshot\" => \"source_snapshot\",\n \"target_snapshot\" => \"target_snapshot\",\n \"body\" => [\n \"indices\" => \"index_a,index_b\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"indices":"index_a,index_b"}'' "$ELASTICSEARCH_URL/_snapshot/my_repository/source_snapshot/_clone/target_snapshot"' - lang: C# source: "var response = await client.Snapshot\n .CloneAsync(repository: \"my_repository\", snapshot: \"source_snapshot\", targetSnapshot: \"target_snapshot\", d1 => d1\n .Indices(\"index_a,index_b\")\n );" - lang: Java source: "client.snapshot().clone(c -> c\n .indices(\"index_a,index_b\")\n .repository(\"my_repository\")\n .snapshot(\"source_snapshot\")\n .targetSnapshot(\"target_snapshot\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 7.10.0 x-codeSamples: - lang: Console source: "PUT /_snapshot/my_repository/source_snapshot/_clone/target_snapshot\n{\n \"indices\": \"index_a,index_b\"\n}" - lang: Python source: "resp = client.snapshot.clone(\n repository=\"my_repository\",\n snapshot=\"source_snapshot\",\n target_snapshot=\"target_snapshot\",\n indices=\"index_a,index_b\",\n)" - lang: JavaScript source: "const response = await client.snapshot.clone({\n repository: \"my_repository\",\n snapshot: \"source_snapshot\",\n target_snapshot: \"target_snapshot\",\n indices: \"index_a,index_b\",\n});" - lang: Ruby source: "response = client.snapshot.clone(\n repository: \"my_repository\",\n snapshot: \"source_snapshot\",\n target_snapshot: \"target_snapshot\",\n body: {\n \"indices\": \"index_a,index_b\"\n }\n)" - lang: PHP source: "$resp = $client->snapshot()->clone([\n \"repository\" => \"my_repository\",\n \"snapshot\" => \"source_snapshot\",\n \"target_snapshot\" => \"target_snapshot\",\n \"body\" => [\n \"indices\" => \"index_a,index_b\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"indices":"index_a,index_b"}'' "$ELASTICSEARCH_URL/_snapshot/my_repository/source_snapshot/_clone/target_snapshot"' - lang: C# source: "var response = await client.Snapshot\n .CloneAsync(repository: \"my_repository\", snapshot: \"source_snapshot\", targetSnapshot: \"target_snapshot\", d1 => d1\n .Indices(\"index_a,index_b\")\n );" - lang: Java source: "client.snapshot().clone(c -> c\n .indices(\"index_a,index_b\")\n .repository(\"my_repository\")\n .snapshot(\"source_snapshot\")\n .targetSnapshot(\"target_snapshot\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_snapshot/{repository}/{snapshot}': get: tags: - snapshot summary: Get snapshot information description: "NOTE: The `after` parameter and `next` field enable you to iterate through snapshots with some consistency guarantees regarding concurrent creation or deletion of snapshots.\nIt is guaranteed that any snapshot that exists at the beginning of the iteration and is not concurrently deleted will be seen during the iteration.\nSnapshots concurrently created may be seen during an iteration.\n\n## Required authorization\n\n* Cluster privileges: `monitor_snapshot`\n" operationId: snapshot-get parameters: - name: repository in: path description: "A comma-separated list of snapshot repository names used to limit the request.\nWildcard (`*`) expressions are supported." required: true schema: $ref: '#/components/schemas/_types.Name' - name: snapshot in: path description: "A comma-separated list of snapshot names to retrieve\nWildcards (`*`) are supported.\n\n* To get information about all snapshots in a registered repository, use a wildcard (`*`) or `_all`.\n* To get information about any snapshots that are currently running, use `_current`." required: true schema: $ref: '#/components/schemas/_types.Names' - name: after in: query description: An offset identifier to start pagination from as returned by the next field in the response body. schema: type: string x-state: Generally available; Added in 7.14.0 - name: from_sort_value in: query description: "The value of the current sort column at which to start retrieval.\nIt can be a string `snapshot-` or a repository name when sorting by snapshot or repository name.\nIt can be a millisecond time value or a number when sorting by `index-` or shard count." schema: type: string x-state: Generally available; Added in 7.16.0 - name: ignore_unavailable in: query description: 'If `false`, the request returns an error for any snapshots that are unavailable.' schema: type: boolean default: false - name: index_details in: query description: "If `true`, the response includes additional information about each index in the snapshot comprising the number of shards in the index, the total size of the index in bytes, and the maximum number of segments per shard in the index.\nThe default is `false`, meaning that this information is omitted." schema: type: boolean default: false x-state: Generally available; Added in 7.13.0 - name: index_names in: query description: 'If `true`, the response includes the name of each index in each snapshot.' schema: type: boolean default: true x-state: Generally available; Added in 8.3.0 - name: include_repository in: query description: 'If `true`, the response includes the repository name in each snapshot.' schema: type: boolean default: true - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: order in: query description: "The sort order.\nValid values are `asc` for ascending and `desc` for descending order.\nThe default behavior is ascending order.\n\nSupported values include:\n - `asc`: Ascending (smallest to largest)\n - `desc`: Descending (largest to smallest)\n\n" schema: allOf: - $ref: '#/components/schemas/_types.SortOrder' default: asc x-state: Generally available; Added in 7.14.0 - name: offset in: query description: Numeric offset to start pagination from based on the snapshots matching this request. Using a non-zero value for this parameter is mutually exclusive with using the after parameter. Defaults to 0. schema: type: number default: 0 x-state: Generally available; Added in 7.15.0 - name: size in: query description: "The maximum number of snapshots to return.\nThe default is -1, which means to return all that match the request without limit." schema: type: number default: -1 x-state: Generally available; Added in 7.14.0 - name: slm_policy_filter in: query description: "Filter snapshots by a comma-separated list of snapshot lifecycle management (SLM) policy names that snapshots belong to.\n\nYou can use wildcards (`*`) and combinations of wildcards followed by exclude patterns starting with `-`.\nFor example, the pattern `*,-policy-a-\\*` will return all snapshots except for those that were created by an SLM policy with a name starting with `policy-a-`.\nNote that the wildcard pattern `*` matches all snapshots created by an SLM policy but not those snapshots that were not created by an SLM policy.\nTo include snapshots that were not created by an SLM policy, you can use the special pattern `_none` that will match all snapshots without an SLM policy." schema: $ref: '#/components/schemas/_types.Name' x-state: Generally available; Added in 7.16.0 - name: sort in: query description: "The sort order for the result.\nThe default behavior is sorting by snapshot start time stamp." schema: allOf: - $ref: '#/components/schemas/snapshot._types.SnapshotSort' default: start_time x-state: Generally available; Added in 7.14.0 - name: state in: query description: "Only return snapshots with a state found in the given comma-separated list of snapshot states.\nThe default is all snapshot states.\n\nSupported values include:\n - `IN_PROGRESS`: The snapshot process has started.\n - `SUCCESS`: The snapshot process completed successfully.\n - `FAILED`: The snapshot failed.\n - `PARTIAL`: The snapshot was partially successful.\n - `INCOMPATIBLE`: The snapshot is incompatible with the current version of the cluster.\n\n" schema: oneOf: - $ref: '#/components/schemas/snapshot._types.SnapshotState' - type: array items: $ref: '#/components/schemas/snapshot._types.SnapshotState' x-state: Generally available; Added in 9.1.0 - name: verbose in: query description: "If `true`, returns additional information about each snapshot such as the version of Elasticsearch which took the snapshot, the start and end times of the snapshot, and the number of shards snapshotted.\n\nNOTE: The parameters `size`, `order`, `after`, `from_sort_value`, `offset`, `slm_policy_filter`, and `sort` are not supported when you set `verbose=false` and the sort order for requests with `verbose=false` is undefined." schema: type: boolean default: true responses: '200': description: '' content: application/json: schema: required: - remaining - total type: object properties: remaining: type: number description: The number of remaining snapshots that were not returned due to size limits and that can be fetched by additional requests using the `next` field value. x-state: Generally available; Added in 7.15.0 total: type: number description: The total number of snapshots that match the request when ignoring the size limit or `after` query parameter. x-state: Generally available; Added in 7.15.0 next: type: string description: "If the request contained a size limit and there might be more results, a `next` field will be added to the response.\nIt can be used as the `after` query parameter to fetch additional results." responses: type: array items: $ref: '#/components/schemas/snapshot.get.SnapshotResponseItem' snapshots: type: array items: $ref: '#/components/schemas/snapshot._types.SnapshotInfo' examples: SnapshotGetResponseExample1: description: "A successful response from `GET /_snapshot/my_repository/snapshot_*?sort=start_time&from_sort_value=1577833200000`. The response contains information for all snapshots with names starting with `snapshot_` and that started on or after timestamp `1577833200000` (Jan 1st 2020) when sorted by snapshot start time in the default ascending order.\n" value: "{\n \"snapshots\": [\n {\n \"snapshot\": \"snapshot_1\",\n \"uuid\": \"dKb54xw67gvdRctLCxSket\",\n \"repository\": \"my_repository\",\n \"version_id\": ,\n \"version\": ,\n \"indices\": [],\n \"data_streams\": [],\n \"feature_states\": [],\n \"include_global_state\": true,\n \"state\": \"SUCCESS\",\n \"start_time\": \"2020-07-06T21:55:18.128Z\",\n \"start_time_in_millis\": 1593093628849,\n \"end_time\": \"2020-07-06T21:55:18.129Z\",\n \"end_time_in_millis\": 1593093628850,\n \"duration_in_millis\": 1,\n \"failures\": [],\n \"shards\": {\n \"total\": 0,\n \"failed\": 0,\n \"successful\": 0\n }\n },\n {\n \"snapshot\": \"snapshot_2\",\n \"uuid\": \"vdRctLCxSketdKb54xw67g\",\n \"repository\": \"my_repository\",\n \"version_id\": ,\n \"version\": ,\n \"indices\": [],\n \"data_streams\": [],\n \"feature_states\": [],\n \"include_global_state\": true,\n \"state\": \"SUCCESS\",\n \"start_time\": \"2020-07-06T21:55:18.130Z\",\n \"start_time_in_millis\": 1593093628851,\n \"end_time\": \"2020-07-06T21:55:18.130Z\",\n \"end_time_in_millis\": 1593093628851,\n \"duration_in_millis\": 0,\n \"failures\": [],\n \"shards\": {\n \"total\": 0,\n \"failed\": 0,\n \"successful\": 0\n }\n },\n {\n \"snapshot\": \"snapshot_3\",\n \"uuid\": \"dRctdKb54xw67gvLCxSket\",\n \"repository\": \"my_repository\",\n \"version_id\": ,\n \"version\": ,\n \"indices\": [],\n \"data_streams\": [],\n \"feature_states\": [],\n \"include_global_state\": true,\n \"state\": \"SUCCESS\",\n \"start_time\": \"2020-07-06T21:55:18.131Z\",\n \"start_time_in_millis\": 1593093628852,\n \"end_time\": \"2020-07-06T21:55:18.135Z\",\n \"end_time_in_millis\": 1593093628856,\n \"duration_in_millis\": 4,\n \"failures\": [],\n \"shards\": {\n \"total\": 0,\n \"failed\": 0,\n \"successful\": 0\n }\n }\n ],\n \"total\": 3,\n \"remaining\": 0\n}" x-state: Generally available x-codeSamples: - lang: Console source: "GET /_snapshot/my_repository/snapshot_*?sort=start_time&from_sort_value=1577833200000\n" - lang: Python source: "resp = client.snapshot.get(\n repository=\"my_repository\",\n snapshot=\"snapshot_*\",\n sort=\"start_time\",\n from_sort_value=\"1577833200000\",\n)" - lang: JavaScript source: "const response = await client.snapshot.get({\n repository: \"my_repository\",\n snapshot: \"snapshot_*\",\n sort: \"start_time\",\n from_sort_value: 1577833200000,\n});" - lang: Ruby source: "response = client.snapshot.get(\n repository: \"my_repository\",\n snapshot: \"snapshot_*\",\n sort: \"start_time\",\n from_sort_value: \"1577833200000\"\n)" - lang: PHP source: "$resp = $client->snapshot()->get([\n \"repository\" => \"my_repository\",\n \"snapshot\" => \"snapshot_*\",\n \"sort\" => \"start_time\",\n \"from_sort_value\" => \"1577833200000\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_snapshot/my_repository/snapshot_*?sort=start_time&from_sort_value=1577833200000"' - lang: C# source: "var response = await client.Snapshot\n .GetAsync(repository: \"my_repository\", snapshot: new[] { \"snapshot_*\" }, d1 => d1\n .FromSortValue(\"1577833200000\")\n .Sort(SnapshotSort.StartTime)\n );" - lang: Java source: "client.snapshot().get(g -> g\n .fromSortValue(\"1577833200000\")\n .repository(\"my_repository\")\n .snapshot(\"snapshot_*\")\n .sort(SnapshotSort.StartTime)\n);\n" x-metaTags: - content: Elasticsearch name: product_name post: tags: - snapshot summary: "Create a snapshot\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_snapshot/{repository}/{snapshot}\n
\n
\n POST\n /_snapshot/{repository}/{snapshot}\n
\n \n\nTake a snapshot of a cluster or of data streams and indices.\n\n## Required authorization\n\n* Cluster privileges: `create_snapshot`\n" externalDocs: description: More about managing snapshots url: https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore/create-snapshots x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/create-snapshot-api.html operationId: snapshot-create parameters: - $ref: '#/components/parameters/snapshot.create-repository' - $ref: '#/components/parameters/snapshot.create-snapshot' - $ref: '#/components/parameters/snapshot.create-master_timeout' - $ref: '#/components/parameters/snapshot.create-wait_for_completion' requestBody: $ref: '#/components/requestBodies/snapshot.create' responses: '200': $ref: '#/components/responses/snapshot.create-200' x-state: Generally available x-codeSamples: - lang: Console source: "PUT /_snapshot/my_repository/snapshot_2?wait_for_completion=true\n{\n \"partial\": true,\n \"indices\": \"index_1,index_2\",\n \"ignore_unavailable\": true,\n \"include_global_state\": false,\n \"metadata\": {\n \"taken_by\": \"user123\",\n \"taken_because\": \"backup before upgrading\"\n }\n}" - lang: Python source: "resp = client.snapshot.create(\n repository=\"my_repository\",\n snapshot=\"snapshot_2\",\n wait_for_completion=True,\n partial=True,\n indices=\"index_1,index_2\",\n ignore_unavailable=True,\n include_global_state=False,\n metadata={\n \"taken_by\": \"user123\",\n \"taken_because\": \"backup before upgrading\"\n },\n)" - lang: JavaScript source: "const response = await client.snapshot.create({\n repository: \"my_repository\",\n snapshot: \"snapshot_2\",\n wait_for_completion: \"true\",\n partial: true,\n indices: \"index_1,index_2\",\n ignore_unavailable: true,\n include_global_state: false,\n metadata: {\n taken_by: \"user123\",\n taken_because: \"backup before upgrading\",\n },\n});" - lang: Ruby source: "response = client.snapshot.create(\n repository: \"my_repository\",\n snapshot: \"snapshot_2\",\n wait_for_completion: \"true\",\n body: {\n \"partial\": true,\n \"indices\": \"index_1,index_2\",\n \"ignore_unavailable\": true,\n \"include_global_state\": false,\n \"metadata\": {\n \"taken_by\": \"user123\",\n \"taken_because\": \"backup before upgrading\"\n }\n }\n)" - lang: PHP source: "$resp = $client->snapshot()->create([\n \"repository\" => \"my_repository\",\n \"snapshot\" => \"snapshot_2\",\n \"wait_for_completion\" => \"true\",\n \"body\" => [\n \"partial\" => true,\n \"indices\" => \"index_1,index_2\",\n \"ignore_unavailable\" => true,\n \"include_global_state\" => false,\n \"metadata\" => [\n \"taken_by\" => \"user123\",\n \"taken_because\" => \"backup before upgrading\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"partial":true,"indices":"index_1,index_2","ignore_unavailable":true,"include_global_state":false,"metadata":{"taken_by":"user123","taken_because":"backup before upgrading"}}'' "$ELASTICSEARCH_URL/_snapshot/my_repository/snapshot_2?wait_for_completion=true"' - lang: C# source: "var response = await client.Snapshot\n .CreateAsync(repository: \"my_repository\", snapshot: \"snapshot_2\", d1 => d1\n .WaitForCompletion(true)\n .IgnoreUnavailable(true)\n .IncludeGlobalState(false)\n .Indices(new[] { \"index_1,index_2\" })\n .Metadata(new Dictionary()\n {\n { \"taken_by\", \"user123\" },\n { \"taken_because\", \"backup before upgrading\" }\n })\n .Partial(true)\n );" - lang: Java source: "client.snapshot().create(c -> c\n .ignoreUnavailable(true)\n .includeGlobalState(false)\n .indices(\"index_1,index_2\")\n .metadata(Map.of(\"taken_by\", JsonData.fromJson(\"\\\"user123\\\"\"),\"taken_because\", JsonData.fromJson(\"\\\"backup before upgrading\\\"\")))\n .partial(true)\n .repository(\"my_repository\")\n .snapshot(\"snapshot_2\")\n .waitForCompletion(true)\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - snapshot summary: Delete snapshots description: "\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: snapshot-delete parameters: - name: repository in: path description: The name of the repository to delete a snapshot from. required: true schema: $ref: '#/components/schemas/_types.Name' - name: snapshot in: path description: "A comma-separated list of snapshot names to delete.\nIt also accepts wildcards (`*`)." required: true schema: $ref: '#/components/schemas/_types.Names' - name: master_timeout in: query description: "The period to wait for the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nTo indicate that the request should never timeout, set it to `-1`." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: wait_for_completion in: query description: "If `false`, the request returns a response as soon as the deletes are scheduled.\nIf `true`, the request returns a response when the matching snapshots are all deleted, and the post-deletion cleanup work associated with the request has completed.\nIf you make several requests to the delete-snapshots API targetting overlapping collections of snapshots then some of those requests may perform different parts of the associated post-deletion cleanup work, returning their responses at different times.\nFor example, if you make two requests to delete the same snapshot then sometimes all of the post-deletion cleanup work will be associated with the first request, delaying its response, while the second request has no associated post-deletion cleanup work and receives its response as soon as the snapshot has been deleted." schema: type: boolean default: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: SnapshotDeleteResponseExample1: description: "A successful response from `DELETE /_snapshot/my_repository/snapshot_2,snapshot_3`. The request deletes `snapshot_2` and `snapshot_3` from the repository named `my_repository`.\n" value: "{\n \"acknowledged\" : true\n}" x-state: Generally available x-codeSamples: - lang: Console source: "DELETE /_snapshot/my_repository/snapshot_2,snapshot_3\n" - lang: Python source: "resp = client.snapshot.delete(\n repository=\"my_repository\",\n snapshot=\"snapshot_2,snapshot_3\",\n)" - lang: JavaScript source: "const response = await client.snapshot.delete({\n repository: \"my_repository\",\n snapshot: \"snapshot_2,snapshot_3\",\n});" - lang: Ruby source: "response = client.snapshot.delete(\n repository: \"my_repository\",\n snapshot: \"snapshot_2,snapshot_3\"\n)" - lang: PHP source: "$resp = $client->snapshot()->delete([\n \"repository\" => \"my_repository\",\n \"snapshot\" => \"snapshot_2,snapshot_3\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_snapshot/my_repository/snapshot_2,snapshot_3"' - lang: C# source: 'var response = await client.Snapshot.DeleteAsync(repository: "my_repository", snapshot: new[] { "snapshot_2", "snapshot_3" });' - lang: Java source: "client.snapshot().delete(d -> d\n .repository(\"my_repository\")\n .snapshot(List.of(\"snapshot_2\",\"snapshot_3\"))\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_snapshot/{repository}': get: tags: - snapshot summary: "Get snapshot repository information\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_snapshot\n
\n
\n GET\n /_snapshot/{repository}\n
\n\n## Required authorization\n\n* Cluster privileges: `monitor_snapshot`\n" operationId: snapshot-get-repository parameters: - $ref: '#/components/parameters/snapshot.get_repository-repository' - $ref: '#/components/parameters/snapshot.get_repository-local' - $ref: '#/components/parameters/snapshot.get_repository-master_timeout' responses: '200': $ref: '#/components/responses/snapshot.get_repository-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET /_snapshot/my_repository\n" - lang: Python source: "resp = client.snapshot.get_repository(\n name=\"my_repository\",\n)" - lang: JavaScript source: "const response = await client.snapshot.getRepository({\n name: \"my_repository\",\n});" - lang: Ruby source: "response = client.snapshot.get_repository(\n repository: \"my_repository\"\n)" - lang: PHP source: "$resp = $client->snapshot()->getRepository([\n \"repository\" => \"my_repository\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_snapshot/my_repository"' - lang: C# source: "var response = await client.Snapshot\n .GetRepositoryAsync(d1 => d1\n .Name(new[] { \"my_repository\" })\n );" - lang: Java source: "client.snapshot().getRepository(g -> g\n .name(\"my_repository\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name post: tags: - snapshot summary: "Create or update a snapshot repository\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_snapshot/{repository}\n
\n
\n POST\n /_snapshot/{repository}\n
\n \n\nIMPORTANT: If you are migrating searchable snapshots, the repository name must be identical in the source and destination clusters.\nTo register a snapshot repository, the cluster's global metadata must be writeable.\nEnsure there are no cluster blocks (for example, `cluster.blocks.read_only` and `clsuter.blocks.read_only_allow_delete` settings) that prevent write access.\n\nSeveral options for this API can be specified using a query parameter or a request body parameter.\nIf both parameters are specified, only the query parameter is used.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" externalDocs: description: About managing snapshot url: https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore/self-managed x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/put-snapshot-repo-api.html operationId: snapshot-create-repository parameters: - $ref: '#/components/parameters/snapshot.create_repository-repository' - $ref: '#/components/parameters/snapshot.create_repository-master_timeout' - $ref: '#/components/parameters/snapshot.create_repository-timeout' - $ref: '#/components/parameters/snapshot.create_repository-verify' requestBody: $ref: '#/components/requestBodies/snapshot.create_repository' responses: '200': $ref: '#/components/responses/snapshot.create_repository-200' x-state: Generally available x-codeSamples: - lang: Console source: "PUT /_snapshot/my_repository\n{\n \"type\": \"fs\",\n \"settings\": {\n \"location\": \"my_backup_location\"\n }\n}" - lang: Python source: "resp = client.snapshot.create_repository(\n name=\"my_repository\",\n repository={\n \"type\": \"fs\",\n \"settings\": {\n \"location\": \"my_backup_location\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.snapshot.createRepository({\n name: \"my_repository\",\n repository: {\n type: \"fs\",\n settings: {\n location: \"my_backup_location\",\n },\n },\n});" - lang: Ruby source: "response = client.snapshot.create_repository(\n repository: \"my_repository\",\n body: {\n \"type\": \"fs\",\n \"settings\": {\n \"location\": \"my_backup_location\"\n }\n }\n)" - lang: PHP source: "$resp = $client->snapshot()->createRepository([\n \"repository\" => \"my_repository\",\n \"body\" => [\n \"type\" => \"fs\",\n \"settings\" => [\n \"location\" => \"my_backup_location\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"type":"fs","settings":{"location":"my_backup_location"}}'' "$ELASTICSEARCH_URL/_snapshot/my_repository"' - lang: C# source: "var response = await client.Snapshot\n .CreateRepositoryAsync(name: \"my_repository\", d1 => d1\n .Repository(new SharedFileSystemRepository()\n {\n Settings = new()\n {\n Location = \"my_backup_location\"\n }\n })\n );" - lang: Java source: "client.snapshot().createRepository(c -> c\n .name(\"my_repository\")\n .repository(r -> r\n .fs(f -> f\n .settings(s -> s\n .location(\"my_backup_location\")\n )\n )\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - snapshot summary: Delete snapshot repositories description: "When a repository is unregistered, Elasticsearch removes only the reference to the location where the repository is storing the snapshots.\nThe snapshots themselves are left untouched and in place.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: snapshot-delete-repository parameters: - name: repository in: path description: "The ame of the snapshot repositories to unregister.\nWildcard (`*`) patterns are supported." required: true schema: $ref: '#/components/schemas/_types.Names' - name: master_timeout in: query description: "The period to wait for the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nTo indicate that the request should never timeout, set it to `-1`." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "The period to wait for a response from all relevant nodes in the cluster after updating the cluster metadata.\nIf no response is received before the timeout expires, the cluster metadata update still applies but the response will indicate that it was not completely acknowledged.\nTo indicate that the request should never timeout, set it to `-1`." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available x-codeSamples: - lang: Console source: "DELETE /_snapshot/my_repository\n" - lang: Python source: "resp = client.snapshot.delete_repository(\n name=\"my_repository\",\n)" - lang: JavaScript source: "const response = await client.snapshot.deleteRepository({\n name: \"my_repository\",\n});" - lang: Ruby source: "response = client.snapshot.delete_repository(\n repository: \"my_repository\"\n)" - lang: PHP source: "$resp = $client->snapshot()->deleteRepository([\n \"repository\" => \"my_repository\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_snapshot/my_repository"' - lang: C# source: 'var response = await client.Snapshot.DeleteRepositoryAsync(name: new[] { "my_repository" });' - lang: Java source: "client.snapshot().deleteRepository(d -> d\n .name(\"my_repository\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_snapshot/{repository}/_analyze': post: tags: - snapshot summary: Analyze a snapshot repository description: "Performs operations on a snapshot repository in order to check for incorrect behaviour.\n\nThere are a large number of third-party storage systems available, not all of which are suitable for use as a snapshot repository by Elasticsearch.\nSome storage systems behave incorrectly, or perform poorly, especially when accessed concurrently by multiple clients as the nodes of an Elasticsearch cluster do.\nThis API performs a collection of read and write operations on your repository which are designed to detect incorrect behaviour and to measure the performance characteristics of your storage system.\n\nThe default values for the parameters are deliberately low to reduce the impact of running an analysis inadvertently and to provide a sensible starting point for your investigations.\nRun your first analysis with the default parameter values to check for simple problems.\nSome repositories may behave correctly when lightly loaded but incorrectly under production-like workloads.\nIf the first analysis is successful, run a sequence of increasingly large analyses until you encounter a failure or you reach a `blob_count` of at least `2000`, a `max_blob_size` of at least `2gb`, a `max_total_data_size` of at least `1tb`, and a `register_operation_count` of at least `100`.\nAlways specify a generous timeout, possibly `1h` or longer, to allow time for each analysis to run to completion.\nSome repositories may behave correctly when accessed by a small number of Elasticsearch nodes but incorrectly when accessed concurrently by a production-scale cluster.\nPerform the analyses using a multi-node cluster of a similar size to your production cluster so that it can detect any problems that only arise when the repository is accessed by many nodes at once.\n\nIf the analysis fails, Elasticsearch detected that your repository behaved unexpectedly.\nThis usually means you are using a third-party storage system with an incorrect or incompatible implementation of the API it claims to support.\nIf so, this storage system is not suitable for use as a snapshot repository.\nRepository analysis triggers conditions that occur only rarely when taking snapshots in a production system.\nSnapshotting to unsuitable storage may appear to work correctly most of the time despite repository analysis failures.\nHowever your snapshot data is at risk if you store it in a snapshot repository that does not reliably pass repository analysis.\nYou can demonstrate that the analysis failure is due to an incompatible storage implementation by verifying that Elasticsearch does not detect the same problem when analysing the reference implementation of the storage protocol you are using.\nFor instance, if you are using storage that offers an API which the supplier claims to be compatible with AWS S3, verify that repositories in AWS S3 do not fail repository analysis.\nThis allows you to demonstrate to your storage supplier that a repository analysis failure must only be caused by an incompatibility with AWS S3 and cannot be attributed to a problem in Elasticsearch.\nPlease do not report Elasticsearch issues involving third-party storage systems unless you can demonstrate that the same issue exists when analysing a repository that uses the reference implementation of the same storage protocol.\nYou will need to work with the supplier of your storage system to address the incompatibilities that Elasticsearch detects.\n\nThe analysis may also report a failure if your repository experienced a service disruption while the analysis was running.\nIn practice, occasional service disruptions are inevitable, but the analysis cannot itself distinguish such disruptions from incorrect behavior so must report all deviations from the expected behavior as failures.\nIf you are certain that you can ascribe an analysis failure to such a service disruption, wait for your service provider to resolve the disruption and then re-run the analysis.\nElasticsearch will be unable to create or restore snapshots during repository service disruptions, so you must ensure that these events occur only very rarely.\n\nIf the analysis is successful, the API returns details of the testing process, optionally including how long each operation took.\nYou can use this information to determine the performance of your storage system.\nIf any operation fails or returns an incorrect result, the API returns an error.\nIf the API returns an error, it may not have removed all the data it wrote to the repository.\nThe error will indicate the location of any leftover data and this path is also recorded in the Elasticsearch logs.\nYou should verify that this location has been cleaned up correctly.\nIf there is still leftover data at the specified location, you should manually remove it.\n\nIf the connection from your client to Elasticsearch is closed while the client is waiting for the result of the analysis, the test is cancelled.\nSome clients are configured to close their connection if no response is received within a certain timeout.\nAn analysis takes a long time to complete so you might need to relax any such client-side timeouts.\nOn cancellation the analysis attempts to clean up the data it was writing, but it may not be able to remove it all.\nThe path to the leftover data is recorded in the Elasticsearch logs.\nYou should verify that this location has been cleaned up correctly.\nIf there is still leftover data at the specified location, you should manually remove it.\n\nIf the analysis is successful then it detected no incorrect behaviour, but this does not mean that correct behaviour is guaranteed.\nThe analysis attempts to detect common bugs but it does not offer 100% coverage.\nAdditionally, it does not test the following:\n\n* Your repository must perform durable writes. Once a blob has been written it must remain in place until it is deleted, even after a power loss or similar disaster.\n* Your repository must not suffer from silent data corruption. Once a blob has been written, its contents must remain unchanged until it is deliberately modified or deleted.\n* Your repository must behave correctly even if connectivity from the cluster is disrupted. Reads and writes may fail in this case, but they must not return incorrect results.\n\nIMPORTANT: An analysis writes a substantial amount of data to your repository and then reads it back again.\nThis consumes bandwidth on the network between the cluster and the repository, and storage space and I/O bandwidth on the repository itself.\nYou must ensure this load does not affect other users of these systems.\nAnalyses respect the repository settings `max_snapshot_bytes_per_sec` and `max_restore_bytes_per_sec` if available and the cluster setting `indices.recovery.max_bytes_per_sec` which you can use to limit the bandwidth they consume.\n\nNOTE: This API is intended for exploratory use by humans.\nYou should expect the request parameters and the response format to vary in future versions.\nThe response exposes immplementation details of the analysis which may change from version to version.\n\nNOTE: Different versions of Elasticsearch may perform different checks for repository compatibility, with newer versions typically being stricter than older ones.\nA storage system that passes repository analysis with one version of Elasticsearch may fail with a different version.\nThis indicates it behaves incorrectly in ways that the former version did not detect.\nYou must work with the supplier of your storage system to address the incompatibilities detected by the repository analysis API in any version of Elasticsearch.\n\nNOTE: This API may not work correctly in a mixed-version cluster.\n\n*Implementation details*\n\nNOTE: This section of documentation describes how the repository analysis API works in this version of Elasticsearch, but you should expect the implementation to vary between versions.\nThe request parameters and response format depend on details of the implementation so may also be different in newer versions.\n\nThe analysis comprises a number of blob-level tasks, as set by the `blob_count` parameter and a number of compare-and-exchange operations on linearizable registers, as set by the `register_operation_count` parameter.\nThese tasks are distributed over the data and master-eligible nodes in the cluster for execution.\n\nFor most blob-level tasks, the executing node first writes a blob to the repository and then instructs some of the other nodes in the cluster to attempt to read the data it just wrote.\nThe size of the blob is chosen randomly, according to the `max_blob_size` and `max_total_data_size` parameters.\nIf any of these reads fails then the repository does not implement the necessary read-after-write semantics that Elasticsearch requires.\n\nFor some blob-level tasks, the executing node will instruct some of its peers to attempt to read the data before the writing process completes.\nThese reads are permitted to fail, but must not return partial data.\nIf any read returns partial data then the repository does not implement the necessary atomicity semantics that Elasticsearch requires.\n\nFor some blob-level tasks, the executing node will overwrite the blob while its peers are reading it.\nIn this case the data read may come from either the original or the overwritten blob, but the read operation must not return partial data or a mix of data from the two blobs.\nIf any of these reads returns partial data or a mix of the two blobs then the repository does not implement the necessary atomicity semantics that Elasticsearch requires for overwrites.\n\nThe executing node will use a variety of different methods to write the blob.\nFor instance, where applicable, it will use both single-part and multi-part uploads.\nSimilarly, the reading nodes will use a variety of different methods to read the data back again.\nFor instance they may read the entire blob from start to end or may read only a subset of the data.\n\nFor some blob-level tasks, the executing node will cancel the write before it is complete.\nIn this case, it still instructs some of the other nodes in the cluster to attempt to read the blob but all of these reads must fail to find the blob.\n\nLinearizable registers are special blobs that Elasticsearch manipulates using an atomic compare-and-exchange operation.\nThis operation ensures correct and strongly-consistent behavior even when the blob is accessed by multiple nodes at the same time.\nThe detailed implementation of the compare-and-exchange operation on linearizable registers varies by repository type.\nRepository analysis verifies that that uncontended compare-and-exchange operations on a linearizable register blob always succeed.\nRepository analysis also verifies that contended operations either succeed or report the contention but do not return incorrect results.\nIf an operation fails due to contention, Elasticsearch retries the operation until it succeeds.\nMost of the compare-and-exchange operations performed by repository analysis atomically increment a counter which is represented as an 8-byte blob.\nSome operations also verify the behavior on small blobs with sizes other than 8 bytes.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: snapshot-repository-analyze parameters: - name: repository in: path description: The name of the repository. required: true schema: $ref: '#/components/schemas/_types.Name' - name: blob_count in: query description: "The total number of blobs to write to the repository during the test.\nFor realistic experiments, set this parameter to at least `2000`." schema: type: number default: 100 - name: check_overwrite_protection in: query description: "Whether to run the overwrite protection check.\nFor realistic experiments, leave this parameter unset." schema: type: boolean default: true x-state: Generally available; Added in 9.5.0 - name: concurrency in: query description: "The number of operations to run concurrently during the test.\nFor realistic experiments, leave this parameter unset." schema: type: number default: 10 - name: detailed in: query description: "Indicates whether to return detailed results, including timing information for every operation performed during the analysis.\nIf false, it returns only a summary of the analysis." schema: type: boolean default: false - name: early_read_node_count in: query description: "The number of nodes on which to perform an early read operation while writing each blob.\nEarly read operations are only rarely performed.\nFor realistic experiments, leave this parameter unset." schema: type: number default: 2 - name: max_blob_size in: query description: "The maximum size of a blob to be written during the test.\nFor realistic experiments, set this parameter to at least `2gb`." schema: allOf: - $ref: '#/components/schemas/_types.ByteSize' default: 10mb - name: max_total_data_size in: query description: "An upper limit on the total size of all the blobs written during the test.\nFor realistic experiments, set this parameter to at least `1tb`." schema: allOf: - $ref: '#/components/schemas/_types.ByteSize' default: 1gb - name: rare_action_probability in: query description: "The probability of performing a rare action such as an early read, an overwrite, or an aborted write on each blob.\nFor realistic experiments, leave this parameter unset." schema: type: number default: 0.02 - name: rarely_abort_writes in: query description: "Indicates whether to rarely cancel writes before they complete.\nFor realistic experiments, leave this parameter unset." schema: type: boolean default: true - name: read_node_count in: query description: "The number of nodes on which to read a blob after writing.\nFor realistic experiments, leave this parameter unset." schema: type: number default: 10 - name: register_operation_count in: query description: "The minimum number of linearizable register operations to perform in total.\nFor realistic experiments, set this parameter to at least `100`." schema: type: number default: 10 - name: seed in: query description: "The seed for the pseudo-random number generator used to generate the list of operations performed during the test.\nTo repeat the same set of operations in multiple experiments, use the same seed in each experiment.\nNote that the operations are performed concurrently so might not always happen in the same order on each run.\nFor realistic experiments, leave this parameter unset." schema: type: number - name: timeout in: query description: "The period of time to wait for the test to complete.\nIf no response is received before the timeout expires, the test is cancelled and returns an error.\nFor realistic experiments, set this parameter sufficiently long to allow the test to complete." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - blob_count - blob_path - concurrency - coordinating_node - delete_elapsed - delete_elapsed_nanos - details - early_read_node_count - issues_detected - listing_elapsed - listing_elapsed_nanos - max_blob_size - max_blob_size_bytes - max_total_data_size - max_total_data_size_bytes - rare_action_probability - read_node_count - repository - seed - summary type: object properties: blob_count: type: number description: The number of blobs written to the repository during the test. blob_path: type: string description: The path in the repository under which all the blobs were written during the test. concurrency: type: number description: The number of write operations performed concurrently during the test. coordinating_node: allOf: - $ref: '#/components/schemas/snapshot.repository_analyze.SnapshotNodeInfo' description: The node that coordinated the analysis and performed the final cleanup. delete_elapsed: allOf: - $ref: '#/components/schemas/_types.Duration' description: The time it took to delete all the blobs in the container. delete_elapsed_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' description: 'The time it took to delete all the blobs in the container, in nanoseconds.' details: allOf: - $ref: '#/components/schemas/snapshot.repository_analyze.DetailsInfo' description: A description of every read and write operation performed during the test. early_read_node_count: type: number description: The limit on the number of nodes on which early read operations were performed after writing each blob. issues_detected: type: array items: type: string description: "A list of correctness issues detected, which is empty if the API succeeded.\nIt is included to emphasize that a successful response does not guarantee correct behaviour in future." listing_elapsed: allOf: - $ref: '#/components/schemas/_types.Duration' description: The time it took to retrieve a list of all the blobs in the container. listing_elapsed_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' description: 'The time it took to retrieve a list of all the blobs in the container, in nanoseconds.' max_blob_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The limit on the size of a blob written during the test. max_blob_size_bytes: type: number description: 'The limit, in bytes, on the size of a blob written during the test.' max_total_data_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The limit on the total size of all blob written during the test. max_total_data_size_bytes: type: number description: 'The limit, in bytes, on the total size of all blob written during the test.' rare_action_probability: type: number description: The probability of performing rare actions during the test. read_node_count: type: number description: The limit on the number of nodes on which read operations were performed after writing each blob. repository: type: string description: The name of the repository that was the subject of the analysis. seed: type: number description: The seed for the pseudo-random number generator used to generate the operations used during the test. summary: allOf: - $ref: '#/components/schemas/snapshot.repository_analyze.SummaryInfo' description: A collection of statistics that summarize the results of the test. x-state: Generally available; Added in 7.12.0 x-codeSamples: - lang: Console source: "POST /_snapshot/my_repository/_analyze?blob_count=10&max_blob_size=1mb&timeout=120s\n" - lang: Python source: "resp = client.snapshot.repository_analyze(\n name=\"my_repository\",\n blob_count=\"10\",\n max_blob_size=\"1mb\",\n timeout=\"120s\",\n)" - lang: JavaScript source: "const response = await client.snapshot.repositoryAnalyze({\n name: \"my_repository\",\n blob_count: 10,\n max_blob_size: \"1mb\",\n timeout: \"120s\",\n});" - lang: Ruby source: "response = client.snapshot.repository_analyze(\n repository: \"my_repository\",\n blob_count: \"10\",\n max_blob_size: \"1mb\",\n timeout: \"120s\"\n)" - lang: PHP source: "$resp = $client->snapshot()->repositoryAnalyze([\n \"repository\" => \"my_repository\",\n \"blob_count\" => \"10\",\n \"max_blob_size\" => \"1mb\",\n \"timeout\" => \"120s\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_snapshot/my_repository/_analyze?blob_count=10&max_blob_size=1mb&timeout=120s"' - lang: C# source: "var response = await client.Snapshot\n .RepositoryAnalyzeAsync(name: \"my_repository\", d1 => d1\n .BlobCount(10)\n .MaxBlobSize(new ByteSize(\"1mb\"))\n .Timeout(\"120s\")\n );" - lang: Java source: "client.snapshot().repositoryAnalyze(r -> r\n .blobCount(10)\n .maxBlobSize(\"1mb\")\n .name(\"my_repository\")\n .timeout(t -> t\n .time(\"120s\")\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_snapshot/{repository}/_verify_integrity': post: tags: - snapshot summary: Verify the repository integrity description: "Verify the integrity of the contents of a snapshot repository.\n\nThis API enables you to perform a comprehensive check of the contents of a repository, looking for any anomalies in its data or metadata which might prevent you from restoring snapshots from the repository or which might cause future snapshot create or delete operations to fail.\n\nIf you suspect the integrity of the contents of one of your snapshot repositories, cease all write activity to this repository immediately, set its `read_only` option to `true`, and use this API to verify its integrity.\nUntil you do so:\n\n* It may not be possible to restore some snapshots from this repository.\n* Searchable snapshots may report errors when searched or may have unassigned shards.\n* Taking snapshots into this repository may fail or may appear to succeed but have created a snapshot which cannot be restored.\n* Deleting snapshots from this repository may fail or may appear to succeed but leave the underlying data on disk.\n* Continuing to write to the repository while it is in an invalid state may causing additional damage to its contents.\n\nIf the API finds any problems with the integrity of the contents of your repository, Elasticsearch will not be able to repair the damage.\nThe only way to bring the repository back into a fully working state after its contents have been damaged is by restoring its contents from a repository backup which was taken before the damage occurred.\nYou must also identify what caused the damage and take action to prevent it from happening again.\n\nIf you cannot restore a repository backup, register a new repository and use this for all future snapshot operations.\nIn some cases it may be possible to recover some of the contents of a damaged repository, either by restoring as many of its snapshots as needed and taking new snapshots of the restored data, or by using the reindex API to copy data from any searchable snapshots mounted from the damaged repository.\n\nAvoid all operations which write to the repository while the verify repository integrity API is running.\nIf something changes the repository contents while an integrity verification is running then Elasticsearch may incorrectly report having detected some anomalies in its contents due to the concurrent writes.\nIt may also incorrectly fail to report some anomalies that the concurrent writes prevented it from detecting.\n\nNOTE: This API is intended for exploratory use by humans. You should expect the request parameters and the response format to vary in future versions.\n\nNOTE: This API may not work correctly in a mixed-version cluster.\n\nThe default values for the parameters of this API are designed to limit the impact of the integrity verification on other activities in your cluster.\nFor instance, by default it will only use at most half of the `snapshot_meta` threads to verify the integrity of each snapshot, allowing other snapshot operations to use the other half of this thread pool.\nIf you modify these parameters to speed up the verification process, you risk disrupting other snapshot-related operations in your cluster.\nFor large repositories, consider setting up a separate single-node Elasticsearch cluster just for running the integrity verification API.\n\nThe response exposes implementation details of the analysis which may change from version to version.\nThe response body format is therefore not considered stable and may be different in newer versions.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: snapshot-repository-verify-integrity parameters: - name: repository in: path description: The name of the snapshot repository. required: true schema: $ref: '#/components/schemas/_types.Names' - name: blob_thread_pool_concurrency in: query description: 'If `verify_blob_contents` is `true`, this parameter specifies how many blobs to verify at once.' schema: type: number default: 1 - name: index_snapshot_verification_concurrency in: query description: The maximum number of index snapshots to verify concurrently within each index verification. schema: type: number default: 1 - name: index_verification_concurrency in: query description: "The number of indices to verify concurrently.\nThe default behavior is to use the entire `snapshot_meta` thread pool." schema: type: number default: 0 - name: max_bytes_per_sec in: query description: 'If `verify_blob_contents` is `true`, this parameter specifies the maximum amount of data that Elasticsearch will read from the repository every second.' schema: type: string default: 10mb - name: max_failed_shard_snapshots in: query description: "The number of shard snapshot failures to track during integrity verification, in order to avoid excessive resource usage.\nIf your repository contains more than this number of shard snapshot failures, the verification will fail." schema: type: number default: 10000 - name: meta_thread_pool_concurrency in: query description: "The maximum number of snapshot metadata operations to run concurrently.\nThe default behavior is to use at most half of the `snapshot_meta` thread pool at once." schema: type: number default: 0 - name: snapshot_verification_concurrency in: query description: "The number of snapshots to verify concurrently.\nThe default behavior is to use at most half of the `snapshot_meta` thread pool at once." schema: type: number default: 0 - name: verify_blob_contents in: query description: "Indicates whether to verify the checksum of every data blob in the repository.\nIf this feature is enabled, Elasticsearch will read the entire repository contents, which may be extremely slow and expensive." schema: type: boolean default: false responses: '200': description: '' content: application/json: schema: type: object x-state: Experimental; Added in 8.16.0 x-codeSamples: - lang: Console source: "POST /_snapshot/my_repository/_verify_integrity\n" - lang: Python source: "resp = client.snapshot.repository_verify_integrity(\n name=\"my_repository\",\n)" - lang: JavaScript source: "const response = await client.snapshot.repositoryVerifyIntegrity({\n name: \"my_repository\",\n});" - lang: Ruby source: "response = client.snapshot.repository_verify_integrity(\n repository: \"my_repository\"\n)" - lang: PHP source: "$resp = $client->snapshot()->repositoryVerifyIntegrity([\n \"repository\" => \"my_repository\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_snapshot/my_repository/_verify_integrity"' - lang: C# source: 'var response = await client.Snapshot.RepositoryVerifyIntegrityAsync(name: new[] { "my_repository" });' - lang: Java source: "client.snapshot().repositoryVerifyIntegrity(r -> r\n .name(\"my_repository\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_snapshot/{repository}/{snapshot}/_restore': post: tags: - snapshot summary: Restore a snapshot description: "Restore a snapshot of a cluster or data streams and indices.\n\nYou can restore a snapshot only to a running cluster with an elected master node.\nThe snapshot repository must be registered and available to the cluster.\nThe snapshot and cluster versions must be compatible.\n\nTo restore a snapshot, the cluster's global metadata must be writable. Ensure there are't any cluster blocks that prevent writes. The restore operation ignores index blocks.\n\nBefore you restore a data stream, ensure the cluster contains a matching index template with data streams enabled. To check, use the index management feature in Kibana or the get index template API:\n\n```\nGET _index_template/*?filter_path=index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\n```\n\nIf no such template exists, you can create one or restore a cluster state that contains one. Without a matching index template, a data stream can't roll over or create backing indices.\n\nIf your snapshot contains data from App Search or Workplace Search, you must restore the Enterprise Search encryption key before you restore the snapshot.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" externalDocs: description: More about restoring a snapshot url: https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore/restore-snapshot x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/restore-snapshot-api.html operationId: snapshot-restore parameters: - name: repository in: path description: The name of the repository to restore a snapshot from. required: true schema: $ref: '#/components/schemas/_types.Name' - name: snapshot in: path description: The name of the snapshot to restore. required: true schema: $ref: '#/components/schemas/_types.Name' - name: master_timeout in: query description: "The period to wait for the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nTo indicate that the request should never timeout, set it to `-1`." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: wait_for_completion in: query description: "If `true`, the request returns a response when the restore operation completes.\nThe operation is complete when it finishes all attempts to recover primary shards for restored indices.\nThis applies even if one or more of the recovery attempts fail.\n\nIf `false`, the request returns a response when the restore operation initializes." schema: type: boolean default: false requestBody: content: application/json: schema: type: object properties: feature_states: type: array items: type: string description: "The feature states to restore.\nIf `include_global_state` is `true`, the request restores all feature states in the snapshot by default.\nIf `include_global_state` is `false`, the request restores no feature states by default.\nNote that specifying an empty array will result in the default behavior.\nTo restore no feature states, regardless of the `include_global_state` value, specify an array containing only the value `none` (`[\"none\"]`)." externalDocs: url: https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore#feature-state ignore_index_settings: type: array items: type: string description: "The index settings to not restore from the snapshot.\nYou can't use this option to ignore `index.number_of_shards`.\n\nFor data streams, this option applies only to restored backing indices.\nNew backing indices are configured using the data stream's matching index template." ignore_unavailable: type: boolean description: "If `true`, the request ignores any index or data stream in indices that's missing from the snapshot.\nIf `false`, the request returns an error for any missing index or data stream." default: false include_aliases: type: boolean description: "If `true`, the request restores aliases for any restored data streams and indices.\nIf `false`, the request doesn’t restore aliases." default: true include_global_state: type: boolean description: "If `true`, restore the cluster state. The cluster state includes:\n\n* Persistent cluster settings\n* Index templates\n* Legacy index templates\n* Ingest pipelines\n* Index lifecycle management (ILM) policies\n* Stored scripts\n* For snapshots taken after 7.12.0, feature states\n\nIf `include_global_state` is `true`, the restore operation merges the legacy index templates in your cluster with the templates contained in the snapshot, replacing any existing ones whose name matches one in the snapshot.\nIt completely removes all persistent settings, non-legacy index templates, ingest pipelines, and ILM lifecycle policies that exist in your cluster and replaces them with the corresponding items from the snapshot.\n\nUse the `feature_states` parameter to configure how feature states are restored.\n\nIf `include_global_state` is `true` and a snapshot was created without a global state then the restore request will fail." default: false index_settings: allOf: - $ref: '#/components/schemas/indices._types.IndexSettings' description: "Index settings to add or change in restored indices, including backing indices.\nYou can't use this option to change `index.number_of_shards`.\n\nFor data streams, this option applies only to restored backing indices.\nNew backing indices are configured using the data stream's matching index template." indices: allOf: - $ref: '#/components/schemas/_types.Indices' description: "A comma-separated list of indices and data streams to restore.\nIt supports a multi-target syntax.\nThe default behavior is all regular indices and regular data streams in the snapshot.\n\nYou can't use this parameter to restore system indices or system data streams.\nUse `feature_states` instead." partial: type: boolean description: "If `false`, the entire restore operation will fail if one or more indices included in the snapshot do not have all primary shards available.\n\nIf true, it allows restoring a partial snapshot of indices with unavailable shards.\nOnly shards that were successfully included in the snapshot will be restored.\nAll missing shards will be recreated as empty." default: false rename_pattern: type: string description: "A rename pattern to apply to restored data streams and indices.\nData streams and indices matching the rename pattern will be renamed according to `rename_replacement`.\n\nThe rename pattern is applied as defined by the regular expression that supports referencing the original text, according to the `appendReplacement` logic." externalDocs: url: https://docs.oracle.com/javase/8/docs/api/java/util/regex/Matcher.html#appendReplacement-java.lang.StringBuffer-java.lang.String- rename_replacement: type: string description: The rename replacement string that is used with the `rename_pattern`. restore_over_existing: type: boolean description: "If `true`, the request can restore over destination indices and data streams that already exist, without closing or deleting them first.\nAn open destination index is closed and restored over in a single step.\nA destination data stream is deleted, together with its backing and failure store indices, and recreated from the snapshot.\n\nIt can't be combined with `rename_pattern`, `rename_replacement`, `include_global_state`, or `partial`." default: false x-state: Generally available; Added in 9.6.0 examples: SnapshotRestoreRequestExample1: summary: Restore with rename pattern description: "Run `POST /_snapshot/my_repository/snapshot_2/_restore?wait_for_completion=true`. It restores `index_1` and `index_2` from `snapshot_2`. The `rename_pattern` and `rename_replacement` parameters indicate any index matching the regular expression `index_(.+)` will be renamed using the pattern `restored_index_$1`. For example, `index_1` will be renamed to `restored_index_1`.\n" value: "{\n \"indices\": \"index_1,index_2\",\n \"ignore_unavailable\": true,\n \"include_global_state\": false,\n \"rename_pattern\": \"index_(.+)\",\n \"rename_replacement\": \"restored_index_$1\",\n \"include_aliases\": false\n}" x-codeSamples: - lang: Console source: "POST /_snapshot/my_repository/snapshot_2/_restore?wait_for_completion=true\n{\n \"indices\": \"index_1,index_2\",\n \"ignore_unavailable\": true,\n \"include_global_state\": false,\n \"rename_pattern\": \"index_(.+)\",\n \"rename_replacement\": \"restored_index_$1\",\n \"include_aliases\": false\n}" - lang: Python source: "resp = client.snapshot.restore(\n repository=\"my_repository\",\n snapshot=\"snapshot_2\",\n wait_for_completion=True,\n indices=\"index_1,index_2\",\n ignore_unavailable=True,\n include_global_state=False,\n rename_pattern=\"index_(.+)\",\n rename_replacement=\"restored_index_$1\",\n include_aliases=False,\n)" - lang: JavaScript source: "const response = await client.snapshot.restore({\n repository: \"my_repository\",\n snapshot: \"snapshot_2\",\n wait_for_completion: \"true\",\n indices: \"index_1,index_2\",\n ignore_unavailable: true,\n include_global_state: false,\n rename_pattern: \"index_(.+)\",\n rename_replacement: \"restored_index_$1\",\n include_aliases: false,\n});" - lang: Ruby source: "response = client.snapshot.restore(\n repository: \"my_repository\",\n snapshot: \"snapshot_2\",\n wait_for_completion: \"true\",\n body: {\n \"indices\": \"index_1,index_2\",\n \"ignore_unavailable\": true,\n \"include_global_state\": false,\n \"rename_pattern\": \"index_(.+)\",\n \"rename_replacement\": \"restored_index_$1\",\n \"include_aliases\": false\n }\n)" - lang: PHP source: "$resp = $client->snapshot()->restore([\n \"repository\" => \"my_repository\",\n \"snapshot\" => \"snapshot_2\",\n \"wait_for_completion\" => \"true\",\n \"body\" => [\n \"indices\" => \"index_1,index_2\",\n \"ignore_unavailable\" => true,\n \"include_global_state\" => false,\n \"rename_pattern\" => \"index_(.+)\",\n \"rename_replacement\" => \"restored_index_$1\",\n \"include_aliases\" => false,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"indices":"index_1,index_2","ignore_unavailable":true,"include_global_state":false,"rename_pattern":"index_(.+)","rename_replacement":"restored_index_$1","include_aliases":false}'' "$ELASTICSEARCH_URL/_snapshot/my_repository/snapshot_2/_restore?wait_for_completion=true"' - lang: C# source: "var response = await client.Snapshot\n .RestoreAsync(repository: \"my_repository\", snapshot: \"snapshot_2\", d1 => d1\n .WaitForCompletion(true)\n .IgnoreUnavailable(true)\n .IncludeAliases(false)\n .IncludeGlobalState(false)\n .Indices(new[] { \"index_1,index_2\" })\n .RenamePattern(\"index_(.+)\")\n .RenameReplacement(\"restored_index_$1\")\n );" - lang: Java source: "client.snapshot().restore(r -> r\n .ignoreUnavailable(true)\n .includeAliases(false)\n .includeGlobalState(false)\n .indices(\"index_1,index_2\")\n .renamePattern(\"index_(.+)\")\n .renameReplacement(\"restored_index_$1\")\n .repository(\"my_repository\")\n .snapshot(\"snapshot_2\")\n .waitForCompletion(true)\n);\n" SnapshotRestoreRequestExample2: summary: Restore in-place description: "Close `index_1` then run `POST /_snapshot/my_repository/snapshot_2/_restore?wait_for_completion=true` to restore an index in-place. For example, you might want to perform this type of restore operation when no alternative options surface after the cluster allocation explain API reports `no_valid_shard_copy`.\n" value: "{\n \"indices\": \"index_1\"\n}" x-codeSamples: - lang: Console source: "POST /_snapshot/my_repository/snapshot_2/_restore?wait_for_completion=true\n{\n \"indices\": \"index_1\"\n}" - lang: Python source: "resp = client.snapshot.restore(\n repository=\"my_repository\",\n snapshot=\"snapshot_2\",\n wait_for_completion=True,\n indices=\"index_1\",\n)" - lang: JavaScript source: "const response = await client.snapshot.restore({\n repository: \"my_repository\",\n snapshot: \"snapshot_2\",\n wait_for_completion: \"true\",\n indices: \"index_1\",\n});" - lang: Ruby source: "response = client.snapshot.restore(\n repository: \"my_repository\",\n snapshot: \"snapshot_2\",\n wait_for_completion: \"true\",\n body: {\n \"indices\": \"index_1\"\n }\n)" - lang: PHP source: "$resp = $client->snapshot()->restore([\n \"repository\" => \"my_repository\",\n \"snapshot\" => \"snapshot_2\",\n \"wait_for_completion\" => \"true\",\n \"body\" => [\n \"indices\" => \"index_1\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"indices":"index_1"}'' "$ELASTICSEARCH_URL/_snapshot/my_repository/snapshot_2/_restore?wait_for_completion=true"' - lang: C# source: "var response = await client.Snapshot\n .RestoreAsync(repository: \"my_repository\", snapshot: \"snapshot_2\", d1 => d1\n .WaitForCompletion(true)\n .Indices(new[] { \"index_1\" })\n );" - lang: Java source: "client.cluster().putSettings(p -> p);\n" responses: '200': description: '' content: application/json: schema: type: object properties: accepted: type: boolean snapshot: allOf: - $ref: '#/components/schemas/snapshot.restore.SnapshotRestore' x-state: Generally available x-codeSamples: - lang: Console source: "POST /_snapshot/my_repository/snapshot_2/_restore?wait_for_completion=true\n{\n \"indices\": \"index_1,index_2\",\n \"ignore_unavailable\": true,\n \"include_global_state\": false,\n \"rename_pattern\": \"index_(.+)\",\n \"rename_replacement\": \"restored_index_$1\",\n \"include_aliases\": false\n}" - lang: Python source: "resp = client.snapshot.restore(\n repository=\"my_repository\",\n snapshot=\"snapshot_2\",\n wait_for_completion=True,\n indices=\"index_1,index_2\",\n ignore_unavailable=True,\n include_global_state=False,\n rename_pattern=\"index_(.+)\",\n rename_replacement=\"restored_index_$1\",\n include_aliases=False,\n)" - lang: JavaScript source: "const response = await client.snapshot.restore({\n repository: \"my_repository\",\n snapshot: \"snapshot_2\",\n wait_for_completion: \"true\",\n indices: \"index_1,index_2\",\n ignore_unavailable: true,\n include_global_state: false,\n rename_pattern: \"index_(.+)\",\n rename_replacement: \"restored_index_$1\",\n include_aliases: false,\n});" - lang: Ruby source: "response = client.snapshot.restore(\n repository: \"my_repository\",\n snapshot: \"snapshot_2\",\n wait_for_completion: \"true\",\n body: {\n \"indices\": \"index_1,index_2\",\n \"ignore_unavailable\": true,\n \"include_global_state\": false,\n \"rename_pattern\": \"index_(.+)\",\n \"rename_replacement\": \"restored_index_$1\",\n \"include_aliases\": false\n }\n)" - lang: PHP source: "$resp = $client->snapshot()->restore([\n \"repository\" => \"my_repository\",\n \"snapshot\" => \"snapshot_2\",\n \"wait_for_completion\" => \"true\",\n \"body\" => [\n \"indices\" => \"index_1,index_2\",\n \"ignore_unavailable\" => true,\n \"include_global_state\" => false,\n \"rename_pattern\" => \"index_(.+)\",\n \"rename_replacement\" => \"restored_index_$1\",\n \"include_aliases\" => false,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"indices":"index_1,index_2","ignore_unavailable":true,"include_global_state":false,"rename_pattern":"index_(.+)","rename_replacement":"restored_index_$1","include_aliases":false}'' "$ELASTICSEARCH_URL/_snapshot/my_repository/snapshot_2/_restore?wait_for_completion=true"' - lang: C# source: "var response = await client.Snapshot\n .RestoreAsync(repository: \"my_repository\", snapshot: \"snapshot_2\", d1 => d1\n .WaitForCompletion(true)\n .IgnoreUnavailable(true)\n .IncludeAliases(false)\n .IncludeGlobalState(false)\n .Indices(new[] { \"index_1,index_2\" })\n .RenamePattern(\"index_(.+)\")\n .RenameReplacement(\"restored_index_$1\")\n );" - lang: Java source: "client.snapshot().restore(r -> r\n .ignoreUnavailable(true)\n .includeAliases(false)\n .includeGlobalState(false)\n .indices(\"index_1,index_2\")\n .renamePattern(\"index_(.+)\")\n .renameReplacement(\"restored_index_$1\")\n .repository(\"my_repository\")\n .snapshot(\"snapshot_2\")\n .waitForCompletion(true)\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_snapshot/{repository}/{snapshot}/_status': get: tags: - snapshot summary: "Get the snapshot status\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_snapshot/_status\n
\n
\n GET\n /_snapshot/{repository}/_status\n
\n
\n GET\n /_snapshot/{repository}/{snapshot}/_status\n
\n \n\nGet a detailed description of the current state for each shard participating in the snapshot.\n\nNote that this API should be used only to obtain detailed shard-level information for ongoing snapshots.\nIf this detail is not needed or you want to obtain information about one or more existing snapshots, use the get snapshot API.\n\nIf you omit the `` request path parameter, the request retrieves information only for currently running snapshots.\nThis usage is preferred.\nIf needed, you can specify `` and `` to retrieve information for specific snapshots, even if they're not currently running.\n\nNote that the stats will not be available for any shard snapshots in an ongoing snapshot completed by a node that (even momentarily) left the cluster.\nLoading the stats from the repository is an expensive operation (see the WARNING below).\nTherefore the stats values for such shards will be -1 even though the \"stage\" value will be \"DONE\", in order to minimize latency.\nA \"description\" field will be present for a shard snapshot completed by a departed node explaining why the shard snapshot's stats results are invalid.\nConsequently, the total stats for the index will be less than expected due to the missing values from these shards.\n\nWARNING: Using the API to return the status of any snapshots other than currently running snapshots can be expensive.\nThe API requires a read from the repository for each shard in each snapshot.\nFor example, if you have 100 snapshots with 1,000 shards each, an API request that includes all snapshots will require 100,000 reads (100 snapshots x 1,000 shards).\n\nDepending on the latency of your storage, such requests can take an extremely long time to return results.\nThese requests can also tax machine resources and, when using cloud storage, incur high processing costs.\n\n## Required authorization\n\n* Cluster privileges: `monitor_snapshot`\n" operationId: snapshot-status parameters: - $ref: '#/components/parameters/snapshot.status-repository' - $ref: '#/components/parameters/snapshot.status-snapshot' - $ref: '#/components/parameters/snapshot.status-ignore_unavailable' - $ref: '#/components/parameters/snapshot.status-master_timeout' responses: '200': $ref: '#/components/responses/snapshot.status-200' x-state: Generally available; Added in 7.8.0 x-codeSamples: - lang: Console source: "GET _snapshot/my_repository/snapshot_2/_status\n" - lang: Python source: "resp = client.snapshot.status(\n repository=\"my_repository\",\n snapshot=\"snapshot_2\",\n)" - lang: JavaScript source: "const response = await client.snapshot.status({\n repository: \"my_repository\",\n snapshot: \"snapshot_2\",\n});" - lang: Ruby source: "response = client.snapshot.status(\n repository: \"my_repository\",\n snapshot: \"snapshot_2\"\n)" - lang: PHP source: "$resp = $client->snapshot()->status([\n \"repository\" => \"my_repository\",\n \"snapshot\" => \"snapshot_2\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_snapshot/my_repository/snapshot_2/_status"' - lang: C# source: "var response = await client.Snapshot\n .StatusAsync(d1 => d1\n .Repository(\"my_repository\")\n .Snapshot(new[] { \"snapshot_2\" })\n );" - lang: Java source: "client.snapshot().status(s -> s\n .repository(\"my_repository\")\n .snapshot(\"snapshot_2\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_snapshot/{repository}/_verify': post: tags: - snapshot summary: Verify a snapshot repository description: "Check for common misconfigurations in a snapshot repository.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" externalDocs: description: About managing snapshot url: https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore/self-managed#snapshots-repository-verification x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/verify-snapshot-repo-api.html operationId: snapshot-verify-repository parameters: - name: repository in: path description: The name of the snapshot repository to verify. required: true schema: $ref: '#/components/schemas/_types.Name' - name: master_timeout in: query description: "The period to wait for the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nTo indicate that the request should never timeout, set it to `-1`." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "The period to wait for a response from all relevant nodes in the cluster after updating the cluster metadata.\nIf no response is received before the timeout expires, the cluster metadata update still applies but the response will indicate that it was not completely acknowledged.\nTo indicate that the request should never timeout, set it to `-1`." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - nodes type: object properties: nodes: type: object additionalProperties: $ref: '#/components/schemas/snapshot.verify_repository.CompactNodeInfo' description: "Information about the nodes connected to the snapshot repository.\nThe key is the ID of the node." x-state: Generally available x-codeSamples: - lang: Console source: "POST _snapshot/my_unverified_backup/_verify\n" - lang: Python source: "resp = client.snapshot.verify_repository(\n name=\"my_unverified_backup\",\n)" - lang: JavaScript source: "const response = await client.snapshot.verifyRepository({\n name: \"my_unverified_backup\",\n});" - lang: Ruby source: "response = client.snapshot.verify_repository(\n repository: \"my_unverified_backup\"\n)" - lang: PHP source: "$resp = $client->snapshot()->verifyRepository([\n \"repository\" => \"my_unverified_backup\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_snapshot/my_unverified_backup/_verify"' - lang: C# source: 'var response = await client.Snapshot.VerifyRepositoryAsync(name: "my_unverified_backup");' - lang: Java source: "client.snapshot().verifyRepository(v -> v\n .name(\"my_unverified_backup\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_sql/close: post: tags: - sql summary: Clear an SQL search cursor operationId: sql-clear-cursor requestBody: content: application/json: schema: required: - cursor type: object properties: cursor: type: string description: Cursor to clear. examples: ClearSqlCursorRequestExample1: description: Run `POST _sql/close` to clear an SQL search cursor. value: "{\n \"cursor\": \"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\"\n}" x-codeSamples: - lang: Console source: "POST _sql/close\n{\n \"cursor\": \"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\"\n}" - lang: Python source: "resp = client.sql.clear_cursor(\n cursor=\"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\",\n)" - lang: JavaScript source: "const response = await client.sql.clearCursor({\n cursor:\n \"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\",\n});" - lang: Ruby source: "response = client.sql.clear_cursor(\n body: {\n \"cursor\": \"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\"\n }\n)" - lang: PHP source: "$resp = $client->sql()->clearCursor([\n \"body\" => [\n \"cursor\" => \"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"cursor":"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8="}'' "$ELASTICSEARCH_URL/_sql/close"' - lang: C# source: "var response = await client.Sql\n .ClearCursorAsync(d1 => d1\n .Cursor(\"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\")\n );" - lang: Java source: "client.sql().clearCursor(c -> c\n .cursor(\"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - succeeded type: object properties: succeeded: type: boolean x-state: Generally available; Added in 6.3.0 x-codeSamples: - lang: Console source: "POST _sql/close\n{\n \"cursor\": \"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\"\n}" - lang: Python source: "resp = client.sql.clear_cursor(\n cursor=\"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\",\n)" - lang: JavaScript source: "const response = await client.sql.clearCursor({\n cursor:\n \"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\",\n});" - lang: Ruby source: "response = client.sql.clear_cursor(\n body: {\n \"cursor\": \"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\"\n }\n)" - lang: PHP source: "$resp = $client->sql()->clearCursor([\n \"body\" => [\n \"cursor\" => \"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"cursor":"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8="}'' "$ELASTICSEARCH_URL/_sql/close"' - lang: C# source: "var response = await client.Sql\n .ClearCursorAsync(d1 => d1\n .Cursor(\"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\")\n );" - lang: Java source: "client.sql().clearCursor(c -> c\n .cursor(\"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_sql/async/delete/{id}': delete: tags: - sql summary: Delete an async SQL search description: "Delete an async SQL search or a stored synchronous SQL search.\nIf the search is still running, the API cancels it.\n\nIf the Elasticsearch security features are enabled, only the following users can use this API to delete a search:\n\n* Users with the `cancel_task` cluster privilege.\n* The user who first submitted the search.\n\n## Required authorization\n\n* Cluster privileges: `cancel_task`\n" operationId: sql-delete-async parameters: - name: id in: path description: The identifier for the search. required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 7.15.0 x-codeSamples: - lang: Console source: "DELETE _sql/async/delete/FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\n" - lang: Python source: "resp = client.sql.delete_async(\n id=\"FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\",\n)" - lang: JavaScript source: "const response = await client.sql.deleteAsync({\n id: \"FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\",\n});" - lang: Ruby source: "response = client.sql.delete_async(\n id: \"FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\"\n)" - lang: PHP source: "$resp = $client->sql()->deleteAsync([\n \"id\" => \"FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_sql/async/delete/FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI="' - lang: C# source: 'var response = await client.Sql.DeleteAsyncAsync(id: "FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=");' - lang: Java source: "client.sql().deleteAsync(d -> d\n .id(\"FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_sql/async/{id}': get: tags: - sql summary: Get async SQL search results description: "Get the current status and available results for an async SQL search or stored synchronous SQL search.\n\nIf the Elasticsearch security features are enabled, only the user who first submitted the SQL search can retrieve the search using this API." operationId: sql-get-async parameters: - name: id in: path description: The identifier for the search. required: true schema: $ref: '#/components/schemas/_types.Id' - name: delimiter in: query description: "The separator for CSV results.\nThe API supports this parameter only for CSV responses." schema: type: string default: ',' - name: format in: query description: "The format for the response.\nYou must specify a format using this parameter or the `Accept` HTTP header.\nIf you specify both, the API uses this parameter." schema: type: string - name: keep_alive in: query description: "The retention period for the search and its results.\nIt defaults to the `keep_alive` period for the original SQL search." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 5d - name: wait_for_completion_timeout in: query description: "The period to wait for complete results.\nIt defaults to no timeout, meaning the request waits for complete search results." schema: $ref: '#/components/schemas/_types.Duration' responses: '200': description: '' content: application/json: schema: required: - id - is_running - is_partial - rows type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: "Identifier for the search.\nThis value is returned only for async and saved synchronous searches.\nFor CSV, TSV, and TXT responses, this value is returned in the `Async-ID` HTTP header." is_running: type: boolean description: "If `true`, the search is still running.\nIf `false`, the search has finished.\nThis value is returned only for async and saved synchronous searches.\nFor CSV, TSV, and TXT responses, this value is returned in the `Async-partial` HTTP header." is_partial: type: boolean description: "If `true`, the response does not contain complete search results.\nIf `is_partial` is `true` and `is_running` is `true`, the search is still running.\nIf `is_partial` is `true` but `is_running` is `false`, the results are partial due to a failure or timeout.\nThis value is returned only for async and saved synchronous searches.\nFor CSV, TSV, and TXT responses, this value is returned in the `Async-partial` HTTP header." columns: type: array items: $ref: '#/components/schemas/sql._types.Column' description: Column headings for the search results. Each object is a column. cursor: type: string description: "The cursor for the next set of paginated results.\nFor CSV, TSV, and TXT responses, this value is returned in the `Cursor` HTTP header." rows: type: array items: $ref: '#/components/schemas/sql._types.Row' description: The values for the search results. x-state: Generally available; Added in 7.15.0 x-codeSamples: - lang: Console source: "GET _sql/async/FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=?wait_for_completion_timeout=2s&format=json\n" - lang: Python source: "resp = client.sql.get_async(\n id=\"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\",\n wait_for_completion_timeout=\"2s\",\n format=\"json\",\n)" - lang: JavaScript source: "const response = await client.sql.getAsync({\n id: \"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\",\n wait_for_completion_timeout: \"2s\",\n format: \"json\",\n});" - lang: Ruby source: "response = client.sql.get_async(\n id: \"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\",\n wait_for_completion_timeout: \"2s\",\n format: \"json\"\n)" - lang: PHP source: "$resp = $client->sql()->getAsync([\n \"id\" => \"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\",\n \"wait_for_completion_timeout\" => \"2s\",\n \"format\" => \"json\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_sql/async/FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=?wait_for_completion_timeout=2s&format=json"' - lang: C# source: "var response = await client.Sql\n .GetAsyncAsync(id: \"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\", d1 => d1\n .Format(\"json\")\n .WaitForCompletionTimeout(\"2s\")\n );" - lang: Java source: "client.sql().getAsync(g -> g\n .format(\"json\")\n .id(\"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\")\n .waitForCompletionTimeout(w -> w\n .time(\"2s\")\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_sql/async/status/{id}': get: tags: - sql summary: Get the async SQL search status description: "Get the current status of an async SQL search or a stored synchronous SQL search.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: sql-get-async-status parameters: - name: id in: path description: The identifier for the search. required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: required: - expiration_time_in_millis - id - is_running - is_partial - start_time_in_millis type: object properties: expiration_time_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: 'The timestamp, in milliseconds since the Unix epoch, when Elasticsearch will delete the search and its results, even if the search is still running.' id: type: string description: The identifier for the search. is_running: type: boolean description: "If `true`, the search is still running.\nIf `false`, the search has finished." is_partial: type: boolean description: "If `true`, the response does not contain complete search results.\nIf `is_partial` is `true` and `is_running` is `true`, the search is still running.\nIf `is_partial` is `true` but `is_running` is `false`, the results are partial due to a failure or timeout." start_time_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: "The timestamp, in milliseconds since the Unix epoch, when the search started.\nThe API returns this property only for running searches." completion_status: allOf: - $ref: '#/components/schemas/_types.uint' description: "The HTTP status code for the search.\nThe API returns this property only for completed searches." x-state: Generally available; Added in 7.15.0 x-codeSamples: - lang: Console source: "GET _sql/async/status/FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\n" - lang: Python source: "resp = client.sql.get_async_status(\n id=\"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\",\n)" - lang: JavaScript source: "const response = await client.sql.getAsyncStatus({\n id: \"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\",\n});" - lang: Ruby source: "response = client.sql.get_async_status(\n id: \"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\"\n)" - lang: PHP source: "$resp = $client->sql()->getAsyncStatus([\n \"id\" => \"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_sql/async/status/FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU="' - lang: C# source: 'var response = await client.Sql.GetAsyncStatusAsync(id: "FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=");' - lang: Java source: "client.sql().getAsyncStatus(g -> g\n .id(\"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_sql: get: tags: - sql summary: "Get SQL search results\n" description: "**All methods and paths for this operation:**\n\n
\n POST\n /_sql\n
\n
\n GET\n /_sql\n
\n \n\nRun an SQL request.\n\n## Required authorization\n\n* Index privileges: `read`\n" operationId: sql-query parameters: - $ref: '#/components/parameters/sql.query-format' requestBody: $ref: '#/components/requestBodies/sql.query' responses: '200': $ref: '#/components/responses/sql.query-200' x-state: Generally available; Added in 6.3.0 x-codeSamples: - lang: Console source: "POST _sql?format=txt\n{\n \"query\": \"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\"\n}" - lang: Python source: "resp = client.sql.query(\n format=\"txt\",\n query=\"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\",\n)" - lang: JavaScript source: "const response = await client.sql.query({\n format: \"txt\",\n query: \"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\",\n});" - lang: Ruby source: "response = client.sql.query(\n format: \"txt\",\n body: {\n \"query\": \"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\"\n }\n)" - lang: PHP source: "$resp = $client->sql()->query([\n \"format\" => \"txt\",\n \"body\" => [\n \"query\" => \"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":"SELECT * FROM library ORDER BY page_count DESC LIMIT 5"}'' "$ELASTICSEARCH_URL/_sql?format=txt"' - lang: C# source: "var response = await client.Sql\n .QueryAsync(d1 => d1\n .Format(SqlFormat.Txt)\n .Query(\"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\")\n );" - lang: Java source: "client.sql().query(q -> q\n .format(SqlFormat.Txt)\n .query(\"\"\"\n SELECT * FROM library ORDER BY page_count DESC LIMIT 5\n \"\"\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_sql/translate: get: tags: - sql summary: "Translate SQL into Elasticsearch queries\n" description: "**All methods and paths for this operation:**\n\n
\n POST\n /_sql/translate\n
\n
\n GET\n /_sql/translate\n
\n \n\nTranslate an SQL search into a search API request containing Query DSL.\nIt accepts the same request body parameters as the SQL search API, excluding `cursor`.\n\n## Required authorization\n\n* Index privileges: `read`\n" operationId: sql-translate requestBody: $ref: '#/components/requestBodies/sql.translate' responses: '200': $ref: '#/components/responses/sql.translate-200' x-state: Generally available; Added in 6.3.0 x-codeSamples: - lang: Console source: "POST _sql/translate\n{\n \"query\": \"SELECT * FROM library ORDER BY page_count DESC\",\n \"fetch_size\": 10\n}" - lang: Python source: "resp = client.sql.translate(\n query=\"SELECT * FROM library ORDER BY page_count DESC\",\n fetch_size=10,\n)" - lang: JavaScript source: "const response = await client.sql.translate({\n query: \"SELECT * FROM library ORDER BY page_count DESC\",\n fetch_size: 10,\n});" - lang: Ruby source: "response = client.sql.translate(\n body: {\n \"query\": \"SELECT * FROM library ORDER BY page_count DESC\",\n \"fetch_size\": 10\n }\n)" - lang: PHP source: "$resp = $client->sql()->translate([\n \"body\" => [\n \"query\" => \"SELECT * FROM library ORDER BY page_count DESC\",\n \"fetch_size\" => 10,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":"SELECT * FROM library ORDER BY page_count DESC","fetch_size":10}'' "$ELASTICSEARCH_URL/_sql/translate"' - lang: C# source: "var response = await client.Sql\n .TranslateAsync(d1 => d1\n .FetchSize(10)\n .Query(\"SELECT * FROM library ORDER BY page_count DESC\")\n );" - lang: Java source: "client.sql().translate(t -> t\n .fetchSize(10)\n .query(\"\"\"\n SELECT * FROM library ORDER BY page_count DESC\n \"\"\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_ssl/certificates: get: tags: - security summary: Get SSL certificates description: "Get information about the X.509 certificates that are used to encrypt communications in the cluster.\nThe API returns a list that includes certificates from all TLS contexts including:\n\n- Settings for transport and HTTP interfaces\n- TLS settings that are used within authentication realms\n- TLS settings for remote monitoring exporters\n\nThe list includes certificates that are used for configuring trust, such as those configured in the `xpack.security.transport.ssl.truststore` and `xpack.security.transport.ssl.certificate_authorities` settings.\nIt also includes certificates that are used for configuring server identity, such as `xpack.security.http.ssl.keystore` and `xpack.security.http.ssl.certificate settings`.\n\nThe list does not include certificates that are sourced from the default SSL context of the Java Runtime Environment (JRE), even if those certificates are in use within Elasticsearch.\n\nNOTE: When a PKCS#11 token is configured as the truststore of the JRE, the API returns all the certificates that are included in the PKCS#11 token irrespective of whether these are used in the Elasticsearch TLS configuration.\n\nIf Elasticsearch is configured to use a keystore or truststore, the API output includes all certificates in that store, even though some of the certificates might not be in active use within the cluster.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" externalDocs: description: About setting up transport tls url: https://www.elastic.co/docs/deploy-manage/security/set-up-basic-security#encrypt-internode-communication x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-api-ssl.html operationId: ssl-certificates responses: '200': description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/ssl.certificates.CertificateInformation' examples: GetCertificatesResponseExample1: description: "A successful response from `GET /_ssl/certificates`, which provides information about the certificates on a single node of Elasticsearch.\n" value: "[\n {\n \"path\": \"certs/elastic-certificates.p12\",\n \"format\": \"PKCS12\",\n \"alias\": \"instance\",\n \"subject_dn\": \"CN=Elastic Certificate Tool Autogenerated CA\",\n \"serial_number\": \"a20f0ee901e8f69dc633ff633e5cd5437cdb4137\",\n \"has_private_key\": false,\n \"expiry\": \"2021-01-15T20:42:49.000Z\"\n },\n {\n \"path\": \"certs/elastic-certificates.p12\",\n \"format\": \"PKCS12\",\n \"alias\": \"ca\",\n \"subject_dn\": \"CN=Elastic Certificate Tool Autogenerated CA\",\n \"serial_number\": \"a20f0ee901e8f69dc633ff633e5cd5437cdb4137\",\n \"has_private_key\": false,\n \"expiry\": \"2021-01-15T20:42:49.000Z\"\n },\n {\n \"path\": \"certs/elastic-certificates.p12\",\n \"format\": \"PKCS12\",\n \"alias\": \"instance\",\n \"subject_dn\": \"CN=instance\",\n \"serial_number\": \"fc1905e1494dc5230218d079c47a617088f84ce0\",\n \"has_private_key\": true,\n \"expiry\": \"2021-01-15T20:44:32.000Z\"\n }\n]" x-state: Generally available; Added in 6.2.0 x-codeSamples: - lang: Console source: "GET /_ssl/certificates\n" - lang: Python source: resp = client.ssl.certificates() - lang: JavaScript source: const response = await client.ssl.certificates(); - lang: Ruby source: response = client.ssl.certificates - lang: PHP source: $resp = $client->ssl()->certificates(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ssl/certificates"' - lang: C# source: var response = await client.Certificates.CertificatesAsync(); - lang: Java source: "client.ssl().certificates();\n" x-metaTags: - content: Elasticsearch name: product_name '/_streams/{name}/_disable': post: tags: - streams summary: Disable a named stream description: "Turn off the named stream feature for this cluster.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: streams-logs-disable parameters: - name: name in: path description: "The stream type to disable.\n\nSupported values include:\n - `logs`: The logs stream type.\n - `logs.otel`: The logs.otel stream type, meant for OTel-formatted data.\n - `logs.ecs`: The logs.ecs stream type, meant for ECS-formatted data.\n\n" required: true schema: $ref: '#/components/schemas/streams._types.StreamType' - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "The period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: PostStreamsLogsDisableResponseExample1: summary: Disable logs.otel streams description: "A successful response from `POST _streams/logs.otel/_disable` endpoint\n" value: "{\n \"acknowledged\": true\n}" x-state: Experimental; Added in 9.1.0 x-codeSamples: - lang: Console source: "POST _streams/logs.otel/_disable\n" - lang: Python source: "resp = client.streams.logs_disable(\n name=\"logs.otel\",\n)" - lang: JavaScript source: "const response = await client.streams.logsDisable({\n name: \"logs.otel\",\n});" - lang: Ruby source: "response = client.streams.logs_disable(\n name: \"logs.otel\"\n)" - lang: PHP source: "$resp = $client->streams()->logsDisable([\n \"name\" => \"logs.otel\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_streams/logs.otel/_disable"' - lang: C# source: 'var response = await client.Streams.LogsDisableAsync(name: StreamType.LogsOtel);' - lang: Java source: "client.streams().logsDisable(l -> l);\n" x-metaTags: - content: Elasticsearch name: product_name '/_streams/{name}/_enable': post: tags: - streams summary: Enable a named stream description: "Turn on the named stream feature for this cluster.\n\nNOTE: To protect existing data, this feature can be turned on only if the cluster does not have\nexisting indices or data streams that match the pattern `|.*` for the enabled stream\ntype name. If those indices or data streams exist, a `409 - Conflict` response and error is\nreturned.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: streams-logs-enable parameters: - name: name in: path description: "The stream type to enable.\n\nSupported values include:\n - `logs`: The logs stream type.\n - `logs.otel`: The logs.otel stream type, meant for OTel-formatted data.\n - `logs.ecs`: The logs.ecs stream type, meant for ECS-formatted data.\n\n" required: true schema: $ref: '#/components/schemas/streams._types.StreamType' - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "The period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: PostStreamsEnableResponseExample1: summary: Enable logs streams description: "A successful response from `POST _streams/logs.otel/_enable` endpoint\n" value: "{\n \"acknowledged\": true\n}" '409': description: "\nAn index named `logs.otel`, or starting with `logs.otel.`, already exists." content: application/json: schema: $ref: '#/components/schemas/_types.ErrorResponseBase' examples: PostStreamsEnableResponseExample2: summary: Enable logs streams - Failure due to conflicting index description: "An error response from the `POST _streams/logs.otel/_enable` endpoint caused by attempting to enable logs.otel streams when an existing index with the name `logs.otel` already exists\n" value: "{\n \"error\": {\n \"root_cause\": [\n {\n \"type\": \"status_exception\",\n \"reason\": \"Cannot enable logs.otel streams: indices named 'logs.otel' or starting with 'logs.otel.' already exist.\"\n }\n ],\n \"type\": \"status_exception\",\n \"reason\": \"Cannot enable logs streams: indices named 'logs.otel' or starting with 'logs.otel.' already exist.\"\n },\n \"status\": 409\n}" x-state: Experimental; Added in 9.1.0 x-codeSamples: - lang: Console source: "POST _streams/logs.otel/_enable\n" - lang: Python source: "resp = client.streams.logs_enable(\n name=\"logs.otel\",\n)" - lang: JavaScript source: "const response = await client.streams.logsEnable({\n name: \"logs.otel\",\n});" - lang: Ruby source: "response = client.streams.logs_enable(\n name: \"logs.otel\"\n)" - lang: PHP source: "$resp = $client->streams()->logsEnable([\n \"name\" => \"logs.otel\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_streams/logs.otel/_enable"' - lang: C# source: 'var response = await client.Streams.LogsEnableAsync(name: StreamType.LogsOtel);' - lang: Java source: "client.streams().logsEnable(l -> l);\n" x-metaTags: - content: Elasticsearch name: product_name /_streams/status: get: tags: - streams summary: Get the status of streams description: "Get the current status for all types of streams.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: streams-status parameters: - name: master_timeout in: query description: 'Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - logs - logs.otel - logs.ecs type: object properties: logs: allOf: - $ref: '#/components/schemas/streams.status.StreamStatus' logs.otel: allOf: - $ref: '#/components/schemas/streams.status.StreamStatus' logs.ecs: allOf: - $ref: '#/components/schemas/streams.status.StreamStatus' examples: GetStreamsStatusResponseExample1: summary: Get Streams Status A successful response from `GET _streams/status` that outlines the current state of all wired streams in the cluster. value: "{\n \"logs\": {\n \"enabled\": false\n }\n \"logs.ecs\": {\n \"enabled\": true\n }\n \"logs.otel\": {\n \"enabled\": true\n }\n}" x-state: Experimental; Added in 9.1.0 x-codeSamples: - lang: Console source: "GET _streams/status\n" - lang: Python source: resp = client.streams.status() - lang: JavaScript source: const response = await client.streams.status(); - lang: Ruby source: response = client.streams.status - lang: PHP source: $resp = $client->streams()->status(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_streams/status"' - lang: C# source: var response = await client.Streams.StatusAsync(); - lang: Java source: "client.streams().status(s -> s);\n" x-metaTags: - content: Elasticsearch name: product_name '/_synonyms/{id}': get: tags: - synonyms summary: Get a synonym set description: "\n\n## Required authorization\n\n* Cluster privileges: `manage_search_synonyms`\n" operationId: synonyms-get-synonym parameters: - name: id in: path description: The synonyms set identifier to retrieve. required: true schema: $ref: '#/components/schemas/_types.Id' - name: from in: query description: The starting offset for synonym rules to retrieve. schema: type: number default: 0 - name: size in: query description: The max number of synonym rules to retrieve. schema: type: number default: 10 - name: search_after in: query description: "The synonym rule ID to use as a cursor for pagination.\nThe next page of results will start after this rule ID.\nThis parameter cannot be used with `from`." schema: type: string x-state: Generally available; Added in 9.5.0 responses: '200': description: '' content: application/json: schema: required: - count - synonyms_set type: object properties: count: type: number description: The total number of synonyms rules that the synonyms set contains. synonyms_set: type: array items: $ref: '#/components/schemas/synonyms._types.SynonymRuleRead' description: Synonym rule details. examples: SynonymsGetResponseExample1: description: A successful response from `GET _synonyms/my-synonyms-set`. value: "{\n \"count\": 3,\n \"synonyms_set\": [\n {\n \"id\": \"test-1\",\n \"synonyms\": \"hello, hi\"\n },\n {\n \"id\": \"test-2\",\n \"synonyms\": \"bye, goodbye\"\n },\n {\n \"id\": \"test-3\",\n \"synonyms\": \"test => check\"\n }\n ]\n}" x-state: Generally available; Added in 8.10.0 x-codeSamples: - lang: Console source: "GET _synonyms/my-synonyms-set\n" - lang: Python source: "resp = client.synonyms.get_synonym(\n id=\"my-synonyms-set\",\n)" - lang: JavaScript source: "const response = await client.synonyms.getSynonym({\n id: \"my-synonyms-set\",\n});" - lang: Ruby source: "response = client.synonyms.get_synonym(\n id: \"my-synonyms-set\"\n)" - lang: PHP source: "$resp = $client->synonyms()->getSynonym([\n \"id\" => \"my-synonyms-set\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_synonyms/my-synonyms-set"' - lang: C# source: 'var response = await client.Synonyms.GetSynonymAsync(id: "my-synonyms-set");' - lang: Java source: "client.synonyms().getSynonym(g -> g\n .id(\"my-synonyms-set\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - synonyms summary: Create or update a synonym set description: "Synonym sets are limited to a maximum of 100,000 synonym rules per set by default.\nThis limit is configurable using the `synonyms.max_synonym_rules` cluster setting.\n\nWhen an existing synonyms set is updated, the search analyzers that use the synonyms set are reloaded automatically for all indices.\nThis is equivalent to invoking the reload search analyzers API for all indices that use the synonyms set.\n\nFor practical examples of how to create or update a synonyms set, refer to the External documentation.\n\n## Required authorization\n\n* Cluster privileges: `manage_search_synonyms`\n" externalDocs: description: About synonym API examples url: https://www.elastic.co/docs/solutions/search/full-text/create-update-synonyms-api-example x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/put-synonyms-set.html operationId: synonyms-put-synonym parameters: - name: id in: path description: The ID of the synonyms set to be created or updated. required: true schema: $ref: '#/components/schemas/_types.Id' - name: refresh in: query description: "If `true`, the request will refresh the analyzers with the new synonyms set and wait for the new synonyms to be available before returning.\nIf `false`, analyzers will not be reloaded with the new synonym set" schema: type: boolean default: true x-state: Generally available; Added in 9.1.0 - name: append in: query description: "If `true`, the provided synonym rules are appended to the existing set, with matching IDs overwriting existing rules.\nIf `false`, the entire synonyms set is replaced with the new synonym rules definitions." schema: type: boolean default: false x-state: Generally available; Added in 9.5.0 requestBody: content: application/json: schema: required: - synonyms_set type: object properties: synonyms_set: oneOf: - $ref: '#/components/schemas/synonyms._types.SynonymRule' - type: array items: $ref: '#/components/schemas/synonyms._types.SynonymRule' description: The synonym rules definitions for the synonyms set. examples: SynonymsPutRequestExample1: description: '' value: "\n{\n \"synonyms_set\": {\n \"synonyms\" : \"hello, hi, howdy\"\n }\n}" x-codeSamples: - lang: Console source: "PUT _synonyms/my-synonyms-set\n\n{\n \"synonyms_set\": {\n \"synonyms\" : \"hello, hi, howdy\"\n }\n}" - lang: Python source: "resp = client.synonyms.put_synonym(\n id=\"my-synonyms-set\",\n synonyms_set={\n \"synonyms\": \"hello, hi, howdy\"\n },\n)" - lang: JavaScript source: "const response = await client.synonyms.putSynonym({\n id: \"my-synonyms-set\",\n synonyms_set: {\n synonyms: \"hello, hi, howdy\",\n },\n});" - lang: Ruby source: "response = client.synonyms.put_synonym(\n id: \"my-synonyms-set\",\n body: {\n \"synonyms_set\": {\n \"synonyms\": \"hello, hi, howdy\"\n }\n }\n)" - lang: PHP source: "$resp = $client->synonyms()->putSynonym([\n \"id\" => \"my-synonyms-set\",\n \"body\" => [\n \"synonyms_set\" => [\n \"synonyms\" => \"hello, hi, howdy\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"synonyms_set":{"synonyms":"hello, hi, howdy"}}'' "$ELASTICSEARCH_URL/_synonyms/my-synonyms-set"' - lang: C# source: "var response = await client.Synonyms\n .PutSynonymAsync(id: \"my-synonyms-set\", d1 => d1\n .SynonymsSet(d2 => d2\n .Synonyms(\"hello, hi, howdy\")\n )\n );" - lang: Java source: "client.synonyms().putSynonym(p -> p\n .id(\"my-synonyms-set\")\n .synonymsSet(s -> s\n .synonyms(\"hello, hi, howdy\")\n )\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - result type: object properties: result: allOf: - $ref: '#/components/schemas/_types.Result' description: The update operation result. reload_analyzers_details: allOf: - $ref: '#/components/schemas/indices.reload_search_analyzers.ReloadResult' description: "Updating a synonyms set can reload the associated analyzers in case refresh is set to true.\nThis information is the analyzers reloading result." '400': description: "\nThe synonym rules are not valid." content: application/json: schema: $ref: '#/components/schemas/_types.ErrorResponseBase' examples: SynonymsPutResponseExample1: description: "An abbreviated response from `PUT _synonyms/my-synonyms-set`. If any of the synonym rules included is not valid, the API returns an error.\n" value: "{\n \"error\": {\n \"root_cause\": [\n {\n \"type\": \"action_request_validation_exception\",\n \"reason\": \"Validation Failed: 1: More than one explicit mapping specified in the same synonyms rule: [hello => hi => howdy];\",\n \"stack_trace\": ...\n }\n ],\n \"type\": \"action_request_validation_exception\",\n \"reason\": \"Validation Failed: 1: More than one explicit mapping specified in the same synonyms rule: [hello => hi => howdy];\",\n \"stack_trace\": ...\n },\n \"status\": 400\n}" x-state: Generally available; Added in 8.10.0 x-codeSamples: - lang: Console source: "PUT _synonyms/my-synonyms-set\n\n{\n \"synonyms_set\": {\n \"synonyms\" : \"hello, hi, howdy\"\n }\n}" - lang: Python source: "resp = client.synonyms.put_synonym(\n id=\"my-synonyms-set\",\n synonyms_set={\n \"synonyms\": \"hello, hi, howdy\"\n },\n)" - lang: JavaScript source: "const response = await client.synonyms.putSynonym({\n id: \"my-synonyms-set\",\n synonyms_set: {\n synonyms: \"hello, hi, howdy\",\n },\n});" - lang: Ruby source: "response = client.synonyms.put_synonym(\n id: \"my-synonyms-set\",\n body: {\n \"synonyms_set\": {\n \"synonyms\": \"hello, hi, howdy\"\n }\n }\n)" - lang: PHP source: "$resp = $client->synonyms()->putSynonym([\n \"id\" => \"my-synonyms-set\",\n \"body\" => [\n \"synonyms_set\" => [\n \"synonyms\" => \"hello, hi, howdy\",\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"synonyms_set":{"synonyms":"hello, hi, howdy"}}'' "$ELASTICSEARCH_URL/_synonyms/my-synonyms-set"' - lang: C# source: "var response = await client.Synonyms\n .PutSynonymAsync(id: \"my-synonyms-set\", d1 => d1\n .SynonymsSet(d2 => d2\n .Synonyms(\"hello, hi, howdy\")\n )\n );" - lang: Java source: "client.synonyms().putSynonym(p -> p\n .id(\"my-synonyms-set\")\n .synonymsSet(s -> s\n .synonyms(\"hello, hi, howdy\")\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - synonyms summary: Delete a synonym set description: "You can only delete a synonyms set that is not in use by any index analyzer.\n\nSynonyms sets can be used in synonym graph token filters and synonym token filters.\nThese synonym filters can be used as part of search analyzers.\n\nAnalyzers need to be loaded when an index is restored (such as when a node starts, or the index becomes open).\nEven if the analyzer is not used on any field mapping, it still needs to be loaded on the index recovery phase.\n\nIf any analyzers cannot be loaded, the index becomes unavailable and the cluster status becomes red or yellow as index shards are not available.\nTo prevent that, synonyms sets that are used in analyzers can't be deleted.\nA delete request in this case will return a 400 response code.\n\nTo remove a synonyms set, you must first remove all indices that contain analyzers using it.\nYou can migrate an index by creating a new index that does not contain the token filter with the synonyms set, and use the reindex API in order to copy over the index data.\nOnce finished, you can delete the index.\nWhen the synonyms set is not used in analyzers, you will be able to delete it.\n\n## Required authorization\n\n* Cluster privileges: `manage_search_synonyms`\n" operationId: synonyms-delete-synonym parameters: - name: id in: path description: The synonyms set identifier to delete. required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 8.10.0 x-codeSamples: - lang: Console source: "DELETE _synonyms/my-synonyms-set\n" - lang: Python source: "resp = client.synonyms.delete_synonym(\n id=\"my-synonyms-set\",\n)" - lang: JavaScript source: "const response = await client.synonyms.deleteSynonym({\n id: \"my-synonyms-set\",\n});" - lang: Ruby source: "response = client.synonyms.delete_synonym(\n id: \"my-synonyms-set\"\n)" - lang: PHP source: "$resp = $client->synonyms()->deleteSynonym([\n \"id\" => \"my-synonyms-set\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_synonyms/my-synonyms-set"' - lang: C# source: 'var response = await client.Synonyms.DeleteSynonymAsync(id: "my-synonyms-set");' - lang: Java source: "client.synonyms().deleteSynonym(d -> d\n .id(\"my-synonyms-set\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_synonyms/{set_id}/{rule_id}': get: tags: - synonyms summary: Get a synonym rule description: "Get a synonym rule from a synonym set.\n\n## Required authorization\n\n* Cluster privileges: `manage_search_synonyms`\n" operationId: synonyms-get-synonym-rule parameters: - name: set_id in: path description: The ID of the synonym set to retrieve the synonym rule from. required: true schema: $ref: '#/components/schemas/_types.Id' - name: rule_id in: path description: The ID of the synonym rule to retrieve. required: true schema: $ref: '#/components/schemas/_types.Id' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/synonyms._types.SynonymRuleRead' examples: SynonymRuleGetResponseExample1: description: A successful response from `GET _synonyms/my-synonyms-set/test-1`. value: "{\n \"id\": \"test-1\",\n \"synonyms\": \"hello, hi\"\n}" x-state: Generally available; Added in 8.10.0 x-codeSamples: - lang: Console source: "GET _synonyms/my-synonyms-set/test-1\n" - lang: Python source: "resp = client.synonyms.get_synonym_rule(\n set_id=\"my-synonyms-set\",\n rule_id=\"test-1\",\n)" - lang: JavaScript source: "const response = await client.synonyms.getSynonymRule({\n set_id: \"my-synonyms-set\",\n rule_id: \"test-1\",\n});" - lang: Ruby source: "response = client.synonyms.get_synonym_rule(\n set_id: \"my-synonyms-set\",\n rule_id: \"test-1\"\n)" - lang: PHP source: "$resp = $client->synonyms()->getSynonymRule([\n \"set_id\" => \"my-synonyms-set\",\n \"rule_id\" => \"test-1\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_synonyms/my-synonyms-set/test-1"' - lang: C# source: 'var response = await client.Synonyms.GetSynonymRuleAsync(setId: "my-synonyms-set", ruleId: "test-1");' - lang: Java source: "client.synonyms().getSynonymRule(g -> g\n .ruleId(\"test-1\")\n .setId(\"my-synonyms-set\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - synonyms summary: Create or update a synonym rule description: "Create or update a synonym rule in a synonym set.\n\nIf any of the synonym rules included is invalid, the API returns an error.\n\nWhen you update a synonym rule, all analyzers using the synonyms set will be reloaded automatically to reflect the new rule.\n\n## Required authorization\n\n* Cluster privileges: `manage_search_synonyms`\n" operationId: synonyms-put-synonym-rule parameters: - name: set_id in: path description: The ID of the synonym set. required: true schema: $ref: '#/components/schemas/_types.Id' - name: rule_id in: path description: The ID of the synonym rule to be updated or created. required: true schema: $ref: '#/components/schemas/_types.Id' - name: refresh in: query description: "If `true`, the request will refresh the analyzers with the new synonym rule and wait for the new synonyms to be available before returning.\nIf `false`, analyzers will not be reloaded with the new synonym rule" schema: type: boolean default: true x-state: Generally available; Added in 9.1.0 requestBody: content: application/json: schema: required: - synonyms type: object properties: synonyms: allOf: - $ref: '#/components/schemas/synonyms._types.SynonymString' description: 'The synonym rule information definition, which must be in Solr format.' externalDocs: url: https://www.elastic.co/docs/reference/text-analysis/analysis-synonym-graph-tokenfilter#analysis-synonym-graph-define-synonyms examples: SynonymRulePutRequestExample1: summary: synonyms/apis/put-synonym-rule.asciidoc:107 description: '' value: "{\n \"synonyms\": \"hello, hi, howdy\"\n}" x-codeSamples: - lang: Console source: "PUT _synonyms/my-synonyms-set/test-1\n{\n \"synonyms\": \"hello, hi, howdy\"\n}" - lang: Python source: "resp = client.synonyms.put_synonym_rule(\n set_id=\"my-synonyms-set\",\n rule_id=\"test-1\",\n synonyms=\"hello, hi, howdy\",\n)" - lang: JavaScript source: "const response = await client.synonyms.putSynonymRule({\n set_id: \"my-synonyms-set\",\n rule_id: \"test-1\",\n synonyms: \"hello, hi, howdy\",\n});" - lang: Ruby source: "response = client.synonyms.put_synonym_rule(\n set_id: \"my-synonyms-set\",\n rule_id: \"test-1\",\n body: {\n \"synonyms\": \"hello, hi, howdy\"\n }\n)" - lang: PHP source: "$resp = $client->synonyms()->putSynonymRule([\n \"set_id\" => \"my-synonyms-set\",\n \"rule_id\" => \"test-1\",\n \"body\" => [\n \"synonyms\" => \"hello, hi, howdy\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"synonyms":"hello, hi, howdy"}'' "$ELASTICSEARCH_URL/_synonyms/my-synonyms-set/test-1"' - lang: C# source: "var response = await client.Synonyms\n .PutSynonymRuleAsync(setId: \"my-synonyms-set\", ruleId: \"test-1\", d1 => d1\n .Synonyms(\"hello, hi, howdy\")\n );" - lang: Java source: "client.synonyms().putSynonymRule(p -> p\n .ruleId(\"test-1\")\n .setId(\"my-synonyms-set\")\n .synonyms(\"hello, hi, howdy\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/synonyms._types.SynonymsUpdateResult' examples: SynonymRuleResponseExample1: description: "A successful response from `PUT _synonyms/my-synonyms-set/test-1`.\n" value: "{\n \"result\": \"updated\",\n \"reload_analyzers_details\": {\n \"_shards\": {\n \"total\": 2,\n \"successful\": 1,\n \"failed\": 0\n },\n \"reload_details\": [\n {\n \"index\": \"test-index\",\n \"reloaded_analyzers\": [\n \"my_search_analyzer\"\n ],\n \"reloaded_node_ids\": [\n \"1wYFZzq8Sxeu_Jvt9mlbkg\"\n ]\n }\n ]\n }\n}" x-state: Generally available; Added in 8.10.0 x-codeSamples: - lang: Console source: "PUT _synonyms/my-synonyms-set/test-1\n{\n \"synonyms\": \"hello, hi, howdy\"\n}" - lang: Python source: "resp = client.synonyms.put_synonym_rule(\n set_id=\"my-synonyms-set\",\n rule_id=\"test-1\",\n synonyms=\"hello, hi, howdy\",\n)" - lang: JavaScript source: "const response = await client.synonyms.putSynonymRule({\n set_id: \"my-synonyms-set\",\n rule_id: \"test-1\",\n synonyms: \"hello, hi, howdy\",\n});" - lang: Ruby source: "response = client.synonyms.put_synonym_rule(\n set_id: \"my-synonyms-set\",\n rule_id: \"test-1\",\n body: {\n \"synonyms\": \"hello, hi, howdy\"\n }\n)" - lang: PHP source: "$resp = $client->synonyms()->putSynonymRule([\n \"set_id\" => \"my-synonyms-set\",\n \"rule_id\" => \"test-1\",\n \"body\" => [\n \"synonyms\" => \"hello, hi, howdy\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"synonyms":"hello, hi, howdy"}'' "$ELASTICSEARCH_URL/_synonyms/my-synonyms-set/test-1"' - lang: C# source: "var response = await client.Synonyms\n .PutSynonymRuleAsync(setId: \"my-synonyms-set\", ruleId: \"test-1\", d1 => d1\n .Synonyms(\"hello, hi, howdy\")\n );" - lang: Java source: "client.synonyms().putSynonymRule(p -> p\n .ruleId(\"test-1\")\n .setId(\"my-synonyms-set\")\n .synonyms(\"hello, hi, howdy\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - synonyms summary: Delete a synonym rule description: "Delete a synonym rule from a synonym set.\n\n## Required authorization\n\n* Cluster privileges: `manage_search_synonyms`\n" operationId: synonyms-delete-synonym-rule parameters: - name: set_id in: path description: The ID of the synonym set to update. required: true schema: $ref: '#/components/schemas/_types.Id' - name: rule_id in: path description: The ID of the synonym rule to delete. required: true schema: $ref: '#/components/schemas/_types.Id' - name: refresh in: query description: "If `true`, the request will refresh the analyzers with the deleted synonym rule and wait for the new synonyms to be available before returning.\nIf `false`, analyzers will not be reloaded with the deleted synonym rule" schema: type: boolean default: true x-state: Generally available; Added in 9.1.0 responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/synonyms._types.SynonymsUpdateResult' examples: SynonymRuleDeleteResponseExample1: description: "A successful response from `DELETE _synonyms/my-synonyms-set/test-1`. All analyzers using this synonyms set will be reloaded automatically to reflect the rule being deleted.\n" value: "{\n \"result\": \"deleted\",\n \"reload_analyzers_details\": {\n \"_shards\": {\n \"total\": 2,\n \"successful\": 1,\n \"failed\": 0\n },\n \"reload_details\": [\n {\n \"index\": \"test-index\",\n \"reloaded_analyzers\": [\n \"my_search_analyzer\"\n ],\n \"reloaded_node_ids\": [\n \"1wYFZzq8Sxeu_Jvt9mlbkg\"\n ]\n }\n ]\n }\n}" x-state: Generally available; Added in 8.10.0 x-codeSamples: - lang: Console source: "DELETE _synonyms/my-synonyms-set/test-1\n" - lang: Python source: "resp = client.synonyms.delete_synonym_rule(\n set_id=\"my-synonyms-set\",\n rule_id=\"test-1\",\n)" - lang: JavaScript source: "const response = await client.synonyms.deleteSynonymRule({\n set_id: \"my-synonyms-set\",\n rule_id: \"test-1\",\n});" - lang: Ruby source: "response = client.synonyms.delete_synonym_rule(\n set_id: \"my-synonyms-set\",\n rule_id: \"test-1\"\n)" - lang: PHP source: "$resp = $client->synonyms()->deleteSynonymRule([\n \"set_id\" => \"my-synonyms-set\",\n \"rule_id\" => \"test-1\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_synonyms/my-synonyms-set/test-1"' - lang: C# source: 'var response = await client.Synonyms.DeleteSynonymRuleAsync(setId: "my-synonyms-set", ruleId: "test-1");' - lang: Java source: "client.synonyms().deleteSynonymRule(d -> d\n .ruleId(\"test-1\")\n .setId(\"my-synonyms-set\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_synonyms: get: tags: - synonyms summary: Get all synonym sets description: "Get a summary of all defined synonym sets.\n\n## Required authorization\n\n* Cluster privileges: `manage_search_synonyms`\n" operationId: synonyms-get-synonyms-sets parameters: - name: from in: query description: The starting offset for synonyms sets to retrieve. schema: type: number default: 0 - name: size in: query description: The maximum number of synonyms sets to retrieve. schema: type: number default: 10 responses: '200': description: '' content: application/json: schema: required: - count - results type: object properties: count: type: number description: The total number of synonyms sets defined. results: type: array items: $ref: '#/components/schemas/synonyms.get_synonyms_sets.SynonymsSetItem' description: The identifier and total number of defined synonym rules for each synonyms set. examples: SynonymsSetsGetResponseExample1: description: A successful response from `GET _synonyms`. value: "{\n \"count\": 3,\n \"results\": [\n {\n \"synonyms_set\": \"ecommerce-synonyms\",\n \"count\": 2\n },\n {\n \"synonyms_set\": \"my-synonyms-set\",\n \"count\": 3\n },\n {\n \"synonyms_set\": \"new-ecommerce-synonyms\",\n \"count\": 1\n }\n ]\n}" x-state: Generally available; Added in 8.10.0 x-codeSamples: - lang: Console source: "GET _synonyms\n" - lang: Python source: resp = client.synonyms.get_synonyms_sets() - lang: JavaScript source: const response = await client.synonyms.getSynonymsSets(); - lang: Ruby source: response = client.synonyms.get_synonyms_sets - lang: PHP source: $resp = $client->synonyms()->getSynonymsSets(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_synonyms"' - lang: C# source: var response = await client.Synonyms.GetSynonymsSetsAsync(); - lang: Java source: "client.synonyms().getSynonymsSets(g -> g);\n" x-metaTags: - content: Elasticsearch name: product_name '/_tasks/{task_id}/_cancel': post: tags: - tasks summary: "Cancel a task\n" description: "**All methods and paths for this operation:**\n\n
\n POST\n /_tasks/_cancel\n
\n
\n POST\n /_tasks/{task_id}/_cancel\n
\n \n\nWARNING: The task management API is new and should still be considered a beta feature.\nThe API may change in ways that are not backwards compatible.\n\nA task may continue to run for some time after it has been cancelled because it may not be able to safely stop its current activity straight away.\nIt is also possible that Elasticsearch must complete its work on other tasks before it can process the cancellation.\nThe get task information API will continue to list these cancelled tasks until they complete.\nThe cancelled flag in the response indicates that the cancellation command has been processed and the task will stop as soon as possible.\n\nTo troubleshoot why a cancelled task does not complete promptly, use the get task information API with the `?detailed` parameter to identify the other tasks the system is running.\nYou can also use the node hot threads API to obtain detailed information about the work the system is doing instead of completing the cancelled task.\n\nFor relocatable tasks, this API transparently follows the task across graceful shutdown relocations,\nso callers can keep using the original task ID. The returned task reports its `original_task_id` and `original_start_time_in_millis`\nif it is continuing work from an earlier task.\n\n## Required authorization\n\n* Cluster privileges: `manage`\n" operationId: tasks-cancel parameters: - $ref: '#/components/parameters/tasks.cancel-task_id' - $ref: '#/components/parameters/tasks.cancel-actions' - $ref: '#/components/parameters/tasks.cancel-nodes' - $ref: '#/components/parameters/tasks.cancel-parent_task_id' - $ref: '#/components/parameters/tasks.cancel-wait_for_completion' responses: '200': $ref: '#/components/responses/tasks.cancel-200' x-state: Experimental; Added in 2.3.0 x-codeSamples: - lang: Console source: "POST _tasks//_cancel\n" - lang: Python source: "resp = client.tasks.cancel(\n task_id=\"\",\n)" - lang: JavaScript source: "const response = await client.tasks.cancel({\n task_id: \"\",\n});" - lang: Ruby source: "response = client.tasks.cancel(\n task_id: \"\"\n)" - lang: PHP source: "$resp = $client->tasks()->cancel([\n \"task_id\" => \"\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_tasks//_cancel"' - lang: Java source: "client.tasks().cancel(c -> c\n .taskId(\"\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_tasks/{task_id}': get: tags: - tasks summary: Get task information description: "Get information about a task currently running in the cluster.\n\nWARNING: The task management API is new and should still be considered a beta feature.\nThe API may change in ways that are not backwards compatible.\n\nIf the task identifier is not found, a 404 response code indicates that there are no resources that match the request.\n\nFor relocatable tasks, this API transparently follows the task across graceful shutdown relocations,\nso callers can keep using the original task ID. The returned task reports its `original_task_id` and `original_start_time_in_millis`\nif it is continuing work from an earlier task.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: tasks-get parameters: - name: task_id in: path description: The task identifier. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: "The period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: wait_for_completion in: query description: 'If `true`, the request blocks until the task has completed.' schema: type: boolean default: false responses: '200': description: '' content: application/json: schema: required: - completed - task type: object properties: completed: type: boolean task: allOf: - $ref: '#/components/schemas/tasks._types.TaskInfo' response: type: object error: allOf: - $ref: '#/components/schemas/_types.ErrorCause' examples: GetTaskResponseExample1: summary: Get cluster actions description: "A successful response from `GET _tasks?actions=cluster:*`, which retrieves all cluster-related tasks.\n" value: "{\n \"nodes\" : {\n \"oTUltX4IQMOUUVeiohTt8A\" : {\n \"name\" : \"H5dfFeA\",\n \"transport_address\" : \"127.0.0.1:9300\",\n \"host\" : \"127.0.0.1\",\n \"ip\" : \"127.0.0.1:9300\",\n \"tasks\" : {\n \"oTUltX4IQMOUUVeiohTt8A:124\" : {\n \"node\" : \"oTUltX4IQMOUUVeiohTt8A\",\n \"id\" : 124,\n \"type\" : \"direct\",\n \"action\" : \"cluster:monitor/tasks/lists[n]\",\n \"start_time_in_millis\" : 1458585884904,\n \"running_time_in_nanos\" : 47402,\n \"cancellable\" : false,\n \"parent_task_id\" : \"oTUltX4IQMOUUVeiohTt8A:123\"\n },\n \"oTUltX4IQMOUUVeiohTt8A:123\" : {\n \"node\" : \"oTUltX4IQMOUUVeiohTt8A\",\n \"id\" : 123,\n \"type\" : \"transport\",\n \"action\" : \"cluster:monitor/tasks/lists\",\n \"start_time_in_millis\" : 1458585884904,\n \"running_time_in_nanos\" : 236042,\n \"cancellable\" : false\n }\n }\n }\n }\n}" GetTaskResponseExample2: summary: Get details about a delete by query description: "A successful response from `GET _tasks?detailed=true&actions=*/delete/byquery`, which gets the status of a delete by query operation. The `status` object contains the actual status. `total` is the total number of operations that the reindex expects to perform. You can estimate the progress by adding the `updated`, `created`, and `deleted` fields. The request will finish when their sum is equal to the `total` field.\n" value: "{\n \"nodes\" : {\n \"r1A2WoRbTwKZ516z6NEs5A\" : {\n \"name\" : \"r1A2WoR\",\n \"transport_address\" : \"127.0.0.1:9300\",\n \"host\" : \"127.0.0.1\",\n \"ip\" : \"127.0.0.1:9300\",\n \"attributes\" : {\n \"testattr\" : \"test\",\n \"portsfile\" : \"true\"\n },\n \"tasks\" : {\n \"r1A2WoRbTwKZ516z6NEs5A:36619\" : {\n \"node\" : \"r1A2WoRbTwKZ516z6NEs5A\",\n \"id\" : 36619,\n \"type\" : \"transport\",\n \"action\" : \"indices:data/write/delete/byquery\",\n \"status\" : { \n \"total\" : 6154,\n \"updated\" : 0,\n \"created\" : 0,\n \"deleted\" : 3500,\n \"batches\" : 36,\n \"version_conflicts\" : 0,\n \"noops\" : 0,\n \"retries\": 0,\n \"throttled_millis\": 0\n },\n \"description\" : \"\"\n }\n }\n }\n }\n}" x-state: Experimental; Added in 5.0.0 x-codeSamples: - lang: Console source: "GET _tasks?detailed=true&actions=*/delete/byquery\n" - lang: Python source: "resp = client.tasks.list(\n detailed=True,\n actions=\"*/delete/byquery\",\n)" - lang: JavaScript source: "const response = await client.tasks.list({\n detailed: \"true\",\n actions: \"*/delete/byquery\",\n});" - lang: Ruby source: "response = client.tasks.list(\n detailed: \"true\",\n actions: \"*/delete/byquery\"\n)" - lang: PHP source: "$resp = $client->tasks()->list([\n \"detailed\" => \"true\",\n \"actions\" => \"*/delete/byquery\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_tasks?detailed=true&actions=*/delete/byquery"' - lang: C# source: "var response = await client.Tasks\n .ListAsync(d1 => d1\n .Actions(\"*/delete/byquery\")\n .Detailed(true)\n );" - lang: Java source: "client.tasks().list(l -> l\n .actions(\"*/delete/byquery\")\n .detailed(true)\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_tasks: get: tags: - tasks summary: Get all tasks description: "Get information about the tasks currently running on one or more nodes in the cluster.\n\nWARNING: The task management API is new and should still be considered a beta feature.\nThe API may change in ways that are not backwards compatible.\n\nFor relocatable tasks, this API transparently follows the task across graceful shutdown relocations,\nso callers can keep using the original task ID. The returned task reports its `original_task_id` and `original_start_time_in_millis`\nif it is continuing work from an earlier task.\n\n**Identifying running tasks**\n\nThe `X-Opaque-Id header`, when provided on the HTTP request header, is going to be returned as a header in the response as well as in the headers field for in the task information.\nThis enables you to track certain calls or associate certain tasks with the client that started them.\nFor example:\n\n```\ncurl -i -H \"X-Opaque-Id: 123456\" \"http://localhost:9200/_tasks?group_by=parents\"\n```\n\nThe API returns the following result:\n\n```\nHTTP/1.1 200 OK\nX-Opaque-Id: 123456\ncontent-type: application/json; charset=UTF-8\ncontent-length: 831\n\n{\n \"tasks\" : {\n \"u5lcZHqcQhu-rUoFaqDphA:45\" : {\n \"node\" : \"u5lcZHqcQhu-rUoFaqDphA\",\n \"id\" : 45,\n \"type\" : \"transport\",\n \"action\" : \"cluster:monitor/tasks/lists\",\n \"start_time_in_millis\" : 1513823752749,\n \"running_time_in_nanos\" : 293139,\n \"cancellable\" : false,\n \"headers\" : {\n \"X-Opaque-Id\" : \"123456\"\n },\n \"children\" : [\n {\n \"node\" : \"u5lcZHqcQhu-rUoFaqDphA\",\n \"id\" : 46,\n \"type\" : \"direct\",\n \"action\" : \"cluster:monitor/tasks/lists[n]\",\n \"start_time_in_millis\" : 1513823752750,\n \"running_time_in_nanos\" : 92133,\n \"cancellable\" : false,\n \"parent_task_id\" : \"u5lcZHqcQhu-rUoFaqDphA:45\",\n \"headers\" : {\n \"X-Opaque-Id\" : \"123456\"\n }\n }\n ]\n }\n }\n }\n```\nIn this example, `X-Opaque-Id: 123456` is the ID as a part of the response header.\nThe `X-Opaque-Id` in the task `headers` is the ID for the task that was initiated by the REST request.\nThe `X-Opaque-Id` in the children `headers` is the child task of the task that was initiated by the REST request.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: tasks-list parameters: - name: actions in: query description: "A comma-separated list or wildcard expression of actions used to limit the request.\nFor example, you can use `cluser:*` to retrieve all cluster-related tasks." schema: oneOf: - type: string - type: array items: type: string - name: detailed in: query description: "If `true`, the response includes detailed information about the running tasks.\nThis information is useful to distinguish tasks from each other but is more costly to run." schema: type: boolean default: false - name: group_by in: query description: "A key that is used to group tasks in the response.\nThe task lists can be grouped either by nodes or by parent tasks.\n\nSupported values include:\n - `nodes`: Group tasks by node ID.\n - `parents`: Group tasks by parent task ID.\n - `none`: Do not group tasks.\n\n" schema: allOf: - $ref: '#/components/schemas/tasks._types.GroupBy' default: nodes - name: nodes in: query description: A comma-separated list of node IDs or names that is used to limit the returned information. schema: $ref: '#/components/schemas/_types.NodeIds' - name: parent_task_id in: query description: "A parent task identifier that is used to limit returned information.\nTo return all tasks, omit this parameter or use a value of `-1`.\nIf the parent task is not found, the API does not return a 404 response code." schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: "The period to wait for each node to respond.\nIf a node does not respond before its timeout expires, the response does not include its information.\nHowever, timed out nodes are included in the `node_failures` property." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: wait_for_completion in: query description: 'If `true`, the request blocks until the operation is complete.' schema: type: boolean default: false responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/tasks._types.TaskListResponseBase' examples: ListTasksResponseExample1: description: "A successful response from `GET _tasks?actions=*search&detailed` The `detailed` parameter affects the `description` field, which contains human readable text that identifies the particular request that the task is performing. For example, it helps identify the search request being performed by a search task.\n" value: "{\n \"nodes\" : {\n \"oTUltX4IQMOUUVeiohTt8A\" : {\n \"name\" : \"H5dfFeA\",\n \"transport_address\" : \"127.0.0.1:9300\",\n \"host\" : \"127.0.0.1\",\n \"ip\" : \"127.0.0.1:9300\",\n \"tasks\" : {\n \"oTUltX4IQMOUUVeiohTt8A:464\" : {\n \"node\" : \"oTUltX4IQMOUUVeiohTt8A\",\n \"id\" : 464,\n \"type\" : \"transport\",\n \"action\" : \"indices:data/read/search\",\n \"description\" : \"indices[test], types[test], search_type[QUERY_THEN_FETCH], source[{\\\"query\\\":...}]\",\n \"start_time_in_millis\" : 1483478610008,\n \"running_time_in_nanos\" : 13991383,\n \"cancellable\" : true,\n \"cancelled\" : false\n }\n }\n }\n }\n}" x-state: Experimental; Added in 2.3.0 x-codeSamples: - lang: Console source: "GET _tasks?actions=*search&detailed\n" - lang: Python source: "resp = client.tasks.list(\n actions=\"*search\",\n detailed=True,\n)" - lang: JavaScript source: "const response = await client.tasks.list({\n actions: \"*search\",\n detailed: \"true\",\n});" - lang: Ruby source: "response = client.tasks.list(\n actions: \"*search\",\n detailed: \"true\"\n)" - lang: PHP source: "$resp = $client->tasks()->list([\n \"actions\" => \"*search\",\n \"detailed\" => \"true\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_tasks?actions=*search&detailed"' - lang: C# source: "var response = await client.Tasks\n .ListAsync(d1 => d1\n .Actions(\"*search\")\n .Detailed(true)\n );" - lang: Java source: "client.tasks().list(l -> l\n .actions(\"*search\")\n .detailed(true)\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_terms_enum': post: tags: - search summary: "Get terms in an index\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /{index}/_terms_enum\n
\n
\n POST\n /{index}/_terms_enum\n
\n \n\nDiscover terms that match a partial string in an index.\nThis API is designed for low-latency look-ups used in auto-complete scenarios.\n\n> info\n> The terms enum API may return terms from deleted documents. Deleted documents are initially only marked as deleted. It is not until their segments are merged that documents are actually deleted. Until that happens, the terms enum API will return terms from these documents.\n\n## Required authorization\n\n* Index privileges: `read`\n" operationId: terms-enum parameters: - $ref: '#/components/parameters/terms_enum-index' requestBody: $ref: '#/components/requestBodies/terms_enum' responses: '200': $ref: '#/components/responses/terms_enum-200' x-state: Generally available; Added in 7.14.0 x-codeSamples: - lang: Console source: "POST stackoverflow/_terms_enum\n{\n \"field\" : \"tags\",\n \"string\" : \"kiba\"\n}" - lang: Python source: "resp = client.terms_enum(\n index=\"stackoverflow\",\n field=\"tags\",\n string=\"kiba\",\n)" - lang: JavaScript source: "const response = await client.termsEnum({\n index: \"stackoverflow\",\n field: \"tags\",\n string: \"kiba\",\n});" - lang: Ruby source: "response = client.terms_enum(\n index: \"stackoverflow\",\n body: {\n \"field\": \"tags\",\n \"string\": \"kiba\"\n }\n)" - lang: PHP source: "$resp = $client->termsEnum([\n \"index\" => \"stackoverflow\",\n \"body\" => [\n \"field\" => \"tags\",\n \"string\" => \"kiba\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"field":"tags","string":"kiba"}'' "$ELASTICSEARCH_URL/stackoverflow/_terms_enum"' - lang: C# source: "var response = await client\n .TermsEnumAsync(indices: new[] { \"stackoverflow\" }, d1 => d1\n .Field(x => x.Tags)\n .String(\"kiba\")\n );" - lang: Java source: "client.termsEnum(t -> t\n .field(\"tags\")\n .index(\"stackoverflow\")\n .string(\"kiba\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_termvectors/{id}': post: tags: - document summary: "Get term vector information\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /{index}/_termvectors\n
\n
\n POST\n /{index}/_termvectors\n
\n
\n GET\n /{index}/_termvectors/{id}\n
\n
\n POST\n /{index}/_termvectors/{id}\n
\n \n\nGet information and statistics about terms in the fields of a particular document.\n\nYou can retrieve term vectors for documents stored in the index or for artificial documents passed in the body of the request.\nYou can specify the fields you are interested in through the `fields` parameter or by adding the fields to the request body.\nFor example:\n\n```\nGET /my-index-000001/_termvectors/1?fields=message\n```\n\nFields can be specified using wildcards, similar to the multi match query.\n\nTerm vectors are real-time by default, not near real-time.\nThis can be changed by setting `realtime` parameter to `false`.\n\nYou can request three types of values: _term information_, _term statistics_, and _field statistics_.\nBy default, all term information and field statistics are returned for all fields but term statistics are excluded.\n\n**Term information**\n\n* term frequency in the field (always returned)\n* term positions (`positions: true`)\n* start and end offsets (`offsets: true`)\n* term payloads (`payloads: true`), as base64 encoded bytes\n\nIf the requested information wasn't stored in the index, it will be computed on the fly if possible.\nAdditionally, term vectors could be computed for documents not even existing in the index, but instead provided by the user.\n\n> warn\n> Start and end offsets assume UTF-16 encoding is being used. If you want to use these offsets in order to get the original text that produced this token, you should make sure that the string you are taking a sub-string of is also encoded using UTF-16.\n\n**Behaviour**\n\nThe term and field statistics are not accurate.\nDeleted documents are not taken into account.\nThe information is only retrieved for the shard the requested document resides in.\nThe term and field statistics are therefore only useful as relative measures whereas the absolute numbers have no meaning in this context.\nBy default, when requesting term vectors of artificial documents, a shard to get the statistics from is randomly selected.\nUse `routing` only to hit a particular shard.\nRefer to the linked documentation for detailed examples of how to use this API.\n\n## Required authorization\n\n* Index privileges: `read`\n" externalDocs: description: About term vectors API examples url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/term-vectors-examples x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/docs-termvectors.html operationId: termvectors parameters: - $ref: '#/components/parameters/termvectors-index' - $ref: '#/components/parameters/termvectors-id' - $ref: '#/components/parameters/termvectors-fields' - $ref: '#/components/parameters/termvectors-field_statistics' - $ref: '#/components/parameters/termvectors-offsets' - $ref: '#/components/parameters/termvectors-payloads' - $ref: '#/components/parameters/termvectors-positions' - $ref: '#/components/parameters/termvectors-preference' - $ref: '#/components/parameters/termvectors-realtime' - $ref: '#/components/parameters/termvectors-routing' - $ref: '#/components/parameters/termvectors-term_statistics' - $ref: '#/components/parameters/termvectors-version' - $ref: '#/components/parameters/termvectors-version_type' requestBody: $ref: '#/components/requestBodies/termvectors' responses: '200': $ref: '#/components/responses/termvectors-200' x-state: Generally available x-codeSamples: - lang: Console source: "GET /my-index-000001/_termvectors/1\n{\n \"fields\" : [\"text\"],\n \"offsets\" : true,\n \"payloads\" : true,\n \"positions\" : true,\n \"term_statistics\" : true,\n \"field_statistics\" : true\n}" - lang: Python source: "resp = client.termvectors(\n index=\"my-index-000001\",\n id=\"1\",\n fields=[\n \"text\"\n ],\n offsets=True,\n payloads=True,\n positions=True,\n term_statistics=True,\n field_statistics=True,\n)" - lang: JavaScript source: "const response = await client.termvectors({\n index: \"my-index-000001\",\n id: 1,\n fields: [\"text\"],\n offsets: true,\n payloads: true,\n positions: true,\n term_statistics: true,\n field_statistics: true,\n});" - lang: Ruby source: "response = client.termvectors(\n index: \"my-index-000001\",\n id: \"1\",\n body: {\n \"fields\": [\n \"text\"\n ],\n \"offsets\": true,\n \"payloads\": true,\n \"positions\": true,\n \"term_statistics\": true,\n \"field_statistics\": true\n }\n)" - lang: PHP source: "$resp = $client->termvectors([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n \"body\" => [\n \"fields\" => array(\n \"text\",\n ),\n \"offsets\" => true,\n \"payloads\" => true,\n \"positions\" => true,\n \"term_statistics\" => true,\n \"field_statistics\" => true,\n ],\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"fields":["text"],"offsets":true,"payloads":true,"positions":true,"term_statistics":true,"field_statistics":true}'' "$ELASTICSEARCH_URL/my-index-000001/_termvectors/1"' - lang: C# source: "var response = await client\n .TermvectorsAsync(index: \"my-index-000001\", routeSlice: null, id: \"1\", d1 => d1\n .Fields(x => x.Text)\n .FieldStatistics(true)\n .Offsets(true)\n .Payloads(true)\n .Positions(true)\n .TermStatistics(true)\n );" - lang: Java source: "client.termvectors(t -> t\n .fieldStatistics(true)\n .fields(\"text\")\n .id(\"1\")\n .index(\"my-index-000001\")\n .offsets(true)\n .payloads(true)\n .positions(true)\n .termStatistics(true)\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_text_structure/find_field_structure: get: tags: - text_structure summary: Find the structure of a text field description: "Find the structure of a text field in an Elasticsearch index.\n\nThis API provides a starting point for extracting further information from log messages already ingested into Elasticsearch.\nFor example, if you have ingested data into a very simple index that has just `@timestamp` and message fields, you can use this API to see what common structure exists in the message field.\n\nThe response from the API contains:\n\n* Sample messages.\n* Statistics that reveal the most common values for all fields detected within the text and basic numeric statistics for numeric fields.\n* Information about the structure of the text, which is useful when you write ingest configurations to index it or similarly formatted text.\n* Appropriate mappings for an Elasticsearch index, which you could use to ingest the text.\n\nAll this information can be calculated by the structure finder with no guidance.\nHowever, you can optionally override some of the decisions about the text structure by specifying one or more query parameters.\n\nIf the structure finder produces unexpected results, specify the `explain` query parameter and an explanation will appear in the response.\nIt helps determine why the returned structure was chosen.\n\n## Required authorization\n\n* Cluster privileges: `monitor_text_structure`\n" operationId: text-structure-find-field-structure parameters: - name: column_names in: query description: "If `format` is set to `delimited`, you can specify the column names in a comma-separated list.\nIf this parameter is not specified, the structure finder uses the column names from the header row of the text.\nIf the text does not have a header row, columns are named \"column1\", \"column2\", \"column3\", for example." schema: oneOf: - type: string - type: array items: type: string - name: delimiter in: query description: "If you have set `format` to `delimited`, you can specify the character used to delimit the values in each row.\nOnly a single character is supported; the delimiter cannot have multiple characters.\nBy default, the API considers the following possibilities: comma, tab, semi-colon, and pipe (`|`).\nIn this default scenario, all rows must have the same number of fields for the delimited format to be detected.\nIf you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row." schema: type: string - name: documents_to_sample in: query description: "The number of documents to include in the structural analysis.\nThe minimum value is 2." schema: allOf: - $ref: '#/components/schemas/_types.uint' default: 1000 - name: ecs_compatibility in: query description: "The mode of compatibility with ECS compliant Grok patterns.\nUse this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern.\nThis setting primarily has an impact when a whole message Grok pattern such as `%{CATALINALOG}` matches the input.\nIf the structure finder identifies a common structure but has no idea of the meaning then generic field names such as `path`, `ipaddress`, `field1`, and `field2` are used in the `grok_pattern` output.\nThe intention in that situation is that a user who knows the meanings will rename the fields before using them." schema: allOf: - $ref: '#/components/schemas/text_structure._types.EcsCompatibilityType' default: disabled - name: explain in: query description: 'If `true`, the response includes a field named `explanation`, which is an array of strings that indicate how the structure finder produced its result.' schema: type: boolean default: false - name: field in: query description: The field that should be analyzed. required: true schema: $ref: '#/components/schemas/_types.Field' - name: format in: query description: "The high level structure of the text.\nBy default, the API chooses the format.\nIn this default scenario, all rows must have the same number of fields for a delimited format to be detected.\nIf the format is set to delimited and the delimiter is not set, however, the API tolerates up to 5% of rows that have a different number of columns than the first row." schema: $ref: '#/components/schemas/text_structure._types.FormatType' - name: grok_pattern in: query description: "If the format is `semi_structured_text`, you can specify a Grok pattern that is used to extract fields from every message in the text.\nThe name of the timestamp field in the Grok pattern must match what is specified in the `timestamp_field` parameter.\nIf that parameter is not specified, the name of the timestamp field in the Grok pattern must match \"timestamp\".\nIf `grok_pattern` is not specified, the structure finder creates a Grok pattern." schema: $ref: '#/components/schemas/_types.GrokPattern' - name: index in: query description: The name of the index that contains the analyzed field. required: true schema: $ref: '#/components/schemas/_types.IndexName' - name: quote in: query description: "If the format is `delimited`, you can specify the character used to quote the values in each row if they contain newlines or the delimiter character.\nOnly a single character is supported.\nIf this parameter is not specified, the default value is a double quote (`\"`).\nIf your delimited text format does not use quoting, a workaround is to set this argument to a character that does not appear anywhere in the sample." schema: type: string - name: should_trim_fields in: query description: "If the format is `delimited`, you can specify whether values between delimiters should have whitespace trimmed from them.\nIf this parameter is not specified and the delimiter is pipe (`|`), the default value is true.\nOtherwise, the default value is `false`." schema: type: boolean - name: should_parse_recursively in: query description: "If the format is `ndjson`, you can specify whether to parse nested JSON objects recursively.\nThe nested objects are parsed to a maximum depth equal to the default value of the `index.mapping.depth.limit` setting.\nAnything beyond that depth is parsed as an `object` type field.\nFor formats other than `ndjson`, this parameter is ignored." schema: type: boolean default: false - name: timeout in: query description: "The maximum amount of time that the structure analysis can take.\nIf the analysis is still running when the timeout expires, it will be stopped." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 25s - name: timestamp_field in: query description: "The name of the field that contains the primary timestamp of each record in the text.\nIn particular, if the text was ingested into an index, this is the field that would be used to populate the `@timestamp` field.\n\nIf the format is `semi_structured_text`, this field must match the name of the appropriate extraction in the `grok_pattern`.\nTherefore, for semi-structured text, it is best not to specify this parameter unless `grok_pattern` is also specified.\n\nFor structured text, if you specify this parameter, the field must exist within the text.\n\nIf this parameter is not specified, the structure finder makes a decision about which field (if any) is the primary timestamp field.\nFor structured text, it is not compulsory to have a timestamp in the text." schema: $ref: '#/components/schemas/_types.Field' - name: timestamp_format in: query description: "The Java time format of the timestamp field in the text.\nOnly a subset of Java time format letter groups are supported:\n\n* `a`\n* `d`\n* `dd`\n* `EEE`\n* `EEEE`\n* `H`\n* `HH`\n* `h`\n* `M`\n* `MM`\n* `MMM`\n* `MMMM`\n* `mm`\n* `ss`\n* `XX`\n* `XXX`\n* `yy`\n* `yyyy`\n* `zzz`\n\nAdditionally `S` letter groups (fractional seconds) of length one to nine are supported providing they occur after `ss` and are separated from the `ss` by a period (`.`), comma (`,`), or colon (`:`).\nSpacing and punctuation is also permitted with the exception a question mark (`?`), newline, and carriage return, together with literal text enclosed in single quotes.\nFor example, `MM/dd HH.mm.ss,SSSSSS 'in' yyyy` is a valid override format.\n\nOne valuable use case for this parameter is when the format is semi-structured text, there are multiple timestamp formats in the text, and you know which format corresponds to the primary timestamp, but you do not want to specify the full `grok_pattern`.\nAnother is when the timestamp format is one that the structure finder does not consider by default.\n\nIf this parameter is not specified, the structure finder chooses the best format from a built-in set.\n\nIf the special value `null` is specified, the structure finder will not look for a primary timestamp in the text.\nWhen the format is semi-structured text, this will result in the structure finder treating the text as single-line messages." schema: type: string responses: '200': description: '' content: application/json: schema: required: - charset - field_stats - format - ingest_pipeline - mappings - need_client_timezone - num_lines_analyzed - num_messages_analyzed - sample_start type: object properties: charset: type: string ecs_compatibility: allOf: - $ref: '#/components/schemas/text_structure._types.EcsCompatibilityType' field_stats: type: object additionalProperties: $ref: '#/components/schemas/text_structure._types.FieldStat' format: allOf: - $ref: '#/components/schemas/text_structure._types.FormatType' grok_pattern: allOf: - $ref: '#/components/schemas/_types.GrokPattern' java_timestamp_formats: type: array items: type: string joda_timestamp_formats: type: array items: type: string ingest_pipeline: allOf: - $ref: '#/components/schemas/ingest._types.PipelineConfig' mappings: allOf: - $ref: '#/components/schemas/_types.mapping.TypeMapping' multiline_start_pattern: type: string need_client_timezone: type: boolean num_lines_analyzed: type: number num_messages_analyzed: type: number sample_start: type: string timestamp_field: allOf: - $ref: '#/components/schemas/_types.Field' examples: FindFieldStructureResponseExample1: description: A successful response from `GET _text_structure/find_field_structure?index=test-logs&field=message`. value: "{\n \"num_lines_analyzed\" : 22,\n \"num_messages_analyzed\" : 22,\n \"sample_start\" : \"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128\\n[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]\\n\",\n \"charset\" : \"UTF-8\",\n \"format\" : \"semi_structured_text\",\n \"multiline_start_pattern\" : \"^\\\\[\\\\b\\\\d{4}-\\\\d{2}-\\\\d{2}[T ]\\\\d{2}:\\\\d{2}\",\n \"grok_pattern\" : \"\\\\[%{TIMESTAMP_ISO8601:timestamp}\\\\]\\\\[%{LOGLEVEL:loglevel} \\\\]\\\\[.*\",\n \"ecs_compatibility\" : \"disabled\",\n \"timestamp_field\" : \"timestamp\",\n \"joda_timestamp_formats\" : [\n \"ISO8601\"\n ],\n \"java_timestamp_formats\" : [\n \"ISO8601\"\n ],\n \"need_client_timezone\" : true,\n \"mappings\" : {\n \"properties\" : {\n \"@timestamp\" : {\n \"type\" : \"date\"\n },\n \"loglevel\" : {\n \"type\" : \"keyword\"\n },\n \"message\" : {\n \"type\" : \"text\"\n }\n }\n },\n \"ingest_pipeline\" : {\n \"description\" : \"Ingest pipeline created by text structure finder\",\n \"processors\" : [\n {\n \"grok\" : {\n \"field\" : \"message\",\n \"patterns\" : [\n \"\\\\[%{TIMESTAMP_ISO8601:timestamp}\\\\]\\\\[%{LOGLEVEL:loglevel} \\\\]\\\\[.*\"\n ],\n \"ecs_compatibility\" : \"disabled\"\n }\n },\n {\n \"date\" : {\n \"field\" : \"timestamp\",\n \"timezone\" : \"{{ event.timezone }}\",\n \"formats\" : [\n \"ISO8601\"\n ]\n }\n },\n {\n \"remove\" : {\n \"field\" : \"timestamp\"\n }\n }\n ]\n },\n \"field_stats\" : {\n \"loglevel\" : {\n \"count\" : 22,\n \"cardinality\" : 1,\n \"top_hits\" : [\n {\n \"value\" : \"INFO\",\n \"count\" : 22\n }\n ]\n },\n \"message\" : {\n \"count\" : 22,\n \"cardinality\" : 22,\n \"top_hits\" : [\n {\n \"value\" : \"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128\",\n \"count\" : 1\n },\n {\n \"value\" : \"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]\",\n \"count\" : 1\n },\n {\n \"value\" : \"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]\",\n \"count\" : 1\n },\n {\n \"value\" : \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]\",\n \"count\" : 1\n },\n {\n \"value\" : \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]\",\n \"count\" : 1\n },\n {\n \"value\" : \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]\",\n \"count\" : 1\n },\n {\n \"value\" : \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]\",\n \"count\" : 1\n },\n {\n \"value\" : \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]\",\n \"count\" : 1\n },\n {\n \"value\" : \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]\",\n \"count\" : 1\n },\n {\n \"value\" : \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]\",\n \"count\" : 1\n }\n ]\n },\n \"timestamp\" : {\n \"count\" : 22,\n \"cardinality\" : 14,\n \"earliest\" : \"2024-03-05T10:52:36,256\",\n \"latest\" : \"2024-03-05T10:52:49,199\",\n \"top_hits\" : [\n {\n \"value\" : \"2024-03-05T10:52:41,044\",\n \"count\" : 6\n },\n {\n \"value\" : \"2024-03-05T10:52:41,043\",\n \"count\" : 3\n },\n {\n \"value\" : \"2024-03-05T10:52:41,059\",\n \"count\" : 2\n },\n {\n \"value\" : \"2024-03-05T10:52:36,256\",\n \"count\" : 1\n },\n {\n \"value\" : \"2024-03-05T10:52:41,038\",\n \"count\" : 1\n },\n {\n \"value\" : \"2024-03-05T10:52:41,042\",\n \"count\" : 1\n },\n {\n \"value\" : \"2024-03-05T10:52:43,291\",\n \"count\" : 1\n },\n {\n \"value\" : \"2024-03-05T10:52:46,098\",\n \"count\" : 1\n },\n {\n \"value\" : \"2024-03-05T10:52:47,227\",\n \"count\" : 1\n },\n {\n \"value\" : \"2024-03-05T10:52:47,259\",\n \"count\" : 1\n }\n ]\n }\n }\n}" x-state: Generally available x-codeSamples: - lang: Console source: "GET _text_structure/find_field_structure?index=test-logs&field=message\n" - lang: Python source: "resp = client.text_structure.find_field_structure(\n index=\"test-logs\",\n field=\"message\",\n)" - lang: JavaScript source: "const response = await client.textStructure.findFieldStructure({\n index: \"test-logs\",\n field: \"message\",\n});" - lang: Ruby source: "response = client.text_structure.find_field_structure(\n index: \"test-logs\",\n field: \"message\"\n)" - lang: PHP source: "$resp = $client->textStructure()->findFieldStructure([\n \"index\" => \"test-logs\",\n \"field\" => \"message\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_text_structure/find_field_structure?index=test-logs&field=message"' - lang: C# source: "var response = await client.TextStructure\n .FindFieldStructureAsync(d1 => d1\n .Field(x => x.Message)\n .Index(\"test-logs\")\n );" - lang: Java source: "client.textStructure().findFieldStructure(f -> f\n .field(\"message\")\n .index(\"test-logs\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_text_structure/find_message_structure: post: tags: - text_structure summary: "Find the structure of text messages\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_text_structure/find_message_structure\n
\n
\n POST\n /_text_structure/find_message_structure\n
\n \n\nFind the structure of a list of text messages.\nThe messages must contain data that is suitable to be ingested into Elasticsearch.\n\nThis API provides a starting point for ingesting data into Elasticsearch in a format that is suitable for subsequent use with other Elastic Stack functionality.\nUse this API rather than the find text structure API if your input text has already been split up into separate messages by some other process.\n\nThe response from the API contains:\n\n* Sample messages.\n* Statistics that reveal the most common values for all fields detected within the text and basic numeric statistics for numeric fields.\n* Information about the structure of the text, which is useful when you write ingest configurations to index it or similarly formatted text.\nAppropriate mappings for an Elasticsearch index, which you could use to ingest the text.\n\nAll this information can be calculated by the structure finder with no guidance.\nHowever, you can optionally override some of the decisions about the text structure by specifying one or more query parameters.\n\nIf the structure finder produces unexpected results, specify the `explain` query parameter and an explanation will appear in the response.\nIt helps determine why the returned structure was chosen.\n\n## Required authorization\n\n* Cluster privileges: `monitor_text_structure`\n" operationId: text-structure-find-message-structure parameters: - $ref: '#/components/parameters/text_structure.find_message_structure-column_names' - $ref: '#/components/parameters/text_structure.find_message_structure-delimiter' - $ref: '#/components/parameters/text_structure.find_message_structure-ecs_compatibility' - $ref: '#/components/parameters/text_structure.find_message_structure-explain' - $ref: '#/components/parameters/text_structure.find_message_structure-format' - $ref: '#/components/parameters/text_structure.find_message_structure-grok_pattern' - $ref: '#/components/parameters/text_structure.find_message_structure-quote' - $ref: '#/components/parameters/text_structure.find_message_structure-should_trim_fields' - $ref: '#/components/parameters/text_structure.find_message_structure-should_parse_recursively' - $ref: '#/components/parameters/text_structure.find_message_structure-timeout' - $ref: '#/components/parameters/text_structure.find_message_structure-timestamp_field' - $ref: '#/components/parameters/text_structure.find_message_structure-timestamp_format' requestBody: $ref: '#/components/requestBodies/text_structure.find_message_structure' responses: '200': $ref: '#/components/responses/text_structure.find_message_structure-200' x-state: Generally available x-codeSamples: - lang: Console source: "POST _text_structure/find_message_structure\n{\n \"messages\": [\n \"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128\",\n \"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]\",\n \"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]\",\n \"[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]\",\n \"[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled\",\n \"[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled\",\n \"[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled\",\n \"[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]\",\n \"[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]\",\n \"[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized\",\n \"[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...\"\n ]\n}" - lang: Python source: "resp = client.text_structure.find_message_structure(\n messages=[\n \"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128\",\n \"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]\",\n \"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]\",\n \"[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]\",\n \"[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled\",\n \"[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled\",\n \"[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled\",\n \"[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]\",\n \"[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]\",\n \"[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized\",\n \"[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...\"\n ],\n)" - lang: JavaScript source: "const response = await client.textStructure.findMessageStructure({\n messages: [\n \"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128\",\n \"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]\",\n \"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]\",\n \"[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]\",\n \"[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled\",\n \"[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled\",\n \"[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled\",\n \"[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]\",\n \"[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]\",\n \"[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized\",\n \"[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...\",\n ],\n});" - lang: Ruby source: "response = client.text_structure.find_message_structure(\n body: {\n \"messages\": [\n \"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128\",\n \"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]\",\n \"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]\",\n \"[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]\",\n \"[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled\",\n \"[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled\",\n \"[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled\",\n \"[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]\",\n \"[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]\",\n \"[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized\",\n \"[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...\"\n ]\n }\n)" - lang: PHP source: "$resp = $client->textStructure()->findMessageStructure([\n \"body\" => [\n \"messages\" => array(\n \"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128\",\n \"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]\",\n \"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]\",\n \"[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]\",\n \"[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled\",\n \"[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled\",\n \"[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled\",\n \"[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]\",\n \"[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]\",\n \"[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized\",\n \"[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...\",\n ),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"messages":["[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128","[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]","[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]","[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]","[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]","[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]","[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]","[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]","[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]","[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]","[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]","[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]","[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]","[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]","[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]","[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled","[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled","[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled","[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]","[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]","[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized","[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ..."]}'' "$ELASTICSEARCH_URL/_text_structure/find_message_structure"' - lang: C# source: "var response = await client.TextStructure\n .FindMessageStructureAsync(d1 => d1\n .Messages(\"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128\", \"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]\", \"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]\", \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]\", \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]\", \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]\", \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]\", \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]\", \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]\", \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]\", \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]\", \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]\", \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]\", \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]\", \"[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]\", \"[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled\", \"[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled\", \"[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled\", \"[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]\", \"[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]\", \"[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized\", \"[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...\")\n );" - lang: Java source: "client.textStructure().findMessageStructure(f -> f\n .messages(List.of(\"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128\",\"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]\",\"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]\",\"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]\",\"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]\",\"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]\",\"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]\",\"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]\",\"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]\",\"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]\",\"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]\",\"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]\",\"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]\",\"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]\",\"[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]\",\"[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled\",\"[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled\",\"[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled\",\"[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]\",\"[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]\",\"[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized\",\"[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...\"))\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_text_structure/find_structure: post: tags: - text_structure summary: Find the structure of a text file description: "The text file must contain data that is suitable to be ingested into Elasticsearch.\n\nThis API provides a starting point for ingesting data into Elasticsearch in a format that is suitable for subsequent use with other Elastic Stack functionality.\nUnlike other Elasticsearch endpoints, the data that is posted to this endpoint does not need to be UTF-8 encoded and in JSON format.\nIt must, however, be text; binary text formats are not currently supported.\nThe size is limited to the Elasticsearch HTTP receive buffer size, which defaults to 100 Mb.\n\nThe response from the API contains:\n\n* A couple of messages from the beginning of the text.\n* Statistics that reveal the most common values for all fields detected within the text and basic numeric statistics for numeric fields.\n* Information about the structure of the text, which is useful when you write ingest configurations to index it or similarly formatted text.\n* Appropriate mappings for an Elasticsearch index, which you could use to ingest the text.\n\nAll this information can be calculated by the structure finder with no guidance.\nHowever, you can optionally override some of the decisions about the text structure by specifying one or more query parameters.\n\n## Required authorization\n\n* Cluster privileges: `monitor_text_structure`\n" externalDocs: description: About finding text structure API url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/find-text-structure-examples x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/find-structure.html operationId: text-structure-find-structure parameters: - name: charset in: query description: "The text's character set.\nIt must be a character set that is supported by the JVM that Elasticsearch uses.\nFor example, `UTF-8`, `UTF-16LE`, `windows-1252`, or `EUC-JP`.\nIf this parameter is not specified, the structure finder chooses an appropriate character set." schema: type: string - name: column_names in: query description: "If you have set format to `delimited`, you can specify the column names in a comma-separated list.\nIf this parameter is not specified, the structure finder uses the column names from the header row of the text.\nIf the text does not have a header role, columns are named \"column1\", \"column2\", \"column3\", for example." schema: oneOf: - type: string - type: array items: type: string - name: delimiter in: query description: "If you have set `format` to `delimited`, you can specify the character used to delimit the values in each row.\nOnly a single character is supported; the delimiter cannot have multiple characters.\nBy default, the API considers the following possibilities: comma, tab, semi-colon, and pipe (`|`).\nIn this default scenario, all rows must have the same number of fields for the delimited format to be detected.\nIf you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row." schema: type: string - name: ecs_compatibility in: query description: "The mode of compatibility with ECS compliant Grok patterns.\nUse this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern.\nValid values are `disabled` and `v1`.\nThis setting primarily has an impact when a whole message Grok pattern such as `%{CATALINALOG}` matches the input.\nIf the structure finder identifies a common structure but has no idea of meaning then generic field names such as `path`, `ipaddress`, `field1`, and `field2` are used in the `grok_pattern` output, with the intention that a user who knows the meanings rename these fields before using it." schema: type: string default: disabled - name: explain in: query description: "If this parameter is set to `true`, the response includes a field named explanation, which is an array of strings that indicate how the structure finder produced its result.\nIf the structure finder produces unexpected results for some text, use this query parameter to help you determine why the returned structure was chosen." schema: type: boolean default: false - name: format in: query description: "The high level structure of the text.\nValid values are `ndjson`, `xml`, `delimited`, and `semi_structured_text`.\nBy default, the API chooses the format.\nIn this default scenario, all rows must have the same number of fields for a delimited format to be detected.\nIf the format is set to `delimited` and the delimiter is not set, however, the API tolerates up to 5% of rows that have a different number of columns than the first row." schema: $ref: '#/components/schemas/text_structure.find_structure.FindStructureFormat' - name: grok_pattern in: query description: "If you have set `format` to `semi_structured_text`, you can specify a Grok pattern that is used to extract fields from every message in the text.\nThe name of the timestamp field in the Grok pattern must match what is specified in the `timestamp_field` parameter.\nIf that parameter is not specified, the name of the timestamp field in the Grok pattern must match \"timestamp\".\nIf `grok_pattern` is not specified, the structure finder creates a Grok pattern." schema: $ref: '#/components/schemas/_types.GrokPattern' - name: has_header_row in: query description: "If you have set `format` to `delimited`, you can use this parameter to indicate whether the column names are in the first row of the text.\nIf this parameter is not specified, the structure finder guesses based on the similarity of the first row of the text to other rows." schema: type: boolean - name: line_merge_size_limit in: query description: "The maximum number of characters in a message when lines are merged to form messages while analyzing semi-structured text.\nIf you have extremely long messages you may need to increase this, but be aware that this may lead to very long processing times if the way to group lines into messages is misdetected." schema: allOf: - $ref: '#/components/schemas/_types.uint' default: 10000 - name: lines_to_sample in: query description: "The number of lines to include in the structural analysis, starting from the beginning of the text.\nThe minimum is 2.\nIf the value of this parameter is greater than the number of lines in the text, the analysis proceeds (as long as there are at least two lines in the text) for all of the lines.\n\nNOTE: The number of lines and the variation of the lines affects the speed of the analysis.\nFor example, if you upload text where the first 1000 lines are all variations on the same message, the analysis will find more commonality than would be seen with a bigger sample.\nIf possible, however, it is more efficient to upload sample text with more variety in the first 1000 lines than to request analysis of 100000 lines to achieve some variety." schema: allOf: - $ref: '#/components/schemas/_types.uint' default: 1000 - name: quote in: query description: "If you have set `format` to `delimited`, you can specify the character used to quote the values in each row if they contain newlines or the delimiter character.\nOnly a single character is supported.\nIf this parameter is not specified, the default value is a double quote (`\"`).\nIf your delimited text format does not use quoting, a workaround is to set this argument to a character that does not appear anywhere in the sample." schema: type: string - name: should_trim_fields in: query description: "If you have set `format` to `delimited`, you can specify whether values between delimiters should have whitespace trimmed from them.\nIf this parameter is not specified and the delimiter is pipe (`|`), the default value is `true`.\nOtherwise, the default value is `false`." schema: type: boolean - name: should_parse_recursively in: query description: "If the format is `ndjson`, you can specify whether to parse nested JSON objects recursively.\nThe nested objects are parsed to a maximum depth equal to the default value of the `index.mapping.depth.limit` setting.\nAnything beyond that depth is parsed as an `object` type field.\nFor formats other than `ndjson`, this parameter is ignored." schema: type: boolean default: false - name: timeout in: query description: "The maximum amount of time that the structure analysis can take.\nIf the analysis is still running when the timeout expires then it will be stopped." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 25s - name: timestamp_field in: query description: "The name of the field that contains the primary timestamp of each record in the text.\nIn particular, if the text were ingested into an index, this is the field that would be used to populate the `@timestamp` field.\n\nIf the `format` is `semi_structured_text`, this field must match the name of the appropriate extraction in the `grok_pattern`.\nTherefore, for semi-structured text, it is best not to specify this parameter unless `grok_pattern` is also specified.\n\nFor structured text, if you specify this parameter, the field must exist within the text.\n\nIf this parameter is not specified, the structure finder makes a decision about which field (if any) is the primary timestamp field.\nFor structured text, it is not compulsory to have a timestamp in the text." schema: $ref: '#/components/schemas/_types.Field' - name: timestamp_format in: query description: "The Java time format of the timestamp field in the text.\n\nOnly a subset of Java time format letter groups are supported:\n\n* `a`\n* `d`\n* `dd`\n* `EEE`\n* `EEEE`\n* `H`\n* `HH`\n* `h`\n* `M`\n* `MM`\n* `MMM`\n* `MMMM`\n* `mm`\n* `ss`\n* `XX`\n* `XXX`\n* `yy`\n* `yyyy`\n* `zzz`\n\nAdditionally `S` letter groups (fractional seconds) of length one to nine are supported providing they occur after `ss` and separated from the `ss` by a `.`, `,` or `:`.\nSpacing and punctuation is also permitted with the exception of `?`, newline and carriage return, together with literal text enclosed in single quotes.\nFor example, `MM/dd HH.mm.ss,SSSSSS 'in' yyyy` is a valid override format.\n\nOne valuable use case for this parameter is when the format is semi-structured text, there are multiple timestamp formats in the text, and you know which format corresponds to the primary timestamp, but you do not want to specify the full `grok_pattern`.\nAnother is when the timestamp format is one that the structure finder does not consider by default.\n\nIf this parameter is not specified, the structure finder chooses the best format from a built-in set.\n\nIf the special value `null` is specified the structure finder will not look for a primary timestamp in the text.\nWhen the format is semi-structured text this will result in the structure finder treating the text as single-line messages." schema: type: string requestBody: content: application/json: schema: type: array items: type: object examples: FindStructureRequestExample1: description: Run `POST _text_structure/find_structure` to analyze newline-delimited JSON text. value: "{\"name\": \"Leviathan Wakes\", \"author\": \"James S.A. Corey\", \"release_date\": \"2011-06-02\", \"page_count\": 561}\n{\"name\": \"Hyperion\", \"author\": \"Dan Simmons\", \"release_date\": \"1989-05-26\", \"page_count\": 482}\n{\"name\": \"Dune\", \"author\": \"Frank Herbert\", \"release_date\": \"1965-06-01\", \"page_count\": 604}\n{\"name\": \"Dune Messiah\", \"author\": \"Frank Herbert\", \"release_date\": \"1969-10-15\", \"page_count\": 331}\n{\"name\": \"Children of Dune\", \"author\": \"Frank Herbert\", \"release_date\": \"1976-04-21\", \"page_count\": 408}\n{\"name\": \"God Emperor of Dune\", \"author\": \"Frank Herbert\", \"release_date\": \"1981-05-28\", \"page_count\": 454}\n{\"name\": \"Consider Phlebas\", \"author\": \"Iain M. Banks\", \"release_date\": \"1987-04-23\", \"page_count\": 471}\n{\"name\": \"Pandora's Star\", \"author\": \"Peter F. Hamilton\", \"release_date\": \"2004-03-02\", \"page_count\": 768}\n{\"name\": \"Revelation Space\", \"author\": \"Alastair Reynolds\", \"release_date\": \"2000-03-15\", \"page_count\": 585}\n{\"name\": \"A Fire Upon the Deep\", \"author\": \"Vernor Vinge\", \"release_date\": \"1992-06-01\", \"page_count\": 613}\n{\"name\": \"Ender's Game\", \"author\": \"Orson Scott Card\", \"release_date\": \"1985-06-01\", \"page_count\": 324}\n{\"name\": \"1984\", \"author\": \"George Orwell\", \"release_date\": \"1985-06-01\", \"page_count\": 328}\n{\"name\": \"Fahrenheit 451\", \"author\": \"Ray Bradbury\", \"release_date\": \"1953-10-15\", \"page_count\": 227}\n{\"name\": \"Brave New World\", \"author\": \"Aldous Huxley\", \"release_date\": \"1932-06-01\", \"page_count\": 268}\n{\"name\": \"Foundation\", \"author\": \"Isaac Asimov\", \"release_date\": \"1951-06-01\", \"page_count\": 224}\n{\"name\": \"The Giver\", \"author\": \"Lois Lowry\", \"release_date\": \"1993-04-26\", \"page_count\": 208}\n{\"name\": \"Slaughterhouse-Five\", \"author\": \"Kurt Vonnegut\", \"release_date\": \"1969-06-01\", \"page_count\": 275}\n{\"name\": \"The Hitchhiker's Guide to the Galaxy\", \"author\": \"Douglas Adams\", \"release_date\": \"1979-10-12\", \"page_count\": 180}\n{\"name\": \"Snow Crash\", \"author\": \"Neal Stephenson\", \"release_date\": \"1992-06-01\", \"page_count\": 470}\n{\"name\": \"Neuromancer\", \"author\": \"William Gibson\", \"release_date\": \"1984-07-01\", \"page_count\": 271}\n{\"name\": \"The Handmaid's Tale\", \"author\": \"Margaret Atwood\", \"release_date\": \"1985-06-01\", \"page_count\": 311}\n{\"name\": \"Starship Troopers\", \"author\": \"Robert A. Heinlein\", \"release_date\": \"1959-12-01\", \"page_count\": 335}\n{\"name\": \"The Left Hand of Darkness\", \"author\": \"Ursula K. Le Guin\", \"release_date\": \"1969-06-01\", \"page_count\": 304}\n{\"name\": \"The Moon is a Harsh Mistress\", \"author\": \"Robert A. Heinlein\", \"release_date\": \"1966-04-01\", \"page_count\": 288}" x-codeSamples: - lang: Console source: "POST _text_structure/find_structure\n{\"name\": \"Leviathan Wakes\", \"author\": \"James S.A. Corey\", \"release_date\": \"2011-06-02\", \"page_count\": 561}\n{\"name\": \"Hyperion\", \"author\": \"Dan Simmons\", \"release_date\": \"1989-05-26\", \"page_count\": 482}\n{\"name\": \"Dune\", \"author\": \"Frank Herbert\", \"release_date\": \"1965-06-01\", \"page_count\": 604}\n{\"name\": \"Dune Messiah\", \"author\": \"Frank Herbert\", \"release_date\": \"1969-10-15\", \"page_count\": 331}\n{\"name\": \"Children of Dune\", \"author\": \"Frank Herbert\", \"release_date\": \"1976-04-21\", \"page_count\": 408}\n{\"name\": \"God Emperor of Dune\", \"author\": \"Frank Herbert\", \"release_date\": \"1981-05-28\", \"page_count\": 454}\n{\"name\": \"Consider Phlebas\", \"author\": \"Iain M. Banks\", \"release_date\": \"1987-04-23\", \"page_count\": 471}\n{\"name\": \"Pandora's Star\", \"author\": \"Peter F. Hamilton\", \"release_date\": \"2004-03-02\", \"page_count\": 768}\n{\"name\": \"Revelation Space\", \"author\": \"Alastair Reynolds\", \"release_date\": \"2000-03-15\", \"page_count\": 585}\n{\"name\": \"A Fire Upon the Deep\", \"author\": \"Vernor Vinge\", \"release_date\": \"1992-06-01\", \"page_count\": 613}\n{\"name\": \"Ender's Game\", \"author\": \"Orson Scott Card\", \"release_date\": \"1985-06-01\", \"page_count\": 324}\n{\"name\": \"1984\", \"author\": \"George Orwell\", \"release_date\": \"1985-06-01\", \"page_count\": 328}\n{\"name\": \"Fahrenheit 451\", \"author\": \"Ray Bradbury\", \"release_date\": \"1953-10-15\", \"page_count\": 227}\n{\"name\": \"Brave New World\", \"author\": \"Aldous Huxley\", \"release_date\": \"1932-06-01\", \"page_count\": 268}\n{\"name\": \"Foundation\", \"author\": \"Isaac Asimov\", \"release_date\": \"1951-06-01\", \"page_count\": 224}\n{\"name\": \"The Giver\", \"author\": \"Lois Lowry\", \"release_date\": \"1993-04-26\", \"page_count\": 208}\n{\"name\": \"Slaughterhouse-Five\", \"author\": \"Kurt Vonnegut\", \"release_date\": \"1969-06-01\", \"page_count\": 275}\n{\"name\": \"The Hitchhiker's Guide to the Galaxy\", \"author\": \"Douglas Adams\", \"release_date\": \"1979-10-12\", \"page_count\": 180}\n{\"name\": \"Snow Crash\", \"author\": \"Neal Stephenson\", \"release_date\": \"1992-06-01\", \"page_count\": 470}\n{\"name\": \"Neuromancer\", \"author\": \"William Gibson\", \"release_date\": \"1984-07-01\", \"page_count\": 271}\n{\"name\": \"The Handmaid's Tale\", \"author\": \"Margaret Atwood\", \"release_date\": \"1985-06-01\", \"page_count\": 311}\n{\"name\": \"Starship Troopers\", \"author\": \"Robert A. Heinlein\", \"release_date\": \"1959-12-01\", \"page_count\": 335}\n{\"name\": \"The Left Hand of Darkness\", \"author\": \"Ursula K. Le Guin\", \"release_date\": \"1969-06-01\", \"page_count\": 304}\n{\"name\": \"The Moon is a Harsh Mistress\", \"author\": \"Robert A. Heinlein\", \"release_date\": \"1966-04-01\", \"page_count\": 288}" - lang: Python source: "resp = client.text_structure.find_structure(\n text_files=[\n {\n \"name\": \"Leviathan Wakes\",\n \"author\": \"James S.A. Corey\",\n \"release_date\": \"2011-06-02\",\n \"page_count\": 561\n },\n {\n \"name\": \"Hyperion\",\n \"author\": \"Dan Simmons\",\n \"release_date\": \"1989-05-26\",\n \"page_count\": 482\n },\n {\n \"name\": \"Dune\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1965-06-01\",\n \"page_count\": 604\n },\n {\n \"name\": \"Dune Messiah\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1969-10-15\",\n \"page_count\": 331\n },\n {\n \"name\": \"Children of Dune\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1976-04-21\",\n \"page_count\": 408\n },\n {\n \"name\": \"God Emperor of Dune\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1981-05-28\",\n \"page_count\": 454\n },\n {\n \"name\": \"Consider Phlebas\",\n \"author\": \"Iain M. Banks\",\n \"release_date\": \"1987-04-23\",\n \"page_count\": 471\n },\n {\n \"name\": \"Pandora's Star\",\n \"author\": \"Peter F. Hamilton\",\n \"release_date\": \"2004-03-02\",\n \"page_count\": 768\n },\n {\n \"name\": \"Revelation Space\",\n \"author\": \"Alastair Reynolds\",\n \"release_date\": \"2000-03-15\",\n \"page_count\": 585\n },\n {\n \"name\": \"A Fire Upon the Deep\",\n \"author\": \"Vernor Vinge\",\n \"release_date\": \"1992-06-01\",\n \"page_count\": 613\n },\n {\n \"name\": \"Ender's Game\",\n \"author\": \"Orson Scott Card\",\n \"release_date\": \"1985-06-01\",\n \"page_count\": 324\n },\n {\n \"name\": \"1984\",\n \"author\": \"George Orwell\",\n \"release_date\": \"1985-06-01\",\n \"page_count\": 328\n },\n {\n \"name\": \"Fahrenheit 451\",\n \"author\": \"Ray Bradbury\",\n \"release_date\": \"1953-10-15\",\n \"page_count\": 227\n },\n {\n \"name\": \"Brave New World\",\n \"author\": \"Aldous Huxley\",\n \"release_date\": \"1932-06-01\",\n \"page_count\": 268\n },\n {\n \"name\": \"Foundation\",\n \"author\": \"Isaac Asimov\",\n \"release_date\": \"1951-06-01\",\n \"page_count\": 224\n },\n {\n \"name\": \"The Giver\",\n \"author\": \"Lois Lowry\",\n \"release_date\": \"1993-04-26\",\n \"page_count\": 208\n },\n {\n \"name\": \"Slaughterhouse-Five\",\n \"author\": \"Kurt Vonnegut\",\n \"release_date\": \"1969-06-01\",\n \"page_count\": 275\n },\n {\n \"name\": \"The Hitchhiker's Guide to the Galaxy\",\n \"author\": \"Douglas Adams\",\n \"release_date\": \"1979-10-12\",\n \"page_count\": 180\n },\n {\n \"name\": \"Snow Crash\",\n \"author\": \"Neal Stephenson\",\n \"release_date\": \"1992-06-01\",\n \"page_count\": 470\n },\n {\n \"name\": \"Neuromancer\",\n \"author\": \"William Gibson\",\n \"release_date\": \"1984-07-01\",\n \"page_count\": 271\n },\n {\n \"name\": \"The Handmaid's Tale\",\n \"author\": \"Margaret Atwood\",\n \"release_date\": \"1985-06-01\",\n \"page_count\": 311\n },\n {\n \"name\": \"Starship Troopers\",\n \"author\": \"Robert A. Heinlein\",\n \"release_date\": \"1959-12-01\",\n \"page_count\": 335\n },\n {\n \"name\": \"The Left Hand of Darkness\",\n \"author\": \"Ursula K. Le Guin\",\n \"release_date\": \"1969-06-01\",\n \"page_count\": 304\n },\n {\n \"name\": \"The Moon is a Harsh Mistress\",\n \"author\": \"Robert A. Heinlein\",\n \"release_date\": \"1966-04-01\",\n \"page_count\": 288\n }\n ],\n)" - lang: JavaScript source: "const response = await client.textStructure.findStructure({\n text_files: [\n {\n name: \"Leviathan Wakes\",\n author: \"James S.A. Corey\",\n release_date: \"2011-06-02\",\n page_count: 561,\n },\n {\n name: \"Hyperion\",\n author: \"Dan Simmons\",\n release_date: \"1989-05-26\",\n page_count: 482,\n },\n {\n name: \"Dune\",\n author: \"Frank Herbert\",\n release_date: \"1965-06-01\",\n page_count: 604,\n },\n {\n name: \"Dune Messiah\",\n author: \"Frank Herbert\",\n release_date: \"1969-10-15\",\n page_count: 331,\n },\n {\n name: \"Children of Dune\",\n author: \"Frank Herbert\",\n release_date: \"1976-04-21\",\n page_count: 408,\n },\n {\n name: \"God Emperor of Dune\",\n author: \"Frank Herbert\",\n release_date: \"1981-05-28\",\n page_count: 454,\n },\n {\n name: \"Consider Phlebas\",\n author: \"Iain M. Banks\",\n release_date: \"1987-04-23\",\n page_count: 471,\n },\n {\n name: \"Pandora's Star\",\n author: \"Peter F. Hamilton\",\n release_date: \"2004-03-02\",\n page_count: 768,\n },\n {\n name: \"Revelation Space\",\n author: \"Alastair Reynolds\",\n release_date: \"2000-03-15\",\n page_count: 585,\n },\n {\n name: \"A Fire Upon the Deep\",\n author: \"Vernor Vinge\",\n release_date: \"1992-06-01\",\n page_count: 613,\n },\n {\n name: \"Ender's Game\",\n author: \"Orson Scott Card\",\n release_date: \"1985-06-01\",\n page_count: 324,\n },\n {\n name: \"1984\",\n author: \"George Orwell\",\n release_date: \"1985-06-01\",\n page_count: 328,\n },\n {\n name: \"Fahrenheit 451\",\n author: \"Ray Bradbury\",\n release_date: \"1953-10-15\",\n page_count: 227,\n },\n {\n name: \"Brave New World\",\n author: \"Aldous Huxley\",\n release_date: \"1932-06-01\",\n page_count: 268,\n },\n {\n name: \"Foundation\",\n author: \"Isaac Asimov\",\n release_date: \"1951-06-01\",\n page_count: 224,\n },\n {\n name: \"The Giver\",\n author: \"Lois Lowry\",\n release_date: \"1993-04-26\",\n page_count: 208,\n },\n {\n name: \"Slaughterhouse-Five\",\n author: \"Kurt Vonnegut\",\n release_date: \"1969-06-01\",\n page_count: 275,\n },\n {\n name: \"The Hitchhiker's Guide to the Galaxy\",\n author: \"Douglas Adams\",\n release_date: \"1979-10-12\",\n page_count: 180,\n },\n {\n name: \"Snow Crash\",\n author: \"Neal Stephenson\",\n release_date: \"1992-06-01\",\n page_count: 470,\n },\n {\n name: \"Neuromancer\",\n author: \"William Gibson\",\n release_date: \"1984-07-01\",\n page_count: 271,\n },\n {\n name: \"The Handmaid's Tale\",\n author: \"Margaret Atwood\",\n release_date: \"1985-06-01\",\n page_count: 311,\n },\n {\n name: \"Starship Troopers\",\n author: \"Robert A. Heinlein\",\n release_date: \"1959-12-01\",\n page_count: 335,\n },\n {\n name: \"The Left Hand of Darkness\",\n author: \"Ursula K. Le Guin\",\n release_date: \"1969-06-01\",\n page_count: 304,\n },\n {\n name: \"The Moon is a Harsh Mistress\",\n author: \"Robert A. Heinlein\",\n release_date: \"1966-04-01\",\n page_count: 288,\n },\n ],\n});" - lang: Ruby source: "response = client.text_structure.find_structure(\n body: [\n {\n \"name\": \"Leviathan Wakes\",\n \"author\": \"James S.A. Corey\",\n \"release_date\": \"2011-06-02\",\n \"page_count\": 561\n },\n {\n \"name\": \"Hyperion\",\n \"author\": \"Dan Simmons\",\n \"release_date\": \"1989-05-26\",\n \"page_count\": 482\n },\n {\n \"name\": \"Dune\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1965-06-01\",\n \"page_count\": 604\n },\n {\n \"name\": \"Dune Messiah\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1969-10-15\",\n \"page_count\": 331\n },\n {\n \"name\": \"Children of Dune\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1976-04-21\",\n \"page_count\": 408\n },\n {\n \"name\": \"God Emperor of Dune\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1981-05-28\",\n \"page_count\": 454\n },\n {\n \"name\": \"Consider Phlebas\",\n \"author\": \"Iain M. Banks\",\n \"release_date\": \"1987-04-23\",\n \"page_count\": 471\n },\n {\n \"name\": \"Pandora's Star\",\n \"author\": \"Peter F. Hamilton\",\n \"release_date\": \"2004-03-02\",\n \"page_count\": 768\n },\n {\n \"name\": \"Revelation Space\",\n \"author\": \"Alastair Reynolds\",\n \"release_date\": \"2000-03-15\",\n \"page_count\": 585\n },\n {\n \"name\": \"A Fire Upon the Deep\",\n \"author\": \"Vernor Vinge\",\n \"release_date\": \"1992-06-01\",\n \"page_count\": 613\n },\n {\n \"name\": \"Ender's Game\",\n \"author\": \"Orson Scott Card\",\n \"release_date\": \"1985-06-01\",\n \"page_count\": 324\n },\n {\n \"name\": \"1984\",\n \"author\": \"George Orwell\",\n \"release_date\": \"1985-06-01\",\n \"page_count\": 328\n },\n {\n \"name\": \"Fahrenheit 451\",\n \"author\": \"Ray Bradbury\",\n \"release_date\": \"1953-10-15\",\n \"page_count\": 227\n },\n {\n \"name\": \"Brave New World\",\n \"author\": \"Aldous Huxley\",\n \"release_date\": \"1932-06-01\",\n \"page_count\": 268\n },\n {\n \"name\": \"Foundation\",\n \"author\": \"Isaac Asimov\",\n \"release_date\": \"1951-06-01\",\n \"page_count\": 224\n },\n {\n \"name\": \"The Giver\",\n \"author\": \"Lois Lowry\",\n \"release_date\": \"1993-04-26\",\n \"page_count\": 208\n },\n {\n \"name\": \"Slaughterhouse-Five\",\n \"author\": \"Kurt Vonnegut\",\n \"release_date\": \"1969-06-01\",\n \"page_count\": 275\n },\n {\n \"name\": \"The Hitchhiker's Guide to the Galaxy\",\n \"author\": \"Douglas Adams\",\n \"release_date\": \"1979-10-12\",\n \"page_count\": 180\n },\n {\n \"name\": \"Snow Crash\",\n \"author\": \"Neal Stephenson\",\n \"release_date\": \"1992-06-01\",\n \"page_count\": 470\n },\n {\n \"name\": \"Neuromancer\",\n \"author\": \"William Gibson\",\n \"release_date\": \"1984-07-01\",\n \"page_count\": 271\n },\n {\n \"name\": \"The Handmaid's Tale\",\n \"author\": \"Margaret Atwood\",\n \"release_date\": \"1985-06-01\",\n \"page_count\": 311\n },\n {\n \"name\": \"Starship Troopers\",\n \"author\": \"Robert A. Heinlein\",\n \"release_date\": \"1959-12-01\",\n \"page_count\": 335\n },\n {\n \"name\": \"The Left Hand of Darkness\",\n \"author\": \"Ursula K. Le Guin\",\n \"release_date\": \"1969-06-01\",\n \"page_count\": 304\n },\n {\n \"name\": \"The Moon is a Harsh Mistress\",\n \"author\": \"Robert A. Heinlein\",\n \"release_date\": \"1966-04-01\",\n \"page_count\": 288\n }\n ]\n)" - lang: PHP source: "$resp = $client->textStructure()->findStructure([\n \"body\" => array(\n [\n \"name\" => \"Leviathan Wakes\",\n \"author\" => \"James S.A. Corey\",\n \"release_date\" => \"2011-06-02\",\n \"page_count\" => 561,\n ],\n [\n \"name\" => \"Hyperion\",\n \"author\" => \"Dan Simmons\",\n \"release_date\" => \"1989-05-26\",\n \"page_count\" => 482,\n ],\n [\n \"name\" => \"Dune\",\n \"author\" => \"Frank Herbert\",\n \"release_date\" => \"1965-06-01\",\n \"page_count\" => 604,\n ],\n [\n \"name\" => \"Dune Messiah\",\n \"author\" => \"Frank Herbert\",\n \"release_date\" => \"1969-10-15\",\n \"page_count\" => 331,\n ],\n [\n \"name\" => \"Children of Dune\",\n \"author\" => \"Frank Herbert\",\n \"release_date\" => \"1976-04-21\",\n \"page_count\" => 408,\n ],\n [\n \"name\" => \"God Emperor of Dune\",\n \"author\" => \"Frank Herbert\",\n \"release_date\" => \"1981-05-28\",\n \"page_count\" => 454,\n ],\n [\n \"name\" => \"Consider Phlebas\",\n \"author\" => \"Iain M. Banks\",\n \"release_date\" => \"1987-04-23\",\n \"page_count\" => 471,\n ],\n [\n \"name\" => \"Pandora's Star\",\n \"author\" => \"Peter F. Hamilton\",\n \"release_date\" => \"2004-03-02\",\n \"page_count\" => 768,\n ],\n [\n \"name\" => \"Revelation Space\",\n \"author\" => \"Alastair Reynolds\",\n \"release_date\" => \"2000-03-15\",\n \"page_count\" => 585,\n ],\n [\n \"name\" => \"A Fire Upon the Deep\",\n \"author\" => \"Vernor Vinge\",\n \"release_date\" => \"1992-06-01\",\n \"page_count\" => 613,\n ],\n [\n \"name\" => \"Ender's Game\",\n \"author\" => \"Orson Scott Card\",\n \"release_date\" => \"1985-06-01\",\n \"page_count\" => 324,\n ],\n [\n \"name\" => \"1984\",\n \"author\" => \"George Orwell\",\n \"release_date\" => \"1985-06-01\",\n \"page_count\" => 328,\n ],\n [\n \"name\" => \"Fahrenheit 451\",\n \"author\" => \"Ray Bradbury\",\n \"release_date\" => \"1953-10-15\",\n \"page_count\" => 227,\n ],\n [\n \"name\" => \"Brave New World\",\n \"author\" => \"Aldous Huxley\",\n \"release_date\" => \"1932-06-01\",\n \"page_count\" => 268,\n ],\n [\n \"name\" => \"Foundation\",\n \"author\" => \"Isaac Asimov\",\n \"release_date\" => \"1951-06-01\",\n \"page_count\" => 224,\n ],\n [\n \"name\" => \"The Giver\",\n \"author\" => \"Lois Lowry\",\n \"release_date\" => \"1993-04-26\",\n \"page_count\" => 208,\n ],\n [\n \"name\" => \"Slaughterhouse-Five\",\n \"author\" => \"Kurt Vonnegut\",\n \"release_date\" => \"1969-06-01\",\n \"page_count\" => 275,\n ],\n [\n \"name\" => \"The Hitchhiker's Guide to the Galaxy\",\n \"author\" => \"Douglas Adams\",\n \"release_date\" => \"1979-10-12\",\n \"page_count\" => 180,\n ],\n [\n \"name\" => \"Snow Crash\",\n \"author\" => \"Neal Stephenson\",\n \"release_date\" => \"1992-06-01\",\n \"page_count\" => 470,\n ],\n [\n \"name\" => \"Neuromancer\",\n \"author\" => \"William Gibson\",\n \"release_date\" => \"1984-07-01\",\n \"page_count\" => 271,\n ],\n [\n \"name\" => \"The Handmaid's Tale\",\n \"author\" => \"Margaret Atwood\",\n \"release_date\" => \"1985-06-01\",\n \"page_count\" => 311,\n ],\n [\n \"name\" => \"Starship Troopers\",\n \"author\" => \"Robert A. Heinlein\",\n \"release_date\" => \"1959-12-01\",\n \"page_count\" => 335,\n ],\n [\n \"name\" => \"The Left Hand of Darkness\",\n \"author\" => \"Ursula K. Le Guin\",\n \"release_date\" => \"1969-06-01\",\n \"page_count\" => 304,\n ],\n [\n \"name\" => \"The Moon is a Harsh Mistress\",\n \"author\" => \"Robert A. Heinlein\",\n \"release_date\" => \"1966-04-01\",\n \"page_count\" => 288,\n ],\n ),\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/x-ndjson" -d $''{"name":"Leviathan Wakes","author":"James S.A. Corey","release_date":"2011-06-02","page_count":561}\n{"name":"Hyperion","author":"Dan Simmons","release_date":"1989-05-26","page_count":482}\n{"name":"Dune","author":"Frank Herbert","release_date":"1965-06-01","page_count":604}\n{"name":"Dune Messiah","author":"Frank Herbert","release_date":"1969-10-15","page_count":331}\n{"name":"Children of Dune","author":"Frank Herbert","release_date":"1976-04-21","page_count":408}\n{"name":"God Emperor of Dune","author":"Frank Herbert","release_date":"1981-05-28","page_count":454}\n{"name":"Consider Phlebas","author":"Iain M. Banks","release_date":"1987-04-23","page_count":471}\n{"name":"Pandora''"''"$''s Star","author":"Peter F. Hamilton","release_date":"2004-03-02","page_count":768}\n{"name":"Revelation Space","author":"Alastair Reynolds","release_date":"2000-03-15","page_count":585}\n{"name":"A Fire Upon the Deep","author":"Vernor Vinge","release_date":"1992-06-01","page_count":613}\n{"name":"Ender''"''"$''s Game","author":"Orson Scott Card","release_date":"1985-06-01","page_count":324}\n{"name":"1984","author":"George Orwell","release_date":"1985-06-01","page_count":328}\n{"name":"Fahrenheit 451","author":"Ray Bradbury","release_date":"1953-10-15","page_count":227}\n{"name":"Brave New World","author":"Aldous Huxley","release_date":"1932-06-01","page_count":268}\n{"name":"Foundation","author":"Isaac Asimov","release_date":"1951-06-01","page_count":224}\n{"name":"The Giver","author":"Lois Lowry","release_date":"1993-04-26","page_count":208}\n{"name":"Slaughterhouse-Five","author":"Kurt Vonnegut","release_date":"1969-06-01","page_count":275}\n{"name":"The Hitchhiker''"''"$''s Guide to the Galaxy","author":"Douglas Adams","release_date":"1979-10-12","page_count":180}\n{"name":"Snow Crash","author":"Neal Stephenson","release_date":"1992-06-01","page_count":470}\n{"name":"Neuromancer","author":"William Gibson","release_date":"1984-07-01","page_count":271}\n{"name":"The Handmaid''"''"$''s Tale","author":"Margaret Atwood","release_date":"1985-06-01","page_count":311}\n{"name":"Starship Troopers","author":"Robert A. Heinlein","release_date":"1959-12-01","page_count":335}\n{"name":"The Left Hand of Darkness","author":"Ursula K. Le Guin","release_date":"1969-06-01","page_count":304}\n{"name":"The Moon is a Harsh Mistress","author":"Robert A. Heinlein","release_date":"1966-04-01","page_count":288}\n'' "$ELASTICSEARCH_URL/_text_structure/find_structure"' required: true responses: '200': description: '' content: application/json: schema: required: - charset - has_byte_order_marker - format - field_stats - sample_start - num_messages_analyzed - mappings - need_client_timezone - num_lines_analyzed - ingest_pipeline type: object properties: charset: type: string description: The character encoding used to parse the text. has_header_row: type: boolean has_byte_order_marker: type: boolean description: 'For UTF character encodings, it indicates whether the text begins with a byte order marker.' format: type: string description: 'Valid values include `ndjson`, `xml`, `delimited`, and `semi_structured_text`.' field_stats: type: object additionalProperties: $ref: '#/components/schemas/text_structure._types.FieldStat' description: "The most common values of each field, plus basic numeric statistics for the numeric `page_count` field.\nThis information may provide clues that the data needs to be cleaned or transformed prior to use by other Elastic Stack functionality." sample_start: type: string description: "The first two messages in the text verbatim.\nThis may help diagnose parse errors or accidental uploads of the wrong text." num_messages_analyzed: type: number description: "The number of distinct messages the lines contained.\nFor NDJSON, this value is the same as `num_lines_analyzed`.\nFor other text formats, messages can span several lines." mappings: allOf: - $ref: '#/components/schemas/_types.mapping.TypeMapping' description: Some suitable mappings for an index into which the data could be ingested. quote: type: string delimiter: type: string need_client_timezone: type: boolean description: "If a timestamp format is detected that does not include a timezone, `need_client_timezone` is `true`.\nThe server that parses the text must therefore be told the correct timezone by the client." num_lines_analyzed: type: number description: The number of lines of the text that were analyzed. column_names: type: array items: type: string description: 'If `format` is `delimited`, the `column_names` field lists the column names in the order they appear in the sample.' explanation: type: array items: type: string grok_pattern: allOf: - $ref: '#/components/schemas/_types.GrokPattern' multiline_start_pattern: type: string exclude_lines_pattern: type: string java_timestamp_formats: type: array items: type: string description: "The Java time formats recognized in the time fields.\nElasticsearch mappings and ingest pipelines use this format." joda_timestamp_formats: type: array items: type: string description: Information that is used to tell Logstash how to parse timestamps. timestamp_field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field considered most likely to be the primary timestamp of each document. should_trim_fields: type: boolean ingest_pipeline: allOf: - $ref: '#/components/schemas/ingest._types.PipelineConfig' examples: FindStructureResponseExample1: description: A successful response from `POST _text_structure/find_structure`. value: "{\n \"num_lines_analyzed\" : 24,\n \"num_messages_analyzed\" : 24,\n \"sample_start\" : \"{\\\"name\\\": \\\"Leviathan Wakes\\\", \\\"author\\\": \\\"James S.A. Corey\\\", \\\"release_date\\\": \\\"2011-06-02\\\", \\\"page_count\\\": 561}\\n{\\\"name\\\": \\\"Hyperion\\\", \\\"author\\\": \\\"Dan Simmons\\\", \\\"release_date\\\": \\\"1989-05-26\\\", \\\"page_count\\\": 482}\\n\",\n \"charset\" : \"UTF-8\",\n \"has_byte_order_marker\" : false,\n \"format\" : \"ndjson\",\n \"ecs_compatibility\" : \"disabled\",\n \"timestamp_field\" : \"release_date\",\n \"joda_timestamp_formats\" : [\n \"ISO8601\"\n ],\n \"java_timestamp_formats\" : [\n \"ISO8601\"\n ],\n \"need_client_timezone\" : true,\n \"mappings\" : {\n \"properties\" : {\n \"@timestamp\" : {\n \"type\" : \"date\"\n },\n \"author\" : {\n \"type\" : \"keyword\"\n },\n \"name\" : {\n \"type\" : \"keyword\"\n },\n \"page_count\" : {\n \"type\" : \"long\"\n },\n \"release_date\" : {\n \"type\" : \"date\",\n \"format\" : \"iso8601\"\n }\n }\n },\n \"ingest_pipeline\" : {\n \"description\" : \"Ingest pipeline created by text structure finder\",\n \"processors\" : [\n {\n \"date\" : {\n \"field\" : \"release_date\",\n \"timezone\" : \"{{ event.timezone }}\",\n \"formats\" : [\n \"ISO8601\"\n ]\n }\n }\n ]\n },\n \"field_stats\" : {\n \"author\" : {\n \"count\" : 24,\n \"cardinality\" : 20,\n \"top_hits\" : [\n {\n \"value\" : \"Frank Herbert\",\n \"count\" : 4\n },\n {\n \"value\" : \"Robert A. Heinlein\",\n \"count\" : 2\n },\n {\n \"value\" : \"Alastair Reynolds\",\n \"count\" : 1\n },\n {\n \"value\" : \"Aldous Huxley\",\n \"count\" : 1\n },\n {\n \"value\" : \"Dan Simmons\",\n \"count\" : 1\n },\n {\n \"value\" : \"Douglas Adams\",\n \"count\" : 1\n },\n {\n \"value\" : \"George Orwell\",\n \"count\" : 1\n },\n {\n \"value\" : \"Iain M. Banks\",\n \"count\" : 1\n },\n {\n \"value\" : \"Isaac Asimov\",\n \"count\" : 1\n },\n {\n \"value\" : \"James S.A. Corey\",\n \"count\" : 1\n }\n ]\n },\n \"name\" : {\n \"count\" : 24,\n \"cardinality\" : 24,\n \"top_hits\" : [\n {\n \"value\" : \"1984\",\n \"count\" : 1\n },\n {\n \"value\" : \"A Fire Upon the Deep\",\n \"count\" : 1\n },\n {\n \"value\" : \"Brave New World\",\n \"count\" : 1\n },\n {\n \"value\" : \"Children of Dune\",\n \"count\" : 1\n },\n {\n \"value\" : \"Consider Phlebas\",\n \"count\" : 1\n },\n {\n \"value\" : \"Dune\",\n \"count\" : 1\n },\n {\n \"value\" : \"Dune Messiah\",\n \"count\" : 1\n },\n {\n \"value\" : \"Ender's Game\",\n \"count\" : 1\n },\n {\n \"value\" : \"Fahrenheit 451\",\n \"count\" : 1\n },\n {\n \"value\" : \"Foundation\",\n \"count\" : 1\n }\n ]\n },\n \"page_count\" : {\n \"count\" : 24,\n \"cardinality\" : 24,\n \"min_value\" : 180,\n \"max_value\" : 768,\n \"mean_value\" : 387.0833333333333,\n \"median_value\" : 329.5,\n \"top_hits\" : [\n {\n \"value\" : 180,\n \"count\" : 1\n },\n {\n \"value\" : 208,\n \"count\" : 1\n },\n {\n \"value\" : 224,\n \"count\" : 1\n },\n {\n \"value\" : 227,\n \"count\" : 1\n },\n {\n \"value\" : 268,\n \"count\" : 1\n },\n {\n \"value\" : 271,\n \"count\" : 1\n },\n {\n \"value\" : 275,\n \"count\" : 1\n },\n {\n \"value\" : 288,\n \"count\" : 1\n },\n {\n \"value\" : 304,\n \"count\" : 1\n },\n {\n \"value\" : 311,\n \"count\" : 1\n }\n ]\n },\n \"release_date\" : {\n \"count\" : 24,\n \"cardinality\" : 20,\n \"earliest\" : \"1932-06-01\",\n \"latest\" : \"2011-06-02\",\n \"top_hits\" : [\n {\n \"value\" : \"1985-06-01\",\n \"count\" : 3\n },\n {\n \"value\" : \"1969-06-01\",\n \"count\" : 2\n },\n {\n \"value\" : \"1992-06-01\",\n \"count\" : 2\n },\n {\n \"value\" : \"1932-06-01\",\n \"count\" : 1\n },\n {\n \"value\" : \"1951-06-01\",\n \"count\" : 1\n },\n {\n \"value\" : \"1953-10-15\",\n \"count\" : 1\n },\n {\n \"value\" : \"1959-12-01\",\n \"count\" : 1\n },\n {\n \"value\" : \"1965-06-01\",\n \"count\" : 1\n },\n {\n \"value\" : \"1966-04-01\",\n \"count\" : 1\n },\n {\n \"value\" : \"1969-10-15\",\n \"count\" : 1\n }\n ]\n }\n }\n}" x-state: Generally available; Added in 7.13.0 x-codeSamples: - lang: Console source: "POST _text_structure/find_structure\n{\"name\": \"Leviathan Wakes\", \"author\": \"James S.A. Corey\", \"release_date\": \"2011-06-02\", \"page_count\": 561}\n{\"name\": \"Hyperion\", \"author\": \"Dan Simmons\", \"release_date\": \"1989-05-26\", \"page_count\": 482}\n{\"name\": \"Dune\", \"author\": \"Frank Herbert\", \"release_date\": \"1965-06-01\", \"page_count\": 604}\n{\"name\": \"Dune Messiah\", \"author\": \"Frank Herbert\", \"release_date\": \"1969-10-15\", \"page_count\": 331}\n{\"name\": \"Children of Dune\", \"author\": \"Frank Herbert\", \"release_date\": \"1976-04-21\", \"page_count\": 408}\n{\"name\": \"God Emperor of Dune\", \"author\": \"Frank Herbert\", \"release_date\": \"1981-05-28\", \"page_count\": 454}\n{\"name\": \"Consider Phlebas\", \"author\": \"Iain M. Banks\", \"release_date\": \"1987-04-23\", \"page_count\": 471}\n{\"name\": \"Pandora's Star\", \"author\": \"Peter F. Hamilton\", \"release_date\": \"2004-03-02\", \"page_count\": 768}\n{\"name\": \"Revelation Space\", \"author\": \"Alastair Reynolds\", \"release_date\": \"2000-03-15\", \"page_count\": 585}\n{\"name\": \"A Fire Upon the Deep\", \"author\": \"Vernor Vinge\", \"release_date\": \"1992-06-01\", \"page_count\": 613}\n{\"name\": \"Ender's Game\", \"author\": \"Orson Scott Card\", \"release_date\": \"1985-06-01\", \"page_count\": 324}\n{\"name\": \"1984\", \"author\": \"George Orwell\", \"release_date\": \"1985-06-01\", \"page_count\": 328}\n{\"name\": \"Fahrenheit 451\", \"author\": \"Ray Bradbury\", \"release_date\": \"1953-10-15\", \"page_count\": 227}\n{\"name\": \"Brave New World\", \"author\": \"Aldous Huxley\", \"release_date\": \"1932-06-01\", \"page_count\": 268}\n{\"name\": \"Foundation\", \"author\": \"Isaac Asimov\", \"release_date\": \"1951-06-01\", \"page_count\": 224}\n{\"name\": \"The Giver\", \"author\": \"Lois Lowry\", \"release_date\": \"1993-04-26\", \"page_count\": 208}\n{\"name\": \"Slaughterhouse-Five\", \"author\": \"Kurt Vonnegut\", \"release_date\": \"1969-06-01\", \"page_count\": 275}\n{\"name\": \"The Hitchhiker's Guide to the Galaxy\", \"author\": \"Douglas Adams\", \"release_date\": \"1979-10-12\", \"page_count\": 180}\n{\"name\": \"Snow Crash\", \"author\": \"Neal Stephenson\", \"release_date\": \"1992-06-01\", \"page_count\": 470}\n{\"name\": \"Neuromancer\", \"author\": \"William Gibson\", \"release_date\": \"1984-07-01\", \"page_count\": 271}\n{\"name\": \"The Handmaid's Tale\", \"author\": \"Margaret Atwood\", \"release_date\": \"1985-06-01\", \"page_count\": 311}\n{\"name\": \"Starship Troopers\", \"author\": \"Robert A. Heinlein\", \"release_date\": \"1959-12-01\", \"page_count\": 335}\n{\"name\": \"The Left Hand of Darkness\", \"author\": \"Ursula K. Le Guin\", \"release_date\": \"1969-06-01\", \"page_count\": 304}\n{\"name\": \"The Moon is a Harsh Mistress\", \"author\": \"Robert A. Heinlein\", \"release_date\": \"1966-04-01\", \"page_count\": 288}" - lang: Python source: "resp = client.text_structure.find_structure(\n text_files=[\n {\n \"name\": \"Leviathan Wakes\",\n \"author\": \"James S.A. Corey\",\n \"release_date\": \"2011-06-02\",\n \"page_count\": 561\n },\n {\n \"name\": \"Hyperion\",\n \"author\": \"Dan Simmons\",\n \"release_date\": \"1989-05-26\",\n \"page_count\": 482\n },\n {\n \"name\": \"Dune\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1965-06-01\",\n \"page_count\": 604\n },\n {\n \"name\": \"Dune Messiah\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1969-10-15\",\n \"page_count\": 331\n },\n {\n \"name\": \"Children of Dune\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1976-04-21\",\n \"page_count\": 408\n },\n {\n \"name\": \"God Emperor of Dune\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1981-05-28\",\n \"page_count\": 454\n },\n {\n \"name\": \"Consider Phlebas\",\n \"author\": \"Iain M. Banks\",\n \"release_date\": \"1987-04-23\",\n \"page_count\": 471\n },\n {\n \"name\": \"Pandora's Star\",\n \"author\": \"Peter F. Hamilton\",\n \"release_date\": \"2004-03-02\",\n \"page_count\": 768\n },\n {\n \"name\": \"Revelation Space\",\n \"author\": \"Alastair Reynolds\",\n \"release_date\": \"2000-03-15\",\n \"page_count\": 585\n },\n {\n \"name\": \"A Fire Upon the Deep\",\n \"author\": \"Vernor Vinge\",\n \"release_date\": \"1992-06-01\",\n \"page_count\": 613\n },\n {\n \"name\": \"Ender's Game\",\n \"author\": \"Orson Scott Card\",\n \"release_date\": \"1985-06-01\",\n \"page_count\": 324\n },\n {\n \"name\": \"1984\",\n \"author\": \"George Orwell\",\n \"release_date\": \"1985-06-01\",\n \"page_count\": 328\n },\n {\n \"name\": \"Fahrenheit 451\",\n \"author\": \"Ray Bradbury\",\n \"release_date\": \"1953-10-15\",\n \"page_count\": 227\n },\n {\n \"name\": \"Brave New World\",\n \"author\": \"Aldous Huxley\",\n \"release_date\": \"1932-06-01\",\n \"page_count\": 268\n },\n {\n \"name\": \"Foundation\",\n \"author\": \"Isaac Asimov\",\n \"release_date\": \"1951-06-01\",\n \"page_count\": 224\n },\n {\n \"name\": \"The Giver\",\n \"author\": \"Lois Lowry\",\n \"release_date\": \"1993-04-26\",\n \"page_count\": 208\n },\n {\n \"name\": \"Slaughterhouse-Five\",\n \"author\": \"Kurt Vonnegut\",\n \"release_date\": \"1969-06-01\",\n \"page_count\": 275\n },\n {\n \"name\": \"The Hitchhiker's Guide to the Galaxy\",\n \"author\": \"Douglas Adams\",\n \"release_date\": \"1979-10-12\",\n \"page_count\": 180\n },\n {\n \"name\": \"Snow Crash\",\n \"author\": \"Neal Stephenson\",\n \"release_date\": \"1992-06-01\",\n \"page_count\": 470\n },\n {\n \"name\": \"Neuromancer\",\n \"author\": \"William Gibson\",\n \"release_date\": \"1984-07-01\",\n \"page_count\": 271\n },\n {\n \"name\": \"The Handmaid's Tale\",\n \"author\": \"Margaret Atwood\",\n \"release_date\": \"1985-06-01\",\n \"page_count\": 311\n },\n {\n \"name\": \"Starship Troopers\",\n \"author\": \"Robert A. Heinlein\",\n \"release_date\": \"1959-12-01\",\n \"page_count\": 335\n },\n {\n \"name\": \"The Left Hand of Darkness\",\n \"author\": \"Ursula K. Le Guin\",\n \"release_date\": \"1969-06-01\",\n \"page_count\": 304\n },\n {\n \"name\": \"The Moon is a Harsh Mistress\",\n \"author\": \"Robert A. Heinlein\",\n \"release_date\": \"1966-04-01\",\n \"page_count\": 288\n }\n ],\n)" - lang: JavaScript source: "const response = await client.textStructure.findStructure({\n text_files: [\n {\n name: \"Leviathan Wakes\",\n author: \"James S.A. Corey\",\n release_date: \"2011-06-02\",\n page_count: 561,\n },\n {\n name: \"Hyperion\",\n author: \"Dan Simmons\",\n release_date: \"1989-05-26\",\n page_count: 482,\n },\n {\n name: \"Dune\",\n author: \"Frank Herbert\",\n release_date: \"1965-06-01\",\n page_count: 604,\n },\n {\n name: \"Dune Messiah\",\n author: \"Frank Herbert\",\n release_date: \"1969-10-15\",\n page_count: 331,\n },\n {\n name: \"Children of Dune\",\n author: \"Frank Herbert\",\n release_date: \"1976-04-21\",\n page_count: 408,\n },\n {\n name: \"God Emperor of Dune\",\n author: \"Frank Herbert\",\n release_date: \"1981-05-28\",\n page_count: 454,\n },\n {\n name: \"Consider Phlebas\",\n author: \"Iain M. Banks\",\n release_date: \"1987-04-23\",\n page_count: 471,\n },\n {\n name: \"Pandora's Star\",\n author: \"Peter F. Hamilton\",\n release_date: \"2004-03-02\",\n page_count: 768,\n },\n {\n name: \"Revelation Space\",\n author: \"Alastair Reynolds\",\n release_date: \"2000-03-15\",\n page_count: 585,\n },\n {\n name: \"A Fire Upon the Deep\",\n author: \"Vernor Vinge\",\n release_date: \"1992-06-01\",\n page_count: 613,\n },\n {\n name: \"Ender's Game\",\n author: \"Orson Scott Card\",\n release_date: \"1985-06-01\",\n page_count: 324,\n },\n {\n name: \"1984\",\n author: \"George Orwell\",\n release_date: \"1985-06-01\",\n page_count: 328,\n },\n {\n name: \"Fahrenheit 451\",\n author: \"Ray Bradbury\",\n release_date: \"1953-10-15\",\n page_count: 227,\n },\n {\n name: \"Brave New World\",\n author: \"Aldous Huxley\",\n release_date: \"1932-06-01\",\n page_count: 268,\n },\n {\n name: \"Foundation\",\n author: \"Isaac Asimov\",\n release_date: \"1951-06-01\",\n page_count: 224,\n },\n {\n name: \"The Giver\",\n author: \"Lois Lowry\",\n release_date: \"1993-04-26\",\n page_count: 208,\n },\n {\n name: \"Slaughterhouse-Five\",\n author: \"Kurt Vonnegut\",\n release_date: \"1969-06-01\",\n page_count: 275,\n },\n {\n name: \"The Hitchhiker's Guide to the Galaxy\",\n author: \"Douglas Adams\",\n release_date: \"1979-10-12\",\n page_count: 180,\n },\n {\n name: \"Snow Crash\",\n author: \"Neal Stephenson\",\n release_date: \"1992-06-01\",\n page_count: 470,\n },\n {\n name: \"Neuromancer\",\n author: \"William Gibson\",\n release_date: \"1984-07-01\",\n page_count: 271,\n },\n {\n name: \"The Handmaid's Tale\",\n author: \"Margaret Atwood\",\n release_date: \"1985-06-01\",\n page_count: 311,\n },\n {\n name: \"Starship Troopers\",\n author: \"Robert A. Heinlein\",\n release_date: \"1959-12-01\",\n page_count: 335,\n },\n {\n name: \"The Left Hand of Darkness\",\n author: \"Ursula K. Le Guin\",\n release_date: \"1969-06-01\",\n page_count: 304,\n },\n {\n name: \"The Moon is a Harsh Mistress\",\n author: \"Robert A. Heinlein\",\n release_date: \"1966-04-01\",\n page_count: 288,\n },\n ],\n});" - lang: Ruby source: "response = client.text_structure.find_structure(\n body: [\n {\n \"name\": \"Leviathan Wakes\",\n \"author\": \"James S.A. Corey\",\n \"release_date\": \"2011-06-02\",\n \"page_count\": 561\n },\n {\n \"name\": \"Hyperion\",\n \"author\": \"Dan Simmons\",\n \"release_date\": \"1989-05-26\",\n \"page_count\": 482\n },\n {\n \"name\": \"Dune\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1965-06-01\",\n \"page_count\": 604\n },\n {\n \"name\": \"Dune Messiah\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1969-10-15\",\n \"page_count\": 331\n },\n {\n \"name\": \"Children of Dune\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1976-04-21\",\n \"page_count\": 408\n },\n {\n \"name\": \"God Emperor of Dune\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1981-05-28\",\n \"page_count\": 454\n },\n {\n \"name\": \"Consider Phlebas\",\n \"author\": \"Iain M. Banks\",\n \"release_date\": \"1987-04-23\",\n \"page_count\": 471\n },\n {\n \"name\": \"Pandora's Star\",\n \"author\": \"Peter F. Hamilton\",\n \"release_date\": \"2004-03-02\",\n \"page_count\": 768\n },\n {\n \"name\": \"Revelation Space\",\n \"author\": \"Alastair Reynolds\",\n \"release_date\": \"2000-03-15\",\n \"page_count\": 585\n },\n {\n \"name\": \"A Fire Upon the Deep\",\n \"author\": \"Vernor Vinge\",\n \"release_date\": \"1992-06-01\",\n \"page_count\": 613\n },\n {\n \"name\": \"Ender's Game\",\n \"author\": \"Orson Scott Card\",\n \"release_date\": \"1985-06-01\",\n \"page_count\": 324\n },\n {\n \"name\": \"1984\",\n \"author\": \"George Orwell\",\n \"release_date\": \"1985-06-01\",\n \"page_count\": 328\n },\n {\n \"name\": \"Fahrenheit 451\",\n \"author\": \"Ray Bradbury\",\n \"release_date\": \"1953-10-15\",\n \"page_count\": 227\n },\n {\n \"name\": \"Brave New World\",\n \"author\": \"Aldous Huxley\",\n \"release_date\": \"1932-06-01\",\n \"page_count\": 268\n },\n {\n \"name\": \"Foundation\",\n \"author\": \"Isaac Asimov\",\n \"release_date\": \"1951-06-01\",\n \"page_count\": 224\n },\n {\n \"name\": \"The Giver\",\n \"author\": \"Lois Lowry\",\n \"release_date\": \"1993-04-26\",\n \"page_count\": 208\n },\n {\n \"name\": \"Slaughterhouse-Five\",\n \"author\": \"Kurt Vonnegut\",\n \"release_date\": \"1969-06-01\",\n \"page_count\": 275\n },\n {\n \"name\": \"The Hitchhiker's Guide to the Galaxy\",\n \"author\": \"Douglas Adams\",\n \"release_date\": \"1979-10-12\",\n \"page_count\": 180\n },\n {\n \"name\": \"Snow Crash\",\n \"author\": \"Neal Stephenson\",\n \"release_date\": \"1992-06-01\",\n \"page_count\": 470\n },\n {\n \"name\": \"Neuromancer\",\n \"author\": \"William Gibson\",\n \"release_date\": \"1984-07-01\",\n \"page_count\": 271\n },\n {\n \"name\": \"The Handmaid's Tale\",\n \"author\": \"Margaret Atwood\",\n \"release_date\": \"1985-06-01\",\n \"page_count\": 311\n },\n {\n \"name\": \"Starship Troopers\",\n \"author\": \"Robert A. Heinlein\",\n \"release_date\": \"1959-12-01\",\n \"page_count\": 335\n },\n {\n \"name\": \"The Left Hand of Darkness\",\n \"author\": \"Ursula K. Le Guin\",\n \"release_date\": \"1969-06-01\",\n \"page_count\": 304\n },\n {\n \"name\": \"The Moon is a Harsh Mistress\",\n \"author\": \"Robert A. Heinlein\",\n \"release_date\": \"1966-04-01\",\n \"page_count\": 288\n }\n ]\n)" - lang: PHP source: "$resp = $client->textStructure()->findStructure([\n \"body\" => array(\n [\n \"name\" => \"Leviathan Wakes\",\n \"author\" => \"James S.A. Corey\",\n \"release_date\" => \"2011-06-02\",\n \"page_count\" => 561,\n ],\n [\n \"name\" => \"Hyperion\",\n \"author\" => \"Dan Simmons\",\n \"release_date\" => \"1989-05-26\",\n \"page_count\" => 482,\n ],\n [\n \"name\" => \"Dune\",\n \"author\" => \"Frank Herbert\",\n \"release_date\" => \"1965-06-01\",\n \"page_count\" => 604,\n ],\n [\n \"name\" => \"Dune Messiah\",\n \"author\" => \"Frank Herbert\",\n \"release_date\" => \"1969-10-15\",\n \"page_count\" => 331,\n ],\n [\n \"name\" => \"Children of Dune\",\n \"author\" => \"Frank Herbert\",\n \"release_date\" => \"1976-04-21\",\n \"page_count\" => 408,\n ],\n [\n \"name\" => \"God Emperor of Dune\",\n \"author\" => \"Frank Herbert\",\n \"release_date\" => \"1981-05-28\",\n \"page_count\" => 454,\n ],\n [\n \"name\" => \"Consider Phlebas\",\n \"author\" => \"Iain M. Banks\",\n \"release_date\" => \"1987-04-23\",\n \"page_count\" => 471,\n ],\n [\n \"name\" => \"Pandora's Star\",\n \"author\" => \"Peter F. Hamilton\",\n \"release_date\" => \"2004-03-02\",\n \"page_count\" => 768,\n ],\n [\n \"name\" => \"Revelation Space\",\n \"author\" => \"Alastair Reynolds\",\n \"release_date\" => \"2000-03-15\",\n \"page_count\" => 585,\n ],\n [\n \"name\" => \"A Fire Upon the Deep\",\n \"author\" => \"Vernor Vinge\",\n \"release_date\" => \"1992-06-01\",\n \"page_count\" => 613,\n ],\n [\n \"name\" => \"Ender's Game\",\n \"author\" => \"Orson Scott Card\",\n \"release_date\" => \"1985-06-01\",\n \"page_count\" => 324,\n ],\n [\n \"name\" => \"1984\",\n \"author\" => \"George Orwell\",\n \"release_date\" => \"1985-06-01\",\n \"page_count\" => 328,\n ],\n [\n \"name\" => \"Fahrenheit 451\",\n \"author\" => \"Ray Bradbury\",\n \"release_date\" => \"1953-10-15\",\n \"page_count\" => 227,\n ],\n [\n \"name\" => \"Brave New World\",\n \"author\" => \"Aldous Huxley\",\n \"release_date\" => \"1932-06-01\",\n \"page_count\" => 268,\n ],\n [\n \"name\" => \"Foundation\",\n \"author\" => \"Isaac Asimov\",\n \"release_date\" => \"1951-06-01\",\n \"page_count\" => 224,\n ],\n [\n \"name\" => \"The Giver\",\n \"author\" => \"Lois Lowry\",\n \"release_date\" => \"1993-04-26\",\n \"page_count\" => 208,\n ],\n [\n \"name\" => \"Slaughterhouse-Five\",\n \"author\" => \"Kurt Vonnegut\",\n \"release_date\" => \"1969-06-01\",\n \"page_count\" => 275,\n ],\n [\n \"name\" => \"The Hitchhiker's Guide to the Galaxy\",\n \"author\" => \"Douglas Adams\",\n \"release_date\" => \"1979-10-12\",\n \"page_count\" => 180,\n ],\n [\n \"name\" => \"Snow Crash\",\n \"author\" => \"Neal Stephenson\",\n \"release_date\" => \"1992-06-01\",\n \"page_count\" => 470,\n ],\n [\n \"name\" => \"Neuromancer\",\n \"author\" => \"William Gibson\",\n \"release_date\" => \"1984-07-01\",\n \"page_count\" => 271,\n ],\n [\n \"name\" => \"The Handmaid's Tale\",\n \"author\" => \"Margaret Atwood\",\n \"release_date\" => \"1985-06-01\",\n \"page_count\" => 311,\n ],\n [\n \"name\" => \"Starship Troopers\",\n \"author\" => \"Robert A. Heinlein\",\n \"release_date\" => \"1959-12-01\",\n \"page_count\" => 335,\n ],\n [\n \"name\" => \"The Left Hand of Darkness\",\n \"author\" => \"Ursula K. Le Guin\",\n \"release_date\" => \"1969-06-01\",\n \"page_count\" => 304,\n ],\n [\n \"name\" => \"The Moon is a Harsh Mistress\",\n \"author\" => \"Robert A. Heinlein\",\n \"release_date\" => \"1966-04-01\",\n \"page_count\" => 288,\n ],\n ),\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/x-ndjson" -d $''{"name":"Leviathan Wakes","author":"James S.A. Corey","release_date":"2011-06-02","page_count":561}\n{"name":"Hyperion","author":"Dan Simmons","release_date":"1989-05-26","page_count":482}\n{"name":"Dune","author":"Frank Herbert","release_date":"1965-06-01","page_count":604}\n{"name":"Dune Messiah","author":"Frank Herbert","release_date":"1969-10-15","page_count":331}\n{"name":"Children of Dune","author":"Frank Herbert","release_date":"1976-04-21","page_count":408}\n{"name":"God Emperor of Dune","author":"Frank Herbert","release_date":"1981-05-28","page_count":454}\n{"name":"Consider Phlebas","author":"Iain M. Banks","release_date":"1987-04-23","page_count":471}\n{"name":"Pandora''"''"$''s Star","author":"Peter F. Hamilton","release_date":"2004-03-02","page_count":768}\n{"name":"Revelation Space","author":"Alastair Reynolds","release_date":"2000-03-15","page_count":585}\n{"name":"A Fire Upon the Deep","author":"Vernor Vinge","release_date":"1992-06-01","page_count":613}\n{"name":"Ender''"''"$''s Game","author":"Orson Scott Card","release_date":"1985-06-01","page_count":324}\n{"name":"1984","author":"George Orwell","release_date":"1985-06-01","page_count":328}\n{"name":"Fahrenheit 451","author":"Ray Bradbury","release_date":"1953-10-15","page_count":227}\n{"name":"Brave New World","author":"Aldous Huxley","release_date":"1932-06-01","page_count":268}\n{"name":"Foundation","author":"Isaac Asimov","release_date":"1951-06-01","page_count":224}\n{"name":"The Giver","author":"Lois Lowry","release_date":"1993-04-26","page_count":208}\n{"name":"Slaughterhouse-Five","author":"Kurt Vonnegut","release_date":"1969-06-01","page_count":275}\n{"name":"The Hitchhiker''"''"$''s Guide to the Galaxy","author":"Douglas Adams","release_date":"1979-10-12","page_count":180}\n{"name":"Snow Crash","author":"Neal Stephenson","release_date":"1992-06-01","page_count":470}\n{"name":"Neuromancer","author":"William Gibson","release_date":"1984-07-01","page_count":271}\n{"name":"The Handmaid''"''"$''s Tale","author":"Margaret Atwood","release_date":"1985-06-01","page_count":311}\n{"name":"Starship Troopers","author":"Robert A. Heinlein","release_date":"1959-12-01","page_count":335}\n{"name":"The Left Hand of Darkness","author":"Ursula K. Le Guin","release_date":"1969-06-01","page_count":304}\n{"name":"The Moon is a Harsh Mistress","author":"Robert A. Heinlein","release_date":"1966-04-01","page_count":288}\n'' "$ELASTICSEARCH_URL/_text_structure/find_structure"' x-metaTags: - content: Elasticsearch name: product_name /_text_structure/test_grok_pattern: post: tags: - text_structure summary: "Test a Grok pattern\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_text_structure/test_grok_pattern\n
\n
\n POST\n /_text_structure/test_grok_pattern\n
\n \n\nTest a Grok pattern on one or more lines of text.\nThe API indicates whether the lines match the pattern together with the offsets and lengths of the matched substrings.\n\n## Required authorization\n\n* Cluster privileges: `monitor_text_structure`\n" externalDocs: description: Learn more about Grok patterns url: https://www.elastic.co/docs/explore-analyze/scripting/grok x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/test-grok-pattern.html operationId: text-structure-test-grok-pattern parameters: - $ref: '#/components/parameters/text_structure.test_grok_pattern-ecs_compatibility' requestBody: $ref: '#/components/requestBodies/text_structure.test_grok_pattern' responses: '200': $ref: '#/components/responses/text_structure.test_grok_pattern-200' x-state: Generally available; Added in 8.13.0 x-codeSamples: - lang: Console source: "GET _text_structure/test_grok_pattern\n{\n \"grok_pattern\": \"Hello %{WORD:first_name} %{WORD:last_name}\",\n \"text\": [\n \"Hello John Doe\",\n \"this does not match\"\n ]\n}" - lang: Python source: "resp = client.text_structure.test_grok_pattern(\n grok_pattern=\"Hello %{WORD:first_name} %{WORD:last_name}\",\n text=[\n \"Hello John Doe\",\n \"this does not match\"\n ],\n)" - lang: JavaScript source: "const response = await client.textStructure.testGrokPattern({\n grok_pattern: \"Hello %{WORD:first_name} %{WORD:last_name}\",\n text: [\"Hello John Doe\", \"this does not match\"],\n});" - lang: Ruby source: "response = client.text_structure.test_grok_pattern(\n body: {\n \"grok_pattern\": \"Hello %{WORD:first_name} %{WORD:last_name}\",\n \"text\": [\n \"Hello John Doe\",\n \"this does not match\"\n ]\n }\n)" - lang: PHP source: "$resp = $client->textStructure()->testGrokPattern([\n \"body\" => [\n \"grok_pattern\" => \"Hello %{WORD:first_name} %{WORD:last_name}\",\n \"text\" => array(\n \"Hello John Doe\",\n \"this does not match\",\n ),\n ],\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"grok_pattern":"Hello %{WORD:first_name} %{WORD:last_name}","text":["Hello John Doe","this does not match"]}'' "$ELASTICSEARCH_URL/_text_structure/test_grok_pattern"' - lang: C# source: "var response = await client.TextStructure\n .TestGrokPatternAsync(d1 => d1\n .GrokPattern(\"Hello %{WORD:first_name} %{WORD:last_name}\")\n .Text(\"Hello John Doe\", \"this does not match\")\n );" - lang: Java source: "client.textStructure().testGrokPattern(t -> t\n .grokPattern(\"Hello %{WORD:first_name} %{WORD:last_name}\")\n .text(List.of(\"Hello John Doe\",\"this does not match\"))\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_transform/{transform_id}': get: tags: - transform summary: "Get transforms\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_transform\n
\n
\n GET\n /_transform/{transform_id}\n
\n \n\nGet configuration information for transforms.\n\n## Required authorization\n\n* Cluster privileges: `monitor_transform`\n" operationId: transform-get-transform parameters: - $ref: '#/components/parameters/transform.get_transform-transform_id' - $ref: '#/components/parameters/transform.get_transform-allow_no_match' - $ref: '#/components/parameters/transform.get_transform-from' - $ref: '#/components/parameters/transform.get_transform-size' - $ref: '#/components/parameters/transform.get_transform-exclude_generated' responses: '200': $ref: '#/components/responses/transform.get_transform-200' x-state: Generally available; Added in 7.5.0 x-codeSamples: - lang: Console source: "GET _transform?size=10\n" - lang: Python source: "resp = client.transform.get_transform(\n size=\"10\",\n)" - lang: JavaScript source: "const response = await client.transform.getTransform({\n size: 10,\n});" - lang: Ruby source: "response = client.transform.get_transform(\n size: \"10\"\n)" - lang: PHP source: "$resp = $client->transform()->getTransform([\n \"size\" => \"10\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_transform?size=10"' - lang: C# source: "var response = await client.TransformManagement\n .GetTransformAsync(d1 => d1\n .Size(10)\n );" - lang: Java source: "client.transform().getTransform(g -> g\n .size(10)\n);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - transform summary: Create a transform description: "Creates a transform.\n\nA transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as\na data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a\nunique row per entity.\n\nYou must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If\nyou choose to use the pivot method for your transform, the entities are defined by the set of `group_by` fields in\nthe pivot object. If you choose to use the latest method, the entities are defined by the `unique_key` field values\nin the latest object.\n\nYou must have `create_index`, `index`, and `read` privileges on the destination index and `read` and\n`view_index_metadata` privileges on the source indices. When Elasticsearch security features are enabled, the\ntransform remembers which roles the user that created it had at the time of creation and uses those same roles. If\nthose roles do not have the required privileges on the source and destination indices, the transform fails when it\nattempts unauthorized operations.\n\nNOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any\n`.transform-internal*` indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do\nnot give users any privileges on `.transform-internal*` indices. If you used transforms prior to 7.5, also do not\ngive users any privileges on `.data-frame-internal*` indices.\n\n## Required authorization\n\n* Index privileges: `create_index`,`read`,`index`,`view_index_metadata`\n* Cluster privileges: `manage_transform`\n" operationId: transform-put-transform parameters: - name: transform_id in: path description: "Identifier for the transform. This identifier can contain lowercase alphanumeric characters (a-z and 0-9),\nhyphens, and underscores. It has a 64 character limit and must start and end with alphanumeric characters." required: true schema: $ref: '#/components/schemas/_types.Id' - name: defer_validation in: query description: "When the transform is created, a series of validations occur to ensure its success. For example, there is a\ncheck for the existence of the source indices and a check that the destination index is not part of the source\nindex pattern. You can use this parameter to skip the checks, for example when the source index does not exist\nuntil after the transform is created. The validations are always run when you start the transform, however, with\nthe exception of privilege checks." schema: type: boolean default: false - name: timeout in: query description: 'Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: required: - dest - source type: object properties: dest: allOf: - $ref: '#/components/schemas/transform._types.Destination' description: The destination for the transform. description: type: string description: Free text description of the transform. frequency: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The interval between checks for changes in the source indices when the transform is running continuously. Also\ndetermines the retry interval in the event of transient failures while the transform is searching or indexing.\nThe minimum value is `1s` and the maximum is `1h`." default: 1m latest: allOf: - $ref: '#/components/schemas/transform._types.Latest' description: The latest method transforms the data by finding the latest document for each unique key. _meta: allOf: - $ref: '#/components/schemas/_types.Metadata' description: Defines optional transform metadata. pivot: allOf: - $ref: '#/components/schemas/transform._types.Pivot' description: "The pivot method transforms the data by aggregating and grouping it. These objects define the group by fields\nand the aggregation to reduce the data." retention_policy: allOf: - $ref: '#/components/schemas/transform._types.RetentionPolicyContainer' description: "Defines a retention policy for the transform. Data that meets the defined criteria is deleted from the\ndestination index." settings: allOf: - $ref: '#/components/schemas/transform._types.Settings' description: Defines optional transform settings. source: allOf: - $ref: '#/components/schemas/transform._types.Source' description: The source of the data for the transform. sync: allOf: - $ref: '#/components/schemas/transform._types.SyncContainer' description: Defines the properties transforms require to run continuously. examples: PutTransformRequestExample1: summary: A pivot transform description: Run `PUT _transform/ecommerce_transform1` to create a transform that uses the pivot method. value: "{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n \"retention_policy\": {\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n }\n}" x-codeSamples: - lang: Console source: "PUT _transform/ecommerce_transform1\n{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n \"retention_policy\": {\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n }\n}" - lang: Python source: "resp = client.transform.put_transform(\n transform_id=\"ecommerce_transform1\",\n source={\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n pivot={\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": True\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n description=\"Maximum priced ecommerce data by customer_id in Asia\",\n dest={\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n frequency=\"5m\",\n sync={\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n retention_policy={\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.transform.putTransform({\n transform_id: \"ecommerce_transform1\",\n source: {\n index: \"kibana_sample_data_ecommerce\",\n query: {\n term: {\n \"geoip.continent_name\": {\n value: \"Asia\",\n },\n },\n },\n },\n pivot: {\n group_by: {\n customer_id: {\n terms: {\n field: \"customer_id\",\n missing_bucket: true,\n },\n },\n },\n aggregations: {\n max_price: {\n max: {\n field: \"taxful_total_price\",\n },\n },\n },\n },\n description: \"Maximum priced ecommerce data by customer_id in Asia\",\n dest: {\n index: \"kibana_sample_data_ecommerce_transform1\",\n pipeline: \"add_timestamp_pipeline\",\n },\n frequency: \"5m\",\n sync: {\n time: {\n field: \"order_date\",\n delay: \"60s\",\n },\n },\n retention_policy: {\n time: {\n field: \"order_date\",\n max_age: \"30d\",\n },\n },\n});" - lang: Ruby source: "response = client.transform.put_transform(\n transform_id: \"ecommerce_transform1\",\n body: {\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n \"retention_policy\": {\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->transform()->putTransform([\n \"transform_id\" => \"ecommerce_transform1\",\n \"body\" => [\n \"source\" => [\n \"index\" => \"kibana_sample_data_ecommerce\",\n \"query\" => [\n \"term\" => [\n \"geoip.continent_name\" => [\n \"value\" => \"Asia\",\n ],\n ],\n ],\n ],\n \"pivot\" => [\n \"group_by\" => [\n \"customer_id\" => [\n \"terms\" => [\n \"field\" => \"customer_id\",\n \"missing_bucket\" => true,\n ],\n ],\n ],\n \"aggregations\" => [\n \"max_price\" => [\n \"max\" => [\n \"field\" => \"taxful_total_price\",\n ],\n ],\n ],\n ],\n \"description\" => \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\" => [\n \"index\" => \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\" => \"add_timestamp_pipeline\",\n ],\n \"frequency\" => \"5m\",\n \"sync\" => [\n \"time\" => [\n \"field\" => \"order_date\",\n \"delay\" => \"60s\",\n ],\n ],\n \"retention_policy\" => [\n \"time\" => [\n \"field\" => \"order_date\",\n \"max_age\" => \"30d\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"index":"kibana_sample_data_ecommerce","query":{"term":{"geoip.continent_name":{"value":"Asia"}}}},"pivot":{"group_by":{"customer_id":{"terms":{"field":"customer_id","missing_bucket":true}}},"aggregations":{"max_price":{"max":{"field":"taxful_total_price"}}}},"description":"Maximum priced ecommerce data by customer_id in Asia","dest":{"index":"kibana_sample_data_ecommerce_transform1","pipeline":"add_timestamp_pipeline"},"frequency":"5m","sync":{"time":{"field":"order_date","delay":"60s"}},"retention_policy":{"time":{"field":"order_date","max_age":"30d"}}}'' "$ELASTICSEARCH_URL/_transform/ecommerce_transform1"' - lang: C# source: "var response = await client.TransformManagement\n .PutTransformAsync(transformId: \"ecommerce_transform1\", d1 => d1\n .Description(\"Maximum priced ecommerce data by customer_id in Asia\")\n .Dest(d2 => d2\n .Index(\"kibana_sample_data_ecommerce_transform1\")\n .Pipeline(\"add_timestamp_pipeline\")\n )\n .Frequency(\"5m\")\n .Pivot(d2 => d2\n .Aggregations(d3 => d3\n .Add(\"max_price\", d4 => d4\n .Max(d5 => d5\n .Field(x => x.TaxfulTotalPrice)\n )\n )\n )\n .GroupBy(d3 => d3\n .Add(\"customer_id\", d4 => d4\n .Terms(d5 => d5\n .Field(x => x.CustomerId)\n .MissingBucket(true)\n )\n )\n )\n )\n .RetentionPolicy(d2 => d2\n .Time(d3 => d3\n .Field(x => x.OrderDate)\n .MaxAge(\"30d\")\n )\n )\n .Source(d2 => d2\n .Indices(new[] { \"kibana_sample_data_ecommerce\" })\n .Query(d3 => d3\n .Term(d4 => d4\n .Field(x => x.Geoip.ContinentName)\n .Value(\"Asia\")\n )\n )\n )\n .Sync(d2 => d2\n .Time(d3 => d3\n .Delay(\"60s\")\n .Field(x => x.OrderDate)\n )\n )\n );" - lang: Java source: "client.transform().putTransform(p -> p\n .description(\"Maximum priced ecommerce data by customer_id in Asia\")\n .dest(d -> d\n .index(\"kibana_sample_data_ecommerce_transform1\")\n .pipeline(\"add_timestamp_pipeline\")\n )\n .frequency(f -> f\n .time(\"5m\")\n )\n .pivot(pi -> pi\n .aggregations(\"max_price\", a -> a\n .max(m -> m\n .field(\"taxful_total_price\")\n )\n )\n .groupBy(\"customer_id\", g -> g\n .terms(t -> t\n .field(\"customer_id\")\n .missingBucket(true)\n )\n )\n )\n .retentionPolicy(r -> r\n .time(t -> t\n .field(\"order_date\")\n .maxAge(m -> m\n .time(\"30d\")\n )\n )\n )\n .source(s -> s\n .index(\"kibana_sample_data_ecommerce\")\n .query(q -> q\n .term(te -> te\n .field(\"geoip.continent_name\")\n .value(FieldValue.of(\"Asia\"))\n )\n )\n )\n .sync(sy -> sy\n .time(ti -> ti\n .delay(d -> d\n .time(\"60s\")\n )\n .field(\"order_date\")\n )\n )\n .transformId(\"ecommerce_transform1\")\n);\n" PutTransformRequestExample2: summary: A latest transform description: Run `PUT _transform/ecommerce_transform2` to create a transform that uses the latest method. value: "{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"latest\": {\n \"unique_key\": [\n \"customer_id\"\n ],\n \"sort\": \"order_date\"\n },\n \"description\": \"Latest order for each customer\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform2\"\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n }\n}" x-codeSamples: - lang: Console source: "PUT _transform/ecommerce_transform2\n{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"latest\": {\n \"unique_key\": [\n \"customer_id\"\n ],\n \"sort\": \"order_date\"\n },\n \"description\": \"Latest order for each customer\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform2\"\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n }\n}" - lang: Python source: "resp = client.transform.put_transform(\n transform_id=\"ecommerce_transform2\",\n source={\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n latest={\n \"unique_key\": [\n \"customer_id\"\n ],\n \"sort\": \"order_date\"\n },\n description=\"Latest order for each customer\",\n dest={\n \"index\": \"kibana_sample_data_ecommerce_transform2\"\n },\n frequency=\"5m\",\n sync={\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.transform.putTransform({\n transform_id: \"ecommerce_transform2\",\n source: {\n index: \"kibana_sample_data_ecommerce\",\n },\n latest: {\n unique_key: [\"customer_id\"],\n sort: \"order_date\",\n },\n description: \"Latest order for each customer\",\n dest: {\n index: \"kibana_sample_data_ecommerce_transform2\",\n },\n frequency: \"5m\",\n sync: {\n time: {\n field: \"order_date\",\n delay: \"60s\",\n },\n },\n});" - lang: Ruby source: "response = client.transform.put_transform(\n transform_id: \"ecommerce_transform2\",\n body: {\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"latest\": {\n \"unique_key\": [\n \"customer_id\"\n ],\n \"sort\": \"order_date\"\n },\n \"description\": \"Latest order for each customer\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform2\"\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->transform()->putTransform([\n \"transform_id\" => \"ecommerce_transform2\",\n \"body\" => [\n \"source\" => [\n \"index\" => \"kibana_sample_data_ecommerce\",\n ],\n \"latest\" => [\n \"unique_key\" => array(\n \"customer_id\",\n ),\n \"sort\" => \"order_date\",\n ],\n \"description\" => \"Latest order for each customer\",\n \"dest\" => [\n \"index\" => \"kibana_sample_data_ecommerce_transform2\",\n ],\n \"frequency\" => \"5m\",\n \"sync\" => [\n \"time\" => [\n \"field\" => \"order_date\",\n \"delay\" => \"60s\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"index":"kibana_sample_data_ecommerce"},"latest":{"unique_key":["customer_id"],"sort":"order_date"},"description":"Latest order for each customer","dest":{"index":"kibana_sample_data_ecommerce_transform2"},"frequency":"5m","sync":{"time":{"field":"order_date","delay":"60s"}}}'' "$ELASTICSEARCH_URL/_transform/ecommerce_transform2"' - lang: C# source: "var response = await client.TransformManagement\n .PutTransformAsync(transformId: \"ecommerce_transform2\", d1 => d1\n .Description(\"Latest order for each customer\")\n .Dest(d2 => d2\n .Index(\"kibana_sample_data_ecommerce_transform2\")\n )\n .Frequency(\"5m\")\n .Latest(d2 => d2\n .Sort(x => x.OrderDate)\n .UniqueKey(x => x.CustomerId)\n )\n .Source(d2 => d2\n .Indices(new[] { \"kibana_sample_data_ecommerce\" })\n )\n .Sync(d2 => d2\n .Time(d3 => d3\n .Delay(\"60s\")\n .Field(x => x.OrderDate)\n )\n )\n );" - lang: Java source: "client.transform().putTransform(p -> p\n .description(\"Latest order for each customer\")\n .dest(d -> d\n .index(\"kibana_sample_data_ecommerce_transform2\")\n )\n .frequency(f -> f\n .time(\"5m\")\n )\n .latest(l -> l\n .sort(\"order_date\")\n .uniqueKey(\"customer_id\")\n )\n .source(s -> s\n .index(\"kibana_sample_data_ecommerce\")\n )\n .sync(s -> s\n .time(t -> t\n .delay(d -> d\n .time(\"60s\")\n )\n .field(\"order_date\")\n )\n )\n .transformId(\"ecommerce_transform2\")\n);\n" PutTransformRequestExample3: summary: A transform with destination aliases description: "Run `PUT _transform/ecommerce_transform3` to create a transform that adds the destination index to aliases. With `move_on_creation` set to `true`, the destination index becomes the only index in that alias.\n" value: "{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"latest\": {\n \"unique_key\": [\n \"customer_id\"\n ],\n \"sort\": \"order_date\"\n },\n \"description\": \"Latest order for each customer\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform3\",\n \"aliases\": [\n {\n \"alias\": \"kibana_sample_data_ecommerce_transform\"\n },\n {\n \"alias\": \"kibana_sample_data_ecommerce_transform_latest\",\n \"move_on_creation\": true\n }\n ]\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n }\n}" x-codeSamples: - lang: Console source: "PUT _transform/ecommerce_transform3\n{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"latest\": {\n \"unique_key\": [\n \"customer_id\"\n ],\n \"sort\": \"order_date\"\n },\n \"description\": \"Latest order for each customer\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform3\",\n \"aliases\": [\n {\n \"alias\": \"kibana_sample_data_ecommerce_transform\"\n },\n {\n \"alias\": \"kibana_sample_data_ecommerce_transform_latest\",\n \"move_on_creation\": true\n }\n ]\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n }\n}" - lang: Python source: "resp = client.transform.put_transform(\n transform_id=\"ecommerce_transform3\",\n source={\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n latest={\n \"unique_key\": [\n \"customer_id\"\n ],\n \"sort\": \"order_date\"\n },\n description=\"Latest order for each customer\",\n dest={\n \"index\": \"kibana_sample_data_ecommerce_transform3\",\n \"aliases\": [\n {\n \"alias\": \"kibana_sample_data_ecommerce_transform\"\n },\n {\n \"alias\": \"kibana_sample_data_ecommerce_transform_latest\",\n \"move_on_creation\": True\n }\n ]\n },\n frequency=\"5m\",\n sync={\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.transform.putTransform({\n transform_id: \"ecommerce_transform3\",\n source: {\n index: \"kibana_sample_data_ecommerce\",\n },\n latest: {\n unique_key: [\"customer_id\"],\n sort: \"order_date\",\n },\n description: \"Latest order for each customer\",\n dest: {\n index: \"kibana_sample_data_ecommerce_transform3\",\n aliases: [\n {\n alias: \"kibana_sample_data_ecommerce_transform\",\n },\n {\n alias: \"kibana_sample_data_ecommerce_transform_latest\",\n move_on_creation: true,\n },\n ],\n },\n frequency: \"5m\",\n sync: {\n time: {\n field: \"order_date\",\n delay: \"60s\",\n },\n },\n});" - lang: Ruby source: "response = client.transform.put_transform(\n transform_id: \"ecommerce_transform3\",\n body: {\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"latest\": {\n \"unique_key\": [\n \"customer_id\"\n ],\n \"sort\": \"order_date\"\n },\n \"description\": \"Latest order for each customer\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform3\",\n \"aliases\": [\n {\n \"alias\": \"kibana_sample_data_ecommerce_transform\"\n },\n {\n \"alias\": \"kibana_sample_data_ecommerce_transform_latest\",\n \"move_on_creation\": true\n }\n ]\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->transform()->putTransform([\n \"transform_id\" => \"ecommerce_transform3\",\n \"body\" => [\n \"source\" => [\n \"index\" => \"kibana_sample_data_ecommerce\",\n ],\n \"latest\" => [\n \"unique_key\" => array(\n \"customer_id\",\n ),\n \"sort\" => \"order_date\",\n ],\n \"description\" => \"Latest order for each customer\",\n \"dest\" => [\n \"index\" => \"kibana_sample_data_ecommerce_transform3\",\n \"aliases\" => array(\n [\n \"alias\" => \"kibana_sample_data_ecommerce_transform\",\n ],\n [\n \"alias\" => \"kibana_sample_data_ecommerce_transform_latest\",\n \"move_on_creation\" => true,\n ],\n ),\n ],\n \"frequency\" => \"5m\",\n \"sync\" => [\n \"time\" => [\n \"field\" => \"order_date\",\n \"delay\" => \"60s\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"index":"kibana_sample_data_ecommerce"},"latest":{"unique_key":["customer_id"],"sort":"order_date"},"description":"Latest order for each customer","dest":{"index":"kibana_sample_data_ecommerce_transform3","aliases":[{"alias":"kibana_sample_data_ecommerce_transform"},{"alias":"kibana_sample_data_ecommerce_transform_latest","move_on_creation":true}]},"frequency":"5m","sync":{"time":{"field":"order_date","delay":"60s"}}}'' "$ELASTICSEARCH_URL/_transform/ecommerce_transform3"' - lang: C# source: "var response = await client.TransformManagement\n .PutTransformAsync(transformId: \"ecommerce_transform3\", d1 => d1\n .Description(\"Latest order for each customer\")\n .Dest(d2 => d2\n .Aliases(d3 => d3\n .Alias(\"kibana_sample_data_ecommerce_transform\"), d3 => d3\n .Alias(\"kibana_sample_data_ecommerce_transform_latest\")\n .MoveOnCreation(true)\n )\n .Index(\"kibana_sample_data_ecommerce_transform3\")\n )\n .Frequency(\"5m\")\n .Latest(d2 => d2\n .Sort(x => x.OrderDate)\n .UniqueKey(x => x.CustomerId)\n )\n .Source(d2 => d2\n .Indices(new[] { \"kibana_sample_data_ecommerce\" })\n )\n .Sync(d2 => d2\n .Time(d3 => d3\n .Delay(\"60s\")\n .Field(x => x.OrderDate)\n )\n )\n );" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: PutTransformResponseExample1: description: A successful response when creating a transform. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 7.2.0 x-codeSamples: - lang: Console source: "PUT _transform/ecommerce_transform1\n{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n \"retention_policy\": {\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n }\n}" - lang: Python source: "resp = client.transform.put_transform(\n transform_id=\"ecommerce_transform1\",\n source={\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n pivot={\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": True\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n description=\"Maximum priced ecommerce data by customer_id in Asia\",\n dest={\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n frequency=\"5m\",\n sync={\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n retention_policy={\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.transform.putTransform({\n transform_id: \"ecommerce_transform1\",\n source: {\n index: \"kibana_sample_data_ecommerce\",\n query: {\n term: {\n \"geoip.continent_name\": {\n value: \"Asia\",\n },\n },\n },\n },\n pivot: {\n group_by: {\n customer_id: {\n terms: {\n field: \"customer_id\",\n missing_bucket: true,\n },\n },\n },\n aggregations: {\n max_price: {\n max: {\n field: \"taxful_total_price\",\n },\n },\n },\n },\n description: \"Maximum priced ecommerce data by customer_id in Asia\",\n dest: {\n index: \"kibana_sample_data_ecommerce_transform1\",\n pipeline: \"add_timestamp_pipeline\",\n },\n frequency: \"5m\",\n sync: {\n time: {\n field: \"order_date\",\n delay: \"60s\",\n },\n },\n retention_policy: {\n time: {\n field: \"order_date\",\n max_age: \"30d\",\n },\n },\n});" - lang: Ruby source: "response = client.transform.put_transform(\n transform_id: \"ecommerce_transform1\",\n body: {\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n \"retention_policy\": {\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->transform()->putTransform([\n \"transform_id\" => \"ecommerce_transform1\",\n \"body\" => [\n \"source\" => [\n \"index\" => \"kibana_sample_data_ecommerce\",\n \"query\" => [\n \"term\" => [\n \"geoip.continent_name\" => [\n \"value\" => \"Asia\",\n ],\n ],\n ],\n ],\n \"pivot\" => [\n \"group_by\" => [\n \"customer_id\" => [\n \"terms\" => [\n \"field\" => \"customer_id\",\n \"missing_bucket\" => true,\n ],\n ],\n ],\n \"aggregations\" => [\n \"max_price\" => [\n \"max\" => [\n \"field\" => \"taxful_total_price\",\n ],\n ],\n ],\n ],\n \"description\" => \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\" => [\n \"index\" => \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\" => \"add_timestamp_pipeline\",\n ],\n \"frequency\" => \"5m\",\n \"sync\" => [\n \"time\" => [\n \"field\" => \"order_date\",\n \"delay\" => \"60s\",\n ],\n ],\n \"retention_policy\" => [\n \"time\" => [\n \"field\" => \"order_date\",\n \"max_age\" => \"30d\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"index":"kibana_sample_data_ecommerce","query":{"term":{"geoip.continent_name":{"value":"Asia"}}}},"pivot":{"group_by":{"customer_id":{"terms":{"field":"customer_id","missing_bucket":true}}},"aggregations":{"max_price":{"max":{"field":"taxful_total_price"}}}},"description":"Maximum priced ecommerce data by customer_id in Asia","dest":{"index":"kibana_sample_data_ecommerce_transform1","pipeline":"add_timestamp_pipeline"},"frequency":"5m","sync":{"time":{"field":"order_date","delay":"60s"}},"retention_policy":{"time":{"field":"order_date","max_age":"30d"}}}'' "$ELASTICSEARCH_URL/_transform/ecommerce_transform1"' - lang: C# source: "var response = await client.TransformManagement\n .PutTransformAsync(transformId: \"ecommerce_transform1\", d1 => d1\n .Description(\"Maximum priced ecommerce data by customer_id in Asia\")\n .Dest(d2 => d2\n .Index(\"kibana_sample_data_ecommerce_transform1\")\n .Pipeline(\"add_timestamp_pipeline\")\n )\n .Frequency(\"5m\")\n .Pivot(d2 => d2\n .Aggregations(d3 => d3\n .Add(\"max_price\", d4 => d4\n .Max(d5 => d5\n .Field(x => x.TaxfulTotalPrice)\n )\n )\n )\n .GroupBy(d3 => d3\n .Add(\"customer_id\", d4 => d4\n .Terms(d5 => d5\n .Field(x => x.CustomerId)\n .MissingBucket(true)\n )\n )\n )\n )\n .RetentionPolicy(d2 => d2\n .Time(d3 => d3\n .Field(x => x.OrderDate)\n .MaxAge(\"30d\")\n )\n )\n .Source(d2 => d2\n .Indices(new[] { \"kibana_sample_data_ecommerce\" })\n .Query(d3 => d3\n .Term(d4 => d4\n .Field(x => x.Geoip.ContinentName)\n .Value(\"Asia\")\n )\n )\n )\n .Sync(d2 => d2\n .Time(d3 => d3\n .Delay(\"60s\")\n .Field(x => x.OrderDate)\n )\n )\n );" - lang: Java source: "client.transform().putTransform(p -> p\n .description(\"Maximum priced ecommerce data by customer_id in Asia\")\n .dest(d -> d\n .index(\"kibana_sample_data_ecommerce_transform1\")\n .pipeline(\"add_timestamp_pipeline\")\n )\n .frequency(f -> f\n .time(\"5m\")\n )\n .pivot(pi -> pi\n .aggregations(\"max_price\", a -> a\n .max(m -> m\n .field(\"taxful_total_price\")\n )\n )\n .groupBy(\"customer_id\", g -> g\n .terms(t -> t\n .field(\"customer_id\")\n .missingBucket(true)\n )\n )\n )\n .retentionPolicy(r -> r\n .time(t -> t\n .field(\"order_date\")\n .maxAge(m -> m\n .time(\"30d\")\n )\n )\n )\n .source(s -> s\n .index(\"kibana_sample_data_ecommerce\")\n .query(q -> q\n .term(te -> te\n .field(\"geoip.continent_name\")\n .value(FieldValue.of(\"Asia\"))\n )\n )\n )\n .sync(sy -> sy\n .time(ti -> ti\n .delay(d -> d\n .time(\"60s\")\n )\n .field(\"order_date\")\n )\n )\n .transformId(\"ecommerce_transform1\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - transform summary: Delete a transform description: "\n\n## Required authorization\n\n* Cluster privileges: `manage_transform`\n" operationId: transform-delete-transform parameters: - name: transform_id in: path description: Identifier for the transform. required: true schema: $ref: '#/components/schemas/_types.Id' - name: force in: query description: "If this value is false, the transform must be stopped before it can be deleted. If true, the transform is\ndeleted regardless of its current state." schema: type: boolean default: false - name: delete_dest_index in: query description: "If this value is true, the destination index is deleted together with the transform. If false, the destination\nindex will not be deleted" schema: type: boolean default: false - name: timeout in: query description: 'Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: DeleteTransformResponseExample1: description: A successful response when the transform is deleted. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 7.5.0 x-codeSamples: - lang: Console source: "DELETE _transform/ecommerce_transform\n" - lang: Python source: "resp = client.transform.delete_transform(\n transform_id=\"ecommerce_transform\",\n)" - lang: JavaScript source: "const response = await client.transform.deleteTransform({\n transform_id: \"ecommerce_transform\",\n});" - lang: Ruby source: "response = client.transform.delete_transform(\n transform_id: \"ecommerce_transform\"\n)" - lang: PHP source: "$resp = $client->transform()->deleteTransform([\n \"transform_id\" => \"ecommerce_transform\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_transform/ecommerce_transform"' - lang: C# source: 'var response = await client.TransformManagement.DeleteTransformAsync(transformId: "ecommerce_transform");' - lang: Java source: "client.transform().deleteTransform(d -> d\n .transformId(\"ecommerce_transform\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_transform/_node_stats: get: tags: - transform summary: Get node stats description: "Get per-node information about transform usage.\n\n## Required authorization\n\n* Cluster privileges: `manage_transform`\n" operationId: transform-get-node-stats responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/transform.get_node_stats.TransformNodeFullStats' x-state: Generally available; Added in 8.15.0 x-metaTags: - content: Elasticsearch name: product_name '/_transform/{transform_id}/_stats': get: tags: - transform summary: Get transform stats description: "Get usage information for transforms.\n\n## Required authorization\n\n* Index privileges: `read`,`view_index_metadata`\n* Cluster privileges: `monitor_transform`\n" operationId: transform-get-transform-stats parameters: - name: transform_id in: path description: "Identifier for the transform. It can be a transform identifier or a\nwildcard expression. You can get information for all transforms by using\n`_all`, by specifying `*` as the ``, or by omitting the\n``." required: true schema: $ref: '#/components/schemas/_types.Names' - name: allow_no_match in: query description: "Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no transforms that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nIf this parameter is false, the request returns a 404 status code when\nthere are no matches or only partial matches." schema: type: boolean default: true - name: basic in: query description: "If true, the response includes `id`, `state`, `node`, `stats`, `health`,\nand basic `checkpointing` information (the last and next checkpoint\nnumbers, and the next checkpoint's `position` and `progress`). Skips\nstatistics that require heavy computations to calculate:\n`operations_behind`, `changes_last_detected_at`, `last_search_time`, and\nthe checkpoint timestamps." schema: type: boolean default: false x-state: Generally available; Added in 8.13.0 - name: from in: query description: Skips the specified number of transforms. schema: type: number default: 0 - name: size in: query description: Specifies the maximum number of transforms to obtain. schema: type: number default: 100 - name: timeout in: query description: Controls the time to wait for the stats schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - count - transforms type: object properties: count: type: number transforms: type: array items: $ref: '#/components/schemas/transform.get_transform_stats.TransformStats' examples: GetTransformStatsResponseExample1: description: A successful response that contains usage information for a transform. value: "{\n \"count\": 1,\n \"transforms\": [\n {\n \"id\": \"ecommerce-customer-transform\",\n \"state\": \"started\",\n \"node\": {\n \"id\": \"cpTIGMsVQ8Gqwqlxxxxxxx\",\n \"name\": \"my.home\",\n \"ephemeral_id\": \"5-L21nFsQxxxxxxxxxx-xx\",\n \"transport_address\": \"127.0.0.1:9300\",\n \"attributes\": {}\n },\n \"stats\": {\n \"pages_processed\": 78,\n \"documents_processed\": 6027,\n \"documents_indexed\": 68,\n \"documents_deleted\": 22,\n \"delete_time_in_ms\": 214,\n \"trigger_count\": 168,\n \"index_time_in_ms\": 412,\n \"index_total\": 20,\n \"index_failures\": 0,\n \"search_time_in_ms\": 353,\n \"search_total\": 78,\n \"search_failures\": 0,\n \"processing_time_in_ms\": 8,\n \"processing_total\": 78,\n \"exponential_avg_checkpoint_duration_ms\": 97.30637923893185,\n \"exponential_avg_documents_indexed\": 2.2064915040974062,\n \"exponential_avg_documents_processed\": 179.89419945785045\n },\n \"checkpointing\": {\n \"last\": {\n \"checkpoint\": 20,\n \"timestamp_millis\": 1585344558220,\n \"time_upper_bound_millis\": 1585344498220\n },\n \"changes_last_detected_at\": 1585344558219\n },\n \"health\": {\n \"status\": \"green\"\n }\n }\n ]\n}" x-state: Generally available; Added in 7.5.0 x-codeSamples: - lang: Console source: "GET _transform/ecommerce-customer-transform/_stats\n" - lang: Python source: "resp = client.transform.get_transform_stats(\n transform_id=\"ecommerce-customer-transform\",\n)" - lang: JavaScript source: "const response = await client.transform.getTransformStats({\n transform_id: \"ecommerce-customer-transform\",\n});" - lang: Ruby source: "response = client.transform.get_transform_stats(\n transform_id: \"ecommerce-customer-transform\"\n)" - lang: PHP source: "$resp = $client->transform()->getTransformStats([\n \"transform_id\" => \"ecommerce-customer-transform\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_transform/ecommerce-customer-transform/_stats"' - lang: C# source: 'var response = await client.TransformManagement.GetTransformStatsAsync(transformId: new[] { "ecommerce-customer-transform" });' - lang: Java source: "client.transform().getTransformStats(g -> g\n .transformId(\"ecommerce-customer-transform\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_transform/{transform_id}/_preview': post: tags: - transform summary: "Preview a transform\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_transform/_preview\n
\n
\n POST\n /_transform/_preview\n
\n
\n GET\n /_transform/{transform_id}/_preview\n
\n
\n POST\n /_transform/{transform_id}/_preview\n
\n \n\nGenerates a preview of the results that you will get when you create a transform with the same configuration.\n\nIt returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also\ngenerates a list of mappings and settings for the destination index. These values are determined based on the field\ntypes of the source index and the transform aggregations.\n\n## Required authorization\n\n* Index privileges: `read`,`view_index_metadata`\n* Cluster privileges: `manage_transform`\n" operationId: transform-preview-transform parameters: - $ref: '#/components/parameters/transform.preview_transform-transform_id' - $ref: '#/components/parameters/transform.preview_transform-timeout' requestBody: $ref: '#/components/requestBodies/transform.preview_transform' responses: '200': $ref: '#/components/responses/transform.preview_transform-200' x-state: Generally available; Added in 7.2.0 x-codeSamples: - lang: Console source: "POST _transform/_preview\n{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n }\n}" - lang: Python source: "resp = client.transform.preview_transform(\n source={\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n pivot={\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": True\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.transform.previewTransform({\n source: {\n index: \"kibana_sample_data_ecommerce\",\n },\n pivot: {\n group_by: {\n customer_id: {\n terms: {\n field: \"customer_id\",\n missing_bucket: true,\n },\n },\n },\n aggregations: {\n max_price: {\n max: {\n field: \"taxful_total_price\",\n },\n },\n },\n },\n});" - lang: Ruby source: "response = client.transform.preview_transform(\n body: {\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->transform()->previewTransform([\n \"body\" => [\n \"source\" => [\n \"index\" => \"kibana_sample_data_ecommerce\",\n ],\n \"pivot\" => [\n \"group_by\" => [\n \"customer_id\" => [\n \"terms\" => [\n \"field\" => \"customer_id\",\n \"missing_bucket\" => true,\n ],\n ],\n ],\n \"aggregations\" => [\n \"max_price\" => [\n \"max\" => [\n \"field\" => \"taxful_total_price\",\n ],\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"index":"kibana_sample_data_ecommerce"},"pivot":{"group_by":{"customer_id":{"terms":{"field":"customer_id","missing_bucket":true}}},"aggregations":{"max_price":{"max":{"field":"taxful_total_price"}}}}}'' "$ELASTICSEARCH_URL/_transform/_preview"' - lang: C# source: "var response = await client.TransformManagement\n .PreviewTransformAsync(d1 => d1\n .Pivot(d2 => d2\n .Aggregations(d3 => d3\n .Add(\"max_price\", d4 => d4\n .Max(d5 => d5\n .Field(x => x.TaxfulTotalPrice)\n )\n )\n )\n .GroupBy(d3 => d3\n .Add(\"customer_id\", d4 => d4\n .Terms(d5 => d5\n .Field(x => x.CustomerId)\n .MissingBucket(true)\n )\n )\n )\n )\n .Source(d2 => d2\n .Indices(new[] { \"kibana_sample_data_ecommerce\" })\n )\n );" - lang: Java source: "client.transform().previewTransform(p -> p\n .pivot(pi -> pi\n .aggregations(\"max_price\", a -> a\n .max(m -> m\n .field(\"taxful_total_price\")\n )\n )\n .groupBy(\"customer_id\", g -> g\n .terms(t -> t\n .field(\"customer_id\")\n .missingBucket(true)\n )\n )\n )\n .source(s -> s\n .index(\"kibana_sample_data_ecommerce\")\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_transform/{transform_id}/_reset': post: tags: - transform summary: Reset a transform description: "Before you can reset it, you must stop it; alternatively, use the `force` query parameter.\nIf the destination index was created by the transform, it is deleted.\n\n## Required authorization\n\n* Cluster privileges: `manage_transform`\n" operationId: transform-reset-transform parameters: - name: transform_id in: path description: "Identifier for the transform. This identifier can contain lowercase alphanumeric characters (a-z and 0-9),\nhyphens, and underscores. It has a 64 character limit and must start and end with alphanumeric characters." required: true schema: $ref: '#/components/schemas/_types.Id' - name: force in: query description: "If this value is `true`, the transform is reset regardless of its current state. If it's `false`, the transform\nmust be stopped before it can be reset." schema: type: boolean default: false - name: timeout in: query description: 'Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: ResetTransformResponseExample1: description: A successful response when the transform is reset. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 8.1.0 x-codeSamples: - lang: Console source: "POST _transform/ecommerce_transform/_reset\n" - lang: Python source: "resp = client.transform.reset_transform(\n transform_id=\"ecommerce_transform\",\n)" - lang: JavaScript source: "const response = await client.transform.resetTransform({\n transform_id: \"ecommerce_transform\",\n});" - lang: Ruby source: "response = client.transform.reset_transform(\n transform_id: \"ecommerce_transform\"\n)" - lang: PHP source: "$resp = $client->transform()->resetTransform([\n \"transform_id\" => \"ecommerce_transform\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_transform/ecommerce_transform/_reset"' - lang: C# source: 'var response = await client.TransformManagement.ResetTransformAsync(transformId: "ecommerce_transform");' - lang: Java source: "client.transform().resetTransform(r -> r\n .transformId(\"ecommerce_transform\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_transform/{transform_id}/_schedule_now': post: tags: - transform summary: Schedule a transform to start now description: "Instantly run a transform to process data.\nIf you run this API, the transform will process the new data instantly,\nwithout waiting for the configured frequency interval. After the API is called,\nthe transform will be processed again at `now + frequency` unless the API\nis called again in the meantime.\n\n## Required authorization\n\n* Cluster privileges: `manage_transform`\n" operationId: transform-schedule-now-transform parameters: - name: transform_id in: path description: Identifier for the transform. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: Controls the time to wait for the scheduling to take place schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: defer in: query description: "When true, defers the scheduling by the transform's configured sync delay\ninstead of triggering immediately. The transform will process new data after\nthe delay elapses rather than right away." schema: type: boolean default: false x-state: Generally available; Added in 9.4.0 responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: ScheduleNowTransformResponseExample1: description: A successful response when the transform is scheduled to run now. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 8.7.0 x-codeSamples: - lang: Console source: "POST _transform/ecommerce_transform/_schedule_now\n" - lang: Python source: "resp = client.transform.schedule_now_transform(\n transform_id=\"ecommerce_transform\",\n)" - lang: JavaScript source: "const response = await client.transform.scheduleNowTransform({\n transform_id: \"ecommerce_transform\",\n});" - lang: Ruby source: "response = client.transform.schedule_now_transform(\n transform_id: \"ecommerce_transform\"\n)" - lang: PHP source: "$resp = $client->transform()->scheduleNowTransform([\n \"transform_id\" => \"ecommerce_transform\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_transform/ecommerce_transform/_schedule_now"' - lang: C# source: 'var response = await client.TransformManagement.ScheduleNowTransformAsync(transformId: "ecommerce_transform");' - lang: Java source: "client.transform().scheduleNowTransform(s -> s\n .transformId(\"ecommerce_transform\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_transform/set_upgrade_mode: post: tags: - transform summary: Set upgrade_mode for transform indices description: "Sets a cluster wide upgrade_mode setting that prepares transform\nindices for an upgrade.\nWhen upgrading your cluster, in some circumstances you must restart your\nnodes and reindex your transform indices. In those circumstances,\nthere must be no transforms running. You can close the transforms,\ndo the upgrade, then open all the transforms again. Alternatively,\nyou can use this API to temporarily halt tasks associated with the transforms\nand prevent new transforms from opening. You can also use this API\nduring upgrades that do not require you to reindex your transform\nindices, though stopping transforms is not a requirement in that case.\nYou can see the current value for the upgrade_mode setting by using the get\ntransform info API.\n\n## Required authorization\n\n* Cluster privileges: `manage_transform`\n" operationId: transform-set-upgrade-mode parameters: - name: enabled in: query description: "When `true`, it enables `upgrade_mode` which temporarily halts all\ntransform tasks and prohibits new transform tasks from\nstarting." schema: type: boolean default: false - name: timeout in: query description: The time to wait for the request to be completed. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' x-state: Generally available; Added in 8.18.0 x-codeSamples: - lang: Console source: "POST _transform/set_upgrade_mode?enabled=true\n" - lang: Python source: "resp = client.transform.set_upgrade_mode(\n enabled=True,\n)" - lang: JavaScript source: "const response = await client.transform.setUpgradeMode({\n enabled: \"true\",\n});" - lang: Ruby source: "response = client.transform.set_upgrade_mode(\n enabled: \"true\"\n)" - lang: PHP source: "$resp = $client->transform()->setUpgradeMode([\n \"enabled\" => \"true\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_transform/set_upgrade_mode?enabled=true"' - lang: C# source: "var response = await client.TransformManagement\n .SetUpgradeModeAsync(d1 => d1\n .Enabled(true)\n );" - lang: Java source: "client.transform().setUpgradeMode(s -> s\n .enabled(true)\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_transform/{transform_id}/_start': post: tags: - transform summary: Start a transform description: "When you start a transform, it creates the destination index if it does not already exist. The `number_of_shards` is\nset to `1` and the `auto_expand_replicas` is set to `0-1`. If it is a pivot transform, it deduces the mapping\ndefinitions for the destination index from the source indices and the transform aggregations. If fields in the\ndestination index are derived from scripts (as in the case of `scripted_metric` or `bucket_script` aggregations),\nthe transform uses dynamic mappings unless an index template exists. If it is a latest transform, it does not deduce\nmapping definitions; it uses dynamic mappings. To use explicit mappings, create the destination index before you\nstart the transform. Alternatively, you can create an index template, though it does not affect the deduced mappings\nin a pivot transform.\n\nWhen the transform starts, a series of validations occur to ensure its success. If you deferred validation when you\ncreated the transform, they occur when you start the transform—​with the exception of privilege checks. When\nElasticsearch security features are enabled, the transform remembers which roles the user that created it had at the\ntime of creation and uses those same roles. If those roles do not have the required privileges on the source and\ndestination indices, the transform fails when it attempts unauthorized operations.\n\n## Required authorization\n\n* Index privileges: `read`,`view_index_metadata`\n* Cluster privileges: `manage_transform`\n" operationId: transform-start-transform parameters: - name: transform_id in: path description: Identifier for the transform. required: true schema: $ref: '#/components/schemas/_types.Id' - name: timeout in: query description: 'Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.' schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: from in: query description: Restricts the set of transformed entities to those changed after this time. Relative times like now-30d are supported. Only applicable for continuous transforms. schema: type: string - name: initial_delay in: query description: "A one-time, reduced sync delay that applies until the transform has processed its first document.\nIt then reverts to the `sync.time.delay` of the transform.\nOnly applicable for continuous transforms, and it can't be greater than `sync.time.delay`." schema: $ref: '#/components/schemas/_types.Duration' x-state: Generally available; Added in 9.6.0 responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: StartTransformResponseExample1: description: A successful response when a transform starts. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 7.5.0 x-codeSamples: - lang: Console source: "POST _transform/ecommerce-customer-transform/_start\n" - lang: Python source: "resp = client.transform.start_transform(\n transform_id=\"ecommerce-customer-transform\",\n)" - lang: JavaScript source: "const response = await client.transform.startTransform({\n transform_id: \"ecommerce-customer-transform\",\n});" - lang: Ruby source: "response = client.transform.start_transform(\n transform_id: \"ecommerce-customer-transform\"\n)" - lang: PHP source: "$resp = $client->transform()->startTransform([\n \"transform_id\" => \"ecommerce-customer-transform\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_transform/ecommerce-customer-transform/_start"' - lang: C# source: 'var response = await client.TransformManagement.StartTransformAsync(transformId: "ecommerce-customer-transform");' - lang: Java source: "client.transform().startTransform(s -> s\n .transformId(\"ecommerce-customer-transform\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_transform/{transform_id}/_stop': post: tags: - transform summary: Stop transforms description: "Stops one or more transforms.\n\n## Required authorization\n\n* Cluster privileges: `manage_transform`\n" operationId: transform-stop-transform parameters: - name: transform_id in: path description: "Identifier for the transform. To stop multiple transforms, use a comma-separated list or a wildcard expression.\nTo stop all transforms, use `_all` or `*` as the identifier." required: true schema: $ref: '#/components/schemas/_types.Name' - name: allow_no_match in: query description: "Specifies what to do when the request: contains wildcard expressions and there are no transforms that match;\ncontains the `_all` string or no identifiers and there are no matches; contains wildcard expressions and there\nare only partial matches.\n\nIf it is true, the API returns a successful acknowledgement message when there are no matches. When there are\nonly partial matches, the API stops the appropriate transforms.\n\nIf it is false, the request returns a 404 status code when there are no matches or only partial matches." schema: type: boolean default: true - name: force in: query description: 'If it is true, the API forcefully stops the transforms.' schema: type: boolean default: false - name: timeout in: query description: "Period to wait for a response when `wait_for_completion` is `true`. If no response is received before the\ntimeout expires, the request returns a timeout exception. However, the request continues processing and\neventually moves the transform to a STOPPED state." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: wait_for_checkpoint in: query description: "If it is true, the transform does not completely stop until the current checkpoint is completed. If it is false,\nthe transform stops as soon as possible." schema: type: boolean default: false - name: wait_for_completion in: query description: "If it is true, the API blocks until the indexer state completely stops. If it is false, the API returns\nimmediately and the indexer is stopped asynchronously in the background." schema: type: boolean default: false responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: StopTransformResponseExample1: description: A successful response when a transform stops. value: "{\n \"acknowledged\": true\n}" x-state: Generally available; Added in 7.5.0 x-codeSamples: - lang: Console source: "POST _transform/ecommerce_transform/_stop\n" - lang: Python source: "resp = client.transform.stop_transform(\n transform_id=\"ecommerce_transform\",\n)" - lang: JavaScript source: "const response = await client.transform.stopTransform({\n transform_id: \"ecommerce_transform\",\n});" - lang: Ruby source: "response = client.transform.stop_transform(\n transform_id: \"ecommerce_transform\"\n)" - lang: PHP source: "$resp = $client->transform()->stopTransform([\n \"transform_id\" => \"ecommerce_transform\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_transform/ecommerce_transform/_stop"' - lang: C# source: 'var response = await client.TransformManagement.StopTransformAsync(transformId: "ecommerce_transform");' - lang: Java source: "client.transform().stopTransform(s -> s\n .transformId(\"ecommerce_transform\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_transform/{transform_id}/_update': post: tags: - transform summary: Update a transform description: "Updates certain properties of a transform.\n\nAll updated properties except `description` do not take effect until after the transform starts the next checkpoint,\nthus there is data consistency in each checkpoint. To use this API, you must have `read` and `view_index_metadata`\nprivileges for the source indices. You must also have `index` and `read` privileges for the destination index. When\nElasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the\ntime of update and runs with those privileges.\n\n## Required authorization\n\n* Index privileges: `read`,`index`,`view_index_metadata`\n* Cluster privileges: `manage_transform`\n" operationId: transform-update-transform parameters: - name: transform_id in: path description: Identifier for the transform. required: true schema: $ref: '#/components/schemas/_types.Id' - name: defer_validation in: query description: "When true, deferrable validations are not run. This behavior may be\ndesired if the source index does not exist until after the transform is\ncreated." schema: type: boolean - name: timeout in: query description: "Period to wait for a response. If no response is received before the\ntimeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s requestBody: content: application/json: schema: type: object properties: dest: allOf: - $ref: '#/components/schemas/transform._types.Destination' description: The destination for the transform. description: type: string description: Free text description of the transform. frequency: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The interval between checks for changes in the source indices when the\ntransform is running continuously. Also determines the retry interval in\nthe event of transient failures while the transform is searching or\nindexing. The minimum value is 1s and the maximum is 1h." default: 1m _meta: allOf: - $ref: '#/components/schemas/_types.Metadata' description: Defines optional transform metadata. source: allOf: - $ref: '#/components/schemas/transform._types.Source' description: The source of the data for the transform. settings: allOf: - $ref: '#/components/schemas/transform._types.Settings' description: Defines optional transform settings. sync: allOf: - $ref: '#/components/schemas/transform._types.SyncContainer' description: Defines the properties transforms require to run continuously. retention_policy: oneOf: - $ref: '#/components/schemas/transform._types.RetentionPolicyContainer' - type: - 'null' - string description: "Defines a retention policy for the transform. Data that meets the defined\ncriteria is deleted from the destination index." examples: UpdateTransformRequestExample1: description: Run `POST _transform/simple-kibana-ecomm-pivot/_update` to update a transform that uses the pivot method. value: "{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform_v2\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"15m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"120s\"\n }\n }\n}" x-codeSamples: - lang: Console source: "POST _transform/simple-kibana-ecomm-pivot/_update\n{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform_v2\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"15m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"120s\"\n }\n }\n}" - lang: Python source: "resp = client.transform.update_transform(\n transform_id=\"simple-kibana-ecomm-pivot\",\n source={\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n description=\"Maximum priced ecommerce data by customer_id in Asia\",\n dest={\n \"index\": \"kibana_sample_data_ecommerce_transform_v2\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n frequency=\"15m\",\n sync={\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"120s\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.transform.updateTransform({\n transform_id: \"simple-kibana-ecomm-pivot\",\n source: {\n index: \"kibana_sample_data_ecommerce\",\n query: {\n term: {\n \"geoip.continent_name\": {\n value: \"Asia\",\n },\n },\n },\n },\n description: \"Maximum priced ecommerce data by customer_id in Asia\",\n dest: {\n index: \"kibana_sample_data_ecommerce_transform_v2\",\n pipeline: \"add_timestamp_pipeline\",\n },\n frequency: \"15m\",\n sync: {\n time: {\n field: \"order_date\",\n delay: \"120s\",\n },\n },\n});" - lang: Ruby source: "response = client.transform.update_transform(\n transform_id: \"simple-kibana-ecomm-pivot\",\n body: {\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform_v2\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"15m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"120s\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->transform()->updateTransform([\n \"transform_id\" => \"simple-kibana-ecomm-pivot\",\n \"body\" => [\n \"source\" => [\n \"index\" => \"kibana_sample_data_ecommerce\",\n \"query\" => [\n \"term\" => [\n \"geoip.continent_name\" => [\n \"value\" => \"Asia\",\n ],\n ],\n ],\n ],\n \"description\" => \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\" => [\n \"index\" => \"kibana_sample_data_ecommerce_transform_v2\",\n \"pipeline\" => \"add_timestamp_pipeline\",\n ],\n \"frequency\" => \"15m\",\n \"sync\" => [\n \"time\" => [\n \"field\" => \"order_date\",\n \"delay\" => \"120s\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"index":"kibana_sample_data_ecommerce","query":{"term":{"geoip.continent_name":{"value":"Asia"}}}},"description":"Maximum priced ecommerce data by customer_id in Asia","dest":{"index":"kibana_sample_data_ecommerce_transform_v2","pipeline":"add_timestamp_pipeline"},"frequency":"15m","sync":{"time":{"field":"order_date","delay":"120s"}}}'' "$ELASTICSEARCH_URL/_transform/simple-kibana-ecomm-pivot/_update"' - lang: C# source: "var response = await client.TransformManagement\n .UpdateTransformAsync(transformId: \"simple-kibana-ecomm-pivot\", d1 => d1\n .Description(\"Maximum priced ecommerce data by customer_id in Asia\")\n .Dest(d2 => d2\n .Index(\"kibana_sample_data_ecommerce_transform_v2\")\n .Pipeline(\"add_timestamp_pipeline\")\n )\n .Frequency(\"15m\")\n .Source(d2 => d2\n .Indices(new[] { \"kibana_sample_data_ecommerce\" })\n .Query(d3 => d3\n .Term(d4 => d4\n .Field(x => x.Geoip.ContinentName)\n .Value(\"Asia\")\n )\n )\n )\n .Sync(d2 => d2\n .Time(d3 => d3\n .Delay(\"120s\")\n .Field(x => x.OrderDate)\n )\n )\n );" - lang: Java source: "client.transform().updateTransform(u -> u\n .description(\"Maximum priced ecommerce data by customer_id in Asia\")\n .dest(d -> d\n .index(\"kibana_sample_data_ecommerce_transform_v2\")\n .pipeline(\"add_timestamp_pipeline\")\n )\n .frequency(f -> f\n .time(\"15m\")\n )\n .source(s -> s\n .index(\"kibana_sample_data_ecommerce\")\n .query(q -> q\n .term(t -> t\n .field(\"geoip.continent_name\")\n .value(FieldValue.of(\"Asia\"))\n )\n )\n )\n .sync(sy -> sy\n .time(t -> t\n .delay(d -> d\n .time(\"120s\")\n )\n .field(\"order_date\")\n )\n )\n .transformId(\"simple-kibana-ecomm-pivot\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - create_time - dest - id - settings - source - version type: object properties: authorization: allOf: - $ref: '#/components/schemas/ml._types.TransformAuthorization' create_time: type: number description: type: string dest: allOf: - $ref: '#/components/schemas/transform._types.Destination' frequency: allOf: - $ref: '#/components/schemas/_types.Duration' id: allOf: - $ref: '#/components/schemas/_types.Id' latest: allOf: - $ref: '#/components/schemas/transform._types.Latest' pivot: allOf: - $ref: '#/components/schemas/transform._types.Pivot' retention_policy: allOf: - $ref: '#/components/schemas/transform._types.RetentionPolicyContainer' settings: allOf: - $ref: '#/components/schemas/transform._types.Settings' source: allOf: - $ref: '#/components/schemas/_global.reindex.Source' sync: allOf: - $ref: '#/components/schemas/transform._types.SyncContainer' version: allOf: - $ref: '#/components/schemas/_types.VersionString' _meta: allOf: - $ref: '#/components/schemas/_types.Metadata' examples: UpdateTransformResponseExample1: description: A successful response when creating a transform. value: "{\n \"id\": \"simple-kibana-ecomm-pivot\",\n \"authorization\": {\n \"roles\": [\n \"superuser\"\n ]\n },\n \"version\": \"10.0.0\",\n \"create_time\": 1712951576767,\n \"source\": {\n \"index\": [\n \"kibana_sample_data_ecommerce\"\n ],\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform_v2\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"15m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"120s\"\n }\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"settings\": {},\n \"retention_policy\": {\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n }\n}" x-state: Generally available; Added in 7.2.0 x-codeSamples: - lang: Console source: "POST _transform/simple-kibana-ecomm-pivot/_update\n{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform_v2\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"15m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"120s\"\n }\n }\n}" - lang: Python source: "resp = client.transform.update_transform(\n transform_id=\"simple-kibana-ecomm-pivot\",\n source={\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n description=\"Maximum priced ecommerce data by customer_id in Asia\",\n dest={\n \"index\": \"kibana_sample_data_ecommerce_transform_v2\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n frequency=\"15m\",\n sync={\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"120s\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.transform.updateTransform({\n transform_id: \"simple-kibana-ecomm-pivot\",\n source: {\n index: \"kibana_sample_data_ecommerce\",\n query: {\n term: {\n \"geoip.continent_name\": {\n value: \"Asia\",\n },\n },\n },\n },\n description: \"Maximum priced ecommerce data by customer_id in Asia\",\n dest: {\n index: \"kibana_sample_data_ecommerce_transform_v2\",\n pipeline: \"add_timestamp_pipeline\",\n },\n frequency: \"15m\",\n sync: {\n time: {\n field: \"order_date\",\n delay: \"120s\",\n },\n },\n});" - lang: Ruby source: "response = client.transform.update_transform(\n transform_id: \"simple-kibana-ecomm-pivot\",\n body: {\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform_v2\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"15m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"120s\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->transform()->updateTransform([\n \"transform_id\" => \"simple-kibana-ecomm-pivot\",\n \"body\" => [\n \"source\" => [\n \"index\" => \"kibana_sample_data_ecommerce\",\n \"query\" => [\n \"term\" => [\n \"geoip.continent_name\" => [\n \"value\" => \"Asia\",\n ],\n ],\n ],\n ],\n \"description\" => \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\" => [\n \"index\" => \"kibana_sample_data_ecommerce_transform_v2\",\n \"pipeline\" => \"add_timestamp_pipeline\",\n ],\n \"frequency\" => \"15m\",\n \"sync\" => [\n \"time\" => [\n \"field\" => \"order_date\",\n \"delay\" => \"120s\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"source":{"index":"kibana_sample_data_ecommerce","query":{"term":{"geoip.continent_name":{"value":"Asia"}}}},"description":"Maximum priced ecommerce data by customer_id in Asia","dest":{"index":"kibana_sample_data_ecommerce_transform_v2","pipeline":"add_timestamp_pipeline"},"frequency":"15m","sync":{"time":{"field":"order_date","delay":"120s"}}}'' "$ELASTICSEARCH_URL/_transform/simple-kibana-ecomm-pivot/_update"' - lang: C# source: "var response = await client.TransformManagement\n .UpdateTransformAsync(transformId: \"simple-kibana-ecomm-pivot\", d1 => d1\n .Description(\"Maximum priced ecommerce data by customer_id in Asia\")\n .Dest(d2 => d2\n .Index(\"kibana_sample_data_ecommerce_transform_v2\")\n .Pipeline(\"add_timestamp_pipeline\")\n )\n .Frequency(\"15m\")\n .Source(d2 => d2\n .Indices(new[] { \"kibana_sample_data_ecommerce\" })\n .Query(d3 => d3\n .Term(d4 => d4\n .Field(x => x.Geoip.ContinentName)\n .Value(\"Asia\")\n )\n )\n )\n .Sync(d2 => d2\n .Time(d3 => d3\n .Delay(\"120s\")\n .Field(x => x.OrderDate)\n )\n )\n );" - lang: Java source: "client.transform().updateTransform(u -> u\n .description(\"Maximum priced ecommerce data by customer_id in Asia\")\n .dest(d -> d\n .index(\"kibana_sample_data_ecommerce_transform_v2\")\n .pipeline(\"add_timestamp_pipeline\")\n )\n .frequency(f -> f\n .time(\"15m\")\n )\n .source(s -> s\n .index(\"kibana_sample_data_ecommerce\")\n .query(q -> q\n .term(t -> t\n .field(\"geoip.continent_name\")\n .value(FieldValue.of(\"Asia\"))\n )\n )\n )\n .sync(sy -> sy\n .time(t -> t\n .delay(d -> d\n .time(\"120s\")\n )\n .field(\"order_date\")\n )\n )\n .transformId(\"simple-kibana-ecomm-pivot\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_transform/_upgrade: post: tags: - transform summary: Upgrade all transforms description: "Transforms are compatible across minor versions and between supported major versions.\nHowever, over time, the format of transform configuration information may change.\nThis API identifies transforms that have a legacy configuration format and upgrades them to the latest version.\nIt also cleans up the internal data structures that store the transform state and checkpoints.\nThe upgrade does not affect the source and destination indices.\nThe upgrade also does not affect the roles that transforms use when Elasticsearch security features are enabled; the role used to read source data and write to the destination index remains unchanged.\n\nIf a transform upgrade step fails, the upgrade stops and an error is returned about the underlying issue.\nResolve the issue then re-run the process again.\nA summary is returned when the upgrade is finished.\n\nTo ensure continuous transforms remain running during a major version upgrade of the cluster – for example, from 7.16 to 8.0 – it is recommended to upgrade transforms before upgrading the cluster.\nYou may want to perform a recent cluster backup prior to the upgrade.\n\n## Required authorization\n\n* Cluster privileges: `manage_transform`\n" operationId: transform-upgrade-transforms parameters: - name: dry_run in: query description: 'When true, the request checks for updates but does not run them.' schema: type: boolean default: false - name: timeout in: query description: "Period to wait for a response. If no response is received before the timeout expires, the request fails and\nreturns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - needs_update - no_action - updated type: object properties: needs_update: type: number description: The number of transforms that need to be upgraded. no_action: type: number description: The number of transforms that don’t require upgrading. updated: type: number description: The number of transforms that have been upgraded. examples: UpgradeTransformResponseExample1: description: A successful response contains a summary when all transforms are upgraded. value: "{\n \"needs_update\": 0,\n \"updated\": 2,\n \"no_action\": 1\n}" x-state: Generally available; Added in 7.16.0 x-codeSamples: - lang: Console source: "POST _transform/_upgrade\n" - lang: Python source: resp = client.transform.upgrade_transforms() - lang: JavaScript source: const response = await client.transform.upgradeTransforms(); - lang: Ruby source: response = client.transform.upgrade_transforms - lang: PHP source: $resp = $client->transform()->upgradeTransforms(); - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_transform/_upgrade"' - lang: C# source: var response = await client.TransformManagement.UpgradeTransformsAsync(); - lang: Java source: "client.transform().upgradeTransforms(u -> u);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_update/{id}': post: tags: - document summary: Update a document description: "Update a document by running a script or passing a partial document.\n\nIf the Elasticsearch security features are enabled, you must have the `index` or `write` index privilege for the target index or index alias.\n\nThe script can update, delete, or skip modifying the document.\nThe API also supports passing a partial document, which is merged into the existing document.\nTo fully replace an existing document, use the index API.\nThis operation:\n\n* Gets the document (collocated with the shard) from the index.\n* Runs the specified script.\n* Indexes the result.\n\nThe document must still be reindexed, but using this API removes some network roundtrips and reduces chances of version conflicts between the GET and the index operation.\n\nThe `_source` field must be enabled to use this API.\nIn addition to `_source`, you can access the following variables through the `ctx` map: `_index`, `_type`, `_id`, `_version`, `_routing`, and `_now` (the current timestamp).\nFor usage examples such as partial updates, upserts, and scripted updates, see the External documentation.\n\n## Required authorization\n\n* Index privileges: `write`\n" externalDocs: description: More about updating a document url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/update-document x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/docs-update.html operationId: update parameters: - name: index in: path description: "The name of the target index.\nBy default, the index is created automatically if it doesn't exist." required: true schema: $ref: '#/components/schemas/_types.IndexName' - name: id in: path description: A unique identifier for the document to be updated. required: true schema: $ref: '#/components/schemas/_types.Id' - name: if_primary_term in: query description: Only perform the operation if the document has this primary term. schema: type: number - name: if_seq_no in: query description: Only perform the operation if the document has this sequence number. schema: $ref: '#/components/schemas/_types.SequenceNumber' - name: include_source_on_error in: query description: True or false if to include the document source in the error message in case of parsing errors. schema: type: boolean default: true - name: lang in: query description: The script language. schema: type: string default: painless - name: refresh in: query description: "If 'true', Elasticsearch refreshes the affected shards to make this operation visible to search.\nIf 'wait_for', it waits for a refresh to make this operation visible to search.\nIf 'false', it does nothing with refreshes." schema: allOf: - $ref: '#/components/schemas/_types.Refresh' default: 'false' - name: require_alias in: query description: 'If `true`, the destination must be an index alias.' schema: type: boolean default: false - name: retry_on_conflict in: query description: The number of times the operation should be retried when a conflict occurs. schema: type: number default: 0 - name: routing in: query description: "A custom value used to route operations to a specific shard.\nNot allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead." schema: $ref: '#/components/schemas/_types.Routing' x-state: Generally available - name: timeout in: query description: "The period to wait for the following operations: dynamic mapping updates and waiting for active shards.\nElasticsearch waits for at least the timeout period before failing.\nThe actual wait time could be longer, particularly when multiple waits occur." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 1m - name: wait_for_active_shards in: query description: "The number of copies of each shard that must be active before proceeding with the operation.\nSet to 'all' or any positive integer up to the total number of shards in the index (`number_of_replicas`+1).\nThe default value of `1` means it waits for each primary shard to be active." schema: allOf: - $ref: '#/components/schemas/_types.WaitForActiveShards' default: '1' - name: _source in: query description: "If `false`, source retrieval is turned off.\nYou can also specify a comma-separated list of the fields you want to retrieve." schema: allOf: - $ref: '#/components/schemas/_global.search._types.SourceConfigParam' default: 'true' - name: _source_excludes in: query description: The source fields you want to exclude. schema: $ref: '#/components/schemas/_types.Fields' - name: _source_includes in: query description: The source fields you want to retrieve. schema: $ref: '#/components/schemas/_types.Fields' requestBody: content: application/json: schema: type: object properties: detect_noop: type: boolean description: 'If `true`, the `result` in the response is set to `noop` (no operation) when there are no changes to the document.' default: true doc: type: object description: "A partial update to an existing document.\nIf both `doc` and `script` are specified, `doc` is ignored." doc_as_upsert: type: boolean description: "If `true`, use the contents of 'doc' as the value of 'upsert'.\nNOTE: Using ingest pipelines with `doc_as_upsert` is not supported." default: false script: allOf: - $ref: '#/components/schemas/_types.Script' description: The script to run to update the document. scripted_upsert: type: boolean description: 'If `true`, run the script whether or not the document exists.' default: false _source: allOf: - $ref: '#/components/schemas/_global.search._types.SourceConfig' description: "If `false`, turn off source retrieval.\nYou can also specify a comma-separated list of the fields you want to retrieve." default: 'true' upsert: type: object description: "If the document does not already exist, the contents of 'upsert' are inserted as a new document.\nIf the document exists, the 'script' is run." examples: UpdateRequestExample1: summary: Update a counter with a script description: Run `POST test/_update/1` to increment a counter by using a script. value: "{\n \"script\" : {\n \"source\": \"ctx._source.counter += params.count\",\n \"lang\": \"painless\",\n \"params\" : {\n \"count\" : 4\n }\n }\n}" x-codeSamples: - lang: Console source: "POST test/_update/1\n{\n \"script\" : {\n \"source\": \"ctx._source.counter += params.count\",\n \"lang\": \"painless\",\n \"params\" : {\n \"count\" : 4\n }\n }\n}" - lang: Python source: "resp = client.update(\n index=\"test\",\n id=\"1\",\n script={\n \"source\": \"ctx._source.counter += params.count\",\n \"lang\": \"painless\",\n \"params\": {\n \"count\": 4\n }\n },\n)" - lang: JavaScript source: "const response = await client.update({\n index: \"test\",\n id: 1,\n script: {\n source: \"ctx._source.counter += params.count\",\n lang: \"painless\",\n params: {\n count: 4,\n },\n },\n});" - lang: Ruby source: "response = client.update(\n index: \"test\",\n id: \"1\",\n body: {\n \"script\": {\n \"source\": \"ctx._source.counter += params.count\",\n \"lang\": \"painless\",\n \"params\": {\n \"count\": 4\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->update([\n \"index\" => \"test\",\n \"id\" => \"1\",\n \"body\" => [\n \"script\" => [\n \"source\" => \"ctx._source.counter += params.count\",\n \"lang\" => \"painless\",\n \"params\" => [\n \"count\" => 4,\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"script":{"source":"ctx._source.counter += params.count","lang":"painless","params":{"count":4}}}'' "$ELASTICSEARCH_URL/test/_update/1"' - lang: C# source: "var response = await client\n .UpdateAsync(index: \"test\", routeSlice: null, id: \"1\", d1 => d1\n .Script(d2 => d2\n .Lang(ScriptLanguage.Painless)\n .Params(new Dictionary()\n {\n { \"count\", 4 }\n })\n .Source(\"ctx._source.counter += params.count\")\n )\n );" - lang: Java source: "client.update(u -> u\n .id(\"1\")\n .index(\"test\")\n .script(s -> s\n .source(so -> so\n .scriptString(\"ctx._source.counter += params.count\")\n )\n .params(\"count\", JsonData.fromJson(\"4\"))\n .lang(\"painless\")\n )\n,Void.class);\n" UpdateRequestExample10: summary: Scripted upsert description: "Run `POST test/_update/1` to perform a scripted upsert. When `scripted_upsert` is `true`, the script runs whether or not the document exists.\n" value: "{\n \"scripted_upsert\": true,\n \"script\": {\n \"source\": \"\"\"\n if ( ctx.op == 'create' ) {\n ctx._source.counter = params.count\n } else {\n ctx._source.counter += params.count\n }\n \"\"\",\n \"params\": {\n \"count\": 4\n }\n },\n \"upsert\": {}\n}" x-codeSamples: - lang: Console source: "POST test/_update/1\n{\n \"scripted_upsert\": true,\n \"script\": {\n \"source\": \"\"\"\n if ( ctx.op == 'create' ) {\n ctx._source.counter = params.count\n } else {\n ctx._source.counter += params.count\n }\n \"\"\",\n \"params\": {\n \"count\": 4\n }\n },\n \"upsert\": {}\n}" - lang: Python source: "resp = client.update(\n index=\"test\",\n id=\"1\",\n scripted_upsert=True,\n script={\n \"source\": \"\\n if ( ctx.op == 'create' ) {\\n ctx._source.counter = params.count\\n } else {\\n ctx._source.counter += params.count\\n }\\n \",\n \"params\": {\n \"count\": 4\n }\n },\n upsert={},\n)" - lang: JavaScript source: "const response = await client.update({\n index: \"test\",\n id: 1,\n scripted_upsert: true,\n script: {\n source:\n \"\\n if ( ctx.op == 'create' ) {\\n ctx._source.counter = params.count\\n } else {\\n ctx._source.counter += params.count\\n }\\n \",\n params: {\n count: 4,\n },\n },\n upsert: {},\n});" - lang: Ruby source: "response = client.update(\n index: \"test\",\n id: \"1\",\n body: {\n \"scripted_upsert\": true,\n \"script\": {\n \"source\": \"\\n if ( ctx.op == 'create' ) {\\n ctx._source.counter = params.count\\n } else {\\n ctx._source.counter += params.count\\n }\\n \",\n \"params\": {\n \"count\": 4\n }\n },\n \"upsert\": {}\n }\n)" - lang: PHP source: "$resp = $client->update([\n \"index\" => \"test\",\n \"id\" => \"1\",\n \"body\" => [\n \"scripted_upsert\" => true,\n \"script\" => [\n \"source\" => \"\\n if ( ctx.op == 'create' ) {\\n ctx._source.counter = params.count\\n } else {\\n ctx._source.counter += params.count\\n }\\n \",\n \"params\" => [\n \"count\" => 4,\n ],\n ],\n \"upsert\" => new ArrayObject([]),\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"scripted_upsert":true,"script":{"source":"\n if ( ctx.op == ''"''"''create''"''"'' ) {\n ctx._source.counter = params.count\n } else {\n ctx._source.counter += params.count\n }\n ","params":{"count":4}},"upsert":{}}'' "$ELASTICSEARCH_URL/test/_update/1"' - lang: C# source: "var response = await client\n .UpdateAsync(index: \"test\", routeSlice: null, id: \"1\", d1 => d1\n .Script(d2 => d2\n .Params(new Dictionary()\n {\n { \"count\", 4 }\n })\n .Source(\"\\n if ( ctx.op == 'create' ) {\\n ctx._source.counter = params.count\\n } else {\\n ctx._source.counter += params.count\\n }\\n \")\n )\n .ScriptedUpsert(true)\n .Upsert(new MyDocument())\n );" - lang: Java source: "client.update(u -> u\n .id(\"1\")\n .index(\"test\")\n .script(s -> s\n .source(so -> so\n .scriptString(\"\n if ( ctx.op == 'create' ) {\n ctx._source.counter = params.count\n } else {\n ctx._source.counter += params.count\n }\n \")\n )\n .params(\"count\", JsonData.fromJson(\"4\"))\n )\n .scriptedUpsert(true)\n .upsert(JsonData.fromJson(\"{}\"))\n,Void.class);\n" UpdateRequestExample11: summary: Doc as upsert description: "Run `POST test/_update/1` to perform a doc as upsert. Instead of sending a partial `doc` plus an `upsert` doc, you can set `doc_as_upsert` to `true` to use the contents of `doc` as the `upsert` value.\n" value: "{\n \"doc\": {\n \"name\": \"new_name\"\n },\n \"doc_as_upsert\": true\n}" x-codeSamples: - lang: Console source: "POST test/_update/1\n{\n \"doc\": {\n \"name\": \"new_name\"\n },\n \"doc_as_upsert\": true\n}" - lang: Python source: "resp = client.update(\n index=\"test\",\n id=\"1\",\n doc={\n \"name\": \"new_name\"\n },\n doc_as_upsert=True,\n)" - lang: JavaScript source: "const response = await client.update({\n index: \"test\",\n id: 1,\n doc: {\n name: \"new_name\",\n },\n doc_as_upsert: true,\n});" - lang: Ruby source: "response = client.update(\n index: \"test\",\n id: \"1\",\n body: {\n \"doc\": {\n \"name\": \"new_name\"\n },\n \"doc_as_upsert\": true\n }\n)" - lang: PHP source: "$resp = $client->update([\n \"index\" => \"test\",\n \"id\" => \"1\",\n \"body\" => [\n \"doc\" => [\n \"name\" => \"new_name\",\n ],\n \"doc_as_upsert\" => true,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"doc":{"name":"new_name"},"doc_as_upsert":true}'' "$ELASTICSEARCH_URL/test/_update/1"' - lang: C# source: "var response = await client\n .UpdateAsync(index: \"test\", routeSlice: null, id: \"1\", d1 => d1\n .Doc(new MyDocument()\n {\n Name = \"new_name\"\n })\n .DocAsUpsert(true)\n );" - lang: Java source: "client.update(u -> u\n .doc(JsonData.fromJson(\"\"\"\n{\"name\":\"new_name\"}\n\"\"\"))\n .docAsUpsert(true)\n .id(\"1\")\n .index(\"test\")\n,Void.class);\n" UpdateRequestExample2: summary: Add a tag with a script description: "Run `POST test/_update/1` to use a script to add a tag to a list of tags. In this example, it is just a list, so the tag is added even it exists.\n" value: "{\n \"script\": {\n \"source\": \"ctx._source.tags.add(params.tag)\",\n \"lang\": \"painless\",\n \"params\": {\n \"tag\": \"blue\"\n }\n }\n}" x-codeSamples: - lang: Console source: "POST test/_update/1\n{\n \"script\": {\n \"source\": \"ctx._source.tags.add(params.tag)\",\n \"lang\": \"painless\",\n \"params\": {\n \"tag\": \"blue\"\n }\n }\n}" - lang: Python source: "resp = client.update(\n index=\"test\",\n id=\"1\",\n script={\n \"source\": \"ctx._source.tags.add(params.tag)\",\n \"lang\": \"painless\",\n \"params\": {\n \"tag\": \"blue\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.update({\n index: \"test\",\n id: 1,\n script: {\n source: \"ctx._source.tags.add(params.tag)\",\n lang: \"painless\",\n params: {\n tag: \"blue\",\n },\n },\n});" - lang: Ruby source: "response = client.update(\n index: \"test\",\n id: \"1\",\n body: {\n \"script\": {\n \"source\": \"ctx._source.tags.add(params.tag)\",\n \"lang\": \"painless\",\n \"params\": {\n \"tag\": \"blue\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->update([\n \"index\" => \"test\",\n \"id\" => \"1\",\n \"body\" => [\n \"script\" => [\n \"source\" => \"ctx._source.tags.add(params.tag)\",\n \"lang\" => \"painless\",\n \"params\" => [\n \"tag\" => \"blue\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"script":{"source":"ctx._source.tags.add(params.tag)","lang":"painless","params":{"tag":"blue"}}}'' "$ELASTICSEARCH_URL/test/_update/1"' - lang: C# source: "var response = await client\n .UpdateAsync(index: \"test\", routeSlice: null, id: \"1\", d1 => d1\n .Script(d2 => d2\n .Lang(ScriptLanguage.Painless)\n .Params(new Dictionary()\n {\n { \"tag\", \"blue\" }\n })\n .Source(\"ctx._source.tags.add(params.tag)\")\n )\n );" - lang: Java source: "client.update(u -> u\n .id(\"1\")\n .index(\"test\")\n .script(s -> s\n .source(so -> so\n .scriptString(\"ctx._source.tags.add(params.tag)\")\n )\n .params(\"tag\", JsonData.fromJson(\"\\\"blue\\\"\"))\n .lang(\"painless\")\n )\n,Void.class);\n" UpdateRequestExample3: summary: Remove a tag with a script description: "Run `POST test/_update/1` to use a script to remove a tag from a list of tags. The Painless function to remove a tag takes the array index of the element you want to remove. To avoid a possible runtime error, you first need to make sure the tag exists. If the list contains duplicates of the tag, this script just removes one occurrence.\n" value: "{\n \"script\": {\n \"source\": \"if (ctx._source.tags.contains(params.tag)) { ctx._source.tags.remove(ctx._source.tags.indexOf(params.tag)) }\",\n \"lang\": \"painless\",\n \"params\": {\n \"tag\": \"blue\"\n }\n }\n}" x-codeSamples: - lang: Console source: "POST test/_update/1\n{\n \"script\": {\n \"source\": \"if (ctx._source.tags.contains(params.tag)) { ctx._source.tags.remove(ctx._source.tags.indexOf(params.tag)) }\",\n \"lang\": \"painless\",\n \"params\": {\n \"tag\": \"blue\"\n }\n }\n}" - lang: Python source: "resp = client.update(\n index=\"test\",\n id=\"1\",\n script={\n \"source\": \"if (ctx._source.tags.contains(params.tag)) { ctx._source.tags.remove(ctx._source.tags.indexOf(params.tag)) }\",\n \"lang\": \"painless\",\n \"params\": {\n \"tag\": \"blue\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.update({\n index: \"test\",\n id: 1,\n script: {\n source:\n \"if (ctx._source.tags.contains(params.tag)) { ctx._source.tags.remove(ctx._source.tags.indexOf(params.tag)) }\",\n lang: \"painless\",\n params: {\n tag: \"blue\",\n },\n },\n});" - lang: Ruby source: "response = client.update(\n index: \"test\",\n id: \"1\",\n body: {\n \"script\": {\n \"source\": \"if (ctx._source.tags.contains(params.tag)) { ctx._source.tags.remove(ctx._source.tags.indexOf(params.tag)) }\",\n \"lang\": \"painless\",\n \"params\": {\n \"tag\": \"blue\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->update([\n \"index\" => \"test\",\n \"id\" => \"1\",\n \"body\" => [\n \"script\" => [\n \"source\" => \"if (ctx._source.tags.contains(params.tag)) { ctx._source.tags.remove(ctx._source.tags.indexOf(params.tag)) }\",\n \"lang\" => \"painless\",\n \"params\" => [\n \"tag\" => \"blue\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"script":{"source":"if (ctx._source.tags.contains(params.tag)) { ctx._source.tags.remove(ctx._source.tags.indexOf(params.tag)) }","lang":"painless","params":{"tag":"blue"}}}'' "$ELASTICSEARCH_URL/test/_update/1"' - lang: C# source: "var response = await client\n .UpdateAsync(index: \"test\", routeSlice: null, id: \"1\", d1 => d1\n .Script(d2 => d2\n .Lang(ScriptLanguage.Painless)\n .Params(new Dictionary()\n {\n { \"tag\", \"blue\" }\n })\n .Source(\"if (ctx._source.tags.contains(params.tag)) { ctx._source.tags.remove(ctx._source.tags.indexOf(params.tag)) }\")\n )\n );" - lang: Java source: "client.update(u -> u\n .id(\"1\")\n .index(\"test\")\n .script(s -> s\n .source(so -> so\n .scriptString(\"if (ctx._source.tags.contains(params.tag)) { ctx._source.tags.remove(ctx._source.tags.indexOf(params.tag)) }\")\n )\n .params(\"tag\", JsonData.fromJson(\"\\\"blue\\\"\"))\n .lang(\"painless\")\n )\n,Void.class);\n" UpdateRequestExample4: summary: Add fields with a script description: "Run `POST test/_update/1` to use a script to add a field `new_field` to the document.\n" value: "{\n \"script\" : \"ctx._source.new_field = 'value_of_new_field'\"\n}" x-codeSamples: - lang: Console source: "POST test/_update/1\n{\n \"script\" : \"ctx._source.new_field = 'value_of_new_field'\"\n}" - lang: Python source: "resp = client.update(\n index=\"test\",\n id=\"1\",\n script=\"ctx._source.new_field = 'value_of_new_field'\",\n)" - lang: JavaScript source: "const response = await client.update({\n index: \"test\",\n id: 1,\n script: \"ctx._source.new_field = 'value_of_new_field'\",\n});" - lang: Ruby source: "response = client.update(\n index: \"test\",\n id: \"1\",\n body: {\n \"script\": \"ctx._source.new_field = 'value_of_new_field'\"\n }\n)" - lang: PHP source: "$resp = $client->update([\n \"index\" => \"test\",\n \"id\" => \"1\",\n \"body\" => [\n \"script\" => \"ctx._source.new_field = 'value_of_new_field'\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"script":"ctx._source.new_field = ''"''"''value_of_new_field''"''"''"}'' "$ELASTICSEARCH_URL/test/_update/1"' - lang: C# source: "var response = await client\n .UpdateAsync(index: \"test\", routeSlice: null, id: \"1\", d1 => d1\n .Script(d2 => d2\n .Source(\"ctx._source.new_field = 'value_of_new_field'\")\n )\n );" - lang: Java source: "client.update(u -> u\n .id(\"1\")\n .index(\"test\")\n .script(s -> s\n .source(so -> so\n .scriptString(\"ctx._source.new_field = 'value_of_new_field'\")\n )\n )\n,Void.class);\n" UpdateRequestExample5: summary: Remove fields with a script description: "Run `POST test/_update/1` to use a script to remove a field `new_field` from the document.\n" value: "{\n \"script\" : \"ctx._source.remove('new_field')\"\n}" x-codeSamples: - lang: Console source: "POST test/_update/1\n{\n \"script\" : \"ctx._source.remove('new_field')\"\n}" - lang: Python source: "resp = client.update(\n index=\"test\",\n id=\"1\",\n script=\"ctx._source.remove('new_field')\",\n)" - lang: JavaScript source: "const response = await client.update({\n index: \"test\",\n id: 1,\n script: \"ctx._source.remove('new_field')\",\n});" - lang: Ruby source: "response = client.update(\n index: \"test\",\n id: \"1\",\n body: {\n \"script\": \"ctx._source.remove('new_field')\"\n }\n)" - lang: PHP source: "$resp = $client->update([\n \"index\" => \"test\",\n \"id\" => \"1\",\n \"body\" => [\n \"script\" => \"ctx._source.remove('new_field')\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"script":"ctx._source.remove(''"''"''new_field''"''"'')"}'' "$ELASTICSEARCH_URL/test/_update/1"' - lang: C# source: "var response = await client\n .UpdateAsync(index: \"test\", routeSlice: null, id: \"1\", d1 => d1\n .Script(d2 => d2\n .Source(\"ctx._source.remove('new_field')\")\n )\n );" - lang: Java source: "client.update(u -> u\n .id(\"1\")\n .index(\"test\")\n .script(s -> s\n .source(so -> so\n .scriptString(\"ctx._source.remove('new_field')\")\n )\n )\n,Void.class);\n" UpdateRequestExample6: summary: Remove subfields with a script description: "Run `POST test/_update/1` to use a script to remove a subfield from an object field.\n" value: "{\n \"script\": \"ctx._source['my-object'].remove('my-subfield')\"\n}" x-codeSamples: - lang: Console source: "POST test/_update/1\n{\n \"script\": \"ctx._source['my-object'].remove('my-subfield')\"\n}" - lang: Python source: "resp = client.update(\n index=\"test\",\n id=\"1\",\n script=\"ctx._source['my-object'].remove('my-subfield')\",\n)" - lang: JavaScript source: "const response = await client.update({\n index: \"test\",\n id: 1,\n script: \"ctx._source['my-object'].remove('my-subfield')\",\n});" - lang: Ruby source: "response = client.update(\n index: \"test\",\n id: \"1\",\n body: {\n \"script\": \"ctx._source['my-object'].remove('my-subfield')\"\n }\n)" - lang: PHP source: "$resp = $client->update([\n \"index\" => \"test\",\n \"id\" => \"1\",\n \"body\" => [\n \"script\" => \"ctx._source['my-object'].remove('my-subfield')\",\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"script":"ctx._source[''"''"''my-object''"''"''].remove(''"''"''my-subfield''"''"'')"}'' "$ELASTICSEARCH_URL/test/_update/1"' - lang: C# source: "var response = await client\n .UpdateAsync(index: \"test\", routeSlice: null, id: \"1\", d1 => d1\n .Script(d2 => d2\n .Source(\"ctx._source['my-object'].remove('my-subfield')\")\n )\n );" - lang: Java source: "client.update(u -> u\n .id(\"1\")\n .index(\"test\")\n .script(s -> s\n .source(so -> so\n .scriptString(\"ctx._source['my-object'].remove('my-subfield')\")\n )\n )\n,Void.class);\n" UpdateRequestExample7: summary: Change the operation with a script description: "Run `POST test/_update/1` to change the operation that runs from within the script. For example, this request deletes the document if the `tags` field contains `green`, otherwise it does nothing (`noop`).\n" value: "{\n \"script\": {\n \"source\": \"if (ctx._source.tags.contains(params.tag)) { ctx.op = 'delete' } else { ctx.op = 'noop' }\",\n \"lang\": \"painless\",\n \"params\": {\n \"tag\": \"green\"\n }\n }\n}" x-codeSamples: - lang: Console source: "POST test/_update/1\n{\n \"script\": {\n \"source\": \"if (ctx._source.tags.contains(params.tag)) { ctx.op = 'delete' } else { ctx.op = 'noop' }\",\n \"lang\": \"painless\",\n \"params\": {\n \"tag\": \"green\"\n }\n }\n}" - lang: Python source: "resp = client.update(\n index=\"test\",\n id=\"1\",\n script={\n \"source\": \"if (ctx._source.tags.contains(params.tag)) { ctx.op = 'delete' } else { ctx.op = 'noop' }\",\n \"lang\": \"painless\",\n \"params\": {\n \"tag\": \"green\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.update({\n index: \"test\",\n id: 1,\n script: {\n source:\n \"if (ctx._source.tags.contains(params.tag)) { ctx.op = 'delete' } else { ctx.op = 'noop' }\",\n lang: \"painless\",\n params: {\n tag: \"green\",\n },\n },\n});" - lang: Ruby source: "response = client.update(\n index: \"test\",\n id: \"1\",\n body: {\n \"script\": {\n \"source\": \"if (ctx._source.tags.contains(params.tag)) { ctx.op = 'delete' } else { ctx.op = 'noop' }\",\n \"lang\": \"painless\",\n \"params\": {\n \"tag\": \"green\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->update([\n \"index\" => \"test\",\n \"id\" => \"1\",\n \"body\" => [\n \"script\" => [\n \"source\" => \"if (ctx._source.tags.contains(params.tag)) { ctx.op = 'delete' } else { ctx.op = 'noop' }\",\n \"lang\" => \"painless\",\n \"params\" => [\n \"tag\" => \"green\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"script":{"source":"if (ctx._source.tags.contains(params.tag)) { ctx.op = ''"''"''delete''"''"'' } else { ctx.op = ''"''"''noop''"''"'' }","lang":"painless","params":{"tag":"green"}}}'' "$ELASTICSEARCH_URL/test/_update/1"' - lang: C# source: "var response = await client\n .UpdateAsync(index: \"test\", routeSlice: null, id: \"1\", d1 => d1\n .Script(d2 => d2\n .Lang(ScriptLanguage.Painless)\n .Params(new Dictionary()\n {\n { \"tag\", \"green\" }\n })\n .Source(\"if (ctx._source.tags.contains(params.tag)) { ctx.op = 'delete' } else { ctx.op = 'noop' }\")\n )\n );" - lang: Java source: "client.update(u -> u\n .id(\"1\")\n .index(\"test\")\n .script(s -> s\n .source(so -> so\n .scriptString(\"if (ctx._source.tags.contains(params.tag)) { ctx.op = 'delete' } else { ctx.op = 'noop' }\")\n )\n .params(\"tag\", JsonData.fromJson(\"\\\"green\\\"\"))\n .lang(\"painless\")\n )\n,Void.class);\n" UpdateRequestExample8: summary: Update part of a document description: "Run `POST test/_update/1` to do a partial update that adds a new field to the existing document.\n" value: "{\n \"doc\": {\n \"name\": \"new_name\"\n }\n}" x-codeSamples: - lang: Console source: "POST test/_update/1\n{\n \"doc\": {\n \"name\": \"new_name\"\n }\n}" - lang: Python source: "resp = client.update(\n index=\"test\",\n id=\"1\",\n doc={\n \"name\": \"new_name\"\n },\n)" - lang: JavaScript source: "const response = await client.update({\n index: \"test\",\n id: 1,\n doc: {\n name: \"new_name\",\n },\n});" - lang: Ruby source: "response = client.update(\n index: \"test\",\n id: \"1\",\n body: {\n \"doc\": {\n \"name\": \"new_name\"\n }\n }\n)" - lang: PHP source: "$resp = $client->update([\n \"index\" => \"test\",\n \"id\" => \"1\",\n \"body\" => [\n \"doc\" => [\n \"name\" => \"new_name\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"doc":{"name":"new_name"}}'' "$ELASTICSEARCH_URL/test/_update/1"' - lang: C# source: "var response = await client\n .UpdateAsync(index: \"test\", routeSlice: null, id: \"1\", d1 => d1\n .Doc(new MyDocument()\n {\n Name = \"new_name\"\n })\n );" - lang: Java source: "client.update(u -> u\n .doc(JsonData.fromJson(\"\"\"\n{\"name\":\"new_name\"}\n\"\"\"))\n .id(\"1\")\n .index(\"test\")\n,Void.class);\n" UpdateRequestExample9: summary: Upsert description: "Run `POST test/_update/1` to perfom an upsert. If the document does not already exist, the contents of the upsert element are inserted as a new document. If the document exists, the script is run.\n" value: "{\n \"script\": {\n \"source\": \"ctx._source.counter += params.count\",\n \"lang\": \"painless\",\n \"params\": {\n \"count\": 4\n }\n },\n \"upsert\": {\n \"counter\": 1\n }\n}" x-codeSamples: - lang: Console source: "POST test/_update/1\n{\n \"script\": {\n \"source\": \"ctx._source.counter += params.count\",\n \"lang\": \"painless\",\n \"params\": {\n \"count\": 4\n }\n },\n \"upsert\": {\n \"counter\": 1\n }\n}" - lang: Python source: "resp = client.update(\n index=\"test\",\n id=\"1\",\n script={\n \"source\": \"ctx._source.counter += params.count\",\n \"lang\": \"painless\",\n \"params\": {\n \"count\": 4\n }\n },\n upsert={\n \"counter\": 1\n },\n)" - lang: JavaScript source: "const response = await client.update({\n index: \"test\",\n id: 1,\n script: {\n source: \"ctx._source.counter += params.count\",\n lang: \"painless\",\n params: {\n count: 4,\n },\n },\n upsert: {\n counter: 1,\n },\n});" - lang: Ruby source: "response = client.update(\n index: \"test\",\n id: \"1\",\n body: {\n \"script\": {\n \"source\": \"ctx._source.counter += params.count\",\n \"lang\": \"painless\",\n \"params\": {\n \"count\": 4\n }\n },\n \"upsert\": {\n \"counter\": 1\n }\n }\n)" - lang: PHP source: "$resp = $client->update([\n \"index\" => \"test\",\n \"id\" => \"1\",\n \"body\" => [\n \"script\" => [\n \"source\" => \"ctx._source.counter += params.count\",\n \"lang\" => \"painless\",\n \"params\" => [\n \"count\" => 4,\n ],\n ],\n \"upsert\" => [\n \"counter\" => 1,\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"script":{"source":"ctx._source.counter += params.count","lang":"painless","params":{"count":4}},"upsert":{"counter":1}}'' "$ELASTICSEARCH_URL/test/_update/1"' - lang: C# source: "var response = await client\n .UpdateAsync(index: \"test\", routeSlice: null, id: \"1\", d1 => d1\n .Script(d2 => d2\n .Lang(ScriptLanguage.Painless)\n .Params(new Dictionary()\n {\n { \"count\", 4 }\n })\n .Source(\"ctx._source.counter += params.count\")\n )\n .Upsert(new MyDocument()\n {\n Counter = 1\n })\n );" - lang: Java source: "client.update(u -> u\n .id(\"1\")\n .index(\"test\")\n .script(s -> s\n .source(so -> so\n .scriptString(\"ctx._source.counter += params.count\")\n )\n .params(\"count\", JsonData.fromJson(\"4\"))\n .lang(\"painless\")\n )\n .upsert(JsonData.fromJson(\"\"\"\n{\"counter\":1}\n\"\"\"))\n,Void.class);\n" required: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_global.update.UpdateWriteResponseBase' examples: UpdateResponseExample1: summary: Detect noop updates description: "By default updates that don't change anything detect that they don't change anything and return `\"result\": \"noop\"`.\n" value: "{\n \"_shards\": {\n \"total\": 0,\n \"successful\": 0,\n \"failed\": 0\n },\n \"_index\": \"test\",\n \"_id\": \"1\",\n \"_version\": 2,\n \"_primary_term\": 1,\n \"_seq_no\": 1,\n \"result\": \"noop\"\n}" x-state: Generally available x-codeSamples: - lang: Console source: "POST test/_update/1\n{\n \"script\" : {\n \"source\": \"ctx._source.counter += params.count\",\n \"lang\": \"painless\",\n \"params\" : {\n \"count\" : 4\n }\n }\n}" - lang: Python source: "resp = client.update(\n index=\"test\",\n id=\"1\",\n script={\n \"source\": \"ctx._source.counter += params.count\",\n \"lang\": \"painless\",\n \"params\": {\n \"count\": 4\n }\n },\n)" - lang: JavaScript source: "const response = await client.update({\n index: \"test\",\n id: 1,\n script: {\n source: \"ctx._source.counter += params.count\",\n lang: \"painless\",\n params: {\n count: 4,\n },\n },\n});" - lang: Ruby source: "response = client.update(\n index: \"test\",\n id: \"1\",\n body: {\n \"script\": {\n \"source\": \"ctx._source.counter += params.count\",\n \"lang\": \"painless\",\n \"params\": {\n \"count\": 4\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->update([\n \"index\" => \"test\",\n \"id\" => \"1\",\n \"body\" => [\n \"script\" => [\n \"source\" => \"ctx._source.counter += params.count\",\n \"lang\" => \"painless\",\n \"params\" => [\n \"count\" => 4,\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"script":{"source":"ctx._source.counter += params.count","lang":"painless","params":{"count":4}}}'' "$ELASTICSEARCH_URL/test/_update/1"' - lang: C# source: "var response = await client\n .UpdateAsync(index: \"test\", routeSlice: null, id: \"1\", d1 => d1\n .Script(d2 => d2\n .Lang(ScriptLanguage.Painless)\n .Params(new Dictionary()\n {\n { \"count\", 4 }\n })\n .Source(\"ctx._source.counter += params.count\")\n )\n );" - lang: Java source: "client.update(u -> u\n .id(\"1\")\n .index(\"test\")\n .script(s -> s\n .source(so -> so\n .scriptString(\"ctx._source.counter += params.count\")\n )\n .params(\"count\", JsonData.fromJson(\"4\"))\n .lang(\"painless\")\n )\n,Void.class);\n" x-metaTags: - content: Elasticsearch name: product_name '/{index}/_update_by_query': post: tags: - document summary: Update documents description: "Updates documents that match the specified query.\nIf no query is specified, performs an update on every document in the data stream or index without modifying the source, which is useful for picking up mapping changes.\n\nIf the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or alias:\n\n* `read`\n* `index` or `write`\n\nYou can specify the query criteria in the request URI or the request body using the same syntax as the search API.\n\nWhen you submit an update by query request, Elasticsearch gets a snapshot of the data stream or index when it begins processing the request and updates matching documents using internal versioning.\nWhen the versions match, the document is updated and the version number is incremented.\nIf a document changes between the time that the snapshot is taken and the update operation is processed, it results in a version conflict and the operation fails.\nYou can opt to count version conflicts instead of halting and returning by setting `conflicts` to `proceed`.\nNote that if you opt to count version conflicts, the operation could attempt to update more documents from the source than `max_docs` until it has successfully updated `max_docs` documents or it has gone through every document in the source query.\n\nNOTE: Documents with a version equal to 0 cannot be updated using update by query because internal versioning does not support 0 as a valid version number.\n\nWhile processing an update by query request, Elasticsearch performs multiple search requests sequentially to find all of the matching documents.\nA bulk update request is performed for each batch of matching documents.\nAny query or update failures cause the update by query request to fail and the failures are shown in the response.\nAny update requests that completed successfully still stick, they are not rolled back.\n\n**Refreshing shards**\n\nSpecifying the `refresh` parameter refreshes all shards once the request completes.\nThis is different to the update API's `refresh` parameter, which causes only the shard\nthat received the request to be refreshed. Unlike the update API, it does not support\n`wait_for`.\n\n**Running update by query asynchronously**\n\nIf the request contains `wait_for_completion=false`, Elasticsearch\nperforms some preflight checks, launches the request, and returns a\n[task](https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-tasks) you can use to cancel or get the status of the task.\nElasticsearch creates a record of this task as a document at `.tasks/task/${taskId}`.\n\n**Throttling update requests**\n\nTo control the rate at which update by query issues batches of update operations, you can set `requests_per_second` to any positive decimal number.\nThis pads each batch with a wait time to throttle the rate.\nSet `requests_per_second` to `-1` to turn off throttling.\n\nThrottling uses a wait time between batches so that the internal scroll requests can be given a timeout that takes the request padding into account.\nThe padding time is the difference between the batch size divided by the `requests_per_second` and the time spent writing.\nBy default the batch size is 1000, so if `requests_per_second` is set to `500`:\n\n```\ntarget_time = 1000 / 500 per second = 2 seconds\nwait_time = target_time - write_time = 2 seconds - .5 seconds = 1.5 seconds\n```\n\nSince the batch is issued as a single _bulk request, large batch sizes cause Elasticsearch to create many requests and wait before starting the next set.\nThis is \"bursty\" instead of \"smooth\".\n\n**Slicing**\n\nUpdate by query supports sliced scroll to parallelize the update process.\nThis can improve efficiency and provide a convenient way to break the request down into smaller parts.\n\nSetting `slices` to `auto` chooses a reasonable number for most data streams and indices.\nThis setting will use one slice per shard, up to a certain limit.\nIf there are multiple source data streams or indices, it will choose the number of slices based on the index or backing index with the smallest number of shards.\n\nAdding `slices` to `_update_by_query` just automates the manual process of creating sub-requests, which means it has some quirks:\n\n* You can see these requests in the tasks APIs. These sub-requests are \"child\" tasks of the task for the request with slices.\n* Fetching the status of the task for the request with `slices` only contains the status of completed slices.\n* These sub-requests are individually addressable for things like cancellation and rethrottling.\n* Rethrottling the request with `slices` will rethrottle the unfinished sub-request proportionally.\n* Canceling the request with slices will cancel each sub-request.\n* Due to the nature of slices each sub-request won't get a perfectly even portion of the documents. All documents will be addressed, but some slices may be larger than others. Expect larger slices to have a more even distribution.\n* Parameters like `requests_per_second` and `max_docs` on a request with slices are distributed proportionally to each sub-request. Combine that with the point above about distribution being uneven and you should conclude that using `max_docs` with `slices` might not result in exactly `max_docs` documents being updated.\n* Each sub-request gets a slightly different snapshot of the source data stream or index though these are all taken at approximately the same time.\n\nIf you're slicing manually or otherwise tuning automatic slicing, keep in mind that:\n\n* Query performance is most efficient when the number of slices is equal to the number of shards in the index or backing index. If that number is large (for example, 500), choose a lower number as too many slices hurts performance. Setting slices higher than the number of shards generally does not improve efficiency and adds overhead.\n* Update performance scales linearly across available resources with the number of slices.\n\nWhether query or update performance dominates the runtime depends on the documents being reindexed and cluster resources.\nRefer to the linked documentation for examples of how to update documents using the `_update_by_query` API:\n\n## Required authorization\n\n* Index privileges: `read`,`write`\n" externalDocs: description: More about updating by query API url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/update-by-query-api x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/docs-update-by-query.html operationId: update-by-query parameters: - name: index in: path description: "A comma-separated list of data streams, indices, and aliases to search.\nIt supports wildcards (`*`).\nTo search all data streams or indices, omit this parameter or use `*` or `_all`." required: true schema: $ref: '#/components/schemas/_types.Indices' - name: allow_no_indices in: query description: "A setting that does two separate checks on the index expression.\nIf `false`, the request returns an error (1) if any wildcard expression\n(including `_all` and `*`) resolves to zero matching indices or (2) if the\ncomplete set of resolved indices, aliases or data streams is empty after all\nexpressions are evaluated. If `true`, index expressions that resolve to no\nindices are allowed and the request returns an empty result." schema: type: boolean default: true - name: analyzer in: query description: "The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified." schema: type: string - name: analyze_wildcard in: query description: "If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified." schema: type: boolean default: false - name: conflicts in: query description: "The preferred behavior when update by query hits version conflicts: `abort` or `proceed`.\n\nSupported values include:\n - `abort`: Stop reindexing if there are conflicts.\n - `proceed`: Continue reindexing even if there are conflicts.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.Conflicts' default: abort - name: default_operator in: query description: "The default operator for query string query: `and` or `or`.\nThis parameter can be used only when the `q` query string parameter is specified." schema: allOf: - $ref: '#/components/schemas/_types.query_dsl.Operator' default: or - name: df in: query description: "The field to use as default where no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified." schema: type: string - name: expand_wildcards in: query description: "The type of index that wildcard patterns can match.\nIf the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.\nIt supports comma-separated values, such as `open,hidden`.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: open - name: from in: query description: Skips the specified number of documents. schema: type: number default: 0 - name: ignore_unavailable in: query description: "If `false`, the request returns an error if it targets a concrete (non-wildcarded)\nindex, alias, or data stream that is missing, closed, or otherwise unavailable.\nIf `true`, unavailable concrete targets are silently ignored." schema: type: boolean default: false - name: lenient in: query description: "If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified." schema: type: boolean default: false - name: max_docs in: query description: "The maximum number of documents to process.\nIt defaults to all documents.\nWhen set to a value less than or equal to `scroll_size` and `conflicts` is set to `abort`, a scroll will not be used to retrieve the results for the operation." schema: type: number - name: pipeline in: query description: "The ID of the pipeline to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request.\nIf a final pipeline is configured it will always run, regardless of the value of this parameter." schema: type: string - name: preference in: query description: "The node or shard the operation should be performed on.\nIt is random by default." schema: type: string - name: q in: query description: A query in the Lucene query string syntax. schema: type: string - name: refresh in: query description: "If `true`, Elasticsearch refreshes affected shards to make the operation visible to search after the request completes.\nThis is different than the update API's `refresh` parameter, which causes just the shard that received the request to be refreshed." schema: type: boolean default: false - name: request_cache in: query description: "If `true`, the request cache is used for this request.\nIt defaults to the index-level setting." schema: type: boolean - name: requests_per_second in: query description: "The maximum number of documents to update per second, across the entire update_by_query operation (including slices).\nIt can be either `-1` to turn off throttling or any decimal number like `1.7` or `12` to throttle to that level." schema: type: number default: -1 - name: routing in: query description: "A custom value used to route operations to a specific shard.\nNot allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead." schema: $ref: '#/components/schemas/_types.Routing' x-state: Generally available - name: scroll in: query description: The period to retain the search context for scrolling. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 5m - name: scroll_size in: query description: The size of the scroll request that powers the operation. schema: type: number default: 1000 - name: search_timeout in: query description: "An explicit timeout for each search request.\nBy default, there is no timeout." schema: $ref: '#/components/schemas/_types.Duration' - name: search_type in: query description: "The type of the search operation. Available options include `query_then_fetch` and `dfs_query_then_fetch`.\n\nSupported values include:\n - `query_then_fetch`: Documents are scored using local term and document frequencies for the shard. This is usually faster but less accurate.\n - `dfs_query_then_fetch`: Documents are scored using global term and document frequencies across all shards. This is usually slower but more accurate.\n\n" schema: $ref: '#/components/schemas/_types.SearchType' - name: slices in: query description: The number of slices this task should be divided into. schema: allOf: - $ref: '#/components/schemas/_types.Slices' default: '1' - name: sort in: query description: A comma-separated list of : pairs. schema: type: array items: type: string - name: stats in: query description: The specific `tag` of the request for logging and statistical purposes. schema: type: array items: type: string - name: terminate_after in: query description: "The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers." schema: type: number - name: timeout in: query description: "The period each update request waits for the following operations: dynamic mapping updates, waiting for active shards.\nBy default, it is one minute.\nThis guarantees Elasticsearch waits for at least the timeout before failing.\nThe actual wait time could be longer, particularly when multiple waits occur." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 1m - name: version in: query description: 'If `true`, returns the document version as part of a hit.' schema: type: boolean - name: version_type in: query description: Should the document increment the version number (internal) on hit or not (reindex) schema: type: boolean - name: wait_for_active_shards in: query description: "The number of shard copies that must be active before proceeding with the operation.\nSet to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`).\nThe `timeout` parameter controls how long each write request waits for unavailable shards to become available.\nBoth work exactly the way they work in the bulk API.\nUpdate by query uses scrolled searches, so you can also specify the `scroll` parameter to control how long it keeps the search context alive, for example `?scroll=10m`." schema: allOf: - $ref: '#/components/schemas/_types.WaitForActiveShards' default: '1' - name: wait_for_completion in: query description: "If `true`, the request blocks until the operation is complete.\nIf `false`, Elasticsearch performs some preflight checks, launches the request, and returns a task ID that you can use to cancel or get the status of the task.\nElasticsearch creates a record of this task as a document at `.tasks/task/${taskId}`." schema: type: boolean default: true requestBody: content: application/json: schema: type: object properties: max_docs: type: number description: The maximum number of documents to update. query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: The documents to update using the Query DSL. runtime_mappings: allOf: - $ref: '#/components/schemas/_types.mapping.RuntimeFields' description: "One or more runtime fields in the search request.\nThese fields take precedence over mapped fields with the same name." externalDocs: url: https://www.elastic.co/docs/manage-data/data-store/mapping/define-runtime-fields-in-search-request script: allOf: - $ref: '#/components/schemas/_types.Script' description: The script to run to update the document source or metadata when updating. slice: allOf: - $ref: '#/components/schemas/_types.SlicedScroll' description: Slice the request manually using the provided slice ID and total number of slices. conflicts: allOf: - $ref: '#/components/schemas/_types.Conflicts' description: "The preferred behavior when update by query hits version conflicts: `abort` or `proceed`.\n\nSupported values include:\n - `abort`: Stop reindexing if there are conflicts.\n - `proceed`: Continue reindexing even if there are conflicts.\n\n" default: abort examples: UpdateByQueryRequestExample1: summary: Update selected documents description: "Run `POST my-index-000001/_update_by_query?conflicts=proceed` to update documents that match a query.\n" value: "{\n \"query\": { \n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n}" x-codeSamples: - lang: Console source: "POST my-index-000001/_update_by_query?conflicts=proceed\n{\n \"query\": { \n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n}" - lang: Python source: "resp = client.update_by_query(\n index=\"my-index-000001\",\n conflicts=\"proceed\",\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.updateByQuery({\n index: \"my-index-000001\",\n conflicts: \"proceed\",\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n});" - lang: Ruby source: "response = client.update_by_query(\n index: \"my-index-000001\",\n conflicts: \"proceed\",\n body: {\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->updateByQuery([\n \"index\" => \"my-index-000001\",\n \"conflicts\" => \"proceed\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":{"term":{"user.id":"kimchy"}}}'' "$ELASTICSEARCH_URL/my-index-000001/_update_by_query?conflicts=proceed"' - lang: C# source: "var response = await client\n .UpdateByQueryAsync(new UpdateByQueryRequest()\n {\n Indices = new[] { \"my-index-000001\" },\n Query = new Query()\n {\n Term = new()\n {\n Field = global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.User.Id),\n Value = \"kimchy\"\n }\n }\n });" - lang: Java source: "client.updateByQuery(u -> u\n .conflicts(Conflicts.Proceed)\n .index(\"my-index-000001\")\n .query(q -> q\n .term(t -> t\n .field(\"user.id\")\n .value(FieldValue.of(\"kimchy\"))\n )\n )\n);\n" UpdateByQueryRequestExample2: summary: Update the document source description: "Run `POST my-index-000001/_update_by_query` with a script to update the document source. It increments the `count` field for all documents with a `user.id` of `kimchy` in `my-index-000001`.\n" value: "{\n \"script\": {\n \"source\": \"ctx._source.count++\",\n \"lang\": \"painless\"\n },\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n}" x-codeSamples: - lang: Console source: "POST my-index-000001/_update_by_query\n{\n \"script\": {\n \"source\": \"ctx._source.count++\",\n \"lang\": \"painless\"\n },\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n}" - lang: Python source: "resp = client.update_by_query(\n index=\"my-index-000001\",\n script={\n \"source\": \"ctx._source.count++\",\n \"lang\": \"painless\"\n },\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.updateByQuery({\n index: \"my-index-000001\",\n script: {\n source: \"ctx._source.count++\",\n lang: \"painless\",\n },\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n});" - lang: Ruby source: "response = client.update_by_query(\n index: \"my-index-000001\",\n body: {\n \"script\": {\n \"source\": \"ctx._source.count++\",\n \"lang\": \"painless\"\n },\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->updateByQuery([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"script\" => [\n \"source\" => \"ctx._source.count++\",\n \"lang\" => \"painless\",\n ],\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"script":{"source":"ctx._source.count++","lang":"painless"},"query":{"term":{"user.id":"kimchy"}}}'' "$ELASTICSEARCH_URL/my-index-000001/_update_by_query"' - lang: C# source: "var response = await client\n .UpdateByQueryAsync(new UpdateByQueryRequest()\n {\n Indices = new[] { \"my-index-000001\" },\n Query = new Query()\n {\n Term = new()\n {\n Field = global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.User.Id),\n Value = \"kimchy\"\n }\n },\n Script = new()\n {\n Lang = ScriptLanguage.Painless,\n Source = \"ctx._source.count++\"\n }\n });" - lang: Java source: "client.updateByQuery(u -> u\n .index(\"my-index-000001\")\n .query(q -> q\n .term(t -> t\n .field(\"user.id\")\n .value(FieldValue.of(\"kimchy\"))\n )\n )\n .script(s -> s\n .source(so -> so\n .scriptString(\"ctx._source.count++\")\n )\n .lang(\"painless\")\n )\n);\n" UpdateByQueryRequestExample3: summary: Slice manually description: "Run `POST my-index-000001/_update_by_query` to slice an update by query manually. Provide a slice ID and total number of slices to each request.\n" value: "{\n \"slice\": {\n \"id\": 0,\n \"max\": 2\n },\n \"script\": {\n \"source\": \"ctx._source['extra'] = 'test'\"\n }\n}" x-codeSamples: - lang: Console source: "POST my-index-000001/_update_by_query\n{\n \"slice\": {\n \"id\": 0,\n \"max\": 2\n },\n \"script\": {\n \"source\": \"ctx._source['extra'] = 'test'\"\n }\n}" - lang: Python source: "resp = client.update_by_query(\n index=\"my-index-000001\",\n slice={\n \"id\": 0,\n \"max\": 2\n },\n script={\n \"source\": \"ctx._source['extra'] = 'test'\"\n },\n)" - lang: JavaScript source: "const response = await client.updateByQuery({\n index: \"my-index-000001\",\n slice: {\n id: 0,\n max: 2,\n },\n script: {\n source: \"ctx._source['extra'] = 'test'\",\n },\n});" - lang: Ruby source: "response = client.update_by_query(\n index: \"my-index-000001\",\n body: {\n \"slice\": {\n \"id\": 0,\n \"max\": 2\n },\n \"script\": {\n \"source\": \"ctx._source['extra'] = 'test'\"\n }\n }\n)" - lang: PHP source: "$resp = $client->updateByQuery([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"slice\" => [\n \"id\" => 0,\n \"max\" => 2,\n ],\n \"script\" => [\n \"source\" => \"ctx._source['extra'] = 'test'\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"slice":{"id":0,"max":2},"script":{"source":"ctx._source[''"''"''extra''"''"''] = ''"''"''test''"''"''"}}'' "$ELASTICSEARCH_URL/my-index-000001/_update_by_query"' - lang: C# source: "var response = await client\n .UpdateByQueryAsync(new UpdateByQueryRequest()\n {\n Indices = new[] { \"my-index-000001\" },\n Script = new()\n {\n Source = \"ctx._source['extra'] = 'test'\"\n },\n Slice = new()\n {\n Id = 0L,\n Max = 2\n }\n });" - lang: Java source: "client.updateByQuery(u -> u\n .index(\"my-index-000001\")\n .script(s -> s\n .source(so -> so\n .scriptString(\"ctx._source['extra'] = 'test'\")\n )\n )\n .slice(sl -> sl\n .id(\"0\")\n .max(2)\n )\n);\n" UpdateByQueryRequestExample4: summary: Slice automatically description: "Run `POST my-index-000001/_update_by_query?refresh&slices=5` to use automatic slicing. It automatically parallelizes using sliced scroll to slice on `_id`.\n" value: "{\n \"script\": {\n \"source\": \"ctx._source['extra'] = 'test'\"\n }\n}" x-codeSamples: - lang: Console source: "POST my-index-000001/_update_by_query?refresh&slices=5\n{\n \"script\": {\n \"source\": \"ctx._source['extra'] = 'test'\"\n }\n}" - lang: Python source: "resp = client.update_by_query(\n index=\"my-index-000001\",\n refresh=True,\n slices=\"5\",\n script={\n \"source\": \"ctx._source['extra'] = 'test'\"\n },\n)" - lang: JavaScript source: "const response = await client.updateByQuery({\n index: \"my-index-000001\",\n refresh: \"true\",\n slices: 5,\n script: {\n source: \"ctx._source['extra'] = 'test'\",\n },\n});" - lang: Ruby source: "response = client.update_by_query(\n index: \"my-index-000001\",\n refresh: \"true\",\n slices: \"5\",\n body: {\n \"script\": {\n \"source\": \"ctx._source['extra'] = 'test'\"\n }\n }\n)" - lang: PHP source: "$resp = $client->updateByQuery([\n \"index\" => \"my-index-000001\",\n \"refresh\" => \"true\",\n \"slices\" => \"5\",\n \"body\" => [\n \"script\" => [\n \"source\" => \"ctx._source['extra'] = 'test'\",\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"script":{"source":"ctx._source[''"''"''extra''"''"''] = ''"''"''test''"''"''"}}'' "$ELASTICSEARCH_URL/my-index-000001/_update_by_query?refresh&slices=5"' - lang: C# source: "var response = await client\n .UpdateByQueryAsync(new UpdateByQueryRequest()\n {\n Indices = new[] { \"my-index-000001\" },\n Refresh = true,\n Slices = new Slices(5),\n Script = new()\n {\n Source = \"ctx._source['extra'] = 'test'\"\n }\n });" - lang: Java source: "client.updateByQuery(u -> u\n .index(\"my-index-000001\")\n .refresh(true)\n .script(s -> s\n .source(so -> so\n .scriptString(\"ctx._source['extra'] = 'test'\")\n )\n )\n .slices(sl -> sl\n .value(5)\n )\n);\n" responses: '200': description: '' content: application/json: schema: type: object properties: batches: type: number description: The number of scroll responses pulled back by the update by query. failures: type: array items: $ref: '#/components/schemas/_types.BulkByPaginatedSearchFailure' description: "Array of failures if there were any unrecoverable errors during the process.\nIf this is non-empty then the request ended because of those failures.\nUpdate by query is implemented using batches.\nAny failure causes the entire process to end, but all failures in the current batch are collected into the array.\nYou can use the `conflicts` option to prevent reindex from ending when version conflicts occur." noops: type: number description: The number of documents that were ignored because the script used for the update by query returned a noop value for `ctx.op`. deleted: type: number description: The number of documents that were successfully deleted. requests_per_second: type: number description: The number of requests per second effectively run during the update by query. retries: allOf: - $ref: '#/components/schemas/_types.Retries' description: "The number of retries attempted by update by query.\n`bulk` is the number of bulk actions retried.\n`search` is the number of search actions retried." slices: type: array items: $ref: '#/components/schemas/_types.ReindexStatus' description: Status of each slice if the update by query was sliced task: allOf: - $ref: '#/components/schemas/_types.TaskId' timed_out: type: boolean description: 'If true, some requests timed out during the update by query.' took: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: The number of milliseconds from start to end of the whole operation. total: type: number description: The number of documents that were successfully processed. updated: type: number description: The number of documents that were successfully updated. version_conflicts: type: number description: The number of version conflicts that the update by query hit. throttled: allOf: - $ref: '#/components/schemas/_types.Duration' throttled_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: The number of milliseconds the request slept to conform to `requests_per_second`. throttled_until: allOf: - $ref: '#/components/schemas/_types.Duration' throttled_until_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: "This field should always be equal to zero in an _update_by_query response.\nIt only has meaning when using the task API, where it indicates the next time (in milliseconds since epoch) a throttled request will be run again in order to conform to `requests_per_second`." x-state: Generally available; Added in 2.4.0 x-codeSamples: - lang: Console source: "POST my-index-000001/_update_by_query?conflicts=proceed\n{\n \"query\": { \n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n}" - lang: Python source: "resp = client.update_by_query(\n index=\"my-index-000001\",\n conflicts=\"proceed\",\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n)" - lang: JavaScript source: "const response = await client.updateByQuery({\n index: \"my-index-000001\",\n conflicts: \"proceed\",\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n});" - lang: Ruby source: "response = client.update_by_query(\n index: \"my-index-000001\",\n conflicts: \"proceed\",\n body: {\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->updateByQuery([\n \"index\" => \"my-index-000001\",\n \"conflicts\" => \"proceed\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"query":{"term":{"user.id":"kimchy"}}}'' "$ELASTICSEARCH_URL/my-index-000001/_update_by_query?conflicts=proceed"' - lang: C# source: "var response = await client\n .UpdateByQueryAsync(new UpdateByQueryRequest()\n {\n Indices = new[] { \"my-index-000001\" },\n Query = new Query()\n {\n Term = new()\n {\n Field = global::Elastic.Clients.Elasticsearch.Infer.Field(x => x.User.Id),\n Value = \"kimchy\"\n }\n }\n });" - lang: Java source: "client.updateByQuery(u -> u\n .conflicts(Conflicts.Proceed)\n .index(\"my-index-000001\")\n .query(q -> q\n .term(t -> t\n .field(\"user.id\")\n .value(FieldValue.of(\"kimchy\"))\n )\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_update_by_query/{task_id}/_rethrottle': post: tags: - document summary: Throttle an update by query operation description: "Change the number of requests per second for a particular update by query operation.\nRethrottling that speeds up the query takes effect immediately but rethrotting that slows down the query takes effect after completing the current batch to prevent scroll timeouts.\n\n## Required authorization\n\n* Cluster privileges: `manage_reindex`\n" operationId: update-by-query-rethrottle parameters: - name: task_id in: path description: The ID for the task. required: true schema: $ref: '#/components/schemas/_types.Id' - name: requests_per_second in: query description: "The maximum number of documents to update per second, across the entire update_by_query operation (including slices).\nIt can be either `-1` to turn off throttling or any decimal number like `1.7` or `12` to throttle to that level." required: true schema: type: number responses: '200': description: '' content: application/json: schema: required: - nodes type: object properties: nodes: type: object additionalProperties: $ref: '#/components/schemas/_global.update_by_query_rethrottle.UpdateByQueryRethrottleNode' x-state: Generally available; Added in 6.5.0 x-codeSamples: - lang: Console source: "POST _update_by_query/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1\n" - lang: Python source: "resp = client.update_by_query_rethrottle(\n task_id=\"r1A2WoRbTwKZ516z6NEs5A:36619\",\n requests_per_second=\"-1\",\n)" - lang: JavaScript source: "const response = await client.updateByQueryRethrottle({\n task_id: \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n requests_per_second: \"-1\",\n});" - lang: Ruby source: "response = client.update_by_query_rethrottle(\n task_id: \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n requests_per_second: \"-1\"\n)" - lang: PHP source: "$resp = $client->updateByQueryRethrottle([\n \"task_id\" => \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n \"requests_per_second\" => \"-1\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_update_by_query/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1"' - lang: C# source: "var response = await client\n .UpdateByQueryRethrottleAsync(taskId: \"r1A2WoRbTwKZ516z6NEs5A:36619\", d1 => d1\n .RequestsPerSecond(-1f)\n );" - lang: Java source: "client.updateByQueryRethrottle(u -> u\n .requestsPerSecond(-1.0F)\n .taskId(\"r1A2WoRbTwKZ516z6NEs5A:36619\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_watcher/watch/{watch_id}/_ack/{action_id}': post: tags: - watcher summary: "Acknowledge a watch\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_watcher/watch/{watch_id}/_ack\n
\n
\n POST\n /_watcher/watch/{watch_id}/_ack\n
\n
\n PUT\n /_watcher/watch/{watch_id}/_ack/{action_id}\n
\n
\n POST\n /_watcher/watch/{watch_id}/_ack/{action_id}\n
\n \n\nAcknowledging a watch enables you to manually throttle the execution of the watch's actions.\n\nThe acknowledgement state of an action is stored in the `status.actions..ack.state` structure.\n\nIMPORTANT: If the specified watch is currently being executed, this API will return an error\nThe reason for this behavior is to prevent overwriting the watch status from a watch execution.\n\nAcknowledging an action throttles further executions of that action until its `ack.state` is reset to `awaits_successful_execution`.\nThis happens when the condition of the watch is not met (the condition evaluates to false).\nTo demonstrate how throttling works in practice and how it can be configured for individual actions within a watch, refer to External documentation.\n\n## Required authorization\n\n* Cluster privileges: `manage_watcher`\n" externalDocs: description: Learn more about actions url: https://www.elastic.co/docs/explore-analyze/alerts-cases/watcher/actions#example x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/watcher-api-ack-watch.html operationId: watcher-ack-watch parameters: - $ref: '#/components/parameters/watcher.ack_watch-watch_id' - $ref: '#/components/parameters/watcher.ack_watch-action_id' responses: '200': $ref: '#/components/responses/watcher.ack_watch-200' x-state: Generally available x-codeSamples: - lang: Console source: "POST _watcher/watch/my_watch/_ack\n" - lang: Python source: "resp = client.watcher.ack_watch(\n watch_id=\"my_watch\",\n)" - lang: JavaScript source: "const response = await client.watcher.ackWatch({\n watch_id: \"my_watch\",\n});" - lang: Ruby source: "response = client.watcher.ack_watch(\n watch_id: \"my_watch\"\n)" - lang: PHP source: "$resp = $client->watcher()->ackWatch([\n \"watch_id\" => \"my_watch\",\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_watcher/watch/my_watch/_ack"' - lang: Java source: "client.watcher().ackWatch(a -> a\n .watchId(\"my_watch\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_watcher/watch/{watch_id}/_activate': post: tags: - watcher summary: "Activate a watch\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_watcher/watch/{watch_id}/_activate\n
\n
\n POST\n /_watcher/watch/{watch_id}/_activate\n
\n \n\nA watch can be either active or inactive.\n\n## Required authorization\n\n* Cluster privileges: `manage_watcher`\n" externalDocs: description: More about how Watcher works url: https://www.elastic.co/docs/explore-analyze/alerts-cases/watcher/how-watcher-works x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/watcher-api-activate-watch.html operationId: watcher-activate-watch parameters: - $ref: '#/components/parameters/watcher.activate_watch-watch_id' responses: '200': $ref: '#/components/responses/watcher.activate_watch-200' x-state: Generally available x-codeSamples: - lang: Console source: "PUT _watcher/watch/my_watch/_activate\n" - lang: Python source: "resp = client.watcher.activate_watch(\n watch_id=\"my_watch\",\n)" - lang: JavaScript source: "const response = await client.watcher.activateWatch({\n watch_id: \"my_watch\",\n});" - lang: Ruby source: "response = client.watcher.activate_watch(\n watch_id: \"my_watch\"\n)" - lang: PHP source: "$resp = $client->watcher()->activateWatch([\n \"watch_id\" => \"my_watch\",\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_watcher/watch/my_watch/_activate"' - lang: Java source: "client.watcher().activateWatch(a -> a\n .watchId(\"my_watch\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_watcher/watch/{watch_id}/_deactivate': post: tags: - watcher summary: "Deactivate a watch\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_watcher/watch/{watch_id}/_deactivate\n
\n
\n POST\n /_watcher/watch/{watch_id}/_deactivate\n
\n \n\nA watch can be either active or inactive.\n\n## Required authorization\n\n* Cluster privileges: `manage_watcher`\n" externalDocs: description: More about how Watcher works url: https://www.elastic.co/docs/explore-analyze/alerts-cases/watcher/how-watcher-works x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/watcher-api-deactivate-watch.html operationId: watcher-deactivate-watch parameters: - $ref: '#/components/parameters/watcher.deactivate_watch-watch_id' responses: '200': $ref: '#/components/responses/watcher.deactivate_watch-200' x-state: Generally available x-codeSamples: - lang: Console source: "PUT _watcher/watch/my_watch/_deactivate\n" - lang: Python source: "resp = client.watcher.deactivate_watch(\n watch_id=\"my_watch\",\n)" - lang: JavaScript source: "const response = await client.watcher.deactivateWatch({\n watch_id: \"my_watch\",\n});" - lang: Ruby source: "response = client.watcher.deactivate_watch(\n watch_id: \"my_watch\"\n)" - lang: PHP source: "$resp = $client->watcher()->deactivateWatch([\n \"watch_id\" => \"my_watch\",\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_watcher/watch/my_watch/_deactivate"' - lang: Java source: "client.watcher().deactivateWatch(d -> d\n .watchId(\"my_watch\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_watcher/watch/{id}': get: tags: - watcher summary: Get a watch description: "\n\n## Required authorization\n\n* Cluster privileges: `monitor_watcher`\n" operationId: watcher-get-watch parameters: - name: id in: path description: The watch identifier. required: true schema: $ref: '#/components/schemas/_types.Name' responses: '200': description: '' content: application/json: schema: required: - found - _id type: object properties: found: type: boolean _id: allOf: - $ref: '#/components/schemas/_types.Id' status: allOf: - $ref: '#/components/schemas/watcher._types.WatchStatus' watch: allOf: - $ref: '#/components/schemas/watcher._types.Watch' _primary_term: type: number _seq_no: allOf: - $ref: '#/components/schemas/_types.SequenceNumber' _version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' examples: GetWatchResponseExample1: description: A successful response from `GET _watcher/watch/my_watch`. value: "{\n \"found\": true,\n \"_id\": \"my_watch\",\n \"_seq_no\": 0,\n \"_primary_term\": 1,\n \"_version\": 1,\n \"status\": { \n \"version\": 1,\n \"state\": {\n \"active\": true,\n \"timestamp\": \"2015-05-26T18:21:08.630Z\"\n },\n \"actions\": {\n \"test_index\": {\n \"ack\": {\n \"timestamp\": \"2015-05-26T18:21:08.630Z\",\n \"state\": \"awaits_successful_execution\"\n }\n }\n }\n },\n \"watch\": {\n \"input\": {\n \"simple\": {\n \"payload\": {\n \"send\": \"yes\"\n }\n }\n },\n \"condition\": {\n \"always\": {}\n },\n \"trigger\": {\n \"schedule\": {\n \"hourly\": {\n \"minute\": [0, 5]\n }\n }\n },\n \"actions\": {\n \"test_index\": {\n \"index\": {\n \"index\": \"test\"\n }\n }\n }\n }\n}" x-state: Generally available; Added in 5.6.0 x-codeSamples: - lang: Console source: "GET _watcher/watch/my_watch\n" - lang: Python source: "resp = client.watcher.get_watch(\n id=\"my_watch\",\n)" - lang: JavaScript source: "const response = await client.watcher.getWatch({\n id: \"my_watch\",\n});" - lang: Ruby source: "response = client.watcher.get_watch(\n id: \"my_watch\"\n)" - lang: PHP source: "$resp = $client->watcher()->getWatch([\n \"id\" => \"my_watch\",\n]);" - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_watcher/watch/my_watch"' - lang: Java source: "client.watcher().getWatch(g -> g\n .id(\"my_watch\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name post: tags: - watcher summary: "Create or update a watch\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_watcher/watch/{id}\n
\n
\n POST\n /_watcher/watch/{id}\n
\n \n\nWhen a watch is registered, a new document that represents the watch is added to the `.watches` index and its trigger is immediately registered with the relevant trigger engine.\nTypically for the `schedule` trigger, the scheduler is the trigger engine.\n\nIMPORTANT: You must use Kibana or this API to create a watch.\nDo not add a watch directly to the `.watches` index by using the Elasticsearch index API.\nIf Elasticsearch security features are enabled, do not give users write privileges on the `.watches` index.\n\nWhen you add a watch you can also define its initial active state by setting the *active* parameter.\n\nWhen Elasticsearch security features are enabled, your watch can index or search only on indices for which the user that stored the watch has privileges.\nIf the user is able to read index `a`, but not index `b`, the same will apply when the watch runs.\n\n## Required authorization\n\n* Cluster privileges: `manage_watcher`\n" operationId: watcher-put-watch parameters: - $ref: '#/components/parameters/watcher.put_watch-id' - $ref: '#/components/parameters/watcher.put_watch-active' - $ref: '#/components/parameters/watcher.put_watch-if_primary_term' - $ref: '#/components/parameters/watcher.put_watch-if_seq_no' - $ref: '#/components/parameters/watcher.put_watch-version' requestBody: $ref: '#/components/requestBodies/watcher.put_watch' responses: '200': $ref: '#/components/responses/watcher.put_watch-200' x-state: Generally available x-codeSamples: - lang: Console source: "PUT _watcher/watch/my-watch\n{\n \"trigger\" : {\n \"schedule\" : { \"cron\" : \"0 0/1 * * * ?\" }\n },\n \"input\" : {\n \"search\" : {\n \"request\" : {\n \"indices\" : [\n \"logstash*\"\n ],\n \"body\" : {\n \"query\" : {\n \"bool\" : {\n \"must\" : {\n \"match\": {\n \"response\": 404\n }\n },\n \"filter\" : {\n \"range\": {\n \"@timestamp\": {\n \"from\": \"{{ctx.trigger.scheduled_time}}||-5m\",\n \"to\": \"{{ctx.trigger.triggered_time}}\"\n }\n }\n }\n }\n }\n }\n }\n }\n },\n \"condition\" : {\n \"compare\" : { \"ctx.payload.hits.total\" : { \"gt\" : 0 }}\n },\n \"actions\" : {\n \"email_admin\" : {\n \"email\" : {\n \"to\" : \"admin@domain.host.com\",\n \"subject\" : \"404 recently encountered\"\n }\n }\n }\n}" - lang: Python source: "resp = client.watcher.put_watch(\n id=\"my-watch\",\n trigger={\n \"schedule\": {\n \"cron\": \"0 0/1 * * * ?\"\n }\n },\n input={\n \"search\": {\n \"request\": {\n \"indices\": [\n \"logstash*\"\n ],\n \"body\": {\n \"query\": {\n \"bool\": {\n \"must\": {\n \"match\": {\n \"response\": 404\n }\n },\n \"filter\": {\n \"range\": {\n \"@timestamp\": {\n \"from\": \"{{ctx.trigger.scheduled_time}}||-5m\",\n \"to\": \"{{ctx.trigger.triggered_time}}\"\n }\n }\n }\n }\n }\n }\n }\n }\n },\n condition={\n \"compare\": {\n \"ctx.payload.hits.total\": {\n \"gt\": 0\n }\n }\n },\n actions={\n \"email_admin\": {\n \"email\": {\n \"to\": \"admin@domain.host.com\",\n \"subject\": \"404 recently encountered\"\n }\n }\n },\n)" - lang: JavaScript source: "const response = await client.watcher.putWatch({\n id: \"my-watch\",\n trigger: {\n schedule: {\n cron: \"0 0/1 * * * ?\",\n },\n },\n input: {\n search: {\n request: {\n indices: [\"logstash*\"],\n body: {\n query: {\n bool: {\n must: {\n match: {\n response: 404,\n },\n },\n filter: {\n range: {\n \"@timestamp\": {\n from: \"{{ctx.trigger.scheduled_time}}||-5m\",\n to: \"{{ctx.trigger.triggered_time}}\",\n },\n },\n },\n },\n },\n },\n },\n },\n },\n condition: {\n compare: {\n \"ctx.payload.hits.total\": {\n gt: 0,\n },\n },\n },\n actions: {\n email_admin: {\n email: {\n to: \"admin@domain.host.com\",\n subject: \"404 recently encountered\",\n },\n },\n },\n});" - lang: Ruby source: "response = client.watcher.put_watch(\n id: \"my-watch\",\n body: {\n \"trigger\": {\n \"schedule\": {\n \"cron\": \"0 0/1 * * * ?\"\n }\n },\n \"input\": {\n \"search\": {\n \"request\": {\n \"indices\": [\n \"logstash*\"\n ],\n \"body\": {\n \"query\": {\n \"bool\": {\n \"must\": {\n \"match\": {\n \"response\": 404\n }\n },\n \"filter\": {\n \"range\": {\n \"@timestamp\": {\n \"from\": \"{{ctx.trigger.scheduled_time}}||-5m\",\n \"to\": \"{{ctx.trigger.triggered_time}}\"\n }\n }\n }\n }\n }\n }\n }\n }\n },\n \"condition\": {\n \"compare\": {\n \"ctx.payload.hits.total\": {\n \"gt\": 0\n }\n }\n },\n \"actions\": {\n \"email_admin\": {\n \"email\": {\n \"to\": \"admin@domain.host.com\",\n \"subject\": \"404 recently encountered\"\n }\n }\n }\n }\n)" - lang: PHP source: "$resp = $client->watcher()->putWatch([\n \"id\" => \"my-watch\",\n \"body\" => [\n \"trigger\" => [\n \"schedule\" => [\n \"cron\" => \"0 0/1 * * * ?\",\n ],\n ],\n \"input\" => [\n \"search\" => [\n \"request\" => [\n \"indices\" => array(\n \"logstash*\",\n ),\n \"body\" => [\n \"query\" => [\n \"bool\" => [\n \"must\" => [\n \"match\" => [\n \"response\" => 404,\n ],\n ],\n \"filter\" => [\n \"range\" => [\n \"@timestamp\" => [\n \"from\" => \"{{ctx.trigger.scheduled_time}}||-5m\",\n \"to\" => \"{{ctx.trigger.triggered_time}}\",\n ],\n ],\n ],\n ],\n ],\n ],\n ],\n ],\n ],\n \"condition\" => [\n \"compare\" => [\n \"ctx.payload.hits.total\" => [\n \"gt\" => 0,\n ],\n ],\n ],\n \"actions\" => [\n \"email_admin\" => [\n \"email\" => [\n \"to\" => \"admin@domain.host.com\",\n \"subject\" => \"404 recently encountered\",\n ],\n ],\n ],\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"trigger":{"schedule":{"cron":"0 0/1 * * * ?"}},"input":{"search":{"request":{"indices":["logstash*"],"body":{"query":{"bool":{"must":{"match":{"response":404}},"filter":{"range":{"@timestamp":{"from":"{{ctx.trigger.scheduled_time}}||-5m","to":"{{ctx.trigger.triggered_time}}"}}}}}}}}},"condition":{"compare":{"ctx.payload.hits.total":{"gt":0}}},"actions":{"email_admin":{"email":{"to":"admin@domain.host.com","subject":"404 recently encountered"}}}}'' "$ELASTICSEARCH_URL/_watcher/watch/my-watch"' - lang: Java source: "client.watcher().putWatch(p -> p\n .actions(\"email_admin\", a -> a\n .email(e -> e\n .subject(\"404 recently encountered\")\n .to(\"admin@domain.host.com\")\n )\n )\n .condition(c -> c\n .compare(NamedValue.of(\"ctx.payload.hits.total\",Pair.of(ConditionOp.Gt,FieldValue.of(0))))\n )\n .id(\"my-watch\")\n .input(i -> i\n .search(s -> s\n .request(r -> r\n .body(b -> b\n .query(q -> q\n .bool(bo -> bo\n .filter(f -> f\n .range(ra -> ra\n .untyped(u -> u\n .field(\"@timestamp\")\n )\n )\n )\n .must(m -> m\n .match(ma -> ma\n .field(\"response\")\n .query(FieldValue.of(404))\n )\n )\n )\n )\n )\n .indices(\"logstash*\")\n )\n )\n )\n .trigger(t -> t\n .schedule(sc -> sc\n .cron(\"0 0/1 * * * ?\")\n )\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name delete: tags: - watcher summary: Delete a watch description: "When the watch is removed, the document representing the watch in the `.watches` index is gone and it will never be run again.\n\nDeleting a watch does not delete any watch execution records related to this watch from the watch history.\n\nIMPORTANT: Deleting a watch must be done by using only this API.\nDo not delete the watch directly from the `.watches` index using the Elasticsearch delete document API\nWhen Elasticsearch security features are enabled, make sure no write privileges are granted to anyone for the `.watches` index.\n\n## Required authorization\n\n* Cluster privileges: `manage_watcher`\n" operationId: watcher-delete-watch parameters: - name: id in: path description: The watch identifier. required: true schema: $ref: '#/components/schemas/_types.Name' responses: '200': description: '' content: application/json: schema: required: - found - _id - _version type: object properties: found: type: boolean _id: allOf: - $ref: '#/components/schemas/_types.Id' _version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' examples: DeleteWatchResponseExample1: description: A successful response from `DELETE _watcher/watch/my_watch`. value: "{\n \"found\": true,\n \"_id\": \"my_watch\",\n \"_version\": 2\n}" x-state: Generally available x-codeSamples: - lang: Console source: "DELETE _watcher/watch/my_watch\n" - lang: Python source: "resp = client.watcher.delete_watch(\n id=\"my_watch\",\n)" - lang: JavaScript source: "const response = await client.watcher.deleteWatch({\n id: \"my_watch\",\n});" - lang: Ruby source: "response = client.watcher.delete_watch(\n id: \"my_watch\"\n)" - lang: PHP source: "$resp = $client->watcher()->deleteWatch([\n \"id\" => \"my_watch\",\n]);" - lang: curl source: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_watcher/watch/my_watch"' - lang: Java source: "client.watcher().deleteWatch(d -> d\n .id(\"my_watch\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name '/_watcher/watch/{id}/_execute': post: tags: - watcher summary: "Run a watch\n" description: "**All methods and paths for this operation:**\n\n
\n PUT\n /_watcher/watch/_execute\n
\n
\n POST\n /_watcher/watch/_execute\n
\n
\n PUT\n /_watcher/watch/{id}/_execute\n
\n
\n POST\n /_watcher/watch/{id}/_execute\n
\n \n\nThis API can be used to force execution of the watch outside of its triggering logic or to simulate the watch execution for debugging purposes.\n\nFor testing and debugging purposes, you also have fine-grained control on how the watch runs.\nYou can run the watch without running all of its actions or alternatively by simulating them.\nYou can also force execution by ignoring the watch condition and control whether a watch record would be written to the watch history after it runs.\n\nYou can use the run watch API to run watches that are not yet registered by specifying the watch definition inline.\nThis serves as great tool for testing and debugging your watches prior to adding them to Watcher.\n\nWhen Elasticsearch security features are enabled on your cluster, watches are run with the privileges of the user that stored the watches.\nIf your user is allowed to read index `a`, but not index `b`, then the exact same set of rules will apply during execution of a watch.\n\nWhen using the run watch API, the authorization data of the user that called the API will be used as a base, instead of the information who stored the watch.\nRefer to the external documentation for examples of watch execution requests, including existing, customized, and inline watches.\n\n## Required authorization\n\n* Cluster privileges: `manage_watcher`\n" externalDocs: description: More about executing a watch url: https://www.elastic.co/docs/explore-analyze/alerts-cases/watcher/execute-watch x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/watcher-api-execute-watch.html operationId: watcher-execute-watch parameters: - $ref: '#/components/parameters/watcher.execute_watch-id' - $ref: '#/components/parameters/watcher.execute_watch-debug' requestBody: $ref: '#/components/requestBodies/watcher.execute_watch' responses: '200': $ref: '#/components/responses/watcher.execute_watch-200' x-state: Generally available x-codeSamples: - lang: Console source: "POST _watcher/watch/my_watch/_execute\n{\n \"trigger_data\" : { \n \"triggered_time\" : \"now\",\n \"scheduled_time\" : \"now\"\n },\n \"alternative_input\" : { \n \"foo\" : \"bar\"\n },\n \"ignore_condition\" : true, \n \"action_modes\" : {\n \"my-action\" : \"force_simulate\" \n },\n \"record_execution\" : true \n}" - lang: Python source: "resp = client.watcher.execute_watch(\n id=\"my_watch\",\n trigger_data={\n \"triggered_time\": \"now\",\n \"scheduled_time\": \"now\"\n },\n alternative_input={\n \"foo\": \"bar\"\n },\n ignore_condition=True,\n action_modes={\n \"my-action\": \"force_simulate\"\n },\n record_execution=True,\n)" - lang: JavaScript source: "const response = await client.watcher.executeWatch({\n id: \"my_watch\",\n trigger_data: {\n triggered_time: \"now\",\n scheduled_time: \"now\",\n },\n alternative_input: {\n foo: \"bar\",\n },\n ignore_condition: true,\n action_modes: {\n \"my-action\": \"force_simulate\",\n },\n record_execution: true,\n});" - lang: Ruby source: "response = client.watcher.execute_watch(\n id: \"my_watch\",\n body: {\n \"trigger_data\": {\n \"triggered_time\": \"now\",\n \"scheduled_time\": \"now\"\n },\n \"alternative_input\": {\n \"foo\": \"bar\"\n },\n \"ignore_condition\": true,\n \"action_modes\": {\n \"my-action\": \"force_simulate\"\n },\n \"record_execution\": true\n }\n)" - lang: PHP source: "$resp = $client->watcher()->executeWatch([\n \"id\" => \"my_watch\",\n \"body\" => [\n \"trigger_data\" => [\n \"triggered_time\" => \"now\",\n \"scheduled_time\" => \"now\",\n ],\n \"alternative_input\" => [\n \"foo\" => \"bar\",\n ],\n \"ignore_condition\" => true,\n \"action_modes\" => [\n \"my-action\" => \"force_simulate\",\n ],\n \"record_execution\" => true,\n ],\n]);" - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"trigger_data":{"triggered_time":"now","scheduled_time":"now"},"alternative_input":{"foo":"bar"},"ignore_condition":true,"action_modes":{"my-action":"force_simulate"},"record_execution":true}'' "$ELASTICSEARCH_URL/_watcher/watch/my_watch/_execute"' - lang: Java source: "client.watcher().executeWatch(e -> e\n .actionModes(\"my-action\", ActionExecutionMode.ForceSimulate)\n .alternativeInput(\"foo\", JsonData.fromJson(\"\\\"bar\\\"\"))\n .id(\"my_watch\")\n .ignoreCondition(true)\n .recordExecution(true)\n .triggerData(t -> t\n .scheduledTime(DateTime.of(\"now\"))\n .triggeredTime(DateTime.of(\"now\"))\n )\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_watcher/settings: get: tags: - watcher summary: Get Watcher index settings description: "Get settings for the Watcher internal index (`.watches`).\nOnly a subset of settings are shown, for example `index.auto_expand_replicas` and `index.number_of_replicas`.\n\n## Required authorization\n\n* Cluster privileges: `manage_watcher`\n" operationId: watcher-get-settings parameters: - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - index type: object properties: index: allOf: - $ref: '#/components/schemas/indices._types.IndexSettings' examples: WatcherGetSettingsResponseExample1: description: A successful response with two index settings. value: "{\n \"index\": {\n \"auto_expand_replicas\": \"0-4\",\n \"number_of_replicas\": 0\n }\n}" x-state: Generally available x-codeSamples: - lang: Console source: "GET /_watcher/settings\n" - lang: Python source: resp = client.watcher.get_settings() - lang: JavaScript source: const response = await client.watcher.getSettings(); - lang: Ruby source: response = client.watcher.get_settings - lang: PHP source: $resp = $client->watcher()->getSettings(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_watcher/settings"' - lang: Java source: "client.watcher().getSettings(g -> g);\n" x-metaTags: - content: Elasticsearch name: product_name put: tags: - watcher summary: Update Watcher index settings description: "Update settings for the Watcher internal index (`.watches`).\nOnly a subset of settings can be modified.\nThis includes `index.auto_expand_replicas`, `index.number_of_replicas`, `index.routing.allocation.exclude.*`,\n`index.routing.allocation.include.*` and `index.routing.allocation.require.*`.\nModification of `index.routing.allocation.include._tier_preference` is an exception and is not allowed as the\nWatcher shards must always be in the `data_content` tier.\n\n## Required authorization\n\n* Cluster privileges: `manage_watcher`\n" operationId: watcher-update-settings parameters: - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s - name: timeout in: query description: "The period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: $ref: '#/components/schemas/_types.Duration' requestBody: content: application/json: schema: type: object properties: index.auto_expand_replicas: type: string index.number_of_replicas: type: number examples: WatcherUpdateSettingsRequestExample1: value: "{\n \"index.auto_expand_replicas\": \"0-4\"\n}" x-codeSamples: - lang: Console source: "PUT /_watcher/settings\n{\n \"index.auto_expand_replicas\": \"0-4\"\n}" - lang: Python source: "resp = client.watcher.update_settings(\n index_auto_expand_replicas=\"0-4\",\n)" - lang: JavaScript source: "const response = await client.watcher.updateSettings({\n \"index.auto_expand_replicas\": \"0-4\",\n});" - lang: Ruby source: "response = client.watcher.update_settings(\n body: {\n \"index.auto_expand_replicas\": \"0-4\"\n }\n)" - lang: PHP source: "$resp = $client->watcher()->updateSettings([\n \"body\" => [\n \"index.auto_expand_replicas\" => \"0-4\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"index.auto_expand_replicas":"0-4"}'' "$ELASTICSEARCH_URL/_watcher/settings"' - lang: Java source: "client.watcher().updateSettings(u -> u\n .indexAutoExpandReplicas(\"0-4\")\n);\n" required: true responses: '200': description: '' content: application/json: schema: required: - acknowledged type: object properties: acknowledged: type: boolean x-state: Generally available x-codeSamples: - lang: Console source: "PUT /_watcher/settings\n{\n \"index.auto_expand_replicas\": \"0-4\"\n}" - lang: Python source: "resp = client.watcher.update_settings(\n index_auto_expand_replicas=\"0-4\",\n)" - lang: JavaScript source: "const response = await client.watcher.updateSettings({\n \"index.auto_expand_replicas\": \"0-4\",\n});" - lang: Ruby source: "response = client.watcher.update_settings(\n body: {\n \"index.auto_expand_replicas\": \"0-4\"\n }\n)" - lang: PHP source: "$resp = $client->watcher()->updateSettings([\n \"body\" => [\n \"index.auto_expand_replicas\" => \"0-4\",\n ],\n]);" - lang: curl source: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d ''{"index.auto_expand_replicas":"0-4"}'' "$ELASTICSEARCH_URL/_watcher/settings"' - lang: Java source: "client.watcher().updateSettings(u -> u\n .indexAutoExpandReplicas(\"0-4\")\n);\n" x-metaTags: - content: Elasticsearch name: product_name /_watcher/_query/watches: post: tags: - watcher summary: "Query watches\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_watcher/_query/watches\n
\n
\n POST\n /_watcher/_query/watches\n
\n \n\nGet all registered watches in a paginated manner and optionally filter watches by a query.\n\nNote that only the `_id` and `metadata.*` fields are queryable or sortable.\n\n## Required authorization\n\n* Cluster privileges: `monitor_watcher`\n" operationId: watcher-query-watches requestBody: $ref: '#/components/requestBodies/watcher.query_watches' responses: '200': $ref: '#/components/responses/watcher.query_watches-200' x-state: Generally available; Added in 7.11.0 x-codeSamples: - lang: Console source: "GET /_watcher/_query/watches\n" - lang: Python source: resp = client.watcher.query_watches() - lang: JavaScript source: const response = await client.watcher.queryWatches(); - lang: Ruby source: response = client.watcher.query_watches - lang: PHP source: $resp = $client->watcher()->queryWatches(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_watcher/_query/watches"' - lang: Java source: "client.watcher().queryWatches(q -> q);\n" x-metaTags: - content: Elasticsearch name: product_name /_watcher/_start: post: tags: - watcher summary: Start the watch service description: "Start the Watcher service if it is not already running.\n\n## Required authorization\n\n* Cluster privileges: `manage_watcher`\n" operationId: watcher-start parameters: - name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: WatcherStartResponseExample1: description: A successful response from `POST _watcher/_start`. value: "{\n \"acknowledged\": true\n}" x-state: Generally available x-codeSamples: - lang: Console source: "POST _watcher/_start\n" - lang: Python source: resp = client.watcher.start() - lang: JavaScript source: const response = await client.watcher.start(); - lang: Ruby source: response = client.watcher.start - lang: PHP source: $resp = $client->watcher()->start(); - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_watcher/_start"' - lang: Java source: "client.watcher().start(s -> s);\n" x-metaTags: - content: Elasticsearch name: product_name '/_watcher/stats/{metric}': get: tags: - watcher summary: "Get Watcher statistics\n" description: "**All methods and paths for this operation:**\n\n
\n GET\n /_watcher/stats\n
\n
\n GET\n /_watcher/stats/{metric}\n
\n \n\nThis API always returns basic metrics.\nYou retrieve more metrics by using the metric parameter.\n\n## Required authorization\n\n* Cluster privileges: `monitor_watcher`\n" operationId: watcher-stats parameters: - $ref: '#/components/parameters/watcher.stats-metric' - $ref: '#/components/parameters/watcher.stats-emit_stacktraces' - $ref: '#/components/parameters/watcher.stats-metric_' responses: '200': $ref: '#/components/responses/watcher.stats-200' x-state: Generally available; Added in 5.5.0 x-codeSamples: - lang: Console source: "GET _watcher/stats\n" - lang: Python source: resp = client.watcher.stats() - lang: JavaScript source: const response = await client.watcher.stats(); - lang: Ruby source: response = client.watcher.stats - lang: PHP source: $resp = $client->watcher()->stats(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_watcher/stats"' - lang: Java source: "client.watcher().stats(s -> s);\n" x-metaTags: - content: Elasticsearch name: product_name /_watcher/_stop: post: tags: - watcher summary: Stop the watch service description: "Stop the Watcher service if it is running.\n\n## Required authorization\n\n* Cluster privileges: `manage_watcher`\n" operationId: watcher-stop parameters: - name: master_timeout in: query description: "The period to wait for the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nTo indicate that the request should never timeout, set it to `-1`." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: WatcherStopResponseExample1: description: A successful response from `POST _watcher/_stop`. value: "{\n \"acknowledged\": true\n}" x-state: Generally available x-codeSamples: - lang: Console source: "POST _watcher/_stop\n" - lang: Python source: resp = client.watcher.stop() - lang: JavaScript source: const response = await client.watcher.stop(); - lang: Ruby source: response = client.watcher.stop - lang: PHP source: $resp = $client->watcher()->stop(); - lang: curl source: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_watcher/_stop"' - lang: Java source: "client.watcher().stop(s -> s);\n" x-metaTags: - content: Elasticsearch name: product_name /_xpack: get: tags: - xpack summary: Get information description: "The information provided by the API includes:\n\n* Build information including the build number and timestamp.\n* License information about the currently installed license.\n* Feature information for the features that are currently enabled and available under the current license.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: xpack-info parameters: - name: categories in: query description: "A comma-separated list of the information categories to include in the response.\nFor example, `build,license,features`." schema: type: array items: $ref: '#/components/schemas/xpack.info.XPackCategory' - name: accept_enterprise in: query description: 'If used, this otherwise ignored parameter must be set to true' deprecated: true schema: type: boolean - name: human in: query description: "Defines whether additional human-readable information is included in the response.\nIn particular, it adds descriptions and a tag line." schema: type: boolean default: true responses: '200': description: '' content: application/json: schema: required: - build - features - license - tagline type: object properties: build: allOf: - $ref: '#/components/schemas/xpack.info.BuildInformation' features: allOf: - $ref: '#/components/schemas/xpack.info.Features' license: allOf: - $ref: '#/components/schemas/xpack.info.MinimalLicenseInformation' tagline: type: string examples: XPackInfoResponseExample1: description: A successful response from `GET /_xpack`. value: "{\n \"build\" : {\n \"hash\" : \"2798b1a3ce779b3611bb53a0082d4d741e4d3168\",\n \"date\" : \"2015-04-07T13:34:42Z\"\n },\n \"license\" : {\n \"uid\" : \"893361dc-9749-4997-93cb-xxx\",\n \"type\" : \"trial\",\n \"mode\" : \"trial\",\n \"status\" : \"active\",\n \"expiry_date_in_millis\" : 1542665112332\n },\n \"features\" : {\n \"ccr\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"aggregate_metric\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"analytics\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"archive\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"enrich\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"graph\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"ilm\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"logstash\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"ml\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"esql\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"monitoring\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"rollup\": {\n \"available\": true,\n \"enabled\": true\n },\n \"searchable_snapshots\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"security\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"slm\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"spatial\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"eql\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"sql\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"transform\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"voting_only\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"watcher\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"data_streams\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"data_tiers\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"enterprise_search\": {\n \"available\": true,\n \"enabled\": true\n },\n \"universal_profiling\": {\n \"available\": true,\n \"enabled\": true\n },\n \"logsdb\": {\n \"available\": true,\n \"enabled\": false\n }\n },\n \"tagline\" : \"You know, for X\"\n}" x-state: Generally available x-codeSamples: - lang: Console source: "GET /_xpack\n" - lang: Python source: resp = client.xpack.info() - lang: JavaScript source: const response = await client.xpack.info(); - lang: Ruby source: response = client.xpack.info - lang: PHP source: $resp = $client->xpack()->info(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_xpack"' - lang: C# source: var response = await client.Xpack.InfoAsync(); - lang: Java source: "client.xpack().info(i -> i);\n" x-metaTags: - content: Elasticsearch name: product_name /_xpack/usage: get: tags: - xpack summary: Get usage information description: "Get information about the features that are currently enabled and available under the current license.\nThe API also provides some usage statistics.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n" operationId: xpack-usage parameters: - name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error.\nTo indicate that the request should never timeout, set it to `-1`." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s responses: '200': description: '' content: application/json: schema: required: - aggregate_metric - analytics - archive - watcher - ccr - data_tiers - eql - graph - ilm - logstash - ml - monitoring - rollup - spatial - searchable_snapshots - security - slm - sql - transform - voting_only type: object properties: aggregate_metric: allOf: - $ref: '#/components/schemas/xpack.usage.Base' analytics: allOf: - $ref: '#/components/schemas/xpack.usage.Analytics' archive: allOf: - $ref: '#/components/schemas/xpack.usage.Archive' x-state: Generally available; Added in 8.2.0 watcher: allOf: - $ref: '#/components/schemas/xpack.usage.Watcher' ccr: allOf: - $ref: '#/components/schemas/xpack.usage.Ccr' columnar: allOf: - $ref: '#/components/schemas/xpack.usage.IndexModeUsage' description: Usage of the indices with `index.mode` set to `columnar`. x-state: Generally available; Added in 9.6.0 data_frame: allOf: - $ref: '#/components/schemas/xpack.usage.Base' data_science: allOf: - $ref: '#/components/schemas/xpack.usage.Base' data_lifecycle: allOf: - $ref: '#/components/schemas/xpack.usage.DataStreamLifecycleUsage' data_streams: allOf: - $ref: '#/components/schemas/xpack.usage.DataStreams' data_tiers: allOf: - $ref: '#/components/schemas/xpack.usage.DataTiers' enrich: allOf: - $ref: '#/components/schemas/xpack.usage.Base' eql: allOf: - $ref: '#/components/schemas/xpack.usage.Eql' flattened: allOf: - $ref: '#/components/schemas/xpack.usage.Flattened' graph: allOf: - $ref: '#/components/schemas/xpack.usage.Base' gpu_vector_indexing: allOf: - $ref: '#/components/schemas/xpack.usage.GpuVectorIndexing' x-state: Generally available; Added in 9.3.2 health_api: allOf: - $ref: '#/components/schemas/xpack.usage.HealthStatistics' ilm: allOf: - $ref: '#/components/schemas/xpack.usage.Ilm' logging: allOf: - $ref: '#/components/schemas/xpack.usage.Logging' x-state: Generally available; Added in 9.5.0 logsdb_columnar: allOf: - $ref: '#/components/schemas/xpack.usage.IndexModeUsage' description: Usage of the indices with `index.mode` set to `logsdb_columnar`. x-state: Generally available; Added in 9.6.0 logstash: allOf: - $ref: '#/components/schemas/xpack.usage.Base' ml: allOf: - $ref: '#/components/schemas/xpack.usage.MachineLearning' monitoring: allOf: - $ref: '#/components/schemas/xpack.usage.Monitoring' rollup: allOf: - $ref: '#/components/schemas/xpack.usage.Base' runtime_fields: allOf: - $ref: '#/components/schemas/xpack.usage.RuntimeFieldTypes' spatial: allOf: - $ref: '#/components/schemas/xpack.usage.Base' searchable_snapshots: allOf: - $ref: '#/components/schemas/xpack.usage.SearchableSnapshots' security: allOf: - $ref: '#/components/schemas/xpack.usage.Security' slm: allOf: - $ref: '#/components/schemas/xpack.usage.Slm' sql: allOf: - $ref: '#/components/schemas/xpack.usage.Sql' transform: allOf: - $ref: '#/components/schemas/xpack.usage.Base' vectors: allOf: - $ref: '#/components/schemas/xpack.usage.Vector' vectordb_document: allOf: - $ref: '#/components/schemas/xpack.usage.VectorDbDocument' x-state: Generally available; Added in 9.5.0 vectordb_columnar: allOf: - $ref: '#/components/schemas/xpack.usage.VectorDbColumnar' description: "The `vectordb_columnar` index mode is behind a feature flag.\nWithout the flag, this section is still returned, disabled and with zero counts." x-state: Generally available; Added in 9.6.0 voting_only: allOf: - $ref: '#/components/schemas/xpack.usage.Base' examples: XPackUsageResponseExample1: description: An abbreviated response from `GET /_xpack/usage`. value: "{\n \"security\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"monitoring\" : {\n \"available\" : true,\n \"enabled\" : true,\n \"collection_enabled\" : false,\n \"enabled_exporters\" : {\n \"local\" : 1\n }\n },\n \"watcher\" : {\n \"available\" : true,\n \"enabled\" : true,\n \"execution\" : {\n \"actions\" : {\n \"_all\" : {\n \"total\" : 0,\n \"total_time_in_ms\" : 0\n }\n }\n },\n \"watch\" : {\n \"input\" : {\n \"_all\" : {\n \"total\" : 0,\n \"active\" : 0\n }\n },\n \"trigger\" : {\n \"_all\" : {\n \"total\" : 0,\n \"active\" : 0\n }\n }\n },\n \"count\" : {\n \"total\" : 0,\n \"active\" : 0\n }\n },\n \"graph\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"ml\" : {\n \"available\" : true,\n \"enabled\" : true,\n \"jobs\" : {\n \"_all\" : {\n \"count\" : 0,\n \"detectors\" : { },\n \"created_by\" : { },\n \"model_size\" : { },\n \"forecasts\" : {\n \"total\" : 0,\n \"forecasted_jobs\" : 0\n }\n }\n },\n \"datafeeds\" : {\n \"_all\" : {\n \"count\" : 0\n }\n },\n \"data_frame_analytics_jobs\" : {\n \"_all\" : {\n \"count\" : 0\n },\n \"analysis_counts\": { },\n \"memory_usage\": {\n \"peak_usage_bytes\": {\n \"min\": 0.0,\n \"max\": 0.0,\n \"avg\": 0.0,\n \"total\": 0.0\n }\n }\n },\n \"inference\" : {\n \"ingest_processors\" : {\n \"_all\" : {\n \"num_docs_processed\" : {\n \"max\" : 0,\n \"sum\" : 0,\n \"min\" : 0\n },\n \"pipelines\" : {\n \"count\" : 0\n },\n \"num_failures\" : {\n \"max\" : 0,\n \"sum\" : 0,\n \"min\" : 0\n },\n \"time_ms\" : {\n \"max\" : 0,\n \"sum\" : 0,\n \"min\" : 0\n }\n }\n },\n \"trained_models\" : {\n \"_all\" : {\n \"count\": 1\n },\n \"count\": {\n \"total\": 1,\n \"prepackaged\": 1,\n \"other\": 0\n },\n \"model_size_bytes\": {\n \"min\": 0.0,\n \"max\": 0.0,\n \"avg\": 0.0,\n \"total\": 0.0\n },\n \"estimated_operations\": {\n \"min\": 0.0,\n \"max\": 0.0,\n \"avg\": 0.0,\n \"total\": 0.0\n }\n },\n \"deployments\": {\n \"count\": 0,\n \"inference_counts\": {\n \"total\": 0.0,\n \"min\": 0.0,\n \"avg\": 0.0,\n \"max\": 0.0\n },\n \"stats_by_model\": [],\n \"model_sizes_bytes\": {\n \"total\": 0.0,\n \"min\": 0.0,\n \"avg\": 0.0,\n \"max\": 0.0\n },\n \"time_ms\": {\n \"avg\": 0.0\n }\n }\n },\n \"node_count\" : 1,\n \"memory\": {\n anomaly_detectors_memory_bytes: 0,\n data_frame_analytics_memory_bytes: 0,\n pytorch_inference_memory_bytes: 0,\n total_used_memory_bytes: 0\n }\n },\n \"inference\": {\n \"available\" : true,\n \"enabled\" : true,\n \"models\" : [ ]\n },\n \"logstash\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"eql\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"esql\" : {\n \"available\" : true,\n \"enabled\" : true,\n \"features\" : {\n \"eval\" : 0,\n \"stats\" : 0,\n \"dissect\": 0,\n \"grok\" : 0,\n \"limit\" : 0,\n \"where\" : 0,\n \"sort\" : 0,\n \"drop\" : 0,\n \"show\" : 0,\n \"rename\" : 0,\n \"mv_expand\" : 0,\n \"keep\" : 0,\n \"enrich\" : 0,\n \"from\" : 0,\n \"row\" : 0\n },\n \"queries\" : {\n \"rest\" : {\n \"total\" : 0,\n \"failed\" : 0\n },\n \"kibana\" : {\n \"total\" : 0,\n \"failed\" : 0\n },\n \"_all\" : {\n \"total\" : 0,\n \"failed\" : 0\n }\n }\n },\n \"sql\" : {\n \"available\" : true,\n \"enabled\" : true,\n \"features\" : {\n \"having\" : 0,\n \"subselect\" : 0,\n \"limit\" : 0,\n \"orderby\" : 0,\n \"where\" : 0,\n \"join\" : 0,\n \"groupby\" : 0,\n \"command\" : 0,\n \"local\" : 0\n },\n \"queries\" : {\n \"rest\" : {\n \"total\" : 0,\n \"paging\" : 0,\n \"failed\" : 0\n },\n \"cli\" : {\n \"total\" : 0,\n \"paging\" : 0,\n \"failed\" : 0\n },\n \"canvas\" : {\n \"total\" : 0,\n \"paging\" : 0,\n \"failed\" : 0\n },\n \"odbc\" : {\n \"total\" : 0,\n \"paging\" : 0,\n \"failed\" : 0\n },\n \"jdbc\" : {\n \"total\" : 0,\n \"paging\" : 0,\n \"failed\" : 0\n },\n \"odbc32\" : {\n \"total\" : 0,\n \"paging\" : 0,\n \"failed\" : 0\n },\n \"odbc64\" : {\n \"total\" : 0,\n \"paging\" : 0,\n \"failed\" : 0\n },\n \"_all\" : {\n \"total\" : 0,\n \"paging\" : 0,\n \"failed\" : 0\n },\n \"translate\" : {\n \"count\" : 0\n }\n }\n },\n \"rollup\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"ilm\" : {\n \"policy_count\" : 3,\n \"policy_stats\" : [ ]\n },\n \"slm\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"ccr\" : {\n \"available\" : true,\n \"enabled\" : true,\n \"follower_indices_count\" : 0,\n \"auto_follow_patterns_count\" : 0\n },\n \"transform\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"voting_only\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"searchable_snapshots\" : {\n \"available\" : true,\n \"enabled\" : true,\n \"indices_count\" : 0,\n \"full_copy_indices_count\" : 0,\n \"shared_cache_indices_count\" : 0\n },\n \"spatial\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"analytics\" : {\n \"available\" : true,\n \"enabled\" : true,\n \"stats\": {\n \"boxplot_usage\" : 0,\n \"top_metrics_usage\" : 0,\n \"normalize_usage\" : 0,\n \"cumulative_cardinality_usage\" : 0,\n \"t_test_usage\" : 0,\n \"rate_usage\" : 0,\n \"string_stats_usage\" : 0,\n \"moving_percentiles_usage\" : 0,\n \"multi_terms_usage\" : 0\n }\n },\n \"data_streams\" : {\n \"available\" : true,\n \"enabled\" : true,\n \"data_streams\" : 0,\n \"indices_count\" : 0\n },\n \"data_lifecycle\" : {\n \"available\": true,\n \"enabled\": true,\n \"count\": 0,\n \"default_rollover_used\": true,\n \"data_retention\": {\n \"configured_data_streams\": 0\n },\n \"effective_retention\": {\n \"retained_data_streams\": 0\n },\n \"global_retention\": {\n \"default\": {\n \"defined\": false\n },\n \"max\": {\n \"defined\": false\n }\n }\n },\n \"data_tiers\" : {\n \"available\" : true,\n \"enabled\" : true,\n \"data_warm\" : {\n \"node_count\" : 0,\n \"index_count\" : 0,\n \"total_shard_count\" : 0,\n \"primary_shard_count\" : 0,\n \"doc_count\" : 0,\n \"total_size_bytes\" : 0,\n \"primary_size_bytes\" : 0,\n \"primary_shard_size_avg_bytes\" : 0,\n \"primary_shard_size_median_bytes\" : 0,\n \"primary_shard_size_mad_bytes\" : 0\n },\n \"data_frozen\" : {\n \"node_count\" : 1,\n \"index_count\" : 0,\n \"total_shard_count\" : 0,\n \"primary_shard_count\" : 0,\n \"doc_count\" : 0,\n \"total_size_bytes\" : 0,\n \"primary_size_bytes\" : 0,\n \"primary_shard_size_avg_bytes\" : 0,\n \"primary_shard_size_median_bytes\" : 0,\n \"primary_shard_size_mad_bytes\" : 0\n },\n \"data_cold\" : {\n \"node_count\" : 0,\n \"index_count\" : 0,\n \"total_shard_count\" : 0,\n \"primary_shard_count\" : 0,\n \"doc_count\" : 0,\n \"total_size_bytes\" : 0,\n \"primary_size_bytes\" : 0,\n \"primary_shard_size_avg_bytes\" : 0,\n \"primary_shard_size_median_bytes\" : 0,\n \"primary_shard_size_mad_bytes\" : 0\n },\n \"data_content\" : {\n \"node_count\" : 0,\n \"index_count\" : 0,\n \"total_shard_count\" : 0,\n \"primary_shard_count\" : 0,\n \"doc_count\" : 0,\n \"total_size_bytes\" : 0,\n \"primary_size_bytes\" : 0,\n \"primary_shard_size_avg_bytes\" : 0,\n \"primary_shard_size_median_bytes\" : 0,\n \"primary_shard_size_mad_bytes\" : 0\n },\n \"data_hot\" : {\n \"node_count\" : 0,\n \"index_count\" : 0,\n \"total_shard_count\" : 0,\n \"primary_shard_count\" : 0,\n \"doc_count\" : 0,\n \"total_size_bytes\" : 0,\n \"primary_size_bytes\" : 0,\n \"primary_shard_size_avg_bytes\" : 0,\n \"primary_shard_size_median_bytes\" : 0,\n \"primary_shard_size_mad_bytes\" : 0\n }\n },\n \"aggregate_metric\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"archive\" : {\n \"available\" : true,\n \"enabled\" : true,\n \"indices_count\" : 0\n },\n \"health_api\" : {\n \"available\" : true,\n \"enabled\" : true,\n \"invocations\": {\n \"total\": 0\n }\n },\n \"remote_clusters\": {\n \"size\": 0,\n \"mode\": {\n \"proxy\": 0,\n \"sniff\": 0\n },\n \"security\": {\n \"cert\": 0,\n \"api_key\": 0\n }\n },\n \"enterprise_search\" : {\n \"available\": true,\n \"enabled\": true,\n \"search_applications\" : {\n \"count\": 0\n },\n \"analytics_collections\": {\n \"count\": 0\n },\n \"query_rulesets\": {\n \"total_rule_count\": 0,\n \"total_count\": 0,\n \"min_rule_count\": 0,\n \"max_rule_count\": 0\n }\n },\n \"universal_profiling\" : {\n \"available\" : true,\n \"enabled\" : true\n },\n \"logsdb\": {\n \"available\": true,\n \"enabled\": false,\n \"indices_count\": 0,\n \"indices_with_synthetic_source\": 0,\n \"num_docs\": 0,\n \"size_in_bytes\": 0,\n \"has_custom_cutoff_date\": false\n }\n}" x-state: Generally available x-codeSamples: - lang: Console source: "GET /_xpack/usage\n" - lang: Python source: resp = client.xpack.usage() - lang: JavaScript source: const response = await client.xpack.usage(); - lang: Ruby source: response = client.xpack.usage - lang: PHP source: $resp = $client->xpack()->usage(); - lang: curl source: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_xpack/usage"' - lang: C# source: var response = await client.Xpack.UsageAsync(); - lang: Java source: "client.xpack().usage(u -> u);\n" x-metaTags: - content: Elasticsearch name: product_name components: schemas: _types.Id: type: string _types.AcknowledgedResponseBase: required: - acknowledged type: object properties: acknowledged: type: boolean description: 'For a successful response, this value is always true. On failure, an exception is returned instead.' _types.Duration: type: string description: "A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and\n`d` (days). Also accepts \"0\" without a unit and \"-1\" to indicate an unspecified value." externalDocs: url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/api-conventions#time-units async_search._types.AsyncSearchDocumentResponseBase: allOf: - $ref: '#/components/schemas/async_search._types.AsyncSearchResponseBase' - required: - response type: object properties: response: allOf: - $ref: '#/components/schemas/async_search._types.AsyncSearch' async_search._types.AsyncSearch: required: - hits - _shards - timed_out - took type: object properties: aggregations: type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.Aggregate' description: 'Partial aggregations results, coming from the shards that have already completed running the query.' _clusters: allOf: - $ref: '#/components/schemas/_types.ClusterStatistics' fields: type: object additionalProperties: type: object hits: allOf: - $ref: '#/components/schemas/_global.search._types.HitsMetadata' max_score: type: number num_reduce_phases: type: number description: "Indicates how many reductions of the results have been performed.\nIf this number increases compared to the last retrieved results for a get asynch search request, you can expect additional results included in the search response." profile: allOf: - $ref: '#/components/schemas/_global.search._types.Profile' pit_id: allOf: - $ref: '#/components/schemas/_types.Id' _scroll_id: allOf: - $ref: '#/components/schemas/_types.ScrollId' _shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' description: "Indicates how many shards have run the query.\nNote that in order for shard results to be included in the search response, they need to be reduced first." suggest: type: object additionalProperties: type: array items: $ref: '#/components/schemas/_global.search._types.Suggest' terminated_early: type: boolean timed_out: type: boolean took: type: number _types.aggregations.Aggregate: oneOf: - $ref: '#/components/schemas/_types.aggregations.CardinalityAggregate' - $ref: '#/components/schemas/_types.aggregations.HdrPercentilesAggregate' - $ref: '#/components/schemas/_types.aggregations.HdrPercentileRanksAggregate' - $ref: '#/components/schemas/_types.aggregations.TDigestPercentilesAggregate' - $ref: '#/components/schemas/_types.aggregations.TDigestPercentileRanksAggregate' - $ref: '#/components/schemas/_types.aggregations.PercentilesBucketAggregate' - $ref: '#/components/schemas/_types.aggregations.MedianAbsoluteDeviationAggregate' - $ref: '#/components/schemas/_types.aggregations.MinAggregate' - $ref: '#/components/schemas/_types.aggregations.MaxAggregate' - $ref: '#/components/schemas/_types.aggregations.SumAggregate' - $ref: '#/components/schemas/_types.aggregations.AvgAggregate' - $ref: '#/components/schemas/_types.aggregations.WeightedAvgAggregate' - $ref: '#/components/schemas/_types.aggregations.ValueCountAggregate' - $ref: '#/components/schemas/_types.aggregations.SimpleValueAggregate' - $ref: '#/components/schemas/_types.aggregations.DerivativeAggregate' - $ref: '#/components/schemas/_types.aggregations.BucketMetricValueAggregate' - $ref: '#/components/schemas/_types.aggregations.ChangePointAggregate' - $ref: '#/components/schemas/_types.aggregations.StatsAggregate' - $ref: '#/components/schemas/_types.aggregations.StatsBucketAggregate' - $ref: '#/components/schemas/_types.aggregations.ExtendedStatsAggregate' - $ref: '#/components/schemas/_types.aggregations.ExtendedStatsBucketAggregate' - $ref: '#/components/schemas/_types.aggregations.CartesianBoundsAggregate' - $ref: '#/components/schemas/_types.aggregations.CartesianCentroidAggregate' - $ref: '#/components/schemas/_types.aggregations.GeoBoundsAggregate' - $ref: '#/components/schemas/_types.aggregations.GeoCentroidAggregate' - $ref: '#/components/schemas/_types.aggregations.HistogramAggregate' - $ref: '#/components/schemas/_types.aggregations.DateHistogramAggregate' - $ref: '#/components/schemas/_types.aggregations.AutoDateHistogramAggregate' - $ref: '#/components/schemas/_types.aggregations.VariableWidthHistogramAggregate' - $ref: '#/components/schemas/_types.aggregations.StringTermsAggregate' - $ref: '#/components/schemas/_types.aggregations.LongTermsAggregate' - $ref: '#/components/schemas/_types.aggregations.DoubleTermsAggregate' - $ref: '#/components/schemas/_types.aggregations.UnmappedTermsAggregate' - $ref: '#/components/schemas/_types.aggregations.LongRareTermsAggregate' - $ref: '#/components/schemas/_types.aggregations.StringRareTermsAggregate' - $ref: '#/components/schemas/_types.aggregations.UnmappedRareTermsAggregate' - $ref: '#/components/schemas/_types.aggregations.MultiTermsAggregate' - $ref: '#/components/schemas/_types.aggregations.MissingAggregate' - $ref: '#/components/schemas/_types.aggregations.NestedAggregate' - $ref: '#/components/schemas/_types.aggregations.ReverseNestedAggregate' - $ref: '#/components/schemas/_types.aggregations.GlobalAggregate' - $ref: '#/components/schemas/_types.aggregations.FilterAggregate' - $ref: '#/components/schemas/_types.aggregations.ChildrenAggregate' - $ref: '#/components/schemas/_types.aggregations.ParentAggregate' - $ref: '#/components/schemas/_types.aggregations.SamplerAggregate' - $ref: '#/components/schemas/_types.aggregations.UnmappedSamplerAggregate' - $ref: '#/components/schemas/_types.aggregations.GeoHashGridAggregate' - $ref: '#/components/schemas/_types.aggregations.GeoTileGridAggregate' - $ref: '#/components/schemas/_types.aggregations.GeoHexGridAggregate' - $ref: '#/components/schemas/_types.aggregations.RangeAggregate' - $ref: '#/components/schemas/_types.aggregations.DateRangeAggregate' - $ref: '#/components/schemas/_types.aggregations.GeoDistanceAggregate' - $ref: '#/components/schemas/_types.aggregations.IpRangeAggregate' - $ref: '#/components/schemas/_types.aggregations.IpPrefixAggregate' - $ref: '#/components/schemas/_types.aggregations.FiltersAggregate' - $ref: '#/components/schemas/_types.aggregations.AdjacencyMatrixAggregate' - $ref: '#/components/schemas/_types.aggregations.SignificantLongTermsAggregate' - $ref: '#/components/schemas/_types.aggregations.SignificantStringTermsAggregate' - $ref: '#/components/schemas/_types.aggregations.UnmappedSignificantTermsAggregate' - $ref: '#/components/schemas/_types.aggregations.CompositeAggregate' - $ref: '#/components/schemas/_types.aggregations.FrequentItemSetsAggregate' - $ref: '#/components/schemas/_types.aggregations.TimeSeriesAggregate' - $ref: '#/components/schemas/_types.aggregations.ScriptedMetricAggregate' - $ref: '#/components/schemas/_types.aggregations.TopHitsAggregate' - $ref: '#/components/schemas/_types.aggregations.InferenceAggregate' - $ref: '#/components/schemas/_types.aggregations.StringStatsAggregate' - $ref: '#/components/schemas/_types.aggregations.BoxPlotAggregate' - $ref: '#/components/schemas/_types.aggregations.TopMetricsAggregate' - $ref: '#/components/schemas/_types.aggregations.TTestAggregate' - $ref: '#/components/schemas/_types.aggregations.RateAggregate' - $ref: '#/components/schemas/_types.aggregations.CumulativeCardinalityAggregate' - $ref: '#/components/schemas/_types.aggregations.MatrixStatsAggregate' - $ref: '#/components/schemas/_types.aggregations.GeoLineAggregate' externalDocs: url: https://www.elastic.co/docs/explore-analyze/query-filter/aggregations x-model: true _types.aggregations.CardinalityAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - value type: object properties: value: type: number x-model: true _types.aggregations.AggregateBase: type: object properties: meta: allOf: - $ref: '#/components/schemas/_types.Metadata' _types.Metadata: type: object additionalProperties: type: object _types.aggregations.HdrPercentilesAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.PercentilesAggregateBase' - type: object x-model: true _types.aggregations.PercentilesAggregateBase: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - values type: object properties: values: allOf: - $ref: '#/components/schemas/_types.aggregations.Percentiles' _types.aggregations.Percentiles: oneOf: - $ref: '#/components/schemas/_types.aggregations.KeyedPercentiles' - type: array items: $ref: '#/components/schemas/_types.aggregations.ArrayPercentilesItem' _types.aggregations.KeyedPercentiles: type: object additionalProperties: oneOf: - type: string - type: number - type: - 'null' - string _types.aggregations.ArrayPercentilesItem: required: - key - value type: object properties: key: type: number value: oneOf: - type: number - type: - 'null' - string value_as_string: type: string _types.aggregations.HdrPercentileRanksAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.PercentilesAggregateBase' - type: object x-model: true _types.aggregations.TDigestPercentilesAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.PercentilesAggregateBase' - type: object x-model: true _types.aggregations.TDigestPercentileRanksAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.PercentilesAggregateBase' - type: object x-model: true _types.aggregations.PercentilesBucketAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.PercentilesAggregateBase' - type: object x-model: true _types.aggregations.MedianAbsoluteDeviationAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.SingleMetricAggregateBase' - type: object x-model: true _types.aggregations.SingleMetricAggregateBase: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - value type: object properties: value: oneOf: - type: number - type: - 'null' - string description: "The metric value. A missing value generally means that there was no data to aggregate,\nunless specified otherwise." value_as_string: type: string _types.aggregations.MinAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.SingleMetricAggregateBase' - type: object x-model: true _types.aggregations.MaxAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.SingleMetricAggregateBase' - type: object x-model: true _types.aggregations.SumAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.SingleMetricAggregateBase' - type: object description: Sum aggregation result. `value` is always present and is zero if there were no values to process. x-model: true _types.aggregations.AvgAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.SingleMetricAggregateBase' - type: object x-model: true _types.aggregations.WeightedAvgAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.SingleMetricAggregateBase' - type: object description: Weighted average aggregation result. `value` is missing if the weight was set to zero. x-model: true _types.aggregations.ValueCountAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.SingleMetricAggregateBase' - type: object description: Value count aggregation result. `value` is always present. x-model: true _types.aggregations.SimpleValueAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.SingleMetricAggregateBase' - type: object x-model: true _types.aggregations.DerivativeAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.SingleMetricAggregateBase' - type: object properties: normalized_value: type: number normalized_value_as_string: type: string x-model: true _types.aggregations.BucketMetricValueAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.SingleMetricAggregateBase' - required: - keys type: object properties: keys: type: array items: type: string x-model: true _types.aggregations.ChangePointAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - type type: object properties: type: allOf: - $ref: '#/components/schemas/_types.aggregations.ChangeType' bucket: allOf: - $ref: '#/components/schemas/_types.aggregations.ChangePointBucket' _types.aggregations.ChangeType: maxProperties: 1 minProperties: 1 type: object properties: dip: allOf: - $ref: '#/components/schemas/_types.aggregations.Dip' distribution_change: allOf: - $ref: '#/components/schemas/_types.aggregations.DistributionChange' indeterminable: allOf: - $ref: '#/components/schemas/_types.aggregations.Indeterminable' non_stationary: allOf: - $ref: '#/components/schemas/_types.aggregations.NonStationary' spike: allOf: - $ref: '#/components/schemas/_types.aggregations.Spike' stationary: allOf: - $ref: '#/components/schemas/_types.aggregations.Stationary' step_change: allOf: - $ref: '#/components/schemas/_types.aggregations.StepChange' trend_change: allOf: - $ref: '#/components/schemas/_types.aggregations.TrendChange' _types.aggregations.Dip: allOf: - $ref: '#/components/schemas/_types.aggregations.AbstractChangePoint' - type: object _types.aggregations.AbstractChangePoint: required: - p_value - change_point type: object properties: p_value: type: number change_point: type: number _types.aggregations.DistributionChange: allOf: - $ref: '#/components/schemas/_types.aggregations.AbstractChangePoint' - type: object _types.aggregations.Indeterminable: required: - reason type: object properties: reason: type: string _types.aggregations.NonStationary: required: - p_value - r_value - trend type: object properties: p_value: type: number r_value: type: number trend: type: string _types.aggregations.Spike: allOf: - $ref: '#/components/schemas/_types.aggregations.AbstractChangePoint' - type: object _types.aggregations.Stationary: type: object _types.aggregations.StepChange: allOf: - $ref: '#/components/schemas/_types.aggregations.AbstractChangePoint' - type: object _types.aggregations.TrendChange: required: - p_value - r_value - change_point type: object properties: p_value: type: number r_value: type: number change_point: type: number _types.aggregations.ChangePointBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketBase' - required: - key type: object properties: key: allOf: - $ref: '#/components/schemas/_types.FieldValue' _types.FieldValue: oneOf: - type: number - type: number - type: string - type: boolean - type: - 'null' - string description: A field value. _types.aggregations.MultiBucketBase: required: - doc_count type: object properties: doc_count: type: number description: Base type for multi-bucket aggregation results that can hold sub-aggregations results. _types.aggregations.StatsAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - count - min - max - avg - sum type: object properties: count: type: number min: oneOf: - type: number - type: - 'null' - string max: oneOf: - type: number - type: - 'null' - string avg: oneOf: - type: number - type: - 'null' - string sum: type: number min_as_string: type: string max_as_string: type: string avg_as_string: type: string sum_as_string: type: string description: "Statistics aggregation result. `min`, `max` and `avg` are missing if there were no values to process\n(`count` is zero)." x-model: true _types.aggregations.StatsBucketAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.StatsAggregate' - type: object x-model: true _types.aggregations.ExtendedStatsAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.StatsAggregate' - required: - sum_of_squares - variance - variance_population - variance_sampling - std_deviation - std_deviation_population - std_deviation_sampling type: object properties: sum_of_squares: oneOf: - type: number - type: - 'null' - string variance: oneOf: - type: number - type: - 'null' - string variance_population: oneOf: - type: number - type: - 'null' - string variance_sampling: oneOf: - type: number - type: - 'null' - string std_deviation: oneOf: - type: number - type: - 'null' - string std_deviation_population: oneOf: - type: number - type: - 'null' - string std_deviation_sampling: oneOf: - type: number - type: - 'null' - string std_deviation_bounds: allOf: - $ref: '#/components/schemas/_types.aggregations.StandardDeviationBounds' sum_of_squares_as_string: type: string variance_as_string: type: string variance_population_as_string: type: string variance_sampling_as_string: type: string std_deviation_as_string: type: string std_deviation_bounds_as_string: allOf: - $ref: '#/components/schemas/_types.aggregations.StandardDeviationBoundsAsString' x-model: true _types.aggregations.StandardDeviationBounds: required: - upper - lower - upper_population - lower_population - upper_sampling - lower_sampling type: object properties: upper: oneOf: - type: number - type: - 'null' - string lower: oneOf: - type: number - type: - 'null' - string upper_population: oneOf: - type: number - type: - 'null' - string lower_population: oneOf: - type: number - type: - 'null' - string upper_sampling: oneOf: - type: number - type: - 'null' - string lower_sampling: oneOf: - type: number - type: - 'null' - string _types.aggregations.StandardDeviationBoundsAsString: required: - upper - lower - upper_population - lower_population - upper_sampling - lower_sampling type: object properties: upper: type: string lower: type: string upper_population: type: string lower_population: type: string upper_sampling: type: string lower_sampling: type: string _types.aggregations.ExtendedStatsBucketAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.ExtendedStatsAggregate' - type: object x-model: true _types.aggregations.CartesianBoundsAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - type: object properties: bounds: allOf: - $ref: '#/components/schemas/_types.TopLeftBottomRightGeoBounds' _types.TopLeftBottomRightGeoBounds: required: - top_left - bottom_right type: object properties: top_left: allOf: - $ref: '#/components/schemas/_types.GeoLocation' bottom_right: allOf: - $ref: '#/components/schemas/_types.GeoLocation' _types.GeoLocation: oneOf: - $ref: '#/components/schemas/_types.LatLonGeoLocation' - $ref: '#/components/schemas/_types.GeoHashLocation' - type: array items: type: number - type: string description: "A latitude/longitude as a 2 dimensional point. It can be represented in various ways:\n- as a `{lat, long}` object\n- as a geo hash value\n- as a `[lon, lat]` array\n- as a string in `\", \"` or WKT point formats" _types.LatLonGeoLocation: required: - lat - lon type: object properties: lat: type: number description: Latitude lon: type: number description: Longitude _types.GeoHashLocation: required: - geohash type: object properties: geohash: allOf: - $ref: '#/components/schemas/_types.GeoHash' _types.GeoHash: type: string _types.aggregations.CartesianCentroidAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - count type: object properties: count: type: number location: allOf: - $ref: '#/components/schemas/_types.CartesianPoint' _types.CartesianPoint: required: - x - y type: object properties: x: type: number y: type: number _types.aggregations.GeoBoundsAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - type: object properties: bounds: allOf: - $ref: '#/components/schemas/_types.GeoBounds' x-model: true _types.GeoBounds: oneOf: - $ref: '#/components/schemas/_types.CoordsGeoBounds' - $ref: '#/components/schemas/_types.TopLeftBottomRightGeoBounds' - $ref: '#/components/schemas/_types.TopRightBottomLeftGeoBounds' - $ref: '#/components/schemas/_types.WktGeoBounds' description: "A geo bounding box. It can be represented in various ways:\n- as 4 top/bottom/left/right coordinates\n- as 2 top_left / bottom_right points\n- as 2 top_right / bottom_left points\n- as a WKT bounding box" _types.CoordsGeoBounds: required: - top - bottom - left - right type: object properties: top: type: number bottom: type: number left: type: number right: type: number _types.TopRightBottomLeftGeoBounds: required: - top_right - bottom_left type: object properties: top_right: allOf: - $ref: '#/components/schemas/_types.GeoLocation' bottom_left: allOf: - $ref: '#/components/schemas/_types.GeoLocation' _types.WktGeoBounds: required: - wkt type: object properties: wkt: type: string _types.aggregations.GeoCentroidAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - count type: object properties: count: type: number location: allOf: - $ref: '#/components/schemas/_types.GeoLocation' x-model: true _types.aggregations.HistogramAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseHistogramBucket' - type: object x-model: true _types.aggregations.MultiBucketAggregateBaseHistogramBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - buckets type: object properties: buckets: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsHistogramBucket' _types.aggregations.BucketsHistogramBucket: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.HistogramBucket' - type: array items: $ref: '#/components/schemas/_types.aggregations.HistogramBucket' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _types.aggregations.HistogramBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketBase' - required: - key type: object properties: key_as_string: type: string key: type: number _types.aggregations.DateHistogramAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseDateHistogramBucket' - type: object x-model: true _types.aggregations.MultiBucketAggregateBaseDateHistogramBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - buckets type: object properties: buckets: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsDateHistogramBucket' _types.aggregations.BucketsDateHistogramBucket: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.DateHistogramBucket' - type: array items: $ref: '#/components/schemas/_types.aggregations.DateHistogramBucket' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _types.aggregations.DateHistogramBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketBase' - required: - key type: object properties: key_as_string: type: string key: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' _types.EpochTimeUnitMillis: allOf: - $ref: '#/components/schemas/_types.UnitMillis' _types.UnitMillis: type: number description: Time unit for milliseconds _types.aggregations.AutoDateHistogramAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseDateHistogramBucket' - required: - interval type: object properties: interval: allOf: - $ref: '#/components/schemas/_types.DurationLarge' x-model: true _types.DurationLarge: type: string description: "A date histogram interval. Similar to `Duration` with additional units: `w` (week), `M` (month), `q` (quarter) and\n`y` (year)" _types.aggregations.VariableWidthHistogramAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseVariableWidthHistogramBucket' - type: object x-model: true _types.aggregations.MultiBucketAggregateBaseVariableWidthHistogramBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - buckets type: object properties: buckets: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsVariableWidthHistogramBucket' _types.aggregations.BucketsVariableWidthHistogramBucket: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.VariableWidthHistogramBucket' - type: array items: $ref: '#/components/schemas/_types.aggregations.VariableWidthHistogramBucket' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _types.aggregations.VariableWidthHistogramBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketBase' - required: - min - key - max type: object properties: min: type: number key: type: number max: type: number min_as_string: type: string key_as_string: type: string max_as_string: type: string _types.aggregations.StringTermsAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsAggregateBaseStringTermsBucket' - type: object description: Result of a `terms` aggregation when the field is a string. x-model: true _types.aggregations.TermsAggregateBaseStringTermsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseStringTermsBucket' - type: object properties: doc_count_error_upper_bound: type: number sum_other_doc_count: type: number _types.aggregations.MultiBucketAggregateBaseStringTermsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - buckets type: object properties: buckets: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsStringTermsBucket' _types.aggregations.BucketsStringTermsBucket: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.StringTermsBucket' - type: array items: $ref: '#/components/schemas/_types.aggregations.StringTermsBucket' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _types.aggregations.StringTermsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsBucketBase' - required: - key type: object properties: key: allOf: - $ref: '#/components/schemas/_types.FieldValue' _types.aggregations.TermsBucketBase: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketBase' - type: object properties: doc_count_error_upper_bound: type: number _types.aggregations.LongTermsAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsAggregateBaseLongTermsBucket' - type: object description: 'Result of a `terms` aggregation when the field is some kind of whole number like a integer, long, or a date.' x-model: true _types.aggregations.TermsAggregateBaseLongTermsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseLongTermsBucket' - type: object properties: doc_count_error_upper_bound: type: number sum_other_doc_count: type: number _types.aggregations.MultiBucketAggregateBaseLongTermsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - buckets type: object properties: buckets: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsLongTermsBucket' _types.aggregations.BucketsLongTermsBucket: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.LongTermsBucket' - type: array items: $ref: '#/components/schemas/_types.aggregations.LongTermsBucket' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _types.aggregations.LongTermsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsBucketBase' - required: - key type: object properties: key: type: number key_as_string: type: string _types.aggregations.DoubleTermsAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsAggregateBaseDoubleTermsBucket' - type: object description: 'Result of a `terms` aggregation when the field is some kind of decimal number like a float, double, or distance.' x-model: true _types.aggregations.TermsAggregateBaseDoubleTermsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseDoubleTermsBucket' - type: object properties: doc_count_error_upper_bound: type: number sum_other_doc_count: type: number _types.aggregations.MultiBucketAggregateBaseDoubleTermsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - buckets type: object properties: buckets: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsDoubleTermsBucket' _types.aggregations.BucketsDoubleTermsBucket: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.DoubleTermsBucket' - type: array items: $ref: '#/components/schemas/_types.aggregations.DoubleTermsBucket' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _types.aggregations.DoubleTermsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsBucketBase' - required: - key type: object properties: key: type: number key_as_string: type: string _types.aggregations.UnmappedTermsAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsAggregateBaseVoid' - type: object description: Result of a `terms` aggregation when the field is unmapped. `buckets` is always empty. x-model: true _types.aggregations.TermsAggregateBaseVoid: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseVoid' - type: object properties: doc_count_error_upper_bound: type: number sum_other_doc_count: type: number _types.aggregations.MultiBucketAggregateBaseVoid: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - buckets type: object properties: buckets: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsVoid' _types.aggregations.BucketsVoid: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_spec_utils.Void' - type: array items: $ref: '#/components/schemas/_spec_utils.Void' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _spec_utils.Void: type: object description: "The absence of any type. This is commonly used in APIs that don't return a body.\n\nAlthough \"void\" is generally used for the unit type that has only one value, this is to be interpreted as\nthe bottom type that has no value at all. Most languages have a unit type, but few have a bottom type.\n\nSee https://en.m.wikipedia.org/wiki/Unit_type and https://en.m.wikipedia.org/wiki/Bottom_type" _types.aggregations.LongRareTermsAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseLongRareTermsBucket' - type: object description: 'Result of the `rare_terms` aggregation when the field is some kind of whole number like a integer, long, or a date.' x-model: true _types.aggregations.MultiBucketAggregateBaseLongRareTermsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - buckets type: object properties: buckets: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsLongRareTermsBucket' _types.aggregations.BucketsLongRareTermsBucket: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.LongRareTermsBucket' - type: array items: $ref: '#/components/schemas/_types.aggregations.LongRareTermsBucket' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _types.aggregations.LongRareTermsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketBase' - required: - key type: object properties: key: type: number key_as_string: type: string _types.aggregations.StringRareTermsAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseStringRareTermsBucket' - type: object description: Result of the `rare_terms` aggregation when the field is a string. x-model: true _types.aggregations.MultiBucketAggregateBaseStringRareTermsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - buckets type: object properties: buckets: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsStringRareTermsBucket' _types.aggregations.BucketsStringRareTermsBucket: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.StringRareTermsBucket' - type: array items: $ref: '#/components/schemas/_types.aggregations.StringRareTermsBucket' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _types.aggregations.StringRareTermsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketBase' - required: - key type: object properties: key: type: string _types.aggregations.UnmappedRareTermsAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseVoid' - type: object description: Result of a `rare_terms` aggregation when the field is unmapped. `buckets` is always empty. x-model: true _types.aggregations.MultiTermsAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsAggregateBaseMultiTermsBucket' - type: object x-model: true _types.aggregations.TermsAggregateBaseMultiTermsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseMultiTermsBucket' - type: object properties: doc_count_error_upper_bound: type: number sum_other_doc_count: type: number _types.aggregations.MultiBucketAggregateBaseMultiTermsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - buckets type: object properties: buckets: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsMultiTermsBucket' _types.aggregations.BucketsMultiTermsBucket: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.MultiTermsBucket' - type: array items: $ref: '#/components/schemas/_types.aggregations.MultiTermsBucket' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _types.aggregations.MultiTermsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketBase' - required: - key type: object properties: key: type: array items: $ref: '#/components/schemas/_types.FieldValue' key_as_string: type: string doc_count_error_upper_bound: type: number _types.aggregations.MissingAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.SingleBucketAggregateBase' - type: object x-model: true _types.aggregations.SingleBucketAggregateBase: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - doc_count type: object properties: doc_count: type: number description: Base type for single-bucket aggregation results that can hold sub-aggregations results. _types.aggregations.NestedAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.SingleBucketAggregateBase' - type: object x-model: true _types.aggregations.ReverseNestedAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.SingleBucketAggregateBase' - type: object x-model: true _types.aggregations.GlobalAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.SingleBucketAggregateBase' - type: object x-model: true _types.aggregations.FilterAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.SingleBucketAggregateBase' - type: object x-model: true _types.aggregations.ChildrenAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.SingleBucketAggregateBase' - type: object x-model: true _types.aggregations.ParentAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.SingleBucketAggregateBase' - type: object x-model: true _types.aggregations.SamplerAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.SingleBucketAggregateBase' - type: object x-model: true _types.aggregations.UnmappedSamplerAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.SingleBucketAggregateBase' - type: object x-model: true _types.aggregations.GeoHashGridAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseGeoHashGridBucket' - type: object x-model: true _types.aggregations.MultiBucketAggregateBaseGeoHashGridBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - buckets type: object properties: buckets: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsGeoHashGridBucket' _types.aggregations.BucketsGeoHashGridBucket: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.GeoHashGridBucket' - type: array items: $ref: '#/components/schemas/_types.aggregations.GeoHashGridBucket' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _types.aggregations.GeoHashGridBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketBase' - required: - key type: object properties: key: allOf: - $ref: '#/components/schemas/_types.GeoHash' _types.aggregations.GeoTileGridAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseGeoTileGridBucket' - type: object x-model: true _types.aggregations.MultiBucketAggregateBaseGeoTileGridBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - buckets type: object properties: buckets: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsGeoTileGridBucket' _types.aggregations.BucketsGeoTileGridBucket: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.GeoTileGridBucket' - type: array items: $ref: '#/components/schemas/_types.aggregations.GeoTileGridBucket' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _types.aggregations.GeoTileGridBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketBase' - required: - key type: object properties: key: allOf: - $ref: '#/components/schemas/_types.GeoTile' _types.GeoTile: type: string description: 'A map tile reference, represented as `{zoom}/{x}/{y}`' _types.aggregations.GeoHexGridAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseGeoHexGridBucket' - type: object x-model: true _types.aggregations.MultiBucketAggregateBaseGeoHexGridBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - buckets type: object properties: buckets: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsGeoHexGridBucket' _types.aggregations.BucketsGeoHexGridBucket: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.GeoHexGridBucket' - type: array items: $ref: '#/components/schemas/_types.aggregations.GeoHexGridBucket' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _types.aggregations.GeoHexGridBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketBase' - required: - key type: object properties: key: allOf: - $ref: '#/components/schemas/_types.GeoHexCell' _types.GeoHexCell: type: string description: A map hex cell (H3) reference _types.aggregations.RangeAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseRangeBucket' - type: object x-model: true _types.aggregations.MultiBucketAggregateBaseRangeBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - buckets type: object properties: buckets: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsRangeBucket' _types.aggregations.BucketsRangeBucket: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.RangeBucket' - type: array items: $ref: '#/components/schemas/_types.aggregations.RangeBucket' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _types.aggregations.RangeBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketBase' - type: object properties: from: type: number to: type: number from_as_string: type: string to_as_string: type: string key: type: string description: The bucket key. Present if the aggregation is _not_ keyed _types.aggregations.DateRangeAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.RangeAggregate' - type: object description: "Result of a `date_range` aggregation. Same format as a for a `range` aggregation: `from` and `to`\nin `buckets` are milliseconds since the Epoch, represented as a floating point number." x-model: true _types.aggregations.GeoDistanceAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.RangeAggregate' - type: object description: Result of a `geo_distance` aggregation. The unit for `from` and `to` is meters by default. x-model: true _types.aggregations.IpRangeAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseIpRangeBucket' - type: object x-model: true _types.aggregations.MultiBucketAggregateBaseIpRangeBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - buckets type: object properties: buckets: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsIpRangeBucket' _types.aggregations.BucketsIpRangeBucket: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.IpRangeBucket' - type: array items: $ref: '#/components/schemas/_types.aggregations.IpRangeBucket' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _types.aggregations.IpRangeBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketBase' - type: object properties: key: type: string from: type: string to: type: string _types.aggregations.IpPrefixAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseIpPrefixBucket' - type: object x-model: true _types.aggregations.MultiBucketAggregateBaseIpPrefixBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - buckets type: object properties: buckets: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsIpPrefixBucket' _types.aggregations.BucketsIpPrefixBucket: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.IpPrefixBucket' - type: array items: $ref: '#/components/schemas/_types.aggregations.IpPrefixBucket' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _types.aggregations.IpPrefixBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketBase' - required: - is_ipv6 - key - prefix_length type: object properties: is_ipv6: type: boolean key: type: string prefix_length: type: number netmask: type: string _types.aggregations.FiltersAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseFiltersBucket' - type: object x-model: true _types.aggregations.MultiBucketAggregateBaseFiltersBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - buckets type: object properties: buckets: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsFiltersBucket' _types.aggregations.BucketsFiltersBucket: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.FiltersBucket' - type: array items: $ref: '#/components/schemas/_types.aggregations.FiltersBucket' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _types.aggregations.FiltersBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketBase' - type: object properties: key: type: string _types.aggregations.AdjacencyMatrixAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseAdjacencyMatrixBucket' - type: object x-model: true _types.aggregations.MultiBucketAggregateBaseAdjacencyMatrixBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - buckets type: object properties: buckets: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsAdjacencyMatrixBucket' _types.aggregations.BucketsAdjacencyMatrixBucket: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.AdjacencyMatrixBucket' - type: array items: $ref: '#/components/schemas/_types.aggregations.AdjacencyMatrixBucket' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _types.aggregations.AdjacencyMatrixBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketBase' - required: - key type: object properties: key: type: string _types.aggregations.SignificantLongTermsAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.SignificantTermsAggregateBaseSignificantLongTermsBucket' - type: object x-model: true _types.aggregations.SignificantTermsAggregateBaseSignificantLongTermsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseSignificantLongTermsBucket' - type: object properties: bg_count: type: number doc_count: type: number _types.aggregations.MultiBucketAggregateBaseSignificantLongTermsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - buckets type: object properties: buckets: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsSignificantLongTermsBucket' _types.aggregations.BucketsSignificantLongTermsBucket: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.SignificantLongTermsBucket' - type: array items: $ref: '#/components/schemas/_types.aggregations.SignificantLongTermsBucket' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _types.aggregations.SignificantLongTermsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.SignificantTermsBucketBase' - required: - key type: object properties: key: type: number key_as_string: type: string _types.aggregations.SignificantTermsBucketBase: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketBase' - required: - score - bg_count type: object properties: score: type: number bg_count: type: number _types.aggregations.SignificantStringTermsAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.SignificantTermsAggregateBaseSignificantStringTermsBucket' - type: object x-model: true _types.aggregations.SignificantTermsAggregateBaseSignificantStringTermsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseSignificantStringTermsBucket' - type: object properties: bg_count: type: number doc_count: type: number _types.aggregations.MultiBucketAggregateBaseSignificantStringTermsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - buckets type: object properties: buckets: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsSignificantStringTermsBucket' _types.aggregations.BucketsSignificantStringTermsBucket: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.SignificantStringTermsBucket' - type: array items: $ref: '#/components/schemas/_types.aggregations.SignificantStringTermsBucket' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _types.aggregations.SignificantStringTermsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.SignificantTermsBucketBase' - required: - key type: object properties: key: type: string _types.aggregations.UnmappedSignificantTermsAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.SignificantTermsAggregateBaseVoid' - type: object description: Result of the `significant_terms` aggregation on an unmapped field. `buckets` is always empty. x-model: true _types.aggregations.SignificantTermsAggregateBaseVoid: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseVoid' - type: object properties: bg_count: type: number doc_count: type: number _types.aggregations.CompositeAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseCompositeBucket' - type: object properties: after_key: allOf: - $ref: '#/components/schemas/_types.aggregations.CompositeAggregateKey' x-model: true _types.aggregations.CompositeAggregateKey: type: object additionalProperties: $ref: '#/components/schemas/_types.FieldValue' _types.aggregations.MultiBucketAggregateBaseCompositeBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - buckets type: object properties: buckets: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsCompositeBucket' _types.aggregations.BucketsCompositeBucket: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.CompositeBucket' - type: array items: $ref: '#/components/schemas/_types.aggregations.CompositeBucket' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _types.aggregations.CompositeBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketBase' - required: - key type: object properties: key: allOf: - $ref: '#/components/schemas/_types.aggregations.CompositeAggregateKey' _types.aggregations.FrequentItemSetsAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseFrequentItemSetsBucket' - type: object x-model: true _types.aggregations.MultiBucketAggregateBaseFrequentItemSetsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - buckets type: object properties: buckets: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsFrequentItemSetsBucket' _types.aggregations.BucketsFrequentItemSetsBucket: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.FrequentItemSetsBucket' - type: array items: $ref: '#/components/schemas/_types.aggregations.FrequentItemSetsBucket' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _types.aggregations.FrequentItemSetsBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketBase' - required: - key - support type: object properties: key: type: object additionalProperties: type: array items: type: string support: type: number _types.aggregations.TimeSeriesAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketAggregateBaseTimeSeriesBucket' - type: object x-model: true _types.aggregations.MultiBucketAggregateBaseTimeSeriesBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - buckets type: object properties: buckets: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsTimeSeriesBucket' _types.aggregations.BucketsTimeSeriesBucket: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.TimeSeriesBucket' - type: array items: $ref: '#/components/schemas/_types.aggregations.TimeSeriesBucket' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _types.aggregations.TimeSeriesBucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiBucketBase' - required: - key type: object properties: key: type: object additionalProperties: $ref: '#/components/schemas/_types.FieldValue' _types.aggregations.ScriptedMetricAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - value type: object properties: value: type: object x-model: true _types.aggregations.TopHitsAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - hits type: object properties: hits: allOf: - $ref: '#/components/schemas/_global.search._types.HitsMetadata' x-model: true _global.search._types.HitsMetadata: required: - hits type: object properties: total: oneOf: - $ref: '#/components/schemas/_global.search._types.TotalHits' - type: number description: 'Total hit count information, present only if `track_total_hits` wasn''t `false` in the search request.' hits: type: array items: $ref: '#/components/schemas/_global.search._types.Hit' max_score: oneOf: - type: number - type: - 'null' - string _global.search._types.TotalHits: required: - relation - value type: object properties: relation: allOf: - $ref: '#/components/schemas/_global.search._types.TotalHitsRelation' description: "\n\nSupported values include:\n - `eq`: Accurate\n - `gte`: Lower bound, including returned events or sequences\n\n" value: type: number _global.search._types.TotalHitsRelation: enum: - eq - gte type: string _global.search._types.Hit: required: - _index type: object properties: _index: allOf: - $ref: '#/components/schemas/_types.IndexName' _id: allOf: - $ref: '#/components/schemas/_types.Id' _score: oneOf: - type: number - type: - 'null' - string _explanation: allOf: - $ref: '#/components/schemas/_global.explain.Explanation' fields: type: object additionalProperties: type: object highlight: type: object additionalProperties: type: array items: type: string inner_hits: type: object additionalProperties: $ref: '#/components/schemas/_global.search._types.InnerHitsResult' matched_queries: oneOf: - type: array items: type: string - type: object additionalProperties: type: number _nested: allOf: - $ref: '#/components/schemas/_global.search._types.NestedIdentity' _ignored: type: array items: type: string ignored_field_values: type: object additionalProperties: type: array items: type: object _shard: type: string _node: type: string _routing: type: string _source: type: object _rank: type: number _seq_no: allOf: - $ref: '#/components/schemas/_types.SequenceNumber' _primary_term: type: number _version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' sort: allOf: - $ref: '#/components/schemas/_types.SortResults' _types.IndexName: type: string _global.explain.Explanation: required: - description - details - value type: object properties: description: type: string details: type: array items: $ref: '#/components/schemas/_global.explain.ExplanationDetail' value: type: number _global.explain.ExplanationDetail: required: - description - value type: object properties: description: type: string details: type: array items: $ref: '#/components/schemas/_global.explain.ExplanationDetail' value: type: number _global.search._types.InnerHitsResult: required: - hits type: object properties: hits: allOf: - $ref: '#/components/schemas/_global.search._types.HitsMetadata' _global.search._types.NestedIdentity: required: - field - offset type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' offset: type: number _nested: allOf: - $ref: '#/components/schemas/_global.search._types.NestedIdentity' _types.Field: type: string description: Path to field or array of paths. Some API's support wildcards in the path to select multiple fields. _types.SequenceNumber: type: number _types.VersionNumber: type: number _types.SortResults: type: array items: $ref: '#/components/schemas/_types.FieldValue' _types.aggregations.InferenceAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - type: object properties: value: allOf: - $ref: '#/components/schemas/_types.FieldValue' feature_importance: type: array items: $ref: '#/components/schemas/_types.aggregations.InferenceFeatureImportance' top_classes: type: array items: $ref: '#/components/schemas/_types.aggregations.InferenceTopClassEntry' warning: type: string x-model: true _types.aggregations.InferenceFeatureImportance: required: - feature_name type: object properties: feature_name: type: string importance: type: number classes: type: array items: $ref: '#/components/schemas/_types.aggregations.InferenceClassImportance' _types.aggregations.InferenceClassImportance: required: - class_name - importance type: object properties: class_name: type: string importance: type: number _types.aggregations.InferenceTopClassEntry: required: - class_name - class_probability - class_score type: object properties: class_name: allOf: - $ref: '#/components/schemas/_types.FieldValue' class_probability: type: number class_score: type: number _types.aggregations.StringStatsAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - count - min_length - max_length - avg_length - entropy type: object properties: count: type: number min_length: oneOf: - type: number - type: - 'null' - string max_length: oneOf: - type: number - type: - 'null' - string avg_length: oneOf: - type: number - type: - 'null' - string entropy: oneOf: - type: number - type: - 'null' - string distribution: oneOf: - type: object additionalProperties: type: number - type: - 'null' - string min_length_as_string: type: string max_length_as_string: type: string avg_length_as_string: type: string x-model: true _types.aggregations.BoxPlotAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - min - max - q1 - q2 - q3 - lower - upper type: object properties: min: type: number max: type: number q1: type: number q2: type: number q3: type: number lower: type: number upper: type: number min_as_string: type: string max_as_string: type: string q1_as_string: type: string q2_as_string: type: string q3_as_string: type: string lower_as_string: type: string upper_as_string: type: string x-model: true _types.aggregations.TopMetricsAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - top type: object properties: top: type: array items: $ref: '#/components/schemas/_types.aggregations.TopMetrics' x-model: true _types.aggregations.TopMetrics: required: - sort - metrics type: object properties: sort: type: array items: oneOf: - $ref: '#/components/schemas/_types.FieldValue' - type: - 'null' - string metrics: type: object additionalProperties: oneOf: - $ref: '#/components/schemas/_types.FieldValue' - type: - 'null' - string _types.aggregations.TTestAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - value type: object properties: value: oneOf: - type: number - type: - 'null' - string value_as_string: type: string x-model: true _types.aggregations.RateAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - value type: object properties: value: type: number value_as_string: type: string x-model: true _types.aggregations.CumulativeCardinalityAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - value type: object properties: value: type: number value_as_string: type: string description: Result of the `cumulative_cardinality` aggregation x-model: true _types.aggregations.MatrixStatsAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - doc_count type: object properties: doc_count: type: number fields: type: array items: $ref: '#/components/schemas/_types.aggregations.MatrixStatsFields' x-model: true _types.aggregations.MatrixStatsFields: required: - name - count - mean - variance - skewness - kurtosis - covariance - correlation type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Field' count: type: number mean: type: number variance: type: number skewness: type: number kurtosis: type: number covariance: type: object additionalProperties: type: number correlation: type: object additionalProperties: type: number _types.aggregations.GeoLineAggregate: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateBase' - required: - type - geometry - properties type: object properties: type: type: string geometry: allOf: - $ref: '#/components/schemas/_types.GeoLine' properties: type: object x-model: true _types.GeoLine: required: - type - coordinates type: object properties: type: type: string description: Always `"LineString"` coordinates: type: array items: type: array items: type: number description: 'Array of `[lon, lat]` coordinates' description: A GeoJson GeoLine. _types.ClusterStatistics: required: - skipped - successful - total - running - partial - failed type: object properties: skipped: type: number successful: type: number total: type: number running: type: number partial: type: number failed: type: number details: type: object additionalProperties: $ref: '#/components/schemas/_types.ClusterDetails' _types.ClusterDetails: required: - status - indices - timed_out type: object properties: status: allOf: - $ref: '#/components/schemas/_types.ClusterSearchStatus' indices: type: string took: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' timed_out: type: boolean _shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' failures: type: array items: $ref: '#/components/schemas/_types.ShardFailure' _types.ClusterSearchStatus: enum: - running - successful - partial - skipped - failed type: string _types.DurationValueUnitMillis: allOf: - $ref: '#/components/schemas/_types.UnitMillis' _types.ShardStatistics: required: - failed - successful - total type: object properties: failed: allOf: - $ref: '#/components/schemas/_types.uint' description: The number of shards the operation or search attempted to run on but failed. successful: allOf: - $ref: '#/components/schemas/_types.uint' description: The number of shards the operation or search succeeded on. total: allOf: - $ref: '#/components/schemas/_types.uint' description: The number of shards the operation or search will run on overall. failures: type: array items: $ref: '#/components/schemas/_types.ShardFailure' skipped: allOf: - $ref: '#/components/schemas/_types.uint' _types.uint: type: number _types.ShardFailure: required: - reason type: object properties: index: allOf: - $ref: '#/components/schemas/_types.IndexName' node: type: string reason: allOf: - $ref: '#/components/schemas/_types.ErrorCause' shard: type: number status: type: string primary: type: boolean _types.ErrorCause: required: - type type: object properties: type: type: string description: The type of error reason: oneOf: - type: string - type: - 'null' - string description: 'A human-readable explanation of the error, in English.' stack_trace: type: string description: The server stack trace. Present only if the `error_trace=true` parameter was sent with the request. caused_by: allOf: - $ref: '#/components/schemas/_types.ErrorCause' root_cause: type: array items: $ref: '#/components/schemas/_types.ErrorCause' suppressed: type: array items: $ref: '#/components/schemas/_types.ErrorCause' description: "Cause and details about a request failure. This class defines the properties common to all error types.\nAdditional details are also provided, that depend on the error type." _global.search._types.Profile: required: - shards type: object properties: shards: type: array items: $ref: '#/components/schemas/_global.search._types.ShardProfile' request: allOf: - $ref: '#/components/schemas/_global.search._types.SearchRequestCoordinatorMetadata' description: 'When profiling is enabled, the original query source and target indices from the coordinating request.' _global.search._types.ShardProfile: required: - aggregations - cluster - id - index - node_id - searches - shard_id type: object properties: aggregations: type: array items: $ref: '#/components/schemas/_global.search._types.AggregationProfile' cluster: type: string dfs: allOf: - $ref: '#/components/schemas/_global.search._types.DfsProfile' fetch: allOf: - $ref: '#/components/schemas/_global.search._types.FetchProfile' id: type: string index: allOf: - $ref: '#/components/schemas/_types.IndexName' node_id: allOf: - $ref: '#/components/schemas/_types.NodeId' rescore: type: array items: $ref: '#/components/schemas/_global.search._types.RescoreProfile' description: 'One entry per rescorer, in the order they ran. Omitted when the request has no rescorer.' x-state: Generally available; Added in 9.6.0 searches: type: array items: $ref: '#/components/schemas/_global.search._types.SearchProfile' shard_id: type: number _global.search._types.AggregationProfile: required: - breakdown - description - time_in_nanos - type type: object properties: breakdown: allOf: - $ref: '#/components/schemas/_global.search._types.AggregationBreakdown' description: type: string time_in_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' type: type: string debug: allOf: - $ref: '#/components/schemas/_global.search._types.AggregationProfileDebug' children: type: array items: $ref: '#/components/schemas/_global.search._types.AggregationProfile' _global.search._types.AggregationBreakdown: required: - build_aggregation - build_aggregation_count - build_leaf_collector - build_leaf_collector_count - collect - collect_count - initialize - initialize_count - reduce - reduce_count type: object properties: build_aggregation: type: number build_aggregation_count: type: number build_leaf_collector: type: number build_leaf_collector_count: type: number collect: type: number collect_count: type: number initialize: type: number initialize_count: type: number post_collection: type: number post_collection_count: type: number reduce: type: number reduce_count: type: number _types.DurationValueUnitNanos: allOf: - $ref: '#/components/schemas/_types.UnitNanos' _types.UnitNanos: type: number description: Time unit for nanoseconds _global.search._types.AggregationProfileDebug: type: object properties: segments_with_multi_valued_ords: type: number collection_strategy: type: string segments_with_single_valued_ords: type: number total_buckets: type: number built_buckets: type: number result_strategy: type: string has_filter: type: boolean delegate: type: string delegate_debug: allOf: - $ref: '#/components/schemas/_global.search._types.AggregationProfileDebug' chars_fetched: type: number extract_count: type: number extract_ns: type: number values_fetched: type: number collect_analyzed_ns: type: number collect_analyzed_count: type: number surviving_buckets: type: number ordinals_collectors_used: type: number ordinals_collectors_overhead_too_high: type: number string_hashing_collectors_used: type: number numeric_collectors_used: type: number empty_collectors_used: type: number deferred_aggregators: type: array items: type: string segments_with_doc_count_field: type: number segments_with_deleted_docs: type: number filters: type: array items: $ref: '#/components/schemas/_global.search._types.AggregationProfileDelegateDebugFilter' segments_counted: type: number segments_collected: type: number map_reducer: type: string brute_force_used: type: number dynamic_pruning_attempted: type: number dynamic_pruning_used: type: number skipped_due_to_no_data: type: number _global.search._types.AggregationProfileDelegateDebugFilter: type: object properties: results_from_metadata: type: number query: type: string specialized_for: type: string segments_counted_in_constant_time: type: number _global.search._types.DfsProfile: type: object properties: statistics: allOf: - $ref: '#/components/schemas/_global.search._types.DfsStatisticsProfile' knn: type: array items: $ref: '#/components/schemas/_global.search._types.DfsKnnProfile' _global.search._types.DfsStatisticsProfile: required: - type - description - time_in_nanos - breakdown type: object properties: type: type: string description: type: string time: allOf: - $ref: '#/components/schemas/_types.Duration' time_in_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' breakdown: allOf: - $ref: '#/components/schemas/_global.search._types.DfsStatisticsBreakdown' debug: type: object additionalProperties: type: object children: type: array items: $ref: '#/components/schemas/_global.search._types.DfsStatisticsProfile' _global.search._types.DfsStatisticsBreakdown: required: - collection_statistics - collection_statistics_count - create_weight - create_weight_count - rewrite - rewrite_count - term_statistics - term_statistics_count type: object properties: collection_statistics: type: number collection_statistics_count: type: number create_weight: type: number create_weight_count: type: number rewrite: type: number rewrite_count: type: number term_statistics: type: number term_statistics_count: type: number _global.search._types.DfsKnnProfile: required: - query - rewrite_time - collector type: object properties: vector_operations_count: type: number query: type: array items: $ref: '#/components/schemas/_global.search._types.KnnQueryProfileResult' rewrite_time: type: number collector: type: array items: $ref: '#/components/schemas/_global.search._types.KnnCollectorResult' _global.search._types.KnnQueryProfileResult: required: - type - description - time_in_nanos - breakdown type: object properties: type: type: string description: type: string time: allOf: - $ref: '#/components/schemas/_types.Duration' time_in_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' breakdown: allOf: - $ref: '#/components/schemas/_global.search._types.KnnQueryProfileBreakdown' debug: type: object additionalProperties: type: object children: type: array items: $ref: '#/components/schemas/_global.search._types.KnnQueryProfileResult' _global.search._types.KnnQueryProfileBreakdown: required: - advance - advance_count - build_scorer - build_scorer_count - compute_max_score - compute_max_score_count - count_weight - count_weight_count - create_weight - create_weight_count - match - match_count - next_doc - next_doc_count - score - score_count - set_min_competitive_score - set_min_competitive_score_count - shallow_advance - shallow_advance_count type: object properties: advance: type: number advance_count: type: number build_scorer: type: number build_scorer_count: type: number compute_max_score: type: number compute_max_score_count: type: number count_weight: type: number count_weight_count: type: number create_weight: type: number create_weight_count: type: number match: type: number match_count: type: number next_doc: type: number next_doc_count: type: number score: type: number score_count: type: number set_min_competitive_score: type: number set_min_competitive_score_count: type: number shallow_advance: type: number shallow_advance_count: type: number _global.search._types.KnnCollectorResult: required: - name - reason - time_in_nanos type: object properties: name: type: string reason: type: string time: allOf: - $ref: '#/components/schemas/_types.Duration' time_in_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' children: type: array items: $ref: '#/components/schemas/_global.search._types.KnnCollectorResult' _global.search._types.FetchProfile: required: - type - description - time_in_nanos - breakdown type: object properties: type: type: string description: type: string time_in_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' breakdown: allOf: - $ref: '#/components/schemas/_global.search._types.FetchProfileBreakdown' debug: allOf: - $ref: '#/components/schemas/_global.search._types.FetchProfileDebug' children: type: array items: $ref: '#/components/schemas/_global.search._types.FetchProfile' _global.search._types.FetchProfileBreakdown: type: object properties: load_source: type: number load_source_count: type: number load_stored_fields: type: number load_stored_fields_count: type: number next_reader: type: number next_reader_count: type: number process_count: type: number process: type: number _global.search._types.FetchProfileDebug: type: object properties: stored_fields: type: array items: type: string fast_path: type: number _types.NodeId: type: string _global.search._types.RescoreProfile: oneOf: - $ref: '#/components/schemas/_global.search._types.QueryRescoreProfile' - $ref: '#/components/schemas/_global.search._types.ScriptRescoreProfile' - $ref: '#/components/schemas/_global.search._types.LearningToRankRescoreProfile' description: "Profile of a single rescorer.\n\nThe shape of `breakdown` depends on the type of rescorer: `query` and `script` do not report any steps,\n`learning_to_rank` does." discriminator: propertyName: type mapping: learning_to_rank: '#/components/schemas/_global.search._types.LearningToRankRescoreProfile' query: '#/components/schemas/_global.search._types.QueryRescoreProfile' script: '#/components/schemas/_global.search._types.ScriptRescoreProfile' _global.search._types.QueryRescoreProfile: allOf: - $ref: '#/components/schemas/_global.search._types.RescoreProfileBase' - required: - type - breakdown type: object properties: type: enum: - query type: string breakdown: allOf: - $ref: '#/components/schemas/_types.EmptyObject' description: The `query` rescorer does not report any steps. _types.EmptyObject: type: object description: For empty Class assignments _global.search._types.RescoreProfileBase: required: - description - time_in_nanos type: object properties: description: type: string description: What the rescorer runs. time_in_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' description: 'The total time spent in the rescorer, including the time spent running its queries.' time: allOf: - $ref: '#/components/schemas/_types.Duration' description: 'The time spent in the rescorer, in human-readable units. Only returned when `human` is `true`.' debug: type: object additionalProperties: type: object description: "Extra details about the rescorer.\n\nEvery rescorer reports `window_size`, the number of top documents it was configured to rescore. `timed_out` is\nset to `true` if the search timed out while the rescorer was running. Rescorers can add their own keys." _global.search._types.ScriptRescoreProfile: allOf: - $ref: '#/components/schemas/_global.search._types.RescoreProfileBase' - required: - type - breakdown type: object properties: type: enum: - script type: string breakdown: allOf: - $ref: '#/components/schemas/_types.EmptyObject' description: The `script` rescorer does not report any steps. _global.search._types.LearningToRankRescoreProfile: allOf: - $ref: '#/components/schemas/_global.search._types.RescoreProfileBase' - required: - type - breakdown type: object properties: type: enum: - learning_to_rank type: string breakdown: allOf: - $ref: '#/components/schemas/_global.search._types.LearningToRankRescoreProfileBreakdown' _global.search._types.LearningToRankRescoreProfileBreakdown: required: - build_feature_extractors - build_feature_extractors_count - feature_extraction - feature_extraction_count - inference - inference_count type: object properties: build_feature_extractors: type: number description: The time spent turning the feature queries of the model into queries that can score documents. build_feature_extractors_count: type: number feature_extraction: type: number description: The time spent extracting the features of the top documents. feature_extraction_count: type: number inference: type: number description: The time spent running the model on the extracted features. inference_count: type: number _global.search._types.SearchProfile: required: - collector - query - rewrite_time type: object properties: collector: type: array items: $ref: '#/components/schemas/_global.search._types.Collector' query: type: array items: $ref: '#/components/schemas/_global.search._types.QueryProfile' rewrite_time: type: number _global.search._types.Collector: required: - name - reason - time_in_nanos type: object properties: name: type: string reason: type: string time_in_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' children: type: array items: $ref: '#/components/schemas/_global.search._types.Collector' _global.search._types.QueryProfile: required: - breakdown - description - time_in_nanos - type type: object properties: breakdown: allOf: - $ref: '#/components/schemas/_global.search._types.QueryBreakdown' description: type: string time_in_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' type: type: string debug: type: object additionalProperties: type: object description: "Extra details about the query.\n\nQueries run by a rescorer include a `rescorer` key with the position of that rescorer in the shard's `rescore` array." x-state: Generally available; Added in 9.6.0 children: type: array items: $ref: '#/components/schemas/_global.search._types.QueryProfile' _global.search._types.QueryBreakdown: required: - advance - advance_count - build_scorer - build_scorer_count - create_weight - create_weight_count - into_bit_set - into_bit_set_count - match - match_count - shallow_advance - shallow_advance_count - next_doc - next_doc_count - score - score_count - compute_max_score - compute_max_score_count - count_weight - count_weight_count - set_min_competitive_score - set_min_competitive_score_count type: object properties: advance: type: number advance_count: type: number build_scorer: type: number build_scorer_count: type: number create_weight: type: number create_weight_count: type: number into_bit_set: type: number into_bit_set_count: type: number match: type: number match_count: type: number shallow_advance: type: number shallow_advance_count: type: number next_doc: type: number next_doc_count: type: number score: type: number score_count: type: number compute_max_score: type: number compute_max_score_count: type: number count_weight: type: number count_weight_count: type: number set_min_competitive_score: type: number set_min_competitive_score_count: type: number _global.search._types.SearchRequestCoordinatorMetadata: type: object properties: source: allOf: - $ref: '#/components/schemas/_global.search._types.SearchRequestBody' description: Original query source from the search request (`SearchSourceBuilder` as JSON). indices: type: array items: $ref: '#/components/schemas/_types.IndexName' description: Target index expressions from the request (before index resolution). description: "Coordinator snapshot of the original search request, serialized under `profile.request` when profiling is enabled.\nIntroduced in Elasticsearch 9.5; omitted when the cluster contains mixed-version nodes that do not serialize this metadata." _global.search._types.SearchRequestBody: type: object properties: aggregations: type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.AggregationContainer' description: Defines the aggregations that are run as part of the search request. externalDocs: url: https://www.elastic.co/docs/explore-analyze/query-filter/aggregations collapse: allOf: - $ref: '#/components/schemas/_global.search._types.FieldCollapse' description: Collapses search results the values of the specified field. explain: type: boolean description: 'If `true`, the request returns detailed information about score computation as part of a hit.' default: false ext: type: object additionalProperties: type: object description: Configuration of search extensions defined by Elasticsearch plugins. from: type: number description: "The starting document offset, which must be non-negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter." default: 0 highlight: allOf: - $ref: '#/components/schemas/_global.search._types.Highlight' description: Specifies the highlighter to use for retrieving highlighted snippets from one or more fields in your search results. externalDocs: url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/highlighting track_total_hits: allOf: - $ref: '#/components/schemas/_global.search._types.TrackHits' description: "Number of hits matching the query to count accurately.\nIf `true`, the exact number of hits is returned at the cost of some performance.\nIf `false`, the response does not include the total number of hits matching the query." default: '10000' indices_boost: type: array items: maxProperties: 1 minProperties: 1 type: object additionalProperties: type: number description: "Boost the `_score` of documents from specified indices.\nThe boost value is the factor by which scores are multiplied.\nA boost value greater than `1.0` increases the score.\nA boost value between `0` and `1.0` decreases the score." externalDocs: url: https://www.elastic.co/docs/explore-analyze/query-filter/languages/querydsl#relevance-scores docvalue_fields: type: array items: $ref: '#/components/schemas/_types.query_dsl.FieldAndFormat' description: "An array of wildcard (`*`) field patterns.\nThe request returns doc values for field names matching these patterns in the `hits.fields` property of the response." externalDocs: url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/retrieve-selected-fields#docvalue-fields knn: oneOf: - $ref: '#/components/schemas/_types.KnnSearch' - type: array items: $ref: '#/components/schemas/_types.KnnSearch' description: The approximate kNN search to run. externalDocs: url: https://www.elastic.co/docs/solutions/search/vector/knn#approximate-knn x-state: Generally available; Added in 8.4.0 rank: allOf: - $ref: '#/components/schemas/_types.RankContainer' description: The Reciprocal Rank Fusion (RRF) to use. x-state: Generally available; Added in 8.8.0 min_score: type: number description: "The minimum `_score` for matching documents.\nDocuments with a lower `_score` are not included in search results or results collected by aggregations." post_filter: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: "Use the `post_filter` parameter to filter search results.\nThe search hits are filtered after the aggregations are calculated.\nA post filter has no impact on the aggregation results." externalDocs: url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/filter-search-results profile: type: boolean description: "Set to `true` to return detailed timing information about the execution of individual components in a search request.\nNOTE: This is a debugging tool and adds significant overhead to search execution." default: false externalDocs: url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/search-profile query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: The search definition using the Query DSL. externalDocs: url: https://www.elastic.co/docs/explore-analyze/query-filter/languages/querydsl rescore: oneOf: - $ref: '#/components/schemas/_global.search._types.Rescore' - type: array items: $ref: '#/components/schemas/_global.search._types.Rescore' description: Can be used to improve precision by reordering just the top (for example 100 - 500) documents returned by the `query` and `post_filter` phases. externalDocs: url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/rescore-search-results retriever: allOf: - $ref: '#/components/schemas/_types.RetrieverContainer' description: "A retriever is a specification to describe top documents returned from a search.\nA retriever replaces other elements of the search API that also return top documents such as `query` and `knn`." externalDocs: url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/retrievers x-state: Generally available; Added in 8.14.0 script_fields: type: object additionalProperties: $ref: '#/components/schemas/_types.ScriptField' description: Retrieve a script evaluation (based on different fields) for each hit. search_after: allOf: - $ref: '#/components/schemas/_types.SortResults' description: Used to retrieve the next page of hits using a set of sort values from the previous page. externalDocs: url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/paginate-search-results#search-after size: type: number description: "The number of hits to return, which must not be negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` property." default: 10 slice: allOf: - $ref: '#/components/schemas/_types.SlicedScroll' description: Split a scrolled search into multiple slices that can be consumed independently. externalDocs: url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/paginate-search-results#slice-scroll sort: allOf: - $ref: '#/components/schemas/_types.Sort' description: A comma-separated list of : pairs. externalDocs: url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/sort-search-results _source: allOf: - $ref: '#/components/schemas/_global.search._types.SourceConfig' description: "The source fields that are returned for matching documents.\nThese fields are returned in the `hits._source` property of the search response.\nIf the `stored_fields` property is specified, the `_source` property defaults to `false`.\nOtherwise, it defaults to `true`." externalDocs: url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/retrieve-selected-fields#source-filtering fields: type: array items: $ref: '#/components/schemas/_types.query_dsl.FieldAndFormat' description: "An array of wildcard (`*`) field patterns.\nThe request returns values for field names matching these patterns in the `hits.fields` property of the response." suggest: allOf: - $ref: '#/components/schemas/_global.search._types.Suggester' description: Defines a suggester that provides similar looking terms based on a provided text. externalDocs: url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/search-suggesters terminate_after: type: number description: "The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this property to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this property for requests that target data streams with backing indices across multiple data tiers.\n\nIf set to `0` (default), the query does not terminate early." default: 0 timeout: type: string description: "The period of time to wait for a response from each shard.\nIf no response is received before the timeout expires, the request fails and returns an error.\nDefaults to no timeout." track_scores: type: boolean description: 'If `true`, calculate and return document scores, even if the scores are not used for sorting.' default: false version: type: boolean description: 'If `true`, the request returns the document version as part of a hit.' default: false seq_no_primary_term: type: boolean description: 'If `true`, the request returns sequence number and primary term of the last modification of each hit.' externalDocs: url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/optimistic-concurrency-control stored_fields: allOf: - $ref: '#/components/schemas/_types.Fields' description: "A comma-separated list of stored fields to return as part of a hit.\nIf no fields are specified, no stored fields are included in the response.\nIf this field is specified, the `_source` property defaults to `false`.\nYou can pass `_source: true` to return both source fields and stored fields in the search response." externalDocs: url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/retrieve-selected-fields#stored-fields pit: allOf: - $ref: '#/components/schemas/_global.search._types.PointInTimeReference' description: "Limit the search to a point in time (PIT).\nIf you provide a PIT, you cannot specify an `` in the request path." runtime_mappings: allOf: - $ref: '#/components/schemas/_types.mapping.RuntimeFields' description: "One or more runtime fields in the search request.\nThese fields take precedence over mapped fields with the same name." externalDocs: url: https://www.elastic.co/docs/manage-data/data-store/mapping/define-runtime-fields-in-search-request stats: type: array items: type: string description: "The stats groups to associate with the search.\nEach group maintains a statistics aggregation for its associated searches.\nYou can retrieve these stats using the indices stats API." _types.aggregations.AggregationContainer: allOf: - type: object properties: aggregations: type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.AggregationContainer' description: "Sub-aggregations for this aggregation.\nOnly applies to bucket aggregations." meta: allOf: - $ref: '#/components/schemas/_types.Metadata' - maxProperties: 1 minProperties: 1 type: object properties: adjacency_matrix: allOf: - $ref: '#/components/schemas/_types.aggregations.AdjacencyMatrixAggregation' description: "A bucket aggregation returning a form of adjacency matrix.\nThe request provides a collection of named filter expressions, similar to the `filters` aggregation.\nEach bucket in the response represents a non-empty cell in the matrix of intersecting filters." externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-adjacency-matrix-aggregation auto_date_histogram: allOf: - $ref: '#/components/schemas/_types.aggregations.AutoDateHistogramAggregation' description: 'A multi-bucket aggregation similar to the date histogram, except instead of providing an interval to use as the width of each bucket, a target number of buckets is provided.' externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-autodatehistogram-aggregation avg: allOf: - $ref: '#/components/schemas/_types.aggregations.AverageAggregation' description: A single-value metrics aggregation that computes the average of numeric values that are extracted from the aggregated documents. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-avg-aggregation avg_bucket: allOf: - $ref: '#/components/schemas/_types.aggregations.AverageBucketAggregation' description: "A sibling pipeline aggregation which calculates the mean value of a specified metric in a sibling aggregation.\nThe specified metric must be numeric and the sibling aggregation must be a multi-bucket aggregation." externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-pipeline-avg-bucket-aggregation boxplot: allOf: - $ref: '#/components/schemas/_types.aggregations.BoxplotAggregation' description: A metrics aggregation that computes a box plot of numeric values extracted from the aggregated documents. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-boxplot-aggregation bucket_script: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketScriptAggregation' description: A parent pipeline aggregation which runs a script which can perform per bucket computations on metrics in the parent multi-bucket aggregation. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-pipeline-bucket-script-aggregation bucket_selector: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketSelectorAggregation' description: A parent pipeline aggregation which runs a script to determine whether the current bucket will be retained in the parent multi-bucket aggregation. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-pipeline-bucket-selector-aggregation bucket_sort: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketSortAggregation' description: A parent pipeline aggregation which sorts the buckets of its parent multi-bucket aggregation. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-pipeline-bucket-sort-aggregation bucket_count_ks_test: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketKsAggregation' description: A sibling pipeline aggregation which runs a two sample Kolmogorov–Smirnov test ("K-S test") against a provided distribution and the distribution implied by the documents counts in the configured sibling aggregation. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-count-ks-test-aggregation x-state: Experimental bucket_correlation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketCorrelationAggregation' description: A sibling pipeline aggregation which runs a correlation function on the configured sibling multi-bucket aggregation. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-correlation-aggregation x-state: Experimental cardinality: allOf: - $ref: '#/components/schemas/_types.aggregations.CardinalityAggregation' description: A single-value metrics aggregation that calculates an approximate count of distinct values. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-cardinality-aggregation cartesian_bounds: allOf: - $ref: '#/components/schemas/_types.aggregations.CartesianBoundsAggregation' description: A metric aggregation that computes the spatial bounding box containing all values for a Point or Shape field. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-cartesian-bounds-aggregation cartesian_centroid: allOf: - $ref: '#/components/schemas/_types.aggregations.CartesianCentroidAggregation' description: A metric aggregation that computes the weighted centroid from all coordinate values for point and shape fields. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-cartesian-centroid-aggregation categorize_text: allOf: - $ref: '#/components/schemas/_types.aggregations.CategorizeTextAggregation' description: A multi-bucket aggregation that groups semi-structured text into buckets. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-categorize-text-aggregation x-state: Experimental change_point: allOf: - $ref: '#/components/schemas/_types.aggregations.ChangePointAggregation' description: "A sibling pipeline that detects, spikes, dips, and change points in a metric.\nGiven a distribution of values provided by the sibling multi-bucket aggregation,\nthis aggregation indicates the bucket of any spike or dip and/or the bucket at which\nthe largest change in the distribution of values, if they are statistically significant.\nThere must be at least 22 bucketed values. Fewer than 1,000 is preferred." externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-change-point-aggregation children: allOf: - $ref: '#/components/schemas/_types.aggregations.ChildrenAggregation' description: 'A single bucket aggregation that selects child documents that have the specified type, as defined in a `join` field.' externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-children-aggregation composite: allOf: - $ref: '#/components/schemas/_types.aggregations.CompositeAggregation' description: "A multi-bucket aggregation that creates composite buckets from different sources.\nUnlike the other multi-bucket aggregations, you can use the `composite` aggregation to paginate *all* buckets from a multi-level aggregation efficiently." cumulative_cardinality: allOf: - $ref: '#/components/schemas/_types.aggregations.CumulativeCardinalityAggregation' description: A parent pipeline aggregation which calculates the cumulative cardinality in a parent `histogram` or `date_histogram` aggregation. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-pipeline-cumulative-cardinality-aggregation cumulative_sum: allOf: - $ref: '#/components/schemas/_types.aggregations.CumulativeSumAggregation' description: A parent pipeline aggregation which calculates the cumulative sum of a specified metric in a parent `histogram` or `date_histogram` aggregation. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-pipeline-cumulative-sum-aggregation date_histogram: allOf: - $ref: '#/components/schemas/_types.aggregations.DateHistogramAggregation' description: "A multi-bucket values source based aggregation that can be applied on date values or date range values extracted from the documents.\nIt dynamically builds fixed size (interval) buckets over the values." externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-datehistogram-aggregation date_range: allOf: - $ref: '#/components/schemas/_types.aggregations.DateRangeAggregation' description: A multi-bucket value source based aggregation that enables the user to define a set of date ranges - each representing a bucket. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-daterange-aggregation derivative: allOf: - $ref: '#/components/schemas/_types.aggregations.DerivativeAggregation' description: A parent pipeline aggregation which calculates the derivative of a specified metric in a parent `histogram` or `date_histogram` aggregation. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-pipeline-derivative-aggregation diversified_sampler: allOf: - $ref: '#/components/schemas/_types.aggregations.DiversifiedSamplerAggregation' description: "A filtering aggregation used to limit any sub aggregations' processing to a sample of the top-scoring documents.\nSimilar to the `sampler` aggregation, but adds the ability to limit the number of matches that share a common value." externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-diversified-sampler-aggregation extended_stats: allOf: - $ref: '#/components/schemas/_types.aggregations.ExtendedStatsAggregation' description: A multi-value metrics aggregation that computes stats over numeric values extracted from the aggregated documents. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-extendedstats-aggregation extended_stats_bucket: allOf: - $ref: '#/components/schemas/_types.aggregations.ExtendedStatsBucketAggregation' description: A sibling pipeline aggregation which calculates a variety of stats across all bucket of a specified metric in a sibling aggregation. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-pipeline-extended-stats-bucket-aggregation frequent_item_sets: allOf: - $ref: '#/components/schemas/_types.aggregations.FrequentItemSetsAggregation' description: 'A bucket aggregation which finds frequent item sets, a form of association rules mining that identifies items that often occur together.' externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-frequent-item-sets-aggregation filter: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: A single bucket aggregation that narrows the set of documents to those that match a query. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-filter-aggregation filters: allOf: - $ref: '#/components/schemas/_types.aggregations.FiltersAggregation' description: A multi-bucket aggregation where each bucket contains the documents that match a query. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-filters-aggregation geo_bounds: allOf: - $ref: '#/components/schemas/_types.aggregations.GeoBoundsAggregation' description: A metric aggregation that computes the geographic bounding box containing all values for a Geopoint or Geoshape field. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-geobounds-aggregation geo_centroid: allOf: - $ref: '#/components/schemas/_types.aggregations.GeoCentroidAggregation' description: A metric aggregation that computes the weighted centroid from all coordinate values for geo fields. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-geocentroid-aggregation geo_distance: allOf: - $ref: '#/components/schemas/_types.aggregations.GeoDistanceAggregation' description: "A multi-bucket aggregation that works on `geo_point` fields.\nEvaluates the distance of each document value from an origin point and determines the buckets it belongs to, based on ranges defined in the request." externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-geodistance-aggregation geohash_grid: allOf: - $ref: '#/components/schemas/_types.aggregations.GeoHashGridAggregation' description: "A multi-bucket aggregation that groups `geo_point` and `geo_shape` values into buckets that represent a grid.\nEach cell is labeled using a geohash which is of user-definable precision." externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-geohashgrid-aggregation geo_line: allOf: - $ref: '#/components/schemas/_types.aggregations.GeoLineAggregation' description: Aggregates all `geo_point` values within a bucket into a `LineString` ordered by the chosen sort field. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-geo-line geotile_grid: allOf: - $ref: '#/components/schemas/_types.aggregations.GeoTileGridAggregation' description: "A multi-bucket aggregation that groups `geo_point` and `geo_shape` values into buckets that represent a grid.\nEach cell corresponds to a map tile as used by many online map sites." externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-geotilegrid-aggregation geohex_grid: allOf: - $ref: '#/components/schemas/_types.aggregations.GeohexGridAggregation' description: "A multi-bucket aggregation that groups `geo_point` and `geo_shape` values into buckets that represent a grid.\nEach cell corresponds to a H3 cell index and is labeled using the H3Index representation." externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-geohexgrid-aggregation global: allOf: - $ref: '#/components/schemas/_types.aggregations.GlobalAggregation' description: "Defines a single bucket of all the documents within the search execution context.\nThis context is defined by the indices and the document types you’re searching on, but is not influenced by the search query itself." externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-global-aggregation histogram: allOf: - $ref: '#/components/schemas/_types.aggregations.HistogramAggregation' description: "A multi-bucket values source based aggregation that can be applied on numeric values or numeric range values extracted from the documents.\nIt dynamically builds fixed size (interval) buckets over the values." externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-histogram-aggregation ip_range: allOf: - $ref: '#/components/schemas/_types.aggregations.IpRangeAggregation' description: A multi-bucket value source based aggregation that enables the user to define a set of IP ranges - each representing a bucket. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-iprange-aggregation ip_prefix: allOf: - $ref: '#/components/schemas/_types.aggregations.IpPrefixAggregation' description: A bucket aggregation that groups documents based on the network or sub-network of an IP address. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-ipprefix-aggregation inference: allOf: - $ref: '#/components/schemas/_types.aggregations.InferenceAggregation' description: A parent pipeline aggregation which loads a pre-trained model and performs inference on the collated result fields from the parent bucket aggregation. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-pipeline-inference-bucket-aggregation line: allOf: - $ref: '#/components/schemas/_types.aggregations.GeoLineAggregation' matrix_stats: allOf: - $ref: '#/components/schemas/_types.aggregations.MatrixStatsAggregation' description: 'A numeric aggregation that computes the following statistics over a set of document fields: `count`, `mean`, `variance`, `skewness`, `kurtosis`, `covariance`, and `covariance`.' externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-matrix-stats-aggregation max: allOf: - $ref: '#/components/schemas/_types.aggregations.MaxAggregation' description: A single-value metrics aggregation that returns the maximum value among the numeric values extracted from the aggregated documents. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-max-aggregation max_bucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MaxBucketAggregation' description: A sibling pipeline aggregation which identifies the bucket(s) with the maximum value of a specified metric in a sibling aggregation and outputs both the value and the key(s) of the bucket(s). externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-pipeline-max-bucket-aggregation median_absolute_deviation: allOf: - $ref: '#/components/schemas/_types.aggregations.MedianAbsoluteDeviationAggregation' description: A single-value aggregation that approximates the median absolute deviation of its search results. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-median-absolute-deviation-aggregation min: allOf: - $ref: '#/components/schemas/_types.aggregations.MinAggregation' description: A single-value metrics aggregation that returns the minimum value among numeric values extracted from the aggregated documents. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-min-aggregation min_bucket: allOf: - $ref: '#/components/schemas/_types.aggregations.MinBucketAggregation' description: A sibling pipeline aggregation which identifies the bucket(s) with the minimum value of a specified metric in a sibling aggregation and outputs both the value and the key(s) of the bucket(s). externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-pipeline-min-bucket-aggregation missing: allOf: - $ref: '#/components/schemas/_types.aggregations.MissingAggregation' description: 'A field data based single bucket aggregation, that creates a bucket of all documents in the current document set context that are missing a field value (effectively, missing a field or having the configured NULL value set).' externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-missing-aggregation moving_avg: allOf: - $ref: '#/components/schemas/_types.aggregations.MovingAverageAggregation' moving_percentiles: allOf: - $ref: '#/components/schemas/_types.aggregations.MovingPercentilesAggregation' description: 'Given an ordered series of percentiles, "slides" a window across those percentiles and computes cumulative percentiles.' externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-pipeline-moving-percentiles-aggregation moving_fn: allOf: - $ref: '#/components/schemas/_types.aggregations.MovingFunctionAggregation' description: "Given an ordered series of data, \"slides\" a window across the data and runs a custom script on each window of data.\nFor convenience, a number of common functions are predefined such as `min`, `max`, and moving averages." externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-pipeline-movfn-aggregation multi_terms: allOf: - $ref: '#/components/schemas/_types.aggregations.MultiTermsAggregation' description: A multi-bucket value source based aggregation where buckets are dynamically built - one per unique set of values. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-multi-terms-aggregation nested: allOf: - $ref: '#/components/schemas/_types.aggregations.NestedAggregation' description: A special single bucket aggregation that enables aggregating nested documents. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-nested-aggregation normalize: allOf: - $ref: '#/components/schemas/_types.aggregations.NormalizeAggregation' description: A parent pipeline aggregation which calculates the specific normalized/rescaled value for a specific bucket value. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-pipeline-normalize-aggregation parent: allOf: - $ref: '#/components/schemas/_types.aggregations.ParentAggregation' description: 'A special single bucket aggregation that selects parent documents that have the specified type, as defined in a `join` field.' externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-parent-aggregation percentile_ranks: allOf: - $ref: '#/components/schemas/_types.aggregations.PercentileRanksAggregation' description: A multi-value metrics aggregation that calculates one or more percentile ranks over numeric values extracted from the aggregated documents. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-percentile-rank-aggregation percentiles: allOf: - $ref: '#/components/schemas/_types.aggregations.PercentilesAggregation' description: A multi-value metrics aggregation that calculates one or more percentiles over numeric values extracted from the aggregated documents. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-percentile-aggregation percentiles_bucket: allOf: - $ref: '#/components/schemas/_types.aggregations.PercentilesBucketAggregation' description: A sibling pipeline aggregation which calculates percentiles across all bucket of a specified metric in a sibling aggregation. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-pipeline-percentiles-bucket-aggregation range: allOf: - $ref: '#/components/schemas/_types.aggregations.RangeAggregation' description: A multi-bucket value source based aggregation that enables the user to define a set of ranges - each representing a bucket. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-range-aggregation rare_terms: allOf: - $ref: '#/components/schemas/_types.aggregations.RareTermsAggregation' description: A multi-bucket value source based aggregation which finds "rare" terms — terms that are at the long-tail of the distribution and are not frequent. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-rare-terms-aggregation rate: allOf: - $ref: '#/components/schemas/_types.aggregations.RateAggregation' description: "Calculates a rate of documents or a field in each bucket.\nCan only be used inside a `date_histogram` or `composite` aggregation." externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-rate-aggregation reverse_nested: allOf: - $ref: '#/components/schemas/_types.aggregations.ReverseNestedAggregation' description: "A special single bucket aggregation that enables aggregating on parent documents from nested documents.\nShould only be defined inside a `nested` aggregation." externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-reverse-nested-aggregation random_sampler: allOf: - $ref: '#/components/schemas/_types.aggregations.RandomSamplerAggregation' description: "A single bucket aggregation that randomly includes documents in the aggregated results.\nSampling provides significant speed improvement at the cost of accuracy." externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-random-sampler-aggregation x-state: Experimental; Added in 8.1.0 sampler: allOf: - $ref: '#/components/schemas/_types.aggregations.SamplerAggregation' description: A filtering aggregation used to limit any sub aggregations' processing to a sample of the top-scoring documents. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-sampler-aggregation scripted_metric: allOf: - $ref: '#/components/schemas/_types.aggregations.ScriptedMetricAggregation' description: A metric aggregation that uses scripts to provide a metric output. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-scripted-metric-aggregation serial_diff: allOf: - $ref: '#/components/schemas/_types.aggregations.SerialDifferencingAggregation' description: An aggregation that subtracts values in a time series from themselves at different time lags or periods. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-pipeline-serialdiff-aggregation significant_terms: allOf: - $ref: '#/components/schemas/_types.aggregations.SignificantTermsAggregation' description: Returns interesting or unusual occurrences of terms in a set. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-significantterms-aggregation significant_text: allOf: - $ref: '#/components/schemas/_types.aggregations.SignificantTextAggregation' description: Returns interesting or unusual occurrences of free-text terms in a set. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-significanttext-aggregation stats: allOf: - $ref: '#/components/schemas/_types.aggregations.StatsAggregation' description: A multi-value metrics aggregation that computes stats over numeric values extracted from the aggregated documents. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-stats-aggregation stats_bucket: allOf: - $ref: '#/components/schemas/_types.aggregations.StatsBucketAggregation' description: A sibling pipeline aggregation which calculates a variety of stats across all bucket of a specified metric in a sibling aggregation. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-pipeline-stats-bucket-aggregation string_stats: allOf: - $ref: '#/components/schemas/_types.aggregations.StringStatsAggregation' description: A multi-value metrics aggregation that computes statistics over string values extracted from the aggregated documents. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-string-stats-aggregation sum: allOf: - $ref: '#/components/schemas/_types.aggregations.SumAggregation' description: A single-value metrics aggregation that sums numeric values that are extracted from the aggregated documents. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-sum-aggregation sum_bucket: allOf: - $ref: '#/components/schemas/_types.aggregations.SumBucketAggregation' description: A sibling pipeline aggregation which calculates the sum of a specified metric across all buckets in a sibling aggregation. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-pipeline-sum-bucket-aggregation terms: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsAggregation' description: A multi-bucket value source based aggregation where buckets are dynamically built - one per unique value. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-terms-aggregation time_series: allOf: - $ref: '#/components/schemas/_types.aggregations.TimeSeriesAggregation' description: "The time series aggregation queries data created using a time series index.\nThis is typically data such as metrics or other data streams with a time component, and requires creating an index using the time series mode." externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-time-series-aggregation x-state: Experimental top_hits: allOf: - $ref: '#/components/schemas/_types.aggregations.TopHitsAggregation' description: A metric aggregation that returns the top matching documents per bucket. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-top-hits-aggregation t_test: allOf: - $ref: '#/components/schemas/_types.aggregations.TTestAggregation' description: A metrics aggregation that performs a statistical hypothesis test in which the test statistic follows a Student’s t-distribution under the null hypothesis on numeric values extracted from the aggregated documents. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-ttest-aggregation top_metrics: allOf: - $ref: '#/components/schemas/_types.aggregations.TopMetricsAggregation' description: A metric aggregation that selects metrics from the document with the largest or smallest sort value. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-top-metrics value_count: allOf: - $ref: '#/components/schemas/_types.aggregations.ValueCountAggregation' description: A single-value metrics aggregation that counts the number of values that are extracted from the aggregated documents. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-valuecount-aggregation weighted_avg: allOf: - $ref: '#/components/schemas/_types.aggregations.WeightedAverageAggregation' description: A single-value metrics aggregation that computes the weighted average of numeric values that are extracted from the aggregated documents. externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-weight-avg-aggregation variable_width_histogram: allOf: - $ref: '#/components/schemas/_types.aggregations.VariableWidthHistogramAggregation' description: 'A multi-bucket aggregation similar to the histogram, except instead of providing an interval to use as the width of each bucket, a target number of buckets is provided.' externalDocs: url: https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-variablewidthhistogram-aggregation _types.aggregations.AdjacencyMatrixAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: filters: type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: "Filters used to create buckets.\nAt least one filter is required." separator: type: string description: Separator used to concatenate filter names. Defaults to &. _types.query_dsl.QueryContainer: maxProperties: 1 minProperties: 1 type: object properties: bool: allOf: - $ref: '#/components/schemas/_types.query_dsl.BoolQuery' description: matches documents matching boolean combinations of other queries. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-bool-query boosting: allOf: - $ref: '#/components/schemas/_types.query_dsl.BoostingQuery' description: Returns documents matching a `positive` query while reducing the relevance score of documents that also match a `negative` query. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-boosting-query common: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.CommonTermsQuery' deprecated: true combined_fields: allOf: - $ref: '#/components/schemas/_types.query_dsl.CombinedFieldsQuery' description: The `combined_fields` query supports searching multiple text fields as if their contents had been indexed into one combined field. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-combined-fields-query x-state: Generally available; Added in 7.13.0 constant_score: allOf: - $ref: '#/components/schemas/_types.query_dsl.ConstantScoreQuery' description: Wraps a filter query and returns every matching document with a relevance score equal to the `boost` parameter value. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-constant-score-query dense_vector: allOf: - $ref: '#/components/schemas/_types.query_dsl.DenseVectorQuery' description: "Scores every document that has a value for a `dense_vector` field, with the exact similarity between its vector and a query vector.\nUnlike the `knn` query, it doesn't use an index structure, or a cutoff based on `k` or `num_candidates`." externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-dense-vector-query x-state: Generally available; Added in 9.6.0 dis_max: allOf: - $ref: '#/components/schemas/_types.query_dsl.DisMaxQuery' description: "Returns documents matching one or more wrapped queries, called query clauses or clauses.\nIf a returned document matches multiple query clauses, the `dis_max` query assigns the document the highest relevance score from any matching clause, plus a tie breaking increment for any additional matching subqueries." externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-dis-max-query distance_feature: allOf: - $ref: '#/components/schemas/_types.query_dsl.DistanceFeatureQuery' description: "Boosts the relevance score of documents closer to a provided origin date or point.\nFor example, you can use this query to give more weight to documents closer to a certain date or location." externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-distance-feature-query exists: allOf: - $ref: '#/components/schemas/_types.query_dsl.ExistsQuery' description: Returns documents that contain an indexed value for a field. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-exists-query function_score: allOf: - $ref: '#/components/schemas/_types.query_dsl.FunctionScoreQuery' description: The `function_score` enables you to modify the score of documents that are retrieved by a query. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-function-score-query fuzzy: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.FuzzyQuery' description: 'Returns documents that contain terms similar to the search term, as measured by a Levenshtein edit distance.' externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-fuzzy-query geo_bounding_box: allOf: - $ref: '#/components/schemas/_types.query_dsl.GeoBoundingBoxQuery' description: Matches geo_point and geo_shape values that intersect a bounding box. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-geo-bounding-box-query geo_distance: allOf: - $ref: '#/components/schemas/_types.query_dsl.GeoDistanceQuery' description: Matches `geo_point` and `geo_shape` values within a given distance of a geopoint. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-geo-distance-query geo_grid: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.GeoGridQuery' description: Matches `geo_point` and `geo_shape` values that intersect a grid cell from a GeoGrid aggregation. geo_polygon: allOf: - $ref: '#/components/schemas/_types.query_dsl.GeoPolygonQuery' deprecated: true geo_shape: allOf: - $ref: '#/components/schemas/_types.query_dsl.GeoShapeQuery' description: Filter documents indexed using either the `geo_shape` or the `geo_point` type. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-geo-shape-query has_child: allOf: - $ref: '#/components/schemas/_types.query_dsl.HasChildQuery' description: Returns parent documents whose joined child documents match a provided query. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-has-child-query has_parent: allOf: - $ref: '#/components/schemas/_types.query_dsl.HasParentQuery' description: Returns child documents whose joined parent document matches a provided query. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-has-parent-query ids: allOf: - $ref: '#/components/schemas/_types.query_dsl.IdsQuery' description: "Returns documents based on their IDs.\nThis query uses document IDs stored in the `_id` field." externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-ids-query intervals: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.IntervalsQuery' description: Returns documents based on the order and proximity of matching terms. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-intervals-query knn: allOf: - $ref: '#/components/schemas/_types.KnnQuery' description: "Finds the k nearest vectors to a query vector, as measured by a similarity\nmetric. knn query finds nearest vectors through approximate search on indexed\ndense_vectors." externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-knn-query kql: allOf: - $ref: '#/components/schemas/_types.query_dsl.KqlQuery' description: "Returns documents matching a provided Kibana Query Language (KQL) expression.\nThe expression is parsed and rewritten into standard Query DSL." externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-kql-query x-state: Generally available; Added in 9.0.0 match: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.MatchQuery' description: "Returns documents that match a provided text, number, date or boolean value.\nThe provided text is analyzed before matching." externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-match-query match_all: allOf: - $ref: '#/components/schemas/_types.query_dsl.MatchAllQuery' description: 'Matches all documents, giving them all a `_score` of 1.0.' externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-match-all-query match_bool_prefix: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.MatchBoolPrefixQuery' description: "Analyzes its input and constructs a `bool` query from the terms.\nEach term except the last is used in a `term` query.\nThe last term is used in a prefix query." externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-match-bool-prefix-query match_none: allOf: - $ref: '#/components/schemas/_types.query_dsl.MatchNoneQuery' description: Matches no documents. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-match-all-query#query-dsl-match-none-query match_phrase: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.MatchPhraseQuery' description: Analyzes the text and creates a phrase query out of the analyzed text. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-match-query-phrase match_phrase_prefix: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.MatchPhrasePrefixQuery' description: "Returns documents that contain the words of a provided text, in the same order as provided.\nThe last term of the provided text is treated as a prefix, matching any words that begin with that term." externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-match-query-phrase-prefix more_like_this: allOf: - $ref: '#/components/schemas/_types.query_dsl.MoreLikeThisQuery' description: Returns documents that are "like" a given set of documents. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-mlt-query multi_match: allOf: - $ref: '#/components/schemas/_types.query_dsl.MultiMatchQuery' description: "Enables you to search for a provided text, number, date or boolean value across multiple fields.\nThe provided text is analyzed before matching." externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-multi-match-query nested: allOf: - $ref: '#/components/schemas/_types.query_dsl.NestedQuery' description: "Wraps another query to search nested fields.\nIf an object matches the search, the nested query returns the root parent document." externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-nested-query parent_id: allOf: - $ref: '#/components/schemas/_types.query_dsl.ParentIdQuery' description: Returns child documents joined to a specific parent document. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-parent-id-query percolate: allOf: - $ref: '#/components/schemas/_types.query_dsl.PercolateQuery' description: Matches queries stored in an index. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-percolate-query pinned: allOf: - $ref: '#/components/schemas/_types.query_dsl.PinnedQuery' description: Promotes selected documents to rank higher than those matching a given query. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-pinned-query prefix: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.PrefixQuery' description: Returns documents that contain a specific prefix in a provided field. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-prefix-query query_string: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryStringQuery' description: 'Returns documents based on a provided query string, using a parser with a strict syntax.' externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-query-string-query range: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.RangeQuery' description: Returns documents that contain terms within a provided range. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-range-query rank_feature: allOf: - $ref: '#/components/schemas/_types.query_dsl.RankFeatureQuery' description: Boosts the relevance score of documents based on the numeric value of a `rank_feature` or `rank_features` field. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-rank-feature-query regexp: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.RegexpQuery' description: Returns documents that contain terms matching a regular expression. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-regexp-query rule: allOf: - $ref: '#/components/schemas/_types.query_dsl.RuleQuery' script: allOf: - $ref: '#/components/schemas/_types.query_dsl.ScriptQuery' description: "Filters documents based on a provided script.\nThe script query is typically used in a filter context." externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-script-query script_score: allOf: - $ref: '#/components/schemas/_types.query_dsl.ScriptScoreQuery' description: Uses a script to provide a custom score for returned documents. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-script-score-query semantic: allOf: - $ref: '#/components/schemas/_types.query_dsl.SemanticQuery' description: A semantic query to semantic_text field types x-state: Generally available; Added in 8.15.0 shape: allOf: - $ref: '#/components/schemas/_types.query_dsl.ShapeQuery' description: Queries documents that contain fields indexed using the `shape` type. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-shape-query simple_query_string: allOf: - $ref: '#/components/schemas/_types.query_dsl.SimpleQueryStringQuery' description: 'Returns documents based on a provided query string, using a parser with a limited but fault-tolerant syntax.' externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-simple-query-string-query span_containing: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanContainingQuery' description: Returns matches which enclose another span query. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-span-containing-query span_field_masking: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanFieldMaskingQuery' description: Wrapper to allow span queries to participate in composite single-field span queries by _lying_ about their search field. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-span-field-masking-query span_first: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanFirstQuery' description: Matches spans near the beginning of a field. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-span-first-query span_multi: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanMultiTermQuery' description: 'Allows you to wrap a multi term query (one of `wildcard`, `fuzzy`, `prefix`, `range`, or `regexp` query) as a `span` query, so it can be nested.' externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-span-multi-term-query span_near: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanNearQuery' description: "Matches spans which are near one another.\nYou can specify `slop`, the maximum number of intervening unmatched positions, as well as whether matches are required to be in-order." externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-span-near-query span_not: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanNotQuery' description: Removes matches which overlap with another span query or which are within x tokens before (controlled by the parameter `pre`) or y tokens after (controlled by the parameter `post`) another span query. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-span-not-query span_or: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanOrQuery' description: Matches the union of its span clauses. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-span-query span_term: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.SpanTermQuery' description: Matches spans containing a term. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-span-term-query span_within: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanWithinQuery' description: Returns matches which are enclosed inside another span query. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-span-within-query sparse_vector: allOf: - $ref: '#/components/schemas/_types.query_dsl.SparseVectorQuery' description: 'Using input query vectors or a natural language processing model to convert a query into a list of token-weight pairs, queries against a sparse vector field.' externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-sparse-vector-query x-state: Generally available; Added in 8.15.0 term: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.TermQuery' description: "Returns documents that contain an exact term in a provided field.\nTo return a document, the query term must exactly match the queried field's value, including whitespace and capitalization." externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-term-query terms: allOf: - $ref: '#/components/schemas/_types.query_dsl.TermsQuery' description: "Returns documents that contain one or more exact terms in a provided field.\nTo return a document, one or more terms must exactly match a field value, including whitespace and capitalization." externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-terms-query terms_set: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.TermsSetQuery' description: "Returns documents that contain a minimum number of exact terms in a provided field.\nTo return a document, a required number of terms must exactly match the field values, including whitespace and capitalization." externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-terms-set-query text_expansion: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.TextExpansionQuery' description: Uses a natural language processing model to convert the query text into a list of token-weight pairs which are then used in a query against a sparse vector or rank features field. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-text-expansion-query deprecated: true x-state: Generally available; Added in 8.8.0 weighted_tokens: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.WeightedTokensQuery' description: Supports returning text_expansion query results by sending in precomputed tokens with the query. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-weighted-tokens-query deprecated: true x-state: Generally available; Added in 8.13.0 wildcard: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.WildcardQuery' description: Returns documents that contain terms matching a wildcard pattern. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-wildcard-query wrapper: allOf: - $ref: '#/components/schemas/_types.query_dsl.WrapperQuery' description: A query that accepts any other query as base64 encoded string. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-wrapper-query type: allOf: - $ref: '#/components/schemas/_types.query_dsl.TypeQuery' deprecated: true description: An Elasticsearch Query DSL (Domain Specific Language) object that defines a query. externalDocs: url: https://www.elastic.co/docs/explore-analyze/query-filter/languages/querydsl x-model: true _types.query_dsl.BoolQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - type: object properties: filter: oneOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' - type: array items: $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: "The clause (query) must appear in matching documents.\nHowever, unlike `must`, the score of the query will be ignored." minimum_should_match: allOf: - $ref: '#/components/schemas/_types.MinimumShouldMatch' description: Specifies the number or percentage of `should` clauses returned documents must match. must: oneOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' - type: array items: $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: The clause (query) must appear in matching documents and will contribute to the score. must_not: oneOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' - type: array items: $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: "The clause (query) must not appear in the matching documents.\nBecause scoring is ignored, a score of `0` is returned for all documents." should: oneOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' - type: array items: $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: The clause (query) should appear in the matching document. x-model: true _types.MinimumShouldMatch: type: - number - string description: 'The minimum number of terms that should match as integer, percentage or range' _types.query_dsl.QueryBase: type: object properties: boost: type: number description: "Floating point number used to decrease or increase the relevance scores of the query.\nBoost values are relative to the default value of 1.0.\nA boost value between 0 and 1.0 decreases the relevance score.\nA value greater than 1.0 increases the relevance score." default: 1 _name: type: string x-model: true _types.query_dsl.BoostingQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - negative_boost - negative - positive type: object properties: negative_boost: type: number description: Floating point number between 0 and 1.0 used to decrease the relevance scores of documents matching the `negative` query. negative: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: Query used to decrease the relevance score of matching documents. positive: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: Any returned documents must match this query. x-model: true _types.query_dsl.CommonTermsQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - query type: object properties: analyzer: type: string cutoff_frequency: type: number high_freq_operator: allOf: - $ref: '#/components/schemas/_types.query_dsl.Operator' low_freq_operator: allOf: - $ref: '#/components/schemas/_types.query_dsl.Operator' minimum_should_match: allOf: - $ref: '#/components/schemas/_types.MinimumShouldMatch' query: type: string x-model: true _types.query_dsl.Operator: enum: - and - AND - or - OR type: string _types.query_dsl.CombinedFieldsQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - fields - query type: object properties: fields: type: array items: $ref: '#/components/schemas/_types.Field' description: 'List of fields to search. Field wildcard patterns are allowed. Only `text` fields are supported, and they must all have the same search `analyzer`.' query: type: string description: "Text to search for in the provided `fields`.\nThe `combined_fields` query analyzes the provided text before performing a search." auto_generate_synonyms_phrase_query: type: boolean description: 'If true, match phrase queries are automatically created for multi-term synonyms.' default: true operator: allOf: - $ref: '#/components/schemas/_types.query_dsl.CombinedFieldsOperator' description: Boolean logic used to interpret text in the query value. default: or minimum_should_match: allOf: - $ref: '#/components/schemas/_types.MinimumShouldMatch' description: Minimum number of clauses that must match for a document to be returned. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-minimum-should-match zero_terms_query: allOf: - $ref: '#/components/schemas/_types.query_dsl.CombinedFieldsZeroTerms' description: "Indicates whether no documents are returned if the analyzer removes all tokens, such as when using a `stop` filter.\n\nSupported values include:\n - `none`: No documents are returned if the analyzer removes all tokens.\n - `all`: Returns all documents, similar to a `match_all` query.\n\n" default: none x-model: true _types.query_dsl.CombinedFieldsOperator: enum: - or - and type: string _types.query_dsl.CombinedFieldsZeroTerms: enum: - none - all type: string _types.query_dsl.ConstantScoreQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - filter type: object properties: filter: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: "Filter query you wish to run. Any returned documents must match this query.\nFilter queries do not calculate relevance scores.\nTo speed up performance, Elasticsearch automatically caches frequently used filter queries." x-model: true _types.query_dsl.DenseVectorQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The name of the `dense_vector` field to search against.\nThe field can be indexed, or not indexed (`index: false`)." query_vector: allOf: - $ref: '#/components/schemas/_types.QueryVector' description: "The query vector. It must have the same number of dimensions as the field.\nYou must provide either `query_vector` or `query_vector_builder`, but not both." query_vector_builder: allOf: - $ref: '#/components/schemas/_types.QueryVectorBuilder' description: "The configuration to build the query vector, for example by running a text embedding model.\nYou must provide either `query_vector` or `query_vector_builder`, but not both." similarity_function: allOf: - $ref: '#/components/schemas/_types.mapping.DenseVectorSimilarity' description: "The similarity used for scoring, which overrides the similarity of the field for this query.\nIt defaults to the similarity of the field, or to `cosine` for a field that is not indexed.\nFor `bit` fields, only `l2_norm` is supported.\nIt can't be combined with `quantized: true`.\n\nSupported values include:\n - `cosine`: Computes the cosine similarity. During indexing Elasticsearch automatically normalizes vectors with `cosine`\nsimilarity to unit length. This allows to internally use `dot_product` for computing similarity, which is more\nefficient. Original un-normalized vectors can be still accessed through scripts.\n\nThe document `_score` is computed as `(1 + cosine(query, vector)) / 2`.\n\nThe `cosine` similarity does not allow vectors with zero magnitude, since cosine is not defined in this case.\n - `dot_product`: Computes the dot product of two unit vectors. This option provides an optimized way to perform cosine similarity.\nThe constraints and computed score are defined by `element_type`.\n\nWhen `element_type` is `float`, all vectors must be unit length, including both document and query vectors.\n\nThe document `_score` is computed as `(1 + dot_product(query, vector)) / 2`.\n\nWhen `element_type` is `byte`, all vectors must have the same length including both document and query vectors or\nresults will be inaccurate.\n\nThe document `_score` is computed as `0.5 + (dot_product(query, vector) / (32768 * dims))` where `dims` is the\nnumber of dimensions per vector.\n - `l2_norm`: Computes similarity based on the `L2` distance (also known as Euclidean distance) between the vectors.\n\nThe document `_score` is computed as `1 / (1 + l2_norm(query, vector)^2)`.\n\nFor `bit` vectors, instead of using `l2_norm`, the `hamming` distance between the vectors is used.\n\nThe `_score` transformation is `(numBits - hamming(a, b)) / numBits`.\n - `max_inner_product`: Computes the maximum inner product of two vectors. This is similar to `dot_product`, but doesn't require vectors\nto be normalized. This means that each vector’s magnitude can significantly effect the score.\n\nThe document `_score` is adjusted to prevent negative values. For `max_inner_product` values `< 0`, the `_score`\nis `1 / (1 + -1 * max_inner_product(query, vector))`. For non-negative `max_inner_product` results the `_score`\nis calculated `max_inner_product(query, vector) + 1`.\n\n" quantized: type: boolean description: "If `false`, the documents are scored with the full-precision vectors, regardless of the index options of the field.\nIf `true`, the documents are scored with the quantized vectors of a quantized field, which is faster but less accurate.\nFor a field that is not quantized, `true` has no effect." default: false _types.QueryVector: oneOf: - type: array items: type: number - type: string description: Both the float vector form and the base64 string form are accepted by the server _types.QueryVectorBuilder: maxProperties: 1 minProperties: 1 type: object properties: embedding: allOf: - $ref: '#/components/schemas/_types.Embedding' text_embedding: allOf: - $ref: '#/components/schemas/_types.TextEmbedding' lookup: allOf: - $ref: '#/components/schemas/_types.LookupQueryVectorBuilder' description: "Lookup a vector from an existing document.\nMust reference a dense_vector field and a single value." x-state: Generally available; Added in 9.4.0 _types.Embedding: required: - input type: object properties: inference_id: type: string input: allOf: - $ref: '#/components/schemas/_types.KnnEmbeddingInput' timeout: allOf: - $ref: '#/components/schemas/_types.Duration' _types.KnnEmbeddingInput: oneOf: - type: string - $ref: '#/components/schemas/_types.InferenceStringGroup' description: "Knn embedding input.\nEither a string, an object or array of objects" _types.InferenceStringGroup: oneOf: - $ref: '#/components/schemas/_types.InferenceString' - type: array items: $ref: '#/components/schemas/_types.InferenceString' _types.InferenceString: required: - type - value type: object properties: type: allOf: - $ref: '#/components/schemas/inference._types.EmbeddingContentType' description: The type of data that the value represents. format: oneOf: - $ref: '#/components/schemas/inference._types.EmbeddingContentFormat' - type: - 'null' - string description: 'The format of the data. If null, the default data format for the given type is used.' value: type: string description: 'String which may be raw text, the string representation of some other data such as an image in base64, or a URL that points to the data.' inference._types.EmbeddingContentType: enum: - text - image - audio - video - pdf type: string inference._types.EmbeddingContentFormat: enum: - text - base64 - url type: string _types.TextEmbedding: required: - model_text type: object properties: model_id: type: string description: "Model ID is required for all dense_vector fields but\nmay be inferred for semantic_text fields" x-state: Generally available; Added in 8.18.0 model_text: type: string description: The text to be converted into a vector by the specified model _types.LookupQueryVectorBuilder: required: - id - index - path type: object properties: id: type: string description: The ID of the document to fetch the vector from index: type: string description: The name of the index to fetch the document from path: type: string description: The name of the field containing the vector routing: type: string description: The routing value to use when fetching the document _types.mapping.DenseVectorSimilarity: enum: - cosine - dot_product - l2_norm - max_inner_product type: string _types.query_dsl.DisMaxQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - queries type: object properties: queries: type: array items: $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: "One or more query clauses.\nReturned documents must match one or more of these queries.\nIf a document matches multiple queries, Elasticsearch uses the highest relevance score." tie_breaker: type: number description: Floating point number between 0 and 1.0 used to increase the relevance scores of documents matching multiple query clauses. default: 0 x-model: true _types.query_dsl.DistanceFeatureQuery: oneOf: - $ref: '#/components/schemas/_types.query_dsl.UntypedDistanceFeatureQuery' - $ref: '#/components/schemas/_types.query_dsl.GeoDistanceFeatureQuery' - $ref: '#/components/schemas/_types.query_dsl.DateDistanceFeatureQuery' externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-distance-feature-query x-model: true _types.query_dsl.UntypedDistanceFeatureQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.DistanceFeatureQueryBase' - type: object x-model: true _types.query_dsl.DistanceFeatureQueryBase: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - origin - pivot - field type: object properties: origin: type: object description: "Date or point of origin used to calculate distances.\nIf the `field` value is a `date` or `date_nanos` field, the `origin` value must be a date.\nDate Math, such as `now-1h`, is supported.\nIf the field value is a `geo_point` field, the `origin` value must be a geopoint." pivot: type: object description: "Distance from the `origin` at which relevance scores receive half of the `boost` value.\nIf the `field` value is a `date` or `date_nanos` field, the `pivot` value must be a time unit, such as `1h` or `10d`. If the `field` value is a `geo_point` field, the `pivot` value must be a distance unit, such as `1km` or `12m`." field: allOf: - $ref: '#/components/schemas/_types.Field' description: "Name of the field used to calculate distances. This field must meet the following criteria:\nbe a `date`, `date_nanos` or `geo_point` field;\nhave an `index` mapping parameter value of `true`, which is the default;\nhave an `doc_values` mapping parameter value of `true`, which is the default." x-model: true _types.query_dsl.GeoDistanceFeatureQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.DistanceFeatureQueryBaseGeoLocationDistance' - type: object x-model: true _types.query_dsl.DistanceFeatureQueryBaseGeoLocationDistance: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - origin - pivot - field type: object properties: origin: allOf: - $ref: '#/components/schemas/_types.GeoLocation' description: "Date or point of origin used to calculate distances.\nIf the `field` value is a `date` or `date_nanos` field, the `origin` value must be a date.\nDate Math, such as `now-1h`, is supported.\nIf the field value is a `geo_point` field, the `origin` value must be a geopoint." pivot: allOf: - $ref: '#/components/schemas/_types.Distance' description: "Distance from the `origin` at which relevance scores receive half of the `boost` value.\nIf the `field` value is a `date` or `date_nanos` field, the `pivot` value must be a time unit, such as `1h` or `10d`. If the `field` value is a `geo_point` field, the `pivot` value must be a distance unit, such as `1km` or `12m`." field: allOf: - $ref: '#/components/schemas/_types.Field' description: "Name of the field used to calculate distances. This field must meet the following criteria:\nbe a `date`, `date_nanos` or `geo_point` field;\nhave an `index` mapping parameter value of `true`, which is the default;\nhave an `doc_values` mapping parameter value of `true`, which is the default." x-model: true _types.Distance: type: string _types.query_dsl.DateDistanceFeatureQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.DistanceFeatureQueryBaseDateMathDuration' - type: object x-model: true _types.query_dsl.DistanceFeatureQueryBaseDateMathDuration: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - origin - pivot - field type: object properties: origin: allOf: - $ref: '#/components/schemas/_types.DateMath' description: "Date or point of origin used to calculate distances.\nIf the `field` value is a `date` or `date_nanos` field, the `origin` value must be a date.\nDate Math, such as `now-1h`, is supported.\nIf the field value is a `geo_point` field, the `origin` value must be a geopoint." pivot: allOf: - $ref: '#/components/schemas/_types.Duration' description: "Distance from the `origin` at which relevance scores receive half of the `boost` value.\nIf the `field` value is a `date` or `date_nanos` field, the `pivot` value must be a time unit, such as `1h` or `10d`. If the `field` value is a `geo_point` field, the `pivot` value must be a distance unit, such as `1km` or `12m`." field: allOf: - $ref: '#/components/schemas/_types.Field' description: "Name of the field used to calculate distances. This field must meet the following criteria:\nbe a `date`, `date_nanos` or `geo_point` field;\nhave an `index` mapping parameter value of `true`, which is the default;\nhave an `doc_values` mapping parameter value of `true`, which is the default." x-model: true _types.DateMath: type: string _types.query_dsl.ExistsQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: Name of the field you wish to search. x-model: true _types.query_dsl.FunctionScoreQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - type: object properties: boost_mode: allOf: - $ref: '#/components/schemas/_types.query_dsl.FunctionBoostMode' description: "Defines how he newly computed score is combined with the score of the query\n\nSupported values include:\n - `multiply`: Query score and function score are multiplied\n - `replace`: Only the function score is used.\nThe query score is ignored.\n - `sum`: Query score and function score are added\n - `avg`: Query score and function score are averaged\n - `max`: Max of query score and function score\n - `min`: Min of query score and function score\n\n" default: multiply functions: type: array items: $ref: '#/components/schemas/_types.query_dsl.FunctionScoreContainer' description: One or more functions that compute a new score for each document returned by the query. max_boost: type: number description: Restricts the new score to not exceed the provided limit. min_score: type: number description: Excludes documents that do not meet the provided score threshold. query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: A query that determines the documents for which a new score is computed. score_mode: allOf: - $ref: '#/components/schemas/_types.query_dsl.FunctionScoreMode' description: "Specifies how the computed scores are combined\n\nSupported values include:\n - `multiply`: Scores are multiplied.\n - `sum`: Scores are summed.\n - `avg`: Scores are averaged.\n - `first`: The first function that has a matching filter is applied.\n - `max`: Maximum score is used.\n - `min`: Minimum score is used.\n\n" default: multiply x-model: true _types.query_dsl.FunctionBoostMode: enum: - multiply - replace - sum - avg - max - min type: string _types.query_dsl.FunctionScoreContainer: allOf: - type: object properties: filter: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' weight: type: number _name: type: string description: A name to identify which function matched and influenced the score. x-state: Generally available; Added in 9.4.0 - maxProperties: 1 minProperties: 1 type: object properties: exp: allOf: - $ref: '#/components/schemas/_types.query_dsl.DecayFunction' description: 'Function that scores a document with a exponential decay, depending on the distance of a numeric field value of the document from an origin.' gauss: allOf: - $ref: '#/components/schemas/_types.query_dsl.DecayFunction' description: 'Function that scores a document with a normal decay, depending on the distance of a numeric field value of the document from an origin.' linear: allOf: - $ref: '#/components/schemas/_types.query_dsl.DecayFunction' description: 'Function that scores a document with a linear decay, depending on the distance of a numeric field value of the document from an origin.' field_value_factor: allOf: - $ref: '#/components/schemas/_types.query_dsl.FieldValueFactorScoreFunction' description: "Function allows you to use a field from a document to influence the score.\nIt’s similar to using the script_score function, however, it avoids the overhead of scripting." random_score: allOf: - $ref: '#/components/schemas/_types.query_dsl.RandomScoreFunction' description: "Generates scores that are uniformly distributed from 0 up to but not including 1.\nIn case you want scores to be reproducible, it is possible to provide a `seed` and `field`." script_score: allOf: - $ref: '#/components/schemas/_types.query_dsl.ScriptScoreFunction' description: Enables you to wrap another query and customize the scoring of it optionally with a computation derived from other numeric field values in the doc using a script expression. x-model: true _types.query_dsl.DecayFunction: oneOf: - $ref: '#/components/schemas/_types.query_dsl.UntypedDecayFunction' - $ref: '#/components/schemas/_types.query_dsl.DateDecayFunction' - $ref: '#/components/schemas/_types.query_dsl.NumericDecayFunction' - $ref: '#/components/schemas/_types.query_dsl.GeoDecayFunction' x-model: true _types.query_dsl.UntypedDecayFunction: allOf: - $ref: '#/components/schemas/_types.query_dsl.DecayFunctionBase' - type: object x-model: true _types.query_dsl.DecayFunctionBase: type: object properties: multi_value_mode: allOf: - $ref: '#/components/schemas/_types.query_dsl.MultiValueMode' description: "Determines how the distance is calculated when a field used for computing the decay contains multiple values.\n\nSupported values include:\n - `min`: Distance is the minimum distance.\n - `max`: Distance is the maximum distance.\n - `avg`: Distance is the average distance.\n - `sum`: Distance is the sum of all distances.\n\n" default: min x-model: true _types.query_dsl.MultiValueMode: enum: - min - max - avg - sum type: string x-model: true _types.query_dsl.DateDecayFunction: allOf: - $ref: '#/components/schemas/_types.query_dsl.DecayFunctionBaseDateMathDuration' - type: object x-model: true _types.query_dsl.DecayFunctionBaseDateMathDuration: type: object properties: multi_value_mode: allOf: - $ref: '#/components/schemas/_types.query_dsl.MultiValueMode' description: "Determines how the distance is calculated when a field used for computing the decay contains multiple values.\n\nSupported values include:\n - `min`: Distance is the minimum distance.\n - `max`: Distance is the maximum distance.\n - `avg`: Distance is the average distance.\n - `sum`: Distance is the sum of all distances.\n\n" default: min x-model: true _types.query_dsl.NumericDecayFunction: allOf: - $ref: '#/components/schemas/_types.query_dsl.DecayFunctionBasedoubledouble' - type: object x-model: true _types.query_dsl.DecayFunctionBasedoubledouble: type: object properties: multi_value_mode: allOf: - $ref: '#/components/schemas/_types.query_dsl.MultiValueMode' description: "Determines how the distance is calculated when a field used for computing the decay contains multiple values.\n\nSupported values include:\n - `min`: Distance is the minimum distance.\n - `max`: Distance is the maximum distance.\n - `avg`: Distance is the average distance.\n - `sum`: Distance is the sum of all distances.\n\n" default: min x-model: true _types.query_dsl.GeoDecayFunction: allOf: - $ref: '#/components/schemas/_types.query_dsl.DecayFunctionBaseGeoLocationDistance' - type: object x-model: true _types.query_dsl.DecayFunctionBaseGeoLocationDistance: type: object properties: multi_value_mode: allOf: - $ref: '#/components/schemas/_types.query_dsl.MultiValueMode' description: "Determines how the distance is calculated when a field used for computing the decay contains multiple values.\n\nSupported values include:\n - `min`: Distance is the minimum distance.\n - `max`: Distance is the maximum distance.\n - `avg`: Distance is the average distance.\n - `sum`: Distance is the sum of all distances.\n\n" default: min x-model: true _types.query_dsl.FieldValueFactorScoreFunction: required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: Field to be extracted from the document. factor: type: number description: Optional factor to multiply the field value with. default: 1 missing: type: number description: "Value used if the document doesn’t have that field.\nThe modifier and factor are still applied to it as though it were read from the document." modifier: allOf: - $ref: '#/components/schemas/_types.query_dsl.FieldValueFactorModifier' description: "Modifier to apply to the field value.\n\nSupported values include:\n - `none`: Do not apply any multiplier to the field value.\n - `log`: Take the common logarithm of the field value.\nBecause this function will return a negative value and cause an error if used on values between 0 and 1, it is recommended to use `log1p` instead.\n - `log1p`: Add 1 to the field value and take the common logarithm.\n - `log2p`: Add 2 to the field value and take the common logarithm.\n - `ln`: Take the natural logarithm of the field value.\nBecause this function will return a negative value and cause an error if used on values between 0 and 1, it is recommended to use `ln1p` instead.\n - `ln1p`: Add 1 to the field value and take the natural logarithm.\n - `ln2p`: Add 2 to the field value and take the natural logarithm.\n - `square`: Square the field value (multiply it by itself).\n - `sqrt`: Take the square root of the field value.\n - `reciprocal`: Reciprocate the field value, same as `1/x` where `x` is the field’s value.\n\n" x-model: true _types.query_dsl.FieldValueFactorModifier: enum: - none - log - log1p - log2p - ln - ln1p - ln2p - square - sqrt - reciprocal type: string _types.query_dsl.RandomScoreFunction: type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' seed: type: - number - string x-model: true _types.query_dsl.ScriptScoreFunction: required: - script type: object properties: script: allOf: - $ref: '#/components/schemas/_types.Script' description: A script that computes a score. x-model: true _types.Script: type: object properties: source: allOf: - $ref: '#/components/schemas/_types.ScriptSource' description: The script source. id: allOf: - $ref: '#/components/schemas/_types.Id' description: The `id` for a stored script. params: type: object additionalProperties: type: object description: "Specifies any named parameters that are passed into the script as variables.\nUse parameters instead of hard-coded values to decrease compile time." lang: allOf: - $ref: '#/components/schemas/_types.ScriptLanguage' description: "Specifies the language the script is written in.\n\nSupported values include:\n - `painless`: Painless scripting language, purpose-built for Elasticsearch.\n - `expression`: Lucene’s expressions language, compiles a JavaScript expression to bytecode.\n - `mustache`: Mustache templated, used for templates.\n - `java`: Expert Java API\n\n" default: painless options: type: object additionalProperties: type: string _types.ScriptSource: oneOf: - type: string - $ref: '#/components/schemas/_global.search._types.SearchRequestBody' _types.ScriptLanguage: anyOf: - enum: - painless - expression - mustache - java type: string - type: string _types.query_dsl.FunctionScoreMode: enum: - multiply - sum - avg - first - max - min type: string _types.query_dsl.FuzzyQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - value type: object properties: max_expansions: type: number description: Maximum number of variations created. default: 50 prefix_length: type: number description: Number of beginning characters left unchanged when creating expansions. default: 0 rewrite: allOf: - $ref: '#/components/schemas/_types.MultiTermQueryRewrite' description: Number of beginning characters left unchanged when creating expansions. default: constant_score transpositions: type: boolean description: Indicates whether edits include transpositions of two adjacent characters (for example `ab` to `ba`). default: true fuzziness: allOf: - $ref: '#/components/schemas/_types.Fuzziness' description: Maximum edit distance allowed for matching. value: type: - boolean - number - string description: Term you wish to find in the provided field. x-model: true _types.MultiTermQueryRewrite: type: string _types.Fuzziness: type: - number - string _types.query_dsl.GeoBoundingBoxQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - type: object properties: type: allOf: - $ref: '#/components/schemas/_types.query_dsl.GeoExecution' deprecated: true validation_method: allOf: - $ref: '#/components/schemas/_types.query_dsl.GeoValidationMethod' description: "Set to `IGNORE_MALFORMED` to accept geo points with invalid latitude or longitude.\nSet to `COERCE` to also try to infer correct latitude or longitude.\n\nSupported values include:\n - `coerce`: Accept geo points with invalid latitude or longitude and additionally try and infer correct coordinates.\n - `ignore_malformed`: Accept geo points with invalid latitude or longitude.\n - `strict`\n\n" default: '''strict''' ignore_unmapped: type: boolean description: "Set to `true` to ignore an unmapped field and not match any documents for this query.\nSet to `false` to throw an exception if the field is not mapped." default: false x-model: true _types.query_dsl.GeoExecution: enum: - memory - indexed type: string _types.query_dsl.GeoValidationMethod: enum: - coerce - ignore_malformed - strict type: string _types.query_dsl.GeoDistanceQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - distance type: object properties: distance: allOf: - $ref: '#/components/schemas/_types.Distance' description: "The radius of the circle centred on the specified location.\nPoints which fall into this circle are considered to be matches." distance_type: allOf: - $ref: '#/components/schemas/_types.GeoDistanceType' description: "How to compute the distance.\nSet to `plane` for a faster calculation that's inaccurate on long distances and close to the poles.\n\nSupported values include:\n - `arc`: The `arc` calculation is the most accurate.\n - `plane`: The `plane` calculation is faster but less accurate.\n\n" default: '''arc''' validation_method: allOf: - $ref: '#/components/schemas/_types.query_dsl.GeoValidationMethod' description: "Set to `IGNORE_MALFORMED` to accept geo points with invalid latitude or longitude.\nSet to `COERCE` to also try to infer correct latitude or longitude.\n\nSupported values include:\n - `coerce`: Accept geo points with invalid latitude or longitude and additionally try and infer correct coordinates.\n - `ignore_malformed`: Accept geo points with invalid latitude or longitude.\n - `strict`\n\n" default: '''strict''' ignore_unmapped: type: boolean description: "Set to `true` to ignore an unmapped field and not match any documents for this query.\nSet to `false` to throw an exception if the field is not mapped." default: false x-model: true _types.GeoDistanceType: enum: - arc - plane type: string _types.query_dsl.GeoGridQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - maxProperties: 1 minProperties: 1 type: object properties: geotile: allOf: - $ref: '#/components/schemas/_types.GeoTile' geohash: allOf: - $ref: '#/components/schemas/_types.GeoHash' geohex: allOf: - $ref: '#/components/schemas/_types.GeoHexCell' _types.query_dsl.GeoPolygonQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - type: object properties: validation_method: allOf: - $ref: '#/components/schemas/_types.query_dsl.GeoValidationMethod' description: "\n\nSupported values include:\n - `coerce`: Accept geo points with invalid latitude or longitude and additionally try and infer correct coordinates.\n - `ignore_malformed`: Accept geo points with invalid latitude or longitude.\n - `strict`\n\n" default: '''strict''' ignore_unmapped: type: boolean x-model: true _types.query_dsl.GeoShapeQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - type: object properties: ignore_unmapped: type: boolean description: "Set to `true` to ignore an unmapped field and not match any documents for this query.\nSet to `false` to throw an exception if the field is not mapped." default: false x-model: true _types.query_dsl.HasChildQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - query - type type: object properties: ignore_unmapped: type: boolean description: Indicates whether to ignore an unmapped `type` and not return any documents instead of an error. default: false inner_hits: allOf: - $ref: '#/components/schemas/_global.search._types.InnerHits' description: 'If defined, each search hit will contain inner hits.' externalDocs: url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/retrieve-inner-hits max_children: type: number description: "Maximum number of child documents that match the query allowed for a returned parent document.\nIf the parent document exceeds this limit, it is excluded from the search results." min_children: type: number description: "Minimum number of child documents that match the query required to match the query for a returned parent document.\nIf the parent document does not meet this limit, it is excluded from the search results." query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: "Query you wish to run on child documents of the `type` field.\nIf a child document matches the search, the query returns the parent document." score_mode: allOf: - $ref: '#/components/schemas/_types.query_dsl.ChildScoreMode' description: Indicates how scores for matching child documents affect the root parent document’s relevance score. default: '''none''' type: allOf: - $ref: '#/components/schemas/_types.RelationName' description: Name of the child relationship mapped for the `join` field. x-model: true _global.search._types.InnerHits: type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' description: "The name for the particular inner hit definition in the response.\nUseful when a search request contains multiple inner hits." size: type: number description: The maximum number of hits to return per `inner_hits`. default: 3 from: type: number description: Inner hit starting document offset. default: 0 collapse: allOf: - $ref: '#/components/schemas/_global.search._types.FieldCollapse' docvalue_fields: type: array items: $ref: '#/components/schemas/_types.query_dsl.FieldAndFormat' explain: type: boolean highlight: allOf: - $ref: '#/components/schemas/_global.search._types.Highlight' ignore_unmapped: type: boolean script_fields: type: object additionalProperties: $ref: '#/components/schemas/_types.ScriptField' seq_no_primary_term: type: boolean field: type: array items: $ref: '#/components/schemas/_types.Field' fields: type: array items: $ref: '#/components/schemas/_types.query_dsl.FieldAndFormat' sort: allOf: - $ref: '#/components/schemas/_types.Sort' description: "How the inner hits should be sorted per `inner_hits`.\nBy default, inner hits are sorted by score." _source: allOf: - $ref: '#/components/schemas/_global.search._types.SourceConfig' stored_fields: allOf: - $ref: '#/components/schemas/_types.Fields' track_scores: type: boolean default: false version: type: boolean _types.Name: type: string _global.search._types.FieldCollapse: required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field to collapse the result set on inner_hits: oneOf: - $ref: '#/components/schemas/_global.search._types.InnerHits' - type: array items: $ref: '#/components/schemas/_global.search._types.InnerHits' description: The number of inner hits and their sort order max_concurrent_group_searches: type: number description: The number of concurrent requests allowed to retrieve the inner_hits per group externalDocs: url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/collapse-search-results x-model: true _types.query_dsl.FieldAndFormat: required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: A wildcard pattern. The request returns values for field names matching this pattern. format: type: string description: The format in which the values are returned. include_unmapped: type: boolean description: A reference to a field with formatting instructions on how to return the value _global.search._types.Highlight: allOf: - $ref: '#/components/schemas/_global.search._types.HighlightBase' - required: - fields type: object properties: encoder: allOf: - $ref: '#/components/schemas/_global.search._types.HighlighterEncoder' fields: oneOf: - maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_global.search._types.HighlightField' - type: array items: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_global.search._types.HighlightField' _global.search._types.HighlighterEncoder: enum: - default - html type: string _global.search._types.HighlightField: allOf: - $ref: '#/components/schemas/_global.search._types.HighlightBase' - type: object properties: fragment_offset: type: number matched_fields: allOf: - $ref: '#/components/schemas/_types.Fields' _types.Fields: oneOf: - $ref: '#/components/schemas/_types.Field' - type: array items: $ref: '#/components/schemas/_types.Field' _global.search._types.HighlightBase: type: object properties: type: allOf: - $ref: '#/components/schemas/_global.search._types.HighlighterType' description: "\n\nSupported values include:\n - `plain`: The `plain` highlighter uses the standard Lucene highlighter\n - `fvh`: The fvh highlighter uses the Lucene Fast Vector highlighter.\n - `unified`: The unified highlighter uses the Lucene Unified Highlighter.\n\n" boundary_chars: type: string description: A string that contains each boundary character. default: '.,!? \t\n' boundary_max_scan: type: number description: How far to scan for boundary characters. default: 20 boundary_scanner: allOf: - $ref: '#/components/schemas/_global.search._types.BoundaryScanner' description: "Specifies how to break the highlighted fragments: chars, sentence, or word.\nOnly valid for the unified and fvh highlighters.\nDefaults to `sentence` for the `unified` highlighter. Defaults to `chars` for the `fvh` highlighter.\n\nSupported values include:\n - `chars`: Use the characters specified by `boundary_chars` as highlighting boundaries.\nThe `boundary_max_scan` setting controls how far to scan for boundary characters.\nOnly valid for the `fvh` highlighter.\n - `sentence`: Break highlighted fragments at the next sentence boundary, as determined by Java’s `BreakIterator`.\nYou can specify the locale to use with `boundary_scanner_locale`.\nWhen used with the `unified` highlighter, the `sentence` scanner splits sentences bigger than `fragment_size` at the first word boundary next to fragment_size.\nYou can set `fragment_size` to `0` to never split any sentence.\n - `word`: Break highlighted fragments at the next word boundary, as determined by Java’s `BreakIterator`.\nYou can specify the locale to use with `boundary_scanner_locale`.\n\n" boundary_scanner_locale: type: string description: "Controls which locale is used to search for sentence and word boundaries.\nThis parameter takes a form of a language tag, for example: `\"en-US\"`, `\"fr-FR\"`, `\"ja-JP\"`." default: Locale.ROOT force_source: type: boolean deprecated: true fragmenter: allOf: - $ref: '#/components/schemas/_global.search._types.HighlighterFragmenter' description: "Specifies how text should be broken up in highlight snippets: `simple` or `span`.\nOnly valid for the `plain` highlighter." default: span fragment_size: type: number description: The size of the highlighted fragment in characters. default: 100 highlight_filter: type: boolean highlight_query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: "Highlight matches for a query other than the search query.\nThis is especially useful if you use a rescore query because those are not taken into account by highlighting by default." max_fragment_length: type: number max_analyzed_offset: type: number description: "If set to a non-negative value, highlighting stops at this defined maximum limit.\nThe rest of the text is not processed, thus not highlighted and no error is returned\nThe `max_analyzed_offset` query setting does not override the `index.highlight.max_analyzed_offset` setting, which prevails when it’s set to lower value than the query setting." no_match_size: type: number description: The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight. default: 0 number_of_fragments: type: number description: "The maximum number of fragments to return.\nIf the number of fragments is set to `0`, no fragments are returned.\nInstead, the entire field contents are highlighted and returned.\nThis can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required.\nIf `number_of_fragments` is `0`, `fragment_size` is ignored." default: 5 options: type: object additionalProperties: type: object order: allOf: - $ref: '#/components/schemas/_global.search._types.HighlighterOrder' description: "Sorts highlighted fragments by score when set to `score`.\nBy default, fragments will be output in the order they appear in the field (order: `none`).\nSetting this option to `score` will output the most relevant fragments first.\nEach highlighter applies its own logic to compute relevancy scores." default: none phrase_limit: type: number description: "Controls the number of matching phrases in a document that are considered.\nPrevents the `fvh` highlighter from analyzing too many phrases and consuming too much memory.\nWhen using `matched_fields`, `phrase_limit` phrases per matched field are considered. Raising the limit increases query time and consumes more memory.\nOnly supported by the `fvh` highlighter." default: 256 post_tags: type: array items: type: string description: "Use in conjunction with `pre_tags` to define the HTML tags to use for the highlighted text.\nBy default, highlighted text is wrapped in `` and `` tags." pre_tags: type: array items: type: string description: "Use in conjunction with `post_tags` to define the HTML tags to use for the highlighted text.\nBy default, highlighted text is wrapped in `` and `` tags." require_field_match: type: boolean description: "By default, only fields that contains a query match are highlighted.\nSet to `false` to highlight all fields." default: true tags_schema: allOf: - $ref: '#/components/schemas/_global.search._types.HighlighterTagsSchema' description: Set to `styled` to use the built-in tag schema. _global.search._types.HighlighterType: anyOf: - enum: - plain - fvh - unified type: string - type: string _global.search._types.BoundaryScanner: enum: - chars - sentence - word type: string _global.search._types.HighlighterFragmenter: enum: - simple - span type: string _global.search._types.HighlighterOrder: enum: - score type: string _global.search._types.HighlighterTagsSchema: enum: - styled type: string _types.ScriptField: required: - script type: object properties: script: allOf: - $ref: '#/components/schemas/_types.Script' ignore_failure: type: boolean _types.Sort: oneOf: - $ref: '#/components/schemas/_types.SortCombinations' - type: array items: $ref: '#/components/schemas/_types.SortCombinations' _types.SortCombinations: oneOf: - $ref: '#/components/schemas/_types.Field' - $ref: '#/components/schemas/_types.SortOptions' _types.SortOptions: maxProperties: 1 minProperties: 1 type: object properties: _score: allOf: - $ref: '#/components/schemas/_types.ScoreSort' _doc: allOf: - $ref: '#/components/schemas/_types.ScoreSort' _geo_distance: allOf: - $ref: '#/components/schemas/_types.GeoDistanceSort' _script: allOf: - $ref: '#/components/schemas/_types.ScriptSort' _types.ScoreSort: type: object properties: order: allOf: - $ref: '#/components/schemas/_types.SortOrder' description: "\n\nSupported values include:\n - `asc`: Ascending (smallest to largest)\n - `desc`: Descending (largest to smallest)\n\n" _types.SortOrder: enum: - asc - desc type: string _types.GeoDistanceSort: type: object properties: mode: allOf: - $ref: '#/components/schemas/_types.SortMode' distance_type: allOf: - $ref: '#/components/schemas/_types.GeoDistanceType' description: "\n\nSupported values include:\n - `arc`: The `arc` calculation is the most accurate.\n - `plane`: The `plane` calculation is faster but less accurate.\n\n" ignore_unmapped: type: boolean order: allOf: - $ref: '#/components/schemas/_types.SortOrder' description: "\n\nSupported values include:\n - `asc`: Ascending (smallest to largest)\n - `desc`: Descending (largest to smallest)\n\n" unit: allOf: - $ref: '#/components/schemas/_types.DistanceUnit' nested: allOf: - $ref: '#/components/schemas/_types.NestedSortValue' _types.SortMode: enum: - min - max - sum - avg - median type: string _types.DistanceUnit: enum: - in - ft - yd - mi - nmi - km - m - cm - mm type: string _types.NestedSortValue: required: - path type: object properties: filter: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' max_children: type: number nested: allOf: - $ref: '#/components/schemas/_types.NestedSortValue' path: allOf: - $ref: '#/components/schemas/_types.Field' _types.ScriptSort: required: - script type: object properties: order: allOf: - $ref: '#/components/schemas/_types.SortOrder' description: "\n\nSupported values include:\n - `asc`: Ascending (smallest to largest)\n - `desc`: Descending (largest to smallest)\n\n" script: allOf: - $ref: '#/components/schemas/_types.Script' type: allOf: - $ref: '#/components/schemas/_types.ScriptSortType' mode: allOf: - $ref: '#/components/schemas/_types.SortMode' nested: allOf: - $ref: '#/components/schemas/_types.NestedSortValue' _types.ScriptSortType: enum: - string - number - version type: string _global.search._types.SourceConfig: oneOf: - type: boolean - $ref: '#/components/schemas/_global.search._types.SourceFilter' description: 'Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.' _global.search._types.SourceFilter: type: object properties: exclude_vectors: type: boolean description: "If `true`, vector fields are excluded from the returned source.\n\nThis option takes precedence over `includes`: any vector field will\nremain excluded even if it matches an `includes` rule." excludes: allOf: - $ref: '#/components/schemas/_types.Fields' description: A list of fields to exclude from the returned source. includes: allOf: - $ref: '#/components/schemas/_types.Fields' description: A list of fields to include in the returned source. _types.query_dsl.ChildScoreMode: enum: - none - avg - sum - max - min type: string _types.RelationName: type: string _types.query_dsl.HasParentQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - parent_type - query type: object properties: ignore_unmapped: type: boolean description: "Indicates whether to ignore an unmapped `parent_type` and not return any documents instead of an error.\nYou can use this parameter to query multiple indices that may not contain the `parent_type`." default: false inner_hits: allOf: - $ref: '#/components/schemas/_global.search._types.InnerHits' description: 'If defined, each search hit will contain inner hits.' externalDocs: url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/retrieve-inner-hits parent_type: allOf: - $ref: '#/components/schemas/_types.RelationName' description: Name of the parent relationship mapped for the `join` field. query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: "Query you wish to run on parent documents of the `parent_type` field.\nIf a parent document matches the search, the query returns its child documents." score: type: boolean description: Indicates whether the relevance score of a matching parent document is aggregated into its child documents. default: false x-model: true _types.query_dsl.IdsQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - type: object properties: values: allOf: - $ref: '#/components/schemas/_types.Ids' description: An array of document IDs. x-model: true _types.Ids: oneOf: - $ref: '#/components/schemas/_types.Id' - type: array items: $ref: '#/components/schemas/_types.Id' _types.query_dsl.IntervalsQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - maxProperties: 1 minProperties: 1 type: object properties: all_of: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsAllOf' description: Returns matches that span a combination of other rules. any_of: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsAnyOf' description: Returns intervals produced by any of its sub-rules. fuzzy: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsFuzzy' description: 'Matches terms that are similar to the provided term, within an edit distance defined by `fuzziness`.' match: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsMatch' description: Matches analyzed text. prefix: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsPrefix' description: Matches terms that start with a specified set of characters. range: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsRange' regexp: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsRegexp' wildcard: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsWildcard' description: Matches terms using a wildcard pattern. externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-intervals-query x-model: true _types.query_dsl.IntervalsAllOf: required: - intervals type: object properties: intervals: type: array items: $ref: '#/components/schemas/_types.query_dsl.IntervalsContainer' description: An array of rules to combine. All rules must produce a match in a document for the overall source to match. max_gaps: type: number description: "Maximum number of positions between the matching terms.\nIntervals produced by the rules further apart than this are not considered matches." default: -1 ordered: type: boolean description: 'If `true`, intervals produced by the rules should appear in the order in which they are specified.' default: false filter: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsFilter' description: Rule used to filter returned intervals. x-model: true _types.query_dsl.IntervalsContainer: maxProperties: 1 minProperties: 1 type: object properties: all_of: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsAllOf' description: Returns matches that span a combination of other rules. any_of: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsAnyOf' description: Returns intervals produced by any of its sub-rules. fuzzy: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsFuzzy' description: Matches analyzed text. match: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsMatch' description: Matches analyzed text. prefix: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsPrefix' description: Matches terms that start with a specified set of characters. range: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsRange' regexp: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsRegexp' wildcard: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsWildcard' description: Matches terms using a wildcard pattern. x-model: true _types.query_dsl.IntervalsAnyOf: required: - intervals type: object properties: intervals: type: array items: $ref: '#/components/schemas/_types.query_dsl.IntervalsContainer' description: An array of rules to match. filter: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsFilter' description: Rule used to filter returned intervals. x-model: true _types.query_dsl.IntervalsFilter: maxProperties: 1 minProperties: 1 type: object properties: after: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsContainer' description: Query used to return intervals that follow an interval from the `filter` rule. before: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsContainer' description: Query used to return intervals that occur before an interval from the `filter` rule. contained_by: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsContainer' description: Query used to return intervals contained by an interval from the `filter` rule. containing: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsContainer' description: Query used to return intervals that contain an interval from the `filter` rule. not_contained_by: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsContainer' description: Query used to return intervals that are **not** contained by an interval from the `filter` rule. not_containing: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsContainer' description: Query used to return intervals that do **not** contain an interval from the `filter` rule. not_overlapping: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsContainer' description: Query used to return intervals that do **not** overlap with an interval from the `filter` rule. overlapping: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsContainer' description: Query used to return intervals that overlap with an interval from the `filter` rule. script: allOf: - $ref: '#/components/schemas/_types.Script' description: "Script used to return matching documents.\nThis script must return a boolean value: `true` or `false`." x-model: true _types.query_dsl.IntervalsFuzzy: required: - term type: object properties: analyzer: type: string description: Analyzer used to normalize the term. fuzziness: allOf: - $ref: '#/components/schemas/_types.Fuzziness' description: Maximum edit distance allowed for matching. default: auto prefix_length: type: number description: Number of beginning characters left unchanged when creating expansions. default: 0 term: type: string description: The term to match. transpositions: type: boolean description: 'Indicates whether edits include transpositions of two adjacent characters (for example, `ab` to `ba`).' default: true use_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "If specified, match intervals from this field rather than the top-level field.\nThe `term` is normalized using the search analyzer from this field, unless `analyzer` is specified separately." x-model: true _types.query_dsl.IntervalsMatch: required: - query type: object properties: analyzer: type: string description: Analyzer used to analyze terms in the query. max_gaps: type: number description: "Maximum number of positions between the matching terms.\nTerms further apart than this are not considered matches." default: -1 ordered: type: boolean description: 'If `true`, matching terms must appear in their specified order.' default: false query: type: string description: Text you wish to find in the provided field. use_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "If specified, match intervals from this field rather than the top-level field.\nThe `term` is normalized using the search analyzer from this field, unless `analyzer` is specified separately." filter: allOf: - $ref: '#/components/schemas/_types.query_dsl.IntervalsFilter' description: An optional interval filter. x-model: true _types.query_dsl.IntervalsPrefix: required: - prefix type: object properties: analyzer: type: string description: Analyzer used to analyze the `prefix`. prefix: type: string description: Beginning characters of terms you wish to find in the top-level field. use_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "If specified, match intervals from this field rather than the top-level field.\nThe `prefix` is normalized using the search analyzer from this field, unless `analyzer` is specified separately." x-model: true _types.query_dsl.IntervalsRange: type: object properties: analyzer: type: string description: Analyzer used to analyze the `prefix`. gte: type: string description: 'Lower term, either gte or gt must be provided.' gt: type: string description: 'Lower term, either gte or gt must be provided.' lte: type: string description: 'Upper term, either lte or lt must be provided.' lt: type: string description: 'Upper term, either lte or lt must be provided.' use_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "If specified, match intervals from this field rather than the top-level field.\nThe `prefix` is normalized using the search analyzer from this field, unless `analyzer` is specified separately." _types.query_dsl.IntervalsRegexp: required: - pattern type: object properties: analyzer: type: string description: Analyzer used to analyze the `prefix`. pattern: type: string description: Regex pattern. use_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "If specified, match intervals from this field rather than the top-level field.\nThe `prefix` is normalized using the search analyzer from this field, unless `analyzer` is specified separately." _types.query_dsl.IntervalsWildcard: required: - pattern type: object properties: analyzer: type: string description: "Analyzer used to analyze the `pattern`.\nDefaults to the top-level field's analyzer." pattern: type: string description: Wildcard pattern used to find matching terms. use_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "If specified, match intervals from this field rather than the top-level field.\nThe `pattern` is normalized using the search analyzer from this field, unless `analyzer` is specified separately." x-model: true _types.KnnQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The name of the vector field to search against query_vector: allOf: - $ref: '#/components/schemas/_types.QueryVector' description: The query vector query_vector_builder: allOf: - $ref: '#/components/schemas/_types.QueryVectorBuilder' description: 'The query vector builder. You must provide a query_vector_builder or query_vector, but not both.' num_candidates: type: number description: The number of nearest neighbor candidates to consider per shard visit_percentage: type: number description: The percentage of vectors to explore per shard while doing knn search with bbq_disk x-state: Generally available; Added in 9.2.0 k: type: number description: The final number of nearest neighbors to return as top hits filter: oneOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' - type: array items: $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: Filters for the kNN search query similarity: type: number description: The minimum similarity for a vector to be considered a match rescore_vector: allOf: - $ref: '#/components/schemas/_types.RescoreVector' description: Apply oversampling and rescoring to quantized vectors x-state: Generally available; Added in 8.18.0 x-model: true _types.RescoreVector: required: - oversample type: object properties: oversample: type: number description: Applies the specified oversample factor to k on the approximate kNN search _types.query_dsl.KqlQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - query type: object properties: case_insensitive: type: boolean description: 'If `true`, performs case-insensitive matching for field names and keyword or text terms.' default: false default_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "Default field, or field pattern with wildcards, to target when a bare term does not specify a field.\nDefaults to the `index.query.default_field` index setting, which has a default value of `*`." query: type: string description: The KQL expression to parse. time_zone: allOf: - $ref: '#/components/schemas/_types.TimeZone' description: Coordinated Universal Time (UTC) offset or IANA time zone used to interpret date literals in the expression. description: "Returns documents matching a provided Kibana Query Language (KQL) expression.\nThe expression is parsed and rewritten into standard Query DSL." _types.TimeZone: type: string _types.query_dsl.MatchQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - query type: object properties: analyzer: type: string description: Analyzer used to convert the text in the query value into tokens. auto_generate_synonyms_phrase_query: type: boolean description: 'If `true`, match phrase queries are automatically created for multi-term synonyms.' default: true cutoff_frequency: type: number deprecated: true fuzziness: allOf: - $ref: '#/components/schemas/_types.Fuzziness' description: Maximum edit distance allowed for matching. fuzzy_rewrite: allOf: - $ref: '#/components/schemas/_types.MultiTermQueryRewrite' description: Method used to rewrite the query. fuzzy_transpositions: type: boolean description: 'If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`).' default: true lenient: type: boolean description: 'If `true`, format-based errors, such as providing a text query value for a numeric field, are ignored.' default: false max_expansions: type: number description: Maximum number of terms to which the query will expand. default: 50 minimum_should_match: allOf: - $ref: '#/components/schemas/_types.MinimumShouldMatch' description: Minimum number of clauses that must match for a document to be returned. operator: allOf: - $ref: '#/components/schemas/_types.query_dsl.Operator' description: Boolean logic used to interpret text in the query value. default: '''or''' prefix_length: type: number description: Number of beginning characters left unchanged for fuzzy matching. default: 0 query: type: - boolean - number - string description: 'Text, number, boolean value or date you wish to find in the provided field.' zero_terms_query: allOf: - $ref: '#/components/schemas/_types.query_dsl.ZeroTermsQuery' description: "Indicates whether no documents are returned if the `analyzer` removes all tokens, such as when using a `stop` filter.\n\nSupported values include:\n - `all`: Returns all documents, similar to a `match_all` query.\n - `none`: No documents are returned if the `analyzer` removes all tokens.\n\n" default: '''none''' x-model: true _types.query_dsl.ZeroTermsQuery: enum: - all - none type: string _types.query_dsl.MatchAllQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - type: object x-model: true _types.query_dsl.MatchBoolPrefixQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - query type: object properties: analyzer: type: string description: Analyzer used to convert the text in the query value into tokens. fuzziness: allOf: - $ref: '#/components/schemas/_types.Fuzziness' description: "Maximum edit distance allowed for matching.\nCan be applied to the term subqueries constructed for all terms but the final term." fuzzy_rewrite: allOf: - $ref: '#/components/schemas/_types.MultiTermQueryRewrite' description: "Method used to rewrite the query.\nCan be applied to the term subqueries constructed for all terms but the final term." fuzzy_transpositions: type: boolean description: "If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`).\nCan be applied to the term subqueries constructed for all terms but the final term." default: true max_expansions: type: number description: "Maximum number of terms to which the query will expand.\nCan be applied to the term subqueries constructed for all terms but the final term." default: 50 minimum_should_match: allOf: - $ref: '#/components/schemas/_types.MinimumShouldMatch' description: "Minimum number of clauses that must match for a document to be returned.\nApplied to the constructed bool query." operator: allOf: - $ref: '#/components/schemas/_types.query_dsl.Operator' description: "Boolean logic used to interpret text in the query value.\nApplied to the constructed bool query." default: '''or''' prefix_length: type: number description: "Number of beginning characters left unchanged for fuzzy matching.\nCan be applied to the term subqueries constructed for all terms but the final term." default: 0 query: type: string description: "Terms you wish to find in the provided field.\nThe last term is used in a prefix query." x-model: true _types.query_dsl.MatchNoneQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - type: object x-model: true _types.query_dsl.MatchPhraseQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - query type: object properties: analyzer: type: string description: Analyzer used to convert the text in the query value into tokens. query: type: string description: Query terms that are analyzed and turned into a phrase query. slop: type: number description: Maximum number of positions allowed between matching tokens. default: 0 zero_terms_query: allOf: - $ref: '#/components/schemas/_types.query_dsl.ZeroTermsQuery' description: "Indicates whether no documents are returned if the `analyzer` removes all tokens, such as when using a `stop` filter.\n\nSupported values include:\n - `all`: Returns all documents, similar to a `match_all` query.\n - `none`: No documents are returned if the `analyzer` removes all tokens.\n\n" default: '''none''' x-model: true _types.query_dsl.MatchPhrasePrefixQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - query type: object properties: analyzer: type: string description: Analyzer used to convert text in the query value into tokens. max_expansions: type: number description: Maximum number of terms to which the last provided term of the query value will expand. default: 50 query: type: string description: Text you wish to find in the provided field. slop: type: number description: Maximum number of positions allowed between matching tokens. default: 0 zero_terms_query: allOf: - $ref: '#/components/schemas/_types.query_dsl.ZeroTermsQuery' description: "Indicates whether no documents are returned if the analyzer removes all tokens, such as when using a `stop` filter.\n\nSupported values include:\n - `all`: Returns all documents, similar to a `match_all` query.\n - `none`: No documents are returned if the `analyzer` removes all tokens.\n\n" default: none x-model: true _types.query_dsl.MoreLikeThisQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - like type: object properties: analyzer: type: string description: "The analyzer that is used to analyze the free form text.\nDefaults to the analyzer associated with the first field in fields." externalDocs: url: https://www.elastic.co/docs/manage-data/data-store/text-analysis boost_terms: type: number description: "Each term in the formed query could be further boosted by their tf-idf score.\nThis sets the boost factor to use when using this feature.\nDefaults to deactivated (0)." default: 0 fail_on_unsupported_field: type: boolean description: Controls whether the query should fail (throw an exception) if any of the specified fields are not of the supported types (`text` or `keyword`). default: true fields: type: array items: $ref: '#/components/schemas/_types.Field' description: "A list of fields to fetch and analyze the text from.\nDefaults to the `index.query.default_field` index setting, which has a default value of `*`." include: type: boolean description: Specifies whether the input documents should also be included in the search results returned. default: false like: oneOf: - $ref: '#/components/schemas/_types.query_dsl.Like' - type: array items: $ref: '#/components/schemas/_types.query_dsl.Like' description: Specifies free form text and/or a single or multiple documents for which you want to find similar documents. max_doc_freq: type: number description: The maximum document frequency above which the terms are ignored from the input document. max_query_terms: type: number description: The maximum number of query terms that can be selected. default: 25 max_word_length: type: number description: "The maximum word length above which the terms are ignored.\nDefaults to unbounded (`0`)." default: 0 min_doc_freq: type: number description: The minimum document frequency below which the terms are ignored from the input document. default: 5 minimum_should_match: allOf: - $ref: '#/components/schemas/_types.MinimumShouldMatch' description: 'After the disjunctive query has been formed, this parameter controls the number of terms that must match.' min_term_freq: type: number description: The minimum term frequency below which the terms are ignored from the input document. default: 2 min_word_length: type: number description: The minimum word length below which the terms are ignored. default: 0 routing: type: string stop_words: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' description: "An array of stop words.\nAny word in this set is ignored." unlike: oneOf: - $ref: '#/components/schemas/_types.query_dsl.Like' - type: array items: $ref: '#/components/schemas/_types.query_dsl.Like' description: Used in combination with `like` to exclude documents that match a set of terms. version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' version_type: allOf: - $ref: '#/components/schemas/_types.VersionType' description: "\n\nSupported values include:\n - `internal`: Use internal versioning that starts at 1 and increments with each update or delete.\n - `external`: Only index the document if the specified version is strictly higher than the version of the stored document or if there is no existing document.\n - `external_gte`: Only index the document if the specified version is equal or higher than the version of the stored document or if there is no existing document.\nNOTE: The `external_gte` version type is meant for special use cases and should be used with care.\nIf used incorrectly, it can result in loss of data.\n\n" default: '''internal''' x-model: true _types.query_dsl.Like: oneOf: - type: string - $ref: '#/components/schemas/_types.query_dsl.LikeDocument' description: Text that we want similar documents for or a lookup to a document's field for the text. _types.query_dsl.LikeDocument: type: object properties: doc: type: object description: A document not present in the index. fields: type: array items: $ref: '#/components/schemas/_types.Field' _id: allOf: - $ref: '#/components/schemas/_types.Id' description: ID of a document. _index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: Index of a document. per_field_analyzer: type: object additionalProperties: type: string description: Overrides the default analyzer. routing: allOf: - $ref: '#/components/schemas/_types.Routing' version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' version_type: allOf: - $ref: '#/components/schemas/_types.VersionType' description: "\n\nSupported values include:\n - `internal`: Use internal versioning that starts at 1 and increments with each update or delete.\n - `external`: Only index the document if the specified version is strictly higher than the version of the stored document or if there is no existing document.\n - `external_gte`: Only index the document if the specified version is equal or higher than the version of the stored document or if there is no existing document.\nNOTE: The `external_gte` version type is meant for special use cases and should be used with care.\nIf used incorrectly, it can result in loss of data.\n\n" default: '''internal''' x-model: true _types.Routing: oneOf: - type: string - type: array items: type: string description: 'Only to be used in query and path parameters, as the array form is actually a csv' _types.VersionType: enum: - internal - external - external_gte type: string _types.analysis.StopWords: oneOf: - $ref: '#/components/schemas/_types.analysis.StopWordLanguage' - type: array items: type: string description: "Language value, such as _arabic_ or _thai_. Defaults to _english_.\nEach 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.\nAlso accepts an array of stop words." _types.analysis.StopWordLanguage: enum: - _arabic_ - _armenian_ - _basque_ - _bengali_ - _brazilian_ - _bulgarian_ - _catalan_ - _cjk_ - _czech_ - _danish_ - _dutch_ - _english_ - _estonian_ - _finnish_ - _french_ - _galician_ - _german_ - _greek_ - _hindi_ - _hungarian_ - _indonesian_ - _irish_ - _italian_ - _latvian_ - _lithuanian_ - _norwegian_ - _persian_ - _portuguese_ - _romanian_ - _russian_ - _serbian_ - _sorani_ - _spanish_ - _swedish_ - _thai_ - _turkish_ - _none_ type: string _types.query_dsl.MultiMatchQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - query type: object properties: analyzer: type: string description: Analyzer used to convert the text in the query value into tokens. auto_generate_synonyms_phrase_query: type: boolean description: 'If `true`, match phrase queries are automatically created for multi-term synonyms.' default: true cutoff_frequency: type: number deprecated: true fields: allOf: - $ref: '#/components/schemas/_types.Fields' description: "The fields to be queried.\nDefaults to the `index.query.default_field` index settings, which in turn defaults to `*`." fuzziness: allOf: - $ref: '#/components/schemas/_types.Fuzziness' description: Maximum edit distance allowed for matching. fuzzy_rewrite: allOf: - $ref: '#/components/schemas/_types.MultiTermQueryRewrite' description: Method used to rewrite the query. fuzzy_transpositions: type: boolean description: "If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`).\nCan be applied to the term subqueries constructed for all terms but the final term." default: true lenient: type: boolean description: 'If `true`, format-based errors, such as providing a text query value for a numeric field, are ignored.' default: false max_expansions: type: number description: Maximum number of terms to which the query will expand. default: 50 minimum_should_match: allOf: - $ref: '#/components/schemas/_types.MinimumShouldMatch' description: Minimum number of clauses that must match for a document to be returned. operator: allOf: - $ref: '#/components/schemas/_types.query_dsl.Operator' description: Boolean logic used to interpret text in the query value. default: '''or''' prefix_length: type: number description: Number of beginning characters left unchanged for fuzzy matching. default: 0 query: type: string description: 'Text, number, boolean value or date you wish to find in the provided field.' slop: type: number description: Maximum number of positions allowed between matching tokens. default: 0 tie_breaker: type: number description: Determines how scores for each per-term blended query and scores across groups are combined. default: 0 type: allOf: - $ref: '#/components/schemas/_types.query_dsl.TextQueryType' description: "How `the` multi_match query is executed internally.\n\nSupported values include:\n - `best_fields`: Finds documents that match any field, but uses the `_score` from the best field.\n - `most_fields`: Finds documents that match any field and combines the `_score` from each field.\n - `cross_fields`: Treats fields with the same analyzer as though they were one big field.\nLooks for each word in any field.\n - `phrase`: Runs a `match_phrase` query on each field and uses the `_score` from the best field.\n - `phrase_prefix`: Runs a `match_phrase_prefix` query on each field and uses the `_score` from the best field.\n - `bool_prefix`: Creates a `match_bool_prefix` query on each field and combines the `_score` from each field.\n\n" default: '''best_fields''' zero_terms_query: allOf: - $ref: '#/components/schemas/_types.query_dsl.ZeroTermsQuery' description: "Indicates whether no documents are returned if the `analyzer` removes all tokens, such as when using a `stop` filter.\n\nSupported values include:\n - `all`: Returns all documents, similar to a `match_all` query.\n - `none`: No documents are returned if the `analyzer` removes all tokens.\n\n" default: '''none''' x-model: true _types.query_dsl.TextQueryType: enum: - best_fields - most_fields - cross_fields - phrase - phrase_prefix - bool_prefix type: string _types.query_dsl.NestedQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - path - query type: object properties: ignore_unmapped: type: boolean description: Indicates whether to ignore an unmapped path and not return any documents instead of an error. default: false inner_hits: allOf: - $ref: '#/components/schemas/_global.search._types.InnerHits' description: 'If defined, each search hit will contain inner hits.' externalDocs: url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/retrieve-inner-hits path: allOf: - $ref: '#/components/schemas/_types.Field' description: Path to the nested object you wish to search. query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: Query you wish to run on nested objects in the path. score_mode: allOf: - $ref: '#/components/schemas/_types.query_dsl.ChildScoreMode' description: How scores for matching child objects affect the root parent document’s relevance score. default: '''avg''' x-model: true _types.query_dsl.ParentIdQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: ID of the parent document. ignore_unmapped: type: boolean description: Indicates whether to ignore an unmapped `type` and not return any documents instead of an error. default: false type: allOf: - $ref: '#/components/schemas/_types.RelationName' description: Name of the child relationship mapped for the `join` field. x-model: true _types.query_dsl.PercolateQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - field type: object properties: document: type: object description: The source of the document being percolated. documents: type: array items: type: object description: An array of sources of the documents being percolated. field: allOf: - $ref: '#/components/schemas/_types.Field' description: Field that holds the indexed queries. The field must use the `percolator` mapping type. id: allOf: - $ref: '#/components/schemas/_types.Id' description: The ID of a stored document to percolate. index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: The index of a stored document to percolate. name: type: string description: The suffix used for the `_percolator_document_slot` field when multiple `percolate` queries are specified. preference: type: string description: Preference used to fetch document to percolate. routing: type: string description: Routing used to fetch document to percolate. version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' description: The expected version of a stored document to percolate. x-model: true _types.query_dsl.PinnedQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - allOf: - required: - organic type: object properties: organic: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: Any choice of query used to rank documents which will be ranked below the "pinned" documents. - maxProperties: 1 minProperties: 1 type: object properties: ids: type: array items: $ref: '#/components/schemas/_types.Id' description: "Document IDs listed in the order they are to appear in results.\nRequired if `docs` is not specified." docs: type: array items: $ref: '#/components/schemas/_types.query_dsl.PinnedDoc' description: "Documents listed in the order they are to appear in results.\nRequired if `ids` is not specified." externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-pinned-query x-model: true _types.query_dsl.PinnedDoc: required: - _id type: object properties: _id: allOf: - $ref: '#/components/schemas/_types.Id' description: The unique document ID. _index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: The index that contains the document. _types.query_dsl.PrefixQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - value type: object properties: rewrite: allOf: - $ref: '#/components/schemas/_types.MultiTermQueryRewrite' description: Method used to rewrite the query. value: type: string description: Beginning characters of terms you wish to find in the provided field. case_insensitive: type: boolean description: "Allows case insensitive matching of the value with the indexed field values when set to `true`.\nDefault is `false` which means the case sensitivity of matching depends on the underlying field’s mapping." default: false x-state: Generally available; Added in 7.10.0 x-model: true _types.query_dsl.QueryStringQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - query type: object properties: allow_leading_wildcard: type: boolean description: 'If `true`, the wildcard characters `*` and `?` are allowed as the first character of the query string.' default: true analyzer: type: string description: Analyzer used to convert text in the query string into tokens. analyze_wildcard: type: boolean description: 'If `true`, the query attempts to analyze wildcard terms in the query string.' default: false auto_generate_synonyms_phrase_query: type: boolean description: 'If `true`, match phrase queries are automatically created for multi-term synonyms.' default: true default_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "Default field to search if no field is provided in the query string.\nSupports wildcards (`*`).\nDefaults to the `index.query.default_field` index setting, which has a default value of `*`." default_operator: allOf: - $ref: '#/components/schemas/_types.query_dsl.Operator' description: Default boolean logic used to interpret text in the query string if no operators are specified. default: '''or''' enable_position_increments: type: boolean description: 'If `true`, enable position increments in queries constructed from a `query_string` search.' default: true escape: type: boolean default: false fields: type: array items: $ref: '#/components/schemas/_types.Field' description: Array of fields to search. Supports wildcards (`*`). fuzziness: allOf: - $ref: '#/components/schemas/_types.Fuzziness' description: Maximum edit distance allowed for fuzzy matching. fuzzy_max_expansions: type: number description: Maximum number of terms to which the query expands for fuzzy matching. default: 50 fuzzy_prefix_length: type: number description: Number of beginning characters left unchanged for fuzzy matching. default: 0 fuzzy_rewrite: allOf: - $ref: '#/components/schemas/_types.MultiTermQueryRewrite' description: Method used to rewrite the query. fuzzy_transpositions: type: boolean description: 'If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`).' default: true lenient: type: boolean description: 'If `true`, format-based errors, such as providing a text value for a numeric field, are ignored.' default: false max_determinized_states: type: number description: Maximum number of automaton states required for the query. default: 10000 minimum_should_match: allOf: - $ref: '#/components/schemas/_types.MinimumShouldMatch' description: Minimum number of clauses that must match for a document to be returned. phrase_slop: type: number description: Maximum number of positions allowed between matching tokens for phrases. default: 0 query: type: string description: Query string you wish to parse and use for search. quote_analyzer: type: string description: "Analyzer used to convert quoted text in the query string into tokens.\nFor quoted text, this parameter overrides the analyzer specified in the `analyzer` parameter." quote_field_suffix: type: string description: "Suffix appended to quoted text in the query string.\nYou can use this suffix to use a different analysis method for exact matches." rewrite: allOf: - $ref: '#/components/schemas/_types.MultiTermQueryRewrite' description: Method used to rewrite the query. tie_breaker: type: number description: How to combine the queries generated from the individual search terms in the resulting `dis_max` query. time_zone: allOf: - $ref: '#/components/schemas/_types.TimeZone' description: Coordinated Universal Time (UTC) offset or IANA time zone used to convert date values in the query string to UTC. type: allOf: - $ref: '#/components/schemas/_types.query_dsl.TextQueryType' description: "Determines how the query matches and scores documents.\n\nSupported values include:\n - `best_fields`: Finds documents that match any field, but uses the `_score` from the best field.\n - `most_fields`: Finds documents that match any field and combines the `_score` from each field.\n - `cross_fields`: Treats fields with the same analyzer as though they were one big field.\nLooks for each word in any field.\n - `phrase`: Runs a `match_phrase` query on each field and uses the `_score` from the best field.\n - `phrase_prefix`: Runs a `match_phrase_prefix` query on each field and uses the `_score` from the best field.\n - `bool_prefix`: Creates a `match_bool_prefix` query on each field and combines the `_score` from each field.\n\n" default: '''best_fields''' x-model: true _types.query_dsl.RangeQuery: oneOf: - $ref: '#/components/schemas/_types.query_dsl.UntypedRangeQuery' - $ref: '#/components/schemas/_types.query_dsl.DateRangeQuery' - $ref: '#/components/schemas/_types.query_dsl.NumberRangeQuery' - $ref: '#/components/schemas/_types.query_dsl.LongNumberRangeQuery' - $ref: '#/components/schemas/_types.query_dsl.TermRangeQuery' externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-range-query x-model: true _types.query_dsl.UntypedRangeQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.RangeQueryBase' - type: object properties: format: allOf: - $ref: '#/components/schemas/_types.DateFormat' description: Date format used to convert `date` values in the query. time_zone: allOf: - $ref: '#/components/schemas/_types.TimeZone' description: Coordinated Universal Time (UTC) offset or IANA time zone used to convert `date` values in the query to UTC. _types.DateFormat: type: string _types.query_dsl.RangeQueryBase: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - type: object properties: relation: allOf: - $ref: '#/components/schemas/_types.query_dsl.RangeRelation' description: "Indicates how the range query matches values for `range` fields.\n\nSupported values include:\n - `within`: Matches documents with a range field value entirely within the query’s range.\n - `contains`: Matches documents with a range field value that entirely contains the query’s range.\n - `intersects`: Matches documents with a range field value that intersects the query’s range.\n\n" default: intersects gt: type: object description: Greater than. gte: type: object description: Greater than or equal to. lt: type: object description: Less than. lte: type: object description: Less than or equal to. _types.query_dsl.RangeRelation: enum: - within - contains - intersects type: string _types.query_dsl.DateRangeQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.RangeQueryBaseDateMath' - type: object properties: format: allOf: - $ref: '#/components/schemas/_types.DateFormat' description: Date format used to convert `date` values in the query. time_zone: allOf: - $ref: '#/components/schemas/_types.TimeZone' description: Coordinated Universal Time (UTC) offset or IANA time zone used to convert `date` values in the query to UTC. _types.query_dsl.RangeQueryBaseDateMath: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - type: object properties: relation: allOf: - $ref: '#/components/schemas/_types.query_dsl.RangeRelation' description: "Indicates how the range query matches values for `range` fields.\n\nSupported values include:\n - `within`: Matches documents with a range field value entirely within the query’s range.\n - `contains`: Matches documents with a range field value that entirely contains the query’s range.\n - `intersects`: Matches documents with a range field value that intersects the query’s range.\n\n" default: intersects gt: allOf: - $ref: '#/components/schemas/_types.DateMath' description: Greater than. gte: allOf: - $ref: '#/components/schemas/_types.DateMath' description: Greater than or equal to. lt: allOf: - $ref: '#/components/schemas/_types.DateMath' description: Less than. lte: allOf: - $ref: '#/components/schemas/_types.DateMath' description: Less than or equal to. _types.query_dsl.NumberRangeQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.RangeQueryBasedouble' - type: object _types.query_dsl.RangeQueryBasedouble: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - type: object properties: relation: allOf: - $ref: '#/components/schemas/_types.query_dsl.RangeRelation' description: "Indicates how the range query matches values for `range` fields.\n\nSupported values include:\n - `within`: Matches documents with a range field value entirely within the query’s range.\n - `contains`: Matches documents with a range field value that entirely contains the query’s range.\n - `intersects`: Matches documents with a range field value that intersects the query’s range.\n\n" default: intersects gt: type: number description: Greater than. gte: type: number description: Greater than or equal to. lt: type: number description: Less than. lte: type: number description: Less than or equal to. _types.query_dsl.LongNumberRangeQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.RangeQueryBaselong' - type: object _types.query_dsl.RangeQueryBaselong: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - type: object properties: relation: allOf: - $ref: '#/components/schemas/_types.query_dsl.RangeRelation' description: "Indicates how the range query matches values for `range` fields.\n\nSupported values include:\n - `within`: Matches documents with a range field value entirely within the query’s range.\n - `contains`: Matches documents with a range field value that entirely contains the query’s range.\n - `intersects`: Matches documents with a range field value that intersects the query’s range.\n\n" default: intersects gt: type: number description: Greater than. gte: type: number description: Greater than or equal to. lt: type: number description: Less than. lte: type: number description: Less than or equal to. _types.query_dsl.TermRangeQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.RangeQueryBasestring' - type: object _types.query_dsl.RangeQueryBasestring: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - type: object properties: relation: allOf: - $ref: '#/components/schemas/_types.query_dsl.RangeRelation' description: "Indicates how the range query matches values for `range` fields.\n\nSupported values include:\n - `within`: Matches documents with a range field value entirely within the query’s range.\n - `contains`: Matches documents with a range field value that entirely contains the query’s range.\n - `intersects`: Matches documents with a range field value that intersects the query’s range.\n\n" default: intersects gt: type: string description: Greater than. gte: type: string description: Greater than or equal to. lt: type: string description: Less than. lte: type: string description: Less than or equal to. _types.query_dsl.RankFeatureQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: '`rank_feature` or `rank_features` field used to boost relevance scores.' saturation: allOf: - $ref: '#/components/schemas/_types.query_dsl.RankFeatureFunctionSaturation' description: Saturation function used to boost relevance scores based on the value of the rank feature `field`. log: allOf: - $ref: '#/components/schemas/_types.query_dsl.RankFeatureFunctionLogarithm' description: Logarithmic function used to boost relevance scores based on the value of the rank feature `field`. linear: allOf: - $ref: '#/components/schemas/_types.query_dsl.RankFeatureFunctionLinear' description: Linear function used to boost relevance scores based on the value of the rank feature `field`. sigmoid: allOf: - $ref: '#/components/schemas/_types.query_dsl.RankFeatureFunctionSigmoid' description: Sigmoid function used to boost relevance scores based on the value of the rank feature `field`. x-model: true _types.query_dsl.RankFeatureFunctionSaturation: allOf: - $ref: '#/components/schemas/_types.query_dsl.RankFeatureFunction' - type: object properties: pivot: type: number description: Configurable pivot value so that the result will be less than 0.5. _types.query_dsl.RankFeatureFunction: type: object _types.query_dsl.RankFeatureFunctionLogarithm: allOf: - $ref: '#/components/schemas/_types.query_dsl.RankFeatureFunction' - required: - scaling_factor type: object properties: scaling_factor: type: number description: Configurable scaling factor. _types.query_dsl.RankFeatureFunctionLinear: allOf: - $ref: '#/components/schemas/_types.query_dsl.RankFeatureFunction' - type: object _types.query_dsl.RankFeatureFunctionSigmoid: allOf: - $ref: '#/components/schemas/_types.query_dsl.RankFeatureFunction' - required: - pivot - exponent type: object properties: pivot: type: number description: Configurable pivot value so that the result will be less than 0.5. exponent: type: number description: Configurable Exponent. _types.query_dsl.RegexpQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - value type: object properties: case_insensitive: type: boolean description: "Allows case insensitive matching of the regular expression value with the indexed field values when set to `true`.\nWhen `false`, case sensitivity of matching depends on the underlying field’s mapping." default: false x-state: Generally available; Added in 7.10.0 flags: type: string description: Enables optional operators for the regular expression. max_determinized_states: type: number description: Maximum number of automaton states required for the query. default: 10000 rewrite: allOf: - $ref: '#/components/schemas/_types.MultiTermQueryRewrite' description: Method used to rewrite the query. value: type: string description: Regular expression for terms you wish to find in the provided field. x-model: true _types.query_dsl.RuleQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - organic - match_criteria type: object properties: organic: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' ruleset_ids: oneOf: - $ref: '#/components/schemas/_types.Id' - type: array items: $ref: '#/components/schemas/_types.Id' ruleset_id: type: string match_criteria: type: object x-model: true _types.query_dsl.ScriptQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - script type: object properties: script: allOf: - $ref: '#/components/schemas/_types.Script' description: "Contains a script to run as a query.\nThis script must return a boolean value, `true` or `false`." x-model: true _types.query_dsl.ScriptScoreQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - query - script type: object properties: min_score: type: number description: Documents with a score lower than this floating point number are excluded from the search results. query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: Query used to return documents. script: allOf: - $ref: '#/components/schemas/_types.Script' description: "Script used to compute the score of documents returned by the query.\nImportant: final relevance scores from the `script_score` query cannot be negative." x-model: true _types.query_dsl.SemanticQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - field - query type: object properties: field: type: string description: 'The field to query, which must be a semantic_text field type' query: type: string description: The query text x-model: true _types.query_dsl.ShapeQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - type: object properties: ignore_unmapped: type: boolean description: When set to `true` the query ignores an unmapped field and will not match any documents. x-model: true _types.query_dsl.SimpleQueryStringQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - query type: object properties: analyzer: type: string description: Analyzer used to convert text in the query string into tokens. analyze_wildcard: type: boolean description: 'If `true`, the query attempts to analyze wildcard terms in the query string.' default: false auto_generate_synonyms_phrase_query: type: boolean description: 'If `true`, the parser creates a match_phrase query for each multi-position token.' default: true default_operator: allOf: - $ref: '#/components/schemas/_types.query_dsl.Operator' description: Default boolean logic used to interpret text in the query string if no operators are specified. default: '''or''' fields: type: array items: $ref: '#/components/schemas/_types.Field' description: "Array of fields you wish to search.\nAccepts wildcard expressions.\nYou also can boost relevance scores for matches to particular fields using a caret (`^`) notation.\nDefaults to the `index.query.default_field index` setting, which has a default value of `*`." flags: allOf: - $ref: '#/components/schemas/_types.query_dsl.SimpleQueryStringFlags' description: List of enabled operators for the simple query string syntax. default: ALL fuzzy_max_expansions: type: number description: Maximum number of terms to which the query expands for fuzzy matching. default: 50 fuzzy_prefix_length: type: number description: Number of beginning characters left unchanged for fuzzy matching. default: 0 fuzzy_transpositions: type: boolean description: 'If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`).' lenient: type: boolean description: 'If `true`, format-based errors, such as providing a text value for a numeric field, are ignored.' default: false minimum_should_match: allOf: - $ref: '#/components/schemas/_types.MinimumShouldMatch' description: Minimum number of clauses that must match for a document to be returned. query: type: string description: Query string in the simple query string syntax you wish to parse and use for search. quote_field_suffix: type: string description: Suffix appended to quoted text in the query string. x-model: true _types.query_dsl.SimpleQueryStringFlags: allOf: - $ref: '#/components/schemas/_spec_utils.PipeSeparatedFlagsSimpleQueryStringFlag' description: 'Query flags can be either a single flag or a combination of flags, e.g. `OR|AND|PREFIX`' _spec_utils.PipeSeparatedFlagsSimpleQueryStringFlag: oneOf: - $ref: '#/components/schemas/_types.query_dsl.SimpleQueryStringFlag' - type: string description: "A set of flags that can be represented as a single enum value or a set of values that are encoded\nas a pipe-separated string\n\nDepending on the target language, code generators can use this hint to generate language specific\nflags enum constructs and the corresponding (de-)serialization code." _types.query_dsl.SimpleQueryStringFlag: enum: - NONE - AND - NOT - OR - PREFIX - PHRASE - PRECEDENCE - ESCAPE - WHITESPACE - FUZZY - NEAR - SLOP - ALL type: string _types.query_dsl.SpanContainingQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - big - little type: object properties: big: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanQuery' description: "Can be any span query.\nMatching spans from `big` that contain matches from `little` are returned." little: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanQuery' description: "Can be any span query.\nMatching spans from `big` that contain matches from `little` are returned." x-model: true _types.query_dsl.SpanQuery: maxProperties: 1 minProperties: 1 type: object properties: span_containing: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanContainingQuery' description: 'Accepts a list of span queries, but only returns those spans which also match a second span query.' span_field_masking: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanFieldMaskingQuery' description: Allows queries like `span_near` or `span_or` across different fields. span_first: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanFirstQuery' description: Accepts another span query whose matches must appear within the first N positions of the field. span_gap: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanGapQuery' span_multi: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanMultiTermQuery' description: 'Wraps a `term`, `range`, `prefix`, `wildcard`, `regexp`, or `fuzzy` query.' span_near: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanNearQuery' description: 'Accepts multiple span queries whose matches must be within the specified distance of each other, and possibly in the same order.' span_not: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanNotQuery' description: 'Wraps another span query, and excludes any documents which match that query.' span_or: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanOrQuery' description: Combines multiple span queries and returns documents which match any of the specified queries. span_term: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.SpanTermQuery' description: The equivalent of the `term` query but for use with other span queries. span_within: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanWithinQuery' description: The result from a single span query is returned as long is its span falls within the spans returned by a list of other span queries. _types.query_dsl.SpanFieldMaskingQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - field - query type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' query: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanQuery' x-model: true _types.query_dsl.SpanFirstQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - end - match type: object properties: end: type: number description: Controls the maximum end position permitted in a match. match: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanQuery' description: Can be any other span type query. x-model: true _types.query_dsl.SpanGapQuery: maxProperties: 1 minProperties: 1 type: object additionalProperties: type: number description: Can only be used as a clause in a span_near query. _types.query_dsl.SpanMultiTermQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - match type: object properties: match: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: 'Should be a multi term query (one of `wildcard`, `fuzzy`, `prefix`, `range`, or `regexp` query).' x-model: true _types.query_dsl.SpanNearQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - clauses type: object properties: clauses: type: array items: $ref: '#/components/schemas/_types.query_dsl.SpanQuery' description: Array of one or more other span type queries. in_order: type: boolean description: Controls whether matches are required to be in-order. slop: type: number description: Controls the maximum number of intervening unmatched positions permitted. x-model: true _types.query_dsl.SpanNotQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - exclude - include type: object properties: dist: type: number description: "The number of tokens from within the include span that can’t have overlap with the exclude span.\nEquivalent to setting both `pre` and `post`." exclude: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanQuery' description: Span query whose matches must not overlap those returned. include: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanQuery' description: Span query whose matches are filtered. post: type: number description: The number of tokens after the include span that can’t have overlap with the exclude span. default: 0 pre: type: number description: The number of tokens before the include span that can’t have overlap with the exclude span. default: 0 x-model: true _types.query_dsl.SpanOrQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - clauses type: object properties: clauses: type: array items: $ref: '#/components/schemas/_types.query_dsl.SpanQuery' description: Array of one or more other span type queries. x-model: true _types.query_dsl.SpanTermQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - value type: object properties: value: allOf: - $ref: '#/components/schemas/_types.FieldValue' x-model: true _types.query_dsl.SpanWithinQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - big - little type: object properties: big: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanQuery' description: "Can be any span query.\nMatching spans from `little` that are enclosed within `big` are returned." little: allOf: - $ref: '#/components/schemas/_types.query_dsl.SpanQuery' description: "Can be any span query.\nMatching spans from `little` that are enclosed within `big` are returned." x-model: true _types.query_dsl.SparseVectorQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - allOf: - required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The name of the field that contains the token-weight pairs to be searched against.\nThis field must be a mapped sparse_vector field." query: type: string description: "The query text you want to use for search.\nIf inference_id is specified, query must also be specified." prune: type: boolean description: "Whether to perform pruning, omitting the non-significant tokens from the query to improve query performance.\nIf prune is true but the pruning_config is not specified, pruning will occur but default values will be used.\nDefault: false" x-state: Generally available; Added in 8.15.0 pruning_config: allOf: - $ref: '#/components/schemas/_types.TokenPruningConfig' description: "Optional pruning configuration.\nIf enabled, this will omit non-significant tokens from the query in order to improve query performance.\nThis is only used if prune is set to true.\nIf prune is set to true but pruning_config is not specified, default values will be used." x-state: Generally available; Added in 8.15.0 - maxProperties: 1 minProperties: 1 type: object properties: query_vector: type: object additionalProperties: type: number description: "Dictionary of precomputed sparse vectors and their associated weights.\nOnly one of inference_id or query_vector may be supplied in a request." inference_id: allOf: - $ref: '#/components/schemas/_types.Id' description: "The inference ID to use to convert the query text into token-weight pairs.\nIt must be the same inference ID that was used to create the tokens from the input text.\nOnly one of inference_id and query_vector is allowed.\nIf inference_id is specified, query must also be specified.\nOnly one of inference_id or query_vector may be supplied in a request." externalDocs: url: https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-sparse-vector-query x-model: true _types.TokenPruningConfig: type: object properties: tokens_freq_ratio_threshold: type: number description: Tokens whose frequency is more than this threshold times the average frequency of all tokens in the specified field are considered outliers and pruned. default: 5 tokens_weight_threshold: type: number description: Tokens whose weight is less than this threshold are considered nonsignificant and pruned. default: 0.4 only_score_pruned_tokens: type: boolean description: 'Whether to only score pruned tokens, vs only scoring kept tokens.' default: false _types.query_dsl.TermQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - value type: object properties: value: allOf: - $ref: '#/components/schemas/_types.FieldValue' description: Term you wish to find in the provided field. case_insensitive: type: boolean description: "Allows case insensitive matching of the value with the indexed field values when set to `true`.\nWhen `false`, the case sensitivity of matching depends on the underlying field’s mapping." default: false x-state: Generally available; Added in 7.10.0 x-model: true _types.query_dsl.TermsQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - type: object x-model: true _types.query_dsl.TermsSetQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - terms type: object properties: minimum_should_match: allOf: - $ref: '#/components/schemas/_types.MinimumShouldMatch' description: Specification describing number of matching terms required to return a document. x-state: Generally available; Added in 8.10.0 minimum_should_match_field: allOf: - $ref: '#/components/schemas/_types.Field' description: Numeric field containing the number of matching terms required to return a document. minimum_should_match_script: allOf: - $ref: '#/components/schemas/_types.Script' description: Custom script containing the number of matching terms required to return a document. terms: type: array items: $ref: '#/components/schemas/_types.FieldValue' description: Array of terms you wish to find in the provided field. x-model: true _types.query_dsl.TextExpansionQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - model_id - model_text type: object properties: model_id: type: string description: The text expansion NLP model to use model_text: type: string description: The query text pruning_config: allOf: - $ref: '#/components/schemas/_types.TokenPruningConfig' description: Token pruning configurations x-state: Experimental; Added in 8.13.0 x-model: true _types.query_dsl.WeightedTokensQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - tokens type: object properties: tokens: oneOf: - type: object additionalProperties: type: number - type: array items: type: object additionalProperties: type: number description: The tokens representing this query pruning_config: allOf: - $ref: '#/components/schemas/_types.TokenPruningConfig' description: Token pruning configurations x-model: true _types.query_dsl.WildcardQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - type: object properties: case_insensitive: type: boolean description: Allows case insensitive matching of the pattern with the indexed field values when set to true. Default is false which means the case sensitivity of matching depends on the underlying field’s mapping. x-state: Generally available; Added in 7.10.0 rewrite: allOf: - $ref: '#/components/schemas/_types.MultiTermQueryRewrite' description: Method used to rewrite the query. value: type: string description: 'Wildcard pattern for terms you wish to find in the provided field. Required, when wildcard is not set.' wildcard: type: string description: 'Wildcard pattern for terms you wish to find in the provided field. Required, when value is not set.' x-model: true _types.query_dsl.WrapperQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - query type: object properties: query: type: string description: "A base64 encoded query.\nThe binary data format can be any of JSON, YAML, CBOR or SMILE encodings" x-model: true _types.query_dsl.TypeQuery: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryBase' - required: - value type: object properties: value: type: string _types.aggregations.BucketAggregationBase: allOf: - $ref: '#/components/schemas/_types.aggregations.Aggregation' - type: object description: Base type for bucket aggregations. These aggregations also accept sub-aggregations. _types.aggregations.Aggregation: type: object _types.aggregations.AutoDateHistogramAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: buckets: type: number description: The target number of buckets. default: 10 field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field on which to run the aggregation. format: type: string description: "The date format used to format `key_as_string` in the response.\nIf no `format` is specified, the first date format specified in the field mapping is used." minimum_interval: oneOf: - $ref: '#/components/schemas/_types.aggregations.MinimumInterval' - type: - 'null' - string description: "The minimum rounding interval.\nThis can make the collection process more efficient, as the aggregation will not attempt to round at any interval lower than `minimum_interval`." missing: allOf: - $ref: '#/components/schemas/_types.DateTime' description: "The value to apply to documents that do not have a value.\nBy default, documents without a value are ignored." offset: type: string description: Time zone specified as a ISO 8601 UTC offset. params: type: object additionalProperties: type: object script: allOf: - $ref: '#/components/schemas/_types.Script' time_zone: allOf: - $ref: '#/components/schemas/_types.TimeZone' description: Time zone ID. x-model: true _types.aggregations.MinimumInterval: enum: - second - minute - hour - day - month - year type: string _types.DateTime: oneOf: - type: string - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: "A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a\nnumber of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string\nrepresentation." _types.aggregations.AverageAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.FormatMetricAggregationBase' - type: object _types.aggregations.FormatMetricAggregationBase: allOf: - $ref: '#/components/schemas/_types.aggregations.MetricAggregationBase' - type: object properties: format: type: string _types.aggregations.MetricAggregationBase: type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field on which to run the aggregation. missing: allOf: - $ref: '#/components/schemas/_types.aggregations.Missing' description: "The value to apply to documents that do not have a value.\nBy default, documents without a value are ignored." script: allOf: - $ref: '#/components/schemas/_types.Script' _types.aggregations.Missing: type: - boolean - number - string _types.aggregations.AverageBucketAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.PipelineAggregationBase' - type: object x-model: true _types.aggregations.PipelineAggregationBase: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketPathAggregation' - type: object properties: format: type: string description: "`DecimalFormat` pattern for the output value.\nIf specified, the formatted value is returned in the aggregation’s `value_as_string` property." gap_policy: allOf: - $ref: '#/components/schemas/_types.aggregations.GapPolicy' description: "Policy to apply when gaps are found in the data.\n\nSupported values include:\n - `skip`: Treats missing data as if the bucket does not exist. It will skip the bucket and\ncontinue calculating using the next available value.\n - `insert_zeros`: Replace missing values with a zero (0) and pipeline aggregation computation will proceed as normal.\n - `keep_values`: Similar to skip, except if the metric provides a non-null, non-NaN value this value is used,\notherwise the empty bucket is skipped.\n\n" default: skip _types.aggregations.GapPolicy: enum: - skip - insert_zeros - keep_values type: string _types.aggregations.BucketPathAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.Aggregation' - type: object properties: buckets_path: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsPath' description: Path to the buckets that contain one set of values to correlate. _types.aggregations.BucketsPath: oneOf: - type: string - type: array items: type: string - type: object additionalProperties: type: string description: "Buckets path can be expressed in different ways, and an aggregation may accept some or all of these\nforms depending on its type. Please refer to each aggregation's documentation to know what buckets\npath forms they accept." _types.aggregations.BoxplotAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.MetricAggregationBase' - type: object properties: compression: type: number description: 'Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error.' execution_hint: allOf: - $ref: '#/components/schemas/_types.aggregations.TDigestExecutionHint' description: "The default implementation of TDigest is optimized for performance, scaling to millions or even billions of sample values while maintaining acceptable accuracy levels (close to 1% relative error for millions of samples in some cases).\nTo use an implementation optimized for accuracy, set this parameter to high_accuracy instead." default: default _types.aggregations.TDigestExecutionHint: enum: - default - high_accuracy type: string _types.aggregations.BucketScriptAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.PipelineAggregationBase' - type: object properties: script: allOf: - $ref: '#/components/schemas/_types.Script' description: The script to run for this aggregation. x-model: true _types.aggregations.BucketSelectorAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.PipelineAggregationBase' - type: object properties: script: allOf: - $ref: '#/components/schemas/_types.Script' description: The script to run for this aggregation. x-model: true _types.aggregations.BucketSortAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.Aggregation' - type: object properties: from: type: number description: Buckets in positions prior to `from` will be truncated. gap_policy: allOf: - $ref: '#/components/schemas/_types.aggregations.GapPolicy' description: "The policy to apply when gaps are found in the data.\n\nSupported values include:\n - `skip`: Treats missing data as if the bucket does not exist. It will skip the bucket and\ncontinue calculating using the next available value.\n - `insert_zeros`: Replace missing values with a zero (0) and pipeline aggregation computation will proceed as normal.\n - `keep_values`: Similar to skip, except if the metric provides a non-null, non-NaN value this value is used,\notherwise the empty bucket is skipped.\n\n" default: skip size: type: number description: "The number of buckets to return.\nDefaults to all buckets of the parent aggregation." sort: allOf: - $ref: '#/components/schemas/_types.Sort' description: The list of fields to sort on. x-model: true _types.aggregations.BucketKsAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketPathAggregation' - type: object properties: alternative: type: array items: type: string description: "A list of string values indicating which K-S test alternative to calculate. The valid values\nare: \"greater\", \"less\", \"two_sided\". This parameter is key for determining the K-S statistic used\nwhen calculating the K-S test. Default value is all possible alternative hypotheses." fractions: type: array items: type: number description: "A list of doubles indicating the distribution of the samples with which to compare to the `buckets_path` results.\nIn typical usage this is the overall proportion of documents in each bucket, which is compared with the actual\ndocument proportions in each bucket from the sibling aggregation counts. The default is to assume that overall\ndocuments are uniformly distributed on these buckets, which they would be if one used equal percentiles of a\nmetric to define the bucket end points." sampling_method: type: string description: "Indicates the sampling methodology when calculating the K-S test. Note, this is sampling of the returned values.\nThis determines the cumulative distribution function (CDF) points used comparing the two samples. Default is\n`upper_tail`, which emphasizes the upper end of the CDF points. Valid options are: `upper_tail`, `uniform`,\nand `lower_tail`." description: "A sibling pipeline aggregation which executes a two sample Kolmogorov–Smirnov test (referred\nto as a \"K-S test\" from now on) against a provided distribution, and the distribution implied\nby the documents counts in the configured sibling aggregation. Specifically, for some metric,\nassuming that the percentile intervals of the metric are known beforehand or have been computed\nby an aggregation, then one would use range aggregation for the sibling to compute the p-value\nof the distribution difference between the metric and the restriction of that metric to a subset\nof the documents. A natural use case is if the sibling aggregation range aggregation nested in a\nterms aggregation, in which case one compares the overall distribution of metric to its restriction\nto each term." x-model: true _types.aggregations.BucketCorrelationAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketPathAggregation' - required: - function type: object properties: function: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketCorrelationFunction' description: The correlation function to execute. description: A sibling pipeline aggregation which executes a correlation function on the configured sibling multi-bucket aggregation. x-model: true _types.aggregations.BucketCorrelationFunction: required: - count_correlation type: object properties: count_correlation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketCorrelationFunctionCountCorrelation' description: The configuration to calculate a count correlation. This function is designed for determining the correlation of a term value and a given metric. _types.aggregations.BucketCorrelationFunctionCountCorrelation: required: - indicator type: object properties: indicator: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketCorrelationFunctionCountCorrelationIndicator' description: The indicator with which to correlate the configured `bucket_path` values. _types.aggregations.BucketCorrelationFunctionCountCorrelationIndicator: required: - doc_count - expectations type: object properties: doc_count: type: number description: "The total number of documents that initially created the expectations. It’s required to be greater\nthan or equal to the sum of all values in the buckets_path as this is the originating superset of data\nto which the term values are correlated." expectations: type: array items: type: number description: "An array of numbers with which to correlate the configured `bucket_path` values.\nThe length of this value must always equal the number of buckets returned by the `bucket_path`." fractions: type: array items: type: number description: "An array of fractions to use when averaging and calculating variance. This should be used if\nthe pre-calculated data and the buckets_path have known gaps. The length of fractions, if provided,\nmust equal expectations." _types.aggregations.CardinalityAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.MetricAggregationBase' - type: object properties: precision_threshold: type: number description: "A unique count below which counts are expected to be close to accurate.\nThis allows to trade memory for accuracy." default: 3000 rehash: type: boolean execution_hint: allOf: - $ref: '#/components/schemas/_types.aggregations.CardinalityExecutionMode' description: "Mechanism by which cardinality aggregations is run.\n\nSupported values include:\n - `global_ordinals`: Run the aggregation by using global ordinals of the field and resolving those values after finishing a shard.\n - `segment_ordinals`: Run the aggregation by using segment ordinal values and resolving those values after each segment.\n - `direct`: Run the aggregation by using field values directly.\n - `save_memory_heuristic`: Heuristic-based mode, default in Elasticsearch 8.3 and earlier.\n - `save_time_heuristic`: Heuristic-based mode, default in Elasticsearch 8.4 and later.\n\n" _types.aggregations.CardinalityExecutionMode: enum: - global_ordinals - segment_ordinals - direct - save_memory_heuristic - save_time_heuristic type: string _types.aggregations.CartesianBoundsAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.MetricAggregationBase' - type: object _types.aggregations.CartesianCentroidAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.MetricAggregationBase' - type: object _types.aggregations.CategorizeTextAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.Aggregation' - required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The semi-structured text field to categorize. max_unique_tokens: type: number description: "The maximum number of unique tokens at any position up to max_matched_tokens. Must be larger than 1.\nSmaller values use less memory and create fewer categories. Larger values will use more memory and\ncreate narrower categories. Max allowed value is 100." default: 50 max_matched_tokens: type: number description: "The maximum number of token positions to match on before attempting to merge categories. Larger\nvalues will use more memory and create narrower categories. Max allowed value is 100." default: 5 similarity_threshold: type: number description: "The minimum percentage of tokens that must match for text to be added to the category bucket. Must\nbe between 1 and 100. The larger the value the narrower the categories. Larger values will increase memory\nusage and create narrower categories." default: 50 categorization_filters: type: array items: type: string description: "This property expects an array of regular expressions. The expressions are used to filter out matching\nsequences from the categorization field values. You can use this functionality to fine tune the categorization\nby excluding sequences from consideration when categories are defined. For example, you can exclude SQL\nstatements that appear in your log files. This property cannot be used at the same time as categorization_analyzer.\nIf you only want to define simple regular expression filters that are applied prior to tokenization, setting\nthis property is the easiest method. If you also want to customize the tokenizer or post-tokenization filtering,\nuse the categorization_analyzer property instead and include the filters as pattern_replace character filters." categorization_analyzer: allOf: - $ref: '#/components/schemas/_types.aggregations.CategorizeTextAnalyzer' description: "The categorization analyzer specifies how the text is analyzed and tokenized before being categorized.\nThe syntax is very similar to that used to define the analyzer in the analyze API. This property\ncannot be used at the same time as `categorization_filters`." externalDocs: url: https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-analyze shard_size: type: number description: The number of categorization buckets to return from each shard before merging all the results. size: type: number description: The number of buckets to return. default: 10 min_doc_count: type: number description: The minimum number of documents in a bucket to be returned to the results. shard_min_doc_count: type: number description: The minimum number of documents in a bucket to be returned from the shard before merging. description: "A multi-bucket aggregation that groups semi-structured text into buckets. Each text\nfield is re-analyzed using a custom analyzer. The resulting tokens are then categorized\ncreating buckets of similarly formatted text values. This aggregation works best with machine\ngenerated text like system logs. Only the first 100 analyzed tokens are used to categorize the text." x-model: true _types.aggregations.CategorizeTextAnalyzer: oneOf: - type: string - $ref: '#/components/schemas/_types.aggregations.CustomCategorizeTextAnalyzer' _types.aggregations.CustomCategorizeTextAnalyzer: type: object properties: char_filter: type: array items: type: string tokenizer: type: string filter: type: array items: type: string _types.aggregations.ChangePointAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.PipelineAggregationBase' - type: object _types.aggregations.ChildrenAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: type: allOf: - $ref: '#/components/schemas/_types.RelationName' description: The child type that should be selected. _types.aggregations.CompositeAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: after: allOf: - $ref: '#/components/schemas/_types.aggregations.CompositeAggregateKey' description: 'When paginating, use the `after_key` value returned in the previous response to retrieve the next page.' size: type: number description: The number of composite buckets that should be returned. default: 10 sources: type: array items: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.CompositeAggregationSource' description: "The value sources used to build composite buckets.\nKeys are returned in the order of the `sources` definition." _types.aggregations.CompositeAggregationSource: maxProperties: 1 minProperties: 1 type: object properties: terms: allOf: - $ref: '#/components/schemas/_types.aggregations.CompositeTermsAggregation' description: A terms aggregation. histogram: allOf: - $ref: '#/components/schemas/_types.aggregations.CompositeHistogramAggregation' description: A histogram aggregation. date_histogram: allOf: - $ref: '#/components/schemas/_types.aggregations.CompositeDateHistogramAggregation' description: A date histogram aggregation. geotile_grid: allOf: - $ref: '#/components/schemas/_types.aggregations.CompositeGeoTileGridAggregation' description: A geotile grid aggregation. _types.aggregations.CompositeTermsAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.CompositeAggregationBase' - type: object _types.aggregations.CompositeAggregationBase: type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: Either `field` or `script` must be present missing_bucket: type: boolean missing_order: allOf: - $ref: '#/components/schemas/_types.aggregations.MissingOrder' script: allOf: - $ref: '#/components/schemas/_types.Script' description: Either `field` or `script` must be present value_type: allOf: - $ref: '#/components/schemas/_types.aggregations.ValueType' order: allOf: - $ref: '#/components/schemas/_types.SortOrder' description: "\n\nSupported values include:\n - `asc`: Ascending (smallest to largest)\n - `desc`: Descending (largest to smallest)\n\n" _types.aggregations.MissingOrder: enum: - first - last - default type: string _types.aggregations.ValueType: enum: - string - long - double - number - date - date_nanos - ip - numeric - geo_point - boolean type: string _types.aggregations.CompositeHistogramAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.CompositeAggregationBase' - required: - interval type: object properties: interval: type: number _types.aggregations.CompositeDateHistogramAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.CompositeAggregationBase' - type: object properties: format: type: string calendar_interval: allOf: - $ref: '#/components/schemas/_types.DurationLarge' description: Either `calendar_interval` or `fixed_interval` must be present fixed_interval: allOf: - $ref: '#/components/schemas/_types.DurationLarge' description: Either `calendar_interval` or `fixed_interval` must be present offset: allOf: - $ref: '#/components/schemas/_types.Duration' time_zone: allOf: - $ref: '#/components/schemas/_types.TimeZone' _types.aggregations.CompositeGeoTileGridAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.CompositeAggregationBase' - type: object properties: precision: type: number bounds: allOf: - $ref: '#/components/schemas/_types.GeoBounds' _types.aggregations.CumulativeCardinalityAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.PipelineAggregationBase' - type: object _types.aggregations.CumulativeSumAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.PipelineAggregationBase' - type: object x-model: true _types.aggregations.DateHistogramAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: calendar_interval: allOf: - $ref: '#/components/schemas/_types.aggregations.CalendarInterval' description: "Calendar-aware interval.\nCan be specified using the unit name, such as `month`, or as a single unit quantity, such as `1M`." extended_bounds: allOf: - $ref: '#/components/schemas/_types.aggregations.ExtendedBoundsFieldDateMath' description: Enables extending the bounds of the histogram beyond the data itself. hard_bounds: allOf: - $ref: '#/components/schemas/_types.aggregations.ExtendedBoundsFieldDateMath' description: Limits the histogram to specified bounds. field: allOf: - $ref: '#/components/schemas/_types.Field' description: The date field whose values are use to build a histogram. fixed_interval: allOf: - $ref: '#/components/schemas/_types.Duration' description: 'Fixed intervals: a fixed number of SI units and never deviate, regardless of where they fall on the calendar.' format: type: string description: "The date format used to format `key_as_string` in the response.\nIf no `format` is specified, the first date format specified in the field mapping is used." interval: allOf: - $ref: '#/components/schemas/_types.Duration' deprecated: true min_doc_count: type: number description: "Only returns buckets that have `min_doc_count` number of documents.\nBy default, all buckets between the first bucket that matches documents and the last one are returned." missing: allOf: - $ref: '#/components/schemas/_types.DateTime' description: "The value to apply to documents that do not have a value.\nBy default, documents without a value are ignored." offset: allOf: - $ref: '#/components/schemas/_types.Duration' description: Changes the start value of each bucket by the specified positive (`+`) or negative offset (`-`) duration. order: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateOrder' description: The sort order of the returned buckets. params: type: object additionalProperties: type: object script: allOf: - $ref: '#/components/schemas/_types.Script' time_zone: allOf: - $ref: '#/components/schemas/_types.TimeZone' description: "Time zone used for bucketing and rounding.\nDefaults to Coordinated Universal Time (UTC)." keyed: type: boolean description: Set to `true` to associate a unique string key with each bucket and return the ranges as a hash rather than an array. _types.aggregations.CalendarInterval: enum: - second - 1s - minute - 1m - hour - 1h - day - 1d - week - 1w - month - 1M - quarter - 1q - year - 1y type: string _types.aggregations.ExtendedBoundsFieldDateMath: type: object properties: max: allOf: - $ref: '#/components/schemas/_types.aggregations.FieldDateMath' description: Maximum value for the bound. min: allOf: - $ref: '#/components/schemas/_types.aggregations.FieldDateMath' description: Minimum value for the bound. _types.aggregations.FieldDateMath: oneOf: - $ref: '#/components/schemas/_types.DateMath' - type: number description: "A date range limit, represented either as a DateMath expression or a number expressed\naccording to the target field's precision." _types.aggregations.AggregateOrder: oneOf: - maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.SortOrder' - type: array items: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.SortOrder' _types.aggregations.DateRangeAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The date field whose values are use to build ranges. format: type: string description: The date format used to format `from` and `to` in the response. missing: allOf: - $ref: '#/components/schemas/_types.aggregations.Missing' description: "The value to apply to documents that do not have a value.\nBy default, documents without a value are ignored." ranges: type: array items: $ref: '#/components/schemas/_types.aggregations.DateRangeExpression' description: Array of date ranges. time_zone: allOf: - $ref: '#/components/schemas/_types.TimeZone' description: Time zone used to convert dates from another time zone to UTC. keyed: type: boolean description: Set to `true` to associate a unique string key with each bucket and returns the ranges as a hash rather than an array. _types.aggregations.DateRangeExpression: type: object properties: from: allOf: - $ref: '#/components/schemas/_types.aggregations.FieldDateMath' description: Start of the range (inclusive). key: type: string description: Custom key to return the range with. to: allOf: - $ref: '#/components/schemas/_types.aggregations.FieldDateMath' description: End of the range (exclusive). _types.aggregations.DerivativeAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.PipelineAggregationBase' - type: object _types.aggregations.DiversifiedSamplerAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: execution_hint: allOf: - $ref: '#/components/schemas/_types.aggregations.SamplerAggregationExecutionHint' description: "The type of value used for de-duplication.\n\nSupported values include:\n - `map`: Hold field values directly.\n - `global_ordinals`: Hold ordinals of the field as determined by the Lucene index.\n - `bytes_hash`: Hold hashes of the field values - with potential for hash collisions.\n\n" default: global_ordinals max_docs_per_value: type: number description: Limits how many documents are permitted per choice of de-duplicating value. default: 1 script: allOf: - $ref: '#/components/schemas/_types.Script' shard_size: type: number description: Limits how many top-scoring documents are collected in the sample processed on each shard. default: 100 field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field used to provide values used for de-duplication. x-model: true _types.aggregations.SamplerAggregationExecutionHint: enum: - map - global_ordinals - bytes_hash type: string _types.aggregations.ExtendedStatsAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.FormatMetricAggregationBase' - type: object properties: sigma: type: number description: The number of standard deviations above/below the mean to display. _types.aggregations.ExtendedStatsBucketAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.PipelineAggregationBase' - type: object properties: sigma: type: number description: The number of standard deviations above/below the mean to display. _types.aggregations.FrequentItemSetsAggregation: required: - fields type: object properties: fields: type: array items: $ref: '#/components/schemas/_types.aggregations.FrequentItemSetsField' description: Fields to analyze. minimum_set_size: type: number description: The minimum size of one item set. default: 1 minimum_support: type: number description: The minimum support of one item set. default: 0.1 size: type: number description: The number of top item sets to return. default: 10 filter: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: Query that filters documents from analysis. _types.aggregations.FrequentItemSetsField: required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' exclude: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsExclude' description: "Values to exclude.\nCan be regular expression strings or arrays of strings of exact terms." include: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsInclude' description: "Values to include.\nCan be regular expression strings or arrays of strings of exact terms." _types.aggregations.TermsExclude: oneOf: - type: string - type: array items: type: string _types.aggregations.TermsInclude: oneOf: - type: string - type: array items: type: string - $ref: '#/components/schemas/_types.aggregations.TermsPartition' _types.aggregations.TermsPartition: required: - num_partitions - partition type: object properties: num_partitions: type: number description: The number of partitions. partition: type: number description: The partition number for this request. _types.aggregations.FiltersAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: filters: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsQueryContainer' description: Collection of queries from which to build buckets. other_bucket: type: boolean description: Set to `true` to add a bucket to the response which will contain all documents that do not match any of the given filters. other_bucket_key: type: string description: The key with which the other bucket is returned. default: _other_ keyed: type: boolean description: "By default, the named filters aggregation returns the buckets as an object.\nSet to `false` to return the buckets as an array of objects." default: true _types.aggregations.BucketsQueryContainer: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.QueryContainer' - type: array items: $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." _types.aggregations.GeoBoundsAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.MetricAggregationBase' - type: object properties: wrap_longitude: type: boolean description: Specifies whether the bounding box should be allowed to overlap the international date line. default: true _types.aggregations.GeoCentroidAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.MetricAggregationBase' - type: object properties: count: type: number location: allOf: - $ref: '#/components/schemas/_types.GeoLocation' _types.aggregations.GeoDistanceAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: distance_type: allOf: - $ref: '#/components/schemas/_types.GeoDistanceType' description: "The distance calculation type.\n\nSupported values include:\n - `arc`: The `arc` calculation is the most accurate.\n - `plane`: The `plane` calculation is faster but less accurate.\n\n" default: arc field: allOf: - $ref: '#/components/schemas/_types.Field' description: A field of type `geo_point` used to evaluate the distance. origin: allOf: - $ref: '#/components/schemas/_types.GeoLocation' description: The origin used to evaluate the distance. ranges: type: array items: $ref: '#/components/schemas/_types.aggregations.AggregationRange' description: An array of ranges used to bucket documents. unit: allOf: - $ref: '#/components/schemas/_types.DistanceUnit' description: The distance unit. default: m _types.aggregations.AggregationRange: type: object properties: from: oneOf: - type: number - type: - 'null' - string description: Start of the range (inclusive). key: type: string description: Custom key to return the range with. to: oneOf: - type: number - type: - 'null' - string description: End of the range (exclusive). _types.aggregations.GeoHashGridAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: bounds: allOf: - $ref: '#/components/schemas/_types.GeoBounds' description: The bounding box to filter the points in each bucket. field: allOf: - $ref: '#/components/schemas/_types.Field' description: "Field containing indexed `geo_point` or `geo_shape` values.\nIf the field contains an array, `geohash_grid` aggregates all array values." precision: allOf: - $ref: '#/components/schemas/_types.GeoHashPrecision' description: The string length of the geohashes used to define cells/buckets in the results. default: '5' shard_size: type: number description: "Allows for more accurate counting of the top cells returned in the final result the aggregation.\nDefaults to returning `max(10,(size x number-of-shards))` buckets from each shard." size: type: number description: The maximum number of geohash buckets to return. default: 10000 _types.GeoHashPrecision: type: - number - string description: 'A precision that can be expressed as a geohash length between 1 and 12, or a distance measure like "1km", "10m".' _types.aggregations.GeoLineAggregation: required: - point type: object properties: point: allOf: - $ref: '#/components/schemas/_types.aggregations.GeoLinePoint' description: The name of the geo_point field. sort: allOf: - $ref: '#/components/schemas/_types.aggregations.GeoLineSort' description: "The name of the numeric field to use as the sort key for ordering the points.\nWhen the `geo_line` aggregation is nested inside a `time_series` aggregation, this field defaults to `@timestamp`, and any other value will result in error." include_sort: type: boolean description: 'When `true`, returns an additional array of the sort values in the feature properties.' sort_order: allOf: - $ref: '#/components/schemas/_types.SortOrder' description: "The order in which the line is sorted (ascending or descending).\n\nSupported values include:\n - `asc`: Ascending (smallest to largest)\n - `desc`: Descending (largest to smallest)\n\n" default: asc size: type: number description: "The maximum length of the line represented in the aggregation.\nValid sizes are between 1 and 10000." default: 10000 _types.aggregations.GeoLinePoint: required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The name of the geo_point field. _types.aggregations.GeoLineSort: required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The name of the numeric field to use as the sort key for ordering the points. _types.aggregations.GeoTileGridAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: "Field containing indexed `geo_point` or `geo_shape` values.\nIf the field contains an array, `geotile_grid` aggregates all array values." precision: allOf: - $ref: '#/components/schemas/_types.GeoTilePrecision' description: "Integer zoom of the key used to define cells/buckets in the results.\nValues outside of the range [0,29] will be rejected." default: '7' shard_size: type: number description: "Allows for more accurate counting of the top cells returned in the final result the aggregation.\nDefaults to returning `max(10,(size x number-of-shards))` buckets from each shard." size: type: number description: The maximum number of buckets to return. default: 10000 bounds: allOf: - $ref: '#/components/schemas/_types.GeoBounds' description: A bounding box to filter the geo-points or geo-shapes in each bucket. _types.GeoTilePrecision: type: number _types.aggregations.GeohexGridAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: "Field containing indexed `geo_point` or `geo_shape` values.\nIf the field contains an array, `geohex_grid` aggregates all array values." precision: type: number description: "Integer zoom of the key used to defined cells or buckets\nin the results. Value should be between 0-15." default: 6 bounds: allOf: - $ref: '#/components/schemas/_types.GeoBounds' description: Bounding box used to filter the geo-points in each bucket. size: type: number description: Maximum number of buckets to return. default: 10000 shard_size: type: number description: Number of buckets returned from each shard. _types.aggregations.GlobalAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object _types.aggregations.HistogramAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: extended_bounds: allOf: - $ref: '#/components/schemas/_types.aggregations.ExtendedBoundsdouble' description: Enables extending the bounds of the histogram beyond the data itself. hard_bounds: allOf: - $ref: '#/components/schemas/_types.aggregations.ExtendedBoundsdouble' description: "Limits the range of buckets in the histogram.\nIt is particularly useful in the case of open data ranges that can result in a very large number of buckets." field: allOf: - $ref: '#/components/schemas/_types.Field' description: The name of the field to aggregate on. interval: type: number description: "The interval for the buckets.\nMust be a positive decimal." min_doc_count: type: number description: "Only returns buckets that have `min_doc_count` number of documents.\nBy default, the response will fill gaps in the histogram with empty buckets." missing: type: number description: "The value to apply to documents that do not have a value.\nBy default, documents without a value are ignored." offset: type: number description: "By default, the bucket keys start with 0 and then continue in even spaced steps of `interval`.\nThe bucket boundaries can be shifted by using the `offset` option." order: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateOrder' description: "The sort order of the returned buckets.\nBy default, the returned buckets are sorted by their key ascending." script: allOf: - $ref: '#/components/schemas/_types.Script' format: type: string keyed: type: boolean description: 'If `true`, returns buckets as a hash instead of an array, keyed by the bucket keys.' default: false _types.aggregations.ExtendedBoundsdouble: type: object properties: max: type: number description: Maximum value for the bound. min: type: number description: Minimum value for the bound. _types.aggregations.IpRangeAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The date field whose values are used to build ranges. ranges: type: array items: $ref: '#/components/schemas/_types.aggregations.IpRangeAggregationRange' description: Array of IP ranges. _types.aggregations.IpRangeAggregationRange: type: object properties: from: oneOf: - type: string - type: - 'null' - string description: Start of the range. mask: type: string description: IP range defined as a CIDR mask. to: oneOf: - type: string - type: - 'null' - string description: End of the range. _types.aggregations.IpPrefixAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - required: - field - prefix_length type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The IP address field to aggregation on. The field mapping type must be `ip`. prefix_length: type: number description: "Length of the network prefix. For IPv4 addresses the accepted range is [0, 32].\nFor IPv6 addresses the accepted range is [0, 128]." is_ipv6: type: boolean description: Defines whether the prefix applies to IPv6 addresses. default: false append_prefix_length: type: boolean description: Defines whether the prefix length is appended to IP address keys in the response. default: false keyed: type: boolean description: Defines whether buckets are returned as a hash rather than an array in the response. min_doc_count: type: number description: Minimum number of documents in a bucket for it to be included in the response. default: 1 _types.aggregations.InferenceAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.PipelineAggregationBase' - required: - model_id type: object properties: model_id: allOf: - $ref: '#/components/schemas/_types.Name' description: The ID or alias for the trained model. inference_config: allOf: - $ref: '#/components/schemas/_types.aggregations.InferenceConfigContainer' description: Contains the inference type and its options. _types.aggregations.InferenceConfigContainer: maxProperties: 1 minProperties: 1 type: object properties: regression: allOf: - $ref: '#/components/schemas/ml._types.RegressionInferenceOptions' description: Regression configuration for inference. classification: allOf: - $ref: '#/components/schemas/ml._types.ClassificationInferenceOptions' description: Classification configuration for inference. ml._types.RegressionInferenceOptions: type: object properties: results_field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. num_top_feature_importance_values: type: number description: Specifies the maximum number of feature importance values per document. default: 0 ml._types.ClassificationInferenceOptions: type: object properties: num_top_classes: type: number description: Specifies the number of top class predictions to return. Defaults to 0. num_top_feature_importance_values: type: number description: Specifies the maximum number of feature importance values per document. default: 0 prediction_field_type: type: string description: 'Specifies the type of the predicted field to write. Acceptable values are: string, number, boolean. When boolean is provided 1.0 is transformed to true and 0.0 to false.' results_field: type: string description: The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. top_classes_results_field: type: string description: Specifies the field to which the top classes are written. Defaults to top_classes. _types.aggregations.MatrixStatsAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.MatrixAggregation' - type: object properties: mode: allOf: - $ref: '#/components/schemas/_types.SortMode' description: Array value the aggregation will use for array or multi-valued fields. default: avg _types.aggregations.MatrixAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.Aggregation' - type: object properties: fields: allOf: - $ref: '#/components/schemas/_types.Fields' description: An array of fields for computing the statistics. missing: type: object additionalProperties: type: number description: "The value to apply to documents that do not have a value.\nBy default, documents without a value are ignored." _types.aggregations.MaxAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.FormatMetricAggregationBase' - type: object _types.aggregations.MaxBucketAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.PipelineAggregationBase' - type: object x-model: true _types.aggregations.MedianAbsoluteDeviationAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.FormatMetricAggregationBase' - type: object properties: compression: type: number description: 'Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error.' default: 1000 execution_hint: allOf: - $ref: '#/components/schemas/_types.aggregations.TDigestExecutionHint' description: "The default implementation of TDigest is optimized for performance, scaling to millions or even billions of sample values while maintaining acceptable accuracy levels (close to 1% relative error for millions of samples in some cases).\nTo use an implementation optimized for accuracy, set this parameter to high_accuracy instead." default: default _types.aggregations.MinAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.FormatMetricAggregationBase' - type: object _types.aggregations.MinBucketAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.PipelineAggregationBase' - type: object x-model: true _types.aggregations.MissingAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The name of the field. missing: allOf: - $ref: '#/components/schemas/_types.aggregations.Missing' _types.aggregations.MovingAverageAggregation: oneOf: - $ref: '#/components/schemas/_types.aggregations.LinearMovingAverageAggregation' - $ref: '#/components/schemas/_types.aggregations.SimpleMovingAverageAggregation' - $ref: '#/components/schemas/_types.aggregations.EwmaMovingAverageAggregation' - $ref: '#/components/schemas/_types.aggregations.HoltMovingAverageAggregation' - $ref: '#/components/schemas/_types.aggregations.HoltWintersMovingAverageAggregation' discriminator: propertyName: model mapping: ewma: '#/components/schemas/_types.aggregations.EwmaMovingAverageAggregation' holt: '#/components/schemas/_types.aggregations.HoltMovingAverageAggregation' holt_winters: '#/components/schemas/_types.aggregations.HoltWintersMovingAverageAggregation' linear: '#/components/schemas/_types.aggregations.LinearMovingAverageAggregation' simple: '#/components/schemas/_types.aggregations.SimpleMovingAverageAggregation' _types.aggregations.LinearMovingAverageAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.MovingAverageAggregationBase' - required: - model - settings type: object properties: model: enum: - linear type: string settings: allOf: - $ref: '#/components/schemas/_types.EmptyObject' _types.aggregations.MovingAverageAggregationBase: allOf: - $ref: '#/components/schemas/_types.aggregations.PipelineAggregationBase' - type: object properties: minimize: type: boolean predict: type: number window: type: number _types.aggregations.SimpleMovingAverageAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.MovingAverageAggregationBase' - required: - model - settings type: object properties: model: enum: - simple type: string settings: allOf: - $ref: '#/components/schemas/_types.EmptyObject' _types.aggregations.EwmaMovingAverageAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.MovingAverageAggregationBase' - required: - model - settings type: object properties: model: enum: - ewma type: string settings: allOf: - $ref: '#/components/schemas/_types.aggregations.EwmaModelSettings' _types.aggregations.EwmaModelSettings: type: object properties: alpha: type: number _types.aggregations.HoltMovingAverageAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.MovingAverageAggregationBase' - required: - model - settings type: object properties: model: enum: - holt type: string settings: allOf: - $ref: '#/components/schemas/_types.aggregations.HoltLinearModelSettings' _types.aggregations.HoltLinearModelSettings: type: object properties: alpha: type: number beta: type: number _types.aggregations.HoltWintersMovingAverageAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.MovingAverageAggregationBase' - required: - model - settings type: object properties: model: enum: - holt_winters type: string settings: allOf: - $ref: '#/components/schemas/_types.aggregations.HoltWintersModelSettings' _types.aggregations.HoltWintersModelSettings: type: object properties: alpha: type: number beta: type: number gamma: type: number pad: type: boolean period: type: number type: allOf: - $ref: '#/components/schemas/_types.aggregations.HoltWintersType' _types.aggregations.HoltWintersType: enum: - add - mult type: string _types.aggregations.MovingPercentilesAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.PipelineAggregationBase' - type: object properties: window: type: number description: The size of window to "slide" across the histogram. shift: type: number description: "By default, the window consists of the last n values excluding the current bucket.\nIncreasing `shift` by 1, moves the starting window position by 1 to the right." default: 0 keyed: type: boolean x-model: true _types.aggregations.MovingFunctionAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.PipelineAggregationBase' - type: object properties: script: type: string description: The script that should be executed on each window of data. shift: type: number description: "By default, the window consists of the last n values excluding the current bucket.\nIncreasing `shift` by 1, moves the starting window position by 1 to the right." default: 0 window: type: number description: The size of window to "slide" across the histogram. x-model: true _types.aggregations.MultiTermsAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - required: - terms type: object properties: collect_mode: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsAggregationCollectMode' description: "Specifies the strategy for data collection.\n\nSupported values include:\n - `depth_first`: Expands all branches of the aggregation tree in one depth-first pass, before any pruning occurs.\n - `breadth_first`: Caches the set of documents that fall into the uppermost buckets for subsequent replay.\n\n" default: breadth_first order: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateOrder' description: "Specifies the sort order of the buckets.\nDefaults to sorting by descending document count." min_doc_count: type: number description: The minimum number of documents in a bucket for it to be returned. default: 1 shard_min_doc_count: type: number description: The minimum number of documents in a bucket on each shard for it to be returned. default: 1 shard_size: type: number description: "The number of candidate terms produced by each shard.\nBy default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter." show_term_doc_count_error: type: boolean description: Calculates the doc count error on per term basis. default: false size: type: number description: The number of term buckets should be returned out of the overall terms list. default: 10 terms: type: array items: $ref: '#/components/schemas/_types.aggregations.MultiTermLookup' description: The field from which to generate sets of terms. _types.aggregations.TermsAggregationCollectMode: enum: - depth_first - breadth_first type: string _types.aggregations.MultiTermLookup: allOf: - type: object properties: missing: allOf: - $ref: '#/components/schemas/_types.aggregations.Missing' description: "The value to apply to documents that do not have a value.\nBy default, documents without a value are ignored." - maxProperties: 1 minProperties: 1 type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: "A field from which to retrieve terms.\nIt is required if `script` is not provided." script: allOf: - $ref: '#/components/schemas/_types.Script' description: "A script to calculate terms to aggregate on.\nIt is required if `field` is not provided." _types.aggregations.NestedAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: path: allOf: - $ref: '#/components/schemas/_types.Field' description: The path to the field of type `nested`. _types.aggregations.NormalizeAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.PipelineAggregationBase' - type: object properties: method: allOf: - $ref: '#/components/schemas/_types.aggregations.NormalizeMethod' description: "The specific method to apply.\n\nSupported values include:\n - `rescale_0_1`: This method rescales the data such that the minimum number is 0, and the maximum number is 1, with the rest normalized linearly in-between.\n - `rescale_0_100`: This method rescales the data such that the minimum number is 0, and the maximum number is 100, with the rest normalized linearly in-between.\n - `percent_of_sum`: This method normalizes each value so that it represents a percentage of the total sum it attributes to.\n - `mean`: This method normalizes such that each value is normalized by how much it differs from the average.\n - `z-score`: This method normalizes such that each value represents how far it is from the mean relative to the standard deviation.\n - `softmax`: This method normalizes such that each value is exponentiated and relative to the sum of the exponents of the original values.\n\n" x-model: true _types.aggregations.NormalizeMethod: enum: - rescale_0_1 - rescale_0_100 - percent_of_sum - mean - z-score - softmax type: string _types.aggregations.ParentAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: type: allOf: - $ref: '#/components/schemas/_types.RelationName' description: The child type that should be selected. _types.aggregations.PercentileRanksAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.FormatMetricAggregationBase' - type: object properties: keyed: type: boolean description: "By default, the aggregation associates a unique string key with each bucket and returns the ranges as a hash rather than an array.\nSet to `false` to disable this behavior." default: true values: oneOf: - type: array items: type: number - type: - 'null' - string description: An array of values for which to calculate the percentile ranks. hdr: allOf: - $ref: '#/components/schemas/_types.aggregations.HdrMethod' description: Uses the alternative High Dynamic Range Histogram algorithm to calculate percentile ranks. tdigest: allOf: - $ref: '#/components/schemas/_types.aggregations.TDigest' description: Sets parameters for the default TDigest algorithm used to calculate percentile ranks. x-model: true _types.aggregations.HdrMethod: type: object properties: number_of_significant_value_digits: type: number description: Specifies the resolution of values for the histogram in number of significant digits. _types.aggregations.TDigest: type: object properties: compression: type: number description: 'Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error.' execution_hint: allOf: - $ref: '#/components/schemas/_types.aggregations.TDigestExecutionHint' description: "The default implementation of TDigest is optimized for performance, scaling to millions or even billions of sample values while maintaining acceptable accuracy levels (close to 1% relative error for millions of samples in some cases).\nTo use an implementation optimized for accuracy, set this parameter to high_accuracy instead." default: default _types.aggregations.PercentilesAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.FormatMetricAggregationBase' - type: object properties: keyed: type: boolean description: "By default, the aggregation associates a unique string key with each bucket and returns the ranges as a hash rather than an array.\nSet to `false` to disable this behavior." default: true percents: oneOf: - type: number - type: array items: type: number description: The percentiles to calculate. hdr: allOf: - $ref: '#/components/schemas/_types.aggregations.HdrMethod' description: Uses the alternative High Dynamic Range Histogram algorithm to calculate percentiles. tdigest: allOf: - $ref: '#/components/schemas/_types.aggregations.TDigest' description: Sets parameters for the default TDigest algorithm used to calculate percentiles. _types.aggregations.PercentilesBucketAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.PipelineAggregationBase' - type: object properties: percents: type: array items: type: number description: The list of percentiles to calculate. _types.aggregations.RangeAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The date field whose values are use to build ranges. missing: type: number description: "The value to apply to documents that do not have a value.\nBy default, documents without a value are ignored." ranges: type: array items: $ref: '#/components/schemas/_types.aggregations.AggregationRange' description: An array of ranges used to bucket documents. script: allOf: - $ref: '#/components/schemas/_types.Script' keyed: type: boolean description: Set to `true` to associate a unique string key with each bucket and return the ranges as a hash rather than an array. format: type: string _types.aggregations.RareTermsAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: exclude: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsExclude' description: Terms that should be excluded from the aggregation. field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field from which to return rare terms. include: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsInclude' description: Terms that should be included in the aggregation. max_doc_count: type: number description: The maximum number of documents a term should appear in. default: 1 missing: allOf: - $ref: '#/components/schemas/_types.aggregations.Missing' description: "The value to apply to documents that do not have a value.\nBy default, documents without a value are ignored." precision: type: number description: "The precision of the internal CuckooFilters.\nSmaller precision leads to better approximation, but higher memory usage." default: 0.001 value_type: type: string x-model: true _types.aggregations.RateAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.FormatMetricAggregationBase' - type: object properties: unit: allOf: - $ref: '#/components/schemas/_types.aggregations.CalendarInterval' description: "The interval used to calculate the rate.\nBy default, the interval of the `date_histogram` is used." mode: allOf: - $ref: '#/components/schemas/_types.aggregations.RateMode' description: "How the rate is calculated.\n\nSupported values include:\n - `sum`: Calculates the sum of all values of the field.\n - `value_count`: Uses the number of values of the field.\n\n" default: sum _types.aggregations.RateMode: enum: - sum - value_count type: string _types.aggregations.ReverseNestedAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: path: allOf: - $ref: '#/components/schemas/_types.Field' description: "Defines the nested object field that should be joined back to.\nThe default is empty, which means that it joins back to the root/main document level." _types.aggregations.RandomSamplerAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - required: - probability type: object properties: probability: type: number description: "The probability that a document will be included in the aggregated data.\nMust be greater than 0, less than 0.5, or exactly 1.\nThe lower the probability, the fewer documents are matched." seed: type: number description: "The seed to generate the random sampling of documents.\nWhen a seed is provided, the random subset of documents is the same between calls." shard_seed: type: number description: 'When combined with seed, setting shard_seed ensures 100% consistent sampling over shards where data is exactly the same.' x-state: Generally available; Added in 8.14.0 x-model: true _types.aggregations.SamplerAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: shard_size: type: number description: Limits how many top-scoring documents are collected in the sample processed on each shard. default: 100 _types.aggregations.ScriptedMetricAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.MetricAggregationBase' - type: object properties: combine_script: allOf: - $ref: '#/components/schemas/_types.Script' description: "Runs once on each shard after document collection is complete.\nAllows the aggregation to consolidate the state returned from each shard." init_script: allOf: - $ref: '#/components/schemas/_types.Script' description: "Runs prior to any collection of documents.\nAllows the aggregation to set up any initial state." map_script: allOf: - $ref: '#/components/schemas/_types.Script' description: "Run once per document collected.\nIf no `combine_script` is specified, the resulting state needs to be stored in the `state` object." params: type: object additionalProperties: type: object description: "A global object with script parameters for `init`, `map` and `combine` scripts.\nIt is shared between the scripts." reduce_script: allOf: - $ref: '#/components/schemas/_types.Script' description: "Runs once on the coordinating node after all shards have returned their results.\nThe script is provided with access to a variable `states`, which is an array of the result of the `combine_script` on each shard." _types.aggregations.SerialDifferencingAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.PipelineAggregationBase' - type: object properties: lag: type: number description: "The historical bucket to subtract from the current value.\nMust be a positive, non-zero integer." x-model: true _types.aggregations.SignificantTermsAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: background_filter: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: 'A background filter that can be used to focus in on significant terms within a narrower context, instead of the entire index.' chi_square: allOf: - $ref: '#/components/schemas/_types.aggregations.ChiSquareHeuristic' description: 'Use Chi square, as described in "Information Retrieval", Manning et al., Chapter 13.5.2, as the significance score.' exclude: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsExclude' description: Terms to exclude. execution_hint: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsAggregationExecutionHint' description: 'Mechanism by which the aggregation should be executed: using field values directly or using global ordinals.' field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field from which to return significant terms. gnd: allOf: - $ref: '#/components/schemas/_types.aggregations.GoogleNormalizedDistanceHeuristic' description: 'Use Google normalized distance as described in "The Google Similarity Distance", Cilibrasi and Vitanyi, 2007, as the significance score.' include: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsInclude' description: Terms to include. jlh: allOf: - $ref: '#/components/schemas/_types.EmptyObject' description: Use JLH score as the significance score. min_doc_count: type: number description: Only return terms that are found in more than `min_doc_count` hits. default: 3 mutual_information: allOf: - $ref: '#/components/schemas/_types.aggregations.MutualInformationHeuristic' description: 'Use mutual information as described in "Information Retrieval", Manning et al., Chapter 13.5.1, as the significance score.' percentage: allOf: - $ref: '#/components/schemas/_types.aggregations.PercentageScoreHeuristic' description: A simple calculation of the number of documents in the foreground sample with a term divided by the number of documents in the background with the term. script_heuristic: allOf: - $ref: '#/components/schemas/_types.aggregations.ScriptedHeuristic' description: 'Customized score, implemented via a script.' p_value: allOf: - $ref: '#/components/schemas/_types.aggregations.PValueHeuristic' description: "Significant terms heuristic that calculates the p-value between the term existing in foreground and background sets.\n\nThe p-value is the probability of obtaining test results at least as extreme as\nthe results actually observed, under the assumption that the null hypothesis is\ncorrect. The p-value is calculated assuming that the foreground set and the\nbackground set are independent https://en.wikipedia.org/wiki/Bernoulli_trial, with the null\nhypothesis that the probabilities are the same." shard_min_doc_count: type: number description: "Regulates the certainty a shard has if the term should actually be added to the candidate list or not with respect to the `min_doc_count`.\nTerms will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`." shard_size: type: number description: "Can be used to control the volumes of candidate terms produced by each shard.\nBy default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter." size: type: number description: The number of buckets returned out of the overall terms list. x-model: true _types.aggregations.ChiSquareHeuristic: required: - background_is_superset - include_negatives type: object properties: background_is_superset: type: boolean description: Set to `false` if you defined a custom background filter that represents a different set of documents that you want to compare to. include_negatives: type: boolean description: Set to `false` to filter out the terms that appear less often in the subset than in documents outside the subset. _types.aggregations.TermsAggregationExecutionHint: enum: - map - global_ordinals - global_ordinals_hash - global_ordinals_low_cardinality type: string _types.aggregations.GoogleNormalizedDistanceHeuristic: type: object properties: background_is_superset: type: boolean description: Set to `false` if you defined a custom background filter that represents a different set of documents that you want to compare to. _types.aggregations.MutualInformationHeuristic: type: object properties: background_is_superset: type: boolean description: Set to `false` if you defined a custom background filter that represents a different set of documents that you want to compare to. include_negatives: type: boolean description: Set to `false` to filter out the terms that appear less often in the subset than in documents outside the subset. _types.aggregations.PercentageScoreHeuristic: type: object _types.aggregations.ScriptedHeuristic: required: - script type: object properties: script: allOf: - $ref: '#/components/schemas/_types.Script' _types.aggregations.PValueHeuristic: type: object properties: background_is_superset: type: boolean normalize_above: type: number description: "Should the results be normalized when above the given value.\nAllows for consistent significance results at various scales.\nNote: `0` is a special value which means no normalization" default: 0 _types.aggregations.SignificantTextAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: background_filter: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: 'A background filter that can be used to focus in on significant terms within a narrower context, instead of the entire index.' chi_square: allOf: - $ref: '#/components/schemas/_types.aggregations.ChiSquareHeuristic' description: 'Use Chi square, as described in "Information Retrieval", Manning et al., Chapter 13.5.2, as the significance score.' exclude: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsExclude' description: Values to exclude. execution_hint: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsAggregationExecutionHint' description: Determines whether the aggregation will use field values directly or global ordinals. field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field from which to return significant text. filter_duplicate_text: type: boolean description: Whether to out duplicate text to deal with noisy data. gnd: allOf: - $ref: '#/components/schemas/_types.aggregations.GoogleNormalizedDistanceHeuristic' description: 'Use Google normalized distance as described in "The Google Similarity Distance", Cilibrasi and Vitanyi, 2007, as the significance score.' include: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsInclude' description: Values to include. jlh: allOf: - $ref: '#/components/schemas/_types.EmptyObject' description: Use JLH score as the significance score. min_doc_count: type: number description: Only return values that are found in more than `min_doc_count` hits. default: 3 mutual_information: allOf: - $ref: '#/components/schemas/_types.aggregations.MutualInformationHeuristic' description: 'Use mutual information as described in "Information Retrieval", Manning et al., Chapter 13.5.1, as the significance score.' percentage: allOf: - $ref: '#/components/schemas/_types.aggregations.PercentageScoreHeuristic' description: A simple calculation of the number of documents in the foreground sample with a term divided by the number of documents in the background with the term. script_heuristic: allOf: - $ref: '#/components/schemas/_types.aggregations.ScriptedHeuristic' description: 'Customized score, implemented via a script.' shard_min_doc_count: type: number description: "Regulates the certainty a shard has if the values should actually be added to the candidate list or not with respect to the min_doc_count.\nValues will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`." shard_size: type: number description: "The number of candidate terms produced by each shard.\nBy default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter." size: type: number description: The number of buckets returned out of the overall terms list. source_fields: allOf: - $ref: '#/components/schemas/_types.Fields' description: Overrides the JSON `_source` fields from which text will be analyzed. x-model: true _types.aggregations.StatsAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.FormatMetricAggregationBase' - type: object _types.aggregations.StatsBucketAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.PipelineAggregationBase' - type: object _types.aggregations.StringStatsAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.MetricAggregationBase' - type: object properties: show_distribution: type: boolean description: Shows the probability distribution for all characters. default: false _types.aggregations.SumAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.FormatMetricAggregationBase' - type: object _types.aggregations.SumBucketAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.PipelineAggregationBase' - type: object x-model: true _types.aggregations.TermsAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: collect_mode: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsAggregationCollectMode' description: "Determines how child aggregations should be calculated: breadth-first or depth-first.\n\nSupported values include:\n - `depth_first`: Expands all branches of the aggregation tree in one depth-first pass, before any pruning occurs.\n - `breadth_first`: Caches the set of documents that fall into the uppermost buckets for subsequent replay.\n\n" exclude: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsExclude' description: "Values to exclude.\nAccepts regular expressions and partitions." execution_hint: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsAggregationExecutionHint' description: Determines whether the aggregation will use field values directly or global ordinals. field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field from which to return terms. include: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsInclude' description: "Values to include.\nAccepts regular expressions and partitions." min_doc_count: type: number description: Only return values that are found in more than `min_doc_count` hits. default: 1 missing: allOf: - $ref: '#/components/schemas/_types.aggregations.Missing' description: "The value to apply to documents that do not have a value.\nBy default, documents without a value are ignored." missing_order: allOf: - $ref: '#/components/schemas/_types.aggregations.MissingOrder' missing_bucket: type: boolean value_type: type: string description: Coerced unmapped fields into the specified type. order: allOf: - $ref: '#/components/schemas/_types.aggregations.AggregateOrder' description: "Specifies the sort order of the buckets.\nDefaults to sorting by descending document count." script: allOf: - $ref: '#/components/schemas/_types.Script' shard_min_doc_count: type: number description: "Regulates the certainty a shard has if the term should actually be added to the candidate list or not with respect to the `min_doc_count`.\nTerms will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`." shard_size: type: number description: "The number of candidate terms produced by each shard.\nBy default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter." show_term_doc_count_error: type: boolean description: 'Set to `true` to return the `doc_count_error_upper_bound`, which is an upper bound to the error on the `doc_count` returned by each shard.' size: type: number description: The number of buckets returned out of the overall terms list. default: 10 format: type: string x-model: true _types.aggregations.TimeSeriesAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: size: type: number description: The maximum number of results to return. default: 10000 keyed: type: boolean description: Set to `true` to associate a unique string key with each bucket and returns the ranges as a hash rather than an array. _types.aggregations.TopHitsAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.MetricAggregationBase' - type: object properties: docvalue_fields: type: array items: $ref: '#/components/schemas/_types.query_dsl.FieldAndFormat' description: Fields for which to return doc values. explain: type: boolean description: 'If `true`, returns detailed information about score computation as part of a hit.' default: false fields: type: array items: $ref: '#/components/schemas/_types.query_dsl.FieldAndFormat' description: "Array of wildcard (*) patterns. The request returns values for field names\nmatching these patterns in the hits.fields property of the response." from: type: number description: Starting document offset. default: 0 highlight: allOf: - $ref: '#/components/schemas/_global.search._types.Highlight' description: Specifies the highlighter to use for retrieving highlighted snippets from one or more fields in the search results. script_fields: type: object additionalProperties: $ref: '#/components/schemas/_types.ScriptField' description: Returns the result of one or more script evaluations for each hit. size: type: number description: The maximum number of top matching hits to return per bucket. default: 3 sort: allOf: - $ref: '#/components/schemas/_types.Sort' description: "Sort order of the top matching hits.\nBy default, the hits are sorted by the score of the main query." _source: allOf: - $ref: '#/components/schemas/_global.search._types.SourceConfig' description: Selects the fields of the source that are returned. stored_fields: allOf: - $ref: '#/components/schemas/_types.Fields' description: Returns values for the specified stored fields (fields that use the `store` mapping option). track_scores: type: boolean description: 'If `true`, calculates and returns document scores, even if the scores are not used for sorting.' default: false version: type: boolean description: 'If `true`, returns document version as part of a hit.' default: false seq_no_primary_term: type: boolean description: 'If `true`, returns sequence number and primary term of the last modification of each hit.' _types.aggregations.TTestAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.Aggregation' - type: object properties: a: allOf: - $ref: '#/components/schemas/_types.aggregations.TestPopulation' description: Test population A. b: allOf: - $ref: '#/components/schemas/_types.aggregations.TestPopulation' description: Test population B. type: allOf: - $ref: '#/components/schemas/_types.aggregations.TTestType' description: "The type of test.\n\nSupported values include:\n - `paired`: Performs paired t-test.\n - `homoscedastic`: Performs two-sample equal variance test.\n - `heteroscedastic`: Performs two-sample unequal variance test.\n\n" default: heteroscedastic _types.aggregations.TestPopulation: required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field to aggregate. script: allOf: - $ref: '#/components/schemas/_types.Script' filter: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: A filter used to define a set of records to run unpaired t-test on. _types.aggregations.TTestType: enum: - paired - homoscedastic - heteroscedastic type: string _types.aggregations.TopMetricsAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.Aggregation' - type: object properties: metrics: oneOf: - $ref: '#/components/schemas/_types.aggregations.TopMetricsValue' - type: array items: $ref: '#/components/schemas/_types.aggregations.TopMetricsValue' description: The fields of the top document to return. size: type: number description: The number of top documents from which to return metrics. default: 1 sort: allOf: - $ref: '#/components/schemas/_types.Sort' description: The sort order of the documents. _types.aggregations.TopMetricsValue: required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: A field to return as a metric. missing: allOf: - $ref: '#/components/schemas/_types.aggregations.Missing' description: "The value to treat a document as having when it has no value for the field.\nBy default, a document that is missing any of the metrics or the sort value is ignored." _types.aggregations.ValueCountAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.FormattableMetricAggregation' - type: object _types.aggregations.FormattableMetricAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.MetricAggregationBase' - type: object properties: format: type: string _types.aggregations.WeightedAverageAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.Aggregation' - type: object properties: format: type: string description: A numeric response formatter. value: allOf: - $ref: '#/components/schemas/_types.aggregations.WeightedAverageValue' description: Configuration for the field that provides the values. value_type: allOf: - $ref: '#/components/schemas/_types.aggregations.ValueType' weight: allOf: - $ref: '#/components/schemas/_types.aggregations.WeightedAverageValue' description: Configuration for the field or script that provides the weights. _types.aggregations.WeightedAverageValue: type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field from which to extract the values or weights. missing: type: number description: A value or weight to use if the field is missing. script: allOf: - $ref: '#/components/schemas/_types.Script' _types.aggregations.VariableWidthHistogramAggregation: type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The name of the field. buckets: type: number description: The target number of buckets. default: 10 shard_size: type: number description: "The number of buckets that the coordinating node will request from each shard.\nDefaults to `buckets * 50`." initial_buffer: type: number description: "Specifies the number of individual documents that will be stored in memory on a shard before the initial bucketing algorithm is run.\nDefaults to `min(10 * shard_size, 50000)`." script: allOf: - $ref: '#/components/schemas/_types.Script' _global.search._types.TrackHits: type: - boolean - number description: "Number of hits matching the query to count accurately. If true, the exact\nnumber of hits is returned at the cost of some performance. If false, the\nresponse does not include the total number of hits matching the query.\nDefaults to 10,000 hits." _types.KnnSearch: required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The name of the vector field to search against query_vector: allOf: - $ref: '#/components/schemas/_types.QueryVector' description: The query vector query_vector_builder: allOf: - $ref: '#/components/schemas/_types.QueryVectorBuilder' description: 'The query vector builder. You must provide a query_vector_builder or query_vector, but not both.' k: type: number description: The final number of nearest neighbors to return as top hits num_candidates: type: number description: The number of nearest neighbor candidates to consider per shard visit_percentage: type: number description: The percentage of vectors to explore per shard while doing knn search with bbq_disk x-state: Generally available; Added in 9.2.0 boost: type: number description: Boost value to apply to kNN scores filter: oneOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' - type: array items: $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: Filters for the kNN search query similarity: type: number description: The minimum similarity for a vector to be considered a match inner_hits: allOf: - $ref: '#/components/schemas/_global.search._types.InnerHits' description: 'If defined, each search hit will contain inner hits.' externalDocs: url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/retrieve-inner-hits rescore_vector: allOf: - $ref: '#/components/schemas/_types.RescoreVector' description: Apply oversampling and rescoring to quantized vectors x-state: Generally available; Added in 8.18.0 _name: type: string _types.RankContainer: maxProperties: 1 minProperties: 1 type: object properties: rrf: allOf: - $ref: '#/components/schemas/_types.RrfRank' description: The reciprocal rank fusion parameters externalDocs: url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/reciprocal-rank-fusion _types.RrfRank: allOf: - $ref: '#/components/schemas/_types.RankBase' - type: object properties: rank_constant: type: number description: How much influence documents in individual result sets per query have over the final ranked result set rank_window_size: type: number description: Size of the individual result sets per query _types.RankBase: type: object _global.search._types.Rescore: allOf: - type: object properties: window_size: type: number - maxProperties: 1 minProperties: 1 type: object properties: query: allOf: - $ref: '#/components/schemas/_global.search._types.RescoreQuery' learning_to_rank: allOf: - $ref: '#/components/schemas/_global.search._types.LearningToRank' script: allOf: - $ref: '#/components/schemas/_global.search._types.ScriptRescore' _global.search._types.RescoreQuery: required: - rescore_query type: object properties: rescore_query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: "The query to use for rescoring.\nThis query is only run on the Top-K results returned by the `query` and `post_filter` phases." query_weight: type: number description: Relative importance of the original query versus the rescore query. default: 1 rescore_query_weight: type: number description: Relative importance of the rescore query versus the original query. default: 1 score_mode: allOf: - $ref: '#/components/schemas/_global.search._types.ScoreMode' description: "Determines how scores are combined.\n\nSupported values include:\n - `avg`: Average the original score and the rescore query score.\n - `max`: Take the max of original score and the rescore query score.\n - `min`: Take the min of the original score and the rescore query score.\n - `multiply`: Multiply the original score by the rescore query score.\nUseful for `function` query rescores.\n - `total`: Add the original score and the rescore query score.\n\n" default: total _global.search._types.ScoreMode: enum: - avg - max - min - multiply - total type: string _global.search._types.LearningToRank: required: - model_id type: object properties: model_id: type: string description: The unique identifier of the trained model uploaded to Elasticsearch params: type: object additionalProperties: type: object description: Named parameters to be passed to the query templates used for feature _global.search._types.ScriptRescore: required: - script type: object properties: script: allOf: - $ref: '#/components/schemas/_types.Script' _types.RetrieverContainer: maxProperties: 1 minProperties: 1 type: object properties: standard: allOf: - $ref: '#/components/schemas/_types.StandardRetriever' description: A retriever that replaces the functionality of a traditional query. knn: allOf: - $ref: '#/components/schemas/_types.KnnRetriever' description: A retriever that replaces the functionality of a knn search. rrf: allOf: - $ref: '#/components/schemas/_types.RRFRetriever' description: A retriever that produces top documents from reciprocal rank fusion (RRF). text_similarity_reranker: allOf: - $ref: '#/components/schemas/_types.TextSimilarityReranker' description: A retriever that reranks the top documents based on a reranking model using the InferenceAPI rule: allOf: - $ref: '#/components/schemas/_types.RuleRetriever' description: A retriever that replaces the functionality of a rule query. rescorer: allOf: - $ref: '#/components/schemas/_types.RescorerRetriever' description: A retriever that re-scores only the results produced by its child retriever. linear: allOf: - $ref: '#/components/schemas/_types.LinearRetriever' description: A retriever that supports the combination of different retrievers through a weighted linear combination. pinned: allOf: - $ref: '#/components/schemas/_types.PinnedRetriever' description: "A pinned retriever applies pinned documents to the underlying retriever.\nThis retriever will rewrite to a PinnedQueryBuilder." diversify: allOf: - $ref: '#/components/schemas/_types.DiversifyRetriever' description: A retriever that diversifies the results from its child retriever. _types.StandardRetriever: allOf: - $ref: '#/components/schemas/_types.RetrieverBase' - type: object properties: query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: Defines a query to retrieve a set of top documents. search_after: allOf: - $ref: '#/components/schemas/_types.SortResults' description: Defines a search after object parameter used for pagination. terminate_after: type: number description: Maximum number of documents to collect for each shard. sort: allOf: - $ref: '#/components/schemas/_types.Sort' description: A sort object that that specifies the order of matching documents. collapse: allOf: - $ref: '#/components/schemas/_global.search._types.FieldCollapse' description: Collapses the top documents by a specified key into a single top document per key. _types.RetrieverBase: type: object properties: filter: oneOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' - type: array items: $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: Query to filter the documents that can match. min_score: type: number description: Minimum _score for matching documents. Documents with a lower _score are not included in the top documents. _name: type: string description: Retriever name. _types.KnnRetriever: allOf: - $ref: '#/components/schemas/_types.RetrieverBase' - required: - field - k type: object properties: field: type: string description: The name of the vector field to search against. query_vector: allOf: - $ref: '#/components/schemas/_types.QueryVector' description: 'Query vector. Must have the same number of dimensions as the vector field you are searching against. You must provide a query_vector_builder or query_vector, but not both.' query_vector_builder: allOf: - $ref: '#/components/schemas/_types.QueryVectorBuilder' description: Defines a model to build a query vector. k: type: number description: Number of nearest neighbors to return as top hits. num_candidates: type: number description: Number of nearest neighbor candidates to consider per shard. visit_percentage: type: number description: The percentage of vectors to explore per shard while doing knn search with bbq_disk x-state: Generally available; Added in 9.2.0 similarity: type: number description: The minimum similarity required for a document to be considered a match. rescore_vector: allOf: - $ref: '#/components/schemas/_types.RescoreVector' description: Apply oversampling and rescoring to quantized vectors x-state: Generally available; Added in 8.18.0 _types.RRFRetriever: allOf: - $ref: '#/components/schemas/_types.RetrieverBase' - required: - retrievers type: object properties: retrievers: type: array items: $ref: '#/components/schemas/_types.RRFRetrieverEntry' description: A list of child retrievers to specify which sets of returned top documents will have the RRF formula applied to them. Each retriever can optionally include a weight parameter. rank_constant: type: number description: This value determines how much influence documents in individual result sets per query have over the final ranked result set. rank_window_size: type: number description: This value determines the size of the individual result sets per query. query: type: string fields: type: array items: type: string _types.RRFRetrieverEntry: oneOf: - $ref: '#/components/schemas/_types.RetrieverContainer' - $ref: '#/components/schemas/_types.RRFRetrieverComponent' description: Either a direct RetrieverContainer (backward compatible) or an RRFRetrieverComponent with weight. _types.RRFRetrieverComponent: required: - retriever type: object properties: retriever: allOf: - $ref: '#/components/schemas/_types.RetrieverContainer' description: The nested retriever configuration. weight: type: number description: Weight multiplier for this retriever's contribution to the RRF score. Higher values increase influence. Defaults to 1.0 if not specified. Must be non-negative. default: 1 description: Wraps a retriever with an optional weight for RRF scoring. _types.TextSimilarityReranker: allOf: - $ref: '#/components/schemas/_types.RetrieverBase' - required: - retriever - inference_text - field type: object properties: retriever: allOf: - $ref: '#/components/schemas/_types.RetrieverContainer' description: 'The nested retriever which will produce the first-level results, that will later be used for reranking.' rank_window_size: type: number description: This value determines how many documents we will consider from the nested retriever. inference_id: type: string description: Unique identifier of the inference endpoint created using the inference API. inference_text: type: string description: The text snippet used as the basis for similarity comparison. field: type: string description: The document field to be used for text similarity comparisons. This field should contain the text that will be evaluated against the inference_text. chunk_rescorer: allOf: - $ref: '#/components/schemas/_types.ChunkRescorer' description: Whether to rescore on only the best matching chunks. x-state: Generally available; Added in 9.2.0 _types.ChunkRescorer: type: object properties: size: type: number description: The number of chunks per document to evaluate for reranking. chunking_settings: allOf: - $ref: '#/components/schemas/_types.mapping.ChunkRescorerChunkingSettings' description: Chunking settings to apply _types.mapping.ChunkRescorerChunkingSettings: required: - max_chunk_size type: object properties: max_chunk_size: type: number description: "The maximum size of a chunk in words.\nThis value cannot be lower than `20` (for `sentence` strategy) or `10` (for `word` strategy).\nThis value should not exceed the window size for the associated model." default: 250 overlap: type: number description: "The number of overlapping words for chunks.\nIt is applicable only to a `word` chunking strategy.\nThis value cannot be higher than half the `max_chunk_size` value." default: 100 sentence_overlap: type: number description: "The number of overlapping sentences for chunks.\nIt is applicable only for a `sentence` chunking strategy.\nIt can be either `1` or `0`." default: 1 separator_group: type: string description: "Only applicable to the `recursive` strategy and required when using it.\n\nSets a predefined list of separators in the saved chunking settings based on the selected text type.\nValues can be `markdown` or `plaintext`.\n\nUsing this parameter is an alternative to manually specifying a custom `separators` list." separators: type: array items: type: string description: "Only applicable to the `recursive` strategy and required when using it.\n\nA list of strings used as possible split points when chunking text.\n\nEach string can be a plain string or a regular expression (regex) pattern.\nThe system tries each separator in order to split the text, starting from the first item in the list.\n\nAfter splitting, it attempts to recombine smaller pieces into larger chunks that stay within\nthe `max_chunk_size` limit, to reduce the total number of chunks generated." strategy: type: string description: "The chunking strategy: `sentence`, `word`, `none` or `recursive`.\n\n * If `strategy` is set to `recursive`, you must also specify:\n\n- `max_chunk_size`\n- either `separators` or`separator_group`\n\nLearn more about different chunking strategies in the linked documentation." default: sentence externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#chunking-strategies _types.RuleRetriever: allOf: - $ref: '#/components/schemas/_types.RetrieverBase' - required: - ruleset_ids - match_criteria - retriever type: object properties: ruleset_ids: oneOf: - $ref: '#/components/schemas/_types.Id' - type: array items: $ref: '#/components/schemas/_types.Id' description: The ruleset IDs containing the rules this retriever is evaluating against. match_criteria: type: object description: The match criteria that will determine if a rule in the provided rulesets should be applied. retriever: allOf: - $ref: '#/components/schemas/_types.RetrieverContainer' description: The retriever whose results rules should be applied to. rank_window_size: type: number description: This value determines the size of the individual result set. _types.RescorerRetriever: allOf: - $ref: '#/components/schemas/_types.RetrieverBase' - required: - retriever - rescore type: object properties: retriever: allOf: - $ref: '#/components/schemas/_types.RetrieverContainer' description: Inner retriever. rescore: oneOf: - $ref: '#/components/schemas/_global.search._types.Rescore' - type: array items: $ref: '#/components/schemas/_global.search._types.Rescore' _types.LinearRetriever: allOf: - $ref: '#/components/schemas/_types.RetrieverBase' - type: object properties: retrievers: type: array items: $ref: '#/components/schemas/_types.InnerRetriever' description: Inner retrievers. rank_window_size: type: number query: type: string fields: type: array items: type: string normalizer: allOf: - $ref: '#/components/schemas/_types.ScoreNormalizer' _types.InnerRetriever: required: - retriever type: object properties: retriever: allOf: - $ref: '#/components/schemas/_types.RetrieverContainer' description: The nested retriever configuration. weight: type: number description: "Weight multiplier for this retriever's contribution to the linear combination.\nMust be non-negative." default: 1 normalizer: allOf: - $ref: '#/components/schemas/_types.ScoreNormalizer' description: "Score normalizer to apply to this retriever's results before weighting.\nFalls back to the top-level `normalizer` on the linear retriever if unset,\nthen to `none` (identity) if neither is set." default: none _types.ScoreNormalizer: enum: - none - minmax - l2_norm type: string _types.PinnedRetriever: allOf: - $ref: '#/components/schemas/_types.RetrieverBase' - required: - retriever type: object properties: retriever: allOf: - $ref: '#/components/schemas/_types.RetrieverContainer' description: Inner retriever. ids: type: array items: type: string docs: type: array items: $ref: '#/components/schemas/_types.SpecifiedDocument' rank_window_size: type: number _types.SpecifiedDocument: required: - id type: object properties: index: allOf: - $ref: '#/components/schemas/_types.IndexName' id: allOf: - $ref: '#/components/schemas/_types.Id' _types.DiversifyRetriever: allOf: - $ref: '#/components/schemas/_types.RetrieverBase' - required: - type - field - retriever type: object properties: type: allOf: - $ref: '#/components/schemas/_types.DiversifyRetrieverTypes' description: The diversification strategy to apply. field: type: string description: The document field on which to diversify results on. retriever: allOf: - $ref: '#/components/schemas/_types.RetrieverContainer' description: The nested retriever whose results will be diversified. size: type: number description: The number of top documents to return after diversification. rank_window_size: type: number description: The number of top documents from the nested retriever to consider for diversification. query_vector: allOf: - $ref: '#/components/schemas/_types.QueryVector' description: The query vector used for diversification. query_vector_builder: allOf: - $ref: '#/components/schemas/_types.QueryVectorBuilder' description: a dense vector query vector builder to use instead of a static query_vector lambda: type: number description: 'Controls the trade-off between relevance and diversity for MMR. A value of 0.0 focuses solely on diversity, while a value of 1.0 focuses solely on relevance. Required for MMR' _types.DiversifyRetrieverTypes: enum: - mmr type: string _types.SlicedScroll: required: - id - max type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' id: allOf: - $ref: '#/components/schemas/_types.Id' max: type: number _global.search._types.Suggester: type: object properties: text: type: string description: 'Global suggest text, to avoid repetition when the same text is used in several suggesters' _global.search._types.PointInTimeReference: required: - id type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' keep_alive: allOf: - $ref: '#/components/schemas/_types.Duration' _types.mapping.RuntimeFields: type: object additionalProperties: $ref: '#/components/schemas/_types.mapping.RuntimeField' _types.mapping.RuntimeField: required: - type type: object properties: fields: type: object additionalProperties: $ref: '#/components/schemas/_types.mapping.CompositeSubField' description: For type `composite` fetch_fields: type: array items: $ref: '#/components/schemas/_types.mapping.RuntimeFieldFetchFields' description: For type `lookup` format: type: string description: A custom format for `date` type runtime fields. input_field: allOf: - $ref: '#/components/schemas/_types.Field' description: For type `lookup` target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: For type `lookup` target_index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: For type `lookup` script: allOf: - $ref: '#/components/schemas/_types.Script' description: Painless script executed at query time. on_script_error: allOf: - $ref: '#/components/schemas/_types.mapping.OnScriptError' type: allOf: - $ref: '#/components/schemas/_types.mapping.RuntimeFieldType' description: 'Field type, which can be: `boolean`, `composite`, `date`, `double`, `geo_point`, `ip`,`keyword`, `long`, or `lookup`.' _types.mapping.CompositeSubField: required: - type type: object properties: type: allOf: - $ref: '#/components/schemas/_types.mapping.RuntimeFieldType' _types.mapping.RuntimeFieldType: enum: - boolean - composite - date - double - geo_point - geo_shape - ip - keyword - long - lookup type: string _types.mapping.RuntimeFieldFetchFields: required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' format: type: string _types.mapping.OnScriptError: enum: - fail - continue type: string _types.ScrollId: type: string _global.search._types.Suggest: oneOf: - $ref: '#/components/schemas/_global.search._types.CompletionSuggest' - $ref: '#/components/schemas/_global.search._types.PhraseSuggest' - $ref: '#/components/schemas/_global.search._types.TermSuggest' _global.search._types.CompletionSuggest: allOf: - $ref: '#/components/schemas/_global.search._types.SuggestBase' - required: - options type: object properties: options: oneOf: - $ref: '#/components/schemas/_global.search._types.CompletionSuggestOption' - type: array items: $ref: '#/components/schemas/_global.search._types.CompletionSuggestOption' _global.search._types.CompletionSuggestOption: required: - text type: object properties: collate_match: type: boolean contexts: type: object additionalProperties: type: array items: $ref: '#/components/schemas/_global.search._types.Context' fields: type: object additionalProperties: type: object _id: type: string _index: allOf: - $ref: '#/components/schemas/_types.IndexName' _routing: type: string _score: type: number _source: type: object text: type: string score: type: number _global.search._types.Context: oneOf: - type: string - $ref: '#/components/schemas/_types.GeoLocation' description: Text or location that we want similar documents for or a lookup to a document's field for the text. _global.search._types.SuggestBase: required: - length - offset - text type: object properties: length: type: number offset: type: number text: type: string _global.search._types.PhraseSuggest: allOf: - $ref: '#/components/schemas/_global.search._types.SuggestBase' - required: - options type: object properties: options: oneOf: - $ref: '#/components/schemas/_global.search._types.PhraseSuggestOption' - type: array items: $ref: '#/components/schemas/_global.search._types.PhraseSuggestOption' _global.search._types.PhraseSuggestOption: required: - text - score type: object properties: text: type: string score: type: number highlighted: type: string collate_match: type: boolean _global.search._types.TermSuggest: allOf: - $ref: '#/components/schemas/_global.search._types.SuggestBase' - required: - options type: object properties: options: oneOf: - $ref: '#/components/schemas/_global.search._types.TermSuggestOption' - type: array items: $ref: '#/components/schemas/_global.search._types.TermSuggestOption' _global.search._types.TermSuggestOption: required: - text - score - freq type: object properties: text: type: string score: type: number freq: type: number highlighted: type: string collate_match: type: boolean async_search._types.AsyncSearchResponseBase: required: - is_partial - is_running - expiration_time_in_millis - start_time_in_millis type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' is_partial: type: boolean description: "When the query is no longer running, this property indicates whether the search failed or was successfully completed on all shards.\nWhile the query is running, `is_partial` is always set to `true`." is_running: type: boolean description: "Indicates whether the search is still running or has completed.\n\n> info\n> If the search failed after some shards returned their results or the node that is coordinating the async search dies, results may be partial even though `is_running` is `false`." expiration_time: allOf: - $ref: '#/components/schemas/_types.DateTime' description: Indicates when the async search will expire. expiration_time_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' start_time: allOf: - $ref: '#/components/schemas/_types.DateTime' start_time_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' completion_time: allOf: - $ref: '#/components/schemas/_types.DateTime' description: "Indicates when the async search completed.\nIt is present only when the search has completed." completion_time_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' error: allOf: - $ref: '#/components/schemas/_types.ErrorCause' async_search._types.AsyncSearchResponseException: required: - is_partial - is_running - expiration_time_in_millis - start_time_in_millis type: object properties: is_partial: type: boolean is_running: type: boolean expiration_time: allOf: - $ref: '#/components/schemas/_types.DateTime' expiration_time_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' start_time: allOf: - $ref: '#/components/schemas/_types.DateTime' start_time_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' completion_time: allOf: - $ref: '#/components/schemas/_types.DateTime' completion_time_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' error: allOf: - $ref: '#/components/schemas/_types.ErrorCause' response: allOf: - $ref: '#/components/schemas/async_search._types.AsyncSearch' async_search.status.StatusResponseBase: allOf: - $ref: '#/components/schemas/async_search._types.AsyncSearchResponseBase' - required: - _shards type: object properties: _shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' description: The number of shards that have run the query so far. _clusters: allOf: - $ref: '#/components/schemas/_types.ClusterStatistics' description: "Metadata about clusters involved in the cross-cluster search.\nIt is not shown for local-only searches." completion_status: type: number description: "If the async search completed, this field shows the status code of the search.\nFor example, `200` indicates that the async search was successfully completed.\n`503` indicates that the async search was completed with an error." _types.Indices: oneOf: - $ref: '#/components/schemas/_types.IndexName' - type: array items: $ref: '#/components/schemas/_types.IndexName' _types.ExpandWildcards: oneOf: - $ref: '#/components/schemas/_types.ExpandWildcard' - type: array items: $ref: '#/components/schemas/_types.ExpandWildcard' _types.ExpandWildcard: enum: - all - open - closed - hidden - none type: string _types.SearchType: enum: - query_then_fetch - dfs_query_then_fetch type: string _types.SuggestMode: enum: - missing - popular - always type: string _global.search._types.SourceConfigParam: oneOf: - type: boolean - $ref: '#/components/schemas/_types.Fields' description: "Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.\nUsed as a query parameter along with the `_source_includes` and `_source_excludes` parameters." _types.Refresh: enum: - 'true' - 'false' - wait_for type: string _types.WaitForActiveShards: oneOf: - type: number - $ref: '#/components/schemas/_types.WaitForActiveShardOptions' _types.WaitForActiveShardOptions: enum: - all - index-setting type: string _global.bulk.OperationContainer: title: Action and metadata maxProperties: 1 minProperties: 1 type: object properties: index: allOf: - $ref: '#/components/schemas/_global.bulk.IndexOperation' description: "Index the specified document.\nIf the document exists, it replaces the document and increments the version.\nThe following line must contain the source data to be indexed." create: allOf: - $ref: '#/components/schemas/_global.bulk.CreateOperation' description: "Index the specified document if it does not already exist.\nThe following line must contain the source data to be indexed." update: allOf: - $ref: '#/components/schemas/_global.bulk.UpdateOperation' description: "Perform a partial document update.\nThe following line must contain the partial document and update options." delete: allOf: - $ref: '#/components/schemas/_global.bulk.DeleteOperation' description: Remove the specified document from the index. description: "An action line, which is the first line of each operation in a bulk request.\nIt specifies the action to perform (`index`, `create`, `update`, or `delete`) and its metadata, such as the target index and document ID.\nAll actions except `delete` expect a source line to follow." _global.bulk.IndexOperation: allOf: - $ref: '#/components/schemas/_global.bulk.WriteOperation' - type: object _global.bulk.WriteOperation: allOf: - $ref: '#/components/schemas/_global.bulk.OperationBase' - type: object properties: dynamic_templates: type: object additionalProperties: type: string description: "A map from the full name of fields to the name of dynamic templates.\nIt defaults to an empty map.\nIf a name matches a dynamic template, that template will be applied regardless of other match predicates defined in the template.\nIf a field is already defined in the mapping, then this parameter won't be used." pipeline: type: string description: "The ID of the pipeline to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request.\nIf a final pipeline is configured, it will always run regardless of the value of this parameter." require_alias: type: boolean description: 'If `true`, the request''s actions must target an index alias.' default: false _global.bulk.OperationBase: type: object properties: _id: allOf: - $ref: '#/components/schemas/_types.Id' description: The document ID. _index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: The name of the index or index alias to perform the action on. routing: type: string description: "A custom value used to route operations to a specific shard, or multiple comma separated values.\nNot allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead." x-state: Generally available if_primary_term: type: number if_seq_no: allOf: - $ref: '#/components/schemas/_types.SequenceNumber' version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' version_type: allOf: - $ref: '#/components/schemas/_types.VersionType' description: "\n\nSupported values include:\n - `internal`: Use internal versioning that starts at 1 and increments with each update or delete.\n - `external`: Only index the document if the specified version is strictly higher than the version of the stored document or if there is no existing document.\n - `external_gte`: Only index the document if the specified version is equal or higher than the version of the stored document or if there is no existing document.\nNOTE: The `external_gte` version type is meant for special use cases and should be used with care.\nIf used incorrectly, it can result in loss of data.\n\n" _global.bulk.CreateOperation: allOf: - $ref: '#/components/schemas/_global.bulk.WriteOperation' - type: object _global.bulk.UpdateOperation: allOf: - $ref: '#/components/schemas/_global.bulk.OperationBase' - type: object properties: require_alias: type: boolean description: 'If `true`, the request''s actions must target an index alias.' default: false retry_on_conflict: type: number description: The number of times an update should be retried in the case of a version conflict. _global.bulk.DeleteOperation: allOf: - $ref: '#/components/schemas/_global.bulk.OperationBase' - type: object _global.bulk.UpdateAction: title: Update source type: object properties: detect_noop: type: boolean description: 'If true, the `result` in the response is set to ''noop'' when no changes to the document occur.' default: true doc: type: object description: A partial update to an existing document. doc_as_upsert: type: boolean description: Set to `true` to use the contents of `doc` as the value of `upsert`. default: false script: allOf: - $ref: '#/components/schemas/_types.Script' description: The script to run to update the document. scripted_upsert: type: boolean description: Set to `true` to run the script whether or not the document exists. default: false _source: allOf: - $ref: '#/components/schemas/_global.search._types.SourceConfig' description: "If `false`, source retrieval is turned off.\nYou can also specify a comma-separated list of the fields you want to retrieve." default: 'true' upsert: type: object description: "If the document does not already exist, the contents of `upsert` are inserted as a new document.\nIf the document exists, the `script` is run." description: "The source line that must follow an `update` action line.\nIt specifies the partial document, script, or upsert options to apply, plus optional update settings." _global.bulk.ResponseItem: required: - _index - status type: object properties: _id: oneOf: - type: string - type: - 'null' - string description: The document ID associated with the operation. _index: type: string description: "The name of the index associated with the operation.\nIf the operation targeted a data stream, this is the backing index into which the document was written." status: type: number description: The HTTP status code returned for the operation. failure_store: allOf: - $ref: '#/components/schemas/_global.bulk.FailureStoreStatus' error: allOf: - $ref: '#/components/schemas/_types.ErrorCause' description: "Additional information about the failed operation.\nThe property is returned only for failed operations." _primary_term: type: number description: "The primary term assigned to the document for the operation.\nThis property is returned only for successful operations." result: type: string description: "The result of the operation.\nPossible values are `created`, `updated`, `deleted`, `noop`, and `not_found`." _seq_no: allOf: - $ref: '#/components/schemas/_types.SequenceNumber' description: "The sequence number assigned to the document for the operation.\nSequence numbers are used to ensure an older version of a document doesn't overwrite a newer version." _shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' description: Shard information for the operation. _version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' description: "The document version associated with the operation.\nThe document version is incremented each time the document is updated.\nThis property is returned only for successful actions." forced_refresh: type: boolean get: allOf: - $ref: '#/components/schemas/_types.InlineGetDictUserDefined' _global.bulk.FailureStoreStatus: enum: - not_applicable_or_unknown - used - not_enabled - failed type: string _types.InlineGetDictUserDefined: required: - found type: object properties: fields: type: object additionalProperties: type: object found: type: boolean _seq_no: allOf: - $ref: '#/components/schemas/_types.SequenceNumber' _primary_term: type: number _routing: allOf: - $ref: '#/components/schemas/_types.Routing' _source: type: object additionalProperties: type: object _types.TaskId: type: string _types.ReindexStatus: required: - batches - deleted - noops - requests_per_second - retries - throttled_millis - throttled_until_millis - total - version_conflicts type: object properties: slice_id: type: number description: The slice ID batches: type: number description: The number of scroll responses pulled back by the reindex. created: type: number description: The number of documents that were successfully created. deleted: type: number description: The number of documents that were successfully deleted. noops: type: number description: The number of documents that were ignored because the script used for the reindex returned a `noop` value for `ctx.op`. requests_per_second: type: number description: The number of requests per second effectively executed during the reindex. retries: allOf: - $ref: '#/components/schemas/_types.Retries' description: The number of retries attempted by reindex. `bulk` is the number of bulk actions retried and `search` is the number of search actions retried. throttled: allOf: - $ref: '#/components/schemas/_types.Duration' throttled_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: Number of milliseconds the request slept to conform to `requests_per_second`. throttled_until: allOf: - $ref: '#/components/schemas/_types.Duration' throttled_until_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: "This field should always be equal to zero in a `_reindex` response.\nIt only has meaning when using the Task API, where it indicates the next time (in milliseconds since epoch) a throttled request will be executed again in order to conform to `requests_per_second`." total: type: number description: The number of documents that were successfully processed. updated: type: number description: 'The number of documents that were successfully updated, for example, a document with same ID already existed prior to reindex updating it.' version_conflicts: type: number description: The number of version conflicts that reindex hits. cancelled: type: string description: The reason for cancellation if the slice was canceled _types.Retries: required: - bulk - search type: object properties: bulk: type: number description: The number of bulk actions retried. search: type: number description: The number of search actions retried. _types.ReindexTaskResult: type: object properties: batches: type: number description: The number of scroll responses pulled back by the reindex. created: type: number description: The number of documents that were successfully created. deleted: type: number description: The number of documents that were successfully deleted. failures: type: array items: $ref: '#/components/schemas/_types.BulkByPaginatedSearchFailure' description: 'Any failures encountered during the reindex. If non-empty, the reindex ended because of these failures.' noops: type: number description: The number of documents that were ignored because the script returned a `noop` value for `ctx.op`. requests_per_second: type: number description: The number of requests per second effectively executed during the reindex. retries: allOf: - $ref: '#/components/schemas/_types.Retries' description: The number of retries attempted by reindex. throttled_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: Number of milliseconds the request slept to conform to `requests_per_second`. throttled_until_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: This field should always be equal to zero in a completed reindex result. timed_out: type: boolean description: Whether any of the requests executed during the reindex timed out. took: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: The total milliseconds the entire operation took. total: type: number description: The number of documents that were successfully processed. updated: type: number description: The number of documents that were successfully updated. version_conflicts: type: number description: The number of version conflicts that occurred. description: "The final result of a completed reindex operation, as stored in the task result.\nThis is the serialized form of `BulkByScrollResponse`." _types.BulkByPaginatedSearchFailure: oneOf: - $ref: '#/components/schemas/_types.BulkIndexByScrollFailure' - $ref: '#/components/schemas/_types.ShardFailure' _types.BulkIndexByScrollFailure: required: - cause - id - index - status type: object properties: cause: allOf: - $ref: '#/components/schemas/_types.ErrorCause' id: allOf: - $ref: '#/components/schemas/_types.Id' index: allOf: - $ref: '#/components/schemas/_types.IndexName' status: type: number _types.Names: oneOf: - $ref: '#/components/schemas/_types.Name' - type: array items: $ref: '#/components/schemas/_types.Name' cat._types.CatAliasesColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatAliasesColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatAliasesColumn' cat._types.CatAliasesColumn: anyOf: - enum: - alias - a - index - i - idx - filter - f - fi - routing.index - ri - routingIndex - routing.search - rs - routingSearch - is_write_index - w - isWriteIndex type: string - type: string _types.Bytes: enum: - b - kb - mb - gb - tb - pb type: string _types.TimeUnit: enum: - nanos - micros - ms - s - m - h - d type: string cat.aliases.AliasesRecord: type: object properties: alias: type: string description: alias name index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: index alias points to filter: type: string description: filter routing.index: type: string description: index routing routing.search: type: string description: search routing is_write_index: type: string description: write index _types.NodeIds: oneOf: - $ref: '#/components/schemas/_types.NodeId' - type: array items: $ref: '#/components/schemas/_types.NodeId' cat._types.CatAllocationColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatAllocationColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatAllocationColumn' cat._types.CatAllocationColumn: anyOf: - enum: - shards - s - shards.undesired - write_load.forecast - wlf - writeLoadForecast - disk.indices.forecast - dif - diskIndicesForecast - disk.indices - di - diskIndices - disk.used - du - diskUsed - disk.avail - da - diskAvail - disk.total - dt - diskTotal - disk.percent - dp - diskPercent - host - h - ip - node - n - node.role - r - role - nodeRole type: string - type: string cat.allocation.AllocationRecord: type: object properties: shards: type: string description: Number of primary and replica shards assigned to the node. shards.undesired: oneOf: - type: string - type: - 'null' - string description: Amount of shards that are scheduled to be moved elsewhere in the cluster or -1 other than desired balance allocator is used write_load.forecast: oneOf: - $ref: '#/components/schemas/_spec_utils.Stringifieddouble' - type: - 'null' - string description: Sum of index write load forecasts disk.indices.forecast: oneOf: - $ref: '#/components/schemas/_types.ByteSize' - type: - 'null' - string description: Sum of shard size forecasts disk.indices: oneOf: - $ref: '#/components/schemas/_types.ByteSize' - type: - 'null' - string description: "Disk space used by the node’s shards. Does not include disk space for the translog or unassigned shards.\nIMPORTANT: This metric double-counts disk space for hard-linked files, such as those created when shrinking, splitting, or cloning an index." disk.used: oneOf: - $ref: '#/components/schemas/_types.ByteSize' - type: - 'null' - string description: "Total disk space in use.\nElasticsearch retrieves this metric from the node’s operating system (OS).\nThe metric includes disk space for: Elasticsearch, including the translog and unassigned shards; the node’s operating system; any other applications or files on the node.\nUnlike `disk.indices`, this metric does not double-count disk space for hard-linked files." disk.avail: oneOf: - $ref: '#/components/schemas/_types.ByteSize' - type: - 'null' - string description: "Free disk space available to Elasticsearch.\nElasticsearch retrieves this metric from the node’s operating system.\nDisk-based shard allocation uses this metric to assign shards to nodes based on available disk space." disk.total: oneOf: - $ref: '#/components/schemas/_types.ByteSize' - type: - 'null' - string description: 'Total disk space for the node, including in-use and available space.' disk.percent: oneOf: - $ref: '#/components/schemas/_types.Percentage' - type: - 'null' - string description: Total percentage of disk space in use. Calculated as `disk.used / disk.total`. host: oneOf: - $ref: '#/components/schemas/_types.Host' - type: - 'null' - string description: Network host for the node. Set using the `network.host` setting. ip: oneOf: - $ref: '#/components/schemas/_types.Ip' - type: - 'null' - string description: IP address and port for the node. node: type: string description: Name for the node. Set using the `node.name` setting. node.role: oneOf: - type: string - type: - 'null' - string description: Node roles _spec_utils.Stringifieddouble: type: - number - string description: "Some APIs will return values such as numbers also as a string (notably epoch timestamps). This behavior\nis used to capture this behavior while keeping the semantics of the field type.\n\nDepending on the target language, code generators can keep the union or remove it and leniently parse\nstrings to the target type." _types.ByteSize: type: - number - string _types.Percentage: type: - number - string _types.Host: type: string _types.Ip: type: string cat._types.CatCircuitBreakerColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatCircuitBreakerColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatCircuitBreakerColumn' cat._types.CatCircuitBreakerColumn: anyOf: - enum: - node_id - id - node_name - nn - breaker - br - limit - l - limit_bytes - lb - estimated - e - estimated_bytes - eb - tripped - t - overhead - o type: string - type: string cat.circuit_breaker.CircuitBreakerRecord: type: object properties: node_id: allOf: - $ref: '#/components/schemas/_types.NodeId' description: Persistent node ID node_name: type: string description: Node name breaker: type: string description: Breaker name limit: type: string description: Limit size limit_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Limit size in bytes estimated: type: string description: Estimated size estimated_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Estimated size in bytes tripped: type: string description: Tripped count overhead: type: string description: Overhead cat._types.CatComponentColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatComponentColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatComponentColumn' cat._types.CatComponentColumn: anyOf: - enum: - name - n - version - v - alias_count - a - mapping_count - m - settings_count - s - metadata_count - me - included_in - i type: string - type: string cat.component_templates.ComponentTemplate: required: - name - version - alias_count - mapping_count - settings_count - metadata_count - included_in type: object properties: name: type: string version: oneOf: - type: string - type: - 'null' - string alias_count: type: string mapping_count: type: string settings_count: type: string metadata_count: type: string included_in: type: string cat._types.CatCountColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatCountColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatCountColumn' cat._types.CatCountColumn: anyOf: - enum: - epoch - t - time - timestamp - ts - hms - hhmmss - count - dc - docs.count - docsCount type: string - type: string cat.count.CountRecord: type: object properties: epoch: allOf: - $ref: '#/components/schemas/_spec_utils.StringifiedEpochTimeUnitSeconds' description: seconds since 1970-01-01 00:00:00 timestamp: allOf: - $ref: '#/components/schemas/_types.TimeOfDay' description: time in HH:MM:SS count: type: string description: the document count _spec_utils.StringifiedEpochTimeUnitSeconds: oneOf: - $ref: '#/components/schemas/_types.EpochTimeUnitSeconds' - type: string description: "Some APIs will return values such as numbers also as a string (notably epoch timestamps). This behavior\nis used to capture this behavior while keeping the semantics of the field type.\n\nDepending on the target language, code generators can keep the union or remove it and leniently parse\nstrings to the target type." _types.EpochTimeUnitSeconds: allOf: - $ref: '#/components/schemas/_types.UnitSeconds' _types.UnitSeconds: type: number description: Time unit for seconds _types.TimeOfDay: type: string description: 'Time of day, expressed as HH:MM:SS' cat._types.CatFieldDataColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatFieldDataColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatFieldDataColumn' cat._types.CatFieldDataColumn: anyOf: - enum: - id - host - h - ip - node - n - field - f - size - s type: string - type: string cat.fielddata.FielddataRecord: type: object properties: id: type: string description: node id host: type: string description: host name ip: type: string description: ip address node: type: string description: node name field: type: string description: field name size: type: string description: field data usage cat._types.CatHealthColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatHealthColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatHealthColumn' cat._types.CatHealthColumn: anyOf: - enum: - epoch - t - time - timestamp - ts - hms - hhmmss - cluster - cl - status - st - node.total - nt - nodeTotal - node.data - nd - nodeData - shards - t - sh - shards.total - shardsTotal - pri - p - shards.primary - shardsPrimary - relo - r - shards.relocating - shardsRelocating - init - i - shards.initializing - shardsInitializing - unassign - u - shards.unassigned - shardsUnassigned - unassign.pri - up - shards.unassigned.primary - shardsUnassignedPrimary - pending_tasks - pt - pendingTasks - max_task_wait_time - mtwt - maxTaskWaitTime - active_shards_percent - asp - activeShardsPercent type: string - type: string cat.health.HealthRecord: type: object properties: epoch: allOf: - $ref: '#/components/schemas/_spec_utils.StringifiedEpochTimeUnitSeconds' description: seconds since 1970-01-01 00:00:00 timestamp: allOf: - $ref: '#/components/schemas/_types.TimeOfDay' description: time in HH:MM:SS cluster: type: string description: cluster name status: type: string description: health status node.total: type: string description: total number of nodes node.data: type: string description: number of nodes that can store data shards: type: string description: total number of shards pri: type: string description: number of primary shards relo: type: string description: number of relocating nodes init: type: string description: number of initializing nodes unassign.pri: type: string description: number of unassigned primary shards unassign: type: string description: number of unassigned shards pending_tasks: type: string description: number of pending tasks max_task_wait_time: type: string description: wait time of longest task pending active_shards_percent: type: string description: active number of shards in percent _types.HealthStatus: enum: - green - GREEN - yellow - YELLOW - red - RED - unknown - unavailable type: string cat._types.CatIndicesColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatIndicesColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatIndicesColumn' cat._types.CatIndicesColumn: anyOf: - enum: - health - h - status - s - index - i - idx - uuid - id - uuid - pri - p - shards.primary - shardsPrimary - rep - r - shards.replica - shardsReplica - docs.count - dc - docsCount - docs.deleted - dd - docsDeleted - creation.date - cd - creation.date.string - cds - store.size - ss - storeSize - pri.store.size - dataset.size - completion.size - cs - completionSize - pri.completion.size - fielddata.memory_size - fm - fielddataMemory - pri.fielddata.memory_size - fielddata.evictions - fe - fielddataEvictions - pri.fielddata.evictions - query_cache.memory_size - qcm - queryCacheMemory - pri.query_cache.memory_size - query_cache.evictions - qce - queryCacheEvictions - pri.query_cache.evictions - request_cache.memory_size - rcm - requestCacheMemory - pri.request_cache.memory_size - request_cache.evictions - rce - requestCacheEvictions - pri.request_cache.evictions - request_cache.hit_count - rchc - requestCacheHitCount - pri.request_cache.hit_count - request_cache.miss_count - rcmc - requestCacheMissCount - pri.request_cache.miss_count - flush.total - ft - flushTotal - pri.flush.total - flush.total_time - ftt - flushTotalTime - pri.flush.total_time - get.current - gc - getCurrent - pri.get.current - get.time - gti - getTime - pri.get.time - get.total - gto - getTotal - pri.get.total - get.exists_time - geti - getExistsTime - pri.get.exists_time - get.exists_total - geto - getExistsTotal - pri.get.exists_total - get.missing_time - gmti - getMissingTime - pri.get.missing_time - get.missing_total - gmto - getMissingTotal - pri.get.missing_total - indexing.delete_current - idc - indexingDeleteCurrent - pri.indexing.delete_current - indexing.delete_time - idti - indexingDeleteTime - pri.indexing.delete_time - indexing.delete_total - idto - indexingDeleteTotal - pri.indexing.delete_total - indexing.index_current - iic - indexingIndexCurrent - pri.indexing.index_current - indexing.index_time - iiti - indexingIndexTime - pri.indexing.index_time - indexing.index_total - iito - indexingIndexTotal - pri.indexing.index_total - indexing.index_failed - iif - indexingIndexFailed - pri.indexing.index_failed - indexing.index_failed_due_to_version_conflict - iifvc - indexingIndexFailedDueToVersionConflict - pri.indexing.index_failed_due_to_version_conflict - merges.current - mc - mergesCurrent - pri.merges.current - merges.current_docs - mcd - mergesCurrentDocs - pri.merges.current_docs - merges.current_size - mcs - mergesCurrentSize - pri.merges.current_size - merges.total - mt - mergesTotal - pri.merges.total - merges.total_docs - mtd - mergesTotalDocs - pri.merges.total_docs - merges.total_size - mts - mergesTotalSize - pri.merges.total_size - merges.total_time - mtt - mergesTotalTime - pri.merges.total_time - refresh.total - rto - refreshTotal - pri.refresh.total - refresh.time - rti - refreshTime - pri.refresh.time - refresh.external_total - rto - refreshTotal - pri.refresh.external_total - refresh.external_time - rti - refreshTime - pri.refresh.external_time - refresh.listeners - rli - refreshListeners - pri.refresh.listeners - search.fetch_current - sfc - searchFetchCurrent - pri.search.fetch_current - search.fetch_time - sfti - searchFetchTime - pri.search.fetch_time - search.fetch_total - sfto - searchFetchTotal - pri.search.fetch_total - search.open_contexts - so - searchOpenContexts - pri.search.open_contexts - search.query_current - sqc - searchQueryCurrent - pri.search.query_current - search.query_time - sqti - searchQueryTime - pri.search.query_time - search.query_total - sqto - searchQueryTotal - pri.search.query_total - search.scroll_current - scc - searchScrollCurrent - pri.search.scroll_current - search.scroll_time - scti - searchScrollTime - pri.search.scroll_time - search.scroll_total - scto - searchScrollTotal - pri.search.scroll_total - segments.count - sc - segmentsCount - pri.segments.count - segments.memory - sm - segmentsMemory - pri.segments.memory - segments.index_writer_memory - siwm - segmentsIndexWriterMemory - pri.segments.index_writer_memory - segments.version_map_memory - svmm - segmentsVersionMapMemory - pri.segments.version_map_memory - segments.fixed_bitset_memory - sfbm - fixedBitsetMemory - pri.segments.fixed_bitset_memory - warmer.current - wc - warmerCurrent - pri.warmer.current - warmer.total - wto - warmerTotal - pri.warmer.total - warmer.total_time - wtt - warmerTotalTime - pri.warmer.total_time - suggest.current - suc - suggestCurrent - pri.suggest.current - suggest.time - suti - suggestTime - pri.suggest.time - suggest.total - suto - suggestTotal - pri.suggest.total - memory.total - tm - memoryTotal - pri.memory.total - bulk.total_operations - bto - bulkTotalOperation - pri.bulk.total_operations - bulk.total_time - btti - bulkTotalTime - pri.bulk.total_time - bulk.total_size_in_bytes - btsi - bulkTotalSizeInBytes - pri.bulk.total_size_in_bytes - bulk.avg_time - bati - bulkAvgTime - pri.bulk.avg_time - bulk.avg_size_in_bytes - basi - bulkAvgSizeInBytes - pri.bulk.avg_size_in_bytes - dense_vector.value_count - dvc - denseVectorCount - pri.dense_vector.value_count - sparse_vector.value_count - svc - sparseVectorCount - pri.sparse_vector.value_count type: string - type: string cat.indices.IndicesRecord: type: object properties: health: type: string description: current health status status: type: string description: open/close status index: type: string description: index name uuid: type: string description: index uuid pri: type: string description: number of primary shards rep: type: string description: number of replica shards docs.count: oneOf: - type: string - type: - 'null' - string description: "The number of documents in the index, including hidden nested documents.\nFor indices with `semantic_text` fields or other nested field types,\nthis count includes the internal nested documents.\nTo get the logical document count (excluding nested documents), use\nthe `_count` API or `_cat/count` API instead." docs.deleted: oneOf: - type: string - type: - 'null' - string description: deleted docs creation.date: type: string description: index creation date (millisecond value) creation.date.string: type: string description: index creation date (as string) store.size: oneOf: - type: string - type: - 'null' - string description: store size of primaries & replicas pri.store.size: oneOf: - type: string - type: - 'null' - string description: store size of primaries dataset.size: oneOf: - type: string - type: - 'null' - string description: total size of dataset (including the cache for partially mounted indices) x-state: Generally available; Added in 8.11.0 completion.size: type: string description: size of completion pri.completion.size: type: string description: size of completion fielddata.memory_size: type: string description: used fielddata cache pri.fielddata.memory_size: type: string description: used fielddata cache fielddata.evictions: type: string description: fielddata evictions pri.fielddata.evictions: type: string description: fielddata evictions query_cache.memory_size: type: string description: used query cache pri.query_cache.memory_size: type: string description: used query cache query_cache.evictions: type: string description: query cache evictions pri.query_cache.evictions: type: string description: query cache evictions request_cache.memory_size: type: string description: used request cache pri.request_cache.memory_size: type: string description: used request cache request_cache.evictions: type: string description: request cache evictions pri.request_cache.evictions: type: string description: request cache evictions request_cache.hit_count: type: string description: request cache hit count pri.request_cache.hit_count: type: string description: request cache hit count request_cache.miss_count: type: string description: request cache miss count pri.request_cache.miss_count: type: string description: request cache miss count flush.total: type: string description: number of flushes pri.flush.total: type: string description: number of flushes flush.total_time: type: string description: time spent in flush pri.flush.total_time: type: string description: time spent in flush get.current: type: string description: number of current get ops pri.get.current: type: string description: number of current get ops get.time: type: string description: time spent in get pri.get.time: type: string description: time spent in get get.total: type: string description: number of get ops pri.get.total: type: string description: number of get ops get.exists_time: type: string description: time spent in successful gets pri.get.exists_time: type: string description: time spent in successful gets get.exists_total: type: string description: number of successful gets pri.get.exists_total: type: string description: number of successful gets get.missing_time: type: string description: time spent in failed gets pri.get.missing_time: type: string description: time spent in failed gets get.missing_total: type: string description: number of failed gets pri.get.missing_total: type: string description: number of failed gets indexing.delete_current: type: string description: number of current deletions pri.indexing.delete_current: type: string description: number of current deletions indexing.delete_time: type: string description: time spent in deletions pri.indexing.delete_time: type: string description: time spent in deletions indexing.delete_total: type: string description: number of delete ops pri.indexing.delete_total: type: string description: number of delete ops indexing.index_current: type: string description: number of current indexing ops pri.indexing.index_current: type: string description: number of current indexing ops indexing.index_time: type: string description: time spent in indexing pri.indexing.index_time: type: string description: time spent in indexing indexing.index_total: type: string description: number of indexing ops pri.indexing.index_total: type: string description: number of indexing ops indexing.index_failed: type: string description: number of failed indexing ops pri.indexing.index_failed: type: string description: number of failed indexing ops merges.current: type: string description: number of current merges pri.merges.current: type: string description: number of current merges merges.current_docs: type: string description: number of current merging docs pri.merges.current_docs: type: string description: number of current merging docs merges.current_size: type: string description: size of current merges pri.merges.current_size: type: string description: size of current merges merges.total: type: string description: number of completed merge ops pri.merges.total: type: string description: number of completed merge ops merges.total_docs: type: string description: docs merged pri.merges.total_docs: type: string description: docs merged merges.total_size: type: string description: size merged pri.merges.total_size: type: string description: size merged merges.total_time: type: string description: time spent in merges pri.merges.total_time: type: string description: time spent in merges refresh.total: type: string description: total refreshes pri.refresh.total: type: string description: total refreshes refresh.time: type: string description: time spent in refreshes pri.refresh.time: type: string description: time spent in refreshes refresh.external_total: type: string description: total external refreshes pri.refresh.external_total: type: string description: total external refreshes refresh.external_time: type: string description: time spent in external refreshes pri.refresh.external_time: type: string description: time spent in external refreshes refresh.listeners: type: string description: number of pending refresh listeners pri.refresh.listeners: type: string description: number of pending refresh listeners search.fetch_current: type: string description: current fetch phase ops pri.search.fetch_current: type: string description: current fetch phase ops search.fetch_time: type: string description: time spent in fetch phase pri.search.fetch_time: type: string description: time spent in fetch phase search.fetch_total: type: string description: total fetch ops pri.search.fetch_total: type: string description: total fetch ops search.open_contexts: type: string description: open search contexts pri.search.open_contexts: type: string description: open search contexts search.query_current: type: string description: current query phase ops pri.search.query_current: type: string description: current query phase ops search.query_time: type: string description: time spent in query phase pri.search.query_time: type: string description: time spent in query phase search.query_total: type: string description: total query phase ops pri.search.query_total: type: string description: total query phase ops search.scroll_current: type: string description: open scroll contexts pri.search.scroll_current: type: string description: open scroll contexts search.scroll_time: type: string description: time scroll contexts held open pri.search.scroll_time: type: string description: time scroll contexts held open search.scroll_total: type: string description: completed scroll contexts pri.search.scroll_total: type: string description: completed scroll contexts segments.count: type: string description: number of segments pri.segments.count: type: string description: number of segments segments.memory: type: string description: memory used by segments pri.segments.memory: type: string description: memory used by segments segments.index_writer_memory: type: string description: memory used by index writer pri.segments.index_writer_memory: type: string description: memory used by index writer segments.version_map_memory: type: string description: memory used by version map pri.segments.version_map_memory: type: string description: memory used by version map segments.fixed_bitset_memory: type: string description: memory used by fixed bit sets for nested object field types and export type filters for types referred in _parent fields pri.segments.fixed_bitset_memory: type: string description: memory used by fixed bit sets for nested object field types and export type filters for types referred in _parent fields warmer.current: type: string description: current warmer ops pri.warmer.current: type: string description: current warmer ops warmer.total: type: string description: total warmer ops pri.warmer.total: type: string description: total warmer ops warmer.total_time: type: string description: time spent in warmers pri.warmer.total_time: type: string description: time spent in warmers suggest.current: type: string description: number of current suggest ops pri.suggest.current: type: string description: number of current suggest ops suggest.time: type: string description: time spend in suggest pri.suggest.time: type: string description: time spend in suggest suggest.total: type: string description: number of suggest ops pri.suggest.total: type: string description: number of suggest ops memory.total: type: string description: total used memory pri.memory.total: type: string description: total user memory search.throttled: type: string description: indicates if the index is search throttled bulk.total_operations: type: string description: number of bulk shard ops pri.bulk.total_operations: type: string description: number of bulk shard ops bulk.total_time: type: string description: time spend in shard bulk pri.bulk.total_time: type: string description: time spend in shard bulk bulk.total_size_in_bytes: type: string description: total size in bytes of shard bulk pri.bulk.total_size_in_bytes: type: string description: total size in bytes of shard bulk bulk.avg_time: type: string description: average time spend in shard bulk pri.bulk.avg_time: type: string description: average time spend in shard bulk bulk.avg_size_in_bytes: type: string description: average size in bytes of shard bulk pri.bulk.avg_size_in_bytes: type: string description: average size in bytes of shard bulk cat._types.CatMasterColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatMasterColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatMasterColumn' cat._types.CatMasterColumn: anyOf: - enum: - id - host - h - ip - node - n type: string - type: string cat.master.MasterRecord: type: object properties: id: type: string description: node id host: type: string description: host name ip: type: string description: ip address node: type: string description: node name cat._types.CatDfaColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatDfaColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatDfaColumn' cat._types.CatDfaColumn: type: string cat.ml_data_frame_analytics.DataFrameAnalyticsRecord: type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: The identifier for the job. type: type: string description: The type of analysis that the job performs. create_time: type: string description: The time when the job was created. version: allOf: - $ref: '#/components/schemas/_types.VersionString' description: The version of Elasticsearch when the job was created. source_index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: The name of the source index. dest_index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: The name of the destination index. description: type: string description: A description of the job. model_memory_limit: type: string description: The approximate maximum amount of memory resources that are permitted for the job. state: type: string description: The current status of the job. failure_reason: type: string description: Messages about the reason why the job failed. progress: type: string description: The progress report for the job by phase. assignment_explanation: type: string description: Messages related to the selection of a node. node.id: allOf: - $ref: '#/components/schemas/_types.Id' description: The unique identifier of the assigned node. node.name: allOf: - $ref: '#/components/schemas/_types.Name' description: The name of the assigned node. node.ephemeral_id: allOf: - $ref: '#/components/schemas/_types.Id' description: The ephemeral identifier of the assigned node. node.address: type: string description: The network address of the assigned node. _types.VersionString: type: string cat._types.CatDatafeedColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatDatafeedColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatDatafeedColumn' cat._types.CatDatafeedColumn: type: string cat.ml_datafeeds.DatafeedsRecord: type: object properties: id: type: string description: The datafeed identifier. state: allOf: - $ref: '#/components/schemas/ml._types.DatafeedState' description: The status of the datafeed. assignment_explanation: type: string description: 'For started datafeeds only, contains messages relating to the selection of a node.' buckets.count: type: string description: The number of buckets processed. search.count: type: string description: The number of searches run by the datafeed. search.time: type: string description: 'The total time the datafeed spent searching, in milliseconds.' search.bucket_avg: type: string description: 'The average search time per bucket, in milliseconds.' search.exp_avg_hour: type: string description: 'The exponential average search time per hour, in milliseconds.' node.id: type: string description: "The unique identifier of the assigned node.\nFor started datafeeds only, this information pertains to the node upon which the datafeed is started." node.name: type: string description: "The name of the assigned node.\nFor started datafeeds only, this information pertains to the node upon which the datafeed is started." node.ephemeral_id: type: string description: "The ephemeral identifier of the assigned node.\nFor started datafeeds only, this information pertains to the node upon which the datafeed is started." node.address: type: string description: "The network address of the assigned node.\nFor started datafeeds only, this information pertains to the node upon which the datafeed is started." ml._types.DatafeedState: enum: - started - stopped - starting - stopping type: string cat._types.CatAnomalyDetectorColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatAnomalyDetectorColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatAnomalyDetectorColumn' cat._types.CatAnomalyDetectorColumn: type: string cat.ml_jobs.JobsRecord: type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: The anomaly detection job identifier. state: allOf: - $ref: '#/components/schemas/ml._types.JobState' description: "The status of the anomaly detection job.\n\nSupported values include:\n - `closing`: The job close action is in progress and has not yet completed. A closing job cannot accept further data.\n - `closed`: The job finished successfully with its model state persisted. The job must be opened before it can accept further data.\n - `opened`: The job is available to receive and process data.\n - `failed`: The job did not finish successfully due to an error.\nThis situation can occur due to invalid input data, a fatal error occurring during the analysis, or an external interaction such as the process being killed by the Linux out of memory (OOM) killer.\nIf the job had irrevocably failed, it must be force closed and then deleted.\nIf the datafeed can be corrected, the job can be closed and then re-opened.\n - `opening`: The job open action is in progress and has not yet completed.\n\n" opened_time: type: string description: 'For open jobs only, the amount of time the job has been opened.' assignment_explanation: type: string description: 'For open anomaly detection jobs only, contains messages relating to the selection of a node to run the job.' data.processed_records: type: string description: "The number of input documents that have been processed by the anomaly detection job.\nThis value includes documents with missing fields, since they are nonetheless analyzed.\nIf you use datafeeds and have aggregations in your search query, the `processed_record_count` is the number of aggregation results processed, not the number of Elasticsearch documents." data.processed_fields: type: string description: "The total number of fields in all the documents that have been processed by the anomaly detection job.\nOnly fields that are specified in the detector configuration object contribute to this count.\nThe timestamp is not included in this count." data.input_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The number of bytes of input data posted to the anomaly detection job. data.input_records: type: string description: The number of input documents posted to the anomaly detection job. data.input_fields: type: string description: "The total number of fields in input documents posted to the anomaly detection job.\nThis count includes fields that are not used in the analysis.\nHowever, be aware that if you are using a datafeed, it extracts only the required fields from the documents it retrieves before posting them to the job." data.invalid_dates: type: string description: The number of input documents with either a missing date field or a date that could not be parsed. data.missing_fields: type: string description: "The number of input documents that are missing a field that the anomaly detection job is configured to analyze.\nInput documents with missing fields are still processed because it is possible that not all fields are missing.\nIf you are using datafeeds or posting data to the job in JSON format, a high `missing_field_count` is often not an indication of data issues.\nIt is not necessarily a cause for concern." data.out_of_order_timestamps: type: string description: "The number of input documents that have a timestamp chronologically preceding the start of the current anomaly detection bucket offset by the latency window.\nThis information is applicable only when you provide data to the anomaly detection job by using the post data API.\nThese out of order documents are discarded, since jobs require time series data to be in ascending chronological order." data.empty_buckets: type: string description: "The number of buckets which did not contain any data.\nIf your data contains many empty buckets, consider increasing your `bucket_span` or using functions that are tolerant to gaps in data such as mean, `non_null_sum` or `non_zero_count`." data.sparse_buckets: type: string description: "The number of buckets that contained few data points compared to the expected number of data points.\nIf your data contains many sparse buckets, consider using a longer `bucket_span`." data.buckets: type: string description: The total number of buckets processed. data.earliest_record: type: string description: The timestamp of the earliest chronologically input document. data.latest_record: type: string description: The timestamp of the latest chronologically input document. data.last: type: string description: 'The timestamp at which data was last analyzed, according to server time.' data.last_empty_bucket: type: string description: The timestamp of the last bucket that did not contain any data. data.last_sparse_bucket: type: string description: The timestamp of the last bucket that was considered sparse. model.bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "The number of bytes of memory used by the models.\nThis is the maximum value since the last time the model was persisted.\nIf the job is closed, this value indicates the latest size." model.memory_status: allOf: - $ref: '#/components/schemas/ml._types.MemoryStatus' description: The status of the mathematical models. model.bytes_exceeded: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The number of bytes over the high limit for memory usage at the last allocation failure. model.memory_limit: type: string description: 'The upper limit for model memory usage, checked on increasing values.' model.by_fields: type: string description: "The number of `by` field values that were analyzed by the models.\nThis value is cumulative for all detectors in the job." model.over_fields: type: string description: "The number of `over` field values that were analyzed by the models.\nThis value is cumulative for all detectors in the job." model.partition_fields: type: string description: "The number of `partition` field values that were analyzed by the models.\nThis value is cumulative for all detectors in the job." model.bucket_allocation_failures: type: string description: "The number of buckets for which new entities in incoming data were not processed due to insufficient model memory.\nThis situation is also signified by a `hard_limit: memory_status` property value." model.categorization_status: allOf: - $ref: '#/components/schemas/ml._types.CategorizationStatus' description: The status of categorization for the job. model.categorized_doc_count: type: string description: The number of documents that have had a field categorized. model.total_category_count: type: string description: The number of categories created by categorization. model.frequent_category_count: type: string description: The number of categories that match more than 1% of categorized documents. model.rare_category_count: type: string description: The number of categories that match just one categorized document. model.dead_category_count: type: string description: "The number of categories created by categorization that will never be assigned again because another category’s definition makes it a superset of the dead category.\nDead categories are a side effect of the way categorization has no prior training." model.failed_category_count: type: string description: "The number of times that categorization wanted to create a new category but couldn’t because the job had hit its `model_memory_limit`.\nThis count does not track which specific categories failed to be created.\nTherefore you cannot use this value to determine the number of unique categories that were missed." model.log_time: type: string description: 'The timestamp when the model stats were gathered, according to server time.' model.timestamp: type: string description: The timestamp of the last record when the model stats were gathered. forecasts.total: type: string description: "The number of individual forecasts currently available for the job.\nA value of one or more indicates that forecasts exist." forecasts.memory.min: type: string description: The minimum memory usage in bytes for forecasts related to the anomaly detection job. forecasts.memory.max: type: string description: The maximum memory usage in bytes for forecasts related to the anomaly detection job. forecasts.memory.avg: type: string description: The average memory usage in bytes for forecasts related to the anomaly detection job. forecasts.memory.total: type: string description: The total memory usage in bytes for forecasts related to the anomaly detection job. forecasts.records.min: type: string description: The minimum number of `model_forecast` documents written for forecasts related to the anomaly detection job. forecasts.records.max: type: string description: The maximum number of `model_forecast` documents written for forecasts related to the anomaly detection job. forecasts.records.avg: type: string description: The average number of `model_forecast` documents written for forecasts related to the anomaly detection job. forecasts.records.total: type: string description: The total number of `model_forecast` documents written for forecasts related to the anomaly detection job. forecasts.time.min: type: string description: The minimum runtime in milliseconds for forecasts related to the anomaly detection job. forecasts.time.max: type: string description: The maximum runtime in milliseconds for forecasts related to the anomaly detection job. forecasts.time.avg: type: string description: The average runtime in milliseconds for forecasts related to the anomaly detection job. forecasts.time.total: type: string description: The total runtime in milliseconds for forecasts related to the anomaly detection job. node.id: allOf: - $ref: '#/components/schemas/_types.NodeId' description: The uniqe identifier of the assigned node. node.name: type: string description: The name of the assigned node. node.ephemeral_id: allOf: - $ref: '#/components/schemas/_types.NodeId' description: The ephemeral identifier of the assigned node. node.address: type: string description: The network address of the assigned node. buckets.count: type: string description: The number of bucket results produced by the job. buckets.time.total: type: string description: 'The sum of all bucket processing times, in milliseconds.' buckets.time.min: type: string description: 'The minimum of all bucket processing times, in milliseconds.' buckets.time.max: type: string description: 'The maximum of all bucket processing times, in milliseconds.' buckets.time.exp_avg: type: string description: 'The exponential moving average of all bucket processing times, in milliseconds.' buckets.time.exp_avg_hour: type: string description: 'The exponential moving average of bucket processing times calculated in a one hour time window, in milliseconds.' ml._types.JobState: enum: - closing - closed - opened - failed - opening type: string ml._types.MemoryStatus: enum: - ok - soft_limit - hard_limit type: string ml._types.CategorizationStatus: enum: - ok - warn type: string cat._types.CatTrainedModelsColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatTrainedModelsColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatTrainedModelsColumn' cat._types.CatTrainedModelsColumn: type: string cat.ml_trained_models.TrainedModelsRecord: type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: The model identifier. created_by: type: string description: Information about the creator of the model. heap_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The estimated heap size to keep the model in memory. operations: type: string description: "The estimated number of operations to use the model.\nThis number helps to measure the computational complexity of the model." license: type: string description: The license level of the model. create_time: allOf: - $ref: '#/components/schemas/_types.DateTime' description: The time the model was created. version: allOf: - $ref: '#/components/schemas/_types.VersionString' description: The version of Elasticsearch when the model was created. description: type: string description: A description of the model. ingest.pipelines: type: string description: The number of pipelines that are referencing the model. ingest.count: type: string description: The total number of documents that are processed by the model. ingest.time: type: string description: The total time spent processing documents with thie model. ingest.current: type: string description: The total number of documents that are currently being handled by the model. ingest.failed: type: string description: The total number of failed ingest attempts with the model. data_frame.id: type: string description: "The identifier for the data frame analytics job that created the model.\nOnly displayed if the job is still available." data_frame.create_time: type: string description: The time the data frame analytics job was created. data_frame.source_index: type: string description: The source index used to train in the data frame analysis. data_frame.analysis: type: string description: The analysis used by the data frame to build the model. type: type: string x-state: Generally available; Added in 8.0.0 cat._types.CatNodeattrsColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatNodeattrsColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatNodeattrsColumn' cat._types.CatNodeattrsColumn: anyOf: - enum: - node - id - id - nodeId - pid - p - host - h - ip - i - port - po - attr - attr.name - value - attr.value type: string - type: string cat.nodeattrs.NodeAttributesRecord: type: object properties: node: type: string description: The node name. id: type: string description: The unique node identifier. pid: type: string description: The process identifier. host: type: string description: The host name. ip: type: string description: The IP address. port: type: string description: The bound transport port. attr: type: string description: The attribute name. value: type: string description: The attribute value. cat._types.CatNodeColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatNodeColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatNodeColumn' cat._types.CatNodeColumn: type: string cat.nodes.NodesRecord: type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: The unique node identifier. pid: type: string description: The process identifier. ip: type: string description: The IP address. port: type: string description: The bound transport port. http_address: type: string description: The bound HTTP address. version: allOf: - $ref: '#/components/schemas/_types.VersionString' description: The Elasticsearch version. flavor: type: string description: The Elasticsearch distribution flavor. type: type: string description: The Elasticsearch distribution type. build: type: string description: The Elasticsearch build hash. jdk: type: string description: The Java version. disk.total: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The total disk space. disk.used: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The used disk space. disk.avail: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The available disk space. disk.used_percent: allOf: - $ref: '#/components/schemas/_types.Percentage' description: The used disk space percentage. heap.current: type: string description: The used heap. heap.percent: allOf: - $ref: '#/components/schemas/_types.Percentage' description: The used heap ratio. heap.max: type: string description: The maximum configured heap. ram.current: type: string description: The used machine memory. ram.percent: allOf: - $ref: '#/components/schemas/_types.Percentage' description: The used machine memory ratio. ram.max: type: string description: The total machine memory. file_desc.current: type: string description: The used file descriptors. file_desc.percent: allOf: - $ref: '#/components/schemas/_types.Percentage' description: The used file descriptor ratio. file_desc.max: type: string description: The maximum number of file descriptors. cpu: type: string description: The recent system CPU usage as a percentage. load_1m: type: string description: The load average for the most recent minute. load_5m: type: string description: The load average for the last five minutes. load_15m: type: string description: The load average for the last fifteen minutes. available_processors: type: string description: The number of available processors (logical CPU cores available to the JVM). uptime: type: string description: The node uptime. node.role: type: string description: "The roles of the node.\nReturned values include `c`(cold node), `d`(data node), `f`(frozen node), `h`(hot node), `i`(ingest node), `l`(machine learning node), `m` (master eligible node), `r`(remote cluster client node), `s`(content node), `t`(transform node), `v`(voting-only node), `w`(warm node),and `-`(coordinating node only)." master: type: string description: "Indicates whether the node is the elected master node.\nReturned values include `*`(elected master) and `-`(not elected master)." name: allOf: - $ref: '#/components/schemas/_types.Name' description: The node name. completion.size: type: string description: The size of completion. fielddata.memory_size: type: string description: The used fielddata cache. fielddata.evictions: type: string description: The fielddata evictions. query_cache.memory_size: type: string description: The used query cache. query_cache.evictions: type: string description: The query cache evictions. query_cache.hit_count: type: string description: The query cache hit counts. query_cache.miss_count: type: string description: The query cache miss counts. request_cache.memory_size: type: string description: The used request cache. request_cache.evictions: type: string description: The request cache evictions. request_cache.hit_count: type: string description: The request cache hit counts. request_cache.miss_count: type: string description: The request cache miss counts. flush.total: type: string description: The number of flushes. flush.total_time: type: string description: The time spent in flush. get.current: type: string description: The number of current get ops. get.time: type: string description: The time spent in get. get.total: type: string description: The number of get ops. get.exists_time: type: string description: The time spent in successful gets. get.exists_total: type: string description: The number of successful get operations. get.missing_time: type: string description: The time spent in failed gets. get.missing_total: type: string description: The number of failed gets. indexing.delete_current: type: string description: The number of current deletions. indexing.delete_time: type: string description: The time spent in deletions. indexing.delete_total: type: string description: The number of delete operations. indexing.index_current: type: string description: The number of current indexing operations. indexing.index_time: type: string description: The time spent in indexing. indexing.index_total: type: string description: The number of indexing operations. indexing.index_failed: type: string description: The number of failed indexing operations. merges.current: type: string description: The number of current merges. merges.current_docs: type: string description: The number of current merging docs. merges.current_size: type: string description: The size of current merges. merges.total: type: string description: The number of completed merge operations. merges.total_docs: type: string description: The docs merged. merges.total_size: type: string description: The size merged. merges.total_time: type: string description: The time spent in merges. refresh.total: type: string description: The total refreshes. refresh.time: type: string description: The time spent in refreshes. refresh.external_total: type: string description: The total external refreshes. refresh.external_time: type: string description: The time spent in external refreshes. refresh.listeners: type: string description: The number of pending refresh listeners. script.compilations: type: string description: The total script compilations. script.cache_evictions: type: string description: The total compiled scripts evicted from the cache. script.compilation_limit_triggered: type: string description: The script cache compilation limit triggered. search.fetch_current: type: string description: The current fetch phase operations. search.fetch_time: type: string description: The time spent in fetch phase. search.fetch_total: type: string description: The total fetch operations. search.open_contexts: type: string description: The open search contexts. search.query_current: type: string description: The current query phase operations. search.query_time: type: string description: The time spent in query phase. search.query_total: type: string description: The total query phase operations. search.scroll_current: type: string description: The open scroll contexts. search.scroll_time: type: string description: The time scroll contexts held open. search.scroll_total: type: string description: The completed scroll contexts. segments.count: type: string description: The number of segments. segments.memory: type: string description: The memory used by segments. segments.index_writer_memory: type: string description: The memory used by the index writer. segments.version_map_memory: type: string description: The memory used by the version map. segments.fixed_bitset_memory: type: string description: The memory used by fixed bit sets for nested object field types and export type filters for types referred in _parent fields. suggest.current: type: string description: The number of current suggest operations. suggest.time: type: string description: The time spend in suggest. suggest.total: type: string description: The number of suggest operations. bulk.total_operations: type: string description: The number of bulk shard operations. bulk.total_time: type: string description: The time spend in shard bulk. bulk.total_size_in_bytes: type: string description: The total size in bytes of shard bulk. bulk.avg_time: type: string description: The average time spend in shard bulk. bulk.avg_size_in_bytes: type: string description: The average size in bytes of shard bulk. cat._types.CatPendingTasksColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatPendingTasksColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatPendingTasksColumn' cat._types.CatPendingTasksColumn: anyOf: - enum: - insertOrder - o - timeInQueue - t - priority - p - source - s type: string - type: string cat.pending_tasks.PendingTasksRecord: type: object properties: insertOrder: type: string description: The task insertion order. timeInQueue: type: string description: Indicates how long the task has been in queue. priority: type: string description: The task priority. source: type: string description: The task source. cat._types.CatPluginsColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatPluginsColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatPluginsColumn' cat._types.CatPluginsColumn: anyOf: - enum: - id - name - n - component - c - version - v - description - d type: string - type: string cat.plugins.PluginsRecord: type: object properties: id: allOf: - $ref: '#/components/schemas/_types.NodeId' description: The unique node identifier. name: allOf: - $ref: '#/components/schemas/_types.Name' description: The node name. component: type: string description: The component name. version: allOf: - $ref: '#/components/schemas/_types.VersionString' description: The component version. description: type: string description: The plugin details. type: type: string description: The plugin type. cat._types.CatRecoveryColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatRecoveryColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatRecoveryColumn' cat._types.CatRecoveryColumn: anyOf: - enum: - index - i - idx - shard - s - sh - start_time - start - start_time_millis - start_millis - stop_time - stop - stop_time_millis - stop_millis - time - t - ti - type - ty - stage - st - local_retries - lr - priority - pr - gate - g - blocked_for_millis - bf - source_host - shost - source_node - snode - target_host - thost - target_node - tnode - repository - rep - snapshot - snap - files - f - files_recovered - fr - files_percent - fp - files_total - tf - bytes - b - bytes_recovered - br - bytes_percent - bp - bytes_total - tb - translog_ops - to - translog_ops_recovered - tor - translog_ops_percent - top type: string - type: string cat.recovery.RecoveryRecord: type: object properties: index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: The index name. shard: type: string description: The shard name. start_time: allOf: - $ref: '#/components/schemas/_types.DateTime' description: "The recovery start time.\nFor recoveries in the `created` stage (not yet started), this value is the Unix epoch (1970-01-01T00:00:00.000Z)." start_time_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: "The recovery start time in epoch milliseconds.\nFor recoveries in the `created` stage (not yet started), this value is 0." stop_time: allOf: - $ref: '#/components/schemas/_types.DateTime' description: "The recovery stop time.\nFor recoveries that have not yet completed, this value is the Unix epoch (1970-01-01T00:00:00.000Z)." stop_time_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: "The recovery stop time in epoch milliseconds.\nFor recoveries that have not yet completed, this value is 0." time: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The recovery time.\nFor recoveries in the `created` stage (not yet started), this value is 0." type: type: string description: The recovery type. stage: type: string description: The recovery stage. local_retries: type: string description: The number of times this recovery has failed in a way which is retried locally (i.e. on the data node). x-state: Generally available; Added in 9.6.0 priority: type: string description: The recovery priority. x-state: Generally available; Added in 9.6.0 gate: type: string description: "The name of the recovery gate that blocked recovery on the target node.\n\nThe value is `n/a` unless the recovery is queued in the `created` stage and blocked by a recovery gate." x-state: Generally available; Added in 9.6.0 blocked_for_millis: type: string description: "The elapsed time in milliseconds recovery is blocked for.\n\nThe value is `n/a` when the recovery is not blocked by a recovery gate." x-state: Generally available; Added in 9.6.0 source_host: type: string description: The source host. source_node: type: string description: The source node name. target_host: type: string description: The target host. target_node: type: string description: The target node name. repository: type: string description: The repository name. snapshot: type: string description: The snapshot name. files: type: string description: The number of files to recover. files_recovered: type: string description: The files recovered. files_percent: allOf: - $ref: '#/components/schemas/_types.Percentage' description: The ratio of files recovered. files_total: type: string description: The total number of files. bytes: type: string description: The number of bytes to recover. bytes_recovered: type: string description: The bytes recovered. bytes_percent: allOf: - $ref: '#/components/schemas/_types.Percentage' description: The ratio of bytes recovered. bytes_total: type: string description: The total number of bytes. translog_ops: type: string description: The number of translog operations to recover. translog_ops_recovered: type: string description: The translog operations recovered. translog_ops_percent: allOf: - $ref: '#/components/schemas/_types.Percentage' description: The ratio of translog operations recovered. cat.repositories.RepositoriesRecord: type: object properties: id: type: string description: The unique repository identifier. type: type: string description: The repository type. cat._types.CatSegmentsColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatSegmentsColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatSegmentsColumn' cat._types.CatSegmentsColumn: anyOf: - enum: - index - i - idx - shard - s - sh - prirep - p - pr - primaryOrReplica - ip - segment - generation - docs.count - docs.deleted - size - size.memory - committed - searchable - version - compound - id type: string - type: string cat.segments.SegmentsRecord: type: object properties: index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: The index name. shard: type: string description: The shard name. prirep: type: string description: 'The shard type: `primary` or `replica`.' ip: type: string description: The IP address of the node where it lives. id: allOf: - $ref: '#/components/schemas/_types.NodeId' description: The unique identifier of the node where it lives. segment: type: string description: 'The segment name, which is derived from the segment generation and used internally to create file names in the directory of the shard.' generation: type: string description: "The segment generation number.\nElasticsearch increments this generation number for each segment written then uses this number to derive the segment name." docs.count: type: string description: "The number of documents in the segment.\nThis excludes deleted documents and counts any nested documents separately from their parents.\nIt also excludes documents which were indexed recently and do not yet belong to a segment." docs.deleted: type: string description: "The number of deleted documents in the segment, which might be higher or lower than the number of delete operations you have performed.\nThis number excludes deletes that were performed recently and do not yet belong to a segment.\nDeleted documents are cleaned up by the automatic merge process if it makes sense to do so.\nAlso, Elasticsearch creates extra deleted documents to internally track the recent history of operations on a shard." size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The segment size in bytes. size.memory: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "The segment memory in bytes.\nA value of `-1` indicates Elasticsearch was unable to compute this number." committed: type: string description: "If `true`, the segment is synced to disk.\nSegments that are synced can survive a hard reboot.\nIf `false`, the data from uncommitted segments is also stored in the transaction log so that Elasticsearch is able to replay changes on the next start." searchable: type: string description: "If `true`, the segment is searchable.\nIf `false`, the segment has most likely been written to disk but needs a refresh to be searchable." version: allOf: - $ref: '#/components/schemas/_types.VersionString' description: The version of Lucene used to write the segment. compound: type: string description: "If `true`, the segment is stored in a compound file.\nThis means Lucene merged all files from the segment in a single file to save file descriptors." cat._types.CatShardColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatShardColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatShardColumn' cat._types.CatShardColumn: anyOf: - enum: - completion.size - cs - completionSize - dataset.size - dense_vector.value_count - dvc - denseVectorCount - docs - d - dc - fielddata.evictions - fe - fielddataEvictions - fielddata.memory_size - fm - fielddataMemory - flush.total - ft - flushTotal - flush.total_time - ftt - flushTotalTime - get.current - gc - getCurrent - get.exists_time - geti - getExistsTime - get.exists_total - geto - getExistsTotal - get.missing_time - gmti - getMissingTime - get.missing_total - gmto - getMissingTotal - get.time - gti - getTime - get.total - gto - getTotal - id - index - i - idx - indexing.delete_current - idc - indexingDeleteCurrent - indexing.delete_time - idti - indexingDeleteTime - indexing.delete_total - idto - indexingDeleteTotal - indexing.index_current - iic - indexingIndexCurrent - indexing.index_failed_due_to_version_conflict - iifvc - indexingIndexFailedDueToVersionConflict - indexing.index_failed - iif - indexingIndexFailed - indexing.index_time - iiti - indexingIndexTime - indexing.index_total - iito - indexingIndexTotal - ip - merges.current - mc - mergesCurrent - merges.current_docs - mcd - mergesCurrentDocs - merges.current_size - mcs - mergesCurrentSize - merges.total - mt - mergesTotal - merges.total_docs - mtd - mergesTotalDocs - merges.total_size - mts - mergesTotalSize - merges.total_time - mtt - mergesTotalTime - node - n - prirep - p - pr - primaryOrReplica - query_cache.evictions - qce - queryCacheEvictions - query_cache.memory_size - qcm - queryCacheMemory - recoverysource.type - rs - refresh.time - rti - refreshTime - refresh.total - rto - refreshTotal - search.fetch_current - sfc - searchFetchCurrent - search.fetch_time - sfti - searchFetchTime - search.fetch_total - sfto - searchFetchTotal - search.open_contexts - so - searchOpenContexts - search.query_current - sqc - searchQueryCurrent - search.query_time - sqti - searchQueryTime - search.query_total - sqto - searchQueryTotal - search.scroll_current - scc - searchScrollCurrent - search.scroll_time - scti - searchScrollTime - search.scroll_total - scto - searchScrollTotal - segments.count - sc - segmentsCount - segments.fixed_bitset_memory - sfbm - fixedBitsetMemory - segments.index_writer_memory - siwm - segmentsIndexWriterMemory - segments.memory - sm - segmentsMemory - segments.version_map_memory - svmm - segmentsVersionMapMemory - seq_no.global_checkpoint - sqg - globalCheckpoint - seq_no.local_checkpoint - sql - localCheckpoint - seq_no.max - sqm - maxSeqNo - shard - s - sh - dsparse_vector.value_count - svc - sparseVectorCount - state - st - store - sto - suggest.current - suc - suggestCurrent - suggest.time - suti - suggestTime - suggest.total - suto - suggestTotal - sync_id - unassigned.at - ua - unassigned.details - ud - unassigned.for - uf - unassigned.reason - ur type: string - type: string cat.shards.ShardsRecord: type: object properties: index: type: string description: The index name. shard: type: string description: The shard name. prirep: type: string description: 'The shard type: `primary` or `replica`.' state: type: string description: "The shard state.\nReturned values include:\n`INITIALIZING`: The shard is recovering from a peer shard or gateway.\n`RELOCATING`: The shard is relocating.\n`STARTED`: The shard has started.\n`UNASSIGNED`: The shard is not assigned to any node." docs: oneOf: - type: string - type: - 'null' - string description: The number of documents in the shard. store: oneOf: - type: string - type: - 'null' - string description: The disk space used by the shard. dataset: oneOf: - type: string - type: - 'null' - string description: total size of dataset (including the cache for partially mounted indices) x-state: Generally available; Added in 8.11.0 ip: oneOf: - type: string - type: - 'null' - string description: The IP address of the node. id: type: string description: The unique identifier for the node. node: oneOf: - type: string - type: - 'null' - string description: The name of node. sync_id: type: string description: The sync identifier. unassigned.reason: type: string description: "The reason for the last change to the state of an unassigned shard.\nIt does not explain why the shard is currently unassigned; use the cluster allocation explain API for that information.\nReturned values include:\n`ALLOCATION_FAILED`: Unassigned as a result of a failed allocation of the shard.\n`CLUSTER_RECOVERED`: Unassigned as a result of a full cluster recovery.\n`DANGLING_INDEX_IMPORTED`: Unassigned as a result of importing a dangling index.\n`EXISTING_INDEX_RESTORED`: Unassigned as a result of restoring into a closed index.\n`FORCED_EMPTY_PRIMARY`: The shard’s allocation was last modified by forcing an empty primary using the cluster reroute API.\n`INDEX_CLOSED`: Unassigned because the index was closed.\n`INDEX_CREATED`: Unassigned as a result of an API creation of an index.\n`INDEX_REOPENED`: Unassigned as a result of opening a closed index.\n`MANUAL_ALLOCATION`: The shard’s allocation was last modified by the cluster reroute API.\n`NEW_INDEX_RESTORED`: Unassigned as a result of restoring into a new index.\n`NODE_LEFT`: Unassigned as a result of the node hosting it leaving the cluster.\n`NODE_RESTARTING`: Similar to `NODE_LEFT`, except that the node was registered as restarting using the node shutdown API.\n`PRIMARY_FAILED`: The shard was initializing as a replica, but the primary shard failed before the initialization completed.\n`REALLOCATED_REPLICA`: A better replica location is identified and causes the existing replica allocation to be cancelled.\n`REINITIALIZED`: When a shard moves from started back to initializing.\n`REPLICA_ADDED`: Unassigned as a result of explicit addition of a replica.\n`REROUTE_CANCELLED`: Unassigned as a result of explicit cancel reroute command." unassigned.at: type: string description: The time at which the shard became unassigned in Coordinated Universal Time (UTC). unassigned.for: type: string description: The time at which the shard was requested to be unassigned in Coordinated Universal Time (UTC). unassigned.details: type: string description: "Additional details as to why the shard became unassigned.\nIt does not explain why the shard is not assigned; use the cluster allocation explain API for that information." recoverysource.type: type: string description: The type of recovery source. completion.size: type: string description: The size of completion. fielddata.memory_size: type: string description: The used fielddata cache memory. fielddata.evictions: type: string description: The fielddata cache evictions. query_cache.memory_size: type: string description: The used query cache memory. query_cache.evictions: type: string description: The query cache evictions. flush.total: type: string description: The number of flushes. flush.total_time: type: string description: The time spent in flush. get.current: type: string description: The number of current get operations. get.time: type: string description: The time spent in get operations. get.total: type: string description: The number of get operations. get.exists_time: type: string description: The time spent in successful get operations. get.exists_total: type: string description: The number of successful get operations. get.missing_time: type: string description: The time spent in failed get operations. get.missing_total: type: string description: The number of failed get operations. indexing.delete_current: type: string description: The number of current deletion operations. indexing.delete_time: type: string description: The time spent in deletion operations. indexing.delete_total: type: string description: The number of delete operations. indexing.index_current: type: string description: The number of current indexing operations. indexing.index_time: type: string description: The time spent in indexing operations. indexing.index_total: type: string description: The number of indexing operations. indexing.index_failed: type: string description: The number of failed indexing operations. merges.current: type: string description: The number of current merge operations. merges.current_docs: type: string description: The number of current merging documents. merges.current_size: type: string description: The size of current merge operations. merges.total: type: string description: The number of completed merge operations. merges.total_docs: type: string description: The nuber of merged documents. merges.total_size: type: string description: The size of current merges. merges.total_time: type: string description: The time spent merging documents. refresh.total: type: string description: The total number of refreshes. refresh.time: type: string description: The time spent in refreshes. refresh.external_total: type: string description: The total nunber of external refreshes. refresh.external_time: type: string description: The time spent in external refreshes. refresh.listeners: type: string description: The number of pending refresh listeners. search.fetch_current: type: string description: The current fetch phase operations. search.fetch_time: type: string description: The time spent in fetch phase. search.fetch_total: type: string description: The total number of fetch operations. search.open_contexts: type: string description: The number of open search contexts. search.query_current: type: string description: The current query phase operations. search.query_time: type: string description: The time spent in query phase. search.query_total: type: string description: The total number of query phase operations. search.scroll_current: type: string description: The open scroll contexts. search.scroll_time: type: string description: The time scroll contexts were held open. search.scroll_total: type: string description: The number of completed scroll contexts. segments.count: type: string description: The number of segments. segments.memory: type: string description: The memory used by segments. segments.index_writer_memory: type: string description: The memory used by the index writer. segments.version_map_memory: type: string description: The memory used by the version map. segments.fixed_bitset_memory: type: string description: The memory used by fixed bit sets for nested object field types and export type filters for types referred in `_parent` fields. seq_no.max: type: string description: The maximum sequence number. seq_no.local_checkpoint: type: string description: The local checkpoint. seq_no.global_checkpoint: type: string description: The global checkpoint. warmer.current: type: string description: The number of current warmer operations. warmer.total: type: string description: The total number of warmer operations. warmer.total_time: type: string description: The time spent in warmer operations. path.data: type: string description: The shard data path. path.state: type: string description: The shard state path. bulk.total_operations: type: string description: The number of bulk shard operations. bulk.total_time: type: string description: The time spent in shard bulk operations. bulk.total_size_in_bytes: type: string description: The total size in bytes of shard bulk operations. bulk.avg_time: type: string description: The average time spent in shard bulk operations. bulk.avg_size_in_bytes: type: string description: The average size in bytes of shard bulk operations. cat._types.CatSnapshotsColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatSnapshotsColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatSnapshotsColumn' cat._types.CatSnapshotsColumn: anyOf: - enum: - id - snapshot - repository - re - repo - status - s - start_epoch - ste - startEpoch - start_time - sti - startTime - end_epoch - ete - endEpoch - end_time - eti - endTime - duration - dur - indices - i - successful_shards - ss - failed_shards - fs - total_shards - ts - reason - r type: string - type: string cat.snapshots.SnapshotsRecord: type: object properties: id: type: string description: The unique identifier for the snapshot. repository: type: string description: The repository name. status: type: string description: "The state of the snapshot process.\nReturned values include:\n`FAILED`: The snapshot process failed.\n`INCOMPATIBLE`: The snapshot process is incompatible with the current cluster version.\n`IN_PROGRESS`: The snapshot process started but has not completed.\n`PARTIAL`: The snapshot process completed with a partial success.\n`SUCCESS`: The snapshot process completed with a full success." start_epoch: allOf: - $ref: '#/components/schemas/_spec_utils.StringifiedEpochTimeUnitSeconds' description: The Unix epoch time (seconds since 1970-01-01 00:00:00) at which the snapshot process started. start_time: allOf: - $ref: '#/components/schemas/watcher._types.ScheduleTimeOfDay' description: The time (HH:MM:SS) at which the snapshot process started. end_epoch: allOf: - $ref: '#/components/schemas/_spec_utils.StringifiedEpochTimeUnitSeconds' description: The Unix epoch time (seconds since 1970-01-01 00:00:00) at which the snapshot process ended. end_time: allOf: - $ref: '#/components/schemas/_types.TimeOfDay' description: The time (HH:MM:SS) at which the snapshot process ended. duration: allOf: - $ref: '#/components/schemas/_types.Duration' description: 'The time it took the snapshot process to complete, in time units.' indices: type: string description: The number of indices in the snapshot. successful_shards: type: string description: The number of successful shards in the snapshot. failed_shards: type: string description: The number of failed shards in the snapshot. total_shards: type: string description: The total number of shards in the snapshot. reason: type: string description: The reason for any snapshot failures. watcher._types.ScheduleTimeOfDay: oneOf: - type: string - $ref: '#/components/schemas/watcher._types.HourAndMinute' description: 'A time of day, expressed either as `hh:mm`, `noon`, `midnight`, or an hour/minutes structure.' watcher._types.HourAndMinute: required: - hour - minute type: object properties: hour: type: array items: type: number minute: type: array items: type: number cat._types.CatTasksColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatTasksColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatTasksColumn' cat._types.CatTasksColumn: anyOf: - enum: - id - action - ac - task_id - ti - parent_task_id - pti - type - ty - start_time - start - timestamp - ts - hms - hhmmss - running_time_ns - time - running_time - time - node_id - ni - ip - i - port - po - node - n - version - v - x_opaque_id - x type: string - type: string cat.tasks.TasksRecord: type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: The identifier of the task with the node. action: type: string description: The task action. task_id: allOf: - $ref: '#/components/schemas/_types.Id' description: The unique task identifier. parent_task_id: type: string description: The parent task identifier. type: type: string description: The task type. start_time: type: string description: The start time in milliseconds. timestamp: type: string description: The start time in `HH:MM:SS` format. running_time_ns: type: string description: The running time in nanoseconds. running_time: type: string description: The running time. node_id: allOf: - $ref: '#/components/schemas/_types.NodeId' description: The unique node identifier. ip: type: string description: The IP address for the node. port: type: string description: The bound transport port for the node. node: type: string description: The node name. version: allOf: - $ref: '#/components/schemas/_types.VersionString' description: The Elasticsearch version. x_opaque_id: type: string description: The X-Opaque-ID header. description: type: string description: The task action description. cat._types.CatTemplatesColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatTemplatesColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatTemplatesColumn' cat._types.CatTemplatesColumn: anyOf: - enum: - name - n - index_patterns - t - order - o - p - version - v - composed_of - c type: string - type: string cat.templates.TemplatesRecord: type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' description: The template name. index_patterns: type: string description: The template index patterns. order: type: string description: The template application order or priority number. version: oneOf: - $ref: '#/components/schemas/_types.VersionString' - type: - 'null' - string description: The template version. composed_of: type: string description: The component templates that comprise the index template. cat._types.CatThreadPoolColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatThreadPoolColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatThreadPoolColumn' cat._types.CatThreadPoolColumn: anyOf: - enum: - active - a - completed - c - core - cr - ephemeral_id - eid - host - h - ip - i - keep_alive - k - largest - l - max - mx - name - node_id - id - node_name - pid - p - pool_size - psz - port - po - queue - q - queue_size - qs - rejected - r - size - sz - type - t type: string - type: string cat.thread_pool.ThreadPoolRecord: type: object properties: node_name: type: string description: The node name. node_id: allOf: - $ref: '#/components/schemas/_types.NodeId' description: The persistent node identifier. ephemeral_node_id: type: string description: The ephemeral node identifier. pid: type: string description: The process identifier. host: type: string description: The host name for the current node. ip: type: string description: The IP address for the current node. port: type: string description: The bound transport port for the current node. name: type: string description: The thread pool name. type: type: string description: "The thread pool type.\nReturned values include `fixed`, `fixed_auto_queue_size`, `direct`, and `scaling`." active: type: string description: The number of active threads in the current thread pool. pool_size: type: string description: The number of threads in the current thread pool. queue: type: string description: The number of tasks currently in queue. queue_size: type: string description: The maximum number of tasks permitted in the queue. rejected: type: string description: The number of rejected tasks. largest: type: string description: The highest number of active threads in the current thread pool. completed: type: string description: The number of completed tasks. core: oneOf: - type: string - type: - 'null' - string description: The core number of active threads allowed in a scaling thread pool. max: oneOf: - type: string - type: - 'null' - string description: The maximum number of active threads allowed in a scaling thread pool. size: oneOf: - type: string - type: - 'null' - string description: The number of active threads allowed in a fixed thread pool. keep_alive: oneOf: - type: string - type: - 'null' - string description: The thread keep alive time. cat._types.CatTransformColumns: oneOf: - $ref: '#/components/schemas/cat._types.CatTransformColumn' - type: array items: $ref: '#/components/schemas/cat._types.CatTransformColumn' cat._types.CatTransformColumn: type: string cat.transforms.TransformsRecord: type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: The transform identifier. state: type: string description: "The status of the transform.\nReturned values include:\n`aborting`: The transform is aborting.\n`failed: The transform failed. For more information about the failure, check the `reason` field.\n`indexing`: The transform is actively processing data and creating new documents.\n`started`: The transform is running but not actively indexing data.\n`stopped`: The transform is stopped.\n`stopping`: The transform is stopping." checkpoint: type: string description: The sequence number for the checkpoint. documents_processed: type: string description: The number of documents that have been processed from the source index of the transform. checkpoint_progress: oneOf: - type: string - type: - 'null' - string description: The progress of the next checkpoint that is currently in progress. last_search_time: oneOf: - type: string - type: - 'null' - string description: "The timestamp of the last search in the source indices.\nThis field is shown only if the transform is running." changes_last_detection_time: oneOf: - type: string - type: - 'null' - string description: The timestamp when changes were last detected in the source indices. create_time: type: string description: The time the transform was created. version: allOf: - $ref: '#/components/schemas/_types.VersionString' description: The version of Elasticsearch that existed on the node when the transform was created. source_index: type: string description: The source indices for the transform. dest_index: type: string description: The destination index for the transform. pipeline: type: string description: The unique identifier for the ingest pipeline. description: type: string description: The description of the transform. transform_type: type: string description: 'The type of transform: `batch` or `continuous`.' frequency: type: string description: The interval between checks for changes in the source indices when the transform is running continuously. max_page_search_size: type: string description: The initial page size that is used for the composite aggregation for each checkpoint. docs_per_second: type: string description: The number of input documents per second. reason: type: string description: 'If a transform has a `failed` state, these details describe the reason for failure.' search_total: type: string description: The total number of search operations on the source index for the transform. search_failure: type: string description: The total number of search failures. search_time: type: string description: 'The total amount of search time, in milliseconds.' index_total: type: string description: The total number of index operations done by the transform. index_failure: type: string description: The total number of indexing failures. index_time: type: string description: 'The total time spent indexing documents, in milliseconds.' documents_indexed: type: string description: The number of documents that have been indexed into the destination index for the transform. delete_time: type: string description: 'The total time spent deleting documents, in milliseconds.' documents_deleted: type: string description: The number of documents deleted from the destination index due to the retention policy for the transform. trigger_count: type: string description: "The number of times the transform has been triggered by the scheduler.\nFor example, the scheduler triggers the transform indexer to check for updates or ingest new data at an interval specified in the `frequency` property." pages_processed: type: string description: "The number of search or bulk index operations processed.\nDocuments are processed in batches instead of individually." processing_time: type: string description: 'The total time spent processing results, in milliseconds.' checkpoint_duration_time_exp_avg: type: string description: 'The exponential moving average of the duration of the checkpoint, in milliseconds.' indexed_documents_exp_avg: type: string description: The exponential moving average of the number of new documents that have been indexed. processed_documents_exp_avg: type: string description: The exponential moving average of the number of documents that have been processed. indices._types.IndexSettings: type: object externalDocs: description: Index settings url: https://www.elastic.co/docs/reference/elasticsearch/index-settings/ x-model: true indices._types.SoftDeletes: type: object properties: enabled: type: boolean description: Indicates whether soft deletes are enabled on the index. default: true retention_lease: allOf: - $ref: '#/components/schemas/indices._types.RetentionLease' description: "The maximum period to retain a shard history retention lease before it is considered expired.\nShard history retention leases ensure that soft deletes are retained during merges on the Lucene\nindex. If a soft delete is merged away before it can be replicated to a follower the following\nprocess will fail due to incomplete history on the leader." indices._types.RetentionLease: required: - period type: object properties: period: allOf: - $ref: '#/components/schemas/_types.Duration' indices._types.IndexSegmentSort: type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Fields' order: oneOf: - $ref: '#/components/schemas/indices._types.SegmentSortOrder' - type: array items: $ref: '#/components/schemas/indices._types.SegmentSortOrder' description: "\n\nSupported values include: `asc` (or `ASC`), `desc` (or `DESC`)\n\n" mode: oneOf: - $ref: '#/components/schemas/indices._types.SegmentSortMode' - type: array items: $ref: '#/components/schemas/indices._types.SegmentSortMode' description: "\n\nSupported values include: `min` (or `MIN`), `max` (or `MAX`)\n\n" missing: oneOf: - $ref: '#/components/schemas/indices._types.SegmentSortMissing' - type: array items: $ref: '#/components/schemas/indices._types.SegmentSortMissing' description: "\n\nSupported values include: `_last`, `_first`\n\n" indices._types.SegmentSortOrder: enum: - asc - ASC - desc - DESC type: string indices._types.SegmentSortMode: enum: - min - MIN - max - MAX type: string indices._types.SegmentSortMissing: enum: - _last - _first type: string indices._types.IndexCheckOnStartup: enum: - 'true' - 'false' - checksum type: string _spec_utils.Stringifiedinteger: type: - number - string description: "Some APIs will return values such as numbers also as a string (notably epoch timestamps). This behavior\nis used to capture this behavior while keeping the semantics of the field type.\n\nDepending on the target language, code generators can keep the union or remove it and leniently parse\nstrings to the target type." _spec_utils.NullValue: type: - 'null' - string description: "A `null` value that is to be interpreted as an actual value, unless other uses of `null` that are equivalent\nto a missing value. It is used for exemple in settings, where using the `NullValue` for a setting will reset\nit to its default value." indices._types.Merge: type: object properties: scheduler: allOf: - $ref: '#/components/schemas/indices._types.MergeScheduler' indices._types.MergeScheduler: type: object properties: max_thread_count: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedinteger' max_merge_count: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedinteger' indices._types.SettingsSearch: type: object properties: idle: allOf: - $ref: '#/components/schemas/indices._types.SearchIdle' slowlog: allOf: - $ref: '#/components/schemas/indices._types.SlowlogSettings' indices._types.SearchIdle: type: object properties: after: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s indices._types.SlowlogSettings: type: object properties: level: type: string source: type: number reformat: type: boolean threshold: allOf: - $ref: '#/components/schemas/indices._types.SlowlogTresholds' indices._types.SlowlogTresholds: type: object properties: query: allOf: - $ref: '#/components/schemas/indices._types.SlowlogTresholdLevels' fetch: allOf: - $ref: '#/components/schemas/indices._types.SlowlogTresholdLevels' indices._types.SlowlogTresholdLevels: type: object properties: warn: allOf: - $ref: '#/components/schemas/_types.Duration' info: allOf: - $ref: '#/components/schemas/_types.Duration' debug: allOf: - $ref: '#/components/schemas/_types.Duration' trace: allOf: - $ref: '#/components/schemas/_types.Duration' indices._types.IndexSettingBlocks: type: object properties: read_only: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedboolean' read_only_allow_delete: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedboolean' read: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedboolean' write: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedboolean' metadata: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedboolean' _spec_utils.Stringifiedboolean: type: - boolean - string description: "Some APIs will return values such as numbers also as a string (notably epoch timestamps). This behavior\nis used to capture this behavior while keeping the semantics of the field type.\n\nDepending on the target language, code generators can keep the union or remove it and leniently parse\nstrings to the target type." indices._types.SettingsAnalyze: type: object properties: max_token_count: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedinteger' default: 10000 indices._types.SettingsHighlight: type: object properties: max_analyzed_offset: type: number default: 1000000 indices._types.IndexRouting: type: object properties: allocation: allOf: - $ref: '#/components/schemas/indices._types.IndexRoutingAllocation' rebalance: allOf: - $ref: '#/components/schemas/indices._types.IndexRoutingRebalance' indices._types.IndexRoutingAllocation: type: object properties: enable: allOf: - $ref: '#/components/schemas/indices._types.IndexRoutingAllocationOptions' include: allOf: - $ref: '#/components/schemas/indices._types.IndexRoutingAllocationInclude' require: allOf: - $ref: '#/components/schemas/indices._types.IndexRoutingAllocationRequire' description: "Assign the index to a node whose attribute has all of the given values.\nEach key is a node attribute: one of the built-in attributes `_name`, `_host_ip`, `_publish_ip`, `_ip`, `_host`, `_id` and `_tier`, or a custom node attribute.\nEach value is a comma-separated string or an array of strings, and can use wildcards." initial_recovery: allOf: - $ref: '#/components/schemas/indices._types.IndexRoutingAllocationInitialRecovery' disk: allOf: - $ref: '#/components/schemas/indices._types.IndexRoutingAllocationDisk' indices._types.IndexRoutingAllocationOptions: enum: - all - primaries - new_primaries - none type: string indices._types.IndexRoutingAllocationInclude: type: object properties: _tier_preference: type: string _id: allOf: - $ref: '#/components/schemas/_types.Id' indices._types.IndexRoutingAllocationRequire: type: object additionalProperties: oneOf: - type: string - type: array items: type: string indices._types.IndexRoutingAllocationInitialRecovery: type: object properties: _id: allOf: - $ref: '#/components/schemas/_types.Id' indices._types.IndexRoutingAllocationDisk: type: object properties: threshold_enabled: type: - boolean - string indices._types.IndexRoutingRebalance: required: - enable type: object properties: enable: allOf: - $ref: '#/components/schemas/indices._types.IndexRoutingRebalanceOptions' indices._types.IndexRoutingRebalanceOptions: enum: - all - primaries - replicas - none type: string indices._types.IndexSettingsUnassigned: type: object properties: node_left: allOf: - $ref: '#/components/schemas/indices._types.IndexSettingsUnassignedNodeLeft' indices._types.IndexSettingsUnassignedNodeLeft: type: object properties: delayed_timeout: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The amount of time to wait for a node that has left before assuming its\nshards are permanently missing and starting to allocate replacement replicas." default: 1m _types.PipelineName: type: string indices._types.IndexSettingsLifecycle: type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' description: 'The name of the policy to use to manage the index. For information about how Elasticsearch applies policy changes, see Policy updates.' indexing_complete: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedboolean' description: "Indicates whether or not the index has been rolled over. Automatically set to true when ILM completes the rollover action.\nYou can explicitly set it to skip rollover." default: false origination_date: type: number description: "If specified, this is the timestamp used to calculate the index age for its phase transitions. Use this setting\nif you create a new index that contains old data and want to use the original creation date to calculate the index\nage. Specified as a Unix epoch value in milliseconds." default: 0 parse_origination_date: type: boolean description: "Set to true to parse the origination date from the index name. This origination date is used to calculate the index age\nfor its phase transitions. The index name must match the pattern ^.*-{date_format}-\\\\d+, where the date_format is\nyyyy.MM.dd and the trailing digits are optional. An index that was rolled over would normally match the full format,\nfor example logs-2016.10.31-000002). If the index name doesn’t match the pattern, index creation fails." step: allOf: - $ref: '#/components/schemas/indices._types.IndexSettingsLifecycleStep' rollover_alias: type: string description: "The index alias to update when the index rolls over. Specify when using a policy that contains a rollover action.\nWhen the index rolls over, the alias is updated to reflect that the index is no longer the write index. For more\ninformation about rolling indices, see Rollover." default: '' prefer_ilm: type: - boolean - string description: "Preference for the system that manages a data stream backing index (preferring ILM when both ILM and DLM are\napplicable for an index)." default: true indices._types.IndexSettingsLifecycleStep: type: object properties: wait_time_threshold: allOf: - $ref: '#/components/schemas/_types.Duration' description: "Time to wait for the cluster to resolve allocation issues during an ILM shrink action. Must be greater than 1h (1 hour).\nSee Shard allocation for shrink." _spec_utils.StringifiedEpochTimeUnitMillis: oneOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' - type: string description: "Some APIs will return values such as numbers also as a string (notably epoch timestamps). This behavior\nis used to capture this behavior while keeping the semantics of the field type.\n\nDepending on the target language, code generators can keep the union or remove it and leniently parse\nstrings to the target type." _types.Uuid: type: string indices._types.IndexVersioning: type: object properties: created: allOf: - $ref: '#/components/schemas/_types.VersionString' created_string: type: string indices._types.Translog: type: object properties: sync_interval: allOf: - $ref: '#/components/schemas/_types.Duration' description: "How often the translog is fsynced to disk and committed, regardless of write operations.\nValues less than 100ms are not allowed." default: 5s durability: allOf: - $ref: '#/components/schemas/indices._types.TranslogDurability' description: "Whether or not to `fsync` and commit the translog after every index, delete, update, or bulk request.\n\nSupported values include:\n - `request` (or `REQUEST`): (default) fsync and commit after every request. In the event of hardware failure, all acknowledged writes\nwill already have been committed to disk.\n - `async` (or `ASYNC`): fsync and commit in the background every sync_interval. In the event of a failure, all acknowledged writes\nsince the last automatic commit will be discarded.\n\n" default: string flush_threshold_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "The translog stores all operations that are not yet safely persisted in Lucene (i.e., are not\npart of a Lucene commit point). Although these operations are available for reads, they will need\nto be replayed if the shard was stopped and had to be recovered. This setting controls the\nmaximum total size of these operations, to prevent recoveries from taking too long. Once the\nmaximum size has been reached a flush will happen, generating a new Lucene commit point." default: 512mb retention: allOf: - $ref: '#/components/schemas/indices._types.TranslogRetention' indices._types.TranslogDurability: enum: - request - REQUEST - async - ASYNC type: string indices._types.TranslogRetention: type: object properties: size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "This controls the total size of translog files to keep for each shard. Keeping more translog files increases\nthe chance of performing an operation based sync when recovering a replica. If the translog files are not\nsufficient, replica recovery will fall back to a file based sync. This setting is ignored, and should not be\nset, if soft deletes are enabled. Soft deletes are enabled by default in indices created in Elasticsearch\nversions 7.0.0 and later." default: 512mb age: allOf: - $ref: '#/components/schemas/_types.Duration' description: "This controls the maximum duration for which translog files are kept by each shard. Keeping more\ntranslog files increases the chance of performing an operation based sync when recovering replicas. If\nthe translog files are not sufficient, replica recovery will fall back to a file based sync. This setting\nis ignored, and should not be set, if soft deletes are enabled. Soft deletes are enabled by default in\nindices created in Elasticsearch versions 7.0.0 and later." default: 12h indices._types.SettingsQueryString: required: - lenient type: object properties: lenient: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedboolean' indices._types.IndexSettingsAnalysis: type: object properties: analyzer: type: object additionalProperties: $ref: '#/components/schemas/_types.analysis.Analyzer' char_filter: type: object additionalProperties: $ref: '#/components/schemas/_types.analysis.CharFilter' filter: type: object additionalProperties: $ref: '#/components/schemas/_types.analysis.TokenFilter' normalizer: type: object additionalProperties: $ref: '#/components/schemas/_types.analysis.Normalizer' tokenizer: type: object additionalProperties: $ref: '#/components/schemas/_types.analysis.Tokenizer' _types.analysis.Analyzer: oneOf: - $ref: '#/components/schemas/_types.analysis.CustomAnalyzer' - $ref: '#/components/schemas/_types.analysis.FingerprintAnalyzer' - $ref: '#/components/schemas/_types.analysis.KeywordAnalyzer' - $ref: '#/components/schemas/_types.analysis.NoriAnalyzer' - $ref: '#/components/schemas/_types.analysis.PatternAnalyzer' - $ref: '#/components/schemas/_types.analysis.SimpleAnalyzer' - $ref: '#/components/schemas/_types.analysis.StandardAnalyzer' - $ref: '#/components/schemas/_types.analysis.StopAnalyzer' - $ref: '#/components/schemas/_types.analysis.WhitespaceAnalyzer' - $ref: '#/components/schemas/_types.analysis.IcuAnalyzer' - $ref: '#/components/schemas/_types.analysis.KuromojiAnalyzer' - $ref: '#/components/schemas/_types.analysis.SnowballAnalyzer' - $ref: '#/components/schemas/_types.analysis.ArabicAnalyzer' - $ref: '#/components/schemas/_types.analysis.ArmenianAnalyzer' - $ref: '#/components/schemas/_types.analysis.BasqueAnalyzer' - $ref: '#/components/schemas/_types.analysis.BengaliAnalyzer' - $ref: '#/components/schemas/_types.analysis.BrazilianAnalyzer' - $ref: '#/components/schemas/_types.analysis.BulgarianAnalyzer' - $ref: '#/components/schemas/_types.analysis.CatalanAnalyzer' - $ref: '#/components/schemas/_types.analysis.ChineseAnalyzer' - $ref: '#/components/schemas/_types.analysis.CjkAnalyzer' - $ref: '#/components/schemas/_types.analysis.CzechAnalyzer' - $ref: '#/components/schemas/_types.analysis.DanishAnalyzer' - $ref: '#/components/schemas/_types.analysis.DutchAnalyzer' - $ref: '#/components/schemas/_types.analysis.EnglishAnalyzer' - $ref: '#/components/schemas/_types.analysis.EstonianAnalyzer' - $ref: '#/components/schemas/_types.analysis.FinnishAnalyzer' - $ref: '#/components/schemas/_types.analysis.FrenchAnalyzer' - $ref: '#/components/schemas/_types.analysis.GalicianAnalyzer' - $ref: '#/components/schemas/_types.analysis.GermanAnalyzer' - $ref: '#/components/schemas/_types.analysis.GreekAnalyzer' - $ref: '#/components/schemas/_types.analysis.HindiAnalyzer' - $ref: '#/components/schemas/_types.analysis.HungarianAnalyzer' - $ref: '#/components/schemas/_types.analysis.IndonesianAnalyzer' - $ref: '#/components/schemas/_types.analysis.IrishAnalyzer' - $ref: '#/components/schemas/_types.analysis.ItalianAnalyzer' - $ref: '#/components/schemas/_types.analysis.LatvianAnalyzer' - $ref: '#/components/schemas/_types.analysis.LithuanianAnalyzer' - $ref: '#/components/schemas/_types.analysis.NorwegianAnalyzer' - $ref: '#/components/schemas/_types.analysis.PersianAnalyzer' - $ref: '#/components/schemas/_types.analysis.PortugueseAnalyzer' - $ref: '#/components/schemas/_types.analysis.RomanianAnalyzer' - $ref: '#/components/schemas/_types.analysis.RussianAnalyzer' - $ref: '#/components/schemas/_types.analysis.SerbianAnalyzer' - $ref: '#/components/schemas/_types.analysis.SoraniAnalyzer' - $ref: '#/components/schemas/_types.analysis.SpanishAnalyzer' - $ref: '#/components/schemas/_types.analysis.SwedishAnalyzer' - $ref: '#/components/schemas/_types.analysis.TurkishAnalyzer' - $ref: '#/components/schemas/_types.analysis.ThaiAnalyzer' discriminator: propertyName: type mapping: arabic: '#/components/schemas/_types.analysis.ArabicAnalyzer' armenian: '#/components/schemas/_types.analysis.ArmenianAnalyzer' basque: '#/components/schemas/_types.analysis.BasqueAnalyzer' bengali: '#/components/schemas/_types.analysis.BengaliAnalyzer' brazilian: '#/components/schemas/_types.analysis.BrazilianAnalyzer' bulgarian: '#/components/schemas/_types.analysis.BulgarianAnalyzer' catalan: '#/components/schemas/_types.analysis.CatalanAnalyzer' chinese: '#/components/schemas/_types.analysis.ChineseAnalyzer' cjk: '#/components/schemas/_types.analysis.CjkAnalyzer' custom: '#/components/schemas/_types.analysis.CustomAnalyzer' czech: '#/components/schemas/_types.analysis.CzechAnalyzer' danish: '#/components/schemas/_types.analysis.DanishAnalyzer' dutch: '#/components/schemas/_types.analysis.DutchAnalyzer' english: '#/components/schemas/_types.analysis.EnglishAnalyzer' estonian: '#/components/schemas/_types.analysis.EstonianAnalyzer' fingerprint: '#/components/schemas/_types.analysis.FingerprintAnalyzer' finnish: '#/components/schemas/_types.analysis.FinnishAnalyzer' french: '#/components/schemas/_types.analysis.FrenchAnalyzer' galician: '#/components/schemas/_types.analysis.GalicianAnalyzer' german: '#/components/schemas/_types.analysis.GermanAnalyzer' greek: '#/components/schemas/_types.analysis.GreekAnalyzer' hindi: '#/components/schemas/_types.analysis.HindiAnalyzer' hungarian: '#/components/schemas/_types.analysis.HungarianAnalyzer' icu_analyzer: '#/components/schemas/_types.analysis.IcuAnalyzer' indonesian: '#/components/schemas/_types.analysis.IndonesianAnalyzer' irish: '#/components/schemas/_types.analysis.IrishAnalyzer' italian: '#/components/schemas/_types.analysis.ItalianAnalyzer' keyword: '#/components/schemas/_types.analysis.KeywordAnalyzer' kuromoji: '#/components/schemas/_types.analysis.KuromojiAnalyzer' latvian: '#/components/schemas/_types.analysis.LatvianAnalyzer' lithuanian: '#/components/schemas/_types.analysis.LithuanianAnalyzer' nori: '#/components/schemas/_types.analysis.NoriAnalyzer' norwegian: '#/components/schemas/_types.analysis.NorwegianAnalyzer' pattern: '#/components/schemas/_types.analysis.PatternAnalyzer' persian: '#/components/schemas/_types.analysis.PersianAnalyzer' portuguese: '#/components/schemas/_types.analysis.PortugueseAnalyzer' romanian: '#/components/schemas/_types.analysis.RomanianAnalyzer' russian: '#/components/schemas/_types.analysis.RussianAnalyzer' serbian: '#/components/schemas/_types.analysis.SerbianAnalyzer' simple: '#/components/schemas/_types.analysis.SimpleAnalyzer' snowball: '#/components/schemas/_types.analysis.SnowballAnalyzer' sorani: '#/components/schemas/_types.analysis.SoraniAnalyzer' spanish: '#/components/schemas/_types.analysis.SpanishAnalyzer' standard: '#/components/schemas/_types.analysis.StandardAnalyzer' stop: '#/components/schemas/_types.analysis.StopAnalyzer' swedish: '#/components/schemas/_types.analysis.SwedishAnalyzer' thai: '#/components/schemas/_types.analysis.ThaiAnalyzer' turkish: '#/components/schemas/_types.analysis.TurkishAnalyzer' whitespace: '#/components/schemas/_types.analysis.WhitespaceAnalyzer' _types.analysis.CustomAnalyzer: required: - type - tokenizer type: object properties: type: enum: - custom type: string char_filter: oneOf: - type: string - type: array items: type: string filter: oneOf: - type: string - type: array items: type: string position_increment_gap: type: number position_offset_gap: type: number tokenizer: type: string _types.analysis.FingerprintAnalyzer: required: - type type: object properties: type: enum: - fingerprint type: string version: allOf: - $ref: '#/components/schemas/_types.VersionString' deprecated: true max_output_size: type: number description: "The maximum token size to emit. Tokens larger than this size will be discarded.\nDefaults to `255`" default: 255 separator: type: string description: "The character to use to concatenate the terms.\nDefaults to a space." stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' description: "A pre-defined stop words list like `_english_` or an array containing a list of stop words.\nDefaults to `_none_`." default: _none_ stopwords_path: type: string description: The path to a file containing stop words. _types.analysis.KeywordAnalyzer: required: - type type: object properties: type: enum: - keyword type: string version: allOf: - $ref: '#/components/schemas/_types.VersionString' deprecated: true _types.analysis.NoriAnalyzer: required: - type type: object properties: type: enum: - nori type: string version: allOf: - $ref: '#/components/schemas/_types.VersionString' deprecated: true decompound_mode: allOf: - $ref: '#/components/schemas/_types.analysis.NoriDecompoundMode' stoptags: type: array items: type: string user_dictionary: type: string _types.analysis.NoriDecompoundMode: enum: - discard - none - mixed type: string _types.analysis.PatternAnalyzer: required: - type type: object properties: type: enum: - pattern type: string version: allOf: - $ref: '#/components/schemas/_types.VersionString' deprecated: true flags: type: string description: 'Java regular expression flags. Flags should be pipe-separated, eg "CASE_INSENSITIVE|COMMENTS".' lowercase: type: boolean description: "Should terms be lowercased or not.\nDefaults to `true`." default: true pattern: type: string description: "A Java regular expression.\nDefaults to `\\W+`." default: \W+ stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' description: "A pre-defined stop words list like `_english_` or an array containing a list of stop words.\nDefaults to `_none_`." default: _none_ stopwords_path: type: string description: The path to a file containing stop words. _types.analysis.SimpleAnalyzer: required: - type type: object properties: type: enum: - simple type: string version: allOf: - $ref: '#/components/schemas/_types.VersionString' deprecated: true _types.analysis.StandardAnalyzer: required: - type type: object properties: type: enum: - standard type: string max_token_length: type: number description: "The maximum token length. If a token is seen that exceeds this length then it is split at `max_token_length` intervals.\nDefaults to `255`." default: 255 stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' description: "A pre-defined stop words list like `_english_` or an array containing a list of stop words.\nDefaults to `_none_`." default: _none_ stopwords_path: type: string description: The path to a file containing stop words. _types.analysis.StopAnalyzer: required: - type type: object properties: type: enum: - stop type: string version: allOf: - $ref: '#/components/schemas/_types.VersionString' deprecated: true stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' description: "A pre-defined stop words list like `_english_` or an array containing a list of stop words.\nDefaults to `_none_`." default: _none_ stopwords_path: type: string description: The path to a file containing stop words. _types.analysis.WhitespaceAnalyzer: required: - type type: object properties: type: enum: - whitespace type: string version: allOf: - $ref: '#/components/schemas/_types.VersionString' deprecated: true _types.analysis.IcuAnalyzer: required: - type - method - mode type: object properties: type: enum: - icu_analyzer type: string method: allOf: - $ref: '#/components/schemas/_types.analysis.IcuNormalizationType' mode: allOf: - $ref: '#/components/schemas/_types.analysis.IcuNormalizationMode' _types.analysis.IcuNormalizationType: enum: - nfc - nfkc - nfkc_cf type: string _types.analysis.IcuNormalizationMode: enum: - decompose - compose type: string _types.analysis.KuromojiAnalyzer: required: - type type: object properties: type: enum: - kuromoji type: string mode: allOf: - $ref: '#/components/schemas/_types.analysis.KuromojiTokenizationMode' user_dictionary: type: string _types.analysis.KuromojiTokenizationMode: enum: - normal - search - extended type: string _types.analysis.SnowballAnalyzer: required: - type - language type: object properties: type: enum: - snowball type: string version: allOf: - $ref: '#/components/schemas/_types.VersionString' deprecated: true language: allOf: - $ref: '#/components/schemas/_types.analysis.SnowballLanguage' stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' _types.analysis.SnowballLanguage: enum: - Arabic - Armenian - Basque - Catalan - Danish - Dutch - English - Estonian - Finnish - French - German - German2 - Hungarian - Italian - Irish - Kp - Lithuanian - Lovins - Norwegian - Porter - Portuguese - Romanian - Russian - Serbian - Spanish - Swedish - Turkish type: string _types.analysis.ArabicAnalyzer: required: - type type: object properties: type: enum: - arabic type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.ArmenianAnalyzer: required: - type type: object properties: type: enum: - armenian type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.BasqueAnalyzer: required: - type type: object properties: type: enum: - basque type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.BengaliAnalyzer: required: - type type: object properties: type: enum: - bengali type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.BrazilianAnalyzer: required: - type type: object properties: type: enum: - brazilian type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string _types.analysis.BulgarianAnalyzer: required: - type type: object properties: type: enum: - bulgarian type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.CatalanAnalyzer: required: - type type: object properties: type: enum: - catalan type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.ChineseAnalyzer: required: - type type: object properties: type: enum: - chinese type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string _types.analysis.CjkAnalyzer: required: - type type: object properties: type: enum: - cjk type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string _types.analysis.CzechAnalyzer: required: - type type: object properties: type: enum: - czech type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.DanishAnalyzer: required: - type type: object properties: type: enum: - danish type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string _types.analysis.DutchAnalyzer: required: - type type: object properties: type: enum: - dutch type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.EnglishAnalyzer: required: - type type: object properties: type: enum: - english type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.EstonianAnalyzer: required: - type type: object properties: type: enum: - estonian type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string _types.analysis.FinnishAnalyzer: required: - type type: object properties: type: enum: - finnish type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.FrenchAnalyzer: required: - type type: object properties: type: enum: - french type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.GalicianAnalyzer: required: - type type: object properties: type: enum: - galician type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.GermanAnalyzer: required: - type type: object properties: type: enum: - german type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.GreekAnalyzer: required: - type type: object properties: type: enum: - greek type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string _types.analysis.HindiAnalyzer: required: - type type: object properties: type: enum: - hindi type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.HungarianAnalyzer: required: - type type: object properties: type: enum: - hungarian type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.IndonesianAnalyzer: required: - type type: object properties: type: enum: - indonesian type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.IrishAnalyzer: required: - type type: object properties: type: enum: - irish type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.ItalianAnalyzer: required: - type type: object properties: type: enum: - italian type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.LatvianAnalyzer: required: - type type: object properties: type: enum: - latvian type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.LithuanianAnalyzer: required: - type type: object properties: type: enum: - lithuanian type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.NorwegianAnalyzer: required: - type type: object properties: type: enum: - norwegian type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.PersianAnalyzer: required: - type type: object properties: type: enum: - persian type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string _types.analysis.PortugueseAnalyzer: required: - type type: object properties: type: enum: - portuguese type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.RomanianAnalyzer: required: - type type: object properties: type: enum: - romanian type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.RussianAnalyzer: required: - type type: object properties: type: enum: - russian type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.SerbianAnalyzer: required: - type type: object properties: type: enum: - serbian type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.SoraniAnalyzer: required: - type type: object properties: type: enum: - sorani type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.SpanishAnalyzer: required: - type type: object properties: type: enum: - spanish type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.SwedishAnalyzer: required: - type type: object properties: type: enum: - swedish type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.TurkishAnalyzer: required: - type type: object properties: type: enum: - turkish type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string stem_exclusion: type: array items: type: string _types.analysis.ThaiAnalyzer: required: - type type: object properties: type: enum: - thai type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' stopwords_path: type: string _types.analysis.CharFilter: externalDocs: url: https://www.elastic.co/docs/reference/text-analysis/character-filter-reference x-model: true _types.analysis.CharFilterDefinition: oneOf: - $ref: '#/components/schemas/_types.analysis.HtmlStripCharFilter' - $ref: '#/components/schemas/_types.analysis.MappingCharFilter' - $ref: '#/components/schemas/_types.analysis.PatternReplaceCharFilter' - $ref: '#/components/schemas/_types.analysis.IcuNormalizationCharFilter' - $ref: '#/components/schemas/_types.analysis.KuromojiIterationMarkCharFilter' discriminator: propertyName: type mapping: html_strip: '#/components/schemas/_types.analysis.HtmlStripCharFilter' icu_normalizer: '#/components/schemas/_types.analysis.IcuNormalizationCharFilter' kuromoji_iteration_mark: '#/components/schemas/_types.analysis.KuromojiIterationMarkCharFilter' mapping: '#/components/schemas/_types.analysis.MappingCharFilter' pattern_replace: '#/components/schemas/_types.analysis.PatternReplaceCharFilter' _types.analysis.HtmlStripCharFilter: allOf: - $ref: '#/components/schemas/_types.analysis.CharFilterBase' - required: - type type: object properties: type: enum: - html_strip type: string escaped_tags: type: array items: type: string _types.analysis.CharFilterBase: type: object properties: version: allOf: - $ref: '#/components/schemas/_types.VersionString' _types.analysis.MappingCharFilter: allOf: - $ref: '#/components/schemas/_types.analysis.CharFilterBase' - required: - type type: object properties: type: enum: - mapping type: string mappings: type: array items: type: string mappings_path: type: string _types.analysis.PatternReplaceCharFilter: allOf: - $ref: '#/components/schemas/_types.analysis.CharFilterBase' - required: - type - pattern type: object properties: type: enum: - pattern_replace type: string flags: type: string pattern: type: string replacement: type: string _types.analysis.IcuNormalizationCharFilter: allOf: - $ref: '#/components/schemas/_types.analysis.CharFilterBase' - required: - type type: object properties: type: enum: - icu_normalizer type: string mode: allOf: - $ref: '#/components/schemas/_types.analysis.IcuNormalizationMode' name: allOf: - $ref: '#/components/schemas/_types.analysis.IcuNormalizationType' unicode_set_filter: type: string _types.analysis.KuromojiIterationMarkCharFilter: allOf: - $ref: '#/components/schemas/_types.analysis.CharFilterBase' - required: - type - normalize_kana - normalize_kanji type: object properties: type: enum: - kuromoji_iteration_mark type: string normalize_kana: type: boolean normalize_kanji: type: boolean _types.analysis.TokenFilter: externalDocs: url: https://www.elastic.co/docs/reference/text-analysis/token-filter-reference x-model: true _types.analysis.TokenFilterDefinition: oneOf: - $ref: '#/components/schemas/_types.analysis.ApostropheTokenFilter' - $ref: '#/components/schemas/_types.analysis.ArabicStemTokenFilter' - $ref: '#/components/schemas/_types.analysis.ArabicNormalizationTokenFilter' - $ref: '#/components/schemas/_types.analysis.AsciiFoldingTokenFilter' - $ref: '#/components/schemas/_types.analysis.BengaliNormalizationTokenFilter' - $ref: '#/components/schemas/_types.analysis.BrazilianStemTokenFilter' - $ref: '#/components/schemas/_types.analysis.CjkBigramTokenFilter' - $ref: '#/components/schemas/_types.analysis.CjkWidthTokenFilter' - $ref: '#/components/schemas/_types.analysis.ClassicTokenFilter' - $ref: '#/components/schemas/_types.analysis.CommonGramsTokenFilter' - $ref: '#/components/schemas/_types.analysis.ConditionTokenFilter' - $ref: '#/components/schemas/_types.analysis.CzechStemTokenFilter' - $ref: '#/components/schemas/_types.analysis.DecimalDigitTokenFilter' - $ref: '#/components/schemas/_types.analysis.DelimitedPayloadTokenFilter' - $ref: '#/components/schemas/_types.analysis.DutchStemTokenFilter' - $ref: '#/components/schemas/_types.analysis.EdgeNGramTokenFilter' - $ref: '#/components/schemas/_types.analysis.ElisionTokenFilter' - $ref: '#/components/schemas/_types.analysis.FingerprintTokenFilter' - $ref: '#/components/schemas/_types.analysis.FlattenGraphTokenFilter' - $ref: '#/components/schemas/_types.analysis.FrenchStemTokenFilter' - $ref: '#/components/schemas/_types.analysis.GermanNormalizationTokenFilter' - $ref: '#/components/schemas/_types.analysis.GermanStemTokenFilter' - $ref: '#/components/schemas/_types.analysis.HindiNormalizationTokenFilter' - $ref: '#/components/schemas/_types.analysis.HunspellTokenFilter' - $ref: '#/components/schemas/_types.analysis.HyphenationDecompounderTokenFilter' - $ref: '#/components/schemas/_types.analysis.IndicNormalizationTokenFilter' - $ref: '#/components/schemas/_types.analysis.KeepTypesTokenFilter' - $ref: '#/components/schemas/_types.analysis.KeepWordsTokenFilter' - $ref: '#/components/schemas/_types.analysis.KeywordMarkerTokenFilter' - $ref: '#/components/schemas/_types.analysis.KeywordRepeatTokenFilter' - $ref: '#/components/schemas/_types.analysis.KStemTokenFilter' - $ref: '#/components/schemas/_types.analysis.LengthTokenFilter' - $ref: '#/components/schemas/_types.analysis.LimitTokenCountTokenFilter' - $ref: '#/components/schemas/_types.analysis.LowercaseTokenFilter' - $ref: '#/components/schemas/_types.analysis.MinHashTokenFilter' - $ref: '#/components/schemas/_types.analysis.MultiplexerTokenFilter' - $ref: '#/components/schemas/_types.analysis.NGramTokenFilter' - $ref: '#/components/schemas/_types.analysis.NoriPartOfSpeechTokenFilter' - $ref: '#/components/schemas/_types.analysis.PatternCaptureTokenFilter' - $ref: '#/components/schemas/_types.analysis.PatternReplaceTokenFilter' - $ref: '#/components/schemas/_types.analysis.PersianNormalizationTokenFilter' - $ref: '#/components/schemas/_types.analysis.PersianStemTokenFilter' - $ref: '#/components/schemas/_types.analysis.PorterStemTokenFilter' - $ref: '#/components/schemas/_types.analysis.PredicateTokenFilter' - $ref: '#/components/schemas/_types.analysis.RemoveDuplicatesTokenFilter' - $ref: '#/components/schemas/_types.analysis.ReverseTokenFilter' - $ref: '#/components/schemas/_types.analysis.RussianStemTokenFilter' - $ref: '#/components/schemas/_types.analysis.ScandinavianFoldingTokenFilter' - $ref: '#/components/schemas/_types.analysis.ScandinavianNormalizationTokenFilter' - $ref: '#/components/schemas/_types.analysis.SerbianNormalizationTokenFilter' - $ref: '#/components/schemas/_types.analysis.ShingleTokenFilter' - $ref: '#/components/schemas/_types.analysis.SnowballTokenFilter' - $ref: '#/components/schemas/_types.analysis.SoraniNormalizationTokenFilter' - $ref: '#/components/schemas/_types.analysis.StemmerOverrideTokenFilter' - $ref: '#/components/schemas/_types.analysis.StemmerTokenFilter' - $ref: '#/components/schemas/_types.analysis.StopTokenFilter' - $ref: '#/components/schemas/_types.analysis.SynonymGraphTokenFilter' - $ref: '#/components/schemas/_types.analysis.SynonymTokenFilter' - $ref: '#/components/schemas/_types.analysis.TrimTokenFilter' - $ref: '#/components/schemas/_types.analysis.TruncateTokenFilter' - $ref: '#/components/schemas/_types.analysis.UniqueTokenFilter' - $ref: '#/components/schemas/_types.analysis.UppercaseTokenFilter' - $ref: '#/components/schemas/_types.analysis.WordDelimiterGraphTokenFilter' - $ref: '#/components/schemas/_types.analysis.WordDelimiterTokenFilter' - $ref: '#/components/schemas/_types.analysis.JaStopTokenFilter' - $ref: '#/components/schemas/_types.analysis.KuromojiStemmerTokenFilter' - $ref: '#/components/schemas/_types.analysis.KuromojiReadingFormTokenFilter' - $ref: '#/components/schemas/_types.analysis.KuromojiPartOfSpeechTokenFilter' - $ref: '#/components/schemas/_types.analysis.IcuCollationTokenFilter' - $ref: '#/components/schemas/_types.analysis.IcuFoldingTokenFilter' - $ref: '#/components/schemas/_types.analysis.IcuNormalizationTokenFilter' - $ref: '#/components/schemas/_types.analysis.IcuTransformTokenFilter' - $ref: '#/components/schemas/_types.analysis.PhoneticTokenFilter' - $ref: '#/components/schemas/_types.analysis.DictionaryDecompounderTokenFilter' discriminator: propertyName: type mapping: apostrophe: '#/components/schemas/_types.analysis.ApostropheTokenFilter' arabic_normalization: '#/components/schemas/_types.analysis.ArabicNormalizationTokenFilter' arabic_stem: '#/components/schemas/_types.analysis.ArabicStemTokenFilter' asciifolding: '#/components/schemas/_types.analysis.AsciiFoldingTokenFilter' bengali_normalization: '#/components/schemas/_types.analysis.BengaliNormalizationTokenFilter' brazilian_stem: '#/components/schemas/_types.analysis.BrazilianStemTokenFilter' cjk_bigram: '#/components/schemas/_types.analysis.CjkBigramTokenFilter' cjk_width: '#/components/schemas/_types.analysis.CjkWidthTokenFilter' classic: '#/components/schemas/_types.analysis.ClassicTokenFilter' common_grams: '#/components/schemas/_types.analysis.CommonGramsTokenFilter' condition: '#/components/schemas/_types.analysis.ConditionTokenFilter' czech_stem: '#/components/schemas/_types.analysis.CzechStemTokenFilter' decimal_digit: '#/components/schemas/_types.analysis.DecimalDigitTokenFilter' delimited_payload: '#/components/schemas/_types.analysis.DelimitedPayloadTokenFilter' dictionary_decompounder: '#/components/schemas/_types.analysis.DictionaryDecompounderTokenFilter' dutch_stem: '#/components/schemas/_types.analysis.DutchStemTokenFilter' edge_ngram: '#/components/schemas/_types.analysis.EdgeNGramTokenFilter' elision: '#/components/schemas/_types.analysis.ElisionTokenFilter' fingerprint: '#/components/schemas/_types.analysis.FingerprintTokenFilter' flatten_graph: '#/components/schemas/_types.analysis.FlattenGraphTokenFilter' french_stem: '#/components/schemas/_types.analysis.FrenchStemTokenFilter' german_normalization: '#/components/schemas/_types.analysis.GermanNormalizationTokenFilter' german_stem: '#/components/schemas/_types.analysis.GermanStemTokenFilter' hindi_normalization: '#/components/schemas/_types.analysis.HindiNormalizationTokenFilter' hunspell: '#/components/schemas/_types.analysis.HunspellTokenFilter' hyphenation_decompounder: '#/components/schemas/_types.analysis.HyphenationDecompounderTokenFilter' icu_collation: '#/components/schemas/_types.analysis.IcuCollationTokenFilter' icu_folding: '#/components/schemas/_types.analysis.IcuFoldingTokenFilter' icu_normalizer: '#/components/schemas/_types.analysis.IcuNormalizationTokenFilter' icu_transform: '#/components/schemas/_types.analysis.IcuTransformTokenFilter' indic_normalization: '#/components/schemas/_types.analysis.IndicNormalizationTokenFilter' ja_stop: '#/components/schemas/_types.analysis.JaStopTokenFilter' keep: '#/components/schemas/_types.analysis.KeepWordsTokenFilter' keep_types: '#/components/schemas/_types.analysis.KeepTypesTokenFilter' keyword_marker: '#/components/schemas/_types.analysis.KeywordMarkerTokenFilter' keyword_repeat: '#/components/schemas/_types.analysis.KeywordRepeatTokenFilter' kstem: '#/components/schemas/_types.analysis.KStemTokenFilter' kuromoji_part_of_speech: '#/components/schemas/_types.analysis.KuromojiPartOfSpeechTokenFilter' kuromoji_readingform: '#/components/schemas/_types.analysis.KuromojiReadingFormTokenFilter' kuromoji_stemmer: '#/components/schemas/_types.analysis.KuromojiStemmerTokenFilter' length: '#/components/schemas/_types.analysis.LengthTokenFilter' limit: '#/components/schemas/_types.analysis.LimitTokenCountTokenFilter' lowercase: '#/components/schemas/_types.analysis.LowercaseTokenFilter' min_hash: '#/components/schemas/_types.analysis.MinHashTokenFilter' multiplexer: '#/components/schemas/_types.analysis.MultiplexerTokenFilter' ngram: '#/components/schemas/_types.analysis.NGramTokenFilter' nori_part_of_speech: '#/components/schemas/_types.analysis.NoriPartOfSpeechTokenFilter' pattern_capture: '#/components/schemas/_types.analysis.PatternCaptureTokenFilter' pattern_replace: '#/components/schemas/_types.analysis.PatternReplaceTokenFilter' persian_normalization: '#/components/schemas/_types.analysis.PersianNormalizationTokenFilter' persian_stem: '#/components/schemas/_types.analysis.PersianStemTokenFilter' phonetic: '#/components/schemas/_types.analysis.PhoneticTokenFilter' porter_stem: '#/components/schemas/_types.analysis.PorterStemTokenFilter' predicate_token_filter: '#/components/schemas/_types.analysis.PredicateTokenFilter' remove_duplicates: '#/components/schemas/_types.analysis.RemoveDuplicatesTokenFilter' reverse: '#/components/schemas/_types.analysis.ReverseTokenFilter' russian_stem: '#/components/schemas/_types.analysis.RussianStemTokenFilter' scandinavian_folding: '#/components/schemas/_types.analysis.ScandinavianFoldingTokenFilter' scandinavian_normalization: '#/components/schemas/_types.analysis.ScandinavianNormalizationTokenFilter' serbian_normalization: '#/components/schemas/_types.analysis.SerbianNormalizationTokenFilter' shingle: '#/components/schemas/_types.analysis.ShingleTokenFilter' snowball: '#/components/schemas/_types.analysis.SnowballTokenFilter' sorani_normalization: '#/components/schemas/_types.analysis.SoraniNormalizationTokenFilter' stemmer: '#/components/schemas/_types.analysis.StemmerTokenFilter' stemmer_override: '#/components/schemas/_types.analysis.StemmerOverrideTokenFilter' stop: '#/components/schemas/_types.analysis.StopTokenFilter' synonym: '#/components/schemas/_types.analysis.SynonymTokenFilter' synonym_graph: '#/components/schemas/_types.analysis.SynonymGraphTokenFilter' trim: '#/components/schemas/_types.analysis.TrimTokenFilter' truncate: '#/components/schemas/_types.analysis.TruncateTokenFilter' unique: '#/components/schemas/_types.analysis.UniqueTokenFilter' uppercase: '#/components/schemas/_types.analysis.UppercaseTokenFilter' word_delimiter: '#/components/schemas/_types.analysis.WordDelimiterTokenFilter' word_delimiter_graph: '#/components/schemas/_types.analysis.WordDelimiterGraphTokenFilter' _types.analysis.ApostropheTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - apostrophe type: string _types.analysis.TokenFilterBase: type: object properties: version: allOf: - $ref: '#/components/schemas/_types.VersionString' _types.analysis.ArabicStemTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - arabic_stem type: string _types.analysis.ArabicNormalizationTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - arabic_normalization type: string _types.analysis.AsciiFoldingTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - asciifolding type: string preserve_original: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedboolean' description: 'If `true`, emit both original tokens and folded tokens. Defaults to `false`.' _types.analysis.BengaliNormalizationTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - bengali_normalization type: string _types.analysis.BrazilianStemTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - brazilian_stem type: string _types.analysis.CjkBigramTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - cjk_bigram type: string ignored_scripts: type: array items: $ref: '#/components/schemas/_types.analysis.CjkBigramIgnoredScript' description: Array of character scripts for which to disable bigrams. output_unigrams: type: boolean description: 'If `true`, emit tokens in both bigram and unigram form. If `false`, a CJK character is output in unigram form when it has no adjacent characters. Defaults to `false`.' _types.analysis.CjkBigramIgnoredScript: enum: - han - hangul - hiragana - katakana type: string _types.analysis.CjkWidthTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - cjk_width type: string _types.analysis.ClassicTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - classic type: string _types.analysis.CommonGramsTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - common_grams type: string common_words: type: array items: type: string description: "A list of tokens. The filter generates bigrams for these tokens.\nEither this or the `common_words_path` parameter is required." common_words_path: type: string description: "Path to a file containing a list of tokens. The filter generates bigrams for these tokens.\nThis path must be absolute or relative to the `config` location. The file must be UTF-8 encoded. Each token in the file must be separated by a line break.\nEither this or the `common_words` parameter is required." ignore_case: type: boolean description: 'If `true`, matches for common words matching are case-insensitive. Defaults to `false`.' query_mode: type: boolean description: "If `true`, the filter excludes the following tokens from the output:\n- Unigrams for common words\n- Unigrams for terms followed by common words\nDefaults to `false`. We recommend enabling this parameter for search analyzers." _types.analysis.ConditionTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type - filter - script type: object properties: type: enum: - condition type: string filter: type: array items: type: string description: 'Array of token filters. If a token matches the predicate script in the `script` parameter, these filters are applied to the token in the order provided.' script: allOf: - $ref: '#/components/schemas/_types.Script' description: 'Predicate script used to apply token filters. If a token matches this script, the filters in the `filter` parameter are applied to the token.' _types.analysis.CzechStemTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - czech_stem type: string _types.analysis.DecimalDigitTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - decimal_digit type: string _types.analysis.DelimitedPayloadTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - delimited_payload type: string delimiter: type: string description: Character used to separate tokens from payloads. Defaults to `|`. encoding: allOf: - $ref: '#/components/schemas/_types.analysis.DelimitedPayloadEncoding' description: Data type for the stored payload. _types.analysis.DelimitedPayloadEncoding: enum: - int - float - identity type: string _types.analysis.DutchStemTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - dutch_stem type: string _types.analysis.EdgeNGramTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - edge_ngram type: string max_gram: type: number description: 'Maximum character length of a gram. For custom token filters, defaults to `2`. For the built-in edge_ngram filter, defaults to `1`.' min_gram: type: number description: Minimum character length of a gram. Defaults to `1`. side: allOf: - $ref: '#/components/schemas/_types.analysis.EdgeNGramSide' description: Indicates whether to truncate tokens from the `front` or `back`. Defaults to `front`. preserve_original: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedboolean' description: Emits original token when set to `true`. Defaults to `false`. _types.analysis.EdgeNGramSide: enum: - front - back type: string _types.analysis.ElisionTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - elision type: string articles: type: array items: type: string description: "List of elisions to remove.\nTo be removed, the elision must be at the beginning of a token and be immediately followed by an apostrophe. Both the elision and apostrophe are removed.\nFor custom `elision` filters, either this parameter or `articles_path` must be specified." articles_path: type: string description: "Path to a file that contains a list of elisions to remove.\nThis path must be absolute or relative to the `config` location, and the file must be UTF-8 encoded. Each elision in the file must be separated by a line break.\nTo be removed, the elision must be at the beginning of a token and be immediately followed by an apostrophe. Both the elision and apostrophe are removed.\nFor custom `elision` filters, either this parameter or `articles` must be specified." articles_case: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedboolean' description: 'If `true`, elision matching is case insensitive. If `false`, elision matching is case sensitive. Defaults to `false`.' _types.analysis.FingerprintTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - fingerprint type: string max_output_size: type: number description: 'Maximum character length, including whitespace, of the output token. Defaults to `255`. Concatenated tokens longer than this will result in no token output.' separator: type: string description: Character to use to concatenate the token stream input. Defaults to a space. _types.analysis.FlattenGraphTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - flatten_graph type: string _types.analysis.FrenchStemTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - french_stem type: string _types.analysis.GermanNormalizationTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - german_normalization type: string _types.analysis.GermanStemTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - german_stem type: string _types.analysis.HindiNormalizationTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - hindi_normalization type: string _types.analysis.HunspellTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type - locale type: object properties: type: enum: - hunspell type: string dedup: type: boolean description: 'If `true`, duplicate tokens are removed from the filter’s output. Defaults to `true`.' dictionary: type: string description: "One or more `.dic` files (e.g, `en_US.dic`, my_custom.dic) to use for the Hunspell dictionary.\nBy default, the `hunspell` filter uses all `.dic` files in the `<$ES_PATH_CONF>/hunspell/` directory specified using the `lang`, `language`, or `locale` parameter." locale: type: string description: Locale directory used to specify the `.aff` and `.dic` files for a Hunspell dictionary. longest_only: type: boolean description: 'If `true`, only the longest stemmed version of each token is included in the output. If `false`, all stemmed versions of the token are included. Defaults to `false`.' _types.analysis.HyphenationDecompounderTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.CompoundWordTokenFilterBase' - required: - type - hyphenation_patterns_path type: object properties: type: enum: - hyphenation_decompounder type: string hyphenation_patterns_path: type: string description: "Path to an Apache FOP (Formatting Objects Processor) XML hyphenation pattern file.\nThis path must be absolute or relative to the `config` location. Only FOP v1.2 compatible files are supported." no_sub_matches: type: boolean description: 'If `true`, do not match sub tokens in tokens that are in the word list. Defaults to `false`.' no_overlapping_matches: type: boolean description: 'If `true`, do not allow overlapping tokens. Defaults to `false`.' _types.analysis.CompoundWordTokenFilterBase: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - type: object properties: max_subword_size: type: number description: Maximum subword character length. Longer subword tokens are excluded from the output. Defaults to `15`. min_subword_size: type: number description: Minimum subword character length. Shorter subword tokens are excluded from the output. Defaults to `2`. min_word_size: type: number description: Minimum word character length. Shorter word tokens are excluded from the output. Defaults to `5`. only_longest_match: type: boolean description: 'If `true`, only include the longest matching subword. Defaults to `false`.' word_list: type: array items: type: string description: "A list of subwords to look for in the token stream. If found, the subword is included in the token output.\nEither this parameter or `word_list_path` must be specified." word_list_path: type: string description: "Path to a file that contains a list of subwords to find in the token stream. If found, the subword is included in the token output.\nThis path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each token in the file must be separated by a line break.\nEither this parameter or `word_list` must be specified." _types.analysis.IndicNormalizationTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - indic_normalization type: string _types.analysis.KeepTypesTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type - types type: object properties: type: enum: - keep_types type: string mode: allOf: - $ref: '#/components/schemas/_types.analysis.KeepTypesMode' description: Indicates whether to keep or remove the specified token types. types: type: array items: type: string description: List of token types to keep or remove. _types.analysis.KeepTypesMode: enum: - include - exclude type: string _types.analysis.KeepWordsTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - keep type: string keep_words: type: array items: type: string description: "List of words to keep. Only tokens that match words in this list are included in the output.\nEither this parameter or `keep_words_path` must be specified." keep_words_case: type: boolean description: 'If `true`, lowercase all keep words. Defaults to `false`.' keep_words_path: type: string description: "Path to a file that contains a list of words to keep. Only tokens that match words in this list are included in the output.\nThis path must be absolute or relative to the `config` location, and the file must be UTF-8 encoded. Each word in the file must be separated by a line break.\nEither this parameter or `keep_words` must be specified." _types.analysis.KeywordMarkerTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - keyword_marker type: string ignore_case: type: boolean description: 'If `true`, matching for the `keywords` and `keywords_path` parameters ignores letter case. Defaults to `false`.' keywords: oneOf: - type: string - type: array items: type: string description: "Array of keywords. Tokens that match these keywords are not stemmed.\nThis parameter, `keywords_path`, or `keywords_pattern` must be specified. You cannot specify this parameter and `keywords_pattern`." keywords_path: type: string description: "Path to a file that contains a list of keywords. Tokens that match these keywords are not stemmed.\nThis path must be absolute or relative to the `config` location, and the file must be UTF-8 encoded. Each word in the file must be separated by a line break.\nThis parameter, `keywords`, or `keywords_pattern` must be specified. You cannot specify this parameter and `keywords_pattern`." keywords_pattern: type: string description: "Java regular expression used to match tokens. Tokens that match this expression are marked as keywords and not stemmed.\nThis parameter, `keywords`, or `keywords_path` must be specified. You cannot specify this parameter and `keywords` or `keywords_pattern`." _types.analysis.KeywordRepeatTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - keyword_repeat type: string _types.analysis.KStemTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - kstem type: string _types.analysis.LengthTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - length type: string max: type: number description: 'Maximum character length of a token. Longer tokens are excluded from the output. Defaults to `Integer.MAX_VALUE`, which is `2^31-1` or `2147483647`.' min: type: number description: Minimum character length of a token. Shorter tokens are excluded from the output. Defaults to `0`. _types.analysis.LimitTokenCountTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - limit type: string consume_all_tokens: type: boolean description: 'If `true`, the limit filter exhausts the token stream, even if the `max_token_count` has already been reached. Defaults to `false`.' max_token_count: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedinteger' description: 'Maximum number of tokens to keep. Once this limit is reached, any remaining tokens are excluded from the output. Defaults to `1`.' _types.analysis.LowercaseTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - lowercase type: string language: allOf: - $ref: '#/components/schemas/_types.analysis.LowercaseTokenFilterLanguages' description: Language-specific lowercase token filter to use. _types.analysis.LowercaseTokenFilterLanguages: enum: - greek - irish - turkish type: string _types.analysis.MinHashTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - min_hash type: string bucket_count: type: number description: Number of buckets to which hashes are assigned. Defaults to `512`. hash_count: type: number description: Number of ways to hash each token in the stream. Defaults to `1`. hash_set_size: type: number description: "Number of hashes to keep from each bucket. Defaults to `1`.\nHashes are retained by ascending size, starting with the bucket’s smallest hash first." with_rotation: type: boolean description: 'If `true`, the filter fills empty buckets with the value of the first non-empty bucket to its circular right if the `hash_set_size` is `1`. If the `bucket_count` argument is greater than 1, this parameter defaults to `true`. Otherwise, this parameter defaults to `false`.' _types.analysis.MultiplexerTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type - filters type: object properties: type: enum: - multiplexer type: string filters: type: array items: type: string description: A list of token filters to apply to incoming tokens. preserve_original: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedboolean' description: If `true` (the default) then emit the original token in addition to the filtered tokens. _types.analysis.NGramTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - ngram type: string max_gram: type: number description: Maximum length of characters in a gram. Defaults to `2`. min_gram: type: number description: Minimum length of characters in a gram. Defaults to `1`. preserve_original: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedboolean' description: Emits original token when set to `true`. Defaults to `false`. _types.analysis.NoriPartOfSpeechTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - nori_part_of_speech type: string stoptags: type: array items: type: string description: An array of part-of-speech tags that should be removed. _types.analysis.PatternCaptureTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type - patterns type: object properties: type: enum: - pattern_capture type: string patterns: type: array items: type: string description: A list of regular expressions to match. preserve_original: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedboolean' description: If set to `true` (the default) it will emit the original token. _types.analysis.PatternReplaceTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type - pattern type: object properties: type: enum: - pattern_replace type: string all: type: boolean description: 'If `true`, all substrings matching the pattern parameter’s regular expression are replaced. If `false`, the filter replaces only the first matching substring in each token. Defaults to `true`.' flags: type: string pattern: type: string description: 'Regular expression, written in Java’s regular expression syntax. The filter replaces token substrings matching this pattern with the substring in the `replacement` parameter.' replacement: type: string description: Replacement substring. Defaults to an empty substring (`""`). _types.analysis.PersianNormalizationTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - persian_normalization type: string _types.analysis.PersianStemTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - persian_stem type: string _types.analysis.PorterStemTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - porter_stem type: string _types.analysis.PredicateTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type - script type: object properties: type: enum: - predicate_token_filter type: string script: allOf: - $ref: '#/components/schemas/_types.Script' description: Script containing a condition used to filter incoming tokens. Only tokens that match this script are included in the output. _types.analysis.RemoveDuplicatesTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - remove_duplicates type: string _types.analysis.ReverseTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - reverse type: string _types.analysis.RussianStemTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - russian_stem type: string _types.analysis.ScandinavianFoldingTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - scandinavian_folding type: string _types.analysis.ScandinavianNormalizationTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - scandinavian_normalization type: string _types.analysis.SerbianNormalizationTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - serbian_normalization type: string _types.analysis.ShingleTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - shingle type: string filler_token: type: string description: 'String used in shingles as a replacement for empty positions that do not contain a token. This filler token is only used in shingles, not original unigrams. Defaults to an underscore (`_`).' max_shingle_size: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedinteger' description: Maximum number of tokens to concatenate when creating shingles. Defaults to `2`. min_shingle_size: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedinteger' description: Minimum number of tokens to concatenate when creating shingles. Defaults to `2`. output_unigrams: type: boolean description: 'If `true`, the output includes the original input tokens. If `false`, the output only includes shingles; the original input tokens are removed. Defaults to `true`.' output_unigrams_if_no_shingles: type: boolean description: 'If `true`, the output includes the original input tokens only if no shingles are produced; if shingles are produced, the output only includes shingles. Defaults to `false`.' token_separator: type: string description: Separator used to concatenate adjacent tokens to form a shingle. Defaults to a space (`" "`). _types.analysis.SnowballTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - snowball type: string language: allOf: - $ref: '#/components/schemas/_types.analysis.SnowballLanguage' description: Controls the language used by the stemmer. _types.analysis.SoraniNormalizationTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - sorani_normalization type: string _types.analysis.StemmerOverrideTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - stemmer_override type: string rules: type: array items: type: string description: A list of mapping rules to use. rules_path: type: string description: 'A path (either relative to `config` location, or absolute) to a list of mappings.' _types.analysis.StemmerTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - stemmer type: string language: type: string _types.analysis.StopTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - stop type: string ignore_case: type: boolean description: 'If `true`, stop word matching is case insensitive. For example, if `true`, a stop word of the matches and removes `The`, `THE`, or `the`. Defaults to `false`.' remove_trailing: type: boolean description: 'If `true`, the last token of a stream is removed if it’s a stop word. Defaults to `true`.' stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' description: 'Language value, such as `_arabic_` or `_thai_`. Defaults to `_english_`.' stopwords_path: type: string description: "Path to a file that contains a list of stop words to remove.\nThis path must be absolute or relative to the `config` location, and the file must be UTF-8 encoded. Each stop word in the file must be separated by a line break." _types.analysis.SynonymGraphTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.SynonymTokenFilterBase' - required: - type type: object properties: type: enum: - synonym_graph type: string _types.analysis.SynonymTokenFilterBase: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - type: object properties: expand: type: boolean description: Expands definitions for equivalent synonym rules. Defaults to `true`. format: allOf: - $ref: '#/components/schemas/_types.analysis.SynonymFormat' description: Sets the synonym rules format. lenient: type: boolean description: If `true` ignores errors while parsing the synonym rules. It is important to note that only those synonym rules which cannot get parsed are ignored. Defaults to the value of the `updateable` setting. synonyms: type: array items: type: string description: Used to define inline synonyms. synonyms_path: type: string description: Used to provide a synonym file. This path must be absolute or relative to the `config` location. synonyms_set: oneOf: - type: string - type: array items: type: string description: Provide one or more synonym sets created through the Synonyms Management APIs. Maximum 100 sets per filter. tokenizer: type: string description: 'Controls the tokenizers that will be used to tokenize the synonym, this parameter is for backwards compatibility for indices that created before 6.0.' deprecated: true updateable: type: boolean description: If `true` allows reloading search analyzers to pick up changes to synonym files. Only to be used for search analyzers. Defaults to `false`. _types.analysis.SynonymFormat: enum: - solr - wordnet type: string _types.analysis.SynonymTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.SynonymTokenFilterBase' - required: - type type: object properties: type: enum: - synonym type: string _types.analysis.TrimTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - trim type: string _types.analysis.TruncateTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - truncate type: string length: type: number description: Character limit for each token. Tokens exceeding this limit are truncated. Defaults to `10`. _types.analysis.UniqueTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - unique type: string only_on_same_position: type: boolean description: 'If `true`, only remove duplicate tokens in the same position. Defaults to `false`.' _types.analysis.UppercaseTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - uppercase type: string _types.analysis.WordDelimiterGraphTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.WordDelimiterTokenFilterBase' - required: - type type: object properties: type: enum: - word_delimiter_graph type: string adjust_offsets: type: boolean description: 'If `true`, the filter adjusts the offsets of split or catenated tokens to better reflect their actual position in the token stream. Defaults to `true`.' ignore_keywords: type: boolean description: 'If `true`, the filter skips tokens with a keyword attribute of true. Defaults to `false`.' _types.analysis.WordDelimiterTokenFilterBase: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - type: object properties: catenate_all: type: boolean description: 'If `true`, the filter produces catenated tokens for chains of alphanumeric characters separated by non-alphabetic delimiters. Defaults to `false`.' catenate_numbers: type: boolean description: 'If `true`, the filter produces catenated tokens for chains of numeric characters separated by non-alphabetic delimiters. Defaults to `false`.' catenate_words: type: boolean description: 'If `true`, the filter produces catenated tokens for chains of alphabetical characters separated by non-alphabetic delimiters. Defaults to `false`.' generate_number_parts: type: boolean description: 'If `true`, the filter includes tokens consisting of only numeric characters in the output. If `false`, the filter excludes these tokens from the output. Defaults to `true`.' generate_word_parts: type: boolean description: 'If `true`, the filter includes tokens consisting of only alphabetical characters in the output. If `false`, the filter excludes these tokens from the output. Defaults to `true`.' preserve_original: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedboolean' description: 'If `true`, the filter includes the original version of any split tokens in the output. This original version includes non-alphanumeric delimiters. Defaults to `false`.' protected_words: type: array items: type: string description: Array of tokens the filter won’t split. protected_words_path: type: string description: "Path to a file that contains a list of tokens the filter won’t split.\nThis path must be absolute or relative to the `config` location, and the file must be UTF-8 encoded. Each token in the file must be separated by a line break." split_on_case_change: type: boolean description: 'If `true`, the filter splits tokens at letter case transitions. For example: camelCase -> [ camel, Case ]. Defaults to `true`.' split_on_numerics: type: boolean description: 'If `true`, the filter splits tokens at letter-number transitions. For example: j2se -> [ j, 2, se ]. Defaults to `true`.' stem_english_possessive: type: boolean description: 'If `true`, the filter removes the English possessive (`''s`) from the end of each token. For example: O''Neil''s -> [ O, Neil ]. Defaults to `true`.' type_table: type: array items: type: string description: Array of custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters. type_table_path: type: string description: Path to a file that contains custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters. _types.analysis.WordDelimiterTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.WordDelimiterTokenFilterBase' - required: - type type: object properties: type: enum: - word_delimiter type: string _types.analysis.JaStopTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - ja_stop type: string stopwords: allOf: - $ref: '#/components/schemas/_types.analysis.StopWords' _types.analysis.KuromojiStemmerTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type - minimum_length type: object properties: type: enum: - kuromoji_stemmer type: string minimum_length: type: number _types.analysis.KuromojiReadingFormTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type - use_romaji type: object properties: type: enum: - kuromoji_readingform type: string use_romaji: type: boolean _types.analysis.KuromojiPartOfSpeechTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type - stoptags type: object properties: type: enum: - kuromoji_part_of_speech type: string stoptags: type: array items: type: string _types.analysis.IcuCollationTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type type: object properties: type: enum: - icu_collation type: string alternate: allOf: - $ref: '#/components/schemas/_types.analysis.IcuCollationAlternate' caseFirst: allOf: - $ref: '#/components/schemas/_types.analysis.IcuCollationCaseFirst' caseLevel: type: boolean country: type: string decomposition: allOf: - $ref: '#/components/schemas/_types.analysis.IcuCollationDecomposition' hiraganaQuaternaryMode: type: boolean language: type: string numeric: type: boolean rules: type: string strength: allOf: - $ref: '#/components/schemas/_types.analysis.IcuCollationStrength' variableTop: type: string variant: type: string _types.analysis.IcuCollationAlternate: enum: - shifted - non-ignorable type: string _types.analysis.IcuCollationCaseFirst: enum: - lower - upper type: string _types.analysis.IcuCollationDecomposition: enum: - no - identical type: string _types.analysis.IcuCollationStrength: enum: - primary - secondary - tertiary - quaternary - identical type: string _types.analysis.IcuFoldingTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type - unicode_set_filter type: object properties: type: enum: - icu_folding type: string unicode_set_filter: type: string _types.analysis.IcuNormalizationTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type - name type: object properties: type: enum: - icu_normalizer type: string name: allOf: - $ref: '#/components/schemas/_types.analysis.IcuNormalizationType' _types.analysis.IcuTransformTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type - id type: object properties: type: enum: - icu_transform type: string dir: allOf: - $ref: '#/components/schemas/_types.analysis.IcuTransformDirection' id: type: string _types.analysis.IcuTransformDirection: enum: - forward - reverse type: string _types.analysis.PhoneticTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.TokenFilterBase' - required: - type - encoder type: object properties: type: enum: - phonetic type: string encoder: allOf: - $ref: '#/components/schemas/_types.analysis.PhoneticEncoder' languageset: oneOf: - $ref: '#/components/schemas/_types.analysis.PhoneticLanguage' - type: array items: $ref: '#/components/schemas/_types.analysis.PhoneticLanguage' description: "\n\nSupported values include: `any`, `common`, `cyrillic`, `english`, `french`, `german`, `hebrew`, `hungarian`, `polish`, `romanian`, `russian`, `spanish`\n\n" max_code_len: type: number name_type: allOf: - $ref: '#/components/schemas/_types.analysis.PhoneticNameType' replace: type: boolean rule_type: allOf: - $ref: '#/components/schemas/_types.analysis.PhoneticRuleType' _types.analysis.PhoneticEncoder: enum: - metaphone - double_metaphone - soundex - refined_soundex - caverphone1 - caverphone2 - cologne - nysiis - koelnerphonetik - haasephonetik - beider_morse - daitch_mokotoff type: string _types.analysis.PhoneticLanguage: enum: - any - common - cyrillic - english - french - german - hebrew - hungarian - polish - romanian - russian - spanish type: string _types.analysis.PhoneticNameType: enum: - generic - ashkenazi - sephardic type: string _types.analysis.PhoneticRuleType: enum: - approx - exact type: string _types.analysis.DictionaryDecompounderTokenFilter: allOf: - $ref: '#/components/schemas/_types.analysis.CompoundWordTokenFilterBase' - required: - type type: object properties: type: enum: - dictionary_decompounder type: string _types.analysis.Normalizer: oneOf: - $ref: '#/components/schemas/_types.analysis.LowercaseNormalizer' - $ref: '#/components/schemas/_types.analysis.CustomNormalizer' discriminator: propertyName: type mapping: custom: '#/components/schemas/_types.analysis.CustomNormalizer' lowercase: '#/components/schemas/_types.analysis.LowercaseNormalizer' _types.analysis.LowercaseNormalizer: required: - type type: object properties: type: enum: - lowercase type: string _types.analysis.CustomNormalizer: required: - type type: object properties: type: enum: - custom type: string char_filter: type: array items: type: string filter: type: array items: type: string _types.analysis.Tokenizer: externalDocs: url: https://www.elastic.co/docs/reference/text-analysis/tokenizer-reference x-model: true _types.analysis.TokenizerDefinition: oneOf: - $ref: '#/components/schemas/_types.analysis.CharGroupTokenizer' - $ref: '#/components/schemas/_types.analysis.ClassicTokenizer' - $ref: '#/components/schemas/_types.analysis.EdgeNGramTokenizer' - $ref: '#/components/schemas/_types.analysis.KeywordTokenizer' - $ref: '#/components/schemas/_types.analysis.LetterTokenizer' - $ref: '#/components/schemas/_types.analysis.LowercaseTokenizer' - $ref: '#/components/schemas/_types.analysis.NGramTokenizer' - $ref: '#/components/schemas/_types.analysis.PathHierarchyTokenizer' - $ref: '#/components/schemas/_types.analysis.PatternTokenizer' - $ref: '#/components/schemas/_types.analysis.SimplePatternTokenizer' - $ref: '#/components/schemas/_types.analysis.SimplePatternSplitTokenizer' - $ref: '#/components/schemas/_types.analysis.StandardTokenizer' - $ref: '#/components/schemas/_types.analysis.ThaiTokenizer' - $ref: '#/components/schemas/_types.analysis.UaxEmailUrlTokenizer' - $ref: '#/components/schemas/_types.analysis.WhitespaceTokenizer' - $ref: '#/components/schemas/_types.analysis.IcuTokenizer' - $ref: '#/components/schemas/_types.analysis.KuromojiTokenizer' - $ref: '#/components/schemas/_types.analysis.NoriTokenizer' discriminator: propertyName: type mapping: char_group: '#/components/schemas/_types.analysis.CharGroupTokenizer' classic: '#/components/schemas/_types.analysis.ClassicTokenizer' edge_ngram: '#/components/schemas/_types.analysis.EdgeNGramTokenizer' icu_tokenizer: '#/components/schemas/_types.analysis.IcuTokenizer' keyword: '#/components/schemas/_types.analysis.KeywordTokenizer' kuromoji_tokenizer: '#/components/schemas/_types.analysis.KuromojiTokenizer' letter: '#/components/schemas/_types.analysis.LetterTokenizer' lowercase: '#/components/schemas/_types.analysis.LowercaseTokenizer' ngram: '#/components/schemas/_types.analysis.NGramTokenizer' nori_tokenizer: '#/components/schemas/_types.analysis.NoriTokenizer' path_hierarchy: '#/components/schemas/_types.analysis.PathHierarchyTokenizer' pattern: '#/components/schemas/_types.analysis.PatternTokenizer' simple_pattern: '#/components/schemas/_types.analysis.SimplePatternTokenizer' simple_pattern_split: '#/components/schemas/_types.analysis.SimplePatternSplitTokenizer' standard: '#/components/schemas/_types.analysis.StandardTokenizer' thai: '#/components/schemas/_types.analysis.ThaiTokenizer' uax_url_email: '#/components/schemas/_types.analysis.UaxEmailUrlTokenizer' whitespace: '#/components/schemas/_types.analysis.WhitespaceTokenizer' _types.analysis.CharGroupTokenizer: allOf: - $ref: '#/components/schemas/_types.analysis.TokenizerBase' - required: - type - tokenize_on_chars type: object properties: type: enum: - char_group type: string tokenize_on_chars: type: array items: type: string max_token_length: type: number _types.analysis.TokenizerBase: type: object properties: version: allOf: - $ref: '#/components/schemas/_types.VersionString' _types.analysis.ClassicTokenizer: allOf: - $ref: '#/components/schemas/_types.analysis.TokenizerBase' - required: - type type: object properties: type: enum: - classic type: string max_token_length: type: number _types.analysis.EdgeNGramTokenizer: allOf: - $ref: '#/components/schemas/_types.analysis.TokenizerBase' - required: - type type: object properties: type: enum: - edge_ngram type: string custom_token_chars: type: string max_gram: type: number min_gram: type: number token_chars: type: array items: $ref: '#/components/schemas/_types.analysis.TokenChar' default: [ ] _types.analysis.TokenChar: enum: - letter - digit - whitespace - punctuation - symbol - custom type: string _types.analysis.KeywordTokenizer: allOf: - $ref: '#/components/schemas/_types.analysis.TokenizerBase' - required: - type type: object properties: type: enum: - keyword type: string buffer_size: type: number default: 256 _types.analysis.LetterTokenizer: allOf: - $ref: '#/components/schemas/_types.analysis.TokenizerBase' - required: - type type: object properties: type: enum: - letter type: string _types.analysis.LowercaseTokenizer: allOf: - $ref: '#/components/schemas/_types.analysis.TokenizerBase' - required: - type type: object properties: type: enum: - lowercase type: string _types.analysis.NGramTokenizer: allOf: - $ref: '#/components/schemas/_types.analysis.TokenizerBase' - required: - type type: object properties: type: enum: - ngram type: string custom_token_chars: type: string max_gram: type: number min_gram: type: number token_chars: type: array items: $ref: '#/components/schemas/_types.analysis.TokenChar' default: [ ] _types.analysis.PathHierarchyTokenizer: allOf: - $ref: '#/components/schemas/_types.analysis.TokenizerBase' - required: - type type: object properties: type: enum: - path_hierarchy type: string buffer_size: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedinteger' delimiter: type: string replacement: type: string reverse: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedboolean' skip: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedinteger' _types.analysis.PatternTokenizer: allOf: - $ref: '#/components/schemas/_types.analysis.TokenizerBase' - required: - type type: object properties: type: enum: - pattern type: string flags: type: string group: type: number pattern: type: string _types.analysis.SimplePatternTokenizer: allOf: - $ref: '#/components/schemas/_types.analysis.TokenizerBase' - required: - type type: object properties: type: enum: - simple_pattern type: string pattern: type: string _types.analysis.SimplePatternSplitTokenizer: allOf: - $ref: '#/components/schemas/_types.analysis.TokenizerBase' - required: - type type: object properties: type: enum: - simple_pattern_split type: string pattern: type: string _types.analysis.StandardTokenizer: allOf: - $ref: '#/components/schemas/_types.analysis.TokenizerBase' - required: - type type: object properties: type: enum: - standard type: string max_token_length: type: number _types.analysis.ThaiTokenizer: allOf: - $ref: '#/components/schemas/_types.analysis.TokenizerBase' - required: - type type: object properties: type: enum: - thai type: string _types.analysis.UaxEmailUrlTokenizer: allOf: - $ref: '#/components/schemas/_types.analysis.TokenizerBase' - required: - type type: object properties: type: enum: - uax_url_email type: string max_token_length: type: number _types.analysis.WhitespaceTokenizer: allOf: - $ref: '#/components/schemas/_types.analysis.TokenizerBase' - required: - type type: object properties: type: enum: - whitespace type: string max_token_length: type: number _types.analysis.IcuTokenizer: allOf: - $ref: '#/components/schemas/_types.analysis.TokenizerBase' - required: - type - rule_files type: object properties: type: enum: - icu_tokenizer type: string rule_files: type: string _types.analysis.KuromojiTokenizer: allOf: - $ref: '#/components/schemas/_types.analysis.TokenizerBase' - required: - type - mode type: object properties: type: enum: - kuromoji_tokenizer type: string discard_punctuation: type: boolean mode: allOf: - $ref: '#/components/schemas/_types.analysis.KuromojiTokenizationMode' nbest_cost: type: number nbest_examples: type: string user_dictionary: type: string user_dictionary_rules: type: array items: type: string discard_compound_token: type: boolean _types.analysis.NoriTokenizer: allOf: - $ref: '#/components/schemas/_types.analysis.TokenizerBase' - required: - type type: object properties: type: enum: - nori_tokenizer type: string decompound_mode: allOf: - $ref: '#/components/schemas/_types.analysis.NoriDecompoundMode' discard_punctuation: type: boolean user_dictionary: type: string user_dictionary_rules: type: array items: type: string indices._types.IndexSettingsTimeSeries: type: object properties: end_time: allOf: - $ref: '#/components/schemas/_types.DateTime' start_time: allOf: - $ref: '#/components/schemas/_types.DateTime' temporality_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The name of the field that stores the temporality of a metric.\nThe referenced field must be a `keyword` dimension field; if the setting is unset or the\nfield is missing or invalid, the metric temporality resolves to null." x-state: Generally available; Added in 9.5.0 indices._types.Queries: type: object properties: cache: allOf: - $ref: '#/components/schemas/indices._types.CacheQueries' indices._types.CacheQueries: required: - enabled type: object properties: enabled: type: boolean indices._types.Requests: type: object properties: cache: allOf: - $ref: '#/components/schemas/indices._types.CacheRequests' indices._types.CacheRequests: type: object properties: enable: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedboolean' description: "Whether the shard request cache is enabled for the index.\nThis setting is dynamic and can be updated on an existing index." default: true indices._types.SettingsSimilarity: oneOf: - $ref: '#/components/schemas/indices._types.SettingsSimilarityBm25' - $ref: '#/components/schemas/indices._types.SettingsSimilarityBoolean' - $ref: '#/components/schemas/indices._types.SettingsSimilarityDfi' - $ref: '#/components/schemas/indices._types.SettingsSimilarityDfr' - $ref: '#/components/schemas/indices._types.SettingsSimilarityIb' - $ref: '#/components/schemas/indices._types.SettingsSimilarityLmd' - $ref: '#/components/schemas/indices._types.SettingsSimilarityLmj' - $ref: '#/components/schemas/indices._types.SettingsSimilarityScripted' discriminator: propertyName: type mapping: BM25: '#/components/schemas/indices._types.SettingsSimilarityBm25' DFI: '#/components/schemas/indices._types.SettingsSimilarityDfi' DFR: '#/components/schemas/indices._types.SettingsSimilarityDfr' IB: '#/components/schemas/indices._types.SettingsSimilarityIb' LMDirichlet: '#/components/schemas/indices._types.SettingsSimilarityLmd' LMJelinekMercer: '#/components/schemas/indices._types.SettingsSimilarityLmj' boolean: '#/components/schemas/indices._types.SettingsSimilarityBoolean' scripted: '#/components/schemas/indices._types.SettingsSimilarityScripted' indices._types.SettingsSimilarityBm25: required: - type type: object properties: type: enum: - BM25 type: string b: type: number discount_overlaps: type: boolean k1: type: number indices._types.SettingsSimilarityBoolean: required: - type type: object properties: type: enum: - boolean type: string indices._types.SettingsSimilarityDfi: required: - type - independence_measure type: object properties: type: enum: - DFI type: string independence_measure: allOf: - $ref: '#/components/schemas/_types.DFIIndependenceMeasure' _types.DFIIndependenceMeasure: enum: - standardized - saturated - chisquared type: string indices._types.SettingsSimilarityDfr: required: - type - after_effect - basic_model - normalization type: object properties: type: enum: - DFR type: string after_effect: allOf: - $ref: '#/components/schemas/_types.DFRAfterEffect' basic_model: allOf: - $ref: '#/components/schemas/_types.DFRBasicModel' normalization: allOf: - $ref: '#/components/schemas/_types.Normalization' _types.DFRAfterEffect: enum: - no - b - l type: string _types.DFRBasicModel: enum: - be - d - g - if - in - ine - p type: string _types.Normalization: enum: - no - h1 - h2 - h3 - z type: string indices._types.SettingsSimilarityIb: required: - type - distribution - lambda - normalization type: object properties: type: enum: - IB type: string distribution: allOf: - $ref: '#/components/schemas/_types.IBDistribution' lambda: allOf: - $ref: '#/components/schemas/_types.IBLambda' normalization: allOf: - $ref: '#/components/schemas/_types.Normalization' _types.IBDistribution: enum: - ll - spl type: string _types.IBLambda: enum: - df - ttf type: string indices._types.SettingsSimilarityLmd: required: - type type: object properties: type: enum: - LMDirichlet type: string mu: type: number indices._types.SettingsSimilarityLmj: required: - type type: object properties: type: enum: - LMJelinekMercer type: string lambda: type: number indices._types.SettingsSimilarityScripted: required: - type - script type: object properties: type: enum: - scripted type: string script: allOf: - $ref: '#/components/schemas/_types.Script' weight_script: allOf: - $ref: '#/components/schemas/_types.Script' indices._types.MappingLimitSettings: type: object properties: coerce: type: boolean total_fields: allOf: - $ref: '#/components/schemas/indices._types.MappingLimitSettingsTotalFields' depth: allOf: - $ref: '#/components/schemas/indices._types.MappingLimitSettingsDepth' nested_fields: allOf: - $ref: '#/components/schemas/indices._types.MappingLimitSettingsNestedFields' nested_objects: allOf: - $ref: '#/components/schemas/indices._types.MappingLimitSettingsNestedObjects' field_name_length: allOf: - $ref: '#/components/schemas/indices._types.MappingLimitSettingsFieldNameLength' dimension_fields: allOf: - $ref: '#/components/schemas/indices._types.MappingLimitSettingsDimensionFields' source: allOf: - $ref: '#/components/schemas/indices._types.MappingLimitSettingsSourceFields' ignore_malformed: type: - boolean - string description: Mapping Limit Settings indices._types.MappingLimitSettingsTotalFields: type: object properties: limit: type: - number - string description: "The maximum number of fields in an index. Field and object mappings, as well as field aliases count towards this limit.\nThe limit is in place to prevent mappings and searches from becoming too large. Higher values can lead to performance\ndegradations and memory issues, especially in clusters with a high load or few resources." default: 1000 ignore_dynamic_beyond_limit: type: - boolean - string description: "This setting determines what happens when a dynamically mapped field would exceed the total fields limit. When set\nto false (the default), the index request of the document that tries to add a dynamic field to the mapping will fail\nwith the message Limit of total fields [X] has been exceeded. When set to true, the index request will not fail.\nInstead, fields that would exceed the limit are not added to the mapping, similar to dynamic: false.\nThe fields that were not added to the mapping will be added to the _ignored field." default: false indices._types.MappingLimitSettingsDepth: type: object properties: limit: type: number description: "The maximum depth for a field, which is measured as the number of inner objects. For instance, if all fields are defined\nat the root object level, then the depth is 1. If there is one object mapping, then the depth is 2, etc." default: 20 indices._types.MappingLimitSettingsNestedFields: type: object properties: limit: type: number description: "The maximum number of distinct nested mappings in an index. The nested type should only be used in special cases, when\narrays of objects need to be queried independently of each other. To safeguard against poorly designed mappings, this\nsetting limits the number of unique nested types per index." default: 50 indices._types.MappingLimitSettingsNestedObjects: type: object properties: limit: type: number description: "The maximum number of nested JSON objects that a single document can contain across all nested types. This limit helps\nto prevent out of memory errors when a document contains too many nested objects." default: 10000 indices._types.MappingLimitSettingsFieldNameLength: type: object properties: limit: type: number description: "Setting for the maximum length of a field name. This setting isn’t really something that addresses mappings explosion but\nmight still be useful if you want to limit the field length. It usually shouldn’t be necessary to set this setting. The\ndefault is okay unless a user starts to add a huge number of fields with really long names. Default is `Long.MAX_VALUE` (no limit)." indices._types.MappingLimitSettingsDimensionFields: type: object properties: limit: type: number description: "[preview] This functionality is in technical preview and may be changed or removed in a future release.\nElastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features." indices._types.MappingLimitSettingsSourceFields: required: - mode type: object properties: mode: allOf: - $ref: '#/components/schemas/indices._types.SourceMode' indices._types.SourceMode: enum: - disabled - stored - synthetic type: string indices._types.IndexingSlowlogSettings: type: object properties: level: type: string source: type: number reformat: type: boolean threshold: allOf: - $ref: '#/components/schemas/indices._types.IndexingSlowlogTresholds' indices._types.IndexingSlowlogTresholds: type: object properties: index: allOf: - $ref: '#/components/schemas/indices._types.SlowlogTresholdLevels' description: "The indexing slow log, similar in functionality to the search slow log. The log file name ends with `_index_indexing_slowlog.json`.\nLog and the thresholds are configured in the same way as the search slowlog." indices._types.IndexingPressure: required: - memory type: object properties: memory: allOf: - $ref: '#/components/schemas/indices._types.IndexingPressureMemory' indices._types.IndexingPressureMemory: type: object properties: limit: type: number description: "Number of outstanding bytes that may be consumed by indexing requests. When this limit is reached or exceeded,\nthe node will reject new coordinating and primary operations. When replica operations consume 1.5x this limit,\nthe node will reject new replica operations. Defaults to 10% of the heap." indices._types.Storage: type: object properties: type: allOf: - $ref: '#/components/schemas/indices._types.StorageType' description: "\n\nSupported values include:\n - `fs`: Default file system implementation. This will pick the best implementation depending on the operating environment, which\nis currently hybridfs on all supported systems but is subject to change.\n - `niofs`: The NIO FS type stores the shard index on the file system (maps to Lucene NIOFSDirectory) using NIO. It allows multiple\nthreads to read from the same file concurrently. It is not recommended on Windows because of a bug in the SUN Java\nimplementation and disables some optimizations for heap memory usage.\n - `mmapfs`: The MMap FS type stores the shard index on the file system (maps to Lucene MMapDirectory) by mapping a file into\nmemory (mmap). Memory mapping uses up a portion of the virtual memory address space in your process equal to the size\nof the file being mapped. Before using this class, be sure you have allowed plenty of virtual address space.\n - `hybridfs`: The hybridfs type is a hybrid of niofs and mmapfs, which chooses the best file system type for each type of file\nbased on the read access pattern. Currently only the Lucene term dictionary, norms and doc values files are memory\nmapped. All other files are opened using Lucene NIOFSDirectory. Similarly to mmapfs be sure you have allowed\nplenty of virtual address space.\n\n" allow_mmap: type: boolean description: "You can restrict the use of the mmapfs and the related hybridfs store type via the setting node.store.allow_mmap.\nThis is a boolean setting indicating whether or not memory-mapping is allowed. The default is to allow it. This\nsetting is useful, for example, if you are in an environment where you can not control the ability to create a lot\nof memory maps so you need disable the ability to use memory-mapping." stats_refresh_interval: allOf: - $ref: '#/components/schemas/_types.Duration' description: How often store statistics are refreshed indices._types.StorageType: anyOf: - enum: - fs - niofs - mmapfs - hybridfs type: string - type: string ccr.follow_info.FollowerIndex: required: - follower_index - leader_index - remote_cluster - status type: object properties: follower_index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: The name of the follower index. leader_index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: The name of the index in the leader cluster that is followed. parameters: allOf: - $ref: '#/components/schemas/ccr.follow_info.FollowerIndexParameters' description: 'An object that encapsulates cross-cluster replication parameters. If the follower index''s status is paused, this object is omitted.' remote_cluster: allOf: - $ref: '#/components/schemas/_types.Name' description: The remote cluster that contains the leader index. status: allOf: - $ref: '#/components/schemas/ccr.follow_info.FollowerIndexStatus' description: 'The status of the index following: `active` or `paused`.' ccr.follow_info.FollowerIndexParameters: type: object properties: max_outstanding_read_requests: type: number description: The maximum number of outstanding reads requests from the remote cluster. max_outstanding_write_requests: type: number description: The maximum number of outstanding write requests on the follower. max_read_request_operation_count: type: number description: The maximum number of operations to pull per read from the remote cluster. max_read_request_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The maximum size in bytes of per read of a batch of operations pulled from the remote cluster. max_retry_delay: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The maximum time to wait before retrying an operation that failed exceptionally. An exponential backoff strategy is employed when\nretrying." max_write_buffer_count: type: number description: "The maximum number of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will be\ndeferred until the number of queued operations goes below the limit." max_write_buffer_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "The maximum total bytes of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will\nbe deferred until the total bytes of queued operations goes below the limit." max_write_request_operation_count: type: number description: The maximum number of operations per bulk write request executed on the follower. max_write_request_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The maximum total bytes of operations per bulk write request executed on the follower. read_poll_timeout: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The maximum time to wait for new operations on the remote cluster when the follower index is synchronized with the leader index.\nWhen the timeout has elapsed, the poll for operations will return to the follower so that it can update some statistics.\nThen the follower will immediately attempt to read from the leader again." ccr.follow_info.FollowerIndexStatus: enum: - active - paused type: string ccr._types.FollowIndexStats: required: - index - shards type: object properties: index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: The name of the follower index. shards: type: array items: $ref: '#/components/schemas/ccr._types.ShardStats' description: An array of shard-level following task statistics. ccr._types.ShardStats: required: - bytes_read - failed_read_requests - failed_write_requests - follower_aliases_version - follower_global_checkpoint - follower_index - follower_mapping_version - follower_max_seq_no - follower_settings_version - last_requested_seq_no - leader_global_checkpoint - leader_index - leader_max_seq_no - operations_read - operations_written - outstanding_read_requests - outstanding_write_requests - read_exceptions - remote_cluster - shard_id - successful_read_requests - successful_write_requests - time_since_last_read_millis - total_read_remote_exec_time_millis - total_read_time_millis - total_write_time_millis - write_buffer_operation_count - write_buffer_size_in_bytes type: object properties: bytes_read: type: number description: "The total of transferred bytes read from the leader.\nThis is only an estimate and does not account for compression if enabled." failed_read_requests: type: number description: The number of failed reads. failed_write_requests: type: number description: The number of failed bulk write requests on the follower. fatal_exception: allOf: - $ref: '#/components/schemas/_types.ErrorCause' follower_aliases_version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' description: The index aliases version the follower is synced up to. follower_global_checkpoint: type: number description: "The current global checkpoint on the follower.\nThe difference between the `leader_global_checkpoint` and the `follower_global_checkpoint` is an indication of how much the follower is lagging the leader." follower_index: type: string description: The name of the follower index. follower_mapping_version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' description: The mapping version the follower is synced up to. follower_max_seq_no: allOf: - $ref: '#/components/schemas/_types.SequenceNumber' description: The current maximum sequence number on the follower. follower_settings_version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' description: The index settings version the follower is synced up to. last_requested_seq_no: allOf: - $ref: '#/components/schemas/_types.SequenceNumber' description: The starting sequence number of the last batch of operations requested from the leader. leader_global_checkpoint: type: number description: The current global checkpoint on the leader known to the follower task. leader_index: type: string description: The name of the index in the leader cluster being followed. leader_max_seq_no: allOf: - $ref: '#/components/schemas/_types.SequenceNumber' description: The current maximum sequence number on the leader known to the follower task. operations_read: type: number description: The total number of operations read from the leader. operations_written: type: number description: The number of operations written on the follower. outstanding_read_requests: type: number description: The number of active read requests from the follower. outstanding_write_requests: type: number description: The number of active bulk write requests on the follower. read_exceptions: type: array items: $ref: '#/components/schemas/ccr._types.ReadException' description: An array of objects representing failed reads. remote_cluster: type: string description: The remote cluster containing the leader index. shard_id: type: number description: 'The numerical shard ID, with values from 0 to one less than the number of replicas.' successful_read_requests: type: number description: The number of successful fetches. successful_write_requests: type: number description: The number of bulk write requests run on the follower. time_since_last_read: allOf: - $ref: '#/components/schemas/_types.Duration' time_since_last_read_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: "The number of milliseconds since a read request was sent to the leader.\nWhen the follower is caught up to the leader, this number will increase up to the configured `read_poll_timeout` at which point another read request will be sent to the leader." total_read_remote_exec_time: allOf: - $ref: '#/components/schemas/_types.Duration' total_read_remote_exec_time_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: The total time reads spent running on the remote cluster. total_read_time: allOf: - $ref: '#/components/schemas/_types.Duration' total_read_time_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: 'The total time reads were outstanding, measured from the time a read was sent to the leader to the time a reply was returned to the follower.' total_write_time: allOf: - $ref: '#/components/schemas/_types.Duration' total_write_time_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: The total time spent writing on the follower. write_buffer_operation_count: type: number description: The number of write operations queued on the follower. write_buffer_size_in_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The total number of bytes of operations currently queued for writing. ccr._types.ReadException: required: - exception - from_seq_no - retries type: object properties: exception: allOf: - $ref: '#/components/schemas/_types.ErrorCause' description: The exception that caused the read to fail. from_seq_no: allOf: - $ref: '#/components/schemas/_types.SequenceNumber' description: The starting sequence number of the batch requested from the leader. retries: type: number description: The number of times the batch has been retried. ccr.get_auto_follow_pattern.AutoFollowPattern: required: - name - pattern type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' pattern: allOf: - $ref: '#/components/schemas/ccr.get_auto_follow_pattern.AutoFollowPatternSummary' ccr.get_auto_follow_pattern.AutoFollowPatternSummary: required: - active - remote_cluster - leader_index_patterns - leader_index_exclusion_patterns - max_outstanding_read_requests type: object properties: active: type: boolean remote_cluster: type: string description: The remote cluster containing the leader indices to match against. follow_index_pattern: allOf: - $ref: '#/components/schemas/_types.IndexPattern' description: The name of follower index. leader_index_patterns: allOf: - $ref: '#/components/schemas/_types.IndexPatterns' description: An array of simple index patterns to match against indices in the remote cluster specified by the remote_cluster field. leader_index_exclusion_patterns: allOf: - $ref: '#/components/schemas/_types.IndexPatterns' description: An array of simple index patterns that can be used to exclude indices from being auto-followed. x-state: Generally available; Added in 7.14.0 max_outstanding_read_requests: type: number description: The maximum number of outstanding reads requests from the remote cluster. _types.IndexPattern: type: string _types.IndexPatterns: type: array items: $ref: '#/components/schemas/_types.IndexPattern' ccr.stats.AutoFollowStats: required: - auto_followed_clusters - number_of_failed_follow_indices - number_of_failed_remote_cluster_state_requests - number_of_successful_follow_indices - recent_auto_follow_errors type: object properties: auto_followed_clusters: type: array items: $ref: '#/components/schemas/ccr.stats.AutoFollowedCluster' number_of_failed_follow_indices: type: number description: "The number of indices that the auto-follow coordinator failed to automatically follow.\nThe causes of recent failures are captured in the logs of the elected master node and in the `auto_follow_stats.recent_auto_follow_errors` field." number_of_failed_remote_cluster_state_requests: type: number description: The number of times that the auto-follow coordinator failed to retrieve the cluster state from a remote cluster registered in a collection of auto-follow patterns. number_of_successful_follow_indices: type: number description: The number of indices that the auto-follow coordinator successfully followed. recent_auto_follow_errors: type: array items: $ref: '#/components/schemas/_types.ErrorCause' description: An array of objects representing failures by the auto-follow coordinator. ccr.stats.AutoFollowedCluster: required: - cluster_name - last_seen_metadata_version - time_since_last_check_millis type: object properties: cluster_name: allOf: - $ref: '#/components/schemas/_types.Name' last_seen_metadata_version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' time_since_last_check_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' ccr.stats.FollowStats: required: - indices type: object properties: indices: type: array items: $ref: '#/components/schemas/ccr._types.FollowIndexStats' _types.ScrollIds: oneOf: - $ref: '#/components/schemas/_types.ScrollId' - type: array items: $ref: '#/components/schemas/_types.ScrollId' cluster.allocation_explain.Decision: enum: - yes - no - worse_balance - throttled - awaiting_info - allocation_delayed - no_valid_shard_copy - no_attempt type: string cluster.allocation_explain.AllocationDecision: required: - decider - decision - explanation type: object properties: decider: type: string decision: allOf: - $ref: '#/components/schemas/cluster.allocation_explain.AllocationExplainDecision' explanation: type: string cluster.allocation_explain.AllocationExplainDecision: enum: - NO - YES - THROTTLE - ALWAYS type: string cluster.allocation_explain.ClusterInfo: required: - nodes - shard_sizes - shard_paths - reserved_sizes type: object properties: nodes: type: object additionalProperties: $ref: '#/components/schemas/cluster.allocation_explain.NodeDiskUsage' shard_sizes: type: object additionalProperties: type: number shard_data_set_sizes: type: object additionalProperties: type: string shard_paths: type: object additionalProperties: type: string reserved_sizes: type: array items: $ref: '#/components/schemas/cluster.allocation_explain.ReservedSize' cluster.allocation_explain.NodeDiskUsage: required: - node_name - least_available - most_available type: object properties: node_name: allOf: - $ref: '#/components/schemas/_types.Name' least_available: allOf: - $ref: '#/components/schemas/cluster.allocation_explain.DiskUsage' most_available: allOf: - $ref: '#/components/schemas/cluster.allocation_explain.DiskUsage' cluster.allocation_explain.DiskUsage: required: - path - total_bytes - used_bytes - free_bytes - free_disk_percent - used_disk_percent type: object properties: path: type: string total_bytes: type: number used_bytes: type: number free_bytes: type: number free_disk_percent: type: number used_disk_percent: type: number cluster.allocation_explain.ReservedSize: required: - node_id - path - total - shards type: object properties: node_id: allOf: - $ref: '#/components/schemas/_types.Id' path: type: string total: type: number shards: type: array items: type: string cluster.allocation_explain.CurrentNode: required: - id - name - roles - attributes - transport_address - weight_ranking type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' name: allOf: - $ref: '#/components/schemas/_types.Name' roles: allOf: - $ref: '#/components/schemas/_types.NodeRoles' x-state: Generally available; Added in 8.11.0 attributes: type: object additionalProperties: type: string transport_address: allOf: - $ref: '#/components/schemas/_types.TransportAddress' weight_ranking: type: number _types.NodeRoles: type: array items: $ref: '#/components/schemas/_types.NodeRole' _types.NodeRole: enum: - master - data - data_cold - data_content - data_frozen - data_hot - data_warm - client - ingest - ml - voting_only - transform - remote_cluster_client - coordinating_only type: string _types.TransportAddress: type: string cluster.allocation_explain.NodeAllocationExplanation: required: - node_attributes - node_decision - node_id - node_name - roles - transport_address type: object properties: deciders: type: array items: $ref: '#/components/schemas/cluster.allocation_explain.AllocationDecision' node_attributes: type: object additionalProperties: type: string node_decision: allOf: - $ref: '#/components/schemas/cluster.allocation_explain.Decision' node_id: allOf: - $ref: '#/components/schemas/_types.Id' node_name: allOf: - $ref: '#/components/schemas/_types.Name' roles: allOf: - $ref: '#/components/schemas/_types.NodeRoles' x-state: Generally available; Added in 8.11.0 store: allOf: - $ref: '#/components/schemas/cluster.allocation_explain.AllocationStore' transport_address: allOf: - $ref: '#/components/schemas/_types.TransportAddress' weight_ranking: type: number cluster.allocation_explain.AllocationStore: required: - allocation_id - found - in_sync - matching_size_in_bytes - matching_sync_id - store_exception type: object properties: allocation_id: type: string found: type: boolean in_sync: type: boolean matching_size_in_bytes: type: number matching_sync_id: type: boolean store_exception: type: string cluster.allocation_explain.UnassignedInformation: required: - at - reason type: object properties: at: allOf: - $ref: '#/components/schemas/_types.DateTime' last_allocation_status: type: string reason: allOf: - $ref: '#/components/schemas/cluster.allocation_explain.UnassignedInformationReason' details: type: string failed_allocation_attempts: type: number delayed: type: boolean allocation_status: type: string cluster.allocation_explain.UnassignedInformationReason: enum: - INDEX_CREATED - CLUSTER_RECOVERED - INDEX_REOPENED - DANGLING_INDEX_IMPORTED - NEW_INDEX_RESTORED - EXISTING_INDEX_RESTORED - REPLICA_ADDED - ALLOCATION_FAILED - NODE_LEFT - REROUTE_CANCELLED - REINITIALIZED - REALLOCATED_REPLICA - PRIMARY_FAILED - FORCED_EMPTY_PRIMARY - MANUAL_ALLOCATION type: string cluster._types.ComponentTemplate: required: - name - component_template type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' component_template: allOf: - $ref: '#/components/schemas/cluster._types.ComponentTemplateNodeWithRollover' cluster._types.ComponentTemplateNodeWithRollover: required: - template type: object properties: template: allOf: - $ref: '#/components/schemas/cluster._types.ComponentTemplateSummaryRes' version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' _meta: allOf: - $ref: '#/components/schemas/_types.Metadata' deprecated: type: boolean created_date: allOf: - $ref: '#/components/schemas/_types.DateTime' description: Date and time when the component template was created. Only returned if the `human` query parameter is `true`. x-state: Generally available; Added in 9.2.0 created_date_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: 'Date and time when the component template was created, in milliseconds since the epoch.' x-state: Generally available; Added in 9.2.0 modified_date: allOf: - $ref: '#/components/schemas/_types.DateTime' description: Date and time when the component template was last modified. Only returned if the `human` query parameter is `true`. x-state: Generally available; Added in 9.2.0 modified_date_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: 'Date and time when the component template was last modified, in milliseconds since the epoch.' x-state: Generally available; Added in 9.2.0 cluster._types.ComponentTemplateSummaryRes: type: object properties: lifecycle: allOf: - $ref: '#/components/schemas/indices._types.DataStreamLifecycleWithRollover' x-state: Generally available; Added in 8.11.0 _meta: allOf: - $ref: '#/components/schemas/_types.Metadata' version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' settings: type: object additionalProperties: $ref: '#/components/schemas/indices._types.IndexSettings' mappings: allOf: - $ref: '#/components/schemas/_types.mapping.TypeMapping' aliases: type: object additionalProperties: $ref: '#/components/schemas/indices._types.AliasDefinition' data_stream_options: allOf: - $ref: '#/components/schemas/indices._types.DataStreamOptions' x-state: Generally available; Added in 8.19.0 indices._types.DataStreamLifecycleWithRollover: allOf: - $ref: '#/components/schemas/indices._types.DataStreamLifecycle' - type: object properties: rollover: allOf: - $ref: '#/components/schemas/indices._types.DataStreamLifecycleRolloverConditions' description: "The conditions which will trigger the rollover of a backing index as configured by the cluster setting `cluster.lifecycle.default.rollover`.\nThis property is an implementation detail and it will only be retrieved when the query param `include_defaults` is set to true.\nThe contents of this field are subject to change." description: "Data stream lifecycle with rollover can be used to display the configuration including the default rollover conditions,\nif asked." indices._types.DataStreamLifecycleRolloverConditions: type: object properties: min_age: allOf: - $ref: '#/components/schemas/_types.Duration' max_age: type: string min_docs: type: number max_docs: type: number min_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' max_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' min_primary_shard_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' max_primary_shard_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' min_primary_shard_docs: type: number max_primary_shard_docs: type: number indices._types.DataStreamLifecycle: type: object properties: data_retention: allOf: - $ref: '#/components/schemas/_types.Duration' description: "If defined, every document added to this data stream will be stored at least for this time frame.\nAny time after this duration the document could be deleted.\nWhen empty, every document in this data stream will be stored indefinitely." effective_retention: allOf: - $ref: '#/components/schemas/_types.Duration' description: The least amount of time data should be kept by elasticsearch. retention_determined_by: allOf: - $ref: '#/components/schemas/indices._types.RetentionSource' description: Configuration source that can influence the retention of a data stream. downsampling: type: array items: $ref: '#/components/schemas/indices._types.DownsamplingRound' description: The list of downsampling rounds to execute as part of this downsampling configuration downsampling_method: allOf: - $ref: '#/components/schemas/indices._types.SamplingMethod' description: "The method used to downsample the data. There are two options `aggregate` and `last_value`. It requires\n`downsampling` to be defined. Defaults to `aggregate`." enabled: type: boolean description: "If defined, it turns data stream lifecycle on/off (`true`/`false`) for this data stream. A data stream lifecycle\nthat's disabled (enabled: `false`) will have no effect on the data stream." default: true frozen_after: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The period after which data stream backing indices are automatically converted to partially mounted searchable snapshots.\nThis field is valid only on main data stream lifecycles and cannot be set on failure-store lifecycles." x-state: Generally available; Added in 9.5.0 description: Data stream lifecycle denotes that a data stream is managed by the data stream lifecycle and contains the configuration. indices._types.RetentionSource: enum: - data_stream_configuration - default_global_retention - max_global_retention - default_failures_retention type: string indices._types.DownsamplingRound: required: - after - fixed_interval type: object properties: after: allOf: - $ref: '#/components/schemas/_types.Duration' description: The duration since rollover when this downsampling round should execute fixed_interval: allOf: - $ref: '#/components/schemas/_types.DurationLarge' description: The downsample interval. indices._types.SamplingMethod: enum: - aggregate - last_value type: string _types.mapping.TypeMapping: type: object properties: all_field: allOf: - $ref: '#/components/schemas/_types.mapping.AllField' date_detection: type: boolean dynamic: allOf: - $ref: '#/components/schemas/_types.mapping.DynamicMapping' dynamic_date_formats: type: array items: type: string dynamic_templates: type: array items: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.mapping.DynamicTemplate' _field_names: allOf: - $ref: '#/components/schemas/_types.mapping.FieldNamesField' index_field: allOf: - $ref: '#/components/schemas/_types.mapping.IndexField' _meta: allOf: - $ref: '#/components/schemas/_types.Metadata' numeric_detection: type: boolean properties: type: object additionalProperties: $ref: '#/components/schemas/_types.mapping.Property' _routing: allOf: - $ref: '#/components/schemas/_types.mapping.RoutingField' _size: allOf: - $ref: '#/components/schemas/_types.mapping.SizeField' _source: allOf: - $ref: '#/components/schemas/_types.mapping.SourceField' runtime: type: object additionalProperties: $ref: '#/components/schemas/_types.mapping.RuntimeField' enabled: type: boolean subobjects: allOf: - $ref: '#/components/schemas/_types.mapping.Subobjects' _data_stream_timestamp: allOf: - $ref: '#/components/schemas/_types.mapping.DataStreamTimestamp' x-state: Generally available; Added in 7.16.0 _types.mapping.AllField: required: - analyzer - enabled - omit_norms - search_analyzer - similarity - store - store_term_vector_offsets - store_term_vector_payloads - store_term_vector_positions - store_term_vectors type: object properties: analyzer: type: string enabled: type: boolean omit_norms: type: boolean search_analyzer: type: string similarity: type: string store: type: boolean store_term_vector_offsets: type: boolean store_term_vector_payloads: type: boolean store_term_vector_positions: type: boolean store_term_vectors: type: boolean _types.mapping.DynamicMapping: enum: - strict - runtime - 'true' - 'false' type: string _types.mapping.DynamicTemplate: allOf: - type: object properties: match: oneOf: - type: string - type: array items: type: string path_match: oneOf: - type: string - type: array items: type: string unmatch: oneOf: - type: string - type: array items: type: string path_unmatch: oneOf: - type: string - type: array items: type: string match_mapping_type: oneOf: - type: string - type: array items: type: string unmatch_mapping_type: oneOf: - type: string - type: array items: type: string match_pattern: allOf: - $ref: '#/components/schemas/_types.mapping.MatchType' - maxProperties: 1 minProperties: 1 type: object properties: mapping: allOf: - $ref: '#/components/schemas/_types.mapping.Property' runtime: allOf: - $ref: '#/components/schemas/_types.mapping.RuntimeField' _types.mapping.Property: oneOf: - $ref: '#/components/schemas/_types.mapping.BinaryProperty' - $ref: '#/components/schemas/_types.mapping.BooleanProperty' - $ref: '#/components/schemas/_types.mapping.DynamicProperty' - $ref: '#/components/schemas/_types.mapping.JoinProperty' - $ref: '#/components/schemas/_types.mapping.KeywordProperty' - $ref: '#/components/schemas/_types.mapping.MatchOnlyTextProperty' - $ref: '#/components/schemas/_types.mapping.PercolatorProperty' - $ref: '#/components/schemas/_types.mapping.RankFeatureProperty' - $ref: '#/components/schemas/_types.mapping.RankFeaturesProperty' - $ref: '#/components/schemas/_types.mapping.SearchAsYouTypeProperty' - $ref: '#/components/schemas/_types.mapping.TextProperty' - $ref: '#/components/schemas/_types.mapping.VersionProperty' - $ref: '#/components/schemas/_types.mapping.WildcardProperty' - $ref: '#/components/schemas/_types.mapping.DateNanosProperty' - $ref: '#/components/schemas/_types.mapping.DateProperty' - $ref: '#/components/schemas/_types.mapping.AggregateMetricDoubleProperty' - $ref: '#/components/schemas/_types.mapping.DenseVectorProperty' - $ref: '#/components/schemas/_types.mapping.FlattenedProperty' - $ref: '#/components/schemas/_types.mapping.NestedProperty' - $ref: '#/components/schemas/_types.mapping.ObjectProperty' - $ref: '#/components/schemas/_types.mapping.PassthroughObjectProperty' - $ref: '#/components/schemas/_types.mapping.RankVectorProperty' - $ref: '#/components/schemas/_types.mapping.SemanticTextProperty' - $ref: '#/components/schemas/_types.mapping.SparseVectorProperty' - $ref: '#/components/schemas/_types.mapping.CompletionProperty' - $ref: '#/components/schemas/_types.mapping.ConstantKeywordProperty' - $ref: '#/components/schemas/_types.mapping.CountedKeywordProperty' - $ref: '#/components/schemas/_types.mapping.FieldAliasProperty' - $ref: '#/components/schemas/_types.mapping.HistogramProperty' - $ref: '#/components/schemas/_types.mapping.ExponentialHistogramProperty' - $ref: '#/components/schemas/_types.mapping.IpProperty' - $ref: '#/components/schemas/_types.mapping.Murmur3HashProperty' - $ref: '#/components/schemas/_types.mapping.TokenCountProperty' - $ref: '#/components/schemas/_types.mapping.GeoPointProperty' - $ref: '#/components/schemas/_types.mapping.GeoShapeProperty' - $ref: '#/components/schemas/_types.mapping.PointProperty' - $ref: '#/components/schemas/_types.mapping.ShapeProperty' - $ref: '#/components/schemas/_types.mapping.ByteNumberProperty' - $ref: '#/components/schemas/_types.mapping.DoubleNumberProperty' - $ref: '#/components/schemas/_types.mapping.FloatNumberProperty' - $ref: '#/components/schemas/_types.mapping.HalfFloatNumberProperty' - $ref: '#/components/schemas/_types.mapping.IntegerNumberProperty' - $ref: '#/components/schemas/_types.mapping.LongNumberProperty' - $ref: '#/components/schemas/_types.mapping.ScaledFloatNumberProperty' - $ref: '#/components/schemas/_types.mapping.ShortNumberProperty' - $ref: '#/components/schemas/_types.mapping.UnsignedLongNumberProperty' - $ref: '#/components/schemas/_types.mapping.DateRangeProperty' - $ref: '#/components/schemas/_types.mapping.DoubleRangeProperty' - $ref: '#/components/schemas/_types.mapping.FloatRangeProperty' - $ref: '#/components/schemas/_types.mapping.IntegerRangeProperty' - $ref: '#/components/schemas/_types.mapping.IpRangeProperty' - $ref: '#/components/schemas/_types.mapping.LongRangeProperty' - $ref: '#/components/schemas/_types.mapping.IcuCollationProperty' discriminator: propertyName: type mapping: aggregate_metric_double: '#/components/schemas/_types.mapping.AggregateMetricDoubleProperty' alias: '#/components/schemas/_types.mapping.FieldAliasProperty' binary: '#/components/schemas/_types.mapping.BinaryProperty' boolean: '#/components/schemas/_types.mapping.BooleanProperty' byte: '#/components/schemas/_types.mapping.ByteNumberProperty' completion: '#/components/schemas/_types.mapping.CompletionProperty' constant_keyword: '#/components/schemas/_types.mapping.ConstantKeywordProperty' counted_keyword: '#/components/schemas/_types.mapping.CountedKeywordProperty' date: '#/components/schemas/_types.mapping.DateProperty' date_nanos: '#/components/schemas/_types.mapping.DateNanosProperty' date_range: '#/components/schemas/_types.mapping.DateRangeProperty' dense_vector: '#/components/schemas/_types.mapping.DenseVectorProperty' double: '#/components/schemas/_types.mapping.DoubleNumberProperty' double_range: '#/components/schemas/_types.mapping.DoubleRangeProperty' exponential_histogram: '#/components/schemas/_types.mapping.ExponentialHistogramProperty' flattened: '#/components/schemas/_types.mapping.FlattenedProperty' float: '#/components/schemas/_types.mapping.FloatNumberProperty' float_range: '#/components/schemas/_types.mapping.FloatRangeProperty' geo_point: '#/components/schemas/_types.mapping.GeoPointProperty' geo_shape: '#/components/schemas/_types.mapping.GeoShapeProperty' half_float: '#/components/schemas/_types.mapping.HalfFloatNumberProperty' histogram: '#/components/schemas/_types.mapping.HistogramProperty' icu_collation_keyword: '#/components/schemas/_types.mapping.IcuCollationProperty' integer: '#/components/schemas/_types.mapping.IntegerNumberProperty' integer_range: '#/components/schemas/_types.mapping.IntegerRangeProperty' ip: '#/components/schemas/_types.mapping.IpProperty' ip_range: '#/components/schemas/_types.mapping.IpRangeProperty' join: '#/components/schemas/_types.mapping.JoinProperty' keyword: '#/components/schemas/_types.mapping.KeywordProperty' long: '#/components/schemas/_types.mapping.LongNumberProperty' long_range: '#/components/schemas/_types.mapping.LongRangeProperty' match_only_text: '#/components/schemas/_types.mapping.MatchOnlyTextProperty' murmur3: '#/components/schemas/_types.mapping.Murmur3HashProperty' nested: '#/components/schemas/_types.mapping.NestedProperty' object: '#/components/schemas/_types.mapping.ObjectProperty' passthrough: '#/components/schemas/_types.mapping.PassthroughObjectProperty' percolator: '#/components/schemas/_types.mapping.PercolatorProperty' point: '#/components/schemas/_types.mapping.PointProperty' rank_feature: '#/components/schemas/_types.mapping.RankFeatureProperty' rank_features: '#/components/schemas/_types.mapping.RankFeaturesProperty' rank_vectors: '#/components/schemas/_types.mapping.RankVectorProperty' scaled_float: '#/components/schemas/_types.mapping.ScaledFloatNumberProperty' search_as_you_type: '#/components/schemas/_types.mapping.SearchAsYouTypeProperty' semantic_text: '#/components/schemas/_types.mapping.SemanticTextProperty' shape: '#/components/schemas/_types.mapping.ShapeProperty' short: '#/components/schemas/_types.mapping.ShortNumberProperty' sparse_vector: '#/components/schemas/_types.mapping.SparseVectorProperty' text: '#/components/schemas/_types.mapping.TextProperty' token_count: '#/components/schemas/_types.mapping.TokenCountProperty' unsigned_long: '#/components/schemas/_types.mapping.UnsignedLongNumberProperty' version: '#/components/schemas/_types.mapping.VersionProperty' wildcard: '#/components/schemas/_types.mapping.WildcardProperty' '{dynamic_type}': '#/components/schemas/_types.mapping.DynamicProperty' _types.mapping.BinaryProperty: allOf: - $ref: '#/components/schemas/_types.mapping.DocValuesPropertyBase' - required: - type type: object properties: type: enum: - binary type: string _types.mapping.DocValuesPropertyBase: allOf: - $ref: '#/components/schemas/_types.mapping.CorePropertyBase' - type: object properties: doc_values: allOf: - $ref: '#/components/schemas/_types.mapping.DocValues' _types.mapping.DocValues: oneOf: - type: boolean - $ref: '#/components/schemas/_types.mapping.DocValuesConfig' description: 'Defines whether doc values are enabled for a field. Can be a simple boolean, or a configuration object for finer-grained control over sub-parameters such as `multi_value`.' _types.mapping.DocValuesConfig: type: object properties: multi_value: type: boolean description: "If `false`, the field is treated as single-valued, enabling optimized storage.\nOnly has an effect when columnar index mode is active." default: true x-state: Experimental nullability: type: boolean description: "If `false`, every document must provide a non-null value for the field: a document that\nomits the field, sets it to `null`, or supplies only null values (an empty array or an\nall-null array) is rejected at index time.\nA field that defines `null_value` is always exempt, since the configured default removes\nthe absence of a value.\nOnly has an effect when columnar index mode is active." default: true x-state: Experimental description: Configuration object for doc values when sub-parameters are needed. _types.mapping.CorePropertyBase: allOf: - $ref: '#/components/schemas/_types.mapping.PropertyBase' - type: object properties: copy_to: allOf: - $ref: '#/components/schemas/_types.Fields' store: type: boolean _types.mapping.PropertyBase: type: object properties: meta: type: object additionalProperties: type: string description: Metadata about the field. properties: type: object additionalProperties: $ref: '#/components/schemas/_types.mapping.Property' ignore_above: type: number dynamic: allOf: - $ref: '#/components/schemas/_types.mapping.DynamicMapping' fields: type: object additionalProperties: $ref: '#/components/schemas/_types.mapping.Property' synthetic_source_keep: allOf: - $ref: '#/components/schemas/_types.mapping.SyntheticSourceKeepEnum' description: "\n\nSupported values include:\n - `none`: Synthetic source diverges from the original source (default)\n - `arrays`: Arrays of the corresponding field or object preserve the original element ordering and duplicate elements.\nThe synthetic source fragment for such arrays is not guaranteed to match the original source exactly,\ne.g. array [1, 2, [5], [[4, [3]]], 5] may appear as-is or in an equivalent format like [1, 2, 5, 4, 3, 5].\nThe exact format may change in the future, in an effort to reduce the storage overhead of this option.\n - `all`: The source for both singleton instances and arrays of the corresponding field or object gets recorded.\nWhen applied to objects, the source of all sub-objects and sub-fields gets captured.\nFurthermore, the original source of arrays gets captured and appears in synthetic source with no modifications.\n\n" _types.mapping.SyntheticSourceKeepEnum: enum: - none - arrays - all type: string _types.mapping.BooleanProperty: allOf: - $ref: '#/components/schemas/_types.mapping.DocValuesPropertyBase' - required: - type type: object properties: boost: type: number fielddata: allOf: - $ref: '#/components/schemas/indices._types.NumericFielddata' index: type: boolean null_value: type: boolean ignore_malformed: type: boolean script: allOf: - $ref: '#/components/schemas/_types.Script' on_script_error: allOf: - $ref: '#/components/schemas/_types.mapping.OnScriptError' time_series_dimension: type: boolean description: For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. x-state: Experimental type: enum: - boolean type: string indices._types.NumericFielddata: required: - format type: object properties: format: allOf: - $ref: '#/components/schemas/indices._types.NumericFielddataFormat' indices._types.NumericFielddataFormat: enum: - array - disabled type: string _types.mapping.DynamicProperty: allOf: - $ref: '#/components/schemas/_types.mapping.DocValuesPropertyBase' - required: - type type: object properties: type: enum: - '{dynamic_type}' type: string enabled: type: boolean null_value: allOf: - $ref: '#/components/schemas/_types.FieldValue' boost: type: number coerce: type: boolean script: allOf: - $ref: '#/components/schemas/_types.Script' on_script_error: allOf: - $ref: '#/components/schemas/_types.mapping.OnScriptError' ignore_malformed: type: boolean time_series_metric: allOf: - $ref: '#/components/schemas/_types.mapping.TimeSeriesMetricType' time_series_dimension: type: boolean analyzer: type: string eager_global_ordinals: type: boolean fielddata: type: boolean fielddata_frequency_filter: allOf: - $ref: '#/components/schemas/indices._types.FielddataFrequencyFilter' index: type: boolean index_options: allOf: - $ref: '#/components/schemas/_types.mapping.IndexOptions' index_phrases: type: boolean index_prefixes: oneOf: - $ref: '#/components/schemas/_types.mapping.TextIndexPrefixes' - type: - 'null' - string norms: type: boolean position_increment_gap: type: number search_analyzer: type: string search_quote_analyzer: type: string similarity: oneOf: - type: string - type: - 'null' - string term_vector: allOf: - $ref: '#/components/schemas/_types.mapping.TermVectorOption' format: type: string precision_step: type: number locale: type: string subobjects: allOf: - $ref: '#/components/schemas/_types.mapping.Subobjects' _types.mapping.TimeSeriesMetricType: enum: - gauge - counter - summary - histogram - position type: string indices._types.FielddataFrequencyFilter: required: - max - min - min_segment_size type: object properties: max: type: number min: type: number min_segment_size: type: number _types.mapping.IndexOptions: enum: - docs - freqs - positions - offsets type: string _types.mapping.TextIndexPrefixes: type: object properties: max_chars: type: number min_chars: type: number _types.mapping.TermVectorOption: enum: - no - yes - with_offsets - with_positions - with_positions_offsets - with_positions_offsets_payloads - with_positions_payloads type: string _types.mapping.Subobjects: enum: - 'true' - 'false' type: string _types.mapping.JoinProperty: allOf: - $ref: '#/components/schemas/_types.mapping.PropertyBase' - required: - type type: object properties: relations: type: object additionalProperties: oneOf: - $ref: '#/components/schemas/_types.RelationName' - type: array items: $ref: '#/components/schemas/_types.RelationName' eager_global_ordinals: type: boolean type: enum: - join type: string _types.mapping.KeywordProperty: allOf: - $ref: '#/components/schemas/_types.mapping.DocValuesPropertyBase' - required: - type type: object properties: boost: type: number eager_global_ordinals: type: boolean index: type: boolean index_options: allOf: - $ref: '#/components/schemas/_types.mapping.IndexOptions' script: allOf: - $ref: '#/components/schemas/_types.Script' on_script_error: allOf: - $ref: '#/components/schemas/_types.mapping.OnScriptError' normalizer: type: string norms: type: boolean null_value: type: string similarity: oneOf: - type: string - type: - 'null' - string split_queries_on_whitespace: type: boolean time_series_dimension: type: boolean description: For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. x-state: Experimental type: enum: - keyword type: string _types.mapping.MatchOnlyTextProperty: required: - type type: object properties: type: enum: - match_only_text type: string fields: type: object additionalProperties: $ref: '#/components/schemas/_types.mapping.Property' description: "Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one\nfield for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers." meta: type: object additionalProperties: type: string description: Metadata about the field. copy_to: allOf: - $ref: '#/components/schemas/_types.Fields' description: "Allows you to copy the values of multiple fields into a group\nfield, which can then be queried as a single field." description: "A variant of text that trades scoring and efficiency of positional queries for space efficiency. This field\neffectively stores data the same way as a text field that only indexes documents (index_options: docs) and\ndisables norms (norms: false). Term queries perform as fast if not faster as on text fields, however queries\nthat need positions such as the match_phrase query perform slower as they need to look at the _source document\nto verify whether a phrase matches. All queries return constant scores that are equal to 1.0." _types.mapping.PercolatorProperty: allOf: - $ref: '#/components/schemas/_types.mapping.PropertyBase' - required: - type type: object properties: type: enum: - percolator type: string _types.mapping.RankFeatureProperty: allOf: - $ref: '#/components/schemas/_types.mapping.PropertyBase' - required: - type type: object properties: positive_score_impact: type: boolean type: enum: - rank_feature type: string _types.mapping.RankFeaturesProperty: allOf: - $ref: '#/components/schemas/_types.mapping.PropertyBase' - required: - type type: object properties: positive_score_impact: type: boolean type: enum: - rank_features type: string _types.mapping.SearchAsYouTypeProperty: allOf: - $ref: '#/components/schemas/_types.mapping.CorePropertyBase' - required: - type type: object properties: analyzer: type: string index: type: boolean index_options: allOf: - $ref: '#/components/schemas/_types.mapping.IndexOptions' max_shingle_size: type: number norms: type: boolean search_analyzer: type: string search_quote_analyzer: type: string similarity: oneOf: - type: string - type: - 'null' - string term_vector: allOf: - $ref: '#/components/schemas/_types.mapping.TermVectorOption' type: enum: - search_as_you_type type: string _types.mapping.TextProperty: allOf: - $ref: '#/components/schemas/_types.mapping.CorePropertyBase' - required: - type type: object properties: analyzer: type: string boost: type: number eager_global_ordinals: type: boolean fielddata: type: boolean fielddata_frequency_filter: allOf: - $ref: '#/components/schemas/indices._types.FielddataFrequencyFilter' index: type: boolean index_options: allOf: - $ref: '#/components/schemas/_types.mapping.IndexOptions' index_phrases: type: boolean index_prefixes: oneOf: - $ref: '#/components/schemas/_types.mapping.TextIndexPrefixes' - type: - 'null' - string norms: type: boolean position_increment_gap: type: number search_analyzer: type: string search_quote_analyzer: type: string similarity: oneOf: - type: string - type: - 'null' - string term_vector: allOf: - $ref: '#/components/schemas/_types.mapping.TermVectorOption' type: enum: - text type: string _types.mapping.VersionProperty: allOf: - $ref: '#/components/schemas/_types.mapping.DocValuesPropertyBase' - required: - type type: object properties: type: enum: - version type: string _types.mapping.WildcardProperty: allOf: - $ref: '#/components/schemas/_types.mapping.DocValuesPropertyBase' - required: - type type: object properties: type: enum: - wildcard type: string null_value: type: string x-state: Generally available; Added in 7.15.0 _types.mapping.DateNanosProperty: allOf: - $ref: '#/components/schemas/_types.mapping.DocValuesPropertyBase' - required: - type type: object properties: boost: type: number format: type: string ignore_malformed: type: boolean index: type: boolean script: allOf: - $ref: '#/components/schemas/_types.Script' on_script_error: allOf: - $ref: '#/components/schemas/_types.mapping.OnScriptError' null_value: allOf: - $ref: '#/components/schemas/_types.DateTime' precision_step: type: number type: enum: - date_nanos type: string _types.mapping.DateProperty: allOf: - $ref: '#/components/schemas/_types.mapping.DocValuesPropertyBase' - required: - type type: object properties: boost: type: number fielddata: allOf: - $ref: '#/components/schemas/indices._types.NumericFielddata' format: type: string ignore_malformed: type: boolean index: type: boolean script: allOf: - $ref: '#/components/schemas/_types.Script' on_script_error: allOf: - $ref: '#/components/schemas/_types.mapping.OnScriptError' null_value: allOf: - $ref: '#/components/schemas/_types.DateTime' precision_step: type: number locale: type: string type: enum: - date type: string _types.mapping.AggregateMetricDoubleProperty: allOf: - $ref: '#/components/schemas/_types.mapping.PropertyBase' - required: - type - default_metric - metrics type: object properties: type: enum: - aggregate_metric_double type: string default_metric: type: string ignore_malformed: type: boolean metrics: type: array items: type: string time_series_metric: allOf: - $ref: '#/components/schemas/_types.mapping.TimeSeriesMetricType' _types.mapping.DenseVectorProperty: allOf: - $ref: '#/components/schemas/_types.mapping.PropertyBase' - required: - type type: object properties: type: enum: - dense_vector type: string dims: type: number description: "Number of vector dimensions. Can't exceed `4096`. If `dims` is not specified, it will be set to the length of\nthe first vector added to the field." element_type: allOf: - $ref: '#/components/schemas/_types.mapping.DenseVectorElementType' description: "The data type used to encode vectors. The supported data types are `float` (default), `byte`, and `bit`.\n\nSupported values include:\n - `bit`: Indexes a single bit per dimension. Useful for very high-dimensional vectors or models that specifically support\nbit vectors.\n\nNOTE: when using `bit`, the number of dimensions must be a multiple of `8` and must represent the number of bits.\n - `byte`: Indexes a 1-byte integer value per dimension.\n - `float`: Indexes a 4-byte floating-point value per dimension.\n - `bfloat16`: Indexes a 2-byte floating-point value per dimension.\n\n" default: float index: type: boolean description: 'If `true`, you can search this field using the kNN search API.' default: true index_options: allOf: - $ref: '#/components/schemas/_types.mapping.DenseVectorIndexOptions' description: "An optional section that configures the kNN indexing algorithm. The HNSW algorithm has two internal parameters\nthat influence how the data structure is built. These can be adjusted to improve the accuracy of results, at the\nexpense of slower indexing speed.\n\nThis parameter can only be specified when `index` is `true`." similarity: allOf: - $ref: '#/components/schemas/_types.mapping.DenseVectorSimilarity' description: "The vector similarity metric to use in kNN search.\n\nDocuments are ranked by their vector field's similarity to the query vector. The `_score` of each document will\nbe derived from the similarity, in a way that ensures scores are positive and that a larger score corresponds\nto a higher ranking.\n\nDefaults to `l2_norm` when `element_type` is `bit` otherwise defaults to `cosine`.\n\n`bit` vectors only support `l2_norm` as their similarity metric.\n\nThis parameter can only be specified when `index` is `true`.\n\nSupported values include:\n - `cosine`: Computes the cosine similarity. During indexing Elasticsearch automatically normalizes vectors with `cosine`\nsimilarity to unit length. This allows to internally use `dot_product` for computing similarity, which is more\nefficient. Original un-normalized vectors can be still accessed through scripts.\n\nThe document `_score` is computed as `(1 + cosine(query, vector)) / 2`.\n\nThe `cosine` similarity does not allow vectors with zero magnitude, since cosine is not defined in this case.\n - `dot_product`: Computes the dot product of two unit vectors. This option provides an optimized way to perform cosine similarity.\nThe constraints and computed score are defined by `element_type`.\n\nWhen `element_type` is `float`, all vectors must be unit length, including both document and query vectors.\n\nThe document `_score` is computed as `(1 + dot_product(query, vector)) / 2`.\n\nWhen `element_type` is `byte`, all vectors must have the same length including both document and query vectors or\nresults will be inaccurate.\n\nThe document `_score` is computed as `0.5 + (dot_product(query, vector) / (32768 * dims))` where `dims` is the\nnumber of dimensions per vector.\n - `l2_norm`: Computes similarity based on the `L2` distance (also known as Euclidean distance) between the vectors.\n\nThe document `_score` is computed as `1 / (1 + l2_norm(query, vector)^2)`.\n\nFor `bit` vectors, instead of using `l2_norm`, the `hamming` distance between the vectors is used.\n\nThe `_score` transformation is `(numBits - hamming(a, b)) / numBits`.\n - `max_inner_product`: Computes the maximum inner product of two vectors. This is similar to `dot_product`, but doesn't require vectors\nto be normalized. This means that each vector’s magnitude can significantly effect the score.\n\nThe document `_score` is adjusted to prevent negative values. For `max_inner_product` values `< 0`, the `_score`\nis `1 / (1 + -1 * max_inner_product(query, vector))`. For non-negative `max_inner_product` results the `_score`\nis calculated `max_inner_product(query, vector) + 1`.\n\n" _types.mapping.DenseVectorElementType: enum: - bit - byte - float - bfloat16 type: string _types.mapping.DenseVectorIndexOptions: required: - type type: object properties: confidence_interval: type: number description: "The confidence interval to use when quantizing the vectors. Can be any value between and including `0.90` and\n`1.0` or exactly `0`. When the value is `0`, this indicates that dynamic quantiles should be calculated for\noptimized quantization. When between `0.90` and `1.0`, this value restricts the values used when calculating\nthe quantization thresholds.\n\nFor example, a value of `0.95` will only use the middle `95%` of the values when calculating the quantization\nthresholds (e.g. the highest and lowest `2.5%` of values will be ignored).\n\nDefaults to `1/(dims + 1)` for `int8` quantized vectors and `0` for `int4` for dynamic quantile calculation.\n\nOnly applicable to `int8_hnsw`, `int4_hnsw`, `int8_flat`, and `int4_flat` index types." deprecated: true ef_construction: type: number description: "The number of candidates to track while assembling the list of nearest neighbors for each new node.\n\nOnly applicable to `hnsw`, `int8_hnsw`, `bbq_hnsw`, and `int4_hnsw` index types." default: 100 m: type: number description: "The number of neighbors each node will be connected to in the HNSW graph.\n\nOnly applicable to `hnsw`, `int8_hnsw`, `bbq_hnsw`, and `int4_hnsw` index types." default: 16 type: allOf: - $ref: '#/components/schemas/_types.mapping.DenseVectorIndexOptionsType' description: "The type of kNN algorithm to use.\n\nSupported values include:\n - `bbq_flat`: This utilizes a brute-force search algorithm in addition to automatically quantizing to binary vectors.\nOnly supports `element_type` of `float`.\n - `bbq_hnsw`: This utilizes the HNSW algorithm in addition to automatic binary quantization for scalable approximate kNN\nsearch with `element_type` of `float`.\n\nThis can reduce the memory footprint by nearly 32x at the cost of some accuracy.\n - `bbq_disk`: This utilizes the DiskBBQ algorithm, a version of Inverted Vector File (IVF) that uses BBQ to quantize vectors.\nOnly supports `element_type` of `float`.\n\nThis not only significantly reduces memory usage, but also allows for indexing and searching of very large datasets that do not fit in memory.\nUnlike HNSW, this index type loses performance gracefully as the index grows larger than memory.\n - `flat`: This utilizes a brute-force search algorithm for exact kNN search. This supports all `element_type` values.\n - `hnsw`: This utilizes the HNSW algorithm for scalable approximate kNN search. This supports all `element_type` values.\n - `int4_flat`: This utilizes a brute-force search algorithm in addition to automatically half-byte scalar quantization.\nOnly supports `element_type` of `float`.\n - `int4_hnsw`: This utilizes the HNSW algorithm in addition to automatically scalar quantization for scalable approximate kNN\nsearch with `element_type` of `float`.\n\nThis can reduce the memory footprint by 8x at the cost of some accuracy.\n - `int8_flat`: This utilizes a brute-force search algorithm in addition to automatically scalar quantization. Only supports\n`element_type` of `float`.\n - `int8_hnsw`: The default index type for `float` vectors. This utilizes the HNSW algorithm in addition to automatically scalar\nquantization for scalable approximate kNN search with `element_type` of `float`.\n\nThis can reduce the memory footprint by 4x at the cost of some accuracy.\n\n" rescore_vector: allOf: - $ref: '#/components/schemas/_types.mapping.DenseVectorIndexOptionsRescoreVector' description: 'The rescore vector options. This is only applicable to `bbq_disk`, `bbq_hnsw`, `int4_hnsw`, `int8_hnsw`, `bbq_flat`, `int4_flat`, and `int8_flat` index types.' on_disk_rescore: type: boolean description: "`true` if vector rescoring should be done on-disk\n\nOnly applicable to `bbq_disk`, `bbq_hnsw`, `int4_hnsw`, `int8_hnsw`" default: false x-state: Experimental; Added in 9.3.0 flat_index_threshold: type: number description: "The segment document count threshold below which HNSW graph construction is skipped in favor of brute-force flat\nsearch. `-1` (default) defers to format defaults: `300` for `bbq_hnsw`, `150` for `hnsw`, `int8_hnsw`, and\n`int4_hnsw`. `0` always builds the graph. A positive value overrides the format default.\n\nOnly applicable to `hnsw`, `int8_hnsw`, `int4_hnsw`, `bbq_hnsw`, and `bbq_disk` index types." default: -1 x-state: Generally available; Added in 9.4.0 cluster_size: type: number description: Only applicable to `bbq_disk`. The number of vectors per cluster. Must be between 64 and 65536. default: 384 x-state: Generally available; Added in 9.2.0 default_visit_percentage: type: number description: "Only applicable to `bbq_disk`. The percentage of clusters to visit during search. Must be between 0 and 100.\nA value of 0 defaults to using `num_candidates` for calculating the visit percentage." default: 0 x-state: Generally available; Added in 9.2.0 bits: type: number description: "Only applicable to `bbq_disk`. The number of bits per dimension for quantization encoding.\nValid values are `1`, `2`, `4`, or `7`. When no `rescore_vector` is explicitly set,\nthe default oversampling is automatically adjusted based on the bits value.\nThis setting can be changed without reindexing." default: 1 x-state: Generally available; Added in 9.4.0 precondition: type: boolean description: "Only applicable to `bbq_disk`. When `true`, transforms indexed vectors using a random orthogonal\nprojection before quantization, which can improve accuracy when vector components are not normally\ndistributed. Cannot be changed after the field is created." default: false x-state: Generally available; Added in 9.4.0 auto_calibrate: type: boolean description: "Only applicable to `bbq_disk`. When `true`, Elasticsearch automatically selects the optimal\nquantization encoding, oversampling factor, and preconditioning for each merged segment based\non estimated recall characteristics. Cannot be changed after the field is created." default: false x-state: Generally available; Added in 9.5.0 _types.mapping.DenseVectorIndexOptionsType: enum: - bbq_flat - bbq_hnsw - bbq_disk - flat - hnsw - int4_flat - int4_hnsw - int8_flat - int8_hnsw type: string _types.mapping.DenseVectorIndexOptionsRescoreVector: required: - oversample type: object properties: oversample: type: number description: "The oversampling factor to use when searching for the nearest neighbor. This is only applicable to the quantized formats: `bbq_*`, `int4_*`, and `int8_*`.\nWhen provided, `oversample * k` vectors will be gathered and then their scores will be re-computed with the original vectors.\n\nvalid values are between `1.0` and `10.0` (inclusive), or `0` exactly to disable oversampling." _types.mapping.FlattenedProperty: allOf: - $ref: '#/components/schemas/_types.mapping.PropertyBase' - required: - type type: object properties: boost: type: number depth_limit: type: number doc_values: type: boolean eager_global_ordinals: type: boolean index: type: boolean index_options: allOf: - $ref: '#/components/schemas/_types.mapping.IndexOptions' null_value: type: string preserve_leaf_arrays: allOf: - $ref: '#/components/schemas/_types.mapping.PreserveLeafArrays' description: "How leaf arrays are represented in synthetic source.\nWhen set to `lossy`, leaf arrays are sorted, de-nulled, and deduplicated in the returned synthetic source.\nWhen set to `exact`, leaf arrays preserve order, nulls, and duplicates." similarity: type: string split_queries_on_whitespace: type: boolean time_series_dimensions: type: array items: type: string type: enum: - flattened type: string _types.mapping.PreserveLeafArrays: enum: - lossy - exact type: string _types.mapping.NestedProperty: allOf: - $ref: '#/components/schemas/_types.mapping.CorePropertyBase' - required: - type type: object properties: enabled: type: boolean include_in_parent: type: boolean include_in_root: type: boolean type: enum: - nested type: string _types.mapping.ObjectProperty: allOf: - $ref: '#/components/schemas/_types.mapping.CorePropertyBase' - type: object properties: enabled: type: boolean subobjects: allOf: - $ref: '#/components/schemas/_types.mapping.Subobjects' type: enum: - object type: string _types.mapping.PassthroughObjectProperty: allOf: - $ref: '#/components/schemas/_types.mapping.CorePropertyBase' - type: object properties: type: enum: - passthrough type: string enabled: type: boolean priority: type: number time_series_dimension: type: boolean _types.mapping.RankVectorProperty: allOf: - $ref: '#/components/schemas/_types.mapping.PropertyBase' - required: - type type: object properties: type: enum: - rank_vectors type: string element_type: allOf: - $ref: '#/components/schemas/_types.mapping.RankVectorElementType' dims: type: number description: Technical preview _types.mapping.RankVectorElementType: enum: - byte - float - bit type: string _types.mapping.SemanticTextProperty: required: - type type: object properties: type: enum: - semantic_text type: string meta: type: object additionalProperties: type: string inference_id: allOf: - $ref: '#/components/schemas/_types.Id' description: "Inference endpoint that will be used to generate embeddings for the field.\nThis parameter cannot be updated. Use the Create inference API to create the endpoint.\nIf `search_inference_id` is specified, the inference endpoint will only be used at index time.\nIf the `inference_id` is not specified, it will default to `.jina-embeddings-v5-text-small` if the cluster is authorized to use the Elastic Inference Service,\notherwise it will default to `.elser-2-elasticsearch`. The `.elser-2-elasticsearch` inference endpoint relies on a local ML node to run the ELSER model." default: .jina-embeddings-v5-text-small search_inference_id: allOf: - $ref: '#/components/schemas/_types.Id' description: "Inference endpoint that will be used to generate embeddings at query time.\nYou can update this parameter by using the Update mapping API. Use the Create inference API to create the endpoint.\nIf not specified, the inference endpoint defined by inference_id will be used at both index and query time." index_options: allOf: - $ref: '#/components/schemas/_types.mapping.SemanticTextIndexOptions' description: "Settings for index_options that override any defaults used by semantic_text, for example\nspecific quantization settings." chunking_settings: oneOf: - $ref: '#/components/schemas/_types.mapping.ChunkingSettings' - type: - 'null' - string description: "Settings for chunking text into smaller passages. If specified, these will override the\nchunking settings sent in the inference endpoint associated with inference_id. If chunking settings are updated,\nthey will not be applied to existing documents until they are reindexed." fields: type: object additionalProperties: $ref: '#/components/schemas/_types.mapping.Property' description: "Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one\nfield for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers." _types.mapping.SemanticTextIndexOptions: type: object properties: dense_vector: allOf: - $ref: '#/components/schemas/_types.mapping.DenseVectorIndexOptions' sparse_vector: allOf: - $ref: '#/components/schemas/_types.mapping.SparseVectorIndexOptions' _types.mapping.SparseVectorIndexOptions: type: object properties: prune: type: boolean description: "Whether to perform pruning, omitting the non-significant tokens from the query to improve query performance.\nIf prune is true but the pruning_config is not specified, pruning will occur but default values will be used.\nDefault: false" x-state: Generally available; Added in 8.19.0 pruning_config: allOf: - $ref: '#/components/schemas/_types.TokenPruningConfig' description: "Optional pruning configuration.\nIf enabled, this will omit non-significant tokens from the query in order to improve query performance.\nThis is only used if prune is set to true.\nIf prune is set to true but pruning_config is not specified, default values will be used." x-state: Generally available; Added in 8.19.0 _types.mapping.ChunkingSettings: required: - strategy - max_chunk_size type: object properties: strategy: type: string description: "The chunking strategy: `sentence`, `word`, `none` or `recursive`.\n\n * If `strategy` is set to `recursive`, you must also specify:\n\n- `max_chunk_size`\n- either `separators` or`separator_group`\n\nLearn more about different chunking strategies in the linked documentation." default: sentence externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#chunking-strategies max_chunk_size: type: number description: "The maximum size of a chunk in words.\nThis value cannot be lower than `20` (for `sentence` strategy) or `10` (for `word` strategy).\nThis value should not exceed the window size for the associated model." default: 250 overlap: type: number description: "The number of overlapping words for chunks.\nIt is applicable only to a `word` chunking strategy.\nThis value cannot be higher than half the `max_chunk_size` value." default: 100 sentence_overlap: type: number description: "The number of overlapping sentences for chunks.\nIt is applicable only for a `sentence` chunking strategy.\nIt can be either `1` or `0`." default: 1 separator_group: type: string description: "Only applicable to the `recursive` strategy and required when using it.\n\nSets a predefined list of separators in the saved chunking settings based on the selected text type.\nValues can be `markdown` or `plaintext`.\n\nUsing this parameter is an alternative to manually specifying a custom `separators` list." separators: type: array items: type: string description: "Only applicable to the `recursive` strategy and required when using it.\n\nA list of strings used as possible split points when chunking text.\n\nEach string can be a plain string or a regular expression (regex) pattern.\nThe system tries each separator in order to split the text, starting from the first item in the list.\n\nAfter splitting, it attempts to recombine smaller pieces into larger chunks that stay within\nthe `max_chunk_size` limit, to reduce the total number of chunks generated." _types.mapping.SparseVectorProperty: allOf: - $ref: '#/components/schemas/_types.mapping.PropertyBase' - required: - type type: object properties: store: type: boolean type: enum: - sparse_vector type: string index_options: allOf: - $ref: '#/components/schemas/_types.mapping.SparseVectorIndexOptions' description: "Additional index options for the sparse vector field that controls the\ntoken pruning behavior of the sparse vector field." x-state: Generally available; Added in 8.19.0 _types.mapping.CompletionProperty: allOf: - $ref: '#/components/schemas/_types.mapping.DocValuesPropertyBase' - required: - type type: object properties: analyzer: type: string contexts: type: array items: $ref: '#/components/schemas/_types.mapping.SuggestContext' max_input_length: type: number preserve_position_increments: type: boolean preserve_separators: type: boolean search_analyzer: type: string type: enum: - completion type: string _types.mapping.SuggestContext: required: - name - type type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' path: allOf: - $ref: '#/components/schemas/_types.Field' type: type: string precision: type: - number - string _types.mapping.ConstantKeywordProperty: allOf: - $ref: '#/components/schemas/_types.mapping.PropertyBase' - required: - type type: object properties: value: type: object type: enum: - constant_keyword type: string _types.mapping.CountedKeywordProperty: allOf: - $ref: '#/components/schemas/_types.mapping.PropertyBase' - required: - type type: object properties: type: enum: - counted_keyword type: string index: type: boolean _types.mapping.FieldAliasProperty: allOf: - $ref: '#/components/schemas/_types.mapping.PropertyBase' - required: - type type: object properties: path: allOf: - $ref: '#/components/schemas/_types.Field' type: enum: - alias type: string _types.mapping.HistogramProperty: allOf: - $ref: '#/components/schemas/_types.mapping.PropertyBase' - required: - type type: object properties: ignore_malformed: type: boolean time_series_metric: allOf: - $ref: '#/components/schemas/_types.mapping.TimeSeriesMetricType' type: enum: - histogram type: string _types.mapping.ExponentialHistogramProperty: allOf: - $ref: '#/components/schemas/_types.mapping.PropertyBase' - required: - type type: object properties: time_series_metric: allOf: - $ref: '#/components/schemas/_types.mapping.TimeSeriesMetricType' type: enum: - exponential_histogram type: string _types.mapping.IpProperty: allOf: - $ref: '#/components/schemas/_types.mapping.DocValuesPropertyBase' - required: - type type: object properties: boost: type: number index: type: boolean ignore_malformed: type: boolean null_value: type: string on_script_error: allOf: - $ref: '#/components/schemas/_types.mapping.OnScriptError' script: allOf: - $ref: '#/components/schemas/_types.Script' time_series_dimension: type: boolean description: For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. x-state: Experimental type: enum: - ip type: string _types.mapping.Murmur3HashProperty: allOf: - $ref: '#/components/schemas/_types.mapping.DocValuesPropertyBase' - required: - type type: object properties: type: enum: - murmur3 type: string _types.mapping.TokenCountProperty: allOf: - $ref: '#/components/schemas/_types.mapping.DocValuesPropertyBase' - required: - type type: object properties: analyzer: type: string boost: type: number index: type: boolean null_value: type: number enable_position_increments: type: boolean type: enum: - token_count type: string _types.mapping.GeoPointProperty: allOf: - $ref: '#/components/schemas/_types.mapping.DocValuesPropertyBase' - required: - type type: object properties: ignore_malformed: type: boolean ignore_z_value: type: boolean null_value: allOf: - $ref: '#/components/schemas/_types.GeoLocation' index: type: boolean on_script_error: allOf: - $ref: '#/components/schemas/_types.mapping.OnScriptError' script: allOf: - $ref: '#/components/schemas/_types.Script' type: enum: - geo_point type: string time_series_metric: allOf: - $ref: '#/components/schemas/_types.mapping.GeoPointMetricType' _types.mapping.GeoPointMetricType: enum: - gauge - counter - position type: string _types.mapping.GeoShapeProperty: allOf: - $ref: '#/components/schemas/_types.mapping.DocValuesPropertyBase' - required: - type type: object properties: coerce: type: boolean ignore_malformed: type: boolean ignore_z_value: type: boolean index: type: boolean orientation: allOf: - $ref: '#/components/schemas/_types.mapping.GeoOrientation' strategy: allOf: - $ref: '#/components/schemas/_types.mapping.GeoStrategy' type: enum: - geo_shape type: string description: "The `geo_shape` data type facilitates the indexing of and searching with arbitrary geo shapes such as rectangles\nand polygons." _types.mapping.GeoOrientation: enum: - right - RIGHT - counterclockwise - ccw - left - LEFT - clockwise - cw type: string _types.mapping.GeoStrategy: enum: - recursive - term type: string _types.mapping.PointProperty: allOf: - $ref: '#/components/schemas/_types.mapping.DocValuesPropertyBase' - required: - type type: object properties: ignore_malformed: type: boolean ignore_z_value: type: boolean null_value: type: string type: enum: - point type: string _types.mapping.ShapeProperty: allOf: - $ref: '#/components/schemas/_types.mapping.DocValuesPropertyBase' - required: - type type: object properties: coerce: type: boolean ignore_malformed: type: boolean ignore_z_value: type: boolean orientation: allOf: - $ref: '#/components/schemas/_types.mapping.GeoOrientation' type: enum: - shape type: string description: "The `shape` data type facilitates the indexing of and searching with arbitrary `x, y` cartesian shapes such as\nrectangles and polygons." _types.mapping.ByteNumberProperty: allOf: - $ref: '#/components/schemas/_types.mapping.NumberPropertyBase' - required: - type type: object properties: type: enum: - byte type: string null_value: allOf: - $ref: '#/components/schemas/_types.byte' _types.byte: type: number _types.mapping.NumberPropertyBase: allOf: - $ref: '#/components/schemas/_types.mapping.DocValuesPropertyBase' - type: object properties: boost: type: number coerce: type: boolean ignore_malformed: type: boolean index: type: boolean on_script_error: allOf: - $ref: '#/components/schemas/_types.mapping.OnScriptError' script: allOf: - $ref: '#/components/schemas/_types.Script' time_series_metric: allOf: - $ref: '#/components/schemas/_types.mapping.TimeSeriesMetricType' description: For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. x-state: Experimental time_series_dimension: type: boolean description: For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. default: false x-state: Experimental _types.mapping.DoubleNumberProperty: allOf: - $ref: '#/components/schemas/_types.mapping.NumberPropertyBase' - required: - type type: object properties: type: enum: - double type: string null_value: type: number _types.mapping.FloatNumberProperty: allOf: - $ref: '#/components/schemas/_types.mapping.NumberPropertyBase' - required: - type type: object properties: type: enum: - float type: string null_value: type: number _types.mapping.HalfFloatNumberProperty: allOf: - $ref: '#/components/schemas/_types.mapping.NumberPropertyBase' - required: - type type: object properties: type: enum: - half_float type: string null_value: type: number _types.mapping.IntegerNumberProperty: allOf: - $ref: '#/components/schemas/_types.mapping.NumberPropertyBase' - required: - type type: object properties: type: enum: - integer type: string null_value: type: number _types.mapping.LongNumberProperty: allOf: - $ref: '#/components/schemas/_types.mapping.NumberPropertyBase' - required: - type type: object properties: type: enum: - long type: string null_value: type: number _types.mapping.ScaledFloatNumberProperty: allOf: - $ref: '#/components/schemas/_types.mapping.NumberPropertyBase' - required: - type type: object properties: type: enum: - scaled_float type: string null_value: type: number scaling_factor: type: number _types.mapping.ShortNumberProperty: allOf: - $ref: '#/components/schemas/_types.mapping.NumberPropertyBase' - required: - type type: object properties: type: enum: - short type: string null_value: allOf: - $ref: '#/components/schemas/_types.short' _types.short: type: number _types.mapping.UnsignedLongNumberProperty: allOf: - $ref: '#/components/schemas/_types.mapping.NumberPropertyBase' - required: - type type: object properties: type: enum: - unsigned_long type: string null_value: allOf: - $ref: '#/components/schemas/_types.ulong' _types.ulong: type: number _types.mapping.DateRangeProperty: allOf: - $ref: '#/components/schemas/_types.mapping.RangePropertyBase' - required: - type type: object properties: format: type: string type: enum: - date_range type: string _types.mapping.RangePropertyBase: allOf: - $ref: '#/components/schemas/_types.mapping.DocValuesPropertyBase' - type: object properties: boost: type: number coerce: type: boolean index: type: boolean _types.mapping.DoubleRangeProperty: allOf: - $ref: '#/components/schemas/_types.mapping.RangePropertyBase' - required: - type type: object properties: type: enum: - double_range type: string _types.mapping.FloatRangeProperty: allOf: - $ref: '#/components/schemas/_types.mapping.RangePropertyBase' - required: - type type: object properties: type: enum: - float_range type: string _types.mapping.IntegerRangeProperty: allOf: - $ref: '#/components/schemas/_types.mapping.RangePropertyBase' - required: - type type: object properties: type: enum: - integer_range type: string _types.mapping.IpRangeProperty: allOf: - $ref: '#/components/schemas/_types.mapping.RangePropertyBase' - required: - type type: object properties: type: enum: - ip_range type: string _types.mapping.LongRangeProperty: allOf: - $ref: '#/components/schemas/_types.mapping.RangePropertyBase' - required: - type type: object properties: type: enum: - long_range type: string _types.mapping.IcuCollationProperty: allOf: - $ref: '#/components/schemas/_types.mapping.DocValuesPropertyBase' - required: - type type: object properties: type: enum: - icu_collation_keyword type: string norms: type: boolean index_options: allOf: - $ref: '#/components/schemas/_types.mapping.IndexOptions' index: type: boolean description: Should the field be searchable? null_value: type: string description: 'Accepts a string value which is substituted for any explicit null values. Defaults to null, which means the field is treated as missing.' rules: type: string language: type: string country: type: string variant: type: string strength: allOf: - $ref: '#/components/schemas/_types.analysis.IcuCollationStrength' decomposition: allOf: - $ref: '#/components/schemas/_types.analysis.IcuCollationDecomposition' alternate: allOf: - $ref: '#/components/schemas/_types.analysis.IcuCollationAlternate' case_level: type: boolean case_first: allOf: - $ref: '#/components/schemas/_types.analysis.IcuCollationCaseFirst' numeric: type: boolean variable_top: type: string hiragana_quaternary_mode: type: boolean _types.mapping.MatchType: enum: - simple - regex type: string _types.mapping.FieldNamesField: required: - enabled type: object properties: enabled: type: boolean _types.mapping.IndexField: required: - enabled type: object properties: enabled: type: boolean _types.mapping.RoutingField: required: - required type: object properties: required: type: boolean _types.mapping.SizeField: required: - enabled type: object properties: enabled: type: boolean _types.mapping.SourceField: type: object properties: enabled: type: boolean excludes: type: array items: type: string includes: type: array items: type: string mode: allOf: - $ref: '#/components/schemas/_types.mapping.SourceFieldMode' description: "\n\nSupported values include:\n - `disabled`\n - `stored`\n - `columnar_stored`\n - `synthetic`: Instead of storing source documents on disk exactly as you send them,\n Elasticsearch can reconstruct source content on the fly upon retrieval.\n\n" _types.mapping.SourceFieldMode: enum: - disabled - stored - columnar_stored - synthetic type: string _types.mapping.DataStreamTimestamp: required: - enabled type: object properties: enabled: type: boolean indices._types.AliasDefinition: type: object properties: filter: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: Query used to limit documents the alias can access. index_routing: type: string description: "Value used to route indexing operations to a specific shard.\nIf specified, this overwrites the `routing` value for indexing operations." is_write_index: type: boolean description: 'If `true`, the index is the write index for the alias.' default: false routing: type: string description: Value used to route indexing and search operations to a specific shard. search_routing: type: string description: "Value used to route search operations to a specific shard.\nIf specified, this overwrites the `routing` value for search operations." is_hidden: type: boolean description: "If `true`, the alias is hidden.\nAll indices for the alias must have the same `is_hidden` value." default: false x-state: Generally available; Added in 7.16.0 indices._types.DataStreamOptions: type: object properties: failure_store: allOf: - $ref: '#/components/schemas/indices._types.DataStreamFailureStore' description: 'If defined, it specifies configuration for the failure store of this data stream.' description: "Data stream options contain the configuration of data stream level features for a given data stream, for example,\nthe failure store configuration." indices._types.DataStreamFailureStore: type: object properties: enabled: type: boolean description: "If defined, it turns the failure store on/off (`true`/`false`) for this data stream. A data stream failure store\nthat's disabled (enabled: `false`) will redirect no new failed indices to the failure store; however, it will\nnot remove any existing data from the failure store." default: true lifecycle: allOf: - $ref: '#/components/schemas/indices._types.FailureStoreLifecycle' description: 'If defined, it specifies the lifecycle configuration for the failure store of this data stream.' description: Data stream failure store contains the configuration of the failure store for a given data stream. indices._types.FailureStoreLifecycle: type: object properties: data_retention: allOf: - $ref: '#/components/schemas/_types.Duration' description: "If defined, every document added to this data stream will be stored at least for this time frame.\nAny time after this duration the document could be deleted.\nWhen empty, every document in this data stream will be stored indefinitely." enabled: type: boolean description: "If defined, it turns data stream lifecycle on/off (`true`/`false`) for this data stream. A data stream lifecycle\nthat's disabled (enabled: `false`) will have no effect on the data stream." default: true description: The failure store lifecycle configures the data stream lifecycle configuration for failure indices. _types.Level: enum: - cluster - indices - shards type: string _types.WaitForEvents: enum: - immediate - urgent - high - normal - low - languid type: string cluster.health.WaitForNodes: type: - number - string cluster.health.HealthResponseBody: required: - active_primary_shards - active_shards - active_shards_percent_as_number - cluster_name - delayed_unassigned_shards - initializing_shards - number_of_data_nodes - number_of_in_flight_fetch - number_of_nodes - number_of_pending_tasks - relocating_shards - status - task_max_waiting_in_queue_millis - timed_out - unassigned_primary_shards - unassigned_shards type: object properties: active_primary_shards: type: number description: The number of active primary shards. active_shards: type: number description: The total number of active primary and replica shards. active_shards_percent: type: string description: The ratio of active shards in the cluster expressed as a string formatted percentage. active_shards_percent_as_number: type: number description: The ratio of active shards in the cluster expressed as a percentage. cluster_name: allOf: - $ref: '#/components/schemas/_types.Name' description: The name of the cluster. delayed_unassigned_shards: type: number description: The number of shards whose allocation has been delayed by the timeout settings. indices: type: object additionalProperties: $ref: '#/components/schemas/cluster.health.IndexHealthStats' initializing_shards: type: number description: The number of shards that are under initialization. number_of_data_nodes: type: number description: The number of nodes that are dedicated data nodes. number_of_in_flight_fetch: type: number description: The number of unfinished fetches. number_of_nodes: type: number description: The number of nodes within the cluster. number_of_pending_tasks: type: number description: The number of cluster-level changes that have not yet been executed. relocating_shards: type: number description: The number of shards that are under relocation. status: allOf: - $ref: '#/components/schemas/_types.HealthStatus' description: "\n\nSupported values include:\n - `green` (or `GREEN`): All shards are assigned.\n - `yellow` (or `YELLOW`): All primary shards are assigned, but one or more replica shards are unassigned. If a node in the cluster fails, some data could be unavailable until that node is repaired.\n - `red` (or `RED`): One or more primary shards are unassigned, so some data is unavailable. This can occur briefly during cluster startup as primary shards are assigned.\n - `unknown`\n - `unavailable`\n\n" task_max_waiting_in_queue: allOf: - $ref: '#/components/schemas/_types.Duration' description: The time since the earliest initiated task is waiting for being performed. task_max_waiting_in_queue_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: The time expressed in milliseconds since the earliest initiated task is waiting for being performed. timed_out: type: boolean description: If false the response returned within the period of time that is specified by the timeout parameter (30s by default) unassigned_primary_shards: type: number description: The number of primary shards that are not allocated. unassigned_shards: type: number description: The number of shards that are not allocated. cluster.health.IndexHealthStats: required: - active_primary_shards - active_shards - initializing_shards - number_of_replicas - number_of_shards - relocating_shards - status - unassigned_shards - unassigned_primary_shards type: object properties: active_primary_shards: type: number active_shards: type: number initializing_shards: type: number number_of_replicas: type: number number_of_shards: type: number relocating_shards: type: number shards: type: object additionalProperties: $ref: '#/components/schemas/cluster.health.ShardHealthStats' status: allOf: - $ref: '#/components/schemas/_types.HealthStatus' description: "\n\nSupported values include:\n - `green` (or `GREEN`): All shards are assigned.\n - `yellow` (or `YELLOW`): All primary shards are assigned, but one or more replica shards are unassigned. If a node in the cluster fails, some data could be unavailable until that node is repaired.\n - `red` (or `RED`): One or more primary shards are unassigned, so some data is unavailable. This can occur briefly during cluster startup as primary shards are assigned.\n - `unknown`\n - `unavailable`\n\n" unassigned_shards: type: number unassigned_primary_shards: type: number cluster.health.ShardHealthStats: required: - active_shards - initializing_shards - primary_active - relocating_shards - status - unassigned_shards - unassigned_primary_shards type: object properties: active_shards: type: number initializing_shards: type: number primary_active: type: boolean relocating_shards: type: number status: allOf: - $ref: '#/components/schemas/_types.HealthStatus' description: "\n\nSupported values include:\n - `green` (or `GREEN`): All shards are assigned.\n - `yellow` (or `YELLOW`): All primary shards are assigned, but one or more replica shards are unassigned. If a node in the cluster fails, some data could be unavailable until that node is repaired.\n - `red` (or `RED`): One or more primary shards are unassigned, so some data is unavailable. This can occur briefly during cluster startup as primary shards are assigned.\n - `unknown`\n - `unavailable`\n\n" unassigned_shards: type: number unassigned_primary_shards: type: number _types.ClusterInfoTargets: oneOf: - $ref: '#/components/schemas/_types.ClusterInfoTarget' - type: array items: $ref: '#/components/schemas/_types.ClusterInfoTarget' _types.ClusterInfoTarget: enum: - _all - http - ingest - thread_pool - script type: string nodes._types.Http: required: - routes type: object properties: current_open: type: number description: Current number of open HTTP connections for the node. total_opened: type: number description: Total number of HTTP connections opened for the node. clients: type: array items: $ref: '#/components/schemas/nodes._types.Client' description: "Information on current and recently-closed HTTP client connections.\nClients that have been closed longer than the `http.client_stats.closed_channels.max_age` setting will not be represented here." routes: type: object additionalProperties: $ref: '#/components/schemas/nodes._types.HttpRoute' description: Detailed HTTP stats broken down by route x-state: Generally available; Added in 8.12.0 nodes._types.Client: type: object properties: id: type: number description: Unique ID for the HTTP client. agent: type: string description: "Reported agent for the HTTP client.\nIf unavailable, this property is not included in the response." local_address: type: string description: Local address for the HTTP connection. remote_address: type: string description: Remote address for the HTTP connection. last_uri: type: string description: The URI of the client’s most recent request. opened_time: type: string description: Time at which the client opened the connection. opened_time_millis: type: number description: Time at which the client opened the connection. closed_time: type: string description: Time at which the client closed the connection if the connection is closed. closed_time_millis: type: number description: Time at which the client closed the connection if the connection is closed. last_request_time: type: string description: Time of the most recent request from this client. last_request_time_millis: type: number description: Time of the most recent request from this client. request_count: type: number description: Number of requests from this client. request_size_bytes: type: number description: Cumulative size in bytes of all requests from this client. x_opaque_id: type: string description: "Value from the client’s `x-opaque-id` HTTP header.\nIf unavailable, this property is not included in the response." nodes._types.HttpRoute: required: - requests - responses type: object properties: requests: allOf: - $ref: '#/components/schemas/nodes._types.HttpRouteRequests' responses: allOf: - $ref: '#/components/schemas/nodes._types.HttpRouteResponses' nodes._types.HttpRouteRequests: required: - count - total_size_in_bytes - size_histogram type: object properties: count: type: number total_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' total_size_in_bytes: type: number size_histogram: type: array items: $ref: '#/components/schemas/nodes._types.SizeHttpHistogram' nodes._types.SizeHttpHistogram: required: - count type: object properties: count: type: number ge: allOf: - $ref: '#/components/schemas/_types.ByteSize' ge_bytes: type: number lt: allOf: - $ref: '#/components/schemas/_types.ByteSize' lt_bytes: type: number nodes._types.HttpRouteResponses: required: - count - total_size_in_bytes - handling_time_histogram - size_histogram type: object properties: count: type: number total_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' total_size_in_bytes: type: number handling_time_histogram: type: array items: $ref: '#/components/schemas/nodes._types.TimeHttpHistogram' size_histogram: type: array items: $ref: '#/components/schemas/nodes._types.SizeHttpHistogram' nodes._types.TimeHttpHistogram: required: - count type: object properties: count: type: number ge: allOf: - $ref: '#/components/schemas/_types.Duration' ge_millis: type: number lt: allOf: - $ref: '#/components/schemas/_types.Duration' lt_millis: type: number nodes._types.Ingest: type: object properties: pipelines: type: object additionalProperties: $ref: '#/components/schemas/nodes._types.IngestStats' description: Contains statistics about ingest pipelines for the node. total: allOf: - $ref: '#/components/schemas/nodes._types.IngestTotal' description: Contains statistics about ingest operations for the node. nodes._types.IngestStats: required: - count - current - failed - processors - time_in_millis - ingested_as_first_pipeline_in_bytes - produced_as_first_pipeline_in_bytes type: object properties: count: type: number description: Total number of documents ingested during the lifetime of this node. current: type: number description: Total number of documents currently being ingested. failed: type: number description: Total number of failed ingest operations during the lifetime of this node. processors: type: array items: type: object additionalProperties: $ref: '#/components/schemas/nodes._types.KeyedProcessor' description: Total number of ingest processors. time: allOf: - $ref: '#/components/schemas/_types.Duration' description: Total time spent preprocessing ingest documents during the lifetime of this node. time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: 'Total time, in milliseconds, spent preprocessing ingest documents during the lifetime of this node.' ingested_as_first_pipeline: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "Total size of all documents ingested by the pipeline.\nThe value counts documents for which this pipeline was the first to process them; for pipelines that are not the first to process a document (for example, a final pipeline after a default pipeline, a pipeline run after a reroute processor, or a pipeline invoked by a pipeline processor), the value is `0`." x-state: Generally available; Added in 8.15.0 ingested_as_first_pipeline_in_bytes: type: number description: "Total number of bytes of all documents ingested by the pipeline.\nThe value counts documents for which this pipeline was the first to process them; for pipelines that are not the first to process a document, the value is `0`." x-state: Generally available; Added in 8.15.0 produced_as_first_pipeline: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "Total size of all documents produced by the pipeline.\nThe value counts documents for which this pipeline was the first to process them; for pipelines that are not the first to process a document, the value is `0`.\nIn situations where there are subsequent pipelines, the value represents the size of the document after all pipelines have run." x-state: Generally available; Added in 8.15.0 produced_as_first_pipeline_in_bytes: type: number description: "Total number of bytes of all documents produced by the pipeline.\nThe value counts documents for which this pipeline was the first to process them; for pipelines that are not the first to process a document, the value is `0`.\nIn situations where there are subsequent pipelines, the value represents the size of the document after all pipelines have run." x-state: Generally available; Added in 8.15.0 nodes._types.KeyedProcessor: type: object properties: stats: allOf: - $ref: '#/components/schemas/nodes._types.Processor' type: type: string nodes._types.Processor: type: object properties: count: type: number description: Number of documents transformed by the processor. current: type: number description: Number of documents currently being transformed by the processor. failed: type: number description: Number of failed operations for the processor. time: allOf: - $ref: '#/components/schemas/_types.Duration' description: Time spent by the processor transforming documents. time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: 'Time, in milliseconds, spent by the processor transforming documents.' nodes._types.IngestTotal: required: - count - current - failed - time_in_millis type: object properties: count: type: number description: Total number of documents ingested during the lifetime of this node. current: type: number description: Total number of documents currently being ingested. failed: type: number description: Total number of failed ingest operations during the lifetime of this node. time: allOf: - $ref: '#/components/schemas/_types.Duration' description: Total time spent preprocessing ingest documents during the lifetime of this node. time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: 'Total time, in milliseconds, spent preprocessing ingest documents during the lifetime of this node.' nodes._types.ThreadCount: type: object properties: active: type: number description: Number of active threads in the thread pool. completed: type: number description: Number of tasks completed by the thread pool executor. largest: type: number description: Highest number of active threads in the thread pool. queue: type: number description: Number of tasks in queue for the thread pool. rejected: type: number description: Number of tasks rejected by the thread pool executor. threads: type: number description: Number of threads in the thread pool. nodes._types.Scripting: type: object properties: cache_evictions: type: number description: Total number of times the script cache has evicted old data. compilations: type: number description: Total number of inline script compilations performed by the node. compilations_history: type: object additionalProperties: type: number description: Contains this recent history of script compilations. compilation_limit_triggered: type: number description: Total number of times the script compilation circuit breaker has limited inline script compilations. contexts: type: array items: $ref: '#/components/schemas/nodes._types.Context' nodes._types.Context: type: object properties: context: type: string compilations: type: number cache_evictions: type: number compilation_limit_triggered: type: number cluster.pending_tasks.PendingTask: required: - executing - insert_order - priority - source - time_in_queue_millis type: object properties: executing: type: boolean description: Indicates whether the pending tasks are currently executing or not. insert_order: type: number description: The number that represents when the task has been inserted into the task queue. priority: type: string description: "The priority of the pending task.\nThe valid priorities in descending priority order are: `IMMEDIATE` > `URGENT` > `HIGH` > `NORMAL` > `LOW` > `LANGUID`." source: type: string description: A general description of the cluster task that may include a reason and origin. time_in_queue: allOf: - $ref: '#/components/schemas/_types.Duration' description: The time since the task is waiting for being performed. time_in_queue_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: The time expressed in milliseconds since the task is waiting for being performed. indices.put_index_template.IndexTemplateMapping: type: object properties: aliases: type: object additionalProperties: $ref: '#/components/schemas/indices._types.Alias' description: "Aliases to add.\nIf the index template includes a `data_stream` object, these are data stream aliases.\nOtherwise, these are index aliases.\nData stream aliases ignore the `index_routing`, `routing`, and `search_routing` options." mappings: allOf: - $ref: '#/components/schemas/_types.mapping.TypeMapping' description: "Mapping for fields in the index.\nIf specified, this mapping can include field names, field data types, and mapping parameters." settings: allOf: - $ref: '#/components/schemas/indices._types.IndexSettings' description: Configuration options for the index. lifecycle: allOf: - $ref: '#/components/schemas/indices._types.DataStreamLifecycle' x-state: Generally available; Added in 8.11.0 data_stream_options: oneOf: - $ref: '#/components/schemas/indices._types.DataStreamOptionsTemplate' - type: - 'null' - string x-state: Generally available; Added in 8.19.0 indices._types.Alias: type: object properties: filter: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: Query used to limit documents the alias can access. index_routing: type: string description: "Value used to route indexing operations to a specific shard.\nIf specified, this overwrites the `routing` value for indexing operations." is_hidden: type: boolean description: "If `true`, the alias is hidden.\nAll indices for the alias must have the same `is_hidden` value." default: false is_write_index: type: boolean description: 'If `true`, the index is the write index for the alias.' default: false routing: type: string description: Value used to route indexing and search operations to a specific shard. search_routing: type: string description: "Value used to route search operations to a specific shard.\nIf specified, this overwrites the `routing` value for search operations." indices._types.DataStreamOptionsTemplate: type: object properties: failure_store: oneOf: - $ref: '#/components/schemas/indices._types.DataStreamFailureStoreTemplate' - type: - 'null' - string description: Data stream options template contains the same information as DataStreamOptions but allows them to be set explicitly to null. indices._types.DataStreamFailureStoreTemplate: type: object properties: enabled: oneOf: - type: boolean - type: - 'null' - string description: "If defined, it turns the failure store on/off (`true`/`false`) for this data stream. A data stream failure store\nthat's disabled (enabled: `false`) will redirect no new failed indices to the failure store; however, it will\nnot remove any existing data from the failure store." default: true lifecycle: oneOf: - $ref: '#/components/schemas/indices._types.FailureStoreLifecycleTemplate' - type: - 'null' - string description: 'If defined, it specifies the lifecycle configuration for the failure store of this data stream.' description: Template equivalent of DataStreamFailureStore that allows nullable values. indices._types.FailureStoreLifecycleTemplate: type: object properties: data_retention: oneOf: - $ref: '#/components/schemas/_types.Duration' - type: - 'null' - string description: "If defined, every document added to this data stream will be stored at least for this time frame.\nAny time after this duration the document could be deleted.\nWhen empty, every document in this data stream will be stored indefinitely." enabled: type: boolean description: "If defined, it turns data stream lifecycle on/off (`true`/`false`) for this data stream. A data stream lifecycle\nthat's disabled (enabled: `false`) will have no effect on the data stream." default: true description: Template equivalent of FailureStoreLifecycle that allows nullable values. cluster.remote_info.ClusterRemoteInfo: oneOf: - $ref: '#/components/schemas/cluster.remote_info.ClusterRemoteSniffInfo' - $ref: '#/components/schemas/cluster.remote_info.ClusterRemoteProxyInfo' discriminator: propertyName: mode mapping: proxy: '#/components/schemas/cluster.remote_info.ClusterRemoteProxyInfo' sniff: '#/components/schemas/cluster.remote_info.ClusterRemoteSniffInfo' cluster.remote_info.ClusterRemoteSniffInfo: required: - mode - connected - max_connections_per_cluster - num_nodes_connected - initial_connect_timeout - skip_unavailable - seeds type: object properties: mode: enum: - sniff type: string description: The connection mode for the remote cluster. connected: type: boolean description: "If it is `true`, there is at least one open connection to the remote cluster.\nIf it is `false`, it means that the cluster no longer has an open connection to the remote cluster.\nIt does not necessarily mean that the remote cluster is down or unavailable, just that at some point a connection was lost." max_connections_per_cluster: type: number description: The maximum number of connections maintained for the remote cluster when sniff mode is configured. num_nodes_connected: type: number description: The number of connected nodes in the remote cluster when sniff mode is configured. initial_connect_timeout: allOf: - $ref: '#/components/schemas/_types.Duration' description: The initial connect timeout for remote cluster connections. skip_unavailable: type: boolean description: 'If `true`, cross-cluster search skips the remote cluster when its nodes are unavailable during the search and ignores errors returned by the remote cluster.' seeds: type: array items: type: string description: The initial seed transport addresses of the remote cluster when sniff mode is configured. cluster.remote_info.ClusterRemoteProxyInfo: required: - mode - connected - initial_connect_timeout - skip_unavailable - proxy_address - server_name - num_proxy_sockets_connected - max_proxy_socket_connections type: object properties: mode: enum: - proxy type: string description: The connection mode for the remote cluster. connected: type: boolean description: "If it is `true`, there is at least one open connection to the remote cluster.\nIf it is `false`, it means that the cluster no longer has an open connection to the remote cluster.\nIt does not necessarily mean that the remote cluster is down or unavailable, just that at some point a connection was lost." initial_connect_timeout: allOf: - $ref: '#/components/schemas/_types.Duration' description: The initial connect timeout for remote cluster connections. skip_unavailable: type: boolean description: 'If `true`, cross-cluster search skips the remote cluster when its nodes are unavailable during the search and ignores errors returned by the remote cluster.' proxy_address: type: string description: The address for remote connections when proxy mode is configured. server_name: type: string num_proxy_sockets_connected: type: number description: The number of open socket connections to the remote cluster when proxy mode is configured. max_proxy_socket_connections: type: number description: The maximum number of socket connections to the remote cluster when proxy mode is configured. cluster_credentials: type: string description: 'This field is present and has a value of `::es_redacted::` only when the remote cluster is configured with the API key based model. Otherwise, the field is not present.' cluster.reroute.Command: type: object properties: cancel: allOf: - $ref: '#/components/schemas/cluster.reroute.CommandCancelAction' description: 'Cancel allocation of a shard (or recovery). Accepts index and shard for index name and shard number, and node for the node to cancel the shard allocation on. This can be used to force resynchronization of existing replicas from the primary shard by cancelling them and allowing them to be reinitialized through the standard recovery process. By default only replica shard allocations can be cancelled. If it is necessary to cancel the allocation of a primary shard then the allow_primary flag must also be included in the request.' move: allOf: - $ref: '#/components/schemas/cluster.reroute.CommandMoveAction' description: 'Move a started shard from one node to another node. Accepts index and shard for index name and shard number, from_node for the node to move the shard from, and to_node for the node to move the shard to.' allocate_replica: allOf: - $ref: '#/components/schemas/cluster.reroute.CommandAllocateReplicaAction' description: 'Allocate an unassigned replica shard to a node. Accepts index and shard for index name and shard number, and node to allocate the shard to. Takes allocation deciders into account.' allocate_stale_primary: allOf: - $ref: '#/components/schemas/cluster.reroute.CommandAllocatePrimaryAction' description: 'Allocate a primary shard to a node that holds a stale copy. Accepts the index and shard for index name and shard number, and node to allocate the shard to. Using this command may lead to data loss for the provided shard id. If a node which has the good copy of the data rejoins the cluster later on, that data will be deleted or overwritten with the data of the stale copy that was forcefully allocated with this command. To ensure that these implications are well-understood, this command requires the flag accept_data_loss to be explicitly set to true.' allocate_empty_primary: allOf: - $ref: '#/components/schemas/cluster.reroute.CommandAllocatePrimaryAction' description: 'Allocate an empty primary shard to a node. Accepts the index and shard for index name and shard number, and node to allocate the shard to. Using this command leads to a complete loss of all data that was indexed into this shard, if it was previously started. If a node which has a copy of the data rejoins the cluster later on, that data will be deleted. To ensure that these implications are well-understood, this command requires the flag accept_data_loss to be explicitly set to true.' cluster.reroute.CommandCancelAction: required: - index - shard - node type: object properties: index: allOf: - $ref: '#/components/schemas/_types.IndexName' shard: type: number node: type: string allow_primary: type: boolean cluster.reroute.CommandMoveAction: required: - index - shard - from_node - to_node type: object properties: index: allOf: - $ref: '#/components/schemas/_types.IndexName' shard: type: number from_node: type: string description: The node to move the shard from to_node: type: string description: The node to move the shard to cluster.reroute.CommandAllocateReplicaAction: required: - index - shard - node type: object properties: index: allOf: - $ref: '#/components/schemas/_types.IndexName' shard: type: number node: type: string cluster.reroute.CommandAllocatePrimaryAction: required: - index - shard - node - accept_data_loss type: object properties: index: allOf: - $ref: '#/components/schemas/_types.IndexName' shard: type: number node: type: string accept_data_loss: type: boolean description: 'If a node which has a copy of the data rejoins the cluster later on, that data will be deleted. To ensure that these implications are well-understood, this command requires the flag accept_data_loss to be explicitly set to true' cluster.reroute.RerouteExplanation: required: - command - decisions - parameters type: object properties: command: type: string decisions: type: array items: $ref: '#/components/schemas/cluster.reroute.RerouteDecision' parameters: allOf: - $ref: '#/components/schemas/cluster.reroute.RerouteParameters' cluster.reroute.RerouteDecision: required: - decider - decision - explanation type: object properties: decider: type: string decision: type: string explanation: type: string cluster.reroute.RerouteParameters: required: - allow_primary - index - node - shard type: object properties: allow_primary: type: boolean index: allOf: - $ref: '#/components/schemas/_types.IndexName' node: allOf: - $ref: '#/components/schemas/_types.NodeName' shard: type: number from_node: allOf: - $ref: '#/components/schemas/_types.NodeName' to_node: allOf: - $ref: '#/components/schemas/_types.NodeName' _types.NodeName: type: string cluster.state.ClusterStateMetrics: oneOf: - $ref: '#/components/schemas/cluster.state.ClusterStateMetric' - type: array items: $ref: '#/components/schemas/cluster.state.ClusterStateMetric' cluster.state.ClusterStateMetric: enum: - _all - version - master_node - blocks - nodes - metadata - routing_table - routing_nodes - customs type: string cluster.stats.StatsResponseBase: allOf: - $ref: '#/components/schemas/nodes._types.NodesResponseBase' - required: - cluster_name - cluster_uuid - indices - nodes - repositories - snapshots - timestamp - ccs type: object properties: cluster_name: allOf: - $ref: '#/components/schemas/_types.Name' description: 'Name of the cluster, based on the cluster name setting.' cluster_uuid: allOf: - $ref: '#/components/schemas/_types.Uuid' description: Unique identifier for the cluster. indices: allOf: - $ref: '#/components/schemas/cluster.stats.ClusterIndices' description: Contains statistics about indices with shards assigned to selected nodes. nodes: allOf: - $ref: '#/components/schemas/cluster.stats.ClusterNodes' description: Contains statistics about nodes selected by the request’s node filters. repositories: type: object additionalProperties: type: object additionalProperties: type: number description: Contains stats on repository feature usage exposed in cluster stats for telemetry. snapshots: allOf: - $ref: '#/components/schemas/cluster.stats.ClusterSnapshotStats' description: Contains stats cluster snapshots. status: allOf: - $ref: '#/components/schemas/_types.HealthStatus' description: "Health status of the cluster, based on the state of its primary and replica shards.\n\nSupported values include:\n - `green` (or `GREEN`): All shards are assigned.\n - `yellow` (or `YELLOW`): All primary shards are assigned, but one or more replica shards are unassigned. If a node in the cluster fails, some data could be unavailable until that node is repaired.\n - `red` (or `RED`): One or more primary shards are unassigned, so some data is unavailable. This can occur briefly during cluster startup as primary shards are assigned.\n - `unknown`\n - `unavailable`\n\n" timestamp: type: number description: 'Unix timestamp, in milliseconds, for the last time the cluster statistics were refreshed.' ccs: allOf: - $ref: '#/components/schemas/cluster.stats.CCSStats' description: Cross-cluster stats cluster.stats.ClusterIndices: required: - completion - count - docs - fielddata - query_cache - search - segments - shards - store - dense_vector - sparse_vector type: object properties: analysis: allOf: - $ref: '#/components/schemas/cluster.stats.CharFilterTypes' description: Contains statistics about analyzers and analyzer components used in selected nodes. completion: allOf: - $ref: '#/components/schemas/_types.CompletionStats' description: Contains statistics about memory used for completion in selected nodes. count: type: number description: Total number of indices with shards assigned to selected nodes. docs: allOf: - $ref: '#/components/schemas/_types.DocStats' description: Contains counts for documents in selected nodes. fielddata: allOf: - $ref: '#/components/schemas/_types.FielddataStats' description: Contains statistics about the field data cache of selected nodes. query_cache: allOf: - $ref: '#/components/schemas/_types.QueryCacheStats' description: Contains statistics about the query cache of selected nodes. search: allOf: - $ref: '#/components/schemas/cluster.stats.SearchUsageStats' description: "Holds a snapshot of the search usage statistics.\nUsed to hold the stats for a single node that's part of a ClusterStatsNodeResponse, as well as to\naccumulate stats for the entire cluster and return them as part of the ClusterStatsResponse." segments: allOf: - $ref: '#/components/schemas/_types.SegmentsStats' description: Contains statistics about segments in selected nodes. shards: allOf: - $ref: '#/components/schemas/cluster.stats.ClusterIndicesShards' description: Contains statistics about indices with shards assigned to selected nodes. store: allOf: - $ref: '#/components/schemas/_types.StoreStats' description: Contains statistics about the size of shards assigned to selected nodes. mappings: allOf: - $ref: '#/components/schemas/cluster.stats.FieldTypesMappings' description: Contains statistics about field mappings in selected nodes. versions: type: array items: $ref: '#/components/schemas/cluster.stats.IndicesVersions' description: Contains statistics about analyzers and analyzer components used in selected nodes. dense_vector: allOf: - $ref: '#/components/schemas/cluster.stats.DenseVectorStats' description: Contains statistics about indexed dense vector sparse_vector: allOf: - $ref: '#/components/schemas/cluster.stats.SparseVectorStats' description: Contains statistics about indexed sparse vector cluster.stats.CharFilterTypes: required: - analyzer_types - built_in_analyzers - built_in_char_filters - built_in_filters - built_in_tokenizers - char_filter_types - filter_types - tokenizer_types - synonyms type: object properties: analyzer_types: type: array items: $ref: '#/components/schemas/cluster.stats.FieldTypes' description: Contains statistics about analyzer types used in selected nodes. built_in_analyzers: type: array items: $ref: '#/components/schemas/cluster.stats.FieldTypes' description: Contains statistics about built-in analyzers used in selected nodes. built_in_char_filters: type: array items: $ref: '#/components/schemas/cluster.stats.FieldTypes' description: Contains statistics about built-in character filters used in selected nodes. built_in_filters: type: array items: $ref: '#/components/schemas/cluster.stats.FieldTypes' description: Contains statistics about built-in token filters used in selected nodes. built_in_tokenizers: type: array items: $ref: '#/components/schemas/cluster.stats.FieldTypes' description: Contains statistics about built-in tokenizers used in selected nodes. char_filter_types: type: array items: $ref: '#/components/schemas/cluster.stats.FieldTypes' description: Contains statistics about character filter types used in selected nodes. multiple_synonym_graph_filters: allOf: - $ref: '#/components/schemas/cluster.stats.MultipleSynonymGraphFilter' filter_types: type: array items: $ref: '#/components/schemas/cluster.stats.FieldTypes' description: Contains statistics about token filter types used in selected nodes. tokenizer_types: type: array items: $ref: '#/components/schemas/cluster.stats.FieldTypes' description: Contains statistics about tokenizer types used in selected nodes. synonyms: type: object additionalProperties: $ref: '#/components/schemas/cluster.stats.SynonymsStats' description: Contains statistics about synonyms types used in selected nodes. cluster.stats.FieldTypes: required: - name - count - index_count type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' description: The name for the field type in selected nodes. count: type: number description: The number of occurrences of the field type in selected nodes. index_count: type: number description: The number of indices containing the field type in selected nodes. indexed_vector_count: type: number description: 'For dense_vector field types, number of indexed vector types in selected nodes.' indexed_vector_dim_max: type: number description: 'For dense_vector field types, the maximum dimension of all indexed vector types in selected nodes.' indexed_vector_dim_min: type: number description: 'For dense_vector field types, the minimum dimension of all indexed vector types in selected nodes.' script_count: type: number description: The number of fields that declare a script. x-state: Generally available; Added in 7.13.0 vector_index_type_count: type: object additionalProperties: type: number description: 'For dense_vector field types, count of mappings by index type' vector_similarity_type_count: type: object additionalProperties: type: number description: 'For dense_vector field types, count of mappings by similarity' vector_element_type_count: type: object additionalProperties: type: number description: 'For dense_vector field types, count of mappings by element type' cluster.stats.MultipleSynonymGraphFilter: type: object properties: analyzer_count: type: number description: Number of analyzers across the cluster whose filter chain contains more than one synonym_graph filter. default: 0 index_count: type: number description: Number of indices that contain at least one analyzer with more than one synonym_graph filter. default: 0 cluster.stats.SynonymsStats: required: - count - index_count type: object properties: count: type: number index_count: type: number _types.CompletionStats: required: - size_in_bytes type: object properties: size_in_bytes: type: number description: 'Total amount, in bytes, of memory used for completion across all shards assigned to selected nodes.' size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Total amount of memory used for completion across all shards assigned to selected nodes. fields: type: object additionalProperties: $ref: '#/components/schemas/_types.FieldSizeUsage' _types.FieldSizeUsage: required: - size_in_bytes type: object properties: size: allOf: - $ref: '#/components/schemas/_types.ByteSize' size_in_bytes: type: number _types.DocStats: required: - count - total_size_in_bytes type: object properties: count: type: number description: "Total number of non-deleted documents across all primary shards assigned to selected nodes.\nThis number is based on documents in Lucene segments and may include documents from nested fields." deleted: type: number description: "Total number of deleted documents across all primary shards assigned to selected nodes.\nThis number is based on documents in Lucene segments.\nElasticsearch reclaims the disk space of deleted Lucene documents when a segment is merged." total_size_in_bytes: type: number description: "Returns the total size in bytes of all documents in this stats.\nThis value may be more reliable than store_stats.size_in_bytes in estimating the index size." total_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Human readable total_size_in_bytes _types.FielddataStats: required: - memory_size_in_bytes - global_ordinals type: object properties: evictions: type: number memory_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' memory_size_in_bytes: type: number fields: type: object additionalProperties: $ref: '#/components/schemas/_types.FieldMemoryUsage' global_ordinals: allOf: - $ref: '#/components/schemas/_types.GlobalOrdinalsStats' _types.FieldMemoryUsage: required: - memory_size_in_bytes type: object properties: memory_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' memory_size_in_bytes: type: number _types.GlobalOrdinalsStats: required: - build_time_in_millis type: object properties: build_time_in_millis: allOf: - $ref: '#/components/schemas/_types.UnitMillis' build_time: type: string fields: type: object additionalProperties: $ref: '#/components/schemas/_types.GlobalOrdinalFieldStats' _types.GlobalOrdinalFieldStats: required: - build_time_in_millis - shard_max_value_count type: object properties: build_time_in_millis: allOf: - $ref: '#/components/schemas/_types.UnitMillis' build_time: type: string shard_max_value_count: type: number _types.QueryCacheStats: required: - cache_count - cache_size - evictions - hit_count - memory_size_in_bytes - miss_count - total_count type: object properties: cache_count: type: number description: "Total number of entries added to the query cache across all shards assigned to selected nodes.\nThis number includes current and evicted entries." cache_size: type: number description: Total number of entries currently in the query cache across all shards assigned to selected nodes. evictions: type: number description: Total number of query cache evictions across all shards assigned to selected nodes. hit_count: type: number description: Total count of query cache hits across all shards assigned to selected nodes. memory_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Total amount of memory used for the query cache across all shards assigned to selected nodes. memory_size_in_bytes: type: number description: 'Total amount, in bytes, of memory used for the query cache across all shards assigned to selected nodes.' miss_count: type: number description: Total count of query cache misses across all shards assigned to selected nodes. total_count: type: number description: Total count of hits and misses in the query cache across all shards assigned to selected nodes. cluster.stats.SearchUsageStats: required: - total - queries - rescorers - sections - retrievers - extended type: object properties: total: type: number queries: type: object additionalProperties: type: number rescorers: type: object additionalProperties: type: number sections: type: object additionalProperties: type: number retrievers: type: object additionalProperties: type: number extended: allOf: - $ref: '#/components/schemas/cluster.stats.ExtendedSearchUsage' cluster.stats.ExtendedSearchUsage: type: object properties: retrievers: allOf: - $ref: '#/components/schemas/cluster.stats.ExtendedRetrieversSearchUsage' section: allOf: - $ref: '#/components/schemas/cluster.stats.ExtendedSectionSearchUsage' cluster.stats.ExtendedRetrieversSearchUsage: type: object properties: text_similarity_reranker: allOf: - $ref: '#/components/schemas/cluster.stats.ExtendedTextSimilarityRetrieverUsage' cluster.stats.ExtendedTextSimilarityRetrieverUsage: type: object properties: chunk_rescorer: type: number cluster.stats.ExtendedSectionSearchUsage: type: object properties: sort: type: object additionalProperties: type: number _types.SegmentsStats: required: - count - doc_values_memory_in_bytes - file_sizes - fixed_bit_set_memory_in_bytes - index_writer_memory_in_bytes - max_unsafe_auto_id_timestamp - memory_in_bytes - norms_memory_in_bytes - points_memory_in_bytes - stored_fields_memory_in_bytes - terms_memory_in_bytes - term_vectors_memory_in_bytes - version_map_memory_in_bytes type: object properties: count: type: number description: Total number of segments across all shards assigned to selected nodes. doc_values_memory: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Total amount of memory used for doc values across all shards assigned to selected nodes. doc_values_memory_in_bytes: type: number description: 'Total amount, in bytes, of memory used for doc values across all shards assigned to selected nodes.' file_sizes: type: object additionalProperties: $ref: '#/components/schemas/indices.stats.ShardFileSizeInfo' description: "This object is not populated by the cluster stats API.\nTo get information on segment files, use the node stats API." fixed_bit_set: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "Total amount of memory used by fixed bit sets across all shards assigned to selected nodes.\nFixed bit sets are used for nested object field types and type filters for join fields." fixed_bit_set_memory_in_bytes: type: number description: 'Total amount of memory, in bytes, used by fixed bit sets across all shards assigned to selected nodes.' index_writer_memory: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Total amount of memory used by all index writers across all shards assigned to selected nodes. index_writer_memory_in_bytes: type: number description: 'Total amount, in bytes, of memory used by all index writers across all shards assigned to selected nodes.' max_unsafe_auto_id_timestamp: type: number description: 'Unix timestamp, in milliseconds, of the most recently retried indexing request.' memory: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Total amount of memory used for segments across all shards assigned to selected nodes. memory_in_bytes: type: number description: 'Total amount, in bytes, of memory used for segments across all shards assigned to selected nodes.' norms_memory: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Total amount of memory used for normalization factors across all shards assigned to selected nodes. norms_memory_in_bytes: type: number description: 'Total amount, in bytes, of memory used for normalization factors across all shards assigned to selected nodes.' points_memory: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Total amount of memory used for points across all shards assigned to selected nodes. points_memory_in_bytes: type: number description: 'Total amount, in bytes, of memory used for points across all shards assigned to selected nodes.' stored_fields_memory_in_bytes: type: number description: 'Total amount, in bytes, of memory used for stored fields across all shards assigned to selected nodes.' stored_fields_memory: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Total amount of memory used for stored fields across all shards assigned to selected nodes. terms_memory_in_bytes: type: number description: 'Total amount, in bytes, of memory used for terms across all shards assigned to selected nodes.' terms_memory: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Total amount of memory used for terms across all shards assigned to selected nodes. term_vectors_memory: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Total amount of memory used for term vectors across all shards assigned to selected nodes. term_vectors_memory_in_bytes: type: number description: 'Total amount, in bytes, of memory used for term vectors across all shards assigned to selected nodes.' version_map_memory: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Total amount of memory used by all version maps across all shards assigned to selected nodes. version_map_memory_in_bytes: type: number description: 'Total amount, in bytes, of memory used by all version maps across all shards assigned to selected nodes.' indices.stats.ShardFileSizeInfo: required: - description - size_in_bytes type: object properties: description: type: string size_in_bytes: type: number min_size_in_bytes: type: number max_size_in_bytes: type: number average_size_in_bytes: type: number count: type: number cluster.stats.ClusterIndicesShards: type: object properties: index: allOf: - $ref: '#/components/schemas/cluster.stats.ClusterIndicesShardsIndex' description: Contains statistics about shards assigned to selected nodes. primaries: type: number description: Number of primary shards assigned to selected nodes. replication: type: number description: Ratio of replica shards to primary shards across all selected nodes. total: type: number description: Total number of shards assigned to selected nodes. description: Contains statistics about shards assigned to selected nodes. cluster.stats.ClusterIndicesShardsIndex: required: - primaries - replication - shards type: object properties: primaries: allOf: - $ref: '#/components/schemas/cluster.stats.ClusterShardMetrics' description: Contains statistics about the number of primary shards assigned to selected nodes. replication: allOf: - $ref: '#/components/schemas/cluster.stats.ClusterShardMetrics' description: Contains statistics about the number of replication shards assigned to selected nodes. shards: allOf: - $ref: '#/components/schemas/cluster.stats.ClusterShardMetrics' description: Contains statistics about the number of shards assigned to selected nodes. cluster.stats.ClusterShardMetrics: required: - avg - max - min type: object properties: avg: type: number description: 'Mean number of shards in an index, counting only shards assigned to selected nodes.' max: type: number description: 'Maximum number of shards in an index, counting only shards assigned to selected nodes.' min: type: number description: 'Minimum number of shards in an index, counting only shards assigned to selected nodes.' _types.StoreStats: required: - size_in_bytes - reserved_in_bytes type: object properties: size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Total size of all shards assigned to selected nodes. size_in_bytes: type: number description: 'Total size, in bytes, of all shards assigned to selected nodes.' reserved: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: 'A prediction of how much larger the shard stores will eventually grow due to ongoing peer recoveries, restoring snapshots, and similar activities.' reserved_in_bytes: type: number description: 'A prediction, in bytes, of how much larger the shard stores will eventually grow due to ongoing peer recoveries, restoring snapshots, and similar activities.' total_data_set_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "Total data set size of all shards assigned to selected nodes.\nThis includes the size of shards not stored fully on the nodes, such as the cache for partially mounted indices." total_data_set_size_in_bytes: type: number description: "Total data set size, in bytes, of all shards assigned to selected nodes.\nThis includes the size of shards not stored fully on the nodes, such as the cache for partially mounted indices." cluster.stats.FieldTypesMappings: required: - field_types - runtime_field_types - source_modes type: object properties: field_types: type: array items: $ref: '#/components/schemas/cluster.stats.FieldTypes' description: Contains statistics about field data types used in selected nodes. runtime_field_types: type: array items: $ref: '#/components/schemas/cluster.stats.RuntimeFieldTypes' description: Contains statistics about runtime field data types used in selected nodes. total_field_count: type: number description: Total number of fields in all non-system indices. total_deduplicated_field_count: type: number description: 'Total number of fields in all non-system indices, accounting for mapping deduplication.' total_deduplicated_mapping_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Total size of all mappings after deduplication and compression. total_deduplicated_mapping_size_in_bytes: type: number description: 'Total size of all mappings, in bytes, after deduplication and compression.' source_modes: type: object additionalProperties: type: number description: Source mode usage count. cluster.stats.RuntimeFieldTypes: required: - chars_max - chars_total - count - doc_max - doc_total - index_count - lang - lines_max - lines_total - name - scriptless_count - shadowed_count - source_max - source_total type: object properties: chars_max: type: number description: Maximum number of characters for a single runtime field script. chars_total: type: number description: Total number of characters for the scripts that define the current runtime field data type. count: type: number description: Number of runtime fields mapped to the field data type in selected nodes. doc_max: type: number description: Maximum number of accesses to doc_values for a single runtime field script doc_total: type: number description: Total number of accesses to doc_values for the scripts that define the current runtime field data type. index_count: type: number description: Number of indices containing a mapping of the runtime field data type in selected nodes. lang: type: array items: type: string description: Script languages used for the runtime fields scripts. lines_max: type: number description: Maximum number of lines for a single runtime field script. lines_total: type: number description: Total number of lines for the scripts that define the current runtime field data type. name: allOf: - $ref: '#/components/schemas/_types.Name' description: Field data type used in selected nodes. scriptless_count: type: number description: Number of runtime fields that don’t declare a script. shadowed_count: type: number description: Number of runtime fields that shadow an indexed field. source_max: type: number description: Maximum number of accesses to _source for a single runtime field script. source_total: type: number description: Total number of accesses to _source for the scripts that define the current runtime field data type. cluster.stats.IndicesVersions: required: - index_count - primary_shard_count - total_primary_bytes - version type: object properties: index_count: type: number primary_shard_count: type: number total_primary_bytes: type: number total_primary_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' version: allOf: - $ref: '#/components/schemas/_types.VersionString' cluster.stats.DenseVectorStats: required: - value_count type: object properties: value_count: type: number off_heap: allOf: - $ref: '#/components/schemas/cluster.stats.DenseVectorOffHeapStats' cluster.stats.DenseVectorOffHeapStats: required: - total_size_bytes - total_veb_size_bytes - total_vec_size_bytes - total_veq_size_bytes - total_vex_size_bytes - total_cenivf_size_bytes - total_clivf_size_bytes type: object properties: total_size_bytes: type: number total_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' total_veb_size_bytes: type: number total_veb_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' total_vec_size_bytes: type: number total_vec_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' total_veq_size_bytes: type: number total_veq_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' total_vex_size_bytes: type: number total_vex_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' total_cenivf_size_bytes: type: number total_cenivf_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' total_clivf_size_bytes: type: number total_clivf_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' fielddata: type: object additionalProperties: $ref: '#/components/schemas/cluster.stats.DenseVectorFieldOffHeapStats' cluster.stats.DenseVectorFieldOffHeapStats: type: object properties: auto_calibration: type: array items: $ref: '#/components/schemas/cluster.stats.DenseVectorAutoCalibration' description: "The auto-calibration information of the field, aggregated by distinct set of parameters.\nOnly returned when `include_auto_calibration` is `true`." x-state: Generally available; Added in 9.6.0 description: The off-heap stats of a `dense_vector` field. cluster.stats.DenseVectorAutoCalibration: oneOf: - $ref: '#/components/schemas/cluster.stats.OsqDenseVectorAutoCalibration' description: "The auto-calibration information of a `dense_vector` field, aggregated over the segments that share the same parameters.\n\nThe shape of `parameters` depends on the quantization method of the field." discriminator: propertyName: type mapping: osq: '#/components/schemas/cluster.stats.OsqDenseVectorAutoCalibration' cluster.stats.OsqDenseVectorAutoCalibration: allOf: - $ref: '#/components/schemas/cluster.stats.DenseVectorAutoCalibrationBase' - required: - type type: object properties: type: enum: - osq type: string parameters: allOf: - $ref: '#/components/schemas/indices.segments.OsqSegmentAutoCalibrationParameters' description: The calibration parameters. indices.segments.OsqSegmentAutoCalibrationParameters: required: - bits - query_bits - precondition - oversample type: object properties: bits: type: number description: The number of bits used to quantize the vectors. query_bits: type: number description: The number of bits used to quantize the query vectors. precondition: type: boolean description: 'If `true`, the vectors are preconditioned before quantization.' oversample: type: number description: The oversampling factor applied when rescoring. cluster.stats.DenseVectorAutoCalibrationBase: allOf: - $ref: '#/components/schemas/indices.segments.SegmentAutoCalibrationBase' - required: - number_of_segments type: object properties: number_of_segments: type: number description: The number of segments that share these parameters. indices.segments.SegmentAutoCalibrationBase: required: - calibrated - number_of_vectors - size_in_bytes type: object properties: calibrated: type: boolean description: 'If `true`, the segment has been calibrated, and `parameters` is present.' number_of_vectors: type: number description: The number of vectors of the field in the segment. size: allOf: - $ref: '#/components/schemas/_types.ByteSize' size_in_bytes: type: number description: 'The size of the vectors of the field in the segment, in bytes.' cluster.stats.SparseVectorStats: required: - value_count type: object properties: value_count: type: number cluster.stats.ClusterNodes: required: - count - discovery_types - fs - indexing_pressure - ingest - jvm - network_types - os - packaging_types - plugins - process - versions type: object properties: count: allOf: - $ref: '#/components/schemas/cluster.stats.ClusterNodeCount' description: Contains counts for nodes selected by the request’s node filters. discovery_types: type: object additionalProperties: type: number description: Contains statistics about the discovery types used by selected nodes. fs: allOf: - $ref: '#/components/schemas/cluster.stats.ClusterFileSystem' description: Contains statistics about file stores by selected nodes. indexing_pressure: allOf: - $ref: '#/components/schemas/cluster.stats.IndexingPressure' x-state: Generally available; Added in 7.16.0 ingest: allOf: - $ref: '#/components/schemas/cluster.stats.ClusterIngest' jvm: allOf: - $ref: '#/components/schemas/cluster.stats.ClusterJvm' description: Contains statistics about the Java Virtual Machines (JVMs) used by selected nodes. network_types: allOf: - $ref: '#/components/schemas/cluster.stats.ClusterNetworkTypes' description: Contains statistics about the transport and HTTP networks used by selected nodes. os: allOf: - $ref: '#/components/schemas/cluster.stats.ClusterOperatingSystem' description: Contains statistics about the operating systems used by selected nodes. packaging_types: type: array items: $ref: '#/components/schemas/cluster.stats.NodePackagingType' description: Contains statistics about Elasticsearch distributions installed on selected nodes. plugins: type: array items: $ref: '#/components/schemas/_types.PluginStats' description: "Contains statistics about installed plugins and modules by selected nodes.\nIf no plugins or modules are installed, this array is empty." process: allOf: - $ref: '#/components/schemas/cluster.stats.ClusterProcess' description: Contains statistics about processes used by selected nodes. versions: type: array items: $ref: '#/components/schemas/_types.VersionString' description: Array of Elasticsearch versions used on selected nodes. cluster.stats.ClusterNodeCount: required: - total type: object properties: total: type: number coordinating_only: type: number data: type: number data_cold: type: number data_content: type: number data_frozen: type: number x-state: Generally available; Added in 7.13.0 data_hot: type: number data_warm: type: number index: type: number ingest: type: number master: type: number ml: type: number remote_cluster_client: type: number search: type: number transform: type: number voting_only: type: number cluster.stats.ClusterFileSystem: type: object properties: path: type: string mount: type: string type: type: string available_in_bytes: type: number description: "Total number of bytes available to JVM in file stores across all selected nodes.\nDepending on operating system or process-level restrictions, this number may be less than `nodes.fs.free_in_byes`.\nThis is the actual amount of free disk space the selected Elasticsearch nodes can use." available: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "Total number of bytes available to JVM in file stores across all selected nodes.\nDepending on operating system or process-level restrictions, this number may be less than `nodes.fs.free_in_byes`.\nThis is the actual amount of free disk space the selected Elasticsearch nodes can use." free_in_bytes: type: number description: 'Total number, in bytes, of unallocated bytes in file stores across all selected nodes.' free: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Total number of unallocated bytes in file stores across all selected nodes. total_in_bytes: type: number description: 'Total size, in bytes, of all file stores across all selected nodes.' total: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Total size of all file stores across all selected nodes. low_watermark_free_space: allOf: - $ref: '#/components/schemas/_types.ByteSize' low_watermark_free_space_in_bytes: type: number high_watermark_free_space: allOf: - $ref: '#/components/schemas/_types.ByteSize' high_watermark_free_space_in_bytes: type: number flood_stage_free_space: allOf: - $ref: '#/components/schemas/_types.ByteSize' flood_stage_free_space_in_bytes: type: number frozen_flood_stage_free_space: allOf: - $ref: '#/components/schemas/_types.ByteSize' frozen_flood_stage_free_space_in_bytes: type: number cluster.stats.IndexingPressure: required: - memory type: object properties: memory: allOf: - $ref: '#/components/schemas/nodes._types.IndexingPressureMemory' nodes._types.IndexingPressureMemory: type: object properties: limit: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "Configured memory limit for the indexing requests.\nReplica requests have an automatic limit that is 1.5x this value." limit_in_bytes: type: number description: "Configured memory limit, in bytes, for the indexing requests.\nReplica requests have an automatic limit that is 1.5x this value." current: allOf: - $ref: '#/components/schemas/nodes._types.PressureMemory' description: Contains statistics for current indexing load. total: allOf: - $ref: '#/components/schemas/nodes._types.PressureMemory' description: Contains statistics for the cumulative indexing load since the node started. nodes._types.PressureMemory: type: object properties: all: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: 'Memory consumed by indexing requests in the coordinating, primary, or replica stage.' all_in_bytes: type: number description: 'Memory consumed, in bytes, by indexing requests in the coordinating, primary, or replica stage.' combined_coordinating_and_primary: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "Memory consumed by indexing requests in the coordinating or primary stage.\nThis value is not the sum of coordinating and primary as a node can reuse the coordinating memory if the primary stage is executed locally." combined_coordinating_and_primary_in_bytes: type: number description: "Memory consumed, in bytes, by indexing requests in the coordinating or primary stage.\nThis value is not the sum of coordinating and primary as a node can reuse the coordinating memory if the primary stage is executed locally." coordinating: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Memory consumed by indexing requests in the coordinating stage. coordinating_in_bytes: type: number description: 'Memory consumed, in bytes, by indexing requests in the coordinating stage.' primary: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Memory consumed by indexing requests in the primary stage. primary_in_bytes: type: number description: 'Memory consumed, in bytes, by indexing requests in the primary stage.' replica: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Memory consumed by indexing requests in the replica stage. replica_in_bytes: type: number description: 'Memory consumed, in bytes, by indexing requests in the replica stage.' coordinating_rejections: type: number description: Number of indexing requests rejected in the coordinating stage. primary_rejections: type: number description: Number of indexing requests rejected in the primary stage. replica_rejections: type: number description: Number of indexing requests rejected in the replica stage. primary_document_rejections: type: number large_operation_rejections: type: number cluster.stats.ClusterIngest: required: - number_of_pipelines - processor_stats type: object properties: number_of_pipelines: type: number processor_stats: type: object additionalProperties: $ref: '#/components/schemas/cluster.stats.ClusterProcessor' cluster.stats.ClusterProcessor: required: - count - current - failed - time_in_millis type: object properties: count: type: number current: type: number failed: type: number time: allOf: - $ref: '#/components/schemas/_types.Duration' time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' cluster.stats.ClusterJvm: required: - max_uptime_in_millis - mem - threads - versions type: object properties: max_uptime_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: 'Uptime duration, in milliseconds, since JVM last started.' max_uptime: allOf: - $ref: '#/components/schemas/_types.Duration' description: Uptime duration since JVM last started. mem: allOf: - $ref: '#/components/schemas/cluster.stats.ClusterJvmMemory' description: Contains statistics about memory used by selected nodes. threads: type: number description: Number of active threads in use by JVM across all selected nodes. versions: type: array items: $ref: '#/components/schemas/cluster.stats.ClusterJvmVersion' description: Contains statistics about the JVM versions used by selected nodes. cluster.stats.ClusterJvmMemory: required: - heap_max_in_bytes - heap_used_in_bytes type: object properties: heap_max_in_bytes: type: number description: 'Maximum amount of memory, in bytes, available for use by the heap across all selected nodes.' heap_max: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Maximum amount of memory available for use by the heap across all selected nodes. heap_used_in_bytes: type: number description: 'Memory, in bytes, currently in use by the heap across all selected nodes.' heap_used: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Memory currently in use by the heap across all selected nodes. cluster.stats.ClusterJvmVersion: required: - bundled_jdk - count - using_bundled_jdk - version - vm_name - vm_vendor - vm_version type: object properties: bundled_jdk: type: boolean description: Always `true`. All distributions come with a bundled Java Development Kit (JDK). count: type: number description: Total number of selected nodes using JVM. using_bundled_jdk: type: boolean description: 'If `true`, a bundled JDK is in use by JVM.' version: allOf: - $ref: '#/components/schemas/_types.VersionString' description: Version of JVM used by one or more selected nodes. vm_name: type: string description: Name of the JVM. vm_vendor: type: string description: Vendor of the JVM. vm_version: allOf: - $ref: '#/components/schemas/_types.VersionString' description: "Full version number of JVM.\nThe full version number includes a plus sign (+) followed by the build number." cluster.stats.ClusterNetworkTypes: required: - http_types - transport_types type: object properties: http_types: type: object additionalProperties: type: number description: Contains statistics about the HTTP network types used by selected nodes. transport_types: type: object additionalProperties: type: number description: Contains statistics about the transport network types used by selected nodes. cluster.stats.ClusterOperatingSystem: required: - allocated_processors - available_processors - mem - names - pretty_names type: object properties: allocated_processors: type: number description: "Number of processors used to calculate thread pool size across all selected nodes.\nThis number can be set with the processors setting of a node and defaults to the number of processors reported by the operating system.\nIn both cases, this number will never be larger than 32." architectures: type: array items: $ref: '#/components/schemas/cluster.stats.ClusterOperatingSystemArchitecture' description: 'Contains statistics about processor architectures (for example, x86_64 or aarch64) used by selected nodes.' available_processors: type: number description: Number of processors available to JVM across all selected nodes. mem: allOf: - $ref: '#/components/schemas/cluster.stats.OperatingSystemMemoryInfo' description: Contains statistics about memory used by selected nodes. names: type: array items: $ref: '#/components/schemas/cluster.stats.ClusterOperatingSystemName' description: Contains statistics about operating systems used by selected nodes. pretty_names: type: array items: $ref: '#/components/schemas/cluster.stats.ClusterOperatingSystemPrettyName' description: Contains statistics about operating systems used by selected nodes. cluster.stats.ClusterOperatingSystemArchitecture: required: - arch - count type: object properties: arch: type: string description: Name of an architecture used by one or more selected nodes. count: type: number description: Number of selected nodes using the architecture. cluster.stats.OperatingSystemMemoryInfo: required: - free_in_bytes - free_percent - total_in_bytes - used_in_bytes - used_percent type: object properties: adjusted_total_in_bytes: type: number description: 'Total amount, in bytes, of memory across all selected nodes, but using the value specified using the `es.total_memory_bytes` system property instead of measured total memory for those nodes where that system property was set.' x-state: Generally available; Added in 7.16.0 adjusted_total: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: 'Total amount of memory across all selected nodes, but using the value specified using the `es.total_memory_bytes` system property instead of measured total memory for those nodes where that system property was set.' x-state: Generally available; Added in 7.16.0 free_in_bytes: type: number description: 'Amount, in bytes, of free physical memory across all selected nodes.' free: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Amount of free physical memory across all selected nodes. free_percent: type: number description: Percentage of free physical memory across all selected nodes. total_in_bytes: type: number description: 'Total amount, in bytes, of physical memory across all selected nodes.' total: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Total amount of physical memory across all selected nodes. used_in_bytes: type: number description: 'Amount, in bytes, of physical memory in use across all selected nodes.' used: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Amount of physical memory in use across all selected nodes. used_percent: type: number description: Percentage of physical memory in use across all selected nodes. cluster.stats.ClusterOperatingSystemName: required: - count - name type: object properties: count: type: number description: Number of selected nodes using the operating system. name: allOf: - $ref: '#/components/schemas/_types.Name' description: Name of an operating system used by one or more selected nodes. cluster.stats.ClusterOperatingSystemPrettyName: required: - count - pretty_name type: object properties: count: type: number description: Number of selected nodes using the operating system. pretty_name: allOf: - $ref: '#/components/schemas/_types.Name' description: Human-readable name of an operating system used by one or more selected nodes. cluster.stats.NodePackagingType: required: - count - flavor - type type: object properties: count: type: number description: Number of selected nodes using the distribution flavor and file type. flavor: type: string description: Type of Elasticsearch distribution. This is always `default`. type: type: string description: File type (such as `tar` or `zip`) used for the distribution package. _types.PluginStats: required: - classname - description - elasticsearch_version - extended_plugins - has_native_controller - java_version - name - version - licensed - native_controller_enabled_settings type: object properties: classname: type: string description: type: string elasticsearch_version: allOf: - $ref: '#/components/schemas/_types.VersionString' extended_plugins: type: array items: type: string has_native_controller: type: boolean java_version: allOf: - $ref: '#/components/schemas/_types.VersionString' name: allOf: - $ref: '#/components/schemas/_types.Name' version: allOf: - $ref: '#/components/schemas/_types.VersionString' licensed: type: boolean native_controller_enabled_settings: type: array items: type: string cluster.stats.ClusterProcess: required: - cpu - open_file_descriptors type: object properties: cpu: allOf: - $ref: '#/components/schemas/cluster.stats.ClusterProcessCpu' description: Contains statistics about CPU used by selected nodes. open_file_descriptors: allOf: - $ref: '#/components/schemas/cluster.stats.ClusterProcessOpenFileDescriptors' description: Contains statistics about open file descriptors in selected nodes. cluster.stats.ClusterProcessCpu: required: - percent type: object properties: percent: type: number description: "Percentage of CPU used across all selected nodes.\nReturns `-1` if not supported." cluster.stats.ClusterProcessOpenFileDescriptors: required: - avg - max - min type: object properties: avg: type: number description: "Average number of concurrently open file descriptors.\nReturns `-1` if not supported." max: type: number description: "Maximum number of concurrently open file descriptors allowed across all selected nodes.\nReturns `-1` if not supported." min: type: number description: "Minimum number of concurrently open file descriptors across all selected nodes.\nReturns -1 if not supported." cluster.stats.ClusterSnapshotStats: required: - current_counts - repositories type: object properties: current_counts: allOf: - $ref: '#/components/schemas/cluster.stats.SnapshotCurrentCounts' repositories: type: object additionalProperties: $ref: '#/components/schemas/cluster.stats.PerRepositoryStats' cluster.stats.SnapshotCurrentCounts: required: - snapshots - shard_snapshots - snapshot_deletions - concurrent_operations - cleanups type: object properties: snapshots: type: number description: Snapshots currently in progress shard_snapshots: type: number description: Incomplete shard snapshots snapshot_deletions: type: number description: Snapshots deletions in progress concurrent_operations: type: number description: Sum of snapshots and snapshot_deletions cleanups: type: number description: 'Cleanups in progress, not counted in concurrent_operations as they are not concurrent' cluster.stats.PerRepositoryStats: required: - type - oldest_start_time_millis - current_counts type: object properties: type: type: string oldest_start_time_millis: allOf: - $ref: '#/components/schemas/_types.UnitMillis' oldest_start_time: allOf: - $ref: '#/components/schemas/_types.DateFormat' current_counts: allOf: - $ref: '#/components/schemas/cluster.stats.RepositoryStatsCurrentCounts' cluster.stats.RepositoryStatsCurrentCounts: required: - snapshots - clones - finalizations - deletions - snapshot_deletions - active_deletions - shards type: object properties: snapshots: type: number clones: type: number finalizations: type: number deletions: type: number snapshot_deletions: type: number active_deletions: type: number shards: allOf: - $ref: '#/components/schemas/cluster.stats.RepositoryStatsShards' cluster.stats.RepositoryStatsShards: required: - total - complete - incomplete - states type: object properties: total: type: number complete: type: number incomplete: type: number states: type: object additionalProperties: type: number cluster.stats.CCSStats: required: - _search type: object properties: clusters: type: object additionalProperties: $ref: '#/components/schemas/cluster.stats.RemoteClusterInfo' description: "Contains remote cluster settings and metrics collected from them.\nThe keys are cluster names, and the values are per-cluster data.\nOnly present if `include_remotes` option is set to true." _search: allOf: - $ref: '#/components/schemas/cluster.stats.CCSUsageStats' description: Information about cross-cluster search usage. _esql: allOf: - $ref: '#/components/schemas/cluster.stats.CCSUsageStats' description: Information about ES|QL cross-cluster query usage. cluster.stats.RemoteClusterInfo: required: - cluster_uuid - mode - skip_unavailable - transport.compress - status - version - nodes_count - shards_count - indices_count - indices_total_size_in_bytes - max_heap_in_bytes - mem_total_in_bytes type: object properties: cluster_uuid: type: string description: The UUID of the remote cluster. mode: type: string description: The connection mode used to communicate with the remote cluster. skip_unavailable: type: boolean description: The `skip_unavailable` setting used for this remote cluster. transport.compress: type: string description: Transport compression setting used for this remote cluster. status: allOf: - $ref: '#/components/schemas/_types.HealthStatus' description: "Health status of the cluster, based on the state of its primary and replica shards.\n\nSupported values include:\n - `green` (or `GREEN`): All shards are assigned.\n - `yellow` (or `YELLOW`): All primary shards are assigned, but one or more replica shards are unassigned. If a node in the cluster fails, some data could be unavailable until that node is repaired.\n - `red` (or `RED`): One or more primary shards are unassigned, so some data is unavailable. This can occur briefly during cluster startup as primary shards are assigned.\n - `unknown`\n - `unavailable`\n\n" version: type: array items: $ref: '#/components/schemas/_types.VersionString' description: The list of Elasticsearch versions used by the nodes on the remote cluster. nodes_count: type: number description: The total count of nodes in the remote cluster. shards_count: type: number description: The total number of shards in the remote cluster. indices_count: type: number description: The total number of indices in the remote cluster. indices_total_size_in_bytes: type: number description: 'Total data set size, in bytes, of all shards assigned to selected nodes.' indices_total_size: type: string description: 'Total data set size of all shards assigned to selected nodes, as a human-readable string.' max_heap_in_bytes: type: number description: 'Maximum amount of memory, in bytes, available for use by the heap across the nodes of the remote cluster.' max_heap: type: string description: 'Maximum amount of memory available for use by the heap across the nodes of the remote cluster, as a human-readable string.' mem_total_in_bytes: type: number description: 'Total amount, in bytes, of physical memory across the nodes of the remote cluster.' mem_total: type: string description: 'Total amount of physical memory across the nodes of the remote cluster, as a human-readable string.' cluster.stats.CCSUsageStats: required: - total - success - skipped - took - remotes_per_search_max - remotes_per_search_avg - failure_reasons - features - clients - clusters type: object properties: total: type: number description: The total number of cross-cluster search requests that have been executed by the cluster. success: type: number description: The total number of cross-cluster search requests that have been successfully executed by the cluster. skipped: type: number description: The total number of cross-cluster search requests (successful or failed) that had at least one remote cluster skipped. took: allOf: - $ref: '#/components/schemas/cluster.stats.CCSUsageTimeValue' description: Statistics about the time taken to execute cross-cluster search requests. took_mrt_true: allOf: - $ref: '#/components/schemas/cluster.stats.CCSUsageTimeValue' description: Statistics about the time taken to execute cross-cluster search requests for which the `ccs_minimize_roundtrips` setting was set to `true`. took_mrt_false: allOf: - $ref: '#/components/schemas/cluster.stats.CCSUsageTimeValue' description: Statistics about the time taken to execute cross-cluster search requests for which the `ccs_minimize_roundtrips` setting was set to `false`. remotes_per_search_max: type: number description: The maximum number of remote clusters that were queried in a single cross-cluster search request. remotes_per_search_avg: type: number description: The average number of remote clusters that were queried in a single cross-cluster search request. failure_reasons: type: object additionalProperties: type: number description: Statistics about the reasons for cross-cluster search request failures. The keys are the failure reason names and the values are the number of requests that failed for that reason. features: type: object additionalProperties: type: number description: 'The keys are the names of the search feature, and the values are the number of requests that used that feature. Single request can use more than one feature (e.g. both `async` and `wildcard`).' clients: type: object additionalProperties: type: number description: 'Statistics about the clients that executed cross-cluster search requests. The keys are the names of the clients, and the values are the number of requests that were executed by that client. Only known clients (such as `kibana` or `elasticsearch`) are counted.' clusters: type: object additionalProperties: $ref: '#/components/schemas/cluster.stats.CCSUsageClusterStats' description: 'Statistics about the clusters that were queried in cross-cluster search requests. The keys are cluster names, and the values are per-cluster telemetry data. This also includes the local cluster itself, which uses the name `(local)`.' cluster.stats.CCSUsageTimeValue: required: - max - avg - p90 type: object properties: max: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: 'The maximum time taken to execute a request, in milliseconds.' avg: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: 'The average time taken to execute a request, in milliseconds.' p90: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: 'The 90th percentile of the time taken to execute requests, in milliseconds.' cluster.stats.CCSUsageClusterStats: required: - total - skipped - took type: object properties: total: type: number description: 'The total number of successful (not skipped) cross-cluster search requests that were executed against this cluster. This may include requests where partial results were returned, but not requests in which the cluster has been skipped entirely.' skipped: type: number description: The total number of cross-cluster search requests for which this cluster was skipped. took: allOf: - $ref: '#/components/schemas/cluster.stats.CCSUsageTimeValue' description: Statistics about the time taken to execute requests against this cluster. nodes._types.NodesResponseBase: type: object properties: _nodes: allOf: - $ref: '#/components/schemas/_types.NodeStatistics' description: Contains statistics about the number of nodes selected by the request’s node filters. _types.NodeStatistics: required: - total - successful - failed type: object properties: failures: type: array items: $ref: '#/components/schemas/_types.ErrorCause' total: type: number description: Total number of nodes selected by the request. successful: type: number description: Number of nodes that responded successfully to the request. failed: type: number description: 'Number of nodes that rejected the request or failed to respond. If this value is not 0, a reason for the rejection or failure is included in the response.' description: Contains statistics about the number of nodes selected by the request. _types.Result: enum: - created - updated - deleted - not_found - noop type: string connector._types.Connector: required: - configuration - custom_scheduling - deleted - filtering - is_native - scheduling - status - sync_now type: object properties: api_key_id: type: string api_key_secret_id: type: string configuration: allOf: - $ref: '#/components/schemas/connector._types.ConnectorConfiguration' custom_scheduling: allOf: - $ref: '#/components/schemas/connector._types.ConnectorCustomScheduling' deleted: type: boolean description: type: string error: oneOf: - type: string - type: - 'null' - string features: allOf: - $ref: '#/components/schemas/connector._types.ConnectorFeatures' filtering: type: array items: $ref: '#/components/schemas/connector._types.FilteringConfig' id: allOf: - $ref: '#/components/schemas/_types.Id' index_name: oneOf: - $ref: '#/components/schemas/_types.IndexName' - type: - 'null' - string is_native: type: boolean language: type: string last_access_control_sync_error: type: string last_access_control_sync_scheduled_at: allOf: - $ref: '#/components/schemas/_types.DateTime' last_access_control_sync_status: allOf: - $ref: '#/components/schemas/connector._types.SyncStatus' last_deleted_document_count: type: number last_incremental_sync_scheduled_at: allOf: - $ref: '#/components/schemas/_types.DateTime' last_indexed_document_count: type: number last_seen: allOf: - $ref: '#/components/schemas/_types.DateTime' last_sync_error: type: string last_sync_scheduled_at: allOf: - $ref: '#/components/schemas/_types.DateTime' last_sync_status: allOf: - $ref: '#/components/schemas/connector._types.SyncStatus' last_synced: allOf: - $ref: '#/components/schemas/_types.DateTime' name: type: string pipeline: allOf: - $ref: '#/components/schemas/connector._types.IngestPipelineParams' scheduling: allOf: - $ref: '#/components/schemas/connector._types.SchedulingConfiguration' service_type: type: string status: allOf: - $ref: '#/components/schemas/connector._types.ConnectorStatus' sync_cursor: type: object sync_now: type: boolean connector._types.ConnectorConfiguration: type: object additionalProperties: $ref: '#/components/schemas/connector._types.ConnectorConfigProperties' connector._types.ConnectorConfigProperties: required: - default_value - depends_on - display - label - options - required - sensitive - value type: object properties: category: type: string default_value: allOf: - $ref: '#/components/schemas/_types.ScalarValue' depends_on: type: array items: $ref: '#/components/schemas/connector._types.Dependency' display: allOf: - $ref: '#/components/schemas/connector._types.DisplayType' label: type: string options: type: array items: $ref: '#/components/schemas/connector._types.SelectOption' order: type: number placeholder: type: string required: type: boolean sensitive: type: boolean tooltip: oneOf: - type: string - type: - 'null' - string type: allOf: - $ref: '#/components/schemas/connector._types.ConnectorFieldType' ui_restrictions: type: array items: type: string validations: type: array items: $ref: '#/components/schemas/connector._types.Validation' value: type: object _types.ScalarValue: oneOf: - type: number - type: number - type: string - type: boolean - type: - 'null' - string description: A scalar value. connector._types.Dependency: required: - field - value type: object properties: field: type: string value: allOf: - $ref: '#/components/schemas/_types.ScalarValue' connector._types.DisplayType: enum: - textbox - textarea - numeric - toggle - dropdown type: string connector._types.SelectOption: required: - label - value type: object properties: label: type: string value: allOf: - $ref: '#/components/schemas/_types.ScalarValue' connector._types.ConnectorFieldType: enum: - str - int - list - bool type: string connector._types.Validation: oneOf: - $ref: '#/components/schemas/connector._types.LessThanValidation' - $ref: '#/components/schemas/connector._types.GreaterThanValidation' - $ref: '#/components/schemas/connector._types.ListTypeValidation' - $ref: '#/components/schemas/connector._types.IncludedInValidation' - $ref: '#/components/schemas/connector._types.RegexValidation' discriminator: propertyName: type mapping: greater_than: '#/components/schemas/connector._types.GreaterThanValidation' included_in: '#/components/schemas/connector._types.IncludedInValidation' less_than: '#/components/schemas/connector._types.LessThanValidation' list_type: '#/components/schemas/connector._types.ListTypeValidation' regex: '#/components/schemas/connector._types.RegexValidation' connector._types.LessThanValidation: required: - type - constraint type: object properties: type: enum: - less_than type: string constraint: type: number connector._types.GreaterThanValidation: required: - type - constraint type: object properties: type: enum: - greater_than type: string constraint: type: number connector._types.ListTypeValidation: required: - type - constraint type: object properties: type: enum: - list_type type: string constraint: type: string connector._types.IncludedInValidation: required: - type - constraint type: object properties: type: enum: - included_in type: string constraint: type: array items: $ref: '#/components/schemas/_types.ScalarValue' connector._types.RegexValidation: required: - type - constraint type: object properties: type: enum: - regex type: string constraint: type: string connector._types.ConnectorCustomScheduling: type: object additionalProperties: $ref: '#/components/schemas/connector._types.CustomScheduling' connector._types.CustomScheduling: required: - configuration_overrides - enabled - interval - name type: object properties: configuration_overrides: allOf: - $ref: '#/components/schemas/connector._types.CustomSchedulingConfigurationOverrides' enabled: type: boolean interval: type: string last_synced: allOf: - $ref: '#/components/schemas/_types.DateTime' name: type: string connector._types.CustomSchedulingConfigurationOverrides: type: object properties: max_crawl_depth: type: number sitemap_discovery_disabled: type: boolean domain_allowlist: type: array items: type: string sitemap_urls: type: array items: type: string seed_urls: type: array items: type: string connector._types.ConnectorFeatures: type: object properties: document_level_security: allOf: - $ref: '#/components/schemas/connector._types.FeatureEnabled' description: Indicates whether document-level security is enabled. incremental_sync: allOf: - $ref: '#/components/schemas/connector._types.FeatureEnabled' description: Indicates whether incremental syncs are enabled. native_connector_api_keys: allOf: - $ref: '#/components/schemas/connector._types.FeatureEnabled' description: Indicates whether managed connector API keys are enabled. sync_rules: allOf: - $ref: '#/components/schemas/connector._types.SyncRulesFeature' connector._types.FeatureEnabled: required: - enabled type: object properties: enabled: type: boolean connector._types.SyncRulesFeature: type: object properties: advanced: allOf: - $ref: '#/components/schemas/connector._types.FeatureEnabled' description: Indicates whether advanced sync rules are enabled. basic: allOf: - $ref: '#/components/schemas/connector._types.FeatureEnabled' description: Indicates whether basic sync rules are enabled. connector._types.FilteringConfig: required: - active - draft type: object properties: active: allOf: - $ref: '#/components/schemas/connector._types.FilteringRules' domain: type: string draft: allOf: - $ref: '#/components/schemas/connector._types.FilteringRules' connector._types.FilteringRules: required: - advanced_snippet - rules - validation type: object properties: advanced_snippet: allOf: - $ref: '#/components/schemas/connector._types.FilteringAdvancedSnippet' rules: type: array items: $ref: '#/components/schemas/connector._types.FilteringRule' validation: allOf: - $ref: '#/components/schemas/connector._types.FilteringRulesValidation' connector._types.FilteringAdvancedSnippet: required: - value type: object properties: created_at: allOf: - $ref: '#/components/schemas/_types.DateTime' updated_at: allOf: - $ref: '#/components/schemas/_types.DateTime' value: type: object connector._types.FilteringRule: required: - field - id - order - policy - rule - value type: object properties: created_at: allOf: - $ref: '#/components/schemas/_types.DateTime' field: allOf: - $ref: '#/components/schemas/_types.Field' id: allOf: - $ref: '#/components/schemas/_types.Id' order: type: number policy: allOf: - $ref: '#/components/schemas/connector._types.FilteringPolicy' rule: allOf: - $ref: '#/components/schemas/connector._types.FilteringRuleRule' updated_at: allOf: - $ref: '#/components/schemas/_types.DateTime' value: type: string connector._types.FilteringPolicy: enum: - exclude - include type: string connector._types.FilteringRuleRule: enum: - contains - ends_with - equals - regex - starts_with - '>' - < type: string connector._types.FilteringRulesValidation: required: - errors - state type: object properties: errors: type: array items: $ref: '#/components/schemas/connector._types.FilteringValidation' state: allOf: - $ref: '#/components/schemas/connector._types.FilteringValidationState' connector._types.FilteringValidation: required: - ids - messages type: object properties: ids: type: array items: $ref: '#/components/schemas/_types.Id' messages: type: array items: type: string connector._types.FilteringValidationState: enum: - edited - invalid - valid type: string connector._types.SyncStatus: enum: - canceling - canceled - completed - error - in_progress - pending - suspended type: string connector._types.IngestPipelineParams: required: - extract_binary_content - name - reduce_whitespace - run_ml_inference type: object properties: extract_binary_content: type: boolean name: type: string reduce_whitespace: type: boolean run_ml_inference: type: boolean connector._types.SchedulingConfiguration: type: object properties: access_control: allOf: - $ref: '#/components/schemas/connector._types.ConnectorScheduling' full: allOf: - $ref: '#/components/schemas/connector._types.ConnectorScheduling' incremental: allOf: - $ref: '#/components/schemas/connector._types.ConnectorScheduling' connector._types.ConnectorScheduling: required: - enabled - interval type: object properties: enabled: type: boolean interval: type: string description: The interval is expressed using the crontab syntax connector._types.ConnectorStatus: enum: - created - needs_configuration - configured - connected - error type: string connector._types.ConnectorSyncJob: required: - connector - created_at - deleted_document_count - id - indexed_document_count - indexed_document_volume - job_type - metadata - status - total_document_count - trigger_method type: object properties: cancelation_requested_at: allOf: - $ref: '#/components/schemas/_types.DateTime' canceled_at: allOf: - $ref: '#/components/schemas/_types.DateTime' completed_at: allOf: - $ref: '#/components/schemas/_types.DateTime' connector: allOf: - $ref: '#/components/schemas/connector._types.SyncJobConnectorReference' created_at: allOf: - $ref: '#/components/schemas/_types.DateTime' deleted_document_count: type: number error: type: string id: allOf: - $ref: '#/components/schemas/_types.Id' indexed_document_count: type: number indexed_document_volume: type: number job_type: allOf: - $ref: '#/components/schemas/connector._types.SyncJobType' last_seen: allOf: - $ref: '#/components/schemas/_types.DateTime' metadata: type: object additionalProperties: type: object started_at: allOf: - $ref: '#/components/schemas/_types.DateTime' status: allOf: - $ref: '#/components/schemas/connector._types.SyncStatus' total_document_count: type: number trigger_method: allOf: - $ref: '#/components/schemas/connector._types.SyncJobTriggerMethod' worker_hostname: type: string connector._types.SyncJobConnectorReference: required: - configuration - filtering - id - index_name - service_type type: object properties: configuration: allOf: - $ref: '#/components/schemas/connector._types.ConnectorConfiguration' filtering: allOf: - $ref: '#/components/schemas/connector._types.FilteringRules' id: allOf: - $ref: '#/components/schemas/_types.Id' index_name: type: string language: type: string pipeline: allOf: - $ref: '#/components/schemas/connector._types.IngestPipelineParams' service_type: type: string sync_cursor: type: object connector._types.SyncJobType: enum: - full - incremental - access_control type: string connector._types.SyncJobTriggerMethod: enum: - on_demand - scheduled type: string _types.WriteResponseBase: required: - _id - _index - result - _shards - _version type: object properties: _id: allOf: - $ref: '#/components/schemas/_types.Id' description: The unique identifier for the added document. _index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: The name of the index the document was added to. _primary_term: type: number description: The primary term assigned to the document for the indexing operation. result: allOf: - $ref: '#/components/schemas/_types.Result' description: 'The result of the indexing operation: `created` or `updated`.' _seq_no: allOf: - $ref: '#/components/schemas/_types.SequenceNumber' description: "The sequence number assigned to the document for the indexing operation.\nSequence numbers are used to ensure an older version of a document doesn't overwrite a newer version." _shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' description: Information about the replication process of the operation. _version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' description: 'The document version, which is incremented each time the document is updated.' failure_store: allOf: - $ref: '#/components/schemas/_global.bulk.FailureStoreStatus' description: The role of the failure store in this document response forced_refresh: type: boolean dangling_indices.list_dangling_indices.DanglingIndex: required: - index_name - index_uuid - creation_date_millis - node_ids type: object properties: index_name: type: string index_uuid: type: string creation_date_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' node_ids: allOf: - $ref: '#/components/schemas/_types.Ids' _types.ErrorResponseBase: required: - error - status type: object properties: error: allOf: - $ref: '#/components/schemas/_types.ErrorCause' status: type: number description: The response returned by Elasticsearch when request execution did not succeed. _types.Conflicts: enum: - abort - proceed type: string _types.Slices: oneOf: - type: number - $ref: '#/components/schemas/_types.SlicesCalculation' description: Slices configuration used to parallelize a process. _types.SlicesCalculation: enum: - auto type: string tasks._types.TaskListResponseBase: type: object properties: node_failures: type: array items: $ref: '#/components/schemas/_types.ErrorCause' task_failures: type: array items: $ref: '#/components/schemas/_types.TaskFailure' nodes: type: object additionalProperties: $ref: '#/components/schemas/tasks._types.NodeTasks' description: 'Task information grouped by node, if `group_by` was set to `node` (the default).' tasks: allOf: - $ref: '#/components/schemas/tasks._types.TaskInfos' description: "Either a flat list of tasks if `group_by` was set to `none`, or grouped by parents if\n`group_by` was set to `parents`." _types.TaskFailure: required: - task_id - node_id - status - reason type: object properties: task_id: type: number node_id: allOf: - $ref: '#/components/schemas/_types.NodeId' status: type: string reason: allOf: - $ref: '#/components/schemas/_types.ErrorCause' tasks._types.NodeTasks: required: - tasks type: object properties: name: allOf: - $ref: '#/components/schemas/_types.NodeId' transport_address: allOf: - $ref: '#/components/schemas/_types.TransportAddress' host: allOf: - $ref: '#/components/schemas/_types.Host' ip: allOf: - $ref: '#/components/schemas/_types.Ip' roles: type: array items: type: string attributes: type: object additionalProperties: type: string tasks: type: object additionalProperties: $ref: '#/components/schemas/tasks._types.TaskInfo' tasks._types.TaskInfo: required: - action - cancellable - headers - id - node - running_time_in_nanos - start_time_in_millis - type type: object properties: action: type: string cancelled: type: boolean cancellable: type: boolean description: type: string description: "Human readable text that identifies the particular request that the task is performing.\nFor example, it might identify the search request being performed by a search task.\nOther kinds of tasks have different descriptions, like `_reindex` which has the source and the destination, or `_bulk` which just has the number of requests and the destination indices.\nMany requests will have only an empty description because more detailed information about the request is not easily available or particularly helpful in identifying the request." headers: type: object additionalProperties: type: string id: type: number node: allOf: - $ref: '#/components/schemas/_types.NodeId' running_time: allOf: - $ref: '#/components/schemas/_types.Duration' running_time_in_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' start_time_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' status: type: object description: "The internal status of the task, which varies from task to task.\nThe format also varies.\nWhile the goal is to keep the status for a particular task consistent from version to version, this is not always possible because sometimes the implementation changes.\nFields might be removed from the status for a particular request so any parsing you do of the status might break in minor releases." type: type: string parent_task_id: allOf: - $ref: '#/components/schemas/_types.TaskId' original_task_id: allOf: - $ref: '#/components/schemas/_types.TaskId' description: "The task ID of the original task. Only present when the task is continuing the work of an earlier task that was running on a node which has since shut down (i.e. a relocatable task).\nFor tasks that have not been relocated this is always equal to the task's own ID and is omitted from the response." original_start_time_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: 'The time at which the original task started, in milliseconds since the Unix epoch. Only present together with `original_task_id`.' original_start_time: type: string description: 'The time at which the original task started, as an ISO 8601 formatted string. Only present together with `original_task_id` and when the request includes the `?human=true` query parameter.' tasks._types.TaskInfos: oneOf: - type: array items: $ref: '#/components/schemas/tasks._types.TaskInfo' - type: object additionalProperties: $ref: '#/components/schemas/tasks._types.ParentTaskInfo' tasks._types.ParentTaskInfo: allOf: - $ref: '#/components/schemas/tasks._types.TaskInfo' - type: object properties: children: type: array items: $ref: '#/components/schemas/tasks._types.TaskInfo' enrich.execute_policy.ExecuteEnrichPolicyStatus: required: - phase type: object properties: phase: allOf: - $ref: '#/components/schemas/enrich.execute_policy.EnrichPolicyPhase' step: type: string enrich.execute_policy.EnrichPolicyPhase: enum: - SCHEDULED - RUNNING - COMPLETE - FAILED - CANCELLED type: string enrich._types.Summary: required: - config type: object properties: config: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/enrich._types.Policy' enrich._types.Policy: required: - enrich_fields - indices - match_field type: object properties: enrich_fields: allOf: - $ref: '#/components/schemas/_types.Fields' indices: allOf: - $ref: '#/components/schemas/_types.Indices' match_field: allOf: - $ref: '#/components/schemas/_types.Field' query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' name: allOf: - $ref: '#/components/schemas/_types.Name' elasticsearch_version: type: string enrich.stats.CoordinatorStats: required: - executed_searches_total - node_id - queue_size - remote_requests_current - remote_requests_total type: object properties: executed_searches_total: type: number node_id: allOf: - $ref: '#/components/schemas/_types.Id' queue_size: type: number remote_requests_current: type: number remote_requests_total: type: number enrich.stats.ExecutingPolicy: required: - name - task type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' task: allOf: - $ref: '#/components/schemas/tasks._types.TaskInfo' enrich.stats.CacheStats: required: - node_id - count - hits - hits_time_in_millis - misses - misses_time_in_millis - evictions - size_in_bytes type: object properties: node_id: allOf: - $ref: '#/components/schemas/_types.Id' count: type: number hits: type: number hits_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' misses: type: number misses_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' evictions: type: number size_in_bytes: type: number eql._types.EqlSearchResponseBase: required: - hits type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: Identifier for the search. is_partial: type: boolean description: 'If true, the response does not contain complete search results.' is_running: type: boolean description: 'If true, the search request is still executing.' took: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: Milliseconds it took Elasticsearch to execute the request. timed_out: type: boolean description: 'If true, the request timed out before completion.' hits: allOf: - $ref: '#/components/schemas/eql._types.EqlHits' description: Contains matching events and sequences. Also contains related metadata. shard_failures: type: array items: $ref: '#/components/schemas/_types.ShardFailure' description: 'Contains information about shard failures (if any), in case allow_partial_search_results=true' eql._types.EqlHits: type: object properties: total: allOf: - $ref: '#/components/schemas/_global.search._types.TotalHits' description: Metadata about the number of matching events or sequences. events: type: array items: $ref: '#/components/schemas/eql._types.HitsEvent' description: Contains events matching the query. Each object represents a matching event. sequences: type: array items: $ref: '#/components/schemas/eql._types.HitsSequence' description: Contains event sequences matching the query. Each object represents a matching sequence. This parameter is only returned for EQL queries containing a sequence. eql._types.HitsEvent: required: - _index - _id - _source type: object properties: _index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: Name of the index containing the event. _id: allOf: - $ref: '#/components/schemas/_types.Id' description: Unique identifier for the event. This ID is only unique within the index. _source: type: object description: Original JSON body passed for the event at index time. missing: type: boolean description: Set to `true` for events in a timespan-constrained sequence that do not meet a given condition. fields: type: object additionalProperties: type: array items: type: object eql._types.HitsSequence: required: - events type: object properties: events: type: array items: $ref: '#/components/schemas/eql._types.HitsEvent' description: Contains events matching the query. Each object represents a matching event. join_keys: type: array items: type: object description: Shared field values used to constrain matches in the sequence. These are defined using the by keyword in the EQL query syntax. eql.search.ResultPosition: enum: - tail - head type: string esql._types.EsqlFormat: enum: - csv - json - tsv - txt - yaml - cbor - smile - arrow type: string esql._types.ESQLParams: oneOf: - type: array items: $ref: '#/components/schemas/esql._types.SingleOrMultiValue' - type: array items: $ref: '#/components/schemas/esql._types.NamedValue' esql._types.SingleOrMultiValue: oneOf: - $ref: '#/components/schemas/_types.FieldValue' - type: array items: $ref: '#/components/schemas/_types.FieldValue' esql._types.NamedValue: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/esql._types.NamedParameterValue' esql._types.NamedParameterValue: oneOf: - $ref: '#/components/schemas/esql._types.SingleOrMultiValue' - $ref: '#/components/schemas/esql._types.ClassifiedNamedParameter' description: "The value of a named ES|QL query parameter.\nIt is either a literal single or multi value, or a single-key object that classifies how\nthe parameter is interpreted." esql._types.ClassifiedNamedParameter: maxProperties: 1 minProperties: 1 type: object properties: value: allOf: - $ref: '#/components/schemas/esql._types.SingleOrMultiValue' description: Interpret the parameter as a literal value. identifier: type: string description: 'Interpret the parameter as an identifier, such as a field or function name.' pattern: type: string description: 'Interpret the parameter as a pattern, such as an index or field name pattern.' description: "A named ES|QL query parameter supplied in its classified form.\nExactly one of `value`, `identifier`, or `pattern` must be set." esql._types.TableValuesContainer: maxProperties: 1 minProperties: 1 type: object properties: integer: type: array items: $ref: '#/components/schemas/esql._types.TableValuesIntegerValue' keyword: type: array items: $ref: '#/components/schemas/esql._types.TableValuesKeywordValue' long: type: array items: $ref: '#/components/schemas/esql._types.TableValuesLongValue' double: type: array items: $ref: '#/components/schemas/esql._types.TableValuesLongDouble' esql._types.TableValuesIntegerValue: oneOf: - type: number - type: array items: type: number esql._types.TableValuesKeywordValue: oneOf: - type: string - type: array items: type: string esql._types.TableValuesLongValue: oneOf: - type: number - type: array items: type: number esql._types.TableValuesLongDouble: oneOf: - type: number - type: array items: type: number esql._types.EsqlQuerySettings: type: object properties: time_zone: type: string description: "The default timezone to be used in the query.\nIt defaults to UTC and overrides the `time_zone` request parameter." x-state: Generally available; Added in 9.4.0 approximation: allOf: - $ref: '#/components/schemas/esql._types.EsqlApproximation' description: "Enables query approximation if possible for the query.\n`false` (the default) disables query approximation and `true` enables it with default settings.\nA map value enables query approximation with custom settings." x-state: Generally available; Added in 9.5.0 column_metadata: allOf: - $ref: '#/components/schemas/_spec_utils.Stringifiedboolean' description: "When enabled, column metadata is added to the query response as additional `_meta` properties.\nCurrently, only `_meta.bucket` is added for columns corresponding to the `BUCKET` function, containing the bucket interval and unit for queries where it can be determined." default: false x-state: Experimental; Added in 9.5.0 description: "Per-query settings supplied through the request body.\nThis is the request-body equivalent of the in-query `SET` command.\nOnly settings that are exposed as request-body parameters can be set here; other `SET`-only\nsettings (such as `unmapped_fields`) must be supplied in the query itself." esql._types.EsqlApproximation: oneOf: - type: boolean - $ref: '#/components/schemas/esql._types.EsqlApproximationSettings' description: "The `approximation` query setting.\nIt can be a boolean that toggles query approximation with default settings, or a map that enables it with custom settings." esql._types.EsqlApproximationSettings: type: object properties: rows: type: number description: "The number of sampled rows used for approximating the query.\nIt must be at least 10,000. A null value uses the system default." confidence_level: type: number description: "The confidence level of the computed confidence intervals.\nA null value disables computing confidence intervals." default: 0.9 esql._types.AsyncEsqlResult: allOf: - $ref: '#/components/schemas/esql._types.EsqlResult' - required: - is_running type: object properties: id: type: string description: "The ID of the async query, to be used in subsequent requests to check the status or retrieve results.\n\nAlso available in the `X-Elasticsearch-Async-Id` HTTP header." is_running: type: boolean description: "Indicates whether the async query is still running or has completed.\n\nAlso available in the `X-Elasticsearch-Async-Is-Running` HTTP header." esql._types.EsqlResult: required: - columns - values type: object properties: took: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' is_partial: type: boolean all_columns: type: array items: $ref: '#/components/schemas/esql._types.EsqlColumnInfo' columns: type: array items: $ref: '#/components/schemas/esql._types.EsqlColumnInfo' values: type: array items: type: array items: $ref: '#/components/schemas/_types.FieldValue' _clusters: allOf: - $ref: '#/components/schemas/esql._types.EsqlClusterInfo' description: "Cross-cluster search information. Present if `include_ccs_metadata` was `true` in the request\nand a cross-cluster search was performed." profile: type: object description: "Profiling information. Present if `profile` was `true` in the request.\nThe contents of this field are currently unstable." esql._types.EsqlColumnInfo: required: - name - type type: object properties: name: type: string type: type: string esql._types.EsqlClusterInfo: required: - total - successful - running - skipped - partial - failed - details type: object properties: total: type: number successful: type: number running: type: number skipped: type: number partial: type: number failed: type: number details: type: object additionalProperties: $ref: '#/components/schemas/esql._types.EsqlClusterDetails' esql._types.EsqlClusterDetails: required: - status - indices type: object properties: status: allOf: - $ref: '#/components/schemas/esql._types.EsqlClusterStatus' indices: type: string took: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' _shards: allOf: - $ref: '#/components/schemas/esql._types.EsqlShardInfo' failures: type: array items: $ref: '#/components/schemas/esql._types.EsqlShardFailure' esql._types.EsqlClusterStatus: enum: - running - successful - partial - skipped - failed type: string esql._types.EsqlShardInfo: required: - total type: object properties: total: type: number successful: type: number skipped: type: number failed: type: number esql._types.EsqlShardFailure: required: - shard - index - reason type: object properties: shard: type: number index: oneOf: - $ref: '#/components/schemas/_types.IndexName' - type: - 'null' - string node: allOf: - $ref: '#/components/schemas/_types.NodeId' reason: allOf: - $ref: '#/components/schemas/_types.ErrorCause' esql._types.ESQLDataSource: required: - name - type - settings type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' description: The data source name. type: type: string description: 'The data source type. Currently, `s3` is supported.' description: type: string description: A free-text description. settings: type: object additionalProperties: type: object description: Type-specific connection and authentication settings. description: "Represents a data source definition stored in cluster state. A data source holds\nconnection settings (credentials, endpoints, auth) for an external data provider." esql._types.ESQLDataset: required: - name - data_source - resource type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' description: The dataset name. data_source: allOf: - $ref: '#/components/schemas/_types.Name' description: The name of the referenced data source. resource: type: string description: "The URI that identifies the data to read, resolved against the referenced data source.\nIt can include glob patterns, for example a recursive pattern that matches\nParquet files under `s3://logs-bucket/access`." description: type: string description: A free-text description. settings: type: object additionalProperties: type: object description: "Format- and parsing-specific settings that configure how the resource is read.\nCommon keys include `format` and `partition_detection`. Additional keys depend on the format reader;\ncompression can be inferred from the resource URI." mappings: allOf: - $ref: '#/components/schemas/esql._types.DatasetMapping' description: The user-declared mapping on the dataset definition. description: "Represents a dataset definition stored in cluster state. A dataset is a named reference\nto external data that participates in the index namespace alongside indices, aliases, and views.\nDatasets inherit credentials from their referenced data source at query time." esql._types.DatasetMapping: type: object properties: dynamic: allOf: - $ref: '#/components/schemas/esql._types.Dynamic' description: "The policy for columns that are not declared in `properties`.\n`true` (the default) infers undeclared columns and overlays the declarations; `false` makes the declaration the entire schema, so undeclared columns are not queryable." default: 'true' properties: type: object additionalProperties: $ref: '#/components/schemas/esql._types.DatasetFieldMapping' description: 'The per-column declarations, keyed by logical column name.' _id: allOf: - $ref: '#/components/schemas/esql._types.IdPath' description: 'The `_id` meta-field configuration, sourcing the document identity from a column.' description: "A user-declared mapping (the `mappings` block) attached to a dataset.\nIt is entirely optional: a dataset with no declared mapping relies on inference." esql._types.Dynamic: enum: - 'true' - 'false' type: string esql._types.DatasetFieldMapping: required: - type type: object properties: type: type: string description: The declared column type. rename_from: type: string description: "The underlying file column that this logical column reads from.\nThis is a read-path rename: the physical column becomes this single logical column.\nResponses always use `rename_from`. `path`, the former name for this field, is still\naccepted in requests and means the same thing." format: type: string description: 'The date-parse pattern for a declared `date` column, mirroring the index date-field `format`.' description: A per-column declaration inside a dataset mapping's `properties`. esql._types.IdPath: required: - path type: object properties: path: type: string description: The name of the column that provides the document identity. description: The `_id` meta-field of a dataset mapping. esql._types.ESQLView: required: - name - query type: object properties: name: type: string description: The name of the ES|QL view query: type: string description: The ES|QL query description: type: string description: A free-text description of the view. x-state: Generally available; Added in 9.6.0 reserved: type: boolean description: "Whether this view is reserved.\n\nElasticsearch creates reserved views. They can be queried and read like any other view.\nThey cannot be created, updated, or deleted through the views API.\nThe response includes this field only when the value is `true`." x-state: Generally available; Added in 9.6.0 description: A non-materialized ES|QL view. esql.list_queries.Body: required: - id - node - start_time_millis - running_time_nanos - query type: object properties: id: type: number node: allOf: - $ref: '#/components/schemas/_types.NodeId' start_time_millis: type: number running_time_nanos: type: number query: type: string _types.InlineGet: required: - found type: object properties: fields: type: object additionalProperties: type: object found: type: boolean _seq_no: allOf: - $ref: '#/components/schemas/_types.SequenceNumber' _primary_term: type: number _routing: allOf: - $ref: '#/components/schemas/_types.Routing' _source: type: object features._types.Feature: required: - name - description type: object properties: name: type: string description: type: string _global.field_caps.FieldCapability: required: - aggregatable - searchable - type type: object properties: aggregatable: type: boolean description: Whether this field can be aggregated on all indices. indices: allOf: - $ref: '#/components/schemas/_types.Indices' description: 'The list of indices where this field has the same type family, or null if all indices have the same type family for the field.' meta: allOf: - $ref: '#/components/schemas/_types.Metadata' description: 'Merged metadata across all indices as a map of string keys to arrays of values. A value length of 1 indicates that all indices had the same value for this key, while a length of 2 or more indicates that not all indices had the same value for this key.' non_aggregatable_indices: allOf: - $ref: '#/components/schemas/_types.Indices' description: 'The list of indices where this field is not aggregatable, or null if all indices have the same definition for the field.' non_searchable_indices: allOf: - $ref: '#/components/schemas/_types.Indices' description: 'The list of indices where this field is not searchable, or null if all indices have the same definition for the field.' searchable: type: boolean description: Whether this field is indexed for search on all indices. type: type: string inference: type: boolean description: 'Whether this field is an inference field, meaning a field that automatically performs inference (for example, `semantic_text` fields), on all indices.' x-state: Generally available; Added in 9.5.0 non_inference_indices: allOf: - $ref: '#/components/schemas/_types.Indices' description: 'The list of indices where this field is not an inference field, or null if all indices have the same definition for the field.' x-state: Generally available; Added in 9.5.0 passthrough: type: boolean description: "Whether this field is a passthrough source on all indices.\nThis property is present only for field types that support passthrough." x-state: Generally available; Added in 9.6.0 non_passthrough_indices: allOf: - $ref: '#/components/schemas/_types.Indices' description: 'The list of indices where this field is not a passthrough source, or null if all indices have the same definition for the field.' x-state: Generally available; Added in 9.6.0 metadata_field: type: boolean description: Whether this field is registered as a metadata field. time_series_dimension: type: boolean description: Whether this field is used as a time series dimension. x-state: Experimental; Added in 8.0.0 time_series_metric: allOf: - $ref: '#/components/schemas/_types.mapping.TimeSeriesMetricType' description: "Contains metric type if this fields is used as a time series\nmetrics, absent if the field is not used as metric." x-state: Experimental; Added in 8.0.0 non_dimension_indices: type: array items: $ref: '#/components/schemas/_types.IndexName' description: "If this list is present in response then some indices have the\nfield marked as a dimension and other indices, the ones in this list, do not." x-state: Experimental; Added in 8.0.0 metric_conflicts_indices: type: array items: $ref: '#/components/schemas/_types.IndexName' description: "The list of indices where this field is present if these indices\ndon’t have the same `time_series_metric` value for this field." x-state: Experimental; Added in 8.0.0 _types.IndexAlias: type: string fleet._types.Checkpoint: type: number _global.msearch.RequestItem: oneOf: - $ref: '#/components/schemas/_global.msearch.MultisearchHeader' - $ref: '#/components/schemas/_global.search._types.SearchRequestBody' _global.msearch.MultisearchHeader: type: object properties: allow_no_indices: type: boolean description: "A setting that does two separate checks on the index expression.\nIf `false`, the request returns an error (1) if any wildcard expression\n(including `_all` and `*`) resolves to zero matching indices or (2) if the\ncomplete set of resolved indices, aliases or data streams is empty after all\nexpressions are evaluated. If `true`, index expressions that resolve to no\nindices are allowed and the request returns an empty result." expand_wildcards: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' description: "\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" ignore_unavailable: type: boolean description: "If `false`, the request returns an error if it targets a concrete (non-wildcarded)\nindex, alias, or data stream that is missing, closed, or otherwise unavailable.\nIf `true`, unavailable concrete targets are silently ignored." index: allOf: - $ref: '#/components/schemas/_types.Indices' preference: type: string project_routing: allOf: - $ref: '#/components/schemas/_types.ProjectRouting' request_cache: type: boolean routing: allOf: - $ref: '#/components/schemas/_types.Routing' description: "A custom value used to route operations to a specific shard.\nNot allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead." search_type: allOf: - $ref: '#/components/schemas/_types.SearchType' description: "\n\nSupported values include:\n - `query_then_fetch`: Documents are scored using local term and document frequencies for the shard. This is usually faster but less accurate.\n - `dfs_query_then_fetch`: Documents are scored using global term and document frequencies across all shards. This is usually slower but more accurate.\n\n" ccs_minimize_roundtrips: type: boolean allow_partial_search_results: type: boolean ignore_throttled: type: boolean description: Contains parameters used to limit or change the subsequent search body request. _types.ProjectRouting: type: string _global.msearch.ResponseItem: oneOf: - $ref: '#/components/schemas/_global.msearch.MultiSearchItem' - $ref: '#/components/schemas/_types.ErrorResponseBase' _global.msearch.MultiSearchItem: allOf: - $ref: '#/components/schemas/_global.search.ResponseBody' - type: object properties: status: type: number _global.search.ResponseBody: required: - took - timed_out - _shards - hits type: object properties: took: type: number description: "The number of milliseconds it took Elasticsearch to run the request.\nThis value is calculated by measuring the time elapsed between receipt of a request on the coordinating node and the time at which the coordinating node is ready to send the response.\nIt includes:\n\n* Communication time between the coordinating node and data nodes\n* Time the request spends in the search thread pool, queued for execution\n* Actual run time\n\nIt does not include:\n\n* Time needed to send the request to Elasticsearch\n* Time needed to serialize the JSON response\n* Time needed to send the response to a client" timed_out: type: boolean description: 'If `true`, the request timed out before completion; returned results may be partial or empty.' _shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' description: A count of shards used for the request. hits: allOf: - $ref: '#/components/schemas/_global.search._types.HitsMetadata' description: The returned documents and metadata. aggregations: type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.Aggregate' _clusters: allOf: - $ref: '#/components/schemas/_types.ClusterStatistics' fields: type: object additionalProperties: type: object max_score: type: number num_reduce_phases: type: number profile: allOf: - $ref: '#/components/schemas/_global.search._types.Profile' pit_id: allOf: - $ref: '#/components/schemas/_types.Id' description: "An updated identifier for the point-in-time that was searched.\n\nIMPORTANT: Each search request against a PIT returns in its response a `pit_id` field which may be different from the identifier you originally supplied.\nAlways use the most recently-received PIT identifier for the next request.\nIf you make concurrent search requests against the same PIT, Elasticsearch can return several different `pit_id` values in its responses.\nIn that case, use any of these values for later requests, preferring more recently-received values whenever possible." _scroll_id: allOf: - $ref: '#/components/schemas/_types.ScrollId' description: "The identifier for the search and its search context.\nYou can use this scroll ID with the scroll API to retrieve the next batch of search results for the request.\nThis property is returned only if the `scroll` query parameter is specified in the request." externalDocs: url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/paginate-search-results#scroll-search-results suggest: type: object additionalProperties: type: array items: $ref: '#/components/schemas/_global.search._types.Suggest' terminated_early: type: boolean _global.get.GetResult: required: - _index - found - _id type: object properties: _index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: The name of the index the document belongs to. fields: type: object additionalProperties: type: object description: 'If the `stored_fields` parameter is set to `true` and `found` is `true`, it contains the document fields stored in the index.' _ignored: type: array items: type: string found: type: boolean description: Indicates whether the document exists. _id: allOf: - $ref: '#/components/schemas/_types.Id' description: The unique identifier for the document. _primary_term: type: number description: The primary term assigned to the document for the indexing operation. _routing: type: string description: 'The explicit routing, if set.' _seq_no: allOf: - $ref: '#/components/schemas/_types.SequenceNumber' description: "The sequence number assigned to the document for the indexing operation.\nSequence numbers are used to ensure an older version of a document doesn't overwrite a newer version." _source: type: object description: "If `found` is `true`, it contains the document data formatted in JSON.\nIf the `_source` parameter is set to `false` or the `stored_fields` parameter is set to `true`, it is excluded." _version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' description: 'The document version, which is ncremented each time the document is updated.' _types.StoredScript: required: - lang - source type: object properties: lang: allOf: - $ref: '#/components/schemas/_types.ScriptLanguage' description: "The language the script is written in.\nFor search templates, use `mustache`.\n\nSupported values include:\n - `painless`: Painless scripting language, purpose-built for Elasticsearch.\n - `expression`: Lucene’s expressions language, compiles a JavaScript expression to bytecode.\n - `mustache`: Mustache templated, used for templates.\n - `java`: Expert Java API\n\n" options: type: object additionalProperties: type: string source: allOf: - $ref: '#/components/schemas/_types.ScriptSource' description: "The script source.\nFor search templates, an object containing the search template." _global.get_script_context.Context: required: - methods - name type: object properties: methods: type: array items: $ref: '#/components/schemas/_global.get_script_context.ContextMethod' name: allOf: - $ref: '#/components/schemas/_types.Name' _global.get_script_context.ContextMethod: required: - name - return_type - params type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' return_type: type: string params: type: array items: $ref: '#/components/schemas/_global.get_script_context.ContextMethodParam' _global.get_script_context.ContextMethodParam: required: - name - type type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' type: type: string _global.get_script_languages.LanguageContext: required: - contexts - language type: object properties: contexts: type: array items: type: string language: allOf: - $ref: '#/components/schemas/_types.ScriptLanguage' description: "\n\nSupported values include:\n - `painless`: Painless scripting language, purpose-built for Elasticsearch.\n - `expression`: Lucene’s expressions language, compiles a JavaScript expression to bytecode.\n - `mustache`: Mustache templated, used for templates.\n - `java`: Expert Java API\n\n" graph._types.Hop: required: - vertices type: object properties: connections: allOf: - $ref: '#/components/schemas/graph._types.Hop' description: Specifies one or more fields from which you want to extract terms that are associated with the specified vertices. query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: An optional guiding query that constrains the Graph API as it explores connected terms. vertices: type: array items: $ref: '#/components/schemas/graph._types.VertexDefinition' description: Contains the fields you are interested in. graph._types.VertexDefinition: required: - field type: object properties: exclude: type: array items: type: string description: Prevents the specified terms from being included in the results. field: allOf: - $ref: '#/components/schemas/_types.Field' description: Identifies a field in the documents of interest. include: type: array items: $ref: '#/components/schemas/graph._types.VertexInclude' description: Identifies the terms of interest that form the starting points from which you want to spider out. min_doc_count: type: number description: "Specifies how many documents must contain a pair of terms before it is considered to be a useful connection.\nThis setting acts as a certainty threshold." default: 3 shard_min_doc_count: type: number description: Controls how many documents on a particular shard have to contain a pair of terms before the connection is returned for global consideration. default: 2 size: type: number description: Specifies the maximum number of vertex terms returned for each field. default: 5 graph._types.VertexInclude: required: - term type: object properties: boost: type: number term: type: string graph._types.ExploreControls: required: - use_significance type: object properties: sample_diversity: allOf: - $ref: '#/components/schemas/graph._types.SampleDiversity' description: "To avoid the top-matching documents sample being dominated by a single source of results, it is sometimes necessary to request diversity in the sample.\nYou can do this by selecting a single-value field and setting a maximum number of documents per value for that field." sample_size: type: number description: "Each hop considers a sample of the best-matching documents on each shard.\nUsing samples improves the speed of execution and keeps exploration focused on meaningfully-connected terms.\nVery small values (less than 50) might not provide sufficient weight-of-evidence to identify significant connections between terms.\nVery large sample sizes can dilute the quality of the results and increase execution times." default: 100 timeout: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The length of time in milliseconds after which exploration will be halted and the results gathered so far are returned.\nThis timeout is honored on a best-effort basis.\nExecution might overrun this timeout if, for example, a long pause is encountered while FieldData is loaded for a field." use_significance: type: boolean description: Filters associated terms so only those that are significantly associated with your query are included. graph._types.SampleDiversity: required: - field - max_docs_per_value type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' max_docs_per_value: type: number graph._types.Connection: required: - doc_count - source - target - weight type: object properties: doc_count: type: number source: type: number target: type: number weight: type: number graph._types.Vertex: required: - depth - field - term - weight type: object properties: depth: type: number field: allOf: - $ref: '#/components/schemas/_types.Field' term: type: string weight: type: number _global.health_report.Indicators: type: object properties: master_is_stable: allOf: - $ref: '#/components/schemas/_global.health_report.MasterIsStableIndicator' shards_availability: allOf: - $ref: '#/components/schemas/_global.health_report.ShardsAvailabilityIndicator' disk: allOf: - $ref: '#/components/schemas/_global.health_report.DiskIndicator' repository_integrity: allOf: - $ref: '#/components/schemas/_global.health_report.RepositoryIntegrityIndicator' data_stream_lifecycle: allOf: - $ref: '#/components/schemas/_global.health_report.DataStreamLifecycleIndicator' ilm: allOf: - $ref: '#/components/schemas/_global.health_report.IlmIndicator' slm: allOf: - $ref: '#/components/schemas/_global.health_report.SlmIndicator' shards_capacity: allOf: - $ref: '#/components/schemas/_global.health_report.ShardsCapacityIndicator' file_settings: allOf: - $ref: '#/components/schemas/_global.health_report.FileSettingsIndicator' cluster_state_encryption: allOf: - $ref: '#/components/schemas/_global.health_report.ProjectEncryptionKeyIndicator' dlm_frozen_transitions: allOf: - $ref: '#/components/schemas/_global.health_report.DlmFrozenTransitionsIndicator' description: Reports the health of data stream lifecycle transitions of backing indices to the frozen tier. x-state: Generally available; Added in 9.6.0 _global.health_report.MasterIsStableIndicator: allOf: - $ref: '#/components/schemas/_global.health_report.BaseIndicator' - type: object properties: details: allOf: - $ref: '#/components/schemas/_global.health_report.MasterIsStableIndicatorDetails' description: MASTER_IS_STABLE _global.health_report.MasterIsStableIndicatorDetails: required: - current_master - recent_masters type: object properties: current_master: allOf: - $ref: '#/components/schemas/_global.health_report.IndicatorNode' recent_masters: type: array items: $ref: '#/components/schemas/_global.health_report.IndicatorNode' exception_fetching_history: allOf: - $ref: '#/components/schemas/_global.health_report.MasterIsStableIndicatorExceptionFetchingHistory' cluster_formation: type: array items: $ref: '#/components/schemas/_global.health_report.MasterIsStableIndicatorClusterFormationNode' _global.health_report.IndicatorNode: required: - name - node_id type: object properties: name: oneOf: - type: string - type: - 'null' - string node_id: oneOf: - type: string - type: - 'null' - string _global.health_report.MasterIsStableIndicatorExceptionFetchingHistory: required: - message - stack_trace type: object properties: message: type: string stack_trace: type: string _global.health_report.MasterIsStableIndicatorClusterFormationNode: required: - node_id - cluster_formation_message type: object properties: name: type: string node_id: type: string cluster_formation_message: type: string _global.health_report.BaseIndicator: required: - status - symptom type: object properties: status: allOf: - $ref: '#/components/schemas/_global.health_report.IndicatorHealthStatus' symptom: type: string impacts: type: array items: $ref: '#/components/schemas/_global.health_report.Impact' diagnosis: type: array items: $ref: '#/components/schemas/_global.health_report.Diagnosis' _global.health_report.IndicatorHealthStatus: enum: - green - yellow - red - unknown - unavailable type: string _global.health_report.Impact: required: - description - id - impact_areas - severity type: object properties: description: type: string id: type: string impact_areas: type: array items: $ref: '#/components/schemas/_global.health_report.ImpactArea' severity: type: number _global.health_report.ImpactArea: enum: - search - ingest - backup - deployment_management type: string _global.health_report.Diagnosis: required: - id - action - affected_resources - cause - help_url type: object properties: id: type: string action: type: string affected_resources: allOf: - $ref: '#/components/schemas/_global.health_report.DiagnosisAffectedResources' cause: type: string help_url: type: string _global.health_report.DiagnosisAffectedResources: type: object properties: indices: allOf: - $ref: '#/components/schemas/_types.Indices' nodes: type: array items: $ref: '#/components/schemas/_global.health_report.IndicatorNode' slm_policies: type: array items: type: string feature_states: type: array items: type: string snapshot_repositories: type: array items: type: string _global.health_report.ShardsAvailabilityIndicator: allOf: - $ref: '#/components/schemas/_global.health_report.BaseIndicator' - type: object properties: details: allOf: - $ref: '#/components/schemas/_global.health_report.ShardsAvailabilityIndicatorDetails' description: SHARDS_AVAILABILITY _global.health_report.ShardsAvailabilityIndicatorDetails: required: - creating_primaries - creating_replicas - initializing_primaries - initializing_replicas - restarting_primaries - restarting_replicas - started_primaries - started_replicas - unassigned_primaries - unassigned_replicas type: object properties: creating_primaries: type: number creating_replicas: type: number initializing_primaries: type: number initializing_replicas: type: number restarting_primaries: type: number restarting_replicas: type: number started_primaries: type: number started_replicas: type: number unassigned_primaries: type: number unassigned_replicas: type: number _global.health_report.DiskIndicator: allOf: - $ref: '#/components/schemas/_global.health_report.BaseIndicator' - type: object properties: details: allOf: - $ref: '#/components/schemas/_global.health_report.DiskIndicatorDetails' description: DISK _global.health_report.DiskIndicatorDetails: required: - indices_with_readonly_block - nodes_with_enough_disk_space - nodes_over_high_watermark - nodes_over_flood_stage_watermark - nodes_with_unknown_disk_status type: object properties: indices_with_readonly_block: type: number nodes_with_enough_disk_space: type: number nodes_over_high_watermark: type: number nodes_over_flood_stage_watermark: type: number nodes_with_unknown_disk_status: type: number _global.health_report.RepositoryIntegrityIndicator: allOf: - $ref: '#/components/schemas/_global.health_report.BaseIndicator' - type: object properties: details: allOf: - $ref: '#/components/schemas/_global.health_report.RepositoryIntegrityIndicatorDetails' description: REPOSITORY_INTEGRITY _global.health_report.RepositoryIntegrityIndicatorDetails: type: object properties: total_repositories: type: number corrupted_repositories: type: number corrupted: type: array items: type: string _global.health_report.DataStreamLifecycleIndicator: allOf: - $ref: '#/components/schemas/_global.health_report.BaseIndicator' - type: object properties: details: allOf: - $ref: '#/components/schemas/_global.health_report.DataStreamLifecycleDetails' description: DATA_STREAM_LIFECYCLE _global.health_report.DataStreamLifecycleDetails: required: - stagnating_backing_indices_count - total_backing_indices_in_error type: object properties: stagnating_backing_indices_count: type: number total_backing_indices_in_error: type: number stagnating_backing_indices: type: array items: $ref: '#/components/schemas/_global.health_report.StagnatingBackingIndices' _global.health_report.StagnatingBackingIndices: required: - index_name - first_occurrence_timestamp - retry_count type: object properties: index_name: allOf: - $ref: '#/components/schemas/_types.IndexName' first_occurrence_timestamp: type: number retry_count: type: number _global.health_report.IlmIndicator: allOf: - $ref: '#/components/schemas/_global.health_report.BaseIndicator' - type: object properties: details: allOf: - $ref: '#/components/schemas/_global.health_report.IlmIndicatorDetails' description: ILM _global.health_report.IlmIndicatorDetails: required: - ilm_status - policies - stagnating_indices type: object properties: ilm_status: allOf: - $ref: '#/components/schemas/_types.LifecycleOperationMode' policies: type: number stagnating_indices: type: number _types.LifecycleOperationMode: enum: - RUNNING - STOPPING - STOPPED type: string _global.health_report.SlmIndicator: allOf: - $ref: '#/components/schemas/_global.health_report.BaseIndicator' - type: object properties: details: allOf: - $ref: '#/components/schemas/_global.health_report.SlmIndicatorDetails' description: SLM _global.health_report.SlmIndicatorDetails: required: - slm_status - policies type: object properties: slm_status: allOf: - $ref: '#/components/schemas/_types.LifecycleOperationMode' policies: type: number unhealthy_policies: allOf: - $ref: '#/components/schemas/_global.health_report.SlmIndicatorUnhealthyPolicies' _global.health_report.SlmIndicatorUnhealthyPolicies: required: - count type: object properties: count: type: number invocations_since_last_success: type: object additionalProperties: type: number _global.health_report.ShardsCapacityIndicator: allOf: - $ref: '#/components/schemas/_global.health_report.BaseIndicator' - type: object properties: details: allOf: - $ref: '#/components/schemas/_global.health_report.ShardsCapacityIndicatorDetails' description: SHARDS_CAPACITY _global.health_report.ShardsCapacityIndicatorDetails: required: - data - frozen type: object properties: data: allOf: - $ref: '#/components/schemas/_global.health_report.ShardsCapacityIndicatorTierDetail' frozen: allOf: - $ref: '#/components/schemas/_global.health_report.ShardsCapacityIndicatorTierDetail' _global.health_report.ShardsCapacityIndicatorTierDetail: required: - max_shards_in_cluster type: object properties: max_shards_in_cluster: type: number current_used_shards: type: number _global.health_report.FileSettingsIndicator: allOf: - $ref: '#/components/schemas/_global.health_report.BaseIndicator' - type: object properties: details: allOf: - $ref: '#/components/schemas/_global.health_report.FileSettingsIndicatorDetails' description: FILE_SETTINGS _global.health_report.FileSettingsIndicatorDetails: required: - failure_streak - most_recent_failure type: object properties: failure_streak: type: number most_recent_failure: type: string _global.health_report.ProjectEncryptionKeyIndicator: allOf: - $ref: '#/components/schemas/_global.health_report.BaseIndicator' - type: object properties: details: allOf: - $ref: '#/components/schemas/_global.health_report.ProjectEncryptionKeyDetails' description: PROJECT_ENCRYPTION_KEY _global.health_report.ProjectEncryptionKeyDetails: required: - active_password_id - encryption_required - state type: object properties: active_key_id: type: string active_password_id: type: string encryption_required: type: boolean description: "Whether callers must refuse to store secrets when the service is not ready.\nIf `false`, callers may fall back to storing secrets in plaintext (with a warning)." key_count: type: number metadata_password_id: type: string state: type: string _global.health_report.DlmFrozenTransitionsIndicator: allOf: - $ref: '#/components/schemas/_global.health_report.BaseIndicator' - type: object properties: details: allOf: - $ref: '#/components/schemas/_global.health_report.DlmFrozenTransitionsIndicatorDetails' description: DLM_FROZEN_TRANSITIONS _global.health_report.DlmFrozenTransitionsIndicatorDetails: type: object properties: transitions_enabled: type: boolean description: Indicates whether frozen-tier transitions are enabled by the `dlm.frozen_transitions.enabled` cluster setting. service_running: type: boolean description: Indicates whether the frozen transition service is running on the current master node. default_repository_configured: type: boolean description: Indicates whether a default snapshot repository is configured with the `repositories.default_repository` cluster setting. overdue_indices_count: type: number description: The total number of overdue indices in the cluster. overdue_indices_count_by_state: type: object additionalProperties: type: number description: "The number of overdue indices in the cluster for each transition state.\nOnly present when there are overdue indices." overdue_indices_sample: type: array items: $ref: '#/components/schemas/_global.health_report.DlmFrozenTransitionOverdueIndex' description: "A sample of the overdue indices and their transition states, sorted by index name.\nThe sample is limited to 100 indices for each transition state, so it can contain fewer indices than `overdue_indices_count`.\nOnly present when there are overdue indices." generated_at_millis: type: number description: "The time, in milliseconds since the Unix epoch, when the master node generated the health snapshot.\nOnly present when the indicator status is `unknown`, meaning the health snapshot is stale." description: "An index is overdue when it has passed its `frozen_after` age by more than the configured threshold and has not yet completed its transition to the frozen tier.\nIndices with a running transition are making progress and are not counted as overdue." _global.health_report.DlmFrozenTransitionOverdueIndex: required: - index_name - transition_state type: object properties: index_name: allOf: - $ref: '#/components/schemas/_types.IndexName' description: The name of the overdue index. transition_state: allOf: - $ref: '#/components/schemas/_global.health_report.DlmFrozenTransitionState' description: "The transition state of the overdue index.\n\nSupported values include:\n - `unmarked`: The index is eligible for a frozen-tier transition but the data stream lifecycle has not marked it for conversion.\n - `marked`: The index is marked for conversion but has not been submitted to the transition executor.\n - `queued`: The index has been submitted to the transition executor and is waiting in its queue for a thread.\n - `running`: The transition of the index is in progress.\n\n" _global.health_report.DlmFrozenTransitionState: enum: - unmarked - marked - queued - running type: string ilm.explain_lifecycle.LifecycleExplain: oneOf: - $ref: '#/components/schemas/ilm.explain_lifecycle.LifecycleExplainManaged' - $ref: '#/components/schemas/ilm.explain_lifecycle.LifecycleExplainUnmanaged' discriminator: propertyName: managed mapping: 'false': '#/components/schemas/ilm.explain_lifecycle.LifecycleExplainUnmanaged' 'true': '#/components/schemas/ilm.explain_lifecycle.LifecycleExplainManaged' ilm.explain_lifecycle.LifecycleExplainManaged: required: - index - managed - skip type: object properties: action: allOf: - $ref: '#/components/schemas/_types.Name' action_time: allOf: - $ref: '#/components/schemas/_types.DateTime' action_time_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' age: allOf: - $ref: '#/components/schemas/_types.Duration' age_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' x-state: Generally available; Added in 9.2.0 failed_step: allOf: - $ref: '#/components/schemas/_types.Name' failed_step_retry_count: type: number index: allOf: - $ref: '#/components/schemas/_types.IndexName' index_creation_date: allOf: - $ref: '#/components/schemas/_types.DateTime' index_creation_date_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' is_auto_retryable_error: type: boolean lifecycle_date: allOf: - $ref: '#/components/schemas/_types.DateTime' lifecycle_date_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' managed: enum: - 'true' type: string phase: allOf: - $ref: '#/components/schemas/_types.Name' phase_time: allOf: - $ref: '#/components/schemas/_types.DateTime' phase_time_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' policy: allOf: - $ref: '#/components/schemas/_types.Name' previous_step_info: type: object additionalProperties: type: object repository_name: type: string snapshot_name: type: string shrink_index_name: type: string step: allOf: - $ref: '#/components/schemas/_types.Name' step_info: type: object additionalProperties: type: object step_time: allOf: - $ref: '#/components/schemas/_types.DateTime' step_time_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' phase_execution: allOf: - $ref: '#/components/schemas/ilm.explain_lifecycle.LifecycleExplainPhaseExecution' time_since_index_creation: allOf: - $ref: '#/components/schemas/_types.Duration' skip: type: boolean ilm.explain_lifecycle.LifecycleExplainPhaseExecution: required: - policy - version - modified_date_in_millis type: object properties: phase_definition: allOf: - $ref: '#/components/schemas/ilm._types.Phase' policy: allOf: - $ref: '#/components/schemas/_types.Name' version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' modified_date_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' ilm._types.Phase: type: object properties: actions: allOf: - $ref: '#/components/schemas/ilm._types.Actions' min_age: allOf: - $ref: '#/components/schemas/_types.Duration' ilm._types.Actions: type: object properties: allocate: allOf: - $ref: '#/components/schemas/ilm._types.AllocateAction' description: 'Phases allowed: warm, cold.' delete: allOf: - $ref: '#/components/schemas/ilm._types.DeleteAction' description: 'Phases allowed: delete.' downsample: allOf: - $ref: '#/components/schemas/ilm._types.DownsampleAction' description: 'Phases allowed: hot, warm, cold.' freeze: allOf: - $ref: '#/components/schemas/_types.EmptyObject' description: The freeze action is a noop in 8.x deprecated: true forcemerge: allOf: - $ref: '#/components/schemas/ilm._types.ForceMergeAction' description: 'Phases allowed: hot, warm.' migrate: allOf: - $ref: '#/components/schemas/ilm._types.MigrateAction' description: 'Phases allowed: warm, cold.' readonly: allOf: - $ref: '#/components/schemas/_types.EmptyObject' description: 'Phases allowed: hot, warm, cold.' rollover: allOf: - $ref: '#/components/schemas/ilm._types.RolloverAction' description: 'Phases allowed: hot.' set_priority: allOf: - $ref: '#/components/schemas/ilm._types.SetPriorityAction' description: 'Phases allowed: hot, warm, cold.' searchable_snapshot: allOf: - $ref: '#/components/schemas/ilm._types.SearchableSnapshotAction' description: 'Phases allowed: hot, cold, frozen.' shrink: allOf: - $ref: '#/components/schemas/ilm._types.ShrinkAction' description: 'Phases allowed: hot, warm.' unfollow: allOf: - $ref: '#/components/schemas/_types.EmptyObject' description: 'Phases allowed: hot, warm, cold, frozen.' wait_for_snapshot: allOf: - $ref: '#/components/schemas/ilm._types.WaitForSnapshotAction' description: 'Phases allowed: delete.' ilm._types.AllocateAction: type: object properties: number_of_replicas: type: number total_shards_per_node: type: number include: type: object additionalProperties: type: string exclude: type: object additionalProperties: type: string require: type: object additionalProperties: type: string ilm._types.DeleteAction: type: object properties: delete_searchable_snapshot: type: boolean ilm._types.DownsampleAction: required: - fixed_interval type: object properties: fixed_interval: allOf: - $ref: '#/components/schemas/_types.DurationLarge' wait_timeout: allOf: - $ref: '#/components/schemas/_types.Duration' ilm._types.ForceMergeAction: required: - max_num_segments type: object properties: max_num_segments: type: number index_codec: type: string ilm._types.MigrateAction: type: object properties: enabled: type: boolean ilm._types.RolloverAction: type: object properties: max_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The `max_size` condition has been deprecated in 9.3.0 and `max_primary_shard_size` should be used instead deprecated: true max_primary_shard_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' max_age: allOf: - $ref: '#/components/schemas/_types.Duration' max_docs: type: number max_primary_shard_docs: type: number min_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' min_primary_shard_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' min_age: allOf: - $ref: '#/components/schemas/_types.Duration' min_docs: type: number min_primary_shard_docs: type: number ilm._types.SetPriorityAction: type: object properties: priority: type: number ilm._types.SearchableSnapshotAction: required: - snapshot_repository type: object properties: snapshot_repository: type: string force_merge_index: type: boolean default: true force_merge_on_clone: type: boolean description: "If `true`, and the index has replicas, ILM first clones the index with zero replicas and force merges the clone, so that replicas are not merged redundantly.\nIf `false`, the managed index is force merged directly.\nNot allowed when `force_merge_index` is `false`." default: true x-state: Generally available; Added in 9.2.1 total_shards_per_node: type: number description: "The maximum number of shards, including primaries and replicas, that can be allocated to any single node for the mounted index.\nMust be at least 1." x-state: Generally available; Added in 8.16.0 replicate_for: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The period for which the mounted index keeps one replica before the replica is removed.\nBy default, the index is mounted without replicas.\nMust be positive.\nOnly the first `searchable_snapshot` action in a policy may set this.\nIt must fit before the next phase starts: for example, if this phase has a `min_age` of 5d and the next phase has 12d, it can be at most 7d." x-state: Generally available; Added in 8.18.0 ilm._types.ShrinkAction: type: object properties: number_of_shards: type: number max_primary_shard_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' allow_write_after_shrink: type: boolean ilm._types.WaitForSnapshotAction: required: - policy type: object properties: policy: type: string ilm.explain_lifecycle.LifecycleExplainUnmanaged: required: - index - managed type: object properties: index: allOf: - $ref: '#/components/schemas/_types.IndexName' managed: enum: - 'false' type: string ilm.get_lifecycle.Lifecycle: required: - modified_date - policy - version type: object properties: modified_date: allOf: - $ref: '#/components/schemas/_types.DateTime' policy: allOf: - $ref: '#/components/schemas/ilm._types.Policy' version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' ilm._types.Policy: required: - phases type: object properties: phases: allOf: - $ref: '#/components/schemas/ilm._types.Phases' _meta: allOf: - $ref: '#/components/schemas/_types.Metadata' description: Arbitrary metadata that is not automatically generated or used by Elasticsearch. ilm._types.Phases: type: object properties: cold: allOf: - $ref: '#/components/schemas/ilm._types.Phase' delete: allOf: - $ref: '#/components/schemas/ilm._types.Phase' frozen: allOf: - $ref: '#/components/schemas/ilm._types.Phase' hot: allOf: - $ref: '#/components/schemas/ilm._types.Phase' warm: allOf: - $ref: '#/components/schemas/ilm._types.Phase' ilm.move_to_step.StepKey: required: - phase type: object properties: action: type: string description: The optional action to which the index will be moved. name: type: string description: The optional step name to which the index will be moved. phase: type: string _types.OpType: enum: - index - create type: string indices._types.IndicesBlockOptions: enum: - metadata - read - read_only - write type: string indices.add_block.AddIndicesBlockStatus: required: - name - blocked type: object properties: name: allOf: - $ref: '#/components/schemas/_types.IndexName' blocked: type: boolean indices.analyze.TextToAnalyze: oneOf: - type: string - type: array items: type: string indices.analyze.AnalyzeDetail: required: - custom_analyzer type: object properties: analyzer: allOf: - $ref: '#/components/schemas/indices.analyze.AnalyzerDetail' charfilters: type: array items: $ref: '#/components/schemas/indices.analyze.CharFilterDetail' custom_analyzer: type: boolean tokenfilters: type: array items: $ref: '#/components/schemas/indices.analyze.TokenDetail' tokenizer: allOf: - $ref: '#/components/schemas/indices.analyze.TokenDetail' indices.analyze.AnalyzerDetail: required: - name - tokens type: object properties: name: type: string tokens: type: array items: $ref: '#/components/schemas/indices.analyze.ExplainAnalyzeToken' indices.analyze.ExplainAnalyzeToken: required: - bytes - end_offset - position - positionLength - start_offset - termFrequency - token - type type: object properties: bytes: type: string end_offset: type: number keyword: type: boolean position: type: number positionLength: type: number start_offset: type: number termFrequency: type: number token: type: string type: type: string indices.analyze.CharFilterDetail: required: - filtered_text - name type: object properties: filtered_text: type: array items: type: string name: type: string indices.analyze.TokenDetail: required: - name - tokens type: object properties: name: type: string tokens: type: array items: $ref: '#/components/schemas/indices.analyze.ExplainAnalyzeToken' indices.analyze.AnalyzeToken: required: - end_offset - position - start_offset - token - type type: object properties: end_offset: type: number position: type: number positionLength: type: number start_offset: type: number token: type: string type: type: string _types.ShardsOperationResponseBase: type: object properties: _shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' indices.close.CloseIndexResult: required: - closed type: object properties: closed: type: boolean shards: type: object additionalProperties: $ref: '#/components/schemas/indices.close.CloseShardResult' indices.close.CloseShardResult: required: - failures type: object properties: failures: type: array items: $ref: '#/components/schemas/_types.ShardFailure' _types.DataStreamName: type: string indices.create_from.CreateFrom: type: object properties: mappings_override: allOf: - $ref: '#/components/schemas/_types.mapping.TypeMapping' description: Mappings overrides to be applied to the destination index (optional) settings_override: allOf: - $ref: '#/components/schemas/indices._types.IndexSettings' description: Settings overrides to be applied to the destination index (optional) remove_index_blocks: type: boolean description: If index blocks should be removed when creating destination index (optional) default: true indices.data_streams_stats.DataStreamsStatsItem: required: - backing_indices - data_stream - maximum_timestamp - store_size_bytes type: object properties: backing_indices: type: number description: Current number of backing indices for the data stream. data_stream: allOf: - $ref: '#/components/schemas/_types.Name' description: Name of the data stream. maximum_timestamp: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: "The data stream’s highest `@timestamp` value, converted to milliseconds since the Unix epoch.\nNOTE: This timestamp is provided as a best effort.\nThe data stream may contain `@timestamp` values higher than this if one or more of the following conditions are met:\nThe stream contains closed backing indices;\nBacking indices with a lower generation contain higher `@timestamp` values." store_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "Total size of all shards for the data stream’s backing indices.\nThis parameter is only returned if the `human` query parameter is `true`." store_size_bytes: type: number description: 'Total size, in bytes, of all shards for the data stream’s backing indices.' _types.IndicesResponseBase: allOf: - $ref: '#/components/schemas/_types.AcknowledgedResponseBase' - type: object properties: _shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' indices._types.AliasesResponseBody: allOf: - $ref: '#/components/schemas/_types.AcknowledgedResponseBase' - type: object properties: errors: type: boolean description: "If `true`, at least one alias action failed.\nThe request still returns HTTP 200." x-state: Generally available; Added in 8.14.0 _types.DataStreamNames: oneOf: - $ref: '#/components/schemas/_types.DataStreamName' - type: array items: $ref: '#/components/schemas/_types.DataStreamName' indices._types.DownsampleConfig: required: - fixed_interval type: object properties: fixed_interval: allOf: - $ref: '#/components/schemas/_types.DurationLarge' description: The interval at which to aggregate the original time series index. sampling_method: allOf: - $ref: '#/components/schemas/indices._types.SamplingMethod' description: The sampling method used to reduce the documents; it can be either `aggregate` or `last_value`. Defaults to `aggregate`. indices.explain_data_lifecycle.DataStreamLifecycleExplain: required: - index - managed_by_lifecycle type: object properties: index: allOf: - $ref: '#/components/schemas/_types.IndexName' managed_by_lifecycle: type: boolean index_creation_date_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' time_since_index_creation: allOf: - $ref: '#/components/schemas/_types.Duration' rollover_date_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' time_since_rollover: allOf: - $ref: '#/components/schemas/_types.Duration' lifecycle: allOf: - $ref: '#/components/schemas/indices._types.DataStreamLifecycleWithRollover' generation_time: allOf: - $ref: '#/components/schemas/_types.Duration' error: type: string frozen_transition_status: type: string unmanaged_reason: type: string indices.field_usage_stats.FieldsUsageBody: required: - _shards type: object properties: _shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' indices.forcemerge._types.ForceMergeResponseBody: allOf: - $ref: '#/components/schemas/_types.ShardsOperationResponseBase' - type: object properties: task: type: string description: "task contains a task id returned when wait_for_completion=false,\nyou can use the task_id to get the status of the task at _tasks/" indices.get.Features: oneOf: - $ref: '#/components/schemas/indices.get.Feature' - type: array items: $ref: '#/components/schemas/indices.get.Feature' indices.get.Feature: enum: - aliases - mappings - settings type: string indices._types.IndexState: type: object properties: aliases: type: object additionalProperties: $ref: '#/components/schemas/indices._types.Alias' mappings: allOf: - $ref: '#/components/schemas/_types.mapping.TypeMapping' settings: allOf: - $ref: '#/components/schemas/indices._types.IndexSettings' defaults: allOf: - $ref: '#/components/schemas/indices._types.IndexSettings' description: 'Default settings, included when the request''s `include_default` is `true`.' data_stream: allOf: - $ref: '#/components/schemas/_types.DataStreamName' lifecycle: allOf: - $ref: '#/components/schemas/indices._types.DataStreamLifecycle' description: Data stream lifecycle applicable if this is a data stream. x-state: Generally available; Added in 8.11.0 indices.get_alias._types.IndexAliases: required: - aliases type: object properties: aliases: type: object additionalProperties: $ref: '#/components/schemas/indices._types.AliasDefinition' indices.get_alias._types.NotFoundAliases: required: - error - status type: object properties: error: type: string status: type: number indices.get_data_lifecycle.DataStreamWithLifecycle: required: - name type: object properties: name: allOf: - $ref: '#/components/schemas/_types.DataStreamName' lifecycle: allOf: - $ref: '#/components/schemas/indices._types.DataStreamLifecycleWithRollover' indices.get_data_lifecycle._types.GlobalRetention: type: object properties: max_retention: allOf: - $ref: '#/components/schemas/_types.Duration' default_retention: allOf: - $ref: '#/components/schemas/_types.Duration' indices.get_data_lifecycle_stats.DataStreamStats: required: - backing_indices_in_error - backing_indices_in_total - name type: object properties: backing_indices_in_error: type: number description: The count of the backing indices for the data stream. backing_indices_in_total: type: number description: The count of the backing indices for the data stream that have encountered an error. name: allOf: - $ref: '#/components/schemas/_types.DataStreamName' description: The name of the data stream. indices._types.DataStream: required: - generation - hidden - next_generation_managed_by - prefer_ilm - indices - name - rollover_on_write - settings - status - template - timestamp_field type: object properties: _meta: allOf: - $ref: '#/components/schemas/_types.Metadata' description: "Custom metadata for the stream, copied from the `_meta` object of the stream’s matching index template.\nIf empty, the response omits this property." allow_custom_routing: type: boolean description: 'If `true`, the data stream allows custom routing on write request.' failure_store: allOf: - $ref: '#/components/schemas/indices._types.FailureStore' description: Information about failure store backing indices generation: type: number description: 'Current generation for the data stream. This number acts as a cumulative count of the stream’s rollovers, starting at 1.' hidden: type: boolean description: 'If `true`, the data stream is hidden.' ilm_policy: allOf: - $ref: '#/components/schemas/_types.Name' description: "Name of the current ILM lifecycle policy in the stream’s matching index template.\nThis lifecycle policy is set in the `index.lifecycle.name` setting.\nIf the template does not include a lifecycle policy, this property is not included in the response.\nNOTE: A data stream’s backing indices may be assigned different lifecycle policies. To retrieve the lifecycle policy for individual backing indices, use the get index settings API." next_generation_managed_by: allOf: - $ref: '#/components/schemas/indices._types.ManagedBy' description: Name of the lifecycle system that'll manage the next generation of the data stream. prefer_ilm: type: boolean description: Indicates if ILM should take precedence over DSL in case both are configured to managed this data stream. indices: type: array items: $ref: '#/components/schemas/indices._types.DataStreamIndex' description: "Array of objects containing information about the data stream’s backing indices.\nThe last item in this array contains information about the stream’s current write index." lifecycle: allOf: - $ref: '#/components/schemas/indices._types.DataStreamLifecycleWithRollover' description: Contains the configuration for the data stream lifecycle of this data stream. x-state: Generally available; Added in 8.11.0 name: allOf: - $ref: '#/components/schemas/_types.DataStreamName' description: Name of the data stream. replicated: type: boolean description: 'If `true`, the data stream is created and managed by cross-cluster replication and the local cluster can not write into this data stream or change its mappings.' rollover_on_write: type: boolean description: 'If `true`, the next write to this data stream will trigger a rollover first and the document will be indexed in the new backing index. If the rollover fails the indexing request will fail too.' settings: allOf: - $ref: '#/components/schemas/indices._types.IndexSettings' description: "The settings specific to this data stream that will take precedence over the settings in the matching index\ntemplate." mappings: allOf: - $ref: '#/components/schemas/_types.mapping.TypeMapping' description: "The mappings specific to this data stream that will take precedence over the mappings in the matching index\ntemplate." status: allOf: - $ref: '#/components/schemas/_types.HealthStatus' description: "Health status of the data stream.\nThis health status is based on the state of the primary and replica shards of the stream’s backing indices.\n\nSupported values include:\n - `green` (or `GREEN`): All shards are assigned.\n - `yellow` (or `YELLOW`): All primary shards are assigned, but one or more replica shards are unassigned. If a node in the cluster fails, some data could be unavailable until that node is repaired.\n - `red` (or `RED`): One or more primary shards are unassigned, so some data is unavailable. This can occur briefly during cluster startup as primary shards are assigned.\n - `unknown`\n - `unavailable`\n\n" system: type: boolean description: 'If `true`, the data stream is created and managed by an Elastic stack component and cannot be modified through normal user interaction.' x-state: Generally available; Added in 7.10.0 template: allOf: - $ref: '#/components/schemas/_types.Name' description: "Name of the index template used to create the data stream’s backing indices.\nThe template’s index pattern must match the name of this data stream." timestamp_field: allOf: - $ref: '#/components/schemas/indices._types.DataStreamTimestampField' description: Information about the `@timestamp` field in the data stream. index_mode: allOf: - $ref: '#/components/schemas/indices._types.IndexMode' description: The index mode for the data stream that will be used for newly created backing indices. indices._types.FailureStore: required: - enabled - indices - rollover_on_write type: object properties: enabled: type: boolean indices: type: array items: $ref: '#/components/schemas/indices._types.DataStreamIndex' rollover_on_write: type: boolean indices._types.DataStreamIndex: required: - index_name - index_uuid type: object properties: index_name: allOf: - $ref: '#/components/schemas/_types.IndexName' description: Name of the backing index. index_uuid: allOf: - $ref: '#/components/schemas/_types.Uuid' description: Universally unique identifier (UUID) for the index. ilm_policy: allOf: - $ref: '#/components/schemas/_types.Name' description: Name of the current ILM lifecycle policy configured for this backing index. managed_by: allOf: - $ref: '#/components/schemas/indices._types.ManagedBy' description: Name of the lifecycle system that's currently managing this backing index. prefer_ilm: type: boolean description: Indicates if ILM should take precedence over DSL in case both are configured to manage this index. index_mode: allOf: - $ref: '#/components/schemas/indices._types.IndexMode' description: The index mode of this backing index of the data stream. indices._types.ManagedBy: enum: - Index Lifecycle Management - Data stream lifecycle - Unmanaged type: string indices._types.IndexMode: enum: - standard - time_series - logsdb - lookup type: string indices._types.DataStreamTimestampField: required: - name type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Field' description: 'Name of the timestamp field for the data stream, which must be `@timestamp`. The `@timestamp` field must be included in every document indexed to the data stream.' indices.get_data_stream_mappings.DataStreamMappings: required: - name - mappings - effective_mappings type: object properties: name: type: string description: The name of the data stream. mappings: allOf: - $ref: '#/components/schemas/_types.mapping.TypeMapping' description: The settings specific to this data stream effective_mappings: allOf: - $ref: '#/components/schemas/_types.mapping.TypeMapping' description: "The settings specific to this data stream merged with the settings from its template. These `effective_settings`\nare the settings that will be used when a new index is created for this data stream." indices.get_data_stream_options.DataStreamWithOptions: required: - name type: object properties: name: allOf: - $ref: '#/components/schemas/_types.DataStreamName' options: allOf: - $ref: '#/components/schemas/indices._types.DataStreamOptions' indices.get_data_stream_settings.DataStreamSettings: required: - name - settings - effective_settings type: object properties: name: type: string description: The name of the data stream. settings: allOf: - $ref: '#/components/schemas/indices._types.IndexSettings' description: The settings specific to this data stream effective_settings: allOf: - $ref: '#/components/schemas/indices._types.IndexSettings' description: "The settings specific to this data stream merged with the settings from its template. These `effective_settings`\nare the settings that will be used when a new index is created for this data stream." indices.get_field_mapping.TypeFieldMappings: required: - mappings type: object properties: mappings: type: object additionalProperties: $ref: '#/components/schemas/_types.mapping.FieldMapping' _types.mapping.FieldMapping: required: - full_name - mapping type: object properties: full_name: type: string mapping: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.mapping.Property' indices.get_index_template.IndexTemplateItem: required: - name - index_template type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' index_template: allOf: - $ref: '#/components/schemas/indices._types.IndexTemplateWithRollover' indices._types.IndexTemplateWithRollover: required: - index_patterns - composed_of type: object properties: template: allOf: - $ref: '#/components/schemas/indices._types.IndexTemplateSummaryWithRollover' description: "Template to be applied.\nIt may optionally include an `aliases`, `mappings`, or `settings` configuration." index_patterns: allOf: - $ref: '#/components/schemas/_types.Names' description: Array of wildcard (`*`) expressions used to match the names of data streams and indices during creation. composed_of: type: array items: $ref: '#/components/schemas/_types.Name' description: "An ordered list of component template names.\nComponent templates are merged in the order specified, meaning that the last component template specified has the highest precedence." version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' description: "Version number used to manage index templates externally.\nThis number is not automatically generated by Elasticsearch." priority: type: number description: "Priority to determine index template precedence when a new data stream or index is created.\nThe index template with the highest priority is chosen.\nIf no priority is specified the template is treated as though it is of priority 0 (lowest priority).\nThis number is not automatically generated by Elasticsearch." _meta: allOf: - $ref: '#/components/schemas/_types.Metadata' description: "Optional user metadata about the index template. May have any contents.\nThis map is not automatically generated by Elasticsearch." allow_auto_create: type: boolean data_stream: allOf: - $ref: '#/components/schemas/indices._types.IndexTemplateDataStreamConfiguration' description: "If this object is included, the template is used to create data streams and their backing indices.\nSupports an empty object.\nData streams require a matching index template with a `data_stream` object." deprecated: type: boolean description: "Marks this index template as deprecated.\nWhen creating or updating a non-deprecated index template that uses deprecated components,\nElasticsearch will emit a deprecation warning." x-state: Generally available; Added in 8.12.0 ignore_missing_component_templates: allOf: - $ref: '#/components/schemas/_types.Names' description: A list of component template names that are allowed to be absent. x-state: Generally available; Added in 8.7.0 created_date: allOf: - $ref: '#/components/schemas/_types.DateTime' description: Date and time when the index template was created. Only returned if the `human` query parameter is `true`. x-state: Generally available; Added in 9.2.0 created_date_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: 'Date and time when the index template was created, in milliseconds since the epoch.' x-state: Generally available; Added in 9.2.0 modified_date: allOf: - $ref: '#/components/schemas/_types.DateTime' description: Date and time when the index template was last modified. Only returned if the `human` query parameter is `true`. x-state: Generally available; Added in 9.2.0 modified_date_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: 'Date and time when the index template was last modified, in milliseconds since the epoch.' x-state: Generally available; Added in 9.2.0 indices._types.IndexTemplateSummaryWithRollover: type: object properties: lifecycle: allOf: - $ref: '#/components/schemas/indices._types.DataStreamLifecycleWithRollover' x-state: Generally available; Added in 8.11.0 aliases: type: object additionalProperties: $ref: '#/components/schemas/indices._types.Alias' description: "Aliases to add.\nIf the index template includes a `data_stream` object, these are data stream aliases.\nOtherwise, these are index aliases.\nData stream aliases ignore the `index_routing`, `routing`, and `search_routing` options." mappings: allOf: - $ref: '#/components/schemas/_types.mapping.TypeMapping' description: "Mapping for fields in the index.\nIf specified, this mapping can include field names, field data types, and mapping parameters." settings: allOf: - $ref: '#/components/schemas/indices._types.IndexSettings' description: Configuration options for the index. data_stream_options: allOf: - $ref: '#/components/schemas/indices._types.DataStreamOptions' x-state: Generally available; Added in 8.19.0 indices._types.IndexTemplateDataStreamConfiguration: type: object properties: hidden: type: boolean description: 'If true, the data stream is hidden.' default: false allow_custom_routing: type: boolean description: 'If true, the data stream supports custom routing.' default: false indices.get_mapping.IndexMappingRecord: required: - mappings type: object properties: item: allOf: - $ref: '#/components/schemas/_types.mapping.TypeMapping' mappings: allOf: - $ref: '#/components/schemas/_types.mapping.TypeMapping' indices.get_migrate_reindex_status.StatusInProgress: required: - index - total_doc_count - reindexed_doc_count type: object properties: index: type: string total_doc_count: type: number reindexed_doc_count: type: number indices.get_migrate_reindex_status.StatusError: required: - index - message type: object properties: index: type: string message: type: string indices._types.TemplateMapping: required: - aliases - index_patterns - mappings - order - settings type: object properties: aliases: type: object additionalProperties: $ref: '#/components/schemas/indices._types.Alias' index_patterns: type: array items: $ref: '#/components/schemas/_types.Name' mappings: allOf: - $ref: '#/components/schemas/_types.mapping.TypeMapping' order: type: number settings: type: object additionalProperties: type: object version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' indices.migrate_reindex.MigrateReindex: required: - mode - source type: object properties: mode: allOf: - $ref: '#/components/schemas/indices.migrate_reindex.ModeEnum' description: Reindex mode. Currently only 'upgrade' is supported. source: allOf: - $ref: '#/components/schemas/indices.migrate_reindex.SourceIndex' description: The source index or data stream (only data streams are currently supported). indices.migrate_reindex.ModeEnum: enum: - upgrade type: string indices.migrate_reindex.SourceIndex: required: - index type: object properties: index: allOf: - $ref: '#/components/schemas/_types.IndexName' indices.modify_data_stream.Action: maxProperties: 1 minProperties: 1 type: object properties: add_backing_index: allOf: - $ref: '#/components/schemas/indices.modify_data_stream.IndexAndDataStreamAction' description: "Adds an existing index as a backing index for a data stream.\nThe index is hidden as part of this operation.\nWARNING: Adding indices with the `add_backing_index` action can potentially result in improper data stream behavior.\nThis should be considered an expert level API." remove_backing_index: allOf: - $ref: '#/components/schemas/indices.modify_data_stream.IndexAndDataStreamAction' description: "Removes a backing index from a data stream.\nThe index is unhidden as part of this operation.\nA data stream’s write index cannot be removed." delete_backing_index: allOf: - $ref: '#/components/schemas/indices.modify_data_stream.IndexAndDataStreamAction' description: "Deletes a backing index from a data stream.\nA data stream’s write index cannot be deleted because it is the write index." x-state: Generally available; Added in 9.5.0 indices.modify_data_stream.IndexAndDataStreamAction: required: - data_stream - index type: object properties: data_stream: allOf: - $ref: '#/components/schemas/_types.DataStreamName' description: Data stream targeted by the action. index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: Index for the action. indices.put_data_stream_mappings.UpdatedDataStreamMappings: required: - name - applied_to_data_stream type: object properties: name: allOf: - $ref: '#/components/schemas/_types.IndexName' description: The data stream name. applied_to_data_stream: type: boolean description: "If the mappings were successfully applied to the data stream (or would have been, if running in `dry_run`\nmode), it is `true`. If an error occurred, it is `false`." error: type: string description: A message explaining why the mappings could not be applied to the data stream. mappings: allOf: - $ref: '#/components/schemas/_types.mapping.TypeMapping' description: The mappings that are specfic to this data stream that will override any mappings from the matching index template. effective_mappings: allOf: - $ref: '#/components/schemas/_types.mapping.TypeMapping' description: "The mappings that are effective on this data stream, taking into account the mappings from the matching index\ntemplate and the mappings specific to this data stream." indices.put_data_stream_settings.UpdatedDataStreamSettings: required: - name - applied_to_data_stream - settings - effective_settings - index_settings_results type: object properties: name: allOf: - $ref: '#/components/schemas/_types.IndexName' description: The data stream name. applied_to_data_stream: type: boolean description: "If the settings were successfully applied to the data stream (or would have been, if running in `dry_run`\nmode), it is `true`. If an error occurred, it is `false`." error: type: string description: A message explaining why the settings could not be applied to the data stream. settings: allOf: - $ref: '#/components/schemas/indices._types.IndexSettings' description: The settings that are specfic to this data stream that will override any settings from the matching index template. effective_settings: allOf: - $ref: '#/components/schemas/indices._types.IndexSettings' description: "The settings that are effective on this data stream, taking into account the settings from the matching index\ntemplate and the settings specific to this data stream." index_settings_results: allOf: - $ref: '#/components/schemas/indices.put_data_stream_settings.IndexSettingResults' description: Information about whether and where each setting was applied. indices.put_data_stream_settings.IndexSettingResults: required: - applied_to_data_stream_only - applied_to_data_stream_and_backing_indices type: object properties: applied_to_data_stream_only: type: array items: type: string description: "The list of settings that were applied to the data stream but not to backing indices. These will be applied to\nthe write index the next time the data stream is rolled over." applied_to_data_stream_and_backing_indices: type: array items: type: string description: "The list of settings that were applied to the data stream and to all of its backing indices. These settings will\nalso be applied to the write index the next time the data stream is rolled over." errors: type: array items: $ref: '#/components/schemas/indices.put_data_stream_settings.DataStreamSettingsError' indices.put_data_stream_settings.DataStreamSettingsError: required: - index - error type: object properties: index: allOf: - $ref: '#/components/schemas/_types.IndexName' error: type: string description: A message explaining why the settings could not be applied to specific indices. indices._types.DataStreamVisibility: type: object properties: hidden: type: boolean allow_custom_routing: type: boolean failure_store: type: boolean indices.recovery.RecoveryStatus: required: - shards type: object properties: shards: type: array items: $ref: '#/components/schemas/indices.recovery.ShardRecovery' indices.recovery.ShardRecovery: required: - id - index - primary - source - stage - start_time_in_millis - target - total_time_in_millis - translog - type - verify_index type: object properties: id: type: number index: allOf: - $ref: '#/components/schemas/indices.recovery.RecoveryIndexStatus' primary: type: boolean source: allOf: - $ref: '#/components/schemas/indices.recovery.RecoveryOrigin' stage: allOf: - $ref: '#/components/schemas/indices.recovery.RecoveryStage' description: "The recovery stage.\n\nSupported values include:\n - `CREATED`: The shard's recovery state has been created, but the recovery has not started yet (it may be queued behind other ongoing recoveries).\n - `INIT`: Recovery has started and is initializing.\n - `INDEX`: Reading index metadata and copying bytes from source to destination.\n - `VERIFY_INDEX`: Verifying the integrity of the index.\n - `TRANSLOG`: Replaying the transaction log.\n - `FINALIZE`: Cleanup.\n - `DONE`: Complete.\n\n" local_retries: type: number description: The number of times this recovery has failed in a way which is retried locally (i.e. on the data node). x-state: Generally available; Added in 9.6.0 priority: allOf: - $ref: '#/components/schemas/indices.recovery.RecoveryPriority' description: "The recovery priority.\n\nSupported values include:\n - `UNASSIGNED_NEW_PRIMARY`: A primary shard which is unassigned because it is newly created.\n - `UNASSIGNED_UNEXPECTED`: A shard which is unassigned because of an unexpected condition, i.e. some kind of failure.\n - `UNASSIGNED_EXPECTED`: A shard which is unassigned for an expected condition, i.e. because of a user operation such as opening or restoring an index, but which is not an UNASSIGNED_NEW_PRIMARY.\n - `RELOCATION_CAN_REMAIN_NO`: A shard which is assigned, and is being relocated because it cannot remain on its current node according to the allocation deciders.\n - `RELOCATION_CAN_REMAIN_NOT_PREFERRED`: A shard which is assigned, and is being relocated because it is not preferred for it to remain on its current node according to the allocation deciders.\n - `RELOCATE_REBALANCING`: A shard which is assigned, and is being relocated for rebalancing.\n - `UNKNOWN`: Placeholder value for unknown priorities.\n\n" x-state: Generally available; Added in 9.6.0 gate: type: string description: "The name of the recovery gate that blocked recovery on the target node.\n\nOnly present for queued recoveries in the `CREATED` stage that are blocked by a recovery gate." x-state: Generally available; Added in 9.6.0 blocked_for_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: "The elapsed time in milliseconds recovery is blocked for.\n\nOnly present with `gate`." x-state: Generally available; Added in 9.6.0 start: allOf: - $ref: '#/components/schemas/indices.recovery.RecoveryStartStatus' start_time: allOf: - $ref: '#/components/schemas/_types.DateTime' description: "The time the recovery started.\nFor recoveries in the `CREATED` stage (not yet started), this value is the Unix epoch (1970-01-01T00:00:00.000Z)." start_time_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: "The time the recovery started, in milliseconds since the Unix epoch.\nFor recoveries in the `CREATED` stage (not yet started), this value is 0." stop_time: allOf: - $ref: '#/components/schemas/_types.DateTime' description: The time the recovery completed. Only present for completed recoveries (`DONE` stage). stop_time_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: "The time the recovery completed, in milliseconds since the Unix epoch.\nOnly present for completed recoveries (`DONE` stage)." target: allOf: - $ref: '#/components/schemas/indices.recovery.RecoveryOrigin' total_time: allOf: - $ref: '#/components/schemas/_types.Duration' total_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: "The total elapsed recovery time in milliseconds.\nFor recoveries in the `CREATED` stage (not yet started), this value is 0." translog: allOf: - $ref: '#/components/schemas/indices.recovery.TranslogStatus' type: allOf: - $ref: '#/components/schemas/indices.recovery.RecoveryType' description: "The recovery source type.\n\nSupported values include:\n - `EMPTY_STORE`: An empty store. Indicates a new primary shard or the forced allocation of an empty primary shard using the cluster reroute API.\n - `EXISTING_STORE`: The store of an existing primary shard. Indicates recovery is related to node startup or the allocation of an existing primary shard.\n - `LOCAL_SHARDS`: Shards of another index on the same node. Indicates recovery is related to a clone, shrink, or split operation.\n - `PEER`: A primary shard on another node. Indicates recovery is related to shard replication.\n - `SNAPSHOT`: A snapshot. Indicates recovery is related to a snapshot restore operation.\n\n" verify_index: allOf: - $ref: '#/components/schemas/indices.recovery.VerifyIndex' indices.recovery.RecoveryIndexStatus: required: - files - size - source_throttle_time_in_millis - target_throttle_time_in_millis - total_time_in_millis type: object properties: bytes: allOf: - $ref: '#/components/schemas/indices.recovery.RecoveryBytes' files: allOf: - $ref: '#/components/schemas/indices.recovery.RecoveryFiles' size: allOf: - $ref: '#/components/schemas/indices.recovery.RecoveryBytes' source_throttle_time: allOf: - $ref: '#/components/schemas/_types.Duration' source_throttle_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' target_throttle_time: allOf: - $ref: '#/components/schemas/_types.Duration' target_throttle_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' total_time: allOf: - $ref: '#/components/schemas/_types.Duration' total_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' indices.recovery.RecoveryBytes: required: - percent - recovered_in_bytes - reused_in_bytes - total_in_bytes type: object properties: percent: allOf: - $ref: '#/components/schemas/_types.Percentage' recovered: allOf: - $ref: '#/components/schemas/_types.ByteSize' recovered_in_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' recovered_from_snapshot: allOf: - $ref: '#/components/schemas/_types.ByteSize' recovered_from_snapshot_in_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' reused: allOf: - $ref: '#/components/schemas/_types.ByteSize' reused_in_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' total: allOf: - $ref: '#/components/schemas/_types.ByteSize' total_in_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' indices.recovery.RecoveryFiles: required: - percent - recovered - reused - total type: object properties: details: type: array items: $ref: '#/components/schemas/indices.recovery.FileDetails' percent: allOf: - $ref: '#/components/schemas/_types.Percentage' recovered: type: number reused: type: number total: type: number indices.recovery.FileDetails: required: - length - name - recovered type: object properties: length: type: number name: type: string recovered: type: number indices.recovery.RecoveryOrigin: type: object properties: hostname: type: string host: allOf: - $ref: '#/components/schemas/_types.Host' transport_address: allOf: - $ref: '#/components/schemas/_types.TransportAddress' id: allOf: - $ref: '#/components/schemas/_types.Id' ip: allOf: - $ref: '#/components/schemas/_types.Ip' name: allOf: - $ref: '#/components/schemas/_types.Name' bootstrap_new_history_uuid: type: boolean repository: allOf: - $ref: '#/components/schemas/_types.Name' snapshot: allOf: - $ref: '#/components/schemas/_types.Name' version: allOf: - $ref: '#/components/schemas/_types.VersionString' restoreUUID: allOf: - $ref: '#/components/schemas/_types.Uuid' index: allOf: - $ref: '#/components/schemas/_types.IndexName' indices.recovery.RecoveryStage: enum: - CREATED - INIT - INDEX - VERIFY_INDEX - TRANSLOG - FINALIZE - DONE type: string indices.recovery.RecoveryPriority: enum: - UNASSIGNED_NEW_PRIMARY - UNASSIGNED_UNEXPECTED - UNASSIGNED_EXPECTED - RELOCATION_CAN_REMAIN_NO - RELOCATION_CAN_REMAIN_NOT_PREFERRED - RELOCATE_REBALANCING - UNKNOWN type: string indices.recovery.RecoveryStartStatus: required: - check_index_time_in_millis - total_time_in_millis type: object properties: check_index_time: allOf: - $ref: '#/components/schemas/_types.Duration' check_index_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' total_time: allOf: - $ref: '#/components/schemas/_types.Duration' total_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' indices.recovery.TranslogStatus: required: - percent - recovered - total - total_on_start - total_time_in_millis type: object properties: percent: allOf: - $ref: '#/components/schemas/_types.Percentage' recovered: type: number total: type: number total_on_start: type: number total_time: allOf: - $ref: '#/components/schemas/_types.Duration' total_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' indices.recovery.RecoveryType: enum: - EMPTY_STORE - EXISTING_STORE - LOCAL_SHARDS - PEER - SNAPSHOT type: string indices.recovery.VerifyIndex: required: - check_index_time_in_millis - total_time_in_millis type: object properties: check_index_time: allOf: - $ref: '#/components/schemas/_types.Duration' check_index_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' total_time: allOf: - $ref: '#/components/schemas/_types.Duration' total_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' indices.reload_search_analyzers.ReloadResult: required: - reload_details - _shards type: object properties: reload_details: type: array items: $ref: '#/components/schemas/indices.reload_search_analyzers.ReloadDetails' _shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' indices.reload_search_analyzers.ReloadDetails: required: - index - reloaded_analyzers - reloaded_node_ids type: object properties: index: type: string reloaded_analyzers: type: array items: type: string reloaded_node_ids: type: array items: type: string indices.remove_block.RemoveIndicesBlockStatus: required: - name type: object properties: name: allOf: - $ref: '#/components/schemas/_types.IndexName' unblocked: type: boolean exception: allOf: - $ref: '#/components/schemas/_types.ErrorCause' indices.resolve_cluster.ResolveClusterInfo: required: - connected - skip_unavailable type: object properties: connected: type: boolean description: Whether the remote cluster is connected to the local (querying) cluster. skip_unavailable: type: boolean description: The `skip_unavailable` setting for a remote cluster. matching_indices: type: boolean description: "Whether the index expression provided in the request matches any indices, aliases or data streams\non the cluster." error: type: string description: "Provides error messages that are likely to occur if you do a search with this index expression\non the specified cluster (for example, lack of security privileges to query an index)." version: allOf: - $ref: '#/components/schemas/_types.ElasticsearchVersionMinInfo' description: Provides version information about the cluster. description: Provides information about each cluster request relevant to doing a cross-cluster search. _types.ElasticsearchVersionMinInfo: required: - build_flavor - minimum_index_compatibility_version - minimum_wire_compatibility_version - number type: object properties: build_flavor: type: string minimum_index_compatibility_version: allOf: - $ref: '#/components/schemas/_types.VersionString' minimum_wire_compatibility_version: allOf: - $ref: '#/components/schemas/_types.VersionString' number: type: string description: Reduced (minimal) info ElasticsearchVersion indices.resolve_index.ResolveIndexItem: required: - name - attributes type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' aliases: type: array items: type: string attributes: type: array items: type: string data_stream: allOf: - $ref: '#/components/schemas/_types.DataStreamName' mode: allOf: - $ref: '#/components/schemas/indices._types.IndexMode' indices.resolve_index.ResolveIndexAliasItem: required: - name - indices type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' indices: allOf: - $ref: '#/components/schemas/_types.Indices' indices.resolve_index.ResolveIndexDataStreamsItem: required: - name - timestamp_field - backing_indices type: object properties: name: allOf: - $ref: '#/components/schemas/_types.DataStreamName' timestamp_field: allOf: - $ref: '#/components/schemas/_types.Field' backing_indices: allOf: - $ref: '#/components/schemas/_types.Indices' indices.rollover.RolloverConditions: type: object properties: min_age: allOf: - $ref: '#/components/schemas/_types.Duration' max_age: allOf: - $ref: '#/components/schemas/_types.Duration' max_age_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' min_docs: type: number max_docs: type: number max_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The `max_size` condition has been deprecated in 9.3.0 and `max_primary_shard_size` should be used instead deprecated: true max_size_bytes: type: number min_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' min_size_bytes: type: number max_primary_shard_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' max_primary_shard_size_bytes: type: number min_primary_shard_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' min_primary_shard_size_bytes: type: number max_primary_shard_docs: type: number min_primary_shard_docs: type: number indices.segments.IndexSegment: required: - shards type: object properties: shards: type: object additionalProperties: oneOf: - $ref: '#/components/schemas/indices.segments.ShardsSegment' - type: array items: $ref: '#/components/schemas/indices.segments.ShardsSegment' indices.segments.ShardsSegment: required: - num_committed_segments - routing - num_search_segments - segments type: object properties: num_committed_segments: type: number routing: allOf: - $ref: '#/components/schemas/indices.segments.ShardSegmentRouting' num_search_segments: type: number segments: type: object additionalProperties: $ref: '#/components/schemas/indices.segments.Segment' indices.segments.ShardSegmentRouting: required: - node - primary - state type: object properties: node: allOf: - $ref: '#/components/schemas/_types.NodeId' description: The node ID of the node that holds the shard. relocating_node: allOf: - $ref: '#/components/schemas/_types.NodeId' description: The node ID of the node the shard is relocating to. Only returned while the shard is relocating. primary: type: boolean description: 'If `true`, the shard is a primary shard.' state: type: string description: 'The state of the shard, such as `STARTED` or `RELOCATING`.' indices.segments.Segment: required: - committed - deleted_docs - generation - search - size_in_bytes - num_docs type: object properties: attributes: type: object additionalProperties: type: string description: Contains information about whether high compression was enabled and per-field vector formats. committed: type: boolean description: "If `true`, the segment is synced to disk. Segments that are synced can survive a hard reboot.\nIf `false`, the data from uncommitted segments is also stored in the transaction log so that Elasticsearch is able to replay changes on the next start." compound: type: boolean description: 'If `true`, Lucene merged all files from the segment into a single file to save file descriptors.' deleted_docs: type: number description: "The number of deleted documents as reported by Lucene, which may be higher or lower than the number of delete operations you have performed.\nThis number excludes deletes that were performed recently and do not yet belong to a segment.\nDeleted documents are cleaned up by the automatic merge process if it makes sense to do so.\nAlso, Elasticsearch creates extra deleted documents to internally track the recent history of operations on a shard." generation: type: number description: 'Generation number, such as `0`. Elasticsearch increments this generation number for each segment written then uses this number to derive the segment name.' search: type: boolean description: "If `true`, the segment is searchable.\nIf `false`, the segment has most likely been written to disk but needs a refresh to be searchable." merge_id: type: string description: The ID of the merge the segment is part of. Only returned while the segment is being merged. sort: type: array items: $ref: '#/components/schemas/indices.segments.SegmentSort' description: The index sort of the segment. Only returned when the index is sorted. size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Disk space used by the segment. size_in_bytes: type: number description: 'Disk space used by the segment, in bytes.' num_docs: type: number description: "The number of documents as reported by Lucene.\nThis excludes deleted documents and counts any nested documents separately from their parents.\nIt also excludes documents which were indexed recently and do not yet belong to a segment." version: allOf: - $ref: '#/components/schemas/_types.VersionString' description: Version of Lucene used to write the segment. auto_calibration: type: object additionalProperties: $ref: '#/components/schemas/indices.segments.SegmentAutoCalibration' description: "The auto-calibration information of the segment, per `dense_vector` field that supports auto-calibration.\nOnly returned when `include_auto_calibration` is `true`." x-state: Generally available; Added in 9.6.0 indices.segments.SegmentSort: required: - field - reverse type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The name of the sort field. mode: type: string description: 'The selector used to pick a value from multi-valued fields, such as `min` or `max`. Only returned for numeric and keyword fields.' missing: type: string description: The value used for documents that are missing the field. reverse: type: boolean description: 'If `true`, the sort order is descending.' indices.segments.SegmentAutoCalibration: oneOf: - $ref: '#/components/schemas/indices.segments.OsqSegmentAutoCalibration' description: "The auto-calibration information of a `dense_vector` field in a segment.\n\nThe shape of `parameters` depends on the quantization method of the field." discriminator: propertyName: type mapping: osq: '#/components/schemas/indices.segments.OsqSegmentAutoCalibration' indices.segments.OsqSegmentAutoCalibration: allOf: - $ref: '#/components/schemas/indices.segments.SegmentAutoCalibrationBase' - required: - type type: object properties: type: enum: - osq type: string parameters: allOf: - $ref: '#/components/schemas/indices.segments.OsqSegmentAutoCalibrationParameters' description: The calibration parameters. indices.shard_stores.ShardStoreStatus: enum: - green - yellow - red - all type: string indices.shard_stores.IndicesShardStores: required: - shards type: object properties: shards: type: object additionalProperties: $ref: '#/components/schemas/indices.shard_stores.ShardStoreWrapper' indices.shard_stores.ShardStoreWrapper: required: - stores type: object properties: stores: type: array items: $ref: '#/components/schemas/indices.shard_stores.ShardStore' indices.shard_stores.ShardStore: required: - allocation type: object properties: allocation: allOf: - $ref: '#/components/schemas/indices.shard_stores.ShardStoreAllocation' description: "The status of the store copy, whether it is used as a primary, replica, or not used at all.\n\nSupported values include:\n - `primary`: The store copy is used as a primary shard.\n - `replica`: The store copy is used as a replica shard.\n - `unused`: The store copy is not used.\n\n" allocation_id: allOf: - $ref: '#/components/schemas/_types.Id' description: The allocation ID of the store copy. store_exception: allOf: - $ref: '#/components/schemas/indices.shard_stores.ShardStoreException' description: Any exception encountered while opening the shard index or from an earlier engine failure. indices.shard_stores.ShardStoreAllocation: enum: - primary - replica - unused type: string indices.shard_stores.ShardStoreException: required: - reason - type type: object properties: reason: type: string type: type: string indices._types.IndexTemplate: required: - index_patterns - composed_of type: object properties: index_patterns: allOf: - $ref: '#/components/schemas/_types.Names' description: Array of wildcard (`*`) expressions used to match the names of data streams and indices during creation. composed_of: type: array items: $ref: '#/components/schemas/_types.Name' description: "An ordered list of component template names.\nComponent templates are merged in the order specified, meaning that the last component template specified has the highest precedence." template: allOf: - $ref: '#/components/schemas/indices._types.IndexTemplateSummary' description: "Template to be applied.\nIt may optionally include an `aliases`, `mappings`, or `settings` configuration." version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' description: "Version number used to manage index templates externally.\nThis number is not automatically generated by Elasticsearch." priority: type: number description: "Priority to determine index template precedence when a new data stream or index is created.\nThe index template with the highest priority is chosen.\nIf no priority is specified the template is treated as though it is of priority 0 (lowest priority).\nThis number is not automatically generated by Elasticsearch." _meta: allOf: - $ref: '#/components/schemas/_types.Metadata' description: "Optional user metadata about the index template. May have any contents.\nThis map is not automatically generated by Elasticsearch." allow_auto_create: type: boolean data_stream: allOf: - $ref: '#/components/schemas/indices._types.IndexTemplateDataStreamConfiguration' description: "If this object is included, the template is used to create data streams and their backing indices.\nSupports an empty object.\nData streams require a matching index template with a `data_stream` object." deprecated: type: boolean description: "Marks this index template as deprecated.\nWhen creating or updating a non-deprecated index template that uses deprecated components,\nElasticsearch will emit a deprecation warning." x-state: Generally available; Added in 8.12.0 ignore_missing_component_templates: allOf: - $ref: '#/components/schemas/_types.Names' description: A list of component template names that are allowed to be absent. x-state: Generally available; Added in 8.7.0 created_date: allOf: - $ref: '#/components/schemas/_types.DateTime' description: Date and time when the index template was created. Only returned if the `human` query parameter is `true`. x-state: Generally available; Added in 9.2.0 created_date_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: 'Date and time when the index template was created, in milliseconds since the epoch.' x-state: Generally available; Added in 9.2.0 modified_date: allOf: - $ref: '#/components/schemas/_types.DateTime' description: Date and time when the index template was last modified. Only returned if the `human` query parameter is `true`. x-state: Generally available; Added in 9.2.0 modified_date_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: 'Date and time when the index template was last modified, in milliseconds since the epoch.' x-state: Generally available; Added in 9.2.0 indices._types.IndexTemplateSummary: type: object properties: aliases: type: object additionalProperties: $ref: '#/components/schemas/indices._types.Alias' description: "Aliases to add.\nIf the index template includes a `data_stream` object, these are data stream aliases.\nOtherwise, these are index aliases.\nData stream aliases ignore the `index_routing`, `routing`, and `search_routing` options." mappings: allOf: - $ref: '#/components/schemas/_types.mapping.TypeMapping' description: "Mapping for fields in the index.\nIf specified, this mapping can include field names, field data types, and mapping parameters." settings: allOf: - $ref: '#/components/schemas/indices._types.IndexSettings' description: Configuration options for the index. lifecycle: allOf: - $ref: '#/components/schemas/indices._types.DataStreamLifecycle' x-state: Generally available; Added in 8.11.0 data_stream_options: allOf: - $ref: '#/components/schemas/indices._types.DataStreamOptions' x-state: Generally available; Added in 8.19.0 indices.simulate_template.Overlapping: required: - name - index_patterns type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' index_patterns: type: array items: type: string indices.simulate_template.Template: required: - aliases - mappings - settings type: object properties: aliases: type: object additionalProperties: $ref: '#/components/schemas/indices._types.Alias' mappings: allOf: - $ref: '#/components/schemas/_types.mapping.TypeMapping' settings: allOf: - $ref: '#/components/schemas/indices._types.IndexSettings' _types.CommonStatsFlags: oneOf: - $ref: '#/components/schemas/_types.CommonStatsFlag' - type: array items: $ref: '#/components/schemas/_types.CommonStatsFlag' _types.CommonStatsFlag: enum: - _all - store - indexing - get - search - merge - flush - refresh - query_cache - fielddata - docs - warmer - completion - segments - translog - request_cache - recovery - bulk - shard_stats - mappings - dense_vector - sparse_vector type: string indices.stats.IndicesStats: type: object properties: primaries: allOf: - $ref: '#/components/schemas/indices.stats.IndexStats' shards: type: object additionalProperties: type: array items: $ref: '#/components/schemas/indices.stats.ShardStats' total: allOf: - $ref: '#/components/schemas/indices.stats.IndexStats' uuid: allOf: - $ref: '#/components/schemas/_types.Uuid' health: allOf: - $ref: '#/components/schemas/_types.HealthStatus' description: "\n\nSupported values include:\n - `green` (or `GREEN`): All shards are assigned.\n - `yellow` (or `YELLOW`): All primary shards are assigned, but one or more replica shards are unassigned. If a node in the cluster fails, some data could be unavailable until that node is repaired.\n - `red` (or `RED`): One or more primary shards are unassigned, so some data is unavailable. This can occur briefly during cluster startup as primary shards are assigned.\n - `unknown`\n - `unavailable`\n\n" x-state: Generally available; Added in 8.1.0 status: allOf: - $ref: '#/components/schemas/indices.stats.IndexMetadataState' x-state: Generally available; Added in 8.1.0 indices.stats.IndexStats: type: object properties: completion: allOf: - $ref: '#/components/schemas/_types.CompletionStats' description: Contains statistics about completions across all shards assigned to the node. dense_vector: allOf: - $ref: '#/components/schemas/cluster.stats.DenseVectorStats' description: Contains statistics about the dense vectors in the index. docs: allOf: - $ref: '#/components/schemas/_types.DocStats' description: Contains statistics about documents across all primary shards assigned to the node. fielddata: allOf: - $ref: '#/components/schemas/_types.FielddataStats' description: Contains statistics about the field data cache across all shards assigned to the node. flush: allOf: - $ref: '#/components/schemas/_types.FlushStats' description: Contains statistics about flush operations for the node. get: allOf: - $ref: '#/components/schemas/_types.GetStats' description: Contains statistics about get operations for the node. indexing: allOf: - $ref: '#/components/schemas/_types.IndexingStats' description: Contains statistics about indexing operations for the node. indices: allOf: - $ref: '#/components/schemas/indices.stats.IndicesStats' description: Contains statistics about indices operations for the node. merges: allOf: - $ref: '#/components/schemas/_types.MergesStats' description: Contains statistics about merge operations for the node. query_cache: allOf: - $ref: '#/components/schemas/_types.QueryCacheStats' description: Contains statistics about the query cache across all shards assigned to the node. recovery: allOf: - $ref: '#/components/schemas/_types.RecoveryStats' description: Contains statistics about recovery operations for the node. refresh: allOf: - $ref: '#/components/schemas/_types.RefreshStats' description: Contains statistics about refresh operations for the node. request_cache: allOf: - $ref: '#/components/schemas/_types.RequestCacheStats' description: Contains statistics about the request cache across all shards assigned to the node. search: allOf: - $ref: '#/components/schemas/_types.SearchStats' description: Contains statistics about search operations for the node. segments: allOf: - $ref: '#/components/schemas/_types.SegmentsStats' description: Contains statistics about segments across all shards assigned to the node. sparse_vector: allOf: - $ref: '#/components/schemas/cluster.stats.SparseVectorStats' description: Contains statistics about the sparse vectors in the index. store: allOf: - $ref: '#/components/schemas/_types.StoreStats' description: Contains statistics about the size of shards assigned to the node. translog: allOf: - $ref: '#/components/schemas/_types.TranslogStats' description: Contains statistics about transaction log operations for the node. warmer: allOf: - $ref: '#/components/schemas/_types.WarmerStats' description: Contains statistics about index warming operations for the node. bulk: allOf: - $ref: '#/components/schemas/_types.BulkStats' shard_stats: allOf: - $ref: '#/components/schemas/indices.stats.ShardsTotalStats' x-state: Generally available; Added in 7.15.0 _types.FlushStats: required: - periodic - total - total_time_in_millis - total_time_excluding_waiting_on_lock_in_millis type: object properties: periodic: type: number total: type: number total_time: allOf: - $ref: '#/components/schemas/_types.Duration' total_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' total_time_excluding_waiting: allOf: - $ref: '#/components/schemas/_types.Duration' total_time_excluding_waiting_on_lock_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' _types.GetStats: required: - current - exists_time_in_millis - exists_total - missing_time_in_millis - missing_total - time_in_millis - total type: object properties: current: type: number exists_time: allOf: - $ref: '#/components/schemas/_types.Duration' exists_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' exists_total: type: number missing_time: allOf: - $ref: '#/components/schemas/_types.Duration' missing_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' missing_total: type: number getTime: allOf: - $ref: '#/components/schemas/_types.Duration' time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' total: type: number _types.IndexingStats: required: - index_current - delete_current - delete_time_in_millis - delete_total - is_throttled - noop_update_total - throttle_time_in_millis - index_time_in_millis - index_total - index_failed - index_failed_due_to_version_conflict type: object properties: index_current: type: number delete_current: type: number delete_time: allOf: - $ref: '#/components/schemas/_types.Duration' delete_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' delete_total: type: number is_throttled: type: boolean noop_update_total: type: number throttle_time: allOf: - $ref: '#/components/schemas/_types.Duration' throttle_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' index_time: allOf: - $ref: '#/components/schemas/_types.Duration' index_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' index_total: type: number index_failed: type: number index_failed_due_to_version_conflict: type: number types: type: object additionalProperties: $ref: '#/components/schemas/_types.IndexingStats' write_load: type: number recent_write_load: type: number peak_write_load: type: number _types.MergesStats: required: - current - current_docs - current_size_in_bytes - total - total_auto_throttle_in_bytes - total_docs - total_size_in_bytes - total_stopped_time_in_millis - total_throttled_time_in_millis - total_time_in_millis type: object properties: current: type: number current_docs: type: number current_size: type: string current_size_in_bytes: type: number total: type: number total_auto_throttle: type: string total_auto_throttle_in_bytes: type: number total_docs: type: number total_size: type: string total_size_in_bytes: type: number total_stopped_time: allOf: - $ref: '#/components/schemas/_types.Duration' total_stopped_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' total_throttled_time: allOf: - $ref: '#/components/schemas/_types.Duration' total_throttled_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' total_time: allOf: - $ref: '#/components/schemas/_types.Duration' total_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' _types.RecoveryStats: required: - current_as_source - current_as_target - throttle_time_in_millis type: object properties: current_as_source: type: number current_as_source_queued: type: number x-state: Generally available; Added in 9.5.0 current_as_target: type: number current_as_target_queued: type: number x-state: Generally available; Added in 9.5.0 current_from_store: type: number x-state: Generally available; Added in 9.5.0 current_from_store_queued: type: number x-state: Generally available; Added in 9.5.0 throttle_time: allOf: - $ref: '#/components/schemas/_types.Duration' throttle_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' _types.RefreshStats: required: - external_total - external_total_time_in_millis - listeners - total - total_time_in_millis type: object properties: external_total: type: number external_total_time: allOf: - $ref: '#/components/schemas/_types.Duration' external_total_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' listeners: type: number total: type: number total_time: allOf: - $ref: '#/components/schemas/_types.Duration' total_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' _types.RequestCacheStats: required: - evictions - hit_count - memory_size_in_bytes - miss_count type: object properties: evictions: type: number hit_count: type: number memory_size: type: string memory_size_in_bytes: type: number miss_count: type: number _types.SearchStats: required: - fetch_current - fetch_time_in_millis - fetch_total - fetch_failure - query_current - query_time_in_millis - query_total - query_failure - scroll_current - scroll_time_in_millis - scroll_total - suggest_current - suggest_time_in_millis - suggest_total type: object properties: fetch_current: type: number fetch_time: allOf: - $ref: '#/components/schemas/_types.Duration' fetch_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' fetch_total: type: number fetch_failure: type: number open_contexts: type: number query_current: type: number query_time: allOf: - $ref: '#/components/schemas/_types.Duration' query_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' query_total: type: number query_failure: type: number scroll_current: type: number scroll_time: allOf: - $ref: '#/components/schemas/_types.Duration' scroll_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' scroll_total: type: number suggest_current: type: number suggest_time: allOf: - $ref: '#/components/schemas/_types.Duration' suggest_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' suggest_total: type: number recent_search_load: type: number groups: type: object additionalProperties: $ref: '#/components/schemas/_types.SearchStats' _types.TranslogStats: required: - earliest_last_modified_age - operations - size_in_bytes - uncommitted_operations - uncommitted_size_in_bytes type: object properties: earliest_last_modified_age: type: number operations: type: number size: type: string size_in_bytes: type: number uncommitted_operations: type: number uncommitted_size: type: string uncommitted_size_in_bytes: type: number _types.WarmerStats: required: - current - total - total_time_in_millis type: object properties: current: type: number total: type: number total_time: allOf: - $ref: '#/components/schemas/_types.Duration' total_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' _types.BulkStats: required: - total_operations - total_time_in_millis - total_size_in_bytes - avg_time_in_millis - avg_size_in_bytes type: object properties: total_operations: type: number total_time: allOf: - $ref: '#/components/schemas/_types.Duration' total_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' total_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' total_size_in_bytes: type: number avg_time: allOf: - $ref: '#/components/schemas/_types.Duration' avg_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' avg_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' avg_size_in_bytes: type: number indices.stats.ShardsTotalStats: required: - total_count type: object properties: total_count: type: number indices.stats.ShardStats: type: object properties: commit: allOf: - $ref: '#/components/schemas/indices.stats.ShardCommit' completion: allOf: - $ref: '#/components/schemas/_types.CompletionStats' dense_vector: allOf: - $ref: '#/components/schemas/cluster.stats.DenseVectorStats' docs: allOf: - $ref: '#/components/schemas/_types.DocStats' fielddata: allOf: - $ref: '#/components/schemas/_types.FielddataStats' flush: allOf: - $ref: '#/components/schemas/_types.FlushStats' get: allOf: - $ref: '#/components/schemas/_types.GetStats' indexing: allOf: - $ref: '#/components/schemas/_types.IndexingStats' mappings: allOf: - $ref: '#/components/schemas/indices.stats.MappingStats' merges: allOf: - $ref: '#/components/schemas/_types.MergesStats' shard_path: allOf: - $ref: '#/components/schemas/indices.stats.ShardPath' query_cache: allOf: - $ref: '#/components/schemas/indices.stats.ShardQueryCache' recovery: allOf: - $ref: '#/components/schemas/_types.RecoveryStats' refresh: allOf: - $ref: '#/components/schemas/_types.RefreshStats' request_cache: allOf: - $ref: '#/components/schemas/_types.RequestCacheStats' retention_leases: allOf: - $ref: '#/components/schemas/indices.stats.ShardRetentionLeases' routing: allOf: - $ref: '#/components/schemas/indices.stats.ShardRouting' search: allOf: - $ref: '#/components/schemas/_types.SearchStats' segments: allOf: - $ref: '#/components/schemas/_types.SegmentsStats' seq_no: allOf: - $ref: '#/components/schemas/indices.stats.ShardSequenceNumber' sparse_vector: allOf: - $ref: '#/components/schemas/cluster.stats.SparseVectorStats' store: allOf: - $ref: '#/components/schemas/_types.StoreStats' translog: allOf: - $ref: '#/components/schemas/_types.TranslogStats' warmer: allOf: - $ref: '#/components/schemas/_types.WarmerStats' bulk: allOf: - $ref: '#/components/schemas/_types.BulkStats' shards: type: object additionalProperties: type: object x-state: Generally available; Added in 7.15.0 shard_stats: allOf: - $ref: '#/components/schemas/indices.stats.ShardsTotalStats' indices: type: object additionalProperties: $ref: '#/components/schemas/indices.stats.ShardStats' indices.stats.ShardCommit: required: - generation - id - num_docs - user_data type: object properties: generation: type: number id: allOf: - $ref: '#/components/schemas/_types.Id' num_docs: type: number user_data: type: object additionalProperties: type: string indices.stats.MappingStats: required: - total_count - total_estimated_overhead_in_bytes - total_segments - total_segment_fields - average_fields_per_segment type: object properties: total_count: type: number total_estimated_overhead: allOf: - $ref: '#/components/schemas/_types.ByteSize' total_estimated_overhead_in_bytes: type: number total_segments: type: number total_segment_fields: type: number average_fields_per_segment: type: number indices.stats.ShardPath: required: - data_path - is_custom_data_path - state_path type: object properties: data_path: type: string is_custom_data_path: type: boolean state_path: type: string indices.stats.ShardQueryCache: required: - cache_count - cache_size - evictions - hit_count - memory_size_in_bytes - miss_count - total_count type: object properties: cache_count: type: number cache_size: type: number evictions: type: number hit_count: type: number memory_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' memory_size_in_bytes: type: number miss_count: type: number total_count: type: number indices.stats.ShardRetentionLeases: required: - primary_term - version - leases type: object properties: primary_term: type: number version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' leases: type: array items: $ref: '#/components/schemas/indices.stats.ShardLease' indices.stats.ShardLease: required: - id - retaining_seq_no - timestamp - source type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' retaining_seq_no: allOf: - $ref: '#/components/schemas/_types.SequenceNumber' timestamp: type: number source: type: string indices.stats.ShardRouting: required: - node - primary - state type: object properties: node: type: string primary: type: boolean relocating_node: oneOf: - type: string - type: - 'null' - string state: allOf: - $ref: '#/components/schemas/indices.stats.ShardRoutingState' indices.stats.ShardRoutingState: enum: - UNASSIGNED - INITIALIZING - STARTED - RELOCATING type: string indices.stats.ShardSequenceNumber: required: - global_checkpoint - local_checkpoint - max_seq_no type: object properties: global_checkpoint: type: number local_checkpoint: type: number max_seq_no: allOf: - $ref: '#/components/schemas/_types.SequenceNumber' indices.stats.IndexMetadataState: enum: - open - close type: string indices.update_aliases.Action: maxProperties: 1 minProperties: 1 type: object properties: add: allOf: - $ref: '#/components/schemas/indices.update_aliases.AddAction' description: "Adds a data stream or index to an alias.\nIf the alias doesn’t exist, the `add` action creates it." remove: allOf: - $ref: '#/components/schemas/indices.update_aliases.RemoveAction' description: Removes a data stream or index from an alias. remove_index: allOf: - $ref: '#/components/schemas/indices.update_aliases.RemoveIndexAction' description: "Deletes an index.\nYou cannot use this action on aliases or data streams." indices.update_aliases.AddAction: type: object properties: alias: allOf: - $ref: '#/components/schemas/_types.IndexAlias' description: "Alias for the action.\nIndex alias names support date math." aliases: oneOf: - $ref: '#/components/schemas/_types.IndexAlias' - type: array items: $ref: '#/components/schemas/_types.IndexAlias' description: "Aliases for the action.\nIndex alias names support date math." filter: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: Query used to limit documents the alias can access. index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: "Data stream or index for the action.\nSupports wildcards (`*`).\nWildcard patterns that match both data streams and indices return an error." indices: allOf: - $ref: '#/components/schemas/_types.Indices' description: "Data streams or indices for the action.\nSupports wildcards (`*`).\nWildcard patterns that match both data streams and indices return an error." index_routing: type: string description: "Value used to route indexing operations to a specific shard.\nIf specified, this overwrites the `routing` value for indexing operations.\nData stream aliases don’t support this parameter." is_hidden: type: boolean description: 'If `true`, the alias is hidden.' default: false is_write_index: type: boolean description: 'If `true`, sets the write index or data stream for the alias.' routing: type: string description: "Value used to route indexing and search operations to a specific shard.\nData stream aliases don’t support this parameter." search_routing: type: string description: "Value used to route search operations to a specific shard.\nIf specified, this overwrites the `routing` value for search operations.\nData stream aliases don’t support this parameter." must_exist: type: boolean description: 'If `true`, the alias must exist to perform the action.' default: false indices.update_aliases.RemoveAction: type: object properties: alias: allOf: - $ref: '#/components/schemas/_types.IndexAlias' description: "Alias for the action.\nIndex alias names support date math." aliases: oneOf: - $ref: '#/components/schemas/_types.IndexAlias' - type: array items: $ref: '#/components/schemas/_types.IndexAlias' description: "Aliases for the action.\nIndex alias names support date math." index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: "Data stream or index for the action.\nSupports wildcards (`*`)." indices: allOf: - $ref: '#/components/schemas/_types.Indices' description: "Data streams or indices for the action.\nSupports wildcards (`*`)." must_exist: type: boolean description: 'If `true`, the alias must exist to perform the action.' default: false indices.update_aliases.RemoveIndexAction: type: object properties: index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: "Data stream or index for the action.\nSupports wildcards (`*`)." indices: allOf: - $ref: '#/components/schemas/_types.Indices' description: "Data streams or indices for the action.\nSupports wildcards (`*`)." must_exist: type: boolean description: 'If `true`, the alias must exist to perform the action.' default: false indices.update_aliases.IndicesUpdateAliasesResponseBody: allOf: - $ref: '#/components/schemas/indices._types.AliasesResponseBody' - type: object properties: action_results: type: array items: $ref: '#/components/schemas/indices.update_aliases.AliasActionResult' description: "Results for each action in the request.\nReturned only when `errors` is `true`." x-state: Generally available; Added in 8.14.0 indices.update_aliases.AliasActionResult: required: - action - status type: object properties: action: allOf: - $ref: '#/components/schemas/indices.update_aliases.AliasActionSummary' description: The action this result describes. status: type: number description: "HTTP status for this action.\n`200` when the action succeeds." error: allOf: - $ref: '#/components/schemas/_types.ErrorCause' description: "Cause of the failure.\nReturned only when this action fails." indices.update_aliases.AliasActionSummary: required: - type - indices - aliases type: object properties: type: allOf: - $ref: '#/components/schemas/indices.update_aliases.AliasActionType' description: The action that was applied. indices: type: array items: $ref: '#/components/schemas/_types.IndexName' description: Resolved data streams or indices for the action. aliases: type: array items: $ref: '#/components/schemas/_types.IndexAlias' description: Aliases for the action. indices.update_aliases.AliasActionType: enum: - add - remove - remove_index type: string indices.validate_query.IndicesValidationExplanation: required: - valid type: object properties: error: type: string explanation: type: string index: allOf: - $ref: '#/components/schemas/_types.IndexName' shard: type: number valid: type: boolean inference._types.RequestChatCompletion: required: - messages type: object properties: messages: type: array items: $ref: '#/components/schemas/inference._types.Message' description: "A list of objects representing the conversation.\nRequests should generally only add new messages from the user (role `user`).\nThe other message roles (`assistant`, `system`, or `tool`) should generally only be copied from the response to a previous completion request, such that the messages array is built up throughout a conversation." model: type: string description: 'The ID of the model to use. By default, the model ID is set to the value included when creating the inference endpoint.' max_completion_tokens: type: number description: The upper bound limit for the number of tokens that can be generated for a completion request. reasoning: allOf: - $ref: '#/components/schemas/inference._types.Reasoning' description: "The reasoning configuration for the completion request.\nThis controls the model's reasoning process in one of two ways:\n\n* By specifying the model’s reasoning effort level with the `effort` field.\n* By enabling reasoning with default settings by setting `enabled` field to `true`.\n\nIt also includes optional settings to control:\n\n* The level of detail in the summary returned in the response with the `summary` field.\n* Whether reasoning details are included in the response at all with the `exclude` field.\n\nExample (effort):\n```\n{\n \"reasoning\": {\n \"effort\": \"high\",\n \"summary\": \"concise\",\n \"exclude\": false\n }\n}\n```\nExample (enabled):\n```\n{\n \"reasoning\": {\n \"enabled\": true,\n \"summary\": \"concise\",\n \"exclude\": false\n }\n}\n```\nCurrently supported only for `elastic` provider." cache_control: allOf: - $ref: '#/components/schemas/inference._types.CacheControl' description: "The prompt caching configuration for the completion request.\nExample:\n```\n{\n \"cache_control\": {\n \"type\": \"ephemeral\",\n \"ttl\": \"1h\"\n }\n}\n```\nUnknown fields in the object and invalid `ttl` values return an error.\nCurrently supported only for `elastic` provider." x-state: Generally available; Added in 9.6.0 session_id: type: string description: "An identifier that groups related completion requests into a session.\nCurrently supported only for `elastic` provider." x-state: Generally available; Added in 9.6.0 stop: type: array items: type: string description: A sequence of strings to control when the model should stop generating additional tokens. temperature: type: number description: The sampling temperature to use. tool_choice: allOf: - $ref: '#/components/schemas/inference._types.CompletionToolType' description: "Controls which tool is called by the model.\nString representation: One of `auto`, `none`, or `requrired`. `auto` allows the model to choose between calling tools and generating a message. `none` causes the model to not call any tools. `required` forces the model to call one or more tools.\nExample (object representation):\n```\n{\n \"tool_choice\": {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\"\n }\n }\n}\n```" tools: type: array items: $ref: '#/components/schemas/inference._types.CompletionTool' description: "A list of tools that the model can call.\nExample:\n```\n{\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_price_of_item\",\n \"description\": \"Get the current price of an item\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"id\": \"12345\"\n },\n \"unit\": {\n \"type\": \"currency\"\n }\n }\n }\n }\n }\n ]\n}\n```" top_p: type: number description: 'Nucleus sampling, an alternative to sampling with temperature.' inference._types.Message: required: - role type: object properties: content: allOf: - $ref: '#/components/schemas/inference._types.MessageContent' description: "The content of the message.\n\nString example:\n```\n{\n \"content\": \"Some string\"\n}\n```\n\nText example:\n```\n{\n \"content\": [\n {\n \"text\": \"Some text\",\n \"type\": \"text\"\n }\n ]\n}\n```\n\nImage example:\n```\n{\n \"content\": [\n {\n \"image_url\": {\n \"url\": \"data:image/jpeg;base64,...\"\n },\n \"type\": \"image_url\"\n }\n ]\n}\n```\n\nFile example:\n```\n{\n \"content\": [\n {\n \"file\": {\n \"file_data\": \"data:application/pdf;base64,...\",\n \"filename\": \"somePDF\"\n },\n \"type\": \"file\"\n }\n ]\n}\n```" role: type: string description: 'The role of the message author. Valid values are `user`, `assistant`, `system`, and `tool`.' tool_call_id: allOf: - $ref: '#/components/schemas/_types.Id' description: Only for `tool` role messages. The tool call that this message is responding to. tool_calls: type: array items: $ref: '#/components/schemas/inference._types.ToolCall' description: "Only for `assistant` role messages. The tool calls generated by the model. If it's specified, the `content` field is optional.\nExample:\n```\n{\n \"tool_calls\": [\n {\n \"id\": \"call_KcAjWtAww20AihPHphUh46Gd\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"arguments\": \"{\\\"location\\\":\\\"Boston, MA\\\"}\"\n }\n }\n ]\n}\n```" reasoning: type: string description: "Only for `assistant` role messages. The reasoning details generated by the model as plaintext.\nCurrently supported only for `elastic` provider." reasoning_details: type: array items: $ref: '#/components/schemas/inference._types.ReasoningDetail' description: "Only for `assistant` role messages. The reasoning details generated by the model as structured data.\nCurrently supported only for `elastic` provider." description: An object representing part of the conversation. inference._types.MessageContent: oneOf: - type: string - type: array items: $ref: '#/components/schemas/inference._types.ContentObject' inference._types.ContentObject: required: - type - text - image_url - file type: object properties: type: allOf: - $ref: '#/components/schemas/inference._types.ContentType' description: "The type of content. Must be one of `text`, `image_url` or `file`. Not all services/models support content\ntypes other than \"text\"" text: type: string description: The text content. Only applicable for the `text` type image_url: allOf: - $ref: '#/components/schemas/inference._types.ImageUrl' description: The image content. Only applicable for the `image_url` type file: allOf: - $ref: '#/components/schemas/inference._types.FileContent' description: The file content. Only applicable for the `file` type description: An object style representation of a single portion of a conversation. inference._types.ContentType: enum: - text - image_url - file type: string inference._types.ImageUrl: required: - url type: object properties: url: type: string description: The base64 encoded image data as a data URI detail: allOf: - $ref: '#/components/schemas/inference._types.ImageUrlDetail' description: Specifies the detail level of the image inference._types.ImageUrlDetail: enum: - auto - low - high type: string inference._types.FileContent: required: - file_data - filename type: object properties: file_data: type: string description: The base64 encoded file data filename: type: string description: The name of the file inference._types.ToolCall: required: - id - function - type type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: The identifier of the tool call. function: allOf: - $ref: '#/components/schemas/inference._types.ToolCallFunction' description: The function that the model called. type: type: string description: The type of the tool call. description: A tool call generated by the model. inference._types.ToolCallFunction: required: - arguments - name type: object properties: arguments: type: string description: The arguments to call the function with in JSON format. name: type: string description: The name of the function to call. description: The function that the model called. inference._types.ReasoningDetail: oneOf: - $ref: '#/components/schemas/inference._types.EncryptedReasoningDetail' - $ref: '#/components/schemas/inference._types.SummaryReasoningDetail' - $ref: '#/components/schemas/inference._types.TextReasoningDetail' description: "Type representing the different types of reasoning details that can be included in the response from the model.\nCurrently supported only for `elastic` provider." discriminator: propertyName: type mapping: reasoning.encrypted: '#/components/schemas/inference._types.EncryptedReasoningDetail' reasoning.summary: '#/components/schemas/inference._types.SummaryReasoningDetail' reasoning.text: '#/components/schemas/inference._types.TextReasoningDetail' inference._types.EncryptedReasoningDetail: allOf: - $ref: '#/components/schemas/inference._types.BaseReasoningDetail' - required: - type - data type: object properties: type: enum: - reasoning.encrypted type: string data: type: string description: "The encrypted reasoning data generated by the model,\nwhich may be redacted or protected based on the model's configuration and the nature of the reasoning information." description: The reasoning detail with encrypted reasoning data that may be redacted or protected. inference._types.BaseReasoningDetail: type: object properties: format: type: string description: The format of the reasoning detail. id: type: string description: The identifier of the reasoning detail. index: type: number description: "The index of the reasoning detail,\nwhich indicates its position in the sequence of reasoning details generated by the model." description: The base reasoning detail that includes common fields across different types of reasoning details. inference._types.SummaryReasoningDetail: allOf: - $ref: '#/components/schemas/inference._types.BaseReasoningDetail' - required: - type - summary type: object properties: type: enum: - reasoning.summary type: string summary: type: string description: "The summary of the reasoning process generated by the model,\nwhich provides an overview of the key points and conclusions reached during the reasoning process." description: The reasoning summary detail includes a high-level summary of the model's reasoning process. inference._types.TextReasoningDetail: allOf: - $ref: '#/components/schemas/inference._types.BaseReasoningDetail' - required: - type type: object properties: type: enum: - reasoning.text type: string signature: type: string description: "The signature of the reasoning text,\nwhich can be used to verify the authenticity and integrity of the reasoning information provided by the model." text: type: string description: "The plaintext reasoning generated by the model,\nwhich provides a detailed explanation of the model's reasoning process in human-readable form." description: The reasoning text detail includes plaintext reasoning with optional signature verification. inference._types.Reasoning: type: object properties: effort: allOf: - $ref: '#/components/schemas/inference._types.ReasoningEffort' description: "The level of effort the model should put into reasoning.\nThis is a hint that guides the model in how much effort to put into reasoning,\nwith `xhigh` being the most effort and `none` being no effort." enabled: type: boolean description: "Whether to enable reasoning with default settings.\nThis is a shortcut for enabling reasoning without having to specify the other parameters.\nIf `enabled` is set to `true`, then reasoning at the `medium` effort level is enabled.\nIgnored if `effort` is specified,\nin which case that parameter will control the reasoning process instead." exclude: type: boolean description: "Whether to exclude reasoning information from the response.\nIf `true`, the response will not include any reasoning details." summary: allOf: - $ref: '#/components/schemas/inference._types.ReasoningSummary' description: "The level of detail included in the reasoning summary returned in the response.\nThis is a hint on how much detail to include in the summary of the reasoning that is returned in the response,\nwith `auto` being the default level of detail, `concise` being less detail, and `detailed` being more detail." description: "The reasoning configuration to use for the completion request.\nCurrently supported only for `elastic` provider." inference._types.ReasoningEffort: enum: - xhigh - high - medium - low - minimal - none type: string inference._types.ReasoningSummary: enum: - auto - concise - detailed type: string inference._types.CacheControl: type: object properties: type: type: string description: 'The type of cache control, for example `ephemeral`.' ttl: allOf: - $ref: '#/components/schemas/_types.Duration' description: 'The time to live of the cached content, for example `1h`.' description: "The prompt caching configuration to use for the completion request.\nCurrently supported only for `elastic` provider." inference._types.CompletionToolType: oneOf: - type: string - $ref: '#/components/schemas/inference._types.CompletionToolChoice' inference._types.CompletionToolChoice: required: - type - function type: object properties: type: type: string description: The type of the tool. function: allOf: - $ref: '#/components/schemas/inference._types.CompletionToolChoiceFunction' description: The tool choice function. description: Controls which tool is called by the model. inference._types.CompletionToolChoiceFunction: required: - name type: object properties: name: type: string description: The name of the function to call. description: The tool choice function. inference._types.CompletionTool: required: - type - function type: object properties: type: type: string description: The type of tool. function: allOf: - $ref: '#/components/schemas/inference._types.CompletionToolFunction' description: The function definition. description: A list of tools that the model can call. inference._types.CompletionToolFunction: required: - name type: object properties: description: type: string description: "A description of what the function does.\nThis is used by the model to choose when and how to call the function." name: type: string description: The name of the function. parameters: type: object description: The parameters the functional accepts. This should be formatted as a JSON object. strict: type: boolean description: Whether to enable schema adherence when generating the function call. description: The completion tool function definition. _types.StreamResult: type: object inference._types.TaskSettings: type: object inference._types.CompletionInferenceResult: required: - completion type: object properties: completion: type: array items: $ref: '#/components/schemas/inference._types.CompletionResult' description: Defines the completion result. inference._types.CompletionResult: required: - result type: object properties: result: type: string description: The completion result object inference.decision.DecisionInput: oneOf: - type: string - $ref: '#/components/schemas/inference._types.EmbeddingContentObjectItem' description: "The input for the `decision` task.\nEither a string, or an object. The object form additionally allows specifying images.\nThe `decision` task currently only supports the `text` and `image` types." inference._types.EmbeddingContentObjectItem: required: - type - value type: object properties: type: allOf: - $ref: '#/components/schemas/inference._types.EmbeddingContentType' description: "The type of input to embed. Not all models support all input types.\nThe `audio`, `video`, and `pdf` types are available in Elasticsearch 9.5.0 and later." format: allOf: - $ref: '#/components/schemas/inference._types.EmbeddingContentFormat' description: "The format of the input. For the `text` type this must be `text`. For all other types, this must be `base64` or `url`.\nIf not specified, this will default to `text` for the `text` type and `base64` for all other types.\nThe `url` format is available in Elasticsearch 9.6.0 and later.\nNot all services and models support all formats." value: type: string description: "The value of the input to embed. For the `base64` format, this must be a base64-encoded data URI, i.e. \"data:content/type;base64,...\".\nFor the `url` format, this must be a URL that points to the content, i.e. \"https://example.com/image.jpg\"." description: An object containing the input data for a single item for the model to embed. inference.decision.DecisionTaskSettings: type: object properties: questions: type: object additionalProperties: $ref: '#/components/schemas/inference.decision.DecisionQuestion' description: "The questions to answer, keyed by question name. The answers in the response use the same names.\nThe questions replace the ones of the inference endpoint as a whole. At least one question is required." description: The task settings of the `decision` task. inference.decision.DecisionQuestion: oneOf: - $ref: '#/components/schemas/inference.decision.PredicateDecisionQuestion' - $ref: '#/components/schemas/inference.decision.ChoiceDecisionQuestion' - $ref: '#/components/schemas/inference.decision.ScoreDecisionQuestion' description: "A question answered by the `decision` task.\nThe type of the question determines the type of its answer." discriminator: propertyName: type mapping: choice: '#/components/schemas/inference.decision.ChoiceDecisionQuestion' predicate: '#/components/schemas/inference.decision.PredicateDecisionQuestion' score: '#/components/schemas/inference.decision.ScoreDecisionQuestion' inference.decision.PredicateDecisionQuestion: allOf: - $ref: '#/components/schemas/inference.decision.DecisionQuestionBase' - required: - type type: object properties: type: enum: - predicate type: string description: A question answered with the probability that the statement in `instructions` is true. inference.decision.DecisionQuestionBase: required: - instructions type: object properties: instructions: type: string description: A description of what to decide. It must not be empty. inference.decision.ChoiceDecisionQuestion: allOf: - $ref: '#/components/schemas/inference.decision.DecisionQuestionBase' - required: - type - choices type: object properties: type: enum: - choice type: string choices: type: object additionalProperties: oneOf: - type: string - type: - 'null' - string description: 'The options to choose from, each mapped to an optional description. At least two choices are required.' description: A question answered with one option out of a fixed set of choices. inference.decision.ScoreDecisionQuestion: allOf: - $ref: '#/components/schemas/inference.decision.DecisionQuestionBase' - required: - type - levels type: object properties: type: enum: - score type: string levels: type: array items: $ref: '#/components/schemas/inference.decision.DecisionScoreLevel' description: 'The levels of the scale, ordered from lowest to highest. At least two levels are required.' description: A question answered with the probability-weighted position on an ordered scale of levels. inference.decision.DecisionScoreLevel: oneOf: - type: string - $ref: '#/components/schemas/inference.decision.DecisionScoreLevelObject' description: 'A level of a `score` question: either a plain label, or an object with a label and an optional description.' inference.decision.DecisionScoreLevelObject: required: - label type: object properties: label: type: string description: The label of the level. description: type: string description: A description of the level. inference._types.DecisionInferenceResult: required: - decision type: object properties: decision: allOf: - $ref: '#/components/schemas/inference._types.DecisionResult' description: Defines the response for a decision request. inference._types.DecisionResult: required: - answers type: object properties: answers: type: object additionalProperties: $ref: '#/components/schemas/inference._types.DecisionAnswer' description: 'The answers, keyed by the name of the question they answer.' inference._types.DecisionAnswer: oneOf: - $ref: '#/components/schemas/inference._types.PredicateDecisionAnswer' - $ref: '#/components/schemas/inference._types.ChoiceDecisionAnswer' - $ref: '#/components/schemas/inference._types.ScoreDecisionAnswer' description: "The answer to a single question of a decision request.\nThe type of the answer matches the type of the question it answers." discriminator: propertyName: type mapping: choice: '#/components/schemas/inference._types.ChoiceDecisionAnswer' predicate: '#/components/schemas/inference._types.PredicateDecisionAnswer' score: '#/components/schemas/inference._types.ScoreDecisionAnswer' inference._types.PredicateDecisionAnswer: required: - type - probability type: object properties: type: enum: - predicate type: string probability: type: number description: The probability that the statement in the question is true. description: The answer to a `predicate` question. inference._types.ChoiceDecisionAnswer: required: - type - choice - probabilities - confidence type: object properties: type: enum: - choice type: string choice: type: string description: The chosen option. probabilities: type: array items: $ref: '#/components/schemas/inference._types.ChoiceDecisionProbability' description: The probability of each option. confidence: type: number description: The confidence in the chosen option. description: The answer to a `choice` question. inference._types.ChoiceDecisionProbability: required: - value - probability type: object properties: value: type: string description: The option. probability: type: number description: The probability of the option. inference._types.ScoreDecisionAnswer: required: - type - score - probabilities - confidence type: object properties: type: enum: - score type: string score: type: number description: 'The probability-weighted position on the scale, from `0` for the lowest level.' probabilities: type: array items: $ref: '#/components/schemas/inference._types.ScoreDecisionProbability' description: 'The probability of each level, ordered from the lowest to the highest level.' confidence: type: number description: The confidence in the score. description: The answer to a `score` question. inference._types.ScoreDecisionProbability: required: - value - label - probability type: object properties: value: type: number description: 'The zero-based position of the level, which is also its position in the array.' label: type: string description: The label of the level. probability: type: number description: The probability of the level. inference._types.TaskType: enum: - sparse_embedding - text_embedding - rerank - completion - chat_completion - embedding - document_extraction - decision type: string inference._types.DeleteInferenceEndpointResult: allOf: - $ref: '#/components/schemas/_types.AcknowledgedResponseBase' - required: - pipelines type: object properties: pipelines: type: array items: type: string description: 'Acknowledged response. For dry_run, contains the list of pipelines which reference the inference endpoint' inference.document_extraction.DocumentExtractionInput: oneOf: - $ref: '#/components/schemas/inference.document_extraction.DocumentExtractionContentObject' - type: array items: $ref: '#/components/schemas/inference.document_extraction.DocumentExtractionContentObject' description: "The documents to extract the content from for the `document_extraction` task.\nEither a `content` object or an array of `content` objects." inference.document_extraction.DocumentExtractionContentObject: required: - content type: object properties: content: allOf: - $ref: '#/components/schemas/inference.document_extraction.DocumentExtractionContentObjectItem' description: The document to extract the content from. description: A wrapper object which contains a single document to extract the content from. inference.document_extraction.DocumentExtractionContentObjectItem: required: - type - value type: object properties: type: allOf: - $ref: '#/components/schemas/inference.document_extraction.DocumentExtractionContentType' description: The type of the document. Not all services and models support all types. format: allOf: - $ref: '#/components/schemas/inference.document_extraction.DocumentExtractionContentFormat' description: "The format of the document. If not specified, this defaults to `base64` for `pdf` and `image`, and `url` for `html`.\nThe `html` type supports `url` only.\nNot all services and models support all formats." value: type: string description: "The value of the document. For the `base64` format, this must be a base64-encoded data URI, that is, \"data:content/type;base64,...\".\nFor the `url` format, this must be a URL that points to the document, that is, \"https://example.com/document.pdf\"." description: An object describing a single document to extract the content from. inference.document_extraction.DocumentExtractionContentType: enum: - image - pdf - html type: string inference.document_extraction.DocumentExtractionContentFormat: enum: - base64 - url type: string inference.document_extraction.DocumentExtractionTaskSettings: type: object properties: output_format: allOf: - $ref: '#/components/schemas/inference.document_extraction.DocumentExtractionOutputFormat' description: The output format of the extracted content. Only `markdown` is supported. parameters: type: object additionalProperties: type: object description: "A free-form object of extraction options that is forwarded to the Elastic Inference Service as-is.\nThe accepted parameters are defined by the Elastic Inference Service." description: "Task settings for the `document_extraction` task type of the `elastic` service.\nThey can be set when creating the inference endpoint and overridden per request.\nRequest values take precedence, and `parameters` are merged per key." inference.document_extraction.DocumentExtractionOutputFormat: enum: - markdown type: string inference._types.DocumentExtractionInferenceResult: required: - document_extraction type: object properties: document_extraction: type: array items: $ref: '#/components/schemas/inference._types.DocumentExtractionResult' description: "Defines the response for a document extraction request.\nThe results are returned in the same order as the documents in the request." inference._types.DocumentExtractionResult: required: - content - format type: object properties: content: type: string description: The content extracted from the document. format: type: string description: 'The format of the extracted content, for example `markdown`.' metadata: allOf: - $ref: '#/components/schemas/_types.Metadata' description: 'Additional information about the document, such as its title. The available fields depend on the service and model.' description: The document extraction result object representing the content extracted from a single document. inference._types.RequestEmbedding: required: - input type: object properties: input: allOf: - $ref: '#/components/schemas/inference._types.EmbeddingInput' description: "Inference input.\nEither a string, an array of strings, a `content` object, or an array of `content` objects.\n`content` objects may contain a single item or an array of items. Models that support multiple items per `content`\nobject will return a single embedding for each `content` object, regardless of how many items it contains.\nSupport for multiple items in a single `content` object is available in Elasticsearch 9.5.0 and later.\n\nstring example:\n```\n\"input\": \"Some text\"\n```\nstring array example:\n```\n\"input\": [\"Some text\", \"Some more text\"]\n```\n`content` object example:\n```\n\"input\": {\n \"content\": {\n \"type\": \"image\",\n \"format\": \"base64\",\n \"value\": \"data:image/jpeg;base64,...\"\n }\n }\n```\n`content` object array example:\n```\n\"input\": [\n {\n \"content\": {\n \"type\": \"text\",\n \"format\": \"text\",\n \"value\": \"Some text to generate an embedding\"\n }\n },\n {\n \"content\": {\n \"type\": \"image\",\n \"format\": \"base64\",\n \"value\": \"data:image/jpeg;base64,...\"\n }\n }\n]\n```\n`content` object using the `url` format example (available in Elasticsearch 9.6.0 and later):\n```\n\"input\": {\n \"content\": {\n \"type\": \"image\",\n \"format\": \"url\",\n \"value\": \"https://example.com/image.jpg\"\n }\n }\n```\nMultiple items in one `content` object example (available in Elasticsearch 9.5.0 and later):\n```\n\"input\": [\n {\n \"content\": [\n {\n \"type\": \"image\",\n \"format\": \"base64\",\n \"value\": \"data:image/jpeg;base64,...\"\n },\n {\n \"type\": \"text\",\n \"value\": \"Some text to create an embedding\"\n }\n ]\n }\n]\n```" input_type: type: string description: "The input data type for the embedding model. Possible values include:\n* `SEARCH`\n* `INGEST`\n* `CLASSIFICATION`\n* `CLUSTERING`\n\nNot all models support all values. Unsupported values will trigger a validation exception.\nAccepted values depend on the configured inference service, refer to the relevant service-specific documentation for more info.\n\n> info\n> The `input_type` parameter specified on the root level of the request body will take precedence over the `input_type` parameter specified in `task_settings`." task_settings: allOf: - $ref: '#/components/schemas/inference._types.TaskSettings' description: Task settings for the individual inference request. These settings are specific to the you specified and override the task settings specified when initializing the service. inference._types.EmbeddingInput: oneOf: - $ref: '#/components/schemas/inference._types.EmbeddingStringInput' - $ref: '#/components/schemas/inference._types.EmbeddingContentInput' description: "Inference input.\nEither a string, an array of strings, a `content` object, or an array of `content` objects." inference._types.EmbeddingStringInput: oneOf: - type: string - type: array items: type: string description: Allows specifying text-only inputs for the `embedding` task. inference._types.EmbeddingContentInput: oneOf: - $ref: '#/components/schemas/inference._types.EmbeddingContentObject' - type: array items: $ref: '#/components/schemas/inference._types.EmbeddingContentObject' description: Allows specifying multimodal inputs for the `embedding` task. inference._types.EmbeddingContentObject: required: - content type: object properties: content: allOf: - $ref: '#/components/schemas/inference._types.EmbeddingContentObjectGroup' description: An object or an array of objects containing the input data for the model to embed description: A wrapper object which contains the fields required to specify multimodal inputs inference._types.EmbeddingContentObjectGroup: oneOf: - $ref: '#/components/schemas/inference._types.EmbeddingContentObjectItem' - type: array items: $ref: '#/components/schemas/inference._types.EmbeddingContentObjectItem' description: "Allows specifying one or multiple items for the `embedding` task, which should result in a single embedding vector.\nSupport for multiple items is available in Elasticsearch 9.5.0 and later." inference._types.EmbeddingInferenceResult: maxProperties: 1 minProperties: 1 type: object properties: embeddings_bytes: type: array items: $ref: '#/components/schemas/inference._types.DenseEmbeddingByteResult' embeddings_bits: type: array items: $ref: '#/components/schemas/inference._types.DenseEmbeddingByteResult' embeddings: type: array items: $ref: '#/components/schemas/inference._types.DenseEmbeddingResult' description: EmbeddingInferenceResult is an aggregation of mutually exclusive embeddings variants inference._types.DenseEmbeddingByteResult: required: - embedding type: object properties: embedding: allOf: - $ref: '#/components/schemas/inference._types.DenseByteVector' description: The dense embedding result object for byte representation inference._types.DenseByteVector: type: array items: $ref: '#/components/schemas/_types.byte' description: "Dense Embedding results containing bytes are represented as Dense\nVectors of bytes." inference._types.DenseEmbeddingResult: required: - embedding type: object properties: embedding: allOf: - $ref: '#/components/schemas/inference._types.DenseVector' description: The dense embedding result object for float representation inference._types.DenseVector: type: array items: type: number description: "Dense Embedding results are represented as Dense Vectors\nof floats." inference._types.InferenceEndpointInfo: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskType' description: The task type description: Represents an inference endpoint as returned by the GET API inference._types.InferenceEndpoint: required: - service - service_settings type: object properties: chunking_settings: allOf: - $ref: '#/components/schemas/inference._types.InferenceChunkingSettings' description: "The chunking configuration object.\nApplies only to the `embedding`, `sparse_embedding` and `text_embedding` task types.\nNot applicable to the `rerank`, `completion`, or `chat_completion` task types." service: type: string description: The service type service_settings: allOf: - $ref: '#/components/schemas/inference._types.ServiceSettings' description: Settings specific to the service task_settings: allOf: - $ref: '#/components/schemas/inference._types.TaskSettings' description: Task settings specific to the service and task type description: Configuration options when storing the inference endpoint inference._types.InferenceChunkingSettings: type: object properties: max_chunk_size: type: number description: "The maximum size of a chunk in words.\nThis value cannot be lower than `20` (for `sentence` strategy) or `10` (for `word` strategy).\nThis value should not exceed the window size for the associated model." default: 250 overlap: type: number description: "The number of overlapping words for chunks.\nIt is applicable only to a `word` chunking strategy.\nThis value cannot be higher than half the `max_chunk_size` value." default: 100 sentence_overlap: type: number description: "The number of overlapping sentences for chunks.\nIt is applicable only for a `sentence` chunking strategy.\nIt can be either `1` or `0`." default: 1 separator_group: type: string description: "Only applicable to the `recursive` strategy and required when using it.\n\nSets a predefined list of separators in the saved chunking settings based on the selected text type.\nValues can be `markdown` or `plaintext`.\n\nUsing this parameter is an alternative to manually specifying a custom `separators` list." separators: type: array items: type: string description: "Only applicable to the `recursive` strategy and required when using it.\n\nA list of strings used as possible split points when chunking text.\n\nEach string can be a plain string or a regular expression (regex) pattern.\nThe system tries each separator in order to split the text, starting from the first item in the list.\n\nAfter splitting, it attempts to recombine smaller pieces into larger chunks that stay within\nthe `max_chunk_size` limit, to reduce the total number of chunks generated." strategy: type: string description: "The chunking strategy: `sentence`, `word`, `none` or `recursive`.\n\n * If `strategy` is set to `recursive`, you must also specify:\n\n- `max_chunk_size`\n- either `separators` or`separator_group`\n\nLearn more about different chunking strategies in the linked documentation." default: sentence externalDocs: url: https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#chunking-strategies description: Chunking configuration object inference._types.ServiceSettings: type: object inference._types.RegionPolicyDoc: required: - region_policy - created_at type: object properties: region_policy: allOf: - $ref: '#/components/schemas/inference._types.RegionPolicy' created_at: allOf: - $ref: '#/components/schemas/_types.DateTime' description: The date and time the region policy was created. created_by: type: string description: The user who created the region policy. updated_at: allOf: - $ref: '#/components/schemas/_types.DateTime' description: The date and time the region policy was last updated. updated_by: type: string description: The user who last updated the region policy. description: The stored region policy document. inference._types.RegionPolicy: maxProperties: 1 minProperties: 1 type: object properties: allowed_geos: type: array items: type: string description: "The list of allowed geographic areas.\nMutually exclusive with `allowed_regions`." allowed_regions: type: array items: $ref: '#/components/schemas/inference._types.CspRegion' description: "The list of allowed cloud service provider regions.\nMutually exclusive with `allowed_geos`." description: "The region policy configuration.\nSpecify exactly one of `allowed_geos` or `allowed_regions`." inference._types.CspRegion: required: - csp - region type: object properties: csp: type: string description: 'The cloud service provider, for example `aws`, `gcp`, or `azure`.' region: type: string description: 'The region of the cloud service provider, for example `us-east-1`.' description: A cloud service provider region. inference._types.InferenceResult: maxProperties: 1 minProperties: 1 type: object properties: embeddings_bytes: type: array items: $ref: '#/components/schemas/inference._types.DenseEmbeddingByteResult' embeddings_bits: type: array items: $ref: '#/components/schemas/inference._types.DenseEmbeddingByteResult' embeddings: type: array items: $ref: '#/components/schemas/inference._types.DenseEmbeddingResult' text_embedding_bytes: type: array items: $ref: '#/components/schemas/inference._types.DenseEmbeddingByteResult' text_embedding_bits: type: array items: $ref: '#/components/schemas/inference._types.DenseEmbeddingByteResult' text_embedding: type: array items: $ref: '#/components/schemas/inference._types.DenseEmbeddingResult' sparse_embedding: type: array items: $ref: '#/components/schemas/inference._types.SparseEmbeddingResult' completion: type: array items: $ref: '#/components/schemas/inference._types.CompletionResult' rerank: type: array items: $ref: '#/components/schemas/inference._types.RankedDocument' description: InferenceResult is an aggregation of mutually exclusive variants inference._types.SparseEmbeddingResult: required: - is_truncated - embedding type: object properties: is_truncated: type: boolean description: Indicates if the text input was truncated in the request sent to the service embedding: allOf: - $ref: '#/components/schemas/inference._types.SparseVector' inference._types.SparseVector: type: object additionalProperties: type: number description: "Sparse Embedding tokens are represented as a dictionary\nof string to double." inference._types.RankedDocument: required: - index - relevance_score type: object properties: index: type: number relevance_score: type: number text: type: string description: "The rerank result object representing a single ranked document\nid: the original index of the document in the request\nrelevance_score: the relevance_score of the document relative to the query\ntext: Optional, the text of the document, if requested" inference._types.ChatCompletionInferenceResult: required: - id - model - object type: object properties: id: type: string description: The unique identifier for the completion. choices: type: array items: $ref: '#/components/schemas/inference._types.ChatCompletionChoice' description: The list of completion choices the model generated for the input message. model: type: string description: The model used to generate the completion. object: type: string description: The object type. usage: allOf: - $ref: '#/components/schemas/inference._types.ChatCompletionUsage' description: "The token usage statistics for the completion request.\nOmitted when usage information is not available." description: The response format for the non-streaming unified chat completion request. inference._types.ChatCompletionChoice: required: - message - index type: object properties: message: allOf: - $ref: '#/components/schemas/inference._types.ChatCompletionMessage' description: The message generated by the model for this choice. finish_reason: type: string description: "The reason the model stopped generating tokens.\nCommon values are `stop` (natural stopping point) and `tool_calls` (the model called a tool).\nOmitted when the reason is not available." index: type: number description: The index of this choice in the list of choices. description: A single completion choice returned by the model. inference._types.ChatCompletionMessage: type: object properties: content: type: string description: The content of the message. refusal: type: string description: The refusal message generated by the model. role: type: string description: The role of the message author. reasoning: type: string description: "The reasoning generated by the model as plaintext.\nCurrently supported only for the `elastic` provider." tool_calls: type: array items: $ref: '#/components/schemas/inference._types.ChatCompletionToolCall' description: The tool calls generated by the model. reasoning_details: type: array items: $ref: '#/components/schemas/inference._types.ReasoningDetail' description: "The reasoning details generated by the model as structured data.\nCurrently supported only for the `elastic` provider." description: The message returned by the model. inference._types.ChatCompletionToolCall: required: - index - type type: object properties: index: type: number description: The index of the tool call in the list of tool calls generated by the model. id: type: string description: The identifier of the tool call. function: allOf: - $ref: '#/components/schemas/inference._types.ChatCompletionToolCallFunction' description: The function that the model called. type: type: string description: The type of the tool call. description: A tool call generated by the model. inference._types.ChatCompletionToolCallFunction: type: object properties: arguments: type: string description: 'The arguments to call the function with, as a JSON string.' name: type: string description: The name of the function. description: The function called by the tool. inference._types.ChatCompletionUsage: required: - completion_tokens - prompt_tokens - total_tokens type: object properties: completion_tokens: type: number description: The number of tokens in the generated completion. prompt_tokens: type: number description: The number of tokens in the prompt. total_tokens: type: number description: The total number of tokens used (prompt + completion). prompt_tokens_details: allOf: - $ref: '#/components/schemas/inference._types.ChatCompletionPromptTokensDetails' description: "Breakdown of the tokens used in the prompt.\nOmitted when no details are available." completion_tokens_details: allOf: - $ref: '#/components/schemas/inference._types.ChatCompletionCompletionTokensDetails' description: "Breakdown of the tokens used in the completion.\nOmitted when no details are available." description: Token usage statistics for the request. inference._types.ChatCompletionPromptTokensDetails: type: object properties: cached_tokens: type: number description: The number of tokens that were cached from a previous request. cache_write_tokens: type: number description: The number of tokens written to the cache. description: Breakdown of tokens used in the prompt. inference._types.ChatCompletionCompletionTokensDetails: type: object properties: reasoning_tokens: type: number description: The number of tokens used for reasoning by the model. description: Breakdown of tokens used in the request. inference._types.Ai21TaskType: enum: - completion - chat_completion type: string inference._types.Ai21ServiceType: enum: - ai21 type: string inference._types.Ai21ServiceSettings: required: - model_id type: object properties: model_id: type: string description: "The name of the model to use for the inference task.\nRefer to the AI21 models documentation for the list of supported models and versions.\nService has been tested and confirmed to be working for `completion` and `chat_completion` tasks with the following models:\n* `jamba-mini`\n* `jamba-large`" externalDocs: url: https://docs.ai21.com/docs/jamba-foundation-models api_key: type: string description: "A valid API key for accessing AI21 API.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key." rate_limit: allOf: - $ref: '#/components/schemas/inference._types.RateLimitSetting' description: "This setting helps to minimize the number of rate limit errors returned from the AI21 API.\nBy default, the `ai21` service sets the number of requests allowed per minute to 200. Please refer to AI21 documentation for more details." externalDocs: url: https://docs.ai21.com/reference/api-rate-limits inference._types.RateLimitSetting: type: object properties: requests_per_minute: type: number description: "The number of requests allowed per minute.\nBy default, the number of requests allowed per minute is set by each service as follows:\n\n* `alibabacloud-ai-search` service: `1000`\n* `amazonbedrock` service: `240`\n* `anthropic` service: `50`\n* `azureaistudio` service: `240`\n* `azureopenai` service and task type `text_embedding`: `1440`\n* `azureopenai` service and task types `completion` or `chat_completion`: `120`\n* `cohere` service: `10000`\n* `contextualai` service: `1000`\n* `elastic` service and task type `chat_completion`: `240`\n* `fireworksai` service: `6000`\n* `googleaistudio` service: `360`\n* `googlevertexai` service: `30000`\n* `hugging_face` service: `3000`\n* `jinaai` service: `2000`\n* `llama` service: `3000`\n* `mistral` service: `240`\n* `openai` service and task type `text_embedding`: `3000`\n* `openai` service and task type `completion`: `500`\n* `openshift_ai` service: `3000`\n* `voyageai` service: `2000`\n* `watsonxai` service: `120`" description: This setting helps to minimize the number of rate limit errors returned from the service. inference._types.InferenceEndpointInfoAi21: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeAi21' description: The task type inference._types.TaskTypeAi21: enum: - completion - chat_completion type: string inference._types.AlibabaCloudTaskType: enum: - completion - rerank - sparse_embedding - text_embedding type: string inference._types.AlibabaCloudServiceType: enum: - alibabacloud-ai-search type: string inference._types.AlibabaCloudServiceSettings: required: - api_key - host - service_id - workspace type: object properties: api_key: type: string description: A valid API key for the AlibabaCloud AI Search API. host: type: string description: "The name of the host address used for the inference task.\nYou can find the host address in the API keys section of the documentation." externalDocs: url: https://opensearch.console.aliyun.com/cn-shanghai/rag/api-key rate_limit: allOf: - $ref: '#/components/schemas/inference._types.RateLimitSetting' description: "This setting helps to minimize the number of rate limit errors returned from AlibabaCloud AI Search.\nBy default, the `alibabacloud-ai-search` service sets the number of requests allowed per minute to `1000`." service_id: type: string description: "The name of the model service to use for the inference task.\nThe following service IDs are available for the `completion` task:\n\n* `ops-qwen-turbo`\n* `qwen-turbo`\n* `qwen-plus`\n* `qwen-max ÷ qwen-max-longcontext`\n\nThe following service ID is available for the `rerank` task:\n\n* `ops-bge-reranker-larger`\n\nThe following service ID is available for the `sparse_embedding` task:\n\n* `ops-text-sparse-embedding-001`\n\nThe following service IDs are available for the `text_embedding` task:\n\n`ops-text-embedding-001`\n`ops-text-embedding-zh-001`\n`ops-text-embedding-en-001`\n`ops-text-embedding-002`" workspace: type: string description: The name of the workspace used for the inference task. inference._types.AlibabaCloudTaskSettings: type: object properties: input_type: type: string description: "For a `sparse_embedding` or `text_embedding` task, specify the type of input passed to the model.\nValid values are:\n\n* `ingest` for storing document embeddings in a vector database.\n* `search` for storing embeddings of search queries run against a vector database to find relevant documents." return_token: type: boolean description: "For a `sparse_embedding` task, it affects whether the token name will be returned in the response.\nIt defaults to `false`, which means only the token ID will be returned in the response." inference._types.InferenceEndpointInfoAlibabaCloudAI: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeAlibabaCloudAI' description: The task type inference._types.TaskTypeAlibabaCloudAI: enum: - text_embedding - rerank - completion - sparse_embedding type: string inference._types.AmazonBedrockTaskType: enum: - chat_completion - completion - text_embedding type: string inference._types.AmazonBedrockServiceType: enum: - amazonbedrock type: string inference._types.AmazonBedrockServiceSettings: required: - access_key - model - region - secret_key type: object properties: access_key: type: string description: A valid AWS access key that has permissions to use Amazon Bedrock and access to models for inference requests. model: type: string description: "The base model ID or an ARN to a custom model based on a foundational model.\nThe base model IDs can be found in the Amazon Bedrock documentation.\nNote that the model ID must be available for the provider chosen and your IAM user must have access to the model." externalDocs: url: https://docs.aws.amazon.com/bedrock/latest/userguide/models-supported.html provider: type: string description: "The model provider for your deployment.\nNote that some providers may support only certain task types.\nSupported providers include:\n\n* `amazontitan` - available for `text_embedding` and `completion` task types\n* `anthropic` - available for `chat_completion` and `completion` task types\n* `ai21labs` - available for `chat_completion` and `completion` task types\n* `cohere` - available for `chat_completion`, `completion` and `text_embedding` task types\n* `meta` - available for `chat_completion` and `completion` task types\n* `mistral` - available for `chat_completion` and `completion` task types" region: type: string description: "The region that your model or ARN is deployed in.\nThe list of available regions per model can be found in the Amazon Bedrock documentation." externalDocs: url: https://docs.aws.amazon.com/bedrock/latest/userguide/models-supported.html rate_limit: allOf: - $ref: '#/components/schemas/inference._types.RateLimitSetting' description: "This setting helps to minimize the number of rate limit errors returned from Amazon Bedrock.\nBy default, the `amazonbedrock` service sets the number of requests allowed per minute to 240." secret_key: type: string description: "A valid AWS secret key that is paired with the `access_key`.\nFor informationg about creating and managing access and secret keys, refer to the AWS documentation." externalDocs: url: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html inference._types.AmazonBedrockTaskSettings: type: object properties: max_new_tokens: type: number description: 'For `chat_completion` and `completion` tasks, it sets the maximum number for the output tokens to be generated.' default: 64 temperature: type: number description: "For `chat_completion` and `completion` tasks, it is a number between 0.0 and 1.0 that controls the apparent creativity of the results.\nAt temperature 0.0 the model is most deterministic, at temperature 1.0 most random.\nIt should not be used if `top_p` or `top_k` is specified." top_k: type: number description: "For `chat_completion` and `completion` tasks, it limits samples to the top-K most likely words, balancing coherence and variability.\nIt is only available for anthropic, cohere, and mistral providers.\nIt is an alternative to `temperature`; it should not be used if `temperature` is specified." top_p: type: number description: "For `chat_completion` and `completion` tasks, it is a number in the range of 0.0 to 1.0, to eliminate low-probability tokens.\nTop-p uses nucleus sampling to select top tokens whose sum of likelihoods does not exceed a certain value, ensuring both variety and coherence.\nIt is an alternative to `temperature`; it should not be used if `temperature` is specified." inference._types.InferenceEndpointInfoAmazonBedrock: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeAmazonBedrock' description: The task type inference._types.TaskTypeAmazonBedrock: enum: - chat_completion - completion - text_embedding type: string inference._types.TaskTypeAmazonSageMaker: enum: - text_embedding - completion - chat_completion - sparse_embedding - rerank type: string inference._types.AmazonSageMakerServiceType: enum: - amazon_sagemaker type: string inference._types.AmazonSageMakerServiceSettings: required: - access_key - endpoint_name - api - region - secret_key type: object properties: access_key: type: string description: A valid AWS access key that has permissions to use Amazon SageMaker and access to models for invoking requests. endpoint_name: type: string description: The name of the SageMaker endpoint. externalDocs: url: https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_runtime_InvokeEndpoint.html api: allOf: - $ref: '#/components/schemas/inference._types.AmazonSageMakerApi' description: "The API format to use when calling SageMaker.\nElasticsearch will convert the POST _inference request to this data format when invoking the SageMaker endpoint." region: type: string description: "The region that your endpoint or Amazon Resource Name (ARN) is deployed in.\nThe list of available regions per model can be found in the Amazon SageMaker documentation." externalDocs: url: https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_runtime_InvokeEndpoint.html secret_key: type: string description: "A valid AWS secret key that is paired with the `access_key`.\nFor information about creating and managing access and secret keys, refer to the AWS documentation." externalDocs: url: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html similarity: allOf: - $ref: '#/components/schemas/inference._types.AmazonSageMakerSimilarity' description: "Required when `api` is `elastic` and task type is `text_embedding`. The similarity measure used when invoking the\n`text_embedding` task type." element_type: allOf: - $ref: '#/components/schemas/inference._types.AmazonSageMakerElementType' description: "Required when `api` is `elastic` and task type is `text_embedding`. The data type returned by the text embedding\nmodel.\nThis value is used when parsing the response back to Elasticsearch data structures." target_model: type: string description: The model ID when calling a multi-model endpoint. externalDocs: url: https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_runtime_InvokeEndpoint.html target_container_hostname: type: string description: The container to directly invoke when calling a multi-container endpoint. externalDocs: url: https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_runtime_InvokeEndpoint.html inference_component_name: type: string description: The inference component to directly invoke when calling a multi-component endpoint. externalDocs: url: https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_runtime_InvokeEndpoint.html batch_size: type: number description: "The maximum number of inputs in each batch. This value is used by inference ingestion pipelines\nwhen processing semantic values. It correlates to the number of times the SageMaker endpoint is\ninvoked (one per batch of input)." default: 256 dimensions: type: number description: "The number of dimensions returned by the text embedding models. If this value is not provided, then\nit is guessed by making invoking the endpoint for the `text_embedding` task." inference._types.AmazonSageMakerApi: enum: - openai - elastic type: string inference._types.AmazonSageMakerSimilarity: enum: - cosine - dot_product - l2_norm type: string inference._types.AmazonSageMakerElementType: enum: - byte - float - bit type: string inference._types.AmazonSageMakerTaskSettings: type: object properties: custom_attributes: type: string description: "The AWS custom attributes passed verbatim through to the model running in the SageMaker Endpoint.\nValues will be returned in the `X-elastic-sagemaker-custom-attributes` header." externalDocs: url: https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_runtime_InvokeEndpoint.html enable_explanations: type: string description: The optional JMESPath expression used to override the EnableExplanations provided during endpoint creation. externalDocs: url: https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_runtime_InvokeEndpoint.html inference_id: type: string description: The capture data ID when enabled in the endpoint. externalDocs: url: https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_runtime_InvokeEndpoint.html session_id: type: string description: "The stateful session identifier for a new or existing session.\nNew sessions will be returned in the `X-elastic-sagemaker-new-session-id` header.\nClosed sessions will be returned in the `X-elastic-sagemaker-closed-session-id` header." externalDocs: url: https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_runtime_InvokeEndpoint.html target_variant: type: string description: Specifies the variant when running with multi-variant Endpoints. externalDocs: url: https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_runtime_InvokeEndpoint.html inference._types.InferenceEndpointInfoAmazonSageMaker: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeAmazonSageMaker' description: The task type inference._types.AnthropicTaskType: enum: - completion - chat_completion type: string inference._types.AnthropicServiceType: enum: - anthropic type: string inference._types.AnthropicServiceSettings: required: - api_key - model_id type: object properties: api_key: type: string description: A valid API key for the Anthropic API. model_id: type: string description: "The name of the model to use for the inference task.\nRefer to the Anthropic documentation for the list of supported models." rate_limit: allOf: - $ref: '#/components/schemas/inference._types.RateLimitSetting' description: "This setting helps to minimize the number of rate limit errors returned from Anthropic.\nBy default, the `anthropic` service sets the number of requests allowed per minute to 50." inference._types.AnthropicTaskSettings: required: - max_tokens type: object properties: max_tokens: type: number description: 'For a `completion` or `chat_completion` task, it is the maximum number of tokens to generate before stopping.' temperature: type: number description: "For a `completion` or `chat_completion` task, it is the amount of randomness injected into the response.\nFor more details about the supported range, refer to Anthropic documentation." externalDocs: url: https://docs.anthropic.com/en/api/messages top_k: type: number description: "For a `completion` or `chat_completion` task, it specifies to only sample from the top K options for each subsequent token.\nIt is recommended for advanced use cases only.\nYou usually only need to use `temperature`." top_p: type: number description: "For a `completion` or `chat_completion` task, it specifies to use Anthropic's nucleus sampling.\nIn nucleus sampling, Anthropic computes the cumulative distribution over all the options for each subsequent token in decreasing probability order and cuts it off once it reaches the specified probability.\nYou should either alter `temperature` or `top_p`, but not both.\nIt is recommended for advanced use cases only.\nYou usually only need to use `temperature`." inference._types.InferenceEndpointInfoAnthropic: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeAnthropic' description: The task type inference._types.TaskTypeAnthropic: enum: - completion - chat_completion type: string inference._types.AzureAiStudioTaskType: enum: - completion - rerank - text_embedding type: string inference._types.AzureAiStudioServiceType: enum: - azureaistudio type: string inference._types.AzureAiStudioServiceSettings: required: - api_key - endpoint_type - target - provider type: object properties: api_key: type: string description: "A valid API key of your Azure AI Studio model deployment.\nThis key can be found on the overview page for your deployment in the management section of your Azure AI Studio account.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key." externalDocs: url: https://ai.azure.com/ endpoint_type: type: string description: "The type of endpoint that is available for deployment through Azure AI Studio: `token` or `realtime`.\nThe `token` endpoint type is for \"pay as you go\" endpoints that are billed per token.\nThe `realtime` endpoint type is for \"real-time\" endpoints that are billed per hour of usage." externalDocs: url: https://learn.microsoft.com/en-us/azure/ai-foundry/concepts/deployments-overview#billing-for-deploying-and-inferencing-llms-in-azure-ai-studio target: type: string description: "The target URL of your Azure AI Studio model deployment.\nThis can be found on the overview page for your deployment in the management section of your Azure AI Studio account." provider: type: string description: "The model provider for your deployment.\nNote that some providers may support only certain task types.\nSupported providers include:\n\n* `cohere` - available for `text_embedding`, `rerank` and `completion` task types\n* `databricks` - available for `completion` task type only\n* `meta` - available for `completion` task type only\n* `microsoft_phi` - available for `completion` task type only\n* `mistral` - available for `completion` task type only\n* `openai` - available for `text_embedding` and `completion` task types" rate_limit: allOf: - $ref: '#/components/schemas/inference._types.RateLimitSetting' description: "This setting helps to minimize the number of rate limit errors returned from Azure AI Studio.\nBy default, the `azureaistudio` service sets the number of requests allowed per minute to 240." inference._types.AzureAiStudioTaskSettings: type: object properties: do_sample: type: number description: "For a `completion` task, instruct the inference process to perform sampling.\nIt has no effect unless `temperature` or `top_p` is specified." max_new_tokens: type: number description: 'For a `completion` task, provide a hint for the maximum number of output tokens to be generated.' temperature: type: number description: "For a `completion` task, control the apparent creativity of generated completions with a sampling temperature.\nIt must be a number in the range of 0.0 to 2.0.\nIt should not be used if `top_p` is specified." top_p: type: number description: "For a `completion` task, make the model consider the results of the tokens with nucleus sampling probability.\nIt is an alternative value to `temperature` and must be a number in the range of 0.0 to 2.0.\nIt should not be used if `temperature` is specified." user: type: string description: "For a `text_embedding` task, specify the user issuing the request.\nThis information can be used for abuse detection." return_documents: type: boolean description: 'For a `rerank` task, return doc text within the results.' top_n: type: number description: "For a `rerank` task, the number of most relevant documents to return.\nIt defaults to the number of the documents." inference._types.InferenceEndpointInfoAzureAIStudio: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeAzureAIStudio' description: The task type inference._types.TaskTypeAzureAIStudio: enum: - text_embedding - completion - rerank type: string inference._types.AzureOpenAITaskType: enum: - completion - chat_completion - text_embedding type: string inference._types.AzureOpenAIServiceType: enum: - azureopenai type: string inference._types.AzureOpenAIServiceSettings: required: - api_version - deployment_id - resource_name type: object properties: api_key: type: string description: "A valid API key for your Azure OpenAI account.\n\nIMPORTANT: You must specify either `api_key`, `entra_id`, or `client_secret`.\nIf you do not provide one or you provide more than one of them, you will receive an error when you try to create your endpoint." externalDocs: url: https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#authentication api_version: type: string description: "The Azure API version ID to use.\nIt is recommended to use the latest supported non-preview version." client_id: type: string description: "For OAuth 2.0 authorization using the client credentials grant flow.\nThe application ID that's assigned to your app.\n\nIMPORTANT: To configure OAuth 2.0, you must specify `client_id`, `scopes`, `tenant_id`, and `client_secret` together.\nIf one of the fields is missing, you will receive an error when you try to create your endpoint." externalDocs: url: https://learn.microsoft.com/en-us/azure/api-management/api-management-authenticate-authorize-ai-apis#oauth-20-authorization-by-using-identity-provider client_secret: type: string description: "For OAuth 2.0 authorization using the client credentials grant flow.\nThe application secret that you created in the Microsoft app registration portal for your app.\n\nIMPORTANT: You must specify either `api_key`, `entra_id`, or `client_secret`.\nIf you do not provide one or you provide more than one of them, you will receive an error when you try to create your endpoint.\n\nIMPORTANT: To configure OAuth 2.0, you must specify `client_id`, `scopes`, `tenant_id`, and `client_secret` together.\nIf one of the fields is missing, you will receive an error when you try to create your endpoint." externalDocs: url: https://learn.microsoft.com/en-us/azure/api-management/api-management-authenticate-authorize-ai-apis#oauth-20-authorization-by-using-identity-provider deployment_id: type: string description: "The deployment name of your deployed models.\nYour Azure OpenAI deployments can be found though the Azure OpenAI Studio portal that is linked to your subscription." externalDocs: url: https://oai.azure.com/ entra_id: type: string description: "A valid Microsoft Entra token.\n\nIMPORTANT: You must specify either `api_key`, `entra_id`, or `client_secret`.\nIf you do not provide one or you provide more than one of them, you will receive an error when you try to create your endpoint." externalDocs: url: https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#authentication rate_limit: allOf: - $ref: '#/components/schemas/inference._types.RateLimitSetting' description: "This setting helps to minimize the number of rate limit errors returned from Azure.\nThe `azureopenai` service sets a default number of requests allowed per minute depending on the task type.\nFor `text_embedding`, it is set to `1440`.\nFor `completion` and `chat_completion`, it is set to `120`." externalDocs: url: https://learn.microsoft.com/en-us/azure/ai-services/openai/quotas-limits resource_name: type: string description: "The name of your Azure OpenAI resource.\nYou can find this from the list of resources in the Azure Portal for your subscription." externalDocs: url: https://portal.azure.com/#view/HubsExtension/BrowseAll scopes: type: array items: type: string description: "For OAuth 2.0 authorization using the client credentials grant flow.\nThe resource identifier (application ID URI) of the resource you want, suffixed with .default\nFor example:\n```\n\"scopes\": [\n \"https://cognitiveservices.azure.com/.default\"\n]\n```\n\nIMPORTANT: To configure OAuth 2.0, you must specify `client_id`, `scopes`, `tenant_id`, and `client_secret` together.\nIf one of the fields is missing, you will receive an error when you try to create your endpoint." externalDocs: url: https://learn.microsoft.com/en-us/entra/identity-platform/scopes-oidc tenant_id: type: string description: "For OAuth 2.0 authorization using the client credentials grant flow.\nThe directory tenant the application plans to operate against.\n\nIMPORTANT: To configure OAuth 2.0, you must specify `client_id`, `scopes`, `tenant_id`, and `client_secret` together.\nIf one of the fields is missing, you will receive an error when you try to create your endpoint." externalDocs: url: https://learn.microsoft.com/en-us/azure/api-management/api-management-authenticate-authorize-ai-apis#oauth-20-authorization-by-using-identity-provider inference._types.AzureOpenAITaskSettings: type: object properties: user: type: string description: "Specifies the user issuing the request.\nThis information can be used for abuse detection." headers: type: object additionalProperties: type: string description: "Specifies custom HTTP header parameters.\nFor example:\n```\n\"headers\": {\n \"Custom-Header\": \"Some-Value\",\n \"Another-Custom-Header\": \"Another-Value\"\n}\n```" inference._types.InferenceEndpointInfoAzureOpenAI: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeAzureOpenAI' description: The task type inference._types.TaskTypeAzureOpenAI: enum: - text_embedding - completion - chat_completion type: string inference._types.CohereTaskType: enum: - completion - rerank - text_embedding type: string inference._types.CohereServiceType: enum: - cohere type: string inference._types.CohereServiceSettings: required: - api_key - model_id type: object properties: api_key: type: string description: "A valid API key for your Cohere account.\nYou can find or create your Cohere API keys on the Cohere API key settings page.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key." externalDocs: url: https://dashboard.cohere.com/api-keys embedding_type: allOf: - $ref: '#/components/schemas/inference._types.CohereEmbeddingType' description: "For a `text_embedding` task, the types of embeddings you want to get back.\nUse `binary` for binary embeddings, which are encoded as bytes with signed int8 precision.\nUse `bit` for binary embeddings, which are encoded as bytes with signed int8 precision (this is a synonym of `binary`).\nUse `byte` for signed int8 embeddings (this is a synonym of `int8`).\nUse `float` for the default float embeddings.\nUse `int8` for signed int8 embeddings." default: float model_id: type: string description: "For a `completion`, `rerank`, or `text_embedding` task, the name of the model to use for the inference task.\n\n* For the available `completion` models, refer to the [Cohere command docs](https://docs.cohere.com/docs/models#command).\n* For the available `rerank` models, refer to the [Cohere rerank docs](https://docs.cohere.com/reference/rerank-1).\n* For the available `text_embedding` models, refer to [Cohere embed docs](https://docs.cohere.com/reference/embed)." rate_limit: allOf: - $ref: '#/components/schemas/inference._types.RateLimitSetting' description: "This setting helps to minimize the number of rate limit errors returned from Cohere.\nBy default, the `cohere` service sets the number of requests allowed per minute to 10000." similarity: allOf: - $ref: '#/components/schemas/inference._types.CohereSimilarityType' description: "The similarity measure.\nIf the `embedding_type` is `float`, the default value is `dot_product`.\nIf the `embedding_type` is `int8` or `byte`, the default value is `cosine`." inference._types.CohereEmbeddingType: enum: - binary - bit - byte - float - int8 type: string inference._types.CohereSimilarityType: enum: - cosine - dot_product - l2_norm type: string inference._types.CohereTaskSettings: required: - input_type type: object properties: input_type: allOf: - $ref: '#/components/schemas/inference._types.CohereInputType' description: "For a `text_embedding` task, the type of input passed to the model.\nValid values are:\n\n* `classification`: Use it for embeddings passed through a text classifier.\n* `clustering`: Use it for the embeddings run through a clustering algorithm.\n* `ingest`: Use it for storing document embeddings in a vector database.\n* `search`: Use it for storing embeddings of search queries run against a vector database to find relevant documents.\n\nIMPORTANT: The `input_type` field is required when using embedding models `v3` and higher." return_documents: type: boolean description: 'For a `rerank` task, return doc text within the results.' top_n: type: number description: "For a `rerank` task, the number of most relevant documents to return.\nIt defaults to the number of the documents.\nIf this inference endpoint is used in a `text_similarity_reranker` retriever query and `top_n` is set, it must be greater than or equal to `rank_window_size` in the query." truncate: allOf: - $ref: '#/components/schemas/inference._types.CohereTruncateType' description: "For a `text_embedding` task, the method to handle inputs longer than the maximum token length.\nValid values are:\n\n* `END`: When the input exceeds the maximum input token length, the end of the input is discarded.\n* `NONE`: When the input exceeds the maximum input token length, an error is returned.\n* `START`: When the input exceeds the maximum input token length, the start of the input is discarded." inference._types.CohereInputType: enum: - classification - clustering - ingest - search type: string inference._types.CohereTruncateType: enum: - END - NONE - START type: string inference._types.InferenceEndpointInfoCohere: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeCohere' description: The task type inference._types.TaskTypeCohere: enum: - text_embedding - rerank - completion type: string inference._types.TaskTypeContextualAI: enum: - rerank type: string inference._types.ContextualAIServiceType: enum: - contextualai type: string inference._types.ContextualAIServiceSettings: required: - api_key - model_id type: object properties: api_key: type: string description: "A valid API key for your Contexutual AI account.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key." model_id: type: string description: "The name of the model to use for the inference task.\nRefer to the Contextual AI documentation for the list of available rerank models." rate_limit: allOf: - $ref: '#/components/schemas/inference._types.RateLimitSetting' description: "This setting helps to minimize the number of rate limit errors returned from Contextual AI.\nThe `contextualai` service sets a default number of requests allowed per minute depending on the task type.\nFor `rerank`, it is set to `1000`." inference._types.ContextualAITaskSettings: type: object properties: instruction: type: string description: "Instructions for the reranking model. Refer to \nOnly for the `rerank` task type." top_k: type: number description: "The number of most relevant documents to return.\nIf not specified, the reranking results of all documents will be returned.\nOnly for the `rerank` task type." inference._types.InferenceEndpointInfoContextualAi: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeContextualAI' description: The task type inference._types.CustomTaskType: enum: - text_embedding - sparse_embedding - rerank - completion type: string inference._types.CustomServiceType: enum: - custom type: string inference._types.CustomServiceSettings: required: - request - response - secret_parameters type: object properties: batch_size: type: number description: "Specifies the batch size used for the semantic_text field. If the field is not provided, the default is 10.\nThe batch size is the maximum number of inputs in a single request to the upstream service.\nThe chunk within the batch are controlled by the selected chunking strategy for the semantic_text field." externalDocs: url: https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/semantic-text#auto-text-chunking headers: type: object additionalProperties: type: string description: "Specifies the HTTP header parameters – such as `Authorization` or `Content-Type` – that are required to access the custom service.\nFor example:\n```\n\"headers\": {\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json;charset=utf-8\"\n}\n```" input_type: type: object additionalProperties: type: string description: "Specifies the input type translation values that are used to replace the `${input_type}` template in the request body.\nFor example:\n```\n\"input_type\": {\n \"translation\": {\n \"ingest\": \"do_ingest\",\n \"search\": \"do_search\"\n },\n \"default\": \"a_default\"\n},\n```\nIf the subsequent inference requests come from a search context, the `search` key will be used and the template will be replaced with `do_search`.\nIf it comes from the ingest context `do_ingest` is used. If it's a different context that is not specified, the default value will be used. If no default is specified an empty string is used.\n`translation` can be:\n* `classification`\n* `clustering`\n* `ingest`\n* `search`" query_parameters: type: array items: $ref: '#/components/schemas/inference._types.CustomServiceQueryParameter' description: "Specifies the query parameters as a list of tuples. The arrays inside the `query_parameters` must have two items, a key and a value.\nFor example:\n```\n\"query_parameters\":[\n [\"param_key\", \"some_value\"],\n [\"param_key\", \"another_value\"],\n [\"other_key\", \"other_value\"]\n]\n```\nIf the base url is `https://www.elastic.co` it results in: `https://www.elastic.co?param_key=some_value¶m_key=another_value&other_key=other_value`." request: allOf: - $ref: '#/components/schemas/inference._types.CustomRequestParams' description: The request configuration object. response: allOf: - $ref: '#/components/schemas/inference._types.CustomResponseParams' description: The response configuration object. secret_parameters: type: object additionalProperties: type: string description: "Specifies secret parameters, like `api_key` or `api_token`, that are required to access the custom service.\nFor example:\n```\n\"secret_parameters\":{\n \"api_key\":\"\"\n}\n```" url: type: string description: The URL endpoint to use for the requests. inference._types.CustomServiceQueryParameter: type: array items: type: string inference._types.CustomRequestParams: required: - content type: object properties: content: type: string description: "The body structure of the request. It requires passing in the string-escaped result of the JSON format HTTP request body.\nFor example:\n```\n\"request\": \"{\\\"input\\\":${input}}\"\n```\n> info\n> The content string needs to be a single line except when using the Kibana console." inference._types.CustomResponseParams: required: - json_parser type: object properties: json_parser: type: object additionalProperties: type: string description: "Specifies the JSON parser that is used to parse the response from the custom service.\nDifferent task types require different json_parser parameters.\nFor example:\n```\n# text_embedding\n# For a response like this:\n\n{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"embedding\",\n \"index\": 0,\n \"embedding\": [\n 0.014539449,\n -0.015288644\n ]\n }\n ],\n \"model\": \"text-embedding-ada-002-v2\",\n \"usage\": {\n \"prompt_tokens\": 8,\n \"total_tokens\": 8\n }\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"text_embeddings\":\"$.data[*].embedding[*]\"\n }\n}\n\n# Elasticsearch supports the following embedding types:\n* float\n* byte\n* bit (or binary)\n\nTo specify the embedding type for the response, the `embedding_type`\nfield should be added in the `json_parser` object. Here's an example:\n\"response\":{\n \"json_parser\":{\n \"text_embeddings\":\"$.data[*].embedding[*]\",\n \"embedding_type\":\"bit\"\n }\n}\n\nIf `embedding_type` is not specified, it defaults to `float`.\n\n# sparse_embedding\n# For a response like this:\n\n{\n \"request_id\": \"75C50B5B-E79E-4930-****-F48DBB392231\",\n \"latency\": 22,\n \"usage\": {\n \"token_count\": 11\n },\n \"result\": {\n \"sparse_embeddings\": [\n {\n \"index\": 0,\n \"embedding\": [\n {\n \"token_id\": 6,\n \"weight\": 0.101\n },\n {\n \"token_id\": 163040,\n \"weight\": 0.28417\n }\n ]\n }\n ]\n }\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"token_path\":\"$.result.sparse_embeddings[*].embedding[*].token_id\",\n \"weight_path\":\"$.result.sparse_embeddings[*].embedding[*].weight\"\n }\n}\n\n# rerank\n# For a response like this:\n\n{\n \"results\": [\n {\n \"index\": 3,\n \"relevance_score\": 0.999071,\n \"document\": \"abc\"\n },\n {\n \"index\": 4,\n \"relevance_score\": 0.7867867,\n \"document\": \"123\"\n },\n {\n \"index\": 0,\n \"relevance_score\": 0.32713068,\n \"document\": \"super\"\n }\n ],\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"reranked_index\":\"$.result.scores[*].index\", // optional\n \"relevance_score\":\"$.result.scores[*].score\",\n \"document_text\":\"xxx\" // optional\n }\n}\n\n# completion\n# For a response like this:\n\n{\n \"id\": \"chatcmpl-B9MBs8CjcvOU2jLn4n570S5qMJKcT\",\n \"object\": \"chat.completion\",\n \"created\": 1741569952,\n \"model\": \"gpt-4.1-2025-04-14\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"Hello! How can I assist you today?\",\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ]\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"completion_result\":\"$.choices[*].message.content\"\n }\n}" inference._types.CustomTaskSettings: type: object properties: parameters: type: object additionalProperties: $ref: '#/components/schemas/inference._types.CustomTaskParameter' description: "Specifies parameters that are required to run the custom service. The parameters depend on the model your custom service uses.\nFor example:\n```\n\"task_settings\":{\n \"parameters\":{\n \"input_type\":\"query\",\n \"return_token\":true\n }\n}\n```\n\n> warn\n> The `task_settings.parameters` cannot contain the same keys as `secret_parameters`. If they do, an error will be returned. This applies to PUT requests and POST requests." inference._types.CustomTaskParameter: type: - boolean - number - string inference._types.InferenceEndpointInfoCustom: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeCustom' description: The task type inference._types.TaskTypeCustom: enum: - text_embedding - sparse_embedding - rerank - completion type: string inference._types.TaskTypeDeepSeek: enum: - completion - chat_completion type: string inference._types.DeepSeekServiceType: enum: - deepseek type: string inference._types.DeepSeekServiceSettings: required: - api_key - model_id type: object properties: api_key: type: string description: "A valid API key for your DeepSeek account.\nYou can find or create your DeepSeek API keys on the DeepSeek API key page.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key." externalDocs: url: https://api-docs.deepseek.com/ model_id: type: string description: "For a `completion` or `chat_completion` task, the name of the model to use for the inference task.\n\nFor the available `completion` and `chat_completion` models, refer to the [DeepSeek Models & Pricing docs](https://api-docs.deepseek.com/quick_start/pricing)." url: type: string description: The URL endpoint to use for the requests. Defaults to `https://api.deepseek.com/chat/completions`. inference._types.InferenceEndpointInfoDeepSeek: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeDeepSeek' description: The task type inference._types.ElasticsearchTaskType: enum: - rerank - sparse_embedding - text_embedding type: string inference._types.ElasticsearchServiceType: enum: - elasticsearch type: string inference._types.ElasticsearchServiceSettings: required: - model_id - num_threads type: object properties: adaptive_allocations: allOf: - $ref: '#/components/schemas/inference._types.AdaptiveAllocations' description: "Adaptive allocations configuration details.\nIf `enabled` is true, the number of allocations of the model is set based on the current load the process gets.\nWhen the load is high, a new model allocation is automatically created, respecting the value of `max_number_of_allocations` if it's set.\nWhen the load is low, a model allocation is automatically removed, respecting the value of `min_number_of_allocations` if it's set.\nIf `enabled` is true, do not set the number of allocations manually." deployment_id: type: string description: "The deployment identifier for a trained model deployment.\nWhen `deployment_id` is used the `model_id` is optional." model_id: type: string description: "The name of the model to use for the inference task.\nIt can be the ID of a built-in model (for example, `.multilingual-e5-small` for E5) or a text embedding model that was uploaded by using the Eland client." externalDocs: url: https://www.elastic.co/docs/explore-analyze/machine-learning/nlp/ml-nlp-import-model#ml-nlp-import-script num_allocations: type: number description: "The total number of allocations that are assigned to the model across machine learning nodes.\nIncreasing this value generally increases the throughput.\nIf adaptive allocations are enabled, do not set this value because it's automatically set." num_threads: type: number description: "The number of threads used by each model allocation during inference.\nThis setting generally increases the speed per inference request.\nThe inference process is a compute-bound process; `threads_per_allocations` must not exceed the number of available allocated processors per node.\nThe value must be a power of 2.\nThe maximum value is 32." long_document_strategy: type: string description: "Available only for the `rerank` task type using the Elastic reranker model.\nControls the strategy used for processing long documents during inference.\n\nPossible values:\n- `truncate` (default): Processes only the beginning of each document.\n- `chunk`: Splits long documents into smaller parts (chunks) before inference.\n\nWhen `long_document_strategy` is set to `chunk`, Elasticsearch splits each document into smaller parts but still returns a single score per document.\nThat score reflects the highest relevance score among all chunks." x-state: Experimental max_chunks_per_doc: type: number description: "Only for the `rerank` task type.\nLimits the number of chunks per document that are sent for inference when chunking is enabled.\nIf not set, all chunks generated for the document are processed." x-state: Experimental inference._types.AdaptiveAllocations: type: object properties: enabled: type: boolean description: Turn on `adaptive_allocations`. default: false max_number_of_allocations: type: number description: "The maximum number of allocations to scale to.\nIf set, it must be greater than or equal to `min_number_of_allocations`." min_number_of_allocations: type: number description: "The minimum number of allocations to scale to.\nIf set, it must be greater than or equal to 0.\nIf not defined, the deployment scales to 0." inference._types.ElasticsearchTaskSettings: type: object properties: return_documents: type: boolean description: 'For a `rerank` task, return the document instead of only the index.' default: true inference._types.InferenceEndpointInfoElasticsearch: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeElasticsearch' description: The task type inference._types.TaskTypeElasticsearch: enum: - sparse_embedding - text_embedding - rerank type: string inference._types.ElserTaskType: enum: - sparse_embedding type: string inference._types.ElserServiceType: enum: - elser type: string inference._types.ElserServiceSettings: required: - num_allocations - num_threads type: object properties: adaptive_allocations: allOf: - $ref: '#/components/schemas/inference._types.AdaptiveAllocations' description: "Adaptive allocations configuration details.\nIf `enabled` is true, the number of allocations of the model is set based on the current load the process gets.\nWhen the load is high, a new model allocation is automatically created, respecting the value of `max_number_of_allocations` if it's set.\nWhen the load is low, a model allocation is automatically removed, respecting the value of `min_number_of_allocations` if it's set.\nIf `enabled` is true, do not set the number of allocations manually." num_allocations: type: number description: "The total number of allocations this model is assigned across machine learning nodes.\nIncreasing this value generally increases the throughput.\nIf adaptive allocations is enabled, do not set this value because it's automatically set." num_threads: type: number description: "The number of threads used by each model allocation during inference.\nIncreasing this value generally increases the speed per inference request.\nThe inference process is a compute-bound process; `threads_per_allocations` must not exceed the number of available allocated processors per node.\nThe value must be a power of 2.\nThe maximum value is 32.\n\n> info\n> If you want to optimize your ELSER endpoint for ingest, set the number of threads to 1. If you want to optimize your ELSER endpoint for search, set the number of threads to greater than 1." inference._types.InferenceEndpointInfoELSER: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeELSER' description: The task type inference._types.TaskTypeELSER: enum: - sparse_embedding type: string inference._types.FireworksAITaskType: enum: - chat_completion - completion - text_embedding type: string inference._types.FireworksAIServiceType: enum: - fireworksai type: string inference._types.FireworksAIServiceSettings: required: - api_key - model_id type: object properties: api_key: type: string description: "A valid API key for your Fireworks AI account.\nYou can find or create your API keys in the Fireworks AI dashboard.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key." externalDocs: url: https://docs.fireworks.ai/ model_id: type: string description: "The name of the model to use for the inference task.\nRefer to the Fireworks AI documentation for the list of available models for chat completion, completion, and text embedding.\nFor text embedding, supported models include the Qwen3 embedding family (e.g. `fireworks/qwen3-embedding-8b`) and other models in the Fireworks model library." externalDocs: url: https://docs.fireworks.ai/guides/recommended-models url: type: string description: "The URL endpoint to use for the requests.\nIf not provided, the default Fireworks AI API endpoint is used." dimensions: type: number description: "For a `text_embedding` task, the number of dimensions the resulting output embeddings should have.\nVariable-length embeddings are supported via this parameter." similarity: allOf: - $ref: '#/components/schemas/inference._types.FireworksAISimilarityType' description: 'For a `text_embedding` task, the similarity measure. One of cosine, dot_product, l2_norm.' default: cosine externalDocs: url: https://docs.fireworks.ai/guides/querying-embeddings-models rate_limit: allOf: - $ref: '#/components/schemas/inference._types.RateLimitSetting' description: "This setting helps to minimize the number of rate limit errors returned from the Fireworks AI API.\nRate limit grouping is per API key only.\nBy default, the `fireworksai` service sets the number of requests allowed per minute to 6000." externalDocs: url: https://docs.fireworks.ai/guides/quotas_usage/rate-limits inference._types.FireworksAISimilarityType: enum: - cosine - dot_product - l2_norm type: string inference._types.FireworksAITaskSettings: type: object properties: user: type: string description: "For a `completion` or`chat_completion` task, specify the user issuing the request.\nThis information can be used for abuse detection." headers: type: object additionalProperties: type: string description: "For a `completion` or`chat_completion` task. Specifies custom HTTP header parameters.\nFor example:\n```\n\"headers\": {\n \"Custom-Header\": \"Some-Value\",\n \"Another-Custom-Header\": \"Another-Value\"\n}\n```" inference._types.InferenceEndpointInfoFireworksAI: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeFireworksAI' description: The task type inference._types.TaskTypeFireworksAI: enum: - chat_completion - completion - text_embedding type: string inference._types.GoogleAiStudioTaskType: enum: - completion - text_embedding type: string inference._types.GoogleAiServiceType: enum: - googleaistudio type: string inference._types.GoogleAiStudioServiceSettings: required: - api_key - model_id type: object properties: api_key: type: string description: A valid API key of your Google Gemini account. model_id: type: string description: "The name of the model to use for the inference task.\nRefer to the Google documentation for the list of supported models." externalDocs: url: https://ai.google.dev/gemini-api/docs/models rate_limit: allOf: - $ref: '#/components/schemas/inference._types.RateLimitSetting' description: "This setting helps to minimize the number of rate limit errors returned from Google AI Studio.\nBy default, the `googleaistudio` service sets the number of requests allowed per minute to 360." inference._types.InferenceEndpointInfoGoogleAIStudio: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeGoogleAIStudio' description: The task type inference._types.TaskTypeGoogleAIStudio: enum: - text_embedding - completion type: string inference._types.GoogleVertexAITaskType: enum: - rerank - text_embedding - completion - chat_completion type: string inference._types.GoogleVertexAIServiceType: enum: - googlevertexai type: string inference._types.GoogleVertexAIServiceSettings: required: - service_account_json type: object properties: provider: allOf: - $ref: '#/components/schemas/inference._types.GoogleModelGardenProvider' description: "The name of the Google Model Garden Provider for `completion` and `chat_completion` tasks.\nIn order for a Google Model Garden endpoint to be used `provider` must be defined and be other than `google`.\nModes:\n- Google Model Garden (third-party models): set `provider` to a supported non-`google` value and provide `url` and/or `streaming_url`.\n- Google Vertex AI: omit `provider` or set it to `google`. In this mode, do not set `url` or `streaming_url` and Elastic will construct the endpoint url from `location`, `model_id`, and `project_id` parameters." url: type: string description: "The URL for non-streaming `completion` requests to a Google Model Garden provider endpoint.\nIf both `url` and `streaming_url` are provided, each is used for its respective mode.\nIf `streaming_url` is not provided, `url` is also used for streaming `completion` and `chat_completion`.\nIf `provider` is not provided or set to `google` (Google Vertex AI), do not set `url` (or `streaming_url`).\nAt least one of `url` or `streaming_url` must be provided for Google Model Garden endpoint usage.\nCertain providers require separate URLs for streaming and non-streaming operations (e.g., Anthropic, Mistral, AI21). Others support both operation types through a single URL (e.g., Meta, Hugging Face).\nInformation on constructing the URL for various providers can be found in the Google Model Garden documentation for the model, or on the endpoint’s `Sample request` page. The request examples also illustrate the proper formatting for the `url`." streaming_url: type: string description: "The URL for streaming `completion` and `chat_completion` requests to a Google Model Garden provider endpoint.\nIf both `streaming_url` and `url` are provided, each is used for its respective mode.\nIf `url` is not provided, `streaming_url` is also used for non-streaming `completion` requests.\nIf `provider` is not provided or set to `google` (Google Vertex AI), do not set `streaming_url` (or `url`).\nAt least one of `streaming_url` or `url` must be provided for Google Model Garden endpoint usage.\nCertain providers require separate URLs for streaming and non-streaming operations (e.g., Anthropic, Mistral, AI21). Others support both operation types through a single URL (e.g., Meta, Hugging Face).\nInformation on constructing the URL for various providers can be found in the Google Model Garden documentation for the model, or on the endpoint’s `Sample request` page. The request examples also illustrate the proper formatting for the `streaming_url`." location: type: string description: "The name of the location to use for the inference task for the Google Vertex AI inference task.\nFor Google Vertex AI, when `provider` is omitted or `google`, `location` is optional.\nWhen `location` is omitted, the request targets the Google Vertex AI global endpoint (`https://aiplatform.googleapis.com`); when it is provided, the corresponding regional endpoint (`https://-aiplatform.googleapis.com`) is used.\nThe field must be omitted to select the global endpoint; an empty string is not a valid `location`.\nFor Google Model Garden's `completion` and `chat_completion` tasks, when `provider` is a supported non-`google` value - `location` is ignored.\nRefer to the Google documentation for the list of supported locations." externalDocs: url: https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations model_id: type: string description: "The name of the model to use for the inference task.\nFor Google Vertex AI `model_id` is mandatory.\nFor Google Model Garden's `completion` and `chat_completion` tasks, when `provider` is a supported non-`google` value - `model_id` will be used for some providers that require it, otherwise - ignored.\nRefer to the Google documentation for the list of supported models for Google Vertex AI." externalDocs: url: https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text-embeddings-api project_id: type: string description: "The name of the project to use for the Google Vertex AI inference task.\nFor Google Vertex AI `project_id` is mandatory.\nFor Google Model Garden's `completion` and `chat_completion` tasks, when `provider` is a supported non-`google` value - `project_id` is ignored." rate_limit: allOf: - $ref: '#/components/schemas/inference._types.RateLimitSetting' description: "This setting helps to minimize the number of rate limit errors returned from Google Vertex AI.\nBy default, the `googlevertexai` service sets the number of requests allowed per minute to 30.000." service_account_json: type: string description: A valid service account in JSON format for the Google Vertex AI API. dimensions: type: number description: "For a `text_embedding` task, the number of dimensions the resulting output embeddings should have.\nBy default, the model's standard output dimension is used.\nRefer to the Google documentation for more information." externalDocs: url: https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings max_batch_size: type: number description: "Only applicable for the `text_embedding` task type.\nControls the batch size of chunked inference requests sent to Google Vertex AI.\n\nSetting this parameter lower reduces the risk of exceeding token limits but may result in more API calls. Setting it higher increases throughput but may risk hitting token limits.\n\nTo estimate a safe `max_batch_size` value, you can use it together with the `max_chunk_size` parameter using the following formula:\n`max_batch_size ≈ max_chunk_size × 1.3 × 512 ÷ 20000`\n\nWhere:\n- `1.3` is an approximate tokens-per-word ratio\n- `512` is the maximum number of chunks that can be generated per document\n- `20000` is the Google Vertex AI token limit per request\n\nThis estimate assumes the worst-case scenario with a document generating the maximum 512 chunks." default: 250 inference._types.GoogleModelGardenProvider: enum: - google - anthropic - meta - hugging_face - mistral - ai21 type: string inference._types.GoogleVertexAITaskSettings: type: object properties: auto_truncate: type: boolean description: 'For a `text_embedding` task, truncate inputs longer than the maximum token length automatically.' top_n: type: number description: 'For a `rerank` task, the number of the top N documents that should be returned.' thinking_config: allOf: - $ref: '#/components/schemas/inference._types.ThinkingConfig' description: "For a `completion` or `chat_completion` task, allows configuration of the thinking features for the model.\nRefer to the Google documentation for the allowable configurations for each model type." externalDocs: url: https://ai.google.dev/gemini-api/docs/thinking#set-budget max_tokens: type: number description: "For `completion` and `chat_completion` tasks, specifies the `max_tokens` value for requests sent to the Google Model Garden `anthropic` provider.\nIf `provider` is not set to `anthropic`, this field is ignored.\nIf `max_tokens` is specified - it must be a positive integer. If not specified, the default value of 1024 is used.\nAnthropic models require `max_tokens` to be set for each request. Please refer to the Anthropic documentation for more information." externalDocs: url: https://docs.claude.com/en/api/messages#body-max-tokens inference._types.ThinkingConfig: type: object properties: thinking_budget: type: number description: Indicates the desired thinking budget in tokens. inference._types.InferenceEndpointInfoGoogleVertexAI: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeGoogleVertexAI' description: The task type inference._types.TaskTypeGoogleVertexAI: enum: - chat_completion - completion - text_embedding - rerank type: string inference._types.GroqTaskType: enum: - chat_completion type: string inference._types.GroqServiceType: enum: - groq type: string inference._types.GroqServiceSettings: required: - model_id type: object properties: model_id: type: string description: "The name of the model to use for the inference task.\nRefer to the Groq model documentation for the list of supported models and versions.\nService has been tested and confirmed to be working for `completion` and `chat_completion` tasks with the following models:\n* `llama-3.3-70b-versatile`" externalDocs: url: https://console.groq.com/docs/models api_key: type: string description: "A valid API key for accessing Groq API.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key." rate_limit: allOf: - $ref: '#/components/schemas/inference._types.RateLimitSetting' description: "This setting helps to minimize the number of rate limit errors returned from the Groq API.\nBy default, the `groq` service sets the number of requests allowed per minute to 1000. Refer to Groq documentation for more details." externalDocs: url: https://console.groq.com/docs/rate-limits inference._types.InferenceEndpointInfoGroq: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeGroq' description: The task type inference._types.TaskTypeGroq: enum: - chat_completion type: string inference._types.HuggingFaceTaskType: enum: - chat_completion - completion - rerank - text_embedding type: string inference._types.HuggingFaceServiceType: enum: - hugging_face type: string inference._types.HuggingFaceServiceSettings: required: - api_key - url type: object properties: api_key: type: string description: "A valid access token for your HuggingFace account.\nYou can create or find your access tokens on the HuggingFace settings page.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key." externalDocs: url: https://huggingface.co/settings/tokens rate_limit: allOf: - $ref: '#/components/schemas/inference._types.RateLimitSetting' description: "This setting helps to minimize the number of rate limit errors returned from Hugging Face.\nBy default, the `hugging_face` service sets the number of requests allowed per minute to 3000 for all supported tasks.\nHugging Face does not publish a universal rate limit — actual limits may vary.\nIt is recommended to adjust this value based on the capacity and limits of your specific deployment environment." url: type: string description: "The URL endpoint to use for the requests.\nFor `completion` and `chat_completion` tasks, the deployed model must be compatible with the Hugging Face Chat Completion interface (see the linked external documentation for details). The endpoint URL for the request must include `/v1/chat/completions`.\nIf the model supports the OpenAI Chat Completion schema, a toggle should appear in the interface. Enabling this toggle doesn't change any model behavior, it reveals the full endpoint URL needed (which should include `/v1/chat/completions`) when configuring the inference endpoint in Elasticsearch. If the model doesn't support this schema, the toggle may not be shown." externalDocs: url: https://huggingface.co/docs/inference-providers/en/tasks/chat-completion#conversational-large-language-models-llms model_id: type: string description: "The name of the HuggingFace model to use for the inference task.\nFor `completion` and `chat_completion` tasks, this field is optional but may be required for certain models — particularly when using serverless inference endpoints.\nFor the `text_embedding` task, this field should not be included. Otherwise, the request will fail." inference._types.HuggingFaceTaskSettings: type: object properties: return_documents: type: boolean description: 'For a `rerank` task, return doc text within the results.' top_n: type: number description: "For a `rerank` task, the number of most relevant documents to return.\nIt defaults to the number of the documents." inference._types.InferenceEndpointInfoHuggingFace: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeHuggingFace' description: The task type inference._types.TaskTypeHuggingFace: enum: - chat_completion - completion - rerank - text_embedding type: string inference._types.JinaAITaskType: enum: - embedding - rerank - text_embedding type: string inference._types.JinaAIServiceType: enum: - jinaai type: string inference._types.JinaAIServiceSettings: required: - api_key - model_id type: object properties: api_key: type: string description: "A valid API key of your JinaAI account.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key." externalDocs: url: https://jina.ai/embeddings/ model_id: type: string description: The name of the model to use for the inference task. rate_limit: allOf: - $ref: '#/components/schemas/inference._types.RateLimitSetting' description: "This setting helps to minimize the number of rate limit errors returned from JinaAI.\nBy default, the `jinaai` service sets the number of requests allowed per minute to 2000 for all task types." externalDocs: url: https://jina.ai/contact-sales/#rate-limit similarity: allOf: - $ref: '#/components/schemas/inference._types.JinaAISimilarityType' description: "For an `embedding` or `text_embedding` task, the similarity measure. One of cosine, dot_product, l2_norm.\nThe default values varies with the embedding type.\nFor example, a float embedding type uses a `dot_product` similarity measure by default." dimensions: type: number description: "For an `embedding` or `text_embedding` task, the number of dimensions the resulting output embeddings should have.\nBy default, the model's standard output dimension is used.\nRefer to the Jina documentation for more information." externalDocs: url: https://jina.ai/embeddings/ embedding_type: allOf: - $ref: '#/components/schemas/inference._types.JinaAIElementType' description: "For an `embedding` or `text_embedding` task, the data type returned by the model.\nUse `bit` for binary embeddings, which are encoded as bytes with signed int8 precision.\nUse `binary` for binary embeddings, which are encoded as bytes with signed int8 precision (this is a synonym of `bit`).\nUse `float` for the default float embeddings." default: float multimodal_model: type: boolean description: "For the `embedding` task, whether the model supports multimodal inputs. If true, requests sent to the Jina model\nwill use the multimodal request format (a list of objects). If false, requests sent to the model will use the same\nformat as the `text_embedding` task (a list of strings). Setting this to `false` allows the `embedding` task to be\nused with models that do not support multimodal requests." default: true inference._types.JinaAISimilarityType: enum: - cosine - dot_product - l2_norm type: string inference._types.JinaAIElementType: enum: - binary - bit - float type: string inference._types.JinaAITaskSettings: type: object properties: return_documents: type: boolean description: 'For a `rerank` task, return the doc text within the results.' input_type: allOf: - $ref: '#/components/schemas/inference._types.JinaAITextEmbeddingTask' description: "For an `embedding` or `text_embedding` task, the task passed to the model.\nValid values are:\n\n* `classification`: Use it for embeddings passed through a classifier.\n* `clustering`: Use it for the embeddings run through a clustering algorithm.\n* `ingest`: Use it for storing document embeddings in a vector database.\n* `search`: Use it for storing embeddings of search queries run against a vector database to find relevant documents." late_chunking: type: boolean description: "For an `embedding` or `text_embedding` task, controls when text is split into chunks.\nWhen set to `true`, a request from Elasticsearch contains only chunks related to a single document. Instead of batching chunks across documents, Elasticsearch sends them in separate requests. This ensures that chunk embeddings retain context from the entire document, improving semantic quality.\n\nIf a document exceeds the model's context limits, or if the document contains non-text inputs (relevant when using the multimodal `embedding` task), late chunking is automatically disabled for that document only and standard chunking is used instead.\n\nIf not specified, defaults to `false`." top_n: type: number description: "For a `rerank` task, the number of most relevant documents to return.\nIt defaults to the number of the documents.\nIf this inference endpoint is used in a `text_similarity_reranker` retriever query and `top_n` is set, it must be greater than or equal to `rank_window_size` in the query." inference._types.JinaAITextEmbeddingTask: enum: - classification - clustering - ingest - search type: string inference._types.InferenceEndpointInfoJinaAi: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeJinaAi' description: The task type inference._types.TaskTypeJinaAi: enum: - embedding - text_embedding - rerank type: string inference._types.LlamaTaskType: enum: - text_embedding - completion - chat_completion type: string inference._types.LlamaServiceType: enum: - llama type: string inference._types.LlamaServiceSettings: required: - url - model_id type: object properties: url: type: string description: "The URL endpoint of the Llama stack endpoint.\nURL must contain:\n* For `text_embedding` task - `/v1/inference/embeddings`.\n* For `completion` and `chat_completion` tasks - `/v1/openai/v1/chat/completions`." model_id: type: string description: "The name of the model to use for the inference task.\nRefer to the Llama downloading models documentation for different ways of getting a list of available models and downloading them.\nService has been tested and confirmed to be working with the following models:\n* For `text_embedding` task - `all-MiniLM-L6-v2`.\n* For `completion` and `chat_completion` tasks - `llama3.2:3b`." externalDocs: url: https://llama-stack.readthedocs.io/en/latest/references/llama_cli_reference/download_models.html/ max_input_tokens: type: number description: 'For a `text_embedding` task, the maximum number of tokens per input before chunking occurs.' similarity: allOf: - $ref: '#/components/schemas/inference._types.LlamaSimilarityType' description: 'For a `text_embedding` task, the similarity measure. One of cosine, dot_product, l2_norm.' rate_limit: allOf: - $ref: '#/components/schemas/inference._types.RateLimitSetting' description: "This setting helps to minimize the number of rate limit errors returned from the Llama API.\nBy default, the `llama` service sets the number of requests allowed per minute to 3000." inference._types.LlamaSimilarityType: enum: - cosine - dot_product - l2_norm type: string inference._types.InferenceEndpointInfoLlama: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeLlama' description: The task type inference._types.TaskTypeLlama: enum: - text_embedding - chat_completion - completion type: string inference._types.MistralTaskType: enum: - text_embedding - completion - chat_completion type: string inference._types.MistralServiceType: enum: - mistral type: string inference._types.MistralServiceSettings: required: - api_key - model type: object properties: api_key: type: string description: "A valid API key of your Mistral account.\nYou can find your Mistral API keys or you can create a new one on the API Keys page.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key." externalDocs: url: https://console.mistral.ai/api-keys/ max_input_tokens: type: number description: The maximum number of tokens per input before chunking occurs. model: type: string description: "The name of the model to use for the inference task.\nRefer to the Mistral models documentation for the list of available models." externalDocs: url: https://docs.mistral.ai/getting-started/models/ rate_limit: allOf: - $ref: '#/components/schemas/inference._types.RateLimitSetting' description: "This setting helps to minimize the number of rate limit errors returned from the Mistral API.\nBy default, the `mistral` service sets the number of requests allowed per minute to 240." inference._types.InferenceEndpointInfoMistral: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeMistral' description: The task type inference._types.TaskTypeMistral: enum: - text_embedding - chat_completion - completion type: string inference._types.NvidiaTaskType: enum: - chat_completion - completion - rerank - text_embedding type: string inference._types.NvidiaServiceType: enum: - nvidia type: string inference._types.NvidiaServiceSettings: required: - api_key - model_id type: object properties: api_key: type: string description: "A valid API key for your Nvidia endpoint.\nCan be found in `API Keys` section of Nvidia account settings." url: type: string description: "The URL of the Nvidia model endpoint. If not provided, the default endpoint URL is used depending on the task type:\n\n* For `text_embedding` task - `https://integrate.api.nvidia.com/v1/embeddings`.\n* For `completion` and `chat_completion` tasks - `https://integrate.api.nvidia.com/v1/chat/completions`.\n* For `rerank` task - `https://ai.api.nvidia.com/v1/retrieval/nvidia/reranking`." model_id: type: string description: "The name of the model to use for the inference task.\nRefer to the model's documentation for the name if needed.\nService has been tested and confirmed to be working with the following models:\n\n* For `text_embedding` task - `nvidia/llama-3.2-nv-embedqa-1b-v2`.\n* For `completion` and `chat_completion` tasks - `microsoft/phi-3-mini-128k-instruct`.\n* For `rerank` task - `nv-rerank-qa-mistral-4b:1`.\nService doesn't support `text_embedding` task `baai/bge-m3` and `nvidia/nvclip` models due to them not recognizing the `input_type` parameter." max_input_tokens: type: number description: 'For a `text_embedding` task, the maximum number of tokens per input. Inputs exceeding this value are truncated prior to sending to the Nvidia API.' similarity: allOf: - $ref: '#/components/schemas/inference._types.NvidiaSimilarityType' description: 'For a `text_embedding` task, the similarity measure. One of cosine, dot_product, l2_norm.' rate_limit: allOf: - $ref: '#/components/schemas/inference._types.RateLimitSetting' description: "This setting helps to minimize the number of rate limit errors returned from the Nvidia API.\nBy default, the `nvidia` service sets the number of requests allowed per minute to 3000." inference._types.NvidiaSimilarityType: enum: - cosine - dot_product - l2_norm type: string inference._types.NvidiaTaskSettings: type: object properties: input_type: allOf: - $ref: '#/components/schemas/inference._types.NvidiaInputType' description: "For a `text_embedding` task, type of input sent to the Nvidia endpoint.\nValid values are:\n\n* `ingest`: Mapped to Nvidia's `passage` value in request. Used when generating embeddings during indexing.\n* `search`: Mapped to Nvidia's `query` value in request. Used when generating embeddings during querying.\n\nIMPORTANT: For Nvidia endpoints, if the `input_type` field is not specified, it defaults to `query`." truncate: allOf: - $ref: '#/components/schemas/inference._types.CohereTruncateType' description: "For a `text_embedding` task, the method used by the Nvidia model to handle inputs longer than the maximum token length.\nValid values are:\n\n* `END`: When the input exceeds the maximum input token length, the end of the input is discarded.\n* `NONE`: When the input exceeds the maximum input token length, an error is returned.\n* `START`: When the input exceeds the maximum input token length, the start of the input is discarded." inference._types.NvidiaInputType: enum: - ingest - search type: string inference._types.InferenceEndpointInfoNvidia: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference ID task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeNvidia' description: The task type inference._types.TaskTypeNvidia: enum: - chat_completion - completion - rerank - text_embedding type: string inference._types.OpenAITaskType: enum: - chat_completion - completion - text_embedding - embedding type: string inference._types.OpenAIServiceType: enum: - openai type: string inference._types.OpenAIServiceSettings: required: - model_id type: object properties: api_key: type: string description: "A valid API key of your OpenAI account.\nYou can find your OpenAI API keys in your OpenAI account under the API keys section.\n\nIMPORTANT: You must specify either `api_key` or `client_secret`.\nIf you do not provide one or you provide more than one of them, you will receive an error when you try to create your endpoint." externalDocs: url: https://platform.openai.com/api-keys client_id: type: string description: "For OAuth 2.0 authorization using the client credentials grant flow.\nThe application ID that's assigned to your app.\n\nIMPORTANT: To configure OAuth 2.0, you must specify `client_id`, `scopes`, `token_url`, and `client_secret` together.\nIf one of the fields is missing, you will receive an error when you try to create your endpoint." client_secret: type: string description: "For OAuth 2.0 authorization using the client credentials grant flow.\nThe application secret that you created for your app.\n\nIMPORTANT: You must specify either `api_key` or `client_secret`.\nIf you do not provide one or you provide more than one of them, you will receive an error when you try to create your endpoint.\n\nIMPORTANT: To configure OAuth 2.0, you must specify `client_id`, `scopes`, `token_url`, and `client_secret` together.\nIf one of the fields is missing, you will receive an error when you try to create your endpoint." dimensions: type: number description: "For a `text_embedding` or `embedding` task, the number of dimensions the resulting output embeddings should have.\nIt is supported only in `text-embedding-3` and later models.\nIf it is not set, the OpenAI defined default for the model is used." model_id: type: string description: "The name of the model to use for the inference task.\nRefer to the OpenAI documentation for the list of available text embedding models." externalDocs: url: https://platform.openai.com/docs/guides/embeddings/what-are-embeddings organization_id: type: string description: "The unique identifier for your organization.\nYou can find the Organization ID in your OpenAI account under *Settings > Organizations*." rate_limit: allOf: - $ref: '#/components/schemas/inference._types.RateLimitSetting' description: "This setting helps to minimize the number of rate limit errors returned from OpenAI.\nThe `openai` service sets a default number of requests allowed per minute depending on the task type.\nFor `text_embedding` and `embedding`, it is set to `3000`.\nFor `completion` and `chat_completion`, it is set to `500`." scopes: type: array items: type: string description: "For OAuth 2.0 authorization using the client credentials grant flow.\nThe resource identifier of the resource you want.\nFor example:\n```\n\"scopes\": [\n \"scope1\",\n \"scope2\"\n]\n```\n\nIMPORTANT: To configure OAuth 2.0, you must specify `client_id`, `scopes`, `token_url`, and `client_secret` together.\nIf one of the fields is missing, you will receive an error when you try to create your endpoint." similarity: allOf: - $ref: '#/components/schemas/inference._types.OpenAISimilarityType' description: 'For a `text_embedding` or `embedding` task, the similarity measure. One of `cosine`, `dot_product`, `l2_norm`. Defaults to `dot_product`.' token_url: type: string description: "For OAuth 2.0 authorization using the client credentials grant flow.\nAn OAuth2 token endpoint where Elasticsearch sends a request to exchange client credentials for an access token.\n\nIMPORTANT: To configure OAuth 2.0, you must specify `client_id`, `scopes`, `token_url`, and `client_secret` together.\nIf one of the fields is missing, you will receive an error when you try to create your endpoint." url: type: string description: "The URL endpoint to use for the requests.\nIt can be changed for testing purposes.\nDefault value is `https://api.openai.com/v1/embeddings` for a `text_embedding` or `embedding` task,\n`https://api.openai.com/v1/chat/completions` for a `completion` or `chat_completion` task." inference._types.OpenAISimilarityType: enum: - cosine - dot_product - l2_norm type: string inference._types.OpenAITaskSettings: type: object properties: user: type: string description: "Specifies the user issuing the request.\nThis information can be used for abuse detection." headers: type: object additionalProperties: type: string description: "Specifies custom HTTP header parameters.\nFor example:\n```\n\"headers\": {\n \"Custom-Header\": \"Some-Value\",\n \"Another-Custom-Header\": \"Another-Value\"\n}\n```" inference._types.InferenceEndpointInfoOpenAI: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeOpenAI' description: The task type inference._types.TaskTypeOpenAI: enum: - text_embedding - chat_completion - completion - embedding type: string inference._types.OpenShiftAiTaskType: enum: - text_embedding - completion - chat_completion - rerank type: string inference._types.OpenShiftAiServiceType: enum: - openshift_ai type: string inference._types.OpenShiftAiServiceSettings: required: - api_key - url type: object properties: api_key: type: string description: "A valid API key for your OpenShift AI endpoint.\nCan be found in `Token authentication` section of model related information." url: type: string description: The URL of the OpenShift AI hosted model endpoint. model_id: type: string description: "The name of the model to use for the inference task.\nRefer to the hosted model's documentation for the name if needed.\nService has been tested and confirmed to be working with the following models:\n* For `text_embedding` task - `gritlm-7b`.\n* For `completion` and `chat_completion` tasks - `llama-31-8b-instruct`.\n* For `rerank` task - `bge-reranker-v2-m3`." max_input_tokens: type: number description: 'For a `text_embedding` task, the maximum number of tokens per input before chunking occurs.' similarity: allOf: - $ref: '#/components/schemas/inference._types.OpenShiftAiSimilarityType' description: "For a `text_embedding` task, the similarity measure. One of cosine, dot_product, l2_norm.\nIf not specified, the default dot_product value is used." rate_limit: allOf: - $ref: '#/components/schemas/inference._types.RateLimitSetting' description: "This setting helps to minimize the number of rate limit errors returned from the OpenShift AI API.\nBy default, the `openshift_ai` service sets the number of requests allowed per minute to 3000." inference._types.OpenShiftAiSimilarityType: enum: - cosine - dot_product - l2_norm type: string inference._types.OpenShiftAiTaskSettings: type: object properties: return_documents: type: boolean description: 'For a `rerank` task, whether to return the source documents in the response.' top_n: type: number description: 'For a `rerank` task, the number of most relevant documents to return.' inference._types.InferenceEndpointInfoOpenShiftAi: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeOpenShiftAi' description: The task type inference._types.TaskTypeOpenShiftAi: enum: - text_embedding - chat_completion - completion - rerank type: string inference._types.VoyageAITaskType: enum: - text_embedding - rerank type: string inference._types.VoyageAIServiceType: enum: - voyageai type: string inference._types.VoyageAIServiceSettings: required: - model_id type: object properties: dimensions: type: number description: "The number of dimensions for resulting output embeddings.\nThis setting maps to `output_dimension` in the VoyageAI documentation.\nOnly for the `text_embedding` task type." externalDocs: url: https://docs.voyageai.com/docs/embeddings model_id: type: string description: "The name of the model to use for the inference task.\nRefer to the VoyageAI documentation for the list of available text embedding and rerank models." externalDocs: url: https://docs.voyageai.com/docs/reranker rate_limit: allOf: - $ref: '#/components/schemas/inference._types.RateLimitSetting' description: "This setting helps to minimize the number of rate limit errors returned from VoyageAI.\nThe `voyageai` service sets a default number of requests allowed per minute depending on the task type.\nFor both `text_embedding` and `rerank`, it is set to `2000`." embedding_type: type: number description: "The data type for the embeddings to be returned.\nThis setting maps to `output_dtype` in the VoyageAI documentation.\nPermitted values: float, int8, bit.\n`int8` is a synonym of `byte` in the VoyageAI documentation.\n`bit` is a synonym of `binary` in the VoyageAI documentation.\nOnly for the `text_embedding` task type." externalDocs: url: https://docs.voyageai.com/docs/embeddings inference._types.VoyageAITaskSettings: type: object properties: input_type: type: string description: "Type of the input text.\nPermitted values: `ingest` (maps to `document` in the VoyageAI documentation), `search` (maps to `query` in the VoyageAI documentation).\nOnly for the `text_embedding` task type." return_documents: type: boolean description: "Whether to return the source documents in the response.\nOnly for the `rerank` task type." default: false top_k: type: number description: "The number of most relevant documents to return.\nIf not specified, the reranking results of all documents will be returned.\nOnly for the `rerank` task type." truncation: type: boolean description: Whether to truncate the input texts to fit within the context length. default: true inference._types.InferenceEndpointInfoVoyageAI: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeVoyageAI' description: The task type inference._types.TaskTypeVoyageAI: enum: - text_embedding - rerank type: string inference._types.WatsonxTaskType: enum: - text_embedding - rerank - chat_completion - completion type: string inference._types.WatsonxServiceType: enum: - watsonxai type: string inference._types.WatsonxServiceSettings: required: - api_key - api_version - model_id - project_id - url type: object properties: api_key: type: string description: "A valid API key of your Watsonx account.\nYou can find your Watsonx API keys or you can create a new one on the API keys page.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key." externalDocs: url: https://cloud.ibm.com/iam/apikeys api_version: type: string description: "A version parameter that takes a version date in the format of `YYYY-MM-DD`.\nFor the active version data parameters, refer to the Wastonx documentation." externalDocs: url: https://cloud.ibm.com/apidocs/watsonx-ai#active-version-dates model_id: type: string description: "The name of the model to use for the inference task.\nRefer to the IBM Embedding Models section in the Watsonx documentation for the list of available text embedding models.\nRefer to the IBM library - Foundation models in Watsonx.ai." externalDocs: url: https://www.ibm.com/products/watsonx-ai/foundation-models project_id: type: string description: The identifier of the IBM Cloud project to use for the inference task. rate_limit: allOf: - $ref: '#/components/schemas/inference._types.RateLimitSetting' description: "This setting helps to minimize the number of rate limit errors returned from Watsonx.\nBy default, the `watsonxai` service sets the number of requests allowed per minute to 120." url: type: string description: The URL of the inference endpoint that you created on Watsonx. inference._types.InferenceEndpointInfoWatsonx: allOf: - $ref: '#/components/schemas/inference._types.InferenceEndpoint' - required: - inference_id - task_type type: object properties: inference_id: type: string description: The inference Id task_type: allOf: - $ref: '#/components/schemas/inference._types.TaskTypeWatsonx' description: The task type inference._types.TaskTypeWatsonx: enum: - text_embedding - chat_completion - completion type: string inference.rerank.RerankQuery: oneOf: - type: string - $ref: '#/components/schemas/inference.rerank.RerankInputObject' description: "Query input for the `rerank` task.\nEither a string, or an object. The object form additionally allows specifying non-text inputs, such as images.\n\n> info\n> Only the `elastic` service currently supports non-text queries for the `rerank` task." inference.rerank.RerankInputObject: title: Input object required: - type - value type: object properties: type: allOf: - $ref: '#/components/schemas/inference.rerank.RerankInputType' description: The type of input. Not all services and models support all input types. format: allOf: - $ref: '#/components/schemas/inference.rerank.RerankInputFormat' description: "The format of the input. For the `text` type this must be `text`. For the `image` type this must be `base64` or `url`.\nIf not specified, this defaults to `text` for the `text` type and `base64` for the `image` type.\nThe `url` format is available in Elasticsearch 9.6.0 and later.\nNot all services and models support all formats." value: type: string description: "The value of the input. For the `base64` format, this must be a base64-encoded data URI, that is, \"data:content/type;base64,...\".\nFor the `url` format, this must be a URL that points to the content, that is, \"https://example.com/image.jpg\"." description: 'An object describing a single input for the `rerank` task, which additionally allows specifying non-text inputs, such as images.' inference.rerank.RerankInputType: enum: - text - image type: string inference.rerank.RerankInputFormat: enum: - text - base64 - url type: string inference.rerank.RerankInput: oneOf: - $ref: '#/components/schemas/inference.rerank.RerankStringInput' - $ref: '#/components/schemas/inference.rerank.RerankObjectInput' description: "The documents to rank for the `rerank` task.\nEither a string, an array of strings, an object, or an array of objects.\nThe object form additionally allows specifying non-text inputs, such as images.\n\n> info\n> Only the `elastic` service currently supports non-text inputs for the `rerank` task." inference.rerank.RerankStringInput: title: String or array of strings oneOf: - type: string - title: Array of strings type: array items: type: string description: An array of text documents to rank. description: Allows specifying text-only documents to rank for the `rerank` task. inference.rerank.RerankObjectInput: title: Object or array of objects oneOf: - $ref: '#/components/schemas/inference.rerank.RerankInputObject' - title: Array of objects type: array items: $ref: '#/components/schemas/inference.rerank.RerankInputObject' description: 'An array of input objects to rank. Each object can specify a non-text input, such as an image.' description: 'Allows specifying documents to rank as objects, which additionally supports non-text inputs, such as images.' inference._types.RerankedInferenceResult: required: - rerank type: object properties: rerank: type: array items: $ref: '#/components/schemas/inference._types.RankedDocument' description: Defines the response for a rerank request. inference._types.SparseEmbeddingInferenceResult: required: - sparse_embedding type: object properties: sparse_embedding: type: array items: $ref: '#/components/schemas/inference._types.SparseEmbeddingResult' description: The response format for the sparse embedding request. inference._types.TextEmbeddingInferenceResult: maxProperties: 1 minProperties: 1 type: object properties: text_embedding_bytes: type: array items: $ref: '#/components/schemas/inference._types.DenseEmbeddingByteResult' text_embedding_bits: type: array items: $ref: '#/components/schemas/inference._types.DenseEmbeddingByteResult' text_embedding: type: array items: $ref: '#/components/schemas/inference._types.DenseEmbeddingResult' description: TextEmbeddingInferenceResult is an aggregation of mutually exclusive text_embedding variants _types.ElasticsearchVersionInfo: required: - build_date - build_flavor - build_hash - build_snapshot - build_type - lucene_version - minimum_index_compatibility_version - minimum_wire_compatibility_version - number type: object properties: build_date: allOf: - $ref: '#/components/schemas/_types.DateTime' description: The Elasticsearch Git commit's date. build_flavor: type: string description: 'The build flavor. For example, `default`.' build_hash: type: string description: The Elasticsearch Git commit's SHA hash. build_snapshot: type: boolean description: Indicates whether the Elasticsearch build was a snapshot. build_type: type: string description: "The build type that corresponds to how Elasticsearch was installed.\nFor example, `docker`, `rpm`, or `tar`." lucene_version: allOf: - $ref: '#/components/schemas/_types.VersionString' description: The version number of Elasticsearch's underlying Lucene software. minimum_index_compatibility_version: allOf: - $ref: '#/components/schemas/_types.VersionString' description: The minimum index version with which the responding node can read from disk. minimum_wire_compatibility_version: allOf: - $ref: '#/components/schemas/_types.VersionString' description: "The minimum node version with which the responding node can communicate.\nAlso the minimum version from which you can perform a rolling upgrade." number: type: string description: "The Elasticsearch version number.\n\n::: IMPORTANT: For Serverless deployments, this static value is always `8.11.0` and is used solely for backward compatibility with legacy clients.\n Serverless environments are versionless and automatically upgraded, so this value can be safely ignored." ingest.geo_ip_stats.GeoIpDownloadStatistics: required: - successful_downloads - failed_downloads - total_download_time - databases_count - skipped_updates - expired_databases type: object properties: successful_downloads: type: number description: Total number of successful database downloads. failed_downloads: type: number description: Total number of failed database downloads. total_download_time: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: Total milliseconds spent downloading databases. databases_count: type: number description: Current number of databases available for use. skipped_updates: type: number description: Total number of database updates skipped. expired_databases: type: number description: Total number of databases not updated after 30 days ingest.geo_ip_stats.GeoIpNodeDatabases: required: - databases - files_in_temp type: object properties: databases: type: array items: $ref: '#/components/schemas/ingest.geo_ip_stats.GeoIpNodeDatabaseName' description: Downloaded databases for the node. files_in_temp: type: array items: type: string description: 'Downloaded database files, including related license files. Elasticsearch stores these files in the node’s temporary directory: $ES_TMPDIR/geoip-databases/.' description: Downloaded databases for the node. The field key is the node ID. ingest.geo_ip_stats.GeoIpNodeDatabaseName: required: - name type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' description: Name of the database. ingest.get_geoip_database.DatabaseConfigurationMetadata: required: - id - version - modified_date_millis - database type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' version: type: number modified_date_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' database: allOf: - $ref: '#/components/schemas/ingest._types.DatabaseConfiguration' ingest._types.DatabaseConfiguration: allOf: - required: - name type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' description: The provider-assigned name of the IP geolocation database to download. - maxProperties: 1 minProperties: 1 type: object properties: maxmind: allOf: - $ref: '#/components/schemas/ingest._types.Maxmind' ipinfo: allOf: - $ref: '#/components/schemas/ingest._types.Ipinfo' description: "The configuration necessary to identify which IP geolocation provider to use to download a database, as well as any provider-specific configuration necessary for such downloading.\nAt present, the only supported providers are `maxmind` and `ipinfo`, and the `maxmind` provider requires that an `account_id` (string) is configured.\nA provider (either `maxmind` or `ipinfo`) must be specified. The web and local providers can be returned as read only configurations." ingest._types.Maxmind: required: - account_id type: object properties: account_id: allOf: - $ref: '#/components/schemas/_types.Id' ingest._types.Ipinfo: type: object ingest.get_ip_location_database.DatabaseConfigurationMetadata: required: - id - version - database type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' modified_date_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' modified_date: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' database: allOf: - $ref: '#/components/schemas/ingest._types.DatabaseConfigurationFull' ingest._types.DatabaseConfigurationFull: allOf: - required: - name type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' description: The provider-assigned name of the IP geolocation database to download. - maxProperties: 1 minProperties: 1 type: object properties: web: allOf: - $ref: '#/components/schemas/ingest._types.Web' local: allOf: - $ref: '#/components/schemas/ingest._types.Local' maxmind: allOf: - $ref: '#/components/schemas/ingest._types.Maxmind' ipinfo: allOf: - $ref: '#/components/schemas/ingest._types.Ipinfo' ingest._types.Web: type: object ingest._types.Local: required: - type type: object properties: type: type: string ingest._types.Pipeline: type: object properties: description: type: string description: Description of the ingest pipeline. on_failure: type: array items: $ref: '#/components/schemas/ingest._types.ProcessorContainer' description: Processors to run immediately after a processor failure. processors: type: array items: $ref: '#/components/schemas/ingest._types.ProcessorContainer' description: "Processors used to perform transformations on documents before indexing.\nProcessors run sequentially in the order specified." version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' description: Version number used by external systems to track ingest pipelines. deprecated: type: boolean description: "Marks this ingest pipeline as deprecated.\nWhen a deprecated ingest pipeline is referenced as the default or final pipeline when creating or updating a non-deprecated index template, Elasticsearch will emit a deprecation warning." default: false _meta: allOf: - $ref: '#/components/schemas/_types.Metadata' description: Arbitrary metadata about the ingest pipeline. This map is not automatically generated by Elasticsearch. created_date: allOf: - $ref: '#/components/schemas/_types.DateTime' description: Date and time when the pipeline was created. Only returned if the `human` query parameter is `true`. x-state: Generally available; Added in 9.2.0 created_date_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: 'Date and time when the pipeline was created, in milliseconds since the epoch.' x-state: Generally available; Added in 9.2.0 modified_date: allOf: - $ref: '#/components/schemas/_types.DateTime' description: Date and time when the pipeline was last modified. Only returned if the `human` query parameter is `true`. x-state: Generally available; Added in 9.2.0 modified_date_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: 'Date and time when the pipeline was last modified, in milliseconds since the epoch.' x-state: Generally available; Added in 9.2.0 field_access_pattern: allOf: - $ref: '#/components/schemas/ingest._types.FieldAccessPattern' description: Controls how processors in this pipeline should read and write data on a document's source. default: classic x-state: Generally available; Added in 9.2.0 ingest._types.ProcessorContainer: maxProperties: 1 minProperties: 1 type: object properties: append: allOf: - $ref: '#/components/schemas/ingest._types.AppendProcessor' description: "Appends one or more values to an existing array if the field already exists and it is an array.\nConverts a scalar to an array and appends one or more values to it if the field exists and it is a scalar.\nCreates an array containing the provided values if the field doesn’t exist.\nAccepts a single value or an array of values." attachment: allOf: - $ref: '#/components/schemas/ingest._types.AttachmentProcessor' description: 'The attachment processor lets Elasticsearch extract file attachments in common formats (such as PPT, XLS, and PDF) by using the Apache text extraction library Tika.' bytes: allOf: - $ref: '#/components/schemas/ingest._types.BytesProcessor' description: "Converts a human readable byte value (for example `1kb`) to its value in bytes (for example `1024`).\nIf the field is an array of strings, all members of the array will be converted.\nSupported human readable units are \"b\", \"kb\", \"mb\", \"gb\", \"tb\", \"pb\" case insensitive.\nAn error will occur if the field is not a supported format or resultant value exceeds 2^63." cef: allOf: - $ref: '#/components/schemas/ingest._types.CefProcessor' description: Converts a CEF message into a structured format. circle: allOf: - $ref: '#/components/schemas/ingest._types.CircleProcessor' description: Converts circle definitions of shapes to regular polygons which approximate them. community_id: allOf: - $ref: '#/components/schemas/ingest._types.CommunityIDProcessor' description: "Computes the Community ID for network flow data as defined in the\nCommunity ID Specification. You can use a community ID to correlate network\nevents related to a single flow." convert: allOf: - $ref: '#/components/schemas/ingest._types.ConvertProcessor' description: "Converts a field in the currently ingested document to a different type, such as converting a string to an integer.\nIf the field value is an array, all members will be converted." csv: allOf: - $ref: '#/components/schemas/ingest._types.CsvProcessor' description: "Extracts fields from CSV line out of a single text field within a document.\nAny empty field in CSV will be skipped." date: allOf: - $ref: '#/components/schemas/ingest._types.DateProcessor' description: 'Parses dates from fields, and then uses the date or timestamp as the timestamp for the document.' date_index_name: allOf: - $ref: '#/components/schemas/ingest._types.DateIndexNameProcessor' description: The purpose of this processor is to point documents to the right time based index based on a date or timestamp field in a document by using the date math index name support. dissect: allOf: - $ref: '#/components/schemas/ingest._types.DissectProcessor' description: Extracts structured fields out of a single text field by matching the text field against a delimiter-based pattern. dot_expander: allOf: - $ref: '#/components/schemas/ingest._types.DotExpanderProcessor' description: "Expands a field with dots into an object field.\nThis processor allows fields with dots in the name to be accessible by other processors in the pipeline.\nOtherwise these fields can’t be accessed by any processor." drop: allOf: - $ref: '#/components/schemas/ingest._types.DropProcessor' description: "Drops the document without raising any errors.\nThis is useful to prevent the document from getting indexed based on some condition." enrich: allOf: - $ref: '#/components/schemas/ingest._types.EnrichProcessor' description: The `enrich` processor can enrich documents with data from another index. fail: allOf: - $ref: '#/components/schemas/ingest._types.FailProcessor' description: "Raises an exception.\nThis is useful for when you expect a pipeline to fail and want to relay a specific message to the requester." fingerprint: allOf: - $ref: '#/components/schemas/ingest._types.FingerprintProcessor' description: "Computes a hash of the document’s content. You can use this hash for\ncontent fingerprinting." foreach: allOf: - $ref: '#/components/schemas/ingest._types.ForeachProcessor' description: Runs an ingest processor on each element of an array or object. ip_location: allOf: - $ref: '#/components/schemas/ingest._types.IpLocationProcessor' description: Currently an undocumented alias for GeoIP Processor. geo_grid: allOf: - $ref: '#/components/schemas/ingest._types.GeoGridProcessor' description: "Converts geo-grid definitions of grid tiles or cells to regular bounding boxes or polygons which describe their shape.\nThis is useful if there is a need to interact with the tile shapes as spatially indexable fields." geoip: allOf: - $ref: '#/components/schemas/ingest._types.GeoIpProcessor' description: The `geoip` processor adds information about the geographical location of an IPv4 or IPv6 address. grok: allOf: - $ref: '#/components/schemas/ingest._types.GrokProcessor' description: "Extracts structured fields out of a single text field within a document.\nYou choose which field to extract matched fields from, as well as the grok pattern you expect will match.\nA grok pattern is like a regular expression that supports aliased expressions that can be reused." gsub: allOf: - $ref: '#/components/schemas/ingest._types.GsubProcessor' description: "Converts a string field by applying a regular expression and a replacement.\nIf the field is an array of string, all members of the array will be converted.\nIf any non-string values are encountered, the processor will throw an exception." html_strip: allOf: - $ref: '#/components/schemas/ingest._types.HtmlStripProcessor' description: "Removes HTML tags from the field.\nIf the field is an array of strings, HTML tags will be removed from all members of the array." inference: allOf: - $ref: '#/components/schemas/ingest._types.InferenceProcessor' description: Uses a pre-trained data frame analytics model or a model deployed for natural language processing tasks to infer against the data that is being ingested in the pipeline. join: allOf: - $ref: '#/components/schemas/ingest._types.JoinProcessor' description: "Joins each element of an array into a single string using a separator character between each element.\nThrows an error when the field is not an array." json: allOf: - $ref: '#/components/schemas/ingest._types.JsonProcessor' description: 'Parses a string containing JSON data into a structured object, string, or other value.' kv: allOf: - $ref: '#/components/schemas/ingest._types.KeyValueProcessor' description: This processor helps automatically parse messages (or specific event fields) which are of the `foo=bar` variety. lowercase: allOf: - $ref: '#/components/schemas/ingest._types.LowercaseProcessor' description: "Converts a string to its lowercase equivalent.\nIf the field is an array of strings, all members of the array will be converted." network_direction: allOf: - $ref: '#/components/schemas/ingest._types.NetworkDirectionProcessor' description: "Calculates the network direction given a source IP address, destination IP\naddress, and a list of internal networks." normalize_for_stream: allOf: - $ref: '#/components/schemas/ingest._types.NormalizeForStreamProcessor' description: 'Detects whether a document is OpenTelemetry-compliant and, if not, normalizes it so that it can be queried by clients that expect either ECS or OpenTelemetry Semantic Conventions formats.' x-state: Technical preview; Added in 9.1.0 pipeline: allOf: - $ref: '#/components/schemas/ingest._types.PipelineProcessor' description: Executes another pipeline. recover_failure_document: allOf: - $ref: '#/components/schemas/ingest._types.RecoverFailureDocumentProcessor' description: Recovers documents that have been stored in a data stream's failure store by restoring them to their original format. x-state: Generally available; Added in 9.2.0 redact: allOf: - $ref: '#/components/schemas/ingest._types.RedactProcessor' description: "The Redact processor uses the Grok rules engine to obscure text in the input document matching the given Grok patterns.\nThe processor can be used to obscure Personal Identifying Information (PII) by configuring it to detect known patterns such as email or IP addresses.\nText that matches a Grok pattern is replaced with a configurable string such as `` where an email address is matched or simply replace all matches with the text `` if preferred." registered_domain: allOf: - $ref: '#/components/schemas/ingest._types.RegisteredDomainProcessor' description: "Extracts the registered domain (also known as the effective top-level\ndomain or eTLD), sub-domain, and top-level domain from a fully qualified\ndomain name (FQDN). Uses the registered domains defined in the Mozilla\nPublic Suffix List." remove: allOf: - $ref: '#/components/schemas/ingest._types.RemoveProcessor' description: "Removes existing fields.\nIf one field doesn’t exist, an exception will be thrown." rename: allOf: - $ref: '#/components/schemas/ingest._types.RenameProcessor' description: "Renames an existing field.\nIf the field doesn’t exist or the new name is already used, an exception will be thrown." reroute: allOf: - $ref: '#/components/schemas/ingest._types.RerouteProcessor' description: "Routes a document to another target index or data stream.\nWhen setting the `destination` option, the target is explicitly specified and the dataset and namespace options can’t be set.\nWhen the `destination` option is not set, this processor is in a data stream mode. Note that in this mode, the reroute processor can only be used on data streams that follow the data stream naming scheme." script: allOf: - $ref: '#/components/schemas/ingest._types.ScriptProcessor' description: "Runs an inline or stored script on incoming documents.\nThe script runs in the `ingest` context." set: allOf: - $ref: '#/components/schemas/ingest._types.SetProcessor' description: "Adds a field with the specified value.\nIf the field already exists, its value will be replaced with the provided one." set_security_user: allOf: - $ref: '#/components/schemas/ingest._types.SetSecurityUserProcessor' description: 'Sets user-related details (such as `username`, `roles`, `email`, `full_name`, `metadata`, `api_key`, `realm` and `authentication_type`) from the current authenticated user to the current document by pre-processing the ingest.' sort: allOf: - $ref: '#/components/schemas/ingest._types.SortProcessor' description: "Sorts the elements of an array ascending or descending.\nHomogeneous arrays of numbers will be sorted numerically, while arrays of strings or heterogeneous arrays of strings + numbers will be sorted lexicographically.\nThrows an error when the field is not an array." split: allOf: - $ref: '#/components/schemas/ingest._types.SplitProcessor' description: "Splits a field into an array using a separator character.\nOnly works on string fields." terminate: allOf: - $ref: '#/components/schemas/ingest._types.TerminateProcessor' description: "Terminates the current ingest pipeline, causing no further processors to be run.\nThis will normally be executed conditionally, using the `if` option." trim: allOf: - $ref: '#/components/schemas/ingest._types.TrimProcessor' description: "Trims whitespace from a field.\nIf the field is an array of strings, all members of the array will be trimmed.\nThis only works on leading and trailing whitespace." uppercase: allOf: - $ref: '#/components/schemas/ingest._types.UppercaseProcessor' description: "Converts a string to its uppercase equivalent.\nIf the field is an array of strings, all members of the array will be converted." urldecode: allOf: - $ref: '#/components/schemas/ingest._types.UrlDecodeProcessor' description: "URL-decodes a string.\nIf the field is an array of strings, all members of the array will be decoded." uri_parts: allOf: - $ref: '#/components/schemas/ingest._types.UriPartsProcessor' description: "Parses a Uniform Resource Identifier (URI) string and extracts its components as an object.\nThis URI object includes properties for the URI’s domain, path, fragment, port, query, scheme, user info, username, and password." user_agent: allOf: - $ref: '#/components/schemas/ingest._types.UserAgentProcessor' description: "The `user_agent` processor extracts details from the user agent string a browser sends with its web requests.\nThis processor adds this information by default under the `user_agent` field." ingest._types.AppendProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The field to be appended to.\nSupports template snippets." value: oneOf: - type: object - type: array items: type: object description: The value to be appended. Supports template snippets. May specify only one of `value` or `copy_from`. media_type: type: string description: "The media type for encoding `value`.\nApplies only when value is a template snippet.\nMust be one of `application/json`, `text/plain`, or `application/x-www-form-urlencoded`." default: '"application/json"' copy_from: allOf: - $ref: '#/components/schemas/_types.Field' description: 'The origin field which will be appended to `field`, cannot set `value` simultaneously.' allow_duplicates: type: boolean description: 'If `false`, the processor does not append values already present in the field.' default: true ignore_empty_values: type: boolean description: "If `true`, the processor will skip empty values from the source (e.g. empty strings, and null values),\nrather than appending them to the field." default: false ingest._types.ProcessorBase: type: object properties: description: type: string description: "Description of the processor.\nUseful for describing the purpose of the processor or its configuration." if: allOf: - $ref: '#/components/schemas/_types.Script' description: Conditionally execute the processor. ignore_failure: type: boolean description: Ignore failures for the processor. on_failure: type: array items: $ref: '#/components/schemas/ingest._types.ProcessorContainer' description: Handle failures for the processor. tag: type: string description: "Identifier for the processor.\nUseful for debugging and metrics." ingest._types.AttachmentProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field to get the base64 encoded field from. ignore_missing: type: boolean description: 'If `true` and field does not exist, the processor quietly exits without modifying the document.' default: false indexed_chars: type: number description: "The number of chars being used for extraction to prevent huge fields.\nUse `-1` for no limit." default: 100000 indexed_chars_field: allOf: - $ref: '#/components/schemas/_types.Field' description: Field name from which you can overwrite the number of chars being used for extraction. default: 'null' max_field_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "Maximum allowed size of the attachment `field` value in bytes: length of a string (if base64 in JSON,\nchecked before base64 decoding) or byte array length for binary (for example, CBOR).\nIf set to `-1`, there is no per-processor limit.\nThe node setting `ingest.attachment.max_field_size` also applies." default: '-1' x-state: Generally available; Added in 9.5.0 properties: type: array items: type: string description: "Array of properties to select to be stored.\nCan be `content`, `title`, `name`, `author`, `keywords`, `date`, `content_type`, `content_length`, `language`." target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field that will hold the attachment information. default: attachment remove_binary: type: boolean description: 'If true, the binary field will be removed from the document' default: false resource_name: type: string description: "Field containing the name of the resource to decode.\nIf specified, the processor passes this resource name to the underlying Tika library to enable Resource Name Based Detection." ingest._types.BytesProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field to convert. ignore_missing: type: boolean description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.' default: false target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The field to assign the converted value to.\nBy default, the field is updated in-place." default: field ingest._types.CefProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field containing the CEF message. ignore_missing: type: boolean description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.' default: false target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The field to assign the converted value to.\nBy default, the `target_field` is 'cef'" default: '''cef''' ignore_empty_values: type: boolean description: 'If `true` and value is anempty string in extensions, the processor quietly exits without modifying the document.' default: false timezone: type: string description: The timezone to use when parsing the date and when date math index supports resolves expressions into concrete index names. default: UTC ingest._types.CircleProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - error_distance - field - shape_type type: object properties: error_distance: type: number description: 'The difference between the resulting inscribed distance from center to side and the circle’s radius (measured in meters for `geo_shape`, unit-less for `shape`).' field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field to interpret as a circle. Either a string in WKT format or a map for GeoJSON. ignore_missing: type: boolean description: 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.' default: false shape_type: allOf: - $ref: '#/components/schemas/ingest._types.ShapeType' description: 'Which field mapping type is to be used when processing the circle: `geo_shape` or `shape`.' target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The field to assign the polygon shape to\nBy default, the field is updated in-place." ingest._types.ShapeType: enum: - geo_shape - shape type: string ingest._types.CommunityIDProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - type: object properties: source_ip: allOf: - $ref: '#/components/schemas/_types.Field' description: Field containing the source IP address. default: source.ip source_port: allOf: - $ref: '#/components/schemas/_types.Field' description: Field containing the source port. default: source.port destination_ip: allOf: - $ref: '#/components/schemas/_types.Field' description: Field containing the destination IP address. default: destination.ip destination_port: allOf: - $ref: '#/components/schemas/_types.Field' description: Field containing the destination port. default: destination.port iana_number: allOf: - $ref: '#/components/schemas/_types.Field' description: Field containing the IANA number. default: network.iana_number icmp_type: allOf: - $ref: '#/components/schemas/_types.Field' description: Field containing the ICMP type. default: icmp.type icmp_code: allOf: - $ref: '#/components/schemas/_types.Field' description: Field containing the ICMP code. default: icmp.code transport: allOf: - $ref: '#/components/schemas/_types.Field' description: "Field containing the transport protocol name or number. Used only when the\niana_number field is not present. The following protocol names are currently\nsupported: eigrp, gre, icmp, icmpv6, igmp, ipv6-icmp, ospf, pim, sctp, tcp, udp" default: network.transport target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: Output field for the community ID. default: network.community_id seed: type: number description: "Seed for the community ID hash. Must be between 0 and 65535 (inclusive). The\nseed can prevent hash collisions between network domains, such as a staging\nand production network that use the same addressing scheme." default: 0 ignore_missing: type: boolean description: "If true and any required fields are missing, the processor quietly exits\nwithout modifying the document." default: true ingest._types.ConvertProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field - type type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field whose value is to be converted. ignore_missing: type: boolean description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.' default: false target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The field to assign the converted value to.\nBy default, the `field` is updated in-place." default: field type: allOf: - $ref: '#/components/schemas/ingest._types.ConvertType' description: The type to convert the existing value to. ingest._types.ConvertType: enum: - integer - long - double - float - boolean - ip - string - auto type: string ingest._types.CsvProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field - target_fields type: object properties: empty_value: type: object description: "Value used to fill empty fields.\nEmpty fields are skipped if this is not provided.\nAn empty field is one with no value (2 consecutive separators) or empty quotes (`\"\"`)." field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field to extract data from. ignore_missing: type: boolean description: 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.' quote: type: string description: 'Quote used in CSV, has to be single character string.' default: '"' separator: type: string description: 'Separator used in CSV, has to be single character string.' default: ',' target_fields: allOf: - $ref: '#/components/schemas/_types.Fields' description: The array of fields to assign extracted values to. trim: type: boolean description: Trim whitespaces in unquoted fields. ingest._types.DateProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field - formats type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field to get the date from. formats: type: array items: type: string description: "An array of the expected date formats.\nCan be a java time pattern or one of the following formats: ISO8601, UNIX, UNIX_MS, or TAI64N." locale: type: string description: "The locale to use when parsing the date, relevant when parsing month names or week days.\nSupports template snippets." default: ENGLISH target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field that will hold the parsed date. default: '@timestamp' timezone: type: string description: "The timezone to use when parsing the date.\nSupports template snippets." default: UTC output_format: type: string description: "The format to use when writing the date to target_field. Must be a valid\njava time pattern." default: yyyy-MM-dd'T'HH:mm:ss.SSSXXX ingest._types.DateIndexNameProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - date_rounding - field type: object properties: date_formats: type: array items: type: string description: "An array of the expected date formats for parsing dates / timestamps in the document being preprocessed.\nCan be a java time pattern or one of the following formats: ISO8601, UNIX, UNIX_MS, or TAI64N." date_rounding: type: string description: "How to round the date when formatting the date into the index name. Valid values are:\n`y` (year), `M` (month), `w` (week), `d` (day), `h` (hour), `m` (minute) and `s` (second).\nSupports template snippets." field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field to get the date or timestamp from. index_name_format: type: string description: "The format to be used when printing the parsed date into the index name.\nA valid java time pattern is expected here.\nSupports template snippets." default: yyyy-MM-dd index_name_prefix: type: string description: "A prefix of the index name to be prepended before the printed date.\nSupports template snippets." locale: type: string description: 'The locale to use when parsing the date from the document being preprocessed, relevant when parsing month names or week days.' default: ENGLISH timezone: type: string description: The timezone to use when parsing the date and when date math index supports resolves expressions into concrete index names. default: UTC ingest._types.DissectProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field - pattern type: object properties: append_separator: type: string description: The character(s) that separate the appended fields. default: '""' field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field to dissect. ignore_missing: type: boolean description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.' default: false pattern: type: string description: The pattern to apply to the field. ingest._types.DotExpanderProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The field to expand into an object field.\nIf set to `*`, all top-level fields will be expanded." override: type: boolean description: "Controls the behavior when there is already an existing nested object that conflicts with the expanded field.\nWhen `false`, the processor will merge conflicts by combining the old and the new values into an array.\nWhen `true`, the value from the expanded field will overwrite the existing value." default: false path: type: string description: "The field that contains the field to expand.\nOnly required if the field to expand is part another object field, because the `field` option can only understand leaf fields." ingest._types.DropProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - type: object ingest._types.EnrichProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field - policy_name - target_field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The field in the input document that matches the policies match_field used to retrieve the enrichment data.\nSupports template snippets." ignore_missing: type: boolean description: 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.' default: false max_matches: type: number description: "The maximum number of matched documents to include under the configured target field.\nThe `target_field` will be turned into a json array if `max_matches` is higher than 1, otherwise `target_field` will become a json object.\nIn order to avoid documents getting too large, the maximum allowed value is 128." default: 1 override: type: boolean description: "If processor will update fields with pre-existing non-null-valued field.\nWhen set to `false`, such fields will not be touched." default: true policy_name: type: string description: The name of the enrich policy to use. shape_relation: allOf: - $ref: '#/components/schemas/_types.GeoShapeRelation' description: "A spatial relation operator used to match the geoshape of incoming documents to documents in the enrich index.\nThis option is only used for `geo_match` enrich policy types.\n\nSupported values include:\n - `intersects`: Return all documents whose `geo_shape` or `geo_point` field intersects the query geometry.\n - `disjoint`: Return all documents whose `geo_shape` or `geo_point` field has nothing in common with the query geometry.\n - `within`: Return all documents whose `geo_shape` or `geo_point` field is within the query geometry.\nLine geometries are not supported.\n - `contains`: Return all documents whose `geo_shape` or `geo_point` field contains the query geometry.\n\n" default: INTERSECTS target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "Field added to incoming documents to contain enrich data. This field contains both the `match_field` and `enrich_fields` specified in the enrich policy.\nSupports template snippets." _types.GeoShapeRelation: enum: - intersects - disjoint - within - contains type: string ingest._types.FailProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - message type: object properties: message: type: string description: "The error message thrown by the processor.\nSupports template snippets." ingest._types.FingerprintProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - fields type: object properties: fields: allOf: - $ref: '#/components/schemas/_types.Fields' description: "Array of fields to include in the fingerprint. For objects, the processor\nhashes both the field key and value. For other fields, the processor hashes\nonly the field value." target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: Output field for the fingerprint. default: fingerprint salt: type: string description: Salt value for the hash function. method: allOf: - $ref: '#/components/schemas/ingest._types.FingerprintDigest' description: "The hash method used to compute the fingerprint. Must be one of MD5, SHA-1,\nSHA-256, SHA-512, or MurmurHash3." default: SHA-1 ignore_missing: type: boolean description: "If true, the processor ignores any missing fields. If all fields are\nmissing, the processor silently exits without modifying the document." default: false ingest._types.FingerprintDigest: enum: - MD5 - SHA-1 - SHA-256 - SHA-512 - MurmurHash3 type: string ingest._types.ForeachProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field - processor type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: Field containing array or object values. ignore_missing: type: boolean description: 'If `true`, the processor silently exits without changing the document if the `field` is `null` or missing.' default: false processor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorContainer' description: Ingest processor to run on each element. ingest._types.IpLocationProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field type: object properties: database_file: type: string description: 'The database filename referring to a database the module ships with (GeoLite2-City.mmdb, GeoLite2-Country.mmdb, or GeoLite2-ASN.mmdb) or a custom database in the ingest-geoip config directory.' default: GeoLite2-City.mmdb field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field to get the ip address from for the geographical lookup. first_only: type: boolean description: 'If `true`, only the first found IP location data will be returned, even if the field contains an array.' default: true ignore_missing: type: boolean description: 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.' default: false properties: type: array items: type: string description: Controls what properties are added to the `target_field` based on the IP location lookup. target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field that will hold the geographical information looked up from the MaxMind database. default: geoip download_database_on_pipeline_creation: type: boolean description: "If `true` (and if `ingest.geoip.downloader.eager.download` is `false`), the missing database is downloaded when the pipeline is created.\nElse, the download is triggered by when the pipeline is used as the `default_pipeline` or `final_pipeline` in an index." ingest._types.GeoGridProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field - tile_type type: object properties: field: type: string description: "The field to interpret as a geo-tile.=\nThe field format is determined by the `tile_type`." tile_type: allOf: - $ref: '#/components/schemas/ingest._types.GeoGridTileType' description: 'Three tile formats are understood: geohash, geotile and geohex.' target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: 'The field to assign the polygon shape to, by default, the `field` is updated in-place.' default: field parent_field: allOf: - $ref: '#/components/schemas/_types.Field' description: 'If specified and a parent tile exists, save that tile address to this field.' children_field: allOf: - $ref: '#/components/schemas/_types.Field' description: 'If specified and children tiles exist, save those tile addresses to this field as an array of strings.' non_children_field: allOf: - $ref: '#/components/schemas/_types.Field' description: 'If specified and intersecting non-child tiles exist, save their addresses to this field as an array of strings.' precision_field: allOf: - $ref: '#/components/schemas/_types.Field' description: 'If specified, save the tile precision (zoom) as an integer to this field.' ignore_missing: type: boolean description: 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.' default: false target_format: allOf: - $ref: '#/components/schemas/ingest._types.GeoGridTargetFormat' description: Which format to save the generated polygon in. default: geojson ingest._types.GeoGridTileType: enum: - geotile - geohex - geohash type: string ingest._types.GeoGridTargetFormat: enum: - geojson - wkt type: string ingest._types.GeoIpProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field type: object properties: database_file: type: string description: 'The database filename referring to a database the module ships with (GeoLite2-City.mmdb, GeoLite2-Country.mmdb, or GeoLite2-ASN.mmdb) or a custom database in the ingest-geoip config directory.' default: GeoLite2-City.mmdb field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field to get the ip address from for the geographical lookup. first_only: type: boolean description: 'If `true`, only the first found geoip data will be returned, even if the field contains an array.' default: true ignore_missing: type: boolean description: 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.' default: false properties: type: array items: type: string description: Controls what properties are added to the `target_field` based on the geoip lookup. target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field that will hold the geographical information looked up from the MaxMind database. default: geoip download_database_on_pipeline_creation: type: boolean description: "If `true` (and if `ingest.geoip.downloader.eager.download` is `false`), the missing database is downloaded when the pipeline is created.\nElse, the download is triggered by when the pipeline is used as the `default_pipeline` or `final_pipeline` in an index." ingest._types.GrokProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field - patterns type: object properties: ecs_compatibility: type: string description: "Must be disabled or v1. If v1, the processor uses patterns with Elastic\nCommon Schema (ECS) field names." default: disabled field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field to use for grok expression parsing. ignore_missing: type: boolean description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.' default: false pattern_definitions: type: object additionalProperties: type: string description: "A map of pattern-name and pattern tuples defining custom patterns to be used by the current processor.\nPatterns matching existing names will override the pre-existing definition." patterns: type: array items: $ref: '#/components/schemas/_types.GrokPattern' description: "An ordered list of grok expression to match and extract named captures with.\nReturns on the first expression in the list that matches." trace_match: type: boolean description: 'When `true`, `_ingest._grok_match_index` will be inserted into your matched document’s metadata with the index into the pattern found in `patterns` that matched.' default: false validate_only: type: boolean description: 'When `true`, the processor does matching but does not extract structured fields' default: false x-state: Generally available; Added in 9.4.0 _types.GrokPattern: type: string ingest._types.GsubProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field - pattern - replacement type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field to apply the replacement to. ignore_missing: type: boolean description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.' default: false pattern: type: string description: The pattern to be replaced. replacement: type: string description: The string to replace the matching patterns with. target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The field to assign the converted value to\nBy default, the `field` is updated in-place." default: field ingest._types.HtmlStripProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The string-valued field to remove HTML tags from. ignore_missing: type: boolean description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document,' default: false target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The field to assign the converted value to\nBy default, the `field` is updated in-place." default: field ingest._types.InferenceProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - model_id type: object properties: model_id: allOf: - $ref: '#/components/schemas/_types.Id' description: 'The ID or alias for the trained model, or the ID of the deployment.' target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: Field added to incoming documents to contain results objects. default: ml.inference. field_map: type: object additionalProperties: type: object description: "Maps the document field names to the known field names of the model.\nThis mapping takes precedence over any default mappings provided in the model configuration." inference_config: allOf: - $ref: '#/components/schemas/ingest._types.InferenceConfig' description: Contains the inference type and its options. input_output: oneOf: - $ref: '#/components/schemas/ingest._types.InputConfig' - type: array items: $ref: '#/components/schemas/ingest._types.InputConfig' description: "Input fields for inference and output (destination) fields for the inference results.\nThis option is incompatible with the target_field and field_map options." ignore_missing: type: boolean description: "If true and any of the input fields defined in input_ouput are missing\nthen those missing fields are quietly ignored, otherwise a missing field causes a failure.\nOnly applies when using input_output configurations to explicitly list the input fields." ingest._types.InferenceConfig: maxProperties: 1 minProperties: 1 type: object properties: regression: allOf: - $ref: '#/components/schemas/ingest._types.InferenceConfigRegression' description: Regression configuration for inference. classification: allOf: - $ref: '#/components/schemas/ingest._types.InferenceConfigClassification' description: Classification configuration for inference. ingest._types.InferenceConfigRegression: type: object properties: results_field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field that is added to incoming documents to contain the inference prediction. default: _prediction num_top_feature_importance_values: type: number description: Specifies the maximum number of feature importance values per document. default: 0 ingest._types.InferenceConfigClassification: type: object properties: num_top_classes: type: number description: Specifies the number of top class predictions to return. default: 0 num_top_feature_importance_values: type: number description: Specifies the maximum number of feature importance values per document. default: 0 results_field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field that is added to incoming documents to contain the inference prediction. default: _prediction top_classes_results_field: allOf: - $ref: '#/components/schemas/_types.Field' description: Specifies the field to which the top classes are written. default: top_classes prediction_field_type: type: string description: "Specifies the type of the predicted field to write.\nValid values are: `string`, `number`, `boolean`." ingest._types.InputConfig: required: - input_field - output_field type: object properties: input_field: type: string output_field: type: string ingest._types.JoinProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field - separator type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: Field containing array values to join. separator: type: string description: The separator character. target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The field to assign the joined value to.\nBy default, the field is updated in-place." default: field ingest._types.JsonProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field type: object properties: add_to_root: type: boolean description: "Flag that forces the parsed JSON to be added at the top level of the document.\n`target_field` must not be set when this option is chosen." default: false add_to_root_conflict_strategy: allOf: - $ref: '#/components/schemas/ingest._types.JsonProcessorConflictStrategy' description: "When set to `replace`, root fields that conflict with fields from the parsed JSON will be overridden.\nWhen set to `merge`, conflicting fields will be merged.\nOnly applicable `if add_to_root` is set to true.\n\nSupported values include:\n - `replace`: Root fields that conflict with fields from the parsed JSON will be overridden.\n - `merge`: Conflicting fields will be merged.\n\n" allow_duplicate_keys: type: boolean description: "When set to `true`, the JSON parser will not fail if the JSON contains duplicate keys.\nInstead, the last encountered value for any duplicate key wins." default: false field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field to be parsed. target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The field that the converted structured object will be written into.\nAny existing content in this field will be overwritten." default: field ingest._types.JsonProcessorConflictStrategy: enum: - replace - merge type: string ingest._types.KeyValueProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field - field_split - value_split type: object properties: exclude_keys: type: array items: type: string description: List of keys to exclude from document. field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The field to be parsed.\nSupports template snippets." field_split: type: string description: Regex pattern to use for splitting key-value pairs. ignore_missing: type: boolean description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.' default: false include_keys: type: array items: type: string description: "List of keys to filter and insert into document.\nDefaults to including all keys." prefix: type: string description: Prefix to be added to extracted keys. default: 'null' strip_brackets: type: boolean description: 'If `true`. strip brackets `()`, `<>`, `[]` as well as quotes `''` and `"` from extracted values.' default: false target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The field to insert the extracted keys into.\nDefaults to the root of the document.\nSupports template snippets." trim_key: type: string description: String of characters to trim from extracted keys. trim_value: type: string description: String of characters to trim from extracted values. value_split: type: string description: Regex pattern to use for splitting the key from the value within a key-value pair. ingest._types.LowercaseProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field to make lowercase. ignore_missing: type: boolean description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.' default: false target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The field to assign the converted value to.\nBy default, the field is updated in-place." default: field ingest._types.NetworkDirectionProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - type: object properties: source_ip: allOf: - $ref: '#/components/schemas/_types.Field' description: Field containing the source IP address. default: source.ip destination_ip: allOf: - $ref: '#/components/schemas/_types.Field' description: Field containing the destination IP address. default: destination.ip target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: Output field for the network direction. default: network.direction internal_networks: type: array items: type: string description: "List of internal networks. Supports IPv4 and IPv6 addresses and ranges in\nCIDR notation. Also supports the named ranges listed below. These may be\nconstructed with template snippets. Must specify only one of\ninternal_networks or internal_networks_field." internal_networks_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "A field on the given document to read the internal_networks configuration\nfrom." ignore_missing: type: boolean description: "If true and any required fields are missing, the processor quietly exits\nwithout modifying the document." default: true ingest._types.NormalizeForStreamProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - type: object ingest._types.PipelineProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - name type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' description: "The name of the pipeline to execute.\nSupports template snippets." ignore_missing_pipeline: type: boolean description: Whether to ignore missing pipelines instead of failing. default: false ingest._types.RecoverFailureDocumentProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - type: object ingest._types.RedactProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field - patterns type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field to be redacted patterns: type: array items: $ref: '#/components/schemas/_types.GrokPattern' description: A list of grok expressions to match and redact named captures with pattern_definitions: type: object additionalProperties: type: string prefix: type: string description: Start a redacted section with this token default: < suffix: type: string description: End a redacted section with this token default: '>' ignore_missing: type: boolean description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.' default: false skip_if_unlicensed: type: boolean description: 'If `true` and the current license does not support running redact processors, then the processor quietly exits without modifying the document' default: false trace_redact: type: boolean description: If `true` then ingest metadata `_ingest._redact._is_redacted` is set to `true` if the document has been redacted default: false x-state: Generally available; Added in 8.16.0 ingest._types.RegisteredDomainProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: Field containing the source FQDN. target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "Object field containing extracted domain components. If an empty string,\nthe processor adds components to the document’s root." ignore_missing: type: boolean description: "If true and any required fields are missing, the processor quietly exits\nwithout modifying the document." default: true ingest._types.RemoveProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Fields' description: Fields to be removed. Supports template snippets. keep: allOf: - $ref: '#/components/schemas/_types.Fields' description: 'Fields to be kept. When set, all fields other than those specified are removed.' ignore_missing: type: boolean description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.' default: false ingest._types.RenameProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field - target_field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The field to be renamed.\nSupports template snippets." ignore_missing: type: boolean description: 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.' default: false override: type: boolean description: "If `true`, the processor overwrites `target_field` if it already exists.\nIf `false`, the processor fails when `target_field` already exists." default: false target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The new name of the field.\nSupports template snippets." ingest._types.RerouteProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - type: object properties: destination: type: string description: A static value for the target. Can’t be set when the dataset or namespace option is set. dataset: oneOf: - type: string - type: array items: type: string description: "Field references or a static value for the dataset part of the data stream name.\nIn addition to the criteria for index names, cannot contain - and must be no longer than 100 characters.\nExample values are nginx.access and nginx.error.\n\nSupports field references with a mustache-like syntax (denoted as {{double}} or {{{triple}}} curly braces).\nWhen resolving field references, the processor replaces invalid characters with _. Uses the part\nof the index name as a fallback if all field references resolve to a null, missing, or non-string value.\n\ndefault {{data_stream.dataset}}" namespace: oneOf: - type: string - type: array items: type: string description: "Field references or a static value for the namespace part of the data stream name. See the criteria for\nindex names for allowed characters. Must be no longer than 100 characters.\n\nSupports field references with a mustache-like syntax (denoted as {{double}} or {{{triple}}} curly braces).\nWhen resolving field references, the processor replaces invalid characters with _. Uses the part\nof the index name as a fallback if all field references resolve to a null, missing, or non-string value.\n\ndefault {{data_stream.namespace}}" ingest._types.ScriptProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: "ID of a stored script.\nIf no `source` is specified, this parameter is required." lang: allOf: - $ref: '#/components/schemas/_types.ScriptLanguage' description: "Script language.\n\nSupported values include:\n - `painless`: Painless scripting language, purpose-built for Elasticsearch.\n - `expression`: Lucene’s expressions language, compiles a JavaScript expression to bytecode.\n - `mustache`: Mustache templated, used for templates.\n - `java`: Expert Java API\n\n" default: painless params: type: object additionalProperties: type: object description: Object containing parameters for the script. source: allOf: - $ref: '#/components/schemas/_types.ScriptSource' description: "Inline script.\nIf no `id` is specified, this parameter is required." ingest._types.SetProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field type: object properties: copy_from: allOf: - $ref: '#/components/schemas/_types.Field' description: "The origin field which will be copied to `field`, cannot set `value` simultaneously.\nSupported data types are `boolean`, `number`, `array`, `object`, `string`, `date`, etc." field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The field to insert, upsert, or update.\nSupports template snippets." ignore_empty_value: type: boolean description: 'If `true` and `value` is a template snippet that evaluates to `null` or the empty string, the processor quietly exits without modifying the document.' default: false media_type: type: string description: "The media type for encoding `value`.\nApplies only when value is a template snippet.\nMust be one of `application/json`, `text/plain`, or `application/x-www-form-urlencoded`." default: '"application/json"' override: type: boolean description: "If `true` processor will update fields with pre-existing non-null-valued field.\nWhen set to `false`, such fields will not be touched." default: true value: type: object description: "The value to be set for the field.\nSupports template snippets.\nMay specify only one of `value` or `copy_from`." ingest._types.SetSecurityUserProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field to store the user information into. properties: type: array items: type: string description: Controls what user related properties are added to the field. ingest._types.SortProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field to be sorted. order: allOf: - $ref: '#/components/schemas/_types.SortOrder' description: "The sort order to use.\nAccepts `\"asc\"` or `\"desc\"`.\n\nSupported values include:\n - `asc`: Ascending (smallest to largest)\n - `desc`: Descending (largest to smallest)\n\n" default: asc target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The field to assign the sorted value to.\nBy default, the field is updated in-place." ingest._types.SplitProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field - separator type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field to split. ignore_missing: type: boolean description: 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.' default: false preserve_trailing: type: boolean description: 'Preserves empty trailing fields, if any.' default: false separator: type: string description: 'A regex which matches the separator, for example, `,` or `\s+`.' target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The field to assign the split value to.\nBy default, the field is updated in-place." default: field ingest._types.TerminateProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - type: object ingest._types.TrimProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The string-valued field to trim whitespace from. ignore_missing: type: boolean description: 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.' default: false target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The field to assign the trimmed value to.\nBy default, the field is updated in-place." default: field ingest._types.UppercaseProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field to make uppercase. ignore_missing: type: boolean description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.' default: false target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The field to assign the converted value to.\nBy default, the field is updated in-place." default: field ingest._types.UrlDecodeProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field to decode. ignore_missing: type: boolean description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.' default: false target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The field to assign the converted value to.\nBy default, the field is updated in-place." default: field ingest._types.UriPartsProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: Field containing the URI string. ignore_missing: type: boolean description: 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.' default: false keep_original: type: boolean description: 'If `true`, the processor copies the unparsed URI to `.original`.' default: true remove_if_successful: type: boolean description: "If `true`, the processor removes the `field` after parsing the URI string.\nIf parsing fails, the processor does not remove the `field`." default: false target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: Output field for the URI object. default: url ingest._types.UserAgentProcessor: allOf: - $ref: '#/components/schemas/ingest._types.ProcessorBase' - required: - field type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field containing the user agent string. ignore_missing: type: boolean description: 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.' default: false regex_file: type: string description: 'The name of the file in the `config/ingest-user-agent` directory containing the regular expressions for parsing the user agent string. Both the directory and the file have to be created before starting Elasticsearch. If not specified, ingest-user-agent will use the `regexes.yaml` from uap-core it ships with.' target_field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field that will be filled with the user agent details. default: user_agent properties: type: array items: $ref: '#/components/schemas/ingest._types.UserAgentProperty' description: Controls what properties are added to `target_field`. default: - name - os - device - original - version extract_device_type: type: boolean description: Extracts device type from the user agent string on a best-effort basis. default: false x-state: Beta; Added in 8.9.0 ingest._types.UserAgentProperty: enum: - name - os - device - original - version type: string ingest._types.FieldAccessPattern: enum: - classic - flexible type: string ingest._types.Document: required: - _source type: object properties: _id: allOf: - $ref: '#/components/schemas/_types.Id' description: "Unique identifier for the document.\nThis ID must be unique within the `_index`." _index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: Name of the index containing the document. _source: type: object description: JSON body for the document. ingest._types.SimulateDocumentResult: type: object properties: doc: allOf: - $ref: '#/components/schemas/ingest._types.DocumentSimulation' error: allOf: - $ref: '#/components/schemas/_types.ErrorCause' processor_results: type: array items: $ref: '#/components/schemas/ingest._types.PipelineProcessorResult' ingest._types.DocumentSimulation: required: - _id - _index - _ingest - _source type: object properties: _id: allOf: - $ref: '#/components/schemas/_types.Id' description: Unique identifier for the document. This ID must be unique within the `_index`. _index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: Name of the index containing the document. _ingest: allOf: - $ref: '#/components/schemas/ingest._types.Ingest' _routing: type: string description: Value used to send the document to a specific primary shard. _source: type: object additionalProperties: type: object description: JSON body for the document. _version: allOf: - $ref: '#/components/schemas/_spec_utils.StringifiedVersionNumber' description: '' _version_type: allOf: - $ref: '#/components/schemas/_types.VersionType' description: "\n\nSupported values include:\n - `internal`: Use internal versioning that starts at 1 and increments with each update or delete.\n - `external`: Only index the document if the specified version is strictly higher than the version of the stored document or if there is no existing document.\n - `external_gte`: Only index the document if the specified version is equal or higher than the version of the stored document or if there is no existing document.\nNOTE: The `external_gte` version type is meant for special use cases and should be used with care.\nIf used incorrectly, it can result in loss of data.\n\n" description: 'The simulated document, with optional metadata.' ingest._types.Ingest: required: - timestamp type: object properties: _redact: allOf: - $ref: '#/components/schemas/ingest._types.Redact' x-state: Generally available; Added in 8.16.0 timestamp: allOf: - $ref: '#/components/schemas/_types.DateTime' pipeline: allOf: - $ref: '#/components/schemas/_types.Name' ingest._types.Redact: required: - _is_redacted type: object properties: _is_redacted: type: boolean description: indicates if document has been redacted _spec_utils.StringifiedVersionNumber: oneOf: - $ref: '#/components/schemas/_types.VersionNumber' - type: string description: "Some APIs will return values such as numbers also as a string (notably epoch timestamps). This behavior\nis used to capture this behavior while keeping the semantics of the field type.\n\nDepending on the target language, code generators can keep the union or remove it and leniently parse\nstrings to the target type." ingest._types.PipelineProcessorResult: type: object properties: doc: allOf: - $ref: '#/components/schemas/ingest._types.DocumentSimulation' tag: type: string processor_type: type: string status: allOf: - $ref: '#/components/schemas/ingest._types.PipelineSimulationStatusOptions' description: type: string ignored_error: allOf: - $ref: '#/components/schemas/_types.ErrorCause' error: allOf: - $ref: '#/components/schemas/_types.ErrorCause' ingest._types.PipelineSimulationStatusOptions: enum: - success - error - error_ignored - skipped - dropped type: string _global.knn_eval.KnnEvalQuerySource: oneOf: - $ref: '#/components/schemas/_global.knn_eval.KnnEvalDocsQuerySource' - $ref: '#/components/schemas/_global.knn_eval.KnnEvalVectorsQuerySource' description: The source of the query vectors of a kNN evaluation. discriminator: propertyName: from mapping: docs: '#/components/schemas/_global.knn_eval.KnnEvalDocsQuerySource' vectors: '#/components/schemas/_global.knn_eval.KnnEvalVectorsQuerySource' _global.knn_eval.KnnEvalDocsQuerySource: required: - from - size type: object properties: from: enum: - docs type: string size: type: number description: 'The number of documents to sample, from 1 to 1000.' seed: type: number description: 'The seed of the sampling, to sample the same documents across requests.' description: Samples the query vectors from the stored documents. _global.knn_eval.KnnEvalVectorsQuerySource: required: - from - vectors type: object properties: from: enum: - vectors type: string vectors: type: array items: $ref: '#/components/schemas/_global.knn_eval.KnnEvalQueryVector' description: 'The query vectors, from 1 to 1000 entries with unique identifiers.' description: Uses the query vectors in the request. _global.knn_eval.KnnEvalQueryVector: required: - id - query_vector type: object properties: id: type: string description: 'The identifier of the query, which identifies it in the `failures` of the response.' query_vector: allOf: - $ref: '#/components/schemas/_types.QueryVector' description: The query vector. _global.knn_eval.KnnEvalSettings: type: object properties: visit_percentage: type: number description: "The percentage of postings to visit, from 0 to 100.\n`0` selects the automatic visit calculation." num_candidates: type: number description: "The number of nearest neighbor candidates to consider per shard.\nIt can't be less than `k`, or more than 10000 (9999 with sampling)." rescore_vector: allOf: - $ref: '#/components/schemas/_types.RescoreVector' description: The rescoring of the candidates. Only applies to quantized fields. exact: type: boolean description: "If `true`, compares every vector at full precision.\nOnly applies to the `baseline`, requires `allow_exact_baseline`, and can't be combined with other settings." default: false _global.knn_eval.KnnEvalQuerySourceSummary: required: - from type: object properties: from: allOf: - $ref: '#/components/schemas/_global.knn_eval.KnnEvalQuerySourceType' description: How the query vectors were chosen. _global.knn_eval.KnnEvalQuerySourceType: enum: - docs - vectors type: string _global.knn_eval.KnnEvalReportedSettings: allOf: - $ref: '#/components/schemas/_global.knn_eval.KnnEvalSettings' - type: object properties: rescore_window_capped: type: boolean description: 'If `true`, the number of vectors to rescore exceeded the limit of 10000.' default: false quantized_scores: type: boolean description: 'If `true`, the hits were not rescored, so their scores are estimates, and no query is excluded from the mean recall.' default: false _global.knn_eval.KnnEvalVectorOpsKind: enum: - full_precision_scan - quantized_visit_plus_rescore type: string _global.knn_eval.KnnEvalResult: required: - knn_settings - recall - included_queries - excluded_queries - took_ms - vector_ops type: object properties: knn_settings: allOf: - $ref: '#/components/schemas/_global.knn_eval.KnnEvalReportedSettings' description: The evaluated settings. recall: oneOf: - type: number - type: - 'null' - string description: 'The mean recall of the included queries, or `null` if no query is included.' included_queries: type: number description: The number of queries included in the mean recall. excluded_queries: type: number description: 'The number of queries excluded from the mean recall, because the search found a document scoring above the baseline''s lowest top `k` score.' took_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: 'The time the searches took, in milliseconds.' vector_ops: type: number description: The number of vector operations of the searches. _global.knn_eval.KnnEvalFailure: required: - error type: object properties: error: allOf: - $ref: '#/components/schemas/_types.ErrorCause' license.get.LicenseInformation: required: - issue_date - issue_date_in_millis - issued_to - issuer - max_nodes - status - type - uid - start_date_in_millis type: object properties: expiry_date: allOf: - $ref: '#/components/schemas/_types.DateTime' description: The date and time the license expires in ISO 8601 format. expiry_date_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: The date and time the license expires in milliseconds since the Unix epoch. issue_date: allOf: - $ref: '#/components/schemas/_types.DateTime' description: The date and time the license was issued in ISO 8601 format. issue_date_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: The date and time the license was issued in milliseconds since the Unix epoch. issued_to: type: string description: The name of the customer or organization that received the license. issuer: type: string description: The name of the organization that issued the license. max_nodes: oneOf: - type: number - type: - 'null' - string description: The maximum number of nodes the license allows. max_resource_units: oneOf: - type: number - type: - 'null' - string description: The maximum number of resource units the license allows (for enterprise licenses only). status: allOf: - $ref: '#/components/schemas/license._types.LicenseStatus' description: 'The status of the license. For example,active, valid, invalid, or expired.' type: allOf: - $ref: '#/components/schemas/license._types.LicenseType' description: 'The type of the license. For example, trial, basic, gold, platinum, or enterprise.' uid: allOf: - $ref: '#/components/schemas/_types.Uuid' description: The unique identifier of the license. start_date_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: The date and time the license was started in milliseconds since the Unix epoch. license._types.LicenseStatus: enum: - active - valid - invalid - expired type: string license._types.LicenseType: enum: - missing - trial - basic - standard - dev - silver - gold - platinum - enterprise type: string license._types.License: required: - expiry_date_in_millis - issue_date_in_millis - issued_to - issuer - signature - type - uid type: object properties: expiry_date_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' issue_date_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' start_date_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' issued_to: type: string issuer: type: string max_nodes: oneOf: - type: number - type: - 'null' - string max_resource_units: type: number signature: type: string type: allOf: - $ref: '#/components/schemas/license._types.LicenseType' uid: type: string license.post.Acknowledgement: required: - license - message type: object properties: license: type: array items: type: string message: type: string _types.ReindexTaskInfo: required: - id - start_time_in_millis - running_time_in_nanos - cancelled type: object properties: id: allOf: - $ref: '#/components/schemas/_types.TaskId' description: The ID of the reindex task. The ID is assigned when the task was first created and remains the same across graceful shutdown relocations. description: type: string description: 'A sanitized description of the reindex operation (source and destination indices, and optionally remote host info).' start_time_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: 'The time at which the reindex task started, in milliseconds since the Unix epoch. Remains the same across graceful shutdown relocations.' start_time: type: string description: "The time at which the reindex task started, as an ISO-8601 formatted string. Remains the same across graceful shutdown relocations.\nOnly present when the request includes the `?human=true` query parameter." running_time: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The elapsed running time of the reindex task, including relocations, in a human-readable format.\nOnly present when the request includes the `?human=true` query parameter." running_time_in_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' description: 'The elapsed running time of the reindex task, including relocations, in nanoseconds.' cancelled: type: boolean description: Whether the reindex task has been cancelled. status: allOf: - $ref: '#/components/schemas/_types.ReindexStatus' description: The current progress of the reindex operation. description: 'Information about a single parent reindex task, as returned by the reindex management APIs.' logstash._types.Pipeline: required: - description - last_modified - pipeline - pipeline_metadata - pipeline_settings - username type: object properties: description: type: string description: "A description of the pipeline.\nThis description is not used by Elasticsearch or Logstash." last_modified: allOf: - $ref: '#/components/schemas/_types.DateTime' description: "The date the pipeline was last updated.\nIt must be in the `yyyy-MM-dd'T'HH:mm:ss.SSSZZ` strict_date_time format." pipeline: type: string description: The configuration for the pipeline. externalDocs: url: https://www.elastic.co/docs/reference/logstash/configuration-file-structure pipeline_metadata: allOf: - $ref: '#/components/schemas/logstash._types.PipelineMetadata' description: "Optional metadata about the pipeline, which can have any contents.\nThis metadata is not generated or used by Elasticsearch or Logstash." pipeline_settings: allOf: - $ref: '#/components/schemas/logstash._types.PipelineSettings' description: "Settings for the pipeline.\nIt supports only flat keys in dot notation." externalDocs: url: https://www.elastic.co/docs/reference/logstash/logstash-settings-file username: type: string description: The user who last updated the pipeline. logstash._types.PipelineMetadata: required: - type - version type: object properties: type: type: string version: type: string logstash._types.PipelineSettings: required: - pipeline.workers - pipeline.batch.size - pipeline.batch.delay - queue.type - queue.max_bytes - queue.checkpoint.writes type: object properties: pipeline.workers: type: number description: 'The number of workers that will, in parallel, execute the filter and output stages of the pipeline.' pipeline.batch.size: type: number description: The maximum number of events an individual worker thread will collect from inputs before attempting to execute its filters and outputs. pipeline.batch.delay: type: number description: 'When creating pipeline event batches, how long in milliseconds to wait for each event before dispatching an undersized batch to pipeline workers.' queue.type: type: string description: The internal queuing model to use for event buffering. queue.max_bytes: type: string description: 'The total capacity of the queue (`queue.type: persisted`) in number of bytes.' queue.checkpoint.writes: type: number description: 'The maximum number of written events before forcing a checkpoint when persistent queues are enabled (`queue.type: persisted`).' _global.mget.Operation: required: - _id type: object properties: _id: allOf: - $ref: '#/components/schemas/_types.Id' description: The unique document ID. _index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: The index that contains the document. routing: allOf: - $ref: '#/components/schemas/_types.Routing' description: "The key for the primary shard the document resides on. Required if routing is used during indexing.\nNot allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead." _source: allOf: - $ref: '#/components/schemas/_global.search._types.SourceConfig' description: 'If `false`, excludes all _source fields.' stored_fields: allOf: - $ref: '#/components/schemas/_types.Fields' description: The stored fields you want to retrieve. version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' version_type: allOf: - $ref: '#/components/schemas/_types.VersionType' description: "\n\nSupported values include:\n - `internal`: Use internal versioning that starts at 1 and increments with each update or delete.\n - `external`: Only index the document if the specified version is strictly higher than the version of the stored document or if there is no existing document.\n - `external_gte`: Only index the document if the specified version is equal or higher than the version of the stored document or if there is no existing document.\nNOTE: The `external_gte` version type is meant for special use cases and should be used with care.\nIf used incorrectly, it can result in loss of data.\n\n" _global.mget.ResponseItem: oneOf: - $ref: '#/components/schemas/_global.get.GetResult' - $ref: '#/components/schemas/_global.mget.MultiGetError' _global.mget.MultiGetError: required: - error - _id - _index type: object properties: error: allOf: - $ref: '#/components/schemas/_types.ErrorCause' _id: allOf: - $ref: '#/components/schemas/_types.Id' _index: allOf: - $ref: '#/components/schemas/_types.IndexName' migration.deprecations.Deprecation: required: - level - message - url - resolve_during_rolling_upgrade type: object properties: details: type: string description: Optional details about the deprecation warning. level: allOf: - $ref: '#/components/schemas/migration.deprecations.DeprecationLevel' description: "The level property describes the significance of the issue.\n\nSupported values include:\n - `none`\n - `info`\n - `warning`: You can upgrade directly, but you are using deprecated functionality which will not be available or behave differently in the next major version.\n - `critical`: You cannot upgrade without fixing this problem.\n\n" message: type: string description: Descriptive information about the deprecation warning. url: type: string description: 'A link to the breaking change documentation, where you can find more information about this change.' resolve_during_rolling_upgrade: type: boolean _meta: type: object additionalProperties: type: object migration.deprecations.DeprecationLevel: enum: - none - info - warning - critical type: string migration.get_feature_upgrade_status.MigrationFeature: required: - feature_name - minimum_index_version - migration_status - indices type: object properties: feature_name: type: string minimum_index_version: allOf: - $ref: '#/components/schemas/_types.VersionString' migration_status: allOf: - $ref: '#/components/schemas/migration.get_feature_upgrade_status.MigrationStatus' indices: type: array items: $ref: '#/components/schemas/migration.get_feature_upgrade_status.MigrationFeatureIndexInfo' migration.get_feature_upgrade_status.MigrationStatus: enum: - NO_MIGRATION_NEEDED - MIGRATION_NEEDED - IN_PROGRESS - ERROR type: string migration.get_feature_upgrade_status.MigrationFeatureIndexInfo: required: - index - version type: object properties: index: allOf: - $ref: '#/components/schemas/_types.IndexName' version: allOf: - $ref: '#/components/schemas/_types.VersionString' failure_cause: allOf: - $ref: '#/components/schemas/_types.ErrorCause' migration.post_feature_upgrade.MigrationFeature: required: - feature_name type: object properties: feature_name: type: string ml._types.AnalysisConfig: required: - detectors type: object properties: bucket_span: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The size of the interval that the analysis is aggregated into, typically between `5m` and `1h`. This value should be either a whole number of days or equate to a\nwhole number of buckets in one day. If the anomaly detection job uses a datafeed with aggregations, this value must also be divisible by the interval of the date histogram aggregation." default: 5m categorization_analyzer: allOf: - $ref: '#/components/schemas/ml._types.CategorizationAnalyzer' description: 'If `categorization_field_name` is specified, you can also define the analyzer that is used to interpret the categorization field. This property cannot be used at the same time as `categorization_filters`. The categorization analyzer specifies how the `categorization_field` is interpreted by the categorization process. The `categorization_analyzer` field can be specified either as a string or as an object. If it is a string, it must refer to a built-in analyzer or one added by another plugin.' categorization_field_name: allOf: - $ref: '#/components/schemas/_types.Field' description: 'If this property is specified, the values of the specified field will be categorized. The resulting categories must be used in a detector by setting `by_field_name`, `over_field_name`, or `partition_field_name` to the keyword `mlcategory`.' categorization_filters: type: array items: type: string description: 'If `categorization_field_name` is specified, you can also define optional filters. This property expects an array of regular expressions. The expressions are used to filter out matching sequences from the categorization field values. You can use this functionality to fine tune the categorization by excluding sequences from consideration when categories are defined. For example, you can exclude SQL statements that appear in your log files. This property cannot be used at the same time as `categorization_analyzer`. If you only want to define simple regular expression filters that are applied prior to tokenization, setting this property is the easiest method. If you also want to customize the tokenizer or post-tokenization filtering, use the `categorization_analyzer` property instead and include the filters as pattern_replace character filters. The effect is exactly the same.' detectors: type: array items: $ref: '#/components/schemas/ml._types.Detector' description: 'Detector configuration objects specify which data fields a job analyzes. They also specify which analytical functions are used. You can specify multiple detectors for a job. If the detectors array does not contain at least one detector, no analysis can occur and an error is returned.' influencers: type: array items: $ref: '#/components/schemas/_types.Field' description: 'A comma separated list of influencer field names. Typically these can be the by, over, or partition fields that are used in the detector configuration. You might also want to use a field name that is not specifically named in a detector, but is available as part of the input data. When you use multiple detectors, the use of influencers is recommended as it aggregates results for each influencer entity.' latency: allOf: - $ref: '#/components/schemas/_types.Duration' description: 'The size of the window in which to expect data that is out of time order. If you specify a non-zero value, it must be greater than or equal to one second. NOTE: Latency is applicable only when you send data by using the post data API.' default: '0' model_prune_window: allOf: - $ref: '#/components/schemas/_types.Duration' description: 'Advanced configuration option. Affects the pruning of models that have not been updated for the given time duration. The value must be set to a multiple of the `bucket_span`. If set too low, important information may be removed from the model. For jobs created in 8.1 and later, the default value is the greater of `30d` or 20 times `bucket_span`.' multivariate_by_fields: type: boolean description: 'This functionality is reserved for internal use. It is not supported for use in customer environments and is not subject to the support SLA of official GA features. If set to `true`, the analysis will automatically find correlations between metrics for a given by field value and report anomalies when those correlations cease to hold. For example, suppose CPU and memory usage on host A is usually highly correlated with the same metrics on host B. Perhaps this correlation occurs because they are running a load-balanced application. If you enable this property, anomalies will be reported when, for example, CPU usage on host A is high and the value of CPU usage on host B is low. That is to say, you’ll see an anomaly when the CPU of host A is unusual given the CPU of host B. To use the `multivariate_by_fields` property, you must also specify `by_field_name` in your detector.' per_partition_categorization: allOf: - $ref: '#/components/schemas/ml._types.PerPartitionCategorization' description: Settings related to how categorization interacts with partition fields. summary_count_field_name: allOf: - $ref: '#/components/schemas/_types.Field' description: 'If this property is specified, the data that is fed to the job is expected to be pre-summarized. This property value is the name of the field that contains the count of raw data points that have been summarized. The same `summary_count_field_name` applies to all detectors in the job. NOTE: The `summary_count_field_name` property cannot be used with the `metric` function.' ml._types.CategorizationAnalyzer: oneOf: - type: string - $ref: '#/components/schemas/ml._types.CategorizationAnalyzerDefinition' ml._types.CategorizationAnalyzerDefinition: type: object properties: char_filter: type: array items: $ref: '#/components/schemas/_types.analysis.CharFilter' description: 'One or more character filters. In addition to the built-in character filters, other plugins can provide more character filters. If this property is not specified, no character filters are applied prior to categorization. If you are customizing some other aspect of the analyzer and you need to achieve the equivalent of `categorization_filters` (which are not permitted when some other aspect of the analyzer is customized), add them here as pattern replace character filters.' filter: type: array items: $ref: '#/components/schemas/_types.analysis.TokenFilter' description: 'One or more token filters. In addition to the built-in token filters, other plugins can provide more token filters. If this property is not specified, no token filters are applied prior to categorization.' tokenizer: type: - string - object description: "The name or definition of the tokenizer to use after character filters are applied. This property is compulsory if `categorization_analyzer` is specified as an object. Machine learning provides a tokenizer called `ml_standard` that tokenizes in a way that has been determined to produce good categorization results on a variety of log file formats for logs in English. If you want to use that tokenizer but change the character or token filters, specify `\"tokenizer\": \"ml_standard\"` in your `categorization_analyzer`. Additionally, the `ml_classic` tokenizer is available, which tokenizes in the same way as the non-customizable tokenizer in old versions of the product (before 6.2). `ml_classic` was the default categorization tokenizer in versions 6.2 to 7.13, so if you need categorization identical to the default for jobs created in these versions, specify `\"tokenizer\": \"ml_classic\"` in your `categorization_analyzer`.\n" externalDocs: description: Tokenizer reference url: https://www.elastic.co/docs/reference/text-analysis/tokenizer-reference x-model: true ml._types.Detector: type: object properties: by_field_name: allOf: - $ref: '#/components/schemas/_types.Field' description: 'The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split.' custom_rules: type: array items: $ref: '#/components/schemas/ml._types.DetectionRule' description: 'Custom rules enable you to customize the way detectors operate. For example, a rule may dictate conditions under which results should be skipped. Kibana refers to custom rules as job rules.' detector_description: type: string description: A description of the detector. detector_index: type: number description: 'A unique identifier for the detector. This identifier is based on the order of the detectors in the `analysis_config`, starting at zero. If you specify a value for this property, it is ignored.' exclude_frequent: allOf: - $ref: '#/components/schemas/ml._types.ExcludeFrequent' description: 'If set, frequent entities are excluded from influencing the anomaly results. Entities can be considered frequent over time or frequent in a population. If you are working with both over and by fields, you can set `exclude_frequent` to `all` for both fields, or to `by` or `over` for those specific fields.' field_name: allOf: - $ref: '#/components/schemas/_types.Field' description: 'The field that the detector uses in the function. If you use an event rate function such as count or rare, do not specify this field. The `field_name` cannot contain double quotes or backslashes.' function: type: string description: 'The analysis function that is used. For example, `count`, `rare`, `mean`, `min`, `max`, or `sum`.' over_field_name: allOf: - $ref: '#/components/schemas/_types.Field' description: 'The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits.' partition_field_name: allOf: - $ref: '#/components/schemas/_types.Field' description: 'The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field.' use_null: type: boolean description: Defines whether a new series is used as the null series when there is no value for the by or partition fields. default: false ml._types.DetectionRule: type: object properties: actions: type: array items: $ref: '#/components/schemas/ml._types.RuleAction' description: "The set of actions to be triggered when the rule applies. If more than one action is specified the effects of all actions are combined.\n\nSupported values include:\n - `skip_result`: The result will not be created. Unless you also specify `skip_model_update`, the model will be updated as usual with the corresponding series value.\n - `skip_model_update`: The value for that series will not be used to update the model. Unless you also specify `skip_result`, the results will be created as usual. This action is suitable when certain values are expected to be consistently anomalous and they affect the model in a way that negatively impacts the rest of the results.\n\n" default: - skip_result conditions: type: array items: $ref: '#/components/schemas/ml._types.RuleCondition' description: An array of numeric conditions when the rule applies. A rule must either have a non-empty scope or at least one condition. Multiple conditions are combined together with a logical AND. scope: type: object additionalProperties: $ref: '#/components/schemas/ml._types.FilterRef' description: 'A scope of series where the rule applies. A rule must either have a non-empty scope or at least one condition. By default, the scope includes all series. Scoping is allowed for any of the fields that are also specified in `by_field_name`, `over_field_name`, or `partition_field_name`.' ml._types.RuleAction: enum: - skip_result - skip_model_update type: string ml._types.RuleCondition: required: - applies_to - operator - value type: object properties: applies_to: allOf: - $ref: '#/components/schemas/ml._types.AppliesTo' description: 'Specifies the result property to which the condition applies. If your detector uses `lat_long`, `metric`, `rare`, or `freq_rare` functions, you can only specify conditions that apply to time.' operator: allOf: - $ref: '#/components/schemas/ml._types.ConditionOperator' description: 'Specifies the condition operator. The available options are greater than, greater than or equals, less than, and less than or equals.' value: type: number description: The value that is compared against the `applies_to` field using the operator. ml._types.AppliesTo: enum: - actual - typical - diff_from_typical - time type: string ml._types.ConditionOperator: enum: - gt - gte - lt - lte type: string ml._types.FilterRef: required: - filter_id type: object properties: filter_id: allOf: - $ref: '#/components/schemas/_types.Id' description: The identifier for the filter. filter_type: allOf: - $ref: '#/components/schemas/ml._types.FilterType' description: 'If set to `include`, the rule applies for values in the filter. If set to `exclude`, the rule applies for values not in the filter.' default: include ml._types.FilterType: enum: - include - exclude type: string ml._types.ExcludeFrequent: enum: - all - none - by - over type: string ml._types.PerPartitionCategorization: type: object properties: enabled: type: boolean description: 'To enable this setting, you must also set the `partition_field_name` property to the same value in every detector that uses the keyword `mlcategory`. Otherwise, job creation fails.' stop_on_warn: type: boolean description: 'This setting can be set to true only if per-partition categorization is enabled. If true, both categorization and subsequent anomaly detection stops for partitions where the categorization status changes to warn. This setting makes it viable to have a job where it is expected that categorization works well for some partitions but not others; you do not pay the cost of bad categorization forever in the partitions where it works badly.' ml._types.DataframeEvaluationContainer: maxProperties: 1 minProperties: 1 type: object properties: classification: allOf: - $ref: '#/components/schemas/ml._types.DataframeEvaluationClassification' description: Classification evaluation evaluates the results of a classification analysis which outputs a prediction that identifies to which of the classes each document belongs. outlier_detection: allOf: - $ref: '#/components/schemas/ml._types.DataframeEvaluationOutlierDetection' description: Outlier detection evaluates the results of an outlier detection analysis which outputs the probability that each document is an outlier. regression: allOf: - $ref: '#/components/schemas/ml._types.DataframeEvaluationRegression' description: Regression evaluation evaluates the results of a regression analysis which outputs a prediction of values. ml._types.DataframeEvaluationClassification: required: - actual_field type: object properties: actual_field: allOf: - $ref: '#/components/schemas/_types.Field' description: 'The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true).' predicted_field: allOf: - $ref: '#/components/schemas/_types.Field' description: 'The field in the index which contains the predicted value, in other words the results of the classification analysis.' top_classes_field: allOf: - $ref: '#/components/schemas/_types.Field' description: 'The field of the index which is an array of documents of the form { "class_name": XXX, "class_probability": YYY }. This field must be defined as nested in the mappings.' metrics: allOf: - $ref: '#/components/schemas/ml._types.DataframeEvaluationClassificationMetrics' description: Specifies the metrics that are used for the evaluation. ml._types.DataframeEvaluationClassificationMetrics: allOf: - $ref: '#/components/schemas/ml._types.DataframeEvaluationMetrics' - type: object properties: accuracy: type: object additionalProperties: type: object description: Accuracy of predictions (per-class and overall). multiclass_confusion_matrix: type: object additionalProperties: type: object description: Multiclass confusion matrix. ml._types.DataframeEvaluationMetrics: type: object properties: auc_roc: allOf: - $ref: '#/components/schemas/ml._types.DataframeEvaluationClassificationMetricsAucRoc' description: The AUC ROC (area under the curve of the receiver operating characteristic) score and optionally the curve. It is calculated for a specific class (provided as "class_name") treated as positive. precision: type: object additionalProperties: type: object description: Precision of predictions (per-class and average). recall: type: object additionalProperties: type: object description: Recall of predictions (per-class and average). ml._types.DataframeEvaluationClassificationMetricsAucRoc: type: object properties: class_name: allOf: - $ref: '#/components/schemas/_types.Name' description: Name of the only class that is treated as positive during AUC ROC calculation. Other classes are treated as negative ("one-vs-all" strategy). All the evaluated documents must have class_name in the list of their top classes. include_curve: type: boolean description: Whether or not the curve should be returned in addition to the score. Default value is false. ml._types.DataframeEvaluationOutlierDetection: required: - actual_field - predicted_probability_field type: object properties: actual_field: allOf: - $ref: '#/components/schemas/_types.Field' description: 'The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true).' predicted_probability_field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field of the index that defines the probability of whether the item belongs to the class in question or not. It’s the field that contains the results of the analysis. metrics: allOf: - $ref: '#/components/schemas/ml._types.DataframeEvaluationOutlierDetectionMetrics' description: Specifies the metrics that are used for the evaluation. ml._types.DataframeEvaluationOutlierDetectionMetrics: allOf: - $ref: '#/components/schemas/ml._types.DataframeEvaluationMetrics' - type: object properties: confusion_matrix: type: object additionalProperties: type: object description: Accuracy of predictions (per-class and overall). ml._types.DataframeEvaluationRegression: required: - actual_field - predicted_field type: object properties: actual_field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field of the index which contains the ground truth. The data type of this field must be numerical. predicted_field: allOf: - $ref: '#/components/schemas/_types.Field' description: 'The field in the index that contains the predicted value, in other words the results of the regression analysis.' metrics: allOf: - $ref: '#/components/schemas/ml._types.DataframeEvaluationRegressionMetrics' description: 'Specifies the metrics that are used for the evaluation. For more information on mse, msle, and huber, consult the Jupyter notebook on regression loss functions.' ml._types.DataframeEvaluationRegressionMetrics: type: object properties: mse: type: object additionalProperties: type: object description: 'Average squared difference between the predicted values and the actual (ground truth) value. For more information, read this wiki article.' msle: allOf: - $ref: '#/components/schemas/ml._types.DataframeEvaluationRegressionMetricsMsle' description: Average squared difference between the logarithm of the predicted values and the logarithm of the actual (ground truth) value. huber: allOf: - $ref: '#/components/schemas/ml._types.DataframeEvaluationRegressionMetricsHuber' description: Pseudo Huber loss function. r_squared: type: object additionalProperties: type: object description: Proportion of the variance in the dependent variable that is predictable from the independent variables. ml._types.DataframeEvaluationRegressionMetricsMsle: type: object properties: offset: type: number description: Defines the transition point at which you switch from minimizing quadratic error to minimizing quadratic log error. Defaults to 1. ml._types.DataframeEvaluationRegressionMetricsHuber: type: object properties: delta: type: number description: Approximates 1/2 (prediction - actual)2 for values much less than delta and approximates a straight line with slope delta for values much larger than delta. Defaults to 1. Delta needs to be greater than 0. ml.evaluate_data_frame.DataframeClassificationSummary: type: object properties: auc_roc: allOf: - $ref: '#/components/schemas/ml.evaluate_data_frame.DataframeEvaluationSummaryAucRoc' description: "The AUC ROC (area under the curve of the receiver operating characteristic) score and optionally the curve.\nIt is calculated for a specific class (provided as \"class_name\") treated as positive." accuracy: allOf: - $ref: '#/components/schemas/ml.evaluate_data_frame.DataframeClassificationSummaryAccuracy' description: Accuracy of predictions (per-class and overall). multiclass_confusion_matrix: allOf: - $ref: '#/components/schemas/ml.evaluate_data_frame.DataframeClassificationSummaryMulticlassConfusionMatrix' description: Multiclass confusion matrix. precision: allOf: - $ref: '#/components/schemas/ml.evaluate_data_frame.DataframeClassificationSummaryPrecision' description: Precision of predictions (per-class and average). recall: allOf: - $ref: '#/components/schemas/ml.evaluate_data_frame.DataframeClassificationSummaryRecall' description: Recall of predictions (per-class and average). ml.evaluate_data_frame.DataframeEvaluationSummaryAucRoc: allOf: - $ref: '#/components/schemas/ml.evaluate_data_frame.DataframeEvaluationValue' - type: object properties: curve: type: array items: $ref: '#/components/schemas/ml.evaluate_data_frame.DataframeEvaluationSummaryAucRocCurveItem' ml.evaluate_data_frame.DataframeEvaluationSummaryAucRocCurveItem: required: - tpr - fpr - threshold type: object properties: tpr: type: number fpr: type: number threshold: type: number ml.evaluate_data_frame.DataframeEvaluationValue: required: - value type: object properties: value: type: number ml.evaluate_data_frame.DataframeClassificationSummaryAccuracy: required: - classes - overall_accuracy type: object properties: classes: type: array items: $ref: '#/components/schemas/ml.evaluate_data_frame.DataframeEvaluationClass' overall_accuracy: type: number ml.evaluate_data_frame.DataframeEvaluationClass: allOf: - $ref: '#/components/schemas/ml.evaluate_data_frame.DataframeEvaluationValue' - required: - class_name type: object properties: class_name: allOf: - $ref: '#/components/schemas/_types.Name' ml.evaluate_data_frame.DataframeClassificationSummaryMulticlassConfusionMatrix: required: - confusion_matrix - other_actual_class_count type: object properties: confusion_matrix: type: array items: $ref: '#/components/schemas/ml.evaluate_data_frame.ConfusionMatrixItem' other_actual_class_count: type: number ml.evaluate_data_frame.ConfusionMatrixItem: required: - actual_class - actual_class_doc_count - predicted_classes - other_predicted_class_doc_count type: object properties: actual_class: allOf: - $ref: '#/components/schemas/_types.Name' actual_class_doc_count: type: number predicted_classes: type: array items: $ref: '#/components/schemas/ml.evaluate_data_frame.ConfusionMatrixPrediction' other_predicted_class_doc_count: type: number ml.evaluate_data_frame.ConfusionMatrixPrediction: required: - predicted_class - count type: object properties: predicted_class: allOf: - $ref: '#/components/schemas/_types.Name' count: type: number ml.evaluate_data_frame.DataframeClassificationSummaryPrecision: required: - classes - avg_precision type: object properties: classes: type: array items: $ref: '#/components/schemas/ml.evaluate_data_frame.DataframeEvaluationClass' avg_precision: type: number ml.evaluate_data_frame.DataframeClassificationSummaryRecall: required: - classes - avg_recall type: object properties: classes: type: array items: $ref: '#/components/schemas/ml.evaluate_data_frame.DataframeEvaluationClass' avg_recall: type: number ml.evaluate_data_frame.DataframeOutlierDetectionSummary: type: object properties: auc_roc: allOf: - $ref: '#/components/schemas/ml.evaluate_data_frame.DataframeEvaluationSummaryAucRoc' description: The AUC ROC (area under the curve of the receiver operating characteristic) score and optionally the curve. default: '{"include_curve": false}' precision: type: object additionalProperties: type: number description: Set the different thresholds of the outlier score at where the metric is calculated. recall: type: object additionalProperties: type: number description: Set the different thresholds of the outlier score at where the metric is calculated. confusion_matrix: type: object additionalProperties: $ref: '#/components/schemas/ml.evaluate_data_frame.ConfusionMatrixThreshold' description: 'Set the different thresholds of the outlier score at where the metrics (`tp` - true positive, `fp` - false positive, `tn` - true negative, `fn` - false negative) are calculated.' ml.evaluate_data_frame.ConfusionMatrixThreshold: required: - tp - fp - tn - fn type: object properties: tp: type: number description: True Positive fp: type: number description: False Positive tn: type: number description: True Negative fn: type: number description: False Negative ml.evaluate_data_frame.DataframeRegressionSummary: type: object properties: huber: allOf: - $ref: '#/components/schemas/ml.evaluate_data_frame.DataframeEvaluationValue' description: Pseudo Huber loss function. mse: allOf: - $ref: '#/components/schemas/ml.evaluate_data_frame.DataframeEvaluationValue' description: Average squared difference between the predicted values and the actual (`ground truth`) value. msle: allOf: - $ref: '#/components/schemas/ml.evaluate_data_frame.DataframeEvaluationValue' description: Average squared difference between the logarithm of the predicted values and the logarithm of the actual (`ground truth`) value. r_squared: allOf: - $ref: '#/components/schemas/ml.evaluate_data_frame.DataframeEvaluationValue' description: Proportion of the variance in the dependent variable that is predictable from the independent variables. ml._types.DataframeAnalyticsSource: required: - index type: object properties: index: allOf: - $ref: '#/components/schemas/_types.Indices' description: 'Index or indices on which to perform the analysis. It can be a single index or index pattern as well as an array of indices or patterns. NOTE: If your source indices contain documents with the same IDs, only the document that is indexed last appears in the destination index.' runtime_mappings: allOf: - $ref: '#/components/schemas/_types.mapping.RuntimeFields' description: Definitions of runtime fields that will become part of the mapping of the destination index. _source: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalysisAnalyzedFields' description: Specify `includes` and/or `excludes patterns to select which fields will be present in the destination. Fields that are excluded cannot be included in the analysis. query: type: object description: "The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. By default, this property has the following value: `{\"match_all\": {}}`.\n" externalDocs: description: Query DSL url: https://www.elastic.co/docs/explore-analyze/query-filter/languages/querydsl x-model: true ml._types.DataframeAnalysisAnalyzedFields: type: object properties: includes: type: array items: type: string description: 'An array of strings that defines the fields that will be excluded from the analysis. You do not need to add fields with unsupported data types to excludes, these fields are excluded from the analysis automatically.' excludes: type: array items: type: string description: An array of strings that defines the fields that will be included in the analysis. ml._types.DataframeAnalyticsDestination: required: - index type: object properties: index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: Defines the destination index to store the results of the data frame analytics job. results_field: allOf: - $ref: '#/components/schemas/_types.Field' description: Defines the name of the field in which to store the results of the analysis. Defaults to `ml`. ml._types.DataframeAnalysisContainer: maxProperties: 1 minProperties: 1 type: object properties: classification: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalysisClassification' description: The configuration information necessary to perform classification. outlier_detection: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalysisOutlierDetection' description: 'The configuration information necessary to perform outlier detection. NOTE: Advanced parameters are for fine-tuning classification analysis. They are set automatically by hyperparameter optimization to give the minimum validation error. It is highly recommended to use the default values unless you fully understand the function of these parameters.' regression: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalysisRegression' description: 'The configuration information necessary to perform regression. NOTE: Advanced parameters are for fine-tuning regression analysis. They are set automatically by hyperparameter optimization to give the minimum validation error. It is highly recommended to use the default values unless you fully understand the function of these parameters.' ml._types.DataframeAnalysisClassification: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalysis' - type: object properties: class_assignment_objective: type: string num_top_classes: type: number description: 'Defines the number of categories for which the predicted probabilities are reported. It must be non-negative or -1. If it is -1 or greater than the total number of categories, probabilities are reported for all categories; if you have a large number of categories, there could be a significant effect on the size of your destination index. NOTE: To use the AUC ROC evaluation method, `num_top_classes` must be set to -1 or a value greater than or equal to the total number of categories.' default: 2 ml._types.DataframeAnalysis: required: - dependent_variable type: object properties: alpha: type: number description: 'Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This parameter affects loss calculations by acting as a multiplier of the tree depth. Higher alpha values result in shallower trees and faster training times. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to zero.' dependent_variable: type: string description: "Defines which field of the document is to be predicted. It must match one of the fields in the index being used to train. If this field is missing from a document, then that document will not be used for training, but a prediction with the trained model will be generated for it. It is also known as continuous target variable.\nFor classification analysis, the data type of the field must be numeric (`integer`, `short`, `long`, `byte`), categorical (`ip` or `keyword`), or `boolean`. There must be no more than 30 different values in this field.\nFor regression analysis, the data type of the field must be numeric." downsample_factor: type: number description: 'Advanced configuration option. Controls the fraction of data that is used to compute the derivatives of the loss function for tree training. A small value results in the use of a small fraction of the data. If this value is set to be less than 1, accuracy typically improves. However, too small a value may result in poor convergence for the ensemble and so require more trees. By default, this value is calculated during hyperparameter optimization. It must be greater than zero and less than or equal to 1.' early_stopping_enabled: type: boolean description: 'Advanced configuration option. Specifies whether the training process should finish if it is not finding any better performing models. If disabled, the training process can take significantly longer and the chance of finding a better performing model is unremarkable.' default: true eta: type: number description: 'Advanced configuration option. The shrinkage applied to the weights. Smaller values result in larger forests which have a better generalization error. However, larger forests cause slower training. By default, this value is calculated during hyperparameter optimization. It must be a value between 0.001 and 1.' eta_growth_rate_per_tree: type: number description: 'Advanced configuration option. Specifies the rate at which `eta` increases for each new tree that is added to the forest. For example, a rate of 1.05 increases `eta` by 5% for each extra tree. By default, this value is calculated during hyperparameter optimization. It must be between 0.5 and 2.' feature_bag_fraction: type: number description: 'Advanced configuration option. Defines the fraction of features that will be used when selecting a random bag for each candidate split. By default, this value is calculated during hyperparameter optimization.' feature_processors: type: array items: $ref: '#/components/schemas/ml._types.DataframeAnalysisFeatureProcessor' description: 'Advanced configuration option. A collection of feature preprocessors that modify one or more included fields. The analysis uses the resulting one or more features instead of the original document field. However, these features are ephemeral; they are not stored in the destination index. Multiple `feature_processors` entries can refer to the same document fields. Automatic categorical feature encoding still occurs for the fields that are unprocessed by a custom processor or that have categorical values. Use this property only if you want to override the automatic feature encoding of the specified fields.' gamma: type: number description: 'Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies a linear penalty associated with the size of individual trees in the forest. A high gamma value causes training to prefer small trees. A small gamma value results in larger individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value.' lambda: type: number description: 'Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies an L2 regularization term which applies to leaf weights of the individual trees in the forest. A high lambda value causes training to favor small leaf weights. This behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the dependent variable. A small lambda value results in large individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value.' max_optimization_rounds_per_hyperparameter: type: number description: 'Advanced configuration option. A multiplier responsible for determining the maximum number of hyperparameter optimization steps in the Bayesian optimization procedure. The maximum number of steps is determined based on the number of undefined hyperparameters times the maximum optimization rounds per hyperparameter. By default, this value is calculated during hyperparameter optimization.' max_trees: type: number description: 'Advanced configuration option. Defines the maximum number of decision trees in the forest. The maximum value is 2000. By default, this value is calculated during hyperparameter optimization.' num_top_feature_importance_values: type: number description: 'Advanced configuration option. Specifies the maximum number of feature importance values per document to return. By default, no feature importance calculation occurs.' default: 0 prediction_field_name: allOf: - $ref: '#/components/schemas/_types.Field' description: Defines the name of the prediction field in the results. Defaults to `_prediction`. randomize_seed: type: number description: 'Defines the seed for the random generator that is used to pick training data. By default, it is randomly generated. Set it to a specific value to use the same training data each time you start a job (assuming other related parameters such as `source` and `analyzed_fields` are the same).' soft_tree_depth_limit: type: number description: 'Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This soft limit combines with the `soft_tree_depth_tolerance` to penalize trees that exceed the specified depth; the regularized loss increases quickly beyond this depth. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.' soft_tree_depth_tolerance: type: number description: 'Advanced configuration option. This option controls how quickly the regularized loss increases when the tree depth exceeds `soft_tree_depth_limit`. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.01.' training_percent: allOf: - $ref: '#/components/schemas/_types.Percentage' description: Defines what percentage of the eligible documents that will be used for training. Documents that are ignored by the analysis (for example those that contain arrays with more than one value) won’t be included in the calculation for used percentage. default: 100 ml._types.DataframeAnalysisFeatureProcessor: maxProperties: 1 minProperties: 1 type: object properties: frequency_encoding: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalysisFeatureProcessorFrequencyEncoding' description: The configuration information necessary to perform frequency encoding. multi_encoding: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalysisFeatureProcessorMultiEncoding' description: The configuration information necessary to perform multi encoding. It allows multiple processors to be changed together. This way the output of a processor can then be passed to another as an input. n_gram_encoding: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalysisFeatureProcessorNGramEncoding' description: 'The configuration information necessary to perform n-gram encoding. Features created by this encoder have the following name format: .. For example, if the feature_prefix is f, the feature name for the second unigram in a string is f.11.' one_hot_encoding: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalysisFeatureProcessorOneHotEncoding' description: The configuration information necessary to perform one hot encoding. target_mean_encoding: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalysisFeatureProcessorTargetMeanEncoding' description: The configuration information necessary to perform target mean encoding. ml._types.DataframeAnalysisFeatureProcessorFrequencyEncoding: required: - feature_name - field - frequency_map type: object properties: feature_name: allOf: - $ref: '#/components/schemas/_types.Name' description: The resulting feature name. field: allOf: - $ref: '#/components/schemas/_types.Field' frequency_map: type: object additionalProperties: type: number description: 'The resulting frequency map for the field value. If the field value is missing from the frequency_map, the resulting value is 0.' ml._types.DataframeAnalysisFeatureProcessorMultiEncoding: required: - processors type: object properties: processors: type: array items: type: number description: The ordered array of custom processors to execute. Must be more than 1. ml._types.DataframeAnalysisFeatureProcessorNGramEncoding: required: - field - n_grams type: object properties: feature_prefix: type: string description: The feature name prefix. Defaults to ngram__. field: allOf: - $ref: '#/components/schemas/_types.Field' description: The name of the text field to encode. length: type: number description: Specifies the length of the n-gram substring. Defaults to 50. Must be greater than 0. n_grams: type: array items: type: number description: 'Specifies which n-grams to gather. It’s an array of integer values where the minimum value is 1, and a maximum value is 5.' start: type: number description: Specifies the zero-indexed start of the n-gram substring. Negative values are allowed for encoding n-grams of string suffixes. Defaults to 0. custom: type: boolean ml._types.DataframeAnalysisFeatureProcessorOneHotEncoding: required: - field - hot_map type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The name of the field to encode. hot_map: type: string description: The one hot map mapping the field value with the column name. ml._types.DataframeAnalysisFeatureProcessorTargetMeanEncoding: required: - default_value - feature_name - field - target_map type: object properties: default_value: type: number description: The default value if field value is not found in the target_map. feature_name: allOf: - $ref: '#/components/schemas/_types.Name' description: The resulting feature name. field: allOf: - $ref: '#/components/schemas/_types.Field' description: The name of the field to encode. target_map: type: object additionalProperties: type: object description: The field value to target mean transition map. ml._types.DataframeAnalysisOutlierDetection: type: object properties: compute_feature_influence: type: boolean description: Specifies whether the feature influence calculation is enabled. default: true feature_influence_threshold: type: number description: 'The minimum outlier score that a document needs to have in order to calculate its feature influence score. Value range: 0-1.' default: 0.1 method: type: string description: 'The method that outlier detection uses. Available methods are `lof`, `ldof`, `distance_kth_nn`, `distance_knn`, and `ensemble`. The default value is ensemble, which means that outlier detection uses an ensemble of different methods and normalises and combines their individual outlier scores to obtain the overall outlier score.' default: ensemble n_neighbors: type: number description: 'Defines the value for how many nearest neighbors each method of outlier detection uses to calculate its outlier score. When the value is not set, different values are used for different ensemble members. This default behavior helps improve the diversity in the ensemble; only override it if you are confident that the value you choose is appropriate for the data set.' outlier_fraction: type: number description: 'The proportion of the data set that is assumed to be outlying prior to outlier detection. For example, 0.05 means it is assumed that 5% of values are real outliers and 95% are inliers.' standardization_enabled: type: boolean description: 'If true, the following operation is performed on the columns before computing outlier scores: `(x_i - mean(x_i)) / sd(x_i)`.' default: true ml._types.DataframeAnalysisRegression: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalysis' - type: object properties: loss_function: type: string description: 'The loss function used during regression. Available options are `mse` (mean squared error), `msle` (mean squared logarithmic error), `huber` (Pseudo-Huber loss).' default: mse loss_function_parameter: type: number description: A positive number that is used as a parameter to the `loss_function`. ml._types.DataframeAnalyticsFieldSelection: required: - is_included - is_required - mapping_types - name type: object properties: is_included: type: boolean description: Whether the field is selected to be included in the analysis. is_required: type: boolean description: Whether the field is required. feature_type: type: string description: The feature type of this field for the analysis. May be categorical or numerical. mapping_types: type: array items: type: string description: The mapping types of the field. name: allOf: - $ref: '#/components/schemas/_types.Field' description: The field name. reason: type: string description: The reason a field is not selected to be included in the analysis. ml._types.DataframeAnalyticsMemoryEstimation: required: - expected_memory_with_disk - expected_memory_without_disk type: object properties: expected_memory_with_disk: type: string description: Estimated memory usage under the assumption that overflowing to disk is allowed during data frame analytics. expected_memory_with_disk is usually smaller than expected_memory_without_disk as using disk allows to limit the main memory needed to perform data frame analytics. expected_memory_without_disk: type: string description: Estimated memory usage under the assumption that the whole data frame analytics should happen in memory (i.e. without overflowing to disk). ml._types.Page: type: object properties: from: type: number description: Skips the specified number of items. default: 0 size: type: number description: Specifies the maximum number of items to obtain. default: 10000 ml._types.BucketSummary: required: - anomaly_score - bucket_influencers - bucket_span - event_count - initial_anomaly_score - is_interim - job_id - processing_time_ms - result_type - timestamp type: object properties: anomaly_score: type: number description: "The maximum anomaly score, between 0-100, for any of the bucket influencers. This is an overall, rate-limited\nscore for the job. All the anomaly records in the bucket contribute to this score. This value might be updated as\nnew data is analyzed." bucket_influencers: type: array items: $ref: '#/components/schemas/ml._types.BucketInfluencer' bucket_span: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitSeconds' description: The length of the bucket in seconds. This value matches the bucket span that is specified in the job. event_count: type: number description: The number of input data records processed in this bucket. initial_anomaly_score: type: number description: "The maximum anomaly score for any of the bucket influencers. This is the initial value that was calculated at the\ntime the bucket was processed." is_interim: type: boolean description: 'If true, this is an interim result. In other words, the results are calculated based on partial input data.' job_id: allOf: - $ref: '#/components/schemas/_types.Id' description: Identifier for the anomaly detection job. processing_time_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: 'The amount of time, in milliseconds, that it took to analyze the bucket contents and calculate results.' result_type: type: string description: Internal. This value is always set to bucket. timestamp: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: "The start time of the bucket. This timestamp uniquely identifies the bucket. Events that occur exactly at the\ntimestamp of the bucket are included in the results for the bucket." timestamp_string: allOf: - $ref: '#/components/schemas/_types.DateTime' description: "The start time of the bucket. This timestamp uniquely identifies the bucket. Events that occur exactly at the\ntimestamp of the bucket are included in the results for the bucket." ml._types.BucketInfluencer: required: - anomaly_score - bucket_span - influencer_field_name - initial_anomaly_score - is_interim - job_id - probability - raw_anomaly_score - result_type - timestamp type: object properties: anomaly_score: type: number description: "A normalized score between 0-100, which is calculated for each bucket influencer. This score might be updated as\nnewer data is analyzed." bucket_span: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitSeconds' description: The length of the bucket in seconds. This value matches the bucket span that is specified in the job. influencer_field_name: allOf: - $ref: '#/components/schemas/_types.Field' description: The field name of the influencer. initial_anomaly_score: type: number description: "The score between 0-100 for each bucket influencer. This score is the initial value that was calculated at the\ntime the bucket was processed." is_interim: type: boolean description: 'If true, this is an interim result. In other words, the results are calculated based on partial input data.' job_id: allOf: - $ref: '#/components/schemas/_types.Id' description: Identifier for the anomaly detection job. probability: type: number description: "The probability that the bucket has this behavior, in the range 0 to 1. This value can be held to a high precision\nof over 300 decimal places, so the `anomaly_score` is provided as a human-readable and friendly interpretation of\nthis." raw_anomaly_score: type: number description: Internal. result_type: type: string description: Internal. This value is always set to `bucket_influencer`. timestamp: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: The start time of the bucket for which these results were calculated. timestamp_string: allOf: - $ref: '#/components/schemas/_types.DateTime' description: The start time of the bucket for which these results were calculated. _types.DurationValueUnitSeconds: allOf: - $ref: '#/components/schemas/_types.UnitSeconds' ml._types.CalendarEvent: required: - description - end_time - start_time type: object properties: calendar_id: allOf: - $ref: '#/components/schemas/_types.Id' description: A string that uniquely identifies a calendar. event_id: allOf: - $ref: '#/components/schemas/_types.Id' description: type: string description: A description of the scheduled event. end_time: allOf: - $ref: '#/components/schemas/_types.DateTime' description: The timestamp for the end of the scheduled event in milliseconds since the epoch or ISO 8601 format. start_time: allOf: - $ref: '#/components/schemas/_types.DateTime' description: The timestamp for the beginning of the scheduled event in milliseconds since the epoch or ISO 8601 format. skip_result: type: boolean description: When true the model will not create results for this calendar period. default: true skip_model_update: type: boolean description: When true the model will not be updated for this calendar period. default: true force_time_shift: type: number description: Shift time by this many seconds. For example adjust time for daylight savings changes ml.get_calendars.Calendar: required: - calendar_id - job_ids type: object properties: calendar_id: allOf: - $ref: '#/components/schemas/_types.Id' description: A string that uniquely identifies a calendar. description: type: string description: A description of the calendar. job_ids: type: array items: $ref: '#/components/schemas/_types.Id' description: An array of anomaly detection job identifiers. _types.CategoryId: type: number ml._types.Category: required: - category_id - examples - job_id - max_matching_length - regex - terms - result_type - mlcategory type: object properties: category_id: allOf: - $ref: '#/components/schemas/_types.ulong' description: 'A unique identifier for the category. category_id is unique at the job level, even when per-partition categorization is enabled.' examples: type: array items: type: string description: A list of examples of actual values that matched the category. grok_pattern: allOf: - $ref: '#/components/schemas/_types.GrokPattern' description: '[experimental] A Grok pattern that could be used in Logstash or an ingest pipeline to extract fields from messages that match the category. This field is experimental and may be changed or removed in a future release. The Grok patterns that are found are not optimal, but are often a good starting point for manual tweaking.' job_id: allOf: - $ref: '#/components/schemas/_types.Id' description: Identifier for the anomaly detection job. max_matching_length: allOf: - $ref: '#/components/schemas/_types.ulong' description: The maximum length of the fields that matched the category. The value is increased by 10% to enable matching for similar fields that have not been analyzed. partition_field_name: type: string description: 'If per-partition categorization is enabled, this property identifies the field used to segment the categorization. It is not present when per-partition categorization is disabled.' partition_field_value: type: string description: 'If per-partition categorization is enabled, this property identifies the value of the partition_field_name for the category. It is not present when per-partition categorization is disabled.' regex: type: string description: A regular expression that is used to search for values that match the category. terms: type: string description: A space separated list of the common tokens that are matched in values of the category. num_matches: type: number description: The number of messages that have been matched by this category. This is only guaranteed to have the latest accurate count after a job _flush or _close preferred_to_categories: type: array items: $ref: '#/components/schemas/_types.Id' description: A list of category_id entries that this current category encompasses. Any new message that is processed by the categorizer will match against this category and not any of the categories in this list. This is only guaranteed to have the latest accurate list of categories after a job _flush or _close p: type: string result_type: type: string mlcategory: type: string ml._types.DataframeAnalyticsSummary: required: - analysis - dest - id - source type: object properties: allow_lazy_start: type: boolean analysis: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalysisContainer' analyzed_fields: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalysisAnalyzedFields' authorization: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalyticsAuthorization' description: 'The security privileges that the job uses to run its queries. If Elastic Stack security features were disabled at the time of the most recent update to the job, this property is omitted.' create_time: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: type: string dest: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalyticsDestination' id: allOf: - $ref: '#/components/schemas/_types.Id' max_num_threads: type: number model_memory_limit: type: string source: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalyticsSource' version: allOf: - $ref: '#/components/schemas/_types.VersionString' _meta: allOf: - $ref: '#/components/schemas/_types.Metadata' ml._types.DataframeAnalyticsAuthorization: type: object properties: api_key: allOf: - $ref: '#/components/schemas/ml._types.ApiKeyAuthorization' description: 'If an API key was used for the most recent update to the job, its name and identifier are listed in the response.' roles: type: array items: type: string description: 'If a user ID was used for the most recent update to the job, its roles at the time of the update are listed in the response.' service_account: type: string description: 'If a service account was used for the most recent update to the job, the account name is listed in the response.' ml._types.ApiKeyAuthorization: required: - id - name type: object properties: id: type: string description: The identifier for the API key. name: type: string description: The name of the API key. ml._types.DataframeAnalytics: required: - data_counts - id - memory_usage - progress - state type: object properties: analysis_stats: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalyticsStatsContainer' description: An object containing information about the analysis job. assignment_explanation: type: string description: 'For running jobs only, contains messages relating to the selection of a node to run the job.' data_counts: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalyticsStatsDataCounts' description: 'An object that provides counts for the quantity of documents skipped, used in training, or available for testing.' id: allOf: - $ref: '#/components/schemas/_types.Id' description: The unique identifier of the data frame analytics job. memory_usage: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalyticsStatsMemoryUsage' description: An object describing memory usage of the analytics. It is present only after the job is started and memory usage is reported. node: allOf: - $ref: '#/components/schemas/_types.NodeAttributes' description: Contains properties for the node that runs the job. This information is available only for running jobs. progress: type: array items: $ref: '#/components/schemas/ml._types.DataframeAnalyticsStatsProgress' description: The progress report of the data frame analytics job by phase. state: allOf: - $ref: '#/components/schemas/ml._types.DataframeState' description: 'The status of the data frame analytics job, which can be one of the following values: failed, started, starting, stopping, stopped.' ml._types.DataframeAnalyticsStatsContainer: maxProperties: 1 minProperties: 1 type: object properties: classification_stats: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalyticsStatsHyperparameters' description: An object containing information about the classification analysis job. outlier_detection_stats: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalyticsStatsOutlierDetection' description: An object containing information about the outlier detection job. regression_stats: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalyticsStatsHyperparameters' description: An object containing information about the regression analysis. ml._types.DataframeAnalyticsStatsHyperparameters: required: - hyperparameters - iteration - timestamp - timing_stats - validation_loss type: object properties: hyperparameters: allOf: - $ref: '#/components/schemas/ml._types.Hyperparameters' description: An object containing the parameters of the classification analysis job. iteration: type: number description: The number of iterations on the analysis. timestamp: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: The timestamp when the statistics were reported in milliseconds since the epoch. timing_stats: allOf: - $ref: '#/components/schemas/ml._types.TimingStats' description: An object containing time statistics about the data frame analytics job. validation_loss: allOf: - $ref: '#/components/schemas/ml._types.ValidationLoss' description: An object containing information about validation loss. ml._types.Hyperparameters: type: object properties: alpha: type: number description: "Advanced configuration option.\nMachine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly.\nThis parameter affects loss calculations by acting as a multiplier of the tree depth.\nHigher alpha values result in shallower trees and faster training times.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be greater than or equal to zero." lambda: type: number description: "Advanced configuration option.\nRegularization parameter to prevent overfitting on the training data set.\nMultiplies an L2 regularization term which applies to leaf weights of the individual trees in the forest.\nA high lambda value causes training to favor small leaf weights.\nThis behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the dependent variable.\nA small lambda value results in large individual trees and slower training.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be a nonnegative value." gamma: type: number description: "Advanced configuration option.\nRegularization parameter to prevent overfitting on the training data set.\nMultiplies a linear penalty associated with the size of individual trees in the forest.\nA high gamma value causes training to prefer small trees.\nA small gamma value results in larger individual trees and slower training.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be a nonnegative value." eta: type: number description: "Advanced configuration option.\nThe shrinkage applied to the weights.\nSmaller values result in larger forests which have a better generalization error.\nHowever, larger forests cause slower training.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be a value between `0.001` and `1`." eta_growth_rate_per_tree: type: number description: "Advanced configuration option.\nSpecifies the rate at which `eta` increases for each new tree that is added to the forest.\nFor example, a rate of 1.05 increases `eta` by 5% for each extra tree.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be between `0.5` and `2`." feature_bag_fraction: type: number description: "Advanced configuration option.\nDefines the fraction of features that will be used when selecting a random bag for each candidate split.\nBy default, this value is calculated during hyperparameter optimization." downsample_factor: type: number description: "Advanced configuration option.\nControls the fraction of data that is used to compute the derivatives of the loss function for tree training.\nA small value results in the use of a small fraction of the data.\nIf this value is set to be less than 1, accuracy typically improves.\nHowever, too small a value may result in poor convergence for the ensemble and so require more trees.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be greater than zero and less than or equal to 1." max_attempts_to_add_tree: type: number description: "If the algorithm fails to determine a non-trivial tree (more than a single leaf), this parameter determines how many of such consecutive failures are tolerated.\nOnce the number of attempts exceeds the threshold, the forest training stops." max_optimization_rounds_per_hyperparameter: type: number description: "Advanced configuration option.\nA multiplier responsible for determining the maximum number of hyperparameter optimization steps in the Bayesian optimization procedure.\nThe maximum number of steps is determined based on the number of undefined hyperparameters times the maximum optimization rounds per hyperparameter.\nBy default, this value is calculated during hyperparameter optimization." max_trees: type: number description: "Advanced configuration option.\nDefines the maximum number of decision trees in the forest.\nThe maximum value is 2000.\nBy default, this value is calculated during hyperparameter optimization." num_folds: type: number description: The maximum number of folds for the cross-validation procedure. num_splits_per_feature: type: number description: Determines the maximum number of splits for every feature that can occur in a decision tree when the tree is trained. soft_tree_depth_limit: type: number description: "Advanced configuration option.\nMachine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly.\nThis soft limit combines with the `soft_tree_depth_tolerance` to penalize trees that exceed the specified depth; the regularized loss increases quickly beyond this depth.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be greater than or equal to 0." soft_tree_depth_tolerance: type: number description: "Advanced configuration option.\nThis option controls how quickly the regularized loss increases when the tree depth exceeds `soft_tree_depth_limit`.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be greater than or equal to 0.01." ml._types.TimingStats: required: - elapsed_time type: object properties: elapsed_time: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: Runtime of the analysis in milliseconds. iteration_time: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: Runtime of the latest iteration of the analysis in milliseconds. ml._types.ValidationLoss: required: - fold_values - loss_type type: object properties: fold_values: type: array items: type: string description: Validation loss values for every added decision tree during the forest growing procedure. loss_type: type: string description: 'The type of the loss metric. For example, binomial_logistic.' ml._types.DataframeAnalyticsStatsOutlierDetection: required: - parameters - timestamp - timing_stats type: object properties: parameters: allOf: - $ref: '#/components/schemas/ml._types.OutlierDetectionParameters' description: The list of job parameters specified by the user or determined by algorithmic heuristics. timestamp: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: The timestamp when the statistics were reported in milliseconds since the epoch. timing_stats: allOf: - $ref: '#/components/schemas/ml._types.TimingStats' description: An object containing time statistics about the data frame analytics job. ml._types.OutlierDetectionParameters: type: object properties: compute_feature_influence: type: boolean description: Specifies whether the feature influence calculation is enabled. default: true feature_influence_threshold: type: number description: "The minimum outlier score that a document needs to have in order to calculate its feature influence score.\nValue range: 0-1" default: 0.1 method: type: string description: "The method that outlier detection uses.\nAvailable methods are `lof`, `ldof`, `distance_kth_nn`, `distance_knn`, and `ensemble`.\nThe default value is ensemble, which means that outlier detection uses an ensemble of different methods and normalises and combines their individual outlier scores to obtain the overall outlier score." n_neighbors: type: number description: "Defines the value for how many nearest neighbors each method of outlier detection uses to calculate its outlier score.\nWhen the value is not set, different values are used for different ensemble members.\nThis default behavior helps improve the diversity in the ensemble; only override it if you are confident that the value you choose is appropriate for the data set." outlier_fraction: type: number description: "The proportion of the data set that is assumed to be outlying prior to outlier detection.\nFor example, 0.05 means it is assumed that 5% of values are real outliers and 95% are inliers." standardization_enabled: type: boolean description: 'If `true`, the following operation is performed on the columns before computing outlier scores: (x_i - mean(x_i)) / sd(x_i).' default: true ml._types.DataframeAnalyticsStatsDataCounts: required: - skipped_docs_count - test_docs_count - training_docs_count type: object properties: skipped_docs_count: type: number description: 'The number of documents that are skipped during the analysis because they contained values that are not supported by the analysis. For example, outlier detection does not support missing fields so it skips documents with missing fields. Likewise, all types of analysis skip documents that contain arrays with more than one element.' test_docs_count: type: number description: The number of documents that are not used for training the model and can be used for testing. training_docs_count: type: number description: The number of documents that are used for training the model. ml._types.DataframeAnalyticsStatsMemoryUsage: required: - peak_usage_bytes - status type: object properties: memory_reestimate_bytes: type: number description: This value is present when the status is hard_limit and it is a new estimate of how much memory the job needs. peak_usage_bytes: type: number description: The number of bytes used at the highest peak of memory usage. status: type: string description: The memory usage status. timestamp: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: The timestamp when memory usage was calculated. _types.NodeAttributes: required: - attributes - ephemeral_id - name - transport_address type: object properties: attributes: type: object additionalProperties: type: string description: Lists node attributes. ephemeral_id: allOf: - $ref: '#/components/schemas/_types.Id' description: The ephemeral ID of the node. id: allOf: - $ref: '#/components/schemas/_types.NodeId' description: The unique identifier of the node. name: allOf: - $ref: '#/components/schemas/_types.NodeName' description: The unique identifier of the node. transport_address: allOf: - $ref: '#/components/schemas/_types.TransportAddress' description: The host and port where transport HTTP connections are accepted. ml._types.DataframeAnalyticsStatsProgress: required: - phase - progress_percent type: object properties: phase: type: string description: Defines the phase of the data frame analytics job. progress_percent: type: number description: The progress that the data frame analytics job has made expressed in percentage. ml._types.DataframeState: enum: - started - stopped - starting - stopping - failed type: string ml._types.DatafeedStats: required: - datafeed_id - state type: object properties: assignment_explanation: type: string description: 'For started datafeeds only, contains messages relating to the selection of a node.' datafeed_id: allOf: - $ref: '#/components/schemas/_types.Id' description: "A numerical character string that uniquely identifies the datafeed.\nThis identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.\nIt must start and end with alphanumeric characters." node: allOf: - $ref: '#/components/schemas/ml._types.DiscoveryNodeCompact' description: 'For started datafeeds only, this information pertains to the node upon which the datafeed is started.' state: allOf: - $ref: '#/components/schemas/ml._types.DatafeedState' description: 'The status of the datafeed, which can be one of the following values: `starting`, `started`, `stopping`, `stopped`.' timing_stats: allOf: - $ref: '#/components/schemas/ml._types.DatafeedTimingStats' description: An object that provides statistical information about timing aspect of this datafeed. running_state: allOf: - $ref: '#/components/schemas/ml._types.DatafeedRunningState' description: "An object containing the running state for this datafeed.\nIt is only provided if the datafeed is started." ml._types.DiscoveryNodeCompact: required: - name - ephemeral_id - id - transport_address - attributes type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' ephemeral_id: allOf: - $ref: '#/components/schemas/_types.Id' id: allOf: - $ref: '#/components/schemas/_types.Id' transport_address: allOf: - $ref: '#/components/schemas/_types.TransportAddress' attributes: type: object additionalProperties: type: string description: Alternative representation of DiscoveryNode used in ml.get_job_stats and ml.get_datafeed_stats ml._types.DatafeedTimingStats: required: - bucket_count - exponential_average_search_time_per_hour_ms - job_id - search_count - total_search_time_ms type: object properties: bucket_count: type: number description: The number of buckets processed. exponential_average_search_time_per_hour_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitFloatMillis' description: 'The exponential average search time per hour, in milliseconds.' exponential_average_calculation_context: allOf: - $ref: '#/components/schemas/ml._types.ExponentialAverageCalculationContext' job_id: allOf: - $ref: '#/components/schemas/_types.Id' description: Identifier for the anomaly detection job. search_count: type: number description: The number of searches run by the datafeed. total_search_time_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitFloatMillis' description: 'The total time the datafeed spent searching, in milliseconds.' average_search_time_per_bucket_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitFloatMillis' description: 'The average search time per bucket, in milliseconds.' _types.DurationValueUnitFloatMillis: allOf: - $ref: '#/components/schemas/_types.UnitFloatMillis' _types.UnitFloatMillis: type: number description: Time unit for fractional milliseconds ml._types.ExponentialAverageCalculationContext: required: - incremental_metric_value_ms type: object properties: incremental_metric_value_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitFloatMillis' latest_timestamp: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' previous_exponential_average_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitFloatMillis' ml._types.DatafeedRunningState: required: - real_time_configured - real_time_running type: object properties: real_time_configured: type: boolean description: Indicates if the datafeed is "real-time"; meaning that the datafeed has no configured `end` time. real_time_running: type: boolean description: "Indicates whether the datafeed has finished running on the available past data.\nFor datafeeds without a configured `end` time, this means that the datafeed is now running on \"real-time\" data." search_interval: allOf: - $ref: '#/components/schemas/ml._types.RunningStateSearchInterval' description: Provides the latest time interval the datafeed has searched. ml._types.RunningStateSearchInterval: required: - end_ms - start_ms type: object properties: end: allOf: - $ref: '#/components/schemas/_types.Duration' description: The end time. end_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: The end time as an epoch in milliseconds. start: allOf: - $ref: '#/components/schemas/_types.Duration' description: The start time. start_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: The start time as an epoch in milliseconds. ml._types.Datafeed: required: - datafeed_id - indices - job_id - query - delayed_data_check_config type: object properties: aggregations: type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.AggregationContainer' authorization: allOf: - $ref: '#/components/schemas/ml._types.DatafeedAuthorization' description: 'The security privileges that the datafeed uses to run its queries. If Elastic Stack security features were disabled at the time of the most recent update to the datafeed, this property is omitted.' chunking_config: allOf: - $ref: '#/components/schemas/ml._types.ChunkingConfig' datafeed_id: allOf: - $ref: '#/components/schemas/_types.Id' frequency: allOf: - $ref: '#/components/schemas/_types.Duration' description: 'The interval at which scheduled queries are made while the datafeed runs in real time. The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket span. For example: `150s`. When `frequency` is shorter than the bucket span, interim results for the last (partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value must be divisible by the interval of the date histogram aggregation.' indices: type: array items: type: string indexes: type: array items: type: string job_id: allOf: - $ref: '#/components/schemas/_types.Id' max_empty_searches: type: number query_delay: allOf: - $ref: '#/components/schemas/_types.Duration' script_fields: type: object additionalProperties: $ref: '#/components/schemas/_types.ScriptField' scroll_size: type: number delayed_data_check_config: allOf: - $ref: '#/components/schemas/ml._types.DelayedDataCheckConfig' runtime_mappings: allOf: - $ref: '#/components/schemas/_types.mapping.RuntimeFields' indices_options: allOf: - $ref: '#/components/schemas/_types.IndicesOptions' query: type: object description: "The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. By default, this property has the following value: `{\"match_all\": {\"boost\": 1}}`.\n" externalDocs: description: Query DSL url: https://www.elastic.co/docs/explore-analyze/query-filter/languages/querydsl x-model: true ml._types.DatafeedAuthorization: type: object properties: api_key: allOf: - $ref: '#/components/schemas/ml._types.ApiKeyAuthorization' description: 'If an API key was used for the most recent update to the datafeed, its name and identifier are listed in the response.' roles: type: array items: type: string description: 'If a user ID was used for the most recent update to the datafeed, its roles at the time of the update are listed in the response.' service_account: type: string description: 'If a service account was used for the most recent update to the datafeed, the account name is listed in the response.' ml._types.ChunkingConfig: required: - mode type: object properties: mode: allOf: - $ref: '#/components/schemas/ml._types.ChunkingMode' description: "If the mode is `auto`, the chunk size is dynamically calculated;\nthis is the recommended value when the datafeed does not use aggregations.\nIf the mode is `manual`, chunking is applied according to the specified `time_span`;\nuse this mode when the datafeed uses aggregations. If the mode is `off`, no chunking is applied." time_span: allOf: - $ref: '#/components/schemas/_types.Duration' description: The time span that each search will be querying. This setting is applicable only when the `mode` is set to `manual`. default: 3h ml._types.ChunkingMode: enum: - auto - manual - off type: string ml._types.DelayedDataCheckConfig: required: - enabled type: object properties: check_window: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The window of time that is searched for late data. This window of time ends with the latest finalized bucket.\nIt defaults to null, which causes an appropriate `check_window` to be calculated when the real-time datafeed runs.\nIn particular, the default `check_window` span calculation is based on the maximum of `2h` or `8 * bucket_span`." enabled: type: boolean description: Specifies whether the datafeed periodically checks for delayed data. _types.IndicesOptions: type: object properties: allow_no_indices: type: boolean description: "A setting that does two separate checks on the index expression.\nIf `false`, the request returns an error (1) if any wildcard expression\n(including `_all` and `*`) resolves to zero matching indices or (2) if the\ncomplete set of resolved indices, aliases or data streams is empty after all\nexpressions are evaluated. If `true`, index expressions that resolve to no\nindices are allowed and the request returns an empty result." expand_wildcards: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' description: "Type of index that wildcard patterns can match. If the request can target data streams, this argument\ndetermines whether wildcard expressions match hidden data streams. Supports comma-separated values,\nsuch as `open,hidden`.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" ignore_unavailable: type: boolean description: "If `false`, the request returns an error if it targets a concrete (non-wildcarded)\nindex, alias, or data stream that is missing, closed, or otherwise unavailable.\nIf `true`, unavailable concrete targets are silently ignored." default: false ignore_throttled: type: boolean description: 'If true, concrete, expanded or aliased indices are ignored when frozen.' default: true description: "Controls how to deal with unavailable concrete indices (closed or missing), how wildcard expressions are expanded\nto actual indices (all, closed or open indices) and how to deal with wildcard expressions that resolve to no indices." ml._types.Filter: required: - filter_id - items type: object properties: description: type: string description: A description of the filter. filter_id: allOf: - $ref: '#/components/schemas/_types.Id' description: A string that uniquely identifies a filter. items: type: array items: type: string description: An array of strings which is the filter item list. ml._types.Influencer: required: - bucket_span - influencer_score - influencer_field_name - influencer_field_value - initial_influencer_score - is_interim - job_id - probability - result_type - timestamp type: object properties: bucket_span: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitSeconds' description: The length of the bucket in seconds. This value matches the bucket span that is specified in the job. influencer_score: type: number description: "A normalized score between 0-100, which is based on the probability of the influencer in this bucket aggregated\nacross detectors. Unlike `initial_influencer_score`, this value is updated by a re-normalization process as new\ndata is analyzed." influencer_field_name: allOf: - $ref: '#/components/schemas/_types.Field' description: The field name of the influencer. influencer_field_value: type: string description: 'The entity that influenced, contributed to, or was to blame for the anomaly.' initial_influencer_score: type: number description: "A normalized score between 0-100, which is based on the probability of the influencer aggregated across detectors.\nThis is the initial value that was calculated at the time the bucket was processed." is_interim: type: boolean description: 'If true, this is an interim result. In other words, the results are calculated based on partial input data.' job_id: allOf: - $ref: '#/components/schemas/_types.Id' description: Identifier for the anomaly detection job. probability: type: number description: "The probability that the influencer has this behavior, in the range 0 to 1. This value can be held to a high\nprecision of over 300 decimal places, so the `influencer_score` is provided as a human-readable and friendly\ninterpretation of this value." result_type: type: string description: Internal. This value is always set to `influencer`. timestamp: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: The start time of the bucket for which these results were calculated. foo: type: string description: "Additional influencer properties are added, depending on the fields being analyzed. For example, if it’s\nanalyzing `user_name` as an influencer, a field `user_name` is added to the result document. This\ninformation enables you to filter the anomaly results more easily." ml._types.JobStats: required: - data_counts - forecasts_stats - job_id - model_size_stats - state - timing_stats type: object properties: assignment_explanation: type: string description: 'For open anomaly detection jobs only, contains messages relating to the selection of a node to run the job.' data_counts: allOf: - $ref: '#/components/schemas/ml._types.DataCounts' description: "An object that describes the quantity of input to the job and any related error counts.\nThe `data_count` values are cumulative for the lifetime of a job.\nIf a model snapshot is reverted or old results are deleted, the job counts are not reset." forecasts_stats: allOf: - $ref: '#/components/schemas/ml._types.JobForecastStatistics' description: "An object that provides statistical information about forecasts belonging to this job.\nSome statistics are omitted if no forecasts have been made." job_id: type: string description: Identifier for the anomaly detection job. model_size_stats: allOf: - $ref: '#/components/schemas/ml._types.ModelSizeStats' description: An object that provides information about the size and contents of the model. node: allOf: - $ref: '#/components/schemas/ml._types.DiscoveryNodeCompact' description: "Contains properties for the node that runs the job.\nThis information is available only for open jobs." open_time: allOf: - $ref: '#/components/schemas/_types.DateTime' description: 'For open jobs only, the elapsed time for which the job has been open.' state: allOf: - $ref: '#/components/schemas/ml._types.JobState' description: "The status of the anomaly detection job, which can be one of the following values: `closed`, `closing`, `failed`, `opened`, `opening`.\n\nSupported values include:\n - `closing`: The job close action is in progress and has not yet completed. A closing job cannot accept further data.\n - `closed`: The job finished successfully with its model state persisted. The job must be opened before it can accept further data.\n - `opened`: The job is available to receive and process data.\n - `failed`: The job did not finish successfully due to an error.\nThis situation can occur due to invalid input data, a fatal error occurring during the analysis, or an external interaction such as the process being killed by the Linux out of memory (OOM) killer.\nIf the job had irrevocably failed, it must be force closed and then deleted.\nIf the datafeed can be corrected, the job can be closed and then re-opened.\n - `opening`: The job open action is in progress and has not yet completed.\n\n" timing_stats: allOf: - $ref: '#/components/schemas/ml._types.JobTimingStats' description: An object that provides statistical information about timing aspect of this job. deleting: type: boolean description: Indicates that the process of deleting the job is in progress but not yet completed. It is only reported when `true`. ml._types.DataCounts: required: - bucket_count - empty_bucket_count - input_bytes - input_field_count - input_record_count - invalid_date_count - job_id - missing_field_count - out_of_order_timestamp_count - processed_field_count - processed_record_count - sparse_bucket_count type: object properties: bucket_count: type: number earliest_record_timestamp: type: number empty_bucket_count: type: number input_bytes: type: number input_field_count: type: number input_record_count: type: number invalid_date_count: type: number job_id: allOf: - $ref: '#/components/schemas/_types.Id' last_data_time: type: number latest_empty_bucket_timestamp: type: number latest_record_timestamp: type: number latest_sparse_bucket_timestamp: type: number latest_bucket_timestamp: type: number log_time: type: number missing_field_count: type: number out_of_order_timestamp_count: type: number processed_field_count: type: number processed_record_count: type: number sparse_bucket_count: type: number ml._types.JobForecastStatistics: required: - total - forecasted_jobs type: object properties: memory_bytes: allOf: - $ref: '#/components/schemas/ml._types.JobStatistics' processing_time_ms: allOf: - $ref: '#/components/schemas/ml._types.JobStatistics' records: allOf: - $ref: '#/components/schemas/ml._types.JobStatistics' status: type: object additionalProperties: type: number total: type: number forecasted_jobs: type: number ml._types.JobStatistics: required: - avg - max - min - total type: object properties: avg: type: number max: type: number min: type: number total: type: number ml._types.ModelSizeStats: required: - bucket_allocation_failures_count - job_id - log_time - memory_status - model_bytes - result_type - total_by_field_count - total_over_field_count - total_partition_field_count - categorization_status - categorized_doc_count - dead_category_count - failed_category_count - frequent_category_count - rare_category_count - total_category_count type: object properties: bucket_allocation_failures_count: type: number job_id: allOf: - $ref: '#/components/schemas/_types.Id' log_time: allOf: - $ref: '#/components/schemas/_types.DateTime' memory_status: allOf: - $ref: '#/components/schemas/ml._types.MemoryStatus' model_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' model_bytes_exceeded: allOf: - $ref: '#/components/schemas/_types.ByteSize' model_bytes_memory_limit: allOf: - $ref: '#/components/schemas/_types.ByteSize' output_memory_allocator_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' peak_model_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' assignment_memory_basis: type: string result_type: type: string total_by_field_count: type: number total_over_field_count: type: number total_partition_field_count: type: number categorization_status: allOf: - $ref: '#/components/schemas/ml._types.CategorizationStatus' categorized_doc_count: type: number dead_category_count: type: number failed_category_count: type: number frequent_category_count: type: number rare_category_count: type: number total_category_count: type: number timestamp: type: number ml._types.JobTimingStats: required: - bucket_count - exponential_average_bucket_processing_time_per_hour_ms - job_id - total_bucket_processing_time_ms type: object properties: average_bucket_processing_time_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitFloatMillis' bucket_count: type: number exponential_average_bucket_processing_time_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitFloatMillis' exponential_average_bucket_processing_time_per_hour_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitFloatMillis' job_id: allOf: - $ref: '#/components/schemas/_types.Id' total_bucket_processing_time_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitFloatMillis' maximum_bucket_processing_time_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitFloatMillis' minimum_bucket_processing_time_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitFloatMillis' ml._types.Job: required: - allow_lazy_open - analysis_config - data_description - job_id - model_snapshot_retention_days - results_index_name type: object properties: allow_lazy_open: type: boolean description: "Advanced configuration option.\nSpecifies whether this job can open when there is insufficient machine learning node capacity for it to be immediately assigned to a node." analysis_config: allOf: - $ref: '#/components/schemas/ml._types.AnalysisConfig' description: "The analysis configuration, which specifies how to analyze the data.\nAfter you create a job, you cannot change the analysis configuration; all the properties are informational." analysis_limits: allOf: - $ref: '#/components/schemas/ml._types.AnalysisLimits' description: "Limits can be applied for the resources required to hold the mathematical models in memory.\nThese limits are approximate and can be set per job.\nThey do not control the memory used by other processes, for example the Elasticsearch Java processes." background_persist_interval: allOf: - $ref: '#/components/schemas/_types.Duration' description: "Advanced configuration option.\nThe time between each periodic persistence of the model.\nThe default value is a randomized value between 3 to 4 hours, which avoids all jobs persisting at exactly the same time.\nThe smallest allowed value is 1 hour." blocked: allOf: - $ref: '#/components/schemas/ml._types.JobBlocked' create_time: allOf: - $ref: '#/components/schemas/_types.DateTime' custom_settings: allOf: - $ref: '#/components/schemas/ml._types.CustomSettings' description: "Advanced configuration option.\nContains custom metadata about the job." daily_model_snapshot_retention_after_days: type: number description: "Advanced configuration option, which affects the automatic removal of old model snapshots for this job.\nIt specifies a period of time (in days) after which only the first snapshot per day is retained.\nThis period is relative to the timestamp of the most recent snapshot for this job.\nValid values range from 0 to `model_snapshot_retention_days`." default: 1 data_description: allOf: - $ref: '#/components/schemas/ml._types.DataDescription' description: "The data description defines the format of the input data when you send data to the job by using the post data API.\nNote that when configuring a datafeed, these properties are automatically set.\nWhen data is received via the post data API, it is not stored in Elasticsearch.\nOnly the results for anomaly detection are retained." datafeed_config: allOf: - $ref: '#/components/schemas/ml._types.Datafeed' description: "The datafeed, which retrieves data from Elasticsearch for analysis by the job.\nYou can associate only one datafeed with each anomaly detection job." deleting: type: boolean description: "Indicates that the process of deleting the job is in progress but not yet completed.\nIt is only reported when `true`." description: type: string description: A description of the job. finished_time: allOf: - $ref: '#/components/schemas/_types.DateTime' description: "If the job closed or failed, this is the time the job finished, otherwise it is `null`.\nThis property is informational; you cannot change its value." groups: type: array items: type: string description: "A list of job groups.\nA job can belong to no groups or many." job_id: allOf: - $ref: '#/components/schemas/_types.Id' description: "Identifier for the anomaly detection job.\nThis identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.\nIt must start and end with alphanumeric characters." job_type: type: string description: 'Reserved for future use, currently set to `anomaly_detector`.' job_version: allOf: - $ref: '#/components/schemas/_types.VersionString' description: The machine learning configuration version number at which the the job was created. model_plot_config: allOf: - $ref: '#/components/schemas/ml._types.ModelPlotConfig' description: "This advanced configuration option stores model information along with the results.\nIt provides a more detailed view into anomaly detection.\nModel plot provides a simplified and indicative view of the model and its bounds." model_snapshot_id: allOf: - $ref: '#/components/schemas/_types.Id' model_snapshot_retention_days: type: number description: "Advanced configuration option, which affects the automatic removal of old model snapshots for this job.\nIt specifies the maximum period of time (in days) that snapshots are retained.\nThis period is relative to the timestamp of the most recent snapshot for this job.\nBy default, snapshots ten days older than the newest snapshot are deleted." renormalization_window_days: type: number description: "Advanced configuration option.\nThe period over which adjustments to the score are applied, as new data is seen.\nThe default value is the longer of 30 days or 100 `bucket_spans`." results_index_name: allOf: - $ref: '#/components/schemas/_types.IndexName' description: "A text string that affects the name of the machine learning results index.\nThe default value is `shared`, which generates an index named `.ml-anomalies-shared`." results_retention_days: type: number description: "Advanced configuration option.\nThe period of time (in days) that results are retained.\nAge is calculated relative to the timestamp of the latest bucket result.\nIf this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch.\nThe default value is null, which means all results are retained.\nAnnotations generated by the system also count as results for retention purposes; they are deleted after the same number of days as results.\nAnnotations added by users are retained forever." ml._types.AnalysisLimits: type: object properties: categorization_examples_limit: type: number description: 'The maximum number of examples stored per category in memory and in the results data store. If you increase this value, more examples are available, however it requires that you have more storage available. If you set this value to 0, no examples are stored. NOTE: The `categorization_examples_limit` applies only to analysis that uses categorization.' default: 4 model_memory_limit: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: 'The approximate maximum amount of memory resources that are required for analytical processing. Once this limit is approached, data pruning becomes more aggressive. Upon exceeding this limit, new entities are not modeled. If the `xpack.ml.max_model_memory_limit` setting has a value greater than 0 and less than 1024mb, that value is used instead of the default. The default value is relatively small to ensure that high resource usage is a conscious decision. If you have jobs that are expected to analyze high cardinality fields, you will likely need to use a higher value. If you specify a number instead of a string, the units are assumed to be MiB. Specifying a string is recommended for clarity. If you specify a byte size unit of `b` or `kb` and the number does not equate to a discrete number of megabytes, it is rounded down to the closest MiB. The minimum valid value is 1 MiB. If you specify a value less than 1 MiB, an error occurs. If you specify a value for the `xpack.ml.max_model_memory_limit` setting, an error occurs when you try to create jobs that have `model_memory_limit` values greater than that setting value.' default: 1024mb ml._types.JobBlocked: required: - reason type: object properties: reason: allOf: - $ref: '#/components/schemas/ml._types.JobBlockedReason' task_id: allOf: - $ref: '#/components/schemas/_types.TaskId' ml._types.JobBlockedReason: enum: - delete - reset - revert type: string ml._types.CustomSettings: type: object description: Custom metadata about the job ml._types.DataDescription: type: object properties: format: type: string description: Only JSON format is supported at this time. time_field: allOf: - $ref: '#/components/schemas/_types.Field' description: The name of the field that contains the timestamp. default: time time_format: type: string description: 'The time format, which can be `epoch`, `epoch_ms`, or a custom pattern. The value `epoch` refers to UNIX or Epoch time (the number of seconds since 1 Jan 1970). The value `epoch_ms` indicates that time is measured in milliseconds since the epoch. The `epoch` and `epoch_ms` time formats accept either integer or real values. Custom patterns must conform to the Java DateTimeFormatter class. When you use date-time formatting patterns, it is recommended that you provide the full date, time and time zone. For example: `yyyy-MM-dd''T''HH:mm:ssX`. If the pattern that you specify is not sufficient to produce a complete timestamp, job creation fails.' default: epoch field_delimiter: type: string ml._types.ModelPlotConfig: type: object properties: annotations_enabled: type: boolean description: 'If true, enables calculation and storage of the model change annotations for each entity that is being analyzed.' default: true x-state: Generally available; Added in 7.9.0 enabled: type: boolean description: 'If true, enables calculation and storage of the model bounds for each entity that is being analyzed.' default: false terms: allOf: - $ref: '#/components/schemas/_types.Field' description: 'Limits data collection to this comma separated list of partition or by field values. If terms are not specified or it is an empty string, no filtering is applied. Wildcards are not supported. Only the specified terms can be viewed when using the Single Metric Viewer.' x-state: Generally available; Added in 7.9.0 ml.get_memory_stats.Memory: required: - attributes - jvm - mem - name - roles - transport_address - ephemeral_id type: object properties: attributes: type: object additionalProperties: type: string jvm: allOf: - $ref: '#/components/schemas/ml.get_memory_stats.JvmStats' description: Contains Java Virtual Machine (JVM) statistics for the node. mem: allOf: - $ref: '#/components/schemas/ml.get_memory_stats.MemStats' description: Contains statistics about memory usage for the node. name: allOf: - $ref: '#/components/schemas/_types.Name' description: Human-readable identifier for the node. Based on the Node name setting setting. roles: type: array items: type: string description: Roles assigned to the node. transport_address: allOf: - $ref: '#/components/schemas/_types.TransportAddress' description: The host and port where transport HTTP connections are accepted. ephemeral_id: allOf: - $ref: '#/components/schemas/_types.Id' ml.get_memory_stats.JvmStats: required: - heap_max_in_bytes - java_inference_in_bytes - java_inference_max_in_bytes type: object properties: heap_max: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Maximum amount of memory available for use by the heap. heap_max_in_bytes: type: number description: 'Maximum amount of memory, in bytes, available for use by the heap.' java_inference: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Amount of Java heap currently being used for caching inference models. java_inference_in_bytes: type: number description: 'Amount of Java heap, in bytes, currently being used for caching inference models.' java_inference_max: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Maximum amount of Java heap to be used for caching inference models. java_inference_max_in_bytes: type: number description: 'Maximum amount of Java heap, in bytes, to be used for caching inference models.' ml.get_memory_stats.MemStats: required: - adjusted_total_in_bytes - total_in_bytes - ml type: object properties: adjusted_total: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "If the amount of physical memory has been overridden using the es.total_memory_bytes system property\nthen this reports the overridden value. Otherwise it reports the same value as total." adjusted_total_in_bytes: type: number description: "If the amount of physical memory has been overridden using the `es.total_memory_bytes` system property\nthen this reports the overridden value in bytes. Otherwise it reports the same value as `total_in_bytes`." total: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Total amount of physical memory. total_in_bytes: type: number description: Total amount of physical memory in bytes. ml: allOf: - $ref: '#/components/schemas/ml.get_memory_stats.MemMlStats' description: Contains statistics about machine learning use of native memory on the node. ml.get_memory_stats.MemMlStats: required: - anomaly_detectors_in_bytes - data_frame_analytics_in_bytes - max_in_bytes - native_code_overhead_in_bytes - native_inference_in_bytes type: object properties: anomaly_detectors: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Amount of native memory set aside for anomaly detection jobs. anomaly_detectors_in_bytes: type: number description: 'Amount of native memory, in bytes, set aside for anomaly detection jobs.' data_frame_analytics: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Amount of native memory set aside for data frame analytics jobs. data_frame_analytics_in_bytes: type: number description: 'Amount of native memory, in bytes, set aside for data frame analytics jobs.' max: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Maximum amount of native memory (separate to the JVM heap) that may be used by machine learning native processes. max_in_bytes: type: number description: 'Maximum amount of native memory (separate to the JVM heap), in bytes, that may be used by machine learning native processes.' native_code_overhead: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Amount of native memory set aside for loading machine learning native code shared libraries. native_code_overhead_in_bytes: type: number description: 'Amount of native memory, in bytes, set aside for loading machine learning native code shared libraries.' native_inference: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Amount of native memory set aside for trained models that have a PyTorch model_type. native_inference_in_bytes: type: number description: 'Amount of native memory, in bytes, set aside for trained models that have a PyTorch model_type.' ml._types.ModelSnapshotUpgrade: required: - job_id - snapshot_id - state - node - assignment_explanation type: object properties: job_id: allOf: - $ref: '#/components/schemas/_types.Id' snapshot_id: allOf: - $ref: '#/components/schemas/_types.Id' state: allOf: - $ref: '#/components/schemas/ml._types.SnapshotUpgradeState' node: allOf: - $ref: '#/components/schemas/ml._types.DiscoveryNode' assignment_explanation: type: string ml._types.SnapshotUpgradeState: enum: - loading_old_state - saving_new_state - stopped - failed type: string ml._types.DiscoveryNode: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/ml._types.DiscoveryNodeContent' ml._types.DiscoveryNodeContent: required: - ephemeral_id - transport_address - external_id - attributes - roles - version - min_index_version - max_index_version type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' ephemeral_id: allOf: - $ref: '#/components/schemas/_types.Id' transport_address: allOf: - $ref: '#/components/schemas/_types.TransportAddress' external_id: type: string attributes: type: object additionalProperties: type: string roles: type: array items: type: string version: allOf: - $ref: '#/components/schemas/_types.VersionString' min_index_version: type: number max_index_version: type: number ml._types.ModelSnapshot: required: - job_id - min_version - retain - snapshot_doc_count - snapshot_id - timestamp type: object properties: description: type: string description: An optional description of the job. job_id: allOf: - $ref: '#/components/schemas/_types.Id' description: A numerical character string that uniquely identifies the job that the snapshot was created for. latest_record_time_stamp: type: number description: The timestamp of the latest processed record. latest_result_time_stamp: type: number description: The timestamp of the latest bucket result. min_version: allOf: - $ref: '#/components/schemas/_types.VersionString' description: The minimum version required to be able to restore the model snapshot. model_size_stats: allOf: - $ref: '#/components/schemas/ml._types.ModelSizeStats' description: Summary information describing the model. retain: type: boolean description: 'If true, this snapshot will not be deleted during automatic cleanup of snapshots older than model_snapshot_retention_days. However, this snapshot will be deleted when the job is deleted. The default value is false.' snapshot_doc_count: type: number description: For internal use only. snapshot_id: allOf: - $ref: '#/components/schemas/_types.Id' description: A numerical character string that uniquely identifies the model snapshot. timestamp: type: number description: The creation timestamp for the snapshot. ml._types.OverallBucket: required: - bucket_span - is_interim - jobs - overall_score - result_type - timestamp type: object properties: bucket_span: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitSeconds' description: The length of the bucket in seconds. Matches the job with the longest bucket_span value. is_interim: type: boolean description: 'If true, this is an interim result. In other words, the results are calculated based on partial input data.' jobs: type: array items: $ref: '#/components/schemas/ml._types.OverallBucketJob' description: An array of objects that contain the max_anomaly_score per job_id. overall_score: type: number description: The top_n average of the maximum bucket anomaly_score per job. result_type: type: string description: Internal. This is always set to overall_bucket. timestamp: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: The start time of the bucket for which these results were calculated. timestamp_string: allOf: - $ref: '#/components/schemas/_types.DateTime' description: The start time of the bucket for which these results were calculated. ml._types.OverallBucketJob: required: - job_id - max_anomaly_score type: object properties: job_id: allOf: - $ref: '#/components/schemas/_types.Id' max_anomaly_score: type: number ml._types.Anomaly: required: - bucket_span - detector_index - initial_record_score - is_interim - job_id - probability - record_score - result_type - timestamp type: object properties: actual: type: array items: type: number description: The actual value for the bucket. anomaly_score_explanation: allOf: - $ref: '#/components/schemas/ml._types.AnomalyExplanation' description: Information about the factors impacting the initial anomaly score. bucket_span: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitSeconds' description: The length of the bucket in seconds. This value matches the `bucket_span` that is specified in the job. by_field_name: type: string description: 'The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split.' by_field_value: type: string description: The value of `by_field_name`. causes: type: array items: $ref: '#/components/schemas/ml._types.AnomalyCause' description: 'For population analysis, an over field must be specified in the detector. This property contains an array of anomaly records that are the causes for the anomaly that has been identified for the over field. This sub-resource contains the most anomalous records for the `over_field_name`. For scalability reasons, a maximum of the 10 most significant causes of the anomaly are returned. As part of the core analytical modeling, these low-level anomaly records are aggregated for their parent over field record. The `causes` resource contains similar elements to the record resource, namely `actual`, `typical`, `geo_results.actual_point`, `geo_results.typical_point`, `*_field_name` and `*_field_value`. Probability and scores are not applicable to causes.' detector_index: type: number description: A unique identifier for the detector. field_name: type: string description: 'Certain functions require a field to operate on, for example, `sum()`. For those functions, this value is the name of the field to be analyzed.' function: type: string description: 'The function in which the anomaly occurs, as specified in the detector configuration. For example, `max`.' function_description: type: string description: 'The description of the function in which the anomaly occurs, as specified in the detector configuration.' geo_results: allOf: - $ref: '#/components/schemas/ml._types.GeoResults' description: 'If the detector function is `lat_long`, this object contains comma delimited strings for the latitude and longitude of the actual and typical values.' influencers: type: array items: $ref: '#/components/schemas/ml._types.Influence' description: 'If influencers were specified in the detector configuration, this array contains influencers that contributed to or were to blame for an anomaly.' initial_record_score: type: number description: 'A normalized score between 0-100, which is based on the probability of the anomalousness of this record. This is the initial value that was calculated at the time the bucket was processed.' is_interim: type: boolean description: 'If true, this is an interim result. In other words, the results are calculated based on partial input data.' job_id: type: string description: Identifier for the anomaly detection job. over_field_name: type: string description: 'The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits.' over_field_value: type: string description: The value of `over_field_name`. partition_field_name: type: string description: 'The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field.' partition_field_value: type: string description: The value of `partition_field_name`. probability: type: number description: 'The probability of the individual anomaly occurring, in the range 0 to 1. For example, `0.0000772031`. This value can be held to a high precision of over 300 decimal places, so the `record_score` is provided as a human-readable and friendly interpretation of this.' record_score: type: number description: 'A normalized score between 0-100, which is based on the probability of the anomalousness of this record. Unlike `initial_record_score`, this value will be updated by a re-normalization process as new data is analyzed.' result_type: type: string description: Internal. This is always set to `record`. timestamp: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: The start time of the bucket for which these results were calculated. typical: type: array items: type: number description: 'The typical value for the bucket, according to analytical modeling.' ml._types.AnomalyExplanation: type: object properties: anomaly_characteristics_impact: type: number description: Impact from the duration and magnitude of the detected anomaly relative to the historical average. anomaly_length: type: number description: Length of the detected anomaly in the number of buckets. anomaly_type: type: string description: 'Type of the detected anomaly: `spike` or `dip`.' high_variance_penalty: type: boolean description: 'Indicates reduction of anomaly score for the bucket with large confidence intervals. If a bucket has large confidence intervals, the score is reduced.' incomplete_bucket_penalty: type: boolean description: 'If the bucket contains fewer samples than expected, the score is reduced.' lower_confidence_bound: type: number description: Lower bound of the 95% confidence interval. multi_bucket_impact: type: number description: Impact of the deviation between actual and typical values in the past 12 buckets. single_bucket_impact: type: number description: Impact of the deviation between actual and typical values in the current bucket. typical_value: type: number description: Typical (expected) value for this bucket. upper_confidence_bound: type: number description: Upper bound of the 95% confidence interval. ml._types.AnomalyCause: required: - probability type: object properties: actual: type: array items: type: number by_field_name: allOf: - $ref: '#/components/schemas/_types.Name' by_field_value: type: string correlated_by_field_value: type: string field_name: allOf: - $ref: '#/components/schemas/_types.Field' function: type: string function_description: type: string geo_results: allOf: - $ref: '#/components/schemas/ml._types.GeoResults' influencers: type: array items: $ref: '#/components/schemas/ml._types.Influence' over_field_name: allOf: - $ref: '#/components/schemas/_types.Name' over_field_value: type: string partition_field_name: type: string partition_field_value: type: string probability: type: number typical: type: array items: type: number ml._types.GeoResults: type: object properties: actual_point: type: string description: The actual value for the bucket formatted as a `geo_point`. typical_point: type: string description: The typical value for the bucket formatted as a `geo_point`. ml._types.Influence: required: - influencer_field_name - influencer_field_values type: object properties: influencer_field_name: type: string influencer_field_values: type: array items: type: string ml._types.Include: enum: - definition - feature_importance_baseline - hyperparameters - total_feature_importance - definition_status type: string ml._types.TrainedModelConfig: required: - model_id - tags - input type: object properties: model_id: allOf: - $ref: '#/components/schemas/_types.Id' description: Identifier for the trained model. model_type: allOf: - $ref: '#/components/schemas/ml._types.TrainedModelType' description: "The model type\n\nSupported values include:\n - `tree_ensemble`: The model definition is an ensemble model of decision trees.\n - `lang_ident`: A special type reserved for language identification models.\n - `pytorch`: The stored definition is a PyTorch (specifically a TorchScript) model.\nCurrently only NLP models are supported.\n\n" tags: type: array items: type: string description: 'A comma delimited string of tags. A trained model can have many tags, or none.' version: allOf: - $ref: '#/components/schemas/_types.VersionString' description: The Elasticsearch version number in which the trained model was created. compressed_definition: type: string created_by: type: string description: Information on the creator of the trained model. create_time: allOf: - $ref: '#/components/schemas/_types.DateTime' description: The time when the trained model was created. default_field_map: type: object additionalProperties: type: string description: Any field map described in the inference configuration takes precedence. description: type: string description: The free-text description of the trained model. estimated_heap_memory_usage_bytes: type: number description: The estimated heap usage in bytes to keep the trained model in memory. estimated_operations: type: number description: The estimated number of operations to use the trained model. fully_defined: type: boolean description: True if the full model definition is present. inference_config: allOf: - $ref: '#/components/schemas/ml._types.InferenceConfigCreateContainer' description: 'The default configuration for inference. This can be either a regression, classification, or one of the many NLP focused configurations. It must match the underlying definition.trained_model''s target_type. For pre-packaged models such as ELSER the config is not required.' input: allOf: - $ref: '#/components/schemas/ml._types.TrainedModelConfigInput' description: The input field names for the model definition. license_level: type: string description: The license level of the trained model. metadata: allOf: - $ref: '#/components/schemas/ml._types.TrainedModelConfigMetadata' description: 'An object containing metadata about the trained model. For example, models created by data frame analytics contain analysis_config and input objects.' model_size_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' model_package: allOf: - $ref: '#/components/schemas/ml._types.ModelPackageConfig' location: allOf: - $ref: '#/components/schemas/ml._types.TrainedModelLocation' platform_architecture: type: string prefix_strings: allOf: - $ref: '#/components/schemas/ml._types.TrainedModelPrefixStrings' ml._types.TrainedModelType: enum: - tree_ensemble - lang_ident - pytorch type: string ml._types.InferenceConfigCreateContainer: maxProperties: 1 minProperties: 1 type: object properties: regression: allOf: - $ref: '#/components/schemas/ml._types.RegressionInferenceOptions' description: Regression configuration for inference. classification: allOf: - $ref: '#/components/schemas/ml._types.ClassificationInferenceOptions' description: Classification configuration for inference. text_classification: allOf: - $ref: '#/components/schemas/ml._types.TextClassificationInferenceOptions' description: Text classification configuration for inference. x-state: Generally available; Added in 8.0.0 zero_shot_classification: allOf: - $ref: '#/components/schemas/ml._types.ZeroShotClassificationInferenceOptions' description: Zeroshot classification configuration for inference. x-state: Generally available; Added in 8.0.0 fill_mask: allOf: - $ref: '#/components/schemas/ml._types.FillMaskInferenceOptions' description: Fill mask configuration for inference. x-state: Generally available; Added in 8.0.0 learning_to_rank: allOf: - $ref: '#/components/schemas/ml._types.LearningToRankConfig' ner: allOf: - $ref: '#/components/schemas/ml._types.NerInferenceOptions' description: Named entity recognition configuration for inference. x-state: Generally available; Added in 8.0.0 pass_through: allOf: - $ref: '#/components/schemas/ml._types.PassThroughInferenceOptions' description: Pass through configuration for inference. x-state: Generally available; Added in 8.0.0 text_embedding: allOf: - $ref: '#/components/schemas/ml._types.TextEmbeddingInferenceOptions' description: Text embedding configuration for inference. x-state: Generally available; Added in 8.0.0 text_expansion: allOf: - $ref: '#/components/schemas/ml._types.TextExpansionInferenceOptions' description: Text expansion configuration for inference. x-state: Generally available; Added in 8.8.0 question_answering: allOf: - $ref: '#/components/schemas/ml._types.QuestionAnsweringInferenceOptions' description: Question answering configuration for inference. x-state: Generally available; Added in 8.3.0 description: Inference configuration provided when storing the model config ml._types.TextClassificationInferenceOptions: type: object properties: num_top_classes: type: number description: Specifies the number of top class predictions to return. Defaults to 0. tokenization: allOf: - $ref: '#/components/schemas/ml._types.TokenizationConfigContainer' description: The tokenization options results_field: type: string description: The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. classification_labels: type: array items: type: string description: Classification labels to apply other than the stored labels. Must have the same deminsions as the default configured labels vocabulary: allOf: - $ref: '#/components/schemas/ml._types.Vocabulary' description: Text classification configuration options ml._types.TokenizationConfigContainer: maxProperties: 1 minProperties: 1 type: object properties: bert: allOf: - $ref: '#/components/schemas/ml._types.NlpBertTokenizationConfig' description: Indicates BERT tokenization and its options bert_ja: allOf: - $ref: '#/components/schemas/ml._types.NlpBertTokenizationConfig' description: Indicates BERT Japanese tokenization and its options mpnet: allOf: - $ref: '#/components/schemas/ml._types.NlpBertTokenizationConfig' description: Indicates MPNET tokenization and its options x-state: Generally available; Added in 8.1.0 roberta: allOf: - $ref: '#/components/schemas/ml._types.NlpRobertaTokenizationConfig' description: Indicates RoBERTa tokenization and its options x-state: Generally available; Added in 8.2.0 xlm_roberta: allOf: - $ref: '#/components/schemas/ml._types.XlmRobertaTokenizationConfig' description: Tokenization options stored in inference configuration ml._types.NlpBertTokenizationConfig: allOf: - $ref: '#/components/schemas/ml._types.CommonTokenizationConfig' - type: object description: BERT and MPNet tokenization configuration options ml._types.CommonTokenizationConfig: type: object properties: do_lower_case: type: boolean description: Should the tokenizer lower case the text default: false max_sequence_length: type: number description: Maximum input sequence length for the model default: 512 span: type: number description: Tokenization spanning options. Special value of -1 indicates no spanning takes place default: -1 truncate: allOf: - $ref: '#/components/schemas/ml._types.TokenizationTruncate' description: Should tokenization input be automatically truncated before sending to the model for inference default: first with_special_tokens: type: boolean description: Is tokenization completed with special tokens default: true ml._types.TokenizationTruncate: enum: - first - second - none type: string ml._types.NlpRobertaTokenizationConfig: allOf: - $ref: '#/components/schemas/ml._types.CommonTokenizationConfig' - type: object properties: add_prefix_space: type: boolean description: Should the tokenizer prefix input with a space character default: false description: RoBERTa tokenization configuration options ml._types.XlmRobertaTokenizationConfig: allOf: - $ref: '#/components/schemas/ml._types.CommonTokenizationConfig' - type: object ml._types.Vocabulary: required: - index type: object properties: index: allOf: - $ref: '#/components/schemas/_types.IndexName' ml._types.ZeroShotClassificationInferenceOptions: required: - classification_labels type: object properties: tokenization: allOf: - $ref: '#/components/schemas/ml._types.TokenizationConfigContainer' description: The tokenization options to update when inferring hypothesis_template: type: string description: Hypothesis template used when tokenizing labels for prediction default: '"This example is {}."' classification_labels: type: array items: type: string description: "The zero shot classification labels indicating entailment, neutral, and contradiction\nMust contain exactly and only entailment, neutral, and contradiction" results_field: type: string description: The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. multi_label: type: boolean description: Indicates if more than one true label exists. default: false labels: type: array items: type: string description: The labels to predict. description: Zero shot classification configuration options ml._types.FillMaskInferenceOptions: type: object properties: mask_token: type: string description: "The string/token which will be removed from incoming documents and replaced with the inference prediction(s).\nIn a response, this field contains the mask token for the specified model/tokenizer. Each model and tokenizer\nhas a predefined mask token which cannot be changed. Thus, it is recommended not to set this value in requests.\nHowever, if this field is present in a request, its value must match the predefined value for that model/tokenizer,\notherwise the request will fail." num_top_classes: type: number description: Specifies the number of top class predictions to return. Defaults to 0. tokenization: allOf: - $ref: '#/components/schemas/ml._types.TokenizationConfigContainer' description: The tokenization options to update when inferring results_field: type: string description: The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. vocabulary: allOf: - $ref: '#/components/schemas/ml._types.Vocabulary' description: Fill mask inference options ml._types.LearningToRankConfig: required: - num_top_feature_importance_values type: object properties: default_params: type: object additionalProperties: type: object feature_extractors: type: array items: type: object additionalProperties: $ref: '#/components/schemas/ml._types.FeatureExtractor' num_top_feature_importance_values: type: number ml._types.FeatureExtractor: allOf: - $ref: '#/components/schemas/ml._types.QueryFeatureExtractor' ml._types.QueryFeatureExtractor: required: - feature_name - query type: object properties: default_score: type: number feature_name: type: string query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' ml._types.NerInferenceOptions: type: object properties: tokenization: allOf: - $ref: '#/components/schemas/ml._types.TokenizationConfigContainer' description: The tokenization options results_field: type: string description: The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. classification_labels: type: array items: type: string description: The token classification labels. Must be IOB formatted tags vocabulary: allOf: - $ref: '#/components/schemas/ml._types.Vocabulary' description: Named entity recognition options ml._types.PassThroughInferenceOptions: type: object properties: tokenization: allOf: - $ref: '#/components/schemas/ml._types.TokenizationConfigContainer' description: The tokenization options results_field: type: string description: The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. vocabulary: allOf: - $ref: '#/components/schemas/ml._types.Vocabulary' description: Pass through configuration options ml._types.TextEmbeddingInferenceOptions: type: object properties: embedding_size: type: number description: The number of dimensions in the embedding output tokenization: allOf: - $ref: '#/components/schemas/ml._types.TokenizationConfigContainer' description: The tokenization options results_field: type: string description: The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. vocabulary: allOf: - $ref: '#/components/schemas/ml._types.Vocabulary' description: Text embedding inference options ml._types.TextExpansionInferenceOptions: type: object properties: tokenization: allOf: - $ref: '#/components/schemas/ml._types.TokenizationConfigContainer' description: The tokenization options results_field: type: string description: The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. vocabulary: allOf: - $ref: '#/components/schemas/ml._types.Vocabulary' description: Text expansion inference options ml._types.QuestionAnsweringInferenceOptions: type: object properties: num_top_classes: type: number description: Specifies the number of top class predictions to return. Defaults to 0. tokenization: allOf: - $ref: '#/components/schemas/ml._types.TokenizationConfigContainer' description: The tokenization options to update when inferring results_field: type: string description: The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. max_answer_length: type: number description: The maximum answer length to consider description: Question answering inference options ml._types.TrainedModelConfigInput: required: - field_names type: object properties: field_names: type: array items: $ref: '#/components/schemas/_types.Field' description: An array of input field names for the model. ml._types.TrainedModelConfigMetadata: type: object properties: model_aliases: type: array items: type: string feature_importance_baseline: type: object additionalProperties: type: string description: 'An object that contains the baseline for feature importance values. For regression analysis, it is a single value. For classification analysis, there is a value for each class.' hyperparameters: type: array items: $ref: '#/components/schemas/ml._types.Hyperparameter' description: List of the available hyperparameters optimized during the fine_parameter_tuning phase as well as specified by the user. total_feature_importance: type: array items: $ref: '#/components/schemas/ml._types.TotalFeatureImportance' description: An array of the total feature importance for each feature used from the training data set. This array of objects is returned if data frame analytics trained the model and the request includes total_feature_importance in the include request parameter. ml._types.Hyperparameter: required: - name - supplied - value type: object properties: absolute_importance: type: number description: A positive number showing how much the parameter influences the variation of the loss function. For hyperparameters with values that are not specified by the user but tuned during hyperparameter optimization. name: allOf: - $ref: '#/components/schemas/_types.Name' description: Name of the hyperparameter. relative_importance: type: number description: A number between 0 and 1 showing the proportion of influence on the variation of the loss function among all tuned hyperparameters. For hyperparameters with values that are not specified by the user but tuned during hyperparameter optimization. supplied: type: boolean description: Indicates if the hyperparameter is specified by the user (true) or optimized (false). value: type: number description: 'The value of the hyperparameter, either optimized or specified by the user.' ml._types.TotalFeatureImportance: required: - feature_name - importance - classes type: object properties: feature_name: allOf: - $ref: '#/components/schemas/_types.Name' description: The feature for which this importance was calculated. importance: type: array items: $ref: '#/components/schemas/ml._types.TotalFeatureImportanceStatistics' description: A collection of feature importance statistics related to the training data set for this particular feature. classes: type: array items: $ref: '#/components/schemas/ml._types.TotalFeatureImportanceClass' description: 'If the trained model is a classification model, feature importance statistics are gathered per target class value.' ml._types.TotalFeatureImportanceStatistics: required: - mean_magnitude - max - min type: object properties: mean_magnitude: type: number description: The average magnitude of this feature across all the training data. This value is the average of the absolute values of the importance for this feature. max: type: number description: The maximum importance value across all the training data for this feature. min: type: number description: The minimum importance value across all the training data for this feature. ml._types.TotalFeatureImportanceClass: required: - class_name - importance type: object properties: class_name: allOf: - $ref: '#/components/schemas/_types.Name' description: 'The target class value. Could be a string, boolean, or number.' importance: type: array items: $ref: '#/components/schemas/ml._types.TotalFeatureImportanceStatistics' description: A collection of feature importance statistics related to the training data set for this particular feature. ml._types.ModelPackageConfig: required: - packaged_model_id type: object properties: create_time: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: type: string inference_config: type: object additionalProperties: type: object metadata: allOf: - $ref: '#/components/schemas/_types.Metadata' minimum_version: type: string model_repository: type: string model_type: type: string packaged_model_id: allOf: - $ref: '#/components/schemas/_types.Id' platform_architecture: type: string prefix_strings: allOf: - $ref: '#/components/schemas/ml._types.TrainedModelPrefixStrings' size: allOf: - $ref: '#/components/schemas/_types.ByteSize' sha256: type: string tags: type: array items: type: string vocabulary_file: type: string ml._types.TrainedModelPrefixStrings: type: object properties: ingest: type: string description: String prepended to input at ingest search: type: string description: String prepended to input at search ml._types.TrainedModelLocation: required: - index type: object properties: index: allOf: - $ref: '#/components/schemas/ml._types.TrainedModelLocationIndex' ml._types.TrainedModelLocationIndex: required: - name type: object properties: name: allOf: - $ref: '#/components/schemas/_types.IndexName' ml._types.TrainedModelStats: required: - model_id - model_size_stats - pipeline_count type: object properties: deployment_stats: allOf: - $ref: '#/components/schemas/ml._types.TrainedModelDeploymentStats' description: 'A collection of deployment stats, which is present when the models are deployed.' inference_stats: allOf: - $ref: '#/components/schemas/ml._types.TrainedModelInferenceStats' description: A collection of inference stats fields. ingest: type: object additionalProperties: type: object description: "A collection of ingest stats for the model across all nodes.\nThe values are summations of the individual node statistics.\nThe format matches the ingest section in the nodes stats API." model_id: allOf: - $ref: '#/components/schemas/_types.Id' description: The unique identifier of the trained model. model_size_stats: allOf: - $ref: '#/components/schemas/ml._types.TrainedModelSizeStats' description: A collection of model size stats. pipeline_count: type: number description: The number of ingest pipelines that currently refer to the model. ml._types.TrainedModelDeploymentStats: required: - deployment_id - model_id - nodes - peak_throughput_per_minute - priority - start_time type: object properties: adaptive_allocations: allOf: - $ref: '#/components/schemas/ml._types.AdaptiveAllocationsSettings' allocation_status: allOf: - $ref: '#/components/schemas/ml._types.TrainedModelDeploymentAllocationStatus' description: The detailed allocation status for the deployment. cache_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' deployment_id: allOf: - $ref: '#/components/schemas/_types.Id' description: The unique identifier for the trained model deployment. error_count: type: number description: The sum of `error_count` for all nodes in the deployment. inference_count: type: number description: The sum of `inference_count` for all nodes in the deployment. model_id: allOf: - $ref: '#/components/schemas/_types.Id' description: The unique identifier for the trained model. nodes: type: array items: $ref: '#/components/schemas/ml._types.TrainedModelDeploymentNodesStats' description: "The deployment stats for each node that currently has the model allocated.\nIn serverless, stats are reported for a single unnamed virtual node." number_of_allocations: type: number description: The number of allocations requested. peak_throughput_per_minute: type: number priority: allOf: - $ref: '#/components/schemas/ml._types.TrainingPriority' queue_capacity: type: number description: The number of inference requests that can be queued before new requests are rejected. rejected_execution_count: type: number description: "The sum of `rejected_execution_count` for all nodes in the deployment.\nIndividual nodes reject an inference request if the inference queue is full.\nThe queue size is controlled by the `queue_capacity` setting in the start\ntrained model deployment API." reason: type: string description: "The reason for the current deployment state. Usually only populated when\nthe model is not deployed to a node." start_time: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: The epoch timestamp when the deployment started. state: allOf: - $ref: '#/components/schemas/ml._types.DeploymentAssignmentState' description: "The overall state of the deployment.\n\nSupported values include:\n - `started`: The deployment is usable; at least one node has the model allocated.\n - `starting`: The deployment has recently started but is not yet usable; the model is not allocated on any nodes.\n - `stopping`: The deployment is preparing to stop and deallocate the model from the relevant nodes.\n - `failed`: The deployment is on a failed state and must be re-deployed.\n\n" threads_per_allocation: type: number description: The number of threads used be each allocation during inference. timeout_count: type: number description: The sum of `timeout_count` for all nodes in the deployment. ml._types.AdaptiveAllocationsSettings: required: - enabled type: object properties: enabled: type: boolean description: 'If true, adaptive_allocations is enabled' min_number_of_allocations: type: number description: "Specifies the minimum number of allocations to scale to.\nIf set, it must be greater than or equal to 0.\nIf not defined, the deployment scales to 0." max_number_of_allocations: type: number description: "Specifies the maximum number of allocations to scale to.\nIf set, it must be greater than or equal to min_number_of_allocations." ml._types.TrainedModelDeploymentAllocationStatus: required: - allocation_count - state - target_allocation_count type: object properties: allocation_count: type: number description: The current number of nodes where the model is allocated. state: allOf: - $ref: '#/components/schemas/ml._types.DeploymentAllocationState' description: "The detailed allocation state related to the nodes.\n\nSupported values include:\n - `started`: The trained model is started on at least one node.\n - `starting`: Trained model deployment is starting but it is not yet deployed on any nodes.\n - `fully_allocated`: Trained model deployment has started on all valid nodes.\n\n" target_allocation_count: type: number description: The desired number of nodes for model allocation. ml._types.DeploymentAllocationState: enum: - started - starting - fully_allocated type: string ml._types.TrainedModelDeploymentNodesStats: required: - peak_throughput_per_minute - routing_state - throughput_last_minute type: object properties: average_inference_time_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitFloatMillis' description: The average time for each inference call to complete on this node. average_inference_time_ms_last_minute: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitFloatMillis' average_inference_time_ms_excluding_cache_hits: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitFloatMillis' description: 'The average time for each inference call to complete on this node, excluding cache' average_inference_process_memory_rss_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' error_count: type: number description: The number of errors when evaluating the trained model. inference_count: type: number description: The total number of inference calls made against this node for this model. inference_cache_hit_count: type: number inference_cache_hit_count_last_minute: type: number last_access: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: The epoch time stamp of the last inference call for the model on this node. node: allOf: - $ref: '#/components/schemas/ml._types.DiscoveryNode' description: Information pertaining to the node. number_of_allocations: type: number description: The number of allocations assigned to this node. number_of_pending_requests: type: number description: The number of inference requests queued to be processed. peak_throughput_per_minute: type: number rejected_execution_count: type: number description: The number of inference requests that were not processed because the queue was full. routing_state: allOf: - $ref: '#/components/schemas/ml._types.TrainedModelAssignmentRoutingStateAndReason' description: The current routing state and reason for the current routing state for this allocation. start_time: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: The epoch timestamp when the allocation started. threads_per_allocation: type: number description: The number of threads used by each allocation during inference. throughput_last_minute: type: number timeout_count: type: number description: The number of inference requests that timed out before being processed. ml._types.TrainedModelAssignmentRoutingStateAndReason: required: - routing_state type: object properties: reason: type: string description: "The reason for the current state. It is usually populated only when the\n`routing_state` is `failed`." routing_state: allOf: - $ref: '#/components/schemas/ml._types.RoutingState' description: "The current routing state.\n\nSupported values include:\n - `failed`: The allocation attempt failed.\n - `started`: The trained model is allocated and ready to accept inference requests.\n - `starting`: The trained model is attempting to allocate on this node; inference requests are not yet accepted.\n - `stopped`: The trained model is fully deallocated from this node.\n - `stopping`: The trained model is being deallocated from this node.\n\n" ml._types.RoutingState: enum: - failed - started - starting - stopped - stopping type: string ml._types.TrainingPriority: enum: - normal - low type: string ml._types.DeploymentAssignmentState: enum: - started - starting - stopping - failed type: string ml._types.TrainedModelInferenceStats: required: - cache_miss_count - failure_count - inference_count - missing_all_fields_count - timestamp type: object properties: cache_miss_count: type: number description: "The number of times the model was loaded for inference and was not retrieved from the cache.\nIf this number is close to the `inference_count`, the cache is not being appropriately used.\nThis can be solved by increasing the cache size or its time-to-live (TTL).\nRefer to general machine learning settings for the appropriate settings." failure_count: type: number description: The number of failures when using the model for inference. inference_count: type: number description: "The total number of times the model has been called for inference.\nThis is across all inference contexts, including all pipelines." missing_all_fields_count: type: number description: The number of inference calls where all the training features for the model were missing. timestamp: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: The time when the statistics were last updated. ml._types.TrainedModelSizeStats: required: - model_size_bytes - required_native_memory_bytes type: object properties: model_size_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The size of the model in bytes. required_native_memory_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The amount of memory required to load the model in bytes. ml._types.InferenceConfigUpdateContainer: maxProperties: 1 minProperties: 1 type: object properties: regression: allOf: - $ref: '#/components/schemas/ml._types.RegressionInferenceOptions' description: Regression configuration for inference. classification: allOf: - $ref: '#/components/schemas/ml._types.ClassificationInferenceOptions' description: Classification configuration for inference. text_classification: allOf: - $ref: '#/components/schemas/ml._types.TextClassificationInferenceUpdateOptions' description: Text classification configuration for inference. zero_shot_classification: allOf: - $ref: '#/components/schemas/ml._types.ZeroShotClassificationInferenceUpdateOptions' description: Zeroshot classification configuration for inference. fill_mask: allOf: - $ref: '#/components/schemas/ml._types.FillMaskInferenceUpdateOptions' description: Fill mask configuration for inference. ner: allOf: - $ref: '#/components/schemas/ml._types.NerInferenceUpdateOptions' description: Named entity recognition configuration for inference. pass_through: allOf: - $ref: '#/components/schemas/ml._types.PassThroughInferenceUpdateOptions' description: Pass through configuration for inference. text_embedding: allOf: - $ref: '#/components/schemas/ml._types.TextEmbeddingInferenceUpdateOptions' description: Text embedding configuration for inference. text_expansion: allOf: - $ref: '#/components/schemas/ml._types.TextExpansionInferenceUpdateOptions' description: Text expansion configuration for inference. question_answering: allOf: - $ref: '#/components/schemas/ml._types.QuestionAnsweringInferenceUpdateOptions' description: Question answering configuration for inference ml._types.TextClassificationInferenceUpdateOptions: type: object properties: num_top_classes: type: number description: Specifies the number of top class predictions to return. Defaults to 0. tokenization: allOf: - $ref: '#/components/schemas/ml._types.NlpTokenizationUpdateOptions' description: The tokenization options to update when inferring results_field: type: string description: The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. classification_labels: type: array items: type: string description: Classification labels to apply other than the stored labels. Must have the same deminsions as the default configured labels ml._types.NlpTokenizationUpdateOptions: type: object properties: truncate: allOf: - $ref: '#/components/schemas/ml._types.TokenizationTruncate' description: Truncate options to apply span: type: number description: Span options to apply ml._types.ZeroShotClassificationInferenceUpdateOptions: required: - labels type: object properties: tokenization: allOf: - $ref: '#/components/schemas/ml._types.NlpTokenizationUpdateOptions' description: The tokenization options to update when inferring results_field: type: string description: The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. multi_label: type: boolean description: Update the configured multi label option. Indicates if more than one true label exists. Defaults to the configured value. labels: type: array items: type: string description: The labels to predict. ml._types.FillMaskInferenceUpdateOptions: type: object properties: num_top_classes: type: number description: Specifies the number of top class predictions to return. Defaults to 0. tokenization: allOf: - $ref: '#/components/schemas/ml._types.NlpTokenizationUpdateOptions' description: The tokenization options to update when inferring results_field: type: string description: The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. ml._types.NerInferenceUpdateOptions: type: object properties: tokenization: allOf: - $ref: '#/components/schemas/ml._types.NlpTokenizationUpdateOptions' description: The tokenization options to update when inferring results_field: type: string description: The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. ml._types.PassThroughInferenceUpdateOptions: type: object properties: tokenization: allOf: - $ref: '#/components/schemas/ml._types.NlpTokenizationUpdateOptions' description: The tokenization options to update when inferring results_field: type: string description: The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. ml._types.TextEmbeddingInferenceUpdateOptions: type: object properties: tokenization: allOf: - $ref: '#/components/schemas/ml._types.NlpTokenizationUpdateOptions' results_field: type: string description: The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. ml._types.TextExpansionInferenceUpdateOptions: type: object properties: tokenization: allOf: - $ref: '#/components/schemas/ml._types.NlpTokenizationUpdateOptions' results_field: type: string description: The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. ml._types.QuestionAnsweringInferenceUpdateOptions: required: - question type: object properties: question: type: string description: The question to answer given the inference context num_top_classes: type: number description: Specifies the number of top class predictions to return. Defaults to 0. tokenization: allOf: - $ref: '#/components/schemas/ml._types.NlpTokenizationUpdateOptions' description: The tokenization options to update when inferring results_field: type: string description: The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. max_answer_length: type: number description: The maximum answer length to consider for extraction ml._types.InferenceResponseResult: type: object properties: entities: type: array items: $ref: '#/components/schemas/ml._types.TrainedModelEntities' description: 'If the model is trained for named entity recognition (NER) tasks, the response contains the recognized entities.' is_truncated: type: boolean description: "Indicates whether the input text was truncated to meet the model's maximum sequence length limit. This property\nis present only when it is true." predicted_value: oneOf: - $ref: '#/components/schemas/ml._types.PredictedValue' - type: array items: $ref: '#/components/schemas/ml._types.PredictedValue' description: "If the model is trained for a text classification or zero shot classification task, the response is the\npredicted class.\nFor named entity recognition (NER) tasks, it contains the annotated text output.\nFor fill mask tasks, it contains the top prediction for replacing the mask token.\nFor text embedding tasks, it contains the raw numerical text embedding values.\nFor regression models, its a numerical value\nFor classification models, it may be an integer, double, boolean or string depending on prediction type" predicted_value_sequence: type: string description: "For fill mask tasks, the response contains the input text sequence with the mask token replaced by the predicted\nvalue.\nAdditionally" prediction_probability: type: number description: Specifies a probability for the predicted value. prediction_score: type: number description: Specifies a confidence score for the predicted value. top_classes: type: array items: $ref: '#/components/schemas/ml._types.TopClassEntry' description: "For fill mask, text classification, and zero shot classification tasks, the response contains a list of top\nclass entries." warning: type: string description: 'If the request failed, the response contains the reason for the failure.' feature_importance: type: array items: $ref: '#/components/schemas/ml._types.TrainedModelInferenceFeatureImportance' description: The feature importance for the inference results. Relevant only for classification or regression models ml._types.TrainedModelEntities: required: - class_name - class_probability - entity - start_pos - end_pos type: object properties: class_name: type: string class_probability: type: number entity: type: string start_pos: type: number end_pos: type: number ml._types.PredictedValue: oneOf: - $ref: '#/components/schemas/_types.ScalarValue' - type: array items: $ref: '#/components/schemas/_types.ScalarValue' ml._types.TopClassEntry: required: - class_name - class_probability - class_score type: object properties: class_name: type: string class_probability: type: number class_score: type: number ml._types.TrainedModelInferenceFeatureImportance: required: - feature_name type: object properties: feature_name: type: string importance: type: number classes: type: array items: $ref: '#/components/schemas/ml._types.TrainedModelInferenceClassImportance' ml._types.TrainedModelInferenceClassImportance: required: - class_name - importance type: object properties: class_name: type: string importance: type: number ml.info.Defaults: required: - anomaly_detectors - datafeeds - model_platform_variant type: object properties: anomaly_detectors: allOf: - $ref: '#/components/schemas/ml.info.AnomalyDetectors' datafeeds: allOf: - $ref: '#/components/schemas/ml.info.Datafeeds' model_platform_variant: allOf: - $ref: '#/components/schemas/ml.info.ModelPlatformVariant' description: "Returns `linux-x86_64` when all ML nodes are x86, or when no ML nodes exist but the cluster is in Elastic Cloud.\nReturns `platform_agnostic` otherwise." ml.info.AnomalyDetectors: required: - categorization_analyzer - categorization_examples_limit - model_memory_limit - model_snapshot_retention_days - daily_model_snapshot_retention_after_days type: object properties: categorization_analyzer: allOf: - $ref: '#/components/schemas/ml._types.CategorizationAnalyzer' categorization_examples_limit: type: number model_memory_limit: type: string model_snapshot_retention_days: type: number daily_model_snapshot_retention_after_days: type: number ml.info.Datafeeds: required: - scroll_size type: object properties: scroll_size: type: number ml.info.ModelPlatformVariant: enum: - linux-x86_64 - platform_agnostic type: string ml.info.Limits: required: - total_ml_memory type: object properties: max_single_ml_node_processors: type: number total_ml_processors: type: number max_model_memory_limit: allOf: - $ref: '#/components/schemas/_types.ByteSize' effective_max_model_memory_limit: allOf: - $ref: '#/components/schemas/_types.ByteSize' total_ml_memory: allOf: - $ref: '#/components/schemas/_types.ByteSize' ml.info.NativeCode: required: - build_hash - version type: object properties: build_hash: type: string version: allOf: - $ref: '#/components/schemas/_types.VersionString' ml.preview_data_frame_analytics.DataframePreviewConfig: required: - source - analysis type: object properties: source: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalyticsSource' analysis: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalysisContainer' model_memory_limit: type: string max_num_threads: type: number analyzed_fields: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalysisAnalyzedFields' ml._types.DatafeedConfig: type: object properties: aggregations: type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.AggregationContainer' description: 'If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only with low cardinality data.' chunking_config: allOf: - $ref: '#/components/schemas/ml._types.ChunkingConfig' description: 'Datafeeds might be required to search over long time periods, for several months or years. This search is split into time chunks in order to ensure the load on Elasticsearch is managed. Chunking configuration controls how the size of these time chunks are calculated and is an advanced configuration option.' datafeed_id: allOf: - $ref: '#/components/schemas/_types.Id' description: 'A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters. The default value is the job identifier.' delayed_data_check_config: allOf: - $ref: '#/components/schemas/ml._types.DelayedDataCheckConfig' description: 'Specifies whether the datafeed checks for missing data and the size of the window. The datafeed can optionally search over indices that have already been read in an effort to determine whether any data has subsequently been added to the index. If missing data is found, it is a good indication that the `query_delay` option is set too low and the data is being indexed after the datafeed has passed that moment in time. This check runs only on real-time datafeeds.' frequency: allOf: - $ref: '#/components/schemas/_types.Duration' description: 'The interval at which scheduled queries are made while the datafeed runs in real time. The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket span. For example: `150s`. When `frequency` is shorter than the bucket span, interim results for the last (partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value must be divisible by the interval of the date histogram aggregation.' indices: allOf: - $ref: '#/components/schemas/_types.Indices' description: 'An array of index names. Wildcards are supported. If any indices are in remote clusters, the machine learning nodes must have the `remote_cluster_client` role.' indices_options: allOf: - $ref: '#/components/schemas/_types.IndicesOptions' description: Specifies index expansion options that are used during search. job_id: allOf: - $ref: '#/components/schemas/_types.Id' max_empty_searches: type: number description: 'If a real-time datafeed has never seen any data (including during any initial training period) then it will automatically stop itself and close its associated job after this many real-time searches that return no documents. In other words, it will stop after `frequency` times `max_empty_searches` of real-time operation. If not set then a datafeed with no end time that sees no data will remain started until it is explicitly stopped.' max_consecutive_extraction_failures: type: number description: 'The maximum number of consecutive real-time data extraction failures the datafeed tolerates before it automatically stops itself, leaving the associated job open. The consecutive-failure counter resets on any cycle that extracts successfully, including empty-data cycles. If not set, the threshold defaults to roughly one day''s worth of searches based on the datafeed `frequency` (floored at 1). Set to `-1` to disable auto-stop and retry indefinitely. Values of `0` or less than `-1` are rejected.' query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: 'The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch.' query_delay: allOf: - $ref: '#/components/schemas/_types.Duration' description: 'The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default value is randomly selected between `60s` and `120s`. This randomness improves the query performance when there are multiple jobs running on the same node.' runtime_mappings: allOf: - $ref: '#/components/schemas/_types.mapping.RuntimeFields' description: Specifies runtime fields for the datafeed search. script_fields: type: object additionalProperties: $ref: '#/components/schemas/_types.ScriptField' description: Specifies scripts that evaluate custom expressions and returns script fields to the datafeed. The detector configuration objects in a job can contain functions that use these script fields. scroll_size: type: number description: 'The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations. The maximum value is the value of `index.max_result_window`, which is 10,000 by default.' default: 1000 ml._types.JobConfig: required: - analysis_config - data_description type: object properties: allow_lazy_open: type: boolean description: Advanced configuration option. Specifies whether this job can open when there is insufficient machine learning node capacity for it to be immediately assigned to a node. default: false analysis_config: allOf: - $ref: '#/components/schemas/ml._types.AnalysisConfig' description: "The analysis configuration, which specifies how to analyze the data.\nAfter you create a job, you cannot change the analysis configuration; all the properties are informational." analysis_limits: allOf: - $ref: '#/components/schemas/ml._types.AnalysisLimits' description: "Limits can be applied for the resources required to hold the mathematical models in memory.\nThese limits are approximate and can be set per job.\nThey do not control the memory used by other processes, for example the Elasticsearch Java processes." background_persist_interval: allOf: - $ref: '#/components/schemas/_types.Duration' description: "Advanced configuration option.\nThe time between each periodic persistence of the model.\nThe default value is a randomized value between 3 to 4 hours, which avoids all jobs persisting at exactly the same time.\nThe smallest allowed value is 1 hour." custom_settings: allOf: - $ref: '#/components/schemas/ml._types.CustomSettings' description: "Advanced configuration option.\nContains custom metadata about the job." daily_model_snapshot_retention_after_days: type: number description: "Advanced configuration option, which affects the automatic removal of old model snapshots for this job.\nIt specifies a period of time (in days) after which only the first snapshot per day is retained.\nThis period is relative to the timestamp of the most recent snapshot for this job." default: 1 data_description: allOf: - $ref: '#/components/schemas/ml._types.DataDescription' description: "The data description defines the format of the input data when you send data to the job by using the post data API.\nNote that when configure a datafeed, these properties are automatically set." datafeed_config: allOf: - $ref: '#/components/schemas/ml._types.DatafeedConfig' description: "The datafeed, which retrieves data from Elasticsearch for analysis by the job.\nYou can associate only one datafeed with each anomaly detection job." description: type: string description: A description of the job. groups: type: array items: type: string description: A list of job groups. A job can belong to no groups or many. job_id: allOf: - $ref: '#/components/schemas/_types.Id' description: "Identifier for the anomaly detection job.\nThis identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.\nIt must start and end with alphanumeric characters." model_plot_config: allOf: - $ref: '#/components/schemas/ml._types.ModelPlotConfig' description: "This advanced configuration option stores model information along with the results.\nIt provides a more detailed view into anomaly detection.\nModel plot provides a simplified and indicative view of the model and its bounds." model_snapshot_retention_days: type: number description: "Advanced configuration option, which affects the automatic removal of old model snapshots for this job.\nIt specifies the maximum period of time (in days) that snapshots are retained.\nThis period is relative to the timestamp of the most recent snapshot for this job.\nThe default value is `10`, which means snapshots ten days older than the newest snapshot are deleted." default: 10 renormalization_window_days: type: number description: "Advanced configuration option.\nThe period over which adjustments to the score are applied, as new data is seen.\nThe default value is the longer of 30 days or 100 `bucket_spans`." results_index_name: allOf: - $ref: '#/components/schemas/_types.IndexName' description: "A text string that affects the name of the machine learning results index.\nThe default value is `shared`, which generates an index named `.ml-anomalies-shared`." default: shared results_retention_days: type: number description: "Advanced configuration option.\nThe period of time (in days) that results are retained.\nAge is calculated relative to the timestamp of the latest bucket result.\nIf this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch.\nThe default value is null, which means all results are retained.\nAnnotations generated by the system also count as results for retention purposes; they are deleted after the same number of days as results.\nAnnotations added by users are retained forever." _types.HttpHeaders: type: object additionalProperties: oneOf: - type: string - type: array items: type: string ml._types.AnalysisConfigRead: required: - bucket_span - detectors - influencers type: object properties: bucket_span: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The size of the interval that the analysis is aggregated into, typically between `5m` and `1h`. This value should be either a whole number of days or equate to a\nwhole number of buckets in one day. If the anomaly detection job uses a datafeed with aggregations, this value must also be divisible by the interval of the date histogram aggregation." default: 5m detectors: type: array items: $ref: '#/components/schemas/ml._types.DetectorRead' description: 'Detector configuration objects specify which data fields a job analyzes. They also specify which analytical functions are used. You can specify multiple detectors for a job. If the detectors array does not contain at least one detector, no analysis can occur and an error is returned.' influencers: type: array items: $ref: '#/components/schemas/_types.Field' description: 'A comma separated list of influencer field names. Typically these can be the by, over, or partition fields that are used in the detector configuration. You might also want to use a field name that is not specifically named in a detector, but is available as part of the input data. When you use multiple detectors, the use of influencers is recommended as it aggregates results for each influencer entity.' categorization_analyzer: allOf: - $ref: '#/components/schemas/ml._types.CategorizationAnalyzer' description: 'If `categorization_field_name` is specified, you can also define the analyzer that is used to interpret the categorization field. This property cannot be used at the same time as `categorization_filters`. The categorization analyzer specifies how the `categorization_field` is interpreted by the categorization process. The `categorization_analyzer` field can be specified either as a string or as an object. If it is a string, it must refer to a built-in analyzer or one added by another plugin.' categorization_field_name: allOf: - $ref: '#/components/schemas/_types.Field' description: 'If this property is specified, the values of the specified field will be categorized. The resulting categories must be used in a detector by setting `by_field_name`, `over_field_name`, or `partition_field_name` to the keyword `mlcategory`.' categorization_filters: type: array items: type: string description: 'If `categorization_field_name` is specified, you can also define optional filters. This property expects an array of regular expressions. The expressions are used to filter out matching sequences from the categorization field values. You can use this functionality to fine tune the categorization by excluding sequences from consideration when categories are defined. For example, you can exclude SQL statements that appear in your log files. This property cannot be used at the same time as `categorization_analyzer`. If you only want to define simple regular expression filters that are applied prior to tokenization, setting this property is the easiest method. If you also want to customize the tokenizer or post-tokenization filtering, use the `categorization_analyzer` property instead and include the filters as pattern_replace character filters. The effect is exactly the same.' latency: allOf: - $ref: '#/components/schemas/_types.Duration' description: 'The size of the window in which to expect data that is out of time order. If you specify a non-zero value, it must be greater than or equal to one second. NOTE: Latency is applicable only when you send data by using the post data API.' default: '0' model_prune_window: allOf: - $ref: '#/components/schemas/_types.Duration' description: 'Advanced configuration option. Affects the pruning of models that have not been updated for the given time duration. The value must be set to a multiple of the `bucket_span`. If set too low, important information may be removed from the model. For jobs created in 8.1 and later, the default value is the greater of `30d` or 20 times `bucket_span`.' multivariate_by_fields: type: boolean description: 'This functionality is reserved for internal use. It is not supported for use in customer environments and is not subject to the support SLA of official GA features. If set to `true`, the analysis will automatically find correlations between metrics for a given by field value and report anomalies when those correlations cease to hold. For example, suppose CPU and memory usage on host A is usually highly correlated with the same metrics on host B. Perhaps this correlation occurs because they are running a load-balanced application. If you enable this property, anomalies will be reported when, for example, CPU usage on host A is high and the value of CPU usage on host B is low. That is to say, you’ll see an anomaly when the CPU of host A is unusual given the CPU of host B. To use the `multivariate_by_fields` property, you must also specify `by_field_name` in your detector.' per_partition_categorization: allOf: - $ref: '#/components/schemas/ml._types.PerPartitionCategorization' description: Settings related to how categorization interacts with partition fields. summary_count_field_name: allOf: - $ref: '#/components/schemas/_types.Field' description: 'If this property is specified, the data that is fed to the job is expected to be pre-summarized. This property value is the name of the field that contains the count of raw data points that have been summarized. The same `summary_count_field_name` applies to all detectors in the job. NOTE: The `summary_count_field_name` property cannot be used with the `metric` function.' ml._types.DetectorRead: required: - function type: object properties: function: type: string description: 'The analysis function that is used. For example, `count`, `rare`, `mean`, `min`, `max`, or `sum`.' by_field_name: allOf: - $ref: '#/components/schemas/_types.Field' description: 'The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split.' custom_rules: type: array items: $ref: '#/components/schemas/ml._types.DetectionRule' description: 'Custom rules enable you to customize the way detectors operate. For example, a rule may dictate conditions under which results should be skipped. Kibana refers to custom rules as job rules.' detector_description: type: string description: A description of the detector. detector_index: type: number description: 'A unique identifier for the detector. This identifier is based on the order of the detectors in the `analysis_config`, starting at zero. If you specify a value for this property, it is ignored.' exclude_frequent: allOf: - $ref: '#/components/schemas/ml._types.ExcludeFrequent' description: 'If set, frequent entities are excluded from influencing the anomaly results. Entities can be considered frequent over time or frequent in a population. If you are working with both over and by fields, you can set `exclude_frequent` to `all` for both fields, or to `by` or `over` for those specific fields.' field_name: allOf: - $ref: '#/components/schemas/_types.Field' description: 'The field that the detector uses in the function. If you use an event rate function such as count or rare, do not specify this field. The `field_name` cannot contain double quotes or backslashes.' over_field_name: allOf: - $ref: '#/components/schemas/_types.Field' description: 'The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits.' partition_field_name: allOf: - $ref: '#/components/schemas/_types.Field' description: 'The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field.' use_null: type: boolean description: Defines whether a new series is used as the null series when there is no value for the by or partition fields. default: false ml.put_trained_model.Definition: required: - trained_model type: object properties: preprocessors: type: array items: $ref: '#/components/schemas/ml.put_trained_model.Preprocessor' description: Collection of preprocessors trained_model: allOf: - $ref: '#/components/schemas/ml.put_trained_model.TrainedModel' description: The definition of the trained model. ml.put_trained_model.Preprocessor: maxProperties: 1 minProperties: 1 type: object properties: frequency_encoding: allOf: - $ref: '#/components/schemas/ml.put_trained_model.FrequencyEncodingPreprocessor' one_hot_encoding: allOf: - $ref: '#/components/schemas/ml.put_trained_model.OneHotEncodingPreprocessor' target_mean_encoding: allOf: - $ref: '#/components/schemas/ml.put_trained_model.TargetMeanEncodingPreprocessor' ml.put_trained_model.FrequencyEncodingPreprocessor: required: - field - feature_name - frequency_map type: object properties: field: type: string feature_name: type: string frequency_map: type: object additionalProperties: type: number ml.put_trained_model.OneHotEncodingPreprocessor: required: - field - hot_map type: object properties: field: type: string hot_map: type: object additionalProperties: type: string ml.put_trained_model.TargetMeanEncodingPreprocessor: required: - field - feature_name - target_map - default_value type: object properties: field: type: string feature_name: type: string target_map: type: object additionalProperties: type: number default_value: type: number ml.put_trained_model.TrainedModel: type: object properties: tree: allOf: - $ref: '#/components/schemas/ml.put_trained_model.TrainedModelTree' description: The definition for a binary decision tree. tree_node: allOf: - $ref: '#/components/schemas/ml.put_trained_model.TrainedModelTreeNode' description: "The definition of a node in a tree.\nThere are two major types of nodes: leaf nodes and not-leaf nodes.\n- Leaf nodes only need node_index and leaf_value defined.\n- All other nodes need split_feature, left_child, right_child, threshold, decision_type, and default_left defined." ensemble: allOf: - $ref: '#/components/schemas/ml.put_trained_model.Ensemble' description: The definition for an ensemble model ml.put_trained_model.TrainedModelTree: required: - feature_names - tree_structure type: object properties: classification_labels: type: array items: type: string feature_names: type: array items: type: string target_type: type: string tree_structure: type: array items: $ref: '#/components/schemas/ml.put_trained_model.TrainedModelTreeNode' ml.put_trained_model.TrainedModelTreeNode: required: - node_index type: object properties: decision_type: type: string default_left: type: boolean leaf_value: type: number left_child: type: number node_index: type: number right_child: type: number split_feature: type: number split_gain: type: number threshold: type: number ml.put_trained_model.Ensemble: required: - trained_models type: object properties: aggregate_output: allOf: - $ref: '#/components/schemas/ml.put_trained_model.AggregateOutput' classification_labels: type: array items: type: string feature_names: type: array items: type: string target_type: type: string trained_models: type: array items: $ref: '#/components/schemas/ml.put_trained_model.TrainedModel' ml.put_trained_model.AggregateOutput: type: object properties: logistic_regression: allOf: - $ref: '#/components/schemas/ml.put_trained_model.Weights' weighted_sum: allOf: - $ref: '#/components/schemas/ml.put_trained_model.Weights' weighted_mode: allOf: - $ref: '#/components/schemas/ml.put_trained_model.Weights' exponent: allOf: - $ref: '#/components/schemas/ml.put_trained_model.Weights' ml.put_trained_model.Weights: required: - weights type: object properties: weights: type: number ml.put_trained_model.Input: required: - field_names type: object properties: field_names: allOf: - $ref: '#/components/schemas/_types.Names' ml._types.TrainedModelAssignment: required: - assignment_state - routing_table - start_time - task_parameters type: object properties: adaptive_allocations: oneOf: - $ref: '#/components/schemas/ml._types.AdaptiveAllocationsSettings' - type: - 'null' - string assignment_state: allOf: - $ref: '#/components/schemas/ml._types.DeploymentAssignmentState' description: "The overall assignment state.\n\nSupported values include:\n - `started`: The deployment is usable; at least one node has the model allocated.\n - `starting`: The deployment has recently started but is not yet usable; the model is not allocated on any nodes.\n - `stopping`: The deployment is preparing to stop and deallocate the model from the relevant nodes.\n - `failed`: The deployment is on a failed state and must be re-deployed.\n\n" max_assigned_allocations: type: number reason: type: string routing_table: type: object additionalProperties: $ref: '#/components/schemas/ml._types.TrainedModelAssignmentRoutingTable' description: The allocation state for each node. start_time: allOf: - $ref: '#/components/schemas/_types.DateTime' description: The timestamp when the deployment started. task_parameters: allOf: - $ref: '#/components/schemas/ml._types.TrainedModelAssignmentTaskParameters' ml._types.TrainedModelAssignmentRoutingTable: required: - routing_state - current_allocations - target_allocations type: object properties: reason: type: string description: "The reason for the current state. It is usually populated only when the\n`routing_state` is `failed`." routing_state: allOf: - $ref: '#/components/schemas/ml._types.RoutingState' description: "The current routing state.\n\nSupported values include:\n - `failed`: The allocation attempt failed.\n - `started`: The trained model is allocated and ready to accept inference requests.\n - `starting`: The trained model is attempting to allocate on this node; inference requests are not yet accepted.\n - `stopped`: The trained model is fully deallocated from this node.\n - `stopping`: The trained model is being deallocated from this node.\n\n" current_allocations: type: number description: Current number of allocations. target_allocations: type: number description: Target number of allocations. ml._types.TrainedModelAssignmentTaskParameters: required: - model_bytes - model_id - deployment_id - number_of_allocations - priority - per_deployment_memory_bytes - per_allocation_memory_bytes - queue_capacity - threads_per_allocation type: object properties: model_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The size of the trained model in bytes. model_id: allOf: - $ref: '#/components/schemas/_types.Id' description: The unique identifier for the trained model. deployment_id: allOf: - $ref: '#/components/schemas/_types.Id' description: The unique identifier for the trained model deployment. cache_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The size of the trained model cache. x-state: Generally available; Added in 8.4.0 number_of_allocations: type: number description: The total number of allocations this model is assigned across ML nodes. priority: allOf: - $ref: '#/components/schemas/ml._types.TrainingPriority' per_deployment_memory_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' per_allocation_memory_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' queue_capacity: type: number description: Number of inference requests are allowed in the queue at a time. threads_per_allocation: type: number description: Number of threads per allocation. ml._types.AnalysisMemoryLimit: required: - model_memory_limit type: object properties: model_memory_limit: type: string description: 'Limits can be applied for the resources required to hold the mathematical models in memory. These limits are approximate and can be set per job. They do not control the memory used by other processes, for example the Elasticsearch Java processes.' ml._types.DetectorUpdate: required: - detector_index type: object properties: detector_index: type: number description: "A unique identifier for the detector.\nThis identifier is based on the order of the detectors in the `analysis_config`, starting at zero." description: type: string description: A description of the detector. custom_rules: type: array items: $ref: '#/components/schemas/ml._types.DetectionRule' description: "An array of custom rule objects, which enable you to customize the way detectors operate.\nFor example, a rule may dictate to the detector conditions under which results should be skipped.\nKibana refers to custom rules as job rules." _global.msearch.MultiSearchResult: required: - took - responses type: object properties: took: type: number responses: type: array items: $ref: '#/components/schemas/_global.msearch.ResponseItem' _global.msearch_template.RequestItem: oneOf: - $ref: '#/components/schemas/_global.msearch.MultisearchHeader' - $ref: '#/components/schemas/_global.msearch_template.TemplateConfig' _global.msearch_template.TemplateConfig: type: object properties: explain: type: boolean description: 'If `true`, returns detailed information about score calculation as part of each hit.' default: false id: allOf: - $ref: '#/components/schemas/_types.Id' description: "The ID of the search template to use. If no `source` is specified,\nthis parameter is required." params: type: object additionalProperties: type: object description: "Key-value pairs used to replace Mustache variables in the template.\nThe key is the variable name.\nThe value is the variable value." profile: type: boolean description: 'If `true`, the query execution is profiled.' default: false source: allOf: - $ref: '#/components/schemas/_types.ScriptSource' description: "An inline search template. Supports the same parameters as the search API's\nrequest body. It also supports Mustache variables. If no `id` is specified, this\nparameter is required." _global.mtermvectors.Operation: type: object properties: _id: allOf: - $ref: '#/components/schemas/_types.Id' description: The ID of the document. _index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: The index of the document. doc: type: object description: An artificial document (a document not present in the index) for which you want to retrieve term vectors. fields: allOf: - $ref: '#/components/schemas/_types.Fields' description: "Comma-separated list or wildcard expressions of fields to include in the statistics.\nUsed as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters." field_statistics: type: boolean description: 'If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies.' default: true filter: allOf: - $ref: '#/components/schemas/_global.termvectors.Filter' description: Filter terms based on their tf-idf scores. offsets: type: boolean description: 'If `true`, the response includes term offsets.' default: true payloads: type: boolean description: 'If `true`, the response includes term payloads.' default: true positions: type: boolean description: 'If `true`, the response includes term positions.' default: true routing: allOf: - $ref: '#/components/schemas/_types.Routing' description: "Custom value used to route operations to a specific shard.\nNot allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead." term_statistics: type: boolean description: 'If true, the response includes term frequency and document frequency.' default: false version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' description: 'If `true`, returns the document version as part of a hit.' version_type: allOf: - $ref: '#/components/schemas/_types.VersionType' description: "Specific version type.\n\nSupported values include:\n - `internal`: Use internal versioning that starts at 1 and increments with each update or delete.\n - `external`: Only index the document if the specified version is strictly higher than the version of the stored document or if there is no existing document.\n - `external_gte`: Only index the document if the specified version is equal or higher than the version of the stored document or if there is no existing document.\nNOTE: The `external_gte` version type is meant for special use cases and should be used with care.\nIf used incorrectly, it can result in loss of data.\n\n" _global.termvectors.Filter: type: object properties: max_doc_freq: type: number description: "Ignore words which occur in more than this many docs.\nDefaults to unbounded." max_num_terms: type: number description: The maximum number of terms that must be returned per field. default: 25 max_term_freq: type: number description: "Ignore words with more than this frequency in the source doc.\nIt defaults to unbounded." max_word_length: type: number description: "The maximum word length above which words will be ignored.\nDefaults to unbounded." default: 0 min_doc_freq: type: number description: Ignore terms which do not occur in at least this many docs. default: 1 min_term_freq: type: number description: Ignore words with less than this frequency in the source doc. default: 1 min_word_length: type: number description: The minimum word length below which words will be ignored. default: 0 _global.mtermvectors.TermVectorsResult: required: - _index type: object properties: _id: allOf: - $ref: '#/components/schemas/_types.Id' _index: allOf: - $ref: '#/components/schemas/_types.IndexName' _version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' took: type: number found: type: boolean term_vectors: type: object additionalProperties: $ref: '#/components/schemas/_global.termvectors.TermVector' error: allOf: - $ref: '#/components/schemas/_types.ErrorCause' _global.termvectors.TermVector: required: - terms type: object properties: field_statistics: allOf: - $ref: '#/components/schemas/_global.termvectors.FieldStatistics' terms: type: object additionalProperties: $ref: '#/components/schemas/_global.termvectors.Term' _global.termvectors.FieldStatistics: required: - doc_count - sum_doc_freq - sum_ttf type: object properties: doc_count: type: number sum_doc_freq: type: number sum_ttf: type: number _global.termvectors.Term: required: - term_freq type: object properties: doc_freq: type: number score: type: number term_freq: type: number tokens: type: array items: $ref: '#/components/schemas/_global.termvectors.Token' ttf: type: number _global.termvectors.Token: required: - position type: object properties: end_offset: type: number payload: type: string position: type: number start_offset: type: number nodes.clear_repositories_metering_archive.ResponseBase: allOf: - $ref: '#/components/schemas/nodes._types.NodesResponseBase' - required: - cluster_name - nodes type: object properties: cluster_name: allOf: - $ref: '#/components/schemas/_types.Name' description: Name of the cluster. Based on the `cluster.name` setting. externalDocs: url: https://www.elastic.co/docs/deploy-manage/deploy/self-managed/important-settings-configuration#_cluster_name_setting nodes: type: object additionalProperties: $ref: '#/components/schemas/nodes._types.RepositoryMeteringInformation' description: Contains repositories metering information for the nodes selected by the request. nodes._types.RepositoryMeteringInformation: required: - repository_name - repository_type - repository_location - repository_ephemeral_id - repository_started_at - archived - request_counts type: object properties: repository_name: allOf: - $ref: '#/components/schemas/_types.Name' description: Repository name. repository_type: type: string description: Repository type. repository_location: allOf: - $ref: '#/components/schemas/nodes._types.RepositoryLocation' description: Represents an unique location within the repository. repository_ephemeral_id: allOf: - $ref: '#/components/schemas/_types.Id' description: An identifier that changes every time the repository is updated. repository_started_at: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: Time the repository was created or updated. Recorded in milliseconds since the Unix Epoch. repository_stopped_at: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: Time the repository was deleted or updated. Recorded in milliseconds since the Unix Epoch. archived: type: boolean description: "A flag that tells whether or not this object has been archived. When a repository is closed or updated the\nrepository metering information is archived and kept for a certain period of time. This allows retrieving the\nrepository metering information of previous repository instantiations." cluster_version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' description: "The cluster state version when this object was archived, this field can be used as a logical timestamp to delete\nall the archived metrics up to an observed version. This field is only present for archived repository metering\ninformation objects. The main purpose of this field is to avoid possible race conditions during repository metering\ninformation deletions, i.e. deleting archived repositories metering information that we haven’t observed yet." request_counts: allOf: - $ref: '#/components/schemas/nodes._types.RequestCounts' description: An object with the number of request performed against the repository grouped by request type. nodes._types.RepositoryLocation: required: - base_path type: object properties: base_path: type: string container: type: string description: Container name (Azure) bucket: type: string description: 'Bucket name (GCP, S3)' nodes._types.RequestCounts: type: object properties: GetBlobProperties: type: number description: Number of Get Blob Properties requests (Azure) GetBlob: type: number description: Number of Get Blob requests (Azure) ListBlobs: type: number description: Number of List Blobs requests (Azure) PutBlob: type: number description: Number of Put Blob requests (Azure) PutBlock: type: number description: Number of Put Block (Azure) PutBlockList: type: number description: Number of Put Block List requests GetObject: type: number description: 'Number of get object requests (GCP, S3)' ListObjects: type: number description: 'Number of list objects requests (GCP, S3)' InsertObject: type: number description: "Number of insert object requests, including simple, multipart and resumable uploads. Resumable uploads\ncan perform multiple http requests to insert a single object but they are considered as a single request\nsince they are billed as an individual operation. (GCP)" PutObject: type: number description: Number of PutObject requests (S3) PutMultipartObject: type: number description: 'Number of Multipart requests, including CreateMultipartUpload, UploadPart and CompleteMultipartUpload requests (S3)' nodes.get_repositories_metering_info.ResponseBase: allOf: - $ref: '#/components/schemas/nodes._types.NodesResponseBase' - required: - cluster_name - nodes type: object properties: cluster_name: allOf: - $ref: '#/components/schemas/_types.Name' description: Name of the cluster. Based on the `cluster.name` setting. nodes: type: object additionalProperties: $ref: '#/components/schemas/nodes._types.RepositoryMeteringInformation' description: Contains repositories metering information for the nodes selected by the request. _types.ThreadType: enum: - cpu - wait - block - gpu - mem type: string _types.ThreadSortOrder: enum: - total - cpu type: string nodes.info.NodesInfoMetrics: oneOf: - $ref: '#/components/schemas/nodes.info.NodesInfoMetric' - type: array items: $ref: '#/components/schemas/nodes.info.NodesInfoMetric' nodes.info.NodesInfoMetric: enum: - _all - _none - settings - os - process - jvm - thread_pool - transport - http - remote_cluster_server - plugins - ingest - aggregations - indices type: string nodes.info.ResponseBase: allOf: - $ref: '#/components/schemas/nodes._types.NodesResponseBase' - required: - cluster_name - nodes type: object properties: cluster_name: allOf: - $ref: '#/components/schemas/_types.Name' nodes: type: object additionalProperties: $ref: '#/components/schemas/nodes.info.NodeInfo' nodes.info.NodeInfo: required: - attributes - build_flavor - build_hash - build_type - component_versions - host - index_version - ip - name - roles - transport_address - transport_version - version type: object properties: attributes: type: object additionalProperties: type: string build_flavor: type: string build_hash: type: string description: Short hash of the last git commit in this release. build_type: type: string component_versions: type: object additionalProperties: type: number host: allOf: - $ref: '#/components/schemas/_types.Host' description: The node’s host name. http: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoHttp' index_version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' ip: allOf: - $ref: '#/components/schemas/_types.Ip' description: The node’s IP address. jvm: allOf: - $ref: '#/components/schemas/nodes.info.NodeJvmInfo' name: allOf: - $ref: '#/components/schemas/_types.Name' description: The node's name os: allOf: - $ref: '#/components/schemas/nodes.info.NodeOperatingSystemInfo' plugins: type: array items: $ref: '#/components/schemas/_types.PluginStats' process: allOf: - $ref: '#/components/schemas/nodes.info.NodeProcessInfo' roles: allOf: - $ref: '#/components/schemas/_types.NodeRoles' settings: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoSettings' thread_pool: type: object additionalProperties: $ref: '#/components/schemas/nodes.info.NodeThreadPoolInfo' total_indexing_buffer: type: number 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.' total_indexing_buffer_in_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: 'Same as total_indexing_buffer, but expressed in bytes.' transport: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoTransport' transport_address: allOf: - $ref: '#/components/schemas/_types.TransportAddress' description: Host and port where transport HTTP connections are accepted. transport_version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' version: allOf: - $ref: '#/components/schemas/_types.VersionString' description: Elasticsearch version running on this node. modules: type: array items: $ref: '#/components/schemas/_types.PluginStats' ingest: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngest' aggregations: type: object additionalProperties: $ref: '#/components/schemas/nodes.info.NodeInfoAggregation' remote_cluster_server: allOf: - $ref: '#/components/schemas/nodes.info.RemoveClusterServer' nodes.info.NodeInfoHttp: required: - bound_address - max_content_length_in_bytes - publish_address type: object properties: bound_address: type: array items: type: string max_content_length: allOf: - $ref: '#/components/schemas/_types.ByteSize' max_content_length_in_bytes: type: number publish_address: type: string nodes.info.NodeJvmInfo: required: - gc_collectors - mem - memory_pools - pid - start_time_in_millis - version - vm_name - vm_vendor - vm_version - using_bundled_jdk - input_arguments type: object properties: gc_collectors: type: array items: type: string mem: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoJvmMemory' memory_pools: type: array items: type: string pid: type: number start_time_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' version: allOf: - $ref: '#/components/schemas/_types.VersionString' vm_name: allOf: - $ref: '#/components/schemas/_types.Name' vm_vendor: type: string vm_version: allOf: - $ref: '#/components/schemas/_types.VersionString' using_bundled_jdk: type: boolean using_compressed_ordinary_object_pointers: type: - boolean - string input_arguments: type: array items: type: string nodes.info.NodeInfoJvmMemory: required: - direct_max_in_bytes - heap_init_in_bytes - heap_max_in_bytes - non_heap_init_in_bytes - non_heap_max_in_bytes type: object properties: direct_max: allOf: - $ref: '#/components/schemas/_types.ByteSize' direct_max_in_bytes: type: number heap_init: allOf: - $ref: '#/components/schemas/_types.ByteSize' heap_init_in_bytes: type: number heap_max: allOf: - $ref: '#/components/schemas/_types.ByteSize' heap_max_in_bytes: type: number non_heap_init: allOf: - $ref: '#/components/schemas/_types.ByteSize' non_heap_init_in_bytes: type: number non_heap_max: allOf: - $ref: '#/components/schemas/_types.ByteSize' non_heap_max_in_bytes: type: number nodes.info.NodeOperatingSystemInfo: required: - arch - available_processors - name - pretty_name - refresh_interval_in_millis - version type: object properties: arch: type: string description: 'Name of the JVM architecture (ex: amd64, x86)' available_processors: type: number description: Number of processors available to the Java virtual machine allocated_processors: type: number 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. name: allOf: - $ref: '#/components/schemas/_types.Name' description: 'Name of the operating system (ex: Linux, Windows, Mac OS X)' pretty_name: allOf: - $ref: '#/components/schemas/_types.Name' refresh_interval_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: Refresh interval for the OS statistics version: allOf: - $ref: '#/components/schemas/_types.VersionString' description: Version of the operating system cpu: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoOSCPU' mem: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoMemory' swap: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoMemory' nodes.info.NodeInfoOSCPU: required: - cache_size - cache_size_in_bytes - cores_per_socket - mhz - model - total_cores - total_sockets - vendor type: object properties: cache_size: type: string cache_size_in_bytes: type: number cores_per_socket: type: number mhz: type: number model: type: string total_cores: type: number total_sockets: type: number vendor: type: string nodes.info.NodeInfoMemory: required: - total - total_in_bytes type: object properties: total: type: string total_in_bytes: type: number nodes.info.NodeProcessInfo: required: - id - mlockall - refresh_interval_in_millis type: object properties: id: type: number description: Process identifier (PID) mlockall: type: boolean description: Indicates if the process address space has been successfully locked in memory refresh_interval_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: Refresh interval for the process statistics nodes.info.NodeInfoSettings: required: - cluster - node - http - transport type: object properties: cluster: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoSettingsCluster' node: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoSettingsNode' path: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoPath' repositories: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoRepositories' discovery: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoDiscover' action: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoAction' client: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoClient' http: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoSettingsHttp' bootstrap: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoBootstrap' transport: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoSettingsTransport' network: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoSettingsNetwork' xpack: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoXpack' script: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoScript' search: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoSearch' ingest: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoSettingsIngest' nodes.info.NodeInfoSettingsCluster: required: - name - election type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' routing: allOf: - $ref: '#/components/schemas/indices._types.IndexRouting' election: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoSettingsClusterElection' initial_master_nodes: oneOf: - type: array items: type: string - type: string deprecation_indexing: allOf: - $ref: '#/components/schemas/nodes.info.DeprecationIndexing' x-state: Generally available; Added in 7.16.0 nodes.info.NodeInfoSettingsClusterElection: required: - strategy type: object properties: strategy: allOf: - $ref: '#/components/schemas/_types.Name' nodes.info.DeprecationIndexing: required: - enabled type: object properties: enabled: type: - boolean - string nodes.info.NodeInfoSettingsNode: required: - name - attr type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' attr: type: object additionalProperties: type: object max_local_storage_nodes: type: string nodes.info.NodeInfoPath: type: object properties: logs: type: string home: type: string repo: type: array items: type: string data: oneOf: - type: string - type: array items: type: string nodes.info.NodeInfoRepositories: required: - url type: object properties: url: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoRepositoriesUrl' nodes.info.NodeInfoRepositoriesUrl: required: - allowed_urls type: object properties: allowed_urls: type: string nodes.info.NodeInfoDiscover: type: object properties: seed_hosts: oneOf: - type: array items: type: string - type: string type: type: string seed_providers: oneOf: - type: array items: type: string - type: string nodes.info.NodeInfoAction: required: - destructive_requires_name type: object properties: destructive_requires_name: type: string nodes.info.NodeInfoClient: required: - type type: object properties: type: type: string nodes.info.NodeInfoSettingsHttp: required: - type type: object properties: type: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoSettingsHttpType' type.default: type: string compression: type: - boolean - string port: type: - number - string nodes.info.NodeInfoSettingsHttpType: required: - default type: object properties: default: type: string nodes.info.NodeInfoBootstrap: required: - memory_lock type: object properties: memory_lock: type: string nodes.info.NodeInfoSettingsTransport: required: - type type: object properties: type: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoSettingsTransportType' type.default: type: string features: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoSettingsTransportFeatures' nodes.info.NodeInfoSettingsTransportType: required: - default type: object properties: default: type: string nodes.info.NodeInfoSettingsTransportFeatures: required: - x-pack type: object properties: x-pack: type: string nodes.info.NodeInfoSettingsNetwork: type: object properties: host: oneOf: - $ref: '#/components/schemas/_types.Host' - type: array items: $ref: '#/components/schemas/_types.Host' nodes.info.NodeInfoXpack: required: - security type: object properties: license: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoXpackLicense' security: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoXpackSecurity' notification: type: object additionalProperties: type: object ml: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoXpackMl' nodes.info.NodeInfoXpackLicense: required: - self_generated type: object properties: self_generated: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoXpackLicenseType' nodes.info.NodeInfoXpackLicenseType: required: - type type: object properties: type: type: string nodes.info.NodeInfoXpackSecurity: required: - enabled type: object properties: http: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoXpackSecuritySsl' enabled: type: string transport: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoXpackSecuritySsl' authc: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoXpackSecurityAuthc' nodes.info.NodeInfoXpackSecuritySsl: required: - ssl type: object properties: ssl: type: object additionalProperties: type: string nodes.info.NodeInfoXpackSecurityAuthc: type: object properties: realms: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoXpackSecurityAuthcRealms' token: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoXpackSecurityAuthcToken' nodes.info.NodeInfoXpackSecurityAuthcRealms: type: object properties: file: type: object additionalProperties: $ref: '#/components/schemas/nodes.info.NodeInfoXpackSecurityAuthcRealmsStatus' native: type: object additionalProperties: $ref: '#/components/schemas/nodes.info.NodeInfoXpackSecurityAuthcRealmsStatus' pki: type: object additionalProperties: $ref: '#/components/schemas/nodes.info.NodeInfoXpackSecurityAuthcRealmsStatus' nodes.info.NodeInfoXpackSecurityAuthcRealmsStatus: required: - order type: object properties: enabled: type: string order: type: string nodes.info.NodeInfoXpackSecurityAuthcToken: required: - enabled type: object properties: enabled: type: string nodes.info.NodeInfoXpackMl: type: object properties: use_auto_machine_memory_percent: type: boolean nodes.info.NodeInfoScript: required: - allowed_types type: object properties: allowed_types: type: string disable_max_compilations_rate: type: string nodes.info.NodeInfoSearch: required: - remote type: object properties: remote: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoSearchRemote' nodes.info.NodeInfoSearchRemote: required: - connect type: object properties: connect: type: string nodes.info.NodeInfoSettingsIngest: type: object properties: attachment: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' append: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' csv: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' convert: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' date: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' date_index_name: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' dot_expander: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' enrich: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' fail: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' foreach: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' json: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' user_agent: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' kv: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' geoip: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' grok: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' gsub: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' join: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' lowercase: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' remove: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' rename: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' script: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' set: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' sort: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' split: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' trim: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' uppercase: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' urldecode: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' bytes: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' dissect: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' set_security_user: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' pipeline: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' drop: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' circle: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' inference: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestInfo' nodes.info.NodeInfoIngestInfo: required: - downloader type: object properties: downloader: allOf: - $ref: '#/components/schemas/nodes.info.NodeInfoIngestDownloader' nodes.info.NodeInfoIngestDownloader: required: - enabled type: object properties: enabled: type: string nodes.info.NodeThreadPoolInfo: required: - queue_size - type type: object properties: core: type: number keep_alive: allOf: - $ref: '#/components/schemas/_types.Duration' max: type: number queue_size: type: number size: type: number type: type: string nodes.info.NodeInfoTransport: required: - bound_address - publish_address - profiles type: object properties: bound_address: type: array items: type: string publish_address: type: string profiles: type: object additionalProperties: type: string nodes.info.NodeInfoIngest: required: - processors type: object properties: processors: type: array items: $ref: '#/components/schemas/nodes.info.NodeInfoIngestProcessor' nodes.info.NodeInfoIngestProcessor: required: - type type: object properties: type: type: string nodes.info.NodeInfoAggregation: required: - types type: object properties: types: type: array items: type: string nodes.info.RemoveClusterServer: required: - bound_address - publish_address type: object properties: bound_address: type: array items: $ref: '#/components/schemas/_types.TransportAddress' publish_address: allOf: - $ref: '#/components/schemas/_types.TransportAddress' _types.Password: type: string nodes.reload_secure_settings.ResponseBase: allOf: - $ref: '#/components/schemas/nodes._types.NodesResponseBase' - required: - cluster_name - nodes type: object properties: cluster_name: allOf: - $ref: '#/components/schemas/_types.Name' nodes: type: object additionalProperties: $ref: '#/components/schemas/nodes._types.NodeReloadResult' nodes._types.NodeReloadResult: required: - name type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' reload_exception: allOf: - $ref: '#/components/schemas/_types.ErrorCause' secure_setting_names: type: array items: type: string description: The names of the secure settings that were reloaded. keystore_path: type: string description: The path to the keystore file. keystore_digest: type: string description: A SHA-256 hash of the keystore file contents. keystore_last_modified_time: allOf: - $ref: '#/components/schemas/_types.DateTime' description: The last modification time of the keystore file. nodes.stats.NodeStatsMetrics: oneOf: - $ref: '#/components/schemas/nodes.stats.NodeStatsMetric' - type: array items: $ref: '#/components/schemas/nodes.stats.NodeStatsMetric' nodes.stats.NodeStatsMetric: enum: - _all - _none - indices - os - process - jvm - thread_pool - fs - transport - http - breaker - script - discovery - ingest - adaptive_selection - script_cache - indexing_pressure - repositories - allocations type: string _types.NodeStatsLevel: enum: - node - indices - shards type: string nodes.stats.ResponseBase: allOf: - $ref: '#/components/schemas/nodes._types.NodesResponseBase' - required: - nodes type: object properties: cluster_name: allOf: - $ref: '#/components/schemas/_types.Name' nodes: type: object additionalProperties: $ref: '#/components/schemas/nodes._types.Stats' nodes._types.Stats: type: object properties: adaptive_selection: type: object additionalProperties: $ref: '#/components/schemas/nodes._types.AdaptiveSelection' description: Statistics about adaptive replica selection. allocations: allOf: - $ref: '#/components/schemas/nodes._types.Allocations' description: Statistics about shard allocations on the node. breakers: type: object additionalProperties: $ref: '#/components/schemas/nodes._types.Breaker' description: Statistics about the field data circuit breaker. fs: allOf: - $ref: '#/components/schemas/nodes._types.FileSystem' description: 'File system information, data path, free disk space, read/write stats.' host: allOf: - $ref: '#/components/schemas/_types.Host' description: 'Network host for the node, based on the network host setting.' http: allOf: - $ref: '#/components/schemas/nodes._types.Http' description: HTTP connection information. ingest: allOf: - $ref: '#/components/schemas/nodes._types.Ingest' description: Statistics about ingest preprocessing. ip: oneOf: - $ref: '#/components/schemas/_types.Ip' - type: array items: $ref: '#/components/schemas/_types.Ip' description: IP address and port for the node. jvm: allOf: - $ref: '#/components/schemas/nodes._types.Jvm' description: 'JVM stats, memory pool information, garbage collection, buffer pools, number of loaded/unloaded classes.' name: allOf: - $ref: '#/components/schemas/_types.Name' description: "Human-readable identifier for the node.\nBased on the node name setting." os: allOf: - $ref: '#/components/schemas/nodes._types.OperatingSystem' description: 'Operating system stats, load average, mem, swap.' process: allOf: - $ref: '#/components/schemas/nodes._types.Process' description: 'Process statistics, memory consumption, cpu usage, open file descriptors.' roles: allOf: - $ref: '#/components/schemas/_types.NodeRoles' description: Roles assigned to the node. script: allOf: - $ref: '#/components/schemas/nodes._types.Scripting' description: Contains script statistics for the node. script_cache: type: object additionalProperties: oneOf: - $ref: '#/components/schemas/nodes._types.ScriptCache' - type: array items: $ref: '#/components/schemas/nodes._types.ScriptCache' thread_pool: type: object additionalProperties: $ref: '#/components/schemas/nodes._types.ThreadCount' description: 'Statistics about each thread pool, including current size, queue and rejected tasks.' timestamp: type: number transport: allOf: - $ref: '#/components/schemas/nodes._types.Transport' description: Transport statistics about sent and received bytes in cluster communication. transport_address: allOf: - $ref: '#/components/schemas/_types.TransportAddress' description: 'Host and port for the transport layer, used for internal communication between nodes in a cluster.' attributes: type: object additionalProperties: type: string description: Contains a list of attributes for the node. discovery: allOf: - $ref: '#/components/schemas/nodes._types.Discovery' description: Contains node discovery statistics for the node. indexing_pressure: allOf: - $ref: '#/components/schemas/nodes._types.IndexingPressure' description: Contains indexing pressure statistics for the node. indices: allOf: - $ref: '#/components/schemas/indices.stats.ShardStats' description: 'Indices stats about size, document count, indexing and deletion times, search times, field cache size, merges and flushes.' repositories: type: object additionalProperties: $ref: '#/components/schemas/nodes._types.RepositorySnapshotStats' description: 'Statistics about snapshot activity for the node''s registered repositories, keyed by repository name.' nodes._types.AdaptiveSelection: type: object properties: avg_queue_size: type: number description: The exponentially weighted moving average queue size of search requests on the keyed node. avg_response_time: allOf: - $ref: '#/components/schemas/_types.Duration' description: The exponentially weighted moving average response time of search requests on the keyed node. avg_response_time_ns: type: number description: 'The exponentially weighted moving average response time, in nanoseconds, of search requests on the keyed node.' avg_service_time: allOf: - $ref: '#/components/schemas/_types.Duration' description: The exponentially weighted moving average service time of search requests on the keyed node. avg_service_time_ns: type: number description: 'The exponentially weighted moving average service time, in nanoseconds, of search requests on the keyed node.' outgoing_searches: type: number description: The number of outstanding search requests to the keyed node from the node these stats are for. rank: type: string description: The rank of this node; used for shard selection when routing search requests. nodes._types.Allocations: type: object properties: shards: type: number description: Number of shards allocated to the node. undesired_shards: type: number description: Number of shards allocated to the node that are currently undesired. forecasted_ingest_load: type: number description: Forecasted ingest load for the node. forecasted_disk_usage: type: string description: Forecasted disk usage for the node. forecasted_disk_usage_in_bytes: type: number description: 'Forecasted disk usage, in bytes, for the node.' current_disk_usage: type: string description: Current disk usage for the node. current_disk_usage_in_bytes: type: number description: 'Current disk usage, in bytes, for the node.' nodes._types.Breaker: type: object properties: estimated_size: type: string description: Estimated memory used for the operation. estimated_size_in_bytes: type: number description: 'Estimated memory used, in bytes, for the operation.' limit_size: type: string description: Memory limit for the circuit breaker. limit_size_in_bytes: type: number description: 'Memory limit, in bytes, for the circuit breaker.' overhead: type: number description: A constant that all estimates for the circuit breaker are multiplied with to calculate a final estimate. tripped: type: number description: Total number of times the circuit breaker has been triggered and prevented an out of memory error. nodes._types.FileSystem: type: object properties: data: type: array items: $ref: '#/components/schemas/nodes._types.DataPathStats' description: List of all file stores. timestamp: type: number description: "Last time the file stores statistics were refreshed.\nRecorded in milliseconds since the Unix Epoch." total: allOf: - $ref: '#/components/schemas/nodes._types.FileSystemTotal' description: Contains statistics for all file stores of the node. io_stats: allOf: - $ref: '#/components/schemas/nodes._types.IoStats' description: Contains I/O statistics for the node. nodes._types.DataPathStats: type: object properties: available: type: string description: Total amount of disk space available to this Java virtual machine on this file store. available_in_bytes: type: number description: Total number of bytes available to this Java virtual machine on this file store. disk_queue: type: string disk_reads: type: number disk_read_size: type: string disk_read_size_in_bytes: type: number disk_writes: type: number disk_write_size: type: string disk_write_size_in_bytes: type: number free: type: string description: Total amount of unallocated disk space in the file store. free_in_bytes: type: number description: Total number of unallocated bytes in the file store. low_watermark_free_space: type: string description: 'The amount of free disk space that, once reached, triggers the low disk watermark.' low_watermark_free_space_in_bytes: type: number description: 'The amount of free disk space, in bytes, that, once reached, triggers the low disk watermark.' high_watermark_free_space: type: string description: 'The amount of free disk space that, once reached, triggers the high disk watermark.' high_watermark_free_space_in_bytes: type: number description: 'The amount of free disk space, in bytes, that, once reached, triggers the high disk watermark.' flood_stage_free_space: type: string description: 'The amount of free disk space that, once reached, triggers the flood stage disk watermark.' flood_stage_free_space_in_bytes: type: number description: 'The amount of free disk space, in bytes, that, once reached, triggers the flood stage disk watermark.' frozen_flood_stage_free_space: type: string description: 'The amount of free disk space that, once reached, triggers the frozen flood stage disk watermark.' frozen_flood_stage_free_space_in_bytes: type: number description: 'The amount of free disk space, in bytes, that, once reached, triggers the frozen flood stage disk watermark.' mount: type: string description: 'Mount point of the file store (for example: `/dev/sda2`).' path: type: string description: Path to the file store. total: type: string description: Total size of the file store. total_in_bytes: type: number description: Total size of the file store in bytes. type: type: string description: 'Type of the file store (ex: ext4).' nodes._types.FileSystemTotal: type: object properties: available: type: string description: "Total disk space available to this Java virtual machine on all file stores.\nDepending on OS or process level restrictions, this might appear less than `free`.\nThis is the actual amount of free disk space the Elasticsearch node can utilise." available_in_bytes: type: number description: "Total number of bytes available to this Java virtual machine on all file stores.\nDepending on OS or process level restrictions, this might appear less than `free_in_bytes`.\nThis is the actual amount of free disk space the Elasticsearch node can utilise." free: type: string description: Total unallocated disk space in all file stores. free_in_bytes: type: number description: Total number of unallocated bytes in all file stores. total: type: string description: Total size of all file stores. total_in_bytes: type: number description: Total size of all file stores in bytes. nodes._types.IoStats: type: object properties: devices: type: array items: $ref: '#/components/schemas/nodes._types.IoStatDevice' description: "Array of disk metrics for each device that is backing an Elasticsearch data path.\nThese disk metrics are probed periodically and averages between the last probe and the current probe are computed." total: allOf: - $ref: '#/components/schemas/nodes._types.IoStatDevice' description: The sum of the disk metrics for all devices that back an Elasticsearch data path. nodes._types.IoStatDevice: type: object properties: device_name: type: string description: The Linux device name. operations: type: number description: The total number of read and write operations for the device completed since starting Elasticsearch. read_kilobytes: type: number description: The total number of kilobytes read for the device since starting Elasticsearch. read_operations: type: number description: The total number of read operations for the device completed since starting Elasticsearch. write_kilobytes: type: number description: The total number of kilobytes written for the device since starting Elasticsearch. write_operations: type: number description: The total number of write operations for the device completed since starting Elasticsearch. nodes._types.Jvm: type: object properties: buffer_pools: type: object additionalProperties: $ref: '#/components/schemas/nodes._types.NodeBufferPool' description: Contains statistics about JVM buffer pools for the node. classes: allOf: - $ref: '#/components/schemas/nodes._types.JvmClasses' description: Contains statistics about classes loaded by JVM for the node. gc: allOf: - $ref: '#/components/schemas/nodes._types.GarbageCollector' description: Contains statistics about JVM garbage collectors for the node. mem: allOf: - $ref: '#/components/schemas/nodes._types.JvmMemoryStats' description: Contains JVM memory usage statistics for the node. threads: allOf: - $ref: '#/components/schemas/nodes._types.JvmThreads' description: Contains statistics about JVM thread usage for the node. timestamp: type: number description: Last time JVM statistics were refreshed. uptime: type: string description: "Human-readable JVM uptime.\nOnly returned if the `human` query parameter is `true`." uptime_in_millis: type: number description: JVM uptime in milliseconds. nodes._types.NodeBufferPool: type: object properties: count: type: number description: Number of buffer pools. total_capacity: type: string description: Total capacity of buffer pools. total_capacity_in_bytes: type: number description: Total capacity of buffer pools in bytes. used: type: string description: Size of buffer pools. used_in_bytes: type: number description: Size of buffer pools in bytes. nodes._types.JvmClasses: type: object properties: current_loaded_count: type: number description: Number of classes currently loaded by JVM. total_loaded_count: type: number description: Total number of classes loaded since the JVM started. total_unloaded_count: type: number description: Total number of classes unloaded since the JVM started. nodes._types.GarbageCollector: type: object properties: collectors: type: object additionalProperties: $ref: '#/components/schemas/nodes._types.GarbageCollectorTotal' description: Contains statistics about JVM garbage collectors for the node. nodes._types.GarbageCollectorTotal: type: object properties: collection_count: type: number description: Total number of JVM garbage collectors that collect objects. collection_time: type: string description: Total time spent by JVM collecting objects. collection_time_in_millis: type: number description: 'Total time, in milliseconds, spent by JVM collecting objects.' nodes._types.JvmMemoryStats: type: object properties: heap_used: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Memory currently in use by the heap. heap_used_in_bytes: type: number description: 'Memory, in bytes, currently in use by the heap.' heap_used_percent: type: number description: Percentage of memory currently in use by the heap. heap_committed: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Amount of memory available for use by the heap. heap_committed_in_bytes: type: number description: 'Amount of memory, in bytes, available for use by the heap.' heap_max_in_bytes: type: number description: 'Maximum amount of memory, in bytes, available for use by the heap.' heap_max: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: 'Maximum amount of memory, available for use by the heap.' non_heap_used: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Non-heap memory used. non_heap_used_in_bytes: type: number description: 'Non-heap memory used, in bytes.' non_heap_committed: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Amount of non-heap memory available. non_heap_committed_in_bytes: type: number description: 'Amount of non-heap memory available, in bytes.' pools: type: object additionalProperties: $ref: '#/components/schemas/nodes._types.Pool' description: Contains statistics about heap memory usage for the node. nodes._types.Pool: type: object properties: used: type: string description: Memory used by the heap. used_in_bytes: type: number description: 'Memory, in bytes, used by the heap.' max: type: string description: Maximum amount of memory available for use by the heap. max_in_bytes: type: number description: 'Maximum amount of memory, in bytes, available for use by the heap.' peak_used: type: string description: Largest amount of memory historically used by the heap. peak_used_in_bytes: type: number description: 'Largest amount of memory, in bytes, historically used by the heap.' peak_max: type: string description: Largest amount of memory historically used by the heap. peak_max_in_bytes: type: number description: 'Largest amount of memory, in bytes, historically used by the heap.' nodes._types.JvmThreads: type: object properties: count: type: number description: Number of active threads in use by JVM. peak_count: type: number description: Highest number of threads used by JVM. nodes._types.OperatingSystem: type: object properties: cpu: allOf: - $ref: '#/components/schemas/nodes._types.Cpu' mem: allOf: - $ref: '#/components/schemas/nodes._types.ExtendedMemoryStats' swap: allOf: - $ref: '#/components/schemas/nodes._types.MemoryStats' cgroup: allOf: - $ref: '#/components/schemas/nodes._types.Cgroup' timestamp: type: number nodes._types.Cpu: type: object properties: available_processors: type: number description: The number of processors available to the Java virtual machine. percent: type: number sys: allOf: - $ref: '#/components/schemas/_types.Duration' sys_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' total: allOf: - $ref: '#/components/schemas/_types.Duration' total_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' user: allOf: - $ref: '#/components/schemas/_types.Duration' user_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' load_average: type: object additionalProperties: type: number nodes._types.ExtendedMemoryStats: allOf: - $ref: '#/components/schemas/nodes._types.MemoryStats' - type: object properties: free_percent: type: number description: Percentage of free memory. used_percent: type: number description: Percentage of used memory. nodes._types.MemoryStats: type: object properties: adjusted_total: type: string description: "If the amount of physical memory has been overridden using the `es`.`total_memory_bytes` system property then this reports the overridden value.\nOtherwise it reports the same value as `total`." adjusted_total_in_bytes: type: number 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.\nOtherwise it reports the same value as `total_in_bytes`." resident: type: string resident_in_bytes: type: number share: type: string share_in_bytes: type: number total_virtual: type: string total_virtual_in_bytes: type: number total: type: string description: Total amount of physical memory. total_in_bytes: type: number description: Total amount of physical memory in bytes. free: type: string description: Amount of free physical memory. free_in_bytes: type: number description: Amount of free physical memory in bytes. used: type: string description: Amount of used physical memory. used_in_bytes: type: number description: Amount of used physical memory in bytes. nodes._types.Cgroup: type: object properties: cpuacct: allOf: - $ref: '#/components/schemas/nodes._types.CpuAcct' description: Contains statistics about `cpuacct` control group for the node. cpu: allOf: - $ref: '#/components/schemas/nodes._types.CgroupCpu' description: Contains statistics about `cpu` control group for the node. memory: allOf: - $ref: '#/components/schemas/nodes._types.CgroupMemory' description: Contains statistics about the memory control group for the node. nodes._types.CpuAcct: type: object properties: control_group: type: string description: The `cpuacct` control group to which the Elasticsearch process belongs. usage_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' description: 'The total CPU time, in nanoseconds, consumed by all tasks in the same cgroup as the Elasticsearch process.' nodes._types.CgroupCpu: type: object properties: control_group: type: string description: The `cpu` control group to which the Elasticsearch process belongs. cfs_period_micros: type: number description: 'The period of time, in microseconds, for how regularly all tasks in the same cgroup as the Elasticsearch process should have their access to CPU resources reallocated.' cfs_quota_micros: type: number description: 'The total amount of time, in microseconds, for which all tasks in the same cgroup as the Elasticsearch process can run during one period `cfs_period_micros`.' stat: allOf: - $ref: '#/components/schemas/nodes._types.CgroupCpuStat' description: Contains CPU statistics for the node. nodes._types.CgroupCpuStat: type: object properties: number_of_elapsed_periods: type: number description: The number of reporting periods (as specified by `cfs_period_micros`) that have elapsed. number_of_times_throttled: type: number description: The number of times all tasks in the same cgroup as the Elasticsearch process have been throttled. time_throttled_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' description: 'The total amount of time, in nanoseconds, for which all tasks in the same cgroup as the Elasticsearch process have been throttled.' nodes._types.CgroupMemory: type: object properties: control_group: type: string description: The `memory` control group to which the Elasticsearch process belongs. limit_in_bytes: type: string description: "The maximum amount of user memory (including file cache) allowed for all tasks in the same cgroup as the Elasticsearch process.\nThis 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.\nAny value that is too large to parse into a `long` almost certainly means no limit has been set for the cgroup." usage_in_bytes: type: string description: "The total current memory usage by processes in the cgroup, in bytes, by all tasks in the same cgroup as the Elasticsearch process.\nThis value is stored as a string for consistency with `limit_in_bytes`." nodes._types.Process: type: object properties: cpu: allOf: - $ref: '#/components/schemas/nodes._types.Cpu' description: Contains CPU statistics for the node. mem: allOf: - $ref: '#/components/schemas/nodes._types.MemoryStats' description: Contains virtual memory statistics for the node. open_file_descriptors: type: number description: Number of opened file descriptors associated with the current or `-1` if not supported. max_file_descriptors: type: number description: 'Maximum number of file descriptors allowed on the system, or `-1` if not supported.' timestamp: type: number description: "Last time the statistics were refreshed.\nRecorded in milliseconds since the Unix Epoch." nodes._types.ScriptCache: type: object properties: cache_evictions: type: number description: Total number of times the script cache has evicted old data. compilation_limit_triggered: type: number description: Total number of times the script compilation circuit breaker has limited inline script compilations. compilations: type: number description: Total number of inline script compilations performed by the node. context: type: string nodes._types.Transport: type: object properties: inbound_handling_time_histogram: type: array items: $ref: '#/components/schemas/nodes._types.TransportHistogram' description: 'The distribution of the time spent handling each inbound message on a transport thread, represented as a histogram.' outbound_handling_time_histogram: type: array items: $ref: '#/components/schemas/nodes._types.TransportHistogram' description: 'The distribution of the time spent sending each outbound transport message on a transport thread, represented as a histogram.' rx_count: type: number description: Total number of RX (receive) packets received by the node during internal cluster communication. rx_size: type: string description: Size of RX packets received by the node during internal cluster communication. rx_size_in_bytes: type: number description: 'Size, in bytes, of RX packets received by the node during internal cluster communication.' server_open: type: number description: Current number of inbound TCP connections used for internal communication between nodes. tx_count: type: number description: Total number of TX (transmit) packets sent by the node during internal cluster communication. tx_size: type: string description: Size of TX packets sent by the node during internal cluster communication. tx_size_in_bytes: type: number description: 'Size, in bytes, of TX packets sent by the node during internal cluster communication.' total_outbound_connections: type: number description: "The cumulative number of outbound transport connections that this node has opened since it started.\nEach transport connection may comprise multiple TCP connections but is only counted once in this statistic.\nTransport connections are typically long-lived so this statistic should remain constant in a stable cluster." actions: type: object additionalProperties: $ref: '#/components/schemas/nodes._types.TransportActionStats' description: 'Statistics about the transport messages sent and received by the node, broken down by action name.' nodes._types.TransportHistogram: type: object properties: count: type: number description: The number of times a transport thread took a period of time within the bounds of this bucket to handle an inbound message. lt: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The exclusive upper bound of the bucket.\nMay be omitted on the last bucket if this bucket has no upper bound." lt_millis: type: number description: "The exclusive upper bound of the bucket in milliseconds.\nMay be omitted on the last bucket if this bucket has no upper bound." ge: allOf: - $ref: '#/components/schemas/_types.Duration' description: The inclusive lower bound of the bucket. May be omitted on the first bucket if this bucket has no lower bound. ge_millis: type: number description: The inclusive lower bound of the bucket in milliseconds. May be omitted on the first bucket if this bucket has no lower bound. nodes._types.TransportActionStats: required: - requests - responses type: object properties: requests: allOf: - $ref: '#/components/schemas/nodes._types.TransportActionMessageStats' description: Statistics about the requests received for this action. responses: allOf: - $ref: '#/components/schemas/nodes._types.TransportActionMessageStats' description: Statistics about the responses sent for this action. nodes._types.TransportActionMessageStats: required: - count - total_size_in_bytes - histogram type: object properties: count: type: number description: The number of messages of this kind that the node has handled for this action. total_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The cumulative size of the messages of this kind that the node has handled for this action. total_size_in_bytes: type: number description: 'The cumulative size, in bytes, of the messages of this kind that the node has handled for this action.' histogram: type: array items: $ref: '#/components/schemas/nodes._types.TransportMessageSizeHistogramBucket' description: 'The distribution of the sizes of the messages of this kind that the node has handled for this action, represented as a histogram.' nodes._types.TransportMessageSizeHistogramBucket: required: - count type: object properties: count: type: number description: The number of messages with a size that falls within the bounds of this bucket. ge: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "The inclusive lower bound of the bucket.\nMay be omitted on the first bucket if this bucket has no lower bound." ge_bytes: type: number description: "The inclusive lower bound of the bucket in bytes.\nMay be omitted on the first bucket if this bucket has no lower bound." lt: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "The exclusive upper bound of the bucket.\nMay be omitted on the last bucket if this bucket has no upper bound." lt_bytes: type: number description: "The exclusive upper bound of the bucket in bytes.\nMay be omitted on the last bucket if this bucket has no upper bound." nodes._types.Discovery: type: object properties: cluster_state_queue: allOf: - $ref: '#/components/schemas/nodes._types.ClusterStateQueue' description: Contains statistics for the cluster state queue of the node. published_cluster_states: allOf: - $ref: '#/components/schemas/nodes._types.PublishedClusterStates' description: Contains statistics for the published cluster states of the node. cluster_state_update: type: object additionalProperties: $ref: '#/components/schemas/nodes._types.ClusterStateUpdate' description: "Contains low-level statistics about how long various activities took during cluster state updates while the node was the elected master.\nOmitted if the node is not master-eligible.\nEvery 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`.\nThe human-readable fields with a `_time` suffix are only returned if requested with the `?human=true` query parameter." serialized_cluster_states: allOf: - $ref: '#/components/schemas/nodes._types.SerializedClusterState' cluster_applier_stats: allOf: - $ref: '#/components/schemas/nodes._types.ClusterAppliedStats' nodes._types.ClusterStateQueue: type: object properties: total: type: number description: Total number of cluster states in queue. pending: type: number description: Number of pending cluster states in queue. committed: type: number description: Number of committed cluster states in queue. nodes._types.PublishedClusterStates: type: object properties: full_states: type: number description: Number of published cluster states. incompatible_diffs: type: number description: Number of incompatible differences between published cluster states. compatible_diffs: type: number description: Number of compatible differences between published cluster states. nodes._types.ClusterStateUpdate: required: - count type: object properties: count: type: number description: The number of cluster state update attempts that did not change the cluster state since the node started. computation_time: allOf: - $ref: '#/components/schemas/_types.Duration' description: The cumulative amount of time spent computing no-op cluster state updates since the node started. computation_time_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: 'The cumulative amount of time, in milliseconds, spent computing no-op cluster state updates since the node started.' publication_time: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The cumulative amount of time spent publishing cluster state updates which ultimately succeeded, which includes everything from the start of the publication (just after the computation of the new cluster state) until the publication has finished and the master node is ready to start processing the next state update.\nThis includes the time measured by `context_construction_time`, `commit_time`, `completion_time` and `master_apply_time`." publication_time_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: "The cumulative amount of time, in milliseconds, spent publishing cluster state updates which ultimately succeeded, which includes everything from the start of the publication (just after the computation of the new cluster state) until the publication has finished and the master node is ready to start processing the next state update.\nThis includes the time measured by `context_construction_time`, `commit_time`, `completion_time` and `master_apply_time`." context_construction_time: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The cumulative amount of time spent constructing a publication context since the node started for publications that ultimately succeeded.\nThis statistic includes the time spent computing the difference between the current and new cluster state preparing a serialized representation of this difference." context_construction_time_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: "The cumulative amount of time, in milliseconds, spent constructing a publication context since the node started for publications that ultimately succeeded.\nThis statistic includes the time spent computing the difference between the current and new cluster state preparing a serialized representation of this difference." commit_time: allOf: - $ref: '#/components/schemas/_types.Duration' description: 'The cumulative amount of time spent waiting for a successful cluster state update to commit, which measures the time from the start of each publication until a majority of the master-eligible nodes have written the state to disk and confirmed the write to the elected master.' commit_time_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: 'The cumulative amount of time, in milliseconds, spent waiting for a successful cluster state update to commit, which measures the time from the start of each publication until a majority of the master-eligible nodes have written the state to disk and confirmed the write to the elected master.' completion_time: allOf: - $ref: '#/components/schemas/_types.Duration' description: 'The cumulative amount of time spent waiting for a successful cluster state update to complete, which measures the time from the start of each publication until all the other nodes have notified the elected master that they have applied the cluster state.' completion_time_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: 'The cumulative amount of time, in milliseconds, spent waiting for a successful cluster state update to complete, which measures the time from the start of each publication until all the other nodes have notified the elected master that they have applied the cluster state.' master_apply_time: allOf: - $ref: '#/components/schemas/_types.Duration' description: The cumulative amount of time spent successfully applying cluster state updates on the elected master since the node started. master_apply_time_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: 'The cumulative amount of time, in milliseconds, spent successfully applying cluster state updates on the elected master since the node started.' notification_time: allOf: - $ref: '#/components/schemas/_types.Duration' description: The cumulative amount of time spent notifying listeners of a no-op cluster state update since the node started. notification_time_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: 'The cumulative amount of time, in milliseconds, spent notifying listeners of a no-op cluster state update since the node started.' nodes._types.SerializedClusterState: type: object properties: full_states: allOf: - $ref: '#/components/schemas/nodes._types.SerializedClusterStateDetail' description: Number of published cluster states. diffs: allOf: - $ref: '#/components/schemas/nodes._types.SerializedClusterStateDetail' nodes._types.SerializedClusterStateDetail: type: object properties: count: type: number uncompressed_size: type: string uncompressed_size_in_bytes: type: number compressed_size: type: string compressed_size_in_bytes: type: number nodes._types.ClusterAppliedStats: type: object properties: recordings: type: array items: $ref: '#/components/schemas/nodes._types.Recording' nodes._types.Recording: type: object properties: name: type: string cumulative_execution_count: type: number cumulative_execution_time: allOf: - $ref: '#/components/schemas/_types.Duration' cumulative_execution_time_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' nodes._types.IndexingPressure: type: object properties: memory: allOf: - $ref: '#/components/schemas/nodes._types.IndexingPressureMemory' description: Contains statistics for memory consumption from indexing load. nodes._types.RepositorySnapshotStats: required: - total_read_throttled_time_nanos - total_write_throttled_time_nanos - shard_snapshots_started - shard_snapshots_completed - shard_snapshots_in_progress - uploaded_blobs - uploaded_size_in_bytes - total_upload_time_in_millis - total_read_time_in_millis type: object properties: total_read_throttled_time: allOf: - $ref: '#/components/schemas/_types.Duration' description: The cumulative time spent throttling read operations for this repository. total_write_throttled_time: allOf: - $ref: '#/components/schemas/_types.Duration' description: The cumulative time spent throttling write operations for this repository. total_read_throttled_time_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' description: 'The cumulative time, in nanoseconds, spent throttling read operations for this repository.' total_write_throttled_time_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' description: 'The cumulative time, in nanoseconds, spent throttling write operations for this repository.' shard_snapshots_started: type: number description: The number of shard snapshots started for this repository. shard_snapshots_completed: type: number description: The number of shard snapshots completed for this repository. shard_snapshots_in_progress: type: number description: The number of shard snapshots currently in progress for this repository. uploaded_blobs: type: number description: The number of blobs uploaded to this repository. uploaded_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The cumulative size of the blobs uploaded to this repository. uploaded_size_in_bytes: type: number description: 'The cumulative size, in bytes, of the blobs uploaded to this repository.' total_upload_time: allOf: - $ref: '#/components/schemas/_types.Duration' description: The cumulative time spent uploading blobs to this repository. total_upload_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: 'The cumulative time, in milliseconds, spent uploading blobs to this repository.' total_read_time: allOf: - $ref: '#/components/schemas/_types.Duration' description: The cumulative time spent reading blobs while uploading to this repository. total_read_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: 'The cumulative time, in milliseconds, spent reading blobs while uploading to this repository.' nodes.usage.NodesUsageMetrics: oneOf: - $ref: '#/components/schemas/nodes.usage.NodesUsageMetric' - type: array items: $ref: '#/components/schemas/nodes.usage.NodesUsageMetric' nodes.usage.NodesUsageMetric: enum: - _all - rest_actions - aggregations type: string nodes.usage.ResponseBase: allOf: - $ref: '#/components/schemas/nodes._types.NodesResponseBase' - required: - cluster_name - nodes type: object properties: cluster_name: allOf: - $ref: '#/components/schemas/_types.Name' nodes: type: object additionalProperties: $ref: '#/components/schemas/nodes.usage.NodeUsage' nodes.usage.NodeUsage: required: - rest_actions - since - timestamp - aggregations type: object properties: rest_actions: type: object additionalProperties: type: number description: "The total number of times each REST endpoint has been called on this node since the last restart.\n Note that the REST endpoint names are not considered stable." since: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: The timestamp for when the collection of these statistics started. timestamp: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: The timestamp for when these statistics were collected. aggregations: type: object additionalProperties: type: object description: The total number of times search aggregations have been called on this node since the last restart. query_rules._types.QueryRule: required: - rule_id - type - criteria - actions type: object properties: rule_id: allOf: - $ref: '#/components/schemas/_types.Id' description: A unique identifier for the rule. type: allOf: - $ref: '#/components/schemas/query_rules._types.QueryRuleType' description: "The type of rule.\n`pinned` will identify and pin specific documents to the top of search results.\n`exclude` will exclude specific documents from search results." criteria: oneOf: - $ref: '#/components/schemas/query_rules._types.QueryRuleCriteria' - type: array items: $ref: '#/components/schemas/query_rules._types.QueryRuleCriteria' description: "The criteria that must be met for the rule to be applied.\nIf multiple criteria are specified for a rule, all criteria must be met for the rule to be applied." actions: allOf: - $ref: '#/components/schemas/query_rules._types.QueryRuleActions' description: "The actions to take when the rule is matched.\nThe format of this action depends on the rule type." priority: type: number query_rules._types.QueryRuleType: enum: - pinned - exclude type: string query_rules._types.QueryRuleCriteria: required: - type type: object properties: type: allOf: - $ref: '#/components/schemas/query_rules._types.QueryRuleCriteriaType' description: "The type of criteria. The following criteria types are supported:\n\n* `always`: Matches all queries, regardless of input.\n* `contains`: Matches that contain this value anywhere in the field meet the criteria defined by the rule. Only applicable for string values.\n* `exact`: Only exact matches meet the criteria defined by the rule. Applicable for string or numerical values.\n* `fuzzy`: Exact matches or matches within the allowed Levenshtein Edit Distance meet the criteria defined by the rule. Only applicable for string values.\n* `gt`: Matches with a value greater than this value meet the criteria defined by the rule. Only applicable for numerical values.\n* `gte`: Matches with a value greater than or equal to this value meet the criteria defined by the rule. Only applicable for numerical values.\n* `lt`: Matches with a value less than this value meet the criteria defined by the rule. Only applicable for numerical values.\n* `lte`: Matches with a value less than or equal to this value meet the criteria defined by the rule. Only applicable for numerical values.\n* `prefix`: Matches that start with this value meet the criteria defined by the rule. Only applicable for string values.\n* `suffix`: Matches that end with this value meet the criteria defined by the rule. Only applicable for string values." metadata: type: string description: "The metadata field to match against.\nThis metadata will be used to match against `match_criteria` sent in the rule.\nIt is required for all criteria types except `always`." values: type: array items: type: object description: "The values to match against the `metadata` field.\nOnly one value must match for the criteria to be met.\nIt is required for all criteria types except `always`." query_rules._types.QueryRuleCriteriaType: enum: - global - exact - fuzzy - prefix - suffix - contains - lt - lte - gt - gte - always type: string query_rules._types.QueryRuleActions: type: object properties: ids: type: array items: $ref: '#/components/schemas/_types.Id' description: "The unique document IDs of the documents to apply the rule to.\nOnly one of `ids` or `docs` may be specified and at least one must be specified." docs: type: array items: $ref: '#/components/schemas/_types.query_dsl.PinnedDoc' description: "The documents to apply the rule to.\nOnly one of `ids` or `docs` may be specified and at least one must be specified.\nThere is a maximum value of 100 documents in a rule.\nYou can specify the following attributes for each document:\n\n* `_index`: The index of the document to pin.\n* `_id`: The unique document ID." query_rules._types.QueryRuleset: required: - ruleset_id - rules type: object properties: ruleset_id: allOf: - $ref: '#/components/schemas/_types.Id' description: A unique identifier for the ruleset. rules: type: array items: $ref: '#/components/schemas/query_rules._types.QueryRule' description: Rules associated with the query ruleset. query_rules.list_rulesets.QueryRulesetListItem: required: - ruleset_id - rule_total_count - rule_criteria_types_counts - rule_type_counts type: object properties: ruleset_id: allOf: - $ref: '#/components/schemas/_types.Id' description: A unique identifier for the ruleset. rule_total_count: type: number description: The number of rules associated with the ruleset. rule_criteria_types_counts: type: object additionalProperties: type: number description: "A map of criteria type (for example, `exact`) to the number of rules of that type.\n\nNOTE: The counts in `rule_criteria_types_counts` may be larger than the value of `rule_total_count` because a rule may have multiple criteria." rule_type_counts: type: object additionalProperties: type: number description: 'A map of rule type (for example, `pinned`) to the number of rules of that type.' query_rules.test.QueryRulesetMatchedRule: required: - ruleset_id - rule_id type: object properties: ruleset_id: allOf: - $ref: '#/components/schemas/_types.Id' description: Ruleset unique identifier rule_id: allOf: - $ref: '#/components/schemas/_types.Id' description: Rule unique identifier within that ruleset _global.rank_eval.RankEvalRequestItem: required: - id - ratings type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: 'The search request’s ID, used to group result details later.' request: allOf: - $ref: '#/components/schemas/_global.rank_eval.RankEvalQuery' description: The query being evaluated. ratings: type: array items: $ref: '#/components/schemas/_global.rank_eval.DocumentRating' description: List of document ratings template_id: allOf: - $ref: '#/components/schemas/_types.Id' description: The search template Id params: type: object additionalProperties: type: object description: The search template parameters. _global.rank_eval.RankEvalQuery: required: - query type: object properties: query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' size: type: number _global.rank_eval.DocumentRating: required: - _id - _index - rating type: object properties: _id: allOf: - $ref: '#/components/schemas/_types.Id' description: The document ID. _index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: 'The document’s index. For data streams, this should be the document’s backing index.' rating: type: number description: The document’s relevance with regard to this search request. _global.rank_eval.RankEvalMetric: type: object properties: precision: allOf: - $ref: '#/components/schemas/_global.rank_eval.RankEvalMetricPrecision' recall: allOf: - $ref: '#/components/schemas/_global.rank_eval.RankEvalMetricRecall' mean_reciprocal_rank: allOf: - $ref: '#/components/schemas/_global.rank_eval.RankEvalMetricMeanReciprocalRank' dcg: allOf: - $ref: '#/components/schemas/_global.rank_eval.RankEvalMetricDiscountedCumulativeGain' expected_reciprocal_rank: allOf: - $ref: '#/components/schemas/_global.rank_eval.RankEvalMetricExpectedReciprocalRank' _global.rank_eval.RankEvalMetricPrecision: allOf: - $ref: '#/components/schemas/_global.rank_eval.RankEvalMetricRatingTreshold' - type: object properties: ignore_unlabeled: type: boolean description: 'Controls how unlabeled documents in the search results are counted. If set to true, unlabeled documents are ignored and neither count as relevant or irrelevant. Set to false (the default), they are treated as irrelevant.' default: false description: Precision at K (P@k) _global.rank_eval.RankEvalMetricRatingTreshold: allOf: - $ref: '#/components/schemas/_global.rank_eval.RankEvalMetricBase' - type: object properties: relevant_rating_threshold: type: number description: Sets the rating threshold above which documents are considered to be "relevant". default: 1 _global.rank_eval.RankEvalMetricBase: type: object properties: k: type: number description: Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query. default: 10 _global.rank_eval.RankEvalMetricRecall: allOf: - $ref: '#/components/schemas/_global.rank_eval.RankEvalMetricRatingTreshold' - type: object description: Recall at K (R@k) _global.rank_eval.RankEvalMetricMeanReciprocalRank: allOf: - $ref: '#/components/schemas/_global.rank_eval.RankEvalMetricRatingTreshold' - type: object description: Mean Reciprocal Rank _global.rank_eval.RankEvalMetricDiscountedCumulativeGain: allOf: - $ref: '#/components/schemas/_global.rank_eval.RankEvalMetricBase' - type: object properties: normalize: type: boolean description: 'If set to true, this metric will calculate the Normalized DCG.' default: false description: Discounted cumulative gain (DCG) _global.rank_eval.RankEvalMetricExpectedReciprocalRank: allOf: - $ref: '#/components/schemas/_global.rank_eval.RankEvalMetricBase' - required: - maximum_relevance type: object properties: maximum_relevance: type: number description: The highest relevance grade used in the user-supplied relevance judgments. description: Expected Reciprocal Rank (ERR) _global.rank_eval.RankEvalTemplate: required: - id - template type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: The ID of the template. A rated request refers to it by this ID in its `template_id`. template: allOf: - $ref: '#/components/schemas/_types.Script' description: "The search template, either an inline `source` or the `id` of a stored search template.\nIt must be a `mustache` template (the default `lang`), and it must render to a search request body.\nAny `params` set here are ignored: each rated request provides its own `params`, which are used to render the template." _global.rank_eval.RankEvalMetricDetail: required: - metric_score - took - unrated_docs - hits - metric_details type: object properties: metric_score: type: number description: The metric_score in the details section shows the contribution of this query to the global quality metric score took: type: number description: The time in milliseconds it took to execute the search request for this query unrated_docs: type: array items: $ref: '#/components/schemas/_global.rank_eval.UnratedDocument' description: The unrated_docs section contains an _index and _id entry for each document in the search result for this query that didn’t have a ratings value. This can be used to ask the user to supply ratings for these documents hits: type: array items: $ref: '#/components/schemas/_global.rank_eval.RankEvalHitItem' description: The hits section shows a grouping of the search results with their supplied ratings metric_details: type: object additionalProperties: type: object additionalProperties: type: object description: The metric_details give additional information about the calculated quality metric (e.g. how many of the retrieved documents were relevant). The content varies for each metric but allows for better interpretation of the results _global.rank_eval.UnratedDocument: required: - _id - _index type: object properties: _id: allOf: - $ref: '#/components/schemas/_types.Id' _index: allOf: - $ref: '#/components/schemas/_types.IndexName' _global.rank_eval.RankEvalHitItem: required: - hit type: object properties: hit: allOf: - $ref: '#/components/schemas/_global.rank_eval.RankEvalHit' rating: oneOf: - type: number - type: - 'null' - string _global.rank_eval.RankEvalHit: required: - _id - _index - _score type: object properties: _id: allOf: - $ref: '#/components/schemas/_types.Id' _index: allOf: - $ref: '#/components/schemas/_types.IndexName' _score: type: number _global.reindex.Destination: required: - index type: object properties: index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: 'The name of the data stream, index, or index alias you are copying to.' op_type: allOf: - $ref: '#/components/schemas/_types.OpType' description: "If it is `create`, the operation will only index documents that do not already exist (also known as \"put if absent\").\n\nIMPORTANT: To reindex to a data stream destination, this argument must be `create`.\n\nSupported values include:\n - `index`: Overwrite any documents that already exist.\n - `create`: Only index documents that do not already exist.\n\n" default: index pipeline: type: string description: The name of the pipeline to use. routing: type: string description: "By default, a document's routing is preserved unless it's changed by the script.\nIf it is `keep`, the routing on the bulk request sent for each match is set to the routing on the match.\nIf it is `discard`, the routing on the bulk request sent for each match is set to `null`.\nIf it is `=value`, the routing on the bulk request sent for each match is set to all value specified after the equals sign (`=`).\nNot allowed when `index.slice.enabled` is `true` for the destination index; use `_slice` instead." default: keep version_type: allOf: - $ref: '#/components/schemas/_types.VersionType' description: "The versioning to use for the indexing operation.\n\nSupported values include:\n - `internal`: Use internal versioning that starts at 1 and increments with each update or delete.\n - `external`: Only index the document if the specified version is strictly higher than the version of the stored document or if there is no existing document.\n - `external_gte`: Only index the document if the specified version is equal or higher than the version of the stored document or if there is no existing document.\nNOTE: The `external_gte` version type is meant for special use cases and should be used with care.\nIf used incorrectly, it can result in loss of data.\n\n" _global.reindex.Source: required: - index type: object properties: index: allOf: - $ref: '#/components/schemas/_types.Indices' description: "The name of the data stream, index, or alias you are copying from.\nIt accepts a comma-separated list to reindex from multiple sources." query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: 'The documents to reindex, which is defined with Query DSL.' remote: allOf: - $ref: '#/components/schemas/_global.reindex.RemoteSource' description: A remote instance of Elasticsearch that you want to index from. x-state: Generally available; Added in 5.0.0 size: type: number description: "The number of documents to index per batch.\nUse it when you are indexing from remote to ensure that the batches fit within the on-heap buffer, which defaults to a maximum size of 100 MB." default: 1000 slice: allOf: - $ref: '#/components/schemas/_types.SlicedScroll' description: Slice the reindex request manually using the provided slice ID and total number of slices. sort: allOf: - $ref: '#/components/schemas/_types.Sort' description: "A comma-separated list of `:` pairs to sort by before indexing.\nUse it in conjunction with `max_docs` to control what documents are reindexed.\n\nWARNING: Sort in reindex is deprecated.\nSorting in reindex was never guaranteed to index documents in order and prevents further development of reindex such as resilience and performance improvements.\nIf used in combination with `max_docs`, consider using a query filter instead." deprecated: true _source: allOf: - $ref: '#/components/schemas/_global.search._types.SourceConfig' description: "If `true`, reindex all source fields.\nSet it to a list to reindex select fields." default: 'true' runtime_mappings: allOf: - $ref: '#/components/schemas/_types.mapping.RuntimeFields' _global.reindex.RemoteSource: required: - host type: object properties: connect_timeout: allOf: - $ref: '#/components/schemas/_types.Duration' description: The remote connection timeout. default: 30s headers: type: object additionalProperties: type: string description: An object containing the headers of the request. host: allOf: - $ref: '#/components/schemas/_types.Host' description: "The URL for the remote instance of Elasticsearch that you want to index from.\nThis information is required when you're indexing from remote." username: allOf: - $ref: '#/components/schemas/_types.Username' description: The username to use for authentication with the remote host (required when using basic auth). password: allOf: - $ref: '#/components/schemas/_types.Password' description: The password to use for authentication with the remote host (required when using basic auth). api_key: type: string description: "The API key to use for authentication with the remote host (as an alternative to basic auth when the remote cluster is in Elastic Cloud).\n(It is not permitted to set this and also to set an `Authorization` header via `headers`.)" x-state: Generally available; Added in 9.3.0 socket_timeout: allOf: - $ref: '#/components/schemas/_types.Duration' description: The remote socket read timeout. default: 30s _types.Username: type: string tasks._types.GroupBy: enum: - nodes - parents - none type: string _global.reindex_rethrottle.ReindexNode: allOf: - $ref: '#/components/schemas/_spec_utils.BaseNode' - required: - tasks type: object properties: tasks: type: object additionalProperties: $ref: '#/components/schemas/_global.reindex_rethrottle.ReindexTask' _global.reindex_rethrottle.ReindexTask: required: - action - cancellable - cancelled - description - id - node - running_time_in_nanos - start_time_in_millis - status - type - headers type: object properties: action: type: string cancellable: type: boolean cancelled: type: boolean description: type: string id: type: number node: allOf: - $ref: '#/components/schemas/_types.Name' running_time_in_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' start_time_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' status: allOf: - $ref: '#/components/schemas/_global.reindex_rethrottle.ParentReindexStatus' type: type: string headers: allOf: - $ref: '#/components/schemas/_types.HttpHeaders' _global.reindex_rethrottle.ParentReindexStatus: required: - batches - deleted - noops - requests_per_second - retries - throttled_millis - throttled_until_millis - total - version_conflicts type: object properties: slices: type: array items: $ref: '#/components/schemas/_types.ReindexStatus' slice_id: type: number description: The slice ID batches: type: number description: The number of scroll responses pulled back by the reindex. created: type: number description: The number of documents that were successfully created. deleted: type: number description: The number of documents that were successfully deleted. noops: type: number description: The number of documents that were ignored because the script used for the reindex returned a `noop` value for `ctx.op`. requests_per_second: type: number description: The number of requests per second effectively executed during the reindex. retries: allOf: - $ref: '#/components/schemas/_types.Retries' description: The number of retries attempted by reindex. `bulk` is the number of bulk actions retried and `search` is the number of search actions retried. throttled: allOf: - $ref: '#/components/schemas/_types.Duration' throttled_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: Number of milliseconds the request slept to conform to `requests_per_second`. throttled_until: allOf: - $ref: '#/components/schemas/_types.Duration' throttled_until_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: "This field should always be equal to zero in a `_reindex` response.\nIt only has meaning when using the Task API, where it indicates the next time (in milliseconds since epoch) a throttled request will be executed again in order to conform to `requests_per_second`." total: type: number description: The number of documents that were successfully processed. updated: type: number description: 'The number of documents that were successfully updated, for example, a document with same ID already existed prior to reindex updating it.' version_conflicts: type: number description: The number of version conflicts that reindex hits. cancelled: type: string description: The reason for cancellation if the slice was canceled _spec_utils.BaseNode: required: - attributes - host - ip - name - transport_address type: object properties: attributes: type: object additionalProperties: type: string host: allOf: - $ref: '#/components/schemas/_types.Host' ip: allOf: - $ref: '#/components/schemas/_types.Ip' name: allOf: - $ref: '#/components/schemas/_types.Name' roles: allOf: - $ref: '#/components/schemas/_types.NodeRoles' transport_address: allOf: - $ref: '#/components/schemas/_types.TransportAddress' _global.reindex_rethrottle.ReindexTasks: oneOf: - type: array items: $ref: '#/components/schemas/_global.reindex_rethrottle.ReindexTask' - type: object additionalProperties: $ref: '#/components/schemas/_global.reindex_rethrottle.ParentReindexTask' _global.reindex_rethrottle.ParentReindexTask: allOf: - $ref: '#/components/schemas/_global.reindex_rethrottle.ReindexTask' - type: object properties: children: type: array items: $ref: '#/components/schemas/_global.reindex_rethrottle.ReindexTask' rollup.get_jobs.RollupJob: required: - config - stats - status type: object properties: config: allOf: - $ref: '#/components/schemas/rollup.get_jobs.RollupJobConfiguration' description: The rollup job configuration. stats: allOf: - $ref: '#/components/schemas/rollup.get_jobs.RollupJobStats' description: "Transient statistics about the rollup job, such as how many documents have been processed and how many rollup summary docs have been indexed.\nThese stats are not persisted.\nIf a node is restarted, these stats are reset." status: allOf: - $ref: '#/components/schemas/rollup.get_jobs.RollupJobStatus' description: The current status of the indexer for the rollup job. rollup.get_jobs.RollupJobConfiguration: required: - cron - groups - id - index_pattern - metrics - page_size - rollup_index - timeout type: object properties: cron: type: string groups: allOf: - $ref: '#/components/schemas/rollup._types.Groupings' id: allOf: - $ref: '#/components/schemas/_types.Id' index_pattern: type: string metrics: type: array items: $ref: '#/components/schemas/rollup._types.FieldMetric' page_size: type: number rollup_index: allOf: - $ref: '#/components/schemas/_types.IndexName' timeout: allOf: - $ref: '#/components/schemas/_types.Duration' rollup._types.Groupings: type: object properties: date_histogram: allOf: - $ref: '#/components/schemas/rollup._types.DateHistogramGrouping' description: "A date histogram group aggregates a date field into time-based buckets.\nThis group is mandatory; you currently cannot roll up documents without a timestamp and a `date_histogram` group." histogram: allOf: - $ref: '#/components/schemas/rollup._types.HistogramGrouping' description: The histogram group aggregates one or more numeric fields into numeric histogram intervals. terms: allOf: - $ref: '#/components/schemas/rollup._types.TermsGrouping' description: "The terms group can be used on keyword or numeric fields to allow bucketing via the terms aggregation at a later point.\nThe indexer enumerates and stores all values of a field for each time-period.\nThis can be potentially costly for high-cardinality groups such as IP addresses, especially if the time-bucket is particularly sparse." rollup._types.DateHistogramGrouping: required: - field type: object properties: delay: allOf: - $ref: '#/components/schemas/_types.Duration' description: "How long to wait before rolling up new documents.\nBy default, the indexer attempts to roll up all data that is available.\nHowever, it is not uncommon for data to arrive out of order.\nThe indexer is unable to deal with data that arrives after a time-span has been rolled up.\nYou need to specify a delay that matches the longest period of time you expect out-of-order data to arrive." field: allOf: - $ref: '#/components/schemas/_types.Field' description: The date field that is to be rolled up. format: type: string interval: allOf: - $ref: '#/components/schemas/_types.Duration' calendar_interval: allOf: - $ref: '#/components/schemas/_types.Duration' description: The interval of time buckets to be generated when rolling up. fixed_interval: allOf: - $ref: '#/components/schemas/_types.Duration' description: The interval of time buckets to be generated when rolling up. time_zone: allOf: - $ref: '#/components/schemas/_types.TimeZone' description: "Defines what `time_zone` the rollup documents are stored as.\nUnlike raw data, which can shift timezones on the fly, rolled documents have to be stored with a specific timezone.\nBy default, rollup documents are stored in `UTC`." rollup._types.HistogramGrouping: required: - fields - interval type: object properties: fields: allOf: - $ref: '#/components/schemas/_types.Fields' description: "The set of fields that you wish to build histograms for.\nAll fields specified must be some kind of numeric.\nOrder does not matter." interval: type: number description: "The interval of histogram buckets to be generated when rolling up.\nFor example, a value of `5` creates buckets that are five units wide (`0-5`, `5-10`, etc).\nNote that only one interval can be specified in the histogram group, meaning that all fields being grouped via the histogram must share the same interval." rollup._types.TermsGrouping: required: - fields type: object properties: fields: allOf: - $ref: '#/components/schemas/_types.Fields' description: "The set of fields that you wish to collect terms for.\nThis array can contain fields that are both keyword and numerics.\nOrder does not matter." rollup._types.FieldMetric: required: - field - metrics type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The field to collect metrics for. This must be a numeric of some kind. metrics: type: array items: $ref: '#/components/schemas/rollup._types.Metric' description: An array of metrics to collect for the field. At least one metric must be configured. rollup._types.Metric: enum: - min - max - sum - avg - value_count type: string rollup.get_jobs.RollupJobStats: required: - documents_processed - index_failures - index_time_in_ms - index_total - pages_processed - rollups_indexed - search_failures - search_time_in_ms - search_total - trigger_count - processing_time_in_ms - processing_total type: object properties: documents_processed: type: number index_failures: type: number index_time_in_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' index_total: type: number pages_processed: type: number rollups_indexed: type: number search_failures: type: number search_time_in_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' search_total: type: number trigger_count: type: number processing_time_in_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' processing_total: type: number rollup.get_jobs.RollupJobStatus: required: - job_state type: object properties: current_position: type: object additionalProperties: type: object job_state: allOf: - $ref: '#/components/schemas/rollup.get_jobs.IndexingJobState' upgraded_doc_id: type: boolean rollup.get_jobs.IndexingJobState: enum: - started - indexing - stopping - stopped - aborting type: string rollup.get_rollup_caps.RollupCapabilities: required: - rollup_jobs type: object properties: rollup_jobs: type: array items: $ref: '#/components/schemas/rollup.get_rollup_caps.RollupCapabilitySummary' description: 'There can be multiple, independent jobs configured for a single index or index pattern. Each of these jobs may have different configurations, so the API returns a list of all the various configurations available.' rollup.get_rollup_caps.RollupCapabilitySummary: required: - fields - index_pattern - job_id - rollup_index type: object properties: fields: type: object additionalProperties: type: array items: $ref: '#/components/schemas/rollup.get_rollup_caps.RollupFieldSummary' index_pattern: type: string job_id: type: string rollup_index: type: string rollup.get_rollup_caps.RollupFieldSummary: required: - agg type: object properties: agg: type: string calendar_interval: allOf: - $ref: '#/components/schemas/_types.Duration' time_zone: allOf: - $ref: '#/components/schemas/_types.TimeZone' rollup.get_rollup_index_caps.IndexCapabilities: required: - rollup_jobs type: object properties: rollup_jobs: type: array items: $ref: '#/components/schemas/rollup.get_rollup_index_caps.RollupJobSummary' rollup.get_rollup_index_caps.RollupJobSummary: required: - fields - index_pattern - job_id - rollup_index type: object properties: fields: type: object additionalProperties: type: array items: $ref: '#/components/schemas/rollup.get_rollup_index_caps.RollupJobSummaryField' index_pattern: type: string job_id: allOf: - $ref: '#/components/schemas/_types.Id' rollup_index: allOf: - $ref: '#/components/schemas/_types.IndexName' rollup.get_rollup_index_caps.RollupJobSummaryField: required: - agg type: object properties: agg: type: string time_zone: allOf: - $ref: '#/components/schemas/_types.TimeZone' calendar_interval: allOf: - $ref: '#/components/schemas/_types.Duration' _global.scripts_painless_execute.PainlessContext: enum: - painless_test - filter - score - boolean_field - date_field - double_field - geo_point_field - ip_field - keyword_field - long_field - composite_field type: string _global.scripts_painless_execute.PainlessContextSetup: required: - document - index type: object properties: document: type: object description: Document that's temporarily indexed in-memory and accessible from the script. index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: "Index containing a mapping that's compatible with the indexed document.\nYou may specify a remote index by prefixing the index with the remote cluster alias.\nFor example, `remote1:my_index` indicates that you want to run the painless script against the \"my_index\" index on the \"remote1\" cluster.\nThis request will be forwarded to the \"remote1\" cluster if you have configured a connection to that remote cluster.\n\nNOTE: Wildcards are not accepted in the index expression for this endpoint.\nThe expression `*:myindex` will return the error \"No such remote cluster\" and the expression `logs*` or `remote1:logs*` will return the error \"index not found\"." query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' description: Use this parameter to specify a query for computing a score. search_application._types.SearchApplication: allOf: - $ref: '#/components/schemas/search_application._types.SearchApplicationParameters' - required: - name - updated_at_millis type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' description: Search Application name updated_at_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: Last time the Search Application was updated. search_application._types.SearchApplicationParameters: required: - indices type: object properties: indices: type: array items: $ref: '#/components/schemas/_types.IndexName' description: Indices that are part of the Search Application. analytics_collection_name: allOf: - $ref: '#/components/schemas/_types.Name' description: Analytics collection associated to the Search Application. template: allOf: - $ref: '#/components/schemas/search_application._types.SearchApplicationTemplate' description: Search template to use on search operations. search_application._types.SearchApplicationTemplate: required: - script type: object properties: script: allOf: - $ref: '#/components/schemas/_types.Script' description: The associated mustache template. search_application._types.AnalyticsCollection: required: - event_data_stream type: object properties: event_data_stream: allOf: - $ref: '#/components/schemas/search_application._types.EventDataStream' description: Data stream for the collection. search_application._types.EventDataStream: required: - name type: object properties: name: allOf: - $ref: '#/components/schemas/_types.IndexName' search_application._types.EventType: enum: - page_view - search - search_click type: string search_application.put_behavioral_analytics.AnalyticsAcknowledgeResponseBase: allOf: - $ref: '#/components/schemas/_types.AcknowledgedResponseBase' - required: - name type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' description: The name of the analytics collection created or updated _global.search_mvt._types.ZoomLevel: type: number _global.search_mvt._types.Coordinate: type: number _global.search_mvt._types.GridAggregationType: enum: - geotile - geohex type: string _global.search_mvt._types.GridType: enum: - grid - point - centroid type: string _types.MapboxVectorTiles: type: object _global.search_shards.SearchShardsNodeAttributes: required: - name - ephemeral_id - transport_address - external_id - attributes - roles - version - min_index_version - max_index_version type: object properties: name: allOf: - $ref: '#/components/schemas/_types.NodeName' description: The human-readable identifier of the node. ephemeral_id: allOf: - $ref: '#/components/schemas/_types.Id' description: The ephemeral ID of the node. transport_address: allOf: - $ref: '#/components/schemas/_types.TransportAddress' description: The host and port where transport HTTP connections are accepted. external_id: type: string x-state: Generally available; Added in 8.3.0 attributes: type: object additionalProperties: type: string description: Lists node attributes. roles: allOf: - $ref: '#/components/schemas/_types.NodeRoles' version: allOf: - $ref: '#/components/schemas/_types.VersionString' min_index_version: type: number max_index_version: type: number _types.NodeShard: required: - state - primary - shard - index type: object properties: state: allOf: - $ref: '#/components/schemas/indices.stats.ShardRoutingState' primary: type: boolean node: allOf: - $ref: '#/components/schemas/_types.NodeName' shard: type: number index: allOf: - $ref: '#/components/schemas/_types.IndexName' allocation_id: type: object additionalProperties: $ref: '#/components/schemas/_types.Id' recovery_source: type: object additionalProperties: $ref: '#/components/schemas/_types.Id' unassigned_info: allOf: - $ref: '#/components/schemas/cluster.allocation_explain.UnassignedInformation' relocating_node: oneOf: - $ref: '#/components/schemas/_types.NodeId' - type: - 'null' - string relocation_failure_info: allOf: - $ref: '#/components/schemas/_types.RelocationFailureInfo' _types.RelocationFailureInfo: required: - failed_attempts type: object properties: failed_attempts: type: number _global.search_shards.ShardStoreIndex: type: object properties: aliases: type: array items: $ref: '#/components/schemas/_types.Name' filter: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' searchable_snapshots.cache_stats.Node: required: - shared_cache type: object properties: shared_cache: allOf: - $ref: '#/components/schemas/searchable_snapshots.cache_stats.Shared' searchable_snapshots.cache_stats.Shared: required: - reads - bytes_read_in_bytes - writes - bytes_written_in_bytes - evictions - num_regions - size_in_bytes - region_size_in_bytes type: object properties: reads: type: number bytes_read_in_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' writes: type: number bytes_written_in_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' evictions: type: number num_regions: type: number size_in_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' region_size_in_bytes: allOf: - $ref: '#/components/schemas/_types.ByteSize' searchable_snapshots.mount.StorageOption: enum: - full_copy - shared_cache type: string searchable_snapshots.mount.MountedSnapshot: required: - snapshot - indices - shards type: object properties: snapshot: allOf: - $ref: '#/components/schemas/_types.Name' indices: allOf: - $ref: '#/components/schemas/_types.Indices' shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' searchable_snapshots._types.StatsLevel: enum: - cluster - indices - shards type: string security._types.GrantType: enum: - password - access_token type: string security._types.UserProfileWithMetadata: allOf: - $ref: '#/components/schemas/security._types.UserProfile' - required: - last_synchronized - _doc type: object properties: last_synchronized: type: number _doc: allOf: - $ref: '#/components/schemas/security._types.UserProfileHitMetadata' security._types.UserProfileHitMetadata: required: - _primary_term - _seq_no type: object properties: _primary_term: type: number _seq_no: allOf: - $ref: '#/components/schemas/_types.SequenceNumber' security._types.UserProfile: required: - uid - user - data - labels type: object properties: uid: allOf: - $ref: '#/components/schemas/security._types.UserProfileId' user: allOf: - $ref: '#/components/schemas/security._types.UserProfileUser' data: type: object additionalProperties: type: object labels: type: object additionalProperties: type: object enabled: type: boolean security._types.UserProfileId: type: string security._types.UserProfileUser: required: - realm_name - roles - username type: object properties: email: oneOf: - type: string - type: - 'null' - string full_name: oneOf: - $ref: '#/components/schemas/_types.Name' - type: - 'null' - string realm_name: allOf: - $ref: '#/components/schemas/_types.Name' realm_domain: allOf: - $ref: '#/components/schemas/_types.Name' roles: type: array items: type: string username: allOf: - $ref: '#/components/schemas/_types.Username' security.authenticate.AuthenticateApiKey: required: - id - managed_by type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' name: allOf: - $ref: '#/components/schemas/_types.Name' managed_by: allOf: - $ref: '#/components/schemas/security._types.CredentialManagedBy' internal: type: boolean security._types.CredentialManagedBy: enum: - cloud - elasticsearch type: string security._types.RealmInfo: required: - name - type type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' type: type: string security.authenticate.Token: type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' type: type: string x-state: Generally available; Added in 7.14.0 managed_by: allOf: - $ref: '#/components/schemas/security._types.CredentialManagedBy' x-state: Generally available; Added in 9.4.0 security._types.BulkError: required: - count - details type: object properties: count: type: number description: The number of errors details: type: object additionalProperties: $ref: '#/components/schemas/_types.ErrorCause' description: 'Details about the errors, keyed by role name' security._types.RoleDescriptor: type: object properties: cluster: type: array items: $ref: '#/components/schemas/security._types.ClusterPrivilege' description: A list of cluster privileges. These privileges define the cluster level actions that API keys are able to execute. indices: type: array items: $ref: '#/components/schemas/security._types.IndicesPrivileges' description: A list of indices permissions entries. remote_indices: type: array items: $ref: '#/components/schemas/security._types.RemoteIndicesPrivileges' description: A list of indices permissions for remote clusters. x-state: Generally available; Added in 8.14.0 remote_cluster: type: array items: $ref: '#/components/schemas/security._types.RemoteClusterPrivileges' description: "A list of cluster permissions for remote clusters.\nNOTE: This is limited a subset of the cluster permissions." x-state: Generally available; Added in 8.15.0 global: allOf: - $ref: '#/components/schemas/security._types.GlobalPrivilege' description: An object defining global privileges. A global privilege is a form of cluster privilege that is request-aware. applications: type: array items: $ref: '#/components/schemas/security._types.ApplicationPrivileges' description: A list of application privilege entries metadata: allOf: - $ref: '#/components/schemas/_types.Metadata' description: 'Optional meta-data. Within the metadata object, keys that begin with `_` are reserved for system usage.' run_as: type: array items: type: string description: "A list of users that the API keys can impersonate.\nNOTE: In Elastic Cloud Serverless, the run-as feature is disabled.\nFor API compatibility, you can still specify an empty `run_as` field, but a non-empty list will be rejected." externalDocs: url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/submitting-requests-on-behalf-of-other-users description: type: string description: Optional description of the role descriptor restriction: allOf: - $ref: '#/components/schemas/security._types.Restriction' description: Restriction for when the role descriptor is allowed to be effective. transient_metadata: type: object additionalProperties: type: object security._types.ClusterPrivilege: anyOf: - enum: - all - cancel_task - clone_api_key - create_snapshot - cross_cluster_replication - cross_cluster_search - delegate_pki - grant_api_key - manage - manage_api_key - manage_autoscaling - manage_behavioral_analytics - manage_ccr - manage_data_frame_transforms - manage_data_stream_global_retention - manage_enrich - manage_esql - manage_ilm - manage_index_templates - manage_inference - manage_ingest_pipelines - manage_logstash_pipelines - manage_ml - manage_oidc - manage_own_api_key - manage_pipeline - manage_reindex - manage_rollup - manage_saml - manage_search_application - manage_search_query_rules - manage_search_synonyms - manage_security - manage_service_account - manage_slm - manage_token - manage_transform - manage_user_profile - manage_watcher - monitor - monitor_data_frame_transforms - monitor_data_stream_global_retention - monitor_enrich - monitor_esql - monitor_inference - monitor_ml - monitor_reindex - monitor_rollup - monitor_snapshot - monitor_stats - monitor_text_structure - monitor_transform - monitor_watcher - none - post_behavioral_analytics_event - read_ccr - read_fleet_secrets - read_ilm - read_pipeline - read_security - read_slm - transport_client - write_connector_secrets - write_fleet_secrets type: string - type: string security._types.IndicesPrivileges: required: - names - privileges type: object properties: field_security: allOf: - $ref: '#/components/schemas/security._types.FieldSecurity' description: The document fields that the owners of the role have read access to. externalDocs: url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/controlling-access-at-document-field-level names: oneOf: - $ref: '#/components/schemas/_types.IndexName' - type: array items: $ref: '#/components/schemas/_types.IndexName' description: A list of indices (or index name patterns) to which the permissions in this entry apply. privileges: type: array items: $ref: '#/components/schemas/security._types.IndexPrivilege' description: The index level privileges that owners of the role have on the specified indices. query: allOf: - $ref: '#/components/schemas/security._types.IndicesPrivilegesQuery' description: A search query that defines the documents the owners of the role have access to. A document within the specified indices must match this query for it to be accessible by the owners of the role. allow_restricted_indices: type: boolean description: 'Set to `true` if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the `names` list, Elasticsearch checks privileges against these indices regardless of the value set for `allow_restricted_indices`.' default: false security._types.FieldSecurity: type: object properties: except: allOf: - $ref: '#/components/schemas/_types.Fields' grant: allOf: - $ref: '#/components/schemas/_types.Fields' security._types.IndexPrivilege: anyOf: - enum: - all - auto_configure - create - create_doc - create_index - create_view - cross_cluster_replication - cross_cluster_replication_internal - delete - delete_index - delete_view - index - maintenance - manage - manage_data_stream_lifecycle - manage_follow_index - manage_ilm - manage_leader_index - manage_view - monitor - none - read - read_cross_cluster - read_view_metadata - view_index_metadata - write type: string - type: string security._types.IndicesPrivilegesQuery: oneOf: - type: string - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' - $ref: '#/components/schemas/security._types.RoleTemplateQuery' description: "While creating or updating a role you can provide either a JSON structure or a string to the API.\nHowever, the response provided by Elasticsearch will only be string with a json-as-text content.\n\nSince this is embedded in `IndicesPrivileges`, the same structure is used for clarity in both contexts." security._types.RoleTemplateQuery: type: object properties: template: allOf: - $ref: '#/components/schemas/security._types.RoleTemplateScript' description: "When you create a role, you can specify a query that defines the document level security permissions. You can optionally\nuse Mustache templates in the role query to insert the username of the current authenticated user into the role.\nLike other places in Elasticsearch that support templating or scripting, you can specify inline, stored, or file-based\ntemplates and define custom parameters. You access the details for the current authenticated user through the _user parameter." externalDocs: url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/controlling-access-at-document-field-level#templating-role-query security._types.RoleTemplateScript: type: object properties: source: allOf: - $ref: '#/components/schemas/security._types.RoleTemplateInlineQuery' id: allOf: - $ref: '#/components/schemas/_types.Id' description: The `id` for a stored script. params: type: object additionalProperties: type: object description: "Specifies any named parameters that are passed into the script as variables.\nUse parameters instead of hard-coded values to decrease compile time." lang: allOf: - $ref: '#/components/schemas/_types.ScriptLanguage' description: "Specifies the language the script is written in.\n\nSupported values include:\n - `painless`: Painless scripting language, purpose-built for Elasticsearch.\n - `expression`: Lucene’s expressions language, compiles a JavaScript expression to bytecode.\n - `mustache`: Mustache templated, used for templates.\n - `java`: Expert Java API\n\n" default: painless options: type: object additionalProperties: type: string externalDocs: description: Templating a role query url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/controlling-access-at-document-field-level#templating-role-query x-model: true security._types.RoleTemplateInlineQuery: oneOf: - type: string - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' security._types.RemoteIndicesPrivileges: required: - clusters - names - privileges type: object properties: clusters: allOf: - $ref: '#/components/schemas/_types.Names' description: A list of cluster aliases to which the permissions in this entry apply. field_security: allOf: - $ref: '#/components/schemas/security._types.FieldSecurity' description: The document fields that the owners of the role have read access to. externalDocs: url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/controlling-access-at-document-field-level names: oneOf: - $ref: '#/components/schemas/_types.IndexName' - type: array items: $ref: '#/components/schemas/_types.IndexName' description: A list of indices (or index name patterns) to which the permissions in this entry apply. privileges: type: array items: $ref: '#/components/schemas/security._types.IndexPrivilege' description: The index level privileges that owners of the role have on the specified indices. query: allOf: - $ref: '#/components/schemas/security._types.IndicesPrivilegesQuery' description: A search query that defines the documents the owners of the role have access to. A document within the specified indices must match this query for it to be accessible by the owners of the role. allow_restricted_indices: type: boolean description: 'Set to `true` if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the `names` list, Elasticsearch checks privileges against these indices regardless of the value set for `allow_restricted_indices`.' default: false description: The subset of index level privileges that can be defined for remote clusters. security._types.RemoteClusterPrivileges: required: - clusters - privileges type: object properties: clusters: allOf: - $ref: '#/components/schemas/_types.Names' description: A list of cluster aliases to which the permissions in this entry apply. privileges: type: array items: $ref: '#/components/schemas/security._types.RemoteClusterPrivilege' description: The cluster level privileges that owners of the role have on the remote cluster. description: The subset of cluster level privileges that can be defined for remote clusters. security._types.RemoteClusterPrivilege: enum: - monitor_enrich - monitor_stats type: string security._types.GlobalPrivilege: type: object properties: application: allOf: - $ref: '#/components/schemas/security._types.ApplicationGlobalUserPrivileges' profile: allOf: - $ref: '#/components/schemas/security._types.WriteProfileGlobalUserPrivileges' description: A privilege that grants the ability to write the `data` and `access` sections of user profiles for the specified applications. role: allOf: - $ref: '#/components/schemas/security._types.ManageRolesGlobalUserPrivileges' description: A privilege that grants the ability to manage roles that are scoped to the specified indices. data_source: type: array items: $ref: '#/components/schemas/security._types.DataSourcePrivileges' description: 'A list of data source privilege entries, used to grant access to ES|QL data sources.' x-state: Generally available; Added in 9.5.0 security._types.ApplicationGlobalUserPrivileges: type: object properties: manage: allOf: - $ref: '#/components/schemas/security._types.ManageUserPrivileges' description: "The applications for which application privileges can be managed.\nAbsent when the `application` section is present but grants no privileges." security._types.ManageUserPrivileges: required: - applications type: object properties: applications: type: array items: type: string security._types.WriteProfileGlobalUserPrivileges: type: object properties: write: allOf: - $ref: '#/components/schemas/security._types.ManageUserPrivileges' description: "The applications for which user profile data can be written.\nAbsent when the `profile` section is present but grants no privileges." security._types.ManageRolesGlobalUserPrivileges: type: object properties: manage: allOf: - $ref: '#/components/schemas/security._types.ManageRolesPrivileges' description: "The index-scoped role management privileges.\nAbsent when the `role` section is present but grants no privileges." security._types.ManageRolesPrivileges: required: - indices type: object properties: indices: type: array items: $ref: '#/components/schemas/security._types.ManageRolesIndexPermissions' security._types.ManageRolesIndexPermissions: required: - names - privileges type: object properties: names: type: array items: type: string description: A list of indices (or index name patterns) that the owners of the role can manage roles for. privileges: type: array items: type: string description: The index privileges that the managed roles are allowed to grant on the specified indices. security._types.DataSourcePrivileges: required: - names - privileges type: object properties: names: type: array items: type: string description: A list of data source names or wildcard patterns to which the permissions in this entry apply. privileges: type: array items: $ref: '#/components/schemas/security._types.DataSourcePrivilege' description: "The data source privileges that owners of the role have for the specified data sources.\n\nSupported values include:\n - `create`: Grants privilege to create a data source with a matching name.\n - `delete`: Grants privilege to delete a data source with a matching name.\n - `read_metadata`: Grants privilege to read a data source's metadata.\n - `read`: Grants privilege to attach a dataset to a data source with a matching name.\n - `manage`: Grants all data source privileges, including `create`, `delete`, `read`, and `read_metadata`.\n\n" security._types.DataSourcePrivilege: anyOf: - enum: - create - delete - read_metadata - read - manage type: string - type: string security._types.ApplicationPrivileges: required: - application - privileges - resources type: object properties: application: type: string description: The name of the application to which this entry applies. privileges: type: array items: type: string description: 'A list of strings, where each element is the name of an application privilege or action.' resources: type: array items: type: string description: A list resources to which the privileges are applied. security._types.Restriction: required: - workflows type: object properties: workflows: type: array items: $ref: '#/components/schemas/security._types.RestrictionWorkflow' description: "A list of workflows to which the API key is restricted.\nNOTE: In order to use a role restriction, an API key must be created with a single role descriptor." security._types.RestrictionWorkflow: anyOf: - enum: - search_application_query type: string - type: string security._types.ClusterNode: required: - name type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' _types.Namespace: type: string _types.Service: type: string security._types.Access: type: object properties: replication: type: array items: $ref: '#/components/schemas/security._types.ReplicationAccess' description: A list of indices permission entries for cross-cluster replication. search: type: array items: $ref: '#/components/schemas/security._types.SearchAccess' description: A list of indices permission entries for cross-cluster search. security._types.ReplicationAccess: required: - names type: object properties: names: oneOf: - $ref: '#/components/schemas/_types.IndexName' - type: array items: $ref: '#/components/schemas/_types.IndexName' description: A list of indices (or index name patterns) to which the permissions in this entry apply. allow_restricted_indices: type: boolean description: This needs to be set to true if the patterns in the names field should cover system indices. default: false security._types.SearchAccess: required: - names type: object properties: field_security: allOf: - $ref: '#/components/schemas/security._types.FieldSecurity' description: The document fields that the owners of the role have read access to. externalDocs: url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/controlling-access-at-document-field-level names: oneOf: - $ref: '#/components/schemas/_types.IndexName' - type: array items: $ref: '#/components/schemas/_types.IndexName' description: A list of indices (or index name patterns) to which the permissions in this entry apply. query: allOf: - $ref: '#/components/schemas/security._types.IndicesPrivilegesQuery' description: A search query that defines the documents the owners of the role have access to. A document within the specified indices must match this query for it to be accessible by the owners of the role. allow_restricted_indices: type: boolean description: 'Set to `true` if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the `names` list, Elasticsearch checks privileges against these indices regardless of the value set for `allow_restricted_indices`.' default: false security.create_service_token.Token: required: - name - value type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' value: type: string security.delegate_pki.Authentication: required: - username - roles - full_name - email - metadata - enabled - authentication_realm - lookup_realm - authentication_type type: object properties: username: type: string roles: type: array items: type: string full_name: oneOf: - type: string - type: - 'null' - string email: oneOf: - type: string - type: - 'null' - string token: type: object additionalProperties: type: string metadata: allOf: - $ref: '#/components/schemas/_types.Metadata' enabled: type: boolean authentication_realm: allOf: - $ref: '#/components/schemas/security.delegate_pki.AuthenticationRealm' lookup_realm: allOf: - $ref: '#/components/schemas/security.delegate_pki.AuthenticationRealm' authentication_type: type: string api_key: type: object additionalProperties: type: string security.delegate_pki.AuthenticationRealm: required: - name - type type: object properties: name: type: string type: type: string domain: type: string security.delete_privileges.FoundStatus: required: - found type: object properties: found: type: boolean security.enroll_kibana.Token: required: - name - value type: object properties: name: type: string description: The name of the bearer token for the `elastic/kibana` service account. value: type: string description: "The value of the bearer token for the `elastic/kibana` service account.\nUse this value to authenticate the service account with Elasticsearch." security._types.ApiKey: required: - id - name - type - creation - invalidated - username - realm - metadata type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: Id for the API key name: allOf: - $ref: '#/components/schemas/_types.Name' description: Name of the API key. type: allOf: - $ref: '#/components/schemas/security._types.ApiKeyType' description: The type of the API key (e.g. `rest` or `cross_cluster`). x-state: Generally available; Added in 8.10.0 creation: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: Creation time for the API key in milliseconds. expiration: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: Expiration time for the API key in milliseconds. invalidated: type: boolean description: "Invalidation status for the API key.\nIf the key has been invalidated, it has a value of `true`. Otherwise, it is `false`." invalidation: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: 'If the key has been invalidated, invalidation time in milliseconds.' x-state: Generally available; Added in 8.12.0 username: allOf: - $ref: '#/components/schemas/_types.Username' description: Principal for which this API key was created realm: type: string description: Realm name of the principal for which this API key was created. realm_type: type: string description: Realm type of the principal for which this API key was created x-state: Generally available; Added in 8.14.0 metadata: allOf: - $ref: '#/components/schemas/_types.Metadata' description: Metadata of the API key x-state: Generally available; Added in 7.13.0 role_descriptors: type: object additionalProperties: $ref: '#/components/schemas/security._types.RoleDescriptor' description: "The role descriptors assigned to this API key when it was created or last updated.\nAn empty role descriptor means the API key inherits the owner user’s permissions." limited_by: type: array items: type: object additionalProperties: $ref: '#/components/schemas/security._types.RoleDescriptor' description: "The owner user’s permissions associated with the API key.\nIt is a point-in-time snapshot captured at creation and subsequent updates.\nAn API key’s effective permissions are an intersection of its assigned privileges and the owner user’s permissions." x-state: Generally available; Added in 8.5.0 access: allOf: - $ref: '#/components/schemas/security._types.Access' description: "The access granted to cross-cluster API keys.\nThe access is composed of permissions for cross cluster search and cross cluster replication.\nAt least one of them must be specified.\nWhen specified, the new access assignment fully replaces the previously assigned access." x-state: Generally available; Added in 8.10.0 certificate_identity: type: string description: "The certificate identity associated with a cross-cluster API key.\nRestricts the API key to connections authenticated by a specific TLS certificate.\nOnly applicable to cross-cluster API keys." x-state: Generally available; Added in 9.3.0 profile_uid: type: string description: 'The profile uid for the API key owner principal, if requested and if it exists' x-state: Generally available; Added in 8.14.0 _sort: allOf: - $ref: '#/components/schemas/_types.SortResults' description: Sorting values when using the `sort` parameter with the `security.query_api_keys` API. security._types.ApiKeyType: enum: - rest - cross_cluster type: string security.put_privileges.Actions: required: - actions type: object properties: actions: type: array items: type: string application: type: string name: allOf: - $ref: '#/components/schemas/_types.Name' metadata: allOf: - $ref: '#/components/schemas/_types.Metadata' security.get_role.Role: required: - cluster - indices - metadata - applications type: object properties: cluster: type: array items: $ref: '#/components/schemas/security._types.ClusterPrivilege' indices: type: array items: $ref: '#/components/schemas/security.get_role.IndicesPrivilegesRead' remote_indices: type: array items: $ref: '#/components/schemas/security._types.RemoteIndicesPrivileges' x-state: Generally available; Added in 8.14.0 remote_cluster: type: array items: $ref: '#/components/schemas/security._types.RemoteClusterPrivileges' x-state: Generally available; Added in 8.15.0 metadata: allOf: - $ref: '#/components/schemas/_types.Metadata' description: type: string run_as: type: array items: type: string transient_metadata: type: object additionalProperties: type: object applications: type: array items: $ref: '#/components/schemas/security._types.ApplicationPrivileges' role_templates: type: array items: $ref: '#/components/schemas/security._types.RoleTemplate' global: allOf: - $ref: '#/components/schemas/security._types.GlobalPrivilege' x-state: Generally available; Added in 8.0.0 security.get_role.IndicesPrivilegesRead: required: - names - privileges type: object properties: implicitly_granted: type: boolean description: "Set to `true` on entries that were contributed by a registered `ImplicitPrivilegesProvider`\nrather than explicitly stored on the role. Only present when the get role API is called with\n`include_implicit=true`. The put role API rejects this field, so clients must not echo it back\non a GET-then-PUT round-trip." x-state: Generally available; Added in 9.5.0 field_security: allOf: - $ref: '#/components/schemas/security._types.FieldSecurity' description: The document fields that the owners of the role have read access to. externalDocs: url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/controlling-access-at-document-field-level names: oneOf: - $ref: '#/components/schemas/_types.IndexName' - type: array items: $ref: '#/components/schemas/_types.IndexName' description: A list of indices (or index name patterns) to which the permissions in this entry apply. privileges: type: array items: $ref: '#/components/schemas/security._types.IndexPrivilege' description: The index level privileges that owners of the role have on the specified indices. query: allOf: - $ref: '#/components/schemas/security._types.IndicesPrivilegesQuery' description: A search query that defines the documents the owners of the role have access to. A document within the specified indices must match this query for it to be accessible by the owners of the role. allow_restricted_indices: type: boolean description: 'Set to `true` if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the `names` list, Elasticsearch checks privileges against these indices regardless of the value set for `allow_restricted_indices`.' default: false description: "Read-side variant of `IndicesPrivileges` returned by the get role API.\nCarries the `implicitly_granted` marker that is set on entries contributed by\na registered `ImplicitPrivilegesProvider` when `include_implicit` is `true`." security._types.RoleTemplate: required: - template type: object properties: format: allOf: - $ref: '#/components/schemas/security._types.TemplateFormat' template: allOf: - $ref: '#/components/schemas/_types.Script' security._types.TemplateFormat: enum: - string - json type: string security._types.RoleMapping: required: - enabled - metadata - rules type: object properties: enabled: type: boolean metadata: allOf: - $ref: '#/components/schemas/_types.Metadata' roles: type: array items: type: string role_templates: type: array items: $ref: '#/components/schemas/security._types.RoleTemplate' rules: allOf: - $ref: '#/components/schemas/security._types.RoleMappingRule' security._types.RoleMappingRule: maxProperties: 1 minProperties: 1 type: object properties: any: type: array items: $ref: '#/components/schemas/security._types.RoleMappingRule' all: type: array items: $ref: '#/components/schemas/security._types.RoleMappingRule' field: maxProperties: 1 minProperties: 1 type: object additionalProperties: oneOf: - $ref: '#/components/schemas/_types.FieldValue' - type: array items: $ref: '#/components/schemas/_types.FieldValue' except: allOf: - $ref: '#/components/schemas/security._types.RoleMappingRule' security.get_service_accounts.ServiceAccountType: enum: - built_in - user_managed type: string security.get_service_accounts.ServiceAccountInfo: oneOf: - $ref: '#/components/schemas/security.get_service_accounts.BuiltInServiceAccount' - $ref: '#/components/schemas/security.get_service_accounts.UserManagedServiceAccount' description: "The two kinds of service account describe their privileges differently.\nA built-in account includes its role descriptor. A user-managed account includes its role names and whether it is enabled." discriminator: propertyName: type mapping: built_in: '#/components/schemas/security.get_service_accounts.BuiltInServiceAccount' user_managed: '#/components/schemas/security.get_service_accounts.UserManagedServiceAccount' security.get_service_accounts.BuiltInServiceAccount: required: - type - role_descriptor type: object properties: type: enum: - built_in type: string description: The account ships with Elasticsearch. x-state: Generally available; Added in 9.6.0 role_descriptor: allOf: - $ref: '#/components/schemas/security._types.RoleDescriptorRead' description: The role descriptor declared for the account in the Elasticsearch distribution. security._types.RoleDescriptorRead: required: - cluster - indices type: object properties: cluster: type: array items: $ref: '#/components/schemas/security._types.ClusterPrivilege' description: A list of cluster privileges. These privileges define the cluster level actions that API keys are able to execute. indices: type: array items: $ref: '#/components/schemas/security._types.IndicesPrivileges' description: A list of indices permissions entries. remote_indices: type: array items: $ref: '#/components/schemas/security._types.RemoteIndicesPrivileges' description: A list of indices permissions for remote clusters. x-state: Generally available; Added in 8.14.0 remote_cluster: type: array items: $ref: '#/components/schemas/security._types.RemoteClusterPrivileges' description: "A list of cluster permissions for remote clusters.\nNOTE: This is limited a subset of the cluster permissions." x-state: Generally available; Added in 8.15.0 global: allOf: - $ref: '#/components/schemas/security._types.GlobalPrivilege' description: An object defining global privileges. A global privilege is a form of cluster privilege that is request-aware. applications: type: array items: $ref: '#/components/schemas/security._types.ApplicationPrivileges' description: A list of application privilege entries metadata: allOf: - $ref: '#/components/schemas/_types.Metadata' description: 'Optional meta-data. Within the metadata object, keys that begin with `_` are reserved for system usage.' run_as: type: array items: type: string description: "A list of users that the API keys can impersonate.\nNOTE: In Elastic Cloud Serverless, the run-as feature is disabled.\nFor API compatibility, you can still specify an empty `run_as` field, but a non-empty list will be rejected." externalDocs: url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/submitting-requests-on-behalf-of-other-users description: type: string description: Optional description of the role descriptor restriction: allOf: - $ref: '#/components/schemas/security._types.Restriction' description: Restriction for when the role descriptor is allowed to be effective. transient_metadata: type: object additionalProperties: type: object security.get_service_accounts.UserManagedServiceAccount: required: - type - roles - enabled type: object properties: type: enum: - user_managed type: string description: The account was created with the put user-managed service account API. x-state: Generally available; Added in 9.6.0 roles: type: array items: type: string description: "The names of the roles granted to the account, as sent on the last PUT of the account.\nThey are resolved when the account authenticates." enabled: type: boolean description: Whether the account can authenticate. description: type: string description: "A free-text description of the account, as sent on the last PUT of the account.\nIt has no meaning to Elasticsearch. Absent when the account has no description." created_by: allOf: - $ref: '#/components/schemas/security.get_service_accounts.ServiceAccountAuthor' description: "The user who created the account.\nAbsent for an account that was created before Elasticsearch recorded its creator." x-state: Generally available; Added in 9.6.0 created_at: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: "When the account was created, in milliseconds since the Unix epoch.\nAbsent for an account that was created before Elasticsearch recorded its creation time." x-state: Generally available; Added in 9.6.0 created_by_profile_uid: type: string description: "The profile UID of the user who created the account.\nReturned only when `with_profile_uid` is `true` and that user has an activated user profile." x-state: Generally available; Added in 9.6.0 updated_by: allOf: - $ref: '#/components/schemas/security.get_service_accounts.ServiceAccountAuthor' description: "The user who last replaced the account with the put user-managed service account API.\nAbsent until the account is first replaced." x-state: Generally available; Added in 9.6.0 updated_at: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: "When the account was last replaced, in milliseconds since the Unix epoch.\nAbsent until the account is first replaced." x-state: Generally available; Added in 9.6.0 updated_by_profile_uid: type: string description: "The profile UID of the user who last replaced the account.\nReturned only when `with_profile_uid` is `true` and that user has an activated user profile." x-state: Generally available; Added in 9.6.0 security.get_service_accounts.ServiceAccountAuthor: required: - username - realm - realm_type type: object properties: username: allOf: - $ref: '#/components/schemas/_types.Username' description: The username of the user. realm: type: string description: The name of the realm that authenticated the user. realm_type: type: string description: The type of the realm that authenticated the user. api_key: allOf: - $ref: '#/components/schemas/security.get_service_accounts.ServiceAccountAuthorApiKey' description: "The API key that the request was made with.\nAbsent when the request was not made with an API key, or when the API key ran as another user." description: "The user who wrote a user-managed service account.\nIf the request ran as another user, that user is recorded.\nIf the request was made with an API key, the owner of the key is recorded, from the owner's own realm, together with the key itself.\nFor an older API key that does not record its owner's realm, the realm is the API key realm, `_es_api_key`." security.get_service_accounts.ServiceAccountAuthorApiKey: required: - id type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: The ID of the API key. name: allOf: - $ref: '#/components/schemas/_types.Name' description: "The name that the API key had when the request was made.\nAbsent when the API key has no name." security.get_service_credentials.NodesCredentials: required: - _nodes - file_tokens type: object properties: _nodes: allOf: - $ref: '#/components/schemas/_types.NodeStatistics' description: General status showing how nodes respond to the above collection request file_tokens: type: object additionalProperties: $ref: '#/components/schemas/security.get_service_credentials.NodesCredentialsFileToken' description: File-backed tokens collected from all nodes security.get_service_credentials.NodesCredentialsFileToken: required: - nodes type: object properties: nodes: type: array items: type: string security._types.SecuritySettings: type: object properties: index: allOf: - $ref: '#/components/schemas/indices._types.IndexSettings' security._types.NodeSecurityStats: required: - roles type: object properties: roles: allOf: - $ref: '#/components/schemas/security._types.RolesStats' description: Role statistics. security._types.RolesStats: required: - dls type: object properties: dls: allOf: - $ref: '#/components/schemas/xpack.usage.SecurityRolesDls' description: Document-level security (DLS) statistics. xpack.usage.SecurityRolesDls: required: - bit_set_cache type: object properties: bit_set_cache: allOf: - $ref: '#/components/schemas/xpack.usage.SecurityRolesDlsBitSetCache' xpack.usage.SecurityRolesDlsBitSetCache: required: - count - memory_in_bytes - hits - misses - evictions - hits_time_in_millis - misses_time_in_millis type: object properties: count: type: number description: Number of entries in the cache. memory: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: Human-readable amount of memory taken up by the cache. memory_in_bytes: allOf: - $ref: '#/components/schemas/_types.ulong' description: Memory taken up by the cache in bytes. hits: type: number description: Total number of cache hits. x-state: Generally available; Added in 9.2.0 misses: type: number description: Total number of cache misses. x-state: Generally available; Added in 9.2.0 evictions: type: number description: Total number of cache evictions. x-state: Generally available; Added in 9.2.0 hits_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: Total combined time spent in cache for hits in milliseconds. x-state: Generally available; Added in 9.2.0 misses_time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: Total combined time spent in cache for misses in milliseconds. x-state: Generally available; Added in 9.2.0 security.get_token.AccessTokenGrantType: enum: - password - client_credentials - _kerberos - refresh_token - _user_managed_service_account type: string security.get_token.AuthenticatedUser: allOf: - $ref: '#/components/schemas/security._types.User' - required: - authentication_realm - lookup_realm - authentication_type type: object properties: authentication_realm: allOf: - $ref: '#/components/schemas/security.get_token.UserRealm' lookup_realm: allOf: - $ref: '#/components/schemas/security.get_token.UserRealm' authentication_provider: allOf: - $ref: '#/components/schemas/security.get_token.AuthenticationProvider' authentication_type: type: string api_key: allOf: - $ref: '#/components/schemas/security.authenticate.AuthenticateApiKey' description: Present when the authenticated user is an API key. token: allOf: - $ref: '#/components/schemas/security.authenticate.Token' description: 'Present when the authenticated user is a service account, or authenticated with a token.' security.get_token.UserRealm: required: - name - type type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' type: type: string security.get_token.AuthenticationProvider: required: - type - name type: object properties: type: type: string name: allOf: - $ref: '#/components/schemas/_types.Name' security._types.User: required: - metadata - roles - username - enabled type: object properties: email: oneOf: - type: string - type: - 'null' - string full_name: oneOf: - $ref: '#/components/schemas/_types.Name' - type: - 'null' - string metadata: allOf: - $ref: '#/components/schemas/_types.Metadata' roles: type: array items: type: string username: allOf: - $ref: '#/components/schemas/_types.Username' enabled: type: boolean profile_uid: allOf: - $ref: '#/components/schemas/security._types.UserProfileId' security._types.UserIndicesPrivileges: required: - names - privileges - allow_restricted_indices type: object properties: field_security: type: array items: $ref: '#/components/schemas/security._types.FieldSecurity' description: The document fields that the owners of the role have read access to. externalDocs: url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/controlling-access-at-document-field-level names: oneOf: - $ref: '#/components/schemas/_types.IndexName' - type: array items: $ref: '#/components/schemas/_types.IndexName' description: A list of indices (or index name patterns) to which the permissions in this entry apply. privileges: type: array items: $ref: '#/components/schemas/security._types.IndexPrivilege' description: The index level privileges that owners of the role have on the specified indices. query: type: array items: $ref: '#/components/schemas/security._types.IndicesPrivilegesQuery' description: Search queries that define the documents the user has access to. A document within the specified indices must match these queries for it to be accessible by the owners of the role. allow_restricted_indices: type: boolean description: 'Set to `true` if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the `names` list, Elasticsearch checks privileges against these indices regardless of the value set for `allow_restricted_indices`.' security._types.RemoteUserIndicesPrivileges: required: - clusters - names - privileges - allow_restricted_indices type: object properties: clusters: type: array items: type: string field_security: type: array items: $ref: '#/components/schemas/security._types.FieldSecurity' description: The document fields that the owners of the role have read access to. externalDocs: url: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/controlling-access-at-document-field-level names: oneOf: - $ref: '#/components/schemas/_types.IndexName' - type: array items: $ref: '#/components/schemas/_types.IndexName' description: A list of indices (or index name patterns) to which the permissions in this entry apply. privileges: type: array items: $ref: '#/components/schemas/security._types.IndexPrivilege' description: The index level privileges that owners of the role have on the specified indices. query: type: array items: $ref: '#/components/schemas/security._types.IndicesPrivilegesQuery' description: Search queries that define the documents the user has access to. A document within the specified indices must match these queries for it to be accessible by the owners of the role. allow_restricted_indices: type: boolean description: 'Set to `true` if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the `names` list, Elasticsearch checks privileges against these indices regardless of the value set for `allow_restricted_indices`.' security.get_user_profile.GetUserProfileErrors: required: - count - details type: object properties: count: type: number details: type: object additionalProperties: $ref: '#/components/schemas/_types.ErrorCause' security.grant_api_key.GrantApiKey: required: - name type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' expiration: allOf: - $ref: '#/components/schemas/_types.DurationLarge' description: 'Expiration time for the API key. By default, API keys never expire.' role_descriptors: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/security._types.RoleDescriptor' - type: array items: type: object additionalProperties: $ref: '#/components/schemas/security._types.RoleDescriptor' description: "The role descriptors for this API key.\nWhen it is not specified or is an empty array, the API key has a point in time snapshot of permissions of the specified user or access token.\nIf you supply role descriptors, the resultant permissions are an intersection of API keys permissions and the permissions of the user or access token." metadata: allOf: - $ref: '#/components/schemas/_types.Metadata' description: "Arbitrary metadata that you want to associate with the API key.\nIt supports nested data structure.\nWithin the `metadata` object, keys beginning with `_` are reserved for system usage." security.grant_api_key.ApiKeyGrantType: enum: - access_token - password - _user_managed_service_account type: string security.grant_api_key.GrantApiKeyClientAuthentication: required: - scheme - value type: object properties: scheme: allOf: - $ref: '#/components/schemas/security.grant_api_key.GrantApiKeyClientAuthenticationScheme' description: "The client authentication scheme.\n\nSupported values include:\n - `SharedSecret`: The client authenticates with the shared secret configured for the JWT realm.\n\n" value: type: string description: 'The client authentication value, which is what normally follows the scheme in the `ES-Client-Authentication` request header.' security.grant_api_key.GrantApiKeyClientAuthenticationScheme: enum: - SharedSecret type: string security.has_privileges.ApplicationPrivilegesCheck: required: - application - privileges - resources type: object properties: application: type: string description: The name of the application. privileges: type: array items: type: string description: "A list of the privileges that you want to check for the specified resources.\nIt may be either application privilege names or the names of actions that are granted by those privileges" resources: type: array items: type: string description: A list of resource names against which the privileges should be checked. security.has_privileges.IndexPrivilegesCheck: required: - names - privileges type: object properties: names: allOf: - $ref: '#/components/schemas/_types.Indices' description: A list of indices. privileges: type: array items: $ref: '#/components/schemas/security._types.IndexPrivilege' description: A list of the privileges that you want to check for the specified indices. allow_restricted_indices: type: boolean description: "This needs to be set to `true` (default is `false`) if using wildcards or regexps for patterns that cover restricted indices.\nImplicitly, restricted indices do not match index patterns because restricted indices usually have limited privileges and including them in pattern tests would render most such tests false.\nIf restricted indices are explicitly included in the names list, privileges will be checked against them regardless of the value of `allow_restricted_indices`." security.has_privileges.ApplicationsPrivileges: type: object additionalProperties: $ref: '#/components/schemas/security.has_privileges.ResourcePrivileges' security.has_privileges.ResourcePrivileges: type: object additionalProperties: $ref: '#/components/schemas/security.has_privileges.Privileges' security.has_privileges.Privileges: type: object additionalProperties: type: boolean security.has_privileges_user_profile.PrivilegesCheck: type: object properties: application: type: array items: $ref: '#/components/schemas/security.has_privileges.ApplicationPrivilegesCheck' cluster: type: array items: $ref: '#/components/schemas/security._types.ClusterPrivilege' description: A list of the cluster privileges that you want to check. index: type: array items: $ref: '#/components/schemas/security.has_privileges.IndexPrivilegesCheck' security.has_privileges_user_profile.HasPrivilegesUserProfileErrors: required: - count - details type: object properties: count: type: number details: type: object additionalProperties: $ref: '#/components/schemas/_types.ErrorCause' security._types.CreatedStatus: required: - created type: object properties: created: type: boolean security.query_api_keys.ApiKeyAggregationContainer: allOf: - type: object properties: aggregations: type: object additionalProperties: $ref: '#/components/schemas/security.query_api_keys.ApiKeyAggregationContainer' description: "Sub-aggregations for this aggregation.\nOnly applies to bucket aggregations." meta: allOf: - $ref: '#/components/schemas/_types.Metadata' - maxProperties: 1 minProperties: 1 type: object properties: cardinality: allOf: - $ref: '#/components/schemas/_types.aggregations.CardinalityAggregation' description: A single-value metrics aggregation that calculates an approximate count of distinct values. composite: allOf: - $ref: '#/components/schemas/_types.aggregations.CompositeAggregation' description: "A multi-bucket aggregation that creates composite buckets from different sources.\nUnlike the other multi-bucket aggregations, you can use the `composite` aggregation to paginate *all* buckets from a multi-level aggregation efficiently." date_range: allOf: - $ref: '#/components/schemas/_types.aggregations.DateRangeAggregation' description: A multi-bucket value source based aggregation that enables the user to define a set of date ranges - each representing a bucket. filter: allOf: - $ref: '#/components/schemas/security.query_api_keys.ApiKeyQueryContainer' description: A single bucket aggregation that narrows the set of documents to those that match a query. filters: allOf: - $ref: '#/components/schemas/security.query_api_keys.ApiKeyFiltersAggregation' description: A multi-bucket aggregation where each bucket contains the documents that match a query. missing: allOf: - $ref: '#/components/schemas/_types.aggregations.MissingAggregation' range: allOf: - $ref: '#/components/schemas/_types.aggregations.RangeAggregation' description: A multi-bucket value source based aggregation that enables the user to define a set of ranges - each representing a bucket. terms: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsAggregation' description: A multi-bucket value source based aggregation where buckets are dynamically built - one per unique value. value_count: allOf: - $ref: '#/components/schemas/_types.aggregations.ValueCountAggregation' description: A single-value metrics aggregation that counts the number of values that are extracted from the aggregated documents. security.query_api_keys.ApiKeyQueryContainer: maxProperties: 1 minProperties: 1 type: object properties: bool: allOf: - $ref: '#/components/schemas/_types.query_dsl.BoolQuery' description: Matches documents matching boolean combinations of other queries. exists: allOf: - $ref: '#/components/schemas/_types.query_dsl.ExistsQuery' description: Returns documents that contain an indexed value for a field. ids: allOf: - $ref: '#/components/schemas/_types.query_dsl.IdsQuery' description: "Returns documents based on their IDs.\nThis query uses document IDs stored in the `_id` field." match: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.MatchQuery' description: "Returns documents that match a provided text, number, date or boolean value.\nThe provided text is analyzed before matching." match_all: allOf: - $ref: '#/components/schemas/_types.query_dsl.MatchAllQuery' description: 'Matches all documents, giving them all a `_score` of 1.0.' prefix: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.PrefixQuery' description: Returns documents that contain a specific prefix in a provided field. range: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.RangeQuery' description: Returns documents that contain terms within a provided range. simple_query_string: allOf: - $ref: '#/components/schemas/_types.query_dsl.SimpleQueryStringQuery' description: 'Returns documents based on a provided query string, using a parser with a limited but fault-tolerant syntax.' term: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.TermQuery' description: "Returns documents that contain an exact term in a provided field.\nTo return a document, the query term must exactly match the queried field's value, including whitespace and capitalization." terms: allOf: - $ref: '#/components/schemas/_types.query_dsl.TermsQuery' description: "Returns documents that contain one or more exact terms in a provided field.\nTo return a document, one or more terms must exactly match a field value, including whitespace and capitalization." wildcard: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.WildcardQuery' description: Returns documents that contain terms matching a wildcard pattern. security.query_api_keys.ApiKeyFiltersAggregation: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase' - type: object properties: filters: allOf: - $ref: '#/components/schemas/_types.aggregations.BucketsApiKeyQueryContainer' description: Collection of queries from which to build buckets. other_bucket: type: boolean description: Set to `true` to add a bucket to the response which will contain all documents that do not match any of the given filters. other_bucket_key: type: string description: The key with which the other bucket is returned. default: _other_ keyed: type: boolean description: "By default, the named filters aggregation returns the buckets as an object.\nSet to `false` to return the buckets as an array of objects." default: true _types.aggregations.BucketsApiKeyQueryContainer: oneOf: - type: object additionalProperties: $ref: '#/components/schemas/security.query_api_keys.ApiKeyQueryContainer' - type: array items: $ref: '#/components/schemas/security.query_api_keys.ApiKeyQueryContainer' description: "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary." security.query_api_keys.ApiKeyAggregate: oneOf: - $ref: '#/components/schemas/_types.aggregations.CardinalityAggregate' - $ref: '#/components/schemas/_types.aggregations.ValueCountAggregate' - $ref: '#/components/schemas/_types.aggregations.StringTermsAggregate' - $ref: '#/components/schemas/_types.aggregations.LongTermsAggregate' - $ref: '#/components/schemas/_types.aggregations.DoubleTermsAggregate' - $ref: '#/components/schemas/_types.aggregations.UnmappedTermsAggregate' - $ref: '#/components/schemas/_types.aggregations.MultiTermsAggregate' - $ref: '#/components/schemas/_types.aggregations.MissingAggregate' - $ref: '#/components/schemas/_types.aggregations.FilterAggregate' - $ref: '#/components/schemas/_types.aggregations.FiltersAggregate' - $ref: '#/components/schemas/_types.aggregations.RangeAggregate' - $ref: '#/components/schemas/_types.aggregations.DateRangeAggregate' - $ref: '#/components/schemas/_types.aggregations.CompositeAggregate' security.query_role.RoleQueryContainer: maxProperties: 1 minProperties: 1 type: object properties: bool: allOf: - $ref: '#/components/schemas/_types.query_dsl.BoolQuery' description: matches roles matching boolean combinations of other queries. exists: allOf: - $ref: '#/components/schemas/_types.query_dsl.ExistsQuery' description: Returns roles that contain an indexed value for a field. ids: allOf: - $ref: '#/components/schemas/_types.query_dsl.IdsQuery' description: "Returns roles based on their IDs.\nThis query uses role document IDs stored in the `_id` field." match: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.MatchQuery' description: "Returns roles that match a provided text, number, date or boolean value.\nThe provided text is analyzed before matching." match_all: allOf: - $ref: '#/components/schemas/_types.query_dsl.MatchAllQuery' description: 'Matches all roles, giving them all a `_score` of 1.0.' prefix: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.PrefixQuery' description: Returns roles that contain a specific prefix in a provided field. range: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.RangeQuery' description: Returns roles that contain terms within a provided range. simple_query_string: allOf: - $ref: '#/components/schemas/_types.query_dsl.SimpleQueryStringQuery' description: 'Returns roles based on a provided query string, using a parser with a limited but fault-tolerant syntax.' term: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.TermQuery' description: "Returns roles that contain an exact term in a provided field.\nTo return a document, the query term must exactly match the queried field's value, including whitespace and capitalization." terms: allOf: - $ref: '#/components/schemas/_types.query_dsl.TermsQuery' description: "Returns roles that contain one or more exact terms in a provided field.\nTo return a document, one or more terms must exactly match a field value, including whitespace and capitalization." wildcard: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.WildcardQuery' description: Returns roles that contain terms matching a wildcard pattern. security.query_role.QueryRole: allOf: - $ref: '#/components/schemas/security._types.RoleDescriptor' - required: - name type: object properties: _sort: allOf: - $ref: '#/components/schemas/_types.SortResults' name: type: string description: Name of the role. security.query_user.UserQueryContainer: maxProperties: 1 minProperties: 1 type: object properties: ids: allOf: - $ref: '#/components/schemas/_types.query_dsl.IdsQuery' description: "Returns users based on their IDs.\nThis query uses the user document IDs stored in the `_id` field." bool: allOf: - $ref: '#/components/schemas/_types.query_dsl.BoolQuery' description: matches users matching boolean combinations of other queries. exists: allOf: - $ref: '#/components/schemas/_types.query_dsl.ExistsQuery' description: Returns users that contain an indexed value for a field. match: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.MatchQuery' description: "Returns users that match a provided text, number, date or boolean value.\nThe provided text is analyzed before matching." match_all: allOf: - $ref: '#/components/schemas/_types.query_dsl.MatchAllQuery' description: 'Matches all users, giving them all a `_score` of 1.0.' prefix: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.PrefixQuery' description: Returns users that contain a specific prefix in a provided field. range: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.RangeQuery' description: Returns users that contain terms within a provided range. simple_query_string: allOf: - $ref: '#/components/schemas/_types.query_dsl.SimpleQueryStringQuery' description: 'Returns users based on a provided query string, using a parser with a limited but fault-tolerant syntax.' term: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.TermQuery' description: "Returns users that contain an exact term in a provided field.\nTo return a document, the query term must exactly match the queried field's value, including whitespace and capitalization." terms: allOf: - $ref: '#/components/schemas/_types.query_dsl.TermsQuery' description: "Returns users that contain one or more exact terms in a provided field.\nTo return a document, one or more terms must exactly match a field value, including whitespace and capitalization." wildcard: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.query_dsl.WildcardQuery' description: Returns users that contain terms matching a wildcard pattern. security.query_user.QueryUser: allOf: - $ref: '#/components/schemas/security._types.User' - type: object properties: _sort: allOf: - $ref: '#/components/schemas/_types.SortResults' security.suggest_user_profiles.Hint: type: object properties: uids: type: array items: $ref: '#/components/schemas/security._types.UserProfileId' description: A list of profile UIDs to match against. labels: type: object additionalProperties: oneOf: - type: string - type: array items: type: string description: "A single key-value pair to match against the labels section\nof a profile. A profile is considered matching if it matches\nat least one of the strings." security.suggest_user_profiles.TotalUserProfiles: required: - value - relation type: object properties: value: type: number relation: allOf: - $ref: '#/components/schemas/_types.RelationName' simulate.ingest.MergeType: enum: - index - template type: string cluster._types.ComponentTemplateNode: required: - template type: object properties: template: allOf: - $ref: '#/components/schemas/cluster._types.ComponentTemplateSummary' version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' _meta: allOf: - $ref: '#/components/schemas/_types.Metadata' deprecated: type: boolean created_date: allOf: - $ref: '#/components/schemas/_types.DateTime' description: Date and time when the component template was created. Only returned if the `human` query parameter is `true`. x-state: Generally available; Added in 9.2.0 created_date_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: 'Date and time when the component template was created, in milliseconds since the epoch.' x-state: Generally available; Added in 9.2.0 modified_date: allOf: - $ref: '#/components/schemas/_types.DateTime' description: Date and time when the component template was last modified. Only returned if the `human` query parameter is `true`. x-state: Generally available; Added in 9.2.0 modified_date_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: 'Date and time when the component template was last modified, in milliseconds since the epoch.' x-state: Generally available; Added in 9.2.0 cluster._types.ComponentTemplateSummary: type: object properties: _meta: allOf: - $ref: '#/components/schemas/_types.Metadata' version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' settings: type: object additionalProperties: $ref: '#/components/schemas/indices._types.IndexSettings' mappings: allOf: - $ref: '#/components/schemas/_types.mapping.TypeMapping' aliases: type: object additionalProperties: $ref: '#/components/schemas/indices._types.AliasDefinition' lifecycle: allOf: - $ref: '#/components/schemas/indices._types.DataStreamLifecycle' x-state: Generally available; Added in 8.11.0 data_stream_options: allOf: - $ref: '#/components/schemas/indices._types.DataStreamOptions' x-state: Generally available; Added in 8.19.0 simulate.ingest.SimulateIngestDocumentResult: type: object properties: doc: allOf: - $ref: '#/components/schemas/simulate.ingest.IngestDocumentSimulation' simulate.ingest.IngestDocumentSimulation: required: - _id - _index - _source - _version - executed_pipelines type: object properties: _id: allOf: - $ref: '#/components/schemas/_types.Id' description: Identifier for the document. _index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: Name of the index that the document would be indexed into if this were not a simulation. _source: type: object additionalProperties: type: object description: JSON body for the document. _version: allOf: - $ref: '#/components/schemas/_spec_utils.StringifiedVersionNumber' description: '' executed_pipelines: type: array items: type: string description: A list of the names of the pipelines executed on this document. ignored_fields: type: array items: type: object additionalProperties: type: string description: "A list of the fields that would be ignored at the indexing step. For example, a field whose\nvalue is larger than the allowed limit would make it through all of the pipelines, but\nwould not be indexed into Elasticsearch." error: allOf: - $ref: '#/components/schemas/_types.ErrorCause' description: "Any error resulting from simulatng ingest on this doc. This can be an error generated by\nexecuting a processor, or a mapping validation error when simulating indexing the resulting\ndoc." effective_mapping: allOf: - $ref: '#/components/schemas/_types.mapping.TypeMapping' description: "The results of ingest simulation on a single document. The _source of the document contains\nthe results after running all pipelines listed in executed_pipelines on the document. The\nlist of executed pipelines is derived from the pipelines that would be executed if this\ndocument had been ingested into _index." slm._types.SnapshotLifecycle: required: - modified_date_millis - next_execution_millis - policy - version - stats type: object properties: in_progress: allOf: - $ref: '#/components/schemas/slm._types.InProgress' last_failure: allOf: - $ref: '#/components/schemas/slm._types.Invocation' last_success: allOf: - $ref: '#/components/schemas/slm._types.Invocation' modified_date: allOf: - $ref: '#/components/schemas/_types.DateTime' description: The last time the policy was modified. modified_date_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' next_execution: allOf: - $ref: '#/components/schemas/_types.DateTime' description: The next time the policy will run. next_execution_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' policy: allOf: - $ref: '#/components/schemas/slm._types.Policy' version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' description: "The version of the snapshot policy.\nOnly the latest version is stored and incremented when the policy is updated." stats: allOf: - $ref: '#/components/schemas/slm._types.Statistics' slm._types.InProgress: required: - name - start_time_millis - state - uuid type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' start_time_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' state: type: string uuid: allOf: - $ref: '#/components/schemas/_types.Uuid' slm._types.Invocation: required: - snapshot_name - time type: object properties: snapshot_name: allOf: - $ref: '#/components/schemas/_types.Name' time: allOf: - $ref: '#/components/schemas/_types.DateTime' slm._types.Policy: required: - name - repository - schedule type: object properties: config: allOf: - $ref: '#/components/schemas/slm._types.Configuration' name: allOf: - $ref: '#/components/schemas/_types.Name' repository: type: string retention: allOf: - $ref: '#/components/schemas/slm._types.Retention' schedule: allOf: - $ref: '#/components/schemas/watcher._types.CronExpression' slm._types.Configuration: type: object properties: ignore_unavailable: type: boolean description: 'If false, the snapshot fails if any data stream or index in indices is missing or closed. If true, the snapshot ignores missing or closed data streams and indices.' default: false indices: allOf: - $ref: '#/components/schemas/_types.Indices' description: "A comma-separated list of data streams and indices to include in the snapshot. Multi-index syntax is supported.\nBy default, a snapshot includes all data streams and indices in the cluster. If this argument is provided, the snapshot only includes the specified data streams and clusters." include_global_state: type: boolean description: 'If true, the current global state is included in the snapshot.' default: true feature_states: type: array items: type: string description: "A list of feature states to be included in this snapshot. A list of features available for inclusion in the snapshot and their descriptions be can be retrieved using the get features API.\nEach feature state includes one or more system indices containing data necessary for the function of that feature. Providing an empty array will include no feature states in the snapshot, regardless of the value of include_global_state. By default, all available feature states will be included in the snapshot if include_global_state is true, or no feature states if include_global_state is false." metadata: allOf: - $ref: '#/components/schemas/_types.Metadata' description: 'Attaches arbitrary metadata to the snapshot, such as a record of who took the snapshot, why it was taken, or any other useful data. Metadata must be less than 1024 bytes.' partial: type: boolean description: 'If false, the entire snapshot will fail if one or more indices included in the snapshot do not have all primary shards available.' default: false slm._types.Retention: required: - expire_after - max_count - min_count type: object properties: expire_after: allOf: - $ref: '#/components/schemas/_types.Duration' description: Time period after which a snapshot is considered expired and eligible for deletion. SLM deletes expired snapshots based on the slm.retention_schedule. max_count: type: number description: 'Maximum number of snapshots to retain, even if the snapshots have not yet expired. If the number of snapshots in the repository exceeds this limit, the policy retains the most recent snapshots and deletes older snapshots.' min_count: type: number description: 'Minimum number of snapshots to retain, even if the snapshots have expired.' watcher._types.CronExpression: type: string slm._types.Statistics: type: object properties: retention_deletion_time: allOf: - $ref: '#/components/schemas/_types.Duration' retention_deletion_time_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' retention_failed: type: number retention_runs: type: number retention_timed_out: type: number policy: allOf: - $ref: '#/components/schemas/_types.Id' total_snapshots_deleted: type: number total_snapshot_deletion_failures: type: number total_snapshots_failed: type: number total_snapshots_taken: type: number slm._types.SnapshotPolicyStats: required: - policy - snapshots_taken - snapshots_failed - snapshots_deleted - snapshot_deletion_failures type: object properties: policy: type: string snapshots_taken: type: number snapshots_failed: type: number snapshots_deleted: type: number snapshot_deletion_failures: type: number snapshot.cleanup_repository.CleanupRepositoryResults: required: - deleted_blobs - deleted_bytes type: object properties: deleted_blobs: type: number description: "The number of binary large objects (blobs) removed from the snapshot repository during cleanup operations.\nA non-zero value indicates that unreferenced blobs were found and subsequently cleaned up." deleted_bytes: type: number description: The number of bytes freed by cleanup operations. snapshot._types.SnapshotInfo: required: - data_streams - snapshot - uuid type: object properties: data_streams: type: array items: type: string duration: allOf: - $ref: '#/components/schemas/_types.Duration' duration_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' end_time: allOf: - $ref: '#/components/schemas/_types.DateTime' end_time_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' failures: type: array items: $ref: '#/components/schemas/snapshot._types.SnapshotShardFailure' include_global_state: type: boolean indices: type: array items: $ref: '#/components/schemas/_types.IndexName' index_details: type: object additionalProperties: $ref: '#/components/schemas/snapshot._types.IndexDetails' x-state: Generally available; Added in 7.13.0 metadata: allOf: - $ref: '#/components/schemas/_types.Metadata' reason: type: string repository: allOf: - $ref: '#/components/schemas/_types.Name' x-state: Generally available; Added in 7.14.0 snapshot: allOf: - $ref: '#/components/schemas/_types.Name' shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' start_time: allOf: - $ref: '#/components/schemas/_types.DateTime' start_time_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' state: type: string uuid: allOf: - $ref: '#/components/schemas/_types.Uuid' version: allOf: - $ref: '#/components/schemas/_types.VersionString' version_id: allOf: - $ref: '#/components/schemas/_types.VersionNumber' feature_states: type: array items: $ref: '#/components/schemas/snapshot._types.InfoFeatureState' snapshot._types.SnapshotShardFailure: required: - index - reason - shard_id - index_uuid - status type: object properties: index: allOf: - $ref: '#/components/schemas/_types.IndexName' node_id: allOf: - $ref: '#/components/schemas/_types.Id' reason: type: string shard_id: type: number index_uuid: allOf: - $ref: '#/components/schemas/_types.Id' status: type: string snapshot._types.IndexDetails: required: - shard_count - size_in_bytes - max_segments_per_shard type: object properties: shard_count: type: number size: allOf: - $ref: '#/components/schemas/_types.ByteSize' size_in_bytes: type: number max_segments_per_shard: type: number snapshot._types.InfoFeatureState: required: - feature_name - indices type: object properties: feature_name: type: string indices: allOf: - $ref: '#/components/schemas/_types.Indices' snapshot._types.Repository: oneOf: - $ref: '#/components/schemas/snapshot._types.AzureRepository' - $ref: '#/components/schemas/snapshot._types.GcsRepository' - $ref: '#/components/schemas/snapshot._types.S3Repository' - $ref: '#/components/schemas/snapshot._types.SharedFileSystemRepository' - $ref: '#/components/schemas/snapshot._types.ReadOnlyUrlRepository' - $ref: '#/components/schemas/snapshot._types.SourceOnlyRepository' discriminator: propertyName: type mapping: azure: '#/components/schemas/snapshot._types.AzureRepository' fs: '#/components/schemas/snapshot._types.SharedFileSystemRepository' gcs: '#/components/schemas/snapshot._types.GcsRepository' s3: '#/components/schemas/snapshot._types.S3Repository' source: '#/components/schemas/snapshot._types.SourceOnlyRepository' url: '#/components/schemas/snapshot._types.ReadOnlyUrlRepository' snapshot._types.AzureRepository: allOf: - $ref: '#/components/schemas/snapshot._types.RepositoryBase' - required: - type type: object properties: type: enum: - azure type: string description: The Azure repository type. externalDocs: url: https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore/azure-repository settings: allOf: - $ref: '#/components/schemas/snapshot._types.AzureRepositorySettings' description: The repository settings. snapshot._types.AzureRepositorySettings: allOf: - $ref: '#/components/schemas/snapshot._types.RepositorySettingsBase' - type: object properties: base_path: type: string description: "The path to the repository data within the container.\nIt defaults to the root directory.\n\nNOTE: Don't set `base_path` when configuring a snapshot repository for Elastic Cloud Enterprise.\nElastic Cloud Enterprise automatically generates the `base_path` for each deployment so that multiple deployments can share the same bucket." client: type: string description: The name of the Azure repository client to use. default: default container: type: string description: The Azure container. default: elasticsearch-snapshots data_access_tier: type: string description: "The Azure access tier applied to the data blobs of the repository, which hold the files that make up each snapshotted shard.\nAccepted values are `hot`, `cool` and `cold`, in any letter case.\nIf not set, no access tier is requested and Azure applies the default tier of the storage account." x-state: Generally available; Added in 9.5.0 delete_objects_max_size: type: number description: "The maxmimum batch size, between 1 and 256, used for `BlobBatch` requests.\nDefaults to 256 which is the maximum number supported by the Azure blob batch API." default: 256 location_mode: type: string description: "Either `primary_only` or `secondary_only`.\nNote that if you set it to `secondary_only`, it will force `readonly` to `true`." default: primary_only max_concurrent_batch_deletes: type: number description: "The maximum number of concurrent batch delete requests that will be submitted for any individual bulk delete with `BlobBatch`.\nNote that the effective number of concurrent deletes is further limited by the Azure client connection and event loop thread limits.\nDefaults to 10, minimum is 1, maximum is 100." default: 10 metadata_access_tier: type: string description: "The Azure access tier applied to the metadata blobs of the repository.\nThese are generally smaller than the data blobs but can be read more often, for example to list the repository contents or to take snapshots.\nAccepted values are `hot`, `cool` and `cold`, in any letter case.\nIf not set, no access tier is requested and Azure applies the default tier of the storage account." x-state: Generally available; Added in 9.5.0 readonly: type: boolean description: "If `true`, the repository is read-only.\nThe cluster can retrieve and restore snapshots from the repository but not write to the repository or create snapshots in it.\n\nOnly a cluster with write access can create snapshots in the repository.\nAll other clusters connected to the repository should have the `readonly` parameter set to `true`.\nIf `false`, the cluster can write to the repository and create snapshots in it.\n\nIMPORTANT: If you register the same snapshot repository with multiple clusters, only one cluster should have write access to the repository.\nHaving multiple clusters write to the repository at the same time risks corrupting the contents of the repository." default: false snapshot._types.RepositorySettingsBase: type: object properties: chunk_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "Big files can be broken down into multiple smaller blobs in the blob store during snapshotting.\nIt is not recommended to change this value from its default unless there is an explicit reason for limiting the size of blobs in the repository.\nSetting a value lower than the default can result in an increased number of API calls to the blob store during snapshot create and restore operations compared to using the default value and thus make both operations slower and more costly.\nSpecify the chunk size as a byte unit, for example: `10MB`, `5KB`, 500B.\nThe default varies by repository type." compress: type: boolean description: "When set to `true`, metadata files are stored in compressed format.\nThis setting doesn't affect index files that are already compressed by default." default: true max_restore_bytes_per_sec: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "The maximum snapshot restore rate per node.\nIt defaults to unlimited.\nNote that restores are also throttled through recovery settings." max_snapshot_bytes_per_sec: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "The maximum snapshot creation rate per node.\nIt defaults to 40mb per second.\nNote that if the recovery settings for managed services are set, then it defaults to unlimited, and the rate is additionally throttled through recovery settings." snapshot._types.RepositoryBase: type: object properties: uuid: allOf: - $ref: '#/components/schemas/_types.Uuid' snapshot._types.GcsRepository: allOf: - $ref: '#/components/schemas/snapshot._types.RepositoryBase' - required: - type - settings type: object properties: type: enum: - gcs type: string description: The Google Cloud Storage repository type. externalDocs: url: https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore/google-cloud-storage-repository settings: allOf: - $ref: '#/components/schemas/snapshot._types.GcsRepositorySettings' description: The repository settings. snapshot._types.GcsRepositorySettings: allOf: - $ref: '#/components/schemas/snapshot._types.RepositorySettingsBase' - required: - bucket type: object properties: bucket: type: string description: The name of the bucket to be used for snapshots. application_name: type: string description: The name used by the client when it uses the Google Cloud Storage service. deprecated: true base_path: type: string description: "The path to the repository data within the bucket.\nIt defaults to the root of the bucket.\n\nNOTE: Don't set `base_path` when configuring a snapshot repository for Elastic Cloud Enterprise.\nElastic Cloud Enterprise automatically generates the `base_path` for each deployment so that multiple deployments can share the same bucket." client: type: string description: The name of the client to use to connect to Google Cloud Storage. default: default readonly: type: boolean description: "If `true`, the repository is read-only.\nThe cluster can retrieve and restore snapshots from the repository but not write to the repository or create snapshots in it.\n\nOnly a cluster with write access can create snapshots in the repository.\nAll other clusters connected to the repository should have the `readonly` parameter set to `true`.\n\nIf `false`, the cluster can write to the repository and create snapshots in it.\n\nIMPORTANT: If you register the same snapshot repository with multiple clusters, only one cluster should have write access to the repository.\nHaving multiple clusters write to the repository at the same time risks corrupting the contents of the repository." default: false snapshot._types.S3Repository: allOf: - $ref: '#/components/schemas/snapshot._types.RepositoryBase' - required: - type - settings type: object properties: type: enum: - s3 type: string description: The S3 repository type. externalDocs: url: https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore/s3-repository settings: allOf: - $ref: '#/components/schemas/snapshot._types.S3RepositorySettings' description: "The repository settings.\n\nNOTE: In addition to the specified settings, you can also use all non-secure client settings in the repository settings.\nIn this case, the client settings found in the repository settings will be merged with those of the named client used by the repository.\nConflicts between client and repository settings are resolved by the repository settings taking precedence over client settings." snapshot._types.S3RepositorySettings: allOf: - $ref: '#/components/schemas/snapshot._types.RepositorySettingsBase' - required: - bucket type: object properties: bucket: type: string description: "The name of the S3 bucket to use for snapshots.\nThe bucket name must adhere to Amazon's S3 bucket naming rules." externalDocs: url: https://docs.aws.amazon.com/AmazonS3/latest/userguide/BucketRestrictions.html#bucketnamingrules base_path: type: string description: "The path to the repository data within its bucket.\nIt defaults to an empty string, meaning that the repository is at the root of the bucket.\nThe value of this setting should not start or end with a forward slash (`/`).\n\nNOTE: Don't set base_path when configuring a snapshot repository for Elastic Cloud Enterprise.\nElastic Cloud Enterprise automatically generates the `base_path` for each deployment so that multiple deployments may share the same bucket." buffer_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "The minimum threshold below which the chunk is uploaded using a single request.\nBeyond this threshold, the S3 repository will use the AWS Multipart Upload API to split the chunk into several parts, each of `buffer_size` length, and to upload each part in its own request.\nNote that setting a buffer size lower than 5mb is not allowed since it will prevent the use of the Multipart API and may result in upload errors.\nIt is also not possible to set a buffer size greater than 5gb as it is the maximum upload size allowed by S3.\nDefaults to `100mb` or 5% of JVM heap, whichever is smaller." canned_acl: type: string description: "The S3 repository supports all S3 canned ACLs: `private`, `public-read`, `public-read-write`, `authenticated-read`, `log-delivery-write`, `bucket-owner-read`, `bucket-owner-full-control`.\nYou could specify a canned ACL using the `canned_acl` setting.\nWhen the S3 repository creates buckets and objects, it adds the canned ACL into the buckets and objects." default: private externalDocs: url: https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#canned-acl client: type: string description: The name of the S3 client to use to connect to S3. default: default delete_objects_max_size: type: number description: "The maxmimum batch size, between 1 and 1000, used for `DeleteObjects` requests.\nDefaults to 1000 which is the maximum number supported by the AWS DeleteObjects API." default: 1000 externalDocs: url: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html get_register_retry_delay: allOf: - $ref: '#/components/schemas/_types.Duration' description: The time to wait before trying again if an attempt to read a linearizable register fails. default: 5s max_multipart_parts: type: number description: "The maximum number of parts that Elasticsearch will write during a multipart upload of a single object.\nFiles which are larger than `buffer_size × max_multipart_parts` will be chunked into several smaller objects.\nElasticsearch may also split a file across multiple objects to satisfy other constraints such as the `chunk_size` limit.\nDefaults to `10000` which is the maximum number of parts in a multipart upload in AWS S3." default: 10000 max_multipart_upload_cleanup_size: type: number description: "The maximum number of possibly-dangling multipart uploads to clean up in each batch of snapshot deletions.\nDefaults to 1000 which is the maximum number supported by the AWS ListMultipartUploads API.\nIf set to `0`, Elasticsearch will not attempt to clean up dangling multipart uploads." default: 1000 externalDocs: url: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html readonly: type: boolean description: "If true, the repository is read-only.\nThe cluster can retrieve and restore snapshots from the repository but not write to the repository or create snapshots in it.\n\nOnly a cluster with write access can create snapshots in the repository.\nAll other clusters connected to the repository should have the `readonly` parameter set to `true`.\n\nIf `false`, the cluster can write to the repository and create snapshots in it.\n\nIMPORTANT: If you register the same snapshot repository with multiple clusters, only one cluster should have write access to the repository.\nHaving multiple clusters write to the repository at the same time risks corrupting the contents of the repository." default: false server_side_encryption: type: boolean description: 'When set to `true`, files are encrypted on server side using an AES256 algorithm.' default: false storage_class: type: string description: "The S3 storage class for objects written to the repository.\nValues may be `standard`, `reduced_redundancy`, `standard_ia`, `onezone_ia`, and `intelligent_tiering`." default: standard externalDocs: url: https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore/s3-repository#repository-s3-storage-classes throttled_delete_retry.delay_increment: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The delay before the first retry and the amount the delay is incremented by on each subsequent retry.\nThe default is 50ms and the minimum is 0ms." default: 50ms throttled_delete_retry.maximum_delay: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The upper bound on how long the delays between retries will grow to.\nThe default is 5s and the minimum is 0ms." default: 5s throttled_delete_retry.maximum_number_of_retries: type: number description: "The number times to retry a throttled snapshot deletion.\nThe default is 10 and the minimum value is 0 which will disable retries altogether.\nNote that if retries are enabled in the Azure client, each of these retries comprises that many client-level retries." snapshot._types.SharedFileSystemRepository: allOf: - $ref: '#/components/schemas/snapshot._types.RepositoryBase' - required: - type - settings type: object properties: type: enum: - fs type: string description: The shared file system repository type. externalDocs: url: https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore/shared-file-system-repository settings: allOf: - $ref: '#/components/schemas/snapshot._types.SharedFileSystemRepositorySettings' description: The repository settings. snapshot._types.SharedFileSystemRepositorySettings: allOf: - $ref: '#/components/schemas/snapshot._types.RepositorySettingsBase' - required: - location type: object properties: location: type: string description: "The location of the shared filesystem used to store and retrieve snapshots.\nThis location must be registered in the `path.repo` setting on all master and data nodes in the cluster.\nUnlike `path.repo`, this setting supports only a single file path." max_number_of_snapshots: type: number description: "The maximum number of snapshots the repository can contain.\nThe default is `Integer.MAX_VALUE`, which is 2^31-1 or `2147483647`." default: 2147483647 readonly: type: boolean description: "If `true`, the repository is read-only.\nThe cluster can retrieve and restore snapshots from the repository but not write to the repository or create snapshots in it.\n\nOnly a cluster with write access can create snapshots in the repository.\nAll other clusters connected to the repository should have the `readonly` parameter set to `true`.\n\nIf `false`, the cluster can write to the repository and create snapshots in it.\n\nIMPORTANT: If you register the same snapshot repository with multiple clusters, only one cluster should have write access to the repository.\nHaving multiple clusters write to the repository at the same time risks corrupting the contents of the repository." default: false snapshot._types.ReadOnlyUrlRepository: allOf: - $ref: '#/components/schemas/snapshot._types.RepositoryBase' - required: - type - settings type: object properties: type: enum: - url type: string description: The read-only URL repository type. externalDocs: url: https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore/read-only-url-repository settings: allOf: - $ref: '#/components/schemas/snapshot._types.ReadOnlyUrlRepositorySettings' description: The repository settings. snapshot._types.ReadOnlyUrlRepositorySettings: allOf: - $ref: '#/components/schemas/snapshot._types.RepositorySettingsBase' - required: - url type: object properties: http_max_retries: type: number description: The maximum number of retries for HTTP and HTTPS URLs. default: 5 http_socket_timeout: allOf: - $ref: '#/components/schemas/_types.Duration' description: The maximum wait time for data transfers over a connection. default: 50s max_number_of_snapshots: type: number description: "The maximum number of snapshots the repository can contain.\nThe default is `Integer.MAX_VALUE`, which is 2^31-1 or `2147483647`." default: 2147483647 url: type: string description: "The URL location of the root of the shared filesystem repository.\nThe following protocols are supported:\n\n* `file`\n* `ftp`\n* `http`\n* `https`\n* `jar`\n\nURLs using the HTTP, HTTPS, or FTP protocols must be explicitly allowed with the `repositories.url.allowed_urls` cluster setting.\nThis setting supports wildcards in the place of a host, path, query, or fragment in the URL.\n\nURLs using the file protocol must point to the location of a shared filesystem accessible to all master and data nodes in the cluster.\nThis location must be registered in the `path.repo` setting.\nYou don't need to register URLs using the FTP, HTTP, HTTPS, or JAR protocols in the `path.repo` setting." snapshot._types.SourceOnlyRepository: allOf: - $ref: '#/components/schemas/snapshot._types.RepositoryBase' - required: - type - settings type: object properties: type: enum: - source type: string description: The source-only repository type. externalDocs: url: https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore/source-only-repository settings: allOf: - $ref: '#/components/schemas/snapshot._types.SourceOnlyRepositorySettings' description: The repository settings. snapshot._types.SourceOnlyRepositorySettings: oneOf: - $ref: '#/components/schemas/snapshot._types.SourceOnlyRepositorySettingsForSharedFileSystem' - $ref: '#/components/schemas/snapshot._types.SourceOnlyRepositorySettingsForReadOnlyUrl' - $ref: '#/components/schemas/snapshot._types.SourceOnlyRepositorySettingsForAzure' - $ref: '#/components/schemas/snapshot._types.SourceOnlyRepositorySettingsForGcs' - $ref: '#/components/schemas/snapshot._types.SourceOnlyRepositorySettingsForS3' description: "The delegated repository type.\nSource repositories can use `settings` properties for its delegated repository type." discriminator: propertyName: delegate_type mapping: azure: '#/components/schemas/snapshot._types.SourceOnlyRepositorySettingsForAzure' fs: '#/components/schemas/snapshot._types.SourceOnlyRepositorySettingsForSharedFileSystem' gcs: '#/components/schemas/snapshot._types.SourceOnlyRepositorySettingsForGcs' s3: '#/components/schemas/snapshot._types.SourceOnlyRepositorySettingsForS3' url: '#/components/schemas/snapshot._types.SourceOnlyRepositorySettingsForReadOnlyUrl' snapshot._types.SourceOnlyRepositorySettingsForSharedFileSystem: required: - delegate_type - location type: object properties: delegate_type: enum: - fs type: string location: type: string description: "The location of the shared filesystem used to store and retrieve snapshots.\nThis location must be registered in the `path.repo` setting on all master and data nodes in the cluster.\nUnlike `path.repo`, this setting supports only a single file path." max_number_of_snapshots: type: number description: "The maximum number of snapshots the repository can contain.\nThe default is `Integer.MAX_VALUE`, which is 2^31-1 or `2147483647`." default: 2147483647 readonly: type: boolean description: "If `true`, the repository is read-only.\nThe cluster can retrieve and restore snapshots from the repository but not write to the repository or create snapshots in it.\n\nOnly a cluster with write access can create snapshots in the repository.\nAll other clusters connected to the repository should have the `readonly` parameter set to `true`.\n\nIf `false`, the cluster can write to the repository and create snapshots in it.\n\nIMPORTANT: If you register the same snapshot repository with multiple clusters, only one cluster should have write access to the repository.\nHaving multiple clusters write to the repository at the same time risks corrupting the contents of the repository." default: false snapshot._types.SourceOnlyRepositorySettingsForReadOnlyUrl: required: - delegate_type - url type: object properties: delegate_type: enum: - url type: string http_max_retries: type: number description: The maximum number of retries for HTTP and HTTPS URLs. default: 5 http_socket_timeout: allOf: - $ref: '#/components/schemas/_types.Duration' description: The maximum wait time for data transfers over a connection. default: 50s max_number_of_snapshots: type: number description: "The maximum number of snapshots the repository can contain.\nThe default is `Integer.MAX_VALUE`, which is 2^31-1 or `2147483647`." default: 2147483647 url: type: string description: "The URL location of the root of the shared filesystem repository.\nThe following protocols are supported:\n\n* `file`\n* `ftp`\n* `http`\n* `https`\n* `jar`\n\nURLs using the HTTP, HTTPS, or FTP protocols must be explicitly allowed with the `repositories.url.allowed_urls` cluster setting.\nThis setting supports wildcards in the place of a host, path, query, or fragment in the URL.\n\nURLs using the file protocol must point to the location of a shared filesystem accessible to all master and data nodes in the cluster.\nThis location must be registered in the `path.repo` setting.\nYou don't need to register URLs using the FTP, HTTP, HTTPS, or JAR protocols in the `path.repo` setting." snapshot._types.SourceOnlyRepositorySettingsForAzure: required: - delegate_type type: object properties: delegate_type: enum: - azure type: string base_path: type: string description: "The path to the repository data within the container.\nIt defaults to the root directory.\n\nNOTE: Don't set `base_path` when configuring a snapshot repository for Elastic Cloud Enterprise.\nElastic Cloud Enterprise automatically generates the `base_path` for each deployment so that multiple deployments can share the same bucket." client: type: string description: The name of the Azure repository client to use. default: default container: type: string description: The Azure container. default: elasticsearch-snapshots data_access_tier: type: string description: "The Azure access tier applied to the data blobs of the repository, which hold the files that make up each snapshotted shard.\nAccepted values are `hot`, `cool` and `cold`, in any letter case.\nIf not set, no access tier is requested and Azure applies the default tier of the storage account." x-state: Generally available; Added in 9.5.0 delete_objects_max_size: type: number description: "The maxmimum batch size, between 1 and 256, used for `BlobBatch` requests.\nDefaults to 256 which is the maximum number supported by the Azure blob batch API." default: 256 location_mode: type: string description: "Either `primary_only` or `secondary_only`.\nNote that if you set it to `secondary_only`, it will force `readonly` to `true`." default: primary_only max_concurrent_batch_deletes: type: number description: "The maximum number of concurrent batch delete requests that will be submitted for any individual bulk delete with `BlobBatch`.\nNote that the effective number of concurrent deletes is further limited by the Azure client connection and event loop thread limits.\nDefaults to 10, minimum is 1, maximum is 100." default: 10 metadata_access_tier: type: string description: "The Azure access tier applied to the metadata blobs of the repository.\nThese are generally smaller than the data blobs but can be read more often, for example to list the repository contents or to take snapshots.\nAccepted values are `hot`, `cool` and `cold`, in any letter case.\nIf not set, no access tier is requested and Azure applies the default tier of the storage account." x-state: Generally available; Added in 9.5.0 readonly: type: boolean description: "If `true`, the repository is read-only.\nThe cluster can retrieve and restore snapshots from the repository but not write to the repository or create snapshots in it.\n\nOnly a cluster with write access can create snapshots in the repository.\nAll other clusters connected to the repository should have the `readonly` parameter set to `true`.\nIf `false`, the cluster can write to the repository and create snapshots in it.\n\nIMPORTANT: If you register the same snapshot repository with multiple clusters, only one cluster should have write access to the repository.\nHaving multiple clusters write to the repository at the same time risks corrupting the contents of the repository." default: false snapshot._types.SourceOnlyRepositorySettingsForGcs: required: - delegate_type - bucket type: object properties: delegate_type: enum: - gcs type: string bucket: type: string description: The name of the bucket to be used for snapshots. application_name: type: string description: The name used by the client when it uses the Google Cloud Storage service. deprecated: true base_path: type: string description: "The path to the repository data within the bucket.\nIt defaults to the root of the bucket.\n\nNOTE: Don't set `base_path` when configuring a snapshot repository for Elastic Cloud Enterprise.\nElastic Cloud Enterprise automatically generates the `base_path` for each deployment so that multiple deployments can share the same bucket." client: type: string description: The name of the client to use to connect to Google Cloud Storage. default: default readonly: type: boolean description: "If `true`, the repository is read-only.\nThe cluster can retrieve and restore snapshots from the repository but not write to the repository or create snapshots in it.\n\nOnly a cluster with write access can create snapshots in the repository.\nAll other clusters connected to the repository should have the `readonly` parameter set to `true`.\n\nIf `false`, the cluster can write to the repository and create snapshots in it.\n\nIMPORTANT: If you register the same snapshot repository with multiple clusters, only one cluster should have write access to the repository.\nHaving multiple clusters write to the repository at the same time risks corrupting the contents of the repository." default: false snapshot._types.SourceOnlyRepositorySettingsForS3: required: - delegate_type - bucket type: object properties: delegate_type: enum: - s3 type: string bucket: type: string description: "The name of the S3 bucket to use for snapshots.\nThe bucket name must adhere to Amazon's S3 bucket naming rules." externalDocs: url: https://docs.aws.amazon.com/AmazonS3/latest/userguide/BucketRestrictions.html#bucketnamingrules base_path: type: string description: "The path to the repository data within its bucket.\nIt defaults to an empty string, meaning that the repository is at the root of the bucket.\nThe value of this setting should not start or end with a forward slash (`/`).\n\nNOTE: Don't set base_path when configuring a snapshot repository for Elastic Cloud Enterprise.\nElastic Cloud Enterprise automatically generates the `base_path` for each deployment so that multiple deployments may share the same bucket." buffer_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "The minimum threshold below which the chunk is uploaded using a single request.\nBeyond this threshold, the S3 repository will use the AWS Multipart Upload API to split the chunk into several parts, each of `buffer_size` length, and to upload each part in its own request.\nNote that setting a buffer size lower than 5mb is not allowed since it will prevent the use of the Multipart API and may result in upload errors.\nIt is also not possible to set a buffer size greater than 5gb as it is the maximum upload size allowed by S3.\nDefaults to `100mb` or 5% of JVM heap, whichever is smaller." canned_acl: type: string description: "The S3 repository supports all S3 canned ACLs: `private`, `public-read`, `public-read-write`, `authenticated-read`, `log-delivery-write`, `bucket-owner-read`, `bucket-owner-full-control`.\nYou could specify a canned ACL using the `canned_acl` setting.\nWhen the S3 repository creates buckets and objects, it adds the canned ACL into the buckets and objects." default: private externalDocs: url: https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#canned-acl client: type: string description: The name of the S3 client to use to connect to S3. default: default delete_objects_max_size: type: number description: "The maxmimum batch size, between 1 and 1000, used for `DeleteObjects` requests.\nDefaults to 1000 which is the maximum number supported by the AWS DeleteObjects API." default: 1000 externalDocs: url: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html get_register_retry_delay: allOf: - $ref: '#/components/schemas/_types.Duration' description: The time to wait before trying again if an attempt to read a linearizable register fails. default: 5s max_multipart_parts: type: number description: "The maximum number of parts that Elasticsearch will write during a multipart upload of a single object.\nFiles which are larger than `buffer_size × max_multipart_parts` will be chunked into several smaller objects.\nElasticsearch may also split a file across multiple objects to satisfy other constraints such as the `chunk_size` limit.\nDefaults to `10000` which is the maximum number of parts in a multipart upload in AWS S3." default: 10000 max_multipart_upload_cleanup_size: type: number description: "The maximum number of possibly-dangling multipart uploads to clean up in each batch of snapshot deletions.\nDefaults to 1000 which is the maximum number supported by the AWS ListMultipartUploads API.\nIf set to `0`, Elasticsearch will not attempt to clean up dangling multipart uploads." default: 1000 externalDocs: url: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html readonly: type: boolean description: "If true, the repository is read-only.\nThe cluster can retrieve and restore snapshots from the repository but not write to the repository or create snapshots in it.\n\nOnly a cluster with write access can create snapshots in the repository.\nAll other clusters connected to the repository should have the `readonly` parameter set to `true`.\n\nIf `false`, the cluster can write to the repository and create snapshots in it.\n\nIMPORTANT: If you register the same snapshot repository with multiple clusters, only one cluster should have write access to the repository.\nHaving multiple clusters write to the repository at the same time risks corrupting the contents of the repository." default: false server_side_encryption: type: boolean description: 'When set to `true`, files are encrypted on server side using an AES256 algorithm.' default: false storage_class: type: string description: "The S3 storage class for objects written to the repository.\nValues may be `standard`, `reduced_redundancy`, `standard_ia`, `onezone_ia`, and `intelligent_tiering`." default: standard externalDocs: url: https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore/s3-repository#repository-s3-storage-classes throttled_delete_retry.delay_increment: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The delay before the first retry and the amount the delay is incremented by on each subsequent retry.\nThe default is 50ms and the minimum is 0ms." default: 50ms throttled_delete_retry.maximum_delay: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The upper bound on how long the delays between retries will grow to.\nThe default is 5s and the minimum is 0ms." default: 5s throttled_delete_retry.maximum_number_of_retries: type: number description: "The number times to retry a throttled snapshot deletion.\nThe default is 10 and the minimum value is 0 which will disable retries altogether.\nNote that if retries are enabled in the Azure client, each of these retries comprises that many client-level retries." snapshot._types.SnapshotSort: enum: - start_time - duration - name - index_count - repository - shard_count - failed_shard_count type: string snapshot._types.SnapshotState: enum: - IN_PROGRESS - SUCCESS - FAILED - PARTIAL - INCOMPATIBLE type: string snapshot.get.SnapshotResponseItem: required: - repository type: object properties: repository: allOf: - $ref: '#/components/schemas/_types.Name' snapshots: type: array items: $ref: '#/components/schemas/snapshot._types.SnapshotInfo' error: allOf: - $ref: '#/components/schemas/_types.ErrorCause' snapshot.repository_analyze.SnapshotNodeInfo: required: - id - name type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' name: allOf: - $ref: '#/components/schemas/_types.Name' snapshot.repository_analyze.DetailsInfo: required: - blob - write_elapsed - write_elapsed_nanos - write_throttled - write_throttled_nanos - writer_node type: object properties: blob: allOf: - $ref: '#/components/schemas/snapshot.repository_analyze.BlobDetails' description: A description of the blob that was written and read. overwrite_elapsed: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The elapsed time spent overwriting the blob.\nIf the blob was not overwritten, this information is omitted." overwrite_elapsed_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' description: "The elapsed time spent overwriting the blob, in nanoseconds.\nIf the blob was not overwritten, this information is omitted." write_elapsed: allOf: - $ref: '#/components/schemas/_types.Duration' description: The elapsed time spent writing the blob. write_elapsed_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' description: 'The elapsed time spent writing the blob, in nanoseconds.' write_throttled: allOf: - $ref: '#/components/schemas/_types.Duration' description: The length of time spent waiting for the `max_snapshot_bytes_per_sec` (or `indices.recovery.max_bytes_per_sec` if the recovery settings for managed services are set) throttle while writing the blob. write_throttled_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' description: 'The length of time spent waiting for the `max_snapshot_bytes_per_sec` (or `indices.recovery.max_bytes_per_sec` if the recovery settings for managed services are set) throttle while writing the blob, in nanoseconds.' writer_node: allOf: - $ref: '#/components/schemas/snapshot.repository_analyze.SnapshotNodeInfo' description: The node which wrote the blob and coordinated the read operations. snapshot.repository_analyze.BlobDetails: required: - name - overwritten - read_early - read_end - read_start - reads - size - size_bytes type: object properties: name: type: string description: The name of the blob. overwritten: type: boolean description: "Indicates whether the blob was overwritten while the read operations were ongoing.\n /**" read_early: type: boolean read_end: type: number description: 'The position, in bytes, at which read operations completed.' read_start: type: number description: 'The position, in bytes, at which read operations started.' reads: allOf: - $ref: '#/components/schemas/snapshot.repository_analyze.ReadBlobDetails' description: A description of every read operation performed on the blob. size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The size of the blob. size_bytes: type: number description: The size of the blob in bytes. snapshot.repository_analyze.ReadBlobDetails: required: - first_byte_time_nanos - found - node type: object properties: before_write_complete: type: boolean description: Indicates whether the read operation may have started before the write operation was complete. elapsed: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The length of time spent reading the blob.\nIf the blob was not found, this detail is omitted." elapsed_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' description: "The length of time spent reading the blob, in nanoseconds.\nIf the blob was not found, this detail is omitted." first_byte_time: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The length of time waiting for the first byte of the read operation to be received.\nIf the blob was not found, this detail is omitted." first_byte_time_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' description: "The length of time waiting for the first byte of the read operation to be received, in nanoseconds.\nIf the blob was not found, this detail is omitted." found: type: boolean description: "Indicates whether the blob was found by the read operation.\nIf the read was started before the write completed or the write was ended before completion, it might be false." node: allOf: - $ref: '#/components/schemas/snapshot.repository_analyze.SnapshotNodeInfo' description: The node that performed the read operation. throttled: allOf: - $ref: '#/components/schemas/_types.Duration' description: "The length of time spent waiting due to the `max_restore_bytes_per_sec` or `indices.recovery.max_bytes_per_sec` throttles during the read of the blob.\nIf the blob was not found, this detail is omitted." throttled_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' description: "The length of time spent waiting due to the `max_restore_bytes_per_sec` or `indices.recovery.max_bytes_per_sec` throttles during the read of the blob, in nanoseconds.\nIf the blob was not found, this detail is omitted." snapshot.repository_analyze.SummaryInfo: required: - read - write type: object properties: read: allOf: - $ref: '#/components/schemas/snapshot.repository_analyze.ReadSummaryInfo' description: A collection of statistics that summarise the results of the read operations in the test. write: allOf: - $ref: '#/components/schemas/snapshot.repository_analyze.WriteSummaryInfo' description: A collection of statistics that summarise the results of the write operations in the test. snapshot.repository_analyze.ReadSummaryInfo: required: - count - max_wait - max_wait_nanos - total_elapsed - total_elapsed_nanos - total_size - total_size_bytes - total_throttled - total_throttled_nanos - total_wait - total_wait_nanos type: object properties: count: type: number description: The number of read operations performed in the test. max_wait: allOf: - $ref: '#/components/schemas/_types.Duration' description: The maximum time spent waiting for the first byte of any read request to be received. max_wait_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' description: 'The maximum time spent waiting for the first byte of any read request to be received, in nanoseconds.' total_elapsed: allOf: - $ref: '#/components/schemas/_types.Duration' description: The total elapsed time spent on reading blobs in the test. total_elapsed_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' description: 'The total elapsed time spent on reading blobs in the test, in nanoseconds.' total_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The total size of all the blobs or partial blobs read in the test. total_size_bytes: type: number description: 'The total size of all the blobs or partial blobs read in the test, in bytes.' total_throttled: allOf: - $ref: '#/components/schemas/_types.Duration' description: The total time spent waiting due to the `max_restore_bytes_per_sec` or `indices.recovery.max_bytes_per_sec` throttles. total_throttled_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' description: 'The total time spent waiting due to the `max_restore_bytes_per_sec` or `indices.recovery.max_bytes_per_sec` throttles, in nanoseconds.' total_wait: allOf: - $ref: '#/components/schemas/_types.Duration' description: The total time spent waiting for the first byte of each read request to be received. total_wait_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' description: 'The total time spent waiting for the first byte of each read request to be received, in nanoseconds.' snapshot.repository_analyze.WriteSummaryInfo: required: - count - total_elapsed - total_elapsed_nanos - total_size - total_size_bytes - total_throttled - total_throttled_nanos type: object properties: count: type: number description: The number of write operations performed in the test. total_elapsed: allOf: - $ref: '#/components/schemas/_types.Duration' description: The total elapsed time spent on writing blobs in the test. total_elapsed_nanos: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitNanos' description: 'The total elapsed time spent on writing blobs in the test, in nanoseconds.' total_size: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: The total size of all the blobs written in the test. total_size_bytes: type: number description: 'The total size of all the blobs written in the test, in bytes.' total_throttled: allOf: - $ref: '#/components/schemas/_types.Duration' description: The total time spent waiting due to the `max_snapshot_bytes_per_sec` throttle. total_throttled_nanos: type: number description: 'The total time spent waiting due to the `max_snapshot_bytes_per_sec` throttle, in nanoseconds.' snapshot.restore.SnapshotRestore: required: - indices - snapshot - shards type: object properties: indices: type: array items: $ref: '#/components/schemas/_types.IndexName' snapshot: type: string shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' snapshot._types.Status: required: - include_global_state - indices - repository - shards_stats - snapshot - state - stats - uuid type: object properties: include_global_state: type: boolean description: Indicates whether the current cluster state is included in the snapshot. indices: type: object additionalProperties: $ref: '#/components/schemas/snapshot._types.SnapshotIndexStats' repository: type: string description: The name of the repository that includes the snapshot. shards_stats: allOf: - $ref: '#/components/schemas/snapshot._types.ShardsStats' description: Statistics for the shards in the snapshot. snapshot: type: string description: The name of the snapshot. state: type: string description: "The current snapshot state:\n\n* `STARTED`: The snapshot is currently running.\n* `SUCCESS`: All shard snapshots have completed. The snapshot may or may not have completed finalization.\n* `FAILED`: The snapshot finished with an error and failed to store any data." stats: allOf: - $ref: '#/components/schemas/snapshot._types.SnapshotStats' description: Details about the number (`file_count`) and size (`size_in_bytes`) of files included in the snapshot. uuid: allOf: - $ref: '#/components/schemas/_types.Uuid' description: The universally unique identifier (UUID) for the snapshot. snapshot._types.SnapshotIndexStats: required: - shards - shards_stats - stats type: object properties: shards: type: object additionalProperties: $ref: '#/components/schemas/snapshot._types.SnapshotShardsStatus' shards_stats: allOf: - $ref: '#/components/schemas/snapshot._types.ShardsStats' stats: allOf: - $ref: '#/components/schemas/snapshot._types.SnapshotStats' snapshot._types.SnapshotShardsStatus: required: - stage - stats type: object properties: stage: allOf: - $ref: '#/components/schemas/snapshot._types.ShardsStatsStage' description: "\n\nSupported values include:\n - `DONE`: The number of shards in the snapshot that were successfully stored in the repository.\n - `FAILURE`: The number of shards in the snapshot that were not successfully stored in the repository.\n - `FINALIZE`: The number of shards in the snapshot that are in the finalizing stage of being stored in the repository.\n - `INIT`: The number of shards in the snapshot that are in the initializing stage of being stored in the repository.\n - `STARTED`: The number of shards in the snapshot that are in the started stage of being stored in the repository.\n\n" stats: allOf: - $ref: '#/components/schemas/snapshot._types.ShardsStatsSummary' snapshot._types.ShardsStatsStage: enum: - DONE - FAILURE - FINALIZE - INIT - STARTED type: string snapshot._types.ShardsStatsSummary: required: - incremental - total - start_time_in_millis - time_in_millis type: object properties: incremental: allOf: - $ref: '#/components/schemas/snapshot._types.ShardsStatsSummaryItem' total: allOf: - $ref: '#/components/schemas/snapshot._types.ShardsStatsSummaryItem' start_time_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' time: allOf: - $ref: '#/components/schemas/_types.Duration' time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' snapshot._types.ShardsStatsSummaryItem: required: - file_count - size_in_bytes type: object properties: file_count: type: number size_in_bytes: type: number snapshot._types.ShardsStats: required: - done - failed - finalizing - initializing - started - total type: object properties: done: type: number description: 'The number of shards that initialized, started, and finalized successfully.' failed: type: number description: The number of shards that failed to be included in the snapshot. finalizing: type: number description: The number of shards that are finalizing but are not done. initializing: type: number description: The number of shards that are still initializing. started: type: number description: The number of shards that have started but are not finalized. total: type: number description: The total number of shards included in the snapshot. snapshot._types.SnapshotStats: required: - incremental - start_time_in_millis - time_in_millis - total type: object properties: incremental: allOf: - $ref: '#/components/schemas/snapshot._types.FileCountSnapshotStats' description: "The number and size of files that still need to be copied as part of the incremental snapshot.\nFor completed snapshots, this property indicates the number and size of files that were not already in the repository and were copied as part of the incremental snapshot." start_time_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: 'The time, in milliseconds, when the snapshot creation process started.' time: allOf: - $ref: '#/components/schemas/_types.Duration' time_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: 'The total time, in milliseconds, that it took for the snapshot process to complete.' total: allOf: - $ref: '#/components/schemas/snapshot._types.FileCountSnapshotStats' description: The total number and size of files that are referenced by the snapshot. snapshot._types.FileCountSnapshotStats: required: - file_count - size_in_bytes type: object properties: file_count: type: number size_in_bytes: type: number snapshot.verify_repository.CompactNodeInfo: required: - name type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' description: "A human-readable name for the node.\nYou can set this name using the `node.name` property in `elasticsearch.yml`.\nThe default value is the machine's hostname." sql._types.Column: required: - name - type type: object properties: name: allOf: - $ref: '#/components/schemas/_types.Name' type: type: string sql._types.Row: type: array items: type: object sql.query.SqlFormat: enum: - csv - json - tsv - txt - yaml - cbor - smile type: string ssl.certificates.CertificateInformation: required: - alias - expiry - format - has_private_key - path - serial_number - subject_dn type: object properties: alias: oneOf: - type: string - type: - 'null' - string description: "If the path refers to a container file (a jks keystore, or a PKCS#12 file), it is the alias of the certificate.\nOtherwise, it is null." expiry: allOf: - $ref: '#/components/schemas/_types.DateTime' description: The ISO formatted date of the certificate's expiry (not-after) date. format: type: string description: "The format of the file.\nValid values include `jks`, `PKCS12`, and `PEM`." has_private_key: type: boolean description: Indicates whether Elasticsearch has access to the private key for this certificate. issuer: type: string description: The Distinguished Name of the certificate's issuer. path: type: string description: 'The path to the certificate, as configured in the `elasticsearch.yml` file.' serial_number: type: string description: The hexadecimal representation of the certificate's serial number. subject_dn: type: string description: The Distinguished Name of the certificate's subject. streams._types.StreamType: enum: - logs - logs.otel - logs.ecs type: string streams.status.StreamStatus: required: - enabled type: object properties: enabled: type: boolean description: 'If true, the stream feature is enabled.' synonyms._types.SynonymsUpdateResult: required: - result type: object properties: result: allOf: - $ref: '#/components/schemas/_types.Result' description: The update operation result. reload_analyzers_details: allOf: - $ref: '#/components/schemas/indices.reload_search_analyzers.ReloadResult' description: "Updating synonyms in a synonym set can reload the associated analyzers in case refresh is set to true.\nThis information is the analyzers reloading result." synonyms._types.SynonymRuleRead: required: - id - synonyms type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: "The identifier for the synonym rule.\nIf you do not specify a synonym rule ID when you create a rule, an identifier is created automatically by Elasticsearch." synonyms: allOf: - $ref: '#/components/schemas/synonyms._types.SynonymString' description: The synonyms that conform the synonym rule in Solr format. externalDocs: url: https://www.elastic.co/docs/reference/text-analysis/analysis-synonym-graph-tokenfilter#analysis-synonym-graph-define-synonyms synonyms._types.SynonymString: type: string synonyms.get_synonyms_sets.SynonymsSetItem: required: - synonyms_set - count type: object properties: synonyms_set: allOf: - $ref: '#/components/schemas/_types.Id' description: Synonyms set identifier count: type: number description: Number of synonym rules that the synonym set contains synonyms._types.SynonymRule: required: - synonyms type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' description: "The identifier for the synonym rule.\nIf you do not specify a synonym rule ID when you create a rule, an identifier is created automatically by Elasticsearch." synonyms: allOf: - $ref: '#/components/schemas/synonyms._types.SynonymString' description: The synonyms that conform the synonym rule in Solr format. externalDocs: url: https://www.elastic.co/docs/reference/text-analysis/analysis-synonym-graph-tokenfilter#analysis-synonym-graph-define-synonyms text_structure._types.EcsCompatibilityType: enum: - disabled - v1 type: string text_structure._types.FormatType: enum: - delimited - ndjson - semi_structured_text - xml type: string text_structure._types.FieldStat: required: - count - cardinality - top_hits type: object properties: count: type: number cardinality: type: number top_hits: type: array items: $ref: '#/components/schemas/text_structure._types.TopHit' mean_value: type: number median_value: type: number max_value: type: number min_value: type: number earliest: type: string latest: type: string text_structure._types.TopHit: required: - count - value type: object properties: count: type: number value: type: object ingest._types.PipelineConfig: required: - processors type: object properties: description: type: string description: Description of the ingest pipeline. version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' description: Version number used by external systems to track ingest pipelines. processors: type: array items: $ref: '#/components/schemas/ingest._types.ProcessorContainer' description: "Processors used to perform transformations on documents before indexing.\nProcessors run sequentially in the order specified." text_structure.find_structure.FindStructureFormat: enum: - ndjson - xml - delimited - semi_structured_text type: string text_structure.test_grok_pattern.MatchedText: required: - matched type: object properties: matched: type: boolean fields: type: object additionalProperties: type: array items: $ref: '#/components/schemas/text_structure.test_grok_pattern.MatchedField' text_structure.test_grok_pattern.MatchedField: required: - match - offset - length type: object properties: match: type: string offset: type: number length: type: number transform.get_node_stats.TransformNodeFullStats: required: - total type: object properties: total: allOf: - $ref: '#/components/schemas/transform.get_node_stats.TransformNodeStats' transform.get_node_stats.TransformNodeStats: required: - scheduler type: object properties: scheduler: allOf: - $ref: '#/components/schemas/transform.get_node_stats.TransformSchedulerStats' transform.get_node_stats.TransformSchedulerStats: required: - registered_transform_count type: object properties: registered_transform_count: type: number peek_transform: type: string transform.get_transform.TransformSummary: required: - dest - id - source type: object properties: authorization: allOf: - $ref: '#/components/schemas/ml._types.TransformAuthorization' description: 'The security privileges that the transform uses to run its queries. If Elastic Stack security features were disabled at the time of the most recent update to the transform, this property is omitted.' create_time: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: The time the transform was created. create_time_string: allOf: - $ref: '#/components/schemas/_types.DateTime' description: type: string description: Free text description of the transform. dest: allOf: - $ref: '#/components/schemas/transform._types.Destination' description: The destination for the transform. frequency: allOf: - $ref: '#/components/schemas/_types.Duration' id: allOf: - $ref: '#/components/schemas/_types.Id' latest: allOf: - $ref: '#/components/schemas/transform._types.Latest' pivot: allOf: - $ref: '#/components/schemas/transform._types.Pivot' description: The pivot method transforms the data by aggregating and grouping it. retention_policy: allOf: - $ref: '#/components/schemas/transform._types.RetentionPolicyContainer' settings: allOf: - $ref: '#/components/schemas/transform._types.Settings' description: Defines optional transform settings. source: allOf: - $ref: '#/components/schemas/transform._types.Source' description: The source of the data for the transform. sync: allOf: - $ref: '#/components/schemas/transform._types.SyncContainer' description: Defines the properties transforms require to run continuously. version: allOf: - $ref: '#/components/schemas/_types.VersionString' description: The version of Elasticsearch that existed on the node when the transform was created. _meta: allOf: - $ref: '#/components/schemas/_types.Metadata' ml._types.TransformAuthorization: type: object properties: api_key: allOf: - $ref: '#/components/schemas/ml._types.ApiKeyAuthorization' description: 'If an API key was used for the most recent update to the transform, its name and identifier are listed in the response.' roles: type: array items: type: string description: 'If a user ID was used for the most recent update to the transform, its roles at the time of the update are listed in the response.' service_account: type: string description: 'If a service account was used for the most recent update to the transform, the account name is listed in the response.' transform._types.Destination: type: object properties: index: allOf: - $ref: '#/components/schemas/_types.IndexName' description: "The destination index for the transform. The mappings of the destination index are deduced based on the source\nfields when possible. If alternate mappings are required, use the create index API prior to starting the\ntransform." aliases: type: array items: $ref: '#/components/schemas/transform._types.DestinationAlias' description: "The aliases that the destination index for the transform should have.\nAliases are manipulated using the stored credentials of the transform, which means the secondary credentials\nsupplied at creation time (if both primary and secondary credentials are specified).\n\nThe destination index is added to the aliases regardless of whether the destination index was created by the\ntransform or pre-created by the user." x-state: Generally available; Added in 8.8.0 pipeline: type: string description: The unique identifier for an ingest pipeline. transform._types.DestinationAlias: required: - alias type: object properties: alias: allOf: - $ref: '#/components/schemas/_types.IndexAlias' description: The name of the alias. move_on_creation: type: boolean description: "Whether the destination index should be the only index in this alias.\nIf `true`, all the other indices will be removed from this alias before adding the destination index to this\nalias. This does not delete the removed indices; it only removes them from the alias." default: false transform._types.Latest: required: - sort - unique_key type: object properties: sort: allOf: - $ref: '#/components/schemas/_types.Field' description: Specifies the date field that is used to identify the latest documents. unique_key: type: array items: $ref: '#/components/schemas/_types.Field' description: Specifies an array of one or more fields that are used to group the data. transform._types.Pivot: type: object properties: aggregations: type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.AggregationContainer' description: "Defines how to aggregate the grouped data. The following aggregations are currently supported: average, bucket\nscript, bucket selector, cardinality, filter, geo bounds, geo centroid, geo line, max, median absolute deviation,\nmin, missing, percentiles, rare terms, scripted metric, stats, sum, terms, top metrics, value count, weighted\naverage." group_by: type: object additionalProperties: $ref: '#/components/schemas/transform._types.PivotGroupByContainer' description: "Defines how to group the data. More than one grouping can be defined per pivot. The following groupings are\ncurrently supported: date histogram, geotile grid, histogram, terms." transform._types.PivotGroupByContainer: maxProperties: 1 minProperties: 1 type: object properties: date_histogram: allOf: - $ref: '#/components/schemas/_types.aggregations.DateHistogramAggregation' geotile_grid: allOf: - $ref: '#/components/schemas/_types.aggregations.GeoTileGridAggregation' histogram: allOf: - $ref: '#/components/schemas/_types.aggregations.HistogramAggregation' terms: allOf: - $ref: '#/components/schemas/_types.aggregations.TermsAggregation' transform._types.RetentionPolicyContainer: maxProperties: 1 minProperties: 1 type: object properties: time: allOf: - $ref: '#/components/schemas/transform._types.RetentionPolicy' description: Specifies that the transform uses a time field to set the retention policy. transform._types.RetentionPolicy: required: - field - max_age type: object properties: field: allOf: - $ref: '#/components/schemas/_types.Field' description: The date field that is used to calculate the age of the document. max_age: allOf: - $ref: '#/components/schemas/_types.Duration' description: "Specifies the maximum age of a document in the destination index. Documents that are older than the configured\nvalue are removed from the destination index." transform._types.Settings: type: object properties: align_checkpoints: type: boolean description: "Specifies whether the transform checkpoint ranges should be optimized for performance. Such optimization can align\ncheckpoint ranges with the date histogram interval when date histogram is specified as a group source in the\ntransform config. As a result, less document updates in the destination index will be performed thus improving\noverall performance." default: true dates_as_epoch_millis: type: boolean description: "Defines if dates in the output should be written as ISO formatted string or as millis since epoch. epoch_millis was\nthe default for transforms created before version 7.11. For compatible output set this value to `true`." default: false deduce_mappings: type: boolean description: Specifies whether the transform should deduce the destination index mappings from the transform configuration. default: true docs_per_second: type: number description: "Specifies a limit on the number of input documents per second. This setting throttles the transform by adding a\nwait time between search requests. The default value is null, which disables throttling." max_page_search_size: type: number description: "Defines the initial page size to use for the composite aggregation for each checkpoint. If circuit breaker\nexceptions occur, the page size is dynamically adjusted to a lower value. The minimum value is `10` and the\nmaximum is `65,536`. The default value is `500` for `pivot` transforms and `5000` for `latest` transforms." use_point_in_time: type: boolean description: "Specifies whether the transform checkpoint will use the Point In Time API while searching over the source index.\nIn general, Point In Time is an optimization that will reduce pressure on the source index by reducing the amount\nof refreshes and merges, but it can be expensive if a large number of Point In Times are opened and closed for a\ngiven index. The benefits and impact depend on the data being searched, the ingest rate into the source index, and\nthe amount of other consumers searching the same source index." default: true externalDocs: url: https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-open-point-in-time num_failure_retries: type: number description: "Defines the number of retries on a recoverable failure before the transform task is marked as `failed`.\nThe minimum value is `0` and the maximum is `100`, where `-1` indicates that the transform retries indefinitely.\nIf unset, the cluster-level setting `num_transform_failure_retries` is used.\n\nThis setting cannot be specified when `unattended` is `true`, because unattended transforms always retry\nindefinitely." x-state: Generally available; Added in 8.4.0 unattended: type: boolean description: "If `true`, the transform runs in unattended mode. In unattended mode, the transform retries indefinitely in case\nof an error which means the transform never fails. Setting the number of retries other than infinite fails in\nvalidation." default: false x-state: Generally available; Added in 8.5.0 indexer_request_timeout: oneOf: - $ref: '#/components/schemas/_types.Duration' - type: - 'null' - string description: "The initial timeout for the requests the transform sends to nodes to retrieve checkpoint information.\nEach consecutive failure doubles the timeout, up to a maximum of `12h`. The minimum value is `1ms` and the\nmaximum is `12h`. Defaults to `30s`." x-state: Generally available; Added in 8.19.24 description: The source of the data for the transform. transform._types.Source: required: - index type: object properties: index: allOf: - $ref: '#/components/schemas/_types.Indices' description: "The source indices for the transform. It can be a single index, an index pattern (for example, `\"my-index-*\"\"`), an\narray of indices (for example, `[\"my-index-000001\", \"my-index-000002\"]`), or an array of index patterns (for\nexample, `[\"my-index-*\", \"my-other-index-*\"]`. For remote indices use the syntax `\"remote_name:index_name\"`. If\nany indices are in remote clusters then the master node and at least one transform node must have the `remote_cluster_client` node role." runtime_mappings: allOf: - $ref: '#/components/schemas/_types.mapping.RuntimeFields' description: "Definitions of search-time runtime fields that can be used by the transform. For search runtime fields all data\nnodes, including remote nodes, must be 7.12 or later." x-state: Generally available; Added in 7.12.0 query: type: object description: "A query clause that retrieves a subset of data from the source index.\n" externalDocs: description: Query DSL url: https://www.elastic.co/docs/explore-analyze/query-filter/languages/querydsl x-model: true transform._types.SyncContainer: maxProperties: 1 minProperties: 1 type: object properties: time: allOf: - $ref: '#/components/schemas/transform._types.TimeSync' description: Specifies that the transform uses a time field to synchronize the source and destination indices. transform._types.TimeSync: required: - field type: object properties: delay: allOf: - $ref: '#/components/schemas/_types.Duration' description: The time delay between the current time and the latest input data time. default: 60s field: allOf: - $ref: '#/components/schemas/_types.Field' description: "The date field that is used to identify new documents in the source. In general, it’s a good idea to use a field\nthat contains the ingest timestamp. If you use a different field, you might need to set the delay such that it\naccounts for data transmission delays." transform.get_transform_stats.TransformStats: required: - checkpointing - id - state - stats type: object properties: checkpointing: allOf: - $ref: '#/components/schemas/transform.get_transform_stats.Checkpointing' health: allOf: - $ref: '#/components/schemas/transform.get_transform_stats.TransformStatsHealth' id: allOf: - $ref: '#/components/schemas/_types.Id' node: allOf: - $ref: '#/components/schemas/_types.NodeAttributes' reason: type: string state: type: string stats: allOf: - $ref: '#/components/schemas/transform.get_transform_stats.TransformIndexerStats' transform.get_transform_stats.Checkpointing: required: - last type: object properties: changes_last_detected_at: type: number changes_last_detected_at_string: allOf: - $ref: '#/components/schemas/_types.DateTime' last: allOf: - $ref: '#/components/schemas/transform.get_transform_stats.CheckpointStats' next: allOf: - $ref: '#/components/schemas/transform.get_transform_stats.CheckpointStats' operations_behind: type: number last_search_time: type: number last_search_time_string: allOf: - $ref: '#/components/schemas/_types.DateTime' transform.get_transform_stats.CheckpointStats: required: - checkpoint type: object properties: checkpoint: type: number checkpoint_progress: allOf: - $ref: '#/components/schemas/transform.get_transform_stats.TransformProgress' timestamp: allOf: - $ref: '#/components/schemas/_types.DateTime' timestamp_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' time_upper_bound: allOf: - $ref: '#/components/schemas/_types.DateTime' time_upper_bound_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' transform.get_transform_stats.TransformProgress: required: - docs_indexed - docs_processed type: object properties: docs_indexed: type: number docs_processed: type: number docs_remaining: type: number percent_complete: type: number total_docs: type: number transform.get_transform_stats.TransformStatsHealth: required: - status type: object properties: status: allOf: - $ref: '#/components/schemas/_types.HealthStatus' description: "\n\nSupported values include:\n - `green` (or `GREEN`): All shards are assigned.\n - `yellow` (or `YELLOW`): All primary shards are assigned, but one or more replica shards are unassigned. If a node in the cluster fails, some data could be unavailable until that node is repaired.\n - `red` (or `RED`): One or more primary shards are unassigned, so some data is unavailable. This can occur briefly during cluster startup as primary shards are assigned.\n - `unknown`\n - `unavailable`\n\n" issues: type: array items: $ref: '#/components/schemas/transform.get_transform_stats.TransformHealthIssue' description: 'If a non-healthy status is returned, contains a list of issues of the transform.' transform.get_transform_stats.TransformHealthIssue: required: - type - issue - count type: object properties: type: type: string description: The type of the issue issue: type: string description: A description of the issue details: type: string description: Details about the issue count: type: number description: Number of times this issue has occurred since it started first_occurrence: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' description: The timestamp this issue occurred for for the first time first_occurence_string: allOf: - $ref: '#/components/schemas/_types.DateTime' transform.get_transform_stats.TransformIndexerStats: required: - documents_indexed - documents_processed - exponential_avg_checkpoint_duration_ms - exponential_avg_documents_indexed - exponential_avg_documents_processed - index_failures - index_time_in_ms - index_total - pages_processed - processing_time_in_ms - processing_total - search_failures - search_time_in_ms - search_total - trigger_count type: object properties: delete_time_in_ms: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' documents_indexed: type: number documents_deleted: type: number documents_processed: type: number exponential_avg_checkpoint_duration_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitFloatMillis' exponential_avg_documents_indexed: type: number exponential_avg_documents_processed: type: number index_failures: type: number index_time_in_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' index_total: type: number pages_processed: type: number processing_time_in_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' processing_total: type: number search_failures: type: number search_time_in_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' search_total: type: number trigger_count: type: number _global.update.UpdateWriteResponseBase: allOf: - $ref: '#/components/schemas/_types.WriteResponseBase' - type: object properties: get: allOf: - $ref: '#/components/schemas/_types.InlineGet' _global.update_by_query_rethrottle.UpdateByQueryRethrottleNode: allOf: - $ref: '#/components/schemas/_spec_utils.BaseNode' - required: - tasks type: object properties: tasks: type: object additionalProperties: $ref: '#/components/schemas/tasks._types.TaskInfo' watcher._types.WatchStatus: required: - actions - state - version type: object properties: actions: allOf: - $ref: '#/components/schemas/watcher._types.Actions' last_checked: allOf: - $ref: '#/components/schemas/_types.DateTime' last_met_condition: allOf: - $ref: '#/components/schemas/_types.DateTime' state: allOf: - $ref: '#/components/schemas/watcher._types.ActivationState' version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' execution_state: type: string watcher._types.Actions: type: object additionalProperties: $ref: '#/components/schemas/watcher._types.ActionStatus' watcher._types.ActionStatus: required: - ack type: object properties: ack: allOf: - $ref: '#/components/schemas/watcher._types.AcknowledgeState' last_execution: allOf: - $ref: '#/components/schemas/watcher._types.ExecutionState' last_successful_execution: allOf: - $ref: '#/components/schemas/watcher._types.ExecutionState' last_throttle: allOf: - $ref: '#/components/schemas/watcher._types.ThrottleState' watcher._types.AcknowledgeState: required: - state - timestamp type: object properties: state: allOf: - $ref: '#/components/schemas/watcher._types.AcknowledgementOptions' timestamp: allOf: - $ref: '#/components/schemas/_types.DateTime' watcher._types.AcknowledgementOptions: enum: - awaits_successful_execution - ackable - acked type: string watcher._types.ExecutionState: required: - successful - timestamp type: object properties: successful: type: boolean timestamp: allOf: - $ref: '#/components/schemas/_types.DateTime' reason: type: string watcher._types.ThrottleState: required: - reason - timestamp type: object properties: reason: type: string timestamp: allOf: - $ref: '#/components/schemas/_types.DateTime' watcher._types.ActivationState: required: - active - timestamp type: object properties: active: type: boolean timestamp: allOf: - $ref: '#/components/schemas/_types.DateTime' watcher._types.ActivationStatus: required: - actions - state - version type: object properties: actions: allOf: - $ref: '#/components/schemas/watcher._types.Actions' state: allOf: - $ref: '#/components/schemas/watcher._types.ActivationState' version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' watcher._types.ActionExecutionMode: enum: - simulate - force_simulate - execute - force_execute - skip type: string watcher._types.SimulatedActions: required: - actions - all - use_all type: object properties: actions: type: array items: type: string all: allOf: - $ref: '#/components/schemas/watcher._types.SimulatedActions' use_all: type: boolean watcher._types.ScheduleTriggerEvent: required: - scheduled_time type: object properties: scheduled_time: allOf: - $ref: '#/components/schemas/_types.DateTime' triggered_time: allOf: - $ref: '#/components/schemas/_types.DateTime' watcher._types.Watch: required: - actions - input - trigger type: object properties: actions: type: object additionalProperties: $ref: '#/components/schemas/watcher._types.Action' condition: allOf: - $ref: '#/components/schemas/watcher._types.ConditionContainer' input: allOf: - $ref: '#/components/schemas/watcher._types.InputContainer' metadata: allOf: - $ref: '#/components/schemas/_types.Metadata' status: allOf: - $ref: '#/components/schemas/watcher._types.WatchStatus' throttle_period: allOf: - $ref: '#/components/schemas/_types.Duration' throttle_period_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' transform: allOf: - $ref: '#/components/schemas/_types.TransformContainer' trigger: allOf: - $ref: '#/components/schemas/watcher._types.TriggerContainer' watcher._types.Action: type: object properties: action_type: allOf: - $ref: '#/components/schemas/watcher._types.ActionType' condition: allOf: - $ref: '#/components/schemas/watcher._types.ConditionContainer' foreach: type: string max_iterations: type: number name: allOf: - $ref: '#/components/schemas/_types.Name' throttle_period: allOf: - $ref: '#/components/schemas/_types.Duration' throttle_period_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' transform: allOf: - $ref: '#/components/schemas/_types.TransformContainer' index: allOf: - $ref: '#/components/schemas/watcher._types.IndexAction' logging: allOf: - $ref: '#/components/schemas/watcher._types.LoggingAction' email: allOf: - $ref: '#/components/schemas/watcher._types.EmailAction' pagerduty: allOf: - $ref: '#/components/schemas/watcher._types.PagerDutyAction' slack: allOf: - $ref: '#/components/schemas/watcher._types.SlackAction' webhook: allOf: - $ref: '#/components/schemas/watcher._types.WebhookAction' x-state: Generally available; Added in 7.14.0 watcher._types.ActionType: enum: - email - webhook - index - logging - slack - pagerduty type: string watcher._types.ConditionContainer: maxProperties: 1 minProperties: 1 type: object properties: always: allOf: - $ref: '#/components/schemas/watcher._types.AlwaysCondition' array_compare: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/watcher._types.ArrayCompareCondition' compare: maxProperties: 1 minProperties: 1 type: object additionalProperties: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_types.FieldValue' never: allOf: - $ref: '#/components/schemas/watcher._types.NeverCondition' script: allOf: - $ref: '#/components/schemas/watcher._types.ScriptCondition' watcher._types.AlwaysCondition: type: object watcher._types.ArrayCompareCondition: required: - path type: object properties: path: type: string watcher._types.NeverCondition: type: object watcher._types.ScriptCondition: type: object properties: lang: allOf: - $ref: '#/components/schemas/_types.ScriptLanguage' description: "\n\nSupported values include:\n - `painless`: Painless scripting language, purpose-built for Elasticsearch.\n - `expression`: Lucene’s expressions language, compiles a JavaScript expression to bytecode.\n - `mustache`: Mustache templated, used for templates.\n - `java`: Expert Java API\n\n" default: painless params: type: object additionalProperties: type: object source: allOf: - $ref: '#/components/schemas/_types.ScriptSource' id: type: string _types.TransformContainer: maxProperties: 1 minProperties: 1 type: object properties: chain: type: array items: $ref: '#/components/schemas/_types.TransformContainer' script: allOf: - $ref: '#/components/schemas/_types.ScriptTransform' search: allOf: - $ref: '#/components/schemas/_types.SearchTransform' _types.ScriptTransform: type: object properties: lang: type: string default: painless params: type: object additionalProperties: type: object source: allOf: - $ref: '#/components/schemas/_types.ScriptSource' id: type: string _types.SearchTransform: required: - request type: object properties: request: allOf: - $ref: '#/components/schemas/watcher._types.SearchInputRequestDefinition' timeout: allOf: - $ref: '#/components/schemas/_types.Duration' watcher._types.SearchInputRequestDefinition: type: object properties: body: allOf: - $ref: '#/components/schemas/_global.search._types.SearchRequestBody' indices: allOf: - $ref: '#/components/schemas/_types.Indices' indices_options: allOf: - $ref: '#/components/schemas/_types.IndicesOptions' search_type: allOf: - $ref: '#/components/schemas/_types.SearchType' description: "\n\nSupported values include:\n - `query_then_fetch`: Documents are scored using local term and document frequencies for the shard. This is usually faster but less accurate.\n - `dfs_query_then_fetch`: Documents are scored using global term and document frequencies across all shards. This is usually slower but more accurate.\n\n" template: allOf: - $ref: '#/components/schemas/watcher._types.SearchTemplateRequestBody' rest_total_hits_as_int: type: boolean watcher._types.SearchTemplateRequestBody: type: object properties: explain: type: boolean default: false id: allOf: - $ref: '#/components/schemas/_types.Id' description: "ID of the search template to use. If no source is specified,\nthis parameter is required." lang: allOf: - $ref: '#/components/schemas/_types.ScriptLanguage' description: "The language the template is written in.\nIt is reported in the resolved search input of a watch record.\n\nSupported values include:\n - `painless`: Painless scripting language, purpose-built for Elasticsearch.\n - `expression`: Lucene’s expressions language, compiles a JavaScript expression to bytecode.\n - `mustache`: Mustache templated, used for templates.\n - `java`: Expert Java API\n\n" default: mustache params: type: object additionalProperties: type: object profile: type: boolean default: false source: type: string description: "An inline search template. Supports the same parameters as the search API's\nrequest body. Also supports Mustache variables. If no id is specified, this\nparameter is required." watcher._types.IndexAction: type: object properties: index: allOf: - $ref: '#/components/schemas/_types.IndexName' doc_id: allOf: - $ref: '#/components/schemas/_types.Id' refresh: allOf: - $ref: '#/components/schemas/_types.Refresh' op_type: allOf: - $ref: '#/components/schemas/_types.OpType' description: "\n\nSupported values include:\n - `index`: Overwrite any documents that already exist.\n - `create`: Only index documents that do not already exist.\n\n" default: index timeout: allOf: - $ref: '#/components/schemas/_types.Duration' default: 60s execution_time_field: allOf: - $ref: '#/components/schemas/_types.Field' watcher._types.LoggingAction: required: - text type: object properties: level: type: string text: type: string category: type: string watcher._types.EmailAction: allOf: - $ref: '#/components/schemas/watcher._types.Email' - type: object watcher._types.Email: required: - subject - to type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' bcc: oneOf: - type: string - type: array items: type: string body: allOf: - $ref: '#/components/schemas/watcher._types.EmailBody' cc: oneOf: - type: string - type: array items: type: string from: type: string priority: allOf: - $ref: '#/components/schemas/watcher._types.EmailPriority' reply_to: oneOf: - type: string - type: array items: type: string sent_date: allOf: - $ref: '#/components/schemas/_types.DateTime' subject: type: string to: oneOf: - type: string - type: array items: type: string attachments: type: object additionalProperties: $ref: '#/components/schemas/watcher._types.EmailAttachmentContainer' watcher._types.EmailBody: type: object properties: html: type: string text: type: string watcher._types.EmailPriority: enum: - lowest - low - normal - high - highest type: string watcher._types.EmailAttachmentContainer: maxProperties: 1 minProperties: 1 type: object properties: http: allOf: - $ref: '#/components/schemas/watcher._types.HttpEmailAttachment' reporting: allOf: - $ref: '#/components/schemas/watcher._types.ReportingEmailAttachment' data: allOf: - $ref: '#/components/schemas/watcher._types.DataEmailAttachment' watcher._types.HttpEmailAttachment: type: object properties: content_type: type: string inline: type: boolean request: allOf: - $ref: '#/components/schemas/watcher._types.HttpInputRequestDefinition' watcher._types.HttpInputRequestDefinition: type: object properties: auth: allOf: - $ref: '#/components/schemas/watcher._types.HttpInputAuthentication' body: type: string connection_timeout: allOf: - $ref: '#/components/schemas/_types.Duration' headers: type: object additionalProperties: type: string host: allOf: - $ref: '#/components/schemas/_types.Host' method: allOf: - $ref: '#/components/schemas/watcher._types.HttpInputMethod' params: type: object additionalProperties: type: string path: type: string port: allOf: - $ref: '#/components/schemas/_types.uint' proxy: allOf: - $ref: '#/components/schemas/watcher._types.HttpInputProxy' read_timeout: allOf: - $ref: '#/components/schemas/_types.Duration' scheme: allOf: - $ref: '#/components/schemas/watcher._types.ConnectionScheme' url: type: string watcher._types.HttpInputAuthentication: required: - basic type: object properties: basic: allOf: - $ref: '#/components/schemas/watcher._types.HttpInputBasicAuthentication' watcher._types.HttpInputBasicAuthentication: required: - password - username type: object properties: password: allOf: - $ref: '#/components/schemas/_types.Password' username: allOf: - $ref: '#/components/schemas/_types.Username' watcher._types.HttpInputMethod: enum: - head - get - post - put - delete type: string watcher._types.HttpInputProxy: required: - host - port type: object properties: host: allOf: - $ref: '#/components/schemas/_types.Host' port: allOf: - $ref: '#/components/schemas/_types.uint' watcher._types.ConnectionScheme: enum: - http - https type: string watcher._types.ReportingEmailAttachment: required: - url type: object properties: url: type: string inline: type: boolean retries: type: number default: 40 interval: allOf: - $ref: '#/components/schemas/_types.Duration' default: 15s request: allOf: - $ref: '#/components/schemas/watcher._types.HttpInputRequestDefinition' watcher._types.DataEmailAttachment: type: object properties: format: allOf: - $ref: '#/components/schemas/watcher._types.DataAttachmentFormat' watcher._types.DataAttachmentFormat: enum: - json - yaml type: string watcher._types.PagerDutyAction: allOf: - $ref: '#/components/schemas/watcher._types.PagerDutyEvent' - type: object watcher._types.PagerDutyEvent: required: - attach_payload - description - incident_key type: object properties: account: type: string attach_payload: type: boolean client: type: string client_url: type: string contexts: type: array items: $ref: '#/components/schemas/watcher._types.PagerDutyContext' description: type: string event_type: allOf: - $ref: '#/components/schemas/watcher._types.PagerDutyEventType' default: trigger incident_key: type: string proxy: allOf: - $ref: '#/components/schemas/watcher._types.PagerDutyEventProxy' watcher._types.PagerDutyContext: required: - type type: object properties: href: type: string src: type: string type: allOf: - $ref: '#/components/schemas/watcher._types.PagerDutyContextType' watcher._types.PagerDutyContextType: enum: - link - image type: string watcher._types.PagerDutyEventType: enum: - trigger - resolve - acknowledge type: string watcher._types.PagerDutyEventProxy: type: object properties: host: allOf: - $ref: '#/components/schemas/_types.Host' port: type: number watcher._types.SlackAction: required: - message type: object properties: account: type: string message: allOf: - $ref: '#/components/schemas/watcher._types.SlackMessage' watcher._types.SlackMessage: required: - attachments - from - text - to type: object properties: attachments: type: array items: $ref: '#/components/schemas/watcher._types.SlackAttachment' dynamic_attachments: allOf: - $ref: '#/components/schemas/watcher._types.SlackDynamicAttachment' from: type: string icon: type: string text: type: string to: type: array items: type: string watcher._types.SlackAttachment: required: - author_name - title type: object properties: author_icon: type: string author_link: type: string author_name: type: string color: type: string fallback: type: string fields: type: array items: $ref: '#/components/schemas/watcher._types.SlackAttachmentField' footer: type: string footer_icon: type: string image_url: type: string pretext: type: string text: type: string thumb_url: type: string title: type: string title_link: type: string ts: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitSeconds' watcher._types.SlackAttachmentField: required: - short - title - value type: object properties: short: type: boolean title: type: string value: type: string watcher._types.SlackDynamicAttachment: required: - attachment_template - list_path type: object properties: attachment_template: allOf: - $ref: '#/components/schemas/watcher._types.SlackAttachment' list_path: type: string watcher._types.WebhookAction: allOf: - $ref: '#/components/schemas/watcher._types.HttpInputRequestDefinition' - type: object watcher._types.InputContainer: maxProperties: 1 minProperties: 1 type: object properties: chain: allOf: - $ref: '#/components/schemas/watcher._types.ChainInput' http: allOf: - $ref: '#/components/schemas/watcher._types.HttpInput' search: allOf: - $ref: '#/components/schemas/watcher._types.SearchInput' simple: type: object additionalProperties: type: object transform: allOf: - $ref: '#/components/schemas/_types.TransformContainer' watcher._types.ChainInput: required: - inputs type: object properties: inputs: type: array items: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/watcher._types.InputContainer' watcher._types.HttpInput: type: object properties: extract: type: array items: type: string request: allOf: - $ref: '#/components/schemas/watcher._types.HttpInputRequestDefinition' response_content_type: allOf: - $ref: '#/components/schemas/watcher._types.ResponseContentType' watcher._types.ResponseContentType: enum: - json - yaml - text type: string watcher._types.SearchInput: required: - request type: object properties: extract: type: array items: type: string request: allOf: - $ref: '#/components/schemas/watcher._types.SearchInputRequestDefinition' timeout: allOf: - $ref: '#/components/schemas/_types.Duration' watcher._types.TriggerContainer: maxProperties: 1 minProperties: 1 type: object properties: schedule: allOf: - $ref: '#/components/schemas/watcher._types.ScheduleContainer' watcher._types.ScheduleContainer: maxProperties: 1 minProperties: 1 type: object properties: timezone: type: string cron: allOf: - $ref: '#/components/schemas/watcher._types.CronExpression' daily: allOf: - $ref: '#/components/schemas/watcher._types.DailySchedule' hourly: allOf: - $ref: '#/components/schemas/watcher._types.HourlySchedule' interval: allOf: - $ref: '#/components/schemas/_types.Duration' monthly: oneOf: - $ref: '#/components/schemas/watcher._types.TimeOfMonth' - type: array items: $ref: '#/components/schemas/watcher._types.TimeOfMonth' weekly: oneOf: - $ref: '#/components/schemas/watcher._types.TimeOfWeek' - type: array items: $ref: '#/components/schemas/watcher._types.TimeOfWeek' yearly: oneOf: - $ref: '#/components/schemas/watcher._types.TimeOfYear' - type: array items: $ref: '#/components/schemas/watcher._types.TimeOfYear' watcher._types.DailySchedule: required: - at type: object properties: at: type: array items: $ref: '#/components/schemas/watcher._types.ScheduleTimeOfDay' watcher._types.HourlySchedule: required: - minute type: object properties: minute: type: array items: type: number watcher._types.TimeOfMonth: required: - at - on type: object properties: at: type: array items: type: string on: type: array items: type: number watcher._types.TimeOfWeek: required: - at - on type: object properties: at: type: array items: type: string on: type: array items: $ref: '#/components/schemas/watcher._types.Day' watcher._types.Day: enum: - sunday - monday - tuesday - wednesday - thursday - friday - saturday type: string watcher._types.TimeOfYear: required: - at - int - on type: object properties: at: type: array items: type: string int: type: array items: $ref: '#/components/schemas/watcher._types.Month' on: type: array items: type: number watcher._types.Month: enum: - january - february - march - april - may - june - july - august - september - october - november - december type: string watcher.execute_watch.WatchRecord: required: - '@timestamp' - node - state - trigger_event - watch_id type: object properties: '@timestamp': allOf: - $ref: '#/components/schemas/_types.DateTime' node: type: string state: allOf: - $ref: '#/components/schemas/watcher._types.ExecutionStatus' trigger_event: allOf: - $ref: '#/components/schemas/watcher._types.TriggerEventResult' watch_id: allOf: - $ref: '#/components/schemas/_types.Id' condition: allOf: - $ref: '#/components/schemas/watcher._types.ConditionContainer' input: allOf: - $ref: '#/components/schemas/watcher._types.InputContainer' metadata: allOf: - $ref: '#/components/schemas/_types.Metadata' result: allOf: - $ref: '#/components/schemas/watcher._types.ExecutionResult' user: allOf: - $ref: '#/components/schemas/_types.Username' status: allOf: - $ref: '#/components/schemas/watcher._types.WatchStatus' messages: type: array items: type: string vars: type: object additionalProperties: type: object exception: allOf: - $ref: '#/components/schemas/_types.ErrorCause' watcher._types.ExecutionStatus: enum: - awaits_execution - checking - execution_not_needed - throttled - executed - failed - deleted_while_queued - not_executed_already_queued type: string watcher._types.TriggerEventResult: required: - manual - triggered_time - type type: object properties: manual: allOf: - $ref: '#/components/schemas/watcher._types.TriggerEventContainer' triggered_time: allOf: - $ref: '#/components/schemas/_types.DateTime' type: type: string watcher._types.TriggerEventContainer: maxProperties: 1 minProperties: 1 type: object properties: schedule: allOf: - $ref: '#/components/schemas/watcher._types.ScheduleTriggerEvent' watcher._types.ExecutionResult: required: - actions - execution_duration - execution_time type: object properties: actions: type: array items: $ref: '#/components/schemas/watcher._types.ExecutionResultAction' condition: allOf: - $ref: '#/components/schemas/watcher._types.ExecutionResultCondition' execution_duration: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' execution_time: allOf: - $ref: '#/components/schemas/_types.DateTime' input: allOf: - $ref: '#/components/schemas/watcher._types.ExecutionResultInput' transform: allOf: - $ref: '#/components/schemas/watcher._types.ExecutionResultTransform' watcher._types.ExecutionResultAction: allOf: - $ref: '#/components/schemas/watcher._types.ExecutionResultForeachAction' - required: - id - type - status type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' type: allOf: - $ref: '#/components/schemas/watcher._types.ActionType' status: allOf: - $ref: '#/components/schemas/watcher._types.ActionStatusOptions' condition: allOf: - $ref: '#/components/schemas/watcher._types.ExecutionResultCondition' transform: allOf: - $ref: '#/components/schemas/watcher._types.ExecutionResultTransform' foreach: type: array items: $ref: '#/components/schemas/watcher._types.ExecutionResultForeachAction' max_iterations: type: number number_of_actions_executed: type: number watcher._types.ActionStatusOptions: enum: - success - failure - partial_failure - acknowledged - throttled - condition_failed - simulated type: string watcher._types.ExecutionResultCondition: required: - met - status - type type: object properties: met: type: boolean status: allOf: - $ref: '#/components/schemas/watcher._types.ExecutionResultStatus' type: allOf: - $ref: '#/components/schemas/watcher._types.ConditionType' compare: allOf: - $ref: '#/components/schemas/watcher._types.ExecutionResultConditionResolved' array_compare: allOf: - $ref: '#/components/schemas/watcher._types.ExecutionResultConditionResolved' watcher._types.ExecutionResultStatus: enum: - success - failure type: string watcher._types.ConditionType: enum: - always - never - script - compare - array_compare type: string watcher._types.ExecutionResultConditionResolved: type: object properties: resolved_values: type: object additionalProperties: type: object watcher._types.ExecutionResultTransform: required: - status - type type: object properties: payload: type: object additionalProperties: type: object status: allOf: - $ref: '#/components/schemas/watcher._types.ExecutionResultStatus' type: allOf: - $ref: '#/components/schemas/watcher._types.ExecutionResultTransformType' search: allOf: - $ref: '#/components/schemas/watcher._types.ExecutionResultSearchInput' error: allOf: - $ref: '#/components/schemas/_types.ErrorCause' reason: type: string watcher._types.ExecutionResultTransformType: enum: - script - search - chain type: string watcher._types.ExecutionResultSearchInput: required: - request type: object properties: request: allOf: - $ref: '#/components/schemas/watcher._types.SearchInputRequestDefinition' watcher._types.ExecutionResultForeachAction: type: object properties: email: allOf: - $ref: '#/components/schemas/watcher._types.EmailResult' index: allOf: - $ref: '#/components/schemas/watcher._types.IndexResult' logging: allOf: - $ref: '#/components/schemas/watcher._types.LoggingResult' pagerduty: allOf: - $ref: '#/components/schemas/watcher._types.PagerDutyResult' slack: allOf: - $ref: '#/components/schemas/watcher._types.SlackResult' webhook: allOf: - $ref: '#/components/schemas/watcher._types.WebhookResult' error: allOf: - $ref: '#/components/schemas/_types.ErrorCause' reason: type: string description: The result of a single action execution. watcher._types.EmailResult: required: - message type: object properties: account: type: string message: allOf: - $ref: '#/components/schemas/watcher._types.Email' reason: type: string watcher._types.IndexResult: maxProperties: 1 minProperties: 1 type: object properties: response: oneOf: - $ref: '#/components/schemas/watcher._types.IndexResultSummary' - type: array items: $ref: '#/components/schemas/watcher._types.IndexResultSummary' description: "The outcome of the index operation.\nA single summary is returned when a single document is indexed, or an array\nwhen several documents are indexed at once. When a bulk operation ends in\n`failure` or `partial_failure`, the array includes failed items." request: allOf: - $ref: '#/components/schemas/watcher._types.IndexResultRequestSummary' description: "The request that would have been executed.\nIt is only present when the action is simulated." description: "The result of an index action.\nIt is a container that holds either the `response` of an executed index\noperation, or the `request` that would have run when the action is simulated." watcher._types.IndexResultSummary: required: - id - index type: object properties: id: allOf: - $ref: '#/components/schemas/_types.Id' index: allOf: - $ref: '#/components/schemas/_types.IndexName' created: type: boolean result: allOf: - $ref: '#/components/schemas/_types.Result' version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' failed: type: boolean description: Only present for failed items message: type: string description: Only present for failed items description: "A single item of an index action result.\nSuccessful items and failed items expose different fields; only `id` and `index`\nare present in both. Failed items appear when a bulk index action ends in\n`failure` or `partial_failure`." watcher._types.IndexResultRequestSummary: required: - index - source type: object properties: doc_id: allOf: - $ref: '#/components/schemas/_types.Id' index: allOf: - $ref: '#/components/schemas/_types.IndexName' refresh: allOf: - $ref: '#/components/schemas/_types.Refresh' source: type: object watcher._types.LoggingResult: required: - logged_text type: object properties: logged_text: type: string watcher._types.PagerDutyResult: required: - event type: object properties: event: allOf: - $ref: '#/components/schemas/watcher._types.PagerDutyEvent' reason: type: string request: allOf: - $ref: '#/components/schemas/watcher._types.HttpInputRequestResult' response: allOf: - $ref: '#/components/schemas/watcher._types.HttpInputResponseResult' watcher._types.HttpInputRequestResult: allOf: - $ref: '#/components/schemas/watcher._types.HttpInputRequestDefinition' - type: object watcher._types.HttpInputResponseResult: required: - body - headers - status type: object properties: body: type: string headers: allOf: - $ref: '#/components/schemas/_types.HttpHeaders' status: type: number watcher._types.SlackResult: required: - message type: object properties: account: type: string message: allOf: - $ref: '#/components/schemas/watcher._types.SlackMessage' watcher._types.WebhookResult: required: - request type: object properties: request: allOf: - $ref: '#/components/schemas/watcher._types.HttpInputRequestResult' response: allOf: - $ref: '#/components/schemas/watcher._types.HttpInputResponseResult' watcher._types.ExecutionResultInput: required: - status - type type: object properties: payload: type: object additionalProperties: type: object status: allOf: - $ref: '#/components/schemas/watcher._types.ExecutionResultStatus' type: allOf: - $ref: '#/components/schemas/watcher._types.InputType' search: allOf: - $ref: '#/components/schemas/watcher._types.ExecutionResultSearchInput' description: 'The resolved search request, present when the input is a search input.' http: allOf: - $ref: '#/components/schemas/watcher._types.ExecutionResultHttpInput' description: 'The resolved HTTP request, present when the input is an HTTP input.' chain: type: object additionalProperties: $ref: '#/components/schemas/watcher._types.ExecutionResultInput' description: 'The result of each named input, present when the input is a chain input.' error: allOf: - $ref: '#/components/schemas/_types.ErrorCause' watcher._types.InputType: enum: - chain - http - none - search - simple - transform type: string watcher._types.ExecutionResultHttpInput: required: - request type: object properties: request: allOf: - $ref: '#/components/schemas/watcher._types.HttpInputRequestResult' status_code: type: number description: "The HTTP status code returned by the request.\nIt is only present when the request was executed." watcher._types.QueryWatch: required: - _id type: object properties: _id: allOf: - $ref: '#/components/schemas/_types.Id' status: allOf: - $ref: '#/components/schemas/watcher._types.WatchStatus' watch: allOf: - $ref: '#/components/schemas/watcher._types.Watch' _primary_term: type: number _seq_no: allOf: - $ref: '#/components/schemas/_types.SequenceNumber' watcher.stats.WatcherMetric: enum: - _all - all - queued_watches - current_watches - pending_watches type: string watcher.stats.WatcherNodeStats: required: - execution_thread_pool - watch_count - watcher_state - node_id type: object properties: current_watches: type: array items: $ref: '#/components/schemas/watcher.stats.WatchRecordStats' description: "The current executing watches metric gives insight into the watches that are currently being executed by Watcher.\nAdditional information is shared per watch that is currently executing.\nThis information includes the `watch_id`, the time its execution started and its current execution phase.\nTo include this metric, the `metric` option should be set to `current_watches` or `_all`.\nIn addition you can also specify the `emit_stacktraces=true` parameter, which adds stack traces for each watch that is being run.\nThese stack traces can give you more insight into an execution of a watch." execution_thread_pool: allOf: - $ref: '#/components/schemas/watcher._types.ExecutionThreadPool' queued_watches: type: array items: $ref: '#/components/schemas/watcher.stats.WatchRecordQueuedStats' description: "Watcher moderates the execution of watches such that their execution won't put too much pressure on the node and its resources.\nIf too many watches trigger concurrently and there isn't enough capacity to run them all, some of the watches are queued, waiting for the current running watches to finish.s\nThe queued watches metric gives insight on these queued watches.\n\nTo include this metric, the `metric` option should include `queued_watches` or `_all`." watch_count: type: number description: The number of watches currently registered. watcher_state: allOf: - $ref: '#/components/schemas/watcher.stats.WatcherState' description: The current state of Watcher. node_id: allOf: - $ref: '#/components/schemas/_types.Id' watcher.stats.WatchRecordStats: allOf: - $ref: '#/components/schemas/watcher.stats.WatchRecordQueuedStats' - required: - execution_phase - triggered_time - watch_id - watch_record_id type: object properties: execution_phase: allOf: - $ref: '#/components/schemas/watcher._types.ExecutionPhase' description: The current watch execution phase. triggered_time: allOf: - $ref: '#/components/schemas/_types.DateTime' description: The time the watch was triggered by the trigger engine. executed_actions: type: array items: type: string watch_id: allOf: - $ref: '#/components/schemas/_types.Id' watch_record_id: allOf: - $ref: '#/components/schemas/_types.Id' description: The watch record identifier. watcher._types.ExecutionPhase: enum: - awaits_execution - started - input - condition - actions - watch_transform - aborted - finished type: string watcher.stats.WatchRecordQueuedStats: required: - execution_time type: object properties: execution_time: allOf: - $ref: '#/components/schemas/_types.DateTime' description: "The time the watch was run.\nThis is just before the input is being run." watcher._types.ExecutionThreadPool: required: - max_size - queue_size type: object properties: max_size: type: number description: 'The largest size of the execution thread pool, which indicates the largest number of concurrent running watches.' queue_size: type: number description: The number of watches that were triggered and are currently queued. watcher.stats.WatcherState: enum: - stopped - starting - started - stopping type: string xpack.info.XPackCategory: enum: - build - features - license type: string xpack.info.BuildInformation: required: - date - hash type: object properties: date: allOf: - $ref: '#/components/schemas/_types.DateTime' hash: type: string xpack.info.Features: required: - aggregate_metric - analytics - ccr - columnar - data_streams - data_tiers - enrich - enterprise_search - eql - esql - graph - gpu_vector_indexing - ilm - logstash - logsdb - logsdb_columnar - ml - monitoring - rollup - searchable_snapshots - security - slm - spatial - sql - transform - universal_profiling - voting_only - watcher - archive type: object properties: aggregate_metric: allOf: - $ref: '#/components/schemas/xpack.info.Feature' analytics: allOf: - $ref: '#/components/schemas/xpack.info.Feature' ccr: allOf: - $ref: '#/components/schemas/xpack.info.Feature' columnar: allOf: - $ref: '#/components/schemas/xpack.info.Feature' x-state: Generally available; Added in 9.6.0 data_streams: allOf: - $ref: '#/components/schemas/xpack.info.Feature' data_tiers: allOf: - $ref: '#/components/schemas/xpack.info.Feature' enrich: allOf: - $ref: '#/components/schemas/xpack.info.Feature' enterprise_search: allOf: - $ref: '#/components/schemas/xpack.info.Feature' x-state: Generally available; Added in 8.8.0 eql: allOf: - $ref: '#/components/schemas/xpack.info.Feature' esql: allOf: - $ref: '#/components/schemas/xpack.info.Feature' x-state: Generally available; Added in 8.14.0 graph: allOf: - $ref: '#/components/schemas/xpack.info.Feature' gpu_vector_indexing: allOf: - $ref: '#/components/schemas/xpack.info.Feature' x-state: Generally available; Added in 9.3.2 ilm: allOf: - $ref: '#/components/schemas/xpack.info.Feature' logstash: allOf: - $ref: '#/components/schemas/xpack.info.Feature' logsdb: allOf: - $ref: '#/components/schemas/xpack.info.Feature' logsdb_columnar: allOf: - $ref: '#/components/schemas/xpack.info.Feature' x-state: Generally available; Added in 9.6.0 ml: allOf: - $ref: '#/components/schemas/xpack.info.Feature' monitoring: allOf: - $ref: '#/components/schemas/xpack.info.Feature' rollup: allOf: - $ref: '#/components/schemas/xpack.info.Feature' runtime_fields: allOf: - $ref: '#/components/schemas/xpack.info.Feature' searchable_snapshots: allOf: - $ref: '#/components/schemas/xpack.info.Feature' security: allOf: - $ref: '#/components/schemas/xpack.info.Feature' slm: allOf: - $ref: '#/components/schemas/xpack.info.Feature' spatial: allOf: - $ref: '#/components/schemas/xpack.info.Feature' sql: allOf: - $ref: '#/components/schemas/xpack.info.Feature' transform: allOf: - $ref: '#/components/schemas/xpack.info.Feature' universal_profiling: allOf: - $ref: '#/components/schemas/xpack.info.Feature' x-state: Generally available; Added in 8.7.0 voting_only: allOf: - $ref: '#/components/schemas/xpack.info.Feature' watcher: allOf: - $ref: '#/components/schemas/xpack.info.Feature' archive: allOf: - $ref: '#/components/schemas/xpack.info.Feature' x-state: Generally available; Added in 8.2.0 xpack.info.Feature: required: - available - enabled type: object properties: available: type: boolean description: type: string enabled: type: boolean native_code_info: allOf: - $ref: '#/components/schemas/xpack.info.NativeCodeInformation' xpack.info.NativeCodeInformation: required: - build_hash - version type: object properties: build_hash: type: string version: allOf: - $ref: '#/components/schemas/_types.VersionString' xpack.info.MinimalLicenseInformation: required: - expiry_date_in_millis - mode - status - type - uid type: object properties: expiry_date_in_millis: allOf: - $ref: '#/components/schemas/_types.EpochTimeUnitMillis' mode: allOf: - $ref: '#/components/schemas/license._types.LicenseType' status: allOf: - $ref: '#/components/schemas/license._types.LicenseStatus' type: allOf: - $ref: '#/components/schemas/license._types.LicenseType' uid: type: string xpack.usage.Base: required: - available - enabled type: object properties: available: type: boolean enabled: type: boolean xpack.usage.Analytics: allOf: - $ref: '#/components/schemas/xpack.usage.Base' - required: - stats type: object properties: stats: allOf: - $ref: '#/components/schemas/xpack.usage.AnalyticsStatistics' xpack.usage.AnalyticsStatistics: required: - boxplot_usage - cumulative_cardinality_usage - string_stats_usage - top_metrics_usage - t_test_usage - moving_percentiles_usage - normalize_usage - rate_usage type: object properties: boxplot_usage: type: number cumulative_cardinality_usage: type: number string_stats_usage: type: number top_metrics_usage: type: number t_test_usage: type: number moving_percentiles_usage: type: number normalize_usage: type: number rate_usage: type: number multi_terms_usage: type: number xpack.usage.Archive: allOf: - $ref: '#/components/schemas/xpack.usage.Base' - required: - indices_count type: object properties: indices_count: type: number xpack.usage.Watcher: allOf: - $ref: '#/components/schemas/xpack.usage.Base' - required: - execution - watch - count type: object properties: execution: allOf: - $ref: '#/components/schemas/xpack.usage.WatcherActions' watch: allOf: - $ref: '#/components/schemas/xpack.usage.WatcherWatch' count: allOf: - $ref: '#/components/schemas/xpack.usage.Counter' xpack.usage.WatcherActions: required: - actions type: object properties: actions: type: object additionalProperties: $ref: '#/components/schemas/xpack.usage.WatcherActionTotals' xpack.usage.WatcherActionTotals: required: - total - total_time_in_ms type: object properties: total: allOf: - $ref: '#/components/schemas/_types.Duration' total_time_in_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' xpack.usage.WatcherWatch: required: - input - trigger type: object properties: input: type: object additionalProperties: $ref: '#/components/schemas/xpack.usage.Counter' condition: type: object additionalProperties: $ref: '#/components/schemas/xpack.usage.Counter' action: type: object additionalProperties: $ref: '#/components/schemas/xpack.usage.Counter' trigger: allOf: - $ref: '#/components/schemas/xpack.usage.WatcherWatchTrigger' xpack.usage.Counter: required: - active - total type: object properties: active: type: number total: type: number xpack.usage.WatcherWatchTrigger: required: - _all type: object properties: schedule: allOf: - $ref: '#/components/schemas/xpack.usage.WatcherWatchTriggerSchedule' _all: allOf: - $ref: '#/components/schemas/xpack.usage.Counter' xpack.usage.WatcherWatchTriggerSchedule: allOf: - $ref: '#/components/schemas/xpack.usage.Counter' - required: - cron - _all type: object properties: cron: allOf: - $ref: '#/components/schemas/xpack.usage.Counter' _all: allOf: - $ref: '#/components/schemas/xpack.usage.Counter' xpack.usage.Ccr: allOf: - $ref: '#/components/schemas/xpack.usage.Base' - required: - auto_follow_patterns_count - follower_indices_count type: object properties: auto_follow_patterns_count: type: number follower_indices_count: type: number xpack.usage.IndexModeUsage: allOf: - $ref: '#/components/schemas/xpack.usage.Base' - required: - indices_count - indices_with_synthetic_source - num_docs - size_in_bytes - data_streams_count - data_streams_managed_by_ilm - data_streams_managed_by_dlm type: object properties: indices_count: type: number description: The number of indices in this index mode. indices_with_synthetic_source: type: number description: The number of indices in this index mode that use synthetic `_source`. num_docs: type: number description: The number of documents in the indices in this index mode. size_in_bytes: type: number description: 'The size of the indices in this index mode, in bytes.' data_streams_count: type: number description: The number of data streams in this index mode. data_streams_managed_by_ilm: type: number description: The number of data streams in this index mode that are managed by index lifecycle management. data_streams_managed_by_dlm: type: number description: The number of data streams in this index mode that are managed by data stream lifecycle. description: Usage of the indices with a given `index.mode`. xpack.usage.DataStreamLifecycleUsage: allOf: - $ref: '#/components/schemas/xpack.usage.Base' - type: object properties: count: type: number description: The number of data streams that have a lifecycle configured. default_rollover_used: type: boolean description: Whether the default rollover configuration is used by at least one data stream. data_retention: allOf: - $ref: '#/components/schemas/xpack.usage.DataStreamLifecycleRetentionStats' description: Statistics about the explicitly configured data retention across data streams. effective_retention: allOf: - $ref: '#/components/schemas/xpack.usage.DataStreamLifecycleEffectiveRetentionStats' description: Statistics about the effective retention (configured or derived from global retention) across data streams. frozen_after: allOf: - $ref: '#/components/schemas/xpack.usage.DataStreamLifecycleRetentionStats' description: Statistics about the configured `frozen_after` (searchable snapshot) tier threshold across data streams. x-state: Generally available; Added in 9.5.0 global_retention: allOf: - $ref: '#/components/schemas/xpack.usage.DataStreamLifecycleGlobalRetention' description: Statistics about the cluster's global default and maximum retention settings. description: "Usage statistics for data stream lifecycle (DLM), reported by `_xpack/usage` under `data_lifecycle`.\nBesides `available` and `enabled`, all the following statistics are only present when the feature is enabled." xpack.usage.DataStreamLifecycleRetentionStats: allOf: - $ref: '#/components/schemas/xpack.usage.DataStreamLifecycleThresholdStats' - required: - configured_data_streams type: object properties: configured_data_streams: type: number description: The number of data streams for which this value is configured. xpack.usage.DataStreamLifecycleThresholdStats: type: object properties: minimum_millis: type: number description: The smallest configured value in milliseconds. maximum_millis: type: number description: The largest configured value in milliseconds. average_millis: type: number description: The average configured value in milliseconds. description: 'The `minimum_millis`, `maximum_millis`, and `average_millis` fields are only present when at least one data stream contributes to these statistics.' xpack.usage.DataStreamLifecycleEffectiveRetentionStats: allOf: - $ref: '#/components/schemas/xpack.usage.DataStreamLifecycleThresholdStats' - required: - retained_data_streams type: object properties: retained_data_streams: type: number description: The number of data streams for which an effective retention applies. xpack.usage.DataStreamLifecycleGlobalRetention: required: - default - max type: object properties: default: allOf: - $ref: '#/components/schemas/xpack.usage.DataStreamLifecycleGlobalRetentionStats' description: Statistics about the cluster's default global retention. max: allOf: - $ref: '#/components/schemas/xpack.usage.DataStreamLifecycleGlobalRetentionStats' description: Statistics about the cluster's maximum global retention. xpack.usage.DataStreamLifecycleGlobalRetentionStats: required: - defined type: object properties: defined: type: boolean description: Whether this global retention is defined for the cluster. affected_data_streams: type: number description: The number of data streams affected by this global retention. retention_millis: type: number description: The global retention period in milliseconds. description: The `affected_data_streams` and `retention_millis` fields are only present when this global retention is defined. xpack.usage.DataStreams: allOf: - $ref: '#/components/schemas/xpack.usage.Base' - required: - data_streams - indices_count type: object properties: data_streams: type: number indices_count: type: number xpack.usage.DataTiers: allOf: - $ref: '#/components/schemas/xpack.usage.Base' - required: - data_warm - data_cold - data_content - data_hot type: object properties: data_warm: allOf: - $ref: '#/components/schemas/xpack.usage.DataTierPhaseStatistics' data_frozen: allOf: - $ref: '#/components/schemas/xpack.usage.DataTierPhaseStatistics' x-state: Generally available; Added in 7.13.0 data_cold: allOf: - $ref: '#/components/schemas/xpack.usage.DataTierPhaseStatistics' data_content: allOf: - $ref: '#/components/schemas/xpack.usage.DataTierPhaseStatistics' data_hot: allOf: - $ref: '#/components/schemas/xpack.usage.DataTierPhaseStatistics' xpack.usage.DataTierPhaseStatistics: required: - node_count - index_count - total_shard_count - primary_shard_count - doc_count - total_size_bytes - primary_size_bytes - primary_shard_size_avg_bytes - primary_shard_size_median_bytes - primary_shard_size_mad_bytes type: object properties: node_count: type: number index_count: type: number total_shard_count: type: number primary_shard_count: type: number doc_count: type: number total_size_bytes: type: number primary_size_bytes: type: number primary_shard_size_avg_bytes: type: number primary_shard_size_median_bytes: type: number primary_shard_size_mad_bytes: type: number xpack.usage.Eql: allOf: - $ref: '#/components/schemas/xpack.usage.Base' - required: - features - queries type: object properties: features: allOf: - $ref: '#/components/schemas/xpack.usage.EqlFeatures' queries: type: object additionalProperties: $ref: '#/components/schemas/xpack.usage.Query' xpack.usage.EqlFeatures: required: - join - joins - keys - event - pipes - sequence - sequences type: object properties: join: allOf: - $ref: '#/components/schemas/_types.uint' joins: allOf: - $ref: '#/components/schemas/xpack.usage.EqlFeaturesJoin' keys: allOf: - $ref: '#/components/schemas/xpack.usage.EqlFeaturesKeys' event: allOf: - $ref: '#/components/schemas/_types.uint' pipes: allOf: - $ref: '#/components/schemas/xpack.usage.EqlFeaturesPipes' sequence: allOf: - $ref: '#/components/schemas/_types.uint' sequences: allOf: - $ref: '#/components/schemas/xpack.usage.EqlFeaturesSequences' xpack.usage.EqlFeaturesJoin: required: - join_queries_two - join_queries_three - join_until - join_queries_five_or_more - join_queries_four type: object properties: join_queries_two: allOf: - $ref: '#/components/schemas/_types.uint' join_queries_three: allOf: - $ref: '#/components/schemas/_types.uint' join_until: allOf: - $ref: '#/components/schemas/_types.uint' join_queries_five_or_more: allOf: - $ref: '#/components/schemas/_types.uint' join_queries_four: allOf: - $ref: '#/components/schemas/_types.uint' xpack.usage.EqlFeaturesKeys: required: - join_keys_two - join_keys_one - join_keys_three - join_keys_five_or_more - join_keys_four type: object properties: join_keys_two: allOf: - $ref: '#/components/schemas/_types.uint' join_keys_one: allOf: - $ref: '#/components/schemas/_types.uint' join_keys_three: allOf: - $ref: '#/components/schemas/_types.uint' join_keys_five_or_more: allOf: - $ref: '#/components/schemas/_types.uint' join_keys_four: allOf: - $ref: '#/components/schemas/_types.uint' xpack.usage.EqlFeaturesPipes: required: - pipe_tail - pipe_head type: object properties: pipe_tail: allOf: - $ref: '#/components/schemas/_types.uint' pipe_head: allOf: - $ref: '#/components/schemas/_types.uint' xpack.usage.EqlFeaturesSequences: required: - sequence_queries_three - sequence_queries_four - sequence_queries_two - sequence_until - sequence_queries_five_or_more - sequence_maxspan type: object properties: sequence_queries_three: allOf: - $ref: '#/components/schemas/_types.uint' sequence_queries_four: allOf: - $ref: '#/components/schemas/_types.uint' sequence_queries_two: allOf: - $ref: '#/components/schemas/_types.uint' sequence_until: allOf: - $ref: '#/components/schemas/_types.uint' sequence_queries_five_or_more: allOf: - $ref: '#/components/schemas/_types.uint' sequence_maxspan: allOf: - $ref: '#/components/schemas/_types.uint' xpack.usage.Query: type: object properties: count: type: number failed: type: number paging: type: number total: type: number xpack.usage.Flattened: allOf: - $ref: '#/components/schemas/xpack.usage.Base' - required: - field_count type: object properties: field_count: type: number xpack.usage.GpuVectorIndexing: allOf: - $ref: '#/components/schemas/xpack.usage.Base' - required: - index_build_count - nodes_with_gpu - nodes type: object properties: index_build_count: type: number description: Total GPU index builds across the cluster. nodes_with_gpu: type: number description: Count of data nodes with GPU support. nodes: type: array items: $ref: '#/components/schemas/xpack.usage.GpuNodeStats' description: 'Per-node GPU details including type, memory, enabled status, and build count.' description: GPU vector indexing usage statistics. xpack.usage.GpuNodeStats: required: - type - memory_in_bytes - enabled - index_build_count type: object properties: type: type: string description: 'GPU device type (e.g., "NVIDIA L4", "NVIDIA A100").' memory_in_bytes: type: number description: GPU memory in bytes. enabled: type: boolean description: Whether GPU vector indexing is enabled on this node. index_build_count: type: number description: Number of GPU index builds performed on this node. description: Per-node GPU statistics for vector indexing. xpack.usage.HealthStatistics: allOf: - $ref: '#/components/schemas/xpack.usage.Base' - required: - invocations type: object properties: invocations: allOf: - $ref: '#/components/schemas/xpack.usage.Invocations' xpack.usage.Invocations: required: - total type: object properties: total: type: number xpack.usage.Ilm: required: - policy_count - policy_stats type: object properties: policy_count: type: number policy_stats: type: array items: $ref: '#/components/schemas/xpack.usage.IlmPolicyStatistics' xpack.usage.IlmPolicyStatistics: required: - indices_managed - phases type: object properties: indices_managed: type: number phases: allOf: - $ref: '#/components/schemas/xpack.usage.Phases' xpack.usage.Phases: type: object properties: cold: allOf: - $ref: '#/components/schemas/xpack.usage.Phase' delete: allOf: - $ref: '#/components/schemas/xpack.usage.Phase' frozen: allOf: - $ref: '#/components/schemas/xpack.usage.Phase' hot: allOf: - $ref: '#/components/schemas/xpack.usage.Phase' warm: allOf: - $ref: '#/components/schemas/xpack.usage.Phase' xpack.usage.Phase: required: - actions - min_age type: object properties: actions: type: array items: type: string min_age: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' xpack.usage.Logging: required: - querylog - esql type: object properties: querylog: allOf: - $ref: '#/components/schemas/xpack.usage.QueryLoggingConfig' description: Search query log configuration. esql: allOf: - $ref: '#/components/schemas/xpack.usage.EsqlLoggingConfig' description: ES|QL query log configuration. description: Usage statistics about logging configuration reported by `_xpack/usage`. xpack.usage.QueryLoggingConfig: required: - enabled - user - system type: object properties: enabled: type: boolean description: Whether query logging is enabled. user: type: boolean description: Whether user information is included in the query log. system: type: boolean description: Whether system queries are included in the query log. threshold: allOf: - $ref: '#/components/schemas/_types.Duration' description: 'The configured logging threshold, if any.' xpack.usage.EsqlLoggingConfig: required: - enabled - user type: object properties: enabled: type: boolean description: Whether ES|QL query logging is enabled. user: type: boolean description: Whether user information is included in the ES|QL query log. thresholds: type: object additionalProperties: $ref: '#/components/schemas/_types.Duration' description: 'The configured logging thresholds, keyed by threshold name, if any.' xpack.usage.MachineLearning: allOf: - $ref: '#/components/schemas/xpack.usage.Base' - required: - datafeeds - jobs - node_count - data_frame_analytics_jobs - inference type: object properties: datafeeds: type: object additionalProperties: $ref: '#/components/schemas/xpack.usage.Datafeed' jobs: type: object additionalProperties: $ref: '#/components/schemas/xpack.usage.JobUsage' description: Job usage statistics. The `_all` entry is always present and gathers statistics for all jobs. node_count: type: number data_frame_analytics_jobs: allOf: - $ref: '#/components/schemas/xpack.usage.MlDataFrameAnalyticsJobs' inference: allOf: - $ref: '#/components/schemas/xpack.usage.MlInference' xpack.usage.Datafeed: required: - count type: object properties: count: type: number xpack.usage.JobUsage: required: - count - created_by - detectors - forecasts - model_size type: object properties: count: type: number created_by: type: object additionalProperties: type: number detectors: allOf: - $ref: '#/components/schemas/ml._types.JobStatistics' forecasts: allOf: - $ref: '#/components/schemas/xpack.usage.MlJobForecasts' model_size: allOf: - $ref: '#/components/schemas/ml._types.JobStatistics' xpack.usage.MlJobForecasts: required: - total - forecasted_jobs type: object properties: total: type: number forecasted_jobs: type: number xpack.usage.MlDataFrameAnalyticsJobs: required: - _all type: object properties: memory_usage: allOf: - $ref: '#/components/schemas/xpack.usage.MlDataFrameAnalyticsJobsMemory' _all: allOf: - $ref: '#/components/schemas/xpack.usage.MlDataFrameAnalyticsJobsCount' analysis_counts: allOf: - $ref: '#/components/schemas/xpack.usage.MlDataFrameAnalyticsJobsAnalysis' stopped: allOf: - $ref: '#/components/schemas/xpack.usage.MlDataFrameAnalyticsJobsCount' xpack.usage.MlDataFrameAnalyticsJobsMemory: required: - peak_usage_bytes type: object properties: peak_usage_bytes: allOf: - $ref: '#/components/schemas/ml._types.JobStatistics' xpack.usage.MlDataFrameAnalyticsJobsCount: required: - count type: object properties: count: type: number xpack.usage.MlDataFrameAnalyticsJobsAnalysis: type: object properties: classification: type: number outlier_detection: type: number regression: type: number xpack.usage.MlInference: required: - ingest_processors - trained_models type: object properties: ingest_processors: type: object additionalProperties: $ref: '#/components/schemas/xpack.usage.MlInferenceIngestProcessor' trained_models: allOf: - $ref: '#/components/schemas/xpack.usage.MlInferenceTrainedModels' deployments: allOf: - $ref: '#/components/schemas/xpack.usage.MlInferenceDeployments' x-state: Generally available; Added in 8.0.0 xpack.usage.MlInferenceIngestProcessor: required: - num_docs_processed - pipelines - num_failures - time_ms type: object properties: num_docs_processed: allOf: - $ref: '#/components/schemas/xpack.usage.MlInferenceIngestProcessorCount' pipelines: allOf: - $ref: '#/components/schemas/xpack.usage.MlCounter' num_failures: allOf: - $ref: '#/components/schemas/xpack.usage.MlInferenceIngestProcessorCount' time_ms: allOf: - $ref: '#/components/schemas/xpack.usage.MlInferenceIngestProcessorCount' xpack.usage.MlInferenceIngestProcessorCount: required: - max - sum - min type: object properties: max: type: number sum: type: number min: type: number xpack.usage.MlCounter: required: - count type: object properties: count: type: number xpack.usage.MlInferenceTrainedModels: required: - _all type: object properties: estimated_operations: allOf: - $ref: '#/components/schemas/ml._types.JobStatistics' estimated_heap_memory_usage_bytes: allOf: - $ref: '#/components/schemas/ml._types.JobStatistics' count: allOf: - $ref: '#/components/schemas/xpack.usage.MlInferenceTrainedModelsCount' _all: allOf: - $ref: '#/components/schemas/xpack.usage.MlCounter' model_size_bytes: allOf: - $ref: '#/components/schemas/ml._types.JobStatistics' x-state: Generally available; Added in 8.0.0 xpack.usage.MlInferenceTrainedModelsCount: required: - total - prepackaged - other type: object properties: total: type: number prepackaged: type: number other: type: number pass_through: type: number regression: type: number classification: type: number ner: type: number text_embedding: type: number xpack.usage.MlInferenceDeployments: required: - count - inference_counts - model_sizes_bytes - time_ms type: object properties: count: type: number inference_counts: allOf: - $ref: '#/components/schemas/ml._types.JobStatistics' model_sizes_bytes: allOf: - $ref: '#/components/schemas/ml._types.JobStatistics' time_ms: allOf: - $ref: '#/components/schemas/xpack.usage.MlInferenceDeploymentsTimeMs' xpack.usage.MlInferenceDeploymentsTimeMs: required: - avg type: object properties: avg: type: number xpack.usage.Monitoring: allOf: - $ref: '#/components/schemas/xpack.usage.Base' - required: - collection_enabled - enabled_exporters type: object properties: collection_enabled: type: boolean enabled_exporters: type: object additionalProperties: type: number xpack.usage.RuntimeFieldTypes: allOf: - $ref: '#/components/schemas/xpack.usage.Base' - required: - field_types type: object properties: field_types: type: array items: $ref: '#/components/schemas/xpack.usage.RuntimeFieldsType' xpack.usage.RuntimeFieldsType: required: - chars_max - chars_total - count - doc_max - doc_total - index_count - lang - lines_max - lines_total - name - scriptless_count - shadowed_count - source_max - source_total type: object properties: chars_max: type: number chars_total: type: number count: type: number doc_max: type: number doc_total: type: number index_count: type: number lang: type: array items: type: string lines_max: type: number lines_total: type: number name: allOf: - $ref: '#/components/schemas/_types.Field' scriptless_count: type: number shadowed_count: type: number source_max: type: number source_total: type: number xpack.usage.SearchableSnapshots: allOf: - $ref: '#/components/schemas/xpack.usage.Base' - required: - indices_count type: object properties: indices_count: type: number full_copy_indices_count: type: number shared_cache_indices_count: type: number xpack.usage.Security: allOf: - $ref: '#/components/schemas/xpack.usage.Base' - required: - api_key_service - anonymous - audit - fips_140 - ipfilter - realms - role_mapping - roles - ssl - token_service - operator_privileges type: object properties: api_key_service: allOf: - $ref: '#/components/schemas/xpack.usage.FeatureToggle' anonymous: allOf: - $ref: '#/components/schemas/xpack.usage.FeatureToggle' audit: allOf: - $ref: '#/components/schemas/xpack.usage.Audit' fips_140: allOf: - $ref: '#/components/schemas/xpack.usage.FeatureToggle' ipfilter: allOf: - $ref: '#/components/schemas/xpack.usage.IpFilter' realms: type: object additionalProperties: $ref: '#/components/schemas/xpack.usage.Realm' role_mapping: type: object additionalProperties: $ref: '#/components/schemas/xpack.usage.RoleMapping' roles: allOf: - $ref: '#/components/schemas/xpack.usage.SecurityRoles' ssl: allOf: - $ref: '#/components/schemas/xpack.usage.Ssl' system_key: allOf: - $ref: '#/components/schemas/xpack.usage.FeatureToggle' token_service: allOf: - $ref: '#/components/schemas/xpack.usage.FeatureToggle' operator_privileges: allOf: - $ref: '#/components/schemas/xpack.usage.Base' xpack.usage.FeatureToggle: required: - enabled type: object properties: enabled: type: boolean xpack.usage.Audit: allOf: - $ref: '#/components/schemas/xpack.usage.FeatureToggle' - type: object properties: outputs: type: array items: type: string xpack.usage.IpFilter: required: - http - transport type: object properties: http: type: boolean transport: type: boolean xpack.usage.Realm: allOf: - $ref: '#/components/schemas/xpack.usage.Base' - type: object properties: name: type: array items: type: string order: type: array items: type: number size: type: array items: type: number cache: type: array items: $ref: '#/components/schemas/xpack.usage.RealmCache' has_authorization_realms: type: array items: type: boolean has_default_username_pattern: type: array items: type: boolean has_truststore: type: array items: type: boolean is_authentication_delegated: type: array items: type: boolean xpack.usage.RealmCache: required: - size type: object properties: size: type: number xpack.usage.RoleMapping: required: - enabled - size type: object properties: enabled: type: number size: type: number xpack.usage.SecurityRoles: required: - native - dls - file type: object properties: native: allOf: - $ref: '#/components/schemas/xpack.usage.SecurityRolesNative' dls: allOf: - $ref: '#/components/schemas/xpack.usage.SecurityRolesDls' file: allOf: - $ref: '#/components/schemas/xpack.usage.SecurityRolesFile' xpack.usage.SecurityRolesNative: required: - dls - fls - size type: object properties: dls: type: boolean fls: type: boolean size: type: number xpack.usage.SecurityRolesFile: required: - dls - fls - size type: object properties: dls: type: boolean fls: type: boolean size: type: number xpack.usage.Ssl: required: - http - transport type: object properties: http: allOf: - $ref: '#/components/schemas/xpack.usage.FeatureToggle' transport: allOf: - $ref: '#/components/schemas/xpack.usage.FeatureToggle' xpack.usage.Slm: allOf: - $ref: '#/components/schemas/xpack.usage.Base' - type: object properties: policy_count: type: number policy_stats: allOf: - $ref: '#/components/schemas/slm._types.Statistics' xpack.usage.Sql: allOf: - $ref: '#/components/schemas/xpack.usage.Base' - required: - features - queries type: object properties: features: type: object additionalProperties: type: number queries: type: object additionalProperties: $ref: '#/components/schemas/xpack.usage.Query' xpack.usage.Vector: allOf: - $ref: '#/components/schemas/xpack.usage.Base' - required: - dense_vector_dims_avg_count - dense_vector_fields_count type: object properties: dense_vector_dims_avg_count: type: number dense_vector_fields_count: type: number sparse_vector_fields_count: type: number xpack.usage.VectorDbDocument: allOf: - $ref: '#/components/schemas/xpack.usage.Base' - required: - indices_count - num_docs type: object properties: indices_count: type: number description: The number of indices using the `vectordb_document` index mode. num_docs: type: number description: The total number of documents held across all `vectordb_document` indices. description: Usage statistics for indices using the `vectordb_document` index mode. xpack.usage.VectorDbColumnar: allOf: - $ref: '#/components/schemas/xpack.usage.Base' - required: - indices_count - num_docs type: object properties: indices_count: type: number description: The number of indices using the `vectordb_columnar` index mode. num_docs: type: number description: The total number of documents held across all `vectordb_columnar` indices. description: Usage statistics for indices using the `vectordb_columnar` index mode. responses: async_search.submit-200: description: '' content: application/json: schema: $ref: '#/components/schemas/async_search._types.AsyncSearchDocumentResponseBase' examples: AsyncSearchSubmitResponseExample1: description: A successful response when performing search asynchronously. value: "{\n \"id\" : \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n \"is_partial\" : true,\n \"is_running\" : true,\n \"start_time_in_millis\" : 1583945890986,\n \"expiration_time_in_millis\" : 1584377890986,\n \"response\" : {\n \"took\" : 1122,\n \"timed_out\" : false,\n \"num_reduce_phases\" : 0,\n \"_shards\" : {\n \"total\" : 562,\n \"successful\" : 3,\n \"skipped\" : 0,\n \"failed\" : 0\n },\n \"hits\" : {\n \"total\" : {\n \"value\" : 157483,\n \"relation\" : \"gte\"\n },\n \"max_score\" : null,\n \"hits\" : [ ]\n }\n }\n}" async_search.submit-404: description: '' content: application/json: schema: $ref: '#/components/schemas/async_search._types.AsyncSearchResponseException' async_search.submit-400: description: '' content: application/json: schema: $ref: '#/components/schemas/async_search._types.AsyncSearchResponseException' async_search.submit-500: description: '' content: application/json: schema: $ref: '#/components/schemas/async_search._types.AsyncSearchResponseException' async_search.submit-429: description: '' content: application/json: schema: $ref: '#/components/schemas/async_search._types.AsyncSearchResponseException' bulk-200: description: '' content: application/json: schema: required: - errors - items - took type: object properties: errors: type: boolean description: 'If `true`, one or more of the operations in the bulk request did not complete successfully.' items: type: array items: maxProperties: 1 minProperties: 1 type: object additionalProperties: $ref: '#/components/schemas/_global.bulk.ResponseItem' description: 'The result of each operation in the bulk request, in the order they were submitted.' took: type: number description: 'The length of time, in milliseconds, it took to process the bulk request.' ingest_took: type: number examples: BulkResponseExample1: summary: Multiple successful operations value: "{\n \"took\": 30,\n \"errors\": false,\n \"items\": [\n {\n \"index\": {\n \"_index\": \"test\",\n \"_id\": \"1\",\n \"_version\": 1,\n \"result\": \"created\",\n \"_shards\": {\n \"total\": 2,\n \"successful\": 1,\n \"failed\": 0\n },\n \"status\": 201,\n \"_seq_no\" : 0,\n \"_primary_term\": 1\n }\n },\n {\n \"delete\": {\n \"_index\": \"test\",\n \"_id\": \"2\",\n \"_version\": 1,\n \"result\": \"not_found\",\n \"_shards\": {\n \"total\": 2,\n \"successful\": 1,\n \"failed\": 0\n },\n \"status\": 404,\n \"_seq_no\" : 1,\n \"_primary_term\" : 2\n }\n },\n {\n \"create\": {\n \"_index\": \"test\",\n \"_id\": \"3\",\n \"_version\": 1,\n \"result\": \"created\",\n \"_shards\": {\n \"total\": 2,\n \"successful\": 1,\n \"failed\": 0\n },\n \"status\": 201,\n \"_seq_no\" : 2,\n \"_primary_term\" : 3\n }\n },\n {\n \"update\": {\n \"_index\": \"test\",\n \"_id\": \"1\",\n \"_version\": 2,\n \"result\": \"updated\",\n \"_shards\": {\n \"total\": 2,\n \"successful\": 1,\n \"failed\": 0\n },\n \"status\": 200,\n \"_seq_no\" : 3,\n \"_primary_term\" : 4\n }\n }\n ]\n}" BulkResponseExample2: summary: Failed actions description: "If you run `POST /_bulk` with operations that update non-existent documents, the operations cannot complete successfully. The API returns a response with an `errors` property value `true`. The response also includes an error object for any failed operations. The error object contains additional information about the failure, such as the error type and reason.\n" value: "{\n \"took\": 486,\n \"errors\": true,\n \"items\": [\n {\n \"update\": {\n \"_index\": \"index1\",\n \"_id\": \"5\",\n \"status\": 404,\n \"error\": {\n \"type\": \"document_missing_exception\",\n \"reason\": \"[5]: document missing\",\n \"index_uuid\": \"aAsFqTI0Tc2W0LCWgPNrOA\",\n \"shard\": \"0\",\n \"index\": \"index1\"\n }\n }\n },\n {\n \"update\": {\n \"_index\": \"index1\",\n \"_id\": \"6\",\n \"status\": 404,\n \"error\": {\n \"type\": \"document_missing_exception\",\n \"reason\": \"[6]: document missing\",\n \"index_uuid\": \"aAsFqTI0Tc2W0LCWgPNrOA\",\n \"shard\": \"0\",\n \"index\": \"index1\"\n }\n }\n },\n {\n \"create\": {\n \"_index\": \"index1\",\n \"_id\": \"7\",\n \"_version\": 1,\n \"result\": \"created\",\n \"_shards\": {\n \"total\": 2,\n \"successful\": 1,\n \"failed\": 0\n },\n \"_seq_no\": 0,\n \"_primary_term\": 1,\n \"status\": 201\n }\n }\n ]\n}" BulkResponseExample3: summary: Filter for failed operations description: "An example response from `POST /_bulk?filter_path=items.*.error`, which returns only information about failed operations.\n" value: "{\n \"items\": [\n {\n \"update\": {\n \"error\": {\n \"type\": \"document_missing_exception\",\n \"reason\": \"[5]: document missing\",\n \"index_uuid\": \"aAsFqTI0Tc2W0LCWgPNrOA\",\n \"shard\": \"0\",\n \"index\": \"index1\"\n }\n }\n },\n {\n \"update\": {\n \"error\": {\n \"type\": \"document_missing_exception\",\n \"reason\": \"[6]: document missing\",\n \"index_uuid\": \"aAsFqTI0Tc2W0LCWgPNrOA\",\n \"shard\": \"0\",\n \"index\": \"index1\"\n }\n }\n }\n ]\n}" cat.aliases-200: description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.aliases.AliasesRecord' examples: CatAliasesResponseExample1: description: "A successful response from `GET _cat/aliases?format=json&v=true`. This response shows that `alias2` has configured a filter and `alias3` and `alias4` have routing configurations.\n" value: "[\n {\n \"alias\": \"alias1\",\n \"index\": \"test1\",\n \"filter\": \"-\",\n \"routing.index\": \"-\",\n \"routing.search\": \"-\",\n \"is_write_index\": \"true\"\n },\n {\n \"alias\": \"alias1\",\n \"index\": \"test1\",\n \"filter\": \"*\",\n \"routing.index\": \"-\",\n \"routing.search\": \"-\",\n \"is_write_index\": \"true\"\n },\n {\n \"alias\": \"alias3\",\n \"index\": \"test1\",\n \"filter\": \"-\",\n \"routing.index\": \"1\",\n \"routing.search\": \"1\",\n \"is_write_index\": \"true\"\n },\n {\n \"alias\": \"alias4\",\n \"index\": \"test1\",\n \"filter\": \"-\",\n \"routing.index\": \"2\",\n \"routing.search\": \"1,2\",\n \"is_write_index\": \"true\"\n }\n]" cat.allocation-200: description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.allocation.AllocationRecord' examples: CatAllocationResponseExample1: description: "A successful response from `GET /_cat/allocation?v=true&format=json`. It shows a single shard is allocated to the one node available.\n" value: "[\n {\n \"shards\": \"1\",\n \"shards.undesired\": \"0\",\n \"write_load.forecast\": \"0.0\",\n \"disk.indices.forecast\": \"260b\",\n \"disk.indices\": \"260b\",\n \"disk.used\": \"47.3gb\",\n \"disk.avail\": \"43.4gb\",\n \"disk.total\": \"100.7gb\",\n \"disk.percent\": \"46\",\n \"host\": \"127.0.0.1\",\n \"ip\": \"127.0.0.1\",\n \"node\": \"CSUXak2\",\n \"node.role\": \"himrst\"\n }\n]" cat.circuit_breaker-200: description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.circuit_breaker.CircuitBreakerRecord' examples: CatCircuitBreakerResponseExample1: description: "A successful response from `GET /_cat/circuit_breaker?v=true&format=json`. It shows two circuit breakers are active on one node.\n" value: "[\n {\n \"breaker\": \"request\",\n \"estimated\": \"0b\",\n \"limit\": \"614.3mb\",\n \"node_id\": \"ozKxpP9oS3SL0Sp-Mfxc6w\",\n \"tripped\": \"0\"\n },\n {\n \"breaker\": \"fielddata\",\n \"estimated\": \"0b\",\n \"limit\": \"409.5mb\",\n \"node_id\": \"ozKxpP9oS3SL0Sp-Mfxc6w\",\n \"tripped\": \"0\"\n }\n]" cat.component_templates-200: description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.component_templates.ComponentTemplate' examples: CatComponentTemplatesResponseExample1: description: "A successful response from `GET _cat/component_templates/my-template-*?v=true&s=name&format=json`.\n" value: "[\n {\n \"name\": \"my-template-1\",\n \"version\": \"null\",\n \"alias_count\": \"0\",\n \"mapping_count\": \"0\",\n \"settings_count\": \"1\",\n \"metadata_count\": \"0\",\n \"included_in\": \"[my-index-template]\"\n },\n {\n \"name\": \"my-template-2\",\n \"version\": null,\n \"alias_count\": \"0\",\n \"mapping_count\": \"3\",\n \"settings_count\": \"0\",\n \"metadata_count\": \"0\",\n \"included_in\": \"[my-index-template]\"\n }\n]" cat.count-200: description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.count.CountRecord' examples: CatCountResponseExample1: summary: Single data stream or index count description: "A successful response from `GET /_cat/count/my-index-000001?v=true&format=json`. It retrieves the document count for the `my-index-000001` data stream or index.\n" value: "[\n {\n \"epoch\": \"1475868259\",\n \"timestamp\": \"15:24:20\",\n \"count\": \"120\"\n }\n]" CatCountResponseExample2: summary: All data streams and indices count description: "A successful response from `GET /_cat/count?v=true&format=json`. It retrieves the document count for all data streams and indices in the cluster.\n" value: "[\n {\n \"epoch\": \"1475868259\",\n \"timestamp\": \"15:24:20\",\n \"count\": \"121\"\n }\n]" cat.fielddata-200: description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.fielddata.FielddataRecord' examples: CatFielddataResponseExample1: summary: Single field data description: "A successful response from `GET /_cat/fielddata?v=true&fields=body&format=json`. You can specify an individual field in the request body or URL path. This example retrieves heap memory size information for the `body` field.\n" value: "[\n {\n \"id\": \"Nqk-6inXQq-OxUfOUI8jNQ\",\n \"host\": \"127.0.0.1\",\n \"ip\": \"127.0.0.1\",\n \"node\": \"Nqk-6in\",\n \"field\": \"body\",\n \"size\": \"544b\"\n }\n]" CatFielddataResponseExample2: summary: Multiple fields data description: "A successful response from `GET /_cat/fielddata/body,soul?v=true&format=json`. You can specify a comma-separated list of fields in the request body or URL path. This example retrieves heap memory size information for the `body` and `soul` fields. To get information for all fields, run `GET /_cat/fielddata?v=true`.\n" value: "[\n {\n \"id\": \"Nqk-6inXQq-OxUfOUI8jNQ\",\n \"host\": \"1127.0.0.1\",\n \"ip\": \"127.0.0.1\",\n \"node\": \"Nqk-6in\",\n \"field\": \"body\",\n \"size\": \"544b\"\n },\n {\n \"id\": \"Nqk-6inXQq-OxUfOUI8jNQ\",\n \"host\": \"127.0.0.1\",\n \"ip\": \"127.0.0.1\",\n \"node\": \"Nqk-6in\",\n \"field\": \"soul\",\n \"size\": \"480b\"\n }\n]" cat.indices-200: description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.indices.IndicesRecord' examples: CatIndicesResponseExample1: description: "A successful response from `GET /_cat/indices/my-index-*?v=true&s=index&format=json`.\n" value: "[\n {\n \"health\": \"yellow\",\n \"status\": \"open\",\n \"index\": \"my-index-000001\",\n \"uuid\": \"u8FNjxh8Rfy_awN11oDKYQ\",\n \"pri\": \"1\",\n \"rep\": \"1\",\n \"docs.count\": \"1200\",\n \"docs.deleted\": \"0\",\n \"store.size\": \"88.1kb\",\n \"pri.store.size\": \"88.1kb\",\n \"dataset.size\": \"88.1kb\"\n },\n {\n \"health\": \"green\",\n \"status\": \"open\",\n \"index\": \"my-index-000002\",\n \"uuid\": \"nYFWZEO7TUiOjLQXBaYJpA \",\n \"pri\": \"1\",\n \"rep\": \"0\",\n \"docs.count\": \"0\",\n \"docs.deleted\": \"0\",\n \"store.size\": \"260b\",\n \"pri.store.size\": \"260b\",\n \"dataset.size\": \"260b\"\n }\n]" cat.ml_data_frame_analytics-200: description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.ml_data_frame_analytics.DataFrameAnalyticsRecord' examples: CatDataframeanalyticsResponseExample1: description: A successful response from `GET _cat/ml/data_frame/analytics?v=true&format=json`. value: "[\n {\n \"id\": \"classifier_job_1\",\n \"type\": \"classification\",\n \"create_time\": \"2020-02-12T11:49:09.594Z\",\n \"state\": \"stopped\"\n },\n {\n \"id\": \"classifier_job_2\",\n \"type\": \"classification\",\n \"create_time\": \"2020-02-12T11:49:14.479Z\",\n \"state\": \"stopped\"\n },\n {\n \"id\": \"classifier_job_3\",\n \"type\": \"classification\",\n \"create_time\": \"2020-02-12T11:49:16.928Z\",\n \"state\": \"stopped\"\n },\n {\n \"id\": \"classifier_job_4\",\n \"type\": \"classification\",\n \"create_time\": \"2020-02-12T11:49:19.127Z\",\n \"state\": \"stopped\"\n },\n {\n \"id\": \"classifier_job_5\",\n \"type\": \"classification\",\n \"create_time\": \"2020-02-12T11:49:21.349Z\",\n \"state\": \"stopped\"\n }\n]" cat.ml_datafeeds-200: description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.ml_datafeeds.DatafeedsRecord' examples: CatDatafeedsResponseExample1: description: A successful response from `GET _cat/ml/datafeeds?v=true&format=json`. value: "[\n {\n \"id\": \"datafeed-high_sum_total_sales\",\n \"state\": \"stopped\",\n \"buckets.count\": \"743\",\n \"search.count\": \"7\"\n },\n {\n \"id\": \"datafeed-low_request_rate\",\n \"state\": \"stopped\",\n \"buckets.count\": \"1457\",\n \"search.count\": \"3\"\n },\n {\n \"id\": \"datafeed-response_code_rates\",\n \"state\": \"stopped\",\n \"buckets.count\": \"1460\",\n \"search.count\": \"18\"\n },\n {\n \"id\": \"datafeed-url_scanning\",\n \"state\": \"stopped\",\n \"buckets.count\": \"1460\",\n \"search.count\": \"18\"\n }\n]" cat.ml_jobs-200: description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.ml_jobs.JobsRecord' examples: CatJobsResponseExample1: description: 'A successful response from `GET _cat/ml/anomaly_detectors?h=id,s,dpr,mb&v=true&format=json`.' value: "[\n {\n \"id\": \"high_sum_total_sales\",\n \"s\": \"closed\",\n \"dpr\": \"14022\",\n \"mb\": \"1.5mb\"\n },\n {\n \"id\": \"low_request_rate\",\n \"s\": \"closed\",\n \"dpr\": \"1216\",\n \"mb\": \"40.5kb\"\n },\n {\n \"id\": \"response_code_rates\",\n \"s\": \"closed\",\n \"dpr\": \"28146\",\n \"mb\": \"132.7kb\"\n },\n {\n \"id\": \"url_scanning\",\n \"s\": \"closed\",\n \"dpr\": \"28146\",\n \"mb\": \"501.6kb\"\n }\n]" cat.ml_trained_models-200: description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.ml_trained_models.TrainedModelsRecord' examples: CatTrainedModelsResponseExample1: description: A successful response from `GET _cat/ml/trained_models?v=true&format=json`. value: "[\n {\n \"id\": \"ddddd-1580216177138\",\n \"heap_size\": \"0b\",\n \"operations\": \"196\",\n \"create_time\": \"2025-03-25T00:01:38.662Z\",\n \"type\": \"pytorch\",\n \"ingest.pipelines\": \"0\",\n \"data_frame.id\": \"__none__\"\n },\n {\n \"id\": \"lang_ident_model_1\",\n \"heap_size\": \"1mb\",\n \"operations\": \"39629\",\n \"create_time\": \"2019-12-05T12:28:34.594Z\",\n \"type\": \"lang_ident\",\n \"ingest.pipelines\": \"0\",\n \"data_frame.id\": \"__none__\"\n }\n]" cat.recovery-200: description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.recovery.RecoveryRecord' examples: CatRecoveryResponseExample1: summary: No ongoing recoveries description: "A successful response from `GET _cat/recovery?v=true&format=json`. In this example, the source and target nodes are the same because the recovery type is `store`, meaning they were read from local storage on node start.\n" value: "[\n {\n \"index\": \"my-index-000001 \",\n \"shard\": \"0\",\n \"time\": \"13ms\",\n \"type\": \"store\",\n \"stage\": \"done\",\n \"source_host\": \"n/a\",\n \"source_node\": \"n/a\",\n \"target_host\": \"127.0.0.1\",\n \"target_node\": \"node-0\",\n \"repository\": \"n/a\",\n \"snapshot\": \"n/a\",\n \"files\": \"0\",\n \"files_recovered\": \"0\",\n \"files_percent\": \"100.0%\",\n \"files_total\": \"13\",\n \"bytes\": \"0b\",\n \"bytes_recovered\": \"0b\",\n \"bytes_percent\": \"100.0%\",\n \"bytes_total\": \"9928b\",\n \"translog_ops\": \"0\",\n \"translog_ops_recovered\": \"0\",\n \"translog_ops_percent\": \"100.0%\"\n }\n]" CatRecoveryResponseExample2: summary: A live shard recovery description: "A successful response from `GET _cat/recovery?v=true&h=i,s,t,ty,st,shost,thost,f,fp,b,bp&format=json`. You can retrieve information about an ongoing recovery for example when you increase the replica count of an index and bring another node online to host the replicas. In this example, the recovery type is `peer`, meaning the shard recovered from another node. The `files` and `bytes` are real-time measurements.\n" value: "[\n {\n \"i\": \"my-index-000001\",\n \"s\": \"0\",\n \"t\": \"1252ms\",\n \"ty\": \"peer\",\n \"st\": \"done\",\n \"shost\": \"192.168.1.1\",\n \"thost\": \"192.168.1.1\",\n \"f\": \"0\",\n \"fp\": \"100.0%\",\n \"b\": \"0b\",\n \"bp\": \"100.0%\",\n }\n]" CatRecoveryResponseExample3: summary: A snapshot recovery description: "A successful response from `GET _cat/recovery?v=true&h=i,s,t,ty,st,rep,snap,f,fp,b,bp&format=json`. You can restore backups of an index using the snapshot and restore API. You can use the cat recovery API to get information about a snapshot recovery.\n" value: "[\n {\n \"i\": \"my-index-000001\",\n \"s\": \"0\",\n \"t\": \"1978ms\",\n \"ty\": \"snapshot\",\n \"st\": \"done\",\n \"rep\": \"my-repo\",\n \"snap\": \"snap-1\",\n \"f\": \"79\",\n \"fp\": \"8.0%\",\n \"b\": \"12086\",\n \"bp\": \"9.0%\"\n }\n]" cat.segments-200: description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.segments.SegmentsRecord' examples: CatSegmentsResponseExample1: description: "A successful response from `GET /_cat/segments?v=true&format=json`.\n" value: "[\n {\n \"index\": \"test\",\n \"shard\": \"0\",\n \"prirep\": \"p\",\n \"ip\": \"127.0.0.1\",\n \"segment\": \"_0\",\n \"generation\": \"0\",\n \"docs.count\": \"1\",\n \"docs.deleted\": \"0\",\n \"size\": \"3kb\",\n \"size.memory\": \"0\",\n \"committed\": \"false\",\n \"searchable\": \"true\",\n \"version\": \"9.12.0\",\n \"compound\": \"true\"\n },\n {\n \"index\": \"test1\",\n \"shard\": \"0\",\n \"prirep\": \"p\",\n \"ip\": \"127.0.0.1\",\n \"segment\": \"_0\",\n \"generation\": \"0\",\n \"docs.count\": \"1\",\n \"docs.deleted\": \"0\",\n \"size\": \"3kb\",\n \"size.memory\": \"0\",\n \"committed\": \"false\",\n \"searchable\": \"true\",\n \"version\": \"9.12.0\",\n \"compound\": \"true\"\n }\n]" cat.shards-200: description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.shards.ShardsRecord' examples: CatShardsResponseExample1: summary: A single data stream or index description: "A successful response from `GET _cat/shards?format=json`.\n" value: "[\n {\n \"index\": \"my-index-000001\",\n \"shard\": \"0\",\n \"prirep\": \"p\",\n \"state\": \"STARTED\",\n \"docs\": \"3014\",\n \"store\": \"31.1mb\",\n \"dataset\": \"249b\",\n \"ip\": \"192.168.56.10\",\n \"node\": \"H5dfFeA\"\n }\n]" CatShardsResponseExample2: summary: A wildcard pattern description: "A successful response from `GET _cat/shards/my-index-*?format=json`. It returns information for any data streams or indices beginning with `my-index-`.\n" value: "[\n {\n \"index\": \"my-index-000001\",\n \"shard\": \"0\",\n \"prirep\": \"p\",\n \"state\": \"STARTED\",\n \"docs\": \"3014\",\n \"store\": \"31.1mb\",\n \"dataset\": \"249b\",\n \"ip\": \"192.168.56.10\",\n \"node\": \"H5dfFeA\"\n }\n]" CatShardsResponseExample3: summary: A relocating shard description: "A successful response from `GET _cat/shards?format=json`. The `RELOCATING` value in the `state` column indicates the index shard is relocating.\n" value: "[\n {\n \"index\": \"my-index-000001\",\n \"shard\": \"0\",\n \"prirep\": \"p\",\n \"state\": \"RELOCATING\",\n \"docs\": \"3014\",\n \"store\": \"31.1mb\",\n \"dataset\": \"249b\",\n \"ip\": \"192.168.56.10\",\n \"node\": \"H5dfFeA -> -> 192.168.56.30 bGG90GE\"\n }\n]" CatShardsResponseExample4: summary: Shard states description: "A successful response from `GET _cat/shards?format=json`. Before a shard is available for use, it goes through an `INITIALIZING` state. You can use the cat shards API to see which shards are initializing.\n" value: "[\n {\n \"index\": \"my-index-000001\",\n \"shard\": \"0\",\n \"prirep\": \"p\",\n \"state\": \"STARTED\",\n \"docs\": \"3014\",\n \"store\": \"31.1mb\",\n \"dataset\": \"249b\",\n \"ip\": \"192.168.56.10\",\n \"node\": \"H5dfFeA\"\n },\n {\n \"index\": \"my-index-000001\",\n \"shard\": \"0\",\n \"prirep\": \"r\",\n \"state\": \"INITIALIZING\",\n \"docs\": \"0\",\n \"store\": \"14.3mb\",\n \"dataset\": \"249b\",\n \"ip\": \"192.168.56.30\",\n \"node\": \"bGG90GE\"\n }\n]" CatShardsResponseExample5: summary: Reasons for unassigned shards description: "A successful response from `GET _cat/shards?h=index,shard,prirep,state,unassigned.reason&format=json`. It includes the `unassigned.reason` column, which indicates why a shard is unassigned.\n" value: "[\n {\n \"index\": \"my-index-000001\",\n \"shard\": \"0\",\n \"prirep\": \"p\",\n \"state\": \"STARTED\",\n \"unassigned.reason\": \"3014 31.1mb 192.168.56.10 H5dfFeA\"\n },\n {\n \"index\": \"my-index-000001\",\n \"shard\": \"0\",\n \"prirep\": \"r\",\n \"state\": \"STARTED\",\n \"unassigned.reason\": \"3014 31.1mb 192.168.56.30 bGG90GE\"\n },\n {\n \"index\": \"my-index-000001\",\n \"shard\": \"0\",\n \"prirep\": \"r\",\n \"state\": \"STARTED\",\n \"unassigned.reason\": \"3014 31.1mb 192.168.56.20 I8hydUG\"\n },\n {\n \"index\": \"my-index-000001\",\n \"shard\": \"0\",\n \"prirep\": \"r\",\n \"state\": \"UNASSIGNED\",\n \"unassigned.reason\": \"ALLOCATION_FAILED\"\n }\n]" cat.snapshots-200: description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.snapshots.SnapshotsRecord' examples: CatSnapshotsResponseExample1: description: "A successful response from `GET /_cat/snapshots/repo1?v=true&s=id&format=json`.\n" value: "[\n {\n \"id\": \"snap1\",\n \"repository\": \"repo1\",\n \"status\": \"FAILED\",\n \"start_epoch\": \"1445616705\",\n \"start_time\": \"18:11:45\",\n \"end_epoch\": \"1445616978\",\n \"end_time\": \"18:16:18\",\n \"duration\": \"4.6m\",\n \"indices\": \"1\",\n \"successful_shards\": \"4\",\n \"failed_shards\": \"1\",\n \"total_shards\": \"5\"\n },\n {\n \"id\": \"snap2\",\n \"repository\": \"repo1\",\n \"status\": \"SUCCESS\",\n \"start_epoch\": \"1445634298\",\n \"start_time\": \"23:04:58\",\n \"end_epoch\": \"1445634672\",\n \"end_time\": \"23:11:12\",\n \"duration\": \"6.2m\",\n \"indices\": \"2\",\n \"successful_shards\": \"10\",\n \"failed_shards\": \"0\",\n \"total_shards\": \"10\"\n }\n]" cat.templates-200: description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.templates.TemplatesRecord' examples: CatTemplatesResponseExample1: description: "A successful response from `GET _cat/templates/my-template-*?v=true&s=name&format=json`.\n" value: "[\n {\n \"name\": \"my-template-0\",\n \"index_patterns\": \"[te*]\",\n \"order\": \"500\",\n \"version\": null,\n \"composed_of\": \"[]\"\n },\n {\n \"name\": \"my-template-1\",\n \"index_patterns\": \"[tea*]\",\n \"order\": \"501\",\n \"version\": null,\n \"composed_of\": \"[]\"\n },\n {\n \"name\": \"my-template-2\",\n \"index_patterns\": \"[teak*]\",\n \"order\": \"502\",\n \"version\": \"7\",\n \"composed_of\": \"[]\"\n }\n]" cat.thread_pool-200: description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.thread_pool.ThreadPoolRecord' examples: CatThreadPoolResponseExample1: summary: Default columns description: "A successful response from `GET /_cat/thread_pool?format=json`.\n" value: "[\n {\n \"node_name\": \"node-0\",\n \"name\": \"analyze\",\n \"active\": \"0\",\n \"queue\": \"0\",\n \"rejected\": \"0\"\n },\n {\n \"node_name\": \"node-0\",\n \"name\": \"fetch_shard_started\",\n \"active\": \"0\",\n \"queue\": \"0\",\n \"rejected\": \"0\"\n },\n {\n \"node_name\": \"node-0\",\n \"name\": \"fetch_shard_store\",\n \"active\": \"0\",\n \"queue\": \"0\",\n \"rejected\": \"0\"\n },\n {\n \"node_name\": \"node-0\",\n \"name\": \"flush\",\n \"active\": \"0\",\n \"queue\": \"0\",\n \"rejected\": \"0\"\n },\n {\n \"node_name\": \"node-0\",\n \"name\": \"write\",\n \"active\": \"0\",\n \"queue\": \"0\",\n \"rejected\": \"0\"\n }\n]" CatThreadPoolResponseExample2: summary: Explicit columns description: "A successful response from `GET /_cat/thread_pool/generic?v=true&h=id,name,active,rejected,completed&format=json`. It returns the `id`, `name`, `active`, `rejected`, and `completed` columns. It also limits returned information to the generic thread pool.\n" value: "[\n {\n \"id\": \"0EWUhXeBQtaVGlexUeVwMg\",\n \"name\": \"generic\",\n \"active\": \"0\",\n \"rejected\": \"0\",\n \"completed\": \"70\"\n }\n]" cat.transforms-200: description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/cat.transforms.TransformsRecord' examples: CatTransformsResponseExample1: description: A successful response from `GET /_cat/transforms?v=true&format=json`. value: "[\n {\n \"id\" : \"ecommerce_transform\",\n \"state\" : \"started\",\n \"checkpoint\" : \"1\",\n \"documents_processed\" : \"705\",\n \"checkpoint_progress\" : \"100.00\",\n \"changes_last_detection_time\" : null\n }\n]" ccr.get_auto_follow_pattern-200: description: '' content: application/json: schema: required: - patterns type: object properties: patterns: type: array items: $ref: '#/components/schemas/ccr.get_auto_follow_pattern.AutoFollowPattern' examples: GetAutoFollowPatternResponseExample1: description: 'A successful response from `GET /_ccr/auto_follow/my_auto_follow_pattern`, which gets auto-follow patterns.' value: "{\n \"patterns\": [\n {\n \"name\": \"my_auto_follow_pattern\",\n \"pattern\": {\n \"active\": true,\n \"remote_cluster\" : \"remote_cluster\",\n \"leader_index_patterns\" :\n [\n \"leader_index*\"\n ],\n \"leader_index_exclusion_patterns\":\n [\n \"leader_index_001\"\n ],\n \"follow_index_pattern\" : \"{{leader_index}}-follower\"\n }\n }\n ]\n}" clear_scroll-200: description: '' content: application/json: schema: required: - succeeded - num_freed type: object properties: succeeded: type: boolean description: "If `true`, the request succeeded.\nThis does not indicate whether any scrolling search requests were cleared." num_freed: type: number description: The number of scrolling search requests cleared. clear_scroll-404: description: '' content: application/json: schema: required: - succeeded - num_freed type: object properties: succeeded: type: boolean num_freed: type: number cluster.allocation_explain-200: description: '' content: application/json: schema: required: - current_state - index - primary - shard type: object properties: allocate_explanation: type: string allocation_delay: allOf: - $ref: '#/components/schemas/_types.Duration' allocation_delay_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' can_allocate: allOf: - $ref: '#/components/schemas/cluster.allocation_explain.Decision' can_move_to_other_node: allOf: - $ref: '#/components/schemas/cluster.allocation_explain.Decision' can_rebalance_cluster: allOf: - $ref: '#/components/schemas/cluster.allocation_explain.Decision' can_rebalance_cluster_decisions: type: array items: $ref: '#/components/schemas/cluster.allocation_explain.AllocationDecision' can_rebalance_to_other_node: allOf: - $ref: '#/components/schemas/cluster.allocation_explain.Decision' can_remain_decisions: type: array items: $ref: '#/components/schemas/cluster.allocation_explain.AllocationDecision' can_remain_on_current_node: allOf: - $ref: '#/components/schemas/cluster.allocation_explain.Decision' cluster_info: allOf: - $ref: '#/components/schemas/cluster.allocation_explain.ClusterInfo' configured_delay: allOf: - $ref: '#/components/schemas/_types.Duration' configured_delay_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' current_node: allOf: - $ref: '#/components/schemas/cluster.allocation_explain.CurrentNode' current_state: type: string index: allOf: - $ref: '#/components/schemas/_types.IndexName' move_explanation: type: string node_allocation_decisions: type: array items: $ref: '#/components/schemas/cluster.allocation_explain.NodeAllocationExplanation' primary: type: boolean rebalance_explanation: type: string remaining_delay: allOf: - $ref: '#/components/schemas/_types.Duration' remaining_delay_in_millis: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' shard: type: number unassigned_info: allOf: - $ref: '#/components/schemas/cluster.allocation_explain.UnassignedInformation' note: type: string x-state: Generally available; Added in 7.14.0 examples: ClusterAllocationExplainResponseExample1: summary: Conflicting settings description: "An example of an allocation explanation for an unassigned primary shard. In this example, a newly created index has an index setting that requires that it only be allocated to a node named `nonexistent_node`, which does not exist, so the index is unable to allocate.\n" value: "{\n \"index\" : \"my-index-000001\",\n \"shard\" : 0,\n \"primary\" : true,\n \"current_state\" : \"unassigned\",\n \"unassigned_info\" : {\n \"reason\" : \"INDEX_CREATED\",\n \"at\" : \"2017-01-04T18:08:16.600Z\",\n \"last_allocation_status\" : \"no\"\n },\n \"can_allocate\" : \"no\",\n \"allocate_explanation\" : \"Elasticsearch isn't allowed to allocate this shard to any of the nodes in the cluster. Choose a node to which you expect this shard to be allocated, find this node in the node-by-node explanation, and address the reasons which prevent Elasticsearch from allocating this shard there.\",\n \"node_allocation_decisions\" : [\n {\n \"node_id\" : \"8qt2rY-pT6KNZB3-hGfLnw\",\n \"node_name\" : \"node-0\",\n \"transport_address\" : \"127.0.0.1:9401\",\n \"roles\" : [\"data\", \"data_cold\", \"data_content\", \"data_frozen\", \"data_hot\", \"data_warm\", \"ingest\", \"master\", \"ml\", \"remote_cluster_client\", \"transform\"],\n \"node_attributes\" : {},\n \"node_decision\" : \"no\",\n \"weight_ranking\" : 1,\n \"deciders\" : [\n {\n \"decider\" : \"filter\",\n \"decision\" : \"NO\",\n \"explanation\" : \"node does not match index setting [index.routing.allocation.include] filters [_name:\\\"nonexistent_node\\\"]\"\n }\n ]\n }\n ]\n}" ClusterAllocationExplainResponseExample2: summary: Maximum retries description: "An example of an allocation explanation for an unassigned primary shard that has reached the maximum number of allocation retry attempts. After the maximum number of retries is reached, Elasticsearch stops attempting to allocate the shard in order to prevent infinite retries which may impact cluster performance.\n" value: "{\n \"index\" : \"my-index-000001\",\n \"shard\" : 0,\n \"primary\" : true,\n \"current_state\" : \"unassigned\",\n \"unassigned_info\" : {\n \"at\" : \"2017-01-04T18:03:28.464Z\",\n \"failed shard on node [mEKjwwzLT1yJVb8UxT6anw]: failed recovery, failure RecoveryFailedException\",\n \"reason\": \"ALLOCATION_FAILED\",\n \"failed_allocation_attempts\": 5,\n \"last_allocation_status\": \"no\",\n },\n \"can_allocate\": \"no\",\n \"allocate_explanation\": \"cannot allocate because allocation is not permitted to any of the nodes\",\n \"node_allocation_decisions\" : [\n {\n \"node_id\" : \"3sULLVJrRneSg0EfBB-2Ew\",\n \"node_name\" : \"node_t0\",\n \"transport_address\" : \"127.0.0.1:9400\",\n \"roles\" : [\"data_content\", \"data_hot\"],\n \"node_decision\" : \"no\",\n \"store\" : {\n \"matching_size\" : \"4.2kb\",\n \"matching_size_in_bytes\" : 4325\n },\n \"deciders\" : [\n {\n \"decider\": \"max_retry\",\n \"decision\" : \"NO\",\n \"explanation\": \"shard has exceeded the maximum number of retries [5] on failed allocation attempts - manually call [POST /_cluster/reroute?retry_failed] to retry, [unassigned_info[[reason=ALLOCATION_FAILED], at[2024-07-30T21:04:12.166Z], failed_attempts[5], failed_nodes[[mEKjwwzLT1yJVb8UxT6anw]], delayed=false, details[failed shard on node [mEKjwwzLT1yJVb8UxT6anw]: failed recovery, failure RecoveryFailedException], allocation_status[deciders_no]]]\"\n }\n ]\n }\n ]\n}" cluster.get_component_template-200: description: '' content: application/json: schema: required: - component_templates type: object properties: component_templates: type: array items: $ref: '#/components/schemas/cluster._types.ComponentTemplate' examples: GetComponentTemplateResponseExample1: description: A successful response for retrieving information about a component template. value: "{\n \"component_templates\" : [\n {\n \"name\" : \"my-component-template\",\n \"component_template\" : {\n \"version\" : 1,\n \"_meta\" : {\n \"description\" : \"my custom component template\"\n },\n \"template\" : {\n \"settings\" : {\n \"index\" : {\n \"number_of_shards\" : \"1\"\n }\n },\n \"mappings\" : {\n \"properties\" : {\n \"@timestamp\" : {\n \"type\" : \"date\"\n },\n \"message\" : {\n \"type\" : \"text\"\n }\n }\n }\n },\n \"created_date\" : \"2024-01-01T12:00:00.000Z\",\n \"created_date_millis\" : 1704110400000,\n \"modified_date\" : \"2025-01-01T12:00:00.000Z\",\n \"modified_date_millis\" : 1735732800000\n }\n }\n ]\n}" cluster.health-200: description: '' content: application/json: schema: $ref: '#/components/schemas/cluster.health.HealthResponseBody' examples: ClusterHealthResponseExample1: description: "A successful response from `GET _cluster/health`. It is the health status of a quiet single node cluster with a single index with one shard and one replica.\n" value: "{\n \"cluster_name\" : \"testcluster\",\n \"status\" : \"yellow\",\n \"timed_out\" : false,\n \"number_of_nodes\" : 1,\n \"number_of_data_nodes\" : 1,\n \"active_primary_shards\" : 1,\n \"active_shards\" : 1,\n \"relocating_shards\" : 0,\n \"initializing_shards\" : 0,\n \"unassigned_shards\" : 1,\n \"delayed_unassigned_shards\": 0,\n \"number_of_pending_tasks\" : 0,\n \"number_of_in_flight_fetch\": 0,\n \"task_max_waiting_in_queue_millis\": 0,\n \"active_shards_percent_as_number\": 50.0\n}" cluster.health-408: description: '' content: application/json: schema: $ref: '#/components/schemas/cluster.health.HealthResponseBody' cluster.put_component_template-200: description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' cluster.state-200: description: '' content: application/json: schema: type: object cluster.stats-200: description: '' content: application/json: schema: $ref: '#/components/schemas/cluster.stats.StatsResponseBase' connector.put-200: description: '' content: application/json: schema: required: - result - id type: object properties: result: allOf: - $ref: '#/components/schemas/_types.Result' id: allOf: - $ref: '#/components/schemas/_types.Id' examples: ConnectorPutResponseExample1: value: "{\n \"result\": \"created\",\n \"id\": \"my-connector\"\n}" count-200: description: '' content: application/json: schema: required: - count - _shards type: object properties: count: type: number _shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' examples: CountResponseExample1: description: A successful response from `GET /my-index-000001/_count?q=user:kimchy`. value: "{\n \"count\": 1,\n \"_shards\": {\n \"total\": 1,\n \"successful\": 1,\n \"skipped\": 0,\n \"failed\": 0\n }\n}" create-200: description: '' content: application/json: schema: $ref: '#/components/schemas/_types.WriteResponseBase' examples: CreateResponseExample1: description: A successful response from `PUT my-index-000001/_create/1` which indexes a document. value: "{\n \"_index\": \"my-index-000001\",\n \"_id\": \"1\",\n \"_version\": 1,\n \"result\": \"created\",\n \"_shards\": {\n \"total\": 1,\n \"successful\": 1,\n \"failed\": 0\n },\n \"_seq_no\": 0,\n \"_primary_term\": 1\n}" enrich.get_policy-200: description: '' content: application/json: schema: required: - policies type: object properties: policies: type: array items: $ref: '#/components/schemas/enrich._types.Summary' eql.search-200: description: '' content: application/json: schema: $ref: '#/components/schemas/eql._types.EqlSearchResponseBase' examples: EqlSearchResponseExample2: summary: A successful response for performing search with an EQL query. description: '' value: "{\n \"is_partial\": false,\n \"is_running\": false,\n \"took\": 6,\n \"timed_out\": false,\n \"hits\": {\n \"total\": {\n \"value\": 1,\n \"relation\": \"eq\"\n },\n \"sequences\": [\n {\n \"join_keys\": [\n 2012\n ],\n \"events\": [\n {\n \"_index\": \".ds-my-data-stream-2099.12.07-000001\",\n \"_id\": \"AtOJ4UjUBAAx3XR5kcCM\",\n \"_source\": {\n \"@timestamp\": \"2099-12-06T11:04:07.000Z\",\n \"event\": {\n \"category\": \"file\",\n \"id\": \"dGCHwoeS\",\n \"sequence\": 2\n },\n \"file\": {\n \"accessed\": \"2099-12-07T11:07:08.000Z\",\n \"name\": \"cmd.exe\",\n \"path\": \"C:\\\\Windows\\\\System32\\\\cmd.exe\",\n \"type\": \"file\",\n \"size\": 16384\n },\n \"process\": {\n \"pid\": 2012,\n \"name\": \"cmd.exe\",\n \"executable\": \"C:\\\\Windows\\\\System32\\\\cmd.exe\"\n }\n }\n },\n {\n \"_index\": \".ds-my-data-stream-2099.12.07-000001\",\n \"_id\": \"OQmfCaduce8zoHT93o4H\",\n \"_source\": {\n \"@timestamp\": \"2099-12-07T11:07:09.000Z\",\n \"event\": {\n \"category\": \"process\",\n \"id\": \"aR3NWVOs\",\n \"sequence\": 4\n },\n \"process\": {\n \"pid\": 2012,\n \"name\": \"regsvr32.exe\",\n \"command_line\": \"regsvr32.exe /s /u /i:https://...RegSvr32.sct scrobj.dll\",\n \"executable\": \"C:\\\\Windows\\\\System32\\\\regsvr32.exe\"\n }\n }\n }\n ]\n }\n ]\n }\n}" esql.get_data_source-200: description: '' content: application/json: schema: required: - data_sources type: object properties: data_sources: type: array items: $ref: '#/components/schemas/esql._types.ESQLDataSource' description: "The matching data sources.\nCredential values in each data source's settings are redacted as `::es_redacted::` in the response." examples: GetDataSourceResponseExample1: summary: Data source details description: "The response contains the requested data source. Credential values are replaced by the ::es_redacted:: sentinel.\n" value: "{\n \"data_sources\": [\n {\n \"name\": \"prod_s3_logs\",\n \"type\": \"s3\",\n \"description\": \"Production S3 logs bucket\",\n \"settings\": {\n \"region\": \"us-east-1\",\n \"auth\": \"static_credentials\",\n \"access_key\": \"::es_redacted::\",\n \"secret_key\": \"::es_redacted::\"\n }\n }\n ]\n}" GetDataSourceResponseExample2: summary: No data sources matched description: A wildcard or list-all request with no matches returns an empty array. value: "{\n \"data_sources\": []\n}" esql.get_dataset-200: description: '' content: application/json: schema: required: - datasets type: object properties: datasets: type: array items: $ref: '#/components/schemas/esql._types.ESQLDataset' description: The matching datasets. examples: GetDatasetResponseExample1: summary: Dataset details description: The response contains the requested dataset definition. value: "{\n \"datasets\": [\n {\n \"name\": \"access_logs\",\n \"data_source\": \"prod_s3_logs\",\n \"resource\": \"s3://logs-bucket/access/**/*.parquet\",\n \"description\": \"Production access logs\",\n \"settings\": {\n \"partition_detection\": \"hive\"\n }\n }\n ]\n}" GetDatasetResponseExample2: summary: No datasets matched description: A wildcard or list-all request with no matches returns an empty array. value: "{\n \"datasets\": []\n}" esql.get_view-200: description: '' content: application/json: schema: required: - views type: object properties: views: type: array items: $ref: '#/components/schemas/esql._types.ESQLView' examples: GetViewResponseExample1: summary: View definition description: The response contains the requested view. value: "{\n \"views\": [\n {\n \"name\": \"country_addresses\",\n \"query\": \"\"\"\n FROM addresses\n | RENAME city.country.name AS country\n | EVAL country = CASE(country == \"United States of America\", \"United States\", country)\n | STATS count=COUNT() BY country\n \"\"\",\n \"description\": \"Address counts by country\"\n }\n ]\n}" GetViewResponseExample2: summary: Reserved view description: "A reserved view includes reserved set to true. This view is created when anomaly detection results exist.\n" value: "{\n \"views\": [\n {\n \"name\": \".ml-anomalies\",\n \"query\": \"\"\"\n FROM .ml-anomalies-* METADATA _index\n | WHERE result_type IN (\"bucket\", \"record\", \"influencer\")\n | EVAL score = COALESCE(anomaly_score, record_score, influencer_score),\n initial_score = COALESCE(initial_anomaly_score, initial_record_score, initial_influencer_score)\n | KEEP timestamp,\n event.ingested,\n job_id,\n result_type,\n is_interim,\n score,\n initial_score,\n bucket_span,\n function,\n function_description,\n field_name,\n by_field_name,\n by_field_value,\n over_field_name,\n over_field_value,\n partition_field_name,\n partition_field_value,\n influencer_field_name,\n influencer_field_value,\n detector_index,\n actual,\n typical,\n event_count,\n processing_time_ms,\n _index\n \"\"\",\n \"description\": \"View that contains the results of machine learning anomaly detection jobs.\",\n \"reserved\": true\n }\n ]\n}" explain-200: description: '' content: application/json: schema: required: - _index - _id - matched type: object properties: _index: allOf: - $ref: '#/components/schemas/_types.IndexName' _id: allOf: - $ref: '#/components/schemas/_types.Id' matched: type: boolean explanation: allOf: - $ref: '#/components/schemas/_global.explain.ExplanationDetail' get: allOf: - $ref: '#/components/schemas/_types.InlineGet' examples: ExplainResponseExample1: description: A successful response from `GET /my-index-000001/_explain/0`. value: "{\n \"_index\":\"my-index-000001\",\n \"_id\":\"0\",\n \"matched\":true,\n \"explanation\":{\n \"value\":1.6943598,\n \"description\":\"weight(message:elasticsearch in 0) [PerFieldSimilarity], result of:\",\n \"details\":[\n {\n \"value\":1.6943598,\n \"description\":\"score(freq=1.0), computed as boost * idf * tf from:\",\n \"details\":[\n {\n \"value\":2.2,\n \"description\":\"boost\",\n \"details\":[]\n },\n {\n \"value\":1.3862944,\n \"description\":\"idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:\",\n \"details\":[\n {\n \"value\":1,\n \"description\":\"n, number of documents containing term\",\n \"details\":[]\n },\n {\n \"value\":5,\n \"description\":\"N, total number of documents with field\",\n \"details\":[]\n }\n ]\n },\n {\n \"value\":0.5555556,\n \"description\":\"tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:\",\n \"details\":[\n {\n \"value\":1.0,\n \"description\":\"freq, occurrences of term within document\",\n \"details\":[]\n },\n {\n \"value\":1.2,\n \"description\":\"k1, term saturation parameter\",\n \"details\":[]\n },\n {\n \"value\":0.75,\n \"description\":\"b, length normalization parameter\",\n \"details\":[]\n },\n {\n \"value\":3.0,\n \"description\":\"dl, length of field\",\n \"details\":[]\n },\n {\n \"value\":5.4,\n \"description\":\"avgdl, average length of field\",\n \"details\":[]\n }\n ]\n }\n ]\n }\n ]\n }\n}" field_caps-200: description: '' content: application/json: schema: required: - indices - fields type: object properties: indices: allOf: - $ref: '#/components/schemas/_types.Indices' description: 'The list of indices where this field has the same type family, or null if all indices have the same type family for the field.' fields: type: object additionalProperties: type: object additionalProperties: $ref: '#/components/schemas/_global.field_caps.FieldCapability' examples: FieldCapabilitiesResponseExample1: summary: Get two fields description: "A successful response from `GET _field_caps?fields=rating,title`. The field `rating` is defined as a long in `index1` and `index2` and as a `keyword` in `index3` and `index4`. The field `rating` is not aggregatable in `index1`. The field `rating` is not searchable in `index4`. The field `title` is defined as text in all indices. None of the fields are inference fields.\n" value: "{\n \"indices\": [ \"index1\", \"index2\", \"index3\", \"index4\", \"index5\" ],\n \"fields\": {\n \"rating\": {\n \"long\": {\n \"metadata_field\": false,\n \"searchable\": true,\n \"aggregatable\": false,\n \"inference\": false,\n \"indices\": [ \"index1\", \"index2\" ],\n \"non_aggregatable_indices\": [ \"index1\" ]\n },\n \"keyword\": {\n \"metadata_field\": false,\n \"searchable\": false,\n \"aggregatable\": true,\n \"inference\": false,\n \"indices\": [ \"index3\", \"index4\" ],\n \"non_searchable_indices\": [ \"index4\" ]\n }\n },\n \"title\": {\n \"text\": {\n \"metadata_field\": false,\n \"searchable\": true,\n \"aggregatable\": false,\n \"inference\": false\n }\n }\n }\n}" FieldCapabilitiesResponseExample2: summary: Get unmapped fields description: "A successful response from `GET _field_caps?fields=rating,title&include_unmapped`. The response contains an entry for each field that is present in some indices but not all. For example, the `rating` and `title` fields are unmapped in `index5`.\n" value: "{\n \"indices\": [ \"index1\", \"index2\", \"index3\", \"index4\", \"index5\" ],\n \"fields\": {\n \"rating\": {\n \"long\": {\n \"metadata_field\": false,\n \"searchable\": true,\n \"aggregatable\": false,\n \"inference\": false,\n \"indices\": [ \"index1\", \"index2\" ],\n \"non_aggregatable_indices\": [ \"index1\" ]\n },\n \"keyword\": {\n \"metadata_field\": false,\n \"searchable\": false,\n \"aggregatable\": true,\n \"inference\": false,\n \"indices\": [ \"index3\", \"index4\" ],\n \"non_searchable_indices\": [ \"index4\" ]\n }\n },\n \"title\": {\n \"text\": {\n \"metadata_field\": false,\n \"searchable\": true,\n \"aggregatable\": false,\n \"inference\": false\n }\n }\n }\n}" fleet.msearch-200: description: '' content: application/json: schema: required: - docs type: object properties: docs: type: array items: $ref: '#/components/schemas/_global.msearch.ResponseItem' fleet.search-200: description: '' content: application/json: schema: required: - took - timed_out - _shards - hits type: object properties: took: type: number timed_out: type: boolean _shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' hits: allOf: - $ref: '#/components/schemas/_global.search._types.HitsMetadata' aggregations: type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.Aggregate' _clusters: allOf: - $ref: '#/components/schemas/_types.ClusterStatistics' fields: type: object additionalProperties: type: object max_score: type: number num_reduce_phases: type: number profile: allOf: - $ref: '#/components/schemas/_global.search._types.Profile' pit_id: allOf: - $ref: '#/components/schemas/_types.Id' _scroll_id: allOf: - $ref: '#/components/schemas/_types.ScrollId' suggest: type: object additionalProperties: type: array items: $ref: '#/components/schemas/_global.search._types.Suggest' terminated_early: type: boolean graph.explore-200: description: '' content: application/json: schema: required: - connections - failures - timed_out - took - vertices type: object properties: connections: type: array items: $ref: '#/components/schemas/graph._types.Connection' failures: type: array items: $ref: '#/components/schemas/_types.ShardFailure' timed_out: type: boolean took: type: number vertices: type: array items: $ref: '#/components/schemas/graph._types.Vertex' health_report-200: description: '' content: application/json: schema: required: - cluster_name - indicators type: object properties: cluster_name: type: string indicators: allOf: - $ref: '#/components/schemas/_global.health_report.Indicators' status: allOf: - $ref: '#/components/schemas/_global.health_report.IndicatorHealthStatus' ilm.get_lifecycle-200: description: '' content: application/json: schema: type: object additionalProperties: $ref: '#/components/schemas/ilm.get_lifecycle.Lifecycle' examples: GetLifecycleResponseExample1: description: A successful response when retrieving a lifecycle policy. value: "{\n \"my_policy\": {\n \"version\": 1,\n \"modified_date\": 82392349,\n \"policy\": {\n \"phases\": {\n \"warm\": {\n \"min_age\": \"10d\",\n \"actions\": {\n \"forcemerge\": {\n \"max_num_segments\": 1\n }\n }\n },\n \"delete\": {\n \"min_age\": \"30d\",\n \"actions\": {\n \"delete\": {\n \"delete_searchable_snapshot\": true\n }\n }\n }\n }\n },\n \"in_use_by\" : {\n \"indices\" : [],\n \"data_streams\" : [],\n \"composable_templates\" : []\n }\n }\n}" index-200: description: '' content: application/json: schema: $ref: '#/components/schemas/_types.WriteResponseBase' examples: IndexResponseExample1: summary: Automate document IDs description: 'A successful response from `POST my-index-000001/_doc/`, which contains an automated document ID.' value: "{\n \"_shards\": {\n \"total\": 2,\n \"failed\": 0,\n \"successful\": 2\n },\n \"_index\": \"my-index-000001\",\n \"_id\": \"W0tpsmIBdwcYyG50zbta\",\n \"_version\": 1,\n \"_seq_no\": 0,\n \"_primary_term\": 1,\n \"result\": \"created\"\n}" IndexResponseExample2: summary: Define document IDs description: A successful response from `PUT my-index-000001/_doc/1`. value: "{\n \"_shards\": {\n \"total\": 2,\n \"failed\": 0,\n \"successful\": 2\n },\n \"_index\": \"my-index-000001\",\n \"_id\": \"1\",\n \"_version\": 1,\n \"_seq_no\": 0,\n \"_primary_term\": 1,\n \"result\": \"created\"\n}" indices.analyze-200: description: '' content: application/json: schema: type: object properties: detail: allOf: - $ref: '#/components/schemas/indices.analyze.AnalyzeDetail' tokens: type: array items: $ref: '#/components/schemas/indices.analyze.AnalyzeToken' examples: indicesAnalyzeResponseExample7: description: A successful response for an analysis with `explain` set to `true`. value: "{\n \"detail\": {\n \"custom_analyzer\": true,\n \"charfilters\": [],\n \"tokenizer\": {\n \"name\": \"standard\",\n \"tokens\": [\n {\n \"token\": \"detailed\",\n \"start_offset\": 0,\n \"end_offset\": 8,\n \"type\": \"\",\n \"position\": 0\n },\n {\n \"token\": \"output\",\n \"start_offset\": 9,\n \"end_offset\": 15,\n \"type\": \"\",\n \"position\": 1\n }\n ]\n },\n \"tokenfilters\": [\n {\n \"name\": \"snowball\",\n \"tokens\": [\n {\n \"token\": \"detail\",\n \"start_offset\": 0,\n \"end_offset\": 8,\n \"type\": \"\",\n \"position\": 0,\n \"keyword\": false\n },\n {\n \"token\": \"output\",\n \"start_offset\": 9,\n \"end_offset\": 15,\n \"type\": \"\",\n \"position\": 1,\n \"keyword\": false\n }\n ]\n }\n ]\n }\n}" indices.clear_cache-200: description: '' content: application/json: schema: $ref: '#/components/schemas/_types.ShardsOperationResponseBase' indices.clone-200: description: '' content: application/json: schema: required: - acknowledged - index - shards_acknowledged type: object properties: acknowledged: type: boolean index: allOf: - $ref: '#/components/schemas/_types.IndexName' shards_acknowledged: type: boolean indices.create_from-200: description: '' content: application/json: schema: required: - acknowledged - index - shards_acknowledged type: object properties: acknowledged: type: boolean index: allOf: - $ref: '#/components/schemas/_types.IndexName' shards_acknowledged: type: boolean indices.data_streams_stats-200: description: '' content: application/json: schema: required: - _shards - backing_indices - data_stream_count - data_streams - total_store_size_bytes type: object properties: _shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' description: Contains information about shards that attempted to execute the request. backing_indices: type: number description: Total number of backing indices for the selected data streams. data_stream_count: type: number description: Total number of selected data streams. data_streams: type: array items: $ref: '#/components/schemas/indices.data_streams_stats.DataStreamsStatsItem' description: Contains statistics for the selected data streams. total_store_sizes: allOf: - $ref: '#/components/schemas/_types.ByteSize' description: "Total size of all shards for the selected data streams.\nThis property is included only if the `human` query parameter is `true`" total_store_size_bytes: type: number description: 'Total size, in bytes, of all shards for the selected data streams.' examples: indicesDataStreamStatsResponseExample1: description: A successful response for retrieving statistics for a data stream. value: "{\n \"_shards\": {\n \"total\": 10,\n \"successful\": 5,\n \"failed\": 0\n },\n \"data_stream_count\": 2,\n \"backing_indices\": 5,\n \"total_store_size\": \"7kb\",\n \"total_store_size_bytes\": 7268,\n \"data_streams\": [\n {\n \"data_stream\": \"my-data-stream\",\n \"backing_indices\": 3,\n \"store_size\": \"3.7kb\",\n \"store_size_bytes\": 3772,\n \"maximum_timestamp\": 1607512028000\n },\n {\n \"data_stream\": \"my-data-stream-two\",\n \"backing_indices\": 2,\n \"store_size\": \"3.4kb\",\n \"store_size_bytes\": 3496,\n \"maximum_timestamp\": 1607425567000\n }\n ]\n}" indices.delete_alias-200: description: '' content: application/json: schema: $ref: '#/components/schemas/indices._types.AliasesResponseBody' indices.exists_alias-200: description: '' content: application/json: { } indices.flush-200: description: '' content: application/json: schema: $ref: '#/components/schemas/_types.ShardsOperationResponseBase' indices.forcemerge-200: description: '' content: application/json: schema: $ref: '#/components/schemas/indices.forcemerge._types.ForceMergeResponseBody' indices.get_alias-200: description: '' content: application/json: schema: type: object additionalProperties: $ref: '#/components/schemas/indices.get_alias._types.IndexAliases' indices.get_alias-404: description: '' content: application/json: schema: oneOf: - $ref: '#/components/schemas/indices.get_alias._types.NotFoundAliases' - $ref: '#/components/schemas/_types.ErrorResponseBase' indices.get_data_stream-200: description: '' content: application/json: schema: required: - data_streams type: object properties: data_streams: type: array items: $ref: '#/components/schemas/indices._types.DataStream' examples: indicesGetDataStreamResponseExample1: description: A successful response for retrieving information about a data stream. value: "{\n \"data_streams\": [\n {\n \"name\": \"my-data-stream\",\n \"timestamp_field\": {\n \"name\": \"@timestamp\"\n },\n \"indices\": [\n {\n \"index_name\": \".ds-my-data-stream-2099.03.07-000001\",\n \"index_uuid\": \"xCEhwsp8Tey0-FLNFYVwSg\",\n \"prefer_ilm\": true,\n \"ilm_policy\": \"my-lifecycle-policy\",\n \"managed_by\": \"Index Lifecycle Management\"\n },\n {\n \"index_name\": \".ds-my-data-stream-2099.03.08-000002\",\n \"index_uuid\": \"PA_JquKGSiKcAKBA8DJ5gw\",\n \"prefer_ilm\": true,\n \"ilm_policy\": \"my-lifecycle-policy\",\n \"managed_by\": \"Index Lifecycle Management\"\n }\n ],\n \"generation\": 2,\n \"_meta\": {\n \"my-meta-field\": \"foo\"\n },\n \"status\": \"GREEN\",\n \"next_generation_managed_by\": \"Index Lifecycle Management\",\n \"prefer_ilm\": true,\n \"template\": \"my-index-template\",\n \"ilm_policy\": \"my-lifecycle-policy\",\n \"hidden\": false,\n \"system\": false,\n \"allow_custom_routing\": false,\n \"replicated\": false,\n \"rollover_on_write\": false\n },\n {\n \"name\": \"my-data-stream-two\",\n \"timestamp_field\": {\n \"name\": \"@timestamp\"\n },\n \"indices\": [\n {\n \"index_name\": \".ds-my-data-stream-two-2099.03.08-000001\",\n \"index_uuid\": \"3liBu2SYS5axasRt6fUIpA\",\n \"prefer_ilm\": true,\n \"ilm_policy\": \"my-lifecycle-policy\",\n \"managed_by\": \"Index Lifecycle Management\"\n }\n ],\n \"generation\": 1,\n \"_meta\": {\n \"my-meta-field\": \"foo\"\n },\n \"status\": \"YELLOW\",\n \"next_generation_managed_by\": \"Index Lifecycle Management\",\n \"prefer_ilm\": true,\n \"template\": \"my-index-template\",\n \"ilm_policy\": \"my-lifecycle-policy\",\n \"hidden\": false,\n \"system\": false,\n \"allow_custom_routing\": false,\n \"replicated\": false,\n \"rollover_on_write\": false\n }\n ]\n}" indices.get_field_mapping-200: description: '' content: application/json: schema: type: object additionalProperties: $ref: '#/components/schemas/indices.get_field_mapping.TypeFieldMappings' examples: indicesGetFieldMappingResponseExample1: summary: A single field mapping description: "A sucessful response from `GET publications/_mapping/field/title`, which returns the mapping of a field called `title`.\n" value: "{\n \"publications\": {\n \"mappings\": {\n \"title\": {\n \"full_name\": \"title\",\n \"mapping\": {\n \"title\": {\n \"type\": \"text\"\n }\n }\n }\n }\n }\n}" indicesGetFieldMappingResponseExample2: summary: Multiple field mappings description: "A successful response from `GET publications/_mapping/field/author.id,abstract,name`. The get field mapping API also supports wildcard notation.\n" value: "{\n \"publications\": {\n \"mappings\": {\n \"author.id\": {\n \"full_name\": \"author.id\",\n \"mapping\": {\n \"id\": {\n \"type\": \"text\"\n }\n }\n },\n \"abstract\": {\n \"full_name\": \"abstract\",\n \"mapping\": {\n \"abstract\": {\n \"type\": \"text\"\n }\n }\n }\n }\n }\n}" indicesGetFieldMappingResponseExample3: summary: Wildcards description: "A successful response from `GET publications/_mapping/field/a*`.\n" value: "{\n \"publications\": {\n \"mappings\": {\n \"author.name\": {\n \"full_name\": \"author.name\",\n \"mapping\": {\n \"name\": {\n \"type\": \"text\"\n }\n }\n },\n \"abstract\": {\n \"full_name\": \"abstract\",\n \"mapping\": {\n \"abstract\": {\n \"type\": \"text\"\n }\n }\n },\n \"author.id\": {\n \"full_name\": \"author.id\",\n \"mapping\": {\n \"id\": {\n \"type\": \"text\"\n }\n }\n }\n }\n }\n}" indices.get_index_template-200: description: '' content: application/json: schema: required: - index_templates type: object properties: index_templates: type: array items: $ref: '#/components/schemas/indices.get_index_template.IndexTemplateItem' examples: GetIndexTemplateResponseExample1: description: A successful response for retrieving information about an index template. value: "{\n \"index_templates\" : [\n {\n \"name\" : \"my-index-template\",\n \"index_template\" : {\n \"index_patterns\" : [ \"logs-*\" ],\n \"template\" : {\n \"settings\" : {\n \"index\" : {\n \"number_of_shards\" : \"1\",\n \"number_of_replicas\" : \"1\"\n }\n },\n \"mappings\" : {\n \"properties\" : {\n \"@timestamp\" : {\n \"type\" : \"date\"\n },\n \"message\" : {\n \"type\" : \"text\"\n }\n }\n }\n },\n \"composed_of\" : [ \"my-component-template\" ],\n \"priority\" : 200,\n \"version\" : 1,\n \"_meta\" : {\n \"description\" : \"my custom index template\"\n },\n \"created_date\" : \"2024-01-01T12:00:00.000Z\",\n \"created_date_millis\" : 1704110400000,\n \"modified_date\" : \"2025-01-01T12:00:00.000Z\",\n \"modified_date_millis\" : 1735732800000\n }\n }\n ]\n}" indices.get_mapping-200: description: '' content: application/json: schema: type: object additionalProperties: $ref: '#/components/schemas/indices.get_mapping.IndexMappingRecord' indices.get_settings-200: description: '' content: application/json: schema: type: object additionalProperties: $ref: '#/components/schemas/indices._types.IndexState' indices.get_template-200: description: '' content: application/json: schema: type: object additionalProperties: $ref: '#/components/schemas/indices._types.TemplateMapping' indices.put_alias-200: description: '' content: application/json: schema: $ref: '#/components/schemas/indices._types.AliasesResponseBody' indices.put_index_template-200: description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' indices.put_mapping-200: description: '' content: application/json: schema: $ref: '#/components/schemas/_types.IndicesResponseBase' indices.put_settings-200: description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' indices.put_template-200: description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' indices.recovery-200: description: '' content: application/json: schema: type: object additionalProperties: $ref: '#/components/schemas/indices.recovery.RecoveryStatus' examples: indicesRecoveryResponseExample1: summary: Get segment information description: "A successful response from `GET /_recovery?human`, which gets information about ongoing and completed shard recoveries for all data streams and indices in a cluster. This example includes information about a single index recovering a single shard. The source of the recovery is a snapshot repository and the target of the recovery is the `my_es_node` node. The response also includes the number and percentage of files and bytes recovered.\n" value: "{\n \"index1\" : {\n \"shards\" : [ {\n \"id\" : 0,\n \"type\" : \"SNAPSHOT\",\n \"stage\" : \"INDEX\",\n \"primary\" : true,\n \"start_time\" : \"2014-02-24T12:15:59.716\",\n \"start_time_in_millis\": 1393244159716,\n \"stop_time\" : \"0s\",\n \"stop_time_in_millis\" : 0,\n \"total_time\" : \"2.9m\",\n \"total_time_in_millis\" : 175576,\n \"source\" : {\n \"repository\" : \"my_repository\",\n \"snapshot\" : \"my_snapshot\",\n \"index\" : \"index1\",\n \"version\" : \"{version}\",\n \"restoreUUID\": \"PDh1ZAOaRbiGIVtCvZOMww\"\n },\n \"target\" : {\n \"id\" : \"ryqJ5lO5S4-lSFbGntkEkg\",\n \"host\" : \"my.fqdn\",\n \"transport_address\" : \"my.fqdn\",\n \"ip\" : \"10.0.1.7\",\n \"name\" : \"my_es_node\"\n },\n \"index\" : {\n \"size\" : {\n \"total\" : \"75.4mb\",\n \"total_in_bytes\" : 79063092,\n \"reused\" : \"0b\",\n \"reused_in_bytes\" : 0,\n \"recovered\" : \"65.7mb\",\n \"recovered_in_bytes\" : 68891939,\n \"recovered_from_snapshot\" : \"0b\",\n \"recovered_from_snapshot_in_bytes\" : 0,\n \"percent\" : \"87.1%\"\n },\n \"files\" : {\n \"total\" : 73,\n \"reused\" : 0,\n \"recovered\" : 69,\n \"percent\" : \"94.5%\"\n },\n \"total_time\" : \"0s\",\n \"total_time_in_millis\" : 0,\n \"source_throttle_time\" : \"0s\",\n \"source_throttle_time_in_millis\" : 0,\n \"target_throttle_time\" : \"0s\",\n \"target_throttle_time_in_millis\" : 0\n },\n \"translog\" : {\n \"recovered\" : 0,\n \"total\" : 0,\n \"percent\" : \"100.0%\",\n \"total_on_start\" : 0,\n \"total_time\" : \"0s\",\n \"total_time_in_millis\" : 0\n },\n \"verify_index\" : {\n \"check_index_time\" : \"0s\",\n \"check_index_time_in_millis\" : 0,\n \"total_time\" : \"0s\",\n \"total_time_in_millis\" : 0\n }\n } ]\n }\n}" indicesRecoveryResponseExample2: summary: Get detailed recovery information description: "A successful response from `GET _recovery?human&detailed=true`. The response includes a listing of any physical files recovered and their sizes. The response also includes timings in milliseconds of the various stages of recovery: index retrieval, translog replay, and index start time. This response indicates the recovery is done.\n" value: "{\n \"index1\" : {\n \"shards\" : [ {\n \"id\" : 0,\n \"type\" : \"EXISTING_STORE\",\n \"stage\" : \"DONE\",\n \"primary\" : true,\n \"start_time\" : \"2014-02-24T12:38:06.349\",\n \"start_time_in_millis\" : \"1393245486349\",\n \"stop_time\" : \"2014-02-24T12:38:08.464\",\n \"stop_time_in_millis\" : \"1393245488464\",\n \"total_time\" : \"2.1s\",\n \"total_time_in_millis\" : 2115,\n \"source\" : {\n \"id\" : \"RGMdRc-yQWWKIBM4DGvwqQ\",\n \"host\" : \"my.fqdn\",\n \"transport_address\" : \"my.fqdn\",\n \"ip\" : \"10.0.1.7\",\n \"name\" : \"my_es_node\"\n },\n \"target\" : {\n \"id\" : \"RGMdRc-yQWWKIBM4DGvwqQ\",\n \"host\" : \"my.fqdn\",\n \"transport_address\" : \"my.fqdn\",\n \"ip\" : \"10.0.1.7\",\n \"name\" : \"my_es_node\"\n },\n \"index\" : {\n \"size\" : {\n \"total\" : \"24.7mb\",\n \"total_in_bytes\" : 26001617,\n \"reused\" : \"24.7mb\",\n \"reused_in_bytes\" : 26001617,\n \"recovered\" : \"0b\",\n \"recovered_in_bytes\" : 0,\n \"recovered_from_snapshot\" : \"0b\",\n \"recovered_from_snapshot_in_bytes\" : 0,\n \"percent\" : \"100.0%\"\n },\n \"files\" : {\n \"total\" : 26,\n \"reused\" : 26,\n \"recovered\" : 0,\n \"percent\" : \"100.0%\",\n \"details\" : [ {\n \"name\" : \"segments.gen\",\n \"length\" : 20,\n \"recovered\" : 20\n }, {\n \"name\" : \"_0.cfs\",\n \"length\" : 135306,\n \"recovered\" : 135306,\n \"recovered_from_snapshot\": 0\n }, {\n \"name\" : \"segments_2\",\n \"length\" : 251,\n \"recovered\" : 251,\n \"recovered_from_snapshot\": 0\n }\n ]\n },\n \"total_time\" : \"2ms\",\n \"total_time_in_millis\" : 2,\n \"source_throttle_time\" : \"0s\",\n \"source_throttle_time_in_millis\" : 0,\n \"target_throttle_time\" : \"0s\",\n \"target_throttle_time_in_millis\" : 0\n },\n \"translog\" : {\n \"recovered\" : 71,\n \"total\" : 0,\n \"percent\" : \"100.0%\",\n \"total_on_start\" : 0,\n \"total_time\" : \"2.0s\",\n \"total_time_in_millis\" : 2025\n },\n \"verify_index\" : {\n \"check_index_time\" : 0,\n \"check_index_time_in_millis\" : 0,\n \"total_time\" : \"88ms\",\n \"total_time_in_millis\" : 88\n }\n } ]\n }\n}" indices.refresh-200: description: '' content: application/json: schema: $ref: '#/components/schemas/_types.ShardsOperationResponseBase' indices.reload_search_analyzers-200: description: '' content: application/json: schema: $ref: '#/components/schemas/indices.reload_search_analyzers.ReloadResult' examples: ReloadSearchAnalyzersResponseExample1: description: A successful response when reloading a search analyzer of an index. value: "{\n \"template\": {\n \"settings\": {\n \"number_of_shards\": 1\n },\n \"mappings\": {\n \"_source\": {\n \"enabled\": false\n },\n \"properties\": {\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n }\n }\n }\n}" indices.resolve_cluster-200: description: '' content: application/json: schema: type: object additionalProperties: $ref: '#/components/schemas/indices.resolve_cluster.ResolveClusterInfo' examples: ResolveClusterResponseExample1: summary: Resolve with wildcards description: "A successful response from `GET /_resolve/cluster/my-index*,clust*:my-index*`. Each cluster has its own response section. The cluster you sent the request to is labelled as \"(local)\".\n" value: "{\n \"(local)\": {\n \"connected\": true,\n \"skip_unavailable\": false,\n \"matching_indices\": true,\n \"version\": {\n \"number\": \"8.13.0\",\n \"build_flavor\": \"default\",\n \"minimum_wire_compatibility_version\": \"7.17.0\",\n \"minimum_index_compatibility_version\": \"7.0.0\"\n }\n },\n \"cluster_one\": {\n \"connected\": true,\n \"skip_unavailable\": true,\n \"matching_indices\": true,\n \"version\": {\n \"number\": \"8.13.0\",\n \"build_flavor\": \"default\",\n \"minimum_wire_compatibility_version\": \"7.17.0\",\n \"minimum_index_compatibility_version\": \"7.0.0\"\n }\n },\n \"cluster_two\": {\n \"connected\": true,\n \"skip_unavailable\": false,\n \"matching_indices\": true,\n \"version\": {\n \"number\": \"8.13.0\",\n \"build_flavor\": \"default\",\n \"minimum_wire_compatibility_version\": \"7.17.0\",\n \"minimum_index_compatibility_version\": \"7.0.0\"\n }\n }\n}" ResolveClusterResponseExample2: summary: Identify search problems description: "A successful response from `GET /_resolve/cluster/not-present,clust*:my-index*,oldcluster:*?ignore_unavailable=false&timeout=5s`. This type of request can be used to identify potential problems with your cross-cluster search. Note also that a `timeout` of 5 seconds is sent, which sets the maximum time the query will wait for remote clusters to respond. The local cluster has no index called `not_present`. Searching with `ignore_unavailable=false` would return a \"no such index\" error. The `cluster_one` remote cluster has no indices that match the pattern `my-index*`. There may be no indices that match the pattern or the index could be closed. The `cluster_two` remote cluster is not connected (the attempt to connect failed). Since this cluster is marked as `skip_unavailable=false`, you should probably exclude this cluster from the search by adding `-cluster_two:*` to the search index expression. For `cluster_three`, the error message indicates that this remote cluster did not respond within the 5-second timeout window specified, so it is also marked as not connected. The `oldcluster` remote cluster shows that it has matching indices, but no version information is included. This indicates that the cluster version predates the introduction of the `_resolve/cluster` API, so you may want to exclude it from your cross-cluster search.\n" value: "{\n \"(local)\": {\n \"connected\": true,\n \"skip_unavailable\": false,\n \"error\": \"no such index [not_present]\"\n },\n \"cluster_one\": {\n \"connected\": true,\n \"skip_unavailable\": true,\n \"matching_indices\": false,\n \"version\": {\n \"number\": \"8.13.0\",\n \"build_flavor\": \"default\",\n \"minimum_wire_compatibility_version\": \"7.17.0\",\n \"minimum_index_compatibility_version\": \"7.0.0\"\n }\n },\n \"cluster_two\": {\n \"connected\": false,\n \"skip_unavailable\": false\n },\n \"cluster_three\": {\n \"connected\": false,\n \"skip_unavailable\": false,\n \"error\": \"Request timed out before receiving a response from the remote cluster\"\n },\n \"oldcluster\": {\n \"connected\": true,\n \"skip_unavailable\": false,\n \"matching_indices\": true\n }\n}" indices.resolve_index-200: description: '' content: application/json: schema: required: - indices - aliases - data_streams type: object properties: indices: type: array items: $ref: '#/components/schemas/indices.resolve_index.ResolveIndexItem' aliases: type: array items: $ref: '#/components/schemas/indices.resolve_index.ResolveIndexAliasItem' data_streams: type: array items: $ref: '#/components/schemas/indices.resolve_index.ResolveIndexDataStreamsItem' examples: ResolveIndexResponseExample1: description: 'A successful response from `GET /_resolve/index/f*,remoteCluster1:bar*?expand_wildcards=all`.' value: "{\n \"indices\": [\n {\n \"name\": \"foo_closed\",\n \"attributes\": [\n \"closed\"\n ],\n \"mode\": \"standard\"\n },\n {\n \"name\": \"freeze-index\",\n \"aliases\": [\n \"f-alias\"\n ],\n \"attributes\": [\n \"open\"\n ]\n },\n {\n \"name\": \"remoteCluster1:bar-01\",\n \"attributes\": [\n \"open\"\n ]\n }\n ],\n \"aliases\": [\n {\n \"name\": \"f-alias\",\n \"indices\": [\n \"freeze-index\",\n \"my-index-000001\"\n ]\n }\n ],\n \"data_streams\": [\n {\n \"name\": \"foo\",\n \"backing_indices\": [\n \".ds-foo-2099.03.07-000001\"\n ],\n \"timestamp_field\": \"@timestamp\"\n }\n ]\n}" indices.rollover-200: description: '' content: application/json: schema: required: - acknowledged - conditions - dry_run - new_index - old_index - rolled_over - shards_acknowledged type: object properties: acknowledged: type: boolean conditions: type: object additionalProperties: type: boolean dry_run: type: boolean new_index: type: string old_index: type: string rolled_over: type: boolean shards_acknowledged: type: boolean examples: indicesRolloverResponseExample1: description: "An abbreviated response from `GET /_segments`.\n" value: "{\n \"_shards\": {},\n \"indices\": {\n \"test\": {\n \"shards\": {\n \"0\": [\n {\n \"routing\": {\n \"state\": \"STARTED\",\n \"primary\": true,\n \"node\": \"zDC_RorJQCao9xf9pg3Fvw\"\n },\n \"num_committed_segments\": 0,\n \"num_search_segments\": 1,\n \"segments\": {\n \"_0\": {\n \"generation\": 0,\n \"num_docs\": 1,\n \"deleted_docs\": 0,\n \"size_in_bytes\": 3800,\n \"committed\": false,\n \"search\": true,\n \"version\": \"7.0.0\",\n \"compound\": true,\n \"attributes\": {}\n }\n }\n }\n ]\n }\n }\n }\n}" indices.segments-200: description: '' content: application/json: schema: required: - indices - _shards type: object properties: indices: type: object additionalProperties: $ref: '#/components/schemas/indices.segments.IndexSegment' _shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' examples: indicesSegmentsResponseExample1: description: A response describing information about index segments. value: "{\n \"_shards\": {\n \"total\": 2,\n \"successful\": 2,\n \"failed\": 0\n },\n \"indices\": {\n \"kibana_sample_data_ecommerce\": {\n \"shards\": {\n \"0\": [\n {\n \"routing\": {\n \"state\": \"STARTED\",\n \"primary\": false,\n \"node\": \"zZg9NuPhQPKO3LMRkMo2iw\"\n },\n \"num_committed_segments\": 4,\n \"num_search_segments\": 4,\n \"segments\": {\n \"_0\": {\n \"generation\": 0,\n \"num_docs\": 500,\n \"deleted_docs\": 0,\n \"size_in_bytes\": 524718,\n \"committed\": true,\n \"search\": true,\n \"version\": \"10.3.1\",\n \"compound\": true,\n \"attributes\": {\n \"Lucene90StoredFieldsFormat.mode\": \"BEST_SPEED\"\n }\n },\n \"_1\": {\n \"generation\": 1,\n \"num_docs\": 500,\n \"deleted_docs\": 0,\n \"size_in_bytes\": 526100,\n \"committed\": true,\n \"search\": true,\n \"version\": \"10.3.1\",\n \"compound\": true,\n \"attributes\": {\n \"Lucene90StoredFieldsFormat.mode\": \"BEST_SPEED\"\n }\n },\n \"_2\": {\n \"generation\": 2,\n \"num_docs\": 2000,\n \"deleted_docs\": 0,\n \"size_in_bytes\": 1846181,\n \"committed\": true,\n \"search\": true,\n \"version\": \"10.3.1\",\n \"compound\": true,\n \"attributes\": {\n \"Lucene90StoredFieldsFormat.mode\": \"BEST_SPEED\"\n }\n },\n \"_3\": {\n \"generation\": 3,\n \"num_docs\": 1675,\n \"deleted_docs\": 0,\n \"size_in_bytes\": 1572960,\n \"committed\": true,\n \"search\": true,\n \"version\": \"10.3.1\",\n \"compound\": true,\n \"attributes\": {\n \"Lucene90StoredFieldsFormat.mode\": \"BEST_SPEED\"\n }\n }\n }\n },\n {\n \"routing\": {\n \"state\": \"STARTED\",\n \"primary\": true,\n \"node\": \"sp27SQiNTQWKpBKoRcnfQQ\"\n },\n \"num_committed_segments\": 5,\n \"num_search_segments\": 5,\n \"segments\": {\n \"_0\": {\n \"generation\": 0,\n \"num_docs\": 187,\n \"deleted_docs\": 0,\n \"size_in_bytes\": 227245,\n \"committed\": true,\n \"search\": true,\n \"version\": \"10.3.1\",\n \"compound\": true,\n \"attributes\": {\n \"Lucene90StoredFieldsFormat.mode\": \"BEST_SPEED\"\n }\n },\n \"_1\": {\n \"generation\": 1,\n \"num_docs\": 253,\n \"deleted_docs\": 0,\n \"size_in_bytes\": 297549,\n \"committed\": true,\n \"search\": true,\n \"version\": \"10.3.1\",\n \"compound\": true,\n \"attributes\": {\n \"Lucene90StoredFieldsFormat.mode\": \"BEST_SPEED\"\n }\n },\n \"_2\": {\n \"generation\": 2,\n \"num_docs\": 560,\n \"deleted_docs\": 0,\n \"size_in_bytes\": 580918,\n \"committed\": true,\n \"search\": true,\n \"version\": \"10.3.1\",\n \"compound\": true,\n \"attributes\": {\n \"Lucene90StoredFieldsFormat.mode\": \"BEST_SPEED\"\n }\n },\n \"_3\": {\n \"generation\": 3,\n \"num_docs\": 1603,\n \"deleted_docs\": 0,\n \"size_in_bytes\": 1506385,\n \"committed\": true,\n \"search\": true,\n \"version\": \"10.3.1\",\n \"compound\": true,\n \"attributes\": {\n \"Lucene90StoredFieldsFormat.mode\": \"BEST_SPEED\"\n }\n },\n \"_4\": {\n \"generation\": 4,\n \"num_docs\": 2072,\n \"deleted_docs\": 0,\n \"size_in_bytes\": 1913051,\n \"committed\": true,\n \"search\": true,\n \"version\": \"10.3.1\",\n \"compound\": true,\n \"attributes\": {\n \"Lucene90StoredFieldsFormat.mode\": \"BEST_SPEED\"\n }\n }\n }\n }\n ]\n }\n }\n }\n}" indices.shard_stores-200: description: '' content: application/json: schema: required: - indices type: object properties: indices: type: object additionalProperties: $ref: '#/components/schemas/indices.shard_stores.IndicesShardStores' examples: indicesShardStoresResponseExample1: description: "An abbreviated response from `GET /_shard_stores?status=green`.\n" value: "{\n \"indices\": {\n \"my-index-000001\": {\n \"shards\": {\n \"0\": {\n \"stores\": [\n {\n \"sPa3OgxLSYGvQ4oPs-Tajw\": {\n \"name\": \"node_t0\",\n \"ephemeral_id\": \"9NlXRFGCT1m8tkvYCMK-8A\",\n \"transport_address\": \"local[1]\",\n \"external_id\": \"node_t0\",\n \"attributes\": {},\n \"roles\": [],\n \"version\": \"8.10.0\",\n \"min_index_version\": 7000099,\n \"max_index_version\": 8100099\n },\n \"allocation_id\": \"2iNySv_OQVePRX-yaRH_lQ\",\n \"allocation\": \"primary\",\n \"store_exception\": {}\n }\n ]\n }\n }\n }\n }\n}" indices.shrink-200: description: '' content: application/json: schema: required: - acknowledged - shards_acknowledged - index type: object properties: acknowledged: type: boolean shards_acknowledged: type: boolean index: allOf: - $ref: '#/components/schemas/_types.IndexName' indices.simulate_template-200: description: '' content: application/json: schema: required: - template type: object properties: overlapping: type: array items: $ref: '#/components/schemas/indices.simulate_template.Overlapping' template: allOf: - $ref: '#/components/schemas/indices.simulate_template.Template' examples: indicesSimulateTemplateResponseExample2: description: "A successful response from `POST /_index_template/_simulate` with a template configuration in the request body. The response shows any overlapping templates with a lower priority.\n" value: "{\n \"template\" : {\n \"settings\" : {\n \"index\" : {\n \"number_of_replicas\" : \"1\",\n \"routing\" : {\n \"allocation\" : {\n \"include\" : {\n \"_tier_preference\" : \"data_content\"\n }\n }\n }\n }\n },\n \"mappings\" : {\n \"properties\" : {\n \"@timestamp\" : {\n \"type\" : \"date\"\n }\n }\n },\n \"aliases\" : { }\n },\n \"overlapping\" : [\n {\n \"name\" : \"final-template\",\n \"index_patterns\" : [\n \"my-index-*\"\n ]\n }\n ]\n}" indices.split-200: description: '' content: application/json: schema: required: - acknowledged - shards_acknowledged - index type: object properties: acknowledged: type: boolean shards_acknowledged: type: boolean index: allOf: - $ref: '#/components/schemas/_types.IndexName' indices.stats-200: description: '' content: application/json: schema: required: - _shards - _all type: object properties: indices: type: object additionalProperties: $ref: '#/components/schemas/indices.stats.IndicesStats' _shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' _all: allOf: - $ref: '#/components/schemas/indices.stats.IndicesStats' indices.validate_query-200: description: '' content: application/json: schema: required: - valid type: object properties: explanations: type: array items: $ref: '#/components/schemas/indices.validate_query.IndicesValidationExplanation' _shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' valid: type: boolean error: type: string inference.delete-200: description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.DeleteInferenceEndpointResult' inference.get-200: description: '' content: application/json: schema: required: - endpoints type: object properties: endpoints: type: array items: $ref: '#/components/schemas/inference._types.InferenceEndpointInfo' inference.inference-200: description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceResult' inference.put-200: description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfo' inference.update-200: description: '' content: application/json: schema: $ref: '#/components/schemas/inference._types.InferenceEndpointInfo' ingest.get_geoip_database-200: description: '' content: application/json: schema: required: - databases type: object properties: databases: type: array items: $ref: '#/components/schemas/ingest.get_geoip_database.DatabaseConfigurationMetadata' ingest.get_ip_location_database-200: description: '' content: application/json: schema: required: - databases type: object properties: databases: type: array items: $ref: '#/components/schemas/ingest.get_ip_location_database.DatabaseConfigurationMetadata' ingest.get_pipeline-200: description: '' content: application/json: schema: type: object additionalProperties: $ref: '#/components/schemas/ingest._types.Pipeline' examples: GetPipelineResponseExample1: description: A successful response for retrieving information about an ingest pipeline. value: "{\n \"my-pipeline-id\" : {\n \"description\" : \"describe pipeline\",\n \"version\" : 123,\n \"processors\" : [\n {\n \"set\" : {\n \"field\" : \"foo\",\n \"value\" : \"bar\"\n }\n }\n ],\n \"created_date\" : \"2024-01-01T12:00:00.000Z\",\n \"created_date_millis\" : 1704110400000,\n \"modified_date\" : \"2025-01-01T12:00:00.000Z\",\n \"modified_date_millis\" : 1735732800000\n }\n}" ingest.simulate-200: description: '' content: application/json: schema: required: - docs type: object properties: docs: type: array items: $ref: '#/components/schemas/ingest._types.SimulateDocumentResult' examples: SimulatePipelineResponseExample1: description: A successful response for running an ingest pipeline against a set of provided documents. value: "{\n \"docs\": [\n {\n \"doc\": {\n \"_id\": \"id\",\n \"_index\": \"index\",\n \"_version\": \"-3\",\n \"_source\": {\n \"field2\": \"_value\",\n \"foo\": \"bar\"\n },\n \"_ingest\": {\n \"timestamp\": \"2017-05-04T22:30:03.187Z\"\n }\n }\n },\n {\n \"doc\": {\n \"_id\": \"id\",\n \"_index\": \"index\",\n \"_version\": \"-3\",\n \"_source\": {\n \"field2\": \"_value\",\n \"foo\": \"rab\"\n },\n \"_ingest\": {\n \"timestamp\": \"2017-05-04T22:30:03.188Z\"\n }\n }\n }\n ]\n}" knn_eval-200: description: '' content: application/json: schema: type: object properties: query_source: allOf: - $ref: '#/components/schemas/_global.knn_eval.KnnEvalQuerySourceSummary' description: "The source of the query vectors.\nNot returned when `wait_for_completion` is `false`." baseline: allOf: - $ref: '#/components/schemas/_global.knn_eval.KnnEvalReportedSettings' description: "The settings of the baseline search.\nNot returned when `wait_for_completion` is `false`." baseline_took_ms: allOf: - $ref: '#/components/schemas/_types.DurationValueUnitMillis' description: "The time the baseline searches took, in milliseconds.\nNot returned when `wait_for_completion` is `false`." baseline_vector_ops: type: number description: "The number of vector operations of the baseline searches.\nNot returned when `wait_for_completion` is `false`." baseline_vector_ops_kind: allOf: - $ref: '#/components/schemas/_global.knn_eval.KnnEvalVectorOpsKind' description: "What `baseline_vector_ops` counts.\nNot returned when `wait_for_completion` is `false`.\n\nSupported values include:\n - `full_precision_scan`: Full-precision comparisons across all the matching vectors.\n - `quantized_visit_plus_rescore`: Quantized visits plus full-precision rescoring.\n\n" results: type: array items: $ref: '#/components/schemas/_global.knn_eval.KnnEvalResult' description: "The results of each `knn_settings` entry, in the order of the request.\nNot returned when `wait_for_completion` is `false`." failures: type: object additionalProperties: $ref: '#/components/schemas/_global.knn_eval.KnnEvalFailure' description: "The queries that failed, by query identifier.\nNot returned when `wait_for_completion` is `false`." task: allOf: - $ref: '#/components/schemas/_types.TaskId' description: "The identifier of the task that runs the evaluation.\nOnly returned when `wait_for_completion` is `false`." examples: KnnEvalResponseExample1: summary: Evaluate kNN search settings description: "A response from `POST my-index/_knn_eval`, with the recall of each `knn_settings` entry against the default baseline.\n" value: "{\n \"query_source\": {\n \"from\": \"docs\"\n },\n \"baseline\": {\n \"visit_percentage\": 20.0,\n \"rescore_vector\": {\n \"oversample\": 100.0\n }\n },\n \"baseline_took_ms\": 412,\n \"baseline_vector_ops\": 2048000,\n \"baseline_vector_ops_kind\": \"quantized_visit_plus_rescore\",\n \"results\": [\n {\n \"knn_settings\": {\n \"visit_percentage\": 1.0\n },\n \"recall\": 0.87,\n \"included_queries\": 100,\n \"excluded_queries\": 0,\n \"took_ms\": 35,\n \"vector_ops\": 102400\n },\n {\n \"knn_settings\": {\n \"visit_percentage\": 5.0\n },\n \"recall\": 0.97,\n \"included_queries\": 99,\n \"excluded_queries\": 1,\n \"took_ms\": 96,\n \"vector_ops\": 512000\n }\n ],\n \"failures\": {}\n}" license.post-200: description: '' content: application/json: schema: required: - acknowledged - license_status type: object properties: acknowledge: allOf: - $ref: '#/components/schemas/license.post.Acknowledgement' acknowledged: type: boolean license_status: allOf: - $ref: '#/components/schemas/license._types.LicenseStatus' examples: PostLicenseResponseExample1: description: 'If you update to a basic license and you previously had a license with more features, you receive this type of response. You must re-submit the API request and set the `acknowledge` parameter to `true`.' value: "{\n \"acknowledged\": false,\n \"license_status\": \"valid\",\n \"acknowledge\": {\n \"message\": \"\\\"\\\"\\\"This license update requires acknowledgement. To acknowledge the license, please read the following messages and update the license again, this time with the \\\"acknowledge=true\\\" parameter:\\\"\\\"\\\"\",\n \"watcher\": [\n \"Watcher will be disabled\"\n ],\n \"logstash\": [\n \"Logstash will no longer poll for centrally-managed pipelines\"\n ],\n \"security\": [\n \"The following X-Pack security functionality will be disabled ...\"\n ]\n }\n}" logstash.get_pipeline-200: description: '' content: application/json: schema: type: object additionalProperties: $ref: '#/components/schemas/logstash._types.Pipeline' examples: LogstashGetPipelineResponseExample1: description: "A successful response from `GET _logstash/pipeline/my_pipeline`.\n" value: "{\n \"my_pipeline\": {\n \"description\": \"Sample pipeline for illustration purposes\",\n \"last_modified\": \"2021-01-02T02:50:51.250Z\",\n \"pipeline_metadata\": {\n \"type\": \"logstash_pipeline\",\n \"version\": \"1\"\n },\n \"username\": \"elastic\",\n \"pipeline\": \"input {}\\\\n filter { grok {} }\\\\n output {}\",\n \"pipeline_settings\": {\n \"pipeline.workers\": 1,\n \"pipeline.batch.size\": 125,\n \"pipeline.batch.delay\": 50,\n \"queue.type\": \"memory\",\n \"queue.max_bytes\": \"1gb\",\n \"queue.checkpoint.writes\": 1024\n }\n }\n}" mget-200: description: '' content: application/json: schema: required: - docs type: object properties: docs: type: array items: $ref: '#/components/schemas/_global.mget.ResponseItem' description: "The response includes a docs array that contains the documents in the order specified in the request.\nThe structure of the returned documents is similar to that returned by the get API.\nIf there is a failure getting a particular document, the error is included in place of the document." migration.deprecations-200: description: '' content: application/json: schema: required: - cluster_settings - index_settings - data_streams - node_settings - ml_settings - templates - ilm_policies - repositories type: object properties: cluster_settings: type: array items: $ref: '#/components/schemas/migration.deprecations.Deprecation' description: Cluster-level deprecation warnings. index_settings: type: object additionalProperties: type: array items: $ref: '#/components/schemas/migration.deprecations.Deprecation' description: "Index warnings are sectioned off per index and can be filtered using an index-pattern in the query.\nThis section includes warnings for the backing indices of data streams specified in the request path." data_streams: type: object additionalProperties: type: array items: $ref: '#/components/schemas/migration.deprecations.Deprecation' node_settings: type: array items: $ref: '#/components/schemas/migration.deprecations.Deprecation' description: "Node-level deprecation warnings.\nSince only a subset of your nodes might incorporate these settings, it is important to read the details section for more information about which nodes are affected." ml_settings: type: array items: $ref: '#/components/schemas/migration.deprecations.Deprecation' description: Machine learning-related deprecation warnings. templates: type: object additionalProperties: type: array items: $ref: '#/components/schemas/migration.deprecations.Deprecation' description: "Template warnings are sectioned off per template and include deprecations for both component templates and\nindex templates." ilm_policies: type: object additionalProperties: type: array items: $ref: '#/components/schemas/migration.deprecations.Deprecation' description: ILM policy warnings are sectioned off per policy. repositories: type: object additionalProperties: type: array items: $ref: '#/components/schemas/migration.deprecations.Deprecation' description: Snapshot repository warnings are sectioned off per repository. x-state: Generally available; Added in 9.6.0 examples: DeprecationInfoResponseExample1: description: "An abbreviated response from `GET /_migration/deprecations`.\n" value: "{\n \"cluster_settings\": [\n {\n \"level\": \"critical\",\n \"message\": \"Cluster name cannot contain ':'\",\n \"url\": \"https://www.elastic.co/guide/en/elasticsearch/reference/7.0/breaking-changes-7.0.html#_literal_literal_is_no_longer_allowed_in_cluster_name\",\n \"details\": \"This cluster is named [mycompany:logging], which contains the illegal character ':'.\"\n }\n ],\n \"node_settings\": [],\n \"index_settings\": {\n \"logs:apache\": [\n {\n \"level\": \"warning\",\n \"message\": \"Index name cannot contain ':'\",\n \"url\": \"https://www.elastic.co/guide/en/elasticsearch/reference/7.0/breaking-changes-7.0.html#_literal_literal_is_no_longer_allowed_in_index_name\",\n \"details\": \"This index is named [logs:apache], which contains the illegal character ':'.\"\n }\n ]\n },\n \"ml_settings\": []\n}" ml.delete_expired_data-200: description: '' content: application/json: schema: required: - deleted type: object properties: deleted: type: boolean examples: MlDeleteExpiredDataResponseExample1: description: A successful response when deleting expired and unused anomaly detection data. value: "{\n \"deleted\": true\n}" ml.delete_forecast-200: description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: MlDeleteForecastResponseExample1: description: A successful response when deleting a forecast from an anomaly detection job. value: "{\n \"acknowledged\": true\n}" ml.explain_data_frame_analytics-200: description: '' content: application/json: schema: required: - field_selection - memory_estimation type: object properties: field_selection: type: array items: $ref: '#/components/schemas/ml._types.DataframeAnalyticsFieldSelection' description: 'An array of objects that explain selection for each field, sorted by the field names.' memory_estimation: allOf: - $ref: '#/components/schemas/ml._types.DataframeAnalyticsMemoryEstimation' description: 'An array of objects that explain selection for each field, sorted by the field names.' examples: MlExplainDataFrameAnalyticsResponseExample1: description: A succesful response for explaining a data frame analytics job configuration. value: "{\n \"field_selection\": [\n {\n \"field\": \"number_of_bedrooms\",\n \"mappings_types\": [\n \"integer\"\n ],\n \"is_included\": true,\n \"is_required\": false,\n \"feature_type\": \"numerical\"\n },\n {\n \"field\": \"postcode\",\n \"mappings_types\": [\n \"text\"\n ],\n \"is_included\": false,\n \"is_required\": false,\n \"reason\": \"[postcode.keyword] is preferred because it is aggregatable\"\n },\n {\n \"field\": \"postcode.keyword\",\n \"mappings_types\": [\n \"keyword\"\n ],\n \"is_included\": true,\n \"is_required\": false,\n \"feature_type\": \"categorical\"\n },\n {\n \"field\": \"price\",\n \"mappings_types\": [\n \"float\"\n ],\n \"is_included\": true,\n \"is_required\": true,\n \"feature_type\": \"numerical\"\n }\n ],\n \"memory_estimation\": {\n \"expected_memory_without_disk\": \"128MB\",\n \"expected_memory_with_disk\": \"32MB\"\n }\n}" ml.get_buckets-200: description: '' content: application/json: schema: required: - buckets - count type: object properties: buckets: type: array items: $ref: '#/components/schemas/ml._types.BucketSummary' count: type: number ml.get_calendars-200: description: '' content: application/json: schema: required: - calendars - count type: object properties: calendars: type: array items: $ref: '#/components/schemas/ml.get_calendars.Calendar' count: type: number ml.get_categories-200: description: '' content: application/json: schema: required: - categories - count type: object properties: categories: type: array items: $ref: '#/components/schemas/ml._types.Category' count: type: number ml.get_data_frame_analytics-200: description: '' content: application/json: schema: required: - count - data_frame_analytics type: object properties: count: type: number data_frame_analytics: type: array items: $ref: '#/components/schemas/ml._types.DataframeAnalyticsSummary' description: 'An array of data frame analytics job resources, which are sorted by the id value in ascending order.' ml.get_data_frame_analytics_stats-200: description: '' content: application/json: schema: required: - count - data_frame_analytics type: object properties: count: type: number data_frame_analytics: type: array items: $ref: '#/components/schemas/ml._types.DataframeAnalytics' description: 'An array of objects that contain usage information for data frame analytics jobs, which are sorted by the id value in ascending order.' ml.get_datafeed_stats-200: description: '' content: application/json: schema: required: - count - datafeeds type: object properties: count: type: number datafeeds: type: array items: $ref: '#/components/schemas/ml._types.DatafeedStats' ml.get_datafeeds-200: description: '' content: application/json: schema: required: - count - datafeeds type: object properties: count: type: number datafeeds: type: array items: $ref: '#/components/schemas/ml._types.Datafeed' ml.get_filters-200: description: '' content: application/json: schema: required: - count - filters type: object properties: count: type: number filters: type: array items: $ref: '#/components/schemas/ml._types.Filter' ml.get_influencers-200: description: '' content: application/json: schema: required: - count - influencers type: object properties: count: type: number influencers: type: array items: $ref: '#/components/schemas/ml._types.Influencer' description: Array of influencer objects ml.get_job_stats-200: description: '' content: application/json: schema: required: - count - jobs type: object properties: count: type: number jobs: type: array items: $ref: '#/components/schemas/ml._types.JobStats' ml.get_jobs-200: description: '' content: application/json: schema: required: - count - jobs type: object properties: count: type: number jobs: type: array items: $ref: '#/components/schemas/ml._types.Job' ml.get_memory_stats-200: description: '' content: application/json: schema: required: - _nodes - cluster_name - nodes type: object properties: _nodes: allOf: - $ref: '#/components/schemas/_types.NodeStatistics' cluster_name: allOf: - $ref: '#/components/schemas/_types.Name' nodes: type: object additionalProperties: $ref: '#/components/schemas/ml.get_memory_stats.Memory' ml.get_model_snapshots-200: description: '' content: application/json: schema: required: - count - model_snapshots type: object properties: count: type: number model_snapshots: type: array items: $ref: '#/components/schemas/ml._types.ModelSnapshot' ml.get_overall_buckets-200: description: '' content: application/json: schema: required: - count - overall_buckets type: object properties: count: type: number overall_buckets: type: array items: $ref: '#/components/schemas/ml._types.OverallBucket' description: Array of overall bucket objects ml.get_records-200: description: '' content: application/json: schema: required: - count - records type: object properties: count: type: number records: type: array items: $ref: '#/components/schemas/ml._types.Anomaly' ml.get_trained_models-200: description: '' content: application/json: schema: required: - count - trained_model_configs type: object properties: count: type: number trained_model_configs: type: array items: $ref: '#/components/schemas/ml._types.TrainedModelConfig' description: 'An array of trained model resources, which are sorted by the model_id value in ascending order.' ml.get_trained_models_stats-200: description: '' content: application/json: schema: required: - count - trained_model_stats type: object properties: count: type: number description: The total number of trained model statistics that matched the requested ID patterns. Could be higher than the number of items in the trained_model_stats array as the size of the array is restricted by the supplied size parameter. trained_model_stats: type: array items: $ref: '#/components/schemas/ml._types.TrainedModelStats' description: 'An array of trained model statistics, which are sorted by the model_id value in ascending order.' ml.preview_data_frame_analytics-200: description: '' content: application/json: schema: required: - feature_values type: object properties: feature_values: type: array items: type: object additionalProperties: type: string description: An array of objects that contain feature name and value pairs. The features have been processed and indicate what will be sent to the model for training. ml.preview_datafeed-200: description: '' content: application/json: schema: type: array items: type: object msearch-200: description: '' content: application/json: schema: $ref: '#/components/schemas/_global.msearch.MultiSearchResult' msearch_template-200: description: '' content: application/json: schema: $ref: '#/components/schemas/_global.msearch.MultiSearchResult' mtermvectors-200: description: '' content: application/json: schema: required: - docs type: object properties: docs: type: array items: $ref: '#/components/schemas/_global.mtermvectors.TermVectorsResult' nodes.hot_threads-200: description: '' content: application/json: schema: type: object nodes.info-200: description: '' content: application/json: schema: $ref: '#/components/schemas/nodes.info.ResponseBase' examples: nodesInfoResponseExample1: description: An abbreviated response when requesting cluster nodes information. value: "{\n \"_nodes\": {},\n \"cluster_name\": \"elasticsearch\",\n \"nodes\": {\n \"USpTGYaBSIKbgSUJR2Z9lg\": {\n \"name\": \"node-0\",\n \"transport_address\": \"192.168.17:9300\",\n \"host\": \"node-0.elastic.co\",\n \"ip\": \"192.168.17\",\n \"version\": \"{version}\",\n \"transport_version\": 100000298,\n \"index_version\": 100000074,\n \"component_versions\": {\n \"ml_config_version\": 100000162,\n \"transform_config_version\": 100000096\n },\n \"build_flavor\": \"default\",\n \"build_type\": \"{build_type}\",\n \"build_hash\": \"587409e\",\n \"roles\": [\n \"master\",\n \"data\",\n \"ingest\"\n ],\n \"attributes\": {},\n \"plugins\": [\n {\n \"name\": \"analysis-icu\",\n \"version\": \"{version}\",\n \"description\": \"The ICU Analysis plugin integrates Lucene ICU\n module into elasticsearch, adding ICU relates analysis components.\",\n \"classname\":\n \"org.elasticsearch.plugin.analysis.icu.AnalysisICUPlugin\",\n \"has_native_controller\": false\n }\n ],\n \"modules\": [\n {\n \"name\": \"lang-painless\",\n \"version\": \"{version}\",\n \"description\": \"An easy, safe and fast scripting language for\n Elasticsearch\",\n \"classname\": \"org.elasticsearch.painless.PainlessPlugin\",\n \"has_native_controller\": false\n }\n ]\n }\n }\n}" nodes.reload_secure_settings-200: description: '' content: application/json: schema: $ref: '#/components/schemas/nodes.reload_secure_settings.ResponseBase' examples: ReloadSecureSettingsResponseExample1: description: A successful response when reloading keystore on nodes in your cluster. value: "{\n \"_nodes\": {\n \"total\": 1,\n \"successful\": 1,\n \"failed\": 0\n },\n \"cluster_name\": \"my_cluster\",\n \"nodes\": {\n \"pQHNt5rXTTWNvUgOrdynKg\": {\n \"name\": \"node-0\",\n \"secure_setting_names\": [\n \"keystore.seed\",\n \"xpack.security.transport.ssl.keystore.secure_password\",\n \"xpack.security.transport.ssl.truststore.secure_password\"\n ],\n \"keystore_path\": \"/etc/elasticsearch/elasticsearch.keystore\",\n \"keystore_digest\": \"031757c262a50abe1b7e017230cdbab99c1be9fbd7116ff504b27a8787158f46\",\n \"keystore_last_modified_time\": \"2025-12-09T22:06:00.408Z\"\n }\n }\n}" nodes.stats-200: description: '' content: application/json: schema: $ref: '#/components/schemas/nodes.stats.ResponseBase' nodes.usage-200: description: '' content: application/json: schema: $ref: '#/components/schemas/nodes.usage.ResponseBase' put_script-200: description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' rank_eval-200: description: '' content: application/json: schema: required: - metric_score - details - failures type: object properties: metric_score: type: number description: The overall evaluation quality calculated by the defined metric details: type: object additionalProperties: $ref: '#/components/schemas/_global.rank_eval.RankEvalMetricDetail' description: 'The details section contains one entry for every query in the original requests section, keyed by the search request id' failures: type: object additionalProperties: type: object render_search_template-200: description: '' content: application/json: schema: required: - template_output type: object properties: template_output: type: object additionalProperties: type: object rollup.get_jobs-200: description: '' content: application/json: schema: required: - jobs type: object properties: jobs: type: array items: $ref: '#/components/schemas/rollup.get_jobs.RollupJob' examples: GetRollupJobResponseExample1: description: A successful response from `GET _rollup/job/sensor`. value: "{\n \"jobs\": [\n {\n \"config\": {\n \"id\": \"sensor\",\n \"index_pattern\": \"sensor-*\",\n \"rollup_index\": \"sensor_rollup\",\n \"cron\": \"*/30 * * * * ?\",\n \"groups\": {\n \"date_histogram\": {\n \"fixed_interval\": \"1h\",\n \"delay\": \"7d\",\n \"field\": \"timestamp\",\n \"time_zone\": \"UTC\"\n },\n \"terms\": {\n \"fields\": [\n \"node\"\n ]\n }\n },\n \"metrics\": [\n {\n \"field\": \"temperature\",\n \"metrics\": [\n \"min\",\n \"max\",\n \"sum\"\n ]\n },\n {\n \"field\": \"voltage\",\n \"metrics\": [\n \"avg\"\n ]\n }\n ],\n \"timeout\": \"20s\",\n \"page_size\": 1000\n },\n \"status\": {\n \"job_state\": \"stopped\"\n },\n \"stats\": {\n \"pages_processed\": 0,\n \"documents_processed\": 0,\n \"rollups_indexed\": 0,\n \"trigger_count\": 0,\n \"index_failures\": 0,\n \"index_time_in_ms\": 0,\n \"index_total\": 0,\n \"search_failures\": 0,\n \"search_time_in_ms\": 0,\n \"search_total\": 0,\n \"processing_time_in_ms\": 0,\n \"processing_total\": 0\n }\n }\n ]\n}" rollup.get_rollup_caps-200: description: '' content: application/json: schema: type: object additionalProperties: $ref: '#/components/schemas/rollup.get_rollup_caps.RollupCapabilities' examples: GetRollupCapabilitiesResponseExample1: description: "A successful response from `GET _rollup/data/sensor-*` for a rollup job that targets the index pattern `sensor-*`. The response contains the rollup job ID, the index that holds the rolled data, and the index pattern that the job was targeting. It also shows a list of fields that contain data eligible for rollup searches. For example, you can use a `min`, `max`, or `sum` aggregation on the `temperature` field, but only a `date_histogram` on `timestamp`.\n" value: "{\n \"sensor-*\" : {\n \"rollup_jobs\" : [\n {\n \"job_id\" : \"sensor\",\n \"rollup_index\" : \"sensor_rollup\",\n \"index_pattern\" : \"sensor-*\",\n \"fields\" : {\n \"node\" : [\n {\n \"agg\" : \"terms\"\n }\n ],\n \"temperature\" : [\n {\n \"agg\" : \"min\"\n },\n {\n \"agg\" : \"max\"\n },\n {\n \"agg\" : \"sum\"\n }\n ],\n \"timestamp\" : [\n {\n \"agg\" : \"date_histogram\",\n \"time_zone\" : \"UTC\",\n \"fixed_interval\" : \"1h\",\n \"delay\": \"7d\"\n }\n ],\n \"voltage\" : [\n {\n \"agg\" : \"avg\"\n }\n ]\n }\n }\n ]\n }\n}" rollup.rollup_search-200: description: '' content: application/json: schema: required: - took - timed_out - _shards - hits type: object properties: took: type: number timed_out: type: boolean terminated_early: type: boolean _shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' hits: allOf: - $ref: '#/components/schemas/_global.search._types.HitsMetadata' aggregations: type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.Aggregate' examples: RollupSearchResponseExample1: description: "An abbreviated response from `GET /sensor_rollup/_rollup_search` with a `max` aggregation on a `temperature` field. The response provides some metadata about the request (`took`, `_shards`), the search hits (which is always empty for rollup searches), and the aggregation response.\n" value: "{\n \"took\" : 102,\n \"timed_out\" : false,\n \"terminated_early\" : false,\n \"_shards\" : {} ,\n \"hits\" : {\n \"total\" : {\n \"value\": 0,\n \"relation\": \"eq\"\n },\n \"max_score\" : 0.0,\n \"hits\" : [ ]\n },\n \"aggregations\" : {\n \"max_temperature\" : {\n \"value\" : 202.0\n }\n }\n}" scripts_painless_execute-200: description: '' content: application/json: schema: required: - result type: object properties: result: type: object examples: ExecutePainlessScriptResponseExample1: summary: Test context description: A successful response from `POST /_scripts/painless/_execute` with a `painless_test` context. value: "{\n \"result\": \"0.1\"\n}" ExecutePainlessScriptResponseExample2: summary: Filter context description: A successful response from `POST /_scripts/painless/_execute` with a `filter` context. value: "{\n \"result\": true\n}" ExecutePainlessScriptResponseExample3: summary: Score context description: A successful response from `POST /_scripts/painless/_execute` with a `score` context. value: "{\n \"result\": 0.8\n}" scroll-200: description: '' content: application/json: schema: $ref: '#/components/schemas/_global.search.ResponseBody' search-200: description: '' content: application/json: schema: $ref: '#/components/schemas/_global.search.ResponseBody' examples: SearchResponseExample1: description: "An abbreviated response from `GET /my-index-000001/_search?from=40&size=20` with a simple term query.\n" value: "{\n \"took\": 5,\n \"timed_out\": false,\n \"_shards\": {\n \"total\": 1,\n \"successful\": 1,\n \"skipped\": 0,\n \"failed\": 0\n },\n \"hits\": {\n \"total\": {\n \"value\": 20,\n \"relation\": \"eq\"\n },\n \"max_score\": 1.3862942,\n \"hits\": [\n {\n \"_index\": \"my-index-000001\",\n \"_id\": \"0\",\n \"_score\": 1.3862942,\n \"_source\": {\n \"@timestamp\": \"2099-11-15T14:12:12\",\n \"http\": {\n \"request\": {\n \"method\": \"get\"\n },\n \"response\": {\n \"status_code\": 200,\n \"bytes\": 1070000\n },\n \"version\": \"1.1\"\n },\n \"source\": {\n \"ip\": \"127.0.0.1\"\n },\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n }\n }\n ]\n }\n}" search_application.get_behavioral_analytics-200: description: '' content: application/json: schema: type: object additionalProperties: $ref: '#/components/schemas/search_application._types.AnalyticsCollection' examples: BehavioralAnalyticsGetResponseExample1: description: A successful response from `GET _application/analytics/my*` value: "{\n \"my_analytics_collection\": {\n \"event_data_stream\": {\n \"name\": \"behavioral_analytics-events-my_analytics_collection\"\n }\n },\n \"my_analytics_collection2\": {\n \"event_data_stream\": {\n \"name\": \"behavioral_analytics-events-my_analytics_collection2\"\n }\n }\n}" search_application.search-200: description: '' content: application/json: schema: $ref: '#/components/schemas/_global.search.ResponseBody' search_mvt-200: description: '' content: application/json: schema: $ref: '#/components/schemas/_types.MapboxVectorTiles' examples: SearchMvtResponseExample1: description: "A successful response from `GET museums/_mvt/location/13/4207/2692`. It returns results as a binary vector tile. When decoded into JSON, the tile contains the following data.\n" value: "{\n \"hits\": {\n \"extent\": 4096,\n \"version\": 2,\n \"features\": [\n {\n \"geometry\": {\n \"type\": \"Point\",\n \"coordinates\": [\n 3208,\n 3864\n ]\n },\n \"properties\": {\n \"_id\": \"1\",\n \"_index\": \"museums\",\n \"name\": \"NEMO Science Museum\",\n \"price\": 1750\n },\n \"type\": 1\n },\n {\n \"geometry\": {\n \"type\": \"Point\",\n \"coordinates\": [\n 3429,\n 3496\n ]\n },\n \"properties\": {\n \"_id\": \"3\",\n \"_index\": \"museums\",\n \"name\": \"Nederlands Scheepvaartmuseum\",\n \"price\": 1650\n },\n \"type\": 1\n },\n {\n \"geometry\": {\n \"type\": \"Point\",\n \"coordinates\": [\n 3429,\n 3496\n ]\n },\n \"properties\": {\n \"_id\": \"4\",\n \"_index\": \"museums\",\n \"name\": \"Amsterdam Centre for Architecture\",\n \"price\": 0\n },\n \"type\": 1\n }\n ]\n },\n \"aggs\": {\n \"extent\": 4096,\n \"version\": 2,\n \"features\": [\n {\n \"geometry\": {\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n 3072,\n 3072\n ],\n [\n 4096,\n 3072\n ],\n [\n 4096,\n 4096\n ],\n [\n 3072,\n 4096\n ],\n [\n 3072,\n 3072\n ]\n ]\n ]\n },\n \"properties\": {\n \"_count\": 3,\n \"max_price.value\": 1750.0,\n \"min_price.value\": 0.0,\n \"avg_price.value\": 1133.3333333333333\n },\n \"type\": 3\n }\n ]\n },\n \"meta\": {\n \"extent\": 4096,\n \"version\": 2,\n \"features\": [\n {\n \"geometry\": {\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n 0,\n 0\n ],\n [\n 4096,\n 0\n ],\n [\n 4096,\n 4096\n ],\n [\n 0,\n 4096\n ],\n [\n 0,\n 0\n ]\n ]\n ]\n },\n \"properties\": {\n \"_shards.failed\": 0,\n \"_shards.skipped\": 0,\n \"_shards.successful\": 1,\n \"_shards.total\": 1,\n \"aggregations._count.avg\": 3.0,\n \"aggregations._count.count\": 1,\n \"aggregations._count.max\": 3.0,\n \"aggregations._count.min\": 3.0,\n \"aggregations._count.sum\": 3.0,\n \"aggregations.avg_price.avg\": 1133.3333333333333,\n \"aggregations.avg_price.count\": 1,\n \"aggregations.avg_price.max\": 1133.3333333333333,\n \"aggregations.avg_price.min\": 1133.3333333333333,\n \"aggregations.avg_price.sum\": 1133.3333333333333,\n \"aggregations.max_price.avg\": 1750.0,\n \"aggregations.max_price.count\": 1,\n \"aggregations.max_price.max\": 1750.0,\n \"aggregations.max_price.min\": 1750.0,\n \"aggregations.max_price.sum\": 1750.0,\n \"aggregations.min_price.avg\": 0.0,\n \"aggregations.min_price.count\": 1,\n \"aggregations.min_price.max\": 0.0,\n \"aggregations.min_price.min\": 0.0,\n \"aggregations.min_price.sum\": 0.0,\n \"hits.max_score\": 0.0,\n \"hits.total.relation\": \"eq\",\n \"hits.total.value\": 3,\n \"timed_out\": false,\n \"took\": 2\n },\n \"type\": 3\n }\n ]\n }\n}" search_shards-200: description: '' content: application/json: schema: required: - nodes - shards - indices type: object properties: nodes: type: object additionalProperties: $ref: '#/components/schemas/_global.search_shards.SearchShardsNodeAttributes' shards: type: array items: type: array items: $ref: '#/components/schemas/_types.NodeShard' indices: type: object additionalProperties: $ref: '#/components/schemas/_global.search_shards.ShardStoreIndex' examples: SearchShardsResponseExample1: description: An abbreviated response from `GET /my-index-000001/_search_shards`. value: "{\n \"nodes\": {},\n \"indices\": {\n \"my-index-000001\": { }\n },\n \"shards\": [\n [\n {\n \"index\": \"my-index-000001\",\n \"node\": \"JklnKbD7Tyqi9TP3_Q_tBg\",\n \"relocating_node\": null,\n \"primary\": true,\n \"shard\": 0,\n \"state\": \"STARTED\",\n \"allocation_id\": {\"id\":\"0TvkCyF7TAmM1wHP4a42-A\"},\n \"relocation_failure_info\" : {\n \"failed_attempts\" : 0\n }\n }\n ],\n [\n {\n \"index\": \"my-index-000001\",\n \"node\": \"JklnKbD7Tyqi9TP3_Q_tBg\",\n \"relocating_node\": null,\n \"primary\": true,\n \"shard\": 1,\n \"state\": \"STARTED\",\n \"allocation_id\": {\"id\":\"fMju3hd1QHWmWrIgFnI4Ww\"},\n \"relocation_failure_info\" : {\n \"failed_attempts\" : 0\n }\n }\n ],\n [\n {\n \"index\": \"my-index-000001\",\n \"node\": \"JklnKbD7Tyqi9TP3_Q_tBg\",\n \"relocating_node\": null,\n \"primary\": true,\n \"shard\": 2,\n \"state\": \"STARTED\",\n \"allocation_id\": {\"id\":\"Nwl0wbMBTHCWjEEbGYGapg\"},\n \"relocation_failure_info\" : {\n \"failed_attempts\" : 0\n }\n }\n ],\n [\n {\n \"index\": \"my-index-000001\",\n \"node\": \"JklnKbD7Tyqi9TP3_Q_tBg\",\n \"relocating_node\": null,\n \"primary\": true,\n \"shard\": 3,\n \"state\": \"STARTED\",\n \"allocation_id\": {\"id\":\"bU_KLGJISbW0RejwnwDPKw\"},\n \"relocation_failure_info\" : {\n \"failed_attempts\" : 0\n }\n }\n ],\n [\n {\n \"index\": \"my-index-000001\",\n \"node\": \"JklnKbD7Tyqi9TP3_Q_tBg\",\n \"relocating_node\": null,\n \"primary\": true,\n \"shard\": 4,\n \"state\": \"STARTED\",\n \"allocation_id\": {\"id\":\"DMs7_giNSwmdqVukF7UydA\"},\n \"relocation_failure_info\" : {\n \"failed_attempts\" : 0\n }\n }\n ]\n ]\n }" search_template-200: description: '' content: application/json: schema: required: - took - timed_out - _shards - hits type: object properties: took: type: number timed_out: type: boolean _shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' hits: allOf: - $ref: '#/components/schemas/_global.search._types.HitsMetadata' aggregations: type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.Aggregate' _clusters: allOf: - $ref: '#/components/schemas/_types.ClusterStatistics' fields: type: object additionalProperties: type: object max_score: type: number num_reduce_phases: type: number profile: allOf: - $ref: '#/components/schemas/_global.search._types.Profile' pit_id: allOf: - $ref: '#/components/schemas/_types.Id' _scroll_id: allOf: - $ref: '#/components/schemas/_types.ScrollId' suggest: type: object additionalProperties: type: array items: $ref: '#/components/schemas/_global.search._types.Suggest' terminated_early: type: boolean searchable_snapshots.cache_stats-200: description: '' content: application/json: schema: required: - nodes type: object properties: nodes: type: object additionalProperties: $ref: '#/components/schemas/searchable_snapshots.cache_stats.Node' examples: CacheStatsResponseExample1: description: A successful response from `GET /_searchable_snapshots/cache/stats`. value: "{\n \"nodes\" : {\n \"eerrtBMtQEisohZzxBLUSw\" : {\n \"shared_cache\" : {\n \"reads\" : 6051, // The number of cache region read operations. If reads > writes, the difference represents requests successfully served from the cache without accessing the snapshot repository.\n \"bytes_read_in_bytes\" : 5448829,\n \"writes\" : 37, // The number of cache region write operations. If reads == writes, every request required fetching data from the snapshot repository into the cache.\n \"bytes_written_in_bytes\" : 1208320,\n \"evictions\" : 5, // The number of cache region evictions. A low eviction count indicates the cache is effectively serving requests. Use this metric to evaluate cache sizing.\n \"num_regions\" : 65536,\n \"size_in_bytes\" : 1099511627776,\n \"region_size_in_bytes\" : 16777216 // The size of each cache region. A region is a contiguous byte range stored on local disk.\n }\n }\n }\n}" searchable_snapshots.clear_cache-200: description: '' content: application/json: schema: type: object searchable_snapshots.stats-200: description: '' content: application/json: schema: required: - stats - total type: object properties: stats: type: object total: type: object security.change_password-200: description: '' content: application/json: schema: type: object security.clone_api_key-200: description: '' content: application/json: schema: required: - api_key - id - name - encoded type: object properties: api_key: type: string description: The generated API key value for the cloned key. expiration: type: number description: Expiration in milliseconds for the API key. id: allOf: - $ref: '#/components/schemas/_types.Id' description: The unique ID of the cloned API key. name: allOf: - $ref: '#/components/schemas/_types.Name' description: The name of the cloned API key. encoded: type: string description: "API key credentials which is the base64-encoding of\nthe UTF-8 representation of `id` and `api_key` joined\nby a colon (`:`)." security.create_api_key-200: description: '' content: application/json: schema: required: - api_key - id - name - encoded type: object properties: api_key: type: string description: Generated API key. expiration: type: number description: Expiration in milliseconds for the API key. id: allOf: - $ref: '#/components/schemas/_types.Id' description: Unique ID for this API key. name: allOf: - $ref: '#/components/schemas/_types.Name' description: Specifies the name for this API key. encoded: type: string description: "API key credentials which is the base64-encoding of\nthe UTF-8 representation of `id` and `api_key` joined\nby a colon (`:`)." x-state: Generally available; Added in 7.16.0 examples: SecurityCreateApiKeyResponseExample1: description: A successful response from `POST /_security/api_key`. value: "{\n \"id\": \"VuaCfGcBCdbkQm-e5aOx\", \n \"name\": \"my-api-key\",\n \"expiration\": 1544068612110, \n \"api_key\": \"ui2lp2axTNmsyakw9tvNnw\", \n \"encoded\": \"VnVhQ2ZHY0JDZGJrUW0tZTVhT3g6dWkybHAyYXhUTm1zeWFrdzl0dk5udw==\" \n}" security.create_service_token-200: description: '' content: application/json: schema: required: - created - token type: object properties: created: type: boolean token: allOf: - $ref: '#/components/schemas/security.create_service_token.Token' examples: CreateServiceTokenRequestExample1: description: "A successful response from `POST /_security/service/elastic/fleet-server/credential/token/token1`. The response includes the service account token, its name, and its secret value as a bearer token.\n" value: "{\n \"created\": true,\n \"token\": {\n \"name\": \"token1\",\n \"value\": \"AAEAAWVsYXN0aWM...vZmxlZXQtc2VydmVyL3Rva2VuMTo3TFdaSDZ\" \n }\n}" security.disable_user-200: description: '' content: application/json: schema: type: object security.disable_user_profile-200: description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' security.enable_user-200: description: '' content: application/json: schema: type: object security.enable_user_profile-200: description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' security.get_privileges-200: description: '' content: application/json: schema: type: object additionalProperties: type: object additionalProperties: $ref: '#/components/schemas/security.put_privileges.Actions' examples: SecurityGetPrivilegesResponseExample1: description: "A successful response from `GET /_security/privilege/myapp/read`. The response contains information about the `read` privilege for the `app01` application.\n" value: "{\n \"myapp\": {\n \"read\": {\n \"application\": \"myapp\",\n \"name\": \"read\",\n \"actions\": [\n \"data:read/*\",\n \"action:login\"\n ],\n \"metadata\": {\n \"description\": \"Read access to myapp\"\n }\n }\n }\n}" security.get_role-200: description: '' content: application/json: schema: type: object additionalProperties: $ref: '#/components/schemas/security.get_role.Role' examples: SecurityGetRoleResponseExample1: description: "A successful response from `GET /_security/role/my_admin_role`. The response contains information about the `my_admin_role` role in the native realm.\n" value: "{\n \"my_admin_role\": {\n \"description\": \"Grants full access to all management features within the cluster.\",\n \"cluster\" : [ \"all\" ],\n \"indices\" : [\n {\n \"names\" : [ \"index1\", \"index2\" ],\n \"privileges\" : [ \"all\" ],\n \"allow_restricted_indices\" : false,\n \"field_security\" : {\n \"grant\" : [ \"title\", \"body\" ]}\n }\n ],\n \"applications\" : [ ],\n \"run_as\" : [ \"other_user\" ],\n \"metadata\" : {\n \"version\" : 1\n },\n \"transient_metadata\": {\n \"enabled\": true\n }\n }\n}" security.get_role_mapping-200: description: '' content: application/json: schema: type: object additionalProperties: $ref: '#/components/schemas/security._types.RoleMapping' examples: SecurityGetRoleMappingResponseExample1: description: A successful response from `GET /_security/role_mapping/mapping1`. value: "{\n \"mapping1\": {\n \"enabled\": true,\n \"roles\": [\n \"user\"\n ],\n \"rules\": {\n \"field\": {\n \"username\": \"*\"\n }\n },\n \"metadata\": {}\n }\n}" security.get_service_accounts-200: description: '' content: application/json: schema: type: object additionalProperties: $ref: '#/components/schemas/security.get_service_accounts.ServiceAccountInfo' examples: GetServiceAccountsResponseExample1: summary: A built-in service account description: "A successful response from `GET /_security/service/elastic/fleet-server`. The response contains information about the `elastic/fleet-server` service account.\n" value: "{\n \"elastic/fleet-server\": {\n \"type\": \"built_in\",\n \"role_descriptor\": {\n \"cluster\": [\n \"monitor\",\n \"manage_own_api_key\",\n \"read_fleet_secrets\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"logs-*\",\n \"metrics-*\",\n \"traces-*\",\n \".logs-endpoint.diagnostic.collection-*\",\n \".logs-endpoint.action.responses-*\",\n \".logs-endpoint.heartbeat-*\"\n ],\n \"privileges\": [\n \"write\",\n \"create_index\",\n \"auto_configure\"\n ],\n \"allow_restricted_indices\": false\n },\n {\n \"names\": [\n \"profiling-*\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ],\n \"allow_restricted_indices\": false\n },\n {\n \"names\": [\n \"traces-apm.sampled-*\"\n ],\n \"privileges\": [\n \"read\",\n \"monitor\",\n \"maintenance\"\n ],\n \"allow_restricted_indices\": false\n },\n {\n \"names\": [\n \".fleet-secrets*\"\n ],\n \"privileges\": [\n \"read\"\n ],\n \"allow_restricted_indices\": true\n },\n {\n \"names\": [\n \".fleet-actions*\"\n ],\n \"privileges\": [\n \"read\",\n \"write\",\n \"monitor\",\n \"create_index\",\n \"auto_configure\",\n \"maintenance\"\n ],\n \"allow_restricted_indices\": true\n },\n {\n \"names\": [\n \".fleet-agents*\"\n ],\n \"privileges\": [\n \"read\",\n \"write\",\n \"monitor\",\n \"create_index\",\n \"auto_configure\",\n \"maintenance\"\n ],\n \"allow_restricted_indices\": true\n },\n {\n \"names\": [\n \".fleet-artifacts*\"\n ],\n \"privileges\": [\n \"read\",\n \"write\",\n \"monitor\",\n \"create_index\",\n \"auto_configure\",\n \"maintenance\"\n ],\n \"allow_restricted_indices\": true\n },\n {\n \"names\": [\n \".fleet-enrollment-api-keys*\"\n ],\n \"privileges\": [\n \"read\",\n \"write\",\n \"monitor\",\n \"create_index\",\n \"auto_configure\",\n \"maintenance\"\n ],\n \"allow_restricted_indices\": true\n },\n {\n \"names\": [\n \".fleet-policies*\"\n ],\n \"privileges\": [\n \"read\",\n \"write\",\n \"monitor\",\n \"create_index\",\n \"auto_configure\",\n \"maintenance\"\n ],\n \"allow_restricted_indices\": true\n },\n {\n \"names\": [\n \".fleet-policies-leader*\"\n ],\n \"privileges\": [\n \"read\",\n \"write\",\n \"monitor\",\n \"create_index\",\n \"auto_configure\",\n \"maintenance\"\n ],\n \"allow_restricted_indices\": true\n },\n {\n \"names\": [\n \".fleet-servers*\"\n ],\n \"privileges\": [\n \"read\",\n \"write\",\n \"monitor\",\n \"create_index\",\n \"auto_configure\",\n \"maintenance\"\n ],\n \"allow_restricted_indices\": true\n },\n {\n \"names\": [\n \".fleet-fileds*\"\n ],\n \"privileges\": [\n \"read\",\n \"write\",\n \"monitor\",\n \"create_index\",\n \"auto_configure\",\n \"maintenance\"\n ],\n \"allow_restricted_indices\": true\n },\n {\n \"names\": [\n \"synthetics-*\"\n ],\n \"privileges\": [\n \"read\",\n \"write\",\n \"create_index\",\n \"auto_configure\"\n ],\n \"allow_restricted_indices\": false\n }\n ],\n \"applications\": [\n {\n \"application\": \"kibana-*\",\n \"privileges\": [\n \"reserved_fleet-setup\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n }\n }\n}" GetServiceAccountsResponseExample2: summary: User-managed service accounts in a namespace description: "A successful response from `GET /_security/service/my-namespace?type=user_managed`. The response contains the user-managed service accounts in the `my-namespace` namespace. The account was created by `alice` and last replaced by `bob` using an API key.\n" value: "{\n \"my-namespace/my-service\": {\n \"type\": \"user_managed\",\n \"roles\": [\n \"my_role\"\n ],\n \"enabled\": true,\n \"created_by\": {\n \"username\": \"alice\",\n \"realm\": \"ldap1\",\n \"realm_type\": \"ldap\"\n },\n \"created_at\": 1758585600000,\n \"updated_by\": {\n \"username\": \"bob\",\n \"realm\": \"default_native\",\n \"realm_type\": \"native\",\n \"api_key\": {\n \"id\": \"VuaCfGcBCdbkQm-e5aOx\",\n \"name\": \"deploy-bot-key\"\n }\n },\n \"updated_at\": 1758672000000\n }\n}" security.get_user-200: description: '' content: application/json: schema: type: object additionalProperties: $ref: '#/components/schemas/security._types.User' examples: SecurityGetUserResponseExample1: description: "A successful response from `GET /_security/user/jacknich?with_profile_uid=true`. It includes the user `profile_uid` as part of the response.\n" value: "{\n \"jacknich\": {\n \"username\": \"jacknich\",\n \"roles\": [\n \"admin\", \"other_role1\"\n ],\n \"full_name\": \"Jack Nicholson\",\n \"email\": \"jacknich@example.com\",\n \"metadata\": { \"intelligence\" : 7 },\n \"enabled\": true,\n \"profile_uid\": \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\"\n }\n}" security.has_privileges-200: description: '' content: application/json: schema: required: - application - cluster - has_all_requested - index - username type: object properties: application: allOf: - $ref: '#/components/schemas/security.has_privileges.ApplicationsPrivileges' cluster: type: object additionalProperties: type: boolean has_all_requested: type: boolean index: type: object additionalProperties: $ref: '#/components/schemas/security.has_privileges.Privileges' username: allOf: - $ref: '#/components/schemas/_types.Username' examples: SecurityHasPrivilegesResponseExample1: description: 'A successful response from `GET /_security/user/_has_privileges`, which lists the privileges for the `rdeniro` user.' value: "{\n \"username\": \"rdeniro\",\n \"has_all_requested\" : false,\n \"cluster\" : {\n \"monitor\" : true,\n \"manage\" : false\n },\n \"index\" : {\n \"suppliers\" : {\n \"read\" : true\n },\n \"products\" : {\n \"read\" : true\n },\n \"inventory\" : {\n \"read\" : true,\n \"write\" : false\n }\n },\n \"application\" : {\n \"inventory_manager\" : {\n \"product/1852563\" : {\n \"read\": false,\n \"data:write/inventory\": false\n }\n }\n }\n}" security.has_privileges_user_profile-200: description: '' content: application/json: schema: required: - has_privilege_uids type: object properties: has_privilege_uids: type: array items: $ref: '#/components/schemas/security._types.UserProfileId' description: "The subset of the requested profile IDs of the users that\nhave all the requested privileges." errors: allOf: - $ref: '#/components/schemas/security.has_privileges_user_profile.HasPrivilegesUserProfileErrors' description: "The subset of the requested profile IDs for which an error\nwas encountered. It does not include the missing profile IDs\nor the profile IDs of the users that do not have all the\nrequested privileges. This field is absent if empty." examples: HasPrivilegesUserProfileResponseExample1: description: "A response from `POST /_security/profile/_has_privileges` that indicates only one of the three users has all the privileges and one of them is not found.\n" value: "{\n \"has_privilege_uids\": [\"u_rzRnxDgEHIH0GOUoFkZr5Y27YUwSk19Joiq=g4OCxxB_1\"],\n \"errors\": {\n \"count\": 1,\n \"details\": {\n \"u_does-not-exist_0\": {\n \"type\": \"resource_not_found_exception\",\n \"reason\": \"profile document not found\"\n }\n }\n }\n}" security.put_privileges-200: description: '' content: application/json: schema: type: object additionalProperties: type: object additionalProperties: $ref: '#/components/schemas/security._types.CreatedStatus' examples: SecurityPutPrivilegesResponseExample1: description: A successful response from `PUT /_security/privilege`. value: "{\n \"myapp\": {\n \"read\": {\n \"created\": true \n }\n }\n}" SecurityPutPrivilegesResponseExample2: description: "A successful response from `PUT /_security/privilege`. The `created` property indicates whether the privileges have been created or updated.\n" value: "{\n \"app02\": {\n \"all\": {\n \"created\": true\n }\n },\n \"app01\": {\n \"read\": {\n \"created\": true\n },\n \"write\": {\n \"created\": true\n }\n }\n}" security.put_role-200: description: '' content: application/json: schema: required: - role type: object properties: role: allOf: - $ref: '#/components/schemas/security._types.CreatedStatus' description: 'When an existing role is updated, `created` is set to `false`.' examples: SecurityPutRoleResponseExample1: description: A successful response from `POST /_security/role/my_admin_role`. value: "{\n \"role\": {\n \"created\": true \n }\n}" security.put_role_mapping-200: description: '' content: application/json: schema: required: - role_mapping type: object properties: created: type: boolean role_mapping: allOf: - $ref: '#/components/schemas/security._types.CreatedStatus' examples: SecurityPutRoleMappingResponseExample1: description: A successful response from `POST /_security/role_mapping/mapping1`. value: "{\n \"role_mapping\" : {\n \"created\" : true \n }\n}" security.put_user-200: description: '' content: application/json: schema: required: - created type: object properties: created: type: boolean description: "A successful call returns a JSON structure that shows whether the user has been created or updated.\nWhen an existing user is updated, `created` is set to `false`." examples: SecurityPutUserResponseExample1: description: "A successful response from `POST /_security/user/jacknich`. When an existing user is updated, `created` is set to `false`.\n" value: "{\n \"created\": true \n}" security.query_api_keys-200: description: '' content: application/json: schema: required: - total - count - api_keys type: object properties: total: type: number description: The total number of API keys found. count: type: number description: The number of API keys returned in the response. api_keys: type: array items: $ref: '#/components/schemas/security._types.ApiKey' description: A list of API key information. aggregations: type: object additionalProperties: $ref: '#/components/schemas/security.query_api_keys.ApiKeyAggregate' description: 'The aggregations result, if requested.' examples: QueryApiKeysResponseExample1: summary: Query API keys by ID description: "A successful response from `GET /_security/_query/api_key?with_limited_by=true`. The `limited_by` details are the owner user's permissions associated with the API key. It is a point-in-time snapshot captured at creation and subsequent updates. An API key's effective permissions are an intersection of its assigned privileges and the owner user's permissions.\n" value: "{\n \"api_keys\": [\n {\n \"id\": \"VuaCfGcBCdbkQm-e5aOx\",\n \"name\": \"application-key-1\",\n \"creation\": 1548550550158,\n \"expiration\": 1548551550158,\n \"invalidated\": false,\n \"username\": \"myuser\",\n \"realm\": \"native1\",\n \"realm_type\": \"native\",\n \"metadata\": {\n \"application\": \"my-application\"\n },\n \"role_descriptors\": { },\n \"limited_by\": [ \n {\n \"role-power-user\": {\n \"cluster\": [\n \"monitor\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"*\"\n ],\n \"privileges\": [\n \"read\"\n ],\n \"allow_restricted_indices\": false\n }\n ],\n \"applications\": [ ],\n \"run_as\": [ ],\n \"metadata\": { },\n \"transient_metadata\": {\n \"enabled\": true\n }\n }\n }\n ]\n }\n ]\n}" QueryApiKeysResponseExample2: summary: Query API keys with pagination description: "An abbreviated response from `GET /_security/_query/api_key` that contains a list of matched API keys along with their sort values. The first sort value is creation time, which is displayed in `date_time` format. The second sort value is the API key name.\n" value: "{\n \"total\": 100,\n \"count\": 10,\n \"api_keys\": [\n {\n \"id\": \"CLXgVnsBOGkf8IyjcXU7\",\n \"name\": \"app1-key-79\",\n \"creation\": 1629250154811,\n \"invalidated\": false,\n \"username\": \"org-admin-user\",\n \"realm\": \"native1\",\n \"metadata\": {\n \"environment\": \"production\"\n },\n \"role_descriptors\": { },\n \"_sort\": [\n \"2021-08-18T01:29:14.811Z\", \n \"app1-key-79\" \n ]\n },\n {\n \"id\": \"BrXgVnsBOGkf8IyjbXVB\",\n \"name\": \"app1-key-78\",\n \"creation\": 1629250153794,\n \"invalidated\": false,\n \"username\": \"org-admin-user\",\n \"realm\": \"native1\",\n \"metadata\": {\n \"environment\": \"production\"\n },\n \"role_descriptors\": { },\n \"_sort\": [\n \"2021-08-18T01:29:13.794Z\",\n \"app1-key-78\"\n ]\n }\n ]\n}" QueryApiKeysResponseExample3: summary: Query all API keys description: "A successful response from `GET /_security/_query/api_key`. It includes the role descriptors that are assigned to each API key when it was created or last updated. Note that an API key's effective permissions are an intersection of its assigned privileges and the point-in-time snapshot of the owner user's permissions. An empty role descriptors object means the API key inherits the owner user's permissions.\n" value: "{\n \"total\": 3,\n \"count\": 3,\n \"api_keys\": [ \n {\n \"id\": \"nkvrGXsB8w290t56q3Rg\",\n \"name\": \"my-api-key-1\",\n \"creation\": 1628227480421,\n \"expiration\": 1629091480421,\n \"invalidated\": false,\n \"username\": \"elastic\",\n \"realm\": \"reserved\",\n \"realm_type\": \"reserved\",\n \"metadata\": {\n \"letter\": \"a\"\n },\n \"role_descriptors\": { \n \"role-a\": {\n \"cluster\": [\n \"monitor\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-a\"\n ],\n \"privileges\": [\n \"read\"\n ],\n \"allow_restricted_indices\": false\n }\n ],\n \"applications\": [ ],\n \"run_as\": [ ],\n \"metadata\": { },\n \"transient_metadata\": {\n \"enabled\": true\n }\n }\n }\n },\n {\n \"id\": \"oEvrGXsB8w290t5683TI\",\n \"name\": \"my-api-key-2\",\n \"creation\": 1628227498953,\n \"expiration\": 1628313898953,\n \"invalidated\": false,\n \"username\": \"elastic\",\n \"realm\": \"reserved\",\n \"metadata\": {\n \"letter\": \"b\"\n },\n \"role_descriptors\": { } \n }\n ]\n}" security.query_role-200: description: '' content: application/json: schema: required: - total - count - roles type: object properties: total: type: number description: The total number of roles found. count: type: number description: The number of roles returned in the response. roles: type: array items: $ref: '#/components/schemas/security.query_role.QueryRole' description: "A list of roles that match the query.\nThe returned role format is an extension of the role definition format.\nIt adds the `transient_metadata.enabled` and the `_sort` fields.\n`transient_metadata.enabled` is set to `false` in case the role is automatically disabled, for example when the role grants privileges that are not allowed by the installed license.\n`_sort` is present when the search query sorts on some field.\nIt contains the array of values that have been used for sorting." examples: QueryRolesResponseExample1: summary: Query roles by name description: "A successful response from `POST /_security/_query/role`. It returns a JSON structure that contains the information retrieved for one or more roles.\n" value: "{\n \"total\": 2,\n \"count\": 2,\n \"roles\": [ \n {\n \"name\" : \"my_admin_role\",\n \"cluster\" : [\n \"all\"\n ],\n \"indices\" : [\n {\n \"names\" : [\n \"index1\",\n \"index2\"\n ],\n \"privileges\" : [\n \"all\"\n ],\n \"field_security\" : {\n \"grant\" : [\n \"title\",\n \"body\"\n ]\n },\n \"allow_restricted_indices\" : false\n }\n ],\n \"applications\" : [ ],\n \"run_as\" : [\n \"other_user\"\n ],\n \"metadata\" : {\n \"version\" : 1\n },\n \"transient_metadata\" : {\n \"enabled\" : true\n },\n \"description\" : \"Grants full access to all management features within the cluster.\",\n \"_sort\" : [\n \"my_admin_role\"\n ]\n },\n {\n \"name\" : \"my_user_role\",\n \"cluster\" : [ ],\n \"indices\" : [\n {\n \"names\" : [\n \"index1\",\n \"index2\"\n ],\n \"privileges\" : [\n \"all\"\n ],\n \"field_security\" : {\n \"grant\" : [\n \"title\",\n \"body\"\n ]\n },\n \"allow_restricted_indices\" : false\n }\n ],\n \"applications\" : [ ],\n \"run_as\" : [ ],\n \"metadata\" : {\n \"version\" : 1\n },\n \"transient_metadata\" : {\n \"enabled\" : true\n },\n \"description\" : \"Grants user access to some indicies.\",\n \"_sort\" : [\n \"my_user_role\"\n ]\n }\n ]\n}" QueryRolesResponseExample2: summary: Query roles by description description: "A successful response from `POST /_security/_query/role`.\n" value: "{\n \"total\": 2,\n \"count\": 1,\n \"roles\": [\n {\n \"name\" : \"my_user_role\",\n \"cluster\" : [ ],\n \"indices\" : [\n {\n \"names\" : [\n \"index1\",\n \"index2\"\n ],\n \"privileges\" : [\n \"all\"\n ],\n \"field_security\" : {\n \"grant\" : [\n \"title\",\n \"body\"\n ]\n },\n \"allow_restricted_indices\" : false\n }\n ],\n \"applications\" : [ ],\n \"run_as\" : [ ],\n \"metadata\" : {\n \"version\" : 1\n },\n \"transient_metadata\" : {\n \"enabled\" : true\n },\n \"description\" : \"Grants user access to some indicies.\"\n }\n ]\n}" security.query_user-200: description: '' content: application/json: schema: required: - total - count - users type: object properties: total: type: number description: The total number of users found. count: type: number description: The number of users returned in the response. users: type: array items: $ref: '#/components/schemas/security.query_user.QueryUser' description: A list of users that match the query. examples: SecurityQueryUserResponseExample1: summary: Query users by role prefix description: "A successful response from `POST /_security/_query/user?with_profile_uid=true` that contains users that have roles that are prefixed with `other`. It also includes the user `profile_uid` in the response.\n" value: "{\n \"total\": 1,\n \"count\": 1,\n \"users\": [\n {\n \"username\": \"jacknich\",\n \"roles\": [\n \"admin\",\n \"other_role1\"\n ],\n \"full_name\": \"Jack Nicholson\",\n \"email\": \"jacknich@example.com\",\n \"metadata\": {\n \"intelligence\": 7\n },\n \"enabled\": true,\n \"profile_uid\": \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\"\n }\n ]\n}" SecurityQueryUserResponseExample2: summary: Query users with multiple conditions description: "A successful response from `POST /_security/_query/user` that uses a `bool` query to issue complex logical conditions and uses `from`, `size`, and `sort` to help paginate the result. The sort value is `username`.\n" value: "{\n \"total\": 5,\n \"count\": 2,\n \"users\": [\n {\n \"username\": \"ray\",\n \"roles\": [\n \"other_role3\"\n ],\n \"full_name\": \"Ray Nicholson\",\n \"email\": \"rayn@example.com\",\n \"metadata\": {\n \"intelligence\": 7\n },\n \"enabled\": true,\n \"_sort\": [\n \"ray\" \n ]\n },\n {\n \"username\": \"lorraine\",\n \"roles\": [\n \"other_role3\"\n ],\n \"full_name\": \"Lorraine Nicholson\",\n \"email\": \"lorraine@example.com\",\n \"metadata\": {\n \"intelligence\": 7\n },\n \"enabled\": true,\n \"_sort\": [\n \"lorraine\"\n ]\n }\n ]\n}" SecurityQueryUserResponseExample3: summary: Query all users description: "A successful response from `GET /_security/_query/user`, which lists all users. It returns a JSON structure that contains the information retrieved from one or more users.\n" value: "{\n \"total\": 2,\n \"count\": 2,\n \"users\": [ \n {\n \"username\": \"jacknich\",\n \"roles\": [\n \"admin\",\n \"other_role1\"\n ],\n \"full_name\": \"Jack Nicholson\",\n \"email\": \"jacknich@example.com\",\n \"metadata\": {\n \"intelligence\": 7\n },\n \"enabled\": true\n },\n {\n \"username\": \"sandrakn\",\n \"roles\": [\n \"admin\",\n \"other_role1\"\n ],\n \"full_name\": \"Sandra Knight\",\n \"email\": \"sandrakn@example.com\",\n \"metadata\": {\n \"intelligence\": 7\n },\n \"enabled\": true\n }\n ]\n}" security.suggest_user_profiles-200: description: '' content: application/json: schema: required: - total - took - profiles type: object properties: total: allOf: - $ref: '#/components/schemas/security.suggest_user_profiles.TotalUserProfiles' description: Metadata about the number of matching profiles. took: type: number description: The number of milliseconds it took Elasticsearch to run the request. profiles: type: array items: $ref: '#/components/schemas/security._types.UserProfile' description: 'A list of profile documents, ordered by relevance, that match the search criteria.' examples: SuggestUserProfilesResponseExample1: description: "A successful response from `GET /_security/saml/metadata/saml1`. It contains the SAML metadata that was generated for the SAML realm as an XML string.\n" value: "{\n \"metadata\" : \"\"\n}" security.update_user_profile_data-200: description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' examples: UpdateUserProfileDataResponseExample1: description: "A successful response from `POST /_security/profile/u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0/_data`, which indicates that the request is acknowledged.\n" value: "{\n \"acknowledged\": true\n}" simulate.ingest-200: description: '' content: application/json: schema: required: - docs type: object properties: docs: type: array items: $ref: '#/components/schemas/simulate.ingest.SimulateIngestDocumentResult' examples: SimulateIngestResponseExample1: summary: Use an existing pipeline definition description: A successful response when the simulation uses pipeline definitions that are already in the system. value: "{\n \"docs\": [\n {\n \"doc\": null,\n \"_id\": 123,\n \"_index\": \"my-index\",\n \"_version\": -3,\n \"_source\": {\n \"field1\": \"value1\",\n \"field2\": \"value2\",\n \"foo\": \"bar\"\n },\n \"executed_pipelines\": [\n \"my-pipeline\",\n \"my-final-pipeline\"\n ]\n },\n {\n \"doc\": null,\n \"_id\": 456,\n \"_index\": \"my-index\",\n \"_version\": \"-3,\",\n \"_source\": {\n \"field1\": \"value1\",\n \"field2\": \"value2\",\n \"foo\": \"rab\"\n },\n \"executed_pipelines\": [\n \"my-pipeline\",\n \"my-final-pipeline\"\n ]\n }\n ]\n}" SimulateIngestResponseExample2: summary: Use pipeline substitutions description: A successful response when the simulation uses pipeline substitutions. value: "{\n \"docs\": [\n {\n \"doc\": null,\n \"_id\": 123,\n \"_index\": \"my-index\",\n \"_version\": -3,\n \"_source\": {\n \"field2\": \"value2\",\n \"foo\": \"BAR\"\n },\n \"executed_pipelines\": [\n \"my-pipeline\",\n \"my-final-pipeline\"\n ]\n },\n {\n \"doc\": null,\n \"_id\": 456,\n \"_index\": \"my-index\",\n \"_version\": -3,\n \"_source\": {\n \"field2\": \"value2\",\n \"foo\": \"RAB\"\n },\n \"executed_pipelines\": [\n \"my-pipeline\",\n \"my-final-pipeline\"\n ]\n }\n ]\n}" SimulateIngestResponseExample3: summary: Use pipeline substitutions description: A successful response when the simulation uses pipeline substitutions. value: "{\n \"docs\": [\n {\n \"doc\": {\n \"_id\": \"123\",\n \"_index\": \"my-index\",\n \"_version\": -3,\n \"_source\": {\n \"foo\": \"foo\"\n },\n \"executed_pipelines\": [],\n \"effective_mapping\": {\n \"_doc\": {\n \"properties\": {\n \"foo\": {\n \"type\": \"keyword\"\n }\n }\n }\n }\n }\n },\n {\n \"doc\": {\n \"_id\": \"456\",\n \"_index\": \"my-index\",\n \"_version\": -3,\n \"_source\": {\n \"bar\": \"rab\"\n },\n \"executed_pipelines\": [],\n \"effective_mapping\": {\n \"_doc\": {\n \"properties\": {\n \"bar\": {\n \"type\": \"keyword\"\n }\n }\n }\n }\n }\n }\n ]\n}" slm.get_lifecycle-200: description: '' content: application/json: schema: type: object additionalProperties: $ref: '#/components/schemas/slm._types.SnapshotLifecycle' examples: GetSnapshotLifecycleResponseExample1: description: A successful response from `GET _slm/policy/daily-snapshots?human`. value: "{\n \"daily-snapshots\": {\n \"version\": 1,\n \"modified_date\": \"2099-05-06T01:30:00.000Z\",\n \"modified_date_millis\": 4081757400000,\n \"policy\" : {\n \"schedule\": \"0 30 1 * * ?\",\n \"name\": \"\",\n \"repository\": \"my_repository\",\n \"config\": {\n \"indices\": [\"data-*\", \"important\"],\n \"ignore_unavailable\": false,\n \"include_global_state\": false\n },\n \"retention\": {\n \"expire_after\": \"30d\",\n \"min_count\": 5,\n \"max_count\": 50\n }\n },\n \"stats\": {\n \"policy\": \"daily-snapshots\",\n \"snapshots_taken\": 0,\n \"snapshots_failed\": 0,\n \"snapshots_deleted\": 0,\n \"snapshot_deletion_failures\": 0\n },\n \"next_execution\": \"2099-05-07T01:30:00.000Z\",\n \"next_execution_millis\": 4081843800000\n }\n}" snapshot.create-200: description: '' content: application/json: schema: type: object properties: accepted: type: boolean description: Equals `true` if the snapshot was accepted. Present when the request had `wait_for_completion` set to `false` x-state: Generally available; Added in 7.15.0 snapshot: allOf: - $ref: '#/components/schemas/snapshot._types.SnapshotInfo' description: Snapshot information. Present when the request had `wait_for_completion` set to `true` examples: SnapshotCreateResponseExample1: description: A successful response from `PUT /_snapshot/my_repository/snapshot_2?wait_for_completion=true`. value: "{\n \"snapshot\": {\n \"snapshot\": \"snapshot_2\",\n \"uuid\": \"vdRctLCxSketdKb54xw67g\",\n \"repository\": \"my_repository\",\n \"version_id\": ,\n \"version\": ,\n \"indices\": [],\n \"data_streams\": [],\n \"feature_states\": [],\n \"include_global_state\": false,\n \"metadata\": {\n \"taken_by\": \"user123\",\n \"taken_because\": \"backup before upgrading\"\n },\n \"state\": \"SUCCESS\",\n \"start_time\": \"2020-06-25T14:00:28.850Z\",\n \"start_time_in_millis\": 1593093628850,\n \"end_time\": \"2020-06-25T14:00:28.850Z\",\n \"end_time_in_millis\": 1593094752018,\n \"duration_in_millis\": 0,\n \"failures\": [],\n \"shards\": {\n \"total\": 0,\n \"failed\": 0,\n \"successful\": 0\n }\n }\n}" snapshot.create_repository-200: description: '' content: application/json: schema: $ref: '#/components/schemas/_types.AcknowledgedResponseBase' snapshot.get_repository-200: description: '' content: application/json: schema: type: object additionalProperties: $ref: '#/components/schemas/snapshot._types.Repository' examples: SnapshotGetRepositoryResponseExample1: description: A successful response from `GET /_snapshot/my_repository`. value: "{\n \"my_repository\" : {\n \"type\" : \"fs\",\n \"uuid\" : \"0JLknrXbSUiVPuLakHjBrQ\",\n \"settings\" : {\n \"location\" : \"my_backup_location\"\n }\n }\n}" snapshot.status-200: description: '' content: application/json: schema: required: - snapshots type: object properties: snapshots: type: array items: $ref: '#/components/schemas/snapshot._types.Status' examples: SnapshotStatusResponseExample1: summary: All shard stats present description: "A successful response from `GET _snapshot/my_repository/snapshot_2/_status`. The response contains detailed status information for `snapshot_2` in the `my_repository` repository.\n" value: "{\n \"snapshots\" : [\n {\n \"snapshot\" : \"snapshot_2\",\n \"repository\" : \"my_repository\",\n \"uuid\" : \"lNeQD1SvTQCqqJUMQSwmGg\",\n \"state\" : \"SUCCESS\",\n \"include_global_state\" : false,\n \"shards_stats\" : {\n \"initializing\" : 0,\n \"started\" : 0,\n \"finalizing\" : 0,\n \"done\" : 1,\n \"failed\" : 0,\n \"total\" : 1\n },\n \"stats\" : {\n \"incremental\" : {\n \"file_count\" : 3,\n \"size_in_bytes\" : 5969\n },\n \"total\" : {\n \"file_count\" : 4,\n \"size_in_bytes\" : 6024\n },\n \"start_time_in_millis\" : 1594829326691,\n \"time_in_millis\" : 205\n },\n \"indices\" : {\n \"index_1\" : {\n \"shards_stats\" : {\n \"initializing\" : 0,\n \"started\" : 0,\n \"finalizing\" : 0,\n \"done\" : 1,\n \"failed\" : 0,\n \"total\" : 1\n },\n \"stats\" : {\n \"incremental\" : {\n \"file_count\" : 3,\n \"size_in_bytes\" : 5969\n },\n \"total\" : {\n \"file_count\" : 4,\n \"size_in_bytes\" : 6024\n },\n \"start_time_in_millis\" : 1594829326896,\n \"time_in_millis\" : 0\n },\n \"shards\" : {\n \"0\" : {\n \"stage\" : \"DONE\",\n \"stats\" : {\n \"incremental\" : {\n \"file_count\" : 3,\n \"size_in_bytes\" : 5969\n },\n \"total\" : {\n \"file_count\" : 4,\n \"size_in_bytes\" : 6024\n },\n \"start_time_in_millis\" : 1594829326896,\n \"time_in_millis\" : 0\n }\n }\n }\n }\n }\n }\n ]\n}" SnapshotStatusResponseExample2: summary: Missing shard stats description: "A successful response from `GET _snapshot/my_repository/snapshot_2/_status`. Note that in this example the stats for `index-2` shard `0` are missing, with explanatory details provided in the `description` field.\n" value: "{\n \"snapshots\" : [\n {\n \"snapshot\" : \"snapshot_2\",\n \"repository\" : \"my_repository\",\n \"uuid\" : \"lNeQD1SvTQCqqJUMQSwmGg\",\n \"state\" : \"STARTED\",\n \"include_global_state\" : true,\n \"shards_stats\" : {\n \"initializing\" : 0,\n \"started\" : 1,\n \"finalizing\" : 0,\n \"done\" : 1,\n \"failed\" : 0,\n \"total\" : 2\n },\n \"stats\" : {\n \"incremental\" : {\n \"file_count\" : 4,\n \"size_in_bytes\" : 5412\n },\n \"processed\" : {\n \"file_count\" : 2,\n \"size_in_bytes\" : 658\n },\n \"total\" : {\n \"file_count\" : 4,\n \"size_in_bytes\" : 5412\n },\n \"start_time_in_millis\" : 1750452674327,\n \"time_in_millis\" : 189\n },\n \"indices\" : {\n \"index-1\" : {\n \"shards_stats\" : {\n \"initializing\" : 0,\n \"started\" : 1,\n \"finalizing\" : 0,\n \"done\" : 0,\n \"failed\" : 0,\n \"total\" : 1\n },\n \"stats\" : {\n \"incremental\" : {\n \"file_count\" : 4,\n \"size_in_bytes\" : 5412\n },\n \"processed\" : {\n \"file_count\" : 2,\n \"size_in_bytes\" : 658\n },\n \"total\" : {\n \"file_count\" : 4,\n \"size_in_bytes\" : 5412\n },\n \"start_time_in_millis\" : 1750452674379,\n \"time_in_millis\" : 0\n },\n \"shards\" : {\n \"0\" : {\n \"stage\" : \"STARTED\",\n \"stats\" : {\n \"incremental\" : {\n \"file_count\" : 4,\n \"size_in_bytes\" : 5412\n },\n \"processed\" : {\n \"file_count\" : 2,\n \"size_in_bytes\" : 658\n },\n \"total\" : {\n \"file_count\" : 4,\n \"size_in_bytes\" : 5412\n },\n \"start_time_in_millis\" : 1750452674379,\n \"time_in_millis\" : 0\n },\n \"node\" : \"VJzy6aKJSVKwcfjIFBPXxw\"\n }\n }\n },\n \"index-2\" : {\n \"shards_stats\" : {\n \"initializing\" : 0,\n \"started\" : 0,\n \"finalizing\" : 0,\n \"done\" : 1,\n \"failed\" : 0,\n \"total\" : 1\n },\n \"stats\" : {\n \"incremental\" : {\n \"file_count\" : 0,\n \"size_in_bytes\" : 0\n },\n \"total\" : {\n \"file_count\" : 0,\n \"size_in_bytes\" : 0\n },\n \"start_time_in_millis\" : 0,\n \"time_in_millis\" : 0\n },\n \"shards\" : {\n \"0\" : {\n \"stage\" : \"DONE\",\n \"stats\" : {\n \"incremental\" : {\n \"file_count\" : -1,\n \"size_in_bytes\" : -1\n },\n \"total\" : {\n \"file_count\" : -1,\n \"size_in_bytes\" : -1\n },\n \"start_time_in_millis\" : 0,\n \"time_in_millis\" : 0\n },\n \"description\" : \"Snapshot shard stats missing from a currently running snapshot due to a node leaving the cluster after completing the shard snapshot; retry once the snapshot has completed to load all shard stats from the repository.\"\n }\n }\n }\n }\n }\n ]\n}" sql.query-200: description: '' content: application/json: schema: required: - rows type: object properties: columns: type: array items: $ref: '#/components/schemas/sql._types.Column' description: Column headings for the search results. Each object is a column. cursor: type: string description: "The cursor for the next set of paginated results.\nFor CSV, TSV, and TXT responses, this value is returned in the `Cursor` HTTP header." id: allOf: - $ref: '#/components/schemas/_types.Id' description: "The identifier for the search.\nThis value is returned only for async and saved synchronous searches.\nFor CSV, TSV, and TXT responses, this value is returned in the `Async-ID` HTTP header." is_running: type: boolean description: "If `true`, the search is still running.\nIf `false`, the search has finished.\nThis value is returned only for async and saved synchronous searches.\nFor CSV, TSV, and TXT responses, this value is returned in the `Async-partial` HTTP header." is_partial: type: boolean description: "If `true`, the response does not contain complete search results.\nIf `is_partial` is `true` and `is_running` is `true`, the search is still running.\nIf `is_partial` is `true` but `is_running` is `false`, the results are partial due to a failure or timeout.\nThis value is returned only for async and saved synchronous searches.\nFor CSV, TSV, and TXT responses, this value is returned in the `Async-partial` HTTP header." rows: type: array items: $ref: '#/components/schemas/sql._types.Row' description: The values for the search results. sql.translate-200: description: '' content: application/json: schema: type: object properties: aggregations: type: object additionalProperties: $ref: '#/components/schemas/_types.aggregations.AggregationContainer' size: type: number _source: allOf: - $ref: '#/components/schemas/_global.search._types.SourceConfig' fields: type: array items: $ref: '#/components/schemas/_types.query_dsl.FieldAndFormat' query: allOf: - $ref: '#/components/schemas/_types.query_dsl.QueryContainer' sort: allOf: - $ref: '#/components/schemas/_types.Sort' track_total_hits: allOf: - $ref: '#/components/schemas/_global.search._types.TrackHits' tasks.cancel-200: description: '' content: application/json: schema: $ref: '#/components/schemas/tasks._types.TaskListResponseBase' terms_enum-200: description: '' content: application/json: schema: required: - _shards - terms - complete type: object properties: _shards: allOf: - $ref: '#/components/schemas/_types.ShardStatistics' terms: type: array items: type: string complete: type: boolean description: "If `false`, the returned terms set may be incomplete and should be treated as approximate.\nThis can occur due to a few reasons, such as a request timeout or a node error." examples: TermsEnumResponseExample1: description: A successful response from `POST stackoverflow/_terms_enum`. value: "{\n \"_shards\": {\n \"total\": 1,\n \"successful\": 1,\n \"failed\": 0\n },\n \"terms\": [\n \"kibana\"\n ],\n \"complete\" : true\n}" termvectors-200: description: '' content: application/json: schema: required: - found - _index - took - _version type: object properties: found: type: boolean _id: allOf: - $ref: '#/components/schemas/_types.Id' _index: allOf: - $ref: '#/components/schemas/_types.IndexName' term_vectors: type: object additionalProperties: $ref: '#/components/schemas/_global.termvectors.TermVector' took: type: number _version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' examples: TermVectorsResponseExample1: summary: Return stored term vectors description: A successful response from `GET /my-index-000001/_termvectors/1`. value: "{\n \"_index\": \"my-index-000001\",\n \"_id\": \"1\",\n \"_version\": 1,\n \"found\": true,\n \"took\": 6,\n \"term_vectors\": {\n \"text\": {\n \"field_statistics\": {\n \"sum_doc_freq\": 4,\n \"doc_count\": 2,\n \"sum_ttf\": 6\n },\n \"terms\": {\n \"test\": {\n \"doc_freq\": 2,\n \"ttf\": 4,\n \"term_freq\": 3,\n \"tokens\": [\n {\n \"position\": 0,\n \"start_offset\": 0,\n \"end_offset\": 4,\n \"payload\": \"d29yZA==\"\n },\n {\n \"position\": 1,\n \"start_offset\": 5,\n \"end_offset\": 9,\n \"payload\": \"d29yZA==\"\n },\n {\n \"position\": 2,\n \"start_offset\": 10,\n \"end_offset\": 14,\n \"payload\": \"d29yZA==\"\n }\n ]\n }\n }\n }\n }\n}" TermVectorsResponseExample2: summary: Per-field analyzer description: A successful response from `GET /my-index-000001/_termvectors` with `per_field_analyzer` in the request body. value: "{\n \"_index\": \"my-index-000001\",\n \"_version\": 0,\n \"found\": true,\n \"took\": 6,\n \"term_vectors\": {\n \"fullname\": {\n \"field_statistics\": {\n \"sum_doc_freq\": 2,\n \"doc_count\": 4,\n \"sum_ttf\": 4\n },\n \"terms\": {\n \"John Doe\": {\n \"term_freq\": 1,\n \"tokens\": [\n {\n \"position\": 0,\n \"start_offset\": 0,\n \"end_offset\": 8\n }\n ]\n }\n }\n }\n }\n}" TermVectorsResponseExample3: summary: Terms filtering description: A successful response from `GET /my-index-000001/_termvectors` with a `filter` in the request body. value: "{\n \"_index\": \"imdb\",\n \"_version\": 0,\n \"found\": true,\n \"term_vectors\": {\n \"plot\": {\n \"field_statistics\": {\n \"sum_doc_freq\": 3384269,\n \"doc_count\": 176214,\n \"sum_ttf\": 3753460\n },\n \"terms\": {\n \"armored\": {\n \"doc_freq\": 27,\n \"ttf\": 27,\n \"term_freq\": 1,\n \"score\": 9.74725\n },\n \"industrialist\": {\n \"doc_freq\": 88,\n \"ttf\": 88,\n \"term_freq\": 1,\n \"score\": 8.590818\n },\n \"stark\": {\n \"doc_freq\": 44,\n \"ttf\": 47,\n \"term_freq\": 1,\n \"score\": 9.272792\n }\n }\n }\n }\n}" text_structure.find_message_structure-200: description: '' content: application/json: schema: required: - charset - field_stats - format - ingest_pipeline - mappings - need_client_timezone - num_lines_analyzed - num_messages_analyzed - sample_start type: object properties: charset: type: string ecs_compatibility: allOf: - $ref: '#/components/schemas/text_structure._types.EcsCompatibilityType' field_stats: type: object additionalProperties: $ref: '#/components/schemas/text_structure._types.FieldStat' format: allOf: - $ref: '#/components/schemas/text_structure._types.FormatType' grok_pattern: allOf: - $ref: '#/components/schemas/_types.GrokPattern' java_timestamp_formats: type: array items: type: string joda_timestamp_formats: type: array items: type: string ingest_pipeline: allOf: - $ref: '#/components/schemas/ingest._types.PipelineConfig' mappings: allOf: - $ref: '#/components/schemas/_types.mapping.TypeMapping' multiline_start_pattern: type: string need_client_timezone: type: boolean num_lines_analyzed: type: number num_messages_analyzed: type: number sample_start: type: string timestamp_field: allOf: - $ref: '#/components/schemas/_types.Field' examples: FindMessageStructureResponseExample1: description: A successful response from `POST _text_structure/find_message_structure`. value: "{\n \"num_lines_analyzed\" : 22,\n \"num_messages_analyzed\" : 22,\n \"sample_start\" : \"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128\\n[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]\\n\",\n \"charset\" : \"UTF-8\",\n \"format\" : \"semi_structured_text\",\n \"multiline_start_pattern\" : \"^\\\\[\\\\b\\\\d{4}-\\\\d{2}-\\\\d{2}[T ]\\\\d{2}:\\\\d{2}\",\n \"grok_pattern\" : \"\\\\[%{TIMESTAMP_ISO8601:timestamp}\\\\]\\\\[%{LOGLEVEL:loglevel} \\\\]\\\\[.*\",\n \"ecs_compatibility\" : \"disabled\",\n \"timestamp_field\" : \"timestamp\",\n \"joda_timestamp_formats\" : [\n \"ISO8601\"\n ],\n \"java_timestamp_formats\" : [\n \"ISO8601\"\n ],\n \"need_client_timezone\" : true,\n \"mappings\" : {\n \"properties\" : {\n \"@timestamp\" : {\n \"type\" : \"date\"\n },\n \"loglevel\" : {\n \"type\" : \"keyword\"\n },\n \"message\" : {\n \"type\" : \"text\"\n }\n }\n },\n \"ingest_pipeline\" : {\n \"description\" : \"Ingest pipeline created by text structure finder\",\n \"processors\" : [\n {\n \"grok\" : {\n \"field\" : \"message\",\n \"patterns\" : [\n \"\\\\[%{TIMESTAMP_ISO8601:timestamp}\\\\]\\\\[%{LOGLEVEL:loglevel} \\\\]\\\\[.*\"\n ],\n \"ecs_compatibility\" : \"disabled\"\n }\n },\n {\n \"date\" : {\n \"field\" : \"timestamp\",\n \"timezone\" : \"{{ event.timezone }}\",\n \"formats\" : [\n \"ISO8601\"\n ]\n }\n },\n {\n \"remove\" : {\n \"field\" : \"timestamp\"\n }\n }\n ]\n },\n \"field_stats\" : {\n \"loglevel\" : {\n \"count\" : 22,\n \"cardinality\" : 1,\n \"top_hits\" : [\n {\n \"value\" : \"INFO\",\n \"count\" : 22\n }\n ]\n },\n \"message\" : {\n \"count\" : 22,\n \"cardinality\" : 22,\n \"top_hits\" : [\n {\n \"value\" : \"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128\",\n \"count\" : 1\n },\n {\n \"value\" : \"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]\",\n \"count\" : 1\n },\n {\n \"value\" : \"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]\",\n \"count\" : 1\n },\n {\n \"value\" : \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]\",\n \"count\" : 1\n },\n {\n \"value\" : \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]\",\n \"count\" : 1\n },\n {\n \"value\" : \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]\",\n \"count\" : 1\n },\n {\n \"value\" : \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]\",\n \"count\" : 1\n },\n {\n \"value\" : \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]\",\n \"count\" : 1\n },\n {\n \"value\" : \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]\",\n \"count\" : 1\n },\n {\n \"value\" : \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]\",\n \"count\" : 1\n }\n ]\n },\n \"timestamp\" : {\n \"count\" : 22,\n \"cardinality\" : 14,\n \"earliest\" : \"2024-03-05T10:52:36,256\",\n \"latest\" : \"2024-03-05T10:52:49,199\",\n \"top_hits\" : [\n {\n \"value\" : \"2024-03-05T10:52:41,044\",\n \"count\" : 6\n },\n {\n \"value\" : \"2024-03-05T10:52:41,043\",\n \"count\" : 3\n },\n {\n \"value\" : \"2024-03-05T10:52:41,059\",\n \"count\" : 2\n },\n {\n \"value\" : \"2024-03-05T10:52:36,256\",\n \"count\" : 1\n },\n {\n \"value\" : \"2024-03-05T10:52:41,038\",\n \"count\" : 1\n },\n {\n \"value\" : \"2024-03-05T10:52:41,042\",\n \"count\" : 1\n },\n {\n \"value\" : \"2024-03-05T10:52:43,291\",\n \"count\" : 1\n },\n {\n \"value\" : \"2024-03-05T10:52:46,098\",\n \"count\" : 1\n },\n {\n \"value\" : \"2024-03-05T10:52:47,227\",\n \"count\" : 1\n },\n {\n \"value\" : \"2024-03-05T10:52:47,259\",\n \"count\" : 1\n }\n ]\n }\n }\n}" text_structure.test_grok_pattern-200: description: '' content: application/json: schema: required: - matches type: object properties: matches: type: array items: $ref: '#/components/schemas/text_structure.test_grok_pattern.MatchedText' examples: TestGrokPatternResponseExample1: description: A successful response from `GET _text_structure/test_grok_pattern`. value: "{\n \"matches\": [\n {\n \"matched\": true,\n \"fields\": {\n \"first_name\": [\n {\n \"match\": \"John\",\n \"offset\": 6,\n \"length\": 4\n }\n ],\n \"last_name\": [\n {\n \"match\": \"Doe\",\n \"offset\": 11,\n \"length\": 3\n }\n ]\n }\n },\n {\n \"matched\": false\n }\n ]\n}" transform.get_transform-200: description: '' content: application/json: schema: required: - count - transforms type: object properties: count: type: number transforms: type: array items: $ref: '#/components/schemas/transform.get_transform.TransformSummary' examples: GetTransformResponseExample1: description: A successful response that contains configuration information for a transform. value: "{\n \"count\": 1,\n \"transforms\": [\n {\n \"id\": \"ecommerce_transform1\",\n \"authorization\": {\n \"roles\": [\n \"superuser\"\n ]\n },\n \"version\": \"8.4.0\",\n \"create_time\": 1656023416565,\n \"source\": {\n \"index\": [\n \"kibana_sample_data_ecommerce\"\n ],\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\"\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"settings\": {},\n \"retention_policy\": {\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n }\n }\n ]\n}" transform.preview_transform-200: description: '' content: application/json: schema: required: - generated_dest_index - preview type: object properties: generated_dest_index: allOf: - $ref: '#/components/schemas/indices._types.IndexState' preview: type: array items: type: object examples: PreviewTransformResponseExample1: description: An abbreviated response from `POST _transform/_preview` that contains a preview a transform that uses the pivot method. value: "{\n \"preview\": [\n {\n \"max_price\": 171,\n \"customer_id\": \"10\"\n },\n {\n \"max_price\": 233,\n \"customer_id\": \"11\"\n },\n {\n \"max_price\": 200,\n \"customer_id\": \"12\"\n },\n {\n \"max_price\": 301,\n \"customer_id\": \"13\"\n },\n {\n \"max_price\": 176,\n \"customer_id\": \"14\"\n },\n {\n \"max_price\": 2250,\n \"customer_id\": \"15\"\n },\n {\n \"max_price\": 170,\n \"customer_id\": \"16\"\n },\n {\n \"max_price\": 243,\n \"customer_id\": \"17\"\n },\n {\n \"max_price\": 154,\n \"customer_id\": \"18\"\n },\n {\n \"max_price\": 393,\n \"customer_id\": \"19\"\n },\n {\n \"max_price\": 165,\n \"customer_id\": \"20\"\n },\n {\n \"max_price\": 115,\n \"customer_id\": \"21\"\n },\n {\n \"max_price\": 192,\n \"customer_id\": \"22\"\n },\n {\n \"max_price\": 169,\n \"customer_id\": \"23\"\n },\n {\n \"max_price\": 230,\n \"customer_id\": \"24\"\n },\n {\n \"max_price\": 278,\n \"customer_id\": \"25\"\n },\n {\n \"max_price\": 200,\n \"customer_id\": \"26\"\n },\n {\n \"max_price\": 344,\n \"customer_id\": \"27\"\n },\n {\n \"max_price\": 175,\n \"customer_id\": \"28\"\n },\n {\n \"max_price\": 177,\n \"customer_id\": \"29\"\n },\n {\n \"max_price\": 190,\n \"customer_id\": \"30\"\n },\n {\n \"max_price\": 190,\n \"customer_id\": \"31\"\n },\n {\n \"max_price\": 205,\n \"customer_id\": \"32\"\n },\n {\n \"max_price\": 215,\n \"customer_id\": \"33\"\n },\n {\n \"max_price\": 270,\n \"customer_id\": \"34\"\n },\n {\n \"max_price\": 184,\n \"customer_id\": \"36\"\n },\n {\n \"max_price\": 222,\n \"customer_id\": \"37\"\n },\n {\n \"max_price\": 370,\n \"customer_id\": \"38\"\n },\n {\n \"max_price\": 240,\n \"customer_id\": \"39\"\n },\n {\n \"max_price\": 230,\n \"customer_id\": \"4\"\n },\n {\n \"max_price\": 229,\n \"customer_id\": \"41\"\n },\n {\n \"max_price\": 190,\n \"customer_id\": \"42\"\n },\n {\n \"max_price\": 150,\n \"customer_id\": \"43\"\n },\n {\n \"max_price\": 175,\n \"customer_id\": \"44\"\n },\n {\n \"max_price\": 190,\n \"customer_id\": \"45\"\n },\n {\n \"max_price\": 150,\n \"customer_id\": \"46\"\n },\n {\n \"max_price\": 310,\n \"customer_id\": \"48\"\n },\n {\n \"max_price\": 223,\n \"customer_id\": \"49\"\n },\n {\n \"max_price\": 283,\n \"customer_id\": \"5\"\n },\n {\n \"max_price\": 185,\n \"customer_id\": \"50\"\n },\n {\n \"max_price\": 190,\n \"customer_id\": \"51\"\n },\n {\n \"max_price\": 333,\n \"customer_id\": \"52\"\n },\n {\n \"max_price\": 165,\n \"customer_id\": \"6\"\n },\n {\n \"max_price\": 144,\n \"customer_id\": \"7\"\n },\n {\n \"max_price\": 198,\n \"customer_id\": \"8\"\n },\n {\n \"max_price\": 210,\n \"customer_id\": \"9\"\n }\n ],\n \"generated_dest_index\": {\n \"mappings\": {\n \"_meta\": {\n \"_transform\": {\n \"transform\": \"transform-preview\",\n \"version\": {\n \"created\": \"10.0.0\"\n },\n \"creation_date_in_millis\": 1712948905889\n },\n \"created_by\": \"transform\"\n },\n \"properties\": {\n \"max_price\": {\n \"type\": \"half_float\"\n },\n \"customer_id\": {\n \"type\": \"keyword\"\n }\n }\n },\n \"settings\": {\n \"index\": {\n \"number_of_shards\": \"1\",\n \"auto_expand_replicas\": \"0-1\"\n }\n },\n \"aliases\": {}\n }\n}" watcher.ack_watch-200: description: '' content: application/json: schema: required: - status type: object properties: status: allOf: - $ref: '#/components/schemas/watcher._types.WatchStatus' examples: WatcherAckWatchResponseExample1: description: A successful response from `POST _watcher/watch/my_watch/_ack`. value: "{\n \"status\": {\n \"state\": {\n \"active\": true,\n \"timestamp\": \"2015-05-26T18:04:27.723Z\"\n },\n \"last_checked\": \"2015-05-26T18:04:27.753Z\",\n \"last_met_condition\": \"2015-05-26T18:04:27.763Z\",\n \"actions\": {\n \"test_index\": {\n \"ack\" : {\n \"timestamp\": \"2015-05-26T18:04:27.713Z\",\n \"state\": \"acked\"\n },\n \"last_execution\" : {\n \"timestamp\": \"2015-05-25T18:04:27.733Z\",\n \"successful\": true\n },\n \"last_successful_execution\" : {\n \"timestamp\": \"2015-05-25T18:04:27.773Z\",\n \"successful\": true\n }\n }\n },\n \"execution_state\": \"executed\",\n \"version\": 2\n }\n}" watcher.activate_watch-200: description: '' content: application/json: schema: required: - status type: object properties: status: allOf: - $ref: '#/components/schemas/watcher._types.ActivationStatus' watcher.deactivate_watch-200: description: '' content: application/json: schema: required: - status type: object properties: status: allOf: - $ref: '#/components/schemas/watcher._types.ActivationStatus' watcher.execute_watch-200: description: '' content: application/json: schema: required: - _id - watch_record type: object properties: _id: allOf: - $ref: '#/components/schemas/_types.Id' description: The watch record identifier as it would be stored in the `.watcher-history` index. watch_record: allOf: - $ref: '#/components/schemas/watcher.execute_watch.WatchRecord' description: The watch record document as it would be stored in the `.watcher-history` index. examples: WatcherExecuteWatchResponseExample1: description: "A successful response from `POST _watcher/watch/my_watch/_execute`.\n" value: "{\n \"_id\": \"my_watch_0-2015-06-02T23:17:55.124Z\", \n \"watch_record\": { \n \"@timestamp\": \"2015-06-02T23:17:55.124Z\",\n \"watch_id\": \"my_watch\",\n \"node\": \"my_node\",\n \"messages\": [],\n \"trigger_event\": {\n \"type\": \"manual\",\n \"triggered_time\": \"2015-06-02T23:17:55.124Z\",\n \"manual\": {\n \"schedule\": {\n \"scheduled_time\": \"2015-06-02T23:17:55.124Z\"\n }\n }\n },\n \"state\": \"executed\",\n \"status\": {\n \"version\": 1,\n \"execution_state\": \"executed\",\n \"state\": {\n \"active\": true,\n \"timestamp\": \"2015-06-02T23:17:55.111Z\"\n },\n \"last_checked\": \"2015-06-02T23:17:55.124Z\",\n \"last_met_condition\": \"2015-06-02T23:17:55.124Z\",\n \"actions\": {\n \"test_index\": {\n \"ack\": {\n \"timestamp\": \"2015-06-02T23:17:55.124Z\",\n \"state\": \"ackable\"\n },\n \"last_execution\": {\n \"timestamp\": \"2015-06-02T23:17:55.124Z\",\n \"successful\": true\n },\n \"last_successful_execution\": {\n \"timestamp\": \"2015-06-02T23:17:55.124Z\",\n \"successful\": true\n }\n }\n }\n },\n \"input\": {\n \"simple\": {\n \"payload\": {\n \"send\": \"yes\"\n }\n }\n },\n \"condition\": {\n \"always\": {}\n },\n \"result\": { \n \"execution_time\": \"2015-06-02T23:17:55.124Z\",\n \"execution_duration\": 12608,\n \"input\": {\n \"type\": \"simple\",\n \"payload\": {\n \"foo\": \"bar\"\n },\n \"status\": \"success\"\n },\n \"condition\": {\n \"type\": \"always\",\n \"met\": true,\n \"status\": \"success\"\n },\n \"actions\": [\n {\n \"id\": \"test_index\",\n \"index\": {\n \"response\": {\n \"index\": \"test\",\n \"version\": 1,\n \"created\": true,\n \"result\": \"created\",\n \"id\": \"AVSHKzPa9zx62AzUzFXY\"\n }\n },\n \"status\": \"success\",\n \"type\": \"index\"\n }\n ]\n },\n \"user\": \"test_admin\" \n }\n}" watcher.put_watch-200: description: '' content: application/json: schema: required: - created - _id - _primary_term - _seq_no - _version type: object properties: created: type: boolean _id: allOf: - $ref: '#/components/schemas/_types.Id' _primary_term: type: number _seq_no: allOf: - $ref: '#/components/schemas/_types.SequenceNumber' _version: allOf: - $ref: '#/components/schemas/_types.VersionNumber' watcher.query_watches-200: description: '' content: application/json: schema: required: - count - watches type: object properties: count: type: number description: The total number of watches found. watches: type: array items: $ref: '#/components/schemas/watcher._types.QueryWatch' description: 'A list of watches based on the `from`, `size`, or `search_after` request body parameters.' examples: WatcherQueryWatchesResponseExample1: description: A successful response from `GET /_watcher/_query/watches`. value: "{\n \"count\": 1,\n \"watches\": [\n {\n \"_id\": \"my_watch\",\n \"watch\": {\n \"trigger\": {\n \"schedule\": {\n \"hourly\": {\n \"minute\": [\n 0,\n 5\n ]\n }\n }\n },\n \"input\": {\n \"simple\": {\n \"payload\": {\n \"send\": \"yes\"\n }\n }\n },\n \"condition\": {\n \"always\": {}\n },\n \"actions\": {\n \"test_index\": {\n \"index\": {\n \"index\": \"test\"\n }\n }\n }\n },\n \"status\": {\n \"state\": {\n \"active\": true,\n \"timestamp\": \"2015-05-26T18:21:08.630Z\"\n },\n \"actions\": {\n \"test_index\": {\n \"ack\": {\n \"timestamp\": \"2015-05-26T18:21:08.630Z\",\n \"state\": \"awaits_successful_execution\"\n }\n }\n },\n \"version\": -1\n },\n \"_seq_no\": 0,\n \"_primary_term\": 1\n }\n ]\n}" watcher.stats-200: description: '' content: application/json: schema: required: - _nodes - cluster_name - manually_stopped - stats type: object properties: _nodes: allOf: - $ref: '#/components/schemas/_types.NodeStatistics' cluster_name: allOf: - $ref: '#/components/schemas/_types.Name' manually_stopped: type: boolean stats: type: array items: $ref: '#/components/schemas/watcher.stats.WatcherNodeStats' examples: WatcherStatsResponseExample1: summary: Basic metrics description: A successful response from `GET _watcher/stats`. value: "{\n \"watcher_state\": \"started\", \n \"watch_count\": 1, \n \"execution_thread_pool\": {\n \"size\": 1000, \n \"max_size\": 1 \n }\n}" WatcherStatsResponseExample2: summary: Current watch metrics description: A successful response from `GET _watcher/stats?metric=current_watches`. value: "{\n \"watcher_state\": \"started\",\n \"watch_count\": 2,\n \"execution_thread_pool\": {\n \"queue_size\": 1000,\n \"max_size\": 20\n },\n \"current_watches\": [ \n {\n \"watch_id\": \"slow_condition\", \n \"watch_record_id\": \"slow_condition_3-2015-05-13T07:42:32.179Z\", \n \"triggered_time\": \"2015-05-12T11:53:51.800Z\", \n \"execution_time\": \"2015-05-13T07:42:32.179Z\", \n \"execution_phase\": \"condition\" \n }\n ]\n}" WatcherStatsResponseExample3: summary: Queued watch metrics description: An abbreviated response from `GET _watcher/stats/queued_watches`. value: "{\n \"watcher_state\": \"started\",\n \"watch_count\": 10,\n \"execution_thread_pool\": {\n \"queue_size\": 1000,\n \"max_size\": 20\n },\n \"queued_watches\": [ \n {\n \"watch_id\": \"slow_condition4\", \n \"watch_record_id\": \"slow_condition4_223-2015-05-21T11:59:59.811Z\", \n \"triggered_time\": \"2015-05-21T11:59:59.811Z\", \n \"execution_time\": \"2015-05-21T11:59:59.811Z\" \n }\n ]\n}" parameters: async_search.submit-index: name: index in: path description: A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices required: true schema: $ref: '#/components/schemas/_types.Indices' async_search.submit-wait_for_completion_timeout: name: wait_for_completion_timeout in: query description: "Blocks and waits until the search is completed up to a certain timeout.\nWhen the async search completes within the timeout, the response won’t include the ID as the results are not stored in the cluster." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 1s async_search.submit-keep_alive: name: keep_alive in: query description: "Specifies how long the async search needs to be available.\nOngoing async searches and any saved search results are deleted after this period." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 5d async_search.submit-keep_on_completion: name: keep_on_completion in: query description: 'If `true`, results are stored for later retrieval when the search completes within the `wait_for_completion_timeout`.' schema: type: boolean default: false async_search.submit-allow_no_indices: name: allow_no_indices in: query description: "A setting that does two separate checks on the index expression.\nIf `false`, the request returns an error (1) if any wildcard expression\n(including `_all` and `*`) resolves to zero matching indices or (2) if the\ncomplete set of resolved indices, aliases or data streams is empty after all\nexpressions are evaluated. If `true`, index expressions that resolve to no\nindices are allowed and the request returns an empty result." schema: type: boolean async_search.submit-allow_partial_search_results: name: allow_partial_search_results in: query description: Indicate if an error should be returned if there is a partial search failure or timeout schema: type: boolean default: true async_search.submit-analyzer: name: analyzer in: query description: The analyzer to use for the query string schema: type: string async_search.submit-analyze_wildcard: name: analyze_wildcard in: query description: Specify whether wildcard and prefix queries should be analyzed schema: type: boolean default: false async_search.submit-batched_reduce_size: name: batched_reduce_size in: query description: "Affects how often partial results become available, which happens whenever shard results are reduced.\nA partial reduction is performed every time the coordinating node has received a certain number of new shard responses (5 by default)." schema: type: number default: 5 async_search.submit-ccs_minimize_roundtrips: name: ccs_minimize_roundtrips in: query description: The default value is the only supported value. schema: type: boolean default: false async_search.submit-default_operator: name: default_operator in: query description: The default operator for query string query (AND or OR) schema: allOf: - $ref: '#/components/schemas/_types.query_dsl.Operator' default: or async_search.submit-df: name: df in: query description: The field to use as default where no field prefix is given in the query string schema: type: string async_search.submit-docvalue_fields: name: docvalue_fields in: query description: A comma-separated list of fields to return as the docvalue representation of a field for each hit schema: $ref: '#/components/schemas/_types.Fields' async_search.submit-expand_wildcards: name: expand_wildcards in: query description: "Whether to expand wildcard expression to concrete indices that are open, closed or both\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: open async_search.submit-explain: name: explain in: query description: Specify whether to return detailed information about score computation as part of a hit schema: type: boolean async_search.submit-ignore_throttled: name: ignore_throttled in: query description: 'Whether specified concrete, expanded or aliased indices should be ignored when throttled' schema: type: boolean async_search.submit-ignore_unavailable: name: ignore_unavailable in: query description: "If `false`, the request returns an error if it targets a concrete (non-wildcarded)\nindex, alias, or data stream that is missing, closed, or otherwise unavailable.\nIf `true`, unavailable concrete targets are silently ignored." schema: type: boolean async_search.submit-lenient: name: lenient in: query description: Specify whether format-based query failures (such as providing text to a numeric field) should be ignored schema: type: boolean async_search.submit-max_concurrent_shard_requests: name: max_concurrent_shard_requests in: query description: "The number of concurrent shard requests per node this search executes concurrently.\nThis value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests" schema: type: number default: 5 async_search.submit-preference: name: preference in: query description: Specify the node or shard the operation should be performed on schema: type: string default: random async_search.submit-request_cache: name: request_cache in: query description: 'Specify if request cache should be used for this request or not, defaults to true' schema: type: boolean default: true async_search.submit-routing: name: routing in: query description: A comma-separated list of specific routing values schema: $ref: '#/components/schemas/_types.Routing' async_search.submit-search_type: name: search_type in: query description: "Search operation type\n\nSupported values include:\n - `query_then_fetch`: Documents are scored using local term and document frequencies for the shard. This is usually faster but less accurate.\n - `dfs_query_then_fetch`: Documents are scored using global term and document frequencies across all shards. This is usually slower but more accurate.\n\n" schema: $ref: '#/components/schemas/_types.SearchType' async_search.submit-stats: name: stats in: query description: Specific 'tag' of the request for logging and statistical purposes schema: type: array items: type: string async_search.submit-stored_fields: name: stored_fields in: query description: A comma-separated list of stored fields to return as part of a hit schema: $ref: '#/components/schemas/_types.Fields' async_search.submit-suggest_field: name: suggest_field in: query description: Specifies which field to use for suggestions. schema: $ref: '#/components/schemas/_types.Field' async_search.submit-suggest_mode: name: suggest_mode in: query description: "Specify suggest mode\n\nSupported values include:\n - `missing`: Only generate suggestions for terms that are not in the shard.\n - `popular`: Only suggest terms that occur in more docs on the shard than the original term.\n - `always`: Suggest any matching suggestions based on terms in the suggest text.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.SuggestMode' default: missing async_search.submit-suggest_size: name: suggest_size in: query description: How many suggestions to return in response schema: type: number async_search.submit-suggest_text: name: suggest_text in: query description: The source text for which the suggestions should be returned. schema: type: string async_search.submit-terminate_after: name: terminate_after in: query description: 'The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early' schema: type: number async_search.submit-timeout: name: timeout in: query description: Explicit operation timeout schema: $ref: '#/components/schemas/_types.Duration' async_search.submit-track_total_hits: name: track_total_hits in: query description: "Indicate if the number of documents that match the query should be tracked.\nA number can also be specified, to accurately track the total hit count up to the number." schema: $ref: '#/components/schemas/_global.search._types.TrackHits' async_search.submit-track_scores: name: track_scores in: query description: Whether to calculate and return scores even if they are not used for sorting schema: type: boolean async_search.submit-typed_keys: name: typed_keys in: query description: Specify whether aggregation and suggester names should be prefixed by their respective types in the response schema: type: boolean async_search.submit-rest_total_hits_as_int: name: rest_total_hits_as_int in: query description: Indicates whether hits.total should be rendered as an integer or an object in the rest search response schema: type: boolean default: false async_search.submit-version: name: version in: query description: Specify whether to return document version as part of a hit schema: type: boolean async_search.submit-_source: name: _source in: query description: 'True or false to return the _source field or not, or a list of fields to return' schema: $ref: '#/components/schemas/_global.search._types.SourceConfigParam' async_search.submit-_source_excludes: name: _source_excludes in: query description: A list of fields to exclude from the returned _source field schema: $ref: '#/components/schemas/_types.Fields' async_search.submit-_source_includes: name: _source_includes in: query description: A list of fields to extract and return from the _source field schema: $ref: '#/components/schemas/_types.Fields' async_search.submit-seq_no_primary_term: name: seq_no_primary_term in: query description: Specify whether to return sequence number and primary term of the last modification of each hit schema: type: boolean async_search.submit-q: name: q in: query description: Query in the Lucene query string syntax schema: type: string async_search.submit-size: name: size in: query description: Number of hits to return schema: type: number default: 10 async_search.submit-from: name: from in: query description: Starting offset schema: type: number default: 0 async_search.submit-sort: name: sort in: query description: A comma-separated list of : pairs schema: oneOf: - type: string - type: array items: type: string bulk-index: name: index in: path description: 'The name of the data stream, index, or index alias to perform bulk actions on.' required: true schema: $ref: '#/components/schemas/_types.IndexName' bulk-include_source_on_error: name: include_source_on_error in: query description: True or false if to include the document source in the error message in case of parsing errors. schema: type: boolean default: true bulk-list_executed_pipelines: name: list_executed_pipelines in: query description: 'If `true`, the response will include the ingest pipelines that were run for each index or create.' schema: type: boolean default: false bulk-pipeline: name: pipeline in: query description: "The pipeline identifier to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request.\nIf a final pipeline is configured, it will always run regardless of the value of this parameter." schema: type: string bulk-refresh: name: refresh in: query description: "If `true`, Elasticsearch refreshes the affected shards to make this operation visible to search.\nIf `wait_for`, wait for a refresh to make this operation visible to search.\nIf `false`, do nothing with refreshes.\nValid values: `true`, `false`, `wait_for`." schema: allOf: - $ref: '#/components/schemas/_types.Refresh' default: 'false' bulk-routing: name: routing in: query description: "A custom value that is used to route operations to a specific shard.\nNot allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead." schema: $ref: '#/components/schemas/_types.Routing' x-state: Generally available bulk-_source: name: _source in: query description: Indicates whether to return the `_source` field (`true` or `false`) or contains a list of fields to return. schema: $ref: '#/components/schemas/_global.search._types.SourceConfigParam' bulk-_source_excludes: name: _source_excludes in: query description: "A comma-separated list of source fields to exclude from the response.\nYou can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter.\nIf the `_source` parameter is `false`, this parameter is ignored." schema: $ref: '#/components/schemas/_types.Fields' bulk-_source_includes: name: _source_includes in: query description: "A comma-separated list of source fields to include in the response.\nIf this parameter is specified, only these source fields are returned.\nYou can exclude fields from this subset using the `_source_excludes` query parameter.\nIf the `_source` parameter is `false`, this parameter is ignored." schema: $ref: '#/components/schemas/_types.Fields' bulk-timeout: name: timeout in: query description: "The period each action waits for the following operations: automatic index creation, dynamic mapping updates, and waiting for active shards.\nThe default is `1m` (one minute), which guarantees Elasticsearch waits for at least the timeout before failing.\nThe actual wait time could be longer, particularly when multiple waits occur." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 1m bulk-wait_for_active_shards: name: wait_for_active_shards in: query description: "The number of shard copies that must be active before proceeding with the operation.\nSet to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`).\nThe default is `1`, which waits for each primary shard to be active." schema: allOf: - $ref: '#/components/schemas/_types.WaitForActiveShards' default: '1' bulk-require_alias: name: require_alias in: query description: 'If `true`, the request''s actions must target an index alias.' schema: type: boolean default: false bulk-require_data_stream: name: require_data_stream in: query description: 'If `true`, the request''s actions must target a data stream (existing or to be created).' schema: type: boolean default: false cat.aliases-name: name: name in: path description: 'A comma-separated list of aliases to retrieve. Supports wildcards (`*`). To retrieve all aliases, omit this parameter or use `*` or `_all`.' required: true schema: $ref: '#/components/schemas/_types.Names' cat.aliases-h: name: h in: query description: "A comma-separated list of columns names to display. It supports simple wildcards.\n\nSupported values include:\n - `alias` (or `a`): The name of the alias.\n - `index` (or `i`, `idx`): The name of the index the alias points to.\n - `filter` (or `f`, `fi`): The filter applied to the alias.\n - `routing.index` (or `ri`, `routingIndex`): Index routing value for the alias.\n - `routing.search` (or `rs`, `routingSearch`): Search routing value for the alias.\n - `is_write_index` (or `w`, `isWriteIndex`): Indicates if the index is the write index for the alias.\n\n" schema: $ref: '#/components/schemas/cat._types.CatAliasesColumns' cat.aliases-s: name: s in: query description: "List of columns that determine how the table should be sorted.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name." schema: $ref: '#/components/schemas/_types.Names' cat.aliases-expand_wildcards: name: expand_wildcards in: query description: "The type of index that wildcard patterns can match.\nIf the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.\nIt supports comma-separated values, such as `open,hidden`.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: all cat.aliases-master_timeout: name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nTo indicated that the request should never timeout, you can set it to `-1`." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s _spec_utils.CommonCatQueryParameters-format: name: format in: query description: "Specifies the format to return the columnar data in, can be set to\n`text`, `json`, `cbor`, `yaml`, or `smile`." schema: type: string default: text _spec_utils.CommonCatQueryParameters-help: name: help in: query description: "When set to `true` will output available columns. This option\ncan't be combined with any other query string option." schema: type: boolean default: false _spec_utils.CommonCatQueryParameters-v: name: v in: query description: When set to `true` will enable verbose output. schema: type: boolean default: false _spec_utils.CommonCatQueryParameters-bytes: name: bytes in: query description: "Sets the units for columns that contain a byte-size value.\nNote that byte-size value units work in terms of powers of 1024. For instance `1kb` means 1024 bytes, not 1000 bytes.\nIf omitted, byte-size values are rendered with a suffix such as `kb`, `mb`, or `gb`, chosen such that the numeric value of the column is as small as possible whilst still being at least `1.0`.\nIf given, byte-size values are rendered as an integer with no suffix, representing the value of the column in the chosen unit.\nValues that are not an exact multiple of the chosen unit are rounded down." schema: $ref: '#/components/schemas/_types.Bytes' _spec_utils.CommonCatQueryParameters-time: name: time in: query description: "Sets the units for columns that contain a time duration.\nIf omitted, time duration values are rendered with a suffix such as `ms`, `s`, `m` or `h`, chosen such that the numeric value of the column is as small as possible whilst still being at least `1.0`.\nIf given, time duration values are rendered as an integer with no suffix.\nValues that are not an exact multiple of the chosen unit are rounded down." schema: $ref: '#/components/schemas/_types.TimeUnit' cat.allocation-node_id: name: node_id in: path description: A comma-separated list of node identifiers or names used to limit the returned information. required: true schema: $ref: '#/components/schemas/_types.NodeIds' cat.allocation-h: name: h in: query description: "A comma-separated list of columns names to display. It supports simple wildcards.\n\nSupported values include:\n - `shards` (or `s`): The number of shards on the node.\n - `shards.undesired`: The number of shards scheduled to be moved elsewhere in the cluster.\n - `write_load.forecast` (or `wlf`, `writeLoadForecast`): The sum of index write load forecasts.\n - `disk.indices.forecast` (or `dif`, `diskIndicesForecast`): The sum of shard size forecasts.\n - `disk.indices` (or `di`, `diskIndices`): The disk space used by Elasticsearch indices.\n - `disk.used` (or `du`, `diskUsed`): The total disk space used on the node.\n - `disk.avail` (or `da`, `diskAvail`): The available disk space on the node.\n - `disk.total` (or `dt`, `diskTotal`): The total disk capacity of all volumes on the node.\n - `disk.percent` (or `dp`, `diskPercent`): The percentage of disk space used on the node.\n - `host` (or `h`): IThe host of the node.\n - `ip`: The IP address of the node.\n - `node` (or `n`): The name of the node.\n - `node.role` (or `r`, `role`, `nodeRole`): The roles assigned to the node.\n\n" schema: $ref: '#/components/schemas/cat._types.CatAllocationColumns' cat.allocation-s: name: s in: query description: "List of columns that determine how the table should be sorted.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name." schema: $ref: '#/components/schemas/_types.Names' cat.allocation-local: name: local in: query description: "If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node." schema: type: boolean default: false cat.allocation-master_timeout: name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s cat.circuit_breaker-circuit_breaker_patterns: name: circuit_breaker_patterns in: path description: A comma-separated list of regular-expressions to filter the circuit breakers in the output required: true schema: oneOf: - type: string - type: array items: type: string cat.circuit_breaker-h: name: h in: query description: "A comma-separated list of columns names to display. It supports simple wildcards.\n\nSupported values include:\n - `node_id` (or `id`): Persistent node ID\n - `node_name` (or `nn`): Node name\n - `breaker` (or `br`): Breaker name\n - `limit` (or `l`): Limit size\n - `limit_bytes` (or `lb`): Limit size in bytes\n - `estimated` (or `e`): Estimated size\n - `estimated_bytes` (or `eb`): Estimated size in bytes\n - `tripped` (or `t`): Tripped count\n - `overhead` (or `o`): Overhead\n\n" schema: $ref: '#/components/schemas/cat._types.CatCircuitBreakerColumns' cat.circuit_breaker-s: name: s in: query description: "List of columns that determine how the table should be sorted.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name." schema: $ref: '#/components/schemas/_types.Names' cat.circuit_breaker-local: name: local in: query description: "If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node." schema: type: boolean default: false cat.circuit_breaker-master_timeout: name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s cat.component_templates-name: name: name in: path description: "The name of the component template.\nIt accepts wildcard expressions.\nIf it is omitted, all component templates are returned." required: true schema: type: string cat.component_templates-h: name: h in: query description: "A comma-separated list of columns names to display. It supports simple wildcards.\n\nSupported values include:\n - `name` (or `n`): The name of the component template.\n - `version` (or `v`): The version number of the component template.\n - `alias_count` (or `a`): The number of aliases in the component template.\n - `mapping_count` (or `m`): The number of mappings in the component template.\n - `settings_count` (or `s`): The number of settings in the component template.\n - `metadata_count` (or `me`): The number of metadata entries in the component template.\n - `included_in` (or `i`): The index templates that include this component template.\n\n" schema: $ref: '#/components/schemas/cat._types.CatComponentColumns' cat.component_templates-s: name: s in: query description: "List of columns that determine how the table should be sorted.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name." schema: $ref: '#/components/schemas/_types.Names' cat.component_templates-local: name: local in: query description: "If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node." schema: type: boolean default: false cat.component_templates-master_timeout: name: master_timeout in: query description: The period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s cat.count-index: name: index in: path description: "A comma-separated list of data streams, indices, and aliases used to limit the request.\nIt supports wildcards (`*`).\nTo target all data streams and indices, omit this parameter or use `*` or `_all`." required: true schema: $ref: '#/components/schemas/_types.Indices' cat.count-h: name: h in: query description: "A comma-separated list of columns names to display. It supports simple wildcards.\n\nSupported values include:\n - `epoch` (or `t`, `time`): The Unix epoch time in seconds since 1970-01-01 00:00:00.\n - `timestamp` (or `ts`, `hms`, `hhmmss`): The current time in HH:MM:SS format.\n - `count` (or `dc`, `docs.count`, `docsCount`): The document count in the cluster or index.\n\n" schema: $ref: '#/components/schemas/cat._types.CatCountColumns' cat.count-s: name: s in: query description: "List of columns that determine how the table should be sorted.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name." schema: $ref: '#/components/schemas/_types.Names' cat.fielddata-fields: name: fields in: path description: "Comma-separated list of fields used to limit returned information.\nTo retrieve all fields, omit this parameter." required: true schema: $ref: '#/components/schemas/_types.Fields' cat.fielddata-fields_: name: fields in: query description: Comma-separated list of fields used to limit returned information. schema: $ref: '#/components/schemas/_types.Fields' cat.fielddata-h: name: h in: query description: "A comma-separated list of columns names to display. It supports simple wildcards.\n\nSupported values include:\n - `id`: The node ID.\n - `host` (or `h`): The host name of the node.\n - `ip`: The IP address of the node.\n - `node` (or `n`): The node name.\n - `field` (or `f`): The field name.\n - `size` (or `s`): The field data usage.\n\n" schema: $ref: '#/components/schemas/cat._types.CatFieldDataColumns' cat.fielddata-s: name: s in: query description: "List of columns that determine how the table should be sorted.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name." schema: $ref: '#/components/schemas/_types.Names' cat.indices-index: name: index in: path description: "Comma-separated list of data streams, indices, and aliases used to limit the request.\nSupports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`." required: true schema: $ref: '#/components/schemas/_types.Indices' cat.indices-expand_wildcards: name: expand_wildcards in: query description: "The type of index that wildcard patterns can match.\nNote that `closed` also matches non-hidden data streams, so their open backing indices are returned as well.\nIt does not restrict the response to closed indices only.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: 'open,closed' cat.indices-health: name: health in: query description: "The health status used to limit returned indices. By default, the response includes indices of any health status.\n\nSupported values include:\n - `green` (or `GREEN`): All shards are assigned.\n - `yellow` (or `YELLOW`): All primary shards are assigned, but one or more replica shards are unassigned. If a node in the cluster fails, some data could be unavailable until that node is repaired.\n - `red` (or `RED`): One or more primary shards are unassigned, so some data is unavailable. This can occur briefly during cluster startup as primary shards are assigned.\n - `unknown`\n - `unavailable`\n\n" schema: $ref: '#/components/schemas/_types.HealthStatus' cat.indices-include_unloaded_segments: name: include_unloaded_segments in: query description: 'If true, the response includes information from segments that are not loaded into memory.' schema: type: boolean default: false cat.indices-pri: name: pri in: query description: 'If true, the response only includes information from primary shards.' schema: type: boolean default: false cat.indices-master_timeout: name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s cat.indices-h: name: h in: query description: "A comma-separated list of columns names to display. It supports simple wildcards.\n\nSupported values include:\n - `health` (or `h`): The current health status.\n - `status` (or `s`): The open/close status.\n - `index` (or `i`, `idx`): The index name.\n - `uuid` (or `id`, `uuid`): The index UUID.\n - `pri` (or `p`, `shards.primary`, `shardsPrimary`): The number of primary shards.\n - `rep` (or `r`, `shards.replica`, `shardsReplica`): The number of replica shards.\n - `docs.count` (or `dc`, `docsCount`): The number of available documents.\n - `docs.deleted` (or `dd`, `docsDeleted`): The number of deleted documents.\n - `creation.date` (or `cd`): The index creation date (millisecond value).\n - `creation.date.string` (or `cds`): The index creation date (as string).\n - `store.size` (or `ss`, `storeSize`): The store size of primaries and replicas.\n - `pri.store.size`: The store size of primaries.\n - `dataset.size`: The total size of the dataset.\n - `completion.size` (or `cs`, `completionSize`): The size of completion for primaries and replicas.\n - `pri.completion.size`: The size of completion for primaries.\n - `fielddata.memory_size` (or `fm`, `fielddataMemory`): The used fielddata cache for primaries and replicas.\n - `pri.fielddata.memory_size`: The used fielddata cache for primaries.\n - `fielddata.evictions` (or `fe`, `fielddataEvictions`): The number of fielddata evictions for primaries and replicas.\n - `pri.fielddata.evictions`: The number of fielddata evictions for primaries.\n - `query_cache.memory_size` (or `qcm`, `queryCacheMemory`): The used query cache for primaries and replicas.\n - `pri.query_cache.memory_size`: The used query cache for primaries.\n - `query_cache.evictions` (or `qce`, `queryCacheEvictions`): The number of query cache evictions for primaries and replicas.\n - `pri.query_cache.evictions`: The number of query cache evictions for primaries.\n - `request_cache.memory_size` (or `rcm`, `requestCacheMemory`): The used request cache for primaries and replicas.\n - `pri.request_cache.memory_size`: The used request cache for primaries.\n - `request_cache.evictions` (or `rce`, `requestCacheEvictions`): The number of request cache evictions for primaries and replicas.\n - `pri.request_cache.evictions`: The number of request cache evictions for primaries.\n - `request_cache.hit_count` (or `rchc`, `requestCacheHitCount`): The request cache hit count for primaries and replicas.\n - `pri.request_cache.hit_count`: The request cache hit count for primaries.\n - `request_cache.miss_count` (or `rcmc`, `requestCacheMissCount`): The request cache miss count for primaries and replicas.\n - `pri.request_cache.miss_count`: The request cache miss count for primaries.\n - `flush.total` (or `ft`, `flushTotal`): The number of flushes for primaries and replicas.\n - `pri.flush.total`: The number of flushes for primaries.\n - `flush.total_time` (or `ftt`, `flushTotalTime`): The time spent in flush for primaries and replicas.\n - `pri.flush.total_time`: The time spent in flush for primaries.\n - `get.current` (or `gc`, `getCurrent`): The number of current get operations for primaries and replicas.\n - `pri.get.current`: The number of current get operations for primaries.\n - `get.time` (or `gti`, `getTime`): The time spent in get for primaries and replicas.\n - `pri.get.time`: The time spent in get for primaries.\n - `get.total` (or `gto`, `getTotal`): The number of get operations for primaries and replicas.\n - `pri.get.total`: The number of get operations for primaries.\n - `get.exists_time` (or `geti`, `getExistsTime`): The time spent in successful gets for primaries and replicas.\n - `pri.get.exists_time`: The time spent in successful gets for primaries.\n - `get.exists_total` (or `geto`, `getExistsTotal`): The number of successful gets for primaries and replicas.\n - `pri.get.exists_total`: The number of successful gets for primaries.\n - `get.missing_time` (or `gmti`, `getMissingTime`): The time spent in failed gets for primaries and replicas.\n - `pri.get.missing_time`: The time spent in failed gets for primaries.\n - `get.missing_total` (or `gmto`, `getMissingTotal`): The number of failed gets for primaries and replicas.\n - `pri.get.missing_total`: The number of failed gets for primaries.\n - `indexing.delete_current` (or `idc`, `indexingDeleteCurrent`): The number of current deletions for primaries and replicas.\n - `pri.indexing.delete_current`: The number of current deletions for primaries.\n - `indexing.delete_time` (or `idti`, `indexingDeleteTime`): The time spent in deletions for primaries and replicas.\n - `pri.indexing.delete_time`: The time spent in deletions for primaries.\n - `indexing.delete_total` (or `idto`, `indexingDeleteTotal`): The number of delete operations for primaries and replicas.\n - `pri.indexing.delete_total`: The number of delete operations for primaries.\n - `indexing.index_current` (or `iic`, `indexingIndexCurrent`): The number of current indexing operations for primaries and replicas.\n - `pri.indexing.index_current`: The number of current indexing operations for primaries.\n - `indexing.index_time` (or `iiti`, `indexingIndexTime`): The time spent in indexing for primaries and replicas.\n - `pri.indexing.index_time`: The time spent in indexing for primaries.\n - `indexing.index_total` (or `iito`, `indexingIndexTotal`): The number of indexing operations for primaries and replicas.\n - `pri.indexing.index_total`: The number of indexing operations for primaries.\n - `indexing.index_failed` (or `iif`, `indexingIndexFailed`): The number of failed indexing operations for primaries and replicas.\n - `pri.indexing.index_failed`: The number of failed indexing operations for primaries.\n - `indexing.index_failed_due_to_version_conflict` (or `iifvc`, `indexingIndexFailedDueToVersionConflict`): The number of failed indexing operations due to version conflict for primaries and replicas.\n - `pri.indexing.index_failed_due_to_version_conflict`: The number of failed indexing operations due to version conflict for primaries.\n - `merges.current` (or `mc`, `mergesCurrent`): The number of current merges for primaries and replicas.\n - `pri.merges.current`: The number of current merges for primaries.\n - `merges.current_docs` (or `mcd`, `mergesCurrentDocs`): The number of current merging documents for primaries and replicas.\n - `pri.merges.current_docs`: The number of current merging documents for primaries.\n - `merges.current_size` (or `mcs`, `mergesCurrentSize`): The size of current merges for primaries and replicas.\n - `pri.merges.current_size`: The size of current merges for primaries.\n - `merges.total` (or `mt`, `mergesTotal`): The number of completed merge operations for primaries and replicas.\n - `pri.merges.total`: The number of completed merge operations for primaries.\n - `merges.total_docs` (or `mtd`, `mergesTotalDocs`): The number of merged documents for primaries and replicas.\n - `pri.merges.total_docs`: The number of merged documents for primaries.\n - `merges.total_size` (or `mts`, `mergesTotalSize`): The merged size for primaries and replicas.\n - `pri.merges.total_size`: The merged size for primaries.\n - `merges.total_time` (or `mtt`, `mergesTotalTime`): The time spent in merges for primaries and replicas.\n - `pri.merges.total_time`: The time spent in merges for primaries.\n - `refresh.total` (or `rto`, `refreshTotal`): The total refreshes for primaries and replicas.\n - `pri.refresh.total`: The total refreshes for primaries.\n - `refresh.time` (or `rti`, `refreshTime`): The time spent in refreshes for primaries and replicas.\n - `pri.refresh.time`: The time spent in refreshes for primaries.\n - `refresh.external_total` (or `rto`, `refreshTotal`): The total external refreshes for primaries and replicas.\n - `pri.refresh.external_total`: The total external refreshes for primaries.\n - `refresh.external_time` (or `rti`, `refreshTime`): The time spent in external refreshes for primaries and replicas.\n - `pri.refresh.external_time`: The time spent in external refreshes for primaries.\n - `refresh.listeners` (or `rli`, `refreshListeners`): The number of pending refresh listeners for primaries and replicas.\n - `pri.refresh.listeners`: The number of pending refresh listeners for primaries.\n - `search.fetch_current` (or `sfc`, `searchFetchCurrent`): The current fetch phase operations for primaries and replicas.\n - `pri.search.fetch_current`: The current fetch phase operations for primaries.\n - `search.fetch_time` (or `sfti`, `searchFetchTime`): The time spent in fetch phase for primaries and replicas.\n - `pri.search.fetch_time`: The time spent in fetch phase for primaries.\n - `search.fetch_total` (or `sfto`, `searchFetchTotal`): The total fetch operations for primaries and replicas.\n - `pri.search.fetch_total`: The total fetch operations for primaries.\n - `search.open_contexts` (or `so`, `searchOpenContexts`): The open search contexts for primaries and replicas.\n - `pri.search.open_contexts`: The open search contexts for primaries.\n - `search.query_current` (or `sqc`, `searchQueryCurrent`): The current query phase operations for primaries and replicas.\n - `pri.search.query_current`: The current query phase operations for primaries.\n - `search.query_time` (or `sqti`, `searchQueryTime`): The time spent in query phase for primaries and replicas.\n - `pri.search.query_time`: The time spent in query phase for primaries.\n - `search.query_total` (or `sqto`, `searchQueryTotal`): The total query phase operations for primaries and replicas.\n - `pri.search.query_total`: The total query phase operations for primaries.\n - `search.scroll_current` (or `scc`, `searchScrollCurrent`): The open scroll contexts for primaries and replicas.\n - `pri.search.scroll_current`: The open scroll contexts for primaries.\n - `search.scroll_time` (or `scti`, `searchScrollTime`): The time scroll contexts held open for primaries and replicas.\n - `pri.search.scroll_time`: The time scroll contexts held open for primaries.\n - `search.scroll_total` (or `scto`, `searchScrollTotal`): The completed scroll contexts for primaries and replicas.\n - `pri.search.scroll_total`: The completed scroll contexts for primaries.\n - `segments.count` (or `sc`, `segmentsCount`): The number of segments for primaries and replicas.\n - `pri.segments.count`: The number of segments for primaries.\n - `segments.memory` (or `sm`, `segmentsMemory`): The memory used by segments for primaries and replicas.\n - `pri.segments.memory`: The memory used by segments for primaries.\n - `segments.index_writer_memory` (or `siwm`, `segmentsIndexWriterMemory`): The memory used by index writer for primaries and replicas.\n - `pri.segments.index_writer_memory`: The memory used by index writer for primaries.\n - `segments.version_map_memory` (or `svmm`, `segmentsVersionMapMemory`): The memory used by version map for primaries and replicas.\n - `pri.segments.version_map_memory`: The memory used by version map for primaries.\n - `segments.fixed_bitset_memory` (or `sfbm`, `fixedBitsetMemory`): The memory used by fixed bit sets for nested object field types and type filters for types referred in _parent fields. Applicable for primaries and replicas.\n - `pri.segments.fixed_bitset_memory`: The memory used by fixed bit sets for nested object field types and type filters for types referred in _parent fields. Applicable for primaries.\n - `warmer.current` (or `wc`, `warmerCurrent`): The current warmer operations for primaries and replicas.\n - `pri.warmer.current`: The current warmer operations for primaries.\n - `warmer.total` (or `wto`, `warmerTotal`): The total warmer operations for primaries and replicas.\n - `pri.warmer.total`: The total warmer operations for primaries.\n - `warmer.total_time` (or `wtt`, `warmerTotalTime`): The time spent in warmers for primaries and replicas.\n - `pri.warmer.total_time`: The time spent in warmers for primaries.\n - `suggest.current` (or `suc`, `suggestCurrent`): The current suggest operations for primaries and replicas.\n - `pri.suggest.current`: The current suggest operations for primaries.\n - `suggest.time` (or `suti`, `suggestTime`): The time spent in suggest for primaries and replicas.\n - `pri.suggest.time`: The time spent in suggest for primaries.\n - `suggest.total` (or `suto`, `suggestTotal`): The number of suggest operations for primaries and replicas.\n - `pri.suggest.total`: The number of suggest operations for primaries.\n - `memory.total` (or `tm`, `memoryTotal`): The total used memory for primaries and replicas.\n - `pri.memory.total`: The total used memory for primaries.\n - `bulk.total_operations` (or `bto`, `bulkTotalOperation`): The number of bulk shard operations for primaries and replicas.\n - `pri.bulk.total_operations`: The number of bulk shard operations for primaries.\n - `bulk.total_time` (or `btti`, `bulkTotalTime`): The time spent in shard bulk for primaries and replicas.\n - `pri.bulk.total_time`: The time spent in shard bulk for primaries.\n - `bulk.total_size_in_bytes` (or `btsi`, `bulkTotalSizeInBytes`): The total size in bytes of shard bulk for primaries and replicas.\n - `pri.bulk.total_size_in_bytes`: The total size in bytes of shard bulk for primaries.\n - `bulk.avg_time` (or `bati`, `bulkAvgTime`): The average time spent in shard bulk for primaries and replicas.\n - `pri.bulk.avg_time`: The average time spent in shard bulk for primaries.\n - `bulk.avg_size_in_bytes` (or `basi`, `bulkAvgSizeInBytes`): The average size in bytes of shard bulk for primaries and replicas.\n - `pri.bulk.avg_size_in_bytes`: The average size in bytes of shard bulk for primaries.\n - `dense_vector.value_count` (or `dvc`, `denseVectorCount`): The total count of indexed dense vectors for primaries and replicas.\n - `pri.dense_vector.value_count`: The total count of indexed dense vectors for primaries.\n - `sparse_vector.value_count` (or `svc`, `sparseVectorCount`): The total count of indexed sparse vectors for primaries and replicas.\n - `pri.sparse_vector.value_count`: The total count of indexed sparse vectors for primaries.\n\n" schema: $ref: '#/components/schemas/cat._types.CatIndicesColumns' cat.indices-s: name: s in: query description: "List of columns that determine how the table should be sorted.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name." schema: $ref: '#/components/schemas/_types.Names' cat.ml_data_frame_analytics-id: name: id in: path description: The ID of the data frame analytics to fetch required: true schema: $ref: '#/components/schemas/_types.Id' cat.ml_data_frame_analytics-allow_no_match: name: allow_no_match in: query description: "Whether to ignore if a wildcard expression matches no configs.\n(This includes `_all` string or when no configs have been specified.)" schema: type: boolean default: false cat.ml_data_frame_analytics-h: name: h in: query description: "Comma-separated list of column names to display.\n\nSupported values include:\n - `assignment_explanation` (or `ae`): Contains messages relating to the selection of a node.\n - `create_time` (or `ct`, `createTime`): The time when the data frame analytics job was created.\n - `description` (or `d`): A description of a job.\n - `dest_index` (or `di`, `destIndex`): Name of the destination index.\n - `failure_reason` (or `fr`, `failureReason`): Contains messages about the reason why a data frame analytics job failed.\n - `id`: Identifier for the data frame analytics job.\n - `model_memory_limit` (or `mml`, `modelMemoryLimit`): The approximate maximum amount of memory resources that are permitted for\nthe data frame analytics job.\n - `node.address` (or `na`, `nodeAddress`): The network address of the node that the data frame analytics job is\nassigned to.\n - `node.ephemeral_id` (or `ne`, `nodeEphemeralId`): The ephemeral ID of the node that the data frame analytics job is assigned\nto.\n - `node.id` (or `ni`, `nodeId`): The unique identifier of the node that the data frame analytics job is\nassigned to.\n - `node.name` (or `nn`, `nodeName`): The name of the node that the data frame analytics job is assigned to.\n - `progress` (or `p`): The progress report of the data frame analytics job by phase.\n - `source_index` (or `si`, `sourceIndex`): Name of the source index.\n - `state` (or `s`): Current state of the data frame analytics job.\n - `type` (or `t`): The type of analysis that the data frame analytics job performs.\n - `version` (or `v`): The Elasticsearch version number in which the data frame analytics job was\ncreated.\n\n" schema: allOf: - $ref: '#/components/schemas/cat._types.CatDfaColumns' default: 'create_time,id,state,type' cat.ml_data_frame_analytics-s: name: s in: query description: "Comma-separated list of column names or column aliases used to sort the\nresponse.\n\nSupported values include:\n - `assignment_explanation` (or `ae`): Contains messages relating to the selection of a node.\n - `create_time` (or `ct`, `createTime`): The time when the data frame analytics job was created.\n - `description` (or `d`): A description of a job.\n - `dest_index` (or `di`, `destIndex`): Name of the destination index.\n - `failure_reason` (or `fr`, `failureReason`): Contains messages about the reason why a data frame analytics job failed.\n - `id`: Identifier for the data frame analytics job.\n - `model_memory_limit` (or `mml`, `modelMemoryLimit`): The approximate maximum amount of memory resources that are permitted for\nthe data frame analytics job.\n - `node.address` (or `na`, `nodeAddress`): The network address of the node that the data frame analytics job is\nassigned to.\n - `node.ephemeral_id` (or `ne`, `nodeEphemeralId`): The ephemeral ID of the node that the data frame analytics job is assigned\nto.\n - `node.id` (or `ni`, `nodeId`): The unique identifier of the node that the data frame analytics job is\nassigned to.\n - `node.name` (or `nn`, `nodeName`): The name of the node that the data frame analytics job is assigned to.\n - `progress` (or `p`): The progress report of the data frame analytics job by phase.\n - `source_index` (or `si`, `sourceIndex`): Name of the source index.\n - `state` (or `s`): Current state of the data frame analytics job.\n - `type` (or `t`): The type of analysis that the data frame analytics job performs.\n - `version` (or `v`): The Elasticsearch version number in which the data frame analytics job was\ncreated.\n\n" schema: $ref: '#/components/schemas/cat._types.CatDfaColumns' cat.ml_datafeeds-datafeed_id: name: datafeed_id in: path description: A numerical character string that uniquely identifies the datafeed. required: true schema: $ref: '#/components/schemas/_types.Id' cat.ml_datafeeds-allow_no_match: name: allow_no_match in: query description: "Specifies what to do when the request:\n\n* Contains wildcard expressions and there are no datafeeds that match.\n* Contains the `_all` string or no identifiers and there are no matches.\n* Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the API returns an empty datafeeds array when there are no matches and the subset of results when\nthere are partial matches. If `false`, the API returns a 404 status code when there are no matches or only\npartial matches." schema: type: boolean default: true cat.ml_datafeeds-h: name: h in: query description: "Comma-separated list of column names to display.\n\nSupported values include:\n - `ae` (or `assignment_explanation`): For started datafeeds only, contains messages relating to the selection of\na node.\n - `bc` (or `buckets.count`, `bucketsCount`): The number of buckets processed.\n - `id`: A numerical character string that uniquely identifies the datafeed.\n - `na` (or `node.address`, `nodeAddress`): For started datafeeds only, the network address of the node where the\ndatafeed is started.\n - `ne` (or `node.ephemeral_id`, `nodeEphemeralId`): For started datafeeds only, the ephemeral ID of the node where the\ndatafeed is started.\n - `ni` (or `node.id`, `nodeId`): For started datafeeds only, the unique identifier of the node where the\ndatafeed is started.\n - `nn` (or `node.name`, `nodeName`): For started datafeeds only, the name of the node where the datafeed is\nstarted.\n - `sba` (or `search.bucket_avg`, `searchBucketAvg`): The average search time per bucket, in milliseconds.\n - `sc` (or `search.count`, `searchCount`): The number of searches run by the datafeed.\n - `seah` (or `search.exp_avg_hour`, `searchExpAvgHour`): The exponential average search time per hour, in milliseconds.\n - `st` (or `search.time`, `searchTime`): The total time the datafeed spent searching, in milliseconds.\n - `s` (or `state`): The status of the datafeed: `starting`, `started`, `stopping`, or `stopped`.\nIf `starting`, the datafeed has been requested to start but has not yet\nstarted. If `started`, the datafeed is actively receiving data. If\n`stopping`, the datafeed has been requested to stop gracefully and is\ncompleting its final action. If `stopped`, the datafeed is stopped and will\nnot receive data until it is re-started.\n\n" schema: allOf: - $ref: '#/components/schemas/cat._types.CatDatafeedColumns' default: 'id,state,buckets.count,search.count' cat.ml_datafeeds-s: name: s in: query description: "Comma-separated list of column names or column aliases used to sort the response.\n\nSupported values include:\n - `ae` (or `assignment_explanation`): For started datafeeds only, contains messages relating to the selection of\na node.\n - `bc` (or `buckets.count`, `bucketsCount`): The number of buckets processed.\n - `id`: A numerical character string that uniquely identifies the datafeed.\n - `na` (or `node.address`, `nodeAddress`): For started datafeeds only, the network address of the node where the\ndatafeed is started.\n - `ne` (or `node.ephemeral_id`, `nodeEphemeralId`): For started datafeeds only, the ephemeral ID of the node where the\ndatafeed is started.\n - `ni` (or `node.id`, `nodeId`): For started datafeeds only, the unique identifier of the node where the\ndatafeed is started.\n - `nn` (or `node.name`, `nodeName`): For started datafeeds only, the name of the node where the datafeed is\nstarted.\n - `sba` (or `search.bucket_avg`, `searchBucketAvg`): The average search time per bucket, in milliseconds.\n - `sc` (or `search.count`, `searchCount`): The number of searches run by the datafeed.\n - `seah` (or `search.exp_avg_hour`, `searchExpAvgHour`): The exponential average search time per hour, in milliseconds.\n - `st` (or `search.time`, `searchTime`): The total time the datafeed spent searching, in milliseconds.\n - `s` (or `state`): The status of the datafeed: `starting`, `started`, `stopping`, or `stopped`.\nIf `starting`, the datafeed has been requested to start but has not yet\nstarted. If `started`, the datafeed is actively receiving data. If\n`stopping`, the datafeed has been requested to stop gracefully and is\ncompleting its final action. If `stopped`, the datafeed is stopped and will\nnot receive data until it is re-started.\n\n" schema: $ref: '#/components/schemas/cat._types.CatDatafeedColumns' cat.ml_jobs-job_id: name: job_id in: path description: Identifier for the anomaly detection job. required: true schema: $ref: '#/components/schemas/_types.Id' cat.ml_jobs-allow_no_match: name: allow_no_match in: query description: "Specifies what to do when the request:\n\n* Contains wildcard expressions and there are no jobs that match.\n* Contains the `_all` string or no identifiers and there are no matches.\n* Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the API returns an empty jobs array when there are no matches and the subset of results when there\nare partial matches. If `false`, the API returns a 404 status code when there are no matches or only partial\nmatches." schema: type: boolean default: true cat.ml_jobs-h: name: h in: query description: "Comma-separated list of column names to display.\n\nSupported values include:\n - `assignment_explanation` (or `ae`): For open anomaly detection jobs only, contains messages relating to the\nselection of a node to run the job.\n - `buckets.count` (or `bc`, `bucketsCount`): The number of bucket results produced by the job.\n - `buckets.time.exp_avg` (or `btea`, `bucketsTimeExpAvg`): Exponential moving average of all bucket processing times, in milliseconds.\n - `buckets.time.exp_avg_hour` (or `bteah`, `bucketsTimeExpAvgHour`): Exponentially-weighted moving average of bucket processing times calculated\nin a 1 hour time window, in milliseconds.\n - `buckets.time.max` (or `btmax`, `bucketsTimeMax`): Maximum among all bucket processing times, in milliseconds.\n - `buckets.time.min` (or `btmin`, `bucketsTimeMin`): Minimum among all bucket processing times, in milliseconds.\n - `buckets.time.total` (or `btt`, `bucketsTimeTotal`): Sum of all bucket processing times, in milliseconds.\n - `data.buckets` (or `db`, `dataBuckets`): The number of buckets processed.\n - `data.earliest_record` (or `der`, `dataEarliestRecord`): The timestamp of the earliest chronologically input document.\n - `data.empty_buckets` (or `deb`, `dataEmptyBuckets`): The number of buckets which did not contain any data.\n - `data.input_bytes` (or `dib`, `dataInputBytes`): The number of bytes of input data posted to the anomaly detection job.\n - `data.input_fields` (or `dif`, `dataInputFields`): The total number of fields in input documents posted to the anomaly\ndetection job. This count includes fields that are not used in the analysis.\nHowever, be aware that if you are using a datafeed, it extracts only the\nrequired fields from the documents it retrieves before posting them to the job.\n - `data.input_records` (or `dir`, `dataInputRecords`): The number of input documents posted to the anomaly detection job.\n - `data.invalid_dates` (or `did`, `dataInvalidDates`): The number of input documents with either a missing date field or a date\nthat could not be parsed.\n - `data.last` (or `dl`, `dataLast`): The timestamp at which data was last analyzed, according to server time.\n - `data.last_empty_bucket` (or `dleb`, `dataLastEmptyBucket`): The timestamp of the last bucket that did not contain any data.\n - `data.last_sparse_bucket` (or `dlsb`, `dataLastSparseBucket`): The timestamp of the last bucket that was considered sparse.\n - `data.latest_record` (or `dlr`, `dataLatestRecord`): The timestamp of the latest chronologically input document.\n - `data.missing_fields` (or `dmf`, `dataMissingFields`): The number of input documents that are missing a field that the anomaly\ndetection job is configured to analyze. Input documents with missing fields\nare still processed because it is possible that not all fields are missing.\n - `data.out_of_order_timestamps` (or `doot`, `dataOutOfOrderTimestamps`): The number of input documents that have a timestamp chronologically\npreceding the start of the current anomaly detection bucket offset by the\nlatency window. This information is applicable only when you provide data\nto the anomaly detection job by using the post data API. These out of order\ndocuments are discarded, since jobs require time series data to be in\nascending chronological order.\n - `data.processed_fields` (or `dpf`, `dataProcessedFields`): The total number of fields in all the documents that have been processed by\nthe anomaly detection job. Only fields that are specified in the detector\nconfiguration object contribute to this count. The timestamp is not\nincluded in this count.\n - `data.processed_records` (or `dpr`, `dataProcessedRecords`): The number of input documents that have been processed by the anomaly\ndetection job. This value includes documents with missing fields, since\nthey are nonetheless analyzed. If you use datafeeds and have aggregations\nin your search query, the processed record count is the number of\naggregation results processed, not the number of Elasticsearch documents.\n - `data.sparse_buckets` (or `dsb`, `dataSparseBuckets`): The number of buckets that contained few data points compared to the\nexpected number of data points.\n - `forecasts.memory.avg` (or `fmavg`, `forecastsMemoryAvg`): The average memory usage in bytes for forecasts related to the anomaly\ndetection job.\n - `forecasts.memory.max` (or `fmmax`, `forecastsMemoryMax`): The maximum memory usage in bytes for forecasts related to the anomaly\ndetection job.\n - `forecasts.memory.min` (or `fmmin`, `forecastsMemoryMin`): The minimum memory usage in bytes for forecasts related to the anomaly\ndetection job.\n - `forecasts.memory.total` (or `fmt`, `forecastsMemoryTotal`): The total memory usage in bytes for forecasts related to the anomaly\ndetection job.\n - `forecasts.records.avg` (or `fravg`, `forecastsRecordsAvg`): The average number of `m`odel_forecast` documents written for forecasts\nrelated to the anomaly detection job.\n - `forecasts.records.max` (or `frmax`, `forecastsRecordsMax`): The maximum number of `model_forecast` documents written for forecasts\nrelated to the anomaly detection job.\n - `forecasts.records.min` (or `frmin`, `forecastsRecordsMin`): The minimum number of `model_forecast` documents written for forecasts\nrelated to the anomaly detection job.\n - `forecasts.records.total` (or `frt`, `forecastsRecordsTotal`): The total number of `model_forecast` documents written for forecasts\nrelated to the anomaly detection job.\n - `forecasts.time.avg` (or `ftavg`, `forecastsTimeAvg`): The average runtime in milliseconds for forecasts related to the anomaly\ndetection job.\n - `forecasts.time.max` (or `ftmax`, `forecastsTimeMax`): The maximum runtime in milliseconds for forecasts related to the anomaly\ndetection job.\n - `forecasts.time.min` (or `ftmin`, `forecastsTimeMin`): The minimum runtime in milliseconds for forecasts related to the anomaly\ndetection job.\n - `forecasts.time.total` (or `ftt`, `forecastsTimeTotal`): The total runtime in milliseconds for forecasts related to the anomaly\ndetection job.\n - `forecasts.total` (or `ft`, `forecastsTotal`): The number of individual forecasts currently available for the job.\n - `id`: Identifier for the anomaly detection job.\n - `model.bucket_allocation_failures` (or `mbaf`, `modelBucketAllocationFailures`): The number of buckets for which new entities in incoming data were not\nprocessed due to insufficient model memory.\n - `model.by_fields` (or `mbf`, `modelByFields`): The number of by field values that were analyzed by the models. This value\nis cumulative for all detectors in the job.\n - `model.bytes` (or `mb`, `modelBytes`): The number of bytes of memory used by the models. This is the maximum value\nsince the last time the model was persisted. If the job is closed, this\nvalue indicates the latest size.\n - `model.bytes_exceeded` (or `mbe`, `modelBytesExceeded`): The number of bytes over the high limit for memory usage at the last\nallocation failure.\n - `model.categorization_status` (or `mcs`, `modelCategorizationStatus`): The status of categorization for the job: `ok` or `warn`. If `ok`,\ncategorization is performing acceptably well (or not being used at all). If\n`warn`, categorization is detecting a distribution of categories that\nsuggests the input data is inappropriate for categorization. Problems could\nbe that there is only one category, more than 90% of categories are rare,\nthe number of categories is greater than 50% of the number of categorized\ndocuments, there are no frequently matched categories, or more than 50% of\ncategories are dead.\n - `model.categorized_doc_count` (or `mcdc`, `modelCategorizedDocCount`): The number of documents that have had a field categorized.\n - `model.dead_category_count` (or `mdcc`, `modelDeadCategoryCount`): The number of categories created by categorization that will never be\nassigned again because another category’s definition makes it a superset of\nthe dead category. Dead categories are a side effect of the way\ncategorization has no prior training.\n - `model.failed_category_count` (or `mdcc`, `modelFailedCategoryCount`): The number of times that categorization wanted to create a new category but\ncouldn’t because the job had hit its model memory limit. This count does\nnot track which specific categories failed to be created. Therefore, you\ncannot use this value to determine the number of unique categories that\nwere missed.\n - `model.frequent_category_count` (or `mfcc`, `modelFrequentCategoryCount`): The number of categories that match more than 1% of categorized documents.\n - `model.log_time` (or `mlt`, `modelLogTime`): The timestamp when the model stats were gathered, according to server time.\n - `model.memory_limit` (or `mml`, `modelMemoryLimit`): The timestamp when the model stats were gathered, according to server time.\n - `model.memory_status` (or `mms`, `modelMemoryStatus`): The status of the mathematical models: `ok`, `soft_limit`, or `hard_limit`.\nIf `ok`, the models stayed below the configured value. If `soft_limit`, the\nmodels used more than 60% of the configured memory limit and older unused\nmodels will be pruned to free up space. Additionally, in categorization jobs\nno further category examples will be stored. If `hard_limit`, the models\nused more space than the configured memory limit. As a result, not all\nincoming data was processed.\n - `model.over_fields` (or `mof`, `modelOverFields`): The number of over field values that were analyzed by the models. This\nvalue is cumulative for all detectors in the job.\n - `model.partition_fields` (or `mpf`, `modelPartitionFields`): The number of partition field values that were analyzed by the models. This\nvalue is cumulative for all detectors in the job.\n - `model.rare_category_count` (or `mrcc`, `modelRareCategoryCount`): The number of categories that match just one categorized document.\n - `model.timestamp` (or `mt`, `modelTimestamp`): The timestamp of the last record when the model stats were gathered.\n - `model.total_category_count` (or `mtcc`, `modelTotalCategoryCount`): The number of categories created by categorization.\n - `node.address` (or `na`, `nodeAddress`): The network address of the node that runs the job. This information is\navailable only for open jobs.\n - `node.ephemeral_id` (or `ne`, `nodeEphemeralId`): The ephemeral ID of the node that runs the job. This information is\navailable only for open jobs.\n - `node.id` (or `ni`, `nodeId`): The unique identifier of the node that runs the job. This information is\navailable only for open jobs.\n - `node.name` (or `nn`, `nodeName`): The name of the node that runs the job. This information is available only\nfor open jobs.\n - `opened_time` (or `ot`): For open jobs only, the elapsed time for which the job has been open.\n - `state` (or `s`): The status of the anomaly detection job: `closed`, `closing`, `failed`,\n`opened`, or `opening`. If `closed`, the job finished successfully with its\nmodel state persisted. The job must be opened before it can accept further\ndata. If `closing`, the job close action is in progress and has not yet\ncompleted. A closing job cannot accept further data. If `failed`, the job\ndid not finish successfully due to an error. This situation can occur due\nto invalid input data, a fatal error occurring during the analysis, or an\nexternal interaction such as the process being killed by the Linux out of\nmemory (OOM) killer. If the job had irrevocably failed, it must be force\nclosed and then deleted. If the datafeed can be corrected, the job can be\nclosed and then re-opened. If `opened`, the job is available to receive and\nprocess data. If `opening`, the job open action is in progress and has not\nyet completed.\n\n" schema: allOf: - $ref: '#/components/schemas/cat._types.CatAnomalyDetectorColumns' default: 'buckets.count,data.processed_records,forecasts.total,id,model.bytes,model.memory_status,state' cat.ml_jobs-s: name: s in: query description: "Comma-separated list of column names or column aliases used to sort the response.\n\nSupported values include:\n - `assignment_explanation` (or `ae`): For open anomaly detection jobs only, contains messages relating to the\nselection of a node to run the job.\n - `buckets.count` (or `bc`, `bucketsCount`): The number of bucket results produced by the job.\n - `buckets.time.exp_avg` (or `btea`, `bucketsTimeExpAvg`): Exponential moving average of all bucket processing times, in milliseconds.\n - `buckets.time.exp_avg_hour` (or `bteah`, `bucketsTimeExpAvgHour`): Exponentially-weighted moving average of bucket processing times calculated\nin a 1 hour time window, in milliseconds.\n - `buckets.time.max` (or `btmax`, `bucketsTimeMax`): Maximum among all bucket processing times, in milliseconds.\n - `buckets.time.min` (or `btmin`, `bucketsTimeMin`): Minimum among all bucket processing times, in milliseconds.\n - `buckets.time.total` (or `btt`, `bucketsTimeTotal`): Sum of all bucket processing times, in milliseconds.\n - `data.buckets` (or `db`, `dataBuckets`): The number of buckets processed.\n - `data.earliest_record` (or `der`, `dataEarliestRecord`): The timestamp of the earliest chronologically input document.\n - `data.empty_buckets` (or `deb`, `dataEmptyBuckets`): The number of buckets which did not contain any data.\n - `data.input_bytes` (or `dib`, `dataInputBytes`): The number of bytes of input data posted to the anomaly detection job.\n - `data.input_fields` (or `dif`, `dataInputFields`): The total number of fields in input documents posted to the anomaly\ndetection job. This count includes fields that are not used in the analysis.\nHowever, be aware that if you are using a datafeed, it extracts only the\nrequired fields from the documents it retrieves before posting them to the job.\n - `data.input_records` (or `dir`, `dataInputRecords`): The number of input documents posted to the anomaly detection job.\n - `data.invalid_dates` (or `did`, `dataInvalidDates`): The number of input documents with either a missing date field or a date\nthat could not be parsed.\n - `data.last` (or `dl`, `dataLast`): The timestamp at which data was last analyzed, according to server time.\n - `data.last_empty_bucket` (or `dleb`, `dataLastEmptyBucket`): The timestamp of the last bucket that did not contain any data.\n - `data.last_sparse_bucket` (or `dlsb`, `dataLastSparseBucket`): The timestamp of the last bucket that was considered sparse.\n - `data.latest_record` (or `dlr`, `dataLatestRecord`): The timestamp of the latest chronologically input document.\n - `data.missing_fields` (or `dmf`, `dataMissingFields`): The number of input documents that are missing a field that the anomaly\ndetection job is configured to analyze. Input documents with missing fields\nare still processed because it is possible that not all fields are missing.\n - `data.out_of_order_timestamps` (or `doot`, `dataOutOfOrderTimestamps`): The number of input documents that have a timestamp chronologically\npreceding the start of the current anomaly detection bucket offset by the\nlatency window. This information is applicable only when you provide data\nto the anomaly detection job by using the post data API. These out of order\ndocuments are discarded, since jobs require time series data to be in\nascending chronological order.\n - `data.processed_fields` (or `dpf`, `dataProcessedFields`): The total number of fields in all the documents that have been processed by\nthe anomaly detection job. Only fields that are specified in the detector\nconfiguration object contribute to this count. The timestamp is not\nincluded in this count.\n - `data.processed_records` (or `dpr`, `dataProcessedRecords`): The number of input documents that have been processed by the anomaly\ndetection job. This value includes documents with missing fields, since\nthey are nonetheless analyzed. If you use datafeeds and have aggregations\nin your search query, the processed record count is the number of\naggregation results processed, not the number of Elasticsearch documents.\n - `data.sparse_buckets` (or `dsb`, `dataSparseBuckets`): The number of buckets that contained few data points compared to the\nexpected number of data points.\n - `forecasts.memory.avg` (or `fmavg`, `forecastsMemoryAvg`): The average memory usage in bytes for forecasts related to the anomaly\ndetection job.\n - `forecasts.memory.max` (or `fmmax`, `forecastsMemoryMax`): The maximum memory usage in bytes for forecasts related to the anomaly\ndetection job.\n - `forecasts.memory.min` (or `fmmin`, `forecastsMemoryMin`): The minimum memory usage in bytes for forecasts related to the anomaly\ndetection job.\n - `forecasts.memory.total` (or `fmt`, `forecastsMemoryTotal`): The total memory usage in bytes for forecasts related to the anomaly\ndetection job.\n - `forecasts.records.avg` (or `fravg`, `forecastsRecordsAvg`): The average number of `m`odel_forecast` documents written for forecasts\nrelated to the anomaly detection job.\n - `forecasts.records.max` (or `frmax`, `forecastsRecordsMax`): The maximum number of `model_forecast` documents written for forecasts\nrelated to the anomaly detection job.\n - `forecasts.records.min` (or `frmin`, `forecastsRecordsMin`): The minimum number of `model_forecast` documents written for forecasts\nrelated to the anomaly detection job.\n - `forecasts.records.total` (or `frt`, `forecastsRecordsTotal`): The total number of `model_forecast` documents written for forecasts\nrelated to the anomaly detection job.\n - `forecasts.time.avg` (or `ftavg`, `forecastsTimeAvg`): The average runtime in milliseconds for forecasts related to the anomaly\ndetection job.\n - `forecasts.time.max` (or `ftmax`, `forecastsTimeMax`): The maximum runtime in milliseconds for forecasts related to the anomaly\ndetection job.\n - `forecasts.time.min` (or `ftmin`, `forecastsTimeMin`): The minimum runtime in milliseconds for forecasts related to the anomaly\ndetection job.\n - `forecasts.time.total` (or `ftt`, `forecastsTimeTotal`): The total runtime in milliseconds for forecasts related to the anomaly\ndetection job.\n - `forecasts.total` (or `ft`, `forecastsTotal`): The number of individual forecasts currently available for the job.\n - `id`: Identifier for the anomaly detection job.\n - `model.bucket_allocation_failures` (or `mbaf`, `modelBucketAllocationFailures`): The number of buckets for which new entities in incoming data were not\nprocessed due to insufficient model memory.\n - `model.by_fields` (or `mbf`, `modelByFields`): The number of by field values that were analyzed by the models. This value\nis cumulative for all detectors in the job.\n - `model.bytes` (or `mb`, `modelBytes`): The number of bytes of memory used by the models. This is the maximum value\nsince the last time the model was persisted. If the job is closed, this\nvalue indicates the latest size.\n - `model.bytes_exceeded` (or `mbe`, `modelBytesExceeded`): The number of bytes over the high limit for memory usage at the last\nallocation failure.\n - `model.categorization_status` (or `mcs`, `modelCategorizationStatus`): The status of categorization for the job: `ok` or `warn`. If `ok`,\ncategorization is performing acceptably well (or not being used at all). If\n`warn`, categorization is detecting a distribution of categories that\nsuggests the input data is inappropriate for categorization. Problems could\nbe that there is only one category, more than 90% of categories are rare,\nthe number of categories is greater than 50% of the number of categorized\ndocuments, there are no frequently matched categories, or more than 50% of\ncategories are dead.\n - `model.categorized_doc_count` (or `mcdc`, `modelCategorizedDocCount`): The number of documents that have had a field categorized.\n - `model.dead_category_count` (or `mdcc`, `modelDeadCategoryCount`): The number of categories created by categorization that will never be\nassigned again because another category’s definition makes it a superset of\nthe dead category. Dead categories are a side effect of the way\ncategorization has no prior training.\n - `model.failed_category_count` (or `mdcc`, `modelFailedCategoryCount`): The number of times that categorization wanted to create a new category but\ncouldn’t because the job had hit its model memory limit. This count does\nnot track which specific categories failed to be created. Therefore, you\ncannot use this value to determine the number of unique categories that\nwere missed.\n - `model.frequent_category_count` (or `mfcc`, `modelFrequentCategoryCount`): The number of categories that match more than 1% of categorized documents.\n - `model.log_time` (or `mlt`, `modelLogTime`): The timestamp when the model stats were gathered, according to server time.\n - `model.memory_limit` (or `mml`, `modelMemoryLimit`): The timestamp when the model stats were gathered, according to server time.\n - `model.memory_status` (or `mms`, `modelMemoryStatus`): The status of the mathematical models: `ok`, `soft_limit`, or `hard_limit`.\nIf `ok`, the models stayed below the configured value. If `soft_limit`, the\nmodels used more than 60% of the configured memory limit and older unused\nmodels will be pruned to free up space. Additionally, in categorization jobs\nno further category examples will be stored. If `hard_limit`, the models\nused more space than the configured memory limit. As a result, not all\nincoming data was processed.\n - `model.over_fields` (or `mof`, `modelOverFields`): The number of over field values that were analyzed by the models. This\nvalue is cumulative for all detectors in the job.\n - `model.partition_fields` (or `mpf`, `modelPartitionFields`): The number of partition field values that were analyzed by the models. This\nvalue is cumulative for all detectors in the job.\n - `model.rare_category_count` (or `mrcc`, `modelRareCategoryCount`): The number of categories that match just one categorized document.\n - `model.timestamp` (or `mt`, `modelTimestamp`): The timestamp of the last record when the model stats were gathered.\n - `model.total_category_count` (or `mtcc`, `modelTotalCategoryCount`): The number of categories created by categorization.\n - `node.address` (or `na`, `nodeAddress`): The network address of the node that runs the job. This information is\navailable only for open jobs.\n - `node.ephemeral_id` (or `ne`, `nodeEphemeralId`): The ephemeral ID of the node that runs the job. This information is\navailable only for open jobs.\n - `node.id` (or `ni`, `nodeId`): The unique identifier of the node that runs the job. This information is\navailable only for open jobs.\n - `node.name` (or `nn`, `nodeName`): The name of the node that runs the job. This information is available only\nfor open jobs.\n - `opened_time` (or `ot`): For open jobs only, the elapsed time for which the job has been open.\n - `state` (or `s`): The status of the anomaly detection job: `closed`, `closing`, `failed`,\n`opened`, or `opening`. If `closed`, the job finished successfully with its\nmodel state persisted. The job must be opened before it can accept further\ndata. If `closing`, the job close action is in progress and has not yet\ncompleted. A closing job cannot accept further data. If `failed`, the job\ndid not finish successfully due to an error. This situation can occur due\nto invalid input data, a fatal error occurring during the analysis, or an\nexternal interaction such as the process being killed by the Linux out of\nmemory (OOM) killer. If the job had irrevocably failed, it must be force\nclosed and then deleted. If the datafeed can be corrected, the job can be\nclosed and then re-opened. If `opened`, the job is available to receive and\nprocess data. If `opening`, the job open action is in progress and has not\nyet completed.\n\n" schema: $ref: '#/components/schemas/cat._types.CatAnomalyDetectorColumns' cat.ml_trained_models-model_id: name: model_id in: path description: A unique identifier for the trained model. required: true schema: $ref: '#/components/schemas/_types.Id' cat.ml_trained_models-allow_no_match: name: allow_no_match in: query description: "Specifies what to do when the request: contains wildcard expressions and there are no models that match; contains the `_all` string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches.\nIf `true`, the API returns an empty array when there are no matches and the subset of results when there are partial matches.\nIf `false`, the API returns a 404 status code when there are no matches or only partial matches." schema: type: boolean default: true cat.ml_trained_models-h: name: h in: query description: "A comma-separated list of column names to display.\n\nSupported values include:\n - `create_time` (or `ct`): The time when the trained model was created.\n - `created_by` (or `c`, `createdBy`): Information on the creator of the trained model.\n - `data_frame_analytics_id` (or `df`, `dataFrameAnalytics`, `dfid`): Identifier for the data frame analytics job that created the model. Only\ndisplayed if it is still available.\n - `description` (or `d`): The description of the trained model.\n - `heap_size` (or `hs`, `modelHeapSize`): The estimated heap size to keep the trained model in memory.\n - `id`: Identifier for the trained model.\n - `ingest.count` (or `ic`, `ingestCount`): The total number of documents that are processed by the model.\n - `ingest.current` (or `icurr`, `ingestCurrent`): The total number of document that are currently being handled by the\ntrained model.\n - `ingest.failed` (or `if`, `ingestFailed`): The total number of failed ingest attempts with the trained model.\n - `ingest.pipelines` (or `ip`, `ingestPipelines`): The total number of ingest pipelines that are referencing the trained\nmodel.\n - `ingest.time` (or `it`, `ingestTime`): The total time that is spent processing documents with the trained model.\n - `license` (or `l`): The license level of the trained model.\n - `operations` (or `o`, `modelOperations`): The estimated number of operations to use the trained model. This number\nhelps measuring the computational complexity of the model.\n - `version` (or `v`): The Elasticsearch version number in which the trained model was created.\n\n" schema: $ref: '#/components/schemas/cat._types.CatTrainedModelsColumns' cat.ml_trained_models-s: name: s in: query description: "A comma-separated list of column names or aliases used to sort the response.\n\nSupported values include:\n - `create_time` (or `ct`): The time when the trained model was created.\n - `created_by` (or `c`, `createdBy`): Information on the creator of the trained model.\n - `data_frame_analytics_id` (or `df`, `dataFrameAnalytics`, `dfid`): Identifier for the data frame analytics job that created the model. Only\ndisplayed if it is still available.\n - `description` (or `d`): The description of the trained model.\n - `heap_size` (or `hs`, `modelHeapSize`): The estimated heap size to keep the trained model in memory.\n - `id`: Identifier for the trained model.\n - `ingest.count` (or `ic`, `ingestCount`): The total number of documents that are processed by the model.\n - `ingest.current` (or `icurr`, `ingestCurrent`): The total number of document that are currently being handled by the\ntrained model.\n - `ingest.failed` (or `if`, `ingestFailed`): The total number of failed ingest attempts with the trained model.\n - `ingest.pipelines` (or `ip`, `ingestPipelines`): The total number of ingest pipelines that are referencing the trained\nmodel.\n - `ingest.time` (or `it`, `ingestTime`): The total time that is spent processing documents with the trained model.\n - `license` (or `l`): The license level of the trained model.\n - `operations` (or `o`, `modelOperations`): The estimated number of operations to use the trained model. This number\nhelps measuring the computational complexity of the model.\n - `version` (or `v`): The Elasticsearch version number in which the trained model was created.\n\n" schema: $ref: '#/components/schemas/cat._types.CatTrainedModelsColumns' cat.ml_trained_models-from: name: from in: query description: Skips the specified number of transforms. schema: type: number default: 0 cat.ml_trained_models-size: name: size in: query description: The maximum number of transforms to display. schema: type: number default: 100 cat.recovery-index: name: index in: path description: "A comma-separated list of data streams, indices, and aliases used to limit the request.\nSupports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`." required: true schema: $ref: '#/components/schemas/_types.Indices' cat.recovery-active_only: name: active_only in: query description: 'If `true`, the response only includes shard recoveries that have not yet completed (excludes `done` stage).' schema: type: boolean default: false cat.recovery-detailed: name: detailed in: query description: 'If `true`, the response includes detailed information about shard recoveries.' schema: type: boolean default: false cat.recovery-index_: name: index in: query description: Comma-separated list or wildcard expression of index names to limit the returned information schema: $ref: '#/components/schemas/_types.Indices' cat.recovery-h: name: h in: query description: "A comma-separated list of columns names to display.\nIt supports simple wildcards.\n\nSupported values include:\n - `index` (or `i`, `idx`): The index name.\n - `shard` (or `s`, `sh`): The shard name.\n - `start_time` (or `start`): The recovery start time.\n - `start_time_millis` (or `start_millis`): The recovery start time in epoch milliseconds.\n - `stop_time` (or `stop`): The recovery stop time.\n - `stop_time_millis` (or `stop_millis`): The recovery stop time in epoch milliseconds.\n - `time` (or `t`, `ti`): The recovery time.\n - `type` (or `ty`): The recovery type.\n - `stage` (or `st`): The recovery stage.\n - `local_retries` (or `lr`): The number of times this recovery has failed in a way which is retried locally (i.e. on the data node).\n - `priority` (or `pr`): The recovery priority.\n - `gate` (or `g`): The name of the recovery gate that blocked recovery on the target node.\n\nThe value is `n/a` unless the recovery is queued in the `created` stage and blocked by a recovery gate.\n - `blocked_for_millis` (or `bf`): The elapsed time in milliseconds recovery is blocked for.\n\nThe value is `n/a` when the recovery is not blocked by a recovery gate.\n - `source_host` (or `shost`): The source host.\n - `source_node` (or `snode`): The source node name.\n - `target_host` (or `thost`): The target host.\n - `target_node` (or `tnode`): The target node name.\n - `repository` (or `rep`): The repository.\n - `snapshot` (or `snap`): The snapshot.\n - `files` (or `f`): The number of files to recover.\n - `files_recovered` (or `fr`): The files recovered.\n - `files_percent` (or `fp`): The percent of files recovered.\n - `files_total` (or `tf`): The total number of files.\n - `bytes` (or `b`): The number of bytes to recover.\n - `bytes_recovered` (or `br`): The bytes recovered.\n - `bytes_percent` (or `bp`): The percent of bytes recovered.\n - `bytes_total` (or `tb`): The total number of bytes.\n - `translog_ops` (or `to`): The number of translog ops to recover.\n - `translog_ops_recovered` (or `tor`): The translog ops recovered.\n - `translog_ops_percent` (or `top`): The percent of translog ops recovered.\n\n" schema: allOf: - $ref: '#/components/schemas/cat._types.CatRecoveryColumns' default: 'ip,hp,rp,r,m,n,cpu,l' cat.recovery-s: name: s in: query description: "A comma-separated list of column names or aliases that determines the sort order.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name." schema: $ref: '#/components/schemas/_types.Names' cat.segments-index: name: index in: path description: "A comma-separated list of data streams, indices, and aliases used to limit the request.\nSupports wildcards (`*`).\nTo target all data streams and indices, omit this parameter or use `*` or `_all`." required: true schema: $ref: '#/components/schemas/_types.Indices' cat.segments-h: name: h in: query description: "A comma-separated list of columns names to display.\nIt supports simple wildcards.\n\nSupported values include:\n - `index` (or `i`, `idx`): The name of the index.\n - `shard` (or `s`, `sh`): The name of the shard.\n - `prirep` (or `p`, `pr`, `primaryOrReplica`): The shard type. Returned values are 'primary' or 'replica'.\n - `ip`: IP address of the segment’s shard, such as '127.0.1.1'.\n - `segment`: The name of the segment, such as '_0'. The segment name is derived from the segment generation and used internally to create file names in the directory of the shard.\n - `generation`: Generation number, such as '0'. Elasticsearch increments this generation number for each segment written. Elasticsearch then uses this number to derive the segment name.\n - `docs.count`: The number of documents as reported by Lucene. This excludes deleted documents and counts any [nested documents](https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/nested) separately from their parents. It also excludes documents which were indexed recently and do not yet belong to a segment.\n - `docs.deleted`: The number of deleted documents as reported by Lucene, which may be higher or lower than the number of delete operations you have performed. This number excludes deletes that were performed recently and do not yet belong to a segment. Deleted documents are cleaned up by the [automatic merge process](https://www.elastic.co/docs/reference/elasticsearch/index-settings/merge) if it makes sense to do so. Also, Elasticsearch creates extra deleted documents to internally track the recent history of operations on a shard.\n - `size`: The disk space used by the segment, such as '50kb'.\n - `size.memory`: The bytes of segment data stored in memory for efficient search, such as '1264'. A value of '-1' indicates Elasticsearch was unable to compute this number.\n - `committed`: If 'true', the segments is synced to disk. Segments that are synced can survive a hard reboot. If 'false', the data from uncommitted segments is also stored in the transaction log so that Elasticsearch is able to replay changes on the next start.\n - `searchable`: If 'true', the segment is searchable. If 'false', the segment has most likely been written to disk but needs a [refresh](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-refresh) to be searchable.\n - `version`: The version of Lucene used to write the segment.\n - `compound`: If 'true', the segment is stored in a compound file. This means Lucene merged all files from the segment in a single file to save file descriptors.\n - `id`: The ID of the node, such as 'k0zy'.\n\n" schema: allOf: - $ref: '#/components/schemas/cat._types.CatSegmentsColumns' default: 'index,shard,prirep,ip,segment,generation,docs.count,docs.deleted,size,size.memory,committed,searchable,version,compound' cat.segments-s: name: s in: query description: "A comma-separated list of column names or aliases that determines the sort order.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name." schema: $ref: '#/components/schemas/_types.Names' cat.segments-local: name: local in: query description: "If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node." schema: type: boolean default: false cat.segments-master_timeout: name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s cat.segments-expand_wildcards: name: expand_wildcards in: query description: "Type of index that wildcard expressions can match. If the request can target data streams, this argument\ndetermines whether wildcard expressions match hidden data streams. Supports comma-separated values,\nsuch as open,hidden.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: open cat.segments-allow_no_indices: name: allow_no_indices in: query description: "A setting that does two separate checks on the index expression.\nIf `false`, the request returns an error (1) if any wildcard expression\n(including `_all` and `*`) resolves to zero matching indices or (2) if the\ncomplete set of resolved indices, aliases or data streams is empty after all\nexpressions are evaluated. If `true`, index expressions that resolve to no\nindices are allowed and the request returns an empty result." schema: type: boolean default: true cat.segments-ignore_throttled: name: ignore_throttled in: query description: 'If true, concrete, expanded or aliased indices are ignored when frozen.' schema: type: boolean default: false cat.segments-ignore_unavailable: name: ignore_unavailable in: query description: "If `false`, the request returns an error if it targets a concrete (non-wildcarded)\nindex, alias, or data stream that is missing, closed, or otherwise unavailable.\nIf `true`, unavailable concrete targets are silently ignored." schema: type: boolean default: false cat.segments-allow_closed: name: allow_closed in: query description: "If true, allow closed indices to be returned in the response otherwise if false, keep the legacy behaviour\nof throwing an exception if index pattern matches closed indices" schema: type: boolean default: false cat.shards-index: name: index in: path description: "A comma-separated list of data streams, indices, and aliases used to limit the request.\nSupports wildcards (`*`).\nTo target all data streams and indices, omit this parameter or use `*` or `_all`." required: true schema: $ref: '#/components/schemas/_types.Indices' cat.shards-h: name: h in: query description: "List of columns to appear in the response. Supports simple wildcards.\n\nSupported values include:\n - `completion.size` (or `cs`, `completionSize`): Size of completion. For example: `0b`.\n - `dataset.size`: Disk space used by the shard’s dataset, which may or may not be the size on\ndisk, but includes space used by the shard on object storage. Reported as a size value for example: `5kb`.\n - `dense_vector.value_count` (or `dvc`, `denseVectorCount`): Number of indexed dense vectors.\n - `docs` (or `d`, `dc`): Number of documents in shard, for example: `25`.\n - `fielddata.evictions` (or `fe`, `fielddataEvictions`): Fielddata cache evictions, for example: `0`.\n - `fielddata.memory_size` (or `fm`, `fielddataMemory`): Used fielddata cache memory, for example: `0b`.\n - `flush.total` (or `ft`, `flushTotal`): Number of flushes, for example: `1`.\n - `flush.total_time` (or `ftt`, `flushTotalTime`): Time spent in flush, for example: `1`.\n - `get.current` (or `gc`, `getCurrent`): Number of current get operations, for example: `0`.\n - `get.exists_time` (or `geti`, `getExistsTime`): Time spent in successful gets, for example: `14ms`.\n - `get.exists_total` (or `geto`, `getExistsTotal`): Number of successful get operations, for example: `2`.\n - `get.missing_time` (or `gmti`, `getMissingTime`): Time spent in failed gets, for example: `0s`.\n - `get.missing_total` (or `gmto`, `getMissingTotal`): Number of failed get operations, for example: `1`.\n - `get.time` (or `gti`, `getTime`): Time spent in get, for example: `14ms`.\n - `get.total` (or `gto`, `getTotal`): Number of get operations, for example: `2`.\n - `id`: ID of the node, for example: `k0zy`.\n - `index` (or `i`, `idx`): Name of the index.\n - `indexing.delete_current` (or `idc`, `indexingDeleteCurrent`): Number of current deletion operations, for example: `0`.\n - `indexing.delete_time` (or `idti`, `indexingDeleteTime`): Time spent in deletions, for example: `2ms`.\n - `indexing.delete_total` (or `idto`, `indexingDeleteTotal`): Number of deletion operations, for example: `2`.\n - `indexing.index_current` (or `iic`, `indexingIndexCurrent`): Number of current indexing operations, for example: `0`.\n - `indexing.index_failed_due_to_version_conflict` (or `iifvc`, `indexingIndexFailedDueToVersionConflict`): Number of failed indexing operations due to version conflict, for example: `0`.\n - `indexing.index_failed` (or `iif`, `indexingIndexFailed`): Number of failed indexing operations, for example: `0`.\n - `indexing.index_time` (or `iiti`, `indexingIndexTime`): Time spent in indexing, such as for example: `134ms`.\n - `indexing.index_total` (or `iito`, `indexingIndexTotal`): Number of indexing operations, for example: `1`.\n - `ip`: IP address of the node, for example: `127.0.1.1`.\n - `merges.current` (or `mc`, `mergesCurrent`): Number of current merge operations, for example: `0`.\n - `merges.current_docs` (or `mcd`, `mergesCurrentDocs`): Number of current merging documents, for example: `0`.\n - `merges.current_size` (or `mcs`, `mergesCurrentSize`): Size of current merges, for example: `0b`.\n - `merges.total` (or `mt`, `mergesTotal`): Number of completed merge operations, for example: `0`.\n - `merges.total_docs` (or `mtd`, `mergesTotalDocs`): Number of merged documents, for example: `0`.\n - `merges.total_size` (or `mts`, `mergesTotalSize`): Size of current merges, for example: `0b`.\n - `merges.total_time` (or `mtt`, `mergesTotalTime`): Time spent merging documents, for example: `0s`.\n - `node` (or `n`): Node name, for example: `I8hydUG`.\n - `prirep` (or `p`, `pr`, `primaryOrReplica`): Shard type. Returned values are `primary` or `replica`.\n - `query_cache.evictions` (or `qce`, `queryCacheEvictions`): Query cache evictions, for example: `0`.\n - `query_cache.memory_size` (or `qcm`, `queryCacheMemory`): Used query cache memory, for example: `0b`.\n - `recoverysource.type` (or `rs`): Type of recovery source.\n - `refresh.time` (or `rti`, `refreshTime`): Time spent in refreshes, for example: `91ms`.\n - `refresh.total` (or `rto`, `refreshTotal`): Number of refreshes, for example: `16`.\n - `search.fetch_current` (or `sfc`, `searchFetchCurrent`): Current fetch phase operations, for example: `0`.\n - `search.fetch_time` (or `sfti`, `searchFetchTime`): Time spent in fetch phase, for example: `37ms`.\n - `search.fetch_total` (or `sfto`, `searchFetchTotal`): Number of fetch operations, for example: `7`.\n - `search.open_contexts` (or `so`, `searchOpenContexts`): Open search contexts, for example: `0`.\n - `search.query_current` (or `sqc`, `searchQueryCurrent`): Current query phase operations, for example: `0`.\n - `search.query_time` (or `sqti`, `searchQueryTime`): Time spent in query phase, for example: `43ms`.\n - `search.query_total` (or `sqto`, `searchQueryTotal`): Number of query operations, for example: `9`.\n - `search.scroll_current` (or `scc`, `searchScrollCurrent`): Open scroll contexts, for example: `2`.\n - `search.scroll_time` (or `scti`, `searchScrollTime`): Time scroll contexts held open, for example: `2m`.\n - `search.scroll_total` (or `scto`, `searchScrollTotal`): Completed scroll contexts, for example: `1`.\n - `segments.count` (or `sc`, `segmentsCount`): Number of segments, for example: `4`.\n - `segments.fixed_bitset_memory` (or `sfbm`, `fixedBitsetMemory`): Memory used by fixed bit sets for nested object field types and type filters for types referred in join fields, for example: `1.0kb`.\n - `segments.index_writer_memory` (or `siwm`, `segmentsIndexWriterMemory`): Memory used by index writer, for example: `18mb`.\n - `segments.memory` (or `sm`, `segmentsMemory`): Memory used by segments, for example: `1.4kb`.\n - `segments.version_map_memory` (or `svmm`, `segmentsVersionMapMemory`): Memory used by version map, for example: `1.0kb`.\n - `seq_no.global_checkpoint` (or `sqg`, `globalCheckpoint`): Global checkpoint.\n - `seq_no.local_checkpoint` (or `sql`, `localCheckpoint`): Local checkpoint.\n - `seq_no.max` (or `sqm`, `maxSeqNo`): Maximum sequence number.\n - `shard` (or `s`, `sh`): Name of the shard.\n - `dsparse_vector.value_count` (or `svc`, `sparseVectorCount`): Number of indexed [sparse vectors](https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/sparse-vector).\n - `state` (or `st`): State of the shard. Returned values are:\n* `INITIALIZING`: The shard is recovering from a peer shard or gateway.\n* `RELOCATING`: The shard is relocating.\n* `STARTED`: The shard has started.\n* `UNASSIGNED`: The shard is not assigned to any node.\n - `store` (or `sto`): Disk space used by the shard, for example: `5kb`.\n - `suggest.current` (or `suc`, `suggestCurrent`): Number of current suggest operations, for example: `0`.\n - `suggest.time` (or `suti`, `suggestTime`): Time spent in suggest, for example: `0`.\n - `suggest.total` (or `suto`, `suggestTotal`): Number of suggest operations, for example: `0`.\n - `sync_id`: Sync ID of the shard.\n - `unassigned.at` (or `ua`): Time at which the shard became unassigned in [Coordinated Universal Time (UTC)](https://en.wikipedia.org/wiki/List_of_UTC_offsets).\n - `unassigned.details` (or `ud`): Details about why the shard became unassigned. This does not explain why the shard is currently unassigned. To understand why a shard\nis not assigned, use the [Cluster allocation explain](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-allocation-explain) API.\n - `unassigned.for` (or `uf`): Time at which the shard was requested to be unassigned in [Coordinated Universal Time (UTC)](https://en.wikipedia.org/wiki/List_of_UTC_offsets).\n - `unassigned.reason` (or `ur`): Indicates the reason for the last change to the state of this unassigned shard. This does not explain why the shard is currently unassigned.\nTo understand why a shard is not assigned, use the [Cluster allocation explain](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-allocation-explain) API. Returned values include:\n\n* `ALLOCATION_FAILED`: Unassigned as a result of a failed allocation of the shard.\n* `CLUSTER_RECOVERED`: Unassigned as a result of a full cluster recovery.\n* `DANGLING_INDEX_IMPORTED`: Unassigned as a result of importing a dangling index.\n* `EXISTING_INDEX_RESTORED`: Unassigned as a result of restoring into a closed index.\n* `FORCED_EMPTY_PRIMARY`: The shard’s allocation was last modified by forcing an empty primary using the Cluster reroute API.\n* `INDEX_CLOSED`: Unassigned because the index was closed.\n* `INDEX_CREATED`: Unassigned as a result of an API creation of an index.\n* `INDEX_REOPENED`: Unassigned as a result of opening a closed index.\n* `MANUAL_ALLOCATION`: The shard’s allocation was last modified by the Cluster reroute API.\n* `NEW_INDEX_RESTORED`: Unassigned as a result of restoring into a new index.\n* `NODE_LEFT`: Unassigned as a result of the node hosting it leaving the cluster.\n* `NODE_RESTARTING`: Similar to `NODE_LEFT`, except that the node was registered as restarting using the Node shutdown API.\n* `PRIMARY_FAILED`: The shard was initializing as a replica, but the primary shard failed before the initialization completed.\n* `REALLOCATED_REPLICA`: A better replica location is identified and causes the existing replica allocation to be cancelled.\n* `REINITIALIZED`: When a shard moves from started back to initializing.\n* `REPLICA_ADDED`: Unassigned as a result of explicit addition of a replica.\n* `REROUTE_CANCELLED`: Unassigned as a result of explicit cancel reroute command.\n\n" schema: $ref: '#/components/schemas/cat._types.CatShardColumns' cat.shards-s: name: s in: query description: "A comma-separated list of column names or aliases that determines the sort order.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name." schema: $ref: '#/components/schemas/_types.Names' cat.shards-master_timeout: name: master_timeout in: query description: The period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s cat.snapshots-repository: name: repository in: path description: "A comma-separated list of snapshot repositories used to limit the request.\nAccepts wildcard expressions.\n`_all` returns all repositories.\nIf any repository fails during the request, Elasticsearch returns an error." required: true schema: $ref: '#/components/schemas/_types.Names' cat.snapshots-ignore_unavailable: name: ignore_unavailable in: query description: 'If `true`, the response does not include information from unavailable snapshots.' schema: type: boolean default: false cat.snapshots-h: name: h in: query description: "A comma-separated list of columns names to display.\nIt supports simple wildcards.\n\nSupported values include:\n - `id` (or `snapshot`): The ID of the snapshot, such as 'snap1'.\n - `repository` (or `re`, `repo`): The name of the repository, such as 'repo1'.\n - `status` (or `s`): State of the snapshot process. Returned values are: 'FAILED': The snapshot process failed. 'INCOMPATIBLE': The snapshot process is incompatible with the current cluster version. 'IN_PROGRESS': The snapshot process started but has not completed. 'PARTIAL': The snapshot process completed with a partial success. 'SUCCESS': The snapshot process completed with a full success.\n - `start_epoch` (or `ste`, `startEpoch`): The [unix epoch time](https://en.wikipedia.org/wiki/Unix_time) at which the snapshot process started.\n - `start_time` (or `sti`, `startTime`): 'HH:MM:SS' time at which the snapshot process started.\n - `end_epoch` (or `ete`, `endEpoch`): The [unix epoch time](https://en.wikipedia.org/wiki/Unix_time) at which the snapshot process ended.\n - `end_time` (or `eti`, `endTime`): 'HH:MM:SS' time at which the snapshot process ended.\n - `duration` (or `dur`): The time it took the snapshot process to complete in [time units](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/api-conventions#time-units).\n - `indices` (or `i`): The number of indices in the snapshot.\n - `successful_shards` (or `ss`): The number of successful shards in the snapshot.\n - `failed_shards` (or `fs`): The number of failed shards in the snapshot.\n - `total_shards` (or `ts`): The total number of shards in the snapshot.\n - `reason` (or `r`): The reason for any snapshot failures.\n\n" schema: allOf: - $ref: '#/components/schemas/cat._types.CatSnapshotsColumns' default: 'id,repository,status,start_epoch,start_time,end_epoch,end_time,duration,indices,successful_shards,failed_shards,total_shards' cat.snapshots-s: name: s in: query description: "List of columns that determine how the table should be sorted.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name." schema: $ref: '#/components/schemas/_types.Names' cat.snapshots-master_timeout: name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s cat.templates-name: name: name in: path description: "The name of the template to return.\nAccepts wildcard expressions. If omitted, all templates are returned." required: true schema: $ref: '#/components/schemas/_types.Name' cat.templates-h: name: h in: query description: "A comma-separated list of columns names to display. It supports simple wildcards.\n\nSupported values include:\n - `name` (or `n`): The template name.\n - `index_patterns` (or `t`): The template index patterns.\n - `order` (or `o`, `p`): The template application order or priority number.\n - `version` (or `v`): The version.\n - `composed_of` (or `c`): The component templates comprising the index template.\n\n" schema: $ref: '#/components/schemas/cat._types.CatTemplatesColumns' cat.templates-s: name: s in: query description: "List of columns that determine how the table should be sorted.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name." schema: $ref: '#/components/schemas/_types.Names' cat.templates-local: name: local in: query description: "If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node." schema: type: boolean default: false cat.templates-master_timeout: name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s cat.thread_pool-thread_pool_patterns: name: thread_pool_patterns in: path description: "A comma-separated list of thread pool names used to limit the request.\nAccepts wildcard expressions." required: true schema: $ref: '#/components/schemas/_types.Names' cat.thread_pool-h: name: h in: query description: "List of columns to appear in the response. Supports simple wildcards.\n\nSupported values include:\n - `active` (or `a`): Number of active threads in the current thread pool.\n - `completed` (or `c`): Number of tasks completed by the thread pool executor.\n - `core` (or `cr`): Configured core number of active threads allowed in the current thread pool.\n - `ephemeral_id` (or `eid`): Ephemeral node ID.\n - `host` (or `h`): Hostname for the current node.\n - `ip` (or `i`): IP address for the current node.\n - `keep_alive` (or `k`): Configured keep alive time for threads.\n - `largest` (or `l`): Highest number of active threads in the current thread pool.\n - `max` (or `mx`): Configured maximum number of active threads allowed in the current thread pool.\n - `name`: Name of the thread pool, such as `analyze` or `generic`.\n - `node_id` (or `id`): ID of the node, such as `k0zy`.\n - `node_name`: Node name, such as `I8hydUG`.\n - `pid` (or `p`): Process ID of the running node.\n - `pool_size` (or `psz`): Number of threads in the current thread pool.\n - `port` (or `po`): Bound transport port for the current node.\n - `queue` (or `q`): Number of tasks in the queue for the current thread pool.\n - `queue_size` (or `qs`): Maximum number of tasks permitted in the queue for the current thread pool.\n - `rejected` (or `r`): Number of tasks rejected by the thread pool executor.\n - `size` (or `sz`): Configured fixed number of active threads allowed in the current thread pool.\n - `type` (or `t`): Type of thread pool. Returned values are `fixed`, `fixed_auto_queue_size`, `direct`, or `scaling`.\n\n" schema: $ref: '#/components/schemas/cat._types.CatThreadPoolColumns' cat.thread_pool-s: name: s in: query description: "A comma-separated list of column names or aliases that determines the sort order.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name." schema: $ref: '#/components/schemas/_types.Names' cat.thread_pool-local: name: local in: query description: "If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node." schema: type: boolean default: false cat.thread_pool-master_timeout: name: master_timeout in: query description: The period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s cat.transforms-transform_id: name: transform_id in: path description: "A transform identifier or a wildcard expression.\nIf you do not specify one of these options, the API returns information for all transforms." required: true schema: $ref: '#/components/schemas/_types.Id' cat.transforms-allow_no_match: name: allow_no_match in: query description: "Specifies what to do when the request: contains wildcard expressions and there are no transforms that match; contains the `_all` string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches.\nIf `true`, it returns an empty transforms array when there are no matches and the subset of results when there are partial matches.\nIf `false`, the request returns a 404 status code when there are no matches or only partial matches." schema: type: boolean default: true cat.transforms-from: name: from in: query description: Skips the specified number of transforms. schema: type: number default: 0 cat.transforms-h: name: h in: query description: "Comma-separated list of column names to display.\n\nSupported values include:\n - `changes_last_detection_time` (or `cldt`): The timestamp when changes were last detected in the source indices.\n - `checkpoint` (or `cp`): The sequence number for the checkpoint.\n - `checkpoint_duration_time_exp_avg` (or `cdtea`, `checkpointTimeExpAvg`): Exponential moving average of the duration of the checkpoint, in\nmilliseconds.\n - `checkpoint_progress` (or `c`, `checkpointProgress`): The progress of the next checkpoint that is currently in progress.\n - `create_time` (or `ct`, `createTime`): The time the transform was created.\n - `delete_time` (or `dtime`): The amount of time spent deleting, in milliseconds.\n - `description` (or `d`): The description of the transform.\n - `dest_index` (or `di`, `destIndex`): The destination index for the transform. The mappings of the destination\nindex are deduced based on the source fields when possible. If alternate\nmappings are required, use the Create index API prior to starting the\ntransform.\n - `documents_deleted` (or `docd`): The number of documents that have been deleted from the destination index\ndue to the retention policy for this transform.\n - `documents_indexed` (or `doci`): The number of documents that have been indexed into the destination index\nfor the transform.\n - `docs_per_second` (or `dps`): Specifies a limit on the number of input documents per second. This setting\nthrottles the transform by adding a wait time between search requests. The\ndefault value is `null`, which disables throttling.\n - `documents_processed` (or `docp`): The number of documents that have been processed from the source index of\nthe transform.\n - `frequency` (or `f`): The interval between checks for changes in the source indices when the\ntransform is running continuously. Also determines the retry interval in\nthe event of transient failures while the transform is searching or\nindexing. The minimum value is `1s` and the maximum is `1h`. The default\nvalue is `1m`.\n - `id`: Identifier for the transform.\n - `index_failure` (or `if`): The number of indexing failures.\n - `index_time` (or `itime`): The amount of time spent indexing, in milliseconds.\n - `index_total` (or `it`): The number of index operations.\n - `indexed_documents_exp_avg` (or `idea`): Exponential moving average of the number of new documents that have been\nindexed.\n - `last_search_time` (or `lst`, `lastSearchTime`): The timestamp of the last search in the source indices. This field is only\nshown if the transform is running.\n - `max_page_search_size` (or `mpsz`): Defines the initial page size to use for the composite aggregation for each\ncheckpoint. If circuit breaker exceptions occur, the page size is\ndynamically adjusted to a lower value. The minimum value is `10` and the\nmaximum is `65,536`. The default value is `500`.\n - `pages_processed` (or `pp`): The number of search or bulk index operations processed. Documents are\nprocessed in batches instead of individually.\n - `pipeline` (or `p`): The unique identifier for an ingest pipeline.\n - `processed_documents_exp_avg` (or `pdea`): Exponential moving average of the number of documents that have been\nprocessed.\n - `processing_time` (or `pt`): The amount of time spent processing results, in milliseconds.\n - `reason` (or `r`): If a transform has a `failed` state, this property provides details about\nthe reason for the failure.\n - `search_failure` (or `sf`): The number of search failures.\n - `search_time` (or `stime`): The amount of time spent searching, in milliseconds.\n - `search_total` (or `st`): The number of search operations on the source index for the transform.\n - `source_index` (or `si`, `sourceIndex`): The source indices for the transform. It can be a single index, an index\npattern (for example, `\"my-index-*\"`), an array of indices (for example,\n`[\"my-index-000001\", \"my-index-000002\"]`), or an array of index patterns\n(for example, `[\"my-index-*\", \"my-other-index-*\"]`. For remote indices use\nthe syntax `\"remote_name:index_name\"`. If any indices are in remote\nclusters then the master node and at least one transform node must have the\n`remote_cluster_client` node role.\n - `state` (or `s`): The status of the transform, which can be one of the following values:\n\n* `aborting`: The transform is aborting.\n* `failed`: The transform failed. For more information about the failure,\ncheck the reason field.\n* `indexing`: The transform is actively processing data and creating new\ndocuments.\n* `started`: The transform is running but not actively indexing data.\n* `stopped`: The transform is stopped.\n* `stopping`: The transform is stopping.\n - `transform_type` (or `tt`): Indicates the type of transform: `batch` or `continuous`.\n - `trigger_count` (or `tc`): The number of times the transform has been triggered by the scheduler. For\nexample, the scheduler triggers the transform indexer to check for updates\nor ingest new data at an interval specified in the `frequency` property.\n - `version` (or `v`): The version of Elasticsearch that existed on the node when the transform\nwas created.\n\n" schema: allOf: - $ref: '#/components/schemas/cat._types.CatTransformColumns' default: 'changes_last_detection_time,checkpoint,checkpoint_progress,documents_processed,id,last_search_time,state' cat.transforms-s: name: s in: query description: "Comma-separated list of column names or column aliases used to sort the response.\n\nSupported values include:\n - `changes_last_detection_time` (or `cldt`): The timestamp when changes were last detected in the source indices.\n - `checkpoint` (or `cp`): The sequence number for the checkpoint.\n - `checkpoint_duration_time_exp_avg` (or `cdtea`, `checkpointTimeExpAvg`): Exponential moving average of the duration of the checkpoint, in\nmilliseconds.\n - `checkpoint_progress` (or `c`, `checkpointProgress`): The progress of the next checkpoint that is currently in progress.\n - `create_time` (or `ct`, `createTime`): The time the transform was created.\n - `delete_time` (or `dtime`): The amount of time spent deleting, in milliseconds.\n - `description` (or `d`): The description of the transform.\n - `dest_index` (or `di`, `destIndex`): The destination index for the transform. The mappings of the destination\nindex are deduced based on the source fields when possible. If alternate\nmappings are required, use the Create index API prior to starting the\ntransform.\n - `documents_deleted` (or `docd`): The number of documents that have been deleted from the destination index\ndue to the retention policy for this transform.\n - `documents_indexed` (or `doci`): The number of documents that have been indexed into the destination index\nfor the transform.\n - `docs_per_second` (or `dps`): Specifies a limit on the number of input documents per second. This setting\nthrottles the transform by adding a wait time between search requests. The\ndefault value is `null`, which disables throttling.\n - `documents_processed` (or `docp`): The number of documents that have been processed from the source index of\nthe transform.\n - `frequency` (or `f`): The interval between checks for changes in the source indices when the\ntransform is running continuously. Also determines the retry interval in\nthe event of transient failures while the transform is searching or\nindexing. The minimum value is `1s` and the maximum is `1h`. The default\nvalue is `1m`.\n - `id`: Identifier for the transform.\n - `index_failure` (or `if`): The number of indexing failures.\n - `index_time` (or `itime`): The amount of time spent indexing, in milliseconds.\n - `index_total` (or `it`): The number of index operations.\n - `indexed_documents_exp_avg` (or `idea`): Exponential moving average of the number of new documents that have been\nindexed.\n - `last_search_time` (or `lst`, `lastSearchTime`): The timestamp of the last search in the source indices. This field is only\nshown if the transform is running.\n - `max_page_search_size` (or `mpsz`): Defines the initial page size to use for the composite aggregation for each\ncheckpoint. If circuit breaker exceptions occur, the page size is\ndynamically adjusted to a lower value. The minimum value is `10` and the\nmaximum is `65,536`. The default value is `500`.\n - `pages_processed` (or `pp`): The number of search or bulk index operations processed. Documents are\nprocessed in batches instead of individually.\n - `pipeline` (or `p`): The unique identifier for an ingest pipeline.\n - `processed_documents_exp_avg` (or `pdea`): Exponential moving average of the number of documents that have been\nprocessed.\n - `processing_time` (or `pt`): The amount of time spent processing results, in milliseconds.\n - `reason` (or `r`): If a transform has a `failed` state, this property provides details about\nthe reason for the failure.\n - `search_failure` (or `sf`): The number of search failures.\n - `search_time` (or `stime`): The amount of time spent searching, in milliseconds.\n - `search_total` (or `st`): The number of search operations on the source index for the transform.\n - `source_index` (or `si`, `sourceIndex`): The source indices for the transform. It can be a single index, an index\npattern (for example, `\"my-index-*\"`), an array of indices (for example,\n`[\"my-index-000001\", \"my-index-000002\"]`), or an array of index patterns\n(for example, `[\"my-index-*\", \"my-other-index-*\"]`. For remote indices use\nthe syntax `\"remote_name:index_name\"`. If any indices are in remote\nclusters then the master node and at least one transform node must have the\n`remote_cluster_client` node role.\n - `state` (or `s`): The status of the transform, which can be one of the following values:\n\n* `aborting`: The transform is aborting.\n* `failed`: The transform failed. For more information about the failure,\ncheck the reason field.\n* `indexing`: The transform is actively processing data and creating new\ndocuments.\n* `started`: The transform is running but not actively indexing data.\n* `stopped`: The transform is stopped.\n* `stopping`: The transform is stopping.\n - `transform_type` (or `tt`): Indicates the type of transform: `batch` or `continuous`.\n - `trigger_count` (or `tc`): The number of times the transform has been triggered by the scheduler. For\nexample, the scheduler triggers the transform indexer to check for updates\nor ingest new data at an interval specified in the `frequency` property.\n - `version` (or `v`): The version of Elasticsearch that existed on the node when the transform\nwas created.\n\n" schema: $ref: '#/components/schemas/cat._types.CatTransformColumns' cat.transforms-size: name: size in: query description: The maximum number of transforms to obtain. schema: type: number default: 100 ccr.get_auto_follow_pattern-name: name: name in: path description: "The auto-follow pattern collection that you want to retrieve.\nIf you do not specify a name, the API returns information for all collections." required: true schema: $ref: '#/components/schemas/_types.Name' ccr.get_auto_follow_pattern-master_timeout: name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nIt can also be set to `-1` to indicate that the request should never timeout." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s clear_scroll-scroll_id: name: scroll_id in: path description: "A comma-separated list of scroll IDs to clear.\nTo clear all scroll IDs, use `_all`.\nIMPORTANT: Scroll IDs can be long. It is recommended to specify scroll IDs in the request body parameter." required: true deprecated: true schema: $ref: '#/components/schemas/_types.ScrollIds' cluster.allocation_explain-index: name: index in: query description: The name of the index that you would like an explanation for. schema: $ref: '#/components/schemas/_types.IndexName' cluster.allocation_explain-shard: name: shard in: query description: An identifier for the shard that you would like an explanation for. schema: type: number cluster.allocation_explain-primary: name: primary in: query description: 'If true, returns an explanation for the primary shard for the specified shard ID.' schema: type: boolean cluster.allocation_explain-current_node: name: current_node in: query description: Explain a shard only if it is currently located on the specified node name or node ID. schema: $ref: '#/components/schemas/_types.NodeId' cluster.allocation_explain-include_disk_info: name: include_disk_info in: query description: 'If true, returns information about disk usage and shard sizes.' schema: type: boolean default: false cluster.allocation_explain-include_yes_decisions: name: include_yes_decisions in: query description: 'If true, returns YES decisions in explanation.' schema: type: boolean default: false cluster.allocation_explain-master_timeout: name: master_timeout in: query description: Period to wait for a connection to the master node. schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s cluster.get_component_template-name: name: name in: path description: Name of component template to retrieve. Wildcard (`*`) expressions are supported. required: true schema: $ref: '#/components/schemas/_types.Name' cluster.get_component_template-flat_settings: name: flat_settings in: query description: 'If `true`, returns settings in flat format.' schema: type: boolean default: false cluster.get_component_template-settings_filter: name: settings_filter in: query description: 'Filter out results, for example to filter out sensitive information. Supports wildcards or full settings keys' schema: oneOf: - type: string - type: array items: type: string cluster.get_component_template-include_defaults: name: include_defaults in: query description: Return all default configurations for the component template schema: type: boolean default: false x-state: Generally available; Added in 8.11.0 cluster.get_component_template-local: name: local in: query description: "If `true`, the request retrieves information from the local node only.\nIf `false`, information is retrieved from the master node." deprecated: true schema: type: boolean default: false cluster.get_component_template-master_timeout: name: master_timeout in: query description: "Period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s cluster.health-index: name: index in: path description: "A comma-separated list of data streams, indices, and index aliases that limit the request.\nWildcard expressions (`*`) are supported.\nTo target all data streams and indices in a cluster, omit this parameter or use _all or `*`." required: true schema: $ref: '#/components/schemas/_types.Indices' cluster.health-expand_wildcards: name: expand_wildcards in: query description: "Expand wildcard expression to concrete indices that are open, closed or both.\n\nSupported values include:\n - `all`: Match any data stream or index, including hidden ones.\n - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.\n - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.\n - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.\n - `none`: Wildcard expressions are not accepted.\n\n" schema: allOf: - $ref: '#/components/schemas/_types.ExpandWildcards' default: all cluster.health-level: name: level in: query description: Return health information at a specific level of detail. schema: allOf: - $ref: '#/components/schemas/_types.Level' default: cluster cluster.health-local: name: local in: query description: "If true, retrieve information from the local node only.\nIf false, retrieve information from the master node." schema: type: boolean default: false cluster.health-master_timeout: name: master_timeout in: query description: "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s cluster.health-timeout: name: timeout in: query description: "The period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error." schema: allOf: - $ref: '#/components/schemas/_types.Duration' default: 30s cluster.health-wait_for_active_shards: name: wait_for_active_shards in: query description: "Wait for the specified number of active shards.\nUse `all` to wait for all shards in the cluster to be active.\nUse `0` to not wait." schema: allOf: - $ref: '#/components/schemas/_types.WaitForActiveShards' default: '0' cluster.health-wait_for_events: name: wait_for_events in: query description: Wait until all currently queued events with the given priority are processed. schema: $ref: '#/components/schemas/_types.WaitForEvents' cluster.health-wait_for_nodes: name: wait_for_nodes in: query description: "Wait until the specified number (N) of nodes is available.\nIt also accepts `>=N`, `<=N`, `>N` and `