From 947b48ad6c23816864b84e4a4f21c2d5cbae7291 Mon Sep 17 00:00:00 2001 From: Keith Massey Date: Thu, 5 Mar 2026 15:54:32 -0600 Subject: [PATCH] Removing random sampling APIs --- output/schema/schema.json | 1826 +++-------------- output/typescript/types.ts | 92 - specification/_doc_ids/table.csv | 1 - .../indices/_types/SampleConfiguration.ts | 64 - ...IndicesDeleteSampleConfigurationRequest.ts | 63 - ...ndicesDeleteSampleConfigurationResponse.ts | 25 - ...cesDeleteSampleConfigurationResponse1.yaml | 8 - ...icesDeleteSampleConfigurationRequest1.yaml | 1 - ...IndicesGetAllSampleConfigurationRequest.ts | 50 - ...ndicesGetAllSampleConfigurationResponse.ts | 26 - .../_types/IndexSamplingConfiguration.ts | 26 - ...cesGetAllSampleConfigurationResponse1.yaml | 20 - ...icesGetAllSampleConfigurationRequest1.yaml | 1 - .../get_sample/GetRandomSampleRequest.ts | 45 - .../get_sample/GetRandomSampleResponse.ts | 28 - .../indices/get_sample/_types/RawDocument.ts | 33 - .../GetRandomSampleResponse1.yaml | 35 - .../request/GetRandomSampleRequest1.yaml | 1 - .../IndicesGetSampleConfigurationRequest.ts | 56 - .../IndicesGetSampleConfigurationResponse.ts | 28 - ...ndicesGetSampleConfigurationResponse1.yaml | 16 - ...IndicesGetSampleConfigurationRequest1.yaml | 1 - .../GetRandomSampleStatsRequest.ts | 45 - .../GetRandomSampleStatsResponse.ts | 44 - .../GetRandomSampleStatsResponse1.yaml | 20 - .../request/GetRandomSampleStatsRequest1.yaml | 1 - .../IndicesPutSampleConfigurationRequest.ts | 92 - .../IndicesPutSampleConfigurationResponse.ts | 25 - ...ndicesPutSampleConfigurationResponse1.yaml | 8 - ...IndicesPutSampleConfigurationRequest1.yaml | 9 - 30 files changed, 259 insertions(+), 2431 deletions(-) delete mode 100644 specification/indices/_types/SampleConfiguration.ts delete mode 100644 specification/indices/delete_sample_configuration/IndicesDeleteSampleConfigurationRequest.ts delete mode 100644 specification/indices/delete_sample_configuration/IndicesDeleteSampleConfigurationResponse.ts delete mode 100644 specification/indices/delete_sample_configuration/examples/200_response/IndicesDeleteSampleConfigurationResponse1.yaml delete mode 100644 specification/indices/delete_sample_configuration/examples/request/IndicesDeleteSampleConfigurationRequest1.yaml delete mode 100644 specification/indices/get_all_sample_configuration/IndicesGetAllSampleConfigurationRequest.ts delete mode 100644 specification/indices/get_all_sample_configuration/IndicesGetAllSampleConfigurationResponse.ts delete mode 100644 specification/indices/get_all_sample_configuration/_types/IndexSamplingConfiguration.ts delete mode 100644 specification/indices/get_all_sample_configuration/examples/200_response/IndicesGetAllSampleConfigurationResponse1.yaml delete mode 100644 specification/indices/get_all_sample_configuration/examples/request/IndicesGetAllSampleConfigurationRequest1.yaml delete mode 100644 specification/indices/get_sample/GetRandomSampleRequest.ts delete mode 100644 specification/indices/get_sample/GetRandomSampleResponse.ts delete mode 100644 specification/indices/get_sample/_types/RawDocument.ts delete mode 100644 specification/indices/get_sample/examples/200_response/GetRandomSampleResponse1.yaml delete mode 100644 specification/indices/get_sample/examples/request/GetRandomSampleRequest1.yaml delete mode 100644 specification/indices/get_sample_configuration/IndicesGetSampleConfigurationRequest.ts delete mode 100644 specification/indices/get_sample_configuration/IndicesGetSampleConfigurationResponse.ts delete mode 100644 specification/indices/get_sample_configuration/examples/200_response/IndicesGetSampleConfigurationResponse1.yaml delete mode 100644 specification/indices/get_sample_configuration/examples/request/IndicesGetSampleConfigurationRequest1.yaml delete mode 100644 specification/indices/get_sample_stats/GetRandomSampleStatsRequest.ts delete mode 100644 specification/indices/get_sample_stats/GetRandomSampleStatsResponse.ts delete mode 100644 specification/indices/get_sample_stats/examples/200_response/GetRandomSampleStatsResponse1.yaml delete mode 100644 specification/indices/get_sample_stats/examples/request/GetRandomSampleStatsRequest1.yaml delete mode 100644 specification/indices/put_sample_configuration/IndicesPutSampleConfigurationRequest.ts delete mode 100644 specification/indices/put_sample_configuration/IndicesPutSampleConfigurationResponse.ts delete mode 100644 specification/indices/put_sample_configuration/examples/200_response/IndicesPutSampleConfigurationResponse1.yaml delete mode 100644 specification/indices/put_sample_configuration/examples/request/IndicesPutSampleConfigurationRequest1.yaml diff --git a/output/schema/schema.json b/output/schema/schema.json index df249a2bf2..4217a8028a 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -7720,45 +7720,6 @@ } ] }, - { - "availability": { - "stack": { - "featureFlag": "random_sampling", - "since": "9.3.0", - "stability": "experimental", - "visibility": "feature_flag" - } - }, - "description": "Delete sampling configuration.\n\nDelete the sampling configuration for the specified index.", - "docId": "indices-delete-sample-configuration", - "docTag": "random_sample", - "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", - "docUrlServerless": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", - "name": "indices.delete_sample_configuration", - "request": { - "name": "Request", - "namespace": "indices.delete_sample_configuration" - }, - "requestBodyRequired": false, - "requestMediaType": [ - "application/json" - ], - "response": { - "name": "Response", - "namespace": "indices.delete_sample_configuration" - }, - "responseMediaType": [ - "application/json" - ], - "urls": [ - { - "methods": [ - "DELETE" - ], - "path": "/{index}/_sample/config" - } - ] - }, { "availability": { "stack": { @@ -8332,42 +8293,6 @@ } ] }, - { - "availability": { - "stack": { - "featureFlag": "random_sampling", - "since": "9.3.0", - "stability": "experimental", - "visibility": "feature_flag" - } - }, - "description": "Get all sampling configurations.\n\nGet the sampling configurations for all indices.", - "docId": "indices-get-all-sample-configuration", - "docTag": "random_sample", - "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", - "docUrlServerless": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", - "name": "indices.get_all_sample_configuration", - "request": { - "name": "Request", - "namespace": "indices.get_all_sample_configuration" - }, - "requestBodyRequired": false, - "response": { - "name": "Response", - "namespace": "indices.get_all_sample_configuration" - }, - "responseMediaType": [ - "application/json" - ], - "urls": [ - { - "methods": [ - "GET" - ], - "path": "/_sample/config" - } - ] - }, { "availability": { "serverless": { @@ -8810,114 +8735,6 @@ } ] }, - { - "availability": { - "stack": { - "featureFlag": "random_sampling", - "since": "9.3.0", - "stability": "experimental", - "visibility": "feature_flag" - } - }, - "description": "Request for a random sample of raw documents ingested into the given index or data stream.", - "docId": "indices-get-sample", - "docTag": "random_sample", - "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", - "docUrlServerless": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", - "name": "indices.get_sample", - "request": { - "name": "Request", - "namespace": "indices.get_sample" - }, - "requestBodyRequired": false, - "response": { - "name": "Response", - "namespace": "indices.get_sample" - }, - "responseMediaType": [ - "application/json" - ], - "urls": [ - { - "methods": [ - "GET" - ], - "path": "/{index}/_sample" - } - ] - }, - { - "availability": { - "stack": { - "featureFlag": "random_sampling", - "since": "9.3.0", - "stability": "experimental", - "visibility": "feature_flag" - } - }, - "description": "Get sampling configuration.\n\nGet the sampling configuration for the specified index.", - "docId": "indices-get-sample-configuration", - "docTag": "random_sample", - "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", - "docUrlServerless": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", - "name": "indices.get_sample_configuration", - "request": { - "name": "Request", - "namespace": "indices.get_sample_configuration" - }, - "requestBodyRequired": false, - "response": { - "name": "Response", - "namespace": "indices.get_sample_configuration" - }, - "responseMediaType": [ - "application/json" - ], - "urls": [ - { - "methods": [ - "GET" - ], - "path": "/{index}/_sample/config" - } - ] - }, - { - "availability": { - "stack": { - "featureFlag": "random_sampling", - "since": "9.3.0", - "stability": "experimental", - "visibility": "feature_flag" - } - }, - "description": "Request stats for a random sample of raw documents ingested into the given index or data stream.", - "docId": "indices-get-sample-stats", - "docTag": "random_sample", - "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", - "docUrlServerless": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", - "name": "indices.get_sample_stats", - "request": { - "name": "Request", - "namespace": "indices.get_sample_stats" - }, - "requestBodyRequired": false, - "response": { - "name": "Response", - "namespace": "indices.get_sample_stats" - }, - "responseMediaType": [ - "application/json" - ], - "urls": [ - { - "methods": [ - "GET" - ], - "path": "/{index}/_sample/stats" - } - ] - }, { "availability": { "serverless": { @@ -9550,45 +9367,6 @@ } ] }, - { - "availability": { - "stack": { - "featureFlag": "random_sampling", - "since": "9.3.0", - "stability": "experimental", - "visibility": "feature_flag" - } - }, - "description": "Create or update sampling configuration.\n\nCreate or update the sampling configuration for the specified index.", - "docId": "indices-put-sample-configuration", - "docTag": "random_sample", - "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", - "docUrlServerless": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", - "name": "indices.put_sample_configuration", - "request": { - "name": "Request", - "namespace": "indices.put_sample_configuration" - }, - "requestBodyRequired": true, - "requestMediaType": [ - "application/json" - ], - "response": { - "name": "Response", - "namespace": "indices.put_sample_configuration" - }, - "responseMediaType": [ - "application/json" - ], - "urls": [ - { - "methods": [ - "PUT" - ], - "path": "/{index}/_sample/config" - } - ] - }, { "availability": { "serverless": { @@ -157184,125 +156962,6 @@ ], "specLocation": "indices/_types/IndexSettings.ts#L66-L68" }, - { - "kind": "interface", - "description": "Sampling configuration as returned by the API.", - "name": { - "name": "SamplingConfiguration", - "namespace": "indices._types" - }, - "properties": [ - { - "description": "The fraction of documents to sample between 0 and 1.", - "name": "rate", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "double", - "namespace": "_types" - } - } - }, - { - "description": "The maximum number of documents to sample.", - "name": "max_samples", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - }, - { - "description": "The maximum total size of sampled documents.", - "name": "max_size", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "ByteSize", - "namespace": "_types" - } - } - }, - { - "description": "The maximum total size of sampled documents in bytes.", - "name": "max_size_in_bytes", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "description": "The duration for which the sampled documents should be retained.", - "name": "time_to_live", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Duration", - "namespace": "_types" - } - } - }, - { - "description": "The duration for which the sampled documents should be retained, in milliseconds.", - "name": "time_to_live_in_millis", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "description": "An optional condition script that sampled documents must satisfy.", - "name": "if", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "description": "The time when the sampling configuration was created.", - "name": "creation_time", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "DateTime", - "namespace": "_types" - } - } - }, - { - "description": "The time when the sampling configuration was created, in milliseconds since epoch.", - "name": "creation_time_in_millis", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - } - ], - "specLocation": "indices/_types/SampleConfiguration.ts#L24-L64" - }, { "kind": "enum", "members": [ @@ -161821,121 +161480,6 @@ }, "specLocation": "indices/delete_index_template/IndicesDeleteIndexTemplateResponse.ts#L22-L25" }, - { - "kind": "request", - "attachedBehaviors": [ - "CommonQueryParameters" - ], - "body": { - "kind": "no_body" - }, - "description": "Delete sampling configuration.\n\nDelete the sampling configuration for the specified index.", - "examples": { - "IndicesDeleteSampleConfigurationRequest1": { - "alternatives": [ - { - "code": "resp = client.indices.delete_sample_configuration(\n index=\"my-index\",\n)", - "language": "Python" - }, - { - "code": "const response = await client.indices.deleteSampleConfiguration({\n index: \"my-index\",\n});", - "language": "JavaScript" - }, - { - "code": "response = client.indices.delete_sample_configuration(\n index: \"my-index\"\n)", - "language": "Ruby" - }, - { - "code": "$resp = $client->indices()->deleteSampleConfiguration([\n \"index\" => \"my-index\",\n]);", - "language": "PHP" - }, - { - "code": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index/_sample/config\"", - "language": "curl" - } - ], - "method_request": "DELETE /my-index/_sample/config" - } - }, - "inherits": { - "type": { - "name": "RequestBase", - "namespace": "_types" - } - }, - "name": { - "name": "Request", - "namespace": "indices.delete_sample_configuration" - }, - "path": [ - { - "description": "The name of the index.", - "name": "index", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "IndexName", - "namespace": "_types" - } - } - } - ], - "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.", - "name": "master_timeout", - "required": false, - "serverDefault": "30s", - "type": { - "kind": "instance_of", - "type": { - "name": "Duration", - "namespace": "_types" - } - } - }, - { - "description": "Period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error.", - "name": "timeout", - "required": false, - "serverDefault": "30s", - "type": { - "kind": "instance_of", - "type": { - "name": "Duration", - "namespace": "_types" - } - } - } - ], - "specLocation": "indices/delete_sample_configuration/IndicesDeleteSampleConfigurationRequest.ts#L24-L63" - }, - { - "kind": "response", - "body": { - "kind": "value", - "codegenName": "result", - "value": { - "kind": "instance_of", - "type": { - "name": "AcknowledgedResponseBase", - "namespace": "_types" - } - } - }, - "examples": { - "IndicesDeleteSampleConfigurationResponse1": { - "description": "A successful response for deleting a sampling configuration.", - "value": "{\n \"acknowledged\": true\n}" - } - }, - "name": { - "name": "Response", - "namespace": "indices.delete_sample_configuration" - }, - "specLocation": "indices/delete_sample_configuration/IndicesDeleteSampleConfigurationResponse.ts#L22-L25" - }, { "kind": "request", "attachedBehaviors": [ @@ -164495,6 +164039,38 @@ ], "specLocation": "indices/get_alias/_types/response.ts#L29-L37" }, + { + "kind": "interface", + "name": { + "name": "DataStreamWithLifecycle", + "namespace": "indices.get_data_lifecycle" + }, + "properties": [ + { + "name": "name", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "DataStreamName", + "namespace": "_types" + } + } + }, + { + "name": "lifecycle", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "DataStreamLifecycleWithRollover", + "namespace": "indices._types" + } + } + } + ], + "specLocation": "indices/get_data_lifecycle/IndicesGetDataLifecycleResponse.ts#L27-L30" + }, { "kind": "request", "attachedBehaviors": [ @@ -164503,32 +164079,36 @@ "body": { "kind": "no_body" }, - "description": "Get all sampling configurations.\n\nGet the sampling configurations for all indices.", + "description": "Get data stream lifecycles.\n\nGet the data stream lifecycle configuration of one or more data streams.", "examples": { - "IndicesGetAllSampleConfigurationRequest1": { + "IndicesGetDataLifecycleRequestExample1": { "alternatives": [ { - "code": "resp = client.indices.get_all_sample_configuration()", + "code": "resp = client.indices.get_data_lifecycle(\n name=\"{name}\",\n human=True,\n pretty=True,\n)", "language": "Python" }, { - "code": "const response = await client.indices.getAllSampleConfiguration();", + "code": "const response = await client.indices.getDataLifecycle({\n name: \"{name}\",\n human: \"true\",\n pretty: \"true\",\n});", "language": "JavaScript" }, { - "code": "response = client.indices.get_all_sample_configuration", + "code": "response = client.indices.get_data_lifecycle(\n name: \"{name}\",\n human: \"true\",\n pretty: \"true\"\n)", "language": "Ruby" }, { - "code": "$resp = $client->indices()->getAllSampleConfiguration();", + "code": "$resp = $client->indices()->getDataLifecycle([\n \"name\" => \"{name}\",\n \"human\" => \"true\",\n \"pretty\" => \"true\",\n]);", "language": "PHP" }, { - "code": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_sample/config\"", + "code": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_data_stream/%7Bname%7D/_lifecycle?human&pretty\"", "language": "curl" + }, + { + "code": "client.indices().getDataLifecycle(g -> g\n .name(\"{name}\")\n);\n", + "language": "Java" } ], - "method_request": "GET /_sample/config" + "method_request": "GET /_data_stream/{name}/_lifecycle?human&pretty" } }, "inherits": { @@ -164539,12 +164119,51 @@ }, "name": { "name": "Request", - "namespace": "indices.get_all_sample_configuration" + "namespace": "indices.get_data_lifecycle" }, - "path": [], + "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`.", + "name": "name", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "DataStreamNames", + "namespace": "_types" + } + } + } + ], "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.", + "description": "Type of data stream that wildcard patterns can match.\nSupports comma-separated values, such as `open,hidden`.", + "name": "expand_wildcards", + "required": false, + "serverDefault": "open", + "type": { + "kind": "instance_of", + "type": { + "name": "ExpandWildcards", + "namespace": "_types" + } + } + }, + { + "description": "If `true`, return all default settings in the response.", + "name": "include_defaults", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "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.", "name": "master_timeout", "required": false, "serverDefault": "30s", @@ -164557,7 +164176,7 @@ } } ], - "specLocation": "indices/get_all_sample_configuration/IndicesGetAllSampleConfigurationRequest.ts#L24-L50" + "specLocation": "indices/get_data_lifecycle/IndicesGetDataLifecycleRequest.ts#L24-L69" }, { "kind": "response", @@ -164565,15 +164184,15 @@ "kind": "properties", "properties": [ { - "name": "configurations", + "name": "data_streams", "required": true, "type": { "kind": "array_of", "value": { "kind": "instance_of", "type": { - "name": "IndexSamplingConfiguration", - "namespace": "indices.get_all_sample_configuration._types" + "name": "DataStreamWithLifecycle", + "namespace": "indices.get_data_lifecycle" } } } @@ -164581,57 +164200,50 @@ ] }, "examples": { - "IndicesGetAllSampleConfigurationResponse1": { - "description": "A successful response for retrieving all sampling configurations.", - "value": "{\n \"configurations\": [\n {\n \"index\": \"my-index\",\n \"configuration\": {\n \"rate\": 0.05,\n \"max_samples\": 1000,\n \"max_size_in_bytes\": 10485760,\n \"time_to_live_in_millis\": 86400000,\n \"if\": \"ctx?.network?.name == 'Guest'\",\n \"creation_time_in_millis\": 1761677431066\n }\n }\n ]\n}" + "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}" } }, "name": { "name": "Response", - "namespace": "indices.get_all_sample_configuration" + "namespace": "indices.get_data_lifecycle" }, - "specLocation": "indices/get_all_sample_configuration/IndicesGetAllSampleConfigurationResponse.ts#L22-L26" + "specLocation": "indices/get_data_lifecycle/IndicesGetDataLifecycleResponse.ts#L23-L25" }, { "kind": "interface", "name": { - "name": "IndexSamplingConfiguration", - "namespace": "indices.get_all_sample_configuration._types" + "name": "DataStreamStats", + "namespace": "indices.get_data_lifecycle_stats" }, "properties": [ { - "name": "index", + "description": "The count of the backing indices for the data stream.", + "name": "backing_indices_in_error", "required": true, "type": { "kind": "instance_of", "type": { - "name": "IndexName", + "name": "integer", "namespace": "_types" } } }, { - "name": "configuration", + "description": "The count of the backing indices for the data stream that have encountered an error.", + "name": "backing_indices_in_total", "required": true, "type": { "kind": "instance_of", "type": { - "name": "SamplingConfiguration", - "namespace": "indices._types" + "name": "integer", + "namespace": "_types" } } - } - ], - "specLocation": "indices/get_all_sample_configuration/_types/IndexSamplingConfiguration.ts#L23-L26" - }, - { - "kind": "interface", - "name": { - "name": "DataStreamWithLifecycle", - "namespace": "indices.get_data_lifecycle" - }, - "properties": [ + }, { + "description": "The name of the data stream.", "name": "name", "required": true, "type": { @@ -164641,20 +164253,151 @@ "namespace": "_types" } } - }, - { - "name": "lifecycle", - "required": false, - "type": { - "kind": "instance_of", + } + ], + "specLocation": "indices/get_data_lifecycle_stats/IndicesGetDataLifecycleStatsResponse.ts#L46-L59" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Get data stream lifecycle stats.\n\nGet statistics about the data streams that are managed by a data stream lifecycle.", + "examples": { + "IndicesGetDataLifecycleStatsRequestExample1": { + "alternatives": [ + { + "code": "resp = client.indices.get_data_lifecycle_stats(\n human=True,\n pretty=True,\n)", + "language": "Python" + }, + { + "code": "const response = await client.indices.getDataLifecycleStats({\n human: \"true\",\n pretty: \"true\",\n});", + "language": "JavaScript" + }, + { + "code": "response = client.indices.get_data_lifecycle_stats(\n human: \"true\",\n pretty: \"true\"\n)", + "language": "Ruby" + }, + { + "code": "$resp = $client->indices()->getDataLifecycleStats([\n \"human\" => \"true\",\n \"pretty\" => \"true\",\n]);", + "language": "PHP" + }, + { + "code": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_lifecycle/stats?human&pretty\"", + "language": "curl" + }, + { + "code": "client.indices().getDataLifecycleStats();\n", + "language": "Java" + } + ], + "method_request": "GET _lifecycle/stats?human&pretty" + } + }, + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "indices.get_data_lifecycle_stats" + }, + "path": [], + "query": [], + "specLocation": "indices/get_data_lifecycle_stats/IndicesGetDataLifecycleStatsRequest.ts#L23-L42" + }, + { + "kind": "response", + "body": { + "kind": "properties", + "properties": [ + { + "description": "The count of data streams currently being managed by the data stream lifecycle.", + "name": "data_stream_count", + "required": true, "type": { - "name": "DataStreamLifecycleWithRollover", - "namespace": "indices._types" + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "description": "Information about the data streams that are managed by the data stream lifecycle.", + "name": "data_streams", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "DataStreamStats", + "namespace": "indices.get_data_lifecycle_stats" + } + } + } + }, + { + "description": "The duration of the last data stream lifecycle execution.", + "name": "last_run_duration_in_millis", + "required": false, + "type": { + "kind": "instance_of", + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "UnitMillis", + "namespace": "_types" + } + } + ], + "type": { + "name": "DurationValue", + "namespace": "_types" + } + } + }, + { + "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`.", + "name": "time_between_starts_in_millis", + "required": false, + "type": { + "kind": "instance_of", + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "UnitMillis", + "namespace": "_types" + } + } + ], + "type": { + "name": "DurationValue", + "namespace": "_types" + } } } + ] + }, + "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}" } - ], - "specLocation": "indices/get_data_lifecycle/IndicesGetDataLifecycleResponse.ts#L27-L30" + }, + "name": { + "name": "Response", + "namespace": "indices.get_data_lifecycle_stats" + }, + "specLocation": "indices/get_data_lifecycle_stats/IndicesGetDataLifecycleStatsResponse.ts#L24-L44" }, { "kind": "request", @@ -164664,36 +164407,36 @@ "body": { "kind": "no_body" }, - "description": "Get data stream lifecycles.\n\nGet the data stream lifecycle configuration of one or more data streams.", + "description": "Get data streams.\n\nGet information about one or more data streams.", "examples": { - "IndicesGetDataLifecycleRequestExample1": { + "IndicesGetDataStreamExample1": { "alternatives": [ { - "code": "resp = client.indices.get_data_lifecycle(\n name=\"{name}\",\n human=True,\n pretty=True,\n)", + "code": "resp = client.indices.get_data_stream(\n name=\"my-data-stream\",\n)", "language": "Python" }, { - "code": "const response = await client.indices.getDataLifecycle({\n name: \"{name}\",\n human: \"true\",\n pretty: \"true\",\n});", + "code": "const response = await client.indices.getDataStream({\n name: \"my-data-stream\",\n});", "language": "JavaScript" }, { - "code": "response = client.indices.get_data_lifecycle(\n name: \"{name}\",\n human: \"true\",\n pretty: \"true\"\n)", + "code": "response = client.indices.get_data_stream(\n name: \"my-data-stream\"\n)", "language": "Ruby" }, { - "code": "$resp = $client->indices()->getDataLifecycle([\n \"name\" => \"{name}\",\n \"human\" => \"true\",\n \"pretty\" => \"true\",\n]);", + "code": "$resp = $client->indices()->getDataStream([\n \"name\" => \"my-data-stream\",\n]);", "language": "PHP" }, { - "code": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_data_stream/%7Bname%7D/_lifecycle?human&pretty\"", + "code": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_data_stream/my-data-stream\"", "language": "curl" }, { - "code": "client.indices().getDataLifecycle(g -> g\n .name(\"{name}\")\n);\n", + "code": "client.indices().getDataStream(g -> g\n .name(\"my-data-stream\")\n);\n", "language": "Java" } ], - "method_request": "GET /_data_stream/{name}/_lifecycle?human&pretty" + "method_request": "GET _data_stream/my-data-stream" } }, "inherits": { @@ -164704,341 +164447,13 @@ }, "name": { "name": "Request", - "namespace": "indices.get_data_lifecycle" + "namespace": "indices.get_data_stream" }, "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`.", + "description": "Comma-separated list of data stream names used to limit the request.\nWildcard (`*`) expressions are supported. If omitted, all data streams are returned.", "name": "name", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "DataStreamNames", - "namespace": "_types" - } - } - } - ], - "query": [ - { - "description": "Type of data stream that wildcard patterns can match.\nSupports comma-separated values, such as `open,hidden`.", - "name": "expand_wildcards", - "required": false, - "serverDefault": "open", - "type": { - "kind": "instance_of", - "type": { - "name": "ExpandWildcards", - "namespace": "_types" - } - } - }, - { - "description": "If `true`, return all default settings in the response.", - "name": "include_defaults", - "required": false, - "serverDefault": false, - "type": { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "_builtins" - } - } - }, - { - "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.", - "name": "master_timeout", - "required": false, - "serverDefault": "30s", - "type": { - "kind": "instance_of", - "type": { - "name": "Duration", - "namespace": "_types" - } - } - } - ], - "specLocation": "indices/get_data_lifecycle/IndicesGetDataLifecycleRequest.ts#L24-L69" - }, - { - "kind": "response", - "body": { - "kind": "properties", - "properties": [ - { - "name": "data_streams", - "required": true, - "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "DataStreamWithLifecycle", - "namespace": "indices.get_data_lifecycle" - } - } - } - } - ] - }, - "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}" - } - }, - "name": { - "name": "Response", - "namespace": "indices.get_data_lifecycle" - }, - "specLocation": "indices/get_data_lifecycle/IndicesGetDataLifecycleResponse.ts#L23-L25" - }, - { - "kind": "interface", - "name": { - "name": "DataStreamStats", - "namespace": "indices.get_data_lifecycle_stats" - }, - "properties": [ - { - "description": "The count of the backing indices for the data stream.", - "name": "backing_indices_in_error", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - }, - { - "description": "The count of the backing indices for the data stream that have encountered an error.", - "name": "backing_indices_in_total", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - }, - { - "description": "The name of the data stream.", - "name": "name", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "DataStreamName", - "namespace": "_types" - } - } - } - ], - "specLocation": "indices/get_data_lifecycle_stats/IndicesGetDataLifecycleStatsResponse.ts#L46-L59" - }, - { - "kind": "request", - "attachedBehaviors": [ - "CommonQueryParameters" - ], - "body": { - "kind": "no_body" - }, - "description": "Get data stream lifecycle stats.\n\nGet statistics about the data streams that are managed by a data stream lifecycle.", - "examples": { - "IndicesGetDataLifecycleStatsRequestExample1": { - "alternatives": [ - { - "code": "resp = client.indices.get_data_lifecycle_stats(\n human=True,\n pretty=True,\n)", - "language": "Python" - }, - { - "code": "const response = await client.indices.getDataLifecycleStats({\n human: \"true\",\n pretty: \"true\",\n});", - "language": "JavaScript" - }, - { - "code": "response = client.indices.get_data_lifecycle_stats(\n human: \"true\",\n pretty: \"true\"\n)", - "language": "Ruby" - }, - { - "code": "$resp = $client->indices()->getDataLifecycleStats([\n \"human\" => \"true\",\n \"pretty\" => \"true\",\n]);", - "language": "PHP" - }, - { - "code": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_lifecycle/stats?human&pretty\"", - "language": "curl" - }, - { - "code": "client.indices().getDataLifecycleStats();\n", - "language": "Java" - } - ], - "method_request": "GET _lifecycle/stats?human&pretty" - } - }, - "inherits": { - "type": { - "name": "RequestBase", - "namespace": "_types" - } - }, - "name": { - "name": "Request", - "namespace": "indices.get_data_lifecycle_stats" - }, - "path": [], - "query": [], - "specLocation": "indices/get_data_lifecycle_stats/IndicesGetDataLifecycleStatsRequest.ts#L23-L42" - }, - { - "kind": "response", - "body": { - "kind": "properties", - "properties": [ - { - "description": "The count of data streams currently being managed by the data stream lifecycle.", - "name": "data_stream_count", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - }, - { - "description": "Information about the data streams that are managed by the data stream lifecycle.", - "name": "data_streams", - "required": true, - "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "DataStreamStats", - "namespace": "indices.get_data_lifecycle_stats" - } - } - } - }, - { - "description": "The duration of the last data stream lifecycle execution.", - "name": "last_run_duration_in_millis", - "required": false, - "type": { - "kind": "instance_of", - "generics": [ - { - "kind": "instance_of", - "type": { - "name": "UnitMillis", - "namespace": "_types" - } - } - ], - "type": { - "name": "DurationValue", - "namespace": "_types" - } - } - }, - { - "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`.", - "name": "time_between_starts_in_millis", - "required": false, - "type": { - "kind": "instance_of", - "generics": [ - { - "kind": "instance_of", - "type": { - "name": "UnitMillis", - "namespace": "_types" - } - } - ], - "type": { - "name": "DurationValue", - "namespace": "_types" - } - } - } - ] - }, - "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}" - } - }, - "name": { - "name": "Response", - "namespace": "indices.get_data_lifecycle_stats" - }, - "specLocation": "indices/get_data_lifecycle_stats/IndicesGetDataLifecycleStatsResponse.ts#L24-L44" - }, - { - "kind": "request", - "attachedBehaviors": [ - "CommonQueryParameters" - ], - "body": { - "kind": "no_body" - }, - "description": "Get data streams.\n\nGet information about one or more data streams.", - "examples": { - "IndicesGetDataStreamExample1": { - "alternatives": [ - { - "code": "resp = client.indices.get_data_stream(\n name=\"my-data-stream\",\n)", - "language": "Python" - }, - { - "code": "const response = await client.indices.getDataStream({\n name: \"my-data-stream\",\n});", - "language": "JavaScript" - }, - { - "code": "response = client.indices.get_data_stream(\n name: \"my-data-stream\"\n)", - "language": "Ruby" - }, - { - "code": "$resp = $client->indices()->getDataStream([\n \"name\" => \"my-data-stream\",\n]);", - "language": "PHP" - }, - { - "code": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_data_stream/my-data-stream\"", - "language": "curl" - }, - { - "code": "client.indices().getDataStream(g -> g\n .name(\"my-data-stream\")\n);\n", - "language": "Java" - } - ], - "method_request": "GET _data_stream/my-data-stream" - } - }, - "inherits": { - "type": { - "name": "RequestBase", - "namespace": "_types" - } - }, - "name": { - "name": "Request", - "namespace": "indices.get_data_stream" - }, - "path": [ - { - "description": "Comma-separated list of data stream names used to limit the request.\nWildcard (`*`) expressions are supported. If omitted, all data streams are returned.", - "name": "name", - "required": false, + "required": false, "type": { "kind": "instance_of", "type": { @@ -166482,540 +165897,6 @@ ], "specLocation": "indices/get_migrate_reindex_status/MigrateGetReindexStatusResponse.ts#L38-L42" }, - { - "kind": "request", - "attachedBehaviors": [ - "CommonQueryParameters" - ], - "body": { - "kind": "no_body" - }, - "description": "Request for a random sample of raw documents ingested into the given index or data stream.", - "examples": { - "GetRandomSampleRequest1": { - "alternatives": [ - { - "code": "resp = client.indices.get_sample(\n index=\"my-index-000001\",\n)", - "language": "Python" - }, - { - "code": "const response = await client.indices.getSample({\n index: \"my-index-000001\",\n});", - "language": "JavaScript" - }, - { - "code": "response = client.indices.get_sample(\n index: \"my-index-000001\"\n)", - "language": "Ruby" - }, - { - "code": "$resp = $client->indices()->getSample([\n \"index\" => \"my-index-000001\",\n]);", - "language": "PHP" - }, - { - "code": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_sample\"", - "language": "curl" - } - ], - "method_request": "GET /my-index-000001/_sample" - } - }, - "inherits": { - "type": { - "name": "RequestBase", - "namespace": "_types" - } - }, - "name": { - "name": "Request", - "namespace": "indices.get_sample" - }, - "path": [ - { - "description": "Single index or data stream name. Wildcards are not supported.", - "name": "index", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "IndexName", - "namespace": "_types" - } - } - } - ], - "query": [], - "specLocation": "indices/get_sample/GetRandomSampleRequest.ts#L23-L45" - }, - { - "kind": "response", - "body": { - "kind": "properties", - "properties": [ - { - "name": "sample", - "required": true, - "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "RawDocument", - "namespace": "indices.get_sample._types" - } - } - } - } - ] - }, - "examples": { - "GetRandomSampleResponse1": { - "description": "A successful response for retrieving the random sample for an index or data stream.", - "value": "{\n \"sample\": [\n {\n \"index\": \"logs\",\n \"source\": {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"Node 0 message\",\n \"user\": {\n \"id\": \"kimchy\"\n },\n \"network\": {\n \"name\": \"Guest\"\n }\n }\n },\n {\n \"index\": \"logs\",\n \"source\": {\n \"@timestamp\": \"2079-11-15T13:12:00\",\n \"message\": \"Node 1 message\",\n \"user\": {\n \"id\": \"kimchy\"\n },\n \"network\": {\n \"name\": \"Guest\"\n }\n }\n }\n ]\n}" - } - }, - "name": { - "name": "Response", - "namespace": "indices.get_sample" - }, - "specLocation": "indices/get_sample/GetRandomSampleResponse.ts#L22-L28" - }, - { - "kind": "interface", - "name": { - "name": "RawDocument", - "namespace": "indices.get_sample._types" - }, - "properties": [ - { - "description": "Name of the index for this raw document.", - "name": "index", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "description": "The original raw source.", - "name": "source", - "required": true, - "type": { - "kind": "dictionary_of", - "key": { - "kind": "instance_of", - "type": { - "name": "PropertyName", - "namespace": "_types" - } - }, - "singleKey": false, - "value": { - "kind": "instance_of", - "type": { - "name": "Property", - "namespace": "_types.mapping" - } - } - } - } - ], - "specLocation": "indices/get_sample/_types/RawDocument.ts#L24-L33" - }, - { - "kind": "request", - "attachedBehaviors": [ - "CommonQueryParameters" - ], - "body": { - "kind": "no_body" - }, - "description": "Get sampling configuration.\n\nGet the sampling configuration for the specified index.", - "examples": { - "IndicesGetSampleConfigurationRequest1": { - "alternatives": [ - { - "code": "resp = client.indices.get_sample_configuration(\n index=\"my-index\",\n)", - "language": "Python" - }, - { - "code": "const response = await client.indices.getSampleConfiguration({\n index: \"my-index\",\n});", - "language": "JavaScript" - }, - { - "code": "response = client.indices.get_sample_configuration(\n index: \"my-index\"\n)", - "language": "Ruby" - }, - { - "code": "$resp = $client->indices()->getSampleConfiguration([\n \"index\" => \"my-index\",\n]);", - "language": "PHP" - }, - { - "code": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index/_sample/config\"", - "language": "curl" - } - ], - "method_request": "GET /my-index/_sample/config" - } - }, - "inherits": { - "type": { - "name": "RequestBase", - "namespace": "_types" - } - }, - "name": { - "name": "Request", - "namespace": "indices.get_sample_configuration" - }, - "path": [ - { - "description": "The name of the index.", - "name": "index", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "IndexName", - "namespace": "_types" - } - } - } - ], - "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.", - "name": "master_timeout", - "required": false, - "serverDefault": "30s", - "type": { - "kind": "instance_of", - "type": { - "name": "Duration", - "namespace": "_types" - } - } - } - ], - "specLocation": "indices/get_sample_configuration/IndicesGetSampleConfigurationRequest.ts#L24-L56" - }, - { - "kind": "response", - "body": { - "kind": "properties", - "properties": [ - { - "name": "index", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "IndexName", - "namespace": "_types" - } - } - }, - { - "name": "configuration", - "required": true, - "type": { - "kind": "union_of", - "items": [ - { - "kind": "instance_of", - "type": { - "name": "SamplingConfiguration", - "namespace": "indices._types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "null", - "namespace": "_builtins" - } - } - ] - } - } - ] - }, - "examples": { - "IndicesGetSampleConfigurationResponse1": { - "description": "A successful response for retrieving the sampling configuration for an index.", - "value": "{\n \"index\": \"my-index\",\n \"configuration\": {\n \"rate\": 0.05,\n \"max_samples\": 1000,\n \"max_size_in_bytes\": 10485760,\n \"time_to_live_in_millis\": 86400000,\n \"if\": \"ctx?.network?.name == 'Guest'\",\n \"creation_time_in_millis\": 1761341004982\n }\n}" - } - }, - "name": { - "name": "Response", - "namespace": "indices.get_sample_configuration" - }, - "specLocation": "indices/get_sample_configuration/IndicesGetSampleConfigurationResponse.ts#L23-L28" - }, - { - "kind": "request", - "attachedBehaviors": [ - "CommonQueryParameters" - ], - "body": { - "kind": "no_body" - }, - "description": "Request stats for a random sample of raw documents ingested into the given index or data stream.", - "examples": { - "GetRandomSampleStatsRequest1": { - "alternatives": [ - { - "code": "resp = client.indices.get_sample_stats(\n index=\"my-index-000001\",\n)", - "language": "Python" - }, - { - "code": "const response = await client.indices.getSampleStats({\n index: \"my-index-000001\",\n});", - "language": "JavaScript" - }, - { - "code": "response = client.indices.get_sample_stats(\n index: \"my-index-000001\"\n)", - "language": "Ruby" - }, - { - "code": "$resp = $client->indices()->getSampleStats([\n \"index\" => \"my-index-000001\",\n]);", - "language": "PHP" - }, - { - "code": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_sample/stats\"", - "language": "curl" - } - ], - "method_request": "GET /my-index-000001/_sample/stats" - } - }, - "inherits": { - "type": { - "name": "RequestBase", - "namespace": "_types" - } - }, - "name": { - "name": "Request", - "namespace": "indices.get_sample_stats" - }, - "path": [ - { - "description": "Single index or data stream name. Wildcards are not supported.", - "name": "index", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "IndexName", - "namespace": "_types" - } - } - } - ], - "query": [], - "specLocation": "indices/get_sample_stats/GetRandomSampleStatsRequest.ts#L23-L45" - }, - { - "kind": "response", - "body": { - "kind": "properties", - "properties": [ - { - "name": "potential_samples", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "name": "samples_rejected_for_max_samples_exceeded", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "name": "samples_rejected_for_condition", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "name": "samples_rejected_for_rate", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "name": "samples_rejected_for_exception", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "name": "samples_rejected_for_size", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "name": "samples_accepted", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "name": "time_sampling", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Duration", - "namespace": "_types" - } - } - }, - { - "name": "time_sampling_millis", - "required": true, - "type": { - "kind": "instance_of", - "generics": [ - { - "kind": "instance_of", - "type": { - "name": "UnitMillis", - "namespace": "_types" - } - } - ], - "type": { - "name": "DurationValue", - "namespace": "_types" - } - } - }, - { - "name": "time_evaluating_condition", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Duration", - "namespace": "_types" - } - } - }, - { - "name": "time_evaluating_condition_millis", - "required": true, - "type": { - "kind": "instance_of", - "generics": [ - { - "kind": "instance_of", - "type": { - "name": "UnitMillis", - "namespace": "_types" - } - } - ], - "type": { - "name": "DurationValue", - "namespace": "_types" - } - } - }, - { - "name": "time_compiling_condition", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Duration", - "namespace": "_types" - } - } - }, - { - "name": "time_compiling_condition_millis", - "required": true, - "type": { - "kind": "instance_of", - "generics": [ - { - "kind": "instance_of", - "type": { - "name": "UnitMillis", - "namespace": "_types" - } - } - ], - "type": { - "name": "DurationValue", - "namespace": "_types" - } - } - }, - { - "name": "last_exception", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - } - ] - }, - "examples": { - "GetRandomSampleStatsResponse1": { - "description": "A successful response for retrieving the random sample stats for an index or data stream.", - "value": "{\n \"potential_samples\": 2,\n \"samples_rejected_for_max_samples_exceeded\": 0,\n \"samples_rejected_for_condition\": 0,\n \"samples_rejected_for_rate\": 0,\n \"samples_rejected_for_exception\": 0,\n \"samples_rejected_for_size\": 0,\n \"samples_accepted\": 2,\n \"time_sampling\": \"415.7micros\",\n \"time_sampling_millis\": 0,\n \"time_evaluating_condition\": \"185.9micros\",\n \"time_evaluating_condition_millis\": 0,\n \"time_compiling_condition\": \"98.4micros\",\n \"time_compiling_condition_millis\": 0\n}" - } - }, - "name": { - "name": "Response", - "namespace": "indices.get_sample_stats" - }, - "specLocation": "indices/get_sample_stats/GetRandomSampleStatsResponse.ts#L23-L44" - }, { "kind": "request", "attachedBehaviors": [ @@ -169952,195 +168833,6 @@ }, "specLocation": "indices/put_mapping/IndicesPutMappingResponse.ts#L22-L25" }, - { - "kind": "request", - "attachedBehaviors": [ - "CommonQueryParameters" - ], - "body": { - "kind": "properties", - "properties": [ - { - "description": "The fraction of documents to sample. Must be greater than 0 and less than or equal to 1.\nCan be specified as a number or a string.", - "name": "rate", - "required": true, - "type": { - "kind": "instance_of", - "generics": [ - { - "kind": "instance_of", - "type": { - "name": "double", - "namespace": "_types" - } - } - ], - "type": { - "name": "Stringified", - "namespace": "_spec_utils" - } - } - }, - { - "description": "The maximum number of documents to sample. Must be greater than 0 and less than or equal to 10,000.", - "name": "max_samples", - "required": false, - "serverDefault": 100, - "type": { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - }, - { - "description": "The maximum total size of sampled documents. Must be greater than 0 and less than or equal to 5GB.", - "name": "max_size", - "required": false, - "serverDefault": "1GB", - "type": { - "kind": "instance_of", - "type": { - "name": "ByteSize", - "namespace": "_types" - } - } - }, - { - "description": "The duration for which the sampled documents should be retained.\nMust be greater than 0 and less than or equal to 30 days.", - "name": "time_to_live", - "required": false, - "serverDefault": "10d", - "type": { - "kind": "instance_of", - "type": { - "name": "Duration", - "namespace": "_types" - } - } - }, - { - "description": "An optional condition script that sampled documents must satisfy.", - "name": "if", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - } - ] - }, - "description": "Create or update sampling configuration.\n\nCreate or update the sampling configuration for the specified index.", - "examples": { - "IndicesPutSampleConfigurationRequest1": { - "alternatives": [ - { - "code": "resp = client.indices.put_sample_configuration(\n index=\"my-index\",\n rate=0.05,\n max_samples=1000,\n max_size=\"10mb\",\n time_to_live=\"1d\",\n if=\"ctx?.network?.name == 'Guest'\",\n)", - "language": "Python" - }, - { - "code": "const response = await client.indices.putSampleConfiguration({\n index: \"my-index\",\n rate: 0.05,\n max_samples: 1000,\n max_size: \"10mb\",\n time_to_live: \"1d\",\n if: \"ctx?.network?.name == 'Guest'\",\n});", - "language": "JavaScript" - }, - { - "code": "response = client.indices.put_sample_configuration(\n index: \"my-index\",\n body: {\n \"rate\": 0.05,\n \"max_samples\": 1000,\n \"max_size\": \"10mb\",\n \"time_to_live\": \"1d\",\n \"if\": \"ctx?.network?.name == 'Guest'\"\n }\n)", - "language": "Ruby" - }, - { - "code": "$resp = $client->indices()->putSampleConfiguration([\n \"index\" => \"my-index\",\n \"body\" => [\n \"rate\" => 0.05,\n \"max_samples\" => 1000,\n \"max_size\" => \"10mb\",\n \"time_to_live\" => \"1d\",\n \"if\" => \"ctx?.network?.name == 'Guest'\",\n ],\n]);", - "language": "PHP" - }, - { - "code": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"rate\":0.05,\"max_samples\":1000,\"max_size\":\"10mb\",\"time_to_live\":\"1d\",\"if\":\"ctx?.network?.name == '\"'\"'Guest'\"'\"'\"}' \"$ELASTICSEARCH_URL/my-index/_sample/config\"", - "language": "curl" - } - ], - "method_request": "PUT /my-index/_sample/config\n{\n \"rate\": 0.05,\n \"max_samples\": 1000,\n \"max_size\": \"10mb\",\n \"time_to_live\": \"1d\",\n \"if\": \"ctx?.network?.name == 'Guest'\"\n}" - } - }, - "inherits": { - "type": { - "name": "RequestBase", - "namespace": "_types" - } - }, - "name": { - "name": "Request", - "namespace": "indices.put_sample_configuration" - }, - "path": [ - { - "description": "The name of the index or data stream.", - "name": "index", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "IndexName", - "namespace": "_types" - } - } - } - ], - "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.", - "name": "master_timeout", - "required": false, - "serverDefault": "30s", - "type": { - "kind": "instance_of", - "type": { - "name": "Duration", - "namespace": "_types" - } - } - }, - { - "description": "Period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error.", - "name": "timeout", - "required": false, - "serverDefault": "30s", - "type": { - "kind": "instance_of", - "type": { - "name": "Duration", - "namespace": "_types" - } - } - } - ], - "specLocation": "indices/put_sample_configuration/IndicesPutSampleConfigurationRequest.ts#L26-L92" - }, - { - "kind": "response", - "body": { - "kind": "value", - "codegenName": "result", - "value": { - "kind": "instance_of", - "type": { - "name": "AcknowledgedResponseBase", - "namespace": "_types" - } - } - }, - "examples": { - "IndicesPutSampleConfigurationResponse1": { - "description": "A successful response for creating or updating a sampling configuration.", - "value": "{\n \"acknowledged\": true\n}" - } - }, - "name": { - "name": "Response", - "namespace": "indices.put_sample_configuration" - }, - "specLocation": "indices/put_sample_configuration/IndicesPutSampleConfigurationResponse.ts#L22-L25" - }, { "kind": "request", "attachedBehaviors": [ diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 6e8a6f24c1..bda87bc124 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -12531,18 +12531,6 @@ export interface IndicesRetentionLease { period: Duration } -export interface IndicesSamplingConfiguration { - rate: double - max_samples: integer - max_size?: ByteSize - max_size_in_bytes: long - time_to_live?: Duration - time_to_live_in_millis: long - if?: string - creation_time?: DateTime - creation_time_in_millis: long -} - export type IndicesSamplingMethod = 'aggregate' | 'last_value' export interface IndicesSearchIdle { @@ -12952,14 +12940,6 @@ export interface IndicesDeleteIndexTemplateRequest extends RequestBase { export type IndicesDeleteIndexTemplateResponse = AcknowledgedResponseBase -export interface IndicesDeleteSampleConfigurationRequest extends RequestBase { - index: IndexName - master_timeout?: Duration - timeout?: Duration -} - -export type IndicesDeleteSampleConfigurationResponse = AcknowledgedResponseBase - export interface IndicesDeleteTemplateRequest extends RequestBase { name: Name master_timeout?: Duration @@ -13171,19 +13151,6 @@ export interface IndicesGetAliasNotFoundAliasesKeys { export type IndicesGetAliasNotFoundAliases = IndicesGetAliasNotFoundAliasesKeys & { [property: string]: IndicesGetAliasIndexAliases | string | integer } -export interface IndicesGetAllSampleConfigurationRequest extends RequestBase { - master_timeout?: Duration -} - -export interface IndicesGetAllSampleConfigurationResponse { - configurations: IndicesGetAllSampleConfigurationIndexSamplingConfiguration[] -} - -export interface IndicesGetAllSampleConfigurationIndexSamplingConfiguration { - index: IndexName - configuration: IndicesSamplingConfiguration -} - export interface IndicesGetDataLifecycleDataStreamWithLifecycle { name: DataStreamName lifecycle?: IndicesDataStreamLifecycleWithRollover @@ -13349,50 +13316,6 @@ export interface IndicesGetMigrateReindexStatusStatusInProgress { reindexed_doc_count: long } -export interface IndicesGetSampleRequest extends RequestBase { - index: IndexName -} - -export interface IndicesGetSampleResponse { - sample: IndicesGetSampleRawDocument[] -} - -export interface IndicesGetSampleRawDocument { - index: string - source: Record -} - -export interface IndicesGetSampleConfigurationRequest extends RequestBase { - index: IndexName - master_timeout?: Duration -} - -export interface IndicesGetSampleConfigurationResponse { - index: IndexName - configuration: IndicesSamplingConfiguration | null -} - -export interface IndicesGetSampleStatsRequest extends RequestBase { - index: IndexName -} - -export interface IndicesGetSampleStatsResponse { - potential_samples: long - samples_rejected_for_max_samples_exceeded: long - samples_rejected_for_condition: long - samples_rejected_for_rate: long - samples_rejected_for_exception: long - samples_rejected_for_size: long - samples_accepted: long - time_sampling?: Duration - time_sampling_millis: DurationValue - time_evaluating_condition?: Duration - time_evaluating_condition_millis: DurationValue - time_compiling_condition?: Duration - time_compiling_condition_millis: DurationValue - last_exception?: string -} - export interface IndicesGetSettingsRequest extends RequestBase { index?: Indices name?: Names @@ -13630,21 +13553,6 @@ export interface IndicesPutMappingRequest extends RequestBase { export type IndicesPutMappingResponse = IndicesResponseBase -export interface IndicesPutSampleConfigurationRequest extends RequestBase { - index: IndexName - master_timeout?: Duration - timeout?: Duration - body?: { - rate: SpecUtilsStringified - max_samples?: integer - max_size?: ByteSize - time_to_live?: Duration - if?: string - } -} - -export type IndicesPutSampleConfigurationResponse = AcknowledgedResponseBase - export interface IndicesPutSettingsRequest extends RequestBase { index?: Indices allow_no_indices?: boolean diff --git a/specification/_doc_ids/table.csv b/specification/_doc_ids/table.csv index 4b1d9790e1..0bcf13df1a 100644 --- a/specification/_doc_ids/table.csv +++ b/specification/_doc_ids/table.csv @@ -647,7 +647,6 @@ edit-query-rule-from-ui,https://www.elastic.co/docs/solutions/search/query-rules delete-query-rule-from-ui,https://www.elastic.co/docs/solutions/search/query-rules-ui#delete-a-rule,[use-doc-url],,Delete a rule from the Query Rules UI list-query-rules-in-ui,https://www.elastic.co/docs/solutions/search/query-rules-ui#accessing-the-query-rules-ui,[use-doc-url],,See rules and rulesets in Query Rules UI delete-query-ruleset-from-ui,https://www.elastic.co/docs/solutions/search/query-rules-ui#delete-a-ruleset,[use-doc-url],,Delete a ruleset from the Query Rules UI -random_sample,https://www.elastic.co/docs/api/doc/elasticsearch/group/ingest-random-sampling,[use-doc-url],, realtime,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get,https://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-get,https://www.elastic.co/guide/en/elasticsearch/reference/8.19/docs-get.html, redact-processor,https://www.elastic.co/docs/reference/enrich-processor/redact-processor,[use-doc-url],, refresh_an_index,https://www.elastic.co/docs/reference/elasticsearch/rest-apis/refresh-parameter,[use-doc-url],,Learn more about the refresh parameter diff --git a/specification/indices/_types/SampleConfiguration.ts b/specification/indices/_types/SampleConfiguration.ts deleted file mode 100644 index 0c2ef1632c..0000000000 --- a/specification/indices/_types/SampleConfiguration.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { ByteSize } from '@_types/common' -import { double, integer, long } from '@_types/Numeric' -import { DateTime, Duration } from '@_types/Time' - -/** - * Sampling configuration as returned by the API. - */ -export class SamplingConfiguration { - /** - * The fraction of documents to sample between 0 and 1. - */ - rate: double - /** - * The maximum number of documents to sample. - */ - max_samples: integer - /** - * The maximum total size of sampled documents. - */ - max_size?: ByteSize - /** - * The maximum total size of sampled documents in bytes. - */ - max_size_in_bytes: long - /** - * The duration for which the sampled documents should be retained. - */ - time_to_live?: Duration - /** - * The duration for which the sampled documents should be retained, in milliseconds. - */ - time_to_live_in_millis: long - /** - * An optional condition script that sampled documents must satisfy. - */ - if?: string - /** - * The time when the sampling configuration was created. - */ - creation_time?: DateTime - /** - * The time when the sampling configuration was created, in milliseconds since epoch. - */ - creation_time_in_millis: long -} diff --git a/specification/indices/delete_sample_configuration/IndicesDeleteSampleConfigurationRequest.ts b/specification/indices/delete_sample_configuration/IndicesDeleteSampleConfigurationRequest.ts deleted file mode 100644 index 9246171618..0000000000 --- a/specification/indices/delete_sample_configuration/IndicesDeleteSampleConfigurationRequest.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { RequestBase } from '@_types/Base' -import { IndexName, MediaType } from '@_types/common' -import { Duration } from '@_types/Time' - -/** - * Delete sampling configuration. - * - * Delete the sampling configuration for the specified index. - * @rest_spec_name indices.delete_sample_configuration - * @availability stack visibility=feature_flag feature_flag=random_sampling since=9.3.0 stability=experimental - * @doc_id indices-delete-sample-configuration - * @doc_tag random_sample - */ -export interface Request extends RequestBase { - urls: [ - { - path: '/{index}/_sample/config' - methods: ['DELETE'] - } - ] - path_parts: { - /** - * The name of the index. - */ - index: IndexName - } - request_media_type: MediaType.Json - response_media_type: MediaType.Json - query_parameters: { - /** - * 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. - * @server_default 30s - */ - master_timeout?: Duration - /** - * Period to wait for a response. - * If no response is received before the timeout expires, the request fails and returns an error. - * @server_default 30s - */ - timeout?: Duration - } -} diff --git a/specification/indices/delete_sample_configuration/IndicesDeleteSampleConfigurationResponse.ts b/specification/indices/delete_sample_configuration/IndicesDeleteSampleConfigurationResponse.ts deleted file mode 100644 index 9e7bdb91cd..0000000000 --- a/specification/indices/delete_sample_configuration/IndicesDeleteSampleConfigurationResponse.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { AcknowledgedResponseBase } from '@_types/Base' - -export class Response { - /** @codegen_name result */ - body: AcknowledgedResponseBase -} diff --git a/specification/indices/delete_sample_configuration/examples/200_response/IndicesDeleteSampleConfigurationResponse1.yaml b/specification/indices/delete_sample_configuration/examples/200_response/IndicesDeleteSampleConfigurationResponse1.yaml deleted file mode 100644 index 2b95fe3d51..0000000000 --- a/specification/indices/delete_sample_configuration/examples/200_response/IndicesDeleteSampleConfigurationResponse1.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# summary: '' -description: A successful response for deleting a sampling configuration. -# type: response -# response_code: 200 -value: |- - { - "acknowledged": true - } diff --git a/specification/indices/delete_sample_configuration/examples/request/IndicesDeleteSampleConfigurationRequest1.yaml b/specification/indices/delete_sample_configuration/examples/request/IndicesDeleteSampleConfigurationRequest1.yaml deleted file mode 100644 index 5a46bab146..0000000000 --- a/specification/indices/delete_sample_configuration/examples/request/IndicesDeleteSampleConfigurationRequest1.yaml +++ /dev/null @@ -1 +0,0 @@ -method_request: DELETE /my-index/_sample/config diff --git a/specification/indices/get_all_sample_configuration/IndicesGetAllSampleConfigurationRequest.ts b/specification/indices/get_all_sample_configuration/IndicesGetAllSampleConfigurationRequest.ts deleted file mode 100644 index 6329d0f053..0000000000 --- a/specification/indices/get_all_sample_configuration/IndicesGetAllSampleConfigurationRequest.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { RequestBase } from '@_types/Base' -import { Duration } from '@_types/Time' -import { MediaType } from '@_types/common' - -/** - * Get all sampling configurations. - * - * Get the sampling configurations for all indices. - * @rest_spec_name indices.get_all_sample_configuration - * @availability stack visibility=feature_flag feature_flag=random_sampling since=9.3.0 stability=experimental - * @doc_id indices-get-all-sample-configuration - * @doc_tag random_sample - */ -export interface Request extends RequestBase { - urls: [ - { - path: '/_sample/config' - methods: ['GET'] - } - ] - response_media_type: MediaType.Json - query_parameters: { - /** - * 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. - * @server_default 30s - */ - master_timeout?: Duration - } -} diff --git a/specification/indices/get_all_sample_configuration/IndicesGetAllSampleConfigurationResponse.ts b/specification/indices/get_all_sample_configuration/IndicesGetAllSampleConfigurationResponse.ts deleted file mode 100644 index c1784da36f..0000000000 --- a/specification/indices/get_all_sample_configuration/IndicesGetAllSampleConfigurationResponse.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { IndexSamplingConfiguration } from './_types/IndexSamplingConfiguration' - -export class Response { - body: { - configurations: IndexSamplingConfiguration[] - } -} diff --git a/specification/indices/get_all_sample_configuration/_types/IndexSamplingConfiguration.ts b/specification/indices/get_all_sample_configuration/_types/IndexSamplingConfiguration.ts deleted file mode 100644 index 5c51177a70..0000000000 --- a/specification/indices/get_all_sample_configuration/_types/IndexSamplingConfiguration.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { IndexName } from '@_types/common' -import { SamplingConfiguration } from '@indices/_types/SampleConfiguration' - -export class IndexSamplingConfiguration { - index: IndexName - configuration: SamplingConfiguration -} diff --git a/specification/indices/get_all_sample_configuration/examples/200_response/IndicesGetAllSampleConfigurationResponse1.yaml b/specification/indices/get_all_sample_configuration/examples/200_response/IndicesGetAllSampleConfigurationResponse1.yaml deleted file mode 100644 index b3696a3d16..0000000000 --- a/specification/indices/get_all_sample_configuration/examples/200_response/IndicesGetAllSampleConfigurationResponse1.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# summary: '' -description: A successful response for retrieving all sampling configurations. -# type: response -# response_code: 200 -value: |- - { - "configurations": [ - { - "index": "my-index", - "configuration": { - "rate": 0.05, - "max_samples": 1000, - "max_size_in_bytes": 10485760, - "time_to_live_in_millis": 86400000, - "if": "ctx?.network?.name == 'Guest'", - "creation_time_in_millis": 1761677431066 - } - } - ] - } diff --git a/specification/indices/get_all_sample_configuration/examples/request/IndicesGetAllSampleConfigurationRequest1.yaml b/specification/indices/get_all_sample_configuration/examples/request/IndicesGetAllSampleConfigurationRequest1.yaml deleted file mode 100644 index 92d682710b..0000000000 --- a/specification/indices/get_all_sample_configuration/examples/request/IndicesGetAllSampleConfigurationRequest1.yaml +++ /dev/null @@ -1 +0,0 @@ -method_request: GET /_sample/config diff --git a/specification/indices/get_sample/GetRandomSampleRequest.ts b/specification/indices/get_sample/GetRandomSampleRequest.ts deleted file mode 100644 index 4ada9cb6a3..0000000000 --- a/specification/indices/get_sample/GetRandomSampleRequest.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { RequestBase } from '@_types/Base' -import { IndexName, MediaType } from '@_types/common' - -/** - * Request for a random sample of raw documents ingested into the given index or data stream. - * - * @rest_spec_name indices.get_sample - * @availability stack visibility=feature_flag feature_flag=random_sampling since=9.3.0 stability=experimental - * @doc_id indices-get-sample - * @doc_tag random_sample - */ -export interface Request extends RequestBase { - urls: [ - { - path: '/{index}/_sample' - methods: ['GET'] - } - ] - path_parts: { - /** - * Single index or data stream name. Wildcards are not supported. - */ - index: IndexName - } - response_media_type: MediaType.Json -} diff --git a/specification/indices/get_sample/GetRandomSampleResponse.ts b/specification/indices/get_sample/GetRandomSampleResponse.ts deleted file mode 100644 index 86f3927d8c..0000000000 --- a/specification/indices/get_sample/GetRandomSampleResponse.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { RawDocument } from './_types/RawDocument' - -/** - * Response type for the get_random_samples API. - * It reuses the standard SearchResponse structure. - */ -export class Response { - body: { sample: RawDocument[] } -} diff --git a/specification/indices/get_sample/_types/RawDocument.ts b/specification/indices/get_sample/_types/RawDocument.ts deleted file mode 100644 index e3887e9952..0000000000 --- a/specification/indices/get_sample/_types/RawDocument.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { PropertyName } from '@_types/common' -import { Property } from '@_types/mapping/Property' -import { Dictionary } from '@spec_utils/Dictionary' - -export class RawDocument { - /** - * Name of the index for this raw document. - */ - index: string - /** - * The original raw source. - */ - source: Dictionary -} diff --git a/specification/indices/get_sample/examples/200_response/GetRandomSampleResponse1.yaml b/specification/indices/get_sample/examples/200_response/GetRandomSampleResponse1.yaml deleted file mode 100644 index 090637a81b..0000000000 --- a/specification/indices/get_sample/examples/200_response/GetRandomSampleResponse1.yaml +++ /dev/null @@ -1,35 +0,0 @@ -# summary: '' -description: A successful response for retrieving the random sample for an index or data stream. -# type: response -# response_code: 200 -value: |- - { - "sample": [ - { - "index": "logs", - "source": { - "@timestamp": "2099-11-15T13:12:00", - "message": "Node 0 message", - "user": { - "id": "kimchy" - }, - "network": { - "name": "Guest" - } - } - }, - { - "index": "logs", - "source": { - "@timestamp": "2079-11-15T13:12:00", - "message": "Node 1 message", - "user": { - "id": "kimchy" - }, - "network": { - "name": "Guest" - } - } - } - ] - } diff --git a/specification/indices/get_sample/examples/request/GetRandomSampleRequest1.yaml b/specification/indices/get_sample/examples/request/GetRandomSampleRequest1.yaml deleted file mode 100644 index d1451ec58c..0000000000 --- a/specification/indices/get_sample/examples/request/GetRandomSampleRequest1.yaml +++ /dev/null @@ -1 +0,0 @@ -method_request: GET /my-index-000001/_sample diff --git a/specification/indices/get_sample_configuration/IndicesGetSampleConfigurationRequest.ts b/specification/indices/get_sample_configuration/IndicesGetSampleConfigurationRequest.ts deleted file mode 100644 index 6f4b914175..0000000000 --- a/specification/indices/get_sample_configuration/IndicesGetSampleConfigurationRequest.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { RequestBase } from '@_types/Base' -import { IndexName, MediaType } from '@_types/common' -import { Duration } from '@_types/Time' - -/** - * Get sampling configuration. - * - * Get the sampling configuration for the specified index. - * @rest_spec_name indices.get_sample_configuration - * @availability stack visibility=feature_flag feature_flag=random_sampling since=9.3.0 stability=experimental - * @doc_id indices-get-sample-configuration - * @doc_tag random_sample - */ -export interface Request extends RequestBase { - urls: [ - { - path: '/{index}/_sample/config' - methods: ['GET'] - } - ] - path_parts: { - /** - * The name of the index. - */ - index: IndexName - } - response_media_type: MediaType.Json - query_parameters: { - /** - * 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. - * @server_default 30s - */ - master_timeout?: Duration - } -} diff --git a/specification/indices/get_sample_configuration/IndicesGetSampleConfigurationResponse.ts b/specification/indices/get_sample_configuration/IndicesGetSampleConfigurationResponse.ts deleted file mode 100644 index 6fe564e72a..0000000000 --- a/specification/indices/get_sample_configuration/IndicesGetSampleConfigurationResponse.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { IndexName } from '@_types/common' -import { SamplingConfiguration } from '@indices/_types/SampleConfiguration' - -export class Response { - body: { - index: IndexName - configuration: SamplingConfiguration | null - } -} diff --git a/specification/indices/get_sample_configuration/examples/200_response/IndicesGetSampleConfigurationResponse1.yaml b/specification/indices/get_sample_configuration/examples/200_response/IndicesGetSampleConfigurationResponse1.yaml deleted file mode 100644 index bccf1b45d3..0000000000 --- a/specification/indices/get_sample_configuration/examples/200_response/IndicesGetSampleConfigurationResponse1.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# summary: '' -description: A successful response for retrieving the sampling configuration for an index. -# type: response -# response_code: 200 -value: |- - { - "index": "my-index", - "configuration": { - "rate": 0.05, - "max_samples": 1000, - "max_size_in_bytes": 10485760, - "time_to_live_in_millis": 86400000, - "if": "ctx?.network?.name == 'Guest'", - "creation_time_in_millis": 1761341004982 - } - } diff --git a/specification/indices/get_sample_configuration/examples/request/IndicesGetSampleConfigurationRequest1.yaml b/specification/indices/get_sample_configuration/examples/request/IndicesGetSampleConfigurationRequest1.yaml deleted file mode 100644 index b87965b251..0000000000 --- a/specification/indices/get_sample_configuration/examples/request/IndicesGetSampleConfigurationRequest1.yaml +++ /dev/null @@ -1 +0,0 @@ -method_request: GET /my-index/_sample/config diff --git a/specification/indices/get_sample_stats/GetRandomSampleStatsRequest.ts b/specification/indices/get_sample_stats/GetRandomSampleStatsRequest.ts deleted file mode 100644 index 0bff4f6843..0000000000 --- a/specification/indices/get_sample_stats/GetRandomSampleStatsRequest.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { RequestBase } from '@_types/Base' -import { IndexName, MediaType } from '@_types/common' - -/** - * Request stats for a random sample of raw documents ingested into the given index or data stream. - * - * @rest_spec_name indices.get_sample_stats - * @availability stack visibility=feature_flag feature_flag=random_sampling since=9.3.0 stability=experimental - * @doc_id indices-get-sample-stats - * @doc_tag random_sample - */ -export interface Request extends RequestBase { - urls: [ - { - path: '/{index}/_sample/stats' - methods: ['GET'] - } - ] - path_parts: { - /** - * Single index or data stream name. Wildcards are not supported. - */ - index: IndexName - } - response_media_type: MediaType.Json -} diff --git a/specification/indices/get_sample_stats/GetRandomSampleStatsResponse.ts b/specification/indices/get_sample_stats/GetRandomSampleStatsResponse.ts deleted file mode 100644 index 16680db9ca..0000000000 --- a/specification/indices/get_sample_stats/GetRandomSampleStatsResponse.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { long } from '@_types/Numeric' -import { Duration, DurationValue, UnitMillis } from '@_types/Time' - -/** - * Response type for the get_random_samples API. - * It reuses the standard SearchResponse structure. - */ -export class Response { - body: { - potential_samples: long - samples_rejected_for_max_samples_exceeded: long - samples_rejected_for_condition: long - samples_rejected_for_rate: long - samples_rejected_for_exception: long - samples_rejected_for_size: long - samples_accepted: long - time_sampling?: Duration - time_sampling_millis: DurationValue - time_evaluating_condition?: Duration - time_evaluating_condition_millis: DurationValue - time_compiling_condition?: Duration - time_compiling_condition_millis: DurationValue - last_exception?: string - } -} diff --git a/specification/indices/get_sample_stats/examples/200_response/GetRandomSampleStatsResponse1.yaml b/specification/indices/get_sample_stats/examples/200_response/GetRandomSampleStatsResponse1.yaml deleted file mode 100644 index 18efa69b85..0000000000 --- a/specification/indices/get_sample_stats/examples/200_response/GetRandomSampleStatsResponse1.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# summary: '' -description: A successful response for retrieving the random sample stats for an index or data stream. -# type: response -# response_code: 200 -value: |- - { - "potential_samples": 2, - "samples_rejected_for_max_samples_exceeded": 0, - "samples_rejected_for_condition": 0, - "samples_rejected_for_rate": 0, - "samples_rejected_for_exception": 0, - "samples_rejected_for_size": 0, - "samples_accepted": 2, - "time_sampling": "415.7micros", - "time_sampling_millis": 0, - "time_evaluating_condition": "185.9micros", - "time_evaluating_condition_millis": 0, - "time_compiling_condition": "98.4micros", - "time_compiling_condition_millis": 0 - } diff --git a/specification/indices/get_sample_stats/examples/request/GetRandomSampleStatsRequest1.yaml b/specification/indices/get_sample_stats/examples/request/GetRandomSampleStatsRequest1.yaml deleted file mode 100644 index a8589a40ce..0000000000 --- a/specification/indices/get_sample_stats/examples/request/GetRandomSampleStatsRequest1.yaml +++ /dev/null @@ -1 +0,0 @@ -method_request: GET /my-index-000001/_sample/stats diff --git a/specification/indices/put_sample_configuration/IndicesPutSampleConfigurationRequest.ts b/specification/indices/put_sample_configuration/IndicesPutSampleConfigurationRequest.ts deleted file mode 100644 index 267b316a30..0000000000 --- a/specification/indices/put_sample_configuration/IndicesPutSampleConfigurationRequest.ts +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { RequestBase } from '@_types/Base' -import { ByteSize, IndexName, MediaType } from '@_types/common' -import { double, integer } from '@_types/Numeric' -import { Duration } from '@_types/Time' -import { Stringified } from '@spec_utils/Stringified' - -/** - * Create or update sampling configuration. - * - * Create or update the sampling configuration for the specified index. - * @rest_spec_name indices.put_sample_configuration - * @availability stack visibility=feature_flag feature_flag=random_sampling since=9.3.0 stability=experimental - * @doc_id indices-put-sample-configuration - * @doc_tag random_sample - */ -export interface Request extends RequestBase { - urls: [ - { - path: '/{index}/_sample/config' - methods: ['PUT'] - } - ] - path_parts: { - /** - * The name of the index or data stream. - */ - index: IndexName - } - request_media_type: MediaType.Json - response_media_type: MediaType.Json - query_parameters: { - /** - * 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. - * @server_default 30s - */ - master_timeout?: Duration - /** - * Period to wait for a response. - * If no response is received before the timeout expires, the request fails and returns an error. - * @server_default 30s - */ - timeout?: Duration - } - body: { - /** - * The fraction of documents to sample. Must be greater than 0 and less than or equal to 1. - * Can be specified as a number or a string. - */ - rate: Stringified - /** - * The maximum number of documents to sample. Must be greater than 0 and less than or equal to 10,000. - * @server_default 100 - */ - max_samples?: integer - /** - * The maximum total size of sampled documents. Must be greater than 0 and less than or equal to 5GB. - * @server_default 1GB - */ - max_size?: ByteSize - /** - * The duration for which the sampled documents should be retained. - * Must be greater than 0 and less than or equal to 30 days. - * @server_default 10d - */ - time_to_live?: Duration - /** - * An optional condition script that sampled documents must satisfy. - */ - if?: string - } -} diff --git a/specification/indices/put_sample_configuration/IndicesPutSampleConfigurationResponse.ts b/specification/indices/put_sample_configuration/IndicesPutSampleConfigurationResponse.ts deleted file mode 100644 index 9e7bdb91cd..0000000000 --- a/specification/indices/put_sample_configuration/IndicesPutSampleConfigurationResponse.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { AcknowledgedResponseBase } from '@_types/Base' - -export class Response { - /** @codegen_name result */ - body: AcknowledgedResponseBase -} diff --git a/specification/indices/put_sample_configuration/examples/200_response/IndicesPutSampleConfigurationResponse1.yaml b/specification/indices/put_sample_configuration/examples/200_response/IndicesPutSampleConfigurationResponse1.yaml deleted file mode 100644 index a9f60b90a6..0000000000 --- a/specification/indices/put_sample_configuration/examples/200_response/IndicesPutSampleConfigurationResponse1.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# summary: '' -description: A successful response for creating or updating a sampling configuration. -# type: response -# response_code: 200 -value: |- - { - "acknowledged": true - } diff --git a/specification/indices/put_sample_configuration/examples/request/IndicesPutSampleConfigurationRequest1.yaml b/specification/indices/put_sample_configuration/examples/request/IndicesPutSampleConfigurationRequest1.yaml deleted file mode 100644 index f3710c2524..0000000000 --- a/specification/indices/put_sample_configuration/examples/request/IndicesPutSampleConfigurationRequest1.yaml +++ /dev/null @@ -1,9 +0,0 @@ -method_request: |- - PUT /my-index/_sample/config - { - "rate": 0.05, - "max_samples": 1000, - "max_size": "10mb", - "time_to_live": "1d", - "if": "ctx?.network?.name == 'Guest'" - }