diff --git a/Makefile b/Makefile index f58b518edc..5d22334433 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,6 @@ validate-no-cache: ## Validate a given endpoint request or response without loca generate: ## Generate the output spec @echo ">> generating the spec .." - @make generate-language-examples @npm run generate-schema --prefix compiler -- --spec ../specification/ --output ../output/ @npm run start --prefix typescript-generator @@ -55,7 +54,9 @@ transform-to-openapi: ## Generate the OpenAPI definition from the compiled schem @npm run transform-to-openapi -- --schema output/schema/schema.json --flavor serverless --output output/openapi/elasticsearch-serverless-openapi.json transform-to-openapi-for-docs: ## Generate the OpenAPI definition tailored for API docs generation - @npm run transform-to-openapi -- --schema output/schema/schema.json --flavor stack --lift-enum-descriptions --merge-multipath-endpoints --multipath-redirects --output output/openapi/elasticsearch-openapi-docs.json + @make generate-language-examples + @make generate + @npm run transform-to-openapi -- --schema output/schema/schema.json --flavor stack --lift-enum-descriptions --merge-multipath-endpoints --multipath-redirects --include-language-examples --output output/openapi/elasticsearch-openapi-docs.json filter-for-serverless: ## Generate the serverless version from the compiled schema @npm run --prefix compiler filter-by-availability -- --serverless --visibility=public --input ../output/schema/schema.json --output ../output/output/openapi/elasticsearch-serverless-openapi.json diff --git a/compiler-rs/clients_schema_to_openapi/src/cli.rs b/compiler-rs/clients_schema_to_openapi/src/cli.rs index 9342a15582..fe6abf927f 100644 --- a/compiler-rs/clients_schema_to_openapi/src/cli.rs +++ b/compiler-rs/clients_schema_to_openapi/src/cli.rs @@ -35,6 +35,10 @@ pub struct Cli { /// output a redirection map when merging multipath endpoints #[argh(switch)] pub multipath_redirects: bool, + + /// include the x-codeSamples extension with language examples for all endpoints + #[argh(switch)] + pub include_language_examples: bool, } impl Cli { @@ -74,6 +78,7 @@ impl From for Configuration { lift_enum_descriptions: cli.lift_enum_descriptions, merge_multipath_endpoints: cli.merge_multipath_endpoints, multipath_redirects: cli.multipath_redirects, + include_language_examples: cli.include_language_examples, namespaces: if cli.namespace.is_empty() { None } else { diff --git a/compiler-rs/clients_schema_to_openapi/src/lib.rs b/compiler-rs/clients_schema_to_openapi/src/lib.rs index 7fb8d86bc9..b311cfce0d 100644 --- a/compiler-rs/clients_schema_to_openapi/src/lib.rs +++ b/compiler-rs/clients_schema_to_openapi/src/lib.rs @@ -44,6 +44,9 @@ pub struct Configuration { /// Should we output a redirect map when merging multipath endpoints? pub multipath_redirects: bool, + + /// include the x-codeSamples extension with language examples for all endpoints + pub include_language_examples: bool, } pub struct OpenApiConversion { diff --git a/compiler-rs/clients_schema_to_openapi/src/paths.rs b/compiler-rs/clients_schema_to_openapi/src/paths.rs index 9c6e799486..870db9d788 100644 --- a/compiler-rs/clients_schema_to_openapi/src/paths.rs +++ b/compiler-rs/clients_schema_to_openapi/src/paths.rs @@ -347,31 +347,34 @@ pub fn add_endpoint( // add the x-state extension for availability let mut extensions = crate::availability_as_extensions(&endpoint.availability, &tac.config.flavor); - // add the x-codeSamples extension - let mut code_samples = vec![]; - if let Some(examples) = request.examples.clone() { - if let Some((_, example)) = examples.first() { - let request_line = example.method_request.clone().unwrap_or(String::from("")); - let request_body = example.value.clone().unwrap_or(String::from("")); - if !request_line.is_empty() { - code_samples.push(serde_json::json!({ - "lang": "Console", - "source": request_line + "\n" + request_body.as_str(), - })); - } - if let Some(alternatives) = example.alternatives.clone() { - for alternative in alternatives.iter() { + if tac.config.include_language_examples { + // add the x-codeSamples extension + let mut code_samples = vec![]; + if let Some(examples) = request.examples.clone() { + if let Some((_, example)) = examples.first() { + let request_line = example.method_request.clone().unwrap_or(String::from("")); + let request_body = example.value.clone().unwrap_or(String::from("")); + if !request_line.is_empty() { code_samples.push(serde_json::json!({ - "lang": alternative.language, - "source": alternative.code.as_str(), + "lang": "Console", + "source": request_line + "\n" + request_body.as_str(), })); } + if let Some(alternatives) = example.alternatives.clone() { + for alternative in alternatives.iter() { + code_samples.push(serde_json::json!({ + "lang": alternative.language, + "source": alternative.code.as_str(), + })); + } + } } } + if !code_samples.is_empty() { + extensions.insert("x-codeSamples".to_string(), serde_json::json!(code_samples)); + } } - if !code_samples.is_empty() { - extensions.insert("x-codeSamples".to_string(), serde_json::json!(code_samples)); - } + extensions.append(&mut crate::product_meta_as_extensions(namespace, product_meta)); // Create the operation, it will be repeated if we have several methods diff --git a/compiler-rs/compiler-wasm-lib/pkg/compiler_wasm_lib_bg.wasm b/compiler-rs/compiler-wasm-lib/pkg/compiler_wasm_lib_bg.wasm index c4d84116b5..0d695c8679 100644 Binary files a/compiler-rs/compiler-wasm-lib/pkg/compiler_wasm_lib_bg.wasm and b/compiler-rs/compiler-wasm-lib/pkg/compiler_wasm_lib_bg.wasm differ diff --git a/docs/examples/generate-language-examples.js b/docs/examples/generate-language-examples.js index 01aacf8f93..230a744067 100644 --- a/docs/examples/generate-language-examples.js +++ b/docs/examples/generate-language-examples.js @@ -36,13 +36,14 @@ async function generateLanguages(example) { request += '\n' + JSON.stringify(data.value); } } - data.alternatives = []; + const alternatives = []; for (const lang of LANGUAGES) { - data.alternatives.push({ + alternatives.push({ language: lang, code: (await convertRequests(request, lang, {})).trim(), }); } + data.alternatives = alternatives.concat(data.alternatives.filter(pair => !LANGUAGES.includes(pair.language))); doc.delete('alternatives'); doc.add(doc.createPair('alternatives', data.alternatives)); await fs.promises.writeFile(example, doc.toString({lineWidth: 132})); diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index dc2b0f2b13..bcc0c3393e 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -79,32 +79,6 @@ } }, "x-state": "Generally available; Added in 7.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_async_search/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\n" - }, - { - "lang": "Python", - "source": "resp = client.async_search.get(\n id=\"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.asyncSearch.get({\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.async_search.get(\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->asyncSearch()->get([\n \"id\" => \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_async_search/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -140,32 +114,6 @@ } }, "x-state": "Generally available; Added in 7.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_async_search/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\n" - }, - { - "lang": "Python", - "source": "resp = client.async_search.delete(\n id=\"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.asyncSearch.delete({\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.async_search.delete(\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->asyncSearch()->delete([\n \"id\" => \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_async_search/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -230,32 +178,6 @@ } }, "x-state": "Generally available; Added in 7.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_async_search/status/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\n" - }, - { - "lang": "Python", - "source": "resp = client.async_search.status(\n id=\"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.asyncSearch.status({\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.async_search.status(\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->asyncSearch()->status([\n \"id\" => \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_async_search/status/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -407,32 +329,6 @@ } }, "x-state": "Generally available; Added in 7.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /sales*/_async_search?size=0\n{\n \"sort\": [\n { \"date\": { \"order\": \"asc\" } }\n ],\n \"aggs\": {\n \"sale_date\": {\n \"date_histogram\": {\n \"field\": \"date\",\n \"calendar_interval\": \"1d\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.async_search.submit(\n index=\"sales*\",\n size=\"0\",\n sort=[\n {\n \"date\": {\n \"order\": \"asc\"\n }\n }\n ],\n aggs={\n \"sale_date\": {\n \"date_histogram\": {\n \"field\": \"date\",\n \"calendar_interval\": \"1d\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.asyncSearch.submit({\n index: \"sales*\",\n size: 0,\n sort: [\n {\n date: {\n order: \"asc\",\n },\n },\n ],\n aggs: {\n sale_date: {\n date_histogram: {\n field: \"date\",\n calendar_interval: \"1d\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.async_search.submit(\n index: \"sales*\",\n size: \"0\",\n body: {\n \"sort\": [\n {\n \"date\": {\n \"order\": \"asc\"\n }\n }\n ],\n \"aggs\": {\n \"sale_date\": {\n \"date_histogram\": {\n \"field\": \"date\",\n \"calendar_interval\": \"1d\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->asyncSearch()->submit([\n \"index\" => \"sales*\",\n \"size\" => \"0\",\n \"body\" => [\n \"sort\" => array(\n [\n \"date\" => [\n \"order\" => \"asc\",\n ],\n ],\n ),\n \"aggs\" => [\n \"sale_date\" => [\n \"date_histogram\" => [\n \"field\" => \"date\",\n \"calendar_interval\" => \"1d\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"sort\":[{\"date\":{\"order\":\"asc\"}}],\"aggs\":{\"sale_date\":{\"date_histogram\":{\"field\":\"date\",\"calendar_interval\":\"1d\"}}}}' \"$ELASTICSEARCH_URL/sales*/_async_search?size=0\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -587,32 +483,6 @@ } }, "x-state": "Generally available; Added in 7.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /sales*/_async_search?size=0\n{\n \"sort\": [\n { \"date\": { \"order\": \"asc\" } }\n ],\n \"aggs\": {\n \"sale_date\": {\n \"date_histogram\": {\n \"field\": \"date\",\n \"calendar_interval\": \"1d\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.async_search.submit(\n index=\"sales*\",\n size=\"0\",\n sort=[\n {\n \"date\": {\n \"order\": \"asc\"\n }\n }\n ],\n aggs={\n \"sale_date\": {\n \"date_histogram\": {\n \"field\": \"date\",\n \"calendar_interval\": \"1d\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.asyncSearch.submit({\n index: \"sales*\",\n size: 0,\n sort: [\n {\n date: {\n order: \"asc\",\n },\n },\n ],\n aggs: {\n sale_date: {\n date_histogram: {\n field: \"date\",\n calendar_interval: \"1d\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.async_search.submit(\n index: \"sales*\",\n size: \"0\",\n body: {\n \"sort\": [\n {\n \"date\": {\n \"order\": \"asc\"\n }\n }\n ],\n \"aggs\": {\n \"sale_date\": {\n \"date_histogram\": {\n \"field\": \"date\",\n \"calendar_interval\": \"1d\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->asyncSearch()->submit([\n \"index\" => \"sales*\",\n \"size\" => \"0\",\n \"body\" => [\n \"sort\" => array(\n [\n \"date\" => [\n \"order\" => \"asc\",\n ],\n ],\n ),\n \"aggs\" => [\n \"sale_date\" => [\n \"date_histogram\" => [\n \"field\" => \"date\",\n \"calendar_interval\" => \"1d\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"sort\":[{\"date\":{\"order\":\"asc\"}}],\"aggs\":{\"sale_date\":{\"date_histogram\":{\"field\":\"date\",\"calendar_interval\":\"1d\"}}}}' \"$ELASTICSEARCH_URL/sales*/_async_search?size=0\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -670,32 +540,6 @@ } }, "x-state": "Generally available; Added in 7.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_autoscaling/policy/my_autoscaling_policy\n" - }, - { - "lang": "Python", - "source": "resp = client.autoscaling.get_autoscaling_policy(\n name=\"my_autoscaling_policy\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.autoscaling.getAutoscalingPolicy({\n name: \"my_autoscaling_policy\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.autoscaling.get_autoscaling_policy(\n name: \"my_autoscaling_policy\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->autoscaling()->getAutoscalingPolicy([\n \"name\" => \"my_autoscaling_policy\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_autoscaling/policy/my_autoscaling_policy\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -781,32 +625,6 @@ } }, "x-state": "Generally available; Added in 7.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_autoscaling/policy/\n{\n \"roles\": [],\n \"deciders\": {\n \"fixed\": {\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.autoscaling.put_autoscaling_policy(\n name=\"\",\n policy={\n \"roles\": [],\n \"deciders\": {\n \"fixed\": {}\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.autoscaling.putAutoscalingPolicy({\n name: \"\",\n policy: {\n roles: [],\n deciders: {\n fixed: {},\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.autoscaling.put_autoscaling_policy(\n name: \"\",\n body: {\n \"roles\": [],\n \"deciders\": {\n \"fixed\": {}\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->autoscaling()->putAutoscalingPolicy([\n \"name\" => \"\",\n \"body\" => [\n \"roles\" => array(\n ),\n \"deciders\" => [\n \"fixed\" => new ArrayObject([]),\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"roles\":[],\"deciders\":{\"fixed\":{}}}' \"$ELASTICSEARCH_URL/_autoscaling/policy/\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -872,32 +690,6 @@ } }, "x-state": "Generally available; Added in 7.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_autoscaling/policy/*\n" - }, - { - "lang": "Python", - "source": "resp = client.autoscaling.delete_autoscaling_policy(\n name=\"*\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.autoscaling.deleteAutoscalingPolicy({\n name: \"*\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.autoscaling.delete_autoscaling_policy(\n name: \"*\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->autoscaling()->deleteAutoscalingPolicy([\n \"name\" => \"*\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_autoscaling/policy/*\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -955,32 +747,6 @@ } }, "x-state": "Generally available; Added in 7.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_autoscaling/capacity\n" - }, - { - "lang": "Python", - "source": "resp = client.autoscaling.get_autoscaling_capacity()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.autoscaling.getAutoscalingCapacity();" - }, - { - "lang": "Ruby", - "source": "response = client.autoscaling.get_autoscaling_capacity" - }, - { - "lang": "PHP", - "source": "$resp = $client->autoscaling()->getAutoscalingCapacity();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_autoscaling/capacity\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1042,32 +808,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _bulk\n{ \"index\" : { \"_index\" : \"test\", \"_id\" : \"1\" } }\n{ \"field1\" : \"value1\" }\n{ \"delete\" : { \"_index\" : \"test\", \"_id\" : \"2\" } }\n{ \"create\" : { \"_index\" : \"test\", \"_id\" : \"3\" } }\n{ \"field1\" : \"value3\" }\n{ \"update\" : {\"_id\" : \"1\", \"_index\" : \"test\"} }\n{ \"doc\" : {\"field2\" : \"value2\"} }" - }, - { - "lang": "Python", - "source": "resp = client.bulk(\n operations=[\n {\n \"index\": {\n \"_index\": \"test\",\n \"_id\": \"1\"\n }\n },\n {\n \"field1\": \"value1\"\n },\n {\n \"delete\": {\n \"_index\": \"test\",\n \"_id\": \"2\"\n }\n },\n {\n \"create\": {\n \"_index\": \"test\",\n \"_id\": \"3\"\n }\n },\n {\n \"field1\": \"value3\"\n },\n {\n \"update\": {\n \"_id\": \"1\",\n \"_index\": \"test\"\n }\n },\n {\n \"doc\": {\n \"field2\": \"value2\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.bulk({\n operations: [\n {\n index: {\n _index: \"test\",\n _id: \"1\",\n },\n },\n {\n field1: \"value1\",\n },\n {\n delete: {\n _index: \"test\",\n _id: \"2\",\n },\n },\n {\n create: {\n _index: \"test\",\n _id: \"3\",\n },\n },\n {\n field1: \"value3\",\n },\n {\n update: {\n _id: \"1\",\n _index: \"test\",\n },\n },\n {\n doc: {\n field2: \"value2\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.bulk(\n body: [\n {\n \"index\": {\n \"_index\": \"test\",\n \"_id\": \"1\"\n }\n },\n {\n \"field1\": \"value1\"\n },\n {\n \"delete\": {\n \"_index\": \"test\",\n \"_id\": \"2\"\n }\n },\n {\n \"create\": {\n \"_index\": \"test\",\n \"_id\": \"3\"\n }\n },\n {\n \"field1\": \"value3\"\n },\n {\n \"update\": {\n \"_id\": \"1\",\n \"_index\": \"test\"\n }\n },\n {\n \"doc\": {\n \"field2\": \"value2\"\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->bulk([\n \"body\" => array(\n [\n \"index\" => [\n \"_index\" => \"test\",\n \"_id\" => \"1\",\n ],\n ],\n [\n \"field1\" => \"value1\",\n ],\n [\n \"delete\" => [\n \"_index\" => \"test\",\n \"_id\" => \"2\",\n ],\n ],\n [\n \"create\" => [\n \"_index\" => \"test\",\n \"_id\" => \"3\",\n ],\n ],\n [\n \"field1\" => \"value3\",\n ],\n [\n \"update\" => [\n \"_id\" => \"1\",\n \"_index\" => \"test\",\n ],\n ],\n [\n \"doc\" => [\n \"field2\" => \"value2\",\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{\"index\":{\"_index\":\"test\",\"_id\":\"1\"}},{\"field1\":\"value1\"},{\"delete\":{\"_index\":\"test\",\"_id\":\"2\"}},{\"create\":{\"_index\":\"test\",\"_id\":\"3\"}},{\"field1\":\"value3\"},{\"update\":{\"_id\":\"1\",\"_index\":\"test\"}},{\"doc\":{\"field2\":\"value2\"}}]' \"$ELASTICSEARCH_URL/_bulk\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -1127,32 +867,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _bulk\n{ \"index\" : { \"_index\" : \"test\", \"_id\" : \"1\" } }\n{ \"field1\" : \"value1\" }\n{ \"delete\" : { \"_index\" : \"test\", \"_id\" : \"2\" } }\n{ \"create\" : { \"_index\" : \"test\", \"_id\" : \"3\" } }\n{ \"field1\" : \"value3\" }\n{ \"update\" : {\"_id\" : \"1\", \"_index\" : \"test\"} }\n{ \"doc\" : {\"field2\" : \"value2\"} }" - }, - { - "lang": "Python", - "source": "resp = client.bulk(\n operations=[\n {\n \"index\": {\n \"_index\": \"test\",\n \"_id\": \"1\"\n }\n },\n {\n \"field1\": \"value1\"\n },\n {\n \"delete\": {\n \"_index\": \"test\",\n \"_id\": \"2\"\n }\n },\n {\n \"create\": {\n \"_index\": \"test\",\n \"_id\": \"3\"\n }\n },\n {\n \"field1\": \"value3\"\n },\n {\n \"update\": {\n \"_id\": \"1\",\n \"_index\": \"test\"\n }\n },\n {\n \"doc\": {\n \"field2\": \"value2\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.bulk({\n operations: [\n {\n index: {\n _index: \"test\",\n _id: \"1\",\n },\n },\n {\n field1: \"value1\",\n },\n {\n delete: {\n _index: \"test\",\n _id: \"2\",\n },\n },\n {\n create: {\n _index: \"test\",\n _id: \"3\",\n },\n },\n {\n field1: \"value3\",\n },\n {\n update: {\n _id: \"1\",\n _index: \"test\",\n },\n },\n {\n doc: {\n field2: \"value2\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.bulk(\n body: [\n {\n \"index\": {\n \"_index\": \"test\",\n \"_id\": \"1\"\n }\n },\n {\n \"field1\": \"value1\"\n },\n {\n \"delete\": {\n \"_index\": \"test\",\n \"_id\": \"2\"\n }\n },\n {\n \"create\": {\n \"_index\": \"test\",\n \"_id\": \"3\"\n }\n },\n {\n \"field1\": \"value3\"\n },\n {\n \"update\": {\n \"_id\": \"1\",\n \"_index\": \"test\"\n }\n },\n {\n \"doc\": {\n \"field2\": \"value2\"\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->bulk([\n \"body\" => array(\n [\n \"index\" => [\n \"_index\" => \"test\",\n \"_id\" => \"1\",\n ],\n ],\n [\n \"field1\" => \"value1\",\n ],\n [\n \"delete\" => [\n \"_index\" => \"test\",\n \"_id\" => \"2\",\n ],\n ],\n [\n \"create\" => [\n \"_index\" => \"test\",\n \"_id\" => \"3\",\n ],\n ],\n [\n \"field1\" => \"value3\",\n ],\n [\n \"update\" => [\n \"_id\" => \"1\",\n \"_index\" => \"test\",\n ],\n ],\n [\n \"doc\" => [\n \"field2\" => \"value2\",\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{\"index\":{\"_index\":\"test\",\"_id\":\"1\"}},{\"field1\":\"value1\"},{\"delete\":{\"_index\":\"test\",\"_id\":\"2\"}},{\"create\":{\"_index\":\"test\",\"_id\":\"3\"}},{\"field1\":\"value3\"},{\"update\":{\"_id\":\"1\",\"_index\":\"test\"}},{\"doc\":{\"field2\":\"value2\"}}]' \"$ELASTICSEARCH_URL/_bulk\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1217,32 +931,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _bulk\n{ \"index\" : { \"_index\" : \"test\", \"_id\" : \"1\" } }\n{ \"field1\" : \"value1\" }\n{ \"delete\" : { \"_index\" : \"test\", \"_id\" : \"2\" } }\n{ \"create\" : { \"_index\" : \"test\", \"_id\" : \"3\" } }\n{ \"field1\" : \"value3\" }\n{ \"update\" : {\"_id\" : \"1\", \"_index\" : \"test\"} }\n{ \"doc\" : {\"field2\" : \"value2\"} }" - }, - { - "lang": "Python", - "source": "resp = client.bulk(\n operations=[\n {\n \"index\": {\n \"_index\": \"test\",\n \"_id\": \"1\"\n }\n },\n {\n \"field1\": \"value1\"\n },\n {\n \"delete\": {\n \"_index\": \"test\",\n \"_id\": \"2\"\n }\n },\n {\n \"create\": {\n \"_index\": \"test\",\n \"_id\": \"3\"\n }\n },\n {\n \"field1\": \"value3\"\n },\n {\n \"update\": {\n \"_id\": \"1\",\n \"_index\": \"test\"\n }\n },\n {\n \"doc\": {\n \"field2\": \"value2\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.bulk({\n operations: [\n {\n index: {\n _index: \"test\",\n _id: \"1\",\n },\n },\n {\n field1: \"value1\",\n },\n {\n delete: {\n _index: \"test\",\n _id: \"2\",\n },\n },\n {\n create: {\n _index: \"test\",\n _id: \"3\",\n },\n },\n {\n field1: \"value3\",\n },\n {\n update: {\n _id: \"1\",\n _index: \"test\",\n },\n },\n {\n doc: {\n field2: \"value2\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.bulk(\n body: [\n {\n \"index\": {\n \"_index\": \"test\",\n \"_id\": \"1\"\n }\n },\n {\n \"field1\": \"value1\"\n },\n {\n \"delete\": {\n \"_index\": \"test\",\n \"_id\": \"2\"\n }\n },\n {\n \"create\": {\n \"_index\": \"test\",\n \"_id\": \"3\"\n }\n },\n {\n \"field1\": \"value3\"\n },\n {\n \"update\": {\n \"_id\": \"1\",\n \"_index\": \"test\"\n }\n },\n {\n \"doc\": {\n \"field2\": \"value2\"\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->bulk([\n \"body\" => array(\n [\n \"index\" => [\n \"_index\" => \"test\",\n \"_id\" => \"1\",\n ],\n ],\n [\n \"field1\" => \"value1\",\n ],\n [\n \"delete\" => [\n \"_index\" => \"test\",\n \"_id\" => \"2\",\n ],\n ],\n [\n \"create\" => [\n \"_index\" => \"test\",\n \"_id\" => \"3\",\n ],\n ],\n [\n \"field1\" => \"value3\",\n ],\n [\n \"update\" => [\n \"_id\" => \"1\",\n \"_index\" => \"test\",\n ],\n ],\n [\n \"doc\" => [\n \"field2\" => \"value2\",\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{\"index\":{\"_index\":\"test\",\"_id\":\"1\"}},{\"field1\":\"value1\"},{\"delete\":{\"_index\":\"test\",\"_id\":\"2\"}},{\"create\":{\"_index\":\"test\",\"_id\":\"3\"}},{\"field1\":\"value3\"},{\"update\":{\"_id\":\"1\",\"_index\":\"test\"}},{\"doc\":{\"field2\":\"value2\"}}]' \"$ELASTICSEARCH_URL/_bulk\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -1305,32 +993,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _bulk\n{ \"index\" : { \"_index\" : \"test\", \"_id\" : \"1\" } }\n{ \"field1\" : \"value1\" }\n{ \"delete\" : { \"_index\" : \"test\", \"_id\" : \"2\" } }\n{ \"create\" : { \"_index\" : \"test\", \"_id\" : \"3\" } }\n{ \"field1\" : \"value3\" }\n{ \"update\" : {\"_id\" : \"1\", \"_index\" : \"test\"} }\n{ \"doc\" : {\"field2\" : \"value2\"} }" - }, - { - "lang": "Python", - "source": "resp = client.bulk(\n operations=[\n {\n \"index\": {\n \"_index\": \"test\",\n \"_id\": \"1\"\n }\n },\n {\n \"field1\": \"value1\"\n },\n {\n \"delete\": {\n \"_index\": \"test\",\n \"_id\": \"2\"\n }\n },\n {\n \"create\": {\n \"_index\": \"test\",\n \"_id\": \"3\"\n }\n },\n {\n \"field1\": \"value3\"\n },\n {\n \"update\": {\n \"_id\": \"1\",\n \"_index\": \"test\"\n }\n },\n {\n \"doc\": {\n \"field2\": \"value2\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.bulk({\n operations: [\n {\n index: {\n _index: \"test\",\n _id: \"1\",\n },\n },\n {\n field1: \"value1\",\n },\n {\n delete: {\n _index: \"test\",\n _id: \"2\",\n },\n },\n {\n create: {\n _index: \"test\",\n _id: \"3\",\n },\n },\n {\n field1: \"value3\",\n },\n {\n update: {\n _id: \"1\",\n _index: \"test\",\n },\n },\n {\n doc: {\n field2: \"value2\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.bulk(\n body: [\n {\n \"index\": {\n \"_index\": \"test\",\n \"_id\": \"1\"\n }\n },\n {\n \"field1\": \"value1\"\n },\n {\n \"delete\": {\n \"_index\": \"test\",\n \"_id\": \"2\"\n }\n },\n {\n \"create\": {\n \"_index\": \"test\",\n \"_id\": \"3\"\n }\n },\n {\n \"field1\": \"value3\"\n },\n {\n \"update\": {\n \"_id\": \"1\",\n \"_index\": \"test\"\n }\n },\n {\n \"doc\": {\n \"field2\": \"value2\"\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->bulk([\n \"body\" => array(\n [\n \"index\" => [\n \"_index\" => \"test\",\n \"_id\" => \"1\",\n ],\n ],\n [\n \"field1\" => \"value1\",\n ],\n [\n \"delete\" => [\n \"_index\" => \"test\",\n \"_id\" => \"2\",\n ],\n ],\n [\n \"create\" => [\n \"_index\" => \"test\",\n \"_id\" => \"3\",\n ],\n ],\n [\n \"field1\" => \"value3\",\n ],\n [\n \"update\" => [\n \"_id\" => \"1\",\n \"_index\" => \"test\",\n ],\n ],\n [\n \"doc\" => [\n \"field2\" => \"value2\",\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{\"index\":{\"_index\":\"test\",\"_id\":\"1\"}},{\"field1\":\"value1\"},{\"delete\":{\"_index\":\"test\",\"_id\":\"2\"}},{\"create\":{\"_index\":\"test\",\"_id\":\"3\"}},{\"field1\":\"value3\"},{\"update\":{\"_id\":\"1\",\"_index\":\"test\"}},{\"doc\":{\"field2\":\"value2\"}}]' \"$ELASTICSEARCH_URL/_bulk\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1362,32 +1024,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/aliases?format=json&v=true\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.aliases(\n format=\"json\",\n v=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.aliases({\n format: \"json\",\n v: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.aliases(\n format: \"json\",\n v: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->aliases([\n \"format\" => \"json\",\n \"v\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/aliases?format=json&v=true\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1422,32 +1058,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/aliases?format=json&v=true\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.aliases(\n format=\"json\",\n v=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.aliases({\n format: \"json\",\n v: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.aliases(\n format: \"json\",\n v: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->aliases([\n \"format\" => \"json\",\n \"v\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/aliases?format=json&v=true\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1482,32 +1092,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/allocation?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.allocation(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.allocation({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.allocation(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->allocation([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/allocation?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1545,32 +1129,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/allocation?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.allocation(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.allocation({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.allocation(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->allocation([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/allocation?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1602,32 +1160,6 @@ } }, "x-state": "Generally available; Added in 5.1.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/component_templates/my-template-*?v=true&s=name&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.component_templates(\n name=\"my-template-*\",\n v=True,\n s=\"name\",\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.componentTemplates({\n name: \"my-template-*\",\n v: \"true\",\n s: \"name\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.component_templates(\n name: \"my-template-*\",\n v: \"true\",\n s: \"name\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->componentTemplates([\n \"name\" => \"my-template-*\",\n \"v\" => \"true\",\n \"s\" => \"name\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/component_templates/my-template-*?v=true&s=name&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1662,32 +1194,6 @@ } }, "x-state": "Generally available; Added in 5.1.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/component_templates/my-template-*?v=true&s=name&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.component_templates(\n name=\"my-template-*\",\n v=True,\n s=\"name\",\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.componentTemplates({\n name: \"my-template-*\",\n v: \"true\",\n s: \"name\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.component_templates(\n name: \"my-template-*\",\n v: \"true\",\n s: \"name\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->componentTemplates([\n \"name\" => \"my-template-*\",\n \"v\" => \"true\",\n \"s\" => \"name\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/component_templates/my-template-*?v=true&s=name&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1713,32 +1219,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/count/my-index-000001?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.count(\n index=\"my-index-000001\",\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.count({\n index: \"my-index-000001\",\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.count(\n index: \"my-index-000001\",\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->count([\n \"index\" => \"my-index-000001\",\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/count/my-index-000001?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1767,32 +1247,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/count/my-index-000001?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.count(\n index=\"my-index-000001\",\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.count({\n index: \"my-index-000001\",\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.count(\n index: \"my-index-000001\",\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->count([\n \"index\" => \"my-index-000001\",\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/count/my-index-000001?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1824,32 +1278,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/fielddata?v=true&fields=body&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.fielddata(\n v=True,\n fields=\"body\",\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.fielddata({\n v: \"true\",\n fields: \"body\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.fielddata(\n v: \"true\",\n fields: \"body\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->fielddata([\n \"v\" => \"true\",\n \"fields\" => \"body\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/fielddata?v=true&fields=body&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1884,32 +1312,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/fielddata?v=true&fields=body&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.fielddata(\n v=True,\n fields=\"body\",\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.fielddata({\n v: \"true\",\n fields: \"body\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.fielddata(\n v: \"true\",\n fields: \"body\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->fielddata([\n \"v\" => \"true\",\n \"fields\" => \"body\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/fielddata?v=true&fields=body&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1985,32 +1387,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/health?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.health(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.health({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.health(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->health([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/health?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -2081,32 +1457,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/indices/my-index-*?v=true&s=index&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.indices(\n index=\"my-index-*\",\n v=True,\n s=\"index\",\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.indices({\n index: \"my-index-*\",\n v: \"true\",\n s: \"index\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.indices(\n index: \"my-index-*\",\n v: \"true\",\n s: \"index\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->indices([\n \"index\" => \"my-index-*\",\n \"v\" => \"true\",\n \"s\" => \"index\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/indices/my-index-*?v=true&s=index&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -2156,32 +1506,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/indices/my-index-*?v=true&s=index&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.indices(\n index=\"my-index-*\",\n v=True,\n s=\"index\",\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.indices({\n index: \"my-index-*\",\n v: \"true\",\n s: \"index\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.indices(\n index: \"my-index-*\",\n v: \"true\",\n s: \"index\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->indices([\n \"index\" => \"my-index-*\",\n \"v\" => \"true\",\n \"s\" => \"index\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/indices/my-index-*?v=true&s=index&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -2257,32 +1581,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/master?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.master(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.master({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.master(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->master([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/master?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -2317,32 +1615,6 @@ } }, "x-state": "Generally available; Added in 7.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/ml/data_frame/analytics?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.ml_data_frame_analytics(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.mlDataFrameAnalytics({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.ml_data_frame_analytics(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->mlDataFrameAnalytics([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/ml/data_frame/analytics?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -2380,32 +1652,6 @@ } }, "x-state": "Generally available; Added in 7.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/ml/data_frame/analytics?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.ml_data_frame_analytics(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.mlDataFrameAnalytics({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.ml_data_frame_analytics(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->mlDataFrameAnalytics([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/ml/data_frame/analytics?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -2437,32 +1683,6 @@ } }, "x-state": "Generally available; Added in 7.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/ml/datafeeds?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.ml_datafeeds(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.mlDatafeeds({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.ml_datafeeds(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->mlDatafeeds([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/ml/datafeeds?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -2497,32 +1717,6 @@ } }, "x-state": "Generally available; Added in 7.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/ml/datafeeds?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.ml_datafeeds(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.mlDatafeeds({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.ml_datafeeds(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->mlDatafeeds([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/ml/datafeeds?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -2557,32 +1751,6 @@ } }, "x-state": "Generally available; Added in 7.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/ml/anomaly_detectors?h=id,s,dpr,mb&v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.ml_jobs(\n h=\"id,s,dpr,mb\",\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.mlJobs({\n h: \"id,s,dpr,mb\",\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.ml_jobs(\n h: \"id,s,dpr,mb\",\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->mlJobs([\n \"h\" => \"id,s,dpr,mb\",\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/ml/anomaly_detectors?h=id,s,dpr,mb&v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -2620,32 +1788,6 @@ } }, "x-state": "Generally available; Added in 7.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/ml/anomaly_detectors?h=id,s,dpr,mb&v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.ml_jobs(\n h=\"id,s,dpr,mb\",\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.mlJobs({\n h: \"id,s,dpr,mb\",\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.ml_jobs(\n h: \"id,s,dpr,mb\",\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->mlJobs([\n \"h\" => \"id,s,dpr,mb\",\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/ml/anomaly_detectors?h=id,s,dpr,mb&v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -2686,32 +1828,6 @@ } }, "x-state": "Generally available; Added in 7.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/ml/trained_models?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.ml_trained_models(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.mlTrainedModels({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.ml_trained_models(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->mlTrainedModels([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/ml/trained_models?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -2755,32 +1871,6 @@ } }, "x-state": "Generally available; Added in 7.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/ml/trained_models?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.ml_trained_models(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.mlTrainedModels({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.ml_trained_models(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->mlTrainedModels([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/ml/trained_models?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -2862,32 +1952,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/nodeattrs?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.nodeattrs(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.nodeattrs({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.nodeattrs(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->nodeattrs([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/nodeattrs?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -3006,32 +2070,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/nodes?v=true&h=id,ip,port,v,m&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.nodes(\n v=True,\n h=\"id,ip,port,v,m\",\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.nodes({\n v: \"true\",\n h: \"id,ip,port,v,m\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.nodes(\n v: \"true\",\n h: \"id,ip,port,v,m\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->nodes([\n \"v\" => \"true\",\n \"h\" => \"id,ip,port,v,m\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/nodes?v=true&h=id,ip,port,v,m&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -3117,32 +2155,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/pending_tasks?v=trueh=insertOrder,timeInQueue,priority,source&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.pending_tasks(\n v=\"trueh=insertOrder,timeInQueue,priority,source\",\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.pendingTasks({\n v: \"trueh=insertOrder,timeInQueue,priority,source\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.pending_tasks(\n v: \"trueh=insertOrder,timeInQueue,priority,source\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->pendingTasks([\n \"v\" => \"trueh=insertOrder,timeInQueue,priority,source\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/pending_tasks?v=trueh=insertOrder,timeInQueue,priority,source&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -3228,32 +2240,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/plugins?v=true&s=component&h=name,component,version,description&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.plugins(\n v=True,\n s=\"component\",\n h=\"name,component,version,description\",\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.plugins({\n v: \"true\",\n s: \"component\",\n h: \"name,component,version,description\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.plugins(\n v: \"true\",\n s: \"component\",\n h: \"name,component,version,description\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->plugins([\n \"v\" => \"true\",\n \"s\" => \"component\",\n \"h\" => \"name,component,version,description\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/plugins?v=true&s=component&h=name,component,version,description&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -3294,32 +2280,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/recovery?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.recovery(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.recovery({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.recovery(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->recovery([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/recovery?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -3363,32 +2323,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/recovery?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.recovery(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.recovery({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.recovery(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->recovery([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/recovery?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -3464,32 +2398,6 @@ } }, "x-state": "Generally available; Added in 2.1.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/repositories?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.repositories(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.repositories({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.repositories(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->repositories([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/repositories?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -3524,32 +2432,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/segments?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.segments(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.segments({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.segments(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->segments([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/segments?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -3587,32 +2469,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/segments?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.segments(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.segments({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.segments(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->segments([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/segments?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -3647,32 +2503,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/shards?format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.shards(\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.shards({\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.shards(\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->shards([\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/shards?format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -3710,32 +2540,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/shards?format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.shards(\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.shards({\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.shards(\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->shards([\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/shards?format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -3770,32 +2574,6 @@ } }, "x-state": "Generally available; Added in 2.1.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/snapshots/repo1?v=true&s=id&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.snapshots(\n repository=\"repo1\",\n v=True,\n s=\"id\",\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.snapshots({\n repository: \"repo1\",\n v: \"true\",\n s: \"id\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.snapshots(\n repository: \"repo1\",\n v: \"true\",\n s: \"id\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->snapshots([\n \"repository\" => \"repo1\",\n \"v\" => \"true\",\n \"s\" => \"id\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/snapshots/repo1?v=true&s=id&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -3833,32 +2611,6 @@ } }, "x-state": "Generally available; Added in 2.1.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/snapshots/repo1?v=true&s=id&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.snapshots(\n repository=\"repo1\",\n v=True,\n s=\"id\",\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.snapshots({\n repository: \"repo1\",\n v: \"true\",\n s: \"id\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.snapshots(\n repository: \"repo1\",\n v: \"true\",\n s: \"id\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->snapshots([\n \"repository\" => \"repo1\",\n \"v\" => \"true\",\n \"s\" => \"id\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/snapshots/repo1?v=true&s=id&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -3990,32 +2742,6 @@ } }, "x-state": "Technical preview; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/tasks?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.tasks(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.tasks({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.tasks(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->tasks([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/tasks?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -4047,32 +2773,6 @@ } }, "x-state": "Generally available; Added in 5.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/templates/my-template-*?v=true&s=name&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.templates(\n name=\"my-template-*\",\n v=True,\n s=\"name\",\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.templates({\n name: \"my-template-*\",\n v: \"true\",\n s: \"name\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.templates(\n name: \"my-template-*\",\n v: \"true\",\n s: \"name\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->templates([\n \"name\" => \"my-template-*\",\n \"v\" => \"true\",\n \"s\" => \"name\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/templates/my-template-*?v=true&s=name&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -4107,32 +2807,6 @@ } }, "x-state": "Generally available; Added in 5.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/templates/my-template-*?v=true&s=name&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.templates(\n name=\"my-template-*\",\n v=True,\n s=\"name\",\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.templates({\n name: \"my-template-*\",\n v: \"true\",\n s: \"name\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.templates(\n name: \"my-template-*\",\n v: \"true\",\n s: \"name\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->templates([\n \"name\" => \"my-template-*\",\n \"v\" => \"true\",\n \"s\" => \"name\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/templates/my-template-*?v=true&s=name&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -4167,32 +2841,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/thread_pool?format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.thread_pool(\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.threadPool({\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.thread_pool(\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->threadPool([\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/thread_pool?format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -4230,32 +2878,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/thread_pool?format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.thread_pool(\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.threadPool({\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.thread_pool(\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->threadPool([\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/thread_pool?format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -4293,32 +2915,6 @@ } }, "x-state": "Generally available; Added in 7.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/transforms?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.transforms(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.transforms({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.transforms(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->transforms([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/transforms?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -4359,32 +2955,6 @@ } }, "x-state": "Generally available; Added in 7.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/transforms?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.transforms(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.transforms({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.transforms(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->transforms([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/transforms?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -4413,32 +2983,6 @@ } }, "x-state": "Generally available; Added in 6.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_ccr/auto_follow/my_auto_follow_pattern\n" - }, - { - "lang": "Python", - "source": "resp = client.ccr.get_auto_follow_pattern(\n name=\"my_auto_follow_pattern\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ccr.getAutoFollowPattern({\n name: \"my_auto_follow_pattern\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ccr.get_auto_follow_pattern(\n name: \"my_auto_follow_pattern\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ccr()->getAutoFollowPattern([\n \"name\" => \"my_auto_follow_pattern\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ccr/auto_follow/my_auto_follow_pattern\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -4569,32 +3113,6 @@ } }, "x-state": "Generally available; Added in 6.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_ccr/auto_follow/my_auto_follow_pattern\n{\n \"remote_cluster\" : \"remote_cluster\",\n \"leader_index_patterns\" :\n [\n \"leader_index*\"\n ],\n \"follow_index_pattern\" : \"{{leader_index}}-follower\",\n \"settings\": {\n \"index.number_of_replicas\": 0\n },\n \"max_read_request_operation_count\" : 1024,\n \"max_outstanding_read_requests\" : 16,\n \"max_read_request_size\" : \"1024k\",\n \"max_write_request_operation_count\" : 32768,\n \"max_write_request_size\" : \"16k\",\n \"max_outstanding_write_requests\" : 8,\n \"max_write_buffer_count\" : 512,\n \"max_write_buffer_size\" : \"512k\",\n \"max_retry_delay\" : \"10s\",\n \"read_poll_timeout\" : \"30s\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ccr.put_auto_follow_pattern(\n name=\"my_auto_follow_pattern\",\n remote_cluster=\"remote_cluster\",\n leader_index_patterns=[\n \"leader_index*\"\n ],\n follow_index_pattern=\"{{leader_index}}-follower\",\n settings={\n \"index.number_of_replicas\": 0\n },\n max_read_request_operation_count=1024,\n max_outstanding_read_requests=16,\n max_read_request_size=\"1024k\",\n max_write_request_operation_count=32768,\n max_write_request_size=\"16k\",\n max_outstanding_write_requests=8,\n max_write_buffer_count=512,\n max_write_buffer_size=\"512k\",\n max_retry_delay=\"10s\",\n read_poll_timeout=\"30s\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ccr.putAutoFollowPattern({\n name: \"my_auto_follow_pattern\",\n remote_cluster: \"remote_cluster\",\n leader_index_patterns: [\"leader_index*\"],\n follow_index_pattern: \"{{leader_index}}-follower\",\n settings: {\n \"index.number_of_replicas\": 0,\n },\n max_read_request_operation_count: 1024,\n max_outstanding_read_requests: 16,\n max_read_request_size: \"1024k\",\n max_write_request_operation_count: 32768,\n max_write_request_size: \"16k\",\n max_outstanding_write_requests: 8,\n max_write_buffer_count: 512,\n max_write_buffer_size: \"512k\",\n max_retry_delay: \"10s\",\n read_poll_timeout: \"30s\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ccr.put_auto_follow_pattern(\n name: \"my_auto_follow_pattern\",\n body: {\n \"remote_cluster\": \"remote_cluster\",\n \"leader_index_patterns\": [\n \"leader_index*\"\n ],\n \"follow_index_pattern\": \"{{leader_index}}-follower\",\n \"settings\": {\n \"index.number_of_replicas\": 0\n },\n \"max_read_request_operation_count\": 1024,\n \"max_outstanding_read_requests\": 16,\n \"max_read_request_size\": \"1024k\",\n \"max_write_request_operation_count\": 32768,\n \"max_write_request_size\": \"16k\",\n \"max_outstanding_write_requests\": 8,\n \"max_write_buffer_count\": 512,\n \"max_write_buffer_size\": \"512k\",\n \"max_retry_delay\": \"10s\",\n \"read_poll_timeout\": \"30s\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ccr()->putAutoFollowPattern([\n \"name\" => \"my_auto_follow_pattern\",\n \"body\" => [\n \"remote_cluster\" => \"remote_cluster\",\n \"leader_index_patterns\" => array(\n \"leader_index*\",\n ),\n \"follow_index_pattern\" => \"{{leader_index}}-follower\",\n \"settings\" => [\n \"index.number_of_replicas\" => 0,\n ],\n \"max_read_request_operation_count\" => 1024,\n \"max_outstanding_read_requests\" => 16,\n \"max_read_request_size\" => \"1024k\",\n \"max_write_request_operation_count\" => 32768,\n \"max_write_request_size\" => \"16k\",\n \"max_outstanding_write_requests\" => 8,\n \"max_write_buffer_count\" => 512,\n \"max_write_buffer_size\" => \"512k\",\n \"max_retry_delay\" => \"10s\",\n \"read_poll_timeout\" => \"30s\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"remote_cluster\":\"remote_cluster\",\"leader_index_patterns\":[\"leader_index*\"],\"follow_index_pattern\":\"{{leader_index}}-follower\",\"settings\":{\"index.number_of_replicas\":0},\"max_read_request_operation_count\":1024,\"max_outstanding_read_requests\":16,\"max_read_request_size\":\"1024k\",\"max_write_request_operation_count\":32768,\"max_write_request_size\":\"16k\",\"max_outstanding_write_requests\":8,\"max_write_buffer_count\":512,\"max_write_buffer_size\":\"512k\",\"max_retry_delay\":\"10s\",\"read_poll_timeout\":\"30s\"}' \"$ELASTICSEARCH_URL/_ccr/auto_follow/my_auto_follow_pattern\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -4649,32 +3167,6 @@ } }, "x-state": "Generally available; Added in 6.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_ccr/auto_follow/my_auto_follow_pattern\n" - }, - { - "lang": "Python", - "source": "resp = client.ccr.delete_auto_follow_pattern(\n name=\"my_auto_follow_pattern\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ccr.deleteAutoFollowPattern({\n name: \"my_auto_follow_pattern\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ccr.delete_auto_follow_pattern(\n name: \"my_auto_follow_pattern\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ccr()->deleteAutoFollowPattern([\n \"name\" => \"my_auto_follow_pattern\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ccr/auto_follow/my_auto_follow_pattern\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -4825,32 +3317,6 @@ } }, "x-state": "Generally available; Added in 6.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /follower_index/_ccr/follow?wait_for_active_shards=1\n{\n \"remote_cluster\" : \"remote_cluster\",\n \"leader_index\" : \"leader_index\",\n \"settings\": {\n \"index.number_of_replicas\": 0\n },\n \"max_read_request_operation_count\" : 1024,\n \"max_outstanding_read_requests\" : 16,\n \"max_read_request_size\" : \"1024k\",\n \"max_write_request_operation_count\" : 32768,\n \"max_write_request_size\" : \"16k\",\n \"max_outstanding_write_requests\" : 8,\n \"max_write_buffer_count\" : 512,\n \"max_write_buffer_size\" : \"512k\",\n \"max_retry_delay\" : \"10s\",\n \"read_poll_timeout\" : \"30s\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ccr.follow(\n index=\"follower_index\",\n wait_for_active_shards=\"1\",\n remote_cluster=\"remote_cluster\",\n leader_index=\"leader_index\",\n settings={\n \"index.number_of_replicas\": 0\n },\n max_read_request_operation_count=1024,\n max_outstanding_read_requests=16,\n max_read_request_size=\"1024k\",\n max_write_request_operation_count=32768,\n max_write_request_size=\"16k\",\n max_outstanding_write_requests=8,\n max_write_buffer_count=512,\n max_write_buffer_size=\"512k\",\n max_retry_delay=\"10s\",\n read_poll_timeout=\"30s\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ccr.follow({\n index: \"follower_index\",\n wait_for_active_shards: 1,\n remote_cluster: \"remote_cluster\",\n leader_index: \"leader_index\",\n settings: {\n \"index.number_of_replicas\": 0,\n },\n max_read_request_operation_count: 1024,\n max_outstanding_read_requests: 16,\n max_read_request_size: \"1024k\",\n max_write_request_operation_count: 32768,\n max_write_request_size: \"16k\",\n max_outstanding_write_requests: 8,\n max_write_buffer_count: 512,\n max_write_buffer_size: \"512k\",\n max_retry_delay: \"10s\",\n read_poll_timeout: \"30s\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ccr.follow(\n index: \"follower_index\",\n wait_for_active_shards: \"1\",\n body: {\n \"remote_cluster\": \"remote_cluster\",\n \"leader_index\": \"leader_index\",\n \"settings\": {\n \"index.number_of_replicas\": 0\n },\n \"max_read_request_operation_count\": 1024,\n \"max_outstanding_read_requests\": 16,\n \"max_read_request_size\": \"1024k\",\n \"max_write_request_operation_count\": 32768,\n \"max_write_request_size\": \"16k\",\n \"max_outstanding_write_requests\": 8,\n \"max_write_buffer_count\": 512,\n \"max_write_buffer_size\": \"512k\",\n \"max_retry_delay\": \"10s\",\n \"read_poll_timeout\": \"30s\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ccr()->follow([\n \"index\" => \"follower_index\",\n \"wait_for_active_shards\" => \"1\",\n \"body\" => [\n \"remote_cluster\" => \"remote_cluster\",\n \"leader_index\" => \"leader_index\",\n \"settings\" => [\n \"index.number_of_replicas\" => 0,\n ],\n \"max_read_request_operation_count\" => 1024,\n \"max_outstanding_read_requests\" => 16,\n \"max_read_request_size\" => \"1024k\",\n \"max_write_request_operation_count\" => 32768,\n \"max_write_request_size\" => \"16k\",\n \"max_outstanding_write_requests\" => 8,\n \"max_write_buffer_count\" => 512,\n \"max_write_buffer_size\" => \"512k\",\n \"max_retry_delay\" => \"10s\",\n \"read_poll_timeout\" => \"30s\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"remote_cluster\":\"remote_cluster\",\"leader_index\":\"leader_index\",\"settings\":{\"index.number_of_replicas\":0},\"max_read_request_operation_count\":1024,\"max_outstanding_read_requests\":16,\"max_read_request_size\":\"1024k\",\"max_write_request_operation_count\":32768,\"max_write_request_size\":\"16k\",\"max_outstanding_write_requests\":8,\"max_write_buffer_count\":512,\"max_write_buffer_size\":\"512k\",\"max_retry_delay\":\"10s\",\"read_poll_timeout\":\"30s\"}' \"$ELASTICSEARCH_URL/follower_index/_ccr/follow?wait_for_active_shards=1\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -4924,32 +3390,6 @@ } }, "x-state": "Generally available; Added in 6.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /follower_index/_ccr/info\n" - }, - { - "lang": "Python", - "source": "resp = client.ccr.follow_info(\n index=\"follower_index\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ccr.followInfo({\n index: \"follower_index\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ccr.follow_info(\n index: \"follower_index\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ccr()->followInfo([\n \"index\" => \"follower_index\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/follower_index/_ccr/info\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -5018,32 +3458,6 @@ } }, "x-state": "Generally available; Added in 6.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /follower_index/_ccr/stats\n" - }, - { - "lang": "Python", - "source": "resp = client.ccr.follow_stats(\n index=\"follower_index\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ccr.followStats({\n index: \"follower_index\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ccr.follow_stats(\n index: \"follower_index\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ccr()->followStats([\n \"index\" => \"follower_index\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/follower_index/_ccr/stats\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -5138,32 +3552,6 @@ } }, "x-state": "Generally available; Added in 6.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST //_ccr/forget_follower\n{\n \"follower_cluster\" : \"\",\n \"follower_index\" : \"\",\n \"follower_index_uuid\" : \"\",\n \"leader_remote_cluster\" : \"\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ccr.forget_follower(\n index=\"\",\n follower_cluster=\"\",\n follower_index=\"\",\n follower_index_uuid=\"\",\n leader_remote_cluster=\"\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ccr.forgetFollower({\n index: \"\",\n follower_cluster: \"\",\n follower_index: \"\",\n follower_index_uuid: \"\",\n leader_remote_cluster: \"\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ccr.forget_follower(\n index: \"\",\n body: {\n \"follower_cluster\": \"\",\n \"follower_index\": \"\",\n \"follower_index_uuid\": \"\",\n \"leader_remote_cluster\": \"\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ccr()->forgetFollower([\n \"index\" => \"\",\n \"body\" => [\n \"follower_cluster\" => \"\",\n \"follower_index\" => \"\",\n \"follower_index_uuid\" => \"\",\n \"leader_remote_cluster\" => \"\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"follower_cluster\":\"\",\"follower_index\":\"\",\"follower_index_uuid\":\"\",\"leader_remote_cluster\":\"\"}' \"$ELASTICSEARCH_URL//_ccr/forget_follower\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -5189,32 +3577,6 @@ } }, "x-state": "Generally available; Added in 6.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_ccr/auto_follow/my_auto_follow_pattern\n" - }, - { - "lang": "Python", - "source": "resp = client.ccr.get_auto_follow_pattern(\n name=\"my_auto_follow_pattern\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ccr.getAutoFollowPattern({\n name: \"my_auto_follow_pattern\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ccr.get_auto_follow_pattern(\n name: \"my_auto_follow_pattern\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ccr()->getAutoFollowPattern([\n \"name\" => \"my_auto_follow_pattern\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ccr/auto_follow/my_auto_follow_pattern\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -5271,32 +3633,6 @@ } }, "x-state": "Generally available; Added in 7.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_ccr/auto_follow/my_auto_follow_pattern/pause\n" - }, - { - "lang": "Python", - "source": "resp = client.ccr.pause_auto_follow_pattern(\n name=\"my_auto_follow_pattern\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ccr.pauseAutoFollowPattern({\n name: \"my_auto_follow_pattern\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ccr.pause_auto_follow_pattern(\n name: \"my_auto_follow_pattern\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ccr()->pauseAutoFollowPattern([\n \"name\" => \"my_auto_follow_pattern\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ccr/auto_follow/my_auto_follow_pattern/pause\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -5350,32 +3686,6 @@ } }, "x-state": "Generally available; Added in 6.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /follower_index/_ccr/pause_follow\n" - }, - { - "lang": "Python", - "source": "resp = client.ccr.pause_follow(\n index=\"follower_index\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ccr.pauseFollow({\n index: \"follower_index\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ccr.pause_follow(\n index: \"follower_index\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ccr()->pauseFollow([\n \"index\" => \"follower_index\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/follower_index/_ccr/pause_follow\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -5432,32 +3742,6 @@ } }, "x-state": "Generally available; Added in 7.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_ccr/auto_follow/my_auto_follow_pattern/resume\n" - }, - { - "lang": "Python", - "source": "resp = client.ccr.resume_auto_follow_pattern(\n name=\"my_auto_follow_pattern\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ccr.resumeAutoFollowPattern({\n name: \"my_auto_follow_pattern\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ccr.resume_auto_follow_pattern(\n name: \"my_auto_follow_pattern\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ccr()->resumeAutoFollowPattern([\n \"name\" => \"my_auto_follow_pattern\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ccr/auto_follow/my_auto_follow_pattern/resume\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -5561,32 +3845,6 @@ } }, "x-state": "Generally available; Added in 6.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /follower_index/_ccr/resume_follow\n{\n \"max_read_request_operation_count\" : 1024,\n \"max_outstanding_read_requests\" : 16,\n \"max_read_request_size\" : \"1024k\",\n \"max_write_request_operation_count\" : 32768,\n \"max_write_request_size\" : \"16k\",\n \"max_outstanding_write_requests\" : 8,\n \"max_write_buffer_count\" : 512,\n \"max_write_buffer_size\" : \"512k\",\n \"max_retry_delay\" : \"10s\",\n \"read_poll_timeout\" : \"30s\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ccr.resume_follow(\n index=\"follower_index\",\n max_read_request_operation_count=1024,\n max_outstanding_read_requests=16,\n max_read_request_size=\"1024k\",\n max_write_request_operation_count=32768,\n max_write_request_size=\"16k\",\n max_outstanding_write_requests=8,\n max_write_buffer_count=512,\n max_write_buffer_size=\"512k\",\n max_retry_delay=\"10s\",\n read_poll_timeout=\"30s\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ccr.resumeFollow({\n index: \"follower_index\",\n max_read_request_operation_count: 1024,\n max_outstanding_read_requests: 16,\n max_read_request_size: \"1024k\",\n max_write_request_operation_count: 32768,\n max_write_request_size: \"16k\",\n max_outstanding_write_requests: 8,\n max_write_buffer_count: 512,\n max_write_buffer_size: \"512k\",\n max_retry_delay: \"10s\",\n read_poll_timeout: \"30s\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ccr.resume_follow(\n index: \"follower_index\",\n body: {\n \"max_read_request_operation_count\": 1024,\n \"max_outstanding_read_requests\": 16,\n \"max_read_request_size\": \"1024k\",\n \"max_write_request_operation_count\": 32768,\n \"max_write_request_size\": \"16k\",\n \"max_outstanding_write_requests\": 8,\n \"max_write_buffer_count\": 512,\n \"max_write_buffer_size\": \"512k\",\n \"max_retry_delay\": \"10s\",\n \"read_poll_timeout\": \"30s\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ccr()->resumeFollow([\n \"index\" => \"follower_index\",\n \"body\" => [\n \"max_read_request_operation_count\" => 1024,\n \"max_outstanding_read_requests\" => 16,\n \"max_read_request_size\" => \"1024k\",\n \"max_write_request_operation_count\" => 32768,\n \"max_write_request_size\" => \"16k\",\n \"max_outstanding_write_requests\" => 8,\n \"max_write_buffer_count\" => 512,\n \"max_write_buffer_size\" => \"512k\",\n \"max_retry_delay\" => \"10s\",\n \"read_poll_timeout\" => \"30s\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"max_read_request_operation_count\":1024,\"max_outstanding_read_requests\":16,\"max_read_request_size\":\"1024k\",\"max_write_request_operation_count\":32768,\"max_write_request_size\":\"16k\",\"max_outstanding_write_requests\":8,\"max_write_buffer_count\":512,\"max_write_buffer_size\":\"512k\",\"max_retry_delay\":\"10s\",\"read_poll_timeout\":\"30s\"}' \"$ELASTICSEARCH_URL/follower_index/_ccr/resume_follow\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -5651,32 +3909,6 @@ } }, "x-state": "Generally available; Added in 6.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_ccr/stats\n" - }, - { - "lang": "Python", - "source": "resp = client.ccr.stats()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ccr.stats();" - }, - { - "lang": "Ruby", - "source": "response = client.ccr.stats" - }, - { - "lang": "PHP", - "source": "$resp = $client->ccr()->stats();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ccr/stats\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -5733,32 +3965,6 @@ } }, "x-state": "Generally available; Added in 6.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /follower_index/_ccr/unfollow\n" - }, - { - "lang": "Python", - "source": "resp = client.ccr.unfollow(\n index=\"follower_index\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ccr.unfollow({\n index: \"follower_index\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ccr.unfollow(\n index: \"follower_index\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ccr()->unfollow([\n \"index\" => \"follower_index\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/follower_index/_ccr/unfollow\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -5793,32 +3999,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_search/scroll\n{\n \"scroll_id\" : \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.scroll(\n scroll_id=\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.scroll({\n scroll_id: \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.scroll(\n body: {\n \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->scroll([\n \"body\" => [\n \"scroll_id\" => \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"scroll_id\":\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"}' \"$ELASTICSEARCH_URL/_search/scroll\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -5851,32 +4031,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_search/scroll\n{\n \"scroll_id\" : \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.scroll(\n scroll_id=\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.scroll({\n scroll_id: \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.scroll(\n body: {\n \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->scroll([\n \"body\" => [\n \"scroll_id\" => \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"scroll_id\":\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"}' \"$ELASTICSEARCH_URL/_search/scroll\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -5898,32 +4052,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_search/scroll\n{\n \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.clear_scroll(\n scroll_id=\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.clearScroll({\n scroll_id: \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.clear_scroll(\n body: {\n \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->clearScroll([\n \"body\" => [\n \"scroll_id\" => \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"scroll_id\":\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"}' \"$ELASTICSEARCH_URL/_search/scroll\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -5961,32 +4089,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_search/scroll\n{\n \"scroll_id\" : \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.scroll(\n scroll_id=\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.scroll({\n scroll_id: \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.scroll(\n body: {\n \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->scroll([\n \"body\" => [\n \"scroll_id\" => \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"scroll_id\":\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"}' \"$ELASTICSEARCH_URL/_search/scroll\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -6022,32 +4124,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_search/scroll\n{\n \"scroll_id\" : \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.scroll(\n scroll_id=\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.scroll({\n scroll_id: \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.scroll(\n body: {\n \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->scroll([\n \"body\" => [\n \"scroll_id\" => \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"scroll_id\":\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"}' \"$ELASTICSEARCH_URL/_search/scroll\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -6074,32 +4150,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_search/scroll\n{\n \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.clear_scroll(\n scroll_id=\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.clearScroll({\n scroll_id: \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.clear_scroll(\n body: {\n \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->clearScroll([\n \"body\" => [\n \"scroll_id\" => \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"scroll_id\":\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"}' \"$ELASTICSEARCH_URL/_search/scroll\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -6167,32 +4217,6 @@ } }, "x-state": "Generally available; Added in 7.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_pit\n{\n \"id\": \"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.close_point_in_time(\n id=\"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.closePointInTime({\n id: \"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.close_point_in_time(\n body: {\n \"id\": \"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->closePointInTime([\n \"body\" => [\n \"id\" => \"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"id\":\"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\"}' \"$ELASTICSEARCH_URL/_pit\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -6227,32 +4251,6 @@ } }, "x-state": "Generally available; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cluster/allocation/explain\n{\n \"index\": \"my-index-000001\",\n \"shard\": 0,\n \"primary\": false,\n \"current_node\": \"my-node\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.cluster.allocation_explain(\n index=\"my-index-000001\",\n shard=0,\n primary=False,\n current_node=\"my-node\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.allocationExplain({\n index: \"my-index-000001\",\n shard: 0,\n primary: false,\n current_node: \"my-node\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.allocation_explain(\n body: {\n \"index\": \"my-index-000001\",\n \"shard\": 0,\n \"primary\": false,\n \"current_node\": \"my-node\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->allocationExplain([\n \"body\" => [\n \"index\" => \"my-index-000001\",\n \"shard\" => 0,\n \"primary\" => false,\n \"current_node\" => \"my-node\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index\":\"my-index-000001\",\"shard\":0,\"primary\":false,\"current_node\":\"my-node\"}' \"$ELASTICSEARCH_URL/_cluster/allocation/explain\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -6285,32 +4283,6 @@ } }, "x-state": "Generally available; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cluster/allocation/explain\n{\n \"index\": \"my-index-000001\",\n \"shard\": 0,\n \"primary\": false,\n \"current_node\": \"my-node\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.cluster.allocation_explain(\n index=\"my-index-000001\",\n shard=0,\n primary=False,\n current_node=\"my-node\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.allocationExplain({\n index: \"my-index-000001\",\n shard: 0,\n primary: false,\n current_node: \"my-node\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.allocation_explain(\n body: {\n \"index\": \"my-index-000001\",\n \"shard\": 0,\n \"primary\": false,\n \"current_node\": \"my-node\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->allocationExplain([\n \"body\" => [\n \"index\" => \"my-index-000001\",\n \"shard\" => 0,\n \"primary\" => false,\n \"current_node\" => \"my-node\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index\":\"my-index-000001\",\"shard\":0,\"primary\":false,\"current_node\":\"my-node\"}' \"$ELASTICSEARCH_URL/_cluster/allocation/explain\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -6345,32 +4317,6 @@ } }, "x-state": "Generally available; Added in 7.8.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_component_template/template_1\n" - }, - { - "lang": "Python", - "source": "resp = client.cluster.get_component_template(\n name=\"template_1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.getComponentTemplate({\n name: \"template_1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.get_component_template(\n name: \"template_1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->getComponentTemplate([\n \"name\" => \"template_1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_component_template/template_1\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -6400,32 +4346,6 @@ } }, "x-state": "Generally available; Added in 7.8.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _component_template/template_1\n{\n \"template\": null,\n \"settings\": {\n \"number_of_shards\": 1\n },\n \"mappings\": {\n \"_source\": {\n \"enabled\": false\n },\n \"properties\": {\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.cluster.put_component_template(\n name=\"template_1\",\n template=None,\n settings={\n \"number_of_shards\": 1\n },\n mappings={\n \"_source\": {\n \"enabled\": False\n },\n \"properties\": {\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.putComponentTemplate({\n name: \"template_1\",\n template: null,\n settings: {\n number_of_shards: 1,\n },\n mappings: {\n _source: {\n enabled: false,\n },\n properties: {\n host_name: {\n type: \"keyword\",\n },\n created_at: {\n type: \"date\",\n format: \"EEE MMM dd HH:mm:ss Z yyyy\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.put_component_template(\n name: \"template_1\",\n body: {\n \"template\": nil,\n \"settings\": {\n \"number_of_shards\": 1\n },\n \"mappings\": {\n \"_source\": {\n \"enabled\": false\n },\n \"properties\": {\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->putComponentTemplate([\n \"name\" => \"template_1\",\n \"body\" => [\n \"template\" => null,\n \"settings\" => [\n \"number_of_shards\" => 1,\n ],\n \"mappings\" => [\n \"_source\" => [\n \"enabled\" => false,\n ],\n \"properties\" => [\n \"host_name\" => [\n \"type\" => \"keyword\",\n ],\n \"created_at\" => [\n \"type\" => \"date\",\n \"format\" => \"EEE MMM dd HH:mm:ss Z yyyy\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"template\":null,\"settings\":{\"number_of_shards\":1},\"mappings\":{\"_source\":{\"enabled\":false},\"properties\":{\"host_name\":{\"type\":\"keyword\"},\"created_at\":{\"type\":\"date\",\"format\":\"EEE MMM dd HH:mm:ss Z yyyy\"}}}}' \"$ELASTICSEARCH_URL/_component_template/template_1\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -6455,32 +4375,6 @@ } }, "x-state": "Generally available; Added in 7.8.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _component_template/template_1\n{\n \"template\": null,\n \"settings\": {\n \"number_of_shards\": 1\n },\n \"mappings\": {\n \"_source\": {\n \"enabled\": false\n },\n \"properties\": {\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.cluster.put_component_template(\n name=\"template_1\",\n template=None,\n settings={\n \"number_of_shards\": 1\n },\n mappings={\n \"_source\": {\n \"enabled\": False\n },\n \"properties\": {\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.putComponentTemplate({\n name: \"template_1\",\n template: null,\n settings: {\n number_of_shards: 1,\n },\n mappings: {\n _source: {\n enabled: false,\n },\n properties: {\n host_name: {\n type: \"keyword\",\n },\n created_at: {\n type: \"date\",\n format: \"EEE MMM dd HH:mm:ss Z yyyy\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.put_component_template(\n name: \"template_1\",\n body: {\n \"template\": nil,\n \"settings\": {\n \"number_of_shards\": 1\n },\n \"mappings\": {\n \"_source\": {\n \"enabled\": false\n },\n \"properties\": {\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->putComponentTemplate([\n \"name\" => \"template_1\",\n \"body\" => [\n \"template\" => null,\n \"settings\" => [\n \"number_of_shards\" => 1,\n ],\n \"mappings\" => [\n \"_source\" => [\n \"enabled\" => false,\n ],\n \"properties\" => [\n \"host_name\" => [\n \"type\" => \"keyword\",\n ],\n \"created_at\" => [\n \"type\" => \"date\",\n \"format\" => \"EEE MMM dd HH:mm:ss Z yyyy\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"template\":null,\"settings\":{\"number_of_shards\":1},\"mappings\":{\"_source\":{\"enabled\":false},\"properties\":{\"host_name\":{\"type\":\"keyword\"},\"created_at\":{\"type\":\"date\",\"format\":\"EEE MMM dd HH:mm:ss Z yyyy\"}}}}' \"$ELASTICSEARCH_URL/_component_template/template_1\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -6536,32 +4430,6 @@ } }, "x-state": "Generally available; Added in 7.8.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _component_template/template_1\n" - }, - { - "lang": "Python", - "source": "resp = client.cluster.delete_component_template(\n name=\"template_1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.deleteComponentTemplate({\n name: \"template_1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.delete_component_template(\n name: \"template_1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->deleteComponentTemplate([\n \"name\" => \"template_1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_component_template/template_1\"" - } - ], "x-product-feature": "elasticsearch" }, "head": { @@ -6752,32 +4620,6 @@ } }, "x-state": "Generally available; Added in 7.8.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_component_template/template_1\n" - }, - { - "lang": "Python", - "source": "resp = client.cluster.get_component_template(\n name=\"template_1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.getComponentTemplate({\n name: \"template_1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.get_component_template(\n name: \"template_1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->getComponentTemplate([\n \"name\" => \"template_1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_component_template/template_1\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -6874,32 +4716,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cluster/settings?filter_path=persistent.cluster.remote\n" - }, - { - "lang": "Python", - "source": "resp = client.cluster.get_settings(\n filter_path=\"persistent.cluster.remote\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.getSettings({\n filter_path: \"persistent.cluster.remote\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.get_settings(\n filter_path: \"persistent.cluster.remote\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->getSettings([\n \"filter_path\" => \"persistent.cluster.remote\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cluster/settings?filter_path=persistent.cluster.remote\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -7017,32 +4833,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_cluster/settings\n{\n \"persistent\" : {\n \"indices.recovery.max_bytes_per_sec\" : \"50mb\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.cluster.put_settings(\n persistent={\n \"indices.recovery.max_bytes_per_sec\": \"50mb\"\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.putSettings({\n persistent: {\n \"indices.recovery.max_bytes_per_sec\": \"50mb\",\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.put_settings(\n body: {\n \"persistent\": {\n \"indices.recovery.max_bytes_per_sec\": \"50mb\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->putSettings([\n \"body\" => [\n \"persistent\" => [\n \"indices.recovery.max_bytes_per_sec\" => \"50mb\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"persistent\":{\"indices.recovery.max_bytes_per_sec\":\"50mb\"}}' \"$ELASTICSEARCH_URL/_cluster/settings\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -7095,32 +4885,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cluster/health\n" - }, - { - "lang": "Python", - "source": "resp = client.cluster.health()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.health();" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.health" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->health();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cluster/health\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -7176,32 +4940,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cluster/health\n" - }, - { - "lang": "Python", - "source": "resp = client.cluster.health()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.health();" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.health" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->health();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cluster/health\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -7262,32 +5000,6 @@ } }, "x-state": "Generally available; Added in 8.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_info/_all\n" - }, - { - "lang": "Python", - "source": "resp = client.cluster.info(\n target=\"_all\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.info({\n target: \"_all\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.info(\n target: \"_all\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->info([\n \"target\" => \"_all\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_info/_all\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -7345,32 +5057,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cluster/pending_tasks\n" - }, - { - "lang": "Python", - "source": "resp = client.cluster.pending_tasks()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.pendingTasks();" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.pending_tasks" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->pendingTasks();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cluster/pending_tasks\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -7401,32 +5087,6 @@ } }, "x-state": "Generally available; Added in 6.1.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_remote/info\n" - }, - { - "lang": "Python", - "source": "resp = client.cluster.remote_info()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.remoteInfo();" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.remote_info" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->remoteInfo();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_remote/info\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -7555,32 +5215,6 @@ } }, "x-state": "Generally available; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_cluster/reroute?metric=none\n{\n \"commands\": [\n {\n \"move\": {\n \"index\": \"test\", \"shard\": 0,\n \"from_node\": \"node1\", \"to_node\": \"node2\"\n }\n },\n {\n \"allocate_replica\": {\n \"index\": \"test\", \"shard\": 1,\n \"node\": \"node3\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.cluster.reroute(\n metric=\"none\",\n commands=[\n {\n \"move\": {\n \"index\": \"test\",\n \"shard\": 0,\n \"from_node\": \"node1\",\n \"to_node\": \"node2\"\n }\n },\n {\n \"allocate_replica\": {\n \"index\": \"test\",\n \"shard\": 1,\n \"node\": \"node3\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.reroute({\n metric: \"none\",\n commands: [\n {\n move: {\n index: \"test\",\n shard: 0,\n from_node: \"node1\",\n to_node: \"node2\",\n },\n },\n {\n allocate_replica: {\n index: \"test\",\n shard: 1,\n node: \"node3\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.reroute(\n metric: \"none\",\n body: {\n \"commands\": [\n {\n \"move\": {\n \"index\": \"test\",\n \"shard\": 0,\n \"from_node\": \"node1\",\n \"to_node\": \"node2\"\n }\n },\n {\n \"allocate_replica\": {\n \"index\": \"test\",\n \"shard\": 1,\n \"node\": \"node3\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->reroute([\n \"metric\" => \"none\",\n \"body\" => [\n \"commands\" => array(\n [\n \"move\" => [\n \"index\" => \"test\",\n \"shard\" => 0,\n \"from_node\" => \"node1\",\n \"to_node\" => \"node2\",\n ],\n ],\n [\n \"allocate_replica\" => [\n \"index\" => \"test\",\n \"shard\" => 1,\n \"node\" => \"node3\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"commands\":[{\"move\":{\"index\":\"test\",\"shard\":0,\"from_node\":\"node1\",\"to_node\":\"node2\"}},{\"allocate_replica\":{\"index\":\"test\",\"shard\":1,\"node\":\"node3\"}}]}' \"$ELASTICSEARCH_URL/_cluster/reroute?metric=none\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -7624,32 +5258,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cluster/state?filter_path=metadata.cluster_coordination.last_committed_config\n" - }, - { - "lang": "Python", - "source": "resp = client.cluster.state(\n filter_path=\"metadata.cluster_coordination.last_committed_config\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.state({\n filter_path: \"metadata.cluster_coordination.last_committed_config\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.state(\n filter_path: \"metadata.cluster_coordination.last_committed_config\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->state([\n \"filter_path\" => \"metadata.cluster_coordination.last_committed_config\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cluster/state?filter_path=metadata.cluster_coordination.last_committed_config\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -7696,32 +5304,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cluster/state?filter_path=metadata.cluster_coordination.last_committed_config\n" - }, - { - "lang": "Python", - "source": "resp = client.cluster.state(\n filter_path=\"metadata.cluster_coordination.last_committed_config\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.state({\n filter_path: \"metadata.cluster_coordination.last_committed_config\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.state(\n filter_path: \"metadata.cluster_coordination.last_committed_config\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->state([\n \"filter_path\" => \"metadata.cluster_coordination.last_committed_config\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cluster/state?filter_path=metadata.cluster_coordination.last_committed_config\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -7771,32 +5353,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cluster/state?filter_path=metadata.cluster_coordination.last_committed_config\n" - }, - { - "lang": "Python", - "source": "resp = client.cluster.state(\n filter_path=\"metadata.cluster_coordination.last_committed_config\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.state({\n filter_path: \"metadata.cluster_coordination.last_committed_config\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.state(\n filter_path: \"metadata.cluster_coordination.last_committed_config\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->state([\n \"filter_path\" => \"metadata.cluster_coordination.last_committed_config\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cluster/state?filter_path=metadata.cluster_coordination.last_committed_config\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -7822,32 +5378,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cluster/stats?human&filter_path=indices.mappings.total_deduplicated_mapping_size*\n" - }, - { - "lang": "Python", - "source": "resp = client.cluster.stats(\n human=True,\n filter_path=\"indices.mappings.total_deduplicated_mapping_size*\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.stats({\n human: \"true\",\n filter_path: \"indices.mappings.total_deduplicated_mapping_size*\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.stats(\n human: \"true\",\n filter_path: \"indices.mappings.total_deduplicated_mapping_size*\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->stats([\n \"human\" => \"true\",\n \"filter_path\" => \"indices.mappings.total_deduplicated_mapping_size*\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cluster/stats?human&filter_path=indices.mappings.total_deduplicated_mapping_size*\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -7876,32 +5406,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cluster/stats?human&filter_path=indices.mappings.total_deduplicated_mapping_size*\n" - }, - { - "lang": "Python", - "source": "resp = client.cluster.stats(\n human=True,\n filter_path=\"indices.mappings.total_deduplicated_mapping_size*\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.stats({\n human: \"true\",\n filter_path: \"indices.mappings.total_deduplicated_mapping_size*\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.stats(\n human: \"true\",\n filter_path: \"indices.mappings.total_deduplicated_mapping_size*\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->stats([\n \"human\" => \"true\",\n \"filter_path\" => \"indices.mappings.total_deduplicated_mapping_size*\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cluster/stats?human&filter_path=indices.mappings.total_deduplicated_mapping_size*\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -7952,32 +5456,6 @@ } }, "x-state": "Technical preview; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-connector/_check_in\n" - }, - { - "lang": "Python", - "source": "resp = client.connector.check_in(\n connector_id=\"my-connector\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.checkIn({\n connector_id: \"my-connector\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.check_in(\n connector_id: \"my-connector\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->checkIn([\n \"connector_id\" => \"my-connector\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_connector/my-connector/_check_in\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -8025,32 +5503,6 @@ } }, "x-state": "Beta; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _connector/my-connector-id\n" - }, - { - "lang": "Python", - "source": "resp = client.connector.get(\n connector_id=\"my-connector-id\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.get({\n connector_id: \"my-connector-id\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.get(\n connector_id: \"my-connector-id\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->get([\n \"connector_id\" => \"my-connector-id\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_connector/my-connector-id\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -8073,32 +5525,6 @@ } }, "x-state": "Beta; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-connector\n{\n \"index_name\": \"search-google-drive\",\n \"name\": \"My Connector\",\n \"service_type\": \"google_drive\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.put(\n connector_id=\"my-connector\",\n index_name=\"search-google-drive\",\n name=\"My Connector\",\n service_type=\"google_drive\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.put({\n connector_id: \"my-connector\",\n index_name: \"search-google-drive\",\n name: \"My Connector\",\n service_type: \"google_drive\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.put(\n connector_id: \"my-connector\",\n body: {\n \"index_name\": \"search-google-drive\",\n \"name\": \"My Connector\",\n \"service_type\": \"google_drive\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->put([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"index_name\" => \"search-google-drive\",\n \"name\" => \"My Connector\",\n \"service_type\" => \"google_drive\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_name\":\"search-google-drive\",\"name\":\"My Connector\",\"service_type\":\"google_drive\"}' \"$ELASTICSEARCH_URL/_connector/my-connector\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -8159,32 +5585,6 @@ } }, "x-state": "Beta; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _connector/my-connector-id&delete_sync_jobs=true\n" - }, - { - "lang": "Python", - "source": "resp = client.connector.delete(\n connector_id=\"my-connector-id&delete_sync_jobs=true\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.delete({\n connector_id: \"my-connector-id&delete_sync_jobs=true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.delete(\n connector_id: \"my-connector-id&delete_sync_jobs=true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->delete([\n \"connector_id\" => \"my-connector-id&delete_sync_jobs=true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_connector/my-connector-id&delete_sync_jobs=true\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -8296,32 +5696,6 @@ } }, "x-state": "Beta; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _connector\n" - }, - { - "lang": "Python", - "source": "resp = client.connector.list()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.list();" - }, - { - "lang": "Ruby", - "source": "response = client.connector.list" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->list();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_connector\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -8339,32 +5713,6 @@ } }, "x-state": "Beta; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-connector\n{\n \"index_name\": \"search-google-drive\",\n \"name\": \"My Connector\",\n \"service_type\": \"google_drive\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.put(\n connector_id=\"my-connector\",\n index_name=\"search-google-drive\",\n name=\"My Connector\",\n service_type=\"google_drive\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.put({\n connector_id: \"my-connector\",\n index_name: \"search-google-drive\",\n name: \"My Connector\",\n service_type: \"google_drive\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.put(\n connector_id: \"my-connector\",\n body: {\n \"index_name\": \"search-google-drive\",\n \"name\": \"My Connector\",\n \"service_type\": \"google_drive\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->put([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"index_name\" => \"search-google-drive\",\n \"name\" => \"My Connector\",\n \"service_type\" => \"google_drive\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_name\":\"search-google-drive\",\"name\":\"My Connector\",\"service_type\":\"google_drive\"}' \"$ELASTICSEARCH_URL/_connector/my-connector\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -8473,32 +5821,6 @@ } }, "x-state": "Beta; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/_sync_job/my-connector-sync-job-id/_cancel\n" - }, - { - "lang": "Python", - "source": "resp = client.connector.sync_job_cancel(\n connector_sync_job_id=\"my-connector-sync-job-id\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.syncJobCancel({\n connector_sync_job_id: \"my-connector-sync-job-id\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.sync_job_cancel(\n connector_sync_job_id: \"my-connector-sync-job-id\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->syncJobCancel([\n \"connector_sync_job_id\" => \"my-connector-sync-job-id\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job-id/_cancel\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -8536,32 +5858,6 @@ } }, "x-state": "Technical preview", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/_sync_job/my-connector-sync-job/_check_in\n" - }, - { - "lang": "Python", - "source": "resp = client.connector.sync_job_check_in(\n connector_sync_job_id=\"my-connector-sync-job\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.syncJobCheckIn({\n connector_sync_job_id: \"my-connector-sync-job\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.sync_job_check_in(\n connector_sync_job_id: \"my-connector-sync-job\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->syncJobCheckIn([\n \"connector_sync_job_id\" => \"my-connector-sync-job\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job/_check_in\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -8628,32 +5924,6 @@ } }, "x-state": "Technical preview", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/_sync_job/my-connector-sync-job-id/_claim\n{\n \"worker_hostname\": \"some-machine\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.sync_job_claim(\n connector_sync_job_id=\"my-connector-sync-job-id\",\n worker_hostname=\"some-machine\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.syncJobClaim({\n connector_sync_job_id: \"my-connector-sync-job-id\",\n worker_hostname: \"some-machine\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.sync_job_claim(\n connector_sync_job_id: \"my-connector-sync-job-id\",\n body: {\n \"worker_hostname\": \"some-machine\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->syncJobClaim([\n \"connector_sync_job_id\" => \"my-connector-sync-job-id\",\n \"body\" => [\n \"worker_hostname\" => \"some-machine\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"worker_hostname\":\"some-machine\"}' \"$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job-id/_claim\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -8690,32 +5960,6 @@ } }, "x-state": "Beta; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _connector/_sync_job/my-connector-sync-job\n" - }, - { - "lang": "Python", - "source": "resp = client.connector.sync_job_get(\n connector_sync_job_id=\"my-connector-sync-job\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.syncJobGet({\n connector_sync_job_id: \"my-connector-sync-job\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.sync_job_get(\n connector_sync_job_id: \"my-connector-sync-job\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->syncJobGet([\n \"connector_sync_job_id\" => \"my-connector-sync-job\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -8756,32 +6000,6 @@ } }, "x-state": "Beta; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _connector/_sync_job/my-connector-sync-job-id\n" - }, - { - "lang": "Python", - "source": "resp = client.connector.sync_job_delete(\n connector_sync_job_id=\"my-connector-sync-job-id\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.syncJobDelete({\n connector_sync_job_id: \"my-connector-sync-job-id\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.sync_job_delete(\n connector_sync_job_id: \"my-connector-sync-job-id\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->syncJobDelete([\n \"connector_sync_job_id\" => \"my-connector-sync-job-id\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job-id\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -8843,32 +6061,6 @@ } }, "x-state": "Technical preview", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/_sync_job/my-connector-sync-job/_error\n{\n \"error\": \"some-error\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.sync_job_error(\n connector_sync_job_id=\"my-connector-sync-job\",\n error=\"some-error\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.syncJobError({\n connector_sync_job_id: \"my-connector-sync-job\",\n error: \"some-error\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.sync_job_error(\n connector_sync_job_id: \"my-connector-sync-job\",\n body: {\n \"error\": \"some-error\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->syncJobError([\n \"connector_sync_job_id\" => \"my-connector-sync-job\",\n \"body\" => [\n \"error\" => \"some-error\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"error\":\"some-error\"}' \"$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job/_error\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -8970,32 +6162,6 @@ } }, "x-state": "Beta; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _connector/_sync_job?connector_id=my-connector-id&size=1\n" - }, - { - "lang": "Python", - "source": "resp = client.connector.sync_job_list(\n connector_id=\"my-connector-id\",\n size=\"1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.syncJobList({\n connector_id: \"my-connector-id\",\n size: 1,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.sync_job_list(\n connector_id: \"my-connector-id\",\n size: \"1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->syncJobList([\n \"connector_id\" => \"my-connector-id\",\n \"size\" => \"1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_connector/_sync_job?connector_id=my-connector-id&size=1\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -9055,32 +6221,6 @@ } }, "x-state": "Beta; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _connector/_sync_job\n{\n \"id\": \"connector-id\",\n \"job_type\": \"full\",\n \"trigger_method\": \"on_demand\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.sync_job_post(\n id=\"connector-id\",\n job_type=\"full\",\n trigger_method=\"on_demand\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.syncJobPost({\n id: \"connector-id\",\n job_type: \"full\",\n trigger_method: \"on_demand\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.sync_job_post(\n body: {\n \"id\": \"connector-id\",\n \"job_type\": \"full\",\n \"trigger_method\": \"on_demand\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->syncJobPost([\n \"body\" => [\n \"id\" => \"connector-id\",\n \"job_type\" => \"full\",\n \"trigger_method\" => \"on_demand\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"id\":\"connector-id\",\"job_type\":\"full\",\"trigger_method\":\"on_demand\"}' \"$ELASTICSEARCH_URL/_connector/_sync_job\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -9163,32 +6303,6 @@ } }, "x-state": "Technical preview", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/_sync_job/my-connector-sync-job/_stats\n{\n \"deleted_document_count\": 10,\n \"indexed_document_count\": 20,\n \"indexed_document_volume\": 1000,\n \"total_document_count\": 2000,\n \"last_seen\": \"2023-01-02T10:00:00Z\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.sync_job_update_stats(\n connector_sync_job_id=\"my-connector-sync-job\",\n deleted_document_count=10,\n indexed_document_count=20,\n indexed_document_volume=1000,\n total_document_count=2000,\n last_seen=\"2023-01-02T10:00:00Z\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.syncJobUpdateStats({\n connector_sync_job_id: \"my-connector-sync-job\",\n deleted_document_count: 10,\n indexed_document_count: 20,\n indexed_document_volume: 1000,\n total_document_count: 2000,\n last_seen: \"2023-01-02T10:00:00Z\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.sync_job_update_stats(\n connector_sync_job_id: \"my-connector-sync-job\",\n body: {\n \"deleted_document_count\": 10,\n \"indexed_document_count\": 20,\n \"indexed_document_volume\": 1000,\n \"total_document_count\": 2000,\n \"last_seen\": \"2023-01-02T10:00:00Z\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->syncJobUpdateStats([\n \"connector_sync_job_id\" => \"my-connector-sync-job\",\n \"body\" => [\n \"deleted_document_count\" => 10,\n \"indexed_document_count\" => 20,\n \"indexed_document_volume\" => 1000,\n \"total_document_count\" => 2000,\n \"last_seen\" => \"2023-01-02T10:00:00Z\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"deleted_document_count\":10,\"indexed_document_count\":20,\"indexed_document_volume\":1000,\"total_document_count\":2000,\"last_seen\":\"2023-01-02T10:00:00Z\"}' \"$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job/_stats\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -9307,32 +6421,6 @@ } }, "x-state": "Beta; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-connector/_api_key_id\n{\n \"api_key_id\": \"my-api-key-id\",\n \"api_key_secret_id\": \"my-connector-secret-id\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.update_api_key_id(\n connector_id=\"my-connector\",\n api_key_id=\"my-api-key-id\",\n api_key_secret_id=\"my-connector-secret-id\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.updateApiKeyId({\n connector_id: \"my-connector\",\n api_key_id: \"my-api-key-id\",\n api_key_secret_id: \"my-connector-secret-id\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.update_api_key_id(\n connector_id: \"my-connector\",\n body: {\n \"api_key_id\": \"my-api-key-id\",\n \"api_key_secret_id\": \"my-connector-secret-id\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->updateApiKeyId([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"api_key_id\" => \"my-api-key-id\",\n \"api_key_secret_id\" => \"my-connector-secret-id\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"api_key_id\":\"my-api-key-id\",\"api_key_secret_id\":\"my-connector-secret-id\"}' \"$ELASTICSEARCH_URL/_connector/my-connector/_api_key_id\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -9412,32 +6500,6 @@ } }, "x-state": "Beta; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-spo-connector/_configuration\n{\n \"values\": {\n \"tenant_id\": \"my-tenant-id\",\n \"tenant_name\": \"my-sharepoint-site\",\n \"client_id\": \"foo\",\n \"secret_value\": \"bar\",\n \"site_collections\": \"*\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.update_configuration(\n connector_id=\"my-spo-connector\",\n values={\n \"tenant_id\": \"my-tenant-id\",\n \"tenant_name\": \"my-sharepoint-site\",\n \"client_id\": \"foo\",\n \"secret_value\": \"bar\",\n \"site_collections\": \"*\"\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.updateConfiguration({\n connector_id: \"my-spo-connector\",\n values: {\n tenant_id: \"my-tenant-id\",\n tenant_name: \"my-sharepoint-site\",\n client_id: \"foo\",\n secret_value: \"bar\",\n site_collections: \"*\",\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.update_configuration(\n connector_id: \"my-spo-connector\",\n body: {\n \"values\": {\n \"tenant_id\": \"my-tenant-id\",\n \"tenant_name\": \"my-sharepoint-site\",\n \"client_id\": \"foo\",\n \"secret_value\": \"bar\",\n \"site_collections\": \"*\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->updateConfiguration([\n \"connector_id\" => \"my-spo-connector\",\n \"body\" => [\n \"values\" => [\n \"tenant_id\" => \"my-tenant-id\",\n \"tenant_name\" => \"my-sharepoint-site\",\n \"client_id\" => \"foo\",\n \"secret_value\" => \"bar\",\n \"site_collections\" => \"*\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"values\":{\"tenant_id\":\"my-tenant-id\",\"tenant_name\":\"my-sharepoint-site\",\"client_id\":\"foo\",\"secret_value\":\"bar\",\"site_collections\":\"*\"}}' \"$ELASTICSEARCH_URL/_connector/my-spo-connector/_configuration\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -9518,32 +6580,6 @@ } }, "x-state": "Technical preview; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-connector/_error\n{\n \"error\": \"Houston, we have a problem!\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.update_error(\n connector_id=\"my-connector\",\n error=\"Houston, we have a problem!\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.updateError({\n connector_id: \"my-connector\",\n error: \"Houston, we have a problem!\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.update_error(\n connector_id: \"my-connector\",\n body: {\n \"error\": \"Houston, we have a problem!\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->updateError([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"error\" => \"Houston, we have a problem!\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"error\":\"Houston, we have a problem!\"}' \"$ELASTICSEARCH_URL/_connector/my-connector/_error\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -9620,32 +6656,6 @@ } }, "x-state": "Technical preview", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-connector/_features\n{\n \"features\": {\n \"document_level_security\": {\n \"enabled\": true\n },\n \"incremental_sync\": {\n \"enabled\": true\n },\n \"sync_rules\": {\n \"advanced\": {\n \"enabled\": false\n },\n \"basic\": {\n \"enabled\": true\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.update_features(\n connector_id=\"my-connector\",\n features={\n \"document_level_security\": {\n \"enabled\": True\n },\n \"incremental_sync\": {\n \"enabled\": True\n },\n \"sync_rules\": {\n \"advanced\": {\n \"enabled\": False\n },\n \"basic\": {\n \"enabled\": True\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.updateFeatures({\n connector_id: \"my-connector\",\n features: {\n document_level_security: {\n enabled: true,\n },\n incremental_sync: {\n enabled: true,\n },\n sync_rules: {\n advanced: {\n enabled: false,\n },\n basic: {\n enabled: true,\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.update_features(\n connector_id: \"my-connector\",\n body: {\n \"features\": {\n \"document_level_security\": {\n \"enabled\": true\n },\n \"incremental_sync\": {\n \"enabled\": true\n },\n \"sync_rules\": {\n \"advanced\": {\n \"enabled\": false\n },\n \"basic\": {\n \"enabled\": true\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->updateFeatures([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"features\" => [\n \"document_level_security\" => [\n \"enabled\" => true,\n ],\n \"incremental_sync\" => [\n \"enabled\" => true,\n ],\n \"sync_rules\" => [\n \"advanced\" => [\n \"enabled\" => false,\n ],\n \"basic\" => [\n \"enabled\" => true,\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"features\":{\"document_level_security\":{\"enabled\":true},\"incremental_sync\":{\"enabled\":true},\"sync_rules\":{\"advanced\":{\"enabled\":false},\"basic\":{\"enabled\":true}}}}' \"$ELASTICSEARCH_URL/_connector/my-connector/_features\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -9731,32 +6741,6 @@ } }, "x-state": "Beta; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-g-drive-connector/_filtering\n{\n \"rules\": [\n {\n \"field\": \"file_extension\",\n \"id\": \"exclude-txt-files\",\n \"order\": 0,\n \"policy\": \"exclude\",\n \"rule\": \"equals\",\n \"value\": \"txt\"\n },\n {\n \"field\": \"_\",\n \"id\": \"DEFAULT\",\n \"order\": 1,\n \"policy\": \"include\",\n \"rule\": \"regex\",\n \"value\": \".*\"\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.update_filtering(\n connector_id=\"my-g-drive-connector\",\n rules=[\n {\n \"field\": \"file_extension\",\n \"id\": \"exclude-txt-files\",\n \"order\": 0,\n \"policy\": \"exclude\",\n \"rule\": \"equals\",\n \"value\": \"txt\"\n },\n {\n \"field\": \"_\",\n \"id\": \"DEFAULT\",\n \"order\": 1,\n \"policy\": \"include\",\n \"rule\": \"regex\",\n \"value\": \".*\"\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.updateFiltering({\n connector_id: \"my-g-drive-connector\",\n rules: [\n {\n field: \"file_extension\",\n id: \"exclude-txt-files\",\n order: 0,\n policy: \"exclude\",\n rule: \"equals\",\n value: \"txt\",\n },\n {\n field: \"_\",\n id: \"DEFAULT\",\n order: 1,\n policy: \"include\",\n rule: \"regex\",\n value: \".*\",\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.update_filtering(\n connector_id: \"my-g-drive-connector\",\n body: {\n \"rules\": [\n {\n \"field\": \"file_extension\",\n \"id\": \"exclude-txt-files\",\n \"order\": 0,\n \"policy\": \"exclude\",\n \"rule\": \"equals\",\n \"value\": \"txt\"\n },\n {\n \"field\": \"_\",\n \"id\": \"DEFAULT\",\n \"order\": 1,\n \"policy\": \"include\",\n \"rule\": \"regex\",\n \"value\": \".*\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->updateFiltering([\n \"connector_id\" => \"my-g-drive-connector\",\n \"body\" => [\n \"rules\" => array(\n [\n \"field\" => \"file_extension\",\n \"id\" => \"exclude-txt-files\",\n \"order\" => 0,\n \"policy\" => \"exclude\",\n \"rule\" => \"equals\",\n \"value\" => \"txt\",\n ],\n [\n \"field\" => \"_\",\n \"id\" => \"DEFAULT\",\n \"order\" => 1,\n \"policy\" => \"include\",\n \"rule\" => \"regex\",\n \"value\" => \".*\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"rules\":[{\"field\":\"file_extension\",\"id\":\"exclude-txt-files\",\"order\":0,\"policy\":\"exclude\",\"rule\":\"equals\",\"value\":\"txt\"},{\"field\":\"_\",\"id\":\"DEFAULT\",\"order\":1,\"policy\":\"include\",\"rule\":\"regex\",\"value\":\".*\"}]}' \"$ELASTICSEARCH_URL/_connector/my-g-drive-connector/_filtering\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -9900,32 +6884,6 @@ } }, "x-state": "Beta; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-connector/_index_name\n{\n \"index_name\": \"data-from-my-google-drive\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.update_index_name(\n connector_id=\"my-connector\",\n index_name=\"data-from-my-google-drive\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.updateIndexName({\n connector_id: \"my-connector\",\n index_name: \"data-from-my-google-drive\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.update_index_name(\n connector_id: \"my-connector\",\n body: {\n \"index_name\": \"data-from-my-google-drive\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->updateIndexName([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"index_name\" => \"data-from-my-google-drive\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_name\":\"data-from-my-google-drive\"}' \"$ELASTICSEARCH_URL/_connector/my-connector/_index_name\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -9998,32 +6956,6 @@ } }, "x-state": "Beta; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-connector/_name\n{\n \"name\": \"Custom connector\",\n \"description\": \"This is my customized connector\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.update_name(\n connector_id=\"my-connector\",\n name=\"Custom connector\",\n description=\"This is my customized connector\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.updateName({\n connector_id: \"my-connector\",\n name: \"Custom connector\",\n description: \"This is my customized connector\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.update_name(\n connector_id: \"my-connector\",\n body: {\n \"name\": \"Custom connector\",\n \"description\": \"This is my customized connector\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->updateName([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"name\" => \"Custom connector\",\n \"description\" => \"This is my customized connector\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"name\":\"Custom connector\",\"description\":\"This is my customized connector\"}' \"$ELASTICSEARCH_URL/_connector/my-connector/_name\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -10159,32 +7091,6 @@ } }, "x-state": "Beta; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-connector/_pipeline\n{\n \"pipeline\": {\n \"extract_binary_content\": true,\n \"name\": \"my-connector-pipeline\",\n \"reduce_whitespace\": true,\n \"run_ml_inference\": true\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.update_pipeline(\n connector_id=\"my-connector\",\n pipeline={\n \"extract_binary_content\": True,\n \"name\": \"my-connector-pipeline\",\n \"reduce_whitespace\": True,\n \"run_ml_inference\": True\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.updatePipeline({\n connector_id: \"my-connector\",\n pipeline: {\n extract_binary_content: true,\n name: \"my-connector-pipeline\",\n reduce_whitespace: true,\n run_ml_inference: true,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.update_pipeline(\n connector_id: \"my-connector\",\n body: {\n \"pipeline\": {\n \"extract_binary_content\": true,\n \"name\": \"my-connector-pipeline\",\n \"reduce_whitespace\": true,\n \"run_ml_inference\": true\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->updatePipeline([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"pipeline\" => [\n \"extract_binary_content\" => true,\n \"name\" => \"my-connector-pipeline\",\n \"reduce_whitespace\" => true,\n \"run_ml_inference\" => true,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"pipeline\":{\"extract_binary_content\":true,\"name\":\"my-connector-pipeline\",\"reduce_whitespace\":true,\"run_ml_inference\":true}}' \"$ELASTICSEARCH_URL/_connector/my-connector/_pipeline\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -10260,32 +7166,6 @@ } }, "x-state": "Beta; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-connector/_scheduling\n{\n \"scheduling\": {\n \"access_control\": {\n \"enabled\": true,\n \"interval\": \"0 10 0 * * ?\"\n },\n \"full\": {\n \"enabled\": true,\n \"interval\": \"0 20 0 * * ?\"\n },\n \"incremental\": {\n \"enabled\": false,\n \"interval\": \"0 30 0 * * ?\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.update_scheduling(\n connector_id=\"my-connector\",\n scheduling={\n \"access_control\": {\n \"enabled\": True,\n \"interval\": \"0 10 0 * * ?\"\n },\n \"full\": {\n \"enabled\": True,\n \"interval\": \"0 20 0 * * ?\"\n },\n \"incremental\": {\n \"enabled\": False,\n \"interval\": \"0 30 0 * * ?\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.updateScheduling({\n connector_id: \"my-connector\",\n scheduling: {\n access_control: {\n enabled: true,\n interval: \"0 10 0 * * ?\",\n },\n full: {\n enabled: true,\n interval: \"0 20 0 * * ?\",\n },\n incremental: {\n enabled: false,\n interval: \"0 30 0 * * ?\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.update_scheduling(\n connector_id: \"my-connector\",\n body: {\n \"scheduling\": {\n \"access_control\": {\n \"enabled\": true,\n \"interval\": \"0 10 0 * * ?\"\n },\n \"full\": {\n \"enabled\": true,\n \"interval\": \"0 20 0 * * ?\"\n },\n \"incremental\": {\n \"enabled\": false,\n \"interval\": \"0 30 0 * * ?\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->updateScheduling([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"scheduling\" => [\n \"access_control\" => [\n \"enabled\" => true,\n \"interval\" => \"0 10 0 * * ?\",\n ],\n \"full\" => [\n \"enabled\" => true,\n \"interval\" => \"0 20 0 * * ?\",\n ],\n \"incremental\" => [\n \"enabled\" => false,\n \"interval\" => \"0 30 0 * * ?\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"scheduling\":{\"access_control\":{\"enabled\":true,\"interval\":\"0 10 0 * * ?\"},\"full\":{\"enabled\":true,\"interval\":\"0 20 0 * * ?\"},\"incremental\":{\"enabled\":false,\"interval\":\"0 30 0 * * ?\"}}}' \"$ELASTICSEARCH_URL/_connector/my-connector/_scheduling\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -10358,32 +7238,6 @@ } }, "x-state": "Beta; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-connector/_service_type\n{\n \"service_type\": \"sharepoint_online\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.update_service_type(\n connector_id=\"my-connector\",\n service_type=\"sharepoint_online\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.updateServiceType({\n connector_id: \"my-connector\",\n service_type: \"sharepoint_online\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.update_service_type(\n connector_id: \"my-connector\",\n body: {\n \"service_type\": \"sharepoint_online\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->updateServiceType([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"service_type\" => \"sharepoint_online\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service_type\":\"sharepoint_online\"}' \"$ELASTICSEARCH_URL/_connector/my-connector/_service_type\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -10456,32 +7310,6 @@ } }, "x-state": "Technical preview; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-connector/_status\n{\n \"status\": \"needs_configuration\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.update_status(\n connector_id=\"my-connector\",\n status=\"needs_configuration\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.updateStatus({\n connector_id: \"my-connector\",\n status: \"needs_configuration\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.update_status(\n connector_id: \"my-connector\",\n body: {\n \"status\": \"needs_configuration\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->updateStatus([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"status\" => \"needs_configuration\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"status\":\"needs_configuration\"}' \"$ELASTICSEARCH_URL/_connector/my-connector/_status\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -10546,32 +7374,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_count\n{\n \"query\" : {\n \"term\" : { \"user.id\" : \"kimchy\" }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.count(\n index=\"my-index-000001\",\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.count({\n index: \"my-index-000001\",\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.count(\n index: \"my-index-000001\",\n body: {\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->count([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}' \"$ELASTICSEARCH_URL/my-index-000001/_count\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -10634,32 +7436,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_count\n{\n \"query\" : {\n \"term\" : { \"user.id\" : \"kimchy\" }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.count(\n index=\"my-index-000001\",\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.count({\n index: \"my-index-000001\",\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.count(\n index: \"my-index-000001\",\n body: {\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->count([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}' \"$ELASTICSEARCH_URL/my-index-000001/_count\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -10727,32 +7503,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_count\n{\n \"query\" : {\n \"term\" : { \"user.id\" : \"kimchy\" }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.count(\n index=\"my-index-000001\",\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.count({\n index: \"my-index-000001\",\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.count(\n index: \"my-index-000001\",\n body: {\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->count([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}' \"$ELASTICSEARCH_URL/my-index-000001/_count\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -10818,32 +7568,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_count\n{\n \"query\" : {\n \"term\" : { \"user.id\" : \"kimchy\" }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.count(\n index=\"my-index-000001\",\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.count({\n index: \"my-index-000001\",\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.count(\n index: \"my-index-000001\",\n body: {\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->count([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}' \"$ELASTICSEARCH_URL/my-index-000001/_count\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -10914,32 +7638,6 @@ } }, "x-state": "Generally available; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT my-index-000001/_create/1\n{\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.create(\n index=\"my-index-000001\",\n id=\"1\",\n document={\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.create({\n index: \"my-index-000001\",\n id: 1,\n document: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n message: \"GET /search HTTP/1.1 200 1070000\",\n user: {\n id: \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.create(\n index: \"my-index-000001\",\n id: \"1\",\n body: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->create([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n \"body\" => [\n \"@timestamp\" => \"2099-11-15T13:12:00\",\n \"message\" => \"GET /search HTTP/1.1 200 1070000\",\n \"user\" => [\n \"id\" => \"kimchy\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"@timestamp\":\"2099-11-15T13:12:00\",\"message\":\"GET /search HTTP/1.1 200 1070000\",\"user\":{\"id\":\"kimchy\"}}' \"$ELASTICSEARCH_URL/my-index-000001/_create/1\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -11008,32 +7706,6 @@ } }, "x-state": "Generally available; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT my-index-000001/_create/1\n{\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.create(\n index=\"my-index-000001\",\n id=\"1\",\n document={\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.create({\n index: \"my-index-000001\",\n id: 1,\n document: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n message: \"GET /search HTTP/1.1 200 1070000\",\n user: {\n id: \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.create(\n index: \"my-index-000001\",\n id: \"1\",\n body: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->create([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n \"body\" => [\n \"@timestamp\" => \"2099-11-15T13:12:00\",\n \"message\" => \"GET /search HTTP/1.1 200 1070000\",\n \"user\" => [\n \"id\" => \"kimchy\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"@timestamp\":\"2099-11-15T13:12:00\",\"message\":\"GET /search HTTP/1.1 200 1070000\",\"user\":{\"id\":\"kimchy\"}}' \"$ELASTICSEARCH_URL/my-index-000001/_create/1\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -11108,32 +7780,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_dangling/zmM4e0JtBkeUjiHD-MihPQ?accept_data_loss=true\n" - }, - { - "lang": "Python", - "source": "resp = client.dangling_indices.import_dangling_index(\n index_uuid=\"zmM4e0JtBkeUjiHD-MihPQ\",\n accept_data_loss=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.danglingIndices.importDanglingIndex({\n index_uuid: \"zmM4e0JtBkeUjiHD-MihPQ\",\n accept_data_loss: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.dangling_indices.import_dangling_index(\n index_uuid: \"zmM4e0JtBkeUjiHD-MihPQ\",\n accept_data_loss: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->danglingIndices()->importDanglingIndex([\n \"index_uuid\" => \"zmM4e0JtBkeUjiHD-MihPQ\",\n \"accept_data_loss\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_dangling/zmM4e0JtBkeUjiHD-MihPQ?accept_data_loss=true\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -11200,32 +7846,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_dangling/?accept_data_loss=true\n" - }, - { - "lang": "Python", - "source": "resp = client.dangling_indices.delete_dangling_index(\n index_uuid=\"\",\n accept_data_loss=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.danglingIndices.deleteDanglingIndex({\n index_uuid: \"\",\n accept_data_loss: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.dangling_indices.delete_dangling_index(\n index_uuid: \"\",\n accept_data_loss: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->danglingIndices()->deleteDanglingIndex([\n \"index_uuid\" => \"\",\n \"accept_data_loss\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_dangling/?accept_data_loss=true\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -11266,32 +7886,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_dangling\n" - }, - { - "lang": "Python", - "source": "resp = client.dangling_indices.list_dangling_indices()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.danglingIndices.listDanglingIndices();" - }, - { - "lang": "Ruby", - "source": "response = client.dangling_indices.list_dangling_indices" - }, - { - "lang": "PHP", - "source": "$resp = $client->danglingIndices()->listDanglingIndices();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_dangling\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -11457,32 +8051,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index-000001/_doc/1?stored_fields=tags,counter\n" - }, - { - "lang": "Python", - "source": "resp = client.get(\n index=\"my-index-000001\",\n id=\"1\",\n stored_fields=\"tags,counter\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.get({\n index: \"my-index-000001\",\n id: 1,\n stored_fields: \"tags,counter\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.get(\n index: \"my-index-000001\",\n id: \"1\",\n stored_fields: \"tags,counter\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->get([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n \"stored_fields\" => \"tags,counter\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_doc/1?stored_fields=tags,counter\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -11548,32 +8116,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST my-index-000001/_doc/\n{\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.index(\n index=\"my-index-000001\",\n document={\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.index({\n index: \"my-index-000001\",\n document: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n message: \"GET /search HTTP/1.1 200 1070000\",\n user: {\n id: \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.index(\n index: \"my-index-000001\",\n body: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->index([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"@timestamp\" => \"2099-11-15T13:12:00\",\n \"message\" => \"GET /search HTTP/1.1 200 1070000\",\n \"user\" => [\n \"id\" => \"kimchy\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"@timestamp\":\"2099-11-15T13:12:00\",\"message\":\"GET /search HTTP/1.1 200 1070000\",\"user\":{\"id\":\"kimchy\"}}' \"$ELASTICSEARCH_URL/my-index-000001/_doc/\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -11639,32 +8181,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST my-index-000001/_doc/\n{\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.index(\n index=\"my-index-000001\",\n document={\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.index({\n index: \"my-index-000001\",\n document: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n message: \"GET /search HTTP/1.1 200 1070000\",\n user: {\n id: \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.index(\n index: \"my-index-000001\",\n body: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->index([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"@timestamp\" => \"2099-11-15T13:12:00\",\n \"message\" => \"GET /search HTTP/1.1 200 1070000\",\n \"user\" => [\n \"id\" => \"kimchy\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"@timestamp\":\"2099-11-15T13:12:00\",\"message\":\"GET /search HTTP/1.1 200 1070000\",\"user\":{\"id\":\"kimchy\"}}' \"$ELASTICSEARCH_URL/my-index-000001/_doc/\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -11797,32 +8313,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /my-index-000001/_doc/1\n" - }, - { - "lang": "Python", - "source": "resp = client.delete(\n index=\"my-index-000001\",\n id=\"1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.delete({\n index: \"my-index-000001\",\n id: 1,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.delete(\n index: \"my-index-000001\",\n id: \"1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->delete([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_doc/1\"" - } - ], "x-product-feature": "elasticsearch" }, "head": { @@ -11965,32 +8455,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "HEAD my-index-000001/_doc/0\n" - }, - { - "lang": "Python", - "source": "resp = client.exists(\n index=\"my-index-000001\",\n id=\"0\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.exists({\n index: \"my-index-000001\",\n id: 0,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.exists(\n index: \"my-index-000001\",\n id: \"0\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->exists([\n \"index\" => \"my-index-000001\",\n \"id\" => \"0\",\n]);" - }, - { - "lang": "curl", - "source": "curl --head -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_doc/0\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -12435,32 +8899,6 @@ } }, "x-state": "Generally available; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-index-000001,my-index-000002/_delete_by_query\n{\n \"query\": {\n \"match_all\": {}\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.delete_by_query(\n index=\"my-index-000001,my-index-000002\",\n query={\n \"match_all\": {}\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.deleteByQuery({\n index: \"my-index-000001,my-index-000002\",\n query: {\n match_all: {},\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.delete_by_query(\n index: \"my-index-000001,my-index-000002\",\n body: {\n \"query\": {\n \"match_all\": {}\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->deleteByQuery([\n \"index\" => \"my-index-000001,my-index-000002\",\n \"body\" => [\n \"query\" => [\n \"match_all\" => new ArrayObject([]),\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"match_all\":{}}}' \"$ELASTICSEARCH_URL/my-index-000001,my-index-000002/_delete_by_query\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -12508,32 +8946,6 @@ } }, "x-state": "Generally available; Added in 6.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _delete_by_query/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1\n" - }, - { - "lang": "Python", - "source": "resp = client.delete_by_query_rethrottle(\n task_id=\"r1A2WoRbTwKZ516z6NEs5A:36619\",\n requests_per_second=\"-1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.deleteByQueryRethrottle({\n task_id: \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n requests_per_second: \"-1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.delete_by_query_rethrottle(\n task_id: \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n requests_per_second: \"-1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->deleteByQueryRethrottle([\n \"task_id\" => \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n \"requests_per_second\" => \"-1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_delete_by_query/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -12596,32 +9008,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _scripts/my-search-template\n" - }, - { - "lang": "Python", - "source": "resp = client.get_script(\n id=\"my-search-template\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.getScript({\n id: \"my-search-template\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.get_script(\n id: \"my-search-template\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->getScript([\n \"id\" => \"my-search-template\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_scripts/my-search-template\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -12657,32 +9043,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _scripts/my-search-template\n{\n \"script\": {\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.put_script(\n id=\"my-search-template\",\n script={\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.putScript({\n id: \"my-search-template\",\n script: {\n lang: \"mustache\",\n source: {\n query: {\n match: {\n message: \"{{query_string}}\",\n },\n },\n from: \"{{from}}\",\n size: \"{{size}}\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.put_script(\n id: \"my-search-template\",\n body: {\n \"script\": {\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->putScript([\n \"id\" => \"my-search-template\",\n \"body\" => [\n \"script\" => [\n \"lang\" => \"mustache\",\n \"source\" => [\n \"query\" => [\n \"match\" => [\n \"message\" => \"{{query_string}}\",\n ],\n ],\n \"from\" => \"{{from}}\",\n \"size\" => \"{{size}}\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"script\":{\"lang\":\"mustache\",\"source\":{\"query\":{\"match\":{\"message\":\"{{query_string}}\"}},\"from\":\"{{from}}\",\"size\":\"{{size}}\"}}}' \"$ELASTICSEARCH_URL/_scripts/my-search-template\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -12718,32 +9078,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _scripts/my-search-template\n{\n \"script\": {\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.put_script(\n id=\"my-search-template\",\n script={\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.putScript({\n id: \"my-search-template\",\n script: {\n lang: \"mustache\",\n source: {\n query: {\n match: {\n message: \"{{query_string}}\",\n },\n },\n from: \"{{from}}\",\n size: \"{{size}}\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.put_script(\n id: \"my-search-template\",\n body: {\n \"script\": {\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->putScript([\n \"id\" => \"my-search-template\",\n \"body\" => [\n \"script\" => [\n \"lang\" => \"mustache\",\n \"source\" => [\n \"query\" => [\n \"match\" => [\n \"message\" => \"{{query_string}}\",\n ],\n ],\n \"from\" => \"{{from}}\",\n \"size\" => \"{{size}}\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"script\":{\"lang\":\"mustache\",\"source\":{\"query\":{\"match\":{\"message\":\"{{query_string}}\"}},\"from\":\"{{from}}\",\"size\":\"{{size}}\"}}}' \"$ELASTICSEARCH_URL/_scripts/my-search-template\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -12799,32 +9133,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _scripts/my-search-template\n" - }, - { - "lang": "Python", - "source": "resp = client.delete_script(\n id=\"my-search-template\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.deleteScript({\n id: \"my-search-template\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.delete_script(\n id: \"my-search-template\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->deleteScript([\n \"id\" => \"my-search-template\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_scripts/my-search-template\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -12850,32 +9158,6 @@ } }, "x-state": "Generally available; Added in 7.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_enrich/policy/my-policy\n" - }, - { - "lang": "Python", - "source": "resp = client.enrich.get_policy(\n name=\"my-policy\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.enrich.getPolicy({\n name: \"my-policy\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.enrich.get_policy(\n name: \"my-policy\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->enrich()->getPolicy([\n \"name\" => \"my-policy\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_enrich/policy/my-policy\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -12948,32 +9230,6 @@ } }, "x-state": "Generally available; Added in 7.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_enrich/policy/postal_policy\n{\n \"geo_match\": {\n \"indices\": \"postal_codes\",\n \"match_field\": \"location\",\n \"enrich_fields\": [ \"location\", \"postal_code\" ]\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.enrich.put_policy(\n name=\"postal_policy\",\n geo_match={\n \"indices\": \"postal_codes\",\n \"match_field\": \"location\",\n \"enrich_fields\": [\n \"location\",\n \"postal_code\"\n ]\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.enrich.putPolicy({\n name: \"postal_policy\",\n geo_match: {\n indices: \"postal_codes\",\n match_field: \"location\",\n enrich_fields: [\"location\", \"postal_code\"],\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.enrich.put_policy(\n name: \"postal_policy\",\n body: {\n \"geo_match\": {\n \"indices\": \"postal_codes\",\n \"match_field\": \"location\",\n \"enrich_fields\": [\n \"location\",\n \"postal_code\"\n ]\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->enrich()->putPolicy([\n \"name\" => \"postal_policy\",\n \"body\" => [\n \"geo_match\" => [\n \"indices\" => \"postal_codes\",\n \"match_field\" => \"location\",\n \"enrich_fields\" => array(\n \"location\",\n \"postal_code\",\n ),\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"geo_match\":{\"indices\":\"postal_codes\",\"match_field\":\"location\",\"enrich_fields\":[\"location\",\"postal_code\"]}}' \"$ELASTICSEARCH_URL/_enrich/policy/postal_policy\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -13019,32 +9275,6 @@ } }, "x-state": "Generally available; Added in 7.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_enrich/policy/my-policy\n" - }, - { - "lang": "Python", - "source": "resp = client.enrich.delete_policy(\n name=\"my-policy\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.enrich.deletePolicy({\n name: \"my-policy\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.enrich.delete_policy(\n name: \"my-policy\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->enrich()->deletePolicy([\n \"name\" => \"my-policy\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_enrich/policy/my-policy\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -13110,32 +9340,6 @@ } }, "x-state": "Generally available; Added in 7.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_enrich/policy/my-policy/_execute?wait_for_completion=false\n" - }, - { - "lang": "Python", - "source": "resp = client.enrich.execute_policy(\n name=\"my-policy\",\n wait_for_completion=False,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.enrich.executePolicy({\n name: \"my-policy\",\n wait_for_completion: \"false\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.enrich.execute_policy(\n name: \"my-policy\",\n wait_for_completion: \"false\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->enrich()->executePolicy([\n \"name\" => \"my-policy\",\n \"wait_for_completion\" => \"false\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_enrich/policy/my-policy/_execute?wait_for_completion=false\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -13158,32 +9362,6 @@ } }, "x-state": "Generally available; Added in 7.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_enrich/policy/my-policy\n" - }, - { - "lang": "Python", - "source": "resp = client.enrich.get_policy(\n name=\"my-policy\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.enrich.getPolicy({\n name: \"my-policy\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.enrich.get_policy(\n name: \"my-policy\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->enrich()->getPolicy([\n \"name\" => \"my-policy\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_enrich/policy/my-policy\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -13248,32 +9426,6 @@ } }, "x-state": "Generally available; Added in 7.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_enrich/_stats\n" - }, - { - "lang": "Python", - "source": "resp = client.enrich.stats()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.enrich.stats();" - }, - { - "lang": "Ruby", - "source": "response = client.enrich.stats" - }, - { - "lang": "PHP", - "source": "$resp = $client->enrich()->stats();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_enrich/_stats\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -13331,32 +9483,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_eql/search/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=?wait_for_completion_timeout=2s\n" - }, - { - "lang": "Python", - "source": "resp = client.eql.get(\n id=\"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n wait_for_completion_timeout=\"2s\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.eql.get({\n id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n wait_for_completion_timeout: \"2s\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.eql.get(\n id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n wait_for_completion_timeout: \"2s\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->eql()->get([\n \"id\" => \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n \"wait_for_completion_timeout\" => \"2s\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_eql/search/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=?wait_for_completion_timeout=2s\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -13392,32 +9518,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_eql/search/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\n" - }, - { - "lang": "Python", - "source": "resp = client.eql.delete(\n id=\"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.eql.delete({\n id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.eql.delete(\n id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->eql()->delete([\n \"id\" => \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_eql/search/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -13489,32 +9589,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_eql/search/status/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\n" - }, - { - "lang": "Python", - "source": "resp = client.eql.get_status(\n id=\"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.eql.getStatus({\n id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.eql.get_status(\n id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->eql()->getStatus([\n \"id\" => \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_eql/search/status/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -13567,32 +9641,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-data-stream/_eql/search\n{\n \"query\": \"\"\"\n process where (process.name == \"cmd.exe\" and process.pid != 2013)\n \"\"\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.eql.search(\n index=\"my-data-stream\",\n query=\"\\n process where (process.name == \\\"cmd.exe\\\" and process.pid != 2013)\\n \",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.eql.search({\n index: \"my-data-stream\",\n query:\n '\\n process where (process.name == \"cmd.exe\" and process.pid != 2013)\\n ',\n});" - }, - { - "lang": "Ruby", - "source": "response = client.eql.search(\n index: \"my-data-stream\",\n body: {\n \"query\": \"\\n process where (process.name == \\\"cmd.exe\\\" and process.pid != 2013)\\n \"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->eql()->search([\n \"index\" => \"my-data-stream\",\n \"body\" => [\n \"query\" => \"\\n process where (process.name == \\\"cmd.exe\\\" and process.pid != 2013)\\n \",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":\"\\n process where (process.name == \\\"cmd.exe\\\" and process.pid != 2013)\\n \"}' \"$ELASTICSEARCH_URL/my-data-stream/_eql/search\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -13643,32 +9691,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-data-stream/_eql/search\n{\n \"query\": \"\"\"\n process where (process.name == \"cmd.exe\" and process.pid != 2013)\n \"\"\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.eql.search(\n index=\"my-data-stream\",\n query=\"\\n process where (process.name == \\\"cmd.exe\\\" and process.pid != 2013)\\n \",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.eql.search({\n index: \"my-data-stream\",\n query:\n '\\n process where (process.name == \"cmd.exe\" and process.pid != 2013)\\n ',\n});" - }, - { - "lang": "Ruby", - "source": "response = client.eql.search(\n index: \"my-data-stream\",\n body: {\n \"query\": \"\\n process where (process.name == \\\"cmd.exe\\\" and process.pid != 2013)\\n \"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->eql()->search([\n \"index\" => \"my-data-stream\",\n \"body\" => [\n \"query\" => \"\\n process where (process.name == \\\"cmd.exe\\\" and process.pid != 2013)\\n \",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":\"\\n process where (process.name == \\\"cmd.exe\\\" and process.pid != 2013)\\n \"}' \"$ELASTICSEARCH_URL/my-data-stream/_eql/search\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -13797,32 +9819,6 @@ } }, "x-state": "Generally available; Added in 8.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_query/async\n{\n \"query\": \"\"\"\n FROM library,remote-*:library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n \"\"\",\n \"wait_for_completion_timeout\": \"2s\",\n \"include_ccs_metadata\": true\n}" - }, - { - "lang": "Python", - "source": "resp = client.esql.async_query(\n query=\"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n wait_for_completion_timeout=\"2s\",\n include_ccs_metadata=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.esql.asyncQuery({\n query:\n \"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n wait_for_completion_timeout: \"2s\",\n include_ccs_metadata: true,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.esql.async_query(\n body: {\n \"query\": \"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n \"wait_for_completion_timeout\": \"2s\",\n \"include_ccs_metadata\": true\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->esql()->asyncQuery([\n \"body\" => [\n \"query\" => \"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n \"wait_for_completion_timeout\" => \"2s\",\n \"include_ccs_metadata\" => true,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":\"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\"wait_for_completion_timeout\":\"2s\",\"include_ccs_metadata\":true}' \"$ELASTICSEARCH_URL/_query/async\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -13893,32 +9889,6 @@ } }, "x-state": "Generally available; Added in 8.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_query/async/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=?wait_for_completion_timeout=30s\n" - }, - { - "lang": "Python", - "source": "resp = client.esql.async_query_get(\n id=\"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n wait_for_completion_timeout=\"30s\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.esql.asyncQueryGet({\n id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n wait_for_completion_timeout: \"30s\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.esql.async_query_get(\n id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n wait_for_completion_timeout: \"30s\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->esql()->asyncQueryGet([\n \"id\" => \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n \"wait_for_completion_timeout\" => \"30s\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_query/async/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=?wait_for_completion_timeout=30s\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -13957,32 +9927,6 @@ } }, "x-state": "Generally available; Added in 8.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_query/async/FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\n" - }, - { - "lang": "Python", - "source": "resp = client.esql.async_query_delete(\n id=\"FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.esql.asyncQueryDelete({\n id: \"FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.esql.async_query_delete(\n id: \"FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->esql()->asyncQueryDelete([\n \"id\" => \"FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_query/async/FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -14033,32 +9977,6 @@ } }, "x-state": "Generally available; Added in 8.18.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_query/async/FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=/stop\n" - }, - { - "lang": "Python", - "source": "resp = client.esql.async_query_stop(\n id=\"FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.esql.asyncQueryStop({\n id: \"FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.esql.async_query_stop(\n id: \"FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->esql()->asyncQueryStop([\n \"id\" => \"FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_query/async/FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=/stop\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -14178,32 +10096,6 @@ } }, "x-state": "Generally available; Added in 8.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_query\n{\n \"query\": \"\"\"\n FROM library,remote-*:library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n \"\"\",\n \"include_ccs_metadata\": true\n}" - }, - { - "lang": "Python", - "source": "resp = client.esql.query(\n query=\"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n include_ccs_metadata=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.esql.query({\n query:\n \"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n include_ccs_metadata: true,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.esql.query(\n body: {\n \"query\": \"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n \"include_ccs_metadata\": true\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->esql()->query([\n \"body\" => [\n \"query\" => \"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n \"include_ccs_metadata\" => true,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":\"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\"include_ccs_metadata\":true}' \"$ELASTICSEARCH_URL/_query\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -14355,32 +10247,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index-000001/_source/1\n" - }, - { - "lang": "Python", - "source": "resp = client.get_source(\n index=\"my-index-000001\",\n id=\"1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.getSource({\n index: \"my-index-000001\",\n id: 1,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.get_source(\n index: \"my-index-000001\",\n id: \"1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->getSource([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_source/1\"" - } - ], "x-product-feature": "elasticsearch" }, "head": { @@ -14516,32 +10382,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "HEAD my-index-000001/_source/1\n" - }, - { - "lang": "Python", - "source": "resp = client.exists_source(\n index=\"my-index-000001\",\n id=\"1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.existsSource({\n index: \"my-index-000001\",\n id: 1,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.exists_source(\n index: \"my-index-000001\",\n id: \"1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->existsSource([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n]);" - }, - { - "lang": "curl", - "source": "curl --head -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_source/1\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -14606,32 +10446,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_explain/0\n{\n \"query\" : {\n \"match\" : { \"message\" : \"elasticsearch\" }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.explain(\n index=\"my-index-000001\",\n id=\"0\",\n query={\n \"match\": {\n \"message\": \"elasticsearch\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.explain({\n index: \"my-index-000001\",\n id: 0,\n query: {\n match: {\n message: \"elasticsearch\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.explain(\n index: \"my-index-000001\",\n id: \"0\",\n body: {\n \"query\": {\n \"match\": {\n \"message\": \"elasticsearch\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->explain([\n \"index\" => \"my-index-000001\",\n \"id\" => \"0\",\n \"body\" => [\n \"query\" => [\n \"match\" => [\n \"message\" => \"elasticsearch\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"match\":{\"message\":\"elasticsearch\"}}}' \"$ELASTICSEARCH_URL/my-index-000001/_explain/0\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -14694,32 +10508,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_explain/0\n{\n \"query\" : {\n \"match\" : { \"message\" : \"elasticsearch\" }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.explain(\n index=\"my-index-000001\",\n id=\"0\",\n query={\n \"match\": {\n \"message\": \"elasticsearch\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.explain({\n index: \"my-index-000001\",\n id: 0,\n query: {\n match: {\n message: \"elasticsearch\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.explain(\n index: \"my-index-000001\",\n id: \"0\",\n body: {\n \"query\": {\n \"match\": {\n \"message\": \"elasticsearch\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->explain([\n \"index\" => \"my-index-000001\",\n \"id\" => \"0\",\n \"body\" => [\n \"query\" => [\n \"match\" => [\n \"message\" => \"elasticsearch\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"match\":{\"message\":\"elasticsearch\"}}}' \"$ELASTICSEARCH_URL/my-index-000001/_explain/0\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -14776,32 +10564,6 @@ } }, "x-state": "Generally available; Added in 7.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _features\n" - }, - { - "lang": "Python", - "source": "resp = client.features.get_features()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.features.getFeatures();" - }, - { - "lang": "Ruby", - "source": "response = client.features.get_features" - }, - { - "lang": "PHP", - "source": "$resp = $client->features()->getFeatures();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_features\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -14855,32 +10617,6 @@ } }, "x-state": "Technical preview; Added in 7.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_features/_reset\n" - }, - { - "lang": "Python", - "source": "resp = client.features.reset_features()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.features.resetFeatures();" - }, - { - "lang": "Ruby", - "source": "response = client.features.reset_features" - }, - { - "lang": "PHP", - "source": "$resp = $client->features()->resetFeatures();" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_features/_reset\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -14927,32 +10663,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST my-index-*/_field_caps?fields=rating\n{\n \"index_filter\": {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.field_caps(\n index=\"my-index-*\",\n fields=\"rating\",\n index_filter={\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.fieldCaps({\n index: \"my-index-*\",\n fields: \"rating\",\n index_filter: {\n range: {\n \"@timestamp\": {\n gte: \"2018\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.field_caps(\n index: \"my-index-*\",\n fields: \"rating\",\n body: {\n \"index_filter\": {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->fieldCaps([\n \"index\" => \"my-index-*\",\n \"fields\" => \"rating\",\n \"body\" => [\n \"index_filter\" => [\n \"range\" => [\n \"@timestamp\" => [\n \"gte\" => \"2018\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_filter\":{\"range\":{\"@timestamp\":{\"gte\":\"2018\"}}}}' \"$ELASTICSEARCH_URL/my-index-*/_field_caps?fields=rating\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -14997,32 +10707,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST my-index-*/_field_caps?fields=rating\n{\n \"index_filter\": {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.field_caps(\n index=\"my-index-*\",\n fields=\"rating\",\n index_filter={\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.fieldCaps({\n index: \"my-index-*\",\n fields: \"rating\",\n index_filter: {\n range: {\n \"@timestamp\": {\n gte: \"2018\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.field_caps(\n index: \"my-index-*\",\n fields: \"rating\",\n body: {\n \"index_filter\": {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->fieldCaps([\n \"index\" => \"my-index-*\",\n \"fields\" => \"rating\",\n \"body\" => [\n \"index_filter\" => [\n \"range\" => [\n \"@timestamp\" => [\n \"gte\" => \"2018\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_filter\":{\"range\":{\"@timestamp\":{\"gte\":\"2018\"}}}}' \"$ELASTICSEARCH_URL/my-index-*/_field_caps?fields=rating\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -15072,32 +10756,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST my-index-*/_field_caps?fields=rating\n{\n \"index_filter\": {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.field_caps(\n index=\"my-index-*\",\n fields=\"rating\",\n index_filter={\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.fieldCaps({\n index: \"my-index-*\",\n fields: \"rating\",\n index_filter: {\n range: {\n \"@timestamp\": {\n gte: \"2018\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.field_caps(\n index: \"my-index-*\",\n fields: \"rating\",\n body: {\n \"index_filter\": {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->fieldCaps([\n \"index\" => \"my-index-*\",\n \"fields\" => \"rating\",\n \"body\" => [\n \"index_filter\" => [\n \"range\" => [\n \"@timestamp\" => [\n \"gte\" => \"2018\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_filter\":{\"range\":{\"@timestamp\":{\"gte\":\"2018\"}}}}' \"$ELASTICSEARCH_URL/my-index-*/_field_caps?fields=rating\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -15145,32 +10803,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST my-index-*/_field_caps?fields=rating\n{\n \"index_filter\": {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.field_caps(\n index=\"my-index-*\",\n fields=\"rating\",\n index_filter={\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.fieldCaps({\n index: \"my-index-*\",\n fields: \"rating\",\n index_filter: {\n range: {\n \"@timestamp\": {\n gte: \"2018\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.field_caps(\n index: \"my-index-*\",\n fields: \"rating\",\n body: {\n \"index_filter\": {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->fieldCaps([\n \"index\" => \"my-index-*\",\n \"fields\" => \"rating\",\n \"body\" => [\n \"index_filter\" => [\n \"range\" => [\n \"@timestamp\" => [\n \"gte\" => \"2018\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_filter\":{\"range\":{\"@timestamp\":{\"gte\":\"2018\"}}}}' \"$ELASTICSEARCH_URL/my-index-*/_field_caps?fields=rating\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -15860,32 +11492,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _script_context\n" - }, - { - "lang": "Python", - "source": "resp = client.get_script_context()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.getScriptContext();" - }, - { - "lang": "Ruby", - "source": "response = client.get_script_context" - }, - { - "lang": "PHP", - "source": "$resp = $client->getScriptContext();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_script_context\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -15928,32 +11534,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _script_language\n" - }, - { - "lang": "Python", - "source": "resp = client.get_script_languages()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.getScriptLanguages();" - }, - { - "lang": "Ruby", - "source": "response = client.get_script_languages" - }, - { - "lang": "PHP", - "source": "$resp = $client->getScriptLanguages();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_script_language\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -15988,32 +11568,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST clicklogs/_graph/explore\n{\n \"query\": {\n \"match\": {\n \"query.raw\": \"midi\"\n }\n },\n \"vertices\": [\n {\n \"field\": \"product\"\n }\n ],\n \"connections\": {\n \"vertices\": [\n {\n \"field\": \"query.raw\"\n }\n ]\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.graph.explore(\n index=\"clicklogs\",\n query={\n \"match\": {\n \"query.raw\": \"midi\"\n }\n },\n vertices=[\n {\n \"field\": \"product\"\n }\n ],\n connections={\n \"vertices\": [\n {\n \"field\": \"query.raw\"\n }\n ]\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.graph.explore({\n index: \"clicklogs\",\n query: {\n match: {\n \"query.raw\": \"midi\",\n },\n },\n vertices: [\n {\n field: \"product\",\n },\n ],\n connections: {\n vertices: [\n {\n field: \"query.raw\",\n },\n ],\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.graph.explore(\n index: \"clicklogs\",\n body: {\n \"query\": {\n \"match\": {\n \"query.raw\": \"midi\"\n }\n },\n \"vertices\": [\n {\n \"field\": \"product\"\n }\n ],\n \"connections\": {\n \"vertices\": [\n {\n \"field\": \"query.raw\"\n }\n ]\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->graph()->explore([\n \"index\" => \"clicklogs\",\n \"body\" => [\n \"query\" => [\n \"match\" => [\n \"query.raw\" => \"midi\",\n ],\n ],\n \"vertices\" => array(\n [\n \"field\" => \"product\",\n ],\n ),\n \"connections\" => [\n \"vertices\" => array(\n [\n \"field\" => \"query.raw\",\n ],\n ),\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"match\":{\"query.raw\":\"midi\"}},\"vertices\":[{\"field\":\"product\"}],\"connections\":{\"vertices\":[{\"field\":\"query.raw\"}]}}' \"$ELASTICSEARCH_URL/clicklogs/_graph/explore\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -16046,32 +11600,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST clicklogs/_graph/explore\n{\n \"query\": {\n \"match\": {\n \"query.raw\": \"midi\"\n }\n },\n \"vertices\": [\n {\n \"field\": \"product\"\n }\n ],\n \"connections\": {\n \"vertices\": [\n {\n \"field\": \"query.raw\"\n }\n ]\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.graph.explore(\n index=\"clicklogs\",\n query={\n \"match\": {\n \"query.raw\": \"midi\"\n }\n },\n vertices=[\n {\n \"field\": \"product\"\n }\n ],\n connections={\n \"vertices\": [\n {\n \"field\": \"query.raw\"\n }\n ]\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.graph.explore({\n index: \"clicklogs\",\n query: {\n match: {\n \"query.raw\": \"midi\",\n },\n },\n vertices: [\n {\n field: \"product\",\n },\n ],\n connections: {\n vertices: [\n {\n field: \"query.raw\",\n },\n ],\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.graph.explore(\n index: \"clicklogs\",\n body: {\n \"query\": {\n \"match\": {\n \"query.raw\": \"midi\"\n }\n },\n \"vertices\": [\n {\n \"field\": \"product\"\n }\n ],\n \"connections\": {\n \"vertices\": [\n {\n \"field\": \"query.raw\"\n }\n ]\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->graph()->explore([\n \"index\" => \"clicklogs\",\n \"body\" => [\n \"query\" => [\n \"match\" => [\n \"query.raw\" => \"midi\",\n ],\n ],\n \"vertices\" => array(\n [\n \"field\" => \"product\",\n ],\n ),\n \"connections\" => [\n \"vertices\" => array(\n [\n \"field\" => \"query.raw\",\n ],\n ),\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"match\":{\"query.raw\":\"midi\"}},\"vertices\":[{\"field\":\"product\"}],\"connections\":{\"vertices\":[{\"field\":\"query.raw\"}]}}' \"$ELASTICSEARCH_URL/clicklogs/_graph/explore\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -16100,32 +11628,6 @@ } }, "x-state": "Generally available; Added in 8.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _health_report\n" - }, - { - "lang": "Python", - "source": "resp = client.health_report()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.healthReport();" - }, - { - "lang": "Ruby", - "source": "response = client.health_report" - }, - { - "lang": "PHP", - "source": "$resp = $client->healthReport();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_health_report\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -16157,32 +11659,6 @@ } }, "x-state": "Generally available; Added in 8.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _health_report\n" - }, - { - "lang": "Python", - "source": "resp = client.health_report()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.healthReport();" - }, - { - "lang": "Ruby", - "source": "response = client.health_report" - }, - { - "lang": "PHP", - "source": "$resp = $client->healthReport();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_health_report\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -16211,32 +11687,6 @@ } }, "x-state": "Generally available; Added in 6.6.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ilm/policy/my_policy\n" - }, - { - "lang": "Python", - "source": "resp = client.ilm.get_lifecycle(\n name=\"my_policy\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ilm.getLifecycle({\n name: \"my_policy\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ilm.get_lifecycle(\n policy: \"my_policy\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ilm()->getLifecycle([\n \"policy\" => \"my_policy\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ilm/policy/my_policy\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -16321,32 +11771,6 @@ } }, "x-state": "Generally available; Added in 6.6.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _ilm/policy/my_policy\n{\n \"policy\": {\n \"_meta\": {\n \"description\": \"used for nginx log\",\n \"project\": {\n \"name\": \"myProject\",\n \"department\": \"myDepartment\"\n }\n },\n \"phases\": {\n \"warm\": {\n \"min_age\": \"10d\",\n \"actions\": {\n \"forcemerge\": {\n \"max_num_segments\": 1\n }\n }\n },\n \"delete\": {\n \"min_age\": \"30d\",\n \"actions\": {\n \"delete\": {}\n }\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ilm.put_lifecycle(\n name=\"my_policy\",\n policy={\n \"_meta\": {\n \"description\": \"used for nginx log\",\n \"project\": {\n \"name\": \"myProject\",\n \"department\": \"myDepartment\"\n }\n },\n \"phases\": {\n \"warm\": {\n \"min_age\": \"10d\",\n \"actions\": {\n \"forcemerge\": {\n \"max_num_segments\": 1\n }\n }\n },\n \"delete\": {\n \"min_age\": \"30d\",\n \"actions\": {\n \"delete\": {}\n }\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ilm.putLifecycle({\n name: \"my_policy\",\n policy: {\n _meta: {\n description: \"used for nginx log\",\n project: {\n name: \"myProject\",\n department: \"myDepartment\",\n },\n },\n phases: {\n warm: {\n min_age: \"10d\",\n actions: {\n forcemerge: {\n max_num_segments: 1,\n },\n },\n },\n delete: {\n min_age: \"30d\",\n actions: {\n delete: {},\n },\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ilm.put_lifecycle(\n policy: \"my_policy\",\n body: {\n \"policy\": {\n \"_meta\": {\n \"description\": \"used for nginx log\",\n \"project\": {\n \"name\": \"myProject\",\n \"department\": \"myDepartment\"\n }\n },\n \"phases\": {\n \"warm\": {\n \"min_age\": \"10d\",\n \"actions\": {\n \"forcemerge\": {\n \"max_num_segments\": 1\n }\n }\n },\n \"delete\": {\n \"min_age\": \"30d\",\n \"actions\": {\n \"delete\": {}\n }\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ilm()->putLifecycle([\n \"policy\" => \"my_policy\",\n \"body\" => [\n \"policy\" => [\n \"_meta\" => [\n \"description\" => \"used for nginx log\",\n \"project\" => [\n \"name\" => \"myProject\",\n \"department\" => \"myDepartment\",\n ],\n ],\n \"phases\" => [\n \"warm\" => [\n \"min_age\" => \"10d\",\n \"actions\" => [\n \"forcemerge\" => [\n \"max_num_segments\" => 1,\n ],\n ],\n ],\n \"delete\" => [\n \"min_age\" => \"30d\",\n \"actions\" => [\n \"delete\" => new ArrayObject([]),\n ],\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"policy\":{\"_meta\":{\"description\":\"used for nginx log\",\"project\":{\"name\":\"myProject\",\"department\":\"myDepartment\"}},\"phases\":{\"warm\":{\"min_age\":\"10d\",\"actions\":{\"forcemerge\":{\"max_num_segments\":1}}},\"delete\":{\"min_age\":\"30d\",\"actions\":{\"delete\":{}}}}}}' \"$ELASTICSEARCH_URL/_ilm/policy/my_policy\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -16408,32 +11832,6 @@ } }, "x-state": "Generally available; Added in 6.6.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ilm/policy/my_policy\n" - }, - { - "lang": "Python", - "source": "resp = client.ilm.delete_lifecycle(\n name=\"my_policy\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ilm.deleteLifecycle({\n name: \"my_policy\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ilm.delete_lifecycle(\n policy: \"my_policy\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ilm()->deleteLifecycle([\n \"policy\" => \"my_policy\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ilm/policy/my_policy\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -16518,32 +11916,6 @@ } }, "x-state": "Generally available; Added in 6.6.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET .ds-timeseries-*/_ilm/explain\n" - }, - { - "lang": "Python", - "source": "resp = client.ilm.explain_lifecycle(\n index=\".ds-timeseries-*\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ilm.explainLifecycle({\n index: \".ds-timeseries-*\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ilm.explain_lifecycle(\n index: \".ds-timeseries-*\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ilm()->explainLifecycle([\n \"index\" => \".ds-timeseries-*\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/.ds-timeseries-*/_ilm/explain\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -16569,32 +11941,6 @@ } }, "x-state": "Generally available; Added in 6.6.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ilm/policy/my_policy\n" - }, - { - "lang": "Python", - "source": "resp = client.ilm.get_lifecycle(\n name=\"my_policy\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ilm.getLifecycle({\n name: \"my_policy\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ilm.get_lifecycle(\n policy: \"my_policy\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ilm()->getLifecycle([\n \"policy\" => \"my_policy\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ilm/policy/my_policy\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -16633,32 +11979,6 @@ } }, "x-state": "Generally available; Added in 6.6.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ilm/status\n" - }, - { - "lang": "Python", - "source": "resp = client.ilm.get_status()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ilm.getStatus();" - }, - { - "lang": "Ruby", - "source": "response = client.ilm.get_status" - }, - { - "lang": "PHP", - "source": "$resp = $client->ilm()->getStatus();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ilm/status\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -16786,32 +12106,6 @@ } }, "x-state": "Generally available; Added in 7.14.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_ilm/migrate_to_data_tiers\n{\n \"legacy_template_to_delete\": \"global-template\",\n \"node_attribute\": \"custom_attribute_name\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ilm.migrate_to_data_tiers(\n legacy_template_to_delete=\"global-template\",\n node_attribute=\"custom_attribute_name\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ilm.migrateToDataTiers({\n legacy_template_to_delete: \"global-template\",\n node_attribute: \"custom_attribute_name\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ilm.migrate_to_data_tiers(\n body: {\n \"legacy_template_to_delete\": \"global-template\",\n \"node_attribute\": \"custom_attribute_name\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ilm()->migrateToDataTiers([\n \"body\" => [\n \"legacy_template_to_delete\" => \"global-template\",\n \"node_attribute\" => \"custom_attribute_name\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"legacy_template_to_delete\":\"global-template\",\"node_attribute\":\"custom_attribute_name\"}' \"$ELASTICSEARCH_URL/_ilm/migrate_to_data_tiers\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -16888,32 +12182,6 @@ } }, "x-state": "Generally available; Added in 6.6.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ilm/move/my-index-000001\n{\n \"current_step\": {\n \"phase\": \"new\",\n \"action\": \"complete\",\n \"name\": \"complete\"\n },\n \"next_step\": {\n \"phase\": \"warm\",\n \"action\": \"forcemerge\",\n \"name\": \"forcemerge\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ilm.move_to_step(\n index=\"my-index-000001\",\n current_step={\n \"phase\": \"new\",\n \"action\": \"complete\",\n \"name\": \"complete\"\n },\n next_step={\n \"phase\": \"warm\",\n \"action\": \"forcemerge\",\n \"name\": \"forcemerge\"\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ilm.moveToStep({\n index: \"my-index-000001\",\n current_step: {\n phase: \"new\",\n action: \"complete\",\n name: \"complete\",\n },\n next_step: {\n phase: \"warm\",\n action: \"forcemerge\",\n name: \"forcemerge\",\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ilm.move_to_step(\n index: \"my-index-000001\",\n body: {\n \"current_step\": {\n \"phase\": \"new\",\n \"action\": \"complete\",\n \"name\": \"complete\"\n },\n \"next_step\": {\n \"phase\": \"warm\",\n \"action\": \"forcemerge\",\n \"name\": \"forcemerge\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ilm()->moveToStep([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"current_step\" => [\n \"phase\" => \"new\",\n \"action\" => \"complete\",\n \"name\" => \"complete\",\n ],\n \"next_step\" => [\n \"phase\" => \"warm\",\n \"action\" => \"forcemerge\",\n \"name\" => \"forcemerge\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"current_step\":{\"phase\":\"new\",\"action\":\"complete\",\"name\":\"complete\"},\"next_step\":{\"phase\":\"warm\",\"action\":\"forcemerge\",\"name\":\"forcemerge\"}}' \"$ELASTICSEARCH_URL/_ilm/move/my-index-000001\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -16972,32 +12240,6 @@ } }, "x-state": "Generally available; Added in 6.6.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST logs-my_app-default/_ilm/remove\n" - }, - { - "lang": "Python", - "source": "resp = client.ilm.remove_policy(\n index=\"logs-my_app-default\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ilm.removePolicy({\n index: \"logs-my_app-default\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ilm.remove_policy(\n index: \"logs-my_app-default\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ilm()->removePolicy([\n \"index\" => \"logs-my_app-default\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/logs-my_app-default/_ilm/remove\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -17035,32 +12277,6 @@ } }, "x-state": "Generally available; Added in 6.6.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-index-000001/_ilm/retry\n" - }, - { - "lang": "Python", - "source": "resp = client.ilm.retry(\n index=\"my-index-000001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ilm.retry({\n index: \"my-index-000001\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ilm.retry(\n index: \"my-index-000001\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ilm()->retry([\n \"index\" => \"my-index-000001\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_ilm/retry\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -17113,32 +12329,6 @@ } }, "x-state": "Generally available; Added in 6.6.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ilm/start\n" - }, - { - "lang": "Python", - "source": "resp = client.ilm.start()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ilm.start();" - }, - { - "lang": "Ruby", - "source": "response = client.ilm.start" - }, - { - "lang": "PHP", - "source": "$resp = $client->ilm()->start();" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ilm/start\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -17191,32 +12381,6 @@ } }, "x-state": "Generally available; Added in 6.6.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ilm/stop\n" - }, - { - "lang": "Python", - "source": "resp = client.ilm.stop()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ilm.stop();" - }, - { - "lang": "Ruby", - "source": "response = client.ilm.stop" - }, - { - "lang": "PHP", - "source": "$resp = $client->ilm()->stop();" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ilm/stop\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -17281,32 +12445,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST my-index-000001/_doc/\n{\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.index(\n index=\"my-index-000001\",\n document={\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.index({\n index: \"my-index-000001\",\n document: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n message: \"GET /search HTTP/1.1 200 1070000\",\n user: {\n id: \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.index(\n index: \"my-index-000001\",\n body: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->index([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"@timestamp\" => \"2099-11-15T13:12:00\",\n \"message\" => \"GET /search HTTP/1.1 200 1070000\",\n \"user\" => [\n \"id\" => \"kimchy\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"@timestamp\":\"2099-11-15T13:12:00\",\"message\":\"GET /search HTTP/1.1 200 1070000\",\"user\":{\"id\":\"kimchy\"}}' \"$ELASTICSEARCH_URL/my-index-000001/_doc/\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -17430,32 +12568,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /my-index-000001/_block/write\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.add_block(\n index=\"my-index-000001\",\n block=\"write\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.addBlock({\n index: \"my-index-000001\",\n block: \"write\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.add_block(\n index: \"my-index-000001\",\n block: \"write\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->addBlock([\n \"index\" => \"my-index-000001\",\n \"block\" => \"write\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_block/write\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -17484,32 +12596,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_analyze\n{\n \"analyzer\": \"standard\",\n \"text\": \"this is a test\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.analyze(\n analyzer=\"standard\",\n text=\"this is a test\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.analyze({\n analyzer: \"standard\",\n text: \"this is a test\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.analyze(\n body: {\n \"analyzer\": \"standard\",\n \"text\": \"this is a test\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->analyze([\n \"body\" => [\n \"analyzer\" => \"standard\",\n \"text\" => \"this is a test\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"analyzer\":\"standard\",\"text\":\"this is a test\"}' \"$ELASTICSEARCH_URL/_analyze\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -17536,32 +12622,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_analyze\n{\n \"analyzer\": \"standard\",\n \"text\": \"this is a test\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.analyze(\n analyzer=\"standard\",\n text=\"this is a test\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.analyze({\n analyzer: \"standard\",\n text: \"this is a test\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.analyze(\n body: {\n \"analyzer\": \"standard\",\n \"text\": \"this is a test\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->analyze([\n \"body\" => [\n \"analyzer\" => \"standard\",\n \"text\" => \"this is a test\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"analyzer\":\"standard\",\"text\":\"this is a test\"}' \"$ELASTICSEARCH_URL/_analyze\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -17593,32 +12653,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_analyze\n{\n \"analyzer\": \"standard\",\n \"text\": \"this is a test\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.analyze(\n analyzer=\"standard\",\n text=\"this is a test\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.analyze({\n analyzer: \"standard\",\n text: \"this is a test\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.analyze(\n body: {\n \"analyzer\": \"standard\",\n \"text\": \"this is a test\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->analyze([\n \"body\" => [\n \"analyzer\" => \"standard\",\n \"text\" => \"this is a test\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"analyzer\":\"standard\",\"text\":\"this is a test\"}' \"$ELASTICSEARCH_URL/_analyze\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -17648,32 +12682,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_analyze\n{\n \"analyzer\": \"standard\",\n \"text\": \"this is a test\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.analyze(\n analyzer=\"standard\",\n text=\"this is a test\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.analyze({\n analyzer: \"standard\",\n text: \"this is a test\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.analyze(\n body: {\n \"analyzer\": \"standard\",\n \"text\": \"this is a test\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->analyze([\n \"body\" => [\n \"analyzer\" => \"standard\",\n \"text\" => \"this is a test\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"analyzer\":\"standard\",\"text\":\"this is a test\"}' \"$ELASTICSEARCH_URL/_analyze\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -17711,32 +12719,6 @@ } }, "x-state": "Technical preview; Added in 8.18.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_migration/reindex/my-data-stream/_cancel\n" - }, - { - "lang": "Python", - "source": "resp = client.perform_request(\n \"POST\",\n \"/_migration/reindex/my-data-stream/_cancel\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transport.request({\n method: \"POST\",\n path: \"/_migration/reindex/my-data-stream/_cancel\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.perform_request(\n \"POST\",\n \"/_migration/reindex/my-data-stream/_cancel\",\n {},\n)" - }, - { - "lang": "PHP", - "source": "$requestFactory = Psr17FactoryDiscovery::findRequestFactory();\n$request = $requestFactory->createRequest(\n \"POST\",\n \"/_migration/reindex/my-data-stream/_cancel\",\n);\n$resp = $client->sendRequest($request);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_migration/reindex/my-data-stream/_cancel\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -17780,32 +12762,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-index-000001,my-index-000002/_cache/clear?request=true\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.clear_cache(\n index=\"my-index-000001,my-index-000002\",\n request=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.clearCache({\n index: \"my-index-000001,my-index-000002\",\n request: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.clear_cache(\n index: \"my-index-000001,my-index-000002\",\n request: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->clearCache([\n \"index\" => \"my-index-000001,my-index-000002\",\n \"request\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001,my-index-000002/_cache/clear?request=true\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -17852,32 +12808,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-index-000001,my-index-000002/_cache/clear?request=true\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.clear_cache(\n index=\"my-index-000001,my-index-000002\",\n request=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.clearCache({\n index: \"my-index-000001,my-index-000002\",\n request: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.clear_cache(\n index: \"my-index-000001,my-index-000002\",\n request: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->clearCache([\n \"index\" => \"my-index-000001,my-index-000002\",\n \"request\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001,my-index-000002/_cache/clear?request=true\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -17915,32 +12845,6 @@ } }, "x-state": "Generally available; Added in 7.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my_source_index/_clone/my_target_index\n{\n \"settings\": {\n \"index.number_of_shards\": 5\n },\n \"aliases\": {\n \"my_search_indices\": {}\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.clone(\n index=\"my_source_index\",\n target=\"my_target_index\",\n settings={\n \"index.number_of_shards\": 5\n },\n aliases={\n \"my_search_indices\": {}\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.clone({\n index: \"my_source_index\",\n target: \"my_target_index\",\n settings: {\n \"index.number_of_shards\": 5,\n },\n aliases: {\n my_search_indices: {},\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.clone(\n index: \"my_source_index\",\n target: \"my_target_index\",\n body: {\n \"settings\": {\n \"index.number_of_shards\": 5\n },\n \"aliases\": {\n \"my_search_indices\": {}\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->clone([\n \"index\" => \"my_source_index\",\n \"target\" => \"my_target_index\",\n \"body\" => [\n \"settings\" => [\n \"index.number_of_shards\" => 5,\n ],\n \"aliases\" => [\n \"my_search_indices\" => new ArrayObject([]),\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"settings\":{\"index.number_of_shards\":5},\"aliases\":{\"my_search_indices\":{}}}' \"$ELASTICSEARCH_URL/my_source_index/_clone/my_target_index\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -17976,32 +12880,6 @@ } }, "x-state": "Generally available; Added in 7.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my_source_index/_clone/my_target_index\n{\n \"settings\": {\n \"index.number_of_shards\": 5\n },\n \"aliases\": {\n \"my_search_indices\": {}\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.clone(\n index=\"my_source_index\",\n target=\"my_target_index\",\n settings={\n \"index.number_of_shards\": 5\n },\n aliases={\n \"my_search_indices\": {}\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.clone({\n index: \"my_source_index\",\n target: \"my_target_index\",\n settings: {\n \"index.number_of_shards\": 5,\n },\n aliases: {\n my_search_indices: {},\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.clone(\n index: \"my_source_index\",\n target: \"my_target_index\",\n body: {\n \"settings\": {\n \"index.number_of_shards\": 5\n },\n \"aliases\": {\n \"my_search_indices\": {}\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->clone([\n \"index\" => \"my_source_index\",\n \"target\" => \"my_target_index\",\n \"body\" => [\n \"settings\" => [\n \"index.number_of_shards\" => 5,\n ],\n \"aliases\" => [\n \"my_search_indices\" => new ArrayObject([]),\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"settings\":{\"index.number_of_shards\":5},\"aliases\":{\"my_search_indices\":{}}}' \"$ELASTICSEARCH_URL/my_source_index/_clone/my_target_index\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -18124,32 +13002,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-index-00001/_close\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.close(\n index=\"my-index-00001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.close({\n index: \"my-index-00001\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.close(\n index: \"my-index-00001\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->close([\n \"index\" => \"my-index-00001\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-00001/_close\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -18270,32 +13122,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get(\n index=\"my-index-000001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.get({\n index: \"my-index-000001\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get(\n index: \"my-index-000001\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->get([\n \"index\" => \"my-index-000001\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -18418,32 +13244,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /my-index-000001\n{\n \"settings\": {\n \"number_of_shards\": 3,\n \"number_of_replicas\": 2\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.create(\n index=\"my-index-000001\",\n settings={\n \"number_of_shards\": 3,\n \"number_of_replicas\": 2\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.create({\n index: \"my-index-000001\",\n settings: {\n number_of_shards: 3,\n number_of_replicas: 2,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.create(\n index: \"my-index-000001\",\n body: {\n \"settings\": {\n \"number_of_shards\": 3,\n \"number_of_replicas\": 2\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->create([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"settings\" => [\n \"number_of_shards\" => 3,\n \"number_of_replicas\" => 2,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"settings\":{\"number_of_shards\":3,\"number_of_replicas\":2}}' \"$ELASTICSEARCH_URL/my-index-000001\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -18529,32 +13329,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /books\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.delete(\n index=\"books\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.delete({\n index: \"books\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.delete(\n index: \"books\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->delete([\n \"index\" => \"books\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/books\"" - } - ], "x-product-feature": "elasticsearch" }, "head": { @@ -18646,32 +13420,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "HEAD my-data-stream\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.exists(\n index=\"my-data-stream\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.exists({\n index: \"my-data-stream\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.exists(\n index: \"my-data-stream\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->exists([\n \"index\" => \"my-data-stream\",\n]);" - }, - { - "lang": "curl", - "source": "curl --head -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-data-stream\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -18706,32 +13454,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _data_stream/my-data-stream\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_data_stream(\n name=\"my-data-stream\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getDataStream({\n name: \"my-data-stream\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_data_stream(\n name: \"my-data-stream\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getDataStream([\n \"name\" => \"my-data-stream\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_data_stream/my-data-stream\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -18787,32 +13509,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _data_stream/logs-foo-bar\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.create_data_stream(\n name=\"logs-foo-bar\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.createDataStream({\n name: \"logs-foo-bar\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.create_data_stream(\n name: \"logs-foo-bar\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->createDataStream([\n \"name\" => \"logs-foo-bar\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_data_stream/logs-foo-bar\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -18868,32 +13564,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _data_stream/my-data-stream\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.delete_data_stream(\n name=\"my-data-stream\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.deleteDataStream({\n name: \"my-data-stream\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.delete_data_stream(\n name: \"my-data-stream\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->deleteDataStream([\n \"name\" => \"my-data-stream\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_data_stream/my-data-stream\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -18922,32 +13592,6 @@ } }, "x-state": "Technical preview; Added in 8.18.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _create_from/my-index/my-new-index\n" - }, - { - "lang": "Python", - "source": "resp = client.perform_request(\n \"POST\",\n \"/_create_from/my-index/my-new-index\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transport.request({\n method: \"POST\",\n path: \"/_create_from/my-index/my-new-index\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.perform_request(\n \"POST\",\n \"/_create_from/my-index/my-new-index\",\n {},\n)" - }, - { - "lang": "PHP", - "source": "$requestFactory = Psr17FactoryDiscovery::findRequestFactory();\n$request = $requestFactory->createRequest(\n \"POST\",\n \"/_create_from/my-index/my-new-index\",\n);\n$resp = $client->sendRequest($request);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_create_from/my-index/my-new-index\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -18974,32 +13618,6 @@ } }, "x-state": "Technical preview; Added in 8.18.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _create_from/my-index/my-new-index\n" - }, - { - "lang": "Python", - "source": "resp = client.perform_request(\n \"POST\",\n \"/_create_from/my-index/my-new-index\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transport.request({\n method: \"POST\",\n path: \"/_create_from/my-index/my-new-index\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.perform_request(\n \"POST\",\n \"/_create_from/my-index/my-new-index\",\n {},\n)" - }, - { - "lang": "PHP", - "source": "$requestFactory = Psr17FactoryDiscovery::findRequestFactory();\n$request = $requestFactory->createRequest(\n \"POST\",\n \"/_create_from/my-index/my-new-index\",\n);\n$resp = $client->sendRequest($request);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_create_from/my-index/my-new-index\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -19022,32 +13640,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_data_stream/my-index-000001/_stats\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.data_streams_stats(\n name=\"my-index-000001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.dataStreamsStats({\n name: \"my-index-000001\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.data_streams_stats(\n name: \"my-index-000001\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->dataStreamsStats([\n \"name\" => \"my-index-000001\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_data_stream/my-index-000001/_stats\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -19073,32 +13665,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_data_stream/my-index-000001/_stats\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.data_streams_stats(\n name=\"my-index-000001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.dataStreamsStats({\n name: \"my-index-000001\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.data_streams_stats(\n name: \"my-index-000001\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->dataStreamsStats([\n \"name\" => \"my-index-000001\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_data_stream/my-index-000001/_stats\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -19136,32 +13702,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _alias\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_alias()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getAlias();" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_alias" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getAlias();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_alias\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -19194,32 +13734,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _aliases\n{\n \"actions\": [\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.update_aliases(\n actions=[\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.updateAliases({\n actions: [\n {\n add: {\n index: \"my-data-stream\",\n alias: \"my-alias\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.update_aliases(\n body: {\n \"actions\": [\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->updateAliases([\n \"body\" => [\n \"actions\" => array(\n [\n \"add\" => [\n \"index\" => \"my-data-stream\",\n \"alias\" => \"my-alias\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"actions\":[{\"add\":{\"index\":\"my-data-stream\",\"alias\":\"my-alias\"}}]}' \"$ELASTICSEARCH_URL/_aliases\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -19252,32 +13766,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _aliases\n{\n \"actions\": [\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.update_aliases(\n actions=[\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.updateAliases({\n actions: [\n {\n add: {\n index: \"my-data-stream\",\n alias: \"my-alias\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.update_aliases(\n body: {\n \"actions\": [\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->updateAliases([\n \"body\" => [\n \"actions\" => array(\n [\n \"add\" => [\n \"index\" => \"my-data-stream\",\n \"alias\" => \"my-alias\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"actions\":[{\"add\":{\"index\":\"my-data-stream\",\"alias\":\"my-alias\"}}]}' \"$ELASTICSEARCH_URL/_aliases\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -19307,32 +13795,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE my-data-stream/_alias/my-alias\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.delete_alias(\n index=\"my-data-stream\",\n name=\"my-alias\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.deleteAlias({\n index: \"my-data-stream\",\n name: \"my-alias\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.delete_alias(\n index: \"my-data-stream\",\n name: \"my-alias\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->deleteAlias([\n \"index\" => \"my-data-stream\",\n \"name\" => \"my-alias\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-data-stream/_alias/my-alias\"" - } - ], "x-product-feature": "elasticsearch" }, "head": { @@ -19368,32 +13830,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "HEAD _alias/my-alias\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.exists_alias(\n name=\"my-alias\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.existsAlias({\n name: \"my-alias\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.exists_alias(\n name: \"my-alias\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->existsAlias([\n \"name\" => \"my-alias\",\n]);" - }, - { - "lang": "curl", - "source": "curl --head -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_alias/my-alias\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -19428,32 +13864,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _aliases\n{\n \"actions\": [\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.update_aliases(\n actions=[\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.updateAliases({\n actions: [\n {\n add: {\n index: \"my-data-stream\",\n alias: \"my-alias\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.update_aliases(\n body: {\n \"actions\": [\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->updateAliases([\n \"body\" => [\n \"actions\" => array(\n [\n \"add\" => [\n \"index\" => \"my-data-stream\",\n \"alias\" => \"my-alias\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"actions\":[{\"add\":{\"index\":\"my-data-stream\",\"alias\":\"my-alias\"}}]}' \"$ELASTICSEARCH_URL/_aliases\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -19486,32 +13896,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _aliases\n{\n \"actions\": [\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.update_aliases(\n actions=[\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.updateAliases({\n actions: [\n {\n add: {\n index: \"my-data-stream\",\n alias: \"my-alias\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.update_aliases(\n body: {\n \"actions\": [\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->updateAliases([\n \"body\" => [\n \"actions\" => array(\n [\n \"add\" => [\n \"index\" => \"my-data-stream\",\n \"alias\" => \"my-alias\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"actions\":[{\"add\":{\"index\":\"my-data-stream\",\"alias\":\"my-alias\"}}]}' \"$ELASTICSEARCH_URL/_aliases\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -19541,32 +13925,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE my-data-stream/_alias/my-alias\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.delete_alias(\n index=\"my-data-stream\",\n name=\"my-alias\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.deleteAlias({\n index: \"my-data-stream\",\n name: \"my-alias\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.delete_alias(\n index: \"my-data-stream\",\n name: \"my-alias\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->deleteAlias([\n \"index\" => \"my-data-stream\",\n \"name\" => \"my-alias\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-data-stream/_alias/my-alias\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -19651,32 +14009,6 @@ } }, "x-state": "Generally available; Added in 8.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_data_stream/{name}/_lifecycle?human&pretty\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_data_lifecycle(\n name=\"{name}\",\n human=True,\n pretty=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getDataLifecycle({\n name: \"{name}\",\n human: \"true\",\n pretty: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_data_lifecycle(\n name: \"{name}\",\n human: \"true\",\n pretty: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getDataLifecycle([\n \"name\" => \"{name}\",\n \"human\" => \"true\",\n \"pretty\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_data_stream/%7Bname%7D/_lifecycle?human&pretty\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -19780,32 +14112,6 @@ } }, "x-state": "Generally available; Added in 8.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _data_stream/my-data-stream/_lifecycle\n{\n \"data_retention\": \"7d\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.put_data_lifecycle(\n name=\"my-data-stream\",\n data_retention=\"7d\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.putDataLifecycle({\n name: \"my-data-stream\",\n data_retention: \"7d\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.put_data_lifecycle(\n name: \"my-data-stream\",\n body: {\n \"data_retention\": \"7d\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->putDataLifecycle([\n \"name\" => \"my-data-stream\",\n \"body\" => [\n \"data_retention\" => \"7d\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"data_retention\":\"7d\"}' \"$ELASTICSEARCH_URL/_data_stream/my-data-stream/_lifecycle\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -19877,32 +14183,6 @@ } }, "x-state": "Generally available; Added in 8.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _data_stream/my-data-stream/_lifecycle\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.delete_data_lifecycle(\n name=\"my-data-stream\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.deleteDataLifecycle({\n name: \"my-data-stream\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.delete_data_lifecycle(\n name: \"my-data-stream\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->deleteDataLifecycle([\n \"name\" => \"my-data-stream\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_data_stream/my-data-stream/_lifecycle\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -19937,32 +14217,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _index_template/*?filter_path=index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_index_template(\n name=\"*\",\n filter_path=\"index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getIndexTemplate({\n name: \"*\",\n filter_path:\n \"index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_index_template(\n name: \"*\",\n filter_path: \"index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getIndexTemplate([\n \"name\" => \"*\",\n \"filter_path\" => \"index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_index_template/*?filter_path=index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -19995,32 +14249,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_index_template/template_1\n{\n \"index_patterns\" : [\"template*\"],\n \"priority\" : 1,\n \"template\": {\n \"settings\" : {\n \"number_of_shards\" : 2\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.put_index_template(\n name=\"template_1\",\n index_patterns=[\n \"template*\"\n ],\n priority=1,\n template={\n \"settings\": {\n \"number_of_shards\": 2\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.putIndexTemplate({\n name: \"template_1\",\n index_patterns: [\"template*\"],\n priority: 1,\n template: {\n settings: {\n number_of_shards: 2,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.put_index_template(\n name: \"template_1\",\n body: {\n \"index_patterns\": [\n \"template*\"\n ],\n \"priority\": 1,\n \"template\": {\n \"settings\": {\n \"number_of_shards\": 2\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->putIndexTemplate([\n \"name\" => \"template_1\",\n \"body\" => [\n \"index_patterns\" => array(\n \"template*\",\n ),\n \"priority\" => 1,\n \"template\" => [\n \"settings\" => [\n \"number_of_shards\" => 2,\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_patterns\":[\"template*\"],\"priority\":1,\"template\":{\"settings\":{\"number_of_shards\":2}}}' \"$ELASTICSEARCH_URL/_index_template/template_1\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -20053,32 +14281,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_index_template/template_1\n{\n \"index_patterns\" : [\"template*\"],\n \"priority\" : 1,\n \"template\": {\n \"settings\" : {\n \"number_of_shards\" : 2\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.put_index_template(\n name=\"template_1\",\n index_patterns=[\n \"template*\"\n ],\n priority=1,\n template={\n \"settings\": {\n \"number_of_shards\": 2\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.putIndexTemplate({\n name: \"template_1\",\n index_patterns: [\"template*\"],\n priority: 1,\n template: {\n settings: {\n number_of_shards: 2,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.put_index_template(\n name: \"template_1\",\n body: {\n \"index_patterns\": [\n \"template*\"\n ],\n \"priority\": 1,\n \"template\": {\n \"settings\": {\n \"number_of_shards\": 2\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->putIndexTemplate([\n \"name\" => \"template_1\",\n \"body\" => [\n \"index_patterns\" => array(\n \"template*\",\n ),\n \"priority\" => 1,\n \"template\" => [\n \"settings\" => [\n \"number_of_shards\" => 2,\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_patterns\":[\"template*\"],\"priority\":1,\"template\":{\"settings\":{\"number_of_shards\":2}}}' \"$ELASTICSEARCH_URL/_index_template/template_1\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -20134,32 +14336,6 @@ } }, "x-state": "Generally available; Added in 7.8.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_index_template/my-index-template\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.delete_index_template(\n name=\"my-index-template\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.deleteIndexTemplate({\n name: \"my-index-template\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.delete_index_template(\n name: \"my-index-template\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->deleteIndexTemplate([\n \"name\" => \"my-index-template\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_index_template/my-index-template\"" - } - ], "x-product-feature": "elasticsearch" }, "head": { @@ -20256,32 +14432,6 @@ }, "deprecated": true, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_template/.monitoring-*\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_template(\n name=\".monitoring-*\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getTemplate({\n name: \".monitoring-*\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_template(\n name: \".monitoring-*\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getTemplate([\n \"name\" => \".monitoring-*\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_template/.monitoring-*\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -20321,32 +14471,6 @@ }, "deprecated": true, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _template/template_1\n{\n \"index_patterns\": [\n \"te*\",\n \"bar*\"\n ],\n \"settings\": {\n \"number_of_shards\": 1\n },\n \"mappings\": {\n \"_source\": {\n \"enabled\": false\n }\n },\n \"properties\": {\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.put_template(\n name=\"template_1\",\n index_patterns=[\n \"te*\",\n \"bar*\"\n ],\n settings={\n \"number_of_shards\": 1\n },\n mappings={\n \"_source\": {\n \"enabled\": False\n }\n },\n properties={\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.putTemplate({\n name: \"template_1\",\n index_patterns: [\"te*\", \"bar*\"],\n settings: {\n number_of_shards: 1,\n },\n mappings: {\n _source: {\n enabled: false,\n },\n },\n properties: {\n host_name: {\n type: \"keyword\",\n },\n created_at: {\n type: \"date\",\n format: \"EEE MMM dd HH:mm:ss Z yyyy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.put_template(\n name: \"template_1\",\n body: {\n \"index_patterns\": [\n \"te*\",\n \"bar*\"\n ],\n \"settings\": {\n \"number_of_shards\": 1\n },\n \"mappings\": {\n \"_source\": {\n \"enabled\": false\n }\n },\n \"properties\": {\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->putTemplate([\n \"name\" => \"template_1\",\n \"body\" => [\n \"index_patterns\" => array(\n \"te*\",\n \"bar*\",\n ),\n \"settings\" => [\n \"number_of_shards\" => 1,\n ],\n \"mappings\" => [\n \"_source\" => [\n \"enabled\" => false,\n ],\n ],\n \"properties\" => [\n \"host_name\" => [\n \"type\" => \"keyword\",\n ],\n \"created_at\" => [\n \"type\" => \"date\",\n \"format\" => \"EEE MMM dd HH:mm:ss Z yyyy\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_patterns\":[\"te*\",\"bar*\"],\"settings\":{\"number_of_shards\":1},\"mappings\":{\"_source\":{\"enabled\":false}},\"properties\":{\"host_name\":{\"type\":\"keyword\"},\"created_at\":{\"type\":\"date\",\"format\":\"EEE MMM dd HH:mm:ss Z yyyy\"}}}' \"$ELASTICSEARCH_URL/_template/template_1\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -20386,32 +14510,6 @@ }, "deprecated": true, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _template/template_1\n{\n \"index_patterns\": [\n \"te*\",\n \"bar*\"\n ],\n \"settings\": {\n \"number_of_shards\": 1\n },\n \"mappings\": {\n \"_source\": {\n \"enabled\": false\n }\n },\n \"properties\": {\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.put_template(\n name=\"template_1\",\n index_patterns=[\n \"te*\",\n \"bar*\"\n ],\n settings={\n \"number_of_shards\": 1\n },\n mappings={\n \"_source\": {\n \"enabled\": False\n }\n },\n properties={\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.putTemplate({\n name: \"template_1\",\n index_patterns: [\"te*\", \"bar*\"],\n settings: {\n number_of_shards: 1,\n },\n mappings: {\n _source: {\n enabled: false,\n },\n },\n properties: {\n host_name: {\n type: \"keyword\",\n },\n created_at: {\n type: \"date\",\n format: \"EEE MMM dd HH:mm:ss Z yyyy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.put_template(\n name: \"template_1\",\n body: {\n \"index_patterns\": [\n \"te*\",\n \"bar*\"\n ],\n \"settings\": {\n \"number_of_shards\": 1\n },\n \"mappings\": {\n \"_source\": {\n \"enabled\": false\n }\n },\n \"properties\": {\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->putTemplate([\n \"name\" => \"template_1\",\n \"body\" => [\n \"index_patterns\" => array(\n \"te*\",\n \"bar*\",\n ),\n \"settings\" => [\n \"number_of_shards\" => 1,\n ],\n \"mappings\" => [\n \"_source\" => [\n \"enabled\" => false,\n ],\n ],\n \"properties\" => [\n \"host_name\" => [\n \"type\" => \"keyword\",\n ],\n \"created_at\" => [\n \"type\" => \"date\",\n \"format\" => \"EEE MMM dd HH:mm:ss Z yyyy\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_patterns\":[\"te*\",\"bar*\"],\"settings\":{\"number_of_shards\":1},\"mappings\":{\"_source\":{\"enabled\":false}},\"properties\":{\"host_name\":{\"type\":\"keyword\"},\"created_at\":{\"type\":\"date\",\"format\":\"EEE MMM dd HH:mm:ss Z yyyy\"}}}' \"$ELASTICSEARCH_URL/_template/template_1\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -20468,32 +14566,6 @@ }, "deprecated": true, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _template/.cloud-hot-warm-allocation-0\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.delete_template(\n name=\".cloud-hot-warm-allocation-0\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.deleteTemplate({\n name: \".cloud-hot-warm-allocation-0\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.delete_template(\n name: \".cloud-hot-warm-allocation-0\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->deleteTemplate([\n \"name\" => \".cloud-hot-warm-allocation-0\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_template/.cloud-hot-warm-allocation-0\"" - } - ], "x-product-feature": "elasticsearch" }, "head": { @@ -20558,32 +14630,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "HEAD /_template/template_1\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.exists_template(\n name=\"template_1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.existsTemplate({\n name: \"template_1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.exists_template(\n name: \"template_1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->existsTemplate([\n \"name\" => \"template_1\",\n]);" - }, - { - "lang": "curl", - "source": "curl --head -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_template/template_1\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -20671,32 +14717,6 @@ } }, "x-state": "Technical preview; Added in 7.15.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-index-000001/_disk_usage?run_expensive_tasks=true\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.disk_usage(\n index=\"my-index-000001\",\n run_expensive_tasks=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.diskUsage({\n index: \"my-index-000001\",\n run_expensive_tasks: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.disk_usage(\n index: \"my-index-000001\",\n run_expensive_tasks: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->diskUsage([\n \"index\" => \"my-index-000001\",\n \"run_expensive_tasks\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_disk_usage?run_expensive_tasks=true\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -20760,32 +14780,6 @@ } }, "x-state": "Technical preview; Added in 8.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-time-series-index/_downsample/my-downsampled-time-series-index\n{\n \"fixed_interval\": \"1d\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.downsample(\n index=\"my-time-series-index\",\n target_index=\"my-downsampled-time-series-index\",\n config={\n \"fixed_interval\": \"1d\"\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.downsample({\n index: \"my-time-series-index\",\n target_index: \"my-downsampled-time-series-index\",\n config: {\n fixed_interval: \"1d\",\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.downsample(\n index: \"my-time-series-index\",\n target_index: \"my-downsampled-time-series-index\",\n body: {\n \"fixed_interval\": \"1d\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->downsample([\n \"index\" => \"my-time-series-index\",\n \"target_index\" => \"my-downsampled-time-series-index\",\n \"body\" => [\n \"fixed_interval\" => \"1d\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"fixed_interval\":\"1d\"}' \"$ELASTICSEARCH_URL/my-time-series-index/_downsample/my-downsampled-time-series-index\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -20820,32 +14814,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _alias\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_alias()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getAlias();" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_alias" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getAlias();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_alias\"" - } - ], "x-product-feature": "elasticsearch" }, "head": { @@ -20878,32 +14846,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "HEAD _alias/my-alias\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.exists_alias(\n name=\"my-alias\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.existsAlias({\n name: \"my-alias\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.exists_alias(\n name: \"my-alias\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->existsAlias([\n \"name\" => \"my-alias\",\n]);" - }, - { - "lang": "curl", - "source": "curl --head -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_alias/my-alias\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -20984,32 +14926,6 @@ } }, "x-state": "Generally available; Added in 8.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET .ds-metrics-2023.03.22-000001/_lifecycle/explain\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.explain_data_lifecycle(\n index=\".ds-metrics-2023.03.22-000001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.explainDataLifecycle({\n index: \".ds-metrics-2023.03.22-000001\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.explain_data_lifecycle(\n index: \".ds-metrics-2023.03.22-000001\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->explainDataLifecycle([\n \"index\" => \".ds-metrics-2023.03.22-000001\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/.ds-metrics-2023.03.22-000001/_lifecycle/explain\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -21093,32 +15009,6 @@ } }, "x-state": "Technical preview; Added in 7.15.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_field_usage_stats\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.field_usage_stats(\n index=\"my-index-000001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.fieldUsageStats({\n index: \"my-index-000001\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.field_usage_stats(\n index: \"my-index-000001\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->fieldUsageStats([\n \"index\" => \"my-index-000001\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_field_usage_stats\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -21153,32 +15043,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_flush\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.flush()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.flush();" - }, - { - "lang": "Ruby", - "source": "response = client.indices.flush" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->flush();" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_flush\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -21211,32 +15075,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_flush\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.flush()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.flush();" - }, - { - "lang": "Ruby", - "source": "response = client.indices.flush" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->flush();" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_flush\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -21274,32 +15112,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_flush\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.flush()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.flush();" - }, - { - "lang": "Ruby", - "source": "response = client.indices.flush" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->flush();" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_flush\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -21335,32 +15147,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_flush\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.flush()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.flush();" - }, - { - "lang": "Ruby", - "source": "response = client.indices.flush" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->flush();" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_flush\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -21404,32 +15190,6 @@ } }, "x-state": "Generally available; Added in 2.1.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST my-index-000001/_forcemerge\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.forcemerge(\n index=\"my-index-000001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.forcemerge({\n index: \"my-index-000001\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.forcemerge(\n index: \"my-index-000001\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->forcemerge([\n \"index\" => \"my-index-000001\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_forcemerge\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -21476,32 +15236,6 @@ } }, "x-state": "Generally available; Added in 2.1.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST my-index-000001/_forcemerge\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.forcemerge(\n index=\"my-index-000001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.forcemerge({\n index: \"my-index-000001\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.forcemerge(\n index: \"my-index-000001\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->forcemerge([\n \"index\" => \"my-index-000001\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_forcemerge\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -21533,32 +15267,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _alias\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_alias()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getAlias();" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_alias" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getAlias();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_alias\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -21593,32 +15301,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _alias\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_alias()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getAlias();" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_alias" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getAlias();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_alias\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -21672,32 +15354,6 @@ } }, "x-state": "Generally available; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _lifecycle/stats?human&pretty\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_data_lifecycle_stats(\n human=True,\n pretty=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getDataLifecycleStats({\n human: \"true\",\n pretty: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_data_lifecycle_stats(\n human: \"true\",\n pretty: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getDataLifecycleStats([\n \"human\" => \"true\",\n \"pretty\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_lifecycle/stats?human&pretty\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -21729,32 +15385,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _data_stream/my-data-stream\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_data_stream(\n name=\"my-data-stream\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getDataStream({\n name: \"my-data-stream\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_data_stream(\n name: \"my-data-stream\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getDataStream([\n \"name\" => \"my-data-stream\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_data_stream/my-data-stream\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -21792,32 +15422,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET publications/_mapping/field/title\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_field_mapping(\n index=\"publications\",\n fields=\"title\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getFieldMapping({\n index: \"publications\",\n fields: \"title\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_field_mapping(\n index: \"publications\",\n fields: \"title\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getFieldMapping([\n \"index\" => \"publications\",\n \"fields\" => \"title\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/publications/_mapping/field/title\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -21858,32 +15462,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET publications/_mapping/field/title\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_field_mapping(\n index=\"publications\",\n fields=\"title\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getFieldMapping({\n index: \"publications\",\n fields: \"title\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_field_mapping(\n index: \"publications\",\n fields: \"title\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getFieldMapping([\n \"index\" => \"publications\",\n \"fields\" => \"title\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/publications/_mapping/field/title\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -21915,32 +15493,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _index_template/*?filter_path=index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_index_template(\n name=\"*\",\n filter_path=\"index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getIndexTemplate({\n name: \"*\",\n filter_path:\n \"index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_index_template(\n name: \"*\",\n filter_path: \"index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getIndexTemplate([\n \"name\" => \"*\",\n \"filter_path\" => \"index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_index_template/*?filter_path=index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -21975,32 +15527,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /books/_mapping\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_mapping(\n index=\"books\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getMapping({\n index: \"books\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_mapping(\n index: \"books\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getMapping([\n \"index\" => \"books\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/books/_mapping\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -22038,32 +15564,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /books/_mapping\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_mapping(\n index=\"books\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getMapping({\n index: \"books\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_mapping(\n index: \"books\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getMapping([\n \"index\" => \"books\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/books/_mapping\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -22108,32 +15608,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /my-index-000001/_mapping\n{\n \"properties\": {\n \"user\": {\n \"properties\": {\n \"name\": {\n \"type\": \"keyword\"\n }\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.put_mapping(\n index=\"my-index-000001\",\n properties={\n \"user\": {\n \"properties\": {\n \"name\": {\n \"type\": \"keyword\"\n }\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.putMapping({\n index: \"my-index-000001\",\n properties: {\n user: {\n properties: {\n name: {\n type: \"keyword\",\n },\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.put_mapping(\n index: \"my-index-000001\",\n body: {\n \"properties\": {\n \"user\": {\n \"properties\": {\n \"name\": {\n \"type\": \"keyword\"\n }\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->putMapping([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"properties\" => [\n \"user\" => [\n \"properties\" => [\n \"name\" => [\n \"type\" => \"keyword\",\n ],\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"properties\":{\"user\":{\"properties\":{\"name\":{\"type\":\"keyword\"}}}}}' \"$ELASTICSEARCH_URL/my-index-000001/_mapping\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -22178,32 +15652,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /my-index-000001/_mapping\n{\n \"properties\": {\n \"user\": {\n \"properties\": {\n \"name\": {\n \"type\": \"keyword\"\n }\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.put_mapping(\n index=\"my-index-000001\",\n properties={\n \"user\": {\n \"properties\": {\n \"name\": {\n \"type\": \"keyword\"\n }\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.putMapping({\n index: \"my-index-000001\",\n properties: {\n user: {\n properties: {\n name: {\n type: \"keyword\",\n },\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.put_mapping(\n index: \"my-index-000001\",\n body: {\n \"properties\": {\n \"user\": {\n \"properties\": {\n \"name\": {\n \"type\": \"keyword\"\n }\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->putMapping([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"properties\" => [\n \"user\" => [\n \"properties\" => [\n \"name\" => [\n \"type\" => \"keyword\",\n ],\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"properties\":{\"user\":{\"properties\":{\"name\":{\"type\":\"keyword\"}}}}}' \"$ELASTICSEARCH_URL/my-index-000001/_mapping\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -22289,32 +15737,6 @@ } }, "x-state": "Technical preview; Added in 8.18.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_migration/reindex/my-data-stream/_status\n" - }, - { - "lang": "Python", - "source": "resp = client.perform_request(\n \"GET\",\n \"/_migration/reindex/my-data-stream/_status\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transport.request({\n method: \"GET\",\n path: \"/_migration/reindex/my-data-stream/_status\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.perform_request(\n \"GET\",\n \"/_migration/reindex/my-data-stream/_status\",\n {},\n)" - }, - { - "lang": "PHP", - "source": "$requestFactory = Psr17FactoryDiscovery::findRequestFactory();\n$request = $requestFactory->createRequest(\n \"GET\",\n \"/_migration/reindex/my-data-stream/_status\",\n);\n$resp = $client->sendRequest($request);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_migration/reindex/my-data-stream/_status\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -22355,32 +15777,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _all/_settings?expand_wildcards=all&filter_path=*.settings.index.*.slowlog\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_settings(\n index=\"_all\",\n expand_wildcards=\"all\",\n filter_path=\"*.settings.index.*.slowlog\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getSettings({\n index: \"_all\",\n expand_wildcards: \"all\",\n filter_path: \"*.settings.index.*.slowlog\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_settings(\n index: \"_all\",\n expand_wildcards: \"all\",\n filter_path: \"*.settings.index.*.slowlog\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getSettings([\n \"index\" => \"_all\",\n \"expand_wildcards\" => \"all\",\n \"filter_path\" => \"*.settings.index.*.slowlog\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_all/_settings?expand_wildcards=all&filter_path=*.settings.index.*.slowlog\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -22428,32 +15824,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /my-index-000001/_settings\n{\n \"index\" : {\n \"number_of_replicas\" : 2\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.put_settings(\n index=\"my-index-000001\",\n settings={\n \"index\": {\n \"number_of_replicas\": 2\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.putSettings({\n index: \"my-index-000001\",\n settings: {\n index: {\n number_of_replicas: 2,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.put_settings(\n index: \"my-index-000001\",\n body: {\n \"index\": {\n \"number_of_replicas\": 2\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->putSettings([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"index\" => [\n \"number_of_replicas\" => 2,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index\":{\"number_of_replicas\":2}}' \"$ELASTICSEARCH_URL/my-index-000001/_settings\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -22497,32 +15867,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _all/_settings?expand_wildcards=all&filter_path=*.settings.index.*.slowlog\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_settings(\n index=\"_all\",\n expand_wildcards=\"all\",\n filter_path=\"*.settings.index.*.slowlog\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getSettings({\n index: \"_all\",\n expand_wildcards: \"all\",\n filter_path: \"*.settings.index.*.slowlog\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_settings(\n index: \"_all\",\n expand_wildcards: \"all\",\n filter_path: \"*.settings.index.*.slowlog\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getSettings([\n \"index\" => \"_all\",\n \"expand_wildcards\" => \"all\",\n \"filter_path\" => \"*.settings.index.*.slowlog\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_all/_settings?expand_wildcards=all&filter_path=*.settings.index.*.slowlog\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -22573,32 +15917,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /my-index-000001/_settings\n{\n \"index\" : {\n \"number_of_replicas\" : 2\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.put_settings(\n index=\"my-index-000001\",\n settings={\n \"index\": {\n \"number_of_replicas\": 2\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.putSettings({\n index: \"my-index-000001\",\n settings: {\n index: {\n number_of_replicas: 2,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.put_settings(\n index: \"my-index-000001\",\n body: {\n \"index\": {\n \"number_of_replicas\": 2\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->putSettings([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"index\" => [\n \"number_of_replicas\" => 2,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index\":{\"number_of_replicas\":2}}' \"$ELASTICSEARCH_URL/my-index-000001/_settings\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -22645,32 +15963,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _all/_settings?expand_wildcards=all&filter_path=*.settings.index.*.slowlog\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_settings(\n index=\"_all\",\n expand_wildcards=\"all\",\n filter_path=\"*.settings.index.*.slowlog\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getSettings({\n index: \"_all\",\n expand_wildcards: \"all\",\n filter_path: \"*.settings.index.*.slowlog\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_settings(\n index: \"_all\",\n expand_wildcards: \"all\",\n filter_path: \"*.settings.index.*.slowlog\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getSettings([\n \"index\" => \"_all\",\n \"expand_wildcards\" => \"all\",\n \"filter_path\" => \"*.settings.index.*.slowlog\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_all/_settings?expand_wildcards=all&filter_path=*.settings.index.*.slowlog\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -22714,32 +16006,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _all/_settings?expand_wildcards=all&filter_path=*.settings.index.*.slowlog\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_settings(\n index=\"_all\",\n expand_wildcards=\"all\",\n filter_path=\"*.settings.index.*.slowlog\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getSettings({\n index: \"_all\",\n expand_wildcards: \"all\",\n filter_path: \"*.settings.index.*.slowlog\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_settings(\n index: \"_all\",\n expand_wildcards: \"all\",\n filter_path: \"*.settings.index.*.slowlog\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getSettings([\n \"index\" => \"_all\",\n \"expand_wildcards\" => \"all\",\n \"filter_path\" => \"*.settings.index.*.slowlog\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_all/_settings?expand_wildcards=all&filter_path=*.settings.index.*.slowlog\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -22772,32 +16038,6 @@ }, "deprecated": true, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_template/.monitoring-*\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_template(\n name=\".monitoring-*\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getTemplate({\n name: \".monitoring-*\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_template(\n name: \".monitoring-*\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getTemplate([\n \"name\" => \".monitoring-*\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_template/.monitoring-*\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -22838,32 +16078,6 @@ } }, "x-state": "Technical preview; Added in 8.18.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _migration/reindex\n{\n \"source\": {\n \"index\": \"my-data-stream\"\n },\n \"mode\": \"upgrade\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.perform_request(\n \"POST\",\n \"/_migration/reindex\",\n headers={\"Content-Type\": \"application/json\"},\n body={\n \"source\": {\n \"index\": \"my-data-stream\"\n },\n \"mode\": \"upgrade\"\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transport.request({\n method: \"POST\",\n path: \"/_migration/reindex\",\n body: {\n source: {\n index: \"my-data-stream\",\n },\n mode: \"upgrade\",\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.perform_request(\n \"POST\",\n \"/_migration/reindex\",\n {},\n {\n \"source\": {\n \"index\": \"my-data-stream\"\n },\n \"mode\": \"upgrade\"\n },\n { \"Content-Type\": \"application/json\" },\n)" - }, - { - "lang": "PHP", - "source": "$requestFactory = Psr17FactoryDiscovery::findRequestFactory();\n$streamFactory = Psr17FactoryDiscovery::findStreamFactory();\n$request = $requestFactory->createRequest(\n \"POST\",\n \"/_migration/reindex\",\n);\n$request = $request->withHeader(\"Content-Type\", \"application/json\");\n$request = $request->withBody($streamFactory->createStream(\n json_encode([\n \"source\" => [\n \"index\" => \"my-data-stream\",\n ],\n \"mode\" => \"upgrade\",\n ]),\n));\n$resp = $client->sendRequest($request);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"my-data-stream\"},\"mode\":\"upgrade\"}' \"$ELASTICSEARCH_URL/_migration/reindex\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -22921,32 +16135,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _data_stream/_migrate/my-time-series-data\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.migrate_to_data_stream(\n name=\"my-time-series-data\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.migrateToDataStream({\n name: \"my-time-series-data\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.migrate_to_data_stream(\n name: \"my-time-series-data\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->migrateToDataStream([\n \"name\" => \"my-time-series-data\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_data_stream/_migrate/my-time-series-data\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -22999,32 +16187,6 @@ } }, "x-state": "Generally available; Added in 7.16.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _data_stream/_modify\n{\n \"actions\": [\n {\n \"remove_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001\"\n }\n },\n {\n \"add_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001-downsample\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.modify_data_stream(\n actions=[\n {\n \"remove_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001\"\n }\n },\n {\n \"add_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001-downsample\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.modifyDataStream({\n actions: [\n {\n remove_backing_index: {\n data_stream: \"my-data-stream\",\n index: \".ds-my-data-stream-2023.07.26-000001\",\n },\n },\n {\n add_backing_index: {\n data_stream: \"my-data-stream\",\n index: \".ds-my-data-stream-2023.07.26-000001-downsample\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.modify_data_stream(\n body: {\n \"actions\": [\n {\n \"remove_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001\"\n }\n },\n {\n \"add_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001-downsample\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->modifyDataStream([\n \"body\" => [\n \"actions\" => array(\n [\n \"remove_backing_index\" => [\n \"data_stream\" => \"my-data-stream\",\n \"index\" => \".ds-my-data-stream-2023.07.26-000001\",\n ],\n ],\n [\n \"add_backing_index\" => [\n \"data_stream\" => \"my-data-stream\",\n \"index\" => \".ds-my-data-stream-2023.07.26-000001-downsample\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"actions\":[{\"remove_backing_index\":{\"data_stream\":\"my-data-stream\",\"index\":\".ds-my-data-stream-2023.07.26-000001\"}},{\"add_backing_index\":{\"data_stream\":\"my-data-stream\",\"index\":\".ds-my-data-stream-2023.07.26-000001-downsample\"}}]}' \"$ELASTICSEARCH_URL/_data_stream/_modify\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -23140,32 +16302,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /.ds-my-data-stream-2099.03.07-000001/_open/\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.open(\n index=\".ds-my-data-stream-2099.03.07-000001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.open({\n index: \".ds-my-data-stream-2099.03.07-000001\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.open(\n index: \".ds-my-data-stream-2099.03.07-000001\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->open([\n \"index\" => \".ds-my-data-stream-2099.03.07-000001\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/.ds-my-data-stream-2099.03.07-000001/_open/\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -23213,32 +16349,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_data_stream/_promote/my-data-stream\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.promote_data_stream(\n name=\"my-data-stream\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.promoteDataStream({\n name: \"my-data-stream\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.promote_data_stream(\n name: \"my-data-stream\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->promoteDataStream([\n \"name\" => \"my-data-stream\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_data_stream/_promote/my-data-stream\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -23264,32 +16374,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_recovery?human\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.recovery(\n human=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.recovery({\n human: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.recovery(\n human: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->recovery([\n \"human\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_recovery?human\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -23318,32 +16402,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_recovery?human\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.recovery(\n human=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.recovery({\n human: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.recovery(\n human: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->recovery([\n \"human\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_recovery?human\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -23372,32 +16430,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _refresh\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.refresh()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.refresh();" - }, - { - "lang": "Ruby", - "source": "response = client.indices.refresh" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->refresh();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_refresh\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -23424,32 +16456,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _refresh\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.refresh()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.refresh();" - }, - { - "lang": "Ruby", - "source": "response = client.indices.refresh" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->refresh();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_refresh\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -23481,32 +16487,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _refresh\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.refresh()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.refresh();" - }, - { - "lang": "Ruby", - "source": "response = client.indices.refresh" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->refresh();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_refresh\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -23536,32 +16516,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _refresh\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.refresh()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.refresh();" - }, - { - "lang": "Ruby", - "source": "response = client.indices.refresh" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->refresh();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_refresh\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -23599,32 +16553,6 @@ } }, "x-state": "Generally available; Added in 7.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-index-000001/_reload_search_analyzers\n{\n \"_shards\": {\n \"total\": 2,\n \"successful\": 2,\n \"failed\": 0\n },\n \"reload_details\": [\n {\n \"index\": \"my-index-000001\",\n \"reloaded_analyzers\": [\n \"my_synonyms\"\n ],\n \"reloaded_node_ids\": [\n \"mfdqTXn_T7SGr2Ho2KT8uw\"\n ]\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.reload_search_analyzers(\n index=\"my-index-000001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.reloadSearchAnalyzers({\n index: \"my-index-000001\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.reload_search_analyzers(\n index: \"my-index-000001\",\n body: {\n \"_shards\": {\n \"total\": 2,\n \"successful\": 2,\n \"failed\": 0\n },\n \"reload_details\": [\n {\n \"index\": \"my-index-000001\",\n \"reloaded_analyzers\": [\n \"my_synonyms\"\n ],\n \"reloaded_node_ids\": [\n \"mfdqTXn_T7SGr2Ho2KT8uw\"\n ]\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->reloadSearchAnalyzers([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"_shards\" => [\n \"total\" => 2,\n \"successful\" => 2,\n \"failed\" => 0,\n ],\n \"reload_details\" => array(\n [\n \"index\" => \"my-index-000001\",\n \"reloaded_analyzers\" => array(\n \"my_synonyms\",\n ),\n \"reloaded_node_ids\" => array(\n \"mfdqTXn_T7SGr2Ho2KT8uw\",\n ),\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"_shards\":{\"total\":2,\"successful\":2,\"failed\":0},\"reload_details\":[{\"index\":\"my-index-000001\",\"reloaded_analyzers\":[\"my_synonyms\"],\"reloaded_node_ids\":[\"mfdqTXn_T7SGr2Ho2KT8uw\"]}]}' \"$ELASTICSEARCH_URL/my-index-000001/_reload_search_analyzers\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -23660,32 +16588,6 @@ } }, "x-state": "Generally available; Added in 7.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-index-000001/_reload_search_analyzers\n{\n \"_shards\": {\n \"total\": 2,\n \"successful\": 2,\n \"failed\": 0\n },\n \"reload_details\": [\n {\n \"index\": \"my-index-000001\",\n \"reloaded_analyzers\": [\n \"my_synonyms\"\n ],\n \"reloaded_node_ids\": [\n \"mfdqTXn_T7SGr2Ho2KT8uw\"\n ]\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.reload_search_analyzers(\n index=\"my-index-000001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.reloadSearchAnalyzers({\n index: \"my-index-000001\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.reload_search_analyzers(\n index: \"my-index-000001\",\n body: {\n \"_shards\": {\n \"total\": 2,\n \"successful\": 2,\n \"failed\": 0\n },\n \"reload_details\": [\n {\n \"index\": \"my-index-000001\",\n \"reloaded_analyzers\": [\n \"my_synonyms\"\n ],\n \"reloaded_node_ids\": [\n \"mfdqTXn_T7SGr2Ho2KT8uw\"\n ]\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->reloadSearchAnalyzers([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"_shards\" => [\n \"total\" => 2,\n \"successful\" => 2,\n \"failed\" => 0,\n ],\n \"reload_details\" => array(\n [\n \"index\" => \"my-index-000001\",\n \"reloaded_analyzers\" => array(\n \"my_synonyms\",\n ),\n \"reloaded_node_ids\" => array(\n \"mfdqTXn_T7SGr2Ho2KT8uw\",\n ),\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"_shards\":{\"total\":2,\"successful\":2,\"failed\":0},\"reload_details\":[{\"index\":\"my-index-000001\",\"reloaded_analyzers\":[\"my_synonyms\"],\"reloaded_node_ids\":[\"mfdqTXn_T7SGr2Ho2KT8uw\"]}]}' \"$ELASTICSEARCH_URL/my-index-000001/_reload_search_analyzers\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -23720,32 +16622,6 @@ } }, "x-state": "Generally available; Added in 8.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_resolve/cluster/not-present,clust*:my-index*,oldcluster:*?ignore_unavailable=false&timeout=5s\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.resolve_cluster(\n name=\"not-present,clust*:my-index*,oldcluster:*\",\n ignore_unavailable=False,\n timeout=\"5s\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.resolveCluster({\n name: \"not-present,clust*:my-index*,oldcluster:*\",\n ignore_unavailable: \"false\",\n timeout: \"5s\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.resolve_cluster(\n name: \"not-present,clust*:my-index*,oldcluster:*\",\n ignore_unavailable: \"false\",\n timeout: \"5s\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->resolveCluster([\n \"name\" => \"not-present,clust*:my-index*,oldcluster:*\",\n \"ignore_unavailable\" => \"false\",\n \"timeout\" => \"5s\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_resolve/cluster/not-present,clust*:my-index*,oldcluster:*?ignore_unavailable=false&timeout=5s\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -23783,32 +16659,6 @@ } }, "x-state": "Generally available; Added in 8.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_resolve/cluster/not-present,clust*:my-index*,oldcluster:*?ignore_unavailable=false&timeout=5s\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.resolve_cluster(\n name=\"not-present,clust*:my-index*,oldcluster:*\",\n ignore_unavailable=False,\n timeout=\"5s\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.resolveCluster({\n name: \"not-present,clust*:my-index*,oldcluster:*\",\n ignore_unavailable: \"false\",\n timeout: \"5s\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.resolve_cluster(\n name: \"not-present,clust*:my-index*,oldcluster:*\",\n ignore_unavailable: \"false\",\n timeout: \"5s\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->resolveCluster([\n \"name\" => \"not-present,clust*:my-index*,oldcluster:*\",\n \"ignore_unavailable\" => \"false\",\n \"timeout\" => \"5s\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_resolve/cluster/not-present,clust*:my-index*,oldcluster:*?ignore_unavailable=false&timeout=5s\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -23907,32 +16757,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_resolve/index/f*,remoteCluster1:bar*?expand_wildcards=all\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.resolve_index(\n name=\"f*,remoteCluster1:bar*\",\n expand_wildcards=\"all\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.resolveIndex({\n name: \"f*,remoteCluster1:bar*\",\n expand_wildcards: \"all\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.resolve_index(\n name: \"f*,remoteCluster1:bar*\",\n expand_wildcards: \"all\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->resolveIndex([\n \"name\" => \"f*,remoteCluster1:bar*\",\n \"expand_wildcards\" => \"all\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_resolve/index/f*,remoteCluster1:bar*?expand_wildcards=all\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -23973,32 +16797,6 @@ } }, "x-state": "Generally available; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST my-data-stream/_rollover\n{\n \"conditions\": {\n \"max_age\": \"7d\",\n \"max_docs\": 1000,\n \"max_primary_shard_size\": \"50gb\",\n \"max_primary_shard_docs\": \"2000\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.rollover(\n alias=\"my-data-stream\",\n conditions={\n \"max_age\": \"7d\",\n \"max_docs\": 1000,\n \"max_primary_shard_size\": \"50gb\",\n \"max_primary_shard_docs\": \"2000\"\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.rollover({\n alias: \"my-data-stream\",\n conditions: {\n max_age: \"7d\",\n max_docs: 1000,\n max_primary_shard_size: \"50gb\",\n max_primary_shard_docs: \"2000\",\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.rollover(\n alias: \"my-data-stream\",\n body: {\n \"conditions\": {\n \"max_age\": \"7d\",\n \"max_docs\": 1000,\n \"max_primary_shard_size\": \"50gb\",\n \"max_primary_shard_docs\": \"2000\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->rollover([\n \"alias\" => \"my-data-stream\",\n \"body\" => [\n \"conditions\" => [\n \"max_age\" => \"7d\",\n \"max_docs\" => 1000,\n \"max_primary_shard_size\" => \"50gb\",\n \"max_primary_shard_docs\" => \"2000\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"conditions\":{\"max_age\":\"7d\",\"max_docs\":1000,\"max_primary_shard_size\":\"50gb\",\"max_primary_shard_docs\":\"2000\"}}' \"$ELASTICSEARCH_URL/my-data-stream/_rollover\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -24042,32 +16840,6 @@ } }, "x-state": "Generally available; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST my-data-stream/_rollover\n{\n \"conditions\": {\n \"max_age\": \"7d\",\n \"max_docs\": 1000,\n \"max_primary_shard_size\": \"50gb\",\n \"max_primary_shard_docs\": \"2000\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.rollover(\n alias=\"my-data-stream\",\n conditions={\n \"max_age\": \"7d\",\n \"max_docs\": 1000,\n \"max_primary_shard_size\": \"50gb\",\n \"max_primary_shard_docs\": \"2000\"\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.rollover({\n alias: \"my-data-stream\",\n conditions: {\n max_age: \"7d\",\n max_docs: 1000,\n max_primary_shard_size: \"50gb\",\n max_primary_shard_docs: \"2000\",\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.rollover(\n alias: \"my-data-stream\",\n body: {\n \"conditions\": {\n \"max_age\": \"7d\",\n \"max_docs\": 1000,\n \"max_primary_shard_size\": \"50gb\",\n \"max_primary_shard_docs\": \"2000\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->rollover([\n \"alias\" => \"my-data-stream\",\n \"body\" => [\n \"conditions\" => [\n \"max_age\" => \"7d\",\n \"max_docs\" => 1000,\n \"max_primary_shard_size\" => \"50gb\",\n \"max_primary_shard_docs\" => \"2000\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"conditions\":{\"max_age\":\"7d\",\"max_docs\":1000,\"max_primary_shard_size\":\"50gb\",\"max_primary_shard_docs\":\"2000\"}}' \"$ELASTICSEARCH_URL/my-data-stream/_rollover\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -24096,32 +16868,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_segments\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.segments(\n index=\"my-index-000001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.segments({\n index: \"my-index-000001\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.segments(\n index: \"my-index-000001\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->segments([\n \"index\" => \"my-index-000001\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_segments\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -24153,32 +16899,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_segments\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.segments(\n index=\"my-index-000001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.segments({\n index: \"my-index-000001\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.segments(\n index: \"my-index-000001\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->segments([\n \"index\" => \"my-index-000001\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_segments\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -24210,32 +16930,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_shard_stores?status=green\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.shard_stores(\n status=\"green\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.shardStores({\n status: \"green\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.shard_stores(\n status: \"green\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->shardStores([\n \"status\" => \"green\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_shard_stores?status=green\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -24270,32 +16964,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_shard_stores?status=green\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.shard_stores(\n status=\"green\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.shardStores({\n status: \"green\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.shard_stores(\n status: \"green\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->shardStores([\n \"status\" => \"green\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_shard_stores?status=green\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -24333,32 +17001,6 @@ } }, "x-state": "Generally available; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my_source_index/_shrink/my_target_index\n{\n \"settings\": {\n \"index.routing.allocation.require._name\": null,\n \"index.blocks.write\": null\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.shrink(\n index=\"my_source_index\",\n target=\"my_target_index\",\n settings={\n \"index.routing.allocation.require._name\": None,\n \"index.blocks.write\": None\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.shrink({\n index: \"my_source_index\",\n target: \"my_target_index\",\n settings: {\n \"index.routing.allocation.require._name\": null,\n \"index.blocks.write\": null,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.shrink(\n index: \"my_source_index\",\n target: \"my_target_index\",\n body: {\n \"settings\": {\n \"index.routing.allocation.require._name\": nil,\n \"index.blocks.write\": nil\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->shrink([\n \"index\" => \"my_source_index\",\n \"target\" => \"my_target_index\",\n \"body\" => [\n \"settings\" => [\n \"index.routing.allocation.require._name\" => null,\n \"index.blocks.write\" => null,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"settings\":{\"index.routing.allocation.require._name\":null,\"index.blocks.write\":null}}' \"$ELASTICSEARCH_URL/my_source_index/_shrink/my_target_index\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -24394,32 +17036,6 @@ } }, "x-state": "Generally available; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my_source_index/_shrink/my_target_index\n{\n \"settings\": {\n \"index.routing.allocation.require._name\": null,\n \"index.blocks.write\": null\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.shrink(\n index=\"my_source_index\",\n target=\"my_target_index\",\n settings={\n \"index.routing.allocation.require._name\": None,\n \"index.blocks.write\": None\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.shrink({\n index: \"my_source_index\",\n target: \"my_target_index\",\n settings: {\n \"index.routing.allocation.require._name\": null,\n \"index.blocks.write\": null,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.shrink(\n index: \"my_source_index\",\n target: \"my_target_index\",\n body: {\n \"settings\": {\n \"index.routing.allocation.require._name\": nil,\n \"index.blocks.write\": nil\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->shrink([\n \"index\" => \"my_source_index\",\n \"target\" => \"my_target_index\",\n \"body\" => [\n \"settings\" => [\n \"index.routing.allocation.require._name\" => null,\n \"index.blocks.write\" => null,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"settings\":{\"index.routing.allocation.require._name\":null,\"index.blocks.write\":null}}' \"$ELASTICSEARCH_URL/my_source_index/_shrink/my_target_index\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -24517,32 +17133,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_index_template/_simulate_index/my-index-000001\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.simulate_index_template(\n name=\"my-index-000001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.simulateIndexTemplate({\n name: \"my-index-000001\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.simulate_index_template(\n name: \"my-index-000001\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->simulateIndexTemplate([\n \"name\" => \"my-index-000001\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_index_template/_simulate_index/my-index-000001\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -24577,32 +17167,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_index_template/_simulate\n{\n \"index_patterns\": [\"my-index-*\"],\n \"composed_of\": [\"ct2\"],\n \"priority\": 10,\n \"template\": {\n \"settings\": {\n \"index.number_of_replicas\": 1\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.simulate_template(\n index_patterns=[\n \"my-index-*\"\n ],\n composed_of=[\n \"ct2\"\n ],\n priority=10,\n template={\n \"settings\": {\n \"index.number_of_replicas\": 1\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.simulateTemplate({\n index_patterns: [\"my-index-*\"],\n composed_of: [\"ct2\"],\n priority: 10,\n template: {\n settings: {\n \"index.number_of_replicas\": 1,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.simulate_template(\n body: {\n \"index_patterns\": [\n \"my-index-*\"\n ],\n \"composed_of\": [\n \"ct2\"\n ],\n \"priority\": 10,\n \"template\": {\n \"settings\": {\n \"index.number_of_replicas\": 1\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->simulateTemplate([\n \"body\" => [\n \"index_patterns\" => array(\n \"my-index-*\",\n ),\n \"composed_of\" => array(\n \"ct2\",\n ),\n \"priority\" => 10,\n \"template\" => [\n \"settings\" => [\n \"index.number_of_replicas\" => 1,\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_patterns\":[\"my-index-*\"],\"composed_of\":[\"ct2\"],\"priority\":10,\"template\":{\"settings\":{\"index.number_of_replicas\":1}}}' \"$ELASTICSEARCH_URL/_index_template/_simulate\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -24640,32 +17204,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_index_template/_simulate\n{\n \"index_patterns\": [\"my-index-*\"],\n \"composed_of\": [\"ct2\"],\n \"priority\": 10,\n \"template\": {\n \"settings\": {\n \"index.number_of_replicas\": 1\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.simulate_template(\n index_patterns=[\n \"my-index-*\"\n ],\n composed_of=[\n \"ct2\"\n ],\n priority=10,\n template={\n \"settings\": {\n \"index.number_of_replicas\": 1\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.simulateTemplate({\n index_patterns: [\"my-index-*\"],\n composed_of: [\"ct2\"],\n priority: 10,\n template: {\n settings: {\n \"index.number_of_replicas\": 1,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.simulate_template(\n body: {\n \"index_patterns\": [\n \"my-index-*\"\n ],\n \"composed_of\": [\n \"ct2\"\n ],\n \"priority\": 10,\n \"template\": {\n \"settings\": {\n \"index.number_of_replicas\": 1\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->simulateTemplate([\n \"body\" => [\n \"index_patterns\" => array(\n \"my-index-*\",\n ),\n \"composed_of\" => array(\n \"ct2\",\n ),\n \"priority\" => 10,\n \"template\" => [\n \"settings\" => [\n \"index.number_of_replicas\" => 1,\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_patterns\":[\"my-index-*\"],\"composed_of\":[\"ct2\"],\"priority\":10,\"template\":{\"settings\":{\"index.number_of_replicas\":1}}}' \"$ELASTICSEARCH_URL/_index_template/_simulate\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -24703,32 +17241,6 @@ } }, "x-state": "Generally available; Added in 6.1.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-index-000001/_split/split-my-index-000001\n{\n \"settings\": {\n \"index.number_of_shards\": 2\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.split(\n index=\"my-index-000001\",\n target=\"split-my-index-000001\",\n settings={\n \"index.number_of_shards\": 2\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.split({\n index: \"my-index-000001\",\n target: \"split-my-index-000001\",\n settings: {\n \"index.number_of_shards\": 2,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.split(\n index: \"my-index-000001\",\n target: \"split-my-index-000001\",\n body: {\n \"settings\": {\n \"index.number_of_shards\": 2\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->split([\n \"index\" => \"my-index-000001\",\n \"target\" => \"split-my-index-000001\",\n \"body\" => [\n \"settings\" => [\n \"index.number_of_shards\" => 2,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"settings\":{\"index.number_of_shards\":2}}' \"$ELASTICSEARCH_URL/my-index-000001/_split/split-my-index-000001\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -24764,32 +17276,6 @@ } }, "x-state": "Generally available; Added in 6.1.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-index-000001/_split/split-my-index-000001\n{\n \"settings\": {\n \"index.number_of_shards\": 2\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.split(\n index=\"my-index-000001\",\n target=\"split-my-index-000001\",\n settings={\n \"index.number_of_shards\": 2\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.split({\n index: \"my-index-000001\",\n target: \"split-my-index-000001\",\n settings: {\n \"index.number_of_shards\": 2,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.split(\n index: \"my-index-000001\",\n target: \"split-my-index-000001\",\n body: {\n \"settings\": {\n \"index.number_of_shards\": 2\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->split([\n \"index\" => \"my-index-000001\",\n \"target\" => \"split-my-index-000001\",\n \"body\" => [\n \"settings\" => [\n \"index.number_of_shards\" => 2,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"settings\":{\"index.number_of_shards\":2}}' \"$ELASTICSEARCH_URL/my-index-000001/_split/split-my-index-000001\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -24836,32 +17322,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _stats/fielddata?human&fields=my_join_field#question\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.stats(\n metric=\"fielddata\",\n human=True,\n fields=\"my_join_field\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.stats({\n metric: \"fielddata\",\n human: \"true\",\n fields: \"my_join_field\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.stats(\n metric: \"fielddata\",\n human: \"true\",\n fields: \"my_join_field\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->stats([\n \"metric\" => \"fielddata\",\n \"human\" => \"true\",\n \"fields\" => \"my_join_field\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_stats/fielddata?human&fields=my_join_field#question\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -24911,32 +17371,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _stats/fielddata?human&fields=my_join_field#question\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.stats(\n metric=\"fielddata\",\n human=True,\n fields=\"my_join_field\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.stats({\n metric: \"fielddata\",\n human: \"true\",\n fields: \"my_join_field\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.stats(\n metric: \"fielddata\",\n human: \"true\",\n fields: \"my_join_field\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->stats([\n \"metric\" => \"fielddata\",\n \"human\" => \"true\",\n \"fields\" => \"my_join_field\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_stats/fielddata?human&fields=my_join_field#question\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -24986,32 +17420,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _stats/fielddata?human&fields=my_join_field#question\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.stats(\n metric=\"fielddata\",\n human=True,\n fields=\"my_join_field\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.stats({\n metric: \"fielddata\",\n human: \"true\",\n fields: \"my_join_field\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.stats(\n metric: \"fielddata\",\n human: \"true\",\n fields: \"my_join_field\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->stats([\n \"metric\" => \"fielddata\",\n \"human\" => \"true\",\n \"fields\" => \"my_join_field\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_stats/fielddata?human&fields=my_join_field#question\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -25064,32 +17472,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _stats/fielddata?human&fields=my_join_field#question\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.stats(\n metric=\"fielddata\",\n human=True,\n fields=\"my_join_field\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.stats({\n metric: \"fielddata\",\n human: \"true\",\n fields: \"my_join_field\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.stats(\n metric: \"fielddata\",\n human: \"true\",\n fields: \"my_join_field\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->stats([\n \"metric\" => \"fielddata\",\n \"human\" => \"true\",\n \"fields\" => \"my_join_field\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_stats/fielddata?human&fields=my_join_field#question\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -25161,32 +17543,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _aliases\n{\n \"actions\": [\n {\n \"add\": {\n \"index\": \"logs-nginx.access-prod\",\n \"alias\": \"logs\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.update_aliases(\n actions=[\n {\n \"add\": {\n \"index\": \"logs-nginx.access-prod\",\n \"alias\": \"logs\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.updateAliases({\n actions: [\n {\n add: {\n index: \"logs-nginx.access-prod\",\n alias: \"logs\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.update_aliases(\n body: {\n \"actions\": [\n {\n \"add\": {\n \"index\": \"logs-nginx.access-prod\",\n \"alias\": \"logs\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->updateAliases([\n \"body\" => [\n \"actions\" => array(\n [\n \"add\" => [\n \"index\" => \"logs-nginx.access-prod\",\n \"alias\" => \"logs\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"actions\":[{\"add\":{\"index\":\"logs-nginx.access-prod\",\"alias\":\"logs\"}}]}' \"$ELASTICSEARCH_URL/_aliases\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -25245,32 +17601,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index-000001/_validate/query?q=user.id:kimchy\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.validate_query(\n index=\"my-index-000001\",\n q=\"user.id:kimchy\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.validateQuery({\n index: \"my-index-000001\",\n q: \"user.id:kimchy\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.validate_query(\n index: \"my-index-000001\",\n q: \"user.id:kimchy\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->validateQuery([\n \"index\" => \"my-index-000001\",\n \"q\" => \"user.id:kimchy\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_validate/query?q=user.id:kimchy\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -25327,32 +17657,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index-000001/_validate/query?q=user.id:kimchy\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.validate_query(\n index=\"my-index-000001\",\n q=\"user.id:kimchy\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.validateQuery({\n index: \"my-index-000001\",\n q: \"user.id:kimchy\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.validate_query(\n index: \"my-index-000001\",\n q: \"user.id:kimchy\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->validateQuery([\n \"index\" => \"my-index-000001\",\n \"q\" => \"user.id:kimchy\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_validate/query?q=user.id:kimchy\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -25414,32 +17718,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index-000001/_validate/query?q=user.id:kimchy\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.validate_query(\n index=\"my-index-000001\",\n q=\"user.id:kimchy\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.validateQuery({\n index: \"my-index-000001\",\n q: \"user.id:kimchy\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.validate_query(\n index: \"my-index-000001\",\n q: \"user.id:kimchy\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->validateQuery([\n \"index\" => \"my-index-000001\",\n \"q\" => \"user.id:kimchy\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_validate/query?q=user.id:kimchy\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -25499,32 +17777,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index-000001/_validate/query?q=user.id:kimchy\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.validate_query(\n index=\"my-index-000001\",\n q=\"user.id:kimchy\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.validateQuery({\n index: \"my-index-000001\",\n q: \"user.id:kimchy\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.validate_query(\n index: \"my-index-000001\",\n q: \"user.id:kimchy\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->validateQuery([\n \"index\" => \"my-index-000001\",\n \"q\" => \"user.id:kimchy\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_validate/query?q=user.id:kimchy\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -25605,32 +17857,6 @@ } }, "x-state": "Generally available; Added in 8.18.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _inference/chat_completion/openai-completion/_stream\n{\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.chat_completion_unified(\n inference_id=\"openai-completion\",\n chat_completion_request={\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.chatCompletionUnified({\n inference_id: \"openai-completion\",\n chat_completion_request: {\n model: \"gpt-4o\",\n messages: [\n {\n role: \"user\",\n content: \"What is Elastic?\",\n },\n ],\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.chat_completion_unified(\n inference_id: \"openai-completion\",\n body: {\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->chatCompletionUnified([\n \"inference_id\" => \"openai-completion\",\n \"body\" => [\n \"model\" => \"gpt-4o\",\n \"messages\" => array(\n [\n \"role\" => \"user\",\n \"content\" => \"What is Elastic?\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"model\":\"gpt-4o\",\"messages\":[{\"role\":\"user\",\"content\":\"What is Elastic?\"}]}' \"$ELASTICSEARCH_URL/_inference/chat_completion/openai-completion/_stream\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -25722,32 +17948,6 @@ } }, "x-state": "Generally available; Added in 8.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _inference/completion/openai_chat_completions\n{\n \"input\": \"What is Elastic?\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.completion(\n inference_id=\"openai_chat_completions\",\n input=\"What is Elastic?\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.completion({\n inference_id: \"openai_chat_completions\",\n input: \"What is Elastic?\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.completion(\n inference_id: \"openai_chat_completions\",\n body: {\n \"input\": \"What is Elastic?\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->completion([\n \"inference_id\" => \"openai_chat_completions\",\n \"body\" => [\n \"input\" => \"What is Elastic?\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"input\":\"What is Elastic?\"}' \"$ELASTICSEARCH_URL/_inference/completion/openai_chat_completions\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -25769,32 +17969,6 @@ } }, "x-state": "Generally available; Added in 8.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _inference/sparse_embedding/my-elser-model\n" - }, - { - "lang": "Python", - "source": "resp = client.inference.get(\n task_type=\"sparse_embedding\",\n inference_id=\"my-elser-model\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.get({\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.get(\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->get([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"my-elser-model\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "put": { @@ -25818,32 +17992,6 @@ } }, "x-state": "Generally available; Added in 8.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/rerank/my-rerank-model\n{\n \"service\": \"cohere\",\n \"service_settings\": {\n \"model_id\": \"rerank-english-v3.0\",\n \"api_key\": \"{{COHERE_API_KEY}}\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"my-rerank-model\",\n inference_config={\n \"service\": \"cohere\",\n \"service_settings\": {\n \"model_id\": \"rerank-english-v3.0\",\n \"api_key\": \"{{COHERE_API_KEY}}\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"my-rerank-model\",\n inference_config: {\n service: \"cohere\",\n service_settings: {\n model_id: \"rerank-english-v3.0\",\n api_key: \"{{COHERE_API_KEY}}\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"my-rerank-model\",\n body: {\n \"service\": \"cohere\",\n \"service_settings\": {\n \"model_id\": \"rerank-english-v3.0\",\n \"api_key\": \"{{COHERE_API_KEY}}\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"my-rerank-model\",\n \"body\" => [\n \"service\" => \"cohere\",\n \"service_settings\" => [\n \"model_id\" => \"rerank-english-v3.0\",\n \"api_key\" => \"{{COHERE_API_KEY}}\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"cohere\",\"service_settings\":{\"model_id\":\"rerank-english-v3.0\",\"api_key\":\"{{COHERE_API_KEY}}\"}}' \"$ELASTICSEARCH_URL/_inference/rerank/my-rerank-model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -25895,32 +18043,6 @@ } }, "x-state": "Generally available; Added in 8.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_inference/sparse_embedding/my-elser-model\n" - }, - { - "lang": "Python", - "source": "resp = client.inference.delete(\n task_type=\"sparse_embedding\",\n inference_id=\"my-elser-model\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.delete({\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.delete(\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->delete([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"my-elser-model\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -25945,32 +18067,6 @@ } }, "x-state": "Generally available; Added in 8.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _inference/sparse_embedding/my-elser-model\n" - }, - { - "lang": "Python", - "source": "resp = client.inference.get(\n task_type=\"sparse_embedding\",\n inference_id=\"my-elser-model\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.get({\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.get(\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->get([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"my-elser-model\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "put": { @@ -25997,32 +18093,6 @@ } }, "x-state": "Generally available; Added in 8.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/rerank/my-rerank-model\n{\n \"service\": \"cohere\",\n \"service_settings\": {\n \"model_id\": \"rerank-english-v3.0\",\n \"api_key\": \"{{COHERE_API_KEY}}\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"my-rerank-model\",\n inference_config={\n \"service\": \"cohere\",\n \"service_settings\": {\n \"model_id\": \"rerank-english-v3.0\",\n \"api_key\": \"{{COHERE_API_KEY}}\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"my-rerank-model\",\n inference_config: {\n service: \"cohere\",\n service_settings: {\n model_id: \"rerank-english-v3.0\",\n api_key: \"{{COHERE_API_KEY}}\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"my-rerank-model\",\n body: {\n \"service\": \"cohere\",\n \"service_settings\": {\n \"model_id\": \"rerank-english-v3.0\",\n \"api_key\": \"{{COHERE_API_KEY}}\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"my-rerank-model\",\n \"body\" => [\n \"service\" => \"cohere\",\n \"service_settings\" => [\n \"model_id\" => \"rerank-english-v3.0\",\n \"api_key\" => \"{{COHERE_API_KEY}}\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"cohere\",\"service_settings\":{\"model_id\":\"rerank-english-v3.0\",\"api_key\":\"{{COHERE_API_KEY}}\"}}' \"$ELASTICSEARCH_URL/_inference/rerank/my-rerank-model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -26080,32 +18150,6 @@ } }, "x-state": "Generally available; Added in 8.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_inference/sparse_embedding/my-elser-model\n" - }, - { - "lang": "Python", - "source": "resp = client.inference.delete(\n task_type=\"sparse_embedding\",\n inference_id=\"my-elser-model\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.delete({\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.delete(\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->delete([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"my-elser-model\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -26122,32 +18166,6 @@ } }, "x-state": "Generally available; Added in 8.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _inference/sparse_embedding/my-elser-model\n" - }, - { - "lang": "Python", - "source": "resp = client.inference.get(\n task_type=\"sparse_embedding\",\n inference_id=\"my-elser-model\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.get({\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.get(\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->get([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"my-elser-model\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -26245,32 +18263,6 @@ } }, "x-state": "Generally available; Added in 8.16.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/completion/alibabacloud_ai_search_completion\n{\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"host\" : \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-qwen-turbo\",\n \"workspace\" : \"default\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"alibabacloud_ai_search_completion\",\n inference_config={\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-qwen-turbo\",\n \"workspace\": \"default\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"alibabacloud_ai_search_completion\",\n inference_config: {\n service: \"alibabacloud-ai-search\",\n service_settings: {\n host: \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n api_key: \"AlibabaCloud-API-Key\",\n service_id: \"ops-qwen-turbo\",\n workspace: \"default\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"alibabacloud_ai_search_completion\",\n body: {\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-qwen-turbo\",\n \"workspace\": \"default\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"alibabacloud_ai_search_completion\",\n \"body\" => [\n \"service\" => \"alibabacloud-ai-search\",\n \"service_settings\" => [\n \"host\" => \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"api_key\" => \"AlibabaCloud-API-Key\",\n \"service_id\" => \"ops-qwen-turbo\",\n \"workspace\" => \"default\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"alibabacloud-ai-search\",\"service_settings\":{\"host\":\"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\"api_key\":\"AlibabaCloud-API-Key\",\"service_id\":\"ops-qwen-turbo\",\"workspace\":\"default\"}}' \"$ELASTICSEARCH_URL/_inference/completion/alibabacloud_ai_search_completion\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -26358,32 +18350,6 @@ } }, "x-state": "Generally available; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/text_embedding/amazon_bedrock_embeddings\n{\n \"service\": \"amazonbedrock\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-embed-text-v2:0\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"amazon_bedrock_embeddings\",\n inference_config={\n \"service\": \"amazonbedrock\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-embed-text-v2:0\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"amazon_bedrock_embeddings\",\n inference_config: {\n service: \"amazonbedrock\",\n service_settings: {\n access_key: \"AWS-access-key\",\n secret_key: \"AWS-secret-key\",\n region: \"us-east-1\",\n provider: \"amazontitan\",\n model: \"amazon.titan-embed-text-v2:0\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"amazon_bedrock_embeddings\",\n body: {\n \"service\": \"amazonbedrock\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-embed-text-v2:0\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"amazon_bedrock_embeddings\",\n \"body\" => [\n \"service\" => \"amazonbedrock\",\n \"service_settings\" => [\n \"access_key\" => \"AWS-access-key\",\n \"secret_key\" => \"AWS-secret-key\",\n \"region\" => \"us-east-1\",\n \"provider\" => \"amazontitan\",\n \"model\" => \"amazon.titan-embed-text-v2:0\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"amazonbedrock\",\"service_settings\":{\"access_key\":\"AWS-access-key\",\"secret_key\":\"AWS-secret-key\",\"region\":\"us-east-1\",\"provider\":\"amazontitan\",\"model\":\"amazon.titan-embed-text-v2:0\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/amazon_bedrock_embeddings\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -26465,32 +18431,6 @@ } }, "x-state": "Generally available; Added in 8.16.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/completion/anthropic_completion\n{\n \"service\": \"anthropic\",\n \"service_settings\": {\n \"api_key\": \"Anthropic-Api-Key\",\n \"model_id\": \"Model-ID\"\n },\n \"task_settings\": {\n \"max_tokens\": 1024\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"anthropic_completion\",\n inference_config={\n \"service\": \"anthropic\",\n \"service_settings\": {\n \"api_key\": \"Anthropic-Api-Key\",\n \"model_id\": \"Model-ID\"\n },\n \"task_settings\": {\n \"max_tokens\": 1024\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"anthropic_completion\",\n inference_config: {\n service: \"anthropic\",\n service_settings: {\n api_key: \"Anthropic-Api-Key\",\n model_id: \"Model-ID\",\n },\n task_settings: {\n max_tokens: 1024,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"anthropic_completion\",\n body: {\n \"service\": \"anthropic\",\n \"service_settings\": {\n \"api_key\": \"Anthropic-Api-Key\",\n \"model_id\": \"Model-ID\"\n },\n \"task_settings\": {\n \"max_tokens\": 1024\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"anthropic_completion\",\n \"body\" => [\n \"service\" => \"anthropic\",\n \"service_settings\" => [\n \"api_key\" => \"Anthropic-Api-Key\",\n \"model_id\" => \"Model-ID\",\n ],\n \"task_settings\" => [\n \"max_tokens\" => 1024,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"anthropic\",\"service_settings\":{\"api_key\":\"Anthropic-Api-Key\",\"model_id\":\"Model-ID\"},\"task_settings\":{\"max_tokens\":1024}}' \"$ELASTICSEARCH_URL/_inference/completion/anthropic_completion\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -26578,32 +18518,6 @@ } }, "x-state": "Generally available; Added in 8.14.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/text_embedding/azure_ai_studio_embeddings\n{\n \"service\": \"azureaistudio\",\n \"service_settings\": {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-Uri\",\n \"provider\": \"openai\",\n \"endpoint_type\": \"token\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"azure_ai_studio_embeddings\",\n inference_config={\n \"service\": \"azureaistudio\",\n \"service_settings\": {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-Uri\",\n \"provider\": \"openai\",\n \"endpoint_type\": \"token\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"azure_ai_studio_embeddings\",\n inference_config: {\n service: \"azureaistudio\",\n service_settings: {\n api_key: \"Azure-AI-Studio-API-key\",\n target: \"Target-Uri\",\n provider: \"openai\",\n endpoint_type: \"token\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"azure_ai_studio_embeddings\",\n body: {\n \"service\": \"azureaistudio\",\n \"service_settings\": {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-Uri\",\n \"provider\": \"openai\",\n \"endpoint_type\": \"token\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"azure_ai_studio_embeddings\",\n \"body\" => [\n \"service\" => \"azureaistudio\",\n \"service_settings\" => [\n \"api_key\" => \"Azure-AI-Studio-API-key\",\n \"target\" => \"Target-Uri\",\n \"provider\" => \"openai\",\n \"endpoint_type\" => \"token\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"azureaistudio\",\"service_settings\":{\"api_key\":\"Azure-AI-Studio-API-key\",\"target\":\"Target-Uri\",\"provider\":\"openai\",\"endpoint_type\":\"token\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/azure_ai_studio_embeddings\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -26691,32 +18605,6 @@ } }, "x-state": "Generally available; Added in 8.14.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/text_embedding/azure_openai_embeddings\n{\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"azure_openai_embeddings\",\n inference_config={\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"azure_openai_embeddings\",\n inference_config: {\n service: \"azureopenai\",\n service_settings: {\n api_key: \"Api-Key\",\n resource_name: \"Resource-name\",\n deployment_id: \"Deployment-id\",\n api_version: \"2024-02-01\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"azure_openai_embeddings\",\n body: {\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"azure_openai_embeddings\",\n \"body\" => [\n \"service\" => \"azureopenai\",\n \"service_settings\" => [\n \"api_key\" => \"Api-Key\",\n \"resource_name\" => \"Resource-name\",\n \"deployment_id\" => \"Deployment-id\",\n \"api_version\" => \"2024-02-01\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"azureopenai\",\"service_settings\":{\"api_key\":\"Api-Key\",\"resource_name\":\"Resource-name\",\"deployment_id\":\"Deployment-id\",\"api_version\":\"2024-02-01\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/azure_openai_embeddings\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -26804,32 +18692,6 @@ } }, "x-state": "Generally available; Added in 8.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/text_embedding/cohere-embeddings\n{\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-Api-key\",\n \"model_id\": \"embed-english-light-v3.0\",\n \"embedding_type\": \"byte\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"cohere-embeddings\",\n inference_config={\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-Api-key\",\n \"model_id\": \"embed-english-light-v3.0\",\n \"embedding_type\": \"byte\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"cohere-embeddings\",\n inference_config: {\n service: \"cohere\",\n service_settings: {\n api_key: \"Cohere-Api-key\",\n model_id: \"embed-english-light-v3.0\",\n embedding_type: \"byte\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"cohere-embeddings\",\n body: {\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-Api-key\",\n \"model_id\": \"embed-english-light-v3.0\",\n \"embedding_type\": \"byte\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"cohere-embeddings\",\n \"body\" => [\n \"service\" => \"cohere\",\n \"service_settings\" => [\n \"api_key\" => \"Cohere-Api-key\",\n \"model_id\" => \"embed-english-light-v3.0\",\n \"embedding_type\" => \"byte\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"cohere\",\"service_settings\":{\"api_key\":\"Cohere-Api-key\",\"model_id\":\"embed-english-light-v3.0\",\"embedding_type\":\"byte\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/cohere-embeddings\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -26943,32 +18805,6 @@ } }, "x-state": "Generally available; Added in 8.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/sparse_embedding/my-elser-model\n{\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"adaptive_allocations\": { \n \"enabled\": true,\n \"min_number_of_allocations\": 1,\n \"max_number_of_allocations\": 4\n },\n \"num_threads\": 1,\n \"model_id\": \".elser_model_2\" \n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"sparse_embedding\",\n inference_id=\"my-elser-model\",\n inference_config={\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"adaptive_allocations\": {\n \"enabled\": True,\n \"min_number_of_allocations\": 1,\n \"max_number_of_allocations\": 4\n },\n \"num_threads\": 1,\n \"model_id\": \".elser_model_2\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n inference_config: {\n service: \"elasticsearch\",\n service_settings: {\n adaptive_allocations: {\n enabled: true,\n min_number_of_allocations: 1,\n max_number_of_allocations: 4,\n },\n num_threads: 1,\n model_id: \".elser_model_2\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n body: {\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"adaptive_allocations\": {\n \"enabled\": true,\n \"min_number_of_allocations\": 1,\n \"max_number_of_allocations\": 4\n },\n \"num_threads\": 1,\n \"model_id\": \".elser_model_2\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"my-elser-model\",\n \"body\" => [\n \"service\" => \"elasticsearch\",\n \"service_settings\" => [\n \"adaptive_allocations\" => [\n \"enabled\" => true,\n \"min_number_of_allocations\" => 1,\n \"max_number_of_allocations\" => 4,\n ],\n \"num_threads\" => 1,\n \"model_id\" => \".elser_model_2\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"elasticsearch\",\"service_settings\":{\"adaptive_allocations\":{\"enabled\":true,\"min_number_of_allocations\":1,\"max_number_of_allocations\":4},\"num_threads\":1,\"model_id\":\".elser_model_2\"}}' \"$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -27060,32 +18896,6 @@ }, "deprecated": true, "x-state": "Generally available; Added in 8.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/sparse_embedding/my-elser-model\n{\n \"service\": \"elser\",\n \"service_settings\": {\n \"num_allocations\": 1,\n \"num_threads\": 1\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"sparse_embedding\",\n inference_id=\"my-elser-model\",\n inference_config={\n \"service\": \"elser\",\n \"service_settings\": {\n \"num_allocations\": 1,\n \"num_threads\": 1\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n inference_config: {\n service: \"elser\",\n service_settings: {\n num_allocations: 1,\n num_threads: 1,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n body: {\n \"service\": \"elser\",\n \"service_settings\": {\n \"num_allocations\": 1,\n \"num_threads\": 1\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"my-elser-model\",\n \"body\" => [\n \"service\" => \"elser\",\n \"service_settings\" => [\n \"num_allocations\" => 1,\n \"num_threads\" => 1,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"elser\",\"service_settings\":{\"num_allocations\":1,\"num_threads\":1}}' \"$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -27165,32 +18975,6 @@ } }, "x-state": "Generally available; Added in 8.15.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/completion/google_ai_studio_completion\n{\n \"service\": \"googleaistudio\",\n \"service_settings\": {\n \"api_key\": \"api-key\",\n \"model_id\": \"model-id\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"google_ai_studio_completion\",\n inference_config={\n \"service\": \"googleaistudio\",\n \"service_settings\": {\n \"api_key\": \"api-key\",\n \"model_id\": \"model-id\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"google_ai_studio_completion\",\n inference_config: {\n service: \"googleaistudio\",\n service_settings: {\n api_key: \"api-key\",\n model_id: \"model-id\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"google_ai_studio_completion\",\n body: {\n \"service\": \"googleaistudio\",\n \"service_settings\": {\n \"api_key\": \"api-key\",\n \"model_id\": \"model-id\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"google_ai_studio_completion\",\n \"body\" => [\n \"service\" => \"googleaistudio\",\n \"service_settings\" => [\n \"api_key\" => \"api-key\",\n \"model_id\" => \"model-id\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"googleaistudio\",\"service_settings\":{\"api_key\":\"api-key\",\"model_id\":\"model-id\"}}' \"$ELASTICSEARCH_URL/_inference/completion/google_ai_studio_completion\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -27278,32 +19062,6 @@ } }, "x-state": "Generally available; Added in 8.15.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/text_embedding/google_vertex_ai_embeddingss\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"service_account_json\": \"service-account-json\",\n \"model_id\": \"model-id\",\n \"location\": \"location\",\n \"project_id\": \"project-id\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"google_vertex_ai_embeddingss\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"service_account_json\": \"service-account-json\",\n \"model_id\": \"model-id\",\n \"location\": \"location\",\n \"project_id\": \"project-id\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"google_vertex_ai_embeddingss\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n service_account_json: \"service-account-json\",\n model_id: \"model-id\",\n location: \"location\",\n project_id: \"project-id\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"google_vertex_ai_embeddingss\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"service_account_json\": \"service-account-json\",\n \"model_id\": \"model-id\",\n \"location\": \"location\",\n \"project_id\": \"project-id\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"google_vertex_ai_embeddingss\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"service_account_json\" => \"service-account-json\",\n \"model_id\" => \"model-id\",\n \"location\" => \"location\",\n \"project_id\" => \"project-id\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"googlevertexai\",\"service_settings\":{\"service_account_json\":\"service-account-json\",\"model_id\":\"model-id\",\"location\":\"location\",\"project_id\":\"project-id\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/google_vertex_ai_embeddingss\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -27383,32 +19141,6 @@ } }, "x-state": "Generally available; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/text_embedding/hugging-face-embeddings\n{\n \"service\": \"hugging_face\",\n \"service_settings\": {\n \"api_key\": \"hugging-face-access-token\", \n \"url\": \"url-endpoint\" \n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"hugging-face-embeddings\",\n inference_config={\n \"service\": \"hugging_face\",\n \"service_settings\": {\n \"api_key\": \"hugging-face-access-token\",\n \"url\": \"url-endpoint\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"hugging-face-embeddings\",\n inference_config: {\n service: \"hugging_face\",\n service_settings: {\n api_key: \"hugging-face-access-token\",\n url: \"url-endpoint\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"hugging-face-embeddings\",\n body: {\n \"service\": \"hugging_face\",\n \"service_settings\": {\n \"api_key\": \"hugging-face-access-token\",\n \"url\": \"url-endpoint\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"hugging-face-embeddings\",\n \"body\" => [\n \"service\" => \"hugging_face\",\n \"service_settings\" => [\n \"api_key\" => \"hugging-face-access-token\",\n \"url\" => \"url-endpoint\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"hugging_face\",\"service_settings\":{\"api_key\":\"hugging-face-access-token\",\"url\":\"url-endpoint\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/hugging-face-embeddings\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -27496,32 +19228,6 @@ } }, "x-state": "Generally available; Added in 8.18.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/text_embedding/jinaai-embeddings\n{\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v3\",\n \"api_key\": \"JinaAi-Api-key\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"jinaai-embeddings\",\n inference_config={\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v3\",\n \"api_key\": \"JinaAi-Api-key\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"jinaai-embeddings\",\n inference_config: {\n service: \"jinaai\",\n service_settings: {\n model_id: \"jina-embeddings-v3\",\n api_key: \"JinaAi-Api-key\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"jinaai-embeddings\",\n body: {\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v3\",\n \"api_key\": \"JinaAi-Api-key\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"jinaai-embeddings\",\n \"body\" => [\n \"service\" => \"jinaai\",\n \"service_settings\" => [\n \"model_id\" => \"jina-embeddings-v3\",\n \"api_key\" => \"JinaAi-Api-key\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"jinaai\",\"service_settings\":{\"model_id\":\"jina-embeddings-v3\",\"api_key\":\"JinaAi-Api-key\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/jinaai-embeddings\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -27600,32 +19306,6 @@ } }, "x-state": "Generally available; Added in 8.15.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/text_embedding/mistral-embeddings-test\n{\n \"service\": \"mistral\",\n \"service_settings\": {\n \"api_key\": \"Mistral-API-Key\",\n \"model\": \"mistral-embed\" \n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"mistral-embeddings-test\",\n inference_config={\n \"service\": \"mistral\",\n \"service_settings\": {\n \"api_key\": \"Mistral-API-Key\",\n \"model\": \"mistral-embed\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"mistral-embeddings-test\",\n inference_config: {\n service: \"mistral\",\n service_settings: {\n api_key: \"Mistral-API-Key\",\n model: \"mistral-embed\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"mistral-embeddings-test\",\n body: {\n \"service\": \"mistral\",\n \"service_settings\": {\n \"api_key\": \"Mistral-API-Key\",\n \"model\": \"mistral-embed\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"mistral-embeddings-test\",\n \"body\" => [\n \"service\" => \"mistral\",\n \"service_settings\" => [\n \"api_key\" => \"Mistral-API-Key\",\n \"model\" => \"mistral-embed\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"mistral\",\"service_settings\":{\"api_key\":\"Mistral-API-Key\",\"model\":\"mistral-embed\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/mistral-embeddings-test\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -27713,32 +19393,6 @@ } }, "x-state": "Generally available; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/text_embedding/openai-embeddings\n{\n \"service\": \"openai\",\n \"service_settings\": {\n \"api_key\": \"OpenAI-API-Key\",\n \"model_id\": \"text-embedding-3-small\",\n \"dimensions\": 128\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"openai-embeddings\",\n inference_config={\n \"service\": \"openai\",\n \"service_settings\": {\n \"api_key\": \"OpenAI-API-Key\",\n \"model_id\": \"text-embedding-3-small\",\n \"dimensions\": 128\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"openai-embeddings\",\n inference_config: {\n service: \"openai\",\n service_settings: {\n api_key: \"OpenAI-API-Key\",\n model_id: \"text-embedding-3-small\",\n dimensions: 128,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"openai-embeddings\",\n body: {\n \"service\": \"openai\",\n \"service_settings\": {\n \"api_key\": \"OpenAI-API-Key\",\n \"model_id\": \"text-embedding-3-small\",\n \"dimensions\": 128\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"openai-embeddings\",\n \"body\" => [\n \"service\" => \"openai\",\n \"service_settings\" => [\n \"api_key\" => \"OpenAI-API-Key\",\n \"model_id\" => \"text-embedding-3-small\",\n \"dimensions\" => 128,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"openai\",\"service_settings\":{\"api_key\":\"OpenAI-API-Key\",\"model_id\":\"text-embedding-3-small\",\"dimensions\":128}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/openai-embeddings\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -27826,32 +19480,6 @@ } }, "x-state": "Generally available; Added in 8.19.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/text_embedding/openai-embeddings\n{\n \"service\": \"voyageai\",\n \"service_settings\": {\n \"model_id\": \"voyage-3-large\",\n \"dimensions\": 512\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"openai-embeddings\",\n inference_config={\n \"service\": \"voyageai\",\n \"service_settings\": {\n \"model_id\": \"voyage-3-large\",\n \"dimensions\": 512\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"openai-embeddings\",\n inference_config: {\n service: \"voyageai\",\n service_settings: {\n model_id: \"voyage-3-large\",\n dimensions: 512,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"openai-embeddings\",\n body: {\n \"service\": \"voyageai\",\n \"service_settings\": {\n \"model_id\": \"voyage-3-large\",\n \"dimensions\": 512\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"openai-embeddings\",\n \"body\" => [\n \"service\" => \"voyageai\",\n \"service_settings\" => [\n \"model_id\" => \"voyage-3-large\",\n \"dimensions\" => 512,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"voyageai\",\"service_settings\":{\"model_id\":\"voyage-3-large\",\"dimensions\":512}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/openai-embeddings\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -27927,32 +19555,6 @@ } }, "x-state": "Generally available; Added in 8.16.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/text_embedding/watsonx-embeddings\n{\n \"service\": \"watsonxai\",\n \"service_settings\": {\n \"api_key\": \"Watsonx-API-Key\", \n \"url\": \"Wastonx-URL\", \n \"model_id\": \"ibm/slate-30m-english-rtrvr\",\n \"project_id\": \"IBM-Cloud-ID\", \n \"api_version\": \"2024-03-14\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"watsonx-embeddings\",\n inference_config={\n \"service\": \"watsonxai\",\n \"service_settings\": {\n \"api_key\": \"Watsonx-API-Key\",\n \"url\": \"Wastonx-URL\",\n \"model_id\": \"ibm/slate-30m-english-rtrvr\",\n \"project_id\": \"IBM-Cloud-ID\",\n \"api_version\": \"2024-03-14\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"watsonx-embeddings\",\n inference_config: {\n service: \"watsonxai\",\n service_settings: {\n api_key: \"Watsonx-API-Key\",\n url: \"Wastonx-URL\",\n model_id: \"ibm/slate-30m-english-rtrvr\",\n project_id: \"IBM-Cloud-ID\",\n api_version: \"2024-03-14\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"watsonx-embeddings\",\n body: {\n \"service\": \"watsonxai\",\n \"service_settings\": {\n \"api_key\": \"Watsonx-API-Key\",\n \"url\": \"Wastonx-URL\",\n \"model_id\": \"ibm/slate-30m-english-rtrvr\",\n \"project_id\": \"IBM-Cloud-ID\",\n \"api_version\": \"2024-03-14\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"watsonx-embeddings\",\n \"body\" => [\n \"service\" => \"watsonxai\",\n \"service_settings\" => [\n \"api_key\" => \"Watsonx-API-Key\",\n \"url\" => \"Wastonx-URL\",\n \"model_id\" => \"ibm/slate-30m-english-rtrvr\",\n \"project_id\" => \"IBM-Cloud-ID\",\n \"api_version\" => \"2024-03-14\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"watsonxai\",\"service_settings\":{\"api_key\":\"Watsonx-API-Key\",\"url\":\"Wastonx-URL\",\"model_id\":\"ibm/slate-30m-english-rtrvr\",\"project_id\":\"IBM-Cloud-ID\",\"api_version\":\"2024-03-14\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/watsonx-embeddings\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -28050,32 +19652,6 @@ } }, "x-state": "Generally available; Added in 8.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _inference/rerank/cohere_rerank\n{\n \"input\": [\"luke\", \"like\", \"leia\", \"chewy\",\"r2d2\", \"star\", \"wars\"],\n \"query\": \"star wars main character\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.rerank(\n inference_id=\"cohere_rerank\",\n input=[\n \"luke\",\n \"like\",\n \"leia\",\n \"chewy\",\n \"r2d2\",\n \"star\",\n \"wars\"\n ],\n query=\"star wars main character\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.rerank({\n inference_id: \"cohere_rerank\",\n input: [\"luke\", \"like\", \"leia\", \"chewy\", \"r2d2\", \"star\", \"wars\"],\n query: \"star wars main character\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.rerank(\n inference_id: \"cohere_rerank\",\n body: {\n \"input\": [\n \"luke\",\n \"like\",\n \"leia\",\n \"chewy\",\n \"r2d2\",\n \"star\",\n \"wars\"\n ],\n \"query\": \"star wars main character\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->rerank([\n \"inference_id\" => \"cohere_rerank\",\n \"body\" => [\n \"input\" => array(\n \"luke\",\n \"like\",\n \"leia\",\n \"chewy\",\n \"r2d2\",\n \"star\",\n \"wars\",\n ),\n \"query\" => \"star wars main character\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"input\":[\"luke\",\"like\",\"leia\",\"chewy\",\"r2d2\",\"star\",\"wars\"],\"query\":\"star wars main character\"}' \"$ELASTICSEARCH_URL/_inference/rerank/cohere_rerank\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -28167,32 +19743,6 @@ } }, "x-state": "Generally available; Added in 8.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _inference/sparse_embedding/my-elser-model\n{\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.sparse_embedding(\n inference_id=\"my-elser-model\",\n input=\"The sky above the port was the color of television tuned to a dead channel.\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.sparseEmbedding({\n inference_id: \"my-elser-model\",\n input:\n \"The sky above the port was the color of television tuned to a dead channel.\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.sparse_embedding(\n inference_id: \"my-elser-model\",\n body: {\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->sparseEmbedding([\n \"inference_id\" => \"my-elser-model\",\n \"body\" => [\n \"input\" => \"The sky above the port was the color of television tuned to a dead channel.\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"input\":\"The sky above the port was the color of television tuned to a dead channel.\"}' \"$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -28268,32 +19818,6 @@ } }, "x-state": "Generally available; Added in 8.16.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _inference/completion/openai-completion/_stream\n{\n \"input\": \"What is Elastic?\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.stream_completion(\n inference_id=\"openai-completion\",\n input=\"What is Elastic?\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.streamCompletion({\n inference_id: \"openai-completion\",\n input: \"What is Elastic?\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.stream_completion(\n inference_id: \"openai-completion\",\n body: {\n \"input\": \"What is Elastic?\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->streamCompletion([\n \"inference_id\" => \"openai-completion\",\n \"body\" => [\n \"input\" => \"What is Elastic?\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"input\":\"What is Elastic?\"}' \"$ELASTICSEARCH_URL/_inference/completion/openai-completion/_stream\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -28385,32 +19909,6 @@ } }, "x-state": "Generally available; Added in 8.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _inference/text_embedding/my-cohere-endpoint\n{\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\",\n \"task_settings\": {\n \"input_type\": \"ingest\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.text_embedding(\n inference_id=\"my-cohere-endpoint\",\n input=\"The sky above the port was the color of television tuned to a dead channel.\",\n task_settings={\n \"input_type\": \"ingest\"\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.textEmbedding({\n inference_id: \"my-cohere-endpoint\",\n input:\n \"The sky above the port was the color of television tuned to a dead channel.\",\n task_settings: {\n input_type: \"ingest\",\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.text_embedding(\n inference_id: \"my-cohere-endpoint\",\n body: {\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\",\n \"task_settings\": {\n \"input_type\": \"ingest\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->textEmbedding([\n \"inference_id\" => \"my-cohere-endpoint\",\n \"body\" => [\n \"input\" => \"The sky above the port was the color of television tuned to a dead channel.\",\n \"task_settings\" => [\n \"input_type\" => \"ingest\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"input\":\"The sky above the port was the color of television tuned to a dead channel.\",\"task_settings\":{\"input_type\":\"ingest\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/my-cohere-endpoint\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -28436,32 +19934,6 @@ } }, "x-state": "Generally available; Added in 8.17.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/my-inference-endpoint/_update\n{\n \"service_settings\": {\n \"api_key\": \"\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.update(\n inference_id=\"my-inference-endpoint\",\n inference_config={\n \"service_settings\": {\n \"api_key\": \"\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.update({\n inference_id: \"my-inference-endpoint\",\n inference_config: {\n service_settings: {\n api_key: \"\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.update(\n inference_id: \"my-inference-endpoint\",\n body: {\n \"service_settings\": {\n \"api_key\": \"\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->update([\n \"inference_id\" => \"my-inference-endpoint\",\n \"body\" => [\n \"service_settings\" => [\n \"api_key\" => \"\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service_settings\":{\"api_key\":\"\"}}' \"$ELASTICSEARCH_URL/_inference/my-inference-endpoint/_update\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -28490,32 +19962,6 @@ } }, "x-state": "Generally available; Added in 8.17.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/my-inference-endpoint/_update\n{\n \"service_settings\": {\n \"api_key\": \"\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.update(\n inference_id=\"my-inference-endpoint\",\n inference_config={\n \"service_settings\": {\n \"api_key\": \"\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.update({\n inference_id: \"my-inference-endpoint\",\n inference_config: {\n service_settings: {\n api_key: \"\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.update(\n inference_id: \"my-inference-endpoint\",\n body: {\n \"service_settings\": {\n \"api_key\": \"\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->update([\n \"inference_id\" => \"my-inference-endpoint\",\n \"body\" => [\n \"service_settings\" => [\n \"api_key\" => \"\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service_settings\":{\"api_key\":\"\"}}' \"$ELASTICSEARCH_URL/_inference/my-inference-endpoint/_update\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -28570,32 +20016,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /\n" - }, - { - "lang": "Python", - "source": "resp = client.info()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.info();" - }, - { - "lang": "Ruby", - "source": "response = client.info" - }, - { - "lang": "PHP", - "source": "$resp = $client->info();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/\"" - } - ], "x-product-feature": "elasticsearch" }, "head": { @@ -28793,32 +20213,6 @@ } }, "x-state": "Generally available; Added in 8.15.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_ingest/ip_location/database/my-database-id\n" - }, - { - "lang": "Python", - "source": "resp = client.ingest.get_ip_location_database(\n id=\"my-database-id\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ingest.getIpLocationDatabase({\n id: \"my-database-id\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ingest.get_ip_location_database(\n id: \"my-database-id\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ingest()->getIpLocationDatabase([\n \"id\" => \"my-database-id\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ingest/ip_location/database/my-database-id\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -28890,32 +20284,6 @@ } }, "x-state": "Generally available; Added in 8.15.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _ingest/ip_location/database/my-database-1\n{\n \"name\": \"GeoIP2-Domain\",\n \"maxmind\": {\n \"account_id\": \"1234567\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ingest.put_ip_location_database(\n id=\"my-database-1\",\n configuration={\n \"name\": \"GeoIP2-Domain\",\n \"maxmind\": {\n \"account_id\": \"1234567\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ingest.putIpLocationDatabase({\n id: \"my-database-1\",\n configuration: {\n name: \"GeoIP2-Domain\",\n maxmind: {\n account_id: \"1234567\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ingest.put_ip_location_database(\n id: \"my-database-1\",\n body: {\n \"name\": \"GeoIP2-Domain\",\n \"maxmind\": {\n \"account_id\": \"1234567\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ingest()->putIpLocationDatabase([\n \"id\" => \"my-database-1\",\n \"body\" => [\n \"name\" => \"GeoIP2-Domain\",\n \"maxmind\" => [\n \"account_id\" => \"1234567\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"name\":\"GeoIP2-Domain\",\"maxmind\":{\"account_id\":\"1234567\"}}' \"$ELASTICSEARCH_URL/_ingest/ip_location/database/my-database-1\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -28971,32 +20339,6 @@ } }, "x-state": "Generally available; Added in 8.15.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_ingest/ip_location/database/my-database-id\n" - }, - { - "lang": "Python", - "source": "resp = client.ingest.delete_ip_location_database(\n id=\"my-database-id\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ingest.deleteIpLocationDatabase({\n id: \"my-database-id\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ingest.delete_ip_location_database(\n id: \"my-database-id\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ingest()->deleteIpLocationDatabase([\n \"id\" => \"my-database-id\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ingest/ip_location/database/my-database-id\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -29028,32 +20370,6 @@ } }, "x-state": "Generally available; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_ingest/pipeline/my-pipeline-id\n" - }, - { - "lang": "Python", - "source": "resp = client.ingest.get_pipeline(\n id=\"my-pipeline-id\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ingest.getPipeline({\n id: \"my-pipeline-id\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ingest.get_pipeline(\n id: \"my-pipeline-id\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ingest()->getPipeline([\n \"id\" => \"my-pipeline-id\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ingest/pipeline/my-pipeline-id\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -29173,32 +20489,6 @@ } }, "x-state": "Generally available; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _ingest/pipeline/my-pipeline-id\n{\n \"description\" : \"My optional pipeline description\",\n \"processors\" : [\n {\n \"set\" : {\n \"description\" : \"My optional processor description\",\n \"field\": \"my-keyword-field\",\n \"value\": \"foo\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.ingest.put_pipeline(\n id=\"my-pipeline-id\",\n description=\"My optional pipeline description\",\n processors=[\n {\n \"set\": {\n \"description\": \"My optional processor description\",\n \"field\": \"my-keyword-field\",\n \"value\": \"foo\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ingest.putPipeline({\n id: \"my-pipeline-id\",\n description: \"My optional pipeline description\",\n processors: [\n {\n set: {\n description: \"My optional processor description\",\n field: \"my-keyword-field\",\n value: \"foo\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ingest.put_pipeline(\n id: \"my-pipeline-id\",\n body: {\n \"description\": \"My optional pipeline description\",\n \"processors\": [\n {\n \"set\": {\n \"description\": \"My optional processor description\",\n \"field\": \"my-keyword-field\",\n \"value\": \"foo\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ingest()->putPipeline([\n \"id\" => \"my-pipeline-id\",\n \"body\" => [\n \"description\" => \"My optional pipeline description\",\n \"processors\" => array(\n [\n \"set\" => [\n \"description\" => \"My optional processor description\",\n \"field\" => \"my-keyword-field\",\n \"value\" => \"foo\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"description\":\"My optional pipeline description\",\"processors\":[{\"set\":{\"description\":\"My optional processor description\",\"field\":\"my-keyword-field\",\"value\":\"foo\"}}]}' \"$ELASTICSEARCH_URL/_ingest/pipeline/my-pipeline-id\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -29257,32 +20547,6 @@ } }, "x-state": "Generally available; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_ingest/pipeline/my-pipeline-id\n" - }, - { - "lang": "Python", - "source": "resp = client.ingest.delete_pipeline(\n id=\"my-pipeline-id\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ingest.deletePipeline({\n id: \"my-pipeline-id\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ingest.delete_pipeline(\n id: \"my-pipeline-id\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ingest()->deletePipeline([\n \"id\" => \"my-pipeline-id\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ingest/pipeline/my-pipeline-id\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -29326,32 +20590,6 @@ } }, "x-state": "Generally available; Added in 7.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ingest/geoip/stats\n" - }, - { - "lang": "Python", - "source": "resp = client.ingest.geo_ip_stats()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ingest.geoIpStats();" - }, - { - "lang": "Ruby", - "source": "response = client.ingest.geo_ip_stats" - }, - { - "lang": "PHP", - "source": "$resp = $client->ingest()->geoIpStats();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ingest/geoip/stats\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -29391,32 +20629,6 @@ } }, "x-state": "Generally available; Added in 8.15.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_ingest/ip_location/database/my-database-id\n" - }, - { - "lang": "Python", - "source": "resp = client.ingest.get_ip_location_database(\n id=\"my-database-id\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ingest.getIpLocationDatabase({\n id: \"my-database-id\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ingest.get_ip_location_database(\n id: \"my-database-id\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ingest()->getIpLocationDatabase([\n \"id\" => \"my-database-id\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ingest/ip_location/database/my-database-id\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -29445,32 +20657,6 @@ } }, "x-state": "Generally available; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_ingest/pipeline/my-pipeline-id\n" - }, - { - "lang": "Python", - "source": "resp = client.ingest.get_pipeline(\n id=\"my-pipeline-id\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ingest.getPipeline({\n id: \"my-pipeline-id\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ingest.get_pipeline(\n id: \"my-pipeline-id\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ingest()->getPipeline([\n \"id\" => \"my-pipeline-id\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ingest/pipeline/my-pipeline-id\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -29509,32 +20695,6 @@ } }, "x-state": "Generally available; Added in 6.1.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ingest/processor/grok\n" - }, - { - "lang": "Python", - "source": "resp = client.ingest.processor_grok()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ingest.processorGrok();" - }, - { - "lang": "Ruby", - "source": "response = client.ingest.processor_grok" - }, - { - "lang": "PHP", - "source": "$resp = $client->ingest()->processorGrok();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ingest/processor/grok\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -29560,32 +20720,6 @@ } }, "x-state": "Generally available; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_ingest/pipeline/_simulate\n{\n \"pipeline\" :\n {\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\" : {\n \"field\" : \"field2\",\n \"value\" : \"_value\"\n }\n }\n ]\n },\n \"docs\": [\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.ingest.simulate(\n pipeline={\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\": {\n \"field\": \"field2\",\n \"value\": \"_value\"\n }\n }\n ]\n },\n docs=[\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ingest.simulate({\n pipeline: {\n description: \"_description\",\n processors: [\n {\n set: {\n field: \"field2\",\n value: \"_value\",\n },\n },\n ],\n },\n docs: [\n {\n _index: \"index\",\n _id: \"id\",\n _source: {\n foo: \"bar\",\n },\n },\n {\n _index: \"index\",\n _id: \"id\",\n _source: {\n foo: \"rab\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ingest.simulate(\n body: {\n \"pipeline\": {\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\": {\n \"field\": \"field2\",\n \"value\": \"_value\"\n }\n }\n ]\n },\n \"docs\": [\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ingest()->simulate([\n \"body\" => [\n \"pipeline\" => [\n \"description\" => \"_description\",\n \"processors\" => array(\n [\n \"set\" => [\n \"field\" => \"field2\",\n \"value\" => \"_value\",\n ],\n ],\n ),\n ],\n \"docs\" => array(\n [\n \"_index\" => \"index\",\n \"_id\" => \"id\",\n \"_source\" => [\n \"foo\" => \"bar\",\n ],\n ],\n [\n \"_index\" => \"index\",\n \"_id\" => \"id\",\n \"_source\" => [\n \"foo\" => \"rab\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"pipeline\":{\"description\":\"_description\",\"processors\":[{\"set\":{\"field\":\"field2\",\"value\":\"_value\"}}]},\"docs\":[{\"_index\":\"index\",\"_id\":\"id\",\"_source\":{\"foo\":\"bar\"}},{\"_index\":\"index\",\"_id\":\"id\",\"_source\":{\"foo\":\"rab\"}}]}' \"$ELASTICSEARCH_URL/_ingest/pipeline/_simulate\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -29609,32 +20743,6 @@ } }, "x-state": "Generally available; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_ingest/pipeline/_simulate\n{\n \"pipeline\" :\n {\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\" : {\n \"field\" : \"field2\",\n \"value\" : \"_value\"\n }\n }\n ]\n },\n \"docs\": [\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.ingest.simulate(\n pipeline={\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\": {\n \"field\": \"field2\",\n \"value\": \"_value\"\n }\n }\n ]\n },\n docs=[\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ingest.simulate({\n pipeline: {\n description: \"_description\",\n processors: [\n {\n set: {\n field: \"field2\",\n value: \"_value\",\n },\n },\n ],\n },\n docs: [\n {\n _index: \"index\",\n _id: \"id\",\n _source: {\n foo: \"bar\",\n },\n },\n {\n _index: \"index\",\n _id: \"id\",\n _source: {\n foo: \"rab\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ingest.simulate(\n body: {\n \"pipeline\": {\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\": {\n \"field\": \"field2\",\n \"value\": \"_value\"\n }\n }\n ]\n },\n \"docs\": [\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ingest()->simulate([\n \"body\" => [\n \"pipeline\" => [\n \"description\" => \"_description\",\n \"processors\" => array(\n [\n \"set\" => [\n \"field\" => \"field2\",\n \"value\" => \"_value\",\n ],\n ],\n ),\n ],\n \"docs\" => array(\n [\n \"_index\" => \"index\",\n \"_id\" => \"id\",\n \"_source\" => [\n \"foo\" => \"bar\",\n ],\n ],\n [\n \"_index\" => \"index\",\n \"_id\" => \"id\",\n \"_source\" => [\n \"foo\" => \"rab\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"pipeline\":{\"description\":\"_description\",\"processors\":[{\"set\":{\"field\":\"field2\",\"value\":\"_value\"}}]},\"docs\":[{\"_index\":\"index\",\"_id\":\"id\",\"_source\":{\"foo\":\"bar\"}},{\"_index\":\"index\",\"_id\":\"id\",\"_source\":{\"foo\":\"rab\"}}]}' \"$ELASTICSEARCH_URL/_ingest/pipeline/_simulate\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -29663,32 +20771,6 @@ } }, "x-state": "Generally available; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_ingest/pipeline/_simulate\n{\n \"pipeline\" :\n {\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\" : {\n \"field\" : \"field2\",\n \"value\" : \"_value\"\n }\n }\n ]\n },\n \"docs\": [\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.ingest.simulate(\n pipeline={\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\": {\n \"field\": \"field2\",\n \"value\": \"_value\"\n }\n }\n ]\n },\n docs=[\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ingest.simulate({\n pipeline: {\n description: \"_description\",\n processors: [\n {\n set: {\n field: \"field2\",\n value: \"_value\",\n },\n },\n ],\n },\n docs: [\n {\n _index: \"index\",\n _id: \"id\",\n _source: {\n foo: \"bar\",\n },\n },\n {\n _index: \"index\",\n _id: \"id\",\n _source: {\n foo: \"rab\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ingest.simulate(\n body: {\n \"pipeline\": {\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\": {\n \"field\": \"field2\",\n \"value\": \"_value\"\n }\n }\n ]\n },\n \"docs\": [\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ingest()->simulate([\n \"body\" => [\n \"pipeline\" => [\n \"description\" => \"_description\",\n \"processors\" => array(\n [\n \"set\" => [\n \"field\" => \"field2\",\n \"value\" => \"_value\",\n ],\n ],\n ),\n ],\n \"docs\" => array(\n [\n \"_index\" => \"index\",\n \"_id\" => \"id\",\n \"_source\" => [\n \"foo\" => \"bar\",\n ],\n ],\n [\n \"_index\" => \"index\",\n \"_id\" => \"id\",\n \"_source\" => [\n \"foo\" => \"rab\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"pipeline\":{\"description\":\"_description\",\"processors\":[{\"set\":{\"field\":\"field2\",\"value\":\"_value\"}}]},\"docs\":[{\"_index\":\"index\",\"_id\":\"id\",\"_source\":{\"foo\":\"bar\"}},{\"_index\":\"index\",\"_id\":\"id\",\"_source\":{\"foo\":\"rab\"}}]}' \"$ELASTICSEARCH_URL/_ingest/pipeline/_simulate\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -29715,32 +20797,6 @@ } }, "x-state": "Generally available; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_ingest/pipeline/_simulate\n{\n \"pipeline\" :\n {\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\" : {\n \"field\" : \"field2\",\n \"value\" : \"_value\"\n }\n }\n ]\n },\n \"docs\": [\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.ingest.simulate(\n pipeline={\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\": {\n \"field\": \"field2\",\n \"value\": \"_value\"\n }\n }\n ]\n },\n docs=[\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ingest.simulate({\n pipeline: {\n description: \"_description\",\n processors: [\n {\n set: {\n field: \"field2\",\n value: \"_value\",\n },\n },\n ],\n },\n docs: [\n {\n _index: \"index\",\n _id: \"id\",\n _source: {\n foo: \"bar\",\n },\n },\n {\n _index: \"index\",\n _id: \"id\",\n _source: {\n foo: \"rab\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ingest.simulate(\n body: {\n \"pipeline\": {\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\": {\n \"field\": \"field2\",\n \"value\": \"_value\"\n }\n }\n ]\n },\n \"docs\": [\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ingest()->simulate([\n \"body\" => [\n \"pipeline\" => [\n \"description\" => \"_description\",\n \"processors\" => array(\n [\n \"set\" => [\n \"field\" => \"field2\",\n \"value\" => \"_value\",\n ],\n ],\n ),\n ],\n \"docs\" => array(\n [\n \"_index\" => \"index\",\n \"_id\" => \"id\",\n \"_source\" => [\n \"foo\" => \"bar\",\n ],\n ],\n [\n \"_index\" => \"index\",\n \"_id\" => \"id\",\n \"_source\" => [\n \"foo\" => \"rab\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"pipeline\":{\"description\":\"_description\",\"processors\":[{\"set\":{\"field\":\"field2\",\"value\":\"_value\"}}]},\"docs\":[{\"_index\":\"index\",\"_id\":\"id\",\"_source\":{\"foo\":\"bar\"}},{\"_index\":\"index\",\"_id\":\"id\",\"_source\":{\"foo\":\"rab\"}}]}' \"$ELASTICSEARCH_URL/_ingest/pipeline/_simulate\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -29801,32 +20857,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_license\n" - }, - { - "lang": "Python", - "source": "resp = client.license.get()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.license.get();" - }, - { - "lang": "Ruby", - "source": "response = client.license.get" - }, - { - "lang": "PHP", - "source": "$resp = $client->license()->get();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_license\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -29856,32 +20886,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _license\n{\n \"licenses\": [\n {\n \"uid\":\"893361dc-9749-4997-93cb-802e3d7fa4xx\",\n \"type\":\"basic\",\n \"issue_date_in_millis\":1411948800000,\n \"expiry_date_in_millis\":1914278399999,\n \"max_nodes\":1,\n \"issued_to\":\"issuedTo\",\n \"issuer\":\"issuer\",\n \"signature\":\"xx\"\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.license.post(\n licenses=[\n {\n \"uid\": \"893361dc-9749-4997-93cb-802e3d7fa4xx\",\n \"type\": \"basic\",\n \"issue_date_in_millis\": 1411948800000,\n \"expiry_date_in_millis\": 1914278399999,\n \"max_nodes\": 1,\n \"issued_to\": \"issuedTo\",\n \"issuer\": \"issuer\",\n \"signature\": \"xx\"\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.license.post({\n licenses: [\n {\n uid: \"893361dc-9749-4997-93cb-802e3d7fa4xx\",\n type: \"basic\",\n issue_date_in_millis: 1411948800000,\n expiry_date_in_millis: 1914278399999,\n max_nodes: 1,\n issued_to: \"issuedTo\",\n issuer: \"issuer\",\n signature: \"xx\",\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.license.post(\n body: {\n \"licenses\": [\n {\n \"uid\": \"893361dc-9749-4997-93cb-802e3d7fa4xx\",\n \"type\": \"basic\",\n \"issue_date_in_millis\": 1411948800000,\n \"expiry_date_in_millis\": 1914278399999,\n \"max_nodes\": 1,\n \"issued_to\": \"issuedTo\",\n \"issuer\": \"issuer\",\n \"signature\": \"xx\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->license()->post([\n \"body\" => [\n \"licenses\" => array(\n [\n \"uid\" => \"893361dc-9749-4997-93cb-802e3d7fa4xx\",\n \"type\" => \"basic\",\n \"issue_date_in_millis\" => 1411948800000,\n \"expiry_date_in_millis\" => 1914278399999,\n \"max_nodes\" => 1,\n \"issued_to\" => \"issuedTo\",\n \"issuer\" => \"issuer\",\n \"signature\" => \"xx\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"licenses\":[{\"uid\":\"893361dc-9749-4997-93cb-802e3d7fa4xx\",\"type\":\"basic\",\"issue_date_in_millis\":1411948800000,\"expiry_date_in_millis\":1914278399999,\"max_nodes\":1,\"issued_to\":\"issuedTo\",\"issuer\":\"issuer\",\"signature\":\"xx\"}]}' \"$ELASTICSEARCH_URL/_license\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -29911,32 +20915,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _license\n{\n \"licenses\": [\n {\n \"uid\":\"893361dc-9749-4997-93cb-802e3d7fa4xx\",\n \"type\":\"basic\",\n \"issue_date_in_millis\":1411948800000,\n \"expiry_date_in_millis\":1914278399999,\n \"max_nodes\":1,\n \"issued_to\":\"issuedTo\",\n \"issuer\":\"issuer\",\n \"signature\":\"xx\"\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.license.post(\n licenses=[\n {\n \"uid\": \"893361dc-9749-4997-93cb-802e3d7fa4xx\",\n \"type\": \"basic\",\n \"issue_date_in_millis\": 1411948800000,\n \"expiry_date_in_millis\": 1914278399999,\n \"max_nodes\": 1,\n \"issued_to\": \"issuedTo\",\n \"issuer\": \"issuer\",\n \"signature\": \"xx\"\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.license.post({\n licenses: [\n {\n uid: \"893361dc-9749-4997-93cb-802e3d7fa4xx\",\n type: \"basic\",\n issue_date_in_millis: 1411948800000,\n expiry_date_in_millis: 1914278399999,\n max_nodes: 1,\n issued_to: \"issuedTo\",\n issuer: \"issuer\",\n signature: \"xx\",\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.license.post(\n body: {\n \"licenses\": [\n {\n \"uid\": \"893361dc-9749-4997-93cb-802e3d7fa4xx\",\n \"type\": \"basic\",\n \"issue_date_in_millis\": 1411948800000,\n \"expiry_date_in_millis\": 1914278399999,\n \"max_nodes\": 1,\n \"issued_to\": \"issuedTo\",\n \"issuer\": \"issuer\",\n \"signature\": \"xx\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->license()->post([\n \"body\" => [\n \"licenses\" => array(\n [\n \"uid\" => \"893361dc-9749-4997-93cb-802e3d7fa4xx\",\n \"type\" => \"basic\",\n \"issue_date_in_millis\" => 1411948800000,\n \"expiry_date_in_millis\" => 1914278399999,\n \"max_nodes\" => 1,\n \"issued_to\" => \"issuedTo\",\n \"issuer\" => \"issuer\",\n \"signature\" => \"xx\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"licenses\":[{\"uid\":\"893361dc-9749-4997-93cb-802e3d7fa4xx\",\"type\":\"basic\",\"issue_date_in_millis\":1411948800000,\"expiry_date_in_millis\":1914278399999,\"max_nodes\":1,\"issued_to\":\"issuedTo\",\"issuer\":\"issuer\",\"signature\":\"xx\"}]}' \"$ELASTICSEARCH_URL/_license\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -29984,32 +20962,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_license\n" - }, - { - "lang": "Python", - "source": "resp = client.license.delete()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.license.delete();" - }, - { - "lang": "Ruby", - "source": "response = client.license.delete" - }, - { - "lang": "PHP", - "source": "$resp = $client->license()->delete();" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_license\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -30048,32 +21000,6 @@ } }, "x-state": "Generally available; Added in 6.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_license/basic_status\n" - }, - { - "lang": "Python", - "source": "resp = client.license.get_basic_status()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.license.getBasicStatus();" - }, - { - "lang": "Ruby", - "source": "response = client.license.get_basic_status" - }, - { - "lang": "PHP", - "source": "$resp = $client->license()->getBasicStatus();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_license/basic_status\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -30112,32 +21038,6 @@ } }, "x-state": "Generally available; Added in 6.1.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_license/trial_status\n" - }, - { - "lang": "Python", - "source": "resp = client.license.get_trial_status()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.license.getTrialStatus();" - }, - { - "lang": "Ruby", - "source": "response = client.license.get_trial_status" - }, - { - "lang": "PHP", - "source": "$resp = $client->license()->getTrialStatus();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_license/trial_status\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -30234,32 +21134,6 @@ } }, "x-state": "Generally available; Added in 6.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_license/start_basic?acknowledge=true\n" - }, - { - "lang": "Python", - "source": "resp = client.license.post_start_basic(\n acknowledge=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.license.postStartBasic({\n acknowledge: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.license.post_start_basic(\n acknowledge: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->license()->postStartBasic([\n \"acknowledge\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_license/start_basic?acknowledge=true\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -30339,32 +21213,6 @@ } }, "x-state": "Generally available; Added in 6.1.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_license/start_trial?acknowledge=true\n" - }, - { - "lang": "Python", - "source": "resp = client.license.post_start_trial(\n acknowledge=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.license.postStartTrial({\n acknowledge: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.license.post_start_trial(\n acknowledge: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->license()->postStartTrial([\n \"acknowledge\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_license/start_trial?acknowledge=true\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -30390,32 +21238,6 @@ } }, "x-state": "Generally available; Added in 7.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _logstash/pipeline/my_pipeline\n" - }, - { - "lang": "Python", - "source": "resp = client.logstash.get_pipeline(\n id=\"my_pipeline\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.logstash.getPipeline({\n id: \"my_pipeline\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.logstash.get_pipeline(\n id: \"my_pipeline\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->logstash()->getPipeline([\n \"id\" => \"my_pipeline\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_logstash/pipeline/my_pipeline\"" - } - ], "x-product-feature": "elasticsearch, logstash" }, "put": { @@ -30467,32 +21289,6 @@ } }, "x-state": "Generally available; Added in 7.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _logstash/pipeline/my_pipeline\n{\n \"description\": \"Sample pipeline for illustration purposes\",\n \"last_modified\": \"2021-01-02T02:50:51.250Z\",\n \"pipeline_metadata\": {\n \"type\": \"logstash_pipeline\",\n \"version\": 1\n },\n \"username\": \"elastic\",\n \"pipeline\": \"input {}\\\\n filter { grok {} }\\\\n output {}\",\n \"pipeline_settings\": {\n \"pipeline.workers\": 1,\n \"pipeline.batch.size\": 125,\n \"pipeline.batch.delay\": 50,\n \"queue.type\": \"memory\",\n \"queue.max_bytes\": \"1gb\",\n \"queue.checkpoint.writes\": 1024\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.logstash.put_pipeline(\n id=\"my_pipeline\",\n pipeline={\n \"description\": \"Sample pipeline for illustration purposes\",\n \"last_modified\": \"2021-01-02T02:50:51.250Z\",\n \"pipeline_metadata\": {\n \"type\": \"logstash_pipeline\",\n \"version\": 1\n },\n \"username\": \"elastic\",\n \"pipeline\": \"input {}\\\\n filter { grok {} }\\\\n output {}\",\n \"pipeline_settings\": {\n \"pipeline.workers\": 1,\n \"pipeline.batch.size\": 125,\n \"pipeline.batch.delay\": 50,\n \"queue.type\": \"memory\",\n \"queue.max_bytes\": \"1gb\",\n \"queue.checkpoint.writes\": 1024\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.logstash.putPipeline({\n id: \"my_pipeline\",\n pipeline: {\n description: \"Sample pipeline for illustration purposes\",\n last_modified: \"2021-01-02T02:50:51.250Z\",\n pipeline_metadata: {\n type: \"logstash_pipeline\",\n version: 1,\n },\n username: \"elastic\",\n pipeline: \"input {}\\\\n filter { grok {} }\\\\n output {}\",\n pipeline_settings: {\n \"pipeline.workers\": 1,\n \"pipeline.batch.size\": 125,\n \"pipeline.batch.delay\": 50,\n \"queue.type\": \"memory\",\n \"queue.max_bytes\": \"1gb\",\n \"queue.checkpoint.writes\": 1024,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.logstash.put_pipeline(\n id: \"my_pipeline\",\n body: {\n \"description\": \"Sample pipeline for illustration purposes\",\n \"last_modified\": \"2021-01-02T02:50:51.250Z\",\n \"pipeline_metadata\": {\n \"type\": \"logstash_pipeline\",\n \"version\": 1\n },\n \"username\": \"elastic\",\n \"pipeline\": \"input {}\\\\n filter { grok {} }\\\\n output {}\",\n \"pipeline_settings\": {\n \"pipeline.workers\": 1,\n \"pipeline.batch.size\": 125,\n \"pipeline.batch.delay\": 50,\n \"queue.type\": \"memory\",\n \"queue.max_bytes\": \"1gb\",\n \"queue.checkpoint.writes\": 1024\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->logstash()->putPipeline([\n \"id\" => \"my_pipeline\",\n \"body\" => [\n \"description\" => \"Sample pipeline for illustration purposes\",\n \"last_modified\" => \"2021-01-02T02:50:51.250Z\",\n \"pipeline_metadata\" => [\n \"type\" => \"logstash_pipeline\",\n \"version\" => 1,\n ],\n \"username\" => \"elastic\",\n \"pipeline\" => \"input {}\\\\n filter { grok {} }\\\\n output {}\",\n \"pipeline_settings\" => [\n \"pipeline.workers\" => 1,\n \"pipeline.batch.size\" => 125,\n \"pipeline.batch.delay\" => 50,\n \"queue.type\" => \"memory\",\n \"queue.max_bytes\" => \"1gb\",\n \"queue.checkpoint.writes\" => 1024,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"description\":\"Sample pipeline for illustration purposes\",\"last_modified\":\"2021-01-02T02:50:51.250Z\",\"pipeline_metadata\":{\"type\":\"logstash_pipeline\",\"version\":1},\"username\":\"elastic\",\"pipeline\":\"input {}\\\\n filter { grok {} }\\\\n output {}\",\"pipeline_settings\":{\"pipeline.workers\":1,\"pipeline.batch.size\":125,\"pipeline.batch.delay\":50,\"queue.type\":\"memory\",\"queue.max_bytes\":\"1gb\",\"queue.checkpoint.writes\":1024}}' \"$ELASTICSEARCH_URL/_logstash/pipeline/my_pipeline\"" - } - ], "x-product-feature": "elasticsearch, logstash" }, "delete": { @@ -30527,32 +21323,6 @@ } }, "x-state": "Generally available; Added in 7.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _logstash/pipeline/my_pipeline\n" - }, - { - "lang": "Python", - "source": "resp = client.logstash.delete_pipeline(\n id=\"my_pipeline\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.logstash.deletePipeline({\n id: \"my_pipeline\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.logstash.delete_pipeline(\n id: \"my_pipeline\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->logstash()->deletePipeline([\n \"id\" => \"my_pipeline\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_logstash/pipeline/my_pipeline\"" - } - ], "x-product-feature": "elasticsearch, logstash" } }, @@ -30573,32 +21343,6 @@ } }, "x-state": "Generally available; Added in 7.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _logstash/pipeline/my_pipeline\n" - }, - { - "lang": "Python", - "source": "resp = client.logstash.get_pipeline(\n id=\"my_pipeline\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.logstash.getPipeline({\n id: \"my_pipeline\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.logstash.get_pipeline(\n id: \"my_pipeline\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->logstash()->getPipeline([\n \"id\" => \"my_pipeline\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_logstash/pipeline/my_pipeline\"" - } - ], "x-product-feature": "elasticsearch, logstash" } }, @@ -30645,32 +21389,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_mget\n{\n \"docs\": [\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.mget(\n index=\"my-index-000001\",\n docs=[\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.mget({\n index: \"my-index-000001\",\n docs: [\n {\n _id: \"1\",\n },\n {\n _id: \"2\",\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.mget(\n index: \"my-index-000001\",\n body: {\n \"docs\": [\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->mget([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"docs\" => array(\n [\n \"_id\" => \"1\",\n ],\n [\n \"_id\" => \"2\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"docs\":[{\"_id\":\"1\"},{\"_id\":\"2\"}]}' \"$ELASTICSEARCH_URL/my-index-000001/_mget\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -30715,32 +21433,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_mget\n{\n \"docs\": [\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.mget(\n index=\"my-index-000001\",\n docs=[\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.mget({\n index: \"my-index-000001\",\n docs: [\n {\n _id: \"1\",\n },\n {\n _id: \"2\",\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.mget(\n index: \"my-index-000001\",\n body: {\n \"docs\": [\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->mget([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"docs\" => array(\n [\n \"_id\" => \"1\",\n ],\n [\n \"_id\" => \"2\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"docs\":[{\"_id\":\"1\"},{\"_id\":\"2\"}]}' \"$ELASTICSEARCH_URL/my-index-000001/_mget\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -30790,32 +21482,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_mget\n{\n \"docs\": [\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.mget(\n index=\"my-index-000001\",\n docs=[\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.mget({\n index: \"my-index-000001\",\n docs: [\n {\n _id: \"1\",\n },\n {\n _id: \"2\",\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.mget(\n index: \"my-index-000001\",\n body: {\n \"docs\": [\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->mget([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"docs\" => array(\n [\n \"_id\" => \"1\",\n ],\n [\n \"_id\" => \"2\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"docs\":[{\"_id\":\"1\"},{\"_id\":\"2\"}]}' \"$ELASTICSEARCH_URL/my-index-000001/_mget\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -30863,32 +21529,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_mget\n{\n \"docs\": [\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.mget(\n index=\"my-index-000001\",\n docs=[\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.mget({\n index: \"my-index-000001\",\n docs: [\n {\n _id: \"1\",\n },\n {\n _id: \"2\",\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.mget(\n index: \"my-index-000001\",\n body: {\n \"docs\": [\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->mget([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"docs\" => array(\n [\n \"_id\" => \"1\",\n ],\n [\n \"_id\" => \"2\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"docs\":[{\"_id\":\"1\"},{\"_id\":\"2\"}]}' \"$ELASTICSEARCH_URL/my-index-000001/_mget\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -30906,32 +21546,6 @@ } }, "x-state": "Generally available; Added in 6.1.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_migration/deprecations\n" - }, - { - "lang": "Python", - "source": "resp = client.migration.deprecations()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.migration.deprecations();" - }, - { - "lang": "Ruby", - "source": "response = client.migration.deprecations" - }, - { - "lang": "PHP", - "source": "$resp = $client->migration()->deprecations();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_migration/deprecations\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -30954,32 +21568,6 @@ } }, "x-state": "Generally available; Added in 6.1.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_migration/deprecations\n" - }, - { - "lang": "Python", - "source": "resp = client.migration.deprecations()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.migration.deprecations();" - }, - { - "lang": "Ruby", - "source": "response = client.migration.deprecations" - }, - { - "lang": "PHP", - "source": "$resp = $client->migration()->deprecations();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_migration/deprecations\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -31025,32 +21613,6 @@ } }, "x-state": "Generally available; Added in 7.16.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_migration/system_features\n" - }, - { - "lang": "Python", - "source": "resp = client.migration.get_feature_upgrade_status()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.migration.getFeatureUpgradeStatus();" - }, - { - "lang": "Ruby", - "source": "response = client.migration.get_feature_upgrade_status" - }, - { - "lang": "PHP", - "source": "$resp = $client->migration()->getFeatureUpgradeStatus();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_migration/system_features\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -31094,32 +21656,6 @@ } }, "x-state": "Generally available; Added in 7.16.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_migration/system_features\n" - }, - { - "lang": "Python", - "source": "resp = client.migration.post_feature_upgrade()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.migration.postFeatureUpgrade();" - }, - { - "lang": "Ruby", - "source": "response = client.migration.post_feature_upgrade" - }, - { - "lang": "PHP", - "source": "$resp = $client->migration()->postFeatureUpgrade();" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_migration/system_features\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -31171,32 +21707,6 @@ } }, "x-state": "Generally available; Added in 8.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/cache/_clear\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.clear_trained_model_deployment_cache(\n model_id=\"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.clearTrainedModelDeploymentCache({\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.clear_trained_model_deployment_cache(\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->clearTrainedModelDeploymentCache([\n \"model_id\" => \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/cache/_clear\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -31300,32 +21810,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/anomaly_detectors/low_request_rate/_close\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.close_job(\n job_id=\"low_request_rate\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.closeJob({\n job_id: \"low_request_rate\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.close_job(\n job_id: \"low_request_rate\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->closeJob([\n \"job_id\" => \"low_request_rate\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/_close\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -31357,32 +21841,6 @@ } }, "x-state": "Generally available; Added in 6.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/calendars/planned-outages\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_calendars(\n calendar_id=\"planned-outages\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getCalendars({\n calendar_id: \"planned-outages\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_calendars(\n calendar_id: \"planned-outages\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getCalendars([\n \"calendar_id\" => \"planned-outages\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/calendars/planned-outages\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "put": { @@ -31456,32 +21914,6 @@ } }, "x-state": "Generally available; Added in 6.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _ml/calendars/planned-outages\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.put_calendar(\n calendar_id=\"planned-outages\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.putCalendar({\n calendar_id: \"planned-outages\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.put_calendar(\n calendar_id: \"planned-outages\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->putCalendar([\n \"calendar_id\" => \"planned-outages\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/calendars/planned-outages\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -31511,32 +21943,6 @@ } }, "x-state": "Generally available; Added in 6.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/calendars/planned-outages\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_calendars(\n calendar_id=\"planned-outages\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getCalendars({\n calendar_id: \"planned-outages\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_calendars(\n calendar_id: \"planned-outages\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getCalendars([\n \"calendar_id\" => \"planned-outages\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/calendars/planned-outages\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "delete": { @@ -31578,32 +21984,6 @@ } }, "x-state": "Generally available; Added in 6.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ml/calendars/planned-outages\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.delete_calendar(\n calendar_id=\"planned-outages\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.deleteCalendar({\n calendar_id: \"planned-outages\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.delete_calendar(\n calendar_id: \"planned-outages\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->deleteCalendar([\n \"calendar_id\" => \"planned-outages\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/calendars/planned-outages\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -31657,32 +22037,6 @@ } }, "x-state": "Generally available; Added in 6.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ml/calendars/planned-outages/events/LS8LJGEBMTCMA-qz49st\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.delete_calendar_event(\n calendar_id=\"planned-outages\",\n event_id=\"LS8LJGEBMTCMA-qz49st\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.deleteCalendarEvent({\n calendar_id: \"planned-outages\",\n event_id: \"LS8LJGEBMTCMA-qz49st\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.delete_calendar_event(\n calendar_id: \"planned-outages\",\n event_id: \"LS8LJGEBMTCMA-qz49st\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->deleteCalendarEvent([\n \"calendar_id\" => \"planned-outages\",\n \"event_id\" => \"LS8LJGEBMTCMA-qz49st\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/calendars/planned-outages/events/LS8LJGEBMTCMA-qz49st\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -31747,32 +22101,6 @@ } }, "x-state": "Generally available; Added in 6.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _ml/calendars/planned-outages/jobs/total-requests\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.put_calendar_job(\n calendar_id=\"planned-outages\",\n job_id=\"total-requests\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.putCalendarJob({\n calendar_id: \"planned-outages\",\n job_id: \"total-requests\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.put_calendar_job(\n calendar_id: \"planned-outages\",\n job_id: \"total-requests\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->putCalendarJob([\n \"calendar_id\" => \"planned-outages\",\n \"job_id\" => \"total-requests\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/calendars/planned-outages/jobs/total-requests\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "delete": { @@ -31841,32 +22169,6 @@ } }, "x-state": "Generally available; Added in 6.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ml/calendars/planned-outages/jobs/total-requests\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.delete_calendar_job(\n calendar_id=\"planned-outages\",\n job_id=\"total-requests\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.deleteCalendarJob({\n calendar_id: \"planned-outages\",\n job_id: \"total-requests\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.delete_calendar_job(\n calendar_id: \"planned-outages\",\n job_id: \"total-requests\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->deleteCalendarJob([\n \"calendar_id\" => \"planned-outages\",\n \"job_id\" => \"total-requests\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/calendars/planned-outages/jobs/total-requests\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -31901,32 +22203,6 @@ } }, "x-state": "Generally available; Added in 7.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/data_frame/analytics/loganalytics\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_data_frame_analytics(\n id=\"loganalytics\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getDataFrameAnalytics({\n id: \"loganalytics\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_data_frame_analytics(\n id: \"loganalytics\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getDataFrameAnalytics([\n \"id\" => \"loganalytics\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "put": { @@ -32074,32 +22350,6 @@ } }, "x-state": "Generally available; Added in 7.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _ml/data_frame/analytics/model-flight-delays-pre\n{\n \"source\": {\n \"index\": [\n \"kibana_sample_data_flights\"\n ],\n \"query\": {\n \"range\": {\n \"DistanceKilometers\": {\n \"gt\": 0\n }\n }\n },\n \"_source\": {\n \"includes\": [],\n \"excludes\": [\n \"FlightDelay\",\n \"FlightDelayType\"\n ]\n }\n },\n \"dest\": {\n \"index\": \"df-flight-delays\",\n \"results_field\": \"ml-results\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"FlightDelayMin\",\n \"training_percent\": 90\n }\n },\n \"analyzed_fields\": {\n \"includes\": [],\n \"excludes\": [\n \"FlightNum\"\n ]\n },\n \"model_memory_limit\": \"100mb\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.put_data_frame_analytics(\n id=\"model-flight-delays-pre\",\n source={\n \"index\": [\n \"kibana_sample_data_flights\"\n ],\n \"query\": {\n \"range\": {\n \"DistanceKilometers\": {\n \"gt\": 0\n }\n }\n },\n \"_source\": {\n \"includes\": [],\n \"excludes\": [\n \"FlightDelay\",\n \"FlightDelayType\"\n ]\n }\n },\n dest={\n \"index\": \"df-flight-delays\",\n \"results_field\": \"ml-results\"\n },\n analysis={\n \"regression\": {\n \"dependent_variable\": \"FlightDelayMin\",\n \"training_percent\": 90\n }\n },\n analyzed_fields={\n \"includes\": [],\n \"excludes\": [\n \"FlightNum\"\n ]\n },\n model_memory_limit=\"100mb\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.putDataFrameAnalytics({\n id: \"model-flight-delays-pre\",\n source: {\n index: [\"kibana_sample_data_flights\"],\n query: {\n range: {\n DistanceKilometers: {\n gt: 0,\n },\n },\n },\n _source: {\n includes: [],\n excludes: [\"FlightDelay\", \"FlightDelayType\"],\n },\n },\n dest: {\n index: \"df-flight-delays\",\n results_field: \"ml-results\",\n },\n analysis: {\n regression: {\n dependent_variable: \"FlightDelayMin\",\n training_percent: 90,\n },\n },\n analyzed_fields: {\n includes: [],\n excludes: [\"FlightNum\"],\n },\n model_memory_limit: \"100mb\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.put_data_frame_analytics(\n id: \"model-flight-delays-pre\",\n body: {\n \"source\": {\n \"index\": [\n \"kibana_sample_data_flights\"\n ],\n \"query\": {\n \"range\": {\n \"DistanceKilometers\": {\n \"gt\": 0\n }\n }\n },\n \"_source\": {\n \"includes\": [],\n \"excludes\": [\n \"FlightDelay\",\n \"FlightDelayType\"\n ]\n }\n },\n \"dest\": {\n \"index\": \"df-flight-delays\",\n \"results_field\": \"ml-results\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"FlightDelayMin\",\n \"training_percent\": 90\n }\n },\n \"analyzed_fields\": {\n \"includes\": [],\n \"excludes\": [\n \"FlightNum\"\n ]\n },\n \"model_memory_limit\": \"100mb\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->putDataFrameAnalytics([\n \"id\" => \"model-flight-delays-pre\",\n \"body\" => [\n \"source\" => [\n \"index\" => array(\n \"kibana_sample_data_flights\",\n ),\n \"query\" => [\n \"range\" => [\n \"DistanceKilometers\" => [\n \"gt\" => 0,\n ],\n ],\n ],\n \"_source\" => [\n \"includes\" => array(\n ),\n \"excludes\" => array(\n \"FlightDelay\",\n \"FlightDelayType\",\n ),\n ],\n ],\n \"dest\" => [\n \"index\" => \"df-flight-delays\",\n \"results_field\" => \"ml-results\",\n ],\n \"analysis\" => [\n \"regression\" => [\n \"dependent_variable\" => \"FlightDelayMin\",\n \"training_percent\" => 90,\n ],\n ],\n \"analyzed_fields\" => [\n \"includes\" => array(\n ),\n \"excludes\" => array(\n \"FlightNum\",\n ),\n ],\n \"model_memory_limit\" => \"100mb\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":[\"kibana_sample_data_flights\"],\"query\":{\"range\":{\"DistanceKilometers\":{\"gt\":0}}},\"_source\":{\"includes\":[],\"excludes\":[\"FlightDelay\",\"FlightDelayType\"]}},\"dest\":{\"index\":\"df-flight-delays\",\"results_field\":\"ml-results\"},\"analysis\":{\"regression\":{\"dependent_variable\":\"FlightDelayMin\",\"training_percent\":90}},\"analyzed_fields\":{\"includes\":[],\"excludes\":[\"FlightNum\"]},\"model_memory_limit\":\"100mb\"}' \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/model-flight-delays-pre\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "delete": { @@ -32161,32 +22411,6 @@ } }, "x-state": "Generally available; Added in 7.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ml/data_frame/analytics/loganalytics\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.delete_data_frame_analytics(\n id=\"loganalytics\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.deleteDataFrameAnalytics({\n id: \"loganalytics\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.delete_data_frame_analytics(\n id: \"loganalytics\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->deleteDataFrameAnalytics([\n \"id\" => \"loganalytics\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -32215,32 +22439,6 @@ } }, "x-state": "Generally available; Added in 5.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/datafeeds/datafeed-high_sum_total_sales\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_datafeeds(\n datafeed_id=\"datafeed-high_sum_total_sales\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getDatafeeds({\n datafeed_id: \"datafeed-high_sum_total_sales\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_datafeeds(\n datafeed_id: \"datafeed-high_sum_total_sales\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getDatafeeds([\n \"datafeed_id\" => \"datafeed-high_sum_total_sales\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-high_sum_total_sales\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "put": { @@ -32451,32 +22649,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _ml/datafeeds/datafeed-test-job?pretty\n{\n \"indices\": [\n \"kibana_sample_data_logs\"\n ],\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n \"job_id\": \"test-job\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.put_datafeed(\n datafeed_id=\"datafeed-test-job\",\n pretty=True,\n indices=[\n \"kibana_sample_data_logs\"\n ],\n query={\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n job_id=\"test-job\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.putDatafeed({\n datafeed_id: \"datafeed-test-job\",\n pretty: \"true\",\n indices: [\"kibana_sample_data_logs\"],\n query: {\n bool: {\n must: [\n {\n match_all: {},\n },\n ],\n },\n },\n job_id: \"test-job\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.put_datafeed(\n datafeed_id: \"datafeed-test-job\",\n pretty: \"true\",\n body: {\n \"indices\": [\n \"kibana_sample_data_logs\"\n ],\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n \"job_id\": \"test-job\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->putDatafeed([\n \"datafeed_id\" => \"datafeed-test-job\",\n \"pretty\" => \"true\",\n \"body\" => [\n \"indices\" => array(\n \"kibana_sample_data_logs\",\n ),\n \"query\" => [\n \"bool\" => [\n \"must\" => array(\n [\n \"match_all\" => new ArrayObject([]),\n ],\n ),\n ],\n ],\n \"job_id\" => \"test-job\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"indices\":[\"kibana_sample_data_logs\"],\"query\":{\"bool\":{\"must\":[{\"match_all\":{}}]}},\"job_id\":\"test-job\"}' \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-test-job?pretty\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "delete": { @@ -32528,32 +22700,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ml/datafeeds/datafeed-total-requests\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.delete_datafeed(\n datafeed_id=\"datafeed-total-requests\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.deleteDatafeed({\n datafeed_id: \"datafeed-total-requests\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.delete_datafeed(\n datafeed_id: \"datafeed-total-requests\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->deleteDatafeed([\n \"datafeed_id\" => \"datafeed-total-requests\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-total-requests\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -32585,32 +22731,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ml/_delete_expired_data?timeout=1h\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.delete_expired_data(\n timeout=\"1h\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.deleteExpiredData({\n timeout: \"1h\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.delete_expired_data(\n timeout: \"1h\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->deleteExpiredData([\n \"timeout\" => \"1h\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/_delete_expired_data?timeout=1h\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -32639,32 +22759,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ml/_delete_expired_data?timeout=1h\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.delete_expired_data(\n timeout=\"1h\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.deleteExpiredData({\n timeout: \"1h\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.delete_expired_data(\n timeout: \"1h\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->deleteExpiredData([\n \"timeout\" => \"1h\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/_delete_expired_data?timeout=1h\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -32693,32 +22787,6 @@ } }, "x-state": "Generally available; Added in 5.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/filters/safe_domains\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_filters(\n filter_id=\"safe_domains\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getFilters({\n filter_id: \"safe_domains\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_filters(\n filter_id: \"safe_domains\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getFilters([\n \"filter_id\" => \"safe_domains\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/filters/safe_domains\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "put": { @@ -32802,32 +22870,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _ml/filters/safe_domains\n{\n \"description\": \"A list of safe domains\",\n \"items\": [\"*.google.com\", \"wikipedia.org\"]\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.put_filter(\n filter_id=\"safe_domains\",\n description=\"A list of safe domains\",\n items=[\n \"*.google.com\",\n \"wikipedia.org\"\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.putFilter({\n filter_id: \"safe_domains\",\n description: \"A list of safe domains\",\n items: [\"*.google.com\", \"wikipedia.org\"],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.put_filter(\n filter_id: \"safe_domains\",\n body: {\n \"description\": \"A list of safe domains\",\n \"items\": [\n \"*.google.com\",\n \"wikipedia.org\"\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->putFilter([\n \"filter_id\" => \"safe_domains\",\n \"body\" => [\n \"description\" => \"A list of safe domains\",\n \"items\" => array(\n \"*.google.com\",\n \"wikipedia.org\",\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"description\":\"A list of safe domains\",\"items\":[\"*.google.com\",\"wikipedia.org\"]}' \"$ELASTICSEARCH_URL/_ml/filters/safe_domains\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "delete": { @@ -32869,32 +22911,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ml/filters/safe_domains\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.delete_filter(\n filter_id=\"safe_domains\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.deleteFilter({\n filter_id: \"safe_domains\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.delete_filter(\n filter_id: \"safe_domains\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->deleteFilter([\n \"filter_id\" => \"safe_domains\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/filters/safe_domains\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -33001,32 +23017,6 @@ } }, "x-state": "Generally available; Added in 6.1.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/anomaly_detectors/low_request_rate/_forecast\n{\n \"duration\": \"10d\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.forecast(\n job_id=\"low_request_rate\",\n duration=\"10d\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.forecast({\n job_id: \"low_request_rate\",\n duration: \"10d\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.forecast(\n job_id: \"low_request_rate\",\n body: {\n \"duration\": \"10d\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->forecast([\n \"job_id\" => \"low_request_rate\",\n \"body\" => [\n \"duration\" => \"10d\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"duration\":\"10d\"}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/_forecast\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "delete": { @@ -33053,32 +23043,6 @@ } }, "x-state": "Generally available; Added in 6.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ml/anomaly_detectors/total-requests/_forecast/_all\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.delete_forecast(\n job_id=\"total-requests\",\n forecast_id=\"_all\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.deleteForecast({\n job_id: \"total-requests\",\n forecast_id: \"_all\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.delete_forecast(\n job_id: \"total-requests\",\n forecast_id: \"_all\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->deleteForecast([\n \"job_id\" => \"total-requests\",\n \"forecast_id\" => \"_all\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/total-requests/_forecast/_all\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -33110,32 +23074,6 @@ } }, "x-state": "Generally available; Added in 6.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ml/anomaly_detectors/total-requests/_forecast/_all\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.delete_forecast(\n job_id=\"total-requests\",\n forecast_id=\"_all\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.deleteForecast({\n job_id: \"total-requests\",\n forecast_id: \"_all\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.delete_forecast(\n job_id: \"total-requests\",\n forecast_id: \"_all\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->deleteForecast([\n \"job_id\" => \"total-requests\",\n \"forecast_id\" => \"_all\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/total-requests/_forecast/_all\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -33164,32 +23102,6 @@ } }, "x-state": "Generally available; Added in 5.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/high_sum_total_sales\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_jobs(\n job_id=\"high_sum_total_sales\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getJobs({\n job_id: \"high_sum_total_sales\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_jobs(\n job_id: \"high_sum_total_sales\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getJobs([\n \"job_id\" => \"high_sum_total_sales\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/high_sum_total_sales\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "put": { @@ -33429,32 +23341,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_ml/anomaly_detectors/job-01\n{\n \"analysis_config\": {\n \"bucket_span\": \"15m\",\n \"detectors\": [\n {\n \"detector_description\": \"Sum of bytes\",\n \"function\": \"sum\",\n \"field_name\": \"bytes\"\n }\n ]\n },\n \"data_description\": {\n \"time_field\": \"timestamp\",\n \"time_format\": \"epoch_ms\"\n },\n \"analysis_limits\": {\n \"model_memory_limit\": \"11MB\"\n },\n \"model_plot_config\": {\n \"enabled\": true,\n \"annotations_enabled\": true\n },\n \"results_index_name\": \"test-job1\",\n \"datafeed_config\": {\n \"indices\": [\n \"kibana_sample_data_logs\"\n ],\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n \"runtime_mappings\": {\n \"hour_of_day\": {\n \"type\": \"long\",\n \"script\": {\n \"source\": \"emit(doc['timestamp'].value.getHour());\"\n }\n }\n },\n \"datafeed_id\": \"datafeed-test-job1\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.put_job(\n job_id=\"job-01\",\n analysis_config={\n \"bucket_span\": \"15m\",\n \"detectors\": [\n {\n \"detector_description\": \"Sum of bytes\",\n \"function\": \"sum\",\n \"field_name\": \"bytes\"\n }\n ]\n },\n data_description={\n \"time_field\": \"timestamp\",\n \"time_format\": \"epoch_ms\"\n },\n analysis_limits={\n \"model_memory_limit\": \"11MB\"\n },\n model_plot_config={\n \"enabled\": True,\n \"annotations_enabled\": True\n },\n results_index_name=\"test-job1\",\n datafeed_config={\n \"indices\": [\n \"kibana_sample_data_logs\"\n ],\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n \"runtime_mappings\": {\n \"hour_of_day\": {\n \"type\": \"long\",\n \"script\": {\n \"source\": \"emit(doc['timestamp'].value.getHour());\"\n }\n }\n },\n \"datafeed_id\": \"datafeed-test-job1\"\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.putJob({\n job_id: \"job-01\",\n analysis_config: {\n bucket_span: \"15m\",\n detectors: [\n {\n detector_description: \"Sum of bytes\",\n function: \"sum\",\n field_name: \"bytes\",\n },\n ],\n },\n data_description: {\n time_field: \"timestamp\",\n time_format: \"epoch_ms\",\n },\n analysis_limits: {\n model_memory_limit: \"11MB\",\n },\n model_plot_config: {\n enabled: true,\n annotations_enabled: true,\n },\n results_index_name: \"test-job1\",\n datafeed_config: {\n indices: [\"kibana_sample_data_logs\"],\n query: {\n bool: {\n must: [\n {\n match_all: {},\n },\n ],\n },\n },\n runtime_mappings: {\n hour_of_day: {\n type: \"long\",\n script: {\n source: \"emit(doc['timestamp'].value.getHour());\",\n },\n },\n },\n datafeed_id: \"datafeed-test-job1\",\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.put_job(\n job_id: \"job-01\",\n body: {\n \"analysis_config\": {\n \"bucket_span\": \"15m\",\n \"detectors\": [\n {\n \"detector_description\": \"Sum of bytes\",\n \"function\": \"sum\",\n \"field_name\": \"bytes\"\n }\n ]\n },\n \"data_description\": {\n \"time_field\": \"timestamp\",\n \"time_format\": \"epoch_ms\"\n },\n \"analysis_limits\": {\n \"model_memory_limit\": \"11MB\"\n },\n \"model_plot_config\": {\n \"enabled\": true,\n \"annotations_enabled\": true\n },\n \"results_index_name\": \"test-job1\",\n \"datafeed_config\": {\n \"indices\": [\n \"kibana_sample_data_logs\"\n ],\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n \"runtime_mappings\": {\n \"hour_of_day\": {\n \"type\": \"long\",\n \"script\": {\n \"source\": \"emit(doc['timestamp'].value.getHour());\"\n }\n }\n },\n \"datafeed_id\": \"datafeed-test-job1\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->putJob([\n \"job_id\" => \"job-01\",\n \"body\" => [\n \"analysis_config\" => [\n \"bucket_span\" => \"15m\",\n \"detectors\" => array(\n [\n \"detector_description\" => \"Sum of bytes\",\n \"function\" => \"sum\",\n \"field_name\" => \"bytes\",\n ],\n ),\n ],\n \"data_description\" => [\n \"time_field\" => \"timestamp\",\n \"time_format\" => \"epoch_ms\",\n ],\n \"analysis_limits\" => [\n \"model_memory_limit\" => \"11MB\",\n ],\n \"model_plot_config\" => [\n \"enabled\" => true,\n \"annotations_enabled\" => true,\n ],\n \"results_index_name\" => \"test-job1\",\n \"datafeed_config\" => [\n \"indices\" => array(\n \"kibana_sample_data_logs\",\n ),\n \"query\" => [\n \"bool\" => [\n \"must\" => array(\n [\n \"match_all\" => new ArrayObject([]),\n ],\n ),\n ],\n ],\n \"runtime_mappings\" => [\n \"hour_of_day\" => [\n \"type\" => \"long\",\n \"script\" => [\n \"source\" => \"emit(doc['timestamp'].value.getHour());\",\n ],\n ],\n ],\n \"datafeed_id\" => \"datafeed-test-job1\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"analysis_config\":{\"bucket_span\":\"15m\",\"detectors\":[{\"detector_description\":\"Sum of bytes\",\"function\":\"sum\",\"field_name\":\"bytes\"}]},\"data_description\":{\"time_field\":\"timestamp\",\"time_format\":\"epoch_ms\"},\"analysis_limits\":{\"model_memory_limit\":\"11MB\"},\"model_plot_config\":{\"enabled\":true,\"annotations_enabled\":true},\"results_index_name\":\"test-job1\",\"datafeed_config\":{\"indices\":[\"kibana_sample_data_logs\"],\"query\":{\"bool\":{\"must\":[{\"match_all\":{}}]}},\"runtime_mappings\":{\"hour_of_day\":{\"type\":\"long\",\"script\":{\"source\":\"emit(doc['\"'\"'timestamp'\"'\"'].value.getHour());\"}}},\"datafeed_id\":\"datafeed-test-job1\"}}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/job-01\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "delete": { @@ -33532,32 +23418,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ml/anomaly_detectors/total-requests\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.delete_job(\n job_id=\"total-requests\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.deleteJob({\n job_id: \"total-requests\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.delete_job(\n job_id: \"total-requests\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->deleteJob([\n \"job_id\" => \"total-requests\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/total-requests\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -33604,32 +23464,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/high_sum_total_sales/model_snapshots\n{\n \"start\": \"1575402236000\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_model_snapshots(\n job_id=\"high_sum_total_sales\",\n start=\"1575402236000\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getModelSnapshots({\n job_id: \"high_sum_total_sales\",\n start: 1575402236000,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_model_snapshots(\n job_id: \"high_sum_total_sales\",\n body: {\n \"start\": \"1575402236000\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getModelSnapshots([\n \"job_id\" => \"high_sum_total_sales\",\n \"body\" => [\n \"start\" => \"1575402236000\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"start\":\"1575402236000\"}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/high_sum_total_sales/model_snapshots\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -33674,32 +23508,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/high_sum_total_sales/model_snapshots\n{\n \"start\": \"1575402236000\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_model_snapshots(\n job_id=\"high_sum_total_sales\",\n start=\"1575402236000\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getModelSnapshots({\n job_id: \"high_sum_total_sales\",\n start: 1575402236000,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_model_snapshots(\n job_id: \"high_sum_total_sales\",\n body: {\n \"start\": \"1575402236000\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getModelSnapshots([\n \"job_id\" => \"high_sum_total_sales\",\n \"body\" => [\n \"start\" => \"1575402236000\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"start\":\"1575402236000\"}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/high_sum_total_sales/model_snapshots\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "delete": { @@ -33752,32 +23560,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ml/anomaly_detectors/farequote/model_snapshots/1491948163\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.delete_model_snapshot(\n job_id=\"farequote\",\n snapshot_id=\"1491948163\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.deleteModelSnapshot({\n job_id: \"farequote\",\n snapshot_id: 1491948163,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.delete_model_snapshot(\n job_id: \"farequote\",\n snapshot_id: \"1491948163\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->deleteModelSnapshot([\n \"job_id\" => \"farequote\",\n \"snapshot_id\" => \"1491948163\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/farequote/model_snapshots/1491948163\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -33821,32 +23603,6 @@ } }, "x-state": "Generally available; Added in 7.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/trained_models/\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_trained_models()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getTrainedModels();" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_trained_models" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getTrainedModels();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/trained_models/\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "put": { @@ -34017,32 +23773,6 @@ } }, "x-state": "Generally available; Added in 7.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ml/trained_models/regression-job-one-1574775307356\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.delete_trained_model(\n model_id=\"regression-job-one-1574775307356\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.deleteTrainedModel({\n model_id: \"regression-job-one-1574775307356\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.delete_trained_model(\n model_id: \"regression-job-one-1574775307356\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->deleteTrainedModel([\n \"model_id\" => \"regression-job-one-1574775307356\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/trained_models/regression-job-one-1574775307356\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -34101,32 +23831,6 @@ } }, "x-state": "Generally available; Added in 7.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _ml/trained_models/flight-delay-prediction-1574775339910/model_aliases/flight_delay_model\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.put_trained_model_alias(\n model_id=\"flight-delay-prediction-1574775339910\",\n model_alias=\"flight_delay_model\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.putTrainedModelAlias({\n model_id: \"flight-delay-prediction-1574775339910\",\n model_alias: \"flight_delay_model\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.put_trained_model_alias(\n model_id: \"flight-delay-prediction-1574775339910\",\n model_alias: \"flight_delay_model\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->putTrainedModelAlias([\n \"model_id\" => \"flight-delay-prediction-1574775339910\",\n \"model_alias\" => \"flight_delay_model\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/trained_models/flight-delay-prediction-1574775339910/model_aliases/flight_delay_model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "delete": { @@ -34179,32 +23883,6 @@ } }, "x-state": "Generally available; Added in 7.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ml/trained_models/flight-delay-prediction-1574775339910/model_aliases/flight_delay_model\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.delete_trained_model_alias(\n model_id=\"flight-delay-prediction-1574775339910\",\n model_alias=\"flight_delay_model\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.deleteTrainedModelAlias({\n model_id: \"flight-delay-prediction-1574775339910\",\n model_alias: \"flight_delay_model\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.delete_trained_model_alias(\n model_id: \"flight-delay-prediction-1574775339910\",\n model_alias: \"flight_delay_model\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->deleteTrainedModelAlias([\n \"model_id\" => \"flight-delay-prediction-1574775339910\",\n \"model_alias\" => \"flight_delay_model\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/trained_models/flight-delay-prediction-1574775339910/model_aliases/flight_delay_model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -34278,32 +23956,6 @@ } }, "x-state": "Generally available; Added in 7.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/anomaly_detectors/_estimate_model_memory\n{\n \"analysis_config\": {\n \"bucket_span\": \"5m\",\n \"detectors\": [\n {\n \"function\": \"sum\",\n \"field_name\": \"bytes\",\n \"by_field_name\": \"status\",\n \"partition_field_name\": \"app\"\n }\n ],\n \"influencers\": [\n \"source_ip\",\n \"dest_ip\"\n ]\n },\n \"overall_cardinality\": {\n \"status\": 10,\n \"app\": 50\n },\n \"max_bucket_cardinality\": {\n \"source_ip\": 300,\n \"dest_ip\": 30\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.estimate_model_memory(\n analysis_config={\n \"bucket_span\": \"5m\",\n \"detectors\": [\n {\n \"function\": \"sum\",\n \"field_name\": \"bytes\",\n \"by_field_name\": \"status\",\n \"partition_field_name\": \"app\"\n }\n ],\n \"influencers\": [\n \"source_ip\",\n \"dest_ip\"\n ]\n },\n overall_cardinality={\n \"status\": 10,\n \"app\": 50\n },\n max_bucket_cardinality={\n \"source_ip\": 300,\n \"dest_ip\": 30\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.estimateModelMemory({\n analysis_config: {\n bucket_span: \"5m\",\n detectors: [\n {\n function: \"sum\",\n field_name: \"bytes\",\n by_field_name: \"status\",\n partition_field_name: \"app\",\n },\n ],\n influencers: [\"source_ip\", \"dest_ip\"],\n },\n overall_cardinality: {\n status: 10,\n app: 50,\n },\n max_bucket_cardinality: {\n source_ip: 300,\n dest_ip: 30,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.estimate_model_memory(\n body: {\n \"analysis_config\": {\n \"bucket_span\": \"5m\",\n \"detectors\": [\n {\n \"function\": \"sum\",\n \"field_name\": \"bytes\",\n \"by_field_name\": \"status\",\n \"partition_field_name\": \"app\"\n }\n ],\n \"influencers\": [\n \"source_ip\",\n \"dest_ip\"\n ]\n },\n \"overall_cardinality\": {\n \"status\": 10,\n \"app\": 50\n },\n \"max_bucket_cardinality\": {\n \"source_ip\": 300,\n \"dest_ip\": 30\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->estimateModelMemory([\n \"body\" => [\n \"analysis_config\" => [\n \"bucket_span\" => \"5m\",\n \"detectors\" => array(\n [\n \"function\" => \"sum\",\n \"field_name\" => \"bytes\",\n \"by_field_name\" => \"status\",\n \"partition_field_name\" => \"app\",\n ],\n ),\n \"influencers\" => array(\n \"source_ip\",\n \"dest_ip\",\n ),\n ],\n \"overall_cardinality\" => [\n \"status\" => 10,\n \"app\" => 50,\n ],\n \"max_bucket_cardinality\" => [\n \"source_ip\" => 300,\n \"dest_ip\" => 30,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"analysis_config\":{\"bucket_span\":\"5m\",\"detectors\":[{\"function\":\"sum\",\"field_name\":\"bytes\",\"by_field_name\":\"status\",\"partition_field_name\":\"app\"}],\"influencers\":[\"source_ip\",\"dest_ip\"]},\"overall_cardinality\":{\"status\":10,\"app\":50},\"max_bucket_cardinality\":{\"source_ip\":300,\"dest_ip\":30}}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/_estimate_model_memory\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -34408,32 +24060,6 @@ } }, "x-state": "Generally available; Added in 7.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/data_frame/_evaluate\n{\n \"index\": \"animal_classification\",\n \"evaluation\": {\n \"classification\": {\n \"actual_field\": \"animal_class\",\n \"predicted_field\": \"ml.animal_class_prediction\",\n \"metrics\": {\n \"multiclass_confusion_matrix\": {}\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.evaluate_data_frame(\n index=\"animal_classification\",\n evaluation={\n \"classification\": {\n \"actual_field\": \"animal_class\",\n \"predicted_field\": \"ml.animal_class_prediction\",\n \"metrics\": {\n \"multiclass_confusion_matrix\": {}\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.evaluateDataFrame({\n index: \"animal_classification\",\n evaluation: {\n classification: {\n actual_field: \"animal_class\",\n predicted_field: \"ml.animal_class_prediction\",\n metrics: {\n multiclass_confusion_matrix: {},\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.evaluate_data_frame(\n body: {\n \"index\": \"animal_classification\",\n \"evaluation\": {\n \"classification\": {\n \"actual_field\": \"animal_class\",\n \"predicted_field\": \"ml.animal_class_prediction\",\n \"metrics\": {\n \"multiclass_confusion_matrix\": {}\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->evaluateDataFrame([\n \"body\" => [\n \"index\" => \"animal_classification\",\n \"evaluation\" => [\n \"classification\" => [\n \"actual_field\" => \"animal_class\",\n \"predicted_field\" => \"ml.animal_class_prediction\",\n \"metrics\" => [\n \"multiclass_confusion_matrix\" => new ArrayObject([]),\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index\":\"animal_classification\",\"evaluation\":{\"classification\":{\"actual_field\":\"animal_class\",\"predicted_field\":\"ml.animal_class_prediction\",\"metrics\":{\"multiclass_confusion_matrix\":{}}}}}' \"$ELASTICSEARCH_URL/_ml/data_frame/_evaluate\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -34454,32 +24080,6 @@ } }, "x-state": "Generally available; Added in 7.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/data_frame/analytics/_explain\n{\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.explain_data_frame_analytics(\n source={\n \"index\": \"houses_sold_last_10_yrs\"\n },\n analysis={\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.explainDataFrameAnalytics({\n source: {\n index: \"houses_sold_last_10_yrs\",\n },\n analysis: {\n regression: {\n dependent_variable: \"price\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.explain_data_frame_analytics(\n body: {\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->explainDataFrameAnalytics([\n \"body\" => [\n \"source\" => [\n \"index\" => \"houses_sold_last_10_yrs\",\n ],\n \"analysis\" => [\n \"regression\" => [\n \"dependent_variable\" => \"price\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"houses_sold_last_10_yrs\"},\"analysis\":{\"regression\":{\"dependent_variable\":\"price\"}}}' \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/_explain\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -34498,32 +24098,6 @@ } }, "x-state": "Generally available; Added in 7.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/data_frame/analytics/_explain\n{\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.explain_data_frame_analytics(\n source={\n \"index\": \"houses_sold_last_10_yrs\"\n },\n analysis={\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.explainDataFrameAnalytics({\n source: {\n index: \"houses_sold_last_10_yrs\",\n },\n analysis: {\n regression: {\n dependent_variable: \"price\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.explain_data_frame_analytics(\n body: {\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->explainDataFrameAnalytics([\n \"body\" => [\n \"source\" => [\n \"index\" => \"houses_sold_last_10_yrs\",\n ],\n \"analysis\" => [\n \"regression\" => [\n \"dependent_variable\" => \"price\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"houses_sold_last_10_yrs\"},\"analysis\":{\"regression\":{\"dependent_variable\":\"price\"}}}' \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/_explain\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -34549,32 +24123,6 @@ } }, "x-state": "Generally available; Added in 7.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/data_frame/analytics/_explain\n{\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.explain_data_frame_analytics(\n source={\n \"index\": \"houses_sold_last_10_yrs\"\n },\n analysis={\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.explainDataFrameAnalytics({\n source: {\n index: \"houses_sold_last_10_yrs\",\n },\n analysis: {\n regression: {\n dependent_variable: \"price\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.explain_data_frame_analytics(\n body: {\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->explainDataFrameAnalytics([\n \"body\" => [\n \"source\" => [\n \"index\" => \"houses_sold_last_10_yrs\",\n ],\n \"analysis\" => [\n \"regression\" => [\n \"dependent_variable\" => \"price\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"houses_sold_last_10_yrs\"},\"analysis\":{\"regression\":{\"dependent_variable\":\"price\"}}}' \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/_explain\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -34598,32 +24146,6 @@ } }, "x-state": "Generally available; Added in 7.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/data_frame/analytics/_explain\n{\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.explain_data_frame_analytics(\n source={\n \"index\": \"houses_sold_last_10_yrs\"\n },\n analysis={\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.explainDataFrameAnalytics({\n source: {\n index: \"houses_sold_last_10_yrs\",\n },\n analysis: {\n regression: {\n dependent_variable: \"price\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.explain_data_frame_analytics(\n body: {\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->explainDataFrameAnalytics([\n \"body\" => [\n \"source\" => [\n \"index\" => \"houses_sold_last_10_yrs\",\n ],\n \"analysis\" => [\n \"regression\" => [\n \"dependent_variable\" => \"price\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"houses_sold_last_10_yrs\"},\"analysis\":{\"regression\":{\"dependent_variable\":\"price\"}}}' \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/_explain\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -34756,32 +24278,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/anomaly_detectors/low_request_rate/_flush\n{\n \"calc_interim\": true\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.flush_job(\n job_id=\"low_request_rate\",\n calc_interim=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.flushJob({\n job_id: \"low_request_rate\",\n calc_interim: true,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.flush_job(\n job_id: \"low_request_rate\",\n body: {\n \"calc_interim\": true\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->flushJob([\n \"job_id\" => \"low_request_rate\",\n \"body\" => [\n \"calc_interim\" => true,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"calc_interim\":true}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/_flush\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -34837,32 +24333,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/low_request_rate/results/buckets\n{\n \"anomaly_score\": 80,\n \"start\": \"1454530200001\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_buckets(\n job_id=\"low_request_rate\",\n anomaly_score=80,\n start=\"1454530200001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getBuckets({\n job_id: \"low_request_rate\",\n anomaly_score: 80,\n start: 1454530200001,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_buckets(\n job_id: \"low_request_rate\",\n body: {\n \"anomaly_score\": 80,\n \"start\": \"1454530200001\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getBuckets([\n \"job_id\" => \"low_request_rate\",\n \"body\" => [\n \"anomaly_score\" => 80,\n \"start\" => \"1454530200001\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"anomaly_score\":80,\"start\":\"1454530200001\"}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/results/buckets\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -34916,32 +24386,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/low_request_rate/results/buckets\n{\n \"anomaly_score\": 80,\n \"start\": \"1454530200001\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_buckets(\n job_id=\"low_request_rate\",\n anomaly_score=80,\n start=\"1454530200001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getBuckets({\n job_id: \"low_request_rate\",\n anomaly_score: 80,\n start: 1454530200001,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_buckets(\n job_id: \"low_request_rate\",\n body: {\n \"anomaly_score\": 80,\n \"start\": \"1454530200001\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getBuckets([\n \"job_id\" => \"low_request_rate\",\n \"body\" => [\n \"anomaly_score\" => 80,\n \"start\" => \"1454530200001\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"anomaly_score\":80,\"start\":\"1454530200001\"}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/results/buckets\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -34994,32 +24438,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/low_request_rate/results/buckets\n{\n \"anomaly_score\": 80,\n \"start\": \"1454530200001\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_buckets(\n job_id=\"low_request_rate\",\n anomaly_score=80,\n start=\"1454530200001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getBuckets({\n job_id: \"low_request_rate\",\n anomaly_score: 80,\n start: 1454530200001,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_buckets(\n job_id: \"low_request_rate\",\n body: {\n \"anomaly_score\": 80,\n \"start\": \"1454530200001\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getBuckets([\n \"job_id\" => \"low_request_rate\",\n \"body\" => [\n \"anomaly_score\" => 80,\n \"start\" => \"1454530200001\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"anomaly_score\":80,\"start\":\"1454530200001\"}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/results/buckets\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -35070,32 +24488,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/low_request_rate/results/buckets\n{\n \"anomaly_score\": 80,\n \"start\": \"1454530200001\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_buckets(\n job_id=\"low_request_rate\",\n anomaly_score=80,\n start=\"1454530200001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getBuckets({\n job_id: \"low_request_rate\",\n anomaly_score: 80,\n start: 1454530200001,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_buckets(\n job_id: \"low_request_rate\",\n body: {\n \"anomaly_score\": 80,\n \"start\": \"1454530200001\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getBuckets([\n \"job_id\" => \"low_request_rate\",\n \"body\" => [\n \"anomaly_score\" => 80,\n \"start\" => \"1454530200001\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"anomaly_score\":80,\"start\":\"1454530200001\"}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/results/buckets\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -35198,32 +24590,6 @@ } }, "x-state": "Generally available; Added in 6.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/calendars/planned-outages/events\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_calendar_events(\n calendar_id=\"planned-outages\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getCalendarEvents({\n calendar_id: \"planned-outages\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_calendar_events(\n calendar_id: \"planned-outages\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getCalendarEvents([\n \"calendar_id\" => \"planned-outages\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/calendars/planned-outages/events\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -35298,32 +24664,6 @@ } }, "x-state": "Generally available; Added in 6.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/calendars/planned-outages/events\n{\n \"events\" : [\n {\"description\": \"event 1\", \"start_time\": 1513641600000, \"end_time\": 1513728000000},\n {\"description\": \"event 2\", \"start_time\": 1513814400000, \"end_time\": 1513900800000},\n {\"description\": \"event 3\", \"start_time\": 1514160000000, \"end_time\": 1514246400000}\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.post_calendar_events(\n calendar_id=\"planned-outages\",\n events=[\n {\n \"description\": \"event 1\",\n \"start_time\": 1513641600000,\n \"end_time\": 1513728000000\n },\n {\n \"description\": \"event 2\",\n \"start_time\": 1513814400000,\n \"end_time\": 1513900800000\n },\n {\n \"description\": \"event 3\",\n \"start_time\": 1514160000000,\n \"end_time\": 1514246400000\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.postCalendarEvents({\n calendar_id: \"planned-outages\",\n events: [\n {\n description: \"event 1\",\n start_time: 1513641600000,\n end_time: 1513728000000,\n },\n {\n description: \"event 2\",\n start_time: 1513814400000,\n end_time: 1513900800000,\n },\n {\n description: \"event 3\",\n start_time: 1514160000000,\n end_time: 1514246400000,\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.post_calendar_events(\n calendar_id: \"planned-outages\",\n body: {\n \"events\": [\n {\n \"description\": \"event 1\",\n \"start_time\": 1513641600000,\n \"end_time\": 1513728000000\n },\n {\n \"description\": \"event 2\",\n \"start_time\": 1513814400000,\n \"end_time\": 1513900800000\n },\n {\n \"description\": \"event 3\",\n \"start_time\": 1514160000000,\n \"end_time\": 1514246400000\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->postCalendarEvents([\n \"calendar_id\" => \"planned-outages\",\n \"body\" => [\n \"events\" => array(\n [\n \"description\" => \"event 1\",\n \"start_time\" => 1513641600000,\n \"end_time\" => 1513728000000,\n ],\n [\n \"description\" => \"event 2\",\n \"start_time\" => 1513814400000,\n \"end_time\" => 1513900800000,\n ],\n [\n \"description\" => \"event 3\",\n \"start_time\" => 1514160000000,\n \"end_time\" => 1514246400000,\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"events\":[{\"description\":\"event 1\",\"start_time\":1513641600000,\"end_time\":1513728000000},{\"description\":\"event 2\",\"start_time\":1513814400000,\"end_time\":1513900800000},{\"description\":\"event 3\",\"start_time\":1514160000000,\"end_time\":1514246400000}]}' \"$ELASTICSEARCH_URL/_ml/calendars/planned-outages/events\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -35352,32 +24692,6 @@ } }, "x-state": "Generally available; Added in 6.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/calendars/planned-outages\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_calendars(\n calendar_id=\"planned-outages\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getCalendars({\n calendar_id: \"planned-outages\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_calendars(\n calendar_id: \"planned-outages\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getCalendars([\n \"calendar_id\" => \"planned-outages\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/calendars/planned-outages\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -35404,32 +24718,6 @@ } }, "x-state": "Generally available; Added in 6.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/calendars/planned-outages\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_calendars(\n calendar_id=\"planned-outages\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getCalendars({\n calendar_id: \"planned-outages\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_calendars(\n calendar_id: \"planned-outages\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getCalendars([\n \"calendar_id\" => \"planned-outages\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/calendars/planned-outages\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -35467,32 +24755,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/esxi_log/results/categories\n{\n \"page\":{\n \"size\": 1\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_categories(\n job_id=\"esxi_log\",\n page={\n \"size\": 1\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getCategories({\n job_id: \"esxi_log\",\n page: {\n size: 1,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_categories(\n job_id: \"esxi_log\",\n body: {\n \"page\": {\n \"size\": 1\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getCategories([\n \"job_id\" => \"esxi_log\",\n \"body\" => [\n \"page\" => [\n \"size\" => 1,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"page\":{\"size\":1}}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/esxi_log/results/categories\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -35528,32 +24790,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/esxi_log/results/categories\n{\n \"page\":{\n \"size\": 1\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_categories(\n job_id=\"esxi_log\",\n page={\n \"size\": 1\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getCategories({\n job_id: \"esxi_log\",\n page: {\n size: 1,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_categories(\n job_id: \"esxi_log\",\n body: {\n \"page\": {\n \"size\": 1\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getCategories([\n \"job_id\" => \"esxi_log\",\n \"body\" => [\n \"page\" => [\n \"size\" => 1,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"page\":{\"size\":1}}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/esxi_log/results/categories\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -35588,32 +24824,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/esxi_log/results/categories\n{\n \"page\":{\n \"size\": 1\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_categories(\n job_id=\"esxi_log\",\n page={\n \"size\": 1\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getCategories({\n job_id: \"esxi_log\",\n page: {\n size: 1,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_categories(\n job_id: \"esxi_log\",\n body: {\n \"page\": {\n \"size\": 1\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getCategories([\n \"job_id\" => \"esxi_log\",\n \"body\" => [\n \"page\" => [\n \"size\" => 1,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"page\":{\"size\":1}}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/esxi_log/results/categories\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -35646,32 +24856,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/esxi_log/results/categories\n{\n \"page\":{\n \"size\": 1\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_categories(\n job_id=\"esxi_log\",\n page={\n \"size\": 1\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getCategories({\n job_id: \"esxi_log\",\n page: {\n size: 1,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_categories(\n job_id: \"esxi_log\",\n body: {\n \"page\": {\n \"size\": 1\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getCategories([\n \"job_id\" => \"esxi_log\",\n \"body\" => [\n \"page\" => [\n \"size\" => 1,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"page\":{\"size\":1}}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/esxi_log/results/categories\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -35703,32 +24887,6 @@ } }, "x-state": "Generally available; Added in 7.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/data_frame/analytics/loganalytics\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_data_frame_analytics(\n id=\"loganalytics\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getDataFrameAnalytics({\n id: \"loganalytics\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_data_frame_analytics(\n id: \"loganalytics\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getDataFrameAnalytics([\n \"id\" => \"loganalytics\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -35760,32 +24918,6 @@ } }, "x-state": "Generally available; Added in 7.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/data_frame/analytics/weblog-outliers/_stats\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_data_frame_analytics_stats(\n id=\"weblog-outliers\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getDataFrameAnalyticsStats({\n id: \"weblog-outliers\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_data_frame_analytics_stats(\n id: \"weblog-outliers\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getDataFrameAnalyticsStats([\n \"id\" => \"weblog-outliers\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/weblog-outliers/_stats\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -35820,32 +24952,6 @@ } }, "x-state": "Generally available; Added in 7.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/data_frame/analytics/weblog-outliers/_stats\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_data_frame_analytics_stats(\n id=\"weblog-outliers\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getDataFrameAnalyticsStats({\n id: \"weblog-outliers\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_data_frame_analytics_stats(\n id: \"weblog-outliers\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getDataFrameAnalyticsStats([\n \"id\" => \"weblog-outliers\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/weblog-outliers/_stats\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -35871,32 +24977,6 @@ } }, "x-state": "Generally available; Added in 5.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/datafeeds/datafeed-high_sum_total_sales/_stats\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_datafeed_stats(\n datafeed_id=\"datafeed-high_sum_total_sales\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getDatafeedStats({\n datafeed_id: \"datafeed-high_sum_total_sales\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_datafeed_stats(\n datafeed_id: \"datafeed-high_sum_total_sales\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getDatafeedStats([\n \"datafeed_id\" => \"datafeed-high_sum_total_sales\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-high_sum_total_sales/_stats\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -35919,32 +24999,6 @@ } }, "x-state": "Generally available; Added in 5.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/datafeeds/datafeed-high_sum_total_sales/_stats\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_datafeed_stats(\n datafeed_id=\"datafeed-high_sum_total_sales\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getDatafeedStats({\n datafeed_id: \"datafeed-high_sum_total_sales\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_datafeed_stats(\n datafeed_id: \"datafeed-high_sum_total_sales\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getDatafeedStats([\n \"datafeed_id\" => \"datafeed-high_sum_total_sales\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-high_sum_total_sales/_stats\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -35970,32 +25024,6 @@ } }, "x-state": "Generally available; Added in 5.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/datafeeds/datafeed-high_sum_total_sales\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_datafeeds(\n datafeed_id=\"datafeed-high_sum_total_sales\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getDatafeeds({\n datafeed_id: \"datafeed-high_sum_total_sales\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_datafeeds(\n datafeed_id: \"datafeed-high_sum_total_sales\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getDatafeeds([\n \"datafeed_id\" => \"datafeed-high_sum_total_sales\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-high_sum_total_sales\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -36021,32 +25049,6 @@ } }, "x-state": "Generally available; Added in 5.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/filters/safe_domains\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_filters(\n filter_id=\"safe_domains\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getFilters({\n filter_id: \"safe_domains\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_filters(\n filter_id: \"safe_domains\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getFilters([\n \"filter_id\" => \"safe_domains\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/filters/safe_domains\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -36096,32 +25098,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/high_sum_total_sales/results/influencers\n{\n \"sort\": \"influencer_score\",\n \"desc\": true\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_influencers(\n job_id=\"high_sum_total_sales\",\n sort=\"influencer_score\",\n desc=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getInfluencers({\n job_id: \"high_sum_total_sales\",\n sort: \"influencer_score\",\n desc: true,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_influencers(\n job_id: \"high_sum_total_sales\",\n body: {\n \"sort\": \"influencer_score\",\n \"desc\": true\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getInfluencers([\n \"job_id\" => \"high_sum_total_sales\",\n \"body\" => [\n \"sort\" => \"influencer_score\",\n \"desc\" => true,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"sort\":\"influencer_score\",\"desc\":true}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/high_sum_total_sales/results/influencers\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -36169,32 +25145,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/high_sum_total_sales/results/influencers\n{\n \"sort\": \"influencer_score\",\n \"desc\": true\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_influencers(\n job_id=\"high_sum_total_sales\",\n sort=\"influencer_score\",\n desc=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getInfluencers({\n job_id: \"high_sum_total_sales\",\n sort: \"influencer_score\",\n desc: true,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_influencers(\n job_id: \"high_sum_total_sales\",\n body: {\n \"sort\": \"influencer_score\",\n \"desc\": true\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getInfluencers([\n \"job_id\" => \"high_sum_total_sales\",\n \"body\" => [\n \"sort\" => \"influencer_score\",\n \"desc\" => true,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"sort\":\"influencer_score\",\"desc\":true}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/high_sum_total_sales/results/influencers\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -36217,32 +25167,6 @@ } }, "x-state": "Generally available; Added in 5.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/low_request_rate/_stats\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_job_stats(\n job_id=\"low_request_rate\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getJobStats({\n job_id: \"low_request_rate\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_job_stats(\n job_id: \"low_request_rate\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getJobStats([\n \"job_id\" => \"low_request_rate\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/_stats\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -36268,32 +25192,6 @@ } }, "x-state": "Generally available; Added in 5.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/low_request_rate/_stats\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_job_stats(\n job_id=\"low_request_rate\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getJobStats({\n job_id: \"low_request_rate\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_job_stats(\n job_id: \"low_request_rate\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getJobStats([\n \"job_id\" => \"low_request_rate\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/_stats\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -36319,32 +25217,6 @@ } }, "x-state": "Generally available; Added in 5.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/high_sum_total_sales\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_jobs(\n job_id=\"high_sum_total_sales\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getJobs({\n job_id: \"high_sum_total_sales\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_jobs(\n job_id: \"high_sum_total_sales\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getJobs([\n \"job_id\" => \"high_sum_total_sales\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/high_sum_total_sales\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -36370,32 +25242,6 @@ } }, "x-state": "Generally available; Added in 8.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/memory/_stats?human\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_memory_stats(\n human=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getMemoryStats({\n human: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_memory_stats(\n human: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getMemoryStats([\n \"human\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/memory/_stats?human\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -36424,32 +25270,6 @@ } }, "x-state": "Generally available; Added in 8.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/memory/_stats?human\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_memory_stats(\n human=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getMemoryStats({\n human: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_memory_stats(\n human: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getMemoryStats([\n \"human\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/memory/_stats?human\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -36523,32 +25343,6 @@ } }, "x-state": "Generally available; Added in 7.16.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/low_request_rate/model_snapshots/_all/_upgrade/_stats\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_model_snapshot_upgrade_stats(\n job_id=\"low_request_rate\",\n snapshot_id=\"_all\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getModelSnapshotUpgradeStats({\n job_id: \"low_request_rate\",\n snapshot_id: \"_all\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_model_snapshot_upgrade_stats(\n job_id: \"low_request_rate\",\n snapshot_id: \"_all\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getModelSnapshotUpgradeStats([\n \"job_id\" => \"low_request_rate\",\n \"snapshot_id\" => \"_all\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/model_snapshots/_all/_upgrade/_stats\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -36592,32 +25386,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/high_sum_total_sales/model_snapshots\n{\n \"start\": \"1575402236000\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_model_snapshots(\n job_id=\"high_sum_total_sales\",\n start=\"1575402236000\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getModelSnapshots({\n job_id: \"high_sum_total_sales\",\n start: 1575402236000,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_model_snapshots(\n job_id: \"high_sum_total_sales\",\n body: {\n \"start\": \"1575402236000\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getModelSnapshots([\n \"job_id\" => \"high_sum_total_sales\",\n \"body\" => [\n \"start\" => \"1575402236000\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"start\":\"1575402236000\"}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/high_sum_total_sales/model_snapshots\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -36659,32 +25427,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/high_sum_total_sales/model_snapshots\n{\n \"start\": \"1575402236000\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_model_snapshots(\n job_id=\"high_sum_total_sales\",\n start=\"1575402236000\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getModelSnapshots({\n job_id: \"high_sum_total_sales\",\n start: 1575402236000,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_model_snapshots(\n job_id: \"high_sum_total_sales\",\n body: {\n \"start\": \"1575402236000\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getModelSnapshots([\n \"job_id\" => \"high_sum_total_sales\",\n \"body\" => [\n \"start\" => \"1575402236000\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"start\":\"1575402236000\"}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/high_sum_total_sales/model_snapshots\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -36731,32 +25473,6 @@ } }, "x-state": "Generally available; Added in 6.1.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/job-*/results/overall_buckets\n{\n \"overall_score\": 80,\n \"start\": \"1403532000000\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_overall_buckets(\n job_id=\"job-*\",\n overall_score=80,\n start=\"1403532000000\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getOverallBuckets({\n job_id: \"job-*\",\n overall_score: 80,\n start: 1403532000000,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_overall_buckets(\n job_id: \"job-*\",\n body: {\n \"overall_score\": 80,\n \"start\": \"1403532000000\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getOverallBuckets([\n \"job_id\" => \"job-*\",\n \"body\" => [\n \"overall_score\" => 80,\n \"start\" => \"1403532000000\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"overall_score\":80,\"start\":\"1403532000000\"}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/job-*/results/overall_buckets\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -36801,32 +25517,6 @@ } }, "x-state": "Generally available; Added in 6.1.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/job-*/results/overall_buckets\n{\n \"overall_score\": 80,\n \"start\": \"1403532000000\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_overall_buckets(\n job_id=\"job-*\",\n overall_score=80,\n start=\"1403532000000\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getOverallBuckets({\n job_id: \"job-*\",\n overall_score: 80,\n start: 1403532000000,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_overall_buckets(\n job_id: \"job-*\",\n body: {\n \"overall_score\": 80,\n \"start\": \"1403532000000\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getOverallBuckets([\n \"job_id\" => \"job-*\",\n \"body\" => [\n \"overall_score\" => 80,\n \"start\" => \"1403532000000\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"overall_score\":80,\"start\":\"1403532000000\"}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/job-*/results/overall_buckets\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -36876,32 +25566,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/low_request_rate/results/records\n{\n \"sort\": \"record_score\",\n \"desc\": true,\n \"start\": \"1454944100000\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_records(\n job_id=\"low_request_rate\",\n sort=\"record_score\",\n desc=True,\n start=\"1454944100000\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getRecords({\n job_id: \"low_request_rate\",\n sort: \"record_score\",\n desc: true,\n start: 1454944100000,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_records(\n job_id: \"low_request_rate\",\n body: {\n \"sort\": \"record_score\",\n \"desc\": true,\n \"start\": \"1454944100000\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getRecords([\n \"job_id\" => \"low_request_rate\",\n \"body\" => [\n \"sort\" => \"record_score\",\n \"desc\" => true,\n \"start\" => \"1454944100000\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"sort\":\"record_score\",\"desc\":true,\"start\":\"1454944100000\"}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/results/records\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -36949,32 +25613,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/low_request_rate/results/records\n{\n \"sort\": \"record_score\",\n \"desc\": true,\n \"start\": \"1454944100000\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_records(\n job_id=\"low_request_rate\",\n sort=\"record_score\",\n desc=True,\n start=\"1454944100000\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getRecords({\n job_id: \"low_request_rate\",\n sort: \"record_score\",\n desc: true,\n start: 1454944100000,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_records(\n job_id: \"low_request_rate\",\n body: {\n \"sort\": \"record_score\",\n \"desc\": true,\n \"start\": \"1454944100000\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getRecords([\n \"job_id\" => \"low_request_rate\",\n \"body\" => [\n \"sort\" => \"record_score\",\n \"desc\" => true,\n \"start\" => \"1454944100000\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"sort\":\"record_score\",\"desc\":true,\"start\":\"1454944100000\"}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/results/records\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -37015,32 +25653,6 @@ } }, "x-state": "Generally available; Added in 7.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/trained_models/\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_trained_models()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getTrainedModels();" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_trained_models" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getTrainedModels();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/trained_models/\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -37072,32 +25684,6 @@ } }, "x-state": "Generally available; Added in 7.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/trained_models/_stats\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_trained_models_stats()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getTrainedModelsStats();" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_trained_models_stats" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getTrainedModelsStats();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/trained_models/_stats\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -37126,32 +25712,6 @@ } }, "x-state": "Generally available; Added in 7.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/trained_models/_stats\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_trained_models_stats()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getTrainedModelsStats();" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_trained_models_stats" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getTrainedModelsStats();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/trained_models/_stats\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -37243,32 +25803,6 @@ } }, "x-state": "Generally available; Added in 8.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/trained_models/lang_ident_model_1/_infer\n{\n \"docs\":[{\"text\": \"The fool doth think he is wise, but the wise man knows himself to be a fool.\"}]\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.infer_trained_model(\n model_id=\"lang_ident_model_1\",\n docs=[\n {\n \"text\": \"The fool doth think he is wise, but the wise man knows himself to be a fool.\"\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.inferTrainedModel({\n model_id: \"lang_ident_model_1\",\n docs: [\n {\n text: \"The fool doth think he is wise, but the wise man knows himself to be a fool.\",\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.infer_trained_model(\n model_id: \"lang_ident_model_1\",\n body: {\n \"docs\": [\n {\n \"text\": \"The fool doth think he is wise, but the wise man knows himself to be a fool.\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->inferTrainedModel([\n \"model_id\" => \"lang_ident_model_1\",\n \"body\" => [\n \"docs\" => array(\n [\n \"text\" => \"The fool doth think he is wise, but the wise man knows himself to be a fool.\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"docs\":[{\"text\":\"The fool doth think he is wise, but the wise man knows himself to be a fool.\"}]}' \"$ELASTICSEARCH_URL/_ml/trained_models/lang_ident_model_1/_infer\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -37313,32 +25847,6 @@ } }, "x-state": "Generally available; Added in 6.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/info\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.info()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.info();" - }, - { - "lang": "Ruby", - "source": "response = client.ml.info" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->info();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/info\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -37424,32 +25932,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_ml/anomaly_detectors/job-01/_open\n{\n \"timeout\": \"35m\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.open_job(\n job_id=\"job-01\",\n timeout=\"35m\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.openJob({\n job_id: \"job-01\",\n timeout: \"35m\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.open_job(\n job_id: \"job-01\",\n body: {\n \"timeout\": \"35m\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->openJob([\n \"job_id\" => \"job-01\",\n \"body\" => [\n \"timeout\" => \"35m\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"timeout\":\"35m\"}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/job-01/_open\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -37611,32 +26093,6 @@ } }, "x-state": "Generally available; Added in 7.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/data_frame/analytics/_preview\n{\n \"config\": {\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.preview_data_frame_analytics(\n config={\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.previewDataFrameAnalytics({\n config: {\n source: {\n index: \"houses_sold_last_10_yrs\",\n },\n analysis: {\n regression: {\n dependent_variable: \"price\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.preview_data_frame_analytics(\n body: {\n \"config\": {\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->previewDataFrameAnalytics([\n \"body\" => [\n \"config\" => [\n \"source\" => [\n \"index\" => \"houses_sold_last_10_yrs\",\n ],\n \"analysis\" => [\n \"regression\" => [\n \"dependent_variable\" => \"price\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"config\":{\"source\":{\"index\":\"houses_sold_last_10_yrs\"},\"analysis\":{\"regression\":{\"dependent_variable\":\"price\"}}}}' \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/_preview\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -37655,32 +26111,6 @@ } }, "x-state": "Generally available; Added in 7.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/data_frame/analytics/_preview\n{\n \"config\": {\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.preview_data_frame_analytics(\n config={\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.previewDataFrameAnalytics({\n config: {\n source: {\n index: \"houses_sold_last_10_yrs\",\n },\n analysis: {\n regression: {\n dependent_variable: \"price\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.preview_data_frame_analytics(\n body: {\n \"config\": {\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->previewDataFrameAnalytics([\n \"body\" => [\n \"config\" => [\n \"source\" => [\n \"index\" => \"houses_sold_last_10_yrs\",\n ],\n \"analysis\" => [\n \"regression\" => [\n \"dependent_variable\" => \"price\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"config\":{\"source\":{\"index\":\"houses_sold_last_10_yrs\"},\"analysis\":{\"regression\":{\"dependent_variable\":\"price\"}}}}' \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/_preview\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -37706,32 +26136,6 @@ } }, "x-state": "Generally available; Added in 7.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/data_frame/analytics/_preview\n{\n \"config\": {\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.preview_data_frame_analytics(\n config={\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.previewDataFrameAnalytics({\n config: {\n source: {\n index: \"houses_sold_last_10_yrs\",\n },\n analysis: {\n regression: {\n dependent_variable: \"price\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.preview_data_frame_analytics(\n body: {\n \"config\": {\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->previewDataFrameAnalytics([\n \"body\" => [\n \"config\" => [\n \"source\" => [\n \"index\" => \"houses_sold_last_10_yrs\",\n ],\n \"analysis\" => [\n \"regression\" => [\n \"dependent_variable\" => \"price\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"config\":{\"source\":{\"index\":\"houses_sold_last_10_yrs\"},\"analysis\":{\"regression\":{\"dependent_variable\":\"price\"}}}}' \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/_preview\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -37755,32 +26159,6 @@ } }, "x-state": "Generally available; Added in 7.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/data_frame/analytics/_preview\n{\n \"config\": {\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.preview_data_frame_analytics(\n config={\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.previewDataFrameAnalytics({\n config: {\n source: {\n index: \"houses_sold_last_10_yrs\",\n },\n analysis: {\n regression: {\n dependent_variable: \"price\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.preview_data_frame_analytics(\n body: {\n \"config\": {\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->previewDataFrameAnalytics([\n \"body\" => [\n \"config\" => [\n \"source\" => [\n \"index\" => \"houses_sold_last_10_yrs\",\n ],\n \"analysis\" => [\n \"regression\" => [\n \"dependent_variable\" => \"price\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"config\":{\"source\":{\"index\":\"houses_sold_last_10_yrs\"},\"analysis\":{\"regression\":{\"dependent_variable\":\"price\"}}}}' \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/_preview\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -37812,32 +26190,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/datafeeds/datafeed-high_sum_total_sales/_preview\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.preview_datafeed(\n datafeed_id=\"datafeed-high_sum_total_sales\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.previewDatafeed({\n datafeed_id: \"datafeed-high_sum_total_sales\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.preview_datafeed(\n datafeed_id: \"datafeed-high_sum_total_sales\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->previewDatafeed([\n \"datafeed_id\" => \"datafeed-high_sum_total_sales\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-high_sum_total_sales/_preview\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -37867,32 +26219,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/datafeeds/datafeed-high_sum_total_sales/_preview\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.preview_datafeed(\n datafeed_id=\"datafeed-high_sum_total_sales\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.previewDatafeed({\n datafeed_id: \"datafeed-high_sum_total_sales\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.preview_datafeed(\n datafeed_id: \"datafeed-high_sum_total_sales\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->previewDatafeed([\n \"datafeed_id\" => \"datafeed-high_sum_total_sales\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-high_sum_total_sales/_preview\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -37921,32 +26247,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/datafeeds/datafeed-high_sum_total_sales/_preview\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.preview_datafeed(\n datafeed_id=\"datafeed-high_sum_total_sales\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.previewDatafeed({\n datafeed_id: \"datafeed-high_sum_total_sales\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.preview_datafeed(\n datafeed_id: \"datafeed-high_sum_total_sales\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->previewDatafeed([\n \"datafeed_id\" => \"datafeed-high_sum_total_sales\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-high_sum_total_sales/_preview\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -37973,32 +26273,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/datafeeds/datafeed-high_sum_total_sales/_preview\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.preview_datafeed(\n datafeed_id=\"datafeed-high_sum_total_sales\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.previewDatafeed({\n datafeed_id: \"datafeed-high_sum_total_sales\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.preview_datafeed(\n datafeed_id: \"datafeed-high_sum_total_sales\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->previewDatafeed([\n \"datafeed_id\" => \"datafeed-high_sum_total_sales\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-high_sum_total_sales/_preview\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -38082,32 +26356,6 @@ } }, "x-state": "Generally available; Added in 8.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/definition/0\n{\n \"definition\": \"...\",\n \"total_definition_length\": 265632637,\n \"total_parts\": 64\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.put_trained_model_definition_part(\n model_id=\"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n part=\"0\",\n definition=\"...\",\n total_definition_length=265632637,\n total_parts=64,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.putTrainedModelDefinitionPart({\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n part: 0,\n definition: \"...\",\n total_definition_length: 265632637,\n total_parts: 64,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.put_trained_model_definition_part(\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n part: \"0\",\n body: {\n \"definition\": \"...\",\n \"total_definition_length\": 265632637,\n \"total_parts\": 64\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->putTrainedModelDefinitionPart([\n \"model_id\" => \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n \"part\" => \"0\",\n \"body\" => [\n \"definition\" => \"...\",\n \"total_definition_length\" => 265632637,\n \"total_parts\" => 64,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"definition\":\"...\",\"total_definition_length\":265632637,\"total_parts\":64}' \"$ELASTICSEARCH_URL/_ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/definition/0\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -38189,32 +26437,6 @@ } }, "x-state": "Generally available; Added in 8.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/vocabulary\n{\n \"vocabulary\": [\n \"[PAD]\",\n \"[unused0]\",\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.put_trained_model_vocabulary(\n model_id=\"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n vocabulary=[\n \"[PAD]\",\n \"[unused0]\"\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.putTrainedModelVocabulary({\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n vocabulary: [\"[PAD]\", \"[unused0]\"],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.put_trained_model_vocabulary(\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n body: {\n \"vocabulary\": [\n \"[PAD]\",\n \"[unused0]\"\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->putTrainedModelVocabulary([\n \"model_id\" => \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n \"body\" => [\n \"vocabulary\" => array(\n \"[PAD]\",\n \"[unused0]\",\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"vocabulary\":[\"[PAD]\",\"[unused0]\"]}' \"$ELASTICSEARCH_URL/_ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/vocabulary\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -38272,32 +26494,6 @@ } }, "x-state": "Generally available; Added in 7.14.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/anomaly_detectors/total-requests/_reset\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.reset_job(\n job_id=\"total-requests\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.resetJob({\n job_id: \"total-requests\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.reset_job(\n job_id: \"total-requests\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->resetJob([\n \"job_id\" => \"total-requests\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/total-requests/_reset\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -38385,32 +26581,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/anomaly_detectors/low_request_rate/model_snapshots/1637092688/_revert\n{\n \"delete_intervening_results\": true\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.revert_model_snapshot(\n job_id=\"low_request_rate\",\n snapshot_id=\"1637092688\",\n delete_intervening_results=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.revertModelSnapshot({\n job_id: \"low_request_rate\",\n snapshot_id: 1637092688,\n delete_intervening_results: true,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.revert_model_snapshot(\n job_id: \"low_request_rate\",\n snapshot_id: \"1637092688\",\n body: {\n \"delete_intervening_results\": true\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->revertModelSnapshot([\n \"job_id\" => \"low_request_rate\",\n \"snapshot_id\" => \"1637092688\",\n \"body\" => [\n \"delete_intervening_results\" => true,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"delete_intervening_results\":true}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/model_snapshots/1637092688/_revert\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -38457,32 +26627,6 @@ } }, "x-state": "Generally available; Added in 6.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/set_upgrade_mode?enabled=true\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.set_upgrade_mode(\n enabled=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.setUpgradeMode({\n enabled: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.set_upgrade_mode(\n enabled: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->setUpgradeMode([\n \"enabled\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/set_upgrade_mode?enabled=true\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -38542,32 +26686,6 @@ } }, "x-state": "Generally available; Added in 7.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/data_frame/analytics/loganalytics/_start\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.start_data_frame_analytics(\n id=\"loganalytics\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.startDataFrameAnalytics({\n id: \"loganalytics\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.start_data_frame_analytics(\n id: \"loganalytics\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->startDataFrameAnalytics([\n \"id\" => \"loganalytics\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics/_start\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -38674,32 +26792,6 @@ } }, "x-state": "Generally available; Added in 5.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/datafeeds/datafeed-low_request_rate/_start\n{\n \"start\": \"2019-04-07T18:22:16Z\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.start_datafeed(\n datafeed_id=\"datafeed-low_request_rate\",\n start=\"2019-04-07T18:22:16Z\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.startDatafeed({\n datafeed_id: \"datafeed-low_request_rate\",\n start: \"2019-04-07T18:22:16Z\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.start_datafeed(\n datafeed_id: \"datafeed-low_request_rate\",\n body: {\n \"start\": \"2019-04-07T18:22:16Z\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->startDatafeed([\n \"datafeed_id\" => \"datafeed-low_request_rate\",\n \"body\" => [\n \"start\" => \"2019-04-07T18:22:16Z\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"start\":\"2019-04-07T18:22:16Z\"}' \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-low_request_rate/_start\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -38839,32 +26931,6 @@ } }, "x-state": "Generally available; Added in 8.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/_start?wait_for=started&timeout=1m\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.start_trained_model_deployment(\n model_id=\"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n wait_for=\"started\",\n timeout=\"1m\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.startTrainedModelDeployment({\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n wait_for: \"started\",\n timeout: \"1m\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.start_trained_model_deployment(\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n wait_for: \"started\",\n timeout: \"1m\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->startTrainedModelDeployment([\n \"model_id\" => \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n \"wait_for\" => \"started\",\n \"timeout\" => \"1m\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/_start?wait_for=started&timeout=1m\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -38940,32 +27006,6 @@ } }, "x-state": "Generally available; Added in 7.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/data_frame/analytics/loganalytics/_stop\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.stop_data_frame_analytics(\n id=\"loganalytics\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.stopDataFrameAnalytics({\n id: \"loganalytics\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.stop_data_frame_analytics(\n id: \"loganalytics\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->stopDataFrameAnalytics([\n \"id\" => \"loganalytics\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics/_stop\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -39069,32 +27109,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/datafeeds/datafeed-low_request_rate/_stop\n{\n \"timeout\": \"30s\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.stop_datafeed(\n datafeed_id=\"datafeed-low_request_rate\",\n timeout=\"30s\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.stopDatafeed({\n datafeed_id: \"datafeed-low_request_rate\",\n timeout: \"30s\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.stop_datafeed(\n datafeed_id: \"datafeed-low_request_rate\",\n body: {\n \"timeout\": \"30s\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->stopDatafeed([\n \"datafeed_id\" => \"datafeed-low_request_rate\",\n \"body\" => [\n \"timeout\" => \"30s\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"timeout\":\"30s\"}' \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-low_request_rate/_stop\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -39160,32 +27174,6 @@ } }, "x-state": "Generally available; Added in 8.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/trained_models/my_model_for_search/deployment/_stop\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.stop_trained_model_deployment(\n model_id=\"my_model_for_search\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.stopTrainedModelDeployment({\n model_id: \"my_model_for_search\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.stop_trained_model_deployment(\n model_id: \"my_model_for_search\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->stopTrainedModelDeployment([\n \"model_id\" => \"my_model_for_search\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/trained_models/my_model_for_search/deployment/_stop\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -39306,32 +27294,6 @@ } }, "x-state": "Generally available; Added in 7.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/data_frame/analytics/loganalytics/_update\n{\n \"model_memory_limit\": \"200mb\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.update_data_frame_analytics(\n id=\"loganalytics\",\n model_memory_limit=\"200mb\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.updateDataFrameAnalytics({\n id: \"loganalytics\",\n model_memory_limit: \"200mb\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.update_data_frame_analytics(\n id: \"loganalytics\",\n body: {\n \"model_memory_limit\": \"200mb\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->updateDataFrameAnalytics([\n \"id\" => \"loganalytics\",\n \"body\" => [\n \"model_memory_limit\" => \"200mb\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"model_memory_limit\":\"200mb\"}' \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics/_update\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -39545,32 +27507,6 @@ } }, "x-state": "Generally available; Added in 6.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/datafeeds/datafeed-test-job/_update\n{\n \"query\": {\n \"term\": {\n \"geo.src\": \"US\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.update_datafeed(\n datafeed_id=\"datafeed-test-job\",\n query={\n \"term\": {\n \"geo.src\": \"US\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.updateDatafeed({\n datafeed_id: \"datafeed-test-job\",\n query: {\n term: {\n \"geo.src\": \"US\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.update_datafeed(\n datafeed_id: \"datafeed-test-job\",\n body: {\n \"query\": {\n \"term\": {\n \"geo.src\": \"US\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->updateDatafeed([\n \"datafeed_id\" => \"datafeed-test-job\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"geo.src\" => \"US\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"geo.src\":\"US\"}}}' \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-test-job/_update\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -39663,32 +27599,6 @@ } }, "x-state": "Generally available; Added in 6.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/filters/safe_domains/_update\n{\n \"description\": \"Updated list of domains\",\n \"add_items\": [\"*.myorg.com\"],\n \"remove_items\": [\"wikipedia.org\"]\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.update_filter(\n filter_id=\"safe_domains\",\n description=\"Updated list of domains\",\n add_items=[\n \"*.myorg.com\"\n ],\n remove_items=[\n \"wikipedia.org\"\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.updateFilter({\n filter_id: \"safe_domains\",\n description: \"Updated list of domains\",\n add_items: [\"*.myorg.com\"],\n remove_items: [\"wikipedia.org\"],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.update_filter(\n filter_id: \"safe_domains\",\n body: {\n \"description\": \"Updated list of domains\",\n \"add_items\": [\n \"*.myorg.com\"\n ],\n \"remove_items\": [\n \"wikipedia.org\"\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->updateFilter([\n \"filter_id\" => \"safe_domains\",\n \"body\" => [\n \"description\" => \"Updated list of domains\",\n \"add_items\" => array(\n \"*.myorg.com\",\n ),\n \"remove_items\" => array(\n \"wikipedia.org\",\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"description\":\"Updated list of domains\",\"add_items\":[\"*.myorg.com\"],\"remove_items\":[\"wikipedia.org\"]}' \"$ELASTICSEARCH_URL/_ml/filters/safe_domains/_update\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -39894,32 +27804,6 @@ } }, "x-state": "Generally available; Added in 5.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/anomaly_detectors/low_request_rate/_update\n{\n \"description\":\"An updated job\",\n \"detectors\": {\n \"detector_index\": 0,\n \"description\": \"An updated detector description\"\n },\n \"groups\": [\"kibana_sample_data\",\"kibana_sample_web_logs\"],\n \"model_plot_config\": {\n \"enabled\": true\n },\n \"renormalization_window_days\": 30,\n \"background_persist_interval\": \"2h\",\n \"model_snapshot_retention_days\": 7,\n \"results_retention_days\": 60\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.update_job(\n job_id=\"low_request_rate\",\n description=\"An updated job\",\n detectors={\n \"detector_index\": 0,\n \"description\": \"An updated detector description\"\n },\n groups=[\n \"kibana_sample_data\",\n \"kibana_sample_web_logs\"\n ],\n model_plot_config={\n \"enabled\": True\n },\n renormalization_window_days=30,\n background_persist_interval=\"2h\",\n model_snapshot_retention_days=7,\n results_retention_days=60,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.updateJob({\n job_id: \"low_request_rate\",\n description: \"An updated job\",\n detectors: {\n detector_index: 0,\n description: \"An updated detector description\",\n },\n groups: [\"kibana_sample_data\", \"kibana_sample_web_logs\"],\n model_plot_config: {\n enabled: true,\n },\n renormalization_window_days: 30,\n background_persist_interval: \"2h\",\n model_snapshot_retention_days: 7,\n results_retention_days: 60,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.update_job(\n job_id: \"low_request_rate\",\n body: {\n \"description\": \"An updated job\",\n \"detectors\": {\n \"detector_index\": 0,\n \"description\": \"An updated detector description\"\n },\n \"groups\": [\n \"kibana_sample_data\",\n \"kibana_sample_web_logs\"\n ],\n \"model_plot_config\": {\n \"enabled\": true\n },\n \"renormalization_window_days\": 30,\n \"background_persist_interval\": \"2h\",\n \"model_snapshot_retention_days\": 7,\n \"results_retention_days\": 60\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->updateJob([\n \"job_id\" => \"low_request_rate\",\n \"body\" => [\n \"description\" => \"An updated job\",\n \"detectors\" => [\n \"detector_index\" => 0,\n \"description\" => \"An updated detector description\",\n ],\n \"groups\" => array(\n \"kibana_sample_data\",\n \"kibana_sample_web_logs\",\n ),\n \"model_plot_config\" => [\n \"enabled\" => true,\n ],\n \"renormalization_window_days\" => 30,\n \"background_persist_interval\" => \"2h\",\n \"model_snapshot_retention_days\" => 7,\n \"results_retention_days\" => 60,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"description\":\"An updated job\",\"detectors\":{\"detector_index\":0,\"description\":\"An updated detector description\"},\"groups\":[\"kibana_sample_data\",\"kibana_sample_web_logs\"],\"model_plot_config\":{\"enabled\":true},\"renormalization_window_days\":30,\"background_persist_interval\":\"2h\",\"model_snapshot_retention_days\":7,\"results_retention_days\":60}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/_update\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -40006,32 +27890,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST\n_ml/anomaly_detectors/it_ops_new_logs/model_snapshots/1491852978/_update\n{\n \"description\": \"Snapshot 1\",\n \"retain\": true\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.update_model_snapshot(\n job_id=\"it_ops_new_logs\",\n snapshot_id=\"1491852978\",\n description=\"Snapshot 1\",\n retain=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.updateModelSnapshot({\n job_id: \"it_ops_new_logs\",\n snapshot_id: 1491852978,\n description: \"Snapshot 1\",\n retain: true,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.update_model_snapshot(\n job_id: \"it_ops_new_logs\",\n snapshot_id: \"1491852978\",\n body: {\n \"description\": \"Snapshot 1\",\n \"retain\": true\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->updateModelSnapshot([\n \"job_id\" => \"it_ops_new_logs\",\n \"snapshot_id\" => \"1491852978\",\n \"body\" => [\n \"description\" => \"Snapshot 1\",\n \"retain\" => true,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"description\":\"Snapshot 1\",\"retain\":true}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/it_ops_new_logs/model_snapshots/1491852978/_update\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -40111,32 +27969,6 @@ } }, "x-state": "Generally available; Added in 8.6.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/_update\n{\n \"number_of_allocations\": 4\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.update_trained_model_deployment(\n model_id=\"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n number_of_allocations=4,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.updateTrainedModelDeployment({\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n number_of_allocations: 4,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.update_trained_model_deployment(\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n body: {\n \"number_of_allocations\": 4\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->updateTrainedModelDeployment([\n \"model_id\" => \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n \"body\" => [\n \"number_of_allocations\" => 4,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"number_of_allocations\":4}' \"$ELASTICSEARCH_URL/_ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/_update\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -40218,32 +28050,6 @@ } }, "x-state": "Generally available; Added in 5.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/anomaly_detectors/low_request_rate/model_snapshots/1828371/_upgrade?timeout=45m&wait_for_completion=true\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.upgrade_job_snapshot(\n job_id=\"low_request_rate\",\n snapshot_id=\"1828371\",\n timeout=\"45m\",\n wait_for_completion=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.upgradeJobSnapshot({\n job_id: \"low_request_rate\",\n snapshot_id: 1828371,\n timeout: \"45m\",\n wait_for_completion: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.upgrade_job_snapshot(\n job_id: \"low_request_rate\",\n snapshot_id: \"1828371\",\n timeout: \"45m\",\n wait_for_completion: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->upgradeJobSnapshot([\n \"job_id\" => \"low_request_rate\",\n \"snapshot_id\" => \"1828371\",\n \"timeout\" => \"45m\",\n \"wait_for_completion\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/model_snapshots/1828371/_upgrade?timeout=45m&wait_for_completion=true\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -40305,32 +28111,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index-000001/_msearch\n{ }\n{\"query\" : {\"match\" : { \"message\": \"this is a test\"}}}\n{\"index\": \"my-index-000002\"}\n{\"query\" : {\"match_all\" : {}}}" - }, - { - "lang": "Python", - "source": "resp = client.msearch(\n index=\"my-index-000001\",\n searches=[\n {},\n {\n \"query\": {\n \"match\": {\n \"message\": \"this is a test\"\n }\n }\n },\n {\n \"index\": \"my-index-000002\"\n },\n {\n \"query\": {\n \"match_all\": {}\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.msearch({\n index: \"my-index-000001\",\n searches: [\n {},\n {\n query: {\n match: {\n message: \"this is a test\",\n },\n },\n },\n {\n index: \"my-index-000002\",\n },\n {\n query: {\n match_all: {},\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.msearch(\n index: \"my-index-000001\",\n body: [\n {},\n {\n \"query\": {\n \"match\": {\n \"message\": \"this is a test\"\n }\n }\n },\n {\n \"index\": \"my-index-000002\"\n },\n {\n \"query\": {\n \"match_all\": {}\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->msearch([\n \"index\" => \"my-index-000001\",\n \"body\" => array(\n new ArrayObject([]),\n [\n \"query\" => [\n \"match\" => [\n \"message\" => \"this is a test\",\n ],\n ],\n ],\n [\n \"index\" => \"my-index-000002\",\n ],\n [\n \"query\" => [\n \"match_all\" => new ArrayObject([]),\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{},{\"query\":{\"match\":{\"message\":\"this is a test\"}}},{\"index\":\"my-index-000002\"},{\"query\":{\"match_all\":{}}}]' \"$ELASTICSEARCH_URL/my-index-000001/_msearch\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -40390,32 +28170,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index-000001/_msearch\n{ }\n{\"query\" : {\"match\" : { \"message\": \"this is a test\"}}}\n{\"index\": \"my-index-000002\"}\n{\"query\" : {\"match_all\" : {}}}" - }, - { - "lang": "Python", - "source": "resp = client.msearch(\n index=\"my-index-000001\",\n searches=[\n {},\n {\n \"query\": {\n \"match\": {\n \"message\": \"this is a test\"\n }\n }\n },\n {\n \"index\": \"my-index-000002\"\n },\n {\n \"query\": {\n \"match_all\": {}\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.msearch({\n index: \"my-index-000001\",\n searches: [\n {},\n {\n query: {\n match: {\n message: \"this is a test\",\n },\n },\n },\n {\n index: \"my-index-000002\",\n },\n {\n query: {\n match_all: {},\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.msearch(\n index: \"my-index-000001\",\n body: [\n {},\n {\n \"query\": {\n \"match\": {\n \"message\": \"this is a test\"\n }\n }\n },\n {\n \"index\": \"my-index-000002\"\n },\n {\n \"query\": {\n \"match_all\": {}\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->msearch([\n \"index\" => \"my-index-000001\",\n \"body\" => array(\n new ArrayObject([]),\n [\n \"query\" => [\n \"match\" => [\n \"message\" => \"this is a test\",\n ],\n ],\n ],\n [\n \"index\" => \"my-index-000002\",\n ],\n [\n \"query\" => [\n \"match_all\" => new ArrayObject([]),\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{},{\"query\":{\"match\":{\"message\":\"this is a test\"}}},{\"index\":\"my-index-000002\"},{\"query\":{\"match_all\":{}}}]' \"$ELASTICSEARCH_URL/my-index-000001/_msearch\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -40480,32 +28234,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index-000001/_msearch\n{ }\n{\"query\" : {\"match\" : { \"message\": \"this is a test\"}}}\n{\"index\": \"my-index-000002\"}\n{\"query\" : {\"match_all\" : {}}}" - }, - { - "lang": "Python", - "source": "resp = client.msearch(\n index=\"my-index-000001\",\n searches=[\n {},\n {\n \"query\": {\n \"match\": {\n \"message\": \"this is a test\"\n }\n }\n },\n {\n \"index\": \"my-index-000002\"\n },\n {\n \"query\": {\n \"match_all\": {}\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.msearch({\n index: \"my-index-000001\",\n searches: [\n {},\n {\n query: {\n match: {\n message: \"this is a test\",\n },\n },\n },\n {\n index: \"my-index-000002\",\n },\n {\n query: {\n match_all: {},\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.msearch(\n index: \"my-index-000001\",\n body: [\n {},\n {\n \"query\": {\n \"match\": {\n \"message\": \"this is a test\"\n }\n }\n },\n {\n \"index\": \"my-index-000002\"\n },\n {\n \"query\": {\n \"match_all\": {}\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->msearch([\n \"index\" => \"my-index-000001\",\n \"body\" => array(\n new ArrayObject([]),\n [\n \"query\" => [\n \"match\" => [\n \"message\" => \"this is a test\",\n ],\n ],\n ],\n [\n \"index\" => \"my-index-000002\",\n ],\n [\n \"query\" => [\n \"match_all\" => new ArrayObject([]),\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{},{\"query\":{\"match\":{\"message\":\"this is a test\"}}},{\"index\":\"my-index-000002\"},{\"query\":{\"match_all\":{}}}]' \"$ELASTICSEARCH_URL/my-index-000001/_msearch\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -40568,32 +28296,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index-000001/_msearch\n{ }\n{\"query\" : {\"match\" : { \"message\": \"this is a test\"}}}\n{\"index\": \"my-index-000002\"}\n{\"query\" : {\"match_all\" : {}}}" - }, - { - "lang": "Python", - "source": "resp = client.msearch(\n index=\"my-index-000001\",\n searches=[\n {},\n {\n \"query\": {\n \"match\": {\n \"message\": \"this is a test\"\n }\n }\n },\n {\n \"index\": \"my-index-000002\"\n },\n {\n \"query\": {\n \"match_all\": {}\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.msearch({\n index: \"my-index-000001\",\n searches: [\n {},\n {\n query: {\n match: {\n message: \"this is a test\",\n },\n },\n },\n {\n index: \"my-index-000002\",\n },\n {\n query: {\n match_all: {},\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.msearch(\n index: \"my-index-000001\",\n body: [\n {},\n {\n \"query\": {\n \"match\": {\n \"message\": \"this is a test\"\n }\n }\n },\n {\n \"index\": \"my-index-000002\"\n },\n {\n \"query\": {\n \"match_all\": {}\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->msearch([\n \"index\" => \"my-index-000001\",\n \"body\" => array(\n new ArrayObject([]),\n [\n \"query\" => [\n \"match\" => [\n \"message\" => \"this is a test\",\n ],\n ],\n ],\n [\n \"index\" => \"my-index-000002\",\n ],\n [\n \"query\" => [\n \"match_all\" => new ArrayObject([]),\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{},{\"query\":{\"match\":{\"message\":\"this is a test\"}}},{\"index\":\"my-index-000002\"},{\"query\":{\"match_all\":{}}}]' \"$ELASTICSEARCH_URL/my-index-000001/_msearch\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -40634,32 +28336,6 @@ } }, "x-state": "Generally available; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index/_msearch/template\n{ }\n{ \"id\": \"my-search-template\", \"params\": { \"query_string\": \"hello world\", \"from\": 0, \"size\": 10 }}\n{ }\n{ \"id\": \"my-other-search-template\", \"params\": { \"query_type\": \"match_all\" }}" - }, - { - "lang": "Python", - "source": "resp = client.msearch_template(\n index=\"my-index\",\n search_templates=[\n {},\n {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n },\n {},\n {\n \"id\": \"my-other-search-template\",\n \"params\": {\n \"query_type\": \"match_all\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.msearchTemplate({\n index: \"my-index\",\n search_templates: [\n {},\n {\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 0,\n size: 10,\n },\n },\n {},\n {\n id: \"my-other-search-template\",\n params: {\n query_type: \"match_all\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.msearch_template(\n index: \"my-index\",\n body: [\n {},\n {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n },\n {},\n {\n \"id\": \"my-other-search-template\",\n \"params\": {\n \"query_type\": \"match_all\"\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->msearchTemplate([\n \"index\" => \"my-index\",\n \"body\" => array(\n new ArrayObject([]),\n [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 0,\n \"size\" => 10,\n ],\n ],\n new ArrayObject([]),\n [\n \"id\" => \"my-other-search-template\",\n \"params\" => [\n \"query_type\" => \"match_all\",\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{},{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":0,\"size\":10}},{},{\"id\":\"my-other-search-template\",\"params\":{\"query_type\":\"match_all\"}}]' \"$ELASTICSEARCH_URL/my-index/_msearch/template\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -40698,32 +28374,6 @@ } }, "x-state": "Generally available; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index/_msearch/template\n{ }\n{ \"id\": \"my-search-template\", \"params\": { \"query_string\": \"hello world\", \"from\": 0, \"size\": 10 }}\n{ }\n{ \"id\": \"my-other-search-template\", \"params\": { \"query_type\": \"match_all\" }}" - }, - { - "lang": "Python", - "source": "resp = client.msearch_template(\n index=\"my-index\",\n search_templates=[\n {},\n {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n },\n {},\n {\n \"id\": \"my-other-search-template\",\n \"params\": {\n \"query_type\": \"match_all\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.msearchTemplate({\n index: \"my-index\",\n search_templates: [\n {},\n {\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 0,\n size: 10,\n },\n },\n {},\n {\n id: \"my-other-search-template\",\n params: {\n query_type: \"match_all\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.msearch_template(\n index: \"my-index\",\n body: [\n {},\n {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n },\n {},\n {\n \"id\": \"my-other-search-template\",\n \"params\": {\n \"query_type\": \"match_all\"\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->msearchTemplate([\n \"index\" => \"my-index\",\n \"body\" => array(\n new ArrayObject([]),\n [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 0,\n \"size\" => 10,\n ],\n ],\n new ArrayObject([]),\n [\n \"id\" => \"my-other-search-template\",\n \"params\" => [\n \"query_type\" => \"match_all\",\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{},{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":0,\"size\":10}},{},{\"id\":\"my-other-search-template\",\"params\":{\"query_type\":\"match_all\"}}]' \"$ELASTICSEARCH_URL/my-index/_msearch/template\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -40767,32 +28417,6 @@ } }, "x-state": "Generally available; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index/_msearch/template\n{ }\n{ \"id\": \"my-search-template\", \"params\": { \"query_string\": \"hello world\", \"from\": 0, \"size\": 10 }}\n{ }\n{ \"id\": \"my-other-search-template\", \"params\": { \"query_type\": \"match_all\" }}" - }, - { - "lang": "Python", - "source": "resp = client.msearch_template(\n index=\"my-index\",\n search_templates=[\n {},\n {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n },\n {},\n {\n \"id\": \"my-other-search-template\",\n \"params\": {\n \"query_type\": \"match_all\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.msearchTemplate({\n index: \"my-index\",\n search_templates: [\n {},\n {\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 0,\n size: 10,\n },\n },\n {},\n {\n id: \"my-other-search-template\",\n params: {\n query_type: \"match_all\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.msearch_template(\n index: \"my-index\",\n body: [\n {},\n {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n },\n {},\n {\n \"id\": \"my-other-search-template\",\n \"params\": {\n \"query_type\": \"match_all\"\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->msearchTemplate([\n \"index\" => \"my-index\",\n \"body\" => array(\n new ArrayObject([]),\n [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 0,\n \"size\" => 10,\n ],\n ],\n new ArrayObject([]),\n [\n \"id\" => \"my-other-search-template\",\n \"params\" => [\n \"query_type\" => \"match_all\",\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{},{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":0,\"size\":10}},{},{\"id\":\"my-other-search-template\",\"params\":{\"query_type\":\"match_all\"}}]' \"$ELASTICSEARCH_URL/my-index/_msearch/template\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -40834,32 +28458,6 @@ } }, "x-state": "Generally available; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index/_msearch/template\n{ }\n{ \"id\": \"my-search-template\", \"params\": { \"query_string\": \"hello world\", \"from\": 0, \"size\": 10 }}\n{ }\n{ \"id\": \"my-other-search-template\", \"params\": { \"query_type\": \"match_all\" }}" - }, - { - "lang": "Python", - "source": "resp = client.msearch_template(\n index=\"my-index\",\n search_templates=[\n {},\n {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n },\n {},\n {\n \"id\": \"my-other-search-template\",\n \"params\": {\n \"query_type\": \"match_all\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.msearchTemplate({\n index: \"my-index\",\n search_templates: [\n {},\n {\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 0,\n size: 10,\n },\n },\n {},\n {\n id: \"my-other-search-template\",\n params: {\n query_type: \"match_all\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.msearch_template(\n index: \"my-index\",\n body: [\n {},\n {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n },\n {},\n {\n \"id\": \"my-other-search-template\",\n \"params\": {\n \"query_type\": \"match_all\"\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->msearchTemplate([\n \"index\" => \"my-index\",\n \"body\" => array(\n new ArrayObject([]),\n [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 0,\n \"size\" => 10,\n ],\n ],\n new ArrayObject([]),\n [\n \"id\" => \"my-other-search-template\",\n \"params\" => [\n \"query_type\" => \"match_all\",\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{},{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":0,\"size\":10}},{},{\"id\":\"my-other-search-template\",\"params\":{\"query_type\":\"match_all\"}}]' \"$ELASTICSEARCH_URL/my-index/_msearch/template\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -40918,32 +28516,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-index-000001/_mtermvectors\n{\n \"docs\": [\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": true\n },\n {\n \"_id\": \"1\"\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.mtermvectors(\n index=\"my-index-000001\",\n docs=[\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": True\n },\n {\n \"_id\": \"1\"\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.mtermvectors({\n index: \"my-index-000001\",\n docs: [\n {\n _id: \"2\",\n fields: [\"message\"],\n term_statistics: true,\n },\n {\n _id: \"1\",\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.mtermvectors(\n index: \"my-index-000001\",\n body: {\n \"docs\": [\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": true\n },\n {\n \"_id\": \"1\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->mtermvectors([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"docs\" => array(\n [\n \"_id\" => \"2\",\n \"fields\" => array(\n \"message\",\n ),\n \"term_statistics\" => true,\n ],\n [\n \"_id\" => \"1\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"docs\":[{\"_id\":\"2\",\"fields\":[\"message\"],\"term_statistics\":true},{\"_id\":\"1\"}]}' \"$ELASTICSEARCH_URL/my-index-000001/_mtermvectors\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -41000,32 +28572,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-index-000001/_mtermvectors\n{\n \"docs\": [\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": true\n },\n {\n \"_id\": \"1\"\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.mtermvectors(\n index=\"my-index-000001\",\n docs=[\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": True\n },\n {\n \"_id\": \"1\"\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.mtermvectors({\n index: \"my-index-000001\",\n docs: [\n {\n _id: \"2\",\n fields: [\"message\"],\n term_statistics: true,\n },\n {\n _id: \"1\",\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.mtermvectors(\n index: \"my-index-000001\",\n body: {\n \"docs\": [\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": true\n },\n {\n \"_id\": \"1\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->mtermvectors([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"docs\" => array(\n [\n \"_id\" => \"2\",\n \"fields\" => array(\n \"message\",\n ),\n \"term_statistics\" => true,\n ],\n [\n \"_id\" => \"1\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"docs\":[{\"_id\":\"2\",\"fields\":[\"message\"],\"term_statistics\":true},{\"_id\":\"1\"}]}' \"$ELASTICSEARCH_URL/my-index-000001/_mtermvectors\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -41087,32 +28633,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-index-000001/_mtermvectors\n{\n \"docs\": [\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": true\n },\n {\n \"_id\": \"1\"\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.mtermvectors(\n index=\"my-index-000001\",\n docs=[\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": True\n },\n {\n \"_id\": \"1\"\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.mtermvectors({\n index: \"my-index-000001\",\n docs: [\n {\n _id: \"2\",\n fields: [\"message\"],\n term_statistics: true,\n },\n {\n _id: \"1\",\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.mtermvectors(\n index: \"my-index-000001\",\n body: {\n \"docs\": [\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": true\n },\n {\n \"_id\": \"1\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->mtermvectors([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"docs\" => array(\n [\n \"_id\" => \"2\",\n \"fields\" => array(\n \"message\",\n ),\n \"term_statistics\" => true,\n ],\n [\n \"_id\" => \"1\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"docs\":[{\"_id\":\"2\",\"fields\":[\"message\"],\"term_statistics\":true},{\"_id\":\"1\"}]}' \"$ELASTICSEARCH_URL/my-index-000001/_mtermvectors\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -41172,32 +28692,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-index-000001/_mtermvectors\n{\n \"docs\": [\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": true\n },\n {\n \"_id\": \"1\"\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.mtermvectors(\n index=\"my-index-000001\",\n docs=[\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": True\n },\n {\n \"_id\": \"1\"\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.mtermvectors({\n index: \"my-index-000001\",\n docs: [\n {\n _id: \"2\",\n fields: [\"message\"],\n term_statistics: true,\n },\n {\n _id: \"1\",\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.mtermvectors(\n index: \"my-index-000001\",\n body: {\n \"docs\": [\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": true\n },\n {\n \"_id\": \"1\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->mtermvectors([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"docs\" => array(\n [\n \"_id\" => \"2\",\n \"fields\" => array(\n \"message\",\n ),\n \"term_statistics\" => true,\n ],\n [\n \"_id\" => \"1\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"docs\":[{\"_id\":\"2\",\"fields\":[\"message\"],\"term_statistics\":true},{\"_id\":\"1\"}]}' \"$ELASTICSEARCH_URL/my-index-000001/_mtermvectors\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -41323,32 +28817,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_nodes/hot_threads\n" - }, - { - "lang": "Python", - "source": "resp = client.nodes.hot_threads()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.nodes.hotThreads();" - }, - { - "lang": "Ruby", - "source": "response = client.nodes.hot_threads" - }, - { - "lang": "PHP", - "source": "$resp = $client->nodes()->hotThreads();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_nodes/hot_threads\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -41392,32 +28860,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_nodes/hot_threads\n" - }, - { - "lang": "Python", - "source": "resp = client.nodes.hot_threads()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.nodes.hotThreads();" - }, - { - "lang": "Ruby", - "source": "response = client.nodes.hot_threads" - }, - { - "lang": "PHP", - "source": "$resp = $client->nodes()->hotThreads();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_nodes/hot_threads\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -41443,32 +28885,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _nodes/_all/jvm\n" - }, - { - "lang": "Python", - "source": "resp = client.nodes.info(\n node_id=\"_all\",\n metric=\"jvm\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.nodes.info({\n node_id: \"_all\",\n metric: \"jvm\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.nodes.info(\n node_id: \"_all\",\n metric: \"jvm\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->nodes()->info([\n \"node_id\" => \"_all\",\n \"metric\" => \"jvm\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_nodes/_all/jvm\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -41497,32 +28913,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _nodes/_all/jvm\n" - }, - { - "lang": "Python", - "source": "resp = client.nodes.info(\n node_id=\"_all\",\n metric=\"jvm\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.nodes.info({\n node_id: \"_all\",\n metric: \"jvm\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.nodes.info(\n node_id: \"_all\",\n metric: \"jvm\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->nodes()->info([\n \"node_id\" => \"_all\",\n \"metric\" => \"jvm\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_nodes/_all/jvm\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -41551,32 +28941,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _nodes/_all/jvm\n" - }, - { - "lang": "Python", - "source": "resp = client.nodes.info(\n node_id=\"_all\",\n metric=\"jvm\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.nodes.info({\n node_id: \"_all\",\n metric: \"jvm\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.nodes.info(\n node_id: \"_all\",\n metric: \"jvm\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->nodes()->info([\n \"node_id\" => \"_all\",\n \"metric\" => \"jvm\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_nodes/_all/jvm\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -41608,32 +28972,6 @@ } }, "x-state": "Generally available; Added in 1.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _nodes/_all/jvm\n" - }, - { - "lang": "Python", - "source": "resp = client.nodes.info(\n node_id=\"_all\",\n metric=\"jvm\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.nodes.info({\n node_id: \"_all\",\n metric: \"jvm\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.nodes.info(\n node_id: \"_all\",\n metric: \"jvm\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->nodes()->info([\n \"node_id\" => \"_all\",\n \"metric\" => \"jvm\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_nodes/_all/jvm\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -41659,32 +28997,6 @@ } }, "x-state": "Generally available; Added in 6.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _nodes/reload_secure_settings\n{\n \"secure_settings_password\": \"keystore-password\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.nodes.reload_secure_settings(\n secure_settings_password=\"keystore-password\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.nodes.reloadSecureSettings({\n secure_settings_password: \"keystore-password\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.nodes.reload_secure_settings(\n body: {\n \"secure_settings_password\": \"keystore-password\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->nodes()->reloadSecureSettings([\n \"body\" => [\n \"secure_settings_password\" => \"keystore-password\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"secure_settings_password\":\"keystore-password\"}' \"$ELASTICSEARCH_URL/_nodes/reload_secure_settings\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -41713,32 +29025,6 @@ } }, "x-state": "Generally available; Added in 6.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _nodes/reload_secure_settings\n{\n \"secure_settings_password\": \"keystore-password\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.nodes.reload_secure_settings(\n secure_settings_password=\"keystore-password\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.nodes.reloadSecureSettings({\n secure_settings_password: \"keystore-password\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.nodes.reload_secure_settings(\n body: {\n \"secure_settings_password\": \"keystore-password\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->nodes()->reloadSecureSettings([\n \"body\" => [\n \"secure_settings_password\" => \"keystore-password\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"secure_settings_password\":\"keystore-password\"}' \"$ELASTICSEARCH_URL/_nodes/reload_secure_settings\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -41785,32 +29071,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _nodes/stats/process?filter_path=**.max_file_descriptors\n" - }, - { - "lang": "Python", - "source": "resp = client.nodes.stats(\n metric=\"process\",\n filter_path=\"**.max_file_descriptors\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.nodes.stats({\n metric: \"process\",\n filter_path: \"**.max_file_descriptors\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.nodes.stats(\n metric: \"process\",\n filter_path: \"**.max_file_descriptors\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->nodes()->stats([\n \"metric\" => \"process\",\n \"filter_path\" => \"**.max_file_descriptors\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_nodes/stats/process?filter_path=**.max_file_descriptors\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -41860,32 +29120,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _nodes/stats/process?filter_path=**.max_file_descriptors\n" - }, - { - "lang": "Python", - "source": "resp = client.nodes.stats(\n metric=\"process\",\n filter_path=\"**.max_file_descriptors\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.nodes.stats({\n metric: \"process\",\n filter_path: \"**.max_file_descriptors\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.nodes.stats(\n metric: \"process\",\n filter_path: \"**.max_file_descriptors\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->nodes()->stats([\n \"metric\" => \"process\",\n \"filter_path\" => \"**.max_file_descriptors\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_nodes/stats/process?filter_path=**.max_file_descriptors\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -41935,32 +29169,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _nodes/stats/process?filter_path=**.max_file_descriptors\n" - }, - { - "lang": "Python", - "source": "resp = client.nodes.stats(\n metric=\"process\",\n filter_path=\"**.max_file_descriptors\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.nodes.stats({\n metric: \"process\",\n filter_path: \"**.max_file_descriptors\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.nodes.stats(\n metric: \"process\",\n filter_path: \"**.max_file_descriptors\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->nodes()->stats([\n \"metric\" => \"process\",\n \"filter_path\" => \"**.max_file_descriptors\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_nodes/stats/process?filter_path=**.max_file_descriptors\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -42013,32 +29221,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _nodes/stats/process?filter_path=**.max_file_descriptors\n" - }, - { - "lang": "Python", - "source": "resp = client.nodes.stats(\n metric=\"process\",\n filter_path=\"**.max_file_descriptors\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.nodes.stats({\n metric: \"process\",\n filter_path: \"**.max_file_descriptors\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.nodes.stats(\n metric: \"process\",\n filter_path: \"**.max_file_descriptors\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->nodes()->stats([\n \"metric\" => \"process\",\n \"filter_path\" => \"**.max_file_descriptors\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_nodes/stats/process?filter_path=**.max_file_descriptors\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -42091,32 +29273,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _nodes/stats/process?filter_path=**.max_file_descriptors\n" - }, - { - "lang": "Python", - "source": "resp = client.nodes.stats(\n metric=\"process\",\n filter_path=\"**.max_file_descriptors\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.nodes.stats({\n metric: \"process\",\n filter_path: \"**.max_file_descriptors\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.nodes.stats(\n metric: \"process\",\n filter_path: \"**.max_file_descriptors\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->nodes()->stats([\n \"metric\" => \"process\",\n \"filter_path\" => \"**.max_file_descriptors\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_nodes/stats/process?filter_path=**.max_file_descriptors\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -42172,32 +29328,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _nodes/stats/process?filter_path=**.max_file_descriptors\n" - }, - { - "lang": "Python", - "source": "resp = client.nodes.stats(\n metric=\"process\",\n filter_path=\"**.max_file_descriptors\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.nodes.stats({\n metric: \"process\",\n filter_path: \"**.max_file_descriptors\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.nodes.stats(\n metric: \"process\",\n filter_path: \"**.max_file_descriptors\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->nodes()->stats([\n \"metric\" => \"process\",\n \"filter_path\" => \"**.max_file_descriptors\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_nodes/stats/process?filter_path=**.max_file_descriptors\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -42220,32 +29350,6 @@ } }, "x-state": "Generally available; Added in 6.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _nodes/usage\n" - }, - { - "lang": "Python", - "source": "resp = client.nodes.usage()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.nodes.usage();" - }, - { - "lang": "Ruby", - "source": "response = client.nodes.usage" - }, - { - "lang": "PHP", - "source": "$resp = $client->nodes()->usage();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_nodes/usage\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -42271,32 +29375,6 @@ } }, "x-state": "Generally available; Added in 6.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _nodes/usage\n" - }, - { - "lang": "Python", - "source": "resp = client.nodes.usage()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.nodes.usage();" - }, - { - "lang": "Ruby", - "source": "response = client.nodes.usage" - }, - { - "lang": "PHP", - "source": "$resp = $client->nodes()->usage();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_nodes/usage\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -42322,32 +29400,6 @@ } }, "x-state": "Generally available; Added in 6.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _nodes/usage\n" - }, - { - "lang": "Python", - "source": "resp = client.nodes.usage()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.nodes.usage();" - }, - { - "lang": "Ruby", - "source": "response = client.nodes.usage" - }, - { - "lang": "PHP", - "source": "$resp = $client->nodes()->usage();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_nodes/usage\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -42376,32 +29428,6 @@ } }, "x-state": "Generally available; Added in 6.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _nodes/usage\n" - }, - { - "lang": "Python", - "source": "resp = client.nodes.usage()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.nodes.usage();" - }, - { - "lang": "Ruby", - "source": "response = client.nodes.usage" - }, - { - "lang": "PHP", - "source": "$resp = $client->nodes()->usage();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_nodes/usage\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -42542,32 +29568,6 @@ } }, "x-state": "Generally available; Added in 7.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-index-000001/_pit?keep_alive=1m&allow_partial_search_results=true\n" - }, - { - "lang": "Python", - "source": "resp = client.open_point_in_time(\n index=\"my-index-000001\",\n keep_alive=\"1m\",\n allow_partial_search_results=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.openPointInTime({\n index: \"my-index-000001\",\n keep_alive: \"1m\",\n allow_partial_search_results: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.open_point_in_time(\n index: \"my-index-000001\",\n keep_alive: \"1m\",\n allow_partial_search_results: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->openPointInTime([\n \"index\" => \"my-index-000001\",\n \"keep_alive\" => \"1m\",\n \"allow_partial_search_results\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_pit?keep_alive=1m&allow_partial_search_results=true\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -42608,32 +29608,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _scripts/my-search-template\n{\n \"script\": {\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.put_script(\n id=\"my-search-template\",\n script={\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.putScript({\n id: \"my-search-template\",\n script: {\n lang: \"mustache\",\n source: {\n query: {\n match: {\n message: \"{{query_string}}\",\n },\n },\n from: \"{{from}}\",\n size: \"{{size}}\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.put_script(\n id: \"my-search-template\",\n body: {\n \"script\": {\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->putScript([\n \"id\" => \"my-search-template\",\n \"body\" => [\n \"script\" => [\n \"lang\" => \"mustache\",\n \"source\" => [\n \"query\" => [\n \"match\" => [\n \"message\" => \"{{query_string}}\",\n ],\n ],\n \"from\" => \"{{from}}\",\n \"size\" => \"{{size}}\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"script\":{\"lang\":\"mustache\",\"source\":{\"query\":{\"match\":{\"message\":\"{{query_string}}\"}},\"from\":\"{{from}}\",\"size\":\"{{size}}\"}}}' \"$ELASTICSEARCH_URL/_scripts/my-search-template\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -42672,32 +29646,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _scripts/my-search-template\n{\n \"script\": {\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.put_script(\n id=\"my-search-template\",\n script={\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.putScript({\n id: \"my-search-template\",\n script: {\n lang: \"mustache\",\n source: {\n query: {\n match: {\n message: \"{{query_string}}\",\n },\n },\n from: \"{{from}}\",\n size: \"{{size}}\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.put_script(\n id: \"my-search-template\",\n body: {\n \"script\": {\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->putScript([\n \"id\" => \"my-search-template\",\n \"body\" => [\n \"script\" => [\n \"lang\" => \"mustache\",\n \"source\" => [\n \"query\" => [\n \"match\" => [\n \"message\" => \"{{query_string}}\",\n ],\n ],\n \"from\" => \"{{from}}\",\n \"size\" => \"{{size}}\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"script\":{\"lang\":\"mustache\",\"source\":{\"query\":{\"match\":{\"message\":\"{{query_string}}\"}},\"from\":\"{{from}}\",\"size\":\"{{size}}\"}}}' \"$ELASTICSEARCH_URL/_scripts/my-search-template\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -42755,32 +29703,6 @@ } }, "x-state": "Generally available; Added in 8.15.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _query_rules/my-ruleset/_rule/my-rule1\n" - }, - { - "lang": "Python", - "source": "resp = client.query_rules.get_rule(\n ruleset_id=\"my-ruleset\",\n rule_id=\"my-rule1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.queryRules.getRule({\n ruleset_id: \"my-ruleset\",\n rule_id: \"my-rule1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.query_rules.get_rule(\n ruleset_id: \"my-ruleset\",\n rule_id: \"my-rule1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->queryRules()->getRule([\n \"ruleset_id\" => \"my-ruleset\",\n \"rule_id\" => \"my-rule1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_query_rules/my-ruleset/_rule/my-rule1\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -42881,32 +29803,6 @@ } }, "x-state": "Generally available; Added in 8.15.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _query_rules/my-ruleset/_test\n{\n \"match_criteria\": {\n \"query_string\": \"puggles\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.query_rules.test(\n ruleset_id=\"my-ruleset\",\n match_criteria={\n \"query_string\": \"puggles\"\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.queryRules.test({\n ruleset_id: \"my-ruleset\",\n match_criteria: {\n query_string: \"puggles\",\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.query_rules.test(\n ruleset_id: \"my-ruleset\",\n body: {\n \"match_criteria\": {\n \"query_string\": \"puggles\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->queryRules()->test([\n \"ruleset_id\" => \"my-ruleset\",\n \"body\" => [\n \"match_criteria\" => [\n \"query_string\" => \"puggles\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"match_criteria\":{\"query_string\":\"puggles\"}}' \"$ELASTICSEARCH_URL/_query_rules/my-ruleset/_test\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -42953,32 +29849,6 @@ } }, "x-state": "Generally available; Added in 8.15.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _query_rules/my-ruleset/_rule/my-rule1\n" - }, - { - "lang": "Python", - "source": "resp = client.query_rules.delete_rule(\n ruleset_id=\"my-ruleset\",\n rule_id=\"my-rule1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.queryRules.deleteRule({\n ruleset_id: \"my-ruleset\",\n rule_id: \"my-rule1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.query_rules.delete_rule(\n ruleset_id: \"my-ruleset\",\n rule_id: \"my-rule1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->queryRules()->deleteRule([\n \"ruleset_id\" => \"my-ruleset\",\n \"rule_id\" => \"my-rule1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_query_rules/my-ruleset/_rule/my-rule1\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -43022,32 +29892,6 @@ } }, "x-state": "Generally available; Added in 8.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _query_rules/my-ruleset/\n" - }, - { - "lang": "Python", - "source": "resp = client.query_rules.get_ruleset(\n ruleset_id=\"my-ruleset\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.queryRules.getRuleset({\n ruleset_id: \"my-ruleset\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.query_rules.get_ruleset(\n ruleset_id: \"my-ruleset\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->queryRules()->getRuleset([\n \"ruleset_id\" => \"my-ruleset\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_query_rules/my-ruleset/\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -43128,32 +29972,6 @@ } }, "x-state": "Generally available; Added in 8.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _query_rules/my-ruleset\n{\n \"rules\": [\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [ \"pugs\", \"puggles\" ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [ \"us\" ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [ \"rescue dogs\" ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.query_rules.put_ruleset(\n ruleset_id=\"my-ruleset\",\n rules=[\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"pugs\",\n \"puggles\"\n ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [\n \"us\"\n ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"rescue dogs\"\n ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.queryRules.putRuleset({\n ruleset_id: \"my-ruleset\",\n rules: [\n {\n rule_id: \"my-rule1\",\n type: \"pinned\",\n criteria: [\n {\n type: \"contains\",\n metadata: \"user_query\",\n values: [\"pugs\", \"puggles\"],\n },\n {\n type: \"exact\",\n metadata: \"user_country\",\n values: [\"us\"],\n },\n ],\n actions: {\n ids: [\"id1\", \"id2\"],\n },\n },\n {\n rule_id: \"my-rule2\",\n type: \"pinned\",\n criteria: [\n {\n type: \"fuzzy\",\n metadata: \"user_query\",\n values: [\"rescue dogs\"],\n },\n ],\n actions: {\n docs: [\n {\n _index: \"index1\",\n _id: \"id3\",\n },\n {\n _index: \"index2\",\n _id: \"id4\",\n },\n ],\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.query_rules.put_ruleset(\n ruleset_id: \"my-ruleset\",\n body: {\n \"rules\": [\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"pugs\",\n \"puggles\"\n ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [\n \"us\"\n ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"rescue dogs\"\n ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->queryRules()->putRuleset([\n \"ruleset_id\" => \"my-ruleset\",\n \"body\" => [\n \"rules\" => array(\n [\n \"rule_id\" => \"my-rule1\",\n \"type\" => \"pinned\",\n \"criteria\" => array(\n [\n \"type\" => \"contains\",\n \"metadata\" => \"user_query\",\n \"values\" => array(\n \"pugs\",\n \"puggles\",\n ),\n ],\n [\n \"type\" => \"exact\",\n \"metadata\" => \"user_country\",\n \"values\" => array(\n \"us\",\n ),\n ],\n ),\n \"actions\" => [\n \"ids\" => array(\n \"id1\",\n \"id2\",\n ),\n ],\n ],\n [\n \"rule_id\" => \"my-rule2\",\n \"type\" => \"pinned\",\n \"criteria\" => array(\n [\n \"type\" => \"fuzzy\",\n \"metadata\" => \"user_query\",\n \"values\" => array(\n \"rescue dogs\",\n ),\n ],\n ),\n \"actions\" => [\n \"docs\" => array(\n [\n \"_index\" => \"index1\",\n \"_id\" => \"id3\",\n ],\n [\n \"_index\" => \"index2\",\n \"_id\" => \"id4\",\n ],\n ),\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"rules\":[{\"rule_id\":\"my-rule1\",\"type\":\"pinned\",\"criteria\":[{\"type\":\"contains\",\"metadata\":\"user_query\",\"values\":[\"pugs\",\"puggles\"]},{\"type\":\"exact\",\"metadata\":\"user_country\",\"values\":[\"us\"]}],\"actions\":{\"ids\":[\"id1\",\"id2\"]}},{\"rule_id\":\"my-rule2\",\"type\":\"pinned\",\"criteria\":[{\"type\":\"fuzzy\",\"metadata\":\"user_query\",\"values\":[\"rescue dogs\"]}],\"actions\":{\"docs\":[{\"_index\":\"index1\",\"_id\":\"id3\"},{\"_index\":\"index2\",\"_id\":\"id4\"}]}}]}' \"$ELASTICSEARCH_URL/_query_rules/my-ruleset\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -43189,32 +30007,6 @@ } }, "x-state": "Generally available; Added in 8.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _query_rules/my-ruleset/\n" - }, - { - "lang": "Python", - "source": "resp = client.query_rules.delete_ruleset(\n ruleset_id=\"my-ruleset\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.queryRules.deleteRuleset({\n ruleset_id: \"my-ruleset\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.query_rules.delete_ruleset(\n ruleset_id: \"my-ruleset\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->queryRules()->deleteRuleset([\n \"ruleset_id\" => \"my-ruleset\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_query_rules/my-ruleset/\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -43282,32 +30074,6 @@ } }, "x-state": "Generally available; Added in 8.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _query_rules/?from=0&size=3\n" - }, - { - "lang": "Python", - "source": "resp = client.query_rules.list_rulesets(\n from=\"0\",\n size=\"3\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.queryRules.listRulesets({\n from: 0,\n size: 3,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.query_rules.list_rulesets(\n from: \"0\",\n size: \"3\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->queryRules()->listRulesets([\n \"from\" => \"0\",\n \"size\" => \"3\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_query_rules/?from=0&size=3\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -43394,32 +30160,6 @@ } }, "x-state": "Generally available; Added in 8.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _query_rules/my-ruleset\n{\n \"rules\": [\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [ \"pugs\", \"puggles\" ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [ \"us\" ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [ \"rescue dogs\" ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.query_rules.put_ruleset(\n ruleset_id=\"my-ruleset\",\n rules=[\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"pugs\",\n \"puggles\"\n ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [\n \"us\"\n ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"rescue dogs\"\n ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.queryRules.putRuleset({\n ruleset_id: \"my-ruleset\",\n rules: [\n {\n rule_id: \"my-rule1\",\n type: \"pinned\",\n criteria: [\n {\n type: \"contains\",\n metadata: \"user_query\",\n values: [\"pugs\", \"puggles\"],\n },\n {\n type: \"exact\",\n metadata: \"user_country\",\n values: [\"us\"],\n },\n ],\n actions: {\n ids: [\"id1\", \"id2\"],\n },\n },\n {\n rule_id: \"my-rule2\",\n type: \"pinned\",\n criteria: [\n {\n type: \"fuzzy\",\n metadata: \"user_query\",\n values: [\"rescue dogs\"],\n },\n ],\n actions: {\n docs: [\n {\n _index: \"index1\",\n _id: \"id3\",\n },\n {\n _index: \"index2\",\n _id: \"id4\",\n },\n ],\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.query_rules.put_ruleset(\n ruleset_id: \"my-ruleset\",\n body: {\n \"rules\": [\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"pugs\",\n \"puggles\"\n ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [\n \"us\"\n ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"rescue dogs\"\n ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->queryRules()->putRuleset([\n \"ruleset_id\" => \"my-ruleset\",\n \"body\" => [\n \"rules\" => array(\n [\n \"rule_id\" => \"my-rule1\",\n \"type\" => \"pinned\",\n \"criteria\" => array(\n [\n \"type\" => \"contains\",\n \"metadata\" => \"user_query\",\n \"values\" => array(\n \"pugs\",\n \"puggles\",\n ),\n ],\n [\n \"type\" => \"exact\",\n \"metadata\" => \"user_country\",\n \"values\" => array(\n \"us\",\n ),\n ],\n ),\n \"actions\" => [\n \"ids\" => array(\n \"id1\",\n \"id2\",\n ),\n ],\n ],\n [\n \"rule_id\" => \"my-rule2\",\n \"type\" => \"pinned\",\n \"criteria\" => array(\n [\n \"type\" => \"fuzzy\",\n \"metadata\" => \"user_query\",\n \"values\" => array(\n \"rescue dogs\",\n ),\n ],\n ),\n \"actions\" => [\n \"docs\" => array(\n [\n \"_index\" => \"index1\",\n \"_id\" => \"id3\",\n ],\n [\n \"_index\" => \"index2\",\n \"_id\" => \"id4\",\n ],\n ),\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"rules\":[{\"rule_id\":\"my-rule1\",\"type\":\"pinned\",\"criteria\":[{\"type\":\"contains\",\"metadata\":\"user_query\",\"values\":[\"pugs\",\"puggles\"]},{\"type\":\"exact\",\"metadata\":\"user_country\",\"values\":[\"us\"]}],\"actions\":{\"ids\":[\"id1\",\"id2\"]}},{\"rule_id\":\"my-rule2\",\"type\":\"pinned\",\"criteria\":[{\"type\":\"fuzzy\",\"metadata\":\"user_query\",\"values\":[\"rescue dogs\"]}],\"actions\":{\"docs\":[{\"_index\":\"index1\",\"_id\":\"id3\"},{\"_index\":\"index2\",\"_id\":\"id4\"}]}}]}' \"$ELASTICSEARCH_URL/_query_rules/my-ruleset\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -43454,32 +30194,6 @@ } }, "x-state": "Generally available; Added in 6.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_rank_eval\n{\n \"requests\": [\n {\n \"id\": \"JFK query\",\n \"request\": { \"query\": { \"match_all\": {} } },\n \"ratings\": []\n } ],\n \"metric\": {\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": false\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.rank_eval(\n index=\"my-index-000001\",\n requests=[\n {\n \"id\": \"JFK query\",\n \"request\": {\n \"query\": {\n \"match_all\": {}\n }\n },\n \"ratings\": []\n }\n ],\n metric={\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": False\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.rankEval({\n index: \"my-index-000001\",\n requests: [\n {\n id: \"JFK query\",\n request: {\n query: {\n match_all: {},\n },\n },\n ratings: [],\n },\n ],\n metric: {\n precision: {\n k: 20,\n relevant_rating_threshold: 1,\n ignore_unlabeled: false,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.rank_eval(\n index: \"my-index-000001\",\n body: {\n \"requests\": [\n {\n \"id\": \"JFK query\",\n \"request\": {\n \"query\": {\n \"match_all\": {}\n }\n },\n \"ratings\": []\n }\n ],\n \"metric\": {\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": false\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->rankEval([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"requests\" => array(\n [\n \"id\" => \"JFK query\",\n \"request\" => [\n \"query\" => [\n \"match_all\" => new ArrayObject([]),\n ],\n ],\n \"ratings\" => array(\n ),\n ],\n ),\n \"metric\" => [\n \"precision\" => [\n \"k\" => 20,\n \"relevant_rating_threshold\" => 1,\n \"ignore_unlabeled\" => false,\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"requests\":[{\"id\":\"JFK query\",\"request\":{\"query\":{\"match_all\":{}}},\"ratings\":[]}],\"metric\":{\"precision\":{\"k\":20,\"relevant_rating_threshold\":1,\"ignore_unlabeled\":false}}}' \"$ELASTICSEARCH_URL/my-index-000001/_rank_eval\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -43512,32 +30226,6 @@ } }, "x-state": "Generally available; Added in 6.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_rank_eval\n{\n \"requests\": [\n {\n \"id\": \"JFK query\",\n \"request\": { \"query\": { \"match_all\": {} } },\n \"ratings\": []\n } ],\n \"metric\": {\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": false\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.rank_eval(\n index=\"my-index-000001\",\n requests=[\n {\n \"id\": \"JFK query\",\n \"request\": {\n \"query\": {\n \"match_all\": {}\n }\n },\n \"ratings\": []\n }\n ],\n metric={\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": False\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.rankEval({\n index: \"my-index-000001\",\n requests: [\n {\n id: \"JFK query\",\n request: {\n query: {\n match_all: {},\n },\n },\n ratings: [],\n },\n ],\n metric: {\n precision: {\n k: 20,\n relevant_rating_threshold: 1,\n ignore_unlabeled: false,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.rank_eval(\n index: \"my-index-000001\",\n body: {\n \"requests\": [\n {\n \"id\": \"JFK query\",\n \"request\": {\n \"query\": {\n \"match_all\": {}\n }\n },\n \"ratings\": []\n }\n ],\n \"metric\": {\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": false\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->rankEval([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"requests\" => array(\n [\n \"id\" => \"JFK query\",\n \"request\" => [\n \"query\" => [\n \"match_all\" => new ArrayObject([]),\n ],\n ],\n \"ratings\" => array(\n ),\n ],\n ),\n \"metric\" => [\n \"precision\" => [\n \"k\" => 20,\n \"relevant_rating_threshold\" => 1,\n \"ignore_unlabeled\" => false,\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"requests\":[{\"id\":\"JFK query\",\"request\":{\"query\":{\"match_all\":{}}},\"ratings\":[]}],\"metric\":{\"precision\":{\"k\":20,\"relevant_rating_threshold\":1,\"ignore_unlabeled\":false}}}' \"$ELASTICSEARCH_URL/my-index-000001/_rank_eval\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -43575,32 +30263,6 @@ } }, "x-state": "Generally available; Added in 6.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_rank_eval\n{\n \"requests\": [\n {\n \"id\": \"JFK query\",\n \"request\": { \"query\": { \"match_all\": {} } },\n \"ratings\": []\n } ],\n \"metric\": {\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": false\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.rank_eval(\n index=\"my-index-000001\",\n requests=[\n {\n \"id\": \"JFK query\",\n \"request\": {\n \"query\": {\n \"match_all\": {}\n }\n },\n \"ratings\": []\n }\n ],\n metric={\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": False\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.rankEval({\n index: \"my-index-000001\",\n requests: [\n {\n id: \"JFK query\",\n request: {\n query: {\n match_all: {},\n },\n },\n ratings: [],\n },\n ],\n metric: {\n precision: {\n k: 20,\n relevant_rating_threshold: 1,\n ignore_unlabeled: false,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.rank_eval(\n index: \"my-index-000001\",\n body: {\n \"requests\": [\n {\n \"id\": \"JFK query\",\n \"request\": {\n \"query\": {\n \"match_all\": {}\n }\n },\n \"ratings\": []\n }\n ],\n \"metric\": {\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": false\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->rankEval([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"requests\" => array(\n [\n \"id\" => \"JFK query\",\n \"request\" => [\n \"query\" => [\n \"match_all\" => new ArrayObject([]),\n ],\n ],\n \"ratings\" => array(\n ),\n ],\n ),\n \"metric\" => [\n \"precision\" => [\n \"k\" => 20,\n \"relevant_rating_threshold\" => 1,\n \"ignore_unlabeled\" => false,\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"requests\":[{\"id\":\"JFK query\",\"request\":{\"query\":{\"match_all\":{}}},\"ratings\":[]}],\"metric\":{\"precision\":{\"k\":20,\"relevant_rating_threshold\":1,\"ignore_unlabeled\":false}}}' \"$ELASTICSEARCH_URL/my-index-000001/_rank_eval\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -43636,32 +30298,6 @@ } }, "x-state": "Generally available; Added in 6.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_rank_eval\n{\n \"requests\": [\n {\n \"id\": \"JFK query\",\n \"request\": { \"query\": { \"match_all\": {} } },\n \"ratings\": []\n } ],\n \"metric\": {\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": false\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.rank_eval(\n index=\"my-index-000001\",\n requests=[\n {\n \"id\": \"JFK query\",\n \"request\": {\n \"query\": {\n \"match_all\": {}\n }\n },\n \"ratings\": []\n }\n ],\n metric={\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": False\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.rankEval({\n index: \"my-index-000001\",\n requests: [\n {\n id: \"JFK query\",\n request: {\n query: {\n match_all: {},\n },\n },\n ratings: [],\n },\n ],\n metric: {\n precision: {\n k: 20,\n relevant_rating_threshold: 1,\n ignore_unlabeled: false,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.rank_eval(\n index: \"my-index-000001\",\n body: {\n \"requests\": [\n {\n \"id\": \"JFK query\",\n \"request\": {\n \"query\": {\n \"match_all\": {}\n }\n },\n \"ratings\": []\n }\n ],\n \"metric\": {\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": false\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->rankEval([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"requests\" => array(\n [\n \"id\" => \"JFK query\",\n \"request\" => [\n \"query\" => [\n \"match_all\" => new ArrayObject([]),\n ],\n ],\n \"ratings\" => array(\n ),\n ],\n ),\n \"metric\" => [\n \"precision\" => [\n \"k\" => 20,\n \"relevant_rating_threshold\" => 1,\n \"ignore_unlabeled\" => false,\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"requests\":[{\"id\":\"JFK query\",\"request\":{\"query\":{\"match_all\":{}}},\"ratings\":[]}],\"metric\":{\"precision\":{\"k\":20,\"relevant_rating_threshold\":1,\"ignore_unlabeled\":false}}}' \"$ELASTICSEARCH_URL/my-index-000001/_rank_eval\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -43671,7 +30307,10 @@ "document" ], "summary": "Reindex documents", - "description": "Copy documents from a source to a destination.\nYou can copy all documents to the destination index or reindex a subset of the documents.\nThe source can be any existing index, alias, or data stream.\nThe destination must differ from the source.\nFor example, you cannot reindex a data stream into itself.\n\nIMPORTANT: Reindex requires `_source` to be enabled for all documents in the source.\nThe destination should be configured as wanted before calling the reindex API.\nReindex does not copy the settings from the source or its associated template.\nMappings, shard counts, and replicas, for example, must be configured ahead of time.\n\nIf the Elasticsearch security features are enabled, you must have the following security privileges:\n\n* The `read` index privilege for the source data stream, index, or alias.\n* The `write` index privilege for the destination data stream, index, or index alias.\n* To automatically create a data stream or index with a reindex API request, you must have the `auto_configure`, `create_index`, or `manage` index privilege for the destination data stream, index, or alias.\n* If reindexing from a remote cluster, the `source.remote.user` must have the `monitor` cluster privilege and the `read` index privilege for the source data stream, index, or alias.\n\nIf reindexing from a remote cluster, you must explicitly allow the remote host in the `reindex.remote.whitelist` setting.\nAutomatic data stream creation requires a matching index template with data stream enabled.\n\nThe `dest` element can be configured like the index API to control optimistic concurrency control.\nOmitting `version_type` or setting it to `internal` causes Elasticsearch to blindly dump documents into the destination, overwriting any that happen to have the same ID.\n\nSetting `version_type` to `external` causes Elasticsearch to preserve the `version` from the source, create any documents that are missing, and update any documents that have an older version in the destination than they do in the source.\n\nSetting `op_type` to `create` causes the reindex API to create only missing documents in the destination.\nAll existing documents will cause a version conflict.\n\nIMPORTANT: Because data streams are append-only, any reindex request to a destination data stream must have an `op_type` of `create`.\nA reindex can only add new documents to a destination data stream.\nIt cannot update existing documents in a destination data stream.\n\nBy default, version conflicts abort the reindex process.\nTo continue reindexing if there are conflicts, set the `conflicts` request body property to `proceed`.\nIn this case, the response includes a count of the version conflicts that were encountered.\nNote that the handling of other error types is unaffected by the `conflicts` property.\nAdditionally, if you opt to count version conflicts, the operation could attempt to reindex more documents from the source than `max_docs` until it has successfully indexed `max_docs` documents into the target or it has gone through every document in the source query.\n\nNOTE: The reindex API makes no effort to handle ID collisions.\nThe last document written will \"win\" but the order isn't usually predictable so it is not a good idea to rely on this behavior.\nInstead, make sure that IDs are unique by using a script.\n\n**Running reindex asynchronously**\n\nIf the request contains `wait_for_completion=false`, Elasticsearch performs some preflight checks, launches the request, and returns a task you can use to cancel or get the status of the task.\nElasticsearch creates a record of this task as a document at `_tasks/`.\n\n**Reindex from multiple sources**\n\nIf you have many sources to reindex it is generally better to reindex them one at a time rather than using a glob pattern to pick up multiple sources.\nThat way you can resume the process if there are any errors by removing the partially completed source and starting over.\nIt also makes parallelizing the process fairly simple: split the list of sources to reindex and run each list in parallel.\n\nFor example, you can use a bash script like this:\n\n```\nfor index in i1 i2 i3 i4 i5; do\n curl -HContent-Type:application/json -XPOST localhost:9200/_reindex?pretty -d'{\n \"source\": {\n \"index\": \"'$index'\"\n },\n \"dest\": {\n \"index\": \"'$index'-reindexed\"\n }\n }'\ndone\n```\n\n**Throttling**\n\nSet `requests_per_second` to any positive decimal number (`1.4`, `6`, `1000`, for example) to throttle the rate at which reindex issues batches of index operations.\nRequests are throttled by padding each batch with a wait time.\nTo turn off throttling, set `requests_per_second` to `-1`.\n\nThe throttling is done by waiting between batches so that the scroll that reindex uses internally can be given a timeout that takes into account the padding.\nThe padding time is the difference between the batch size divided by the `requests_per_second` and the time spent writing.\nBy default the batch size is `1000`, so if `requests_per_second` is set to `500`:\n\n```\ntarget_time = 1000 / 500 per second = 2 seconds\nwait_time = target_time - write_time = 2 seconds - .5 seconds = 1.5 seconds\n```\n\nSince the batch is issued as a single bulk request, large batch sizes cause Elasticsearch to create many requests and then wait for a while before starting the next set.\nThis is \"bursty\" instead of \"smooth\".\n\n**Slicing**\n\nReindex supports sliced scroll to parallelize the reindexing process.\nThis parallelization can improve efficiency and provide a convenient way to break the request down into smaller parts.\n\nNOTE: Reindexing from remote clusters does not support manual or automatic slicing.\n\nYou can slice a reindex request manually by providing a slice ID and total number of slices to each request.\nYou can also let reindex automatically parallelize by using sliced scroll to slice on `_id`.\nThe `slices` parameter specifies the number of slices to use.\n\nAdding `slices` to the reindex request just automates the manual process, creating sub-requests which means it has some quirks:\n\n* You can see these requests in the tasks API. These sub-requests are \"child\" tasks of the task for the request with slices.\n* Fetching the status of the task for the request with `slices` only contains the status of completed slices.\n* These sub-requests are individually addressable for things like cancellation and rethrottling.\n* Rethrottling the request with `slices` will rethrottle the unfinished sub-request proportionally.\n* Canceling the request with `slices` will cancel each sub-request.\n* Due to the nature of `slices`, each sub-request won't get a perfectly even portion of the documents. All documents will be addressed, but some slices may be larger than others. Expect larger slices to have a more even distribution.\n* Parameters like `requests_per_second` and `max_docs` on a request with `slices` are distributed proportionally to each sub-request. Combine that with the previous point about distribution being uneven and you should conclude that using `max_docs` with `slices` might not result in exactly `max_docs` documents being reindexed.\n* Each sub-request gets a slightly different snapshot of the source, though these are all taken at approximately the same time.\n\nIf slicing automatically, setting `slices` to `auto` will choose a reasonable number for most indices.\nIf slicing manually or otherwise tuning automatic slicing, use the following guidelines.\n\nQuery performance is most efficient when the number of slices is equal to the number of shards in the index.\nIf that number is large (for example, `500`), choose a lower number as too many slices will hurt performance.\nSetting slices higher than the number of shards generally does not improve efficiency and adds overhead.\n\nIndexing performance scales linearly across available resources with the number of slices.\n\nWhether query or indexing performance dominates the runtime depends on the documents being reindexed and cluster resources.\n\n**Modify documents during reindexing**\n\nLike `_update_by_query`, reindex operations support a script that modifies the document.\nUnlike `_update_by_query`, the script is allowed to modify the document's metadata.\n\nJust as in `_update_by_query`, you can set `ctx.op` to change the operation that is run on the destination.\nFor example, set `ctx.op` to `noop` if your script decides that the document doesn’t have to be indexed in the destination. This \"no operation\" will be reported in the `noop` counter in the response body.\nSet `ctx.op` to `delete` if your script decides that the document must be deleted from the destination.\nThe deletion will be reported in the `deleted` counter in the response body.\nSetting `ctx.op` to anything else will return an error, as will setting any other field in `ctx`.\n\nThink of the possibilities! Just be careful; you are able to change:\n\n* `_id`\n* `_index`\n* `_version`\n* `_routing`\n\nSetting `_version` to `null` or clearing it from the `ctx` map is just like not sending the version in an indexing request.\nIt will cause the document to be overwritten in the destination regardless of the version on the target or the version type you use in the reindex API.\n\n**Reindex from remote**\n\nReindex supports reindexing from a remote Elasticsearch cluster.\nThe `host` parameter must contain a scheme, host, port, and optional path.\nThe `username` and `password` parameters are optional and when they are present the reindex operation will connect to the remote Elasticsearch node using basic authentication.\nBe sure to use HTTPS when using basic authentication or the password will be sent in plain text.\nThere are a range of settings available to configure the behavior of the HTTPS connection.\n\nWhen using Elastic Cloud, it is also possible to authenticate against the remote cluster through the use of a valid API key.\nRemote hosts must be explicitly allowed with the `reindex.remote.whitelist` setting.\nIt can be set to a comma delimited list of allowed remote host and port combinations.\nScheme is ignored; only the host and port are used.\nFor example:\n\n```\nreindex.remote.whitelist: [otherhost:9200, another:9200, 127.0.10.*:9200, localhost:*\"]\n```\n\nThe list of allowed hosts must be configured on any nodes that will coordinate the reindex.\nThis feature should work with remote clusters of any version of Elasticsearch.\nThis should enable you to upgrade from any version of Elasticsearch to the current version by reindexing from a cluster of the old version.\n\nWARNING: Elasticsearch does not support forward compatibility across major versions.\nFor example, you cannot reindex from a 7.x cluster into a 6.x cluster.\n\nTo enable queries sent to older versions of Elasticsearch, the `query` parameter is sent directly to the remote host without validation or modification.\n\nNOTE: Reindexing from remote clusters does not support manual or automatic slicing.\n\nReindexing from a remote server uses an on-heap buffer that defaults to a maximum size of 100mb.\nIf the remote index includes very large documents you'll need to use a smaller batch size.\nIt is also possible to set the socket read timeout on the remote connection with the `socket_timeout` field and the connection timeout with the `connect_timeout` field.\nBoth default to 30 seconds.\n\n**Configuring SSL parameters**\n\nReindex from remote supports configurable SSL settings.\nThese must be specified in the `elasticsearch.yml` file, with the exception of the secure settings, which you add in the Elasticsearch keystore.\nIt is not possible to configure SSL in the body of the reindex request.\n\n## Required authorization\n\n* Index privileges: `read`,`write`\n", + "description": "Copy documents from a source to a destination.\nYou can copy all documents to the destination index or reindex a subset of the documents.\nThe source can be any existing index, alias, or data stream.\nThe destination must differ from the source.\nFor example, you cannot reindex a data stream into itself.\n\nIMPORTANT: Reindex requires `_source` to be enabled for all documents in the source.\nThe destination should be configured as wanted before calling the reindex API.\nReindex does not copy the settings from the source or its associated template.\nMappings, shard counts, and replicas, for example, must be configured ahead of time.\n\nIf the Elasticsearch security features are enabled, you must have the following security privileges:\n\n* The `read` index privilege for the source data stream, index, or alias.\n* The `write` index privilege for the destination data stream, index, or index alias.\n* To automatically create a data stream or index with a reindex API request, you must have the `auto_configure`, `create_index`, or `manage` index privilege for the destination data stream, index, or alias.\n* If reindexing from a remote cluster, the `source.remote.user` must have the `monitor` cluster privilege and the `read` index privilege for the source data stream, index, or alias.\n\nIf reindexing from a remote cluster, you must explicitly allow the remote host in the `reindex.remote.whitelist` setting.\nAutomatic data stream creation requires a matching index template with data stream enabled.\n\nThe `dest` element can be configured like the index API to control optimistic concurrency control.\nOmitting `version_type` or setting it to `internal` causes Elasticsearch to blindly dump documents into the destination, overwriting any that happen to have the same ID.\n\nSetting `version_type` to `external` causes Elasticsearch to preserve the `version` from the source, create any documents that are missing, and update any documents that have an older version in the destination than they do in the source.\n\nSetting `op_type` to `create` causes the reindex API to create only missing documents in the destination.\nAll existing documents will cause a version conflict.\n\nIMPORTANT: Because data streams are append-only, any reindex request to a destination data stream must have an `op_type` of `create`.\nA reindex can only add new documents to a destination data stream.\nIt cannot update existing documents in a destination data stream.\n\nBy default, version conflicts abort the reindex process.\nTo continue reindexing if there are conflicts, set the `conflicts` request body property to `proceed`.\nIn this case, the response includes a count of the version conflicts that were encountered.\nNote that the handling of other error types is unaffected by the `conflicts` property.\nAdditionally, if you opt to count version conflicts, the operation could attempt to reindex more documents from the source than `max_docs` until it has successfully indexed `max_docs` documents into the target or it has gone through every document in the source query.\n\nRefer to the linked documentation for examples of how to reindex documents.\n\n## Required authorization\n\n* Index privileges: `read`,`write`\n", + "externalDocs": { + "url": "https://www.elastic.co/docs/reference/elasticsearch/rest-apis/reindex-indices" + }, "operationId": "reindex", "parameters": [ { @@ -43791,66 +30430,6 @@ "summary": "Reindex multiple sources", "description": "Run `POST _reindex` to reindex from multiple sources. The `index` attribute in source can be a list, which enables you to copy from lots of sources in one request. This example copies documents from the `my-index-000001` and `my-index-000002` indices.\n", "value": "{\n \"source\": {\n \"index\": [\"my-index-000001\", \"my-index-000002\"]\n },\n \"dest\": {\n \"index\": \"my-new-index-000002\"\n }\n}" - }, - "ReindexRequestExample10": { - "summary": "Reindex with Painless", - "description": "You can use Painless to reindex daily indices to apply a new template to the existing documents. The script extracts the date from the index name and creates a new index with `-1` appended. For example, all data from `metricbeat-2016.05.31` will be reindexed into `metricbeat-2016.05.31-1`.\n", - "value": "{\n \"source\": {\n \"index\": \"metricbeat-*\"\n },\n \"dest\": {\n \"index\": \"metricbeat\"\n },\n \"script\": {\n \"lang\": \"painless\",\n \"source\": \"ctx._index = 'metricbeat-' + (ctx._index.substring('metricbeat-'.length(), ctx._index.length())) + '-1'\"\n }\n}" - }, - "ReindexRequestExample11": { - "summary": "Reindex a random subset", - "description": "Run `POST _reindex` to extract a random subset of the source for testing. You might need to adjust the `min_score` value depending on the relative amount of data extracted from source.\n", - "value": "{\n \"max_docs\": 10,\n \"source\": {\n \"index\": \"my-index-000001\",\n \"query\": {\n \"function_score\" : {\n \"random_score\" : {},\n \"min_score\" : 0.9\n }\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - }, - "ReindexRequestExample12": { - "summary": "Reindex modified documents", - "description": "Run `POST _reindex` to modify documents during reindexing. This example bumps the version of the source document.\n", - "value": "{\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\",\n \"version_type\": \"external\"\n },\n \"script\": {\n \"source\": \"if (ctx._source.foo == 'bar') {ctx._version++; ctx._source.remove('foo')}\",\n \"lang\": \"painless\"\n }\n}" - }, - "ReindexRequestExample13": { - "summary": "Reindex from remote on Elastic Cloud", - "description": "When using Elastic Cloud, you can run `POST _reindex` and authenticate against a remote cluster with an API key.\n", - "value": "{\n \"source\": {\n \"remote\": {\n \"host\": \"http://otherhost:9200\",\n \"username\": \"user\",\n \"password\": \"pass\"\n },\n \"index\": \"my-index-000001\",\n \"query\": {\n \"match\": {\n \"test\": \"data\"\n }\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - }, - "ReindexRequestExample2": { - "summary": "Manual slicing", - "description": "Run `POST _reindex` to slice a reindex request manually. Provide a slice ID and total number of slices to each request.\n", - "value": "{\n \"source\": {\n \"index\": \"my-index-000001\",\n \"slice\": {\n \"id\": 0,\n \"max\": 2\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - }, - "ReindexRequestExample3": { - "summary": "Automatic slicing", - "description": "Run `POST _reindex?slices=5&refresh` to automatically parallelize using sliced scroll to slice on `_id`. The `slices` parameter specifies the number of slices to use.\n", - "value": "{\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - }, - "ReindexRequestExample4": { - "summary": "Routing", - "description": "By default if reindex sees a document with routing then the routing is preserved unless it's changed by the script. You can set `routing` on the `dest` request to change this behavior. In this example, run `POST _reindex` to copy all documents from the `source` with the company name `cat` into the `dest` with routing set to `cat`.\n", - "value": "{\n \"source\": {\n \"index\": \"source\",\n \"query\": {\n \"match\": {\n \"company\": \"cat\"\n }\n }\n },\n \"dest\": {\n \"index\": \"dest\",\n \"routing\": \"=cat\"\n }\n}" - }, - "ReindexRequestExample5": { - "summary": "Ingest pipelines", - "description": "Run `POST _reindex` and use the ingest pipelines feature.", - "value": "{\n \"source\": {\n \"index\": \"source\"\n },\n \"dest\": {\n \"index\": \"dest\",\n \"pipeline\": \"some_ingest_pipeline\"\n }\n}" - }, - "ReindexRequestExample6": { - "summary": "Reindex with a query", - "description": "Run `POST _reindex` and add a query to the `source` to limit the documents to reindex. For example, this request copies documents into `my-new-index-000001` only if they have a `user.id` of `kimchy`.\n", - "value": "{\n \"source\": {\n \"index\": \"my-index-000001\",\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - }, - "ReindexRequestExample7": { - "summary": "Reindex with max_docs", - "description": "You can limit the number of processed documents by setting `max_docs`. For example, run `POST _reindex` to copy a single document from `my-index-000001` to `my-new-index-000001`.\n", - "value": "{\n \"max_docs\": 1,\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - }, - "ReindexRequestExample8": { - "summary": "Reindex selected fields", - "description": "You can use source filtering to reindex a subset of the fields in the original documents. For example, run `POST _reindex` the reindex only the `user.id` and `_doc` fields of each document.\n", - "value": "{\n \"source\": {\n \"index\": \"my-index-000001\",\n \"_source\": [\"user.id\", \"_doc\"]\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - }, - "ReindexRequestExample9": { - "summary": "Reindex new field names", - "description": "A reindex operation can build a copy of an index with renamed fields. If your index has documents with `text` and `flag` fields, you can change the latter field name to `tag` during the reindex.\n", - "value": "{\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n },\n \"script\": {\n \"source\": \"ctx._source.tag = ctx._source.remove(\\\"flag\\\")\"\n }\n}" } } } @@ -43933,32 +30512,6 @@ } }, "x-state": "Generally available; Added in 2.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _reindex\n{\n \"source\": {\n \"index\": [\"my-index-000001\", \"my-index-000002\"]\n },\n \"dest\": {\n \"index\": \"my-new-index-000002\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.reindex(\n source={\n \"index\": [\n \"my-index-000001\",\n \"my-index-000002\"\n ]\n },\n dest={\n \"index\": \"my-new-index-000002\"\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.reindex({\n source: {\n index: [\"my-index-000001\", \"my-index-000002\"],\n },\n dest: {\n index: \"my-new-index-000002\",\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.reindex(\n body: {\n \"source\": {\n \"index\": [\n \"my-index-000001\",\n \"my-index-000002\"\n ]\n },\n \"dest\": {\n \"index\": \"my-new-index-000002\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->reindex([\n \"body\" => [\n \"source\" => [\n \"index\" => array(\n \"my-index-000001\",\n \"my-index-000002\",\n ),\n ],\n \"dest\" => [\n \"index\" => \"my-new-index-000002\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":[\"my-index-000001\",\"my-index-000002\"]},\"dest\":{\"index\":\"my-new-index-000002\"}}' \"$ELASTICSEARCH_URL/_reindex\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -44017,32 +30570,6 @@ } }, "x-state": "Generally available; Added in 2.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _reindex/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1\n" - }, - { - "lang": "Python", - "source": "resp = client.reindex_rethrottle(\n task_id=\"r1A2WoRbTwKZ516z6NEs5A:36619\",\n requests_per_second=\"-1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.reindexRethrottle({\n task_id: \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n requests_per_second: \"-1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.reindex_rethrottle(\n task_id: \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n requests_per_second: \"-1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->reindexRethrottle([\n \"task_id\" => \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n \"requests_per_second\" => \"-1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_reindex/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -44063,32 +30590,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _render/template\n{\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.render_search_template(\n id=\"my-search-template\",\n params={\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.renderSearchTemplate({\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 20,\n size: 10,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.render_search_template(\n body: {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->renderSearchTemplate([\n \"body\" => [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 20,\n \"size\" => 10,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":20,\"size\":10}}' \"$ELASTICSEARCH_URL/_render/template\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -44107,32 +30608,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _render/template\n{\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.render_search_template(\n id=\"my-search-template\",\n params={\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.renderSearchTemplate({\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 20,\n size: 10,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.render_search_template(\n body: {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->renderSearchTemplate([\n \"body\" => [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 20,\n \"size\" => 10,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":20,\"size\":10}}' \"$ELASTICSEARCH_URL/_render/template\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -44158,32 +30633,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _render/template\n{\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.render_search_template(\n id=\"my-search-template\",\n params={\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.renderSearchTemplate({\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 20,\n size: 10,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.render_search_template(\n body: {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->renderSearchTemplate([\n \"body\" => [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 20,\n \"size\" => 10,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":20,\"size\":10}}' \"$ELASTICSEARCH_URL/_render/template\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -44207,32 +30656,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _render/template\n{\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.render_search_template(\n id=\"my-search-template\",\n params={\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.renderSearchTemplate({\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 20,\n size: 10,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.render_search_template(\n body: {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->renderSearchTemplate([\n \"body\" => [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 20,\n \"size\" => 10,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":20,\"size\":10}}' \"$ELASTICSEARCH_URL/_render/template\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -44256,32 +30679,6 @@ }, "deprecated": true, "x-state": "Technical preview; Added in 6.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _rollup/job/sensor\n" - }, - { - "lang": "Python", - "source": "resp = client.rollup.get_jobs(\n id=\"sensor\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.rollup.getJobs({\n id: \"sensor\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.rollup.get_jobs(\n id: \"sensor\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->rollup()->getJobs([\n \"id\" => \"sensor\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_rollup/job/sensor\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -44379,32 +30776,6 @@ }, "deprecated": true, "x-state": "Technical preview; Added in 6.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _rollup/job/sensor\n{\n \"index_pattern\": \"sensor-*\",\n \"rollup_index\": \"sensor_rollup\",\n \"cron\": \"*/30 * * * * ?\",\n \"page_size\": 1000,\n \"groups\": {\n \"date_histogram\": {\n \"field\": \"timestamp\",\n \"fixed_interval\": \"1h\",\n \"delay\": \"7d\"\n },\n \"terms\": {\n \"fields\": [ \"node\" ]\n }\n },\n \"metrics\": [\n {\n \"field\": \"temperature\",\n \"metrics\": [ \"min\", \"max\", \"sum\" ]\n },\n {\n \"field\": \"voltage\",\n \"metrics\": [ \"avg\" ]\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.rollup.put_job(\n id=\"sensor\",\n index_pattern=\"sensor-*\",\n rollup_index=\"sensor_rollup\",\n cron=\"*/30 * * * * ?\",\n page_size=1000,\n groups={\n \"date_histogram\": {\n \"field\": \"timestamp\",\n \"fixed_interval\": \"1h\",\n \"delay\": \"7d\"\n },\n \"terms\": {\n \"fields\": [\n \"node\"\n ]\n }\n },\n metrics=[\n {\n \"field\": \"temperature\",\n \"metrics\": [\n \"min\",\n \"max\",\n \"sum\"\n ]\n },\n {\n \"field\": \"voltage\",\n \"metrics\": [\n \"avg\"\n ]\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.rollup.putJob({\n id: \"sensor\",\n index_pattern: \"sensor-*\",\n rollup_index: \"sensor_rollup\",\n cron: \"*/30 * * * * ?\",\n page_size: 1000,\n groups: {\n date_histogram: {\n field: \"timestamp\",\n fixed_interval: \"1h\",\n delay: \"7d\",\n },\n terms: {\n fields: [\"node\"],\n },\n },\n metrics: [\n {\n field: \"temperature\",\n metrics: [\"min\", \"max\", \"sum\"],\n },\n {\n field: \"voltage\",\n metrics: [\"avg\"],\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.rollup.put_job(\n id: \"sensor\",\n body: {\n \"index_pattern\": \"sensor-*\",\n \"rollup_index\": \"sensor_rollup\",\n \"cron\": \"*/30 * * * * ?\",\n \"page_size\": 1000,\n \"groups\": {\n \"date_histogram\": {\n \"field\": \"timestamp\",\n \"fixed_interval\": \"1h\",\n \"delay\": \"7d\"\n },\n \"terms\": {\n \"fields\": [\n \"node\"\n ]\n }\n },\n \"metrics\": [\n {\n \"field\": \"temperature\",\n \"metrics\": [\n \"min\",\n \"max\",\n \"sum\"\n ]\n },\n {\n \"field\": \"voltage\",\n \"metrics\": [\n \"avg\"\n ]\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->rollup()->putJob([\n \"id\" => \"sensor\",\n \"body\" => [\n \"index_pattern\" => \"sensor-*\",\n \"rollup_index\" => \"sensor_rollup\",\n \"cron\" => \"*/30 * * * * ?\",\n \"page_size\" => 1000,\n \"groups\" => [\n \"date_histogram\" => [\n \"field\" => \"timestamp\",\n \"fixed_interval\" => \"1h\",\n \"delay\" => \"7d\",\n ],\n \"terms\" => [\n \"fields\" => array(\n \"node\",\n ),\n ],\n ],\n \"metrics\" => array(\n [\n \"field\" => \"temperature\",\n \"metrics\" => array(\n \"min\",\n \"max\",\n \"sum\",\n ),\n ],\n [\n \"field\" => \"voltage\",\n \"metrics\" => array(\n \"avg\",\n ),\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_pattern\":\"sensor-*\",\"rollup_index\":\"sensor_rollup\",\"cron\":\"*/30 * * * * ?\",\"page_size\":1000,\"groups\":{\"date_histogram\":{\"field\":\"timestamp\",\"fixed_interval\":\"1h\",\"delay\":\"7d\"},\"terms\":{\"fields\":[\"node\"]}},\"metrics\":[{\"field\":\"temperature\",\"metrics\":[\"min\",\"max\",\"sum\"]},{\"field\":\"voltage\",\"metrics\":[\"avg\"]}]}' \"$ELASTICSEARCH_URL/_rollup/job/sensor\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -44461,32 +30832,6 @@ }, "deprecated": true, "x-state": "Technical preview; Added in 6.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _rollup/job/sensor\n" - }, - { - "lang": "Python", - "source": "resp = client.rollup.delete_job(\n id=\"sensor\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.rollup.deleteJob({\n id: \"sensor\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.rollup.delete_job(\n id: \"sensor\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->rollup()->deleteJob([\n \"id\" => \"sensor\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_rollup/job/sensor\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -44505,32 +30850,6 @@ }, "deprecated": true, "x-state": "Technical preview; Added in 6.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _rollup/job/sensor\n" - }, - { - "lang": "Python", - "source": "resp = client.rollup.get_jobs(\n id=\"sensor\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.rollup.getJobs({\n id: \"sensor\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.rollup.get_jobs(\n id: \"sensor\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->rollup()->getJobs([\n \"id\" => \"sensor\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_rollup/job/sensor\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -44554,32 +30873,6 @@ }, "deprecated": true, "x-state": "Technical preview; Added in 6.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _rollup/data/sensor-*\n" - }, - { - "lang": "Python", - "source": "resp = client.rollup.get_rollup_caps(\n id=\"sensor-*\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.rollup.getRollupCaps({\n id: \"sensor-*\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.rollup.get_rollup_caps(\n id: \"sensor-*\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->rollup()->getRollupCaps([\n \"id\" => \"sensor-*\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_rollup/data/sensor-*\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -44598,32 +30891,6 @@ }, "deprecated": true, "x-state": "Technical preview; Added in 6.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _rollup/data/sensor-*\n" - }, - { - "lang": "Python", - "source": "resp = client.rollup.get_rollup_caps(\n id=\"sensor-*\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.rollup.getRollupCaps({\n id: \"sensor-*\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.rollup.get_rollup_caps(\n id: \"sensor-*\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->rollup()->getRollupCaps([\n \"id\" => \"sensor-*\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_rollup/data/sensor-*\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -44671,32 +30938,6 @@ }, "deprecated": true, "x-state": "Technical preview; Added in 6.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /sensor_rollup/_rollup/data\n" - }, - { - "lang": "Python", - "source": "resp = client.rollup.get_rollup_index_caps(\n index=\"sensor_rollup\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.rollup.getRollupIndexCaps({\n index: \"sensor_rollup\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.rollup.get_rollup_index_caps(\n index: \"sensor_rollup\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->rollup()->getRollupIndexCaps([\n \"index\" => \"sensor_rollup\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/sensor_rollup/_rollup/data\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -44729,32 +30970,6 @@ }, "deprecated": true, "x-state": "Technical preview; Added in 6.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /sensor_rollup/_rollup_search\n{\n \"size\": 0,\n \"aggregations\": {\n \"max_temperature\": {\n \"max\": {\n \"field\": \"temperature\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.rollup.rollup_search(\n index=\"sensor_rollup\",\n size=0,\n aggregations={\n \"max_temperature\": {\n \"max\": {\n \"field\": \"temperature\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.rollup.rollupSearch({\n index: \"sensor_rollup\",\n size: 0,\n aggregations: {\n max_temperature: {\n max: {\n field: \"temperature\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.rollup.rollup_search(\n index: \"sensor_rollup\",\n body: {\n \"size\": 0,\n \"aggregations\": {\n \"max_temperature\": {\n \"max\": {\n \"field\": \"temperature\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->rollup()->rollupSearch([\n \"index\" => \"sensor_rollup\",\n \"body\" => [\n \"size\" => 0,\n \"aggregations\" => [\n \"max_temperature\" => [\n \"max\" => [\n \"field\" => \"temperature\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"size\":0,\"aggregations\":{\"max_temperature\":{\"max\":{\"field\":\"temperature\"}}}}' \"$ELASTICSEARCH_URL/sensor_rollup/_rollup_search\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -44785,32 +31000,6 @@ }, "deprecated": true, "x-state": "Technical preview; Added in 6.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /sensor_rollup/_rollup_search\n{\n \"size\": 0,\n \"aggregations\": {\n \"max_temperature\": {\n \"max\": {\n \"field\": \"temperature\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.rollup.rollup_search(\n index=\"sensor_rollup\",\n size=0,\n aggregations={\n \"max_temperature\": {\n \"max\": {\n \"field\": \"temperature\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.rollup.rollupSearch({\n index: \"sensor_rollup\",\n size: 0,\n aggregations: {\n max_temperature: {\n max: {\n field: \"temperature\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.rollup.rollup_search(\n index: \"sensor_rollup\",\n body: {\n \"size\": 0,\n \"aggregations\": {\n \"max_temperature\": {\n \"max\": {\n \"field\": \"temperature\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->rollup()->rollupSearch([\n \"index\" => \"sensor_rollup\",\n \"body\" => [\n \"size\" => 0,\n \"aggregations\" => [\n \"max_temperature\" => [\n \"max\" => [\n \"field\" => \"temperature\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"size\":0,\"aggregations\":{\"max_temperature\":{\"max\":{\"field\":\"temperature\"}}}}' \"$ELASTICSEARCH_URL/sensor_rollup/_rollup_search\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -44863,32 +31052,6 @@ }, "deprecated": true, "x-state": "Technical preview; Added in 6.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _rollup/job/sensor/_start\n" - }, - { - "lang": "Python", - "source": "resp = client.rollup.start_job(\n id=\"sensor\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.rollup.startJob({\n id: \"sensor\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.rollup.start_job(\n id: \"sensor\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->rollup()->startJob([\n \"id\" => \"sensor\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_rollup/job/sensor/_start\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -44955,32 +31118,6 @@ }, "deprecated": true, "x-state": "Technical preview; Added in 6.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _rollup/job/sensor/_stop?wait_for_completion=true&timeout=10s\n" - }, - { - "lang": "Python", - "source": "resp = client.rollup.stop_job(\n id=\"sensor\",\n wait_for_completion=True,\n timeout=\"10s\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.rollup.stopJob({\n id: \"sensor\",\n wait_for_completion: \"true\",\n timeout: \"10s\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.rollup.stop_job(\n id: \"sensor\",\n wait_for_completion: \"true\",\n timeout: \"10s\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->rollup()->stopJob([\n \"id\" => \"sensor\",\n \"wait_for_completion\" => \"true\",\n \"timeout\" => \"10s\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_rollup/job/sensor/_stop?wait_for_completion=true&timeout=10s\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -45001,32 +31138,6 @@ } }, "x-state": "Technical preview; Added in 6.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_scripts/painless/_execute\n{\n \"script\": {\n \"source\": \"params.count / params.total\",\n \"params\": {\n \"count\": 100.0,\n \"total\": 1000.0\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.scripts_painless_execute(\n script={\n \"source\": \"params.count / params.total\",\n \"params\": {\n \"count\": 100,\n \"total\": 1000\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.scriptsPainlessExecute({\n script: {\n source: \"params.count / params.total\",\n params: {\n count: 100,\n total: 1000,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.scripts_painless_execute(\n body: {\n \"script\": {\n \"source\": \"params.count / params.total\",\n \"params\": {\n \"count\": 100,\n \"total\": 1000\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->scriptsPainlessExecute([\n \"body\" => [\n \"script\" => [\n \"source\" => \"params.count / params.total\",\n \"params\" => [\n \"count\" => 100,\n \"total\" => 1000,\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"script\":{\"source\":\"params.count / params.total\",\"params\":{\"count\":100,\"total\":1000}}}' \"$ELASTICSEARCH_URL/_scripts/painless/_execute\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -45045,32 +31156,6 @@ } }, "x-state": "Technical preview; Added in 6.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_scripts/painless/_execute\n{\n \"script\": {\n \"source\": \"params.count / params.total\",\n \"params\": {\n \"count\": 100.0,\n \"total\": 1000.0\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.scripts_painless_execute(\n script={\n \"source\": \"params.count / params.total\",\n \"params\": {\n \"count\": 100,\n \"total\": 1000\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.scriptsPainlessExecute({\n script: {\n source: \"params.count / params.total\",\n params: {\n count: 100,\n total: 1000,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.scripts_painless_execute(\n body: {\n \"script\": {\n \"source\": \"params.count / params.total\",\n \"params\": {\n \"count\": 100,\n \"total\": 1000\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->scriptsPainlessExecute([\n \"body\" => [\n \"script\" => [\n \"source\" => \"params.count / params.total\",\n \"params\" => [\n \"count\" => 100,\n \"total\" => 1000,\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"script\":{\"source\":\"params.count / params.total\",\"params\":{\"count\":100,\"total\":1000}}}' \"$ELASTICSEARCH_URL/_scripts/painless/_execute\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -45225,32 +31310,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_search?from=40&size=20\n{\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search(\n index=\"my-index-000001\",\n from=\"40\",\n size=\"20\",\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.search({\n index: \"my-index-000001\",\n from: 40,\n size: 20,\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search(\n index: \"my-index-000001\",\n from: \"40\",\n size: \"20\",\n body: {\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->search([\n \"index\" => \"my-index-000001\",\n \"from\" => \"40\",\n \"size\" => \"20\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}' \"$ELASTICSEARCH_URL/my-index-000001/_search?from=40&size=20\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -45403,32 +31462,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_search?from=40&size=20\n{\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search(\n index=\"my-index-000001\",\n from=\"40\",\n size=\"20\",\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.search({\n index: \"my-index-000001\",\n from: 40,\n size: 20,\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search(\n index: \"my-index-000001\",\n from: \"40\",\n size: \"20\",\n body: {\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->search([\n \"index\" => \"my-index-000001\",\n \"from\" => \"40\",\n \"size\" => \"20\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}' \"$ELASTICSEARCH_URL/my-index-000001/_search?from=40&size=20\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -45586,32 +31619,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_search?from=40&size=20\n{\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search(\n index=\"my-index-000001\",\n from=\"40\",\n size=\"20\",\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.search({\n index: \"my-index-000001\",\n from: 40,\n size: 20,\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search(\n index: \"my-index-000001\",\n from: \"40\",\n size: \"20\",\n body: {\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->search([\n \"index\" => \"my-index-000001\",\n \"from\" => \"40\",\n \"size\" => \"20\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}' \"$ELASTICSEARCH_URL/my-index-000001/_search?from=40&size=20\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -45767,32 +31774,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_search?from=40&size=20\n{\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search(\n index=\"my-index-000001\",\n from=\"40\",\n size=\"20\",\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.search({\n index: \"my-index-000001\",\n from: 40,\n size: 20,\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search(\n index: \"my-index-000001\",\n from: \"40\",\n size: \"20\",\n body: {\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->search([\n \"index\" => \"my-index-000001\",\n \"from\" => \"40\",\n \"size\" => \"20\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}' \"$ELASTICSEARCH_URL/my-index-000001/_search?from=40&size=20\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -45836,32 +31817,6 @@ } }, "x-state": "Beta; Added in 8.8.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _application/search_application/my-app/\n" - }, - { - "lang": "Python", - "source": "resp = client.search_application.get(\n name=\"my-app\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchApplication.get({\n name: \"my-app\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_application.get(\n name: \"my-app\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchApplication()->get([\n \"name\" => \"my-app\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_application/search_application/my-app/\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -45931,32 +31886,6 @@ } }, "x-state": "Beta; Added in 8.8.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _application/search_application/my-app\n{\n \"indices\": [ \"index1\", \"index2\" ],\n \"template\": {\n \"script\": {\n \"source\": {\n \"query\": {\n \"query_string\": {\n \"query\": \"{{query_string}}\",\n \"default_field\": \"{{default_field}}\"\n }\n }\n },\n \"params\": {\n \"query_string\": \"*\",\n \"default_field\": \"*\"\n }\n },\n \"dictionary\": {\n \"properties\": {\n \"query_string\": {\n \"type\": \"string\"\n },\n \"default_field\": {\n \"type\": \"string\",\n \"enum\": [\n \"title\",\n \"description\"\n ]\n },\n \"additionalProperties\": false\n },\n \"required\": [\n \"query_string\"\n ]\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search_application.put(\n name=\"my-app\",\n search_application={\n \"indices\": [\n \"index1\",\n \"index2\"\n ],\n \"template\": {\n \"script\": {\n \"source\": {\n \"query\": {\n \"query_string\": {\n \"query\": \"{{query_string}}\",\n \"default_field\": \"{{default_field}}\"\n }\n }\n },\n \"params\": {\n \"query_string\": \"*\",\n \"default_field\": \"*\"\n }\n },\n \"dictionary\": {\n \"properties\": {\n \"query_string\": {\n \"type\": \"string\"\n },\n \"default_field\": {\n \"type\": \"string\",\n \"enum\": [\n \"title\",\n \"description\"\n ]\n },\n \"additionalProperties\": False\n },\n \"required\": [\n \"query_string\"\n ]\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchApplication.put({\n name: \"my-app\",\n search_application: {\n indices: [\"index1\", \"index2\"],\n template: {\n script: {\n source: {\n query: {\n query_string: {\n query: \"{{query_string}}\",\n default_field: \"{{default_field}}\",\n },\n },\n },\n params: {\n query_string: \"*\",\n default_field: \"*\",\n },\n },\n dictionary: {\n properties: {\n query_string: {\n type: \"string\",\n },\n default_field: {\n type: \"string\",\n enum: [\"title\", \"description\"],\n },\n additionalProperties: false,\n },\n required: [\"query_string\"],\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_application.put(\n name: \"my-app\",\n body: {\n \"indices\": [\n \"index1\",\n \"index2\"\n ],\n \"template\": {\n \"script\": {\n \"source\": {\n \"query\": {\n \"query_string\": {\n \"query\": \"{{query_string}}\",\n \"default_field\": \"{{default_field}}\"\n }\n }\n },\n \"params\": {\n \"query_string\": \"*\",\n \"default_field\": \"*\"\n }\n },\n \"dictionary\": {\n \"properties\": {\n \"query_string\": {\n \"type\": \"string\"\n },\n \"default_field\": {\n \"type\": \"string\",\n \"enum\": [\n \"title\",\n \"description\"\n ]\n },\n \"additionalProperties\": false\n },\n \"required\": [\n \"query_string\"\n ]\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchApplication()->put([\n \"name\" => \"my-app\",\n \"body\" => [\n \"indices\" => array(\n \"index1\",\n \"index2\",\n ),\n \"template\" => [\n \"script\" => [\n \"source\" => [\n \"query\" => [\n \"query_string\" => [\n \"query\" => \"{{query_string}}\",\n \"default_field\" => \"{{default_field}}\",\n ],\n ],\n ],\n \"params\" => [\n \"query_string\" => \"*\",\n \"default_field\" => \"*\",\n ],\n ],\n \"dictionary\" => [\n \"properties\" => [\n \"query_string\" => [\n \"type\" => \"string\",\n ],\n \"default_field\" => [\n \"type\" => \"string\",\n \"enum\" => array(\n \"title\",\n \"description\",\n ),\n ],\n \"additionalProperties\" => false,\n ],\n \"required\" => array(\n \"query_string\",\n ),\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"indices\":[\"index1\",\"index2\"],\"template\":{\"script\":{\"source\":{\"query\":{\"query_string\":{\"query\":\"{{query_string}}\",\"default_field\":\"{{default_field}}\"}}},\"params\":{\"query_string\":\"*\",\"default_field\":\"*\"}},\"dictionary\":{\"properties\":{\"query_string\":{\"type\":\"string\"},\"default_field\":{\"type\":\"string\",\"enum\":[\"title\",\"description\"]},\"additionalProperties\":false},\"required\":[\"query_string\"]}}}' \"$ELASTICSEARCH_URL/_application/search_application/my-app\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -45992,32 +31921,6 @@ } }, "x-state": "Beta; Added in 8.8.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _application/search_application/my-app/\n" - }, - { - "lang": "Python", - "source": "resp = client.search_application.delete(\n name=\"my-app\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchApplication.delete({\n name: \"my-app\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_application.delete(\n name: \"my-app\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchApplication()->delete([\n \"name\" => \"my-app\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_application/search_application/my-app/\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -46040,32 +31943,6 @@ }, "deprecated": true, "x-state": "Technical preview; Added in 8.8.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _application/analytics/my*\n" - }, - { - "lang": "Python", - "source": "resp = client.search_application.get_behavioral_analytics(\n name=\"my*\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchApplication.getBehavioralAnalytics({\n name: \"my*\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_application.get_behavioral_analytics(\n name: \"my*\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchApplication()->getBehavioralAnalytics([\n \"name\" => \"my*\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_application/analytics/my*\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -46101,32 +31978,6 @@ }, "deprecated": true, "x-state": "Technical preview; Added in 8.8.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _application/analytics/my_analytics_collection\n" - }, - { - "lang": "Python", - "source": "resp = client.search_application.put_behavioral_analytics(\n name=\"my_analytics_collection\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchApplication.putBehavioralAnalytics({\n name: \"my_analytics_collection\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_application.put_behavioral_analytics(\n name: \"my_analytics_collection\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchApplication()->putBehavioralAnalytics([\n \"name\" => \"my_analytics_collection\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_application/analytics/my_analytics_collection\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -46163,32 +32014,6 @@ }, "deprecated": true, "x-state": "Technical preview; Added in 8.8.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _application/analytics/my_analytics_collection/\n" - }, - { - "lang": "Python", - "source": "resp = client.search_application.delete_behavioral_analytics(\n name=\"my_analytics_collection\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchApplication.deleteBehavioralAnalytics({\n name: \"my_analytics_collection\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_application.delete_behavioral_analytics(\n name: \"my_analytics_collection\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchApplication()->deleteBehavioralAnalytics([\n \"name\" => \"my_analytics_collection\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_application/analytics/my_analytics_collection/\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -46206,32 +32031,6 @@ }, "deprecated": true, "x-state": "Technical preview; Added in 8.8.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _application/analytics/my*\n" - }, - { - "lang": "Python", - "source": "resp = client.search_application.get_behavioral_analytics(\n name=\"my*\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchApplication.getBehavioralAnalytics({\n name: \"my*\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_application.get_behavioral_analytics(\n name: \"my*\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchApplication()->getBehavioralAnalytics([\n \"name\" => \"my*\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_application/analytics/my*\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -46309,32 +32108,6 @@ } }, "x-state": "Beta; Added in 8.8.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _application/search_application?from=0&size=3&q=app*\n" - }, - { - "lang": "Python", - "source": "resp = client.search_application.list(\n from=\"0\",\n size=\"3\",\n q=\"app*\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchApplication.list({\n from: 0,\n size: 3,\n q: \"app*\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_application.list(\n from: \"0\",\n size: \"3\",\n q: \"app*\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchApplication()->list([\n \"from\" => \"0\",\n \"size\" => \"3\",\n \"q\" => \"app*\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_application/search_application?from=0&size=3&q=app*\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -46423,32 +32196,6 @@ }, "deprecated": true, "x-state": "Technical preview", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _application/analytics/my_analytics_collection/event/search_click\n{\n \"session\": {\n \"id\": \"1797ca95-91c9-4e2e-b1bd-9c38e6f386a9\"\n },\n \"user\": {\n \"id\": \"5f26f01a-bbee-4202-9298-81261067abbd\"\n },\n \"search\":{\n \"query\": \"search term\",\n \"results\": {\n \"items\": [\n {\n \"document\": {\n \"id\": \"123\",\n \"index\": \"products\"\n }\n }\n ],\n \"total_results\": 10\n },\n \"sort\": {\n \"name\": \"relevance\"\n },\n \"search_application\": \"website\"\n },\n \"document\":{\n \"id\": \"123\",\n \"index\": \"products\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search_application.post_behavioral_analytics_event(\n collection_name=\"my_analytics_collection\",\n event_type=\"search_click\",\n payload={\n \"session\": {\n \"id\": \"1797ca95-91c9-4e2e-b1bd-9c38e6f386a9\"\n },\n \"user\": {\n \"id\": \"5f26f01a-bbee-4202-9298-81261067abbd\"\n },\n \"search\": {\n \"query\": \"search term\",\n \"results\": {\n \"items\": [\n {\n \"document\": {\n \"id\": \"123\",\n \"index\": \"products\"\n }\n }\n ],\n \"total_results\": 10\n },\n \"sort\": {\n \"name\": \"relevance\"\n },\n \"search_application\": \"website\"\n },\n \"document\": {\n \"id\": \"123\",\n \"index\": \"products\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchApplication.postBehavioralAnalyticsEvent({\n collection_name: \"my_analytics_collection\",\n event_type: \"search_click\",\n payload: {\n session: {\n id: \"1797ca95-91c9-4e2e-b1bd-9c38e6f386a9\",\n },\n user: {\n id: \"5f26f01a-bbee-4202-9298-81261067abbd\",\n },\n search: {\n query: \"search term\",\n results: {\n items: [\n {\n document: {\n id: \"123\",\n index: \"products\",\n },\n },\n ],\n total_results: 10,\n },\n sort: {\n name: \"relevance\",\n },\n search_application: \"website\",\n },\n document: {\n id: \"123\",\n index: \"products\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_application.post_behavioral_analytics_event(\n collection_name: \"my_analytics_collection\",\n event_type: \"search_click\",\n body: {\n \"session\": {\n \"id\": \"1797ca95-91c9-4e2e-b1bd-9c38e6f386a9\"\n },\n \"user\": {\n \"id\": \"5f26f01a-bbee-4202-9298-81261067abbd\"\n },\n \"search\": {\n \"query\": \"search term\",\n \"results\": {\n \"items\": [\n {\n \"document\": {\n \"id\": \"123\",\n \"index\": \"products\"\n }\n }\n ],\n \"total_results\": 10\n },\n \"sort\": {\n \"name\": \"relevance\"\n },\n \"search_application\": \"website\"\n },\n \"document\": {\n \"id\": \"123\",\n \"index\": \"products\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchApplication()->postBehavioralAnalyticsEvent([\n \"collection_name\" => \"my_analytics_collection\",\n \"event_type\" => \"search_click\",\n \"body\" => [\n \"session\" => [\n \"id\" => \"1797ca95-91c9-4e2e-b1bd-9c38e6f386a9\",\n ],\n \"user\" => [\n \"id\" => \"5f26f01a-bbee-4202-9298-81261067abbd\",\n ],\n \"search\" => [\n \"query\" => \"search term\",\n \"results\" => [\n \"items\" => array(\n [\n \"document\" => [\n \"id\" => \"123\",\n \"index\" => \"products\",\n ],\n ],\n ),\n \"total_results\" => 10,\n ],\n \"sort\" => [\n \"name\" => \"relevance\",\n ],\n \"search_application\" => \"website\",\n ],\n \"document\" => [\n \"id\" => \"123\",\n \"index\" => \"products\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"session\":{\"id\":\"1797ca95-91c9-4e2e-b1bd-9c38e6f386a9\"},\"user\":{\"id\":\"5f26f01a-bbee-4202-9298-81261067abbd\"},\"search\":{\"query\":\"search term\",\"results\":{\"items\":[{\"document\":{\"id\":\"123\",\"index\":\"products\"}}],\"total_results\":10},\"sort\":{\"name\":\"relevance\"},\"search_application\":\"website\"},\"document\":{\"id\":\"123\",\"index\":\"products\"}}' \"$ELASTICSEARCH_URL/_application/analytics/my_analytics_collection/event/search_click\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -46515,32 +32262,6 @@ } }, "x-state": "Technical preview; Added in 8.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _application/search_application/my-app/_render_query\n{\n \"params\": {\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search_application.render_query(\n name=\"my-app\",\n params={\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchApplication.renderQuery({\n name: \"my-app\",\n params: {\n query_string: \"my first query\",\n text_fields: [\n {\n name: \"title\",\n boost: 5,\n },\n {\n name: \"description\",\n boost: 1,\n },\n ],\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_application.render_query(\n name: \"my-app\",\n body: {\n \"params\": {\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchApplication()->renderQuery([\n \"name\" => \"my-app\",\n \"body\" => [\n \"params\" => [\n \"query_string\" => \"my first query\",\n \"text_fields\" => array(\n [\n \"name\" => \"title\",\n \"boost\" => 5,\n ],\n [\n \"name\" => \"description\",\n \"boost\" => 1,\n ],\n ),\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"params\":{\"query_string\":\"my first query\",\"text_fields\":[{\"name\":\"title\",\"boost\":5},{\"name\":\"description\",\"boost\":1}]}}' \"$ELASTICSEARCH_URL/_application/search_application/my-app/_render_query\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -46569,32 +32290,6 @@ } }, "x-state": "Beta; Added in 8.8.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _application/search_application/my-app/_search\n{\n \"params\": {\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\"name\": \"title\", \"boost\": 5},\n {\"name\": \"description\", \"boost\": 1}\n ]\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search_application.search(\n name=\"my-app\",\n params={\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchApplication.search({\n name: \"my-app\",\n params: {\n query_string: \"my first query\",\n text_fields: [\n {\n name: \"title\",\n boost: 5,\n },\n {\n name: \"description\",\n boost: 1,\n },\n ],\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_application.search(\n name: \"my-app\",\n body: {\n \"params\": {\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchApplication()->search([\n \"name\" => \"my-app\",\n \"body\" => [\n \"params\" => [\n \"query_string\" => \"my first query\",\n \"text_fields\" => array(\n [\n \"name\" => \"title\",\n \"boost\" => 5,\n ],\n [\n \"name\" => \"description\",\n \"boost\" => 1,\n ],\n ),\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"params\":{\"query_string\":\"my first query\",\"text_fields\":[{\"name\":\"title\",\"boost\":5},{\"name\":\"description\",\"boost\":1}]}}' \"$ELASTICSEARCH_URL/_application/search_application/my-app/_search\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -46621,32 +32316,6 @@ } }, "x-state": "Beta; Added in 8.8.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _application/search_application/my-app/_search\n{\n \"params\": {\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\"name\": \"title\", \"boost\": 5},\n {\"name\": \"description\", \"boost\": 1}\n ]\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search_application.search(\n name=\"my-app\",\n params={\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchApplication.search({\n name: \"my-app\",\n params: {\n query_string: \"my first query\",\n text_fields: [\n {\n name: \"title\",\n boost: 5,\n },\n {\n name: \"description\",\n boost: 1,\n },\n ],\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_application.search(\n name: \"my-app\",\n body: {\n \"params\": {\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchApplication()->search([\n \"name\" => \"my-app\",\n \"body\" => [\n \"params\" => [\n \"query_string\" => \"my first query\",\n \"text_fields\" => array(\n [\n \"name\" => \"title\",\n \"boost\" => 5,\n ],\n [\n \"name\" => \"description\",\n \"boost\" => 1,\n ],\n ),\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"params\":{\"query_string\":\"my first query\",\"text_fields\":[{\"name\":\"title\",\"boost\":5},{\"name\":\"description\",\"boost\":1}]}}' \"$ELASTICSEARCH_URL/_application/search_application/my-app/_search\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -46708,32 +32377,6 @@ } }, "x-state": "Generally available; Added in 7.15.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET museums/_mvt/location/13/4207/2692\n{\n \"grid_agg\": \"geotile\",\n \"grid_precision\": 2,\n \"fields\": [\n \"name\",\n \"price\"\n ],\n \"query\": {\n \"term\": {\n \"included\": true\n }\n },\n \"aggs\": {\n \"min_price\": {\n \"min\": {\n \"field\": \"price\"\n }\n },\n \"max_price\": {\n \"max\": {\n \"field\": \"price\"\n }\n },\n \"avg_price\": {\n \"avg\": {\n \"field\": \"price\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search_mvt(\n index=\"museums\",\n field=\"location\",\n zoom=\"13\",\n x=\"4207\",\n y=\"2692\",\n grid_agg=\"geotile\",\n grid_precision=2,\n fields=[\n \"name\",\n \"price\"\n ],\n query={\n \"term\": {\n \"included\": True\n }\n },\n aggs={\n \"min_price\": {\n \"min\": {\n \"field\": \"price\"\n }\n },\n \"max_price\": {\n \"max\": {\n \"field\": \"price\"\n }\n },\n \"avg_price\": {\n \"avg\": {\n \"field\": \"price\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchMvt({\n index: \"museums\",\n field: \"location\",\n zoom: 13,\n x: 4207,\n y: 2692,\n grid_agg: \"geotile\",\n grid_precision: 2,\n fields: [\"name\", \"price\"],\n query: {\n term: {\n included: true,\n },\n },\n aggs: {\n min_price: {\n min: {\n field: \"price\",\n },\n },\n max_price: {\n max: {\n field: \"price\",\n },\n },\n avg_price: {\n avg: {\n field: \"price\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_mvt(\n index: \"museums\",\n field: \"location\",\n zoom: \"13\",\n x: \"4207\",\n y: \"2692\",\n body: {\n \"grid_agg\": \"geotile\",\n \"grid_precision\": 2,\n \"fields\": [\n \"name\",\n \"price\"\n ],\n \"query\": {\n \"term\": {\n \"included\": true\n }\n },\n \"aggs\": {\n \"min_price\": {\n \"min\": {\n \"field\": \"price\"\n }\n },\n \"max_price\": {\n \"max\": {\n \"field\": \"price\"\n }\n },\n \"avg_price\": {\n \"avg\": {\n \"field\": \"price\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchMvt([\n \"index\" => \"museums\",\n \"field\" => \"location\",\n \"zoom\" => \"13\",\n \"x\" => \"4207\",\n \"y\" => \"2692\",\n \"body\" => [\n \"grid_agg\" => \"geotile\",\n \"grid_precision\" => 2,\n \"fields\" => array(\n \"name\",\n \"price\",\n ),\n \"query\" => [\n \"term\" => [\n \"included\" => true,\n ],\n ],\n \"aggs\" => [\n \"min_price\" => [\n \"min\" => [\n \"field\" => \"price\",\n ],\n ],\n \"max_price\" => [\n \"max\" => [\n \"field\" => \"price\",\n ],\n ],\n \"avg_price\" => [\n \"avg\" => [\n \"field\" => \"price\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"grid_agg\":\"geotile\",\"grid_precision\":2,\"fields\":[\"name\",\"price\"],\"query\":{\"term\":{\"included\":true}},\"aggs\":{\"min_price\":{\"min\":{\"field\":\"price\"}},\"max_price\":{\"max\":{\"field\":\"price\"}},\"avg_price\":{\"avg\":{\"field\":\"price\"}}}}' \"$ELASTICSEARCH_URL/museums/_mvt/location/13/4207/2692\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -46793,32 +32436,6 @@ } }, "x-state": "Generally available; Added in 7.15.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET museums/_mvt/location/13/4207/2692\n{\n \"grid_agg\": \"geotile\",\n \"grid_precision\": 2,\n \"fields\": [\n \"name\",\n \"price\"\n ],\n \"query\": {\n \"term\": {\n \"included\": true\n }\n },\n \"aggs\": {\n \"min_price\": {\n \"min\": {\n \"field\": \"price\"\n }\n },\n \"max_price\": {\n \"max\": {\n \"field\": \"price\"\n }\n },\n \"avg_price\": {\n \"avg\": {\n \"field\": \"price\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search_mvt(\n index=\"museums\",\n field=\"location\",\n zoom=\"13\",\n x=\"4207\",\n y=\"2692\",\n grid_agg=\"geotile\",\n grid_precision=2,\n fields=[\n \"name\",\n \"price\"\n ],\n query={\n \"term\": {\n \"included\": True\n }\n },\n aggs={\n \"min_price\": {\n \"min\": {\n \"field\": \"price\"\n }\n },\n \"max_price\": {\n \"max\": {\n \"field\": \"price\"\n }\n },\n \"avg_price\": {\n \"avg\": {\n \"field\": \"price\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchMvt({\n index: \"museums\",\n field: \"location\",\n zoom: 13,\n x: 4207,\n y: 2692,\n grid_agg: \"geotile\",\n grid_precision: 2,\n fields: [\"name\", \"price\"],\n query: {\n term: {\n included: true,\n },\n },\n aggs: {\n min_price: {\n min: {\n field: \"price\",\n },\n },\n max_price: {\n max: {\n field: \"price\",\n },\n },\n avg_price: {\n avg: {\n field: \"price\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_mvt(\n index: \"museums\",\n field: \"location\",\n zoom: \"13\",\n x: \"4207\",\n y: \"2692\",\n body: {\n \"grid_agg\": \"geotile\",\n \"grid_precision\": 2,\n \"fields\": [\n \"name\",\n \"price\"\n ],\n \"query\": {\n \"term\": {\n \"included\": true\n }\n },\n \"aggs\": {\n \"min_price\": {\n \"min\": {\n \"field\": \"price\"\n }\n },\n \"max_price\": {\n \"max\": {\n \"field\": \"price\"\n }\n },\n \"avg_price\": {\n \"avg\": {\n \"field\": \"price\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchMvt([\n \"index\" => \"museums\",\n \"field\" => \"location\",\n \"zoom\" => \"13\",\n \"x\" => \"4207\",\n \"y\" => \"2692\",\n \"body\" => [\n \"grid_agg\" => \"geotile\",\n \"grid_precision\" => 2,\n \"fields\" => array(\n \"name\",\n \"price\",\n ),\n \"query\" => [\n \"term\" => [\n \"included\" => true,\n ],\n ],\n \"aggs\" => [\n \"min_price\" => [\n \"min\" => [\n \"field\" => \"price\",\n ],\n ],\n \"max_price\" => [\n \"max\" => [\n \"field\" => \"price\",\n ],\n ],\n \"avg_price\" => [\n \"avg\" => [\n \"field\" => \"price\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"grid_agg\":\"geotile\",\"grid_precision\":2,\"fields\":[\"name\",\"price\"],\"query\":{\"term\":{\"included\":true}},\"aggs\":{\"min_price\":{\"min\":{\"field\":\"price\"}},\"max_price\":{\"max\":{\"field\":\"price\"}},\"avg_price\":{\"avg\":{\"field\":\"price\"}}}}' \"$ELASTICSEARCH_URL/museums/_mvt/location/13/4207/2692\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -46859,32 +32476,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_search_shards\n" - }, - { - "lang": "Python", - "source": "resp = client.search_shards(\n index=\"my-index-000001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchShards({\n index: \"my-index-000001\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_shards(\n index: \"my-index-000001\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchShards([\n \"index\" => \"my-index-000001\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_search_shards\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -46923,32 +32514,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_search_shards\n" - }, - { - "lang": "Python", - "source": "resp = client.search_shards(\n index=\"my-index-000001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchShards({\n index: \"my-index-000001\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_shards(\n index: \"my-index-000001\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchShards([\n \"index\" => \"my-index-000001\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_search_shards\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -46992,32 +32557,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_search_shards\n" - }, - { - "lang": "Python", - "source": "resp = client.search_shards(\n index=\"my-index-000001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchShards({\n index: \"my-index-000001\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_shards(\n index: \"my-index-000001\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchShards([\n \"index\" => \"my-index-000001\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_search_shards\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -47059,32 +32598,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_search_shards\n" - }, - { - "lang": "Python", - "source": "resp = client.search_shards(\n index=\"my-index-000001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchShards({\n index: \"my-index-000001\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_shards(\n index: \"my-index-000001\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchShards([\n \"index\" => \"my-index-000001\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_search_shards\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -47149,32 +32662,6 @@ } }, "x-state": "Generally available; Added in 2.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index/_search/template\n{\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search_template(\n index=\"my-index\",\n id=\"my-search-template\",\n params={\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchTemplate({\n index: \"my-index\",\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 0,\n size: 10,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_template(\n index: \"my-index\",\n body: {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchTemplate([\n \"index\" => \"my-index\",\n \"body\" => [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 0,\n \"size\" => 10,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":0,\"size\":10}}' \"$ELASTICSEARCH_URL/my-index/_search/template\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -47237,32 +32724,6 @@ } }, "x-state": "Generally available; Added in 2.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index/_search/template\n{\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search_template(\n index=\"my-index\",\n id=\"my-search-template\",\n params={\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchTemplate({\n index: \"my-index\",\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 0,\n size: 10,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_template(\n index: \"my-index\",\n body: {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchTemplate([\n \"index\" => \"my-index\",\n \"body\" => [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 0,\n \"size\" => 10,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":0,\"size\":10}}' \"$ELASTICSEARCH_URL/my-index/_search/template\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -47330,32 +32791,6 @@ } }, "x-state": "Generally available; Added in 2.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index/_search/template\n{\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search_template(\n index=\"my-index\",\n id=\"my-search-template\",\n params={\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchTemplate({\n index: \"my-index\",\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 0,\n size: 10,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_template(\n index: \"my-index\",\n body: {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchTemplate([\n \"index\" => \"my-index\",\n \"body\" => [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 0,\n \"size\" => 10,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":0,\"size\":10}}' \"$ELASTICSEARCH_URL/my-index/_search/template\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -47421,32 +32856,6 @@ } }, "x-state": "Generally available; Added in 2.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index/_search/template\n{\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search_template(\n index=\"my-index\",\n id=\"my-search-template\",\n params={\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchTemplate({\n index: \"my-index\",\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 0,\n size: 10,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_template(\n index: \"my-index\",\n body: {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchTemplate([\n \"index\" => \"my-index\",\n \"body\" => [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 0,\n \"size\" => 10,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":0,\"size\":10}}' \"$ELASTICSEARCH_URL/my-index/_search/template\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -47472,32 +32881,6 @@ } }, "x-state": "Technical preview; Added in 7.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_searchable_snapshots/cache/stats\n" - }, - { - "lang": "Python", - "source": "resp = client.searchable_snapshots.cache_stats()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchableSnapshots.cacheStats();" - }, - { - "lang": "Ruby", - "source": "response = client.searchable_snapshots.cache_stats" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchableSnapshots()->cacheStats();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_searchable_snapshots/cache/stats\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -47526,32 +32909,6 @@ } }, "x-state": "Technical preview; Added in 7.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_searchable_snapshots/cache/stats\n" - }, - { - "lang": "Python", - "source": "resp = client.searchable_snapshots.cache_stats()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchableSnapshots.cacheStats();" - }, - { - "lang": "Ruby", - "source": "response = client.searchable_snapshots.cache_stats" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchableSnapshots()->cacheStats();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_searchable_snapshots/cache/stats\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -47583,32 +32940,6 @@ } }, "x-state": "Technical preview; Added in 7.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-index/_searchable_snapshots/cache/clear\n" - }, - { - "lang": "Python", - "source": "resp = client.searchable_snapshots.clear_cache(\n index=\"my-index\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchableSnapshots.clearCache({\n index: \"my-index\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.searchable_snapshots.clear_cache(\n index: \"my-index\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchableSnapshots()->clearCache([\n \"index\" => \"my-index\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index/_searchable_snapshots/cache/clear\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -47643,32 +32974,6 @@ } }, "x-state": "Technical preview; Added in 7.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-index/_searchable_snapshots/cache/clear\n" - }, - { - "lang": "Python", - "source": "resp = client.searchable_snapshots.clear_cache(\n index=\"my-index\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchableSnapshots.clearCache({\n index: \"my-index\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.searchable_snapshots.clear_cache(\n index: \"my-index\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchableSnapshots()->clearCache([\n \"index\" => \"my-index\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index/_searchable_snapshots/cache/clear\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -47796,32 +33101,6 @@ } }, "x-state": "Generally available; Added in 7.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true\n{\n \"index\": \"my_docs\",\n \"renamed_index\": \"docs\",\n \"index_settings\": {\n \"index.number_of_replicas\": 0\n },\n \"ignore_index_settings\": [ \"index.refresh_interval\" ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.searchable_snapshots.mount(\n repository=\"my_repository\",\n snapshot=\"my_snapshot\",\n wait_for_completion=True,\n index=\"my_docs\",\n renamed_index=\"docs\",\n index_settings={\n \"index.number_of_replicas\": 0\n },\n ignore_index_settings=[\n \"index.refresh_interval\"\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchableSnapshots.mount({\n repository: \"my_repository\",\n snapshot: \"my_snapshot\",\n wait_for_completion: \"true\",\n index: \"my_docs\",\n renamed_index: \"docs\",\n index_settings: {\n \"index.number_of_replicas\": 0,\n },\n ignore_index_settings: [\"index.refresh_interval\"],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.searchable_snapshots.mount(\n repository: \"my_repository\",\n snapshot: \"my_snapshot\",\n wait_for_completion: \"true\",\n body: {\n \"index\": \"my_docs\",\n \"renamed_index\": \"docs\",\n \"index_settings\": {\n \"index.number_of_replicas\": 0\n },\n \"ignore_index_settings\": [\n \"index.refresh_interval\"\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchableSnapshots()->mount([\n \"repository\" => \"my_repository\",\n \"snapshot\" => \"my_snapshot\",\n \"wait_for_completion\" => \"true\",\n \"body\" => [\n \"index\" => \"my_docs\",\n \"renamed_index\" => \"docs\",\n \"index_settings\" => [\n \"index.number_of_replicas\" => 0,\n ],\n \"ignore_index_settings\" => array(\n \"index.refresh_interval\",\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index\":\"my_docs\",\"renamed_index\":\"docs\",\"index_settings\":{\"index.number_of_replicas\":0},\"ignore_index_settings\":[\"index.refresh_interval\"]}' \"$ELASTICSEARCH_URL/_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -47844,32 +33123,6 @@ } }, "x-state": "Generally available; Added in 7.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index/_searchable_snapshots/stats\n" - }, - { - "lang": "Python", - "source": "resp = client.searchable_snapshots.stats(\n index=\"my-index\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchableSnapshots.stats({\n index: \"my-index\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.searchable_snapshots.stats(\n index: \"my-index\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchableSnapshots()->stats([\n \"index\" => \"my-index\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index/_searchable_snapshots/stats\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -47895,32 +33148,6 @@ } }, "x-state": "Generally available; Added in 7.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index/_searchable_snapshots/stats\n" - }, - { - "lang": "Python", - "source": "resp = client.searchable_snapshots.stats(\n index=\"my-index\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchableSnapshots.stats({\n index: \"my-index\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.searchable_snapshots.stats(\n index: \"my-index\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchableSnapshots()->stats([\n \"index\" => \"my-index\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index/_searchable_snapshots/stats\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -47987,32 +33214,6 @@ } }, "x-state": "Generally available; Added in 8.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/profile/_activate\n{\n \"grant_type\": \"password\",\n \"username\" : \"jacknich\",\n \"password\" : \"l0ng-r4nd0m-p@ssw0rd\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.activate_user_profile(\n grant_type=\"password\",\n username=\"jacknich\",\n password=\"l0ng-r4nd0m-p@ssw0rd\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.activateUserProfile({\n grant_type: \"password\",\n username: \"jacknich\",\n password: \"l0ng-r4nd0m-p@ssw0rd\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.activate_user_profile(\n body: {\n \"grant_type\": \"password\",\n \"username\": \"jacknich\",\n \"password\": \"l0ng-r4nd0m-p@ssw0rd\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->activateUserProfile([\n \"body\" => [\n \"grant_type\" => \"password\",\n \"username\" => \"jacknich\",\n \"password\" => \"l0ng-r4nd0m-p@ssw0rd\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"grant_type\":\"password\",\"username\":\"jacknich\",\"password\":\"l0ng-r4nd0m-p@ssw0rd\"}' \"$ELASTICSEARCH_URL/_security/profile/_activate\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -48106,32 +33307,6 @@ } }, "x-state": "Generally available; Added in 5.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/_authenticate\n" - }, - { - "lang": "Python", - "source": "resp = client.security.authenticate()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.authenticate();" - }, - { - "lang": "Ruby", - "source": "response = client.security.authenticate" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->authenticate();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/_authenticate\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -48149,32 +33324,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/role/my_admin_role\n" - }, - { - "lang": "Python", - "source": "resp = client.security.get_role(\n name=\"my_admin_role\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.getRole({\n name: \"my_admin_role\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.get_role(\n name: \"my_admin_role\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->getRole([\n \"name\" => \"my_admin_role\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/role/my_admin_role\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -48286,32 +33435,6 @@ } }, "x-state": "Generally available; Added in 8.15.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/role\n{\n \"roles\": {\n \"my_admin_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\n \"all\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n },\n \"my_user_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\"\n ],\n \"privileges\": [\n \"read\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.bulk_put_role(\n roles={\n \"my_admin_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\n \"all\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n },\n \"my_user_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\"\n ],\n \"privileges\": [\n \"read\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.bulkPutRole({\n roles: {\n my_admin_role: {\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index1\", \"index2\"],\n privileges: [\"all\"],\n field_security: {\n grant: [\"title\", \"body\"],\n },\n query: '{\"match\": {\"title\": \"foo\"}}',\n },\n ],\n applications: [\n {\n application: \"myapp\",\n privileges: [\"admin\", \"read\"],\n resources: [\"*\"],\n },\n ],\n run_as: [\"other_user\"],\n metadata: {\n version: 1,\n },\n },\n my_user_role: {\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index1\"],\n privileges: [\"read\"],\n field_security: {\n grant: [\"title\", \"body\"],\n },\n query: '{\"match\": {\"title\": \"foo\"}}',\n },\n ],\n applications: [\n {\n application: \"myapp\",\n privileges: [\"admin\", \"read\"],\n resources: [\"*\"],\n },\n ],\n run_as: [\"other_user\"],\n metadata: {\n version: 1,\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.bulk_put_role(\n body: {\n \"roles\": {\n \"my_admin_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\n \"all\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n },\n \"my_user_role\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\"\n ],\n \"privileges\": [\n \"read\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->bulkPutRole([\n \"body\" => [\n \"roles\" => [\n \"my_admin_role\" => [\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index1\",\n \"index2\",\n ),\n \"privileges\" => array(\n \"all\",\n ),\n \"field_security\" => [\n \"grant\" => array(\n \"title\",\n \"body\",\n ),\n ],\n \"query\" => \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\",\n ],\n ),\n \"applications\" => array(\n [\n \"application\" => \"myapp\",\n \"privileges\" => array(\n \"admin\",\n \"read\",\n ),\n \"resources\" => array(\n \"*\",\n ),\n ],\n ),\n \"run_as\" => array(\n \"other_user\",\n ),\n \"metadata\" => [\n \"version\" => 1,\n ],\n ],\n \"my_user_role\" => [\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index1\",\n ),\n \"privileges\" => array(\n \"read\",\n ),\n \"field_security\" => [\n \"grant\" => array(\n \"title\",\n \"body\",\n ),\n ],\n \"query\" => \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\",\n ],\n ),\n \"applications\" => array(\n [\n \"application\" => \"myapp\",\n \"privileges\" => array(\n \"admin\",\n \"read\",\n ),\n \"resources\" => array(\n \"*\",\n ),\n ],\n ),\n \"run_as\" => array(\n \"other_user\",\n ),\n \"metadata\" => [\n \"version\" => 1,\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"roles\":{\"my_admin_role\":{\"cluster\":[\"all\"],\"indices\":[{\"names\":[\"index1\",\"index2\"],\"privileges\":[\"all\"],\"field_security\":{\"grant\":[\"title\",\"body\"]},\"query\":\"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"}],\"applications\":[{\"application\":\"myapp\",\"privileges\":[\"admin\",\"read\"],\"resources\":[\"*\"]}],\"run_as\":[\"other_user\"],\"metadata\":{\"version\":1}},\"my_user_role\":{\"cluster\":[\"all\"],\"indices\":[{\"names\":[\"index1\"],\"privileges\":[\"read\"],\"field_security\":{\"grant\":[\"title\",\"body\"]},\"query\":\"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"}],\"applications\":[{\"application\":\"myapp\",\"privileges\":[\"admin\",\"read\"],\"resources\":[\"*\"]}],\"run_as\":[\"other_user\"],\"metadata\":{\"version\":1}}}}' \"$ELASTICSEARCH_URL/_security/role\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -48411,32 +33534,6 @@ } }, "x-state": "Generally available; Added in 8.15.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_security/role\n{\n \"names\": [\"my_admin_role\", \"my_user_role\"]\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.bulk_delete_role(\n names=[\n \"my_admin_role\",\n \"my_user_role\"\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.bulkDeleteRole({\n names: [\"my_admin_role\", \"my_user_role\"],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.bulk_delete_role(\n body: {\n \"names\": [\n \"my_admin_role\",\n \"my_user_role\"\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->bulkDeleteRole([\n \"body\" => [\n \"names\" => array(\n \"my_admin_role\",\n \"my_user_role\",\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"names\":[\"my_admin_role\",\"my_user_role\"]}' \"$ELASTICSEARCH_URL/_security/role\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -48540,32 +33637,6 @@ } }, "x-state": "Generally available; Added in 8.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/api_key/_bulk_update\n{\n \"ids\": [\n \"VuaCfGcBCdbkQm-e5aOx\",\n \"H3_AhoIBA9hmeQJdg7ij\"\n ],\n \"role_descriptors\": {\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\n \"*\"\n ],\n \"privileges\": [\n \"write\"\n ]\n }\n ]\n }\n },\n \"metadata\": {\n \"environment\": {\n \"level\": 2,\n \"trusted\": true,\n \"tags\": [\n \"production\"\n ]\n }\n },\n \"expiration\": \"30d\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.bulk_update_api_keys(\n ids=[\n \"VuaCfGcBCdbkQm-e5aOx\",\n \"H3_AhoIBA9hmeQJdg7ij\"\n ],\n role_descriptors={\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\n \"*\"\n ],\n \"privileges\": [\n \"write\"\n ]\n }\n ]\n }\n },\n metadata={\n \"environment\": {\n \"level\": 2,\n \"trusted\": True,\n \"tags\": [\n \"production\"\n ]\n }\n },\n expiration=\"30d\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.bulkUpdateApiKeys({\n ids: [\"VuaCfGcBCdbkQm-e5aOx\", \"H3_AhoIBA9hmeQJdg7ij\"],\n role_descriptors: {\n \"role-a\": {\n indices: [\n {\n names: [\"*\"],\n privileges: [\"write\"],\n },\n ],\n },\n },\n metadata: {\n environment: {\n level: 2,\n trusted: true,\n tags: [\"production\"],\n },\n },\n expiration: \"30d\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.bulk_update_api_keys(\n body: {\n \"ids\": [\n \"VuaCfGcBCdbkQm-e5aOx\",\n \"H3_AhoIBA9hmeQJdg7ij\"\n ],\n \"role_descriptors\": {\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\n \"*\"\n ],\n \"privileges\": [\n \"write\"\n ]\n }\n ]\n }\n },\n \"metadata\": {\n \"environment\": {\n \"level\": 2,\n \"trusted\": true,\n \"tags\": [\n \"production\"\n ]\n }\n },\n \"expiration\": \"30d\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->bulkUpdateApiKeys([\n \"body\" => [\n \"ids\" => array(\n \"VuaCfGcBCdbkQm-e5aOx\",\n \"H3_AhoIBA9hmeQJdg7ij\",\n ),\n \"role_descriptors\" => [\n \"role-a\" => [\n \"indices\" => array(\n [\n \"names\" => array(\n \"*\",\n ),\n \"privileges\" => array(\n \"write\",\n ),\n ],\n ),\n ],\n ],\n \"metadata\" => [\n \"environment\" => [\n \"level\" => 2,\n \"trusted\" => true,\n \"tags\" => array(\n \"production\",\n ),\n ],\n ],\n \"expiration\" => \"30d\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"ids\":[\"VuaCfGcBCdbkQm-e5aOx\",\"H3_AhoIBA9hmeQJdg7ij\"],\"role_descriptors\":{\"role-a\":{\"indices\":[{\"names\":[\"*\"],\"privileges\":[\"write\"]}]}},\"metadata\":{\"environment\":{\"level\":2,\"trusted\":true,\"tags\":[\"production\"]}},\"expiration\":\"30d\"}' \"$ELASTICSEARCH_URL/_security/api_key/_bulk_update\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -48594,32 +33665,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/user/jacknich/_password\n{\n \"password\" : \"new-test-password\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.change_password(\n username=\"jacknich\",\n password=\"new-test-password\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.changePassword({\n username: \"jacknich\",\n password: \"new-test-password\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.change_password(\n username: \"jacknich\",\n body: {\n \"password\": \"new-test-password\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->changePassword([\n \"username\" => \"jacknich\",\n \"body\" => [\n \"password\" => \"new-test-password\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"password\":\"new-test-password\"}' \"$ELASTICSEARCH_URL/_security/user/jacknich/_password\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -48646,32 +33691,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/user/jacknich/_password\n{\n \"password\" : \"new-test-password\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.change_password(\n username=\"jacknich\",\n password=\"new-test-password\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.changePassword({\n username: \"jacknich\",\n password: \"new-test-password\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.change_password(\n username: \"jacknich\",\n body: {\n \"password\": \"new-test-password\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->changePassword([\n \"username\" => \"jacknich\",\n \"body\" => [\n \"password\" => \"new-test-password\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"password\":\"new-test-password\"}' \"$ELASTICSEARCH_URL/_security/user/jacknich/_password\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -48697,32 +33716,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/user/jacknich/_password\n{\n \"password\" : \"new-test-password\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.change_password(\n username=\"jacknich\",\n password=\"new-test-password\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.changePassword({\n username: \"jacknich\",\n password: \"new-test-password\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.change_password(\n username: \"jacknich\",\n body: {\n \"password\": \"new-test-password\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->changePassword([\n \"username\" => \"jacknich\",\n \"body\" => [\n \"password\" => \"new-test-password\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"password\":\"new-test-password\"}' \"$ELASTICSEARCH_URL/_security/user/jacknich/_password\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -48746,32 +33739,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/user/jacknich/_password\n{\n \"password\" : \"new-test-password\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.change_password(\n username=\"jacknich\",\n password=\"new-test-password\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.changePassword({\n username: \"jacknich\",\n password: \"new-test-password\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.change_password(\n username: \"jacknich\",\n body: {\n \"password\": \"new-test-password\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->changePassword([\n \"username\" => \"jacknich\",\n \"body\" => [\n \"password\" => \"new-test-password\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"password\":\"new-test-password\"}' \"$ELASTICSEARCH_URL/_security/user/jacknich/_password\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -48828,32 +33795,6 @@ } }, "x-state": "Generally available; Added in 7.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/api_key/yVGMr3QByxdh1MSaicYx/_clear_cache\n" - }, - { - "lang": "Python", - "source": "resp = client.security.clear_api_key_cache(\n ids=\"yVGMr3QByxdh1MSaicYx\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.clearApiKeyCache({\n ids: \"yVGMr3QByxdh1MSaicYx\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.clear_api_key_cache(\n ids: \"yVGMr3QByxdh1MSaicYx\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->clearApiKeyCache([\n \"ids\" => \"yVGMr3QByxdh1MSaicYx\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/api_key/yVGMr3QByxdh1MSaicYx/_clear_cache\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -48910,32 +33851,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/privilege/myapp/_clear_cache\n" - }, - { - "lang": "Python", - "source": "resp = client.security.clear_cached_privileges(\n application=\"myapp\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.clearCachedPrivileges({\n application: \"myapp\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.clear_cached_privileges(\n application: \"myapp\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->clearCachedPrivileges([\n \"application\" => \"myapp\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/privilege/myapp/_clear_cache\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -49008,32 +33923,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/realm/default_file/_clear_cache\n" - }, - { - "lang": "Python", - "source": "resp = client.security.clear_cached_realms(\n realms=\"default_file\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.clearCachedRealms({\n realms: \"default_file\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.clear_cached_realms(\n realms: \"default_file\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->clearCachedRealms([\n \"realms\" => \"default_file\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/realm/default_file/_clear_cache\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -49090,32 +33979,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/role/my_admin_role/_clear_cache\n" - }, - { - "lang": "Python", - "source": "resp = client.security.clear_cached_roles(\n name=\"my_admin_role\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.clearCachedRoles({\n name: \"my_admin_role\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.clear_cached_roles(\n name: \"my_admin_role\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->clearCachedRoles([\n \"name\" => \"my_admin_role\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/role/my_admin_role/_clear_cache\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -49197,32 +34060,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/service/elastic/fleet-server/credential/token/token1/_clear_cache\n" - }, - { - "lang": "Python", - "source": "resp = client.security.clear_cached_service_tokens(\n namespace=\"elastic\",\n service=\"fleet-server\",\n name=\"token1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.clearCachedServiceTokens({\n namespace: \"elastic\",\n service: \"fleet-server\",\n name: \"token1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.clear_cached_service_tokens(\n namespace: \"elastic\",\n service: \"fleet-server\",\n name: \"token1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->clearCachedServiceTokens([\n \"namespace\" => \"elastic\",\n \"service\" => \"fleet-server\",\n \"name\" => \"token1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/service/elastic/fleet-server/credential/token/token1/_clear_cache\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -49352,32 +34189,6 @@ } }, "x-state": "Generally available; Added in 6.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/api_key?username=myuser&realm_name=native1\n" - }, - { - "lang": "Python", - "source": "resp = client.security.get_api_key(\n username=\"myuser\",\n realm_name=\"native1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.getApiKey({\n username: \"myuser\",\n realm_name: \"native1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.get_api_key(\n username: \"myuser\",\n realm_name: \"native1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->getApiKey([\n \"username\" => \"myuser\",\n \"realm_name\" => \"native1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/api_key?username=myuser&realm_name=native1\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -49404,32 +34215,6 @@ } }, "x-state": "Generally available; Added in 6.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/api_key\n{\n \"name\": \"my-api-key\",\n \"expiration\": \"1d\", \n \"role_descriptors\": { \n \"role-a\": {\n \"cluster\": [\"all\"],\n \"indices\": [\n {\n \"names\": [\"index-a*\"],\n \"privileges\": [\"read\"]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\"all\"],\n \"indices\": [\n {\n \"names\": [\"index-b*\"],\n \"privileges\": [\"all\"]\n }\n ]\n }\n },\n \"metadata\": {\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\"dev\", \"staging\"]\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.create_api_key(\n name=\"my-api-key\",\n expiration=\"1d\",\n role_descriptors={\n \"role-a\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-a*\"\n ],\n \"privileges\": [\n \"read\"\n ]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-b*\"\n ],\n \"privileges\": [\n \"all\"\n ]\n }\n ]\n }\n },\n metadata={\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": True,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.createApiKey({\n name: \"my-api-key\",\n expiration: \"1d\",\n role_descriptors: {\n \"role-a\": {\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index-a*\"],\n privileges: [\"read\"],\n },\n ],\n },\n \"role-b\": {\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index-b*\"],\n privileges: [\"all\"],\n },\n ],\n },\n },\n metadata: {\n application: \"my-application\",\n environment: {\n level: 1,\n trusted: true,\n tags: [\"dev\", \"staging\"],\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.create_api_key(\n body: {\n \"name\": \"my-api-key\",\n \"expiration\": \"1d\",\n \"role_descriptors\": {\n \"role-a\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-a*\"\n ],\n \"privileges\": [\n \"read\"\n ]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-b*\"\n ],\n \"privileges\": [\n \"all\"\n ]\n }\n ]\n }\n },\n \"metadata\": {\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->createApiKey([\n \"body\" => [\n \"name\" => \"my-api-key\",\n \"expiration\" => \"1d\",\n \"role_descriptors\" => [\n \"role-a\" => [\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index-a*\",\n ),\n \"privileges\" => array(\n \"read\",\n ),\n ],\n ),\n ],\n \"role-b\" => [\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index-b*\",\n ),\n \"privileges\" => array(\n \"all\",\n ),\n ],\n ),\n ],\n ],\n \"metadata\" => [\n \"application\" => \"my-application\",\n \"environment\" => [\n \"level\" => 1,\n \"trusted\" => true,\n \"tags\" => array(\n \"dev\",\n \"staging\",\n ),\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"name\":\"my-api-key\",\"expiration\":\"1d\",\"role_descriptors\":{\"role-a\":{\"cluster\":[\"all\"],\"indices\":[{\"names\":[\"index-a*\"],\"privileges\":[\"read\"]}]},\"role-b\":{\"cluster\":[\"all\"],\"indices\":[{\"names\":[\"index-b*\"],\"privileges\":[\"all\"]}]}},\"metadata\":{\"application\":\"my-application\",\"environment\":{\"level\":1,\"trusted\":true,\"tags\":[\"dev\",\"staging\"]}}}' \"$ELASTICSEARCH_URL/_security/api_key\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -49456,32 +34241,6 @@ } }, "x-state": "Generally available; Added in 6.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/api_key\n{\n \"name\": \"my-api-key\",\n \"expiration\": \"1d\", \n \"role_descriptors\": { \n \"role-a\": {\n \"cluster\": [\"all\"],\n \"indices\": [\n {\n \"names\": [\"index-a*\"],\n \"privileges\": [\"read\"]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\"all\"],\n \"indices\": [\n {\n \"names\": [\"index-b*\"],\n \"privileges\": [\"all\"]\n }\n ]\n }\n },\n \"metadata\": {\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\"dev\", \"staging\"]\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.create_api_key(\n name=\"my-api-key\",\n expiration=\"1d\",\n role_descriptors={\n \"role-a\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-a*\"\n ],\n \"privileges\": [\n \"read\"\n ]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-b*\"\n ],\n \"privileges\": [\n \"all\"\n ]\n }\n ]\n }\n },\n metadata={\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": True,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.createApiKey({\n name: \"my-api-key\",\n expiration: \"1d\",\n role_descriptors: {\n \"role-a\": {\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index-a*\"],\n privileges: [\"read\"],\n },\n ],\n },\n \"role-b\": {\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index-b*\"],\n privileges: [\"all\"],\n },\n ],\n },\n },\n metadata: {\n application: \"my-application\",\n environment: {\n level: 1,\n trusted: true,\n tags: [\"dev\", \"staging\"],\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.create_api_key(\n body: {\n \"name\": \"my-api-key\",\n \"expiration\": \"1d\",\n \"role_descriptors\": {\n \"role-a\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-a*\"\n ],\n \"privileges\": [\n \"read\"\n ]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-b*\"\n ],\n \"privileges\": [\n \"all\"\n ]\n }\n ]\n }\n },\n \"metadata\": {\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->createApiKey([\n \"body\" => [\n \"name\" => \"my-api-key\",\n \"expiration\" => \"1d\",\n \"role_descriptors\" => [\n \"role-a\" => [\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index-a*\",\n ),\n \"privileges\" => array(\n \"read\",\n ),\n ],\n ),\n ],\n \"role-b\" => [\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index-b*\",\n ),\n \"privileges\" => array(\n \"all\",\n ),\n ],\n ),\n ],\n ],\n \"metadata\" => [\n \"application\" => \"my-application\",\n \"environment\" => [\n \"level\" => 1,\n \"trusted\" => true,\n \"tags\" => array(\n \"dev\",\n \"staging\",\n ),\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"name\":\"my-api-key\",\"expiration\":\"1d\",\"role_descriptors\":{\"role-a\":{\"cluster\":[\"all\"],\"indices\":[{\"names\":[\"index-a*\"],\"privileges\":[\"read\"]}]},\"role-b\":{\"cluster\":[\"all\"],\"indices\":[{\"names\":[\"index-b*\"],\"privileges\":[\"all\"]}]}},\"metadata\":{\"application\":\"my-application\",\"environment\":{\"level\":1,\"trusted\":true,\"tags\":[\"dev\",\"staging\"]}}}' \"$ELASTICSEARCH_URL/_security/api_key\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -49610,32 +34369,6 @@ } }, "x-state": "Generally available; Added in 6.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_security/api_key\n{\n \"ids\" : [ \"VuaCfGcBCdbkQm-e5aOx\" ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.invalidate_api_key(\n ids=[\n \"VuaCfGcBCdbkQm-e5aOx\"\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.invalidateApiKey({\n ids: [\"VuaCfGcBCdbkQm-e5aOx\"],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.invalidate_api_key(\n body: {\n \"ids\": [\n \"VuaCfGcBCdbkQm-e5aOx\"\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->invalidateApiKey([\n \"body\" => [\n \"ids\" => array(\n \"VuaCfGcBCdbkQm-e5aOx\",\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"ids\":[\"VuaCfGcBCdbkQm-e5aOx\"]}' \"$ELASTICSEARCH_URL/_security/api_key\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -49728,32 +34461,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/cross_cluster/api_key\n{\n \"name\": \"my-cross-cluster-api-key\",\n \"expiration\": \"1d\", \n \"access\": {\n \"search\": [ \n {\n \"names\": [\"logs*\"]\n }\n ],\n \"replication\": [ \n {\n \"names\": [\"archive*\"]\n }\n ]\n },\n \"metadata\": {\n \"description\": \"phase one\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\"dev\", \"staging\"]\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.create_cross_cluster_api_key(\n name=\"my-cross-cluster-api-key\",\n expiration=\"1d\",\n access={\n \"search\": [\n {\n \"names\": [\n \"logs*\"\n ]\n }\n ],\n \"replication\": [\n {\n \"names\": [\n \"archive*\"\n ]\n }\n ]\n },\n metadata={\n \"description\": \"phase one\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": True,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.createCrossClusterApiKey({\n name: \"my-cross-cluster-api-key\",\n expiration: \"1d\",\n access: {\n search: [\n {\n names: [\"logs*\"],\n },\n ],\n replication: [\n {\n names: [\"archive*\"],\n },\n ],\n },\n metadata: {\n description: \"phase one\",\n environment: {\n level: 1,\n trusted: true,\n tags: [\"dev\", \"staging\"],\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.create_cross_cluster_api_key(\n body: {\n \"name\": \"my-cross-cluster-api-key\",\n \"expiration\": \"1d\",\n \"access\": {\n \"search\": [\n {\n \"names\": [\n \"logs*\"\n ]\n }\n ],\n \"replication\": [\n {\n \"names\": [\n \"archive*\"\n ]\n }\n ]\n },\n \"metadata\": {\n \"description\": \"phase one\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->createCrossClusterApiKey([\n \"body\" => [\n \"name\" => \"my-cross-cluster-api-key\",\n \"expiration\" => \"1d\",\n \"access\" => [\n \"search\" => array(\n [\n \"names\" => array(\n \"logs*\",\n ),\n ],\n ),\n \"replication\" => array(\n [\n \"names\" => array(\n \"archive*\",\n ),\n ],\n ),\n ],\n \"metadata\" => [\n \"description\" => \"phase one\",\n \"environment\" => [\n \"level\" => 1,\n \"trusted\" => true,\n \"tags\" => array(\n \"dev\",\n \"staging\",\n ),\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"name\":\"my-cross-cluster-api-key\",\"expiration\":\"1d\",\"access\":{\"search\":[{\"names\":[\"logs*\"]}],\"replication\":[{\"names\":[\"archive*\"]}]},\"metadata\":{\"description\":\"phase one\",\"environment\":{\"level\":1,\"trusted\":true,\"tags\":[\"dev\",\"staging\"]}}}' \"$ELASTICSEARCH_URL/_security/cross_cluster/api_key\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -49788,32 +34495,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/service/elastic/fleet-server/credential/token/token1\n" - }, - { - "lang": "Python", - "source": "resp = client.security.create_service_token(\n namespace=\"elastic\",\n service=\"fleet-server\",\n name=\"token1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.createServiceToken({\n namespace: \"elastic\",\n service: \"fleet-server\",\n name: \"token1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.create_service_token(\n namespace: \"elastic\",\n service: \"fleet-server\",\n name: \"token1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->createServiceToken([\n \"namespace\" => \"elastic\",\n \"service\" => \"fleet-server\",\n \"name\" => \"token1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/service/elastic/fleet-server/credential/token/token1\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -49846,32 +34527,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/service/elastic/fleet-server/credential/token/token1\n" - }, - { - "lang": "Python", - "source": "resp = client.security.create_service_token(\n namespace=\"elastic\",\n service=\"fleet-server\",\n name=\"token1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.createServiceToken({\n namespace: \"elastic\",\n service: \"fleet-server\",\n name: \"token1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.create_service_token(\n namespace: \"elastic\",\n service: \"fleet-server\",\n name: \"token1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->createServiceToken([\n \"namespace\" => \"elastic\",\n \"service\" => \"fleet-server\",\n \"name\" => \"token1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/service/elastic/fleet-server/credential/token/token1\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -49957,32 +34612,6 @@ } }, "x-state": "Generally available; Added in 5.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_security/service/elastic/fleet-server/credential/token/token42\n" - }, - { - "lang": "Python", - "source": "resp = client.security.delete_service_token(\n namespace=\"elastic\",\n service=\"fleet-server\",\n name=\"token42\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.deleteServiceToken({\n namespace: \"elastic\",\n service: \"fleet-server\",\n name: \"token42\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.delete_service_token(\n namespace: \"elastic\",\n service: \"fleet-server\",\n name: \"token42\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->deleteServiceToken([\n \"namespace\" => \"elastic\",\n \"service\" => \"fleet-server\",\n \"name\" => \"token42\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/service/elastic/fleet-server/credential/token/token42\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -50014,32 +34643,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/service/elastic/fleet-server/credential/token/token1\n" - }, - { - "lang": "Python", - "source": "resp = client.security.create_service_token(\n namespace=\"elastic\",\n service=\"fleet-server\",\n name=\"token1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.createServiceToken({\n namespace: \"elastic\",\n service: \"fleet-server\",\n name: \"token1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.create_service_token(\n namespace: \"elastic\",\n service: \"fleet-server\",\n name: \"token1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->createServiceToken([\n \"namespace\" => \"elastic\",\n \"service\" => \"fleet-server\",\n \"name\" => \"token1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/service/elastic/fleet-server/credential/token/token1\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -50123,32 +34726,6 @@ } }, "x-state": "Generally available; Added in 7.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/delegate_pki\n{\n\"x509_certificate_chain\": [\"MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==\"]\n}" - }, - { - "lang": "Python", - "source": "resp = client.perform_request(\n \"POST\",\n \"/_security/delegate_pki\",\n headers={\"Content-Type\": \"application/json\"},\n body={\n \"x509_certificate_chain\": [\n \"MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==\"\n ]\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transport.request({\n method: \"POST\",\n path: \"/_security/delegate_pki\",\n body: {\n x509_certificate_chain: [\n \"MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==\",\n ],\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.perform_request(\n \"POST\",\n \"/_security/delegate_pki\",\n {},\n {\n \"x509_certificate_chain\": [\n \"MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==\"\n ]\n },\n { \"Content-Type\": \"application/json\" },\n)" - }, - { - "lang": "PHP", - "source": "$requestFactory = Psr17FactoryDiscovery::findRequestFactory();\n$streamFactory = Psr17FactoryDiscovery::findStreamFactory();\n$request = $requestFactory->createRequest(\n \"POST\",\n \"/_security/delegate_pki\",\n);\n$request = $request->withHeader(\"Content-Type\", \"application/json\");\n$request = $request->withBody($streamFactory->createStream(\n json_encode([\n \"x509_certificate_chain\" => array(\n \"MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==\",\n ),\n ]),\n));\n$resp = $client->sendRequest($request);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"x509_certificate_chain\":[\"MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==\"]}' \"$ELASTICSEARCH_URL/_security/delegate_pki\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -50177,32 +34754,6 @@ } }, "x-state": "Generally available; Added in 6.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/privilege/myapp/read\n" - }, - { - "lang": "Python", - "source": "resp = client.security.get_privileges(\n application=\"myapp\",\n name=\"read\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.getPrivileges({\n application: \"myapp\",\n name: \"read\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.get_privileges(\n application: \"myapp\",\n name: \"read\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->getPrivileges([\n \"application\" => \"myapp\",\n \"name\" => \"read\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/privilege/myapp/read\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -50274,32 +34825,6 @@ } }, "x-state": "Generally available; Added in 6.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_security/privilege/myapp/read\n" - }, - { - "lang": "Python", - "source": "resp = client.security.delete_privileges(\n application=\"myapp\",\n name=\"read\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.deletePrivileges({\n application: \"myapp\",\n name: \"read\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.delete_privileges(\n application: \"myapp\",\n name: \"read\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->deletePrivileges([\n \"application\" => \"myapp\",\n \"name\" => \"read\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/privilege/myapp/read\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -50322,32 +34847,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/role/my_admin_role\n" - }, - { - "lang": "Python", - "source": "resp = client.security.get_role(\n name=\"my_admin_role\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.getRole({\n name: \"my_admin_role\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.get_role(\n name: \"my_admin_role\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->getRole([\n \"name\" => \"my_admin_role\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/role/my_admin_role\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -50377,32 +34876,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/role/my_admin_role\n{\n \"description\": \"Grants full access to all management features within the cluster.\",\n \"cluster\": [\"all\"],\n \"indices\": [\n {\n \"names\": [ \"index1\", \"index2\" ],\n \"privileges\": [\"all\"],\n \"field_security\" : { // optional\n \"grant\" : [ \"title\", \"body\" ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\" // optional\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [ \"admin\", \"read\" ],\n \"resources\": [ \"*\" ]\n }\n ],\n \"run_as\": [ \"other_user\" ], // optional\n \"metadata\" : { // optional\n \"version\" : 1\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.put_role(\n name=\"my_admin_role\",\n description=\"Grants full access to all management features within the cluster.\",\n cluster=[\n \"all\"\n ],\n indices=[\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\n \"all\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n applications=[\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n run_as=[\n \"other_user\"\n ],\n metadata={\n \"version\": 1\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.putRole({\n name: \"my_admin_role\",\n description:\n \"Grants full access to all management features within the cluster.\",\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index1\", \"index2\"],\n privileges: [\"all\"],\n field_security: {\n grant: [\"title\", \"body\"],\n },\n query: '{\"match\": {\"title\": \"foo\"}}',\n },\n ],\n applications: [\n {\n application: \"myapp\",\n privileges: [\"admin\", \"read\"],\n resources: [\"*\"],\n },\n ],\n run_as: [\"other_user\"],\n metadata: {\n version: 1,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.put_role(\n name: \"my_admin_role\",\n body: {\n \"description\": \"Grants full access to all management features within the cluster.\",\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\n \"all\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->putRole([\n \"name\" => \"my_admin_role\",\n \"body\" => [\n \"description\" => \"Grants full access to all management features within the cluster.\",\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index1\",\n \"index2\",\n ),\n \"privileges\" => array(\n \"all\",\n ),\n \"field_security\" => [\n \"grant\" => array(\n \"title\",\n \"body\",\n ),\n ],\n \"query\" => \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\",\n ],\n ),\n \"applications\" => array(\n [\n \"application\" => \"myapp\",\n \"privileges\" => array(\n \"admin\",\n \"read\",\n ),\n \"resources\" => array(\n \"*\",\n ),\n ],\n ),\n \"run_as\" => array(\n \"other_user\",\n ),\n \"metadata\" => [\n \"version\" => 1,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"description\":\"Grants full access to all management features within the cluster.\",\"cluster\":[\"all\"],\"indices\":[{\"names\":[\"index1\",\"index2\"],\"privileges\":[\"all\"],\"field_security\":{\"grant\":[\"title\",\"body\"]},\"query\":\"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"}],\"applications\":[{\"application\":\"myapp\",\"privileges\":[\"admin\",\"read\"],\"resources\":[\"*\"]}],\"run_as\":[\"other_user\"],\"metadata\":{\"version\":1}}' \"$ELASTICSEARCH_URL/_security/role/my_admin_role\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -50432,32 +34905,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/role/my_admin_role\n{\n \"description\": \"Grants full access to all management features within the cluster.\",\n \"cluster\": [\"all\"],\n \"indices\": [\n {\n \"names\": [ \"index1\", \"index2\" ],\n \"privileges\": [\"all\"],\n \"field_security\" : { // optional\n \"grant\" : [ \"title\", \"body\" ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\" // optional\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [ \"admin\", \"read\" ],\n \"resources\": [ \"*\" ]\n }\n ],\n \"run_as\": [ \"other_user\" ], // optional\n \"metadata\" : { // optional\n \"version\" : 1\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.put_role(\n name=\"my_admin_role\",\n description=\"Grants full access to all management features within the cluster.\",\n cluster=[\n \"all\"\n ],\n indices=[\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\n \"all\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n applications=[\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n run_as=[\n \"other_user\"\n ],\n metadata={\n \"version\": 1\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.putRole({\n name: \"my_admin_role\",\n description:\n \"Grants full access to all management features within the cluster.\",\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index1\", \"index2\"],\n privileges: [\"all\"],\n field_security: {\n grant: [\"title\", \"body\"],\n },\n query: '{\"match\": {\"title\": \"foo\"}}',\n },\n ],\n applications: [\n {\n application: \"myapp\",\n privileges: [\"admin\", \"read\"],\n resources: [\"*\"],\n },\n ],\n run_as: [\"other_user\"],\n metadata: {\n version: 1,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.put_role(\n name: \"my_admin_role\",\n body: {\n \"description\": \"Grants full access to all management features within the cluster.\",\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\n \"all\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->putRole([\n \"name\" => \"my_admin_role\",\n \"body\" => [\n \"description\" => \"Grants full access to all management features within the cluster.\",\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index1\",\n \"index2\",\n ),\n \"privileges\" => array(\n \"all\",\n ),\n \"field_security\" => [\n \"grant\" => array(\n \"title\",\n \"body\",\n ),\n ],\n \"query\" => \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\",\n ],\n ),\n \"applications\" => array(\n [\n \"application\" => \"myapp\",\n \"privileges\" => array(\n \"admin\",\n \"read\",\n ),\n \"resources\" => array(\n \"*\",\n ),\n ],\n ),\n \"run_as\" => array(\n \"other_user\",\n ),\n \"metadata\" => [\n \"version\" => 1,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"description\":\"Grants full access to all management features within the cluster.\",\"cluster\":[\"all\"],\"indices\":[{\"names\":[\"index1\",\"index2\"],\"privileges\":[\"all\"],\"field_security\":{\"grant\":[\"title\",\"body\"]},\"query\":\"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"}],\"applications\":[{\"application\":\"myapp\",\"privileges\":[\"admin\",\"read\"],\"resources\":[\"*\"]}],\"run_as\":[\"other_user\"],\"metadata\":{\"version\":1}}' \"$ELASTICSEARCH_URL/_security/role/my_admin_role\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -50518,32 +34965,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_security/role/my_admin_role\n" - }, - { - "lang": "Python", - "source": "resp = client.security.delete_role(\n name=\"my_admin_role\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.deleteRole({\n name: \"my_admin_role\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.delete_role(\n name: \"my_admin_role\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->deleteRole([\n \"name\" => \"my_admin_role\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/role/my_admin_role\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -50569,32 +34990,6 @@ } }, "x-state": "Generally available; Added in 5.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/role_mapping/mapping1\n" - }, - { - "lang": "Python", - "source": "resp = client.security.get_role_mapping(\n name=\"mapping1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.getRoleMapping({\n name: \"mapping1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.get_role_mapping(\n name: \"mapping1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->getRoleMapping([\n \"name\" => \"mapping1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/role_mapping/mapping1\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -50624,32 +35019,6 @@ } }, "x-state": "Generally available; Added in 5.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/role_mapping/mapping1\n{\n \"roles\": [ \"user\"],\n \"enabled\": true, \n \"rules\": {\n \"field\" : { \"username\" : \"*\" }\n },\n \"metadata\" : { \n \"version\" : 1\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.put_role_mapping(\n name=\"mapping1\",\n roles=[\n \"user\"\n ],\n enabled=True,\n rules={\n \"field\": {\n \"username\": \"*\"\n }\n },\n metadata={\n \"version\": 1\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.putRoleMapping({\n name: \"mapping1\",\n roles: [\"user\"],\n enabled: true,\n rules: {\n field: {\n username: \"*\",\n },\n },\n metadata: {\n version: 1,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.put_role_mapping(\n name: \"mapping1\",\n body: {\n \"roles\": [\n \"user\"\n ],\n \"enabled\": true,\n \"rules\": {\n \"field\": {\n \"username\": \"*\"\n }\n },\n \"metadata\": {\n \"version\": 1\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->putRoleMapping([\n \"name\" => \"mapping1\",\n \"body\" => [\n \"roles\" => array(\n \"user\",\n ),\n \"enabled\" => true,\n \"rules\" => [\n \"field\" => [\n \"username\" => \"*\",\n ],\n ],\n \"metadata\" => [\n \"version\" => 1,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"roles\":[\"user\"],\"enabled\":true,\"rules\":{\"field\":{\"username\":\"*\"}},\"metadata\":{\"version\":1}}' \"$ELASTICSEARCH_URL/_security/role_mapping/mapping1\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -50679,32 +35048,6 @@ } }, "x-state": "Generally available; Added in 5.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/role_mapping/mapping1\n{\n \"roles\": [ \"user\"],\n \"enabled\": true, \n \"rules\": {\n \"field\" : { \"username\" : \"*\" }\n },\n \"metadata\" : { \n \"version\" : 1\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.put_role_mapping(\n name=\"mapping1\",\n roles=[\n \"user\"\n ],\n enabled=True,\n rules={\n \"field\": {\n \"username\": \"*\"\n }\n },\n metadata={\n \"version\": 1\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.putRoleMapping({\n name: \"mapping1\",\n roles: [\"user\"],\n enabled: true,\n rules: {\n field: {\n username: \"*\",\n },\n },\n metadata: {\n version: 1,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.put_role_mapping(\n name: \"mapping1\",\n body: {\n \"roles\": [\n \"user\"\n ],\n \"enabled\": true,\n \"rules\": {\n \"field\": {\n \"username\": \"*\"\n }\n },\n \"metadata\": {\n \"version\": 1\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->putRoleMapping([\n \"name\" => \"mapping1\",\n \"body\" => [\n \"roles\" => array(\n \"user\",\n ),\n \"enabled\" => true,\n \"rules\" => [\n \"field\" => [\n \"username\" => \"*\",\n ],\n ],\n \"metadata\" => [\n \"version\" => 1,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"roles\":[\"user\"],\"enabled\":true,\"rules\":{\"field\":{\"username\":\"*\"}},\"metadata\":{\"version\":1}}' \"$ELASTICSEARCH_URL/_security/role_mapping/mapping1\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -50768,32 +35111,6 @@ } }, "x-state": "Generally available; Added in 5.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_security/role_mapping/mapping1\n" - }, - { - "lang": "Python", - "source": "resp = client.security.delete_role_mapping(\n name=\"mapping1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.deleteRoleMapping({\n name: \"mapping1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.delete_role_mapping(\n name: \"mapping1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->deleteRoleMapping([\n \"name\" => \"mapping1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/role_mapping/mapping1\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -50819,32 +35136,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/user/jacknich?with_profile_uid=true\n" - }, - { - "lang": "Python", - "source": "resp = client.security.get_user(\n username=\"jacknich\",\n with_profile_uid=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.getUser({\n username: \"jacknich\",\n with_profile_uid: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.get_user(\n username: \"jacknich\",\n with_profile_uid: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->getUser([\n \"username\" => \"jacknich\",\n \"with_profile_uid\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/user/jacknich?with_profile_uid=true\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -50871,32 +35162,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/user/jacknich\n{\n \"password\" : \"l0ng-r4nd0m-p@ssw0rd\",\n \"roles\" : [ \"admin\", \"other_role1\" ],\n \"full_name\" : \"Jack Nicholson\",\n \"email\" : \"jacknich@example.com\",\n \"metadata\" : {\n \"intelligence\" : 7\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.put_user(\n username=\"jacknich\",\n password=\"l0ng-r4nd0m-p@ssw0rd\",\n roles=[\n \"admin\",\n \"other_role1\"\n ],\n full_name=\"Jack Nicholson\",\n email=\"jacknich@example.com\",\n metadata={\n \"intelligence\": 7\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.putUser({\n username: \"jacknich\",\n password: \"l0ng-r4nd0m-p@ssw0rd\",\n roles: [\"admin\", \"other_role1\"],\n full_name: \"Jack Nicholson\",\n email: \"jacknich@example.com\",\n metadata: {\n intelligence: 7,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.put_user(\n username: \"jacknich\",\n body: {\n \"password\": \"l0ng-r4nd0m-p@ssw0rd\",\n \"roles\": [\n \"admin\",\n \"other_role1\"\n ],\n \"full_name\": \"Jack Nicholson\",\n \"email\": \"jacknich@example.com\",\n \"metadata\": {\n \"intelligence\": 7\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->putUser([\n \"username\" => \"jacknich\",\n \"body\" => [\n \"password\" => \"l0ng-r4nd0m-p@ssw0rd\",\n \"roles\" => array(\n \"admin\",\n \"other_role1\",\n ),\n \"full_name\" => \"Jack Nicholson\",\n \"email\" => \"jacknich@example.com\",\n \"metadata\" => [\n \"intelligence\" => 7,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"password\":\"l0ng-r4nd0m-p@ssw0rd\",\"roles\":[\"admin\",\"other_role1\"],\"full_name\":\"Jack Nicholson\",\"email\":\"jacknich@example.com\",\"metadata\":{\"intelligence\":7}}' \"$ELASTICSEARCH_URL/_security/user/jacknich\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -50923,32 +35188,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/user/jacknich\n{\n \"password\" : \"l0ng-r4nd0m-p@ssw0rd\",\n \"roles\" : [ \"admin\", \"other_role1\" ],\n \"full_name\" : \"Jack Nicholson\",\n \"email\" : \"jacknich@example.com\",\n \"metadata\" : {\n \"intelligence\" : 7\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.put_user(\n username=\"jacknich\",\n password=\"l0ng-r4nd0m-p@ssw0rd\",\n roles=[\n \"admin\",\n \"other_role1\"\n ],\n full_name=\"Jack Nicholson\",\n email=\"jacknich@example.com\",\n metadata={\n \"intelligence\": 7\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.putUser({\n username: \"jacknich\",\n password: \"l0ng-r4nd0m-p@ssw0rd\",\n roles: [\"admin\", \"other_role1\"],\n full_name: \"Jack Nicholson\",\n email: \"jacknich@example.com\",\n metadata: {\n intelligence: 7,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.put_user(\n username: \"jacknich\",\n body: {\n \"password\": \"l0ng-r4nd0m-p@ssw0rd\",\n \"roles\": [\n \"admin\",\n \"other_role1\"\n ],\n \"full_name\": \"Jack Nicholson\",\n \"email\": \"jacknich@example.com\",\n \"metadata\": {\n \"intelligence\": 7\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->putUser([\n \"username\" => \"jacknich\",\n \"body\" => [\n \"password\" => \"l0ng-r4nd0m-p@ssw0rd\",\n \"roles\" => array(\n \"admin\",\n \"other_role1\",\n ),\n \"full_name\" => \"Jack Nicholson\",\n \"email\" => \"jacknich@example.com\",\n \"metadata\" => [\n \"intelligence\" => 7,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"password\":\"l0ng-r4nd0m-p@ssw0rd\",\"roles\":[\"admin\",\"other_role1\"],\"full_name\":\"Jack Nicholson\",\"email\":\"jacknich@example.com\",\"metadata\":{\"intelligence\":7}}' \"$ELASTICSEARCH_URL/_security/user/jacknich\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -51009,32 +35248,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_security/user/jacknich\n" - }, - { - "lang": "Python", - "source": "resp = client.security.delete_user(\n username=\"jacknich\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.deleteUser({\n username: \"jacknich\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.delete_user(\n username: \"jacknich\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->deleteUser([\n \"username\" => \"jacknich\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/user/jacknich\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -51060,32 +35273,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_security/user/jacknich/_disable\n" - }, - { - "lang": "Python", - "source": "resp = client.security.disable_user(\n username=\"jacknich\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.disableUser({\n username: \"jacknich\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.disable_user(\n username: \"jacknich\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->disableUser([\n \"username\" => \"jacknich\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/user/jacknich/_disable\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -51109,32 +35296,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_security/user/jacknich/_disable\n" - }, - { - "lang": "Python", - "source": "resp = client.security.disable_user(\n username=\"jacknich\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.disableUser({\n username: \"jacknich\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.disable_user(\n username: \"jacknich\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->disableUser([\n \"username\" => \"jacknich\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/user/jacknich/_disable\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -51160,32 +35321,6 @@ } }, "x-state": "Generally available; Added in 8.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/profile/u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0/_disable\n" - }, - { - "lang": "Python", - "source": "resp = client.security.disable_user_profile(\n uid=\"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.disableUserProfile({\n uid: \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.disable_user_profile(\n uid: \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->disableUserProfile([\n \"uid\" => \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/profile/u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0/_disable\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -51209,32 +35344,6 @@ } }, "x-state": "Generally available; Added in 8.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/profile/u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0/_disable\n" - }, - { - "lang": "Python", - "source": "resp = client.security.disable_user_profile(\n uid=\"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.disableUserProfile({\n uid: \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.disable_user_profile(\n uid: \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->disableUserProfile([\n \"uid\" => \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/profile/u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0/_disable\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -51260,32 +35369,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _security/user/logstash_system/_enable\n" - }, - { - "lang": "Python", - "source": "resp = client.security.enable_user(\n username=\"logstash_system\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.enableUser({\n username: \"logstash_system\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.enable_user(\n username: \"logstash_system\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->enableUser([\n \"username\" => \"logstash_system\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/user/logstash_system/_enable\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -51309,32 +35392,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _security/user/logstash_system/_enable\n" - }, - { - "lang": "Python", - "source": "resp = client.security.enable_user(\n username=\"logstash_system\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.enableUser({\n username: \"logstash_system\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.enable_user(\n username: \"logstash_system\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->enableUser([\n \"username\" => \"logstash_system\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/user/logstash_system/_enable\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -51360,32 +35417,6 @@ } }, "x-state": "Generally available; Added in 8.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/profile/u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0/_enable\n" - }, - { - "lang": "Python", - "source": "resp = client.security.enable_user_profile(\n uid=\"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.enableUserProfile({\n uid: \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.enable_user_profile(\n uid: \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->enableUserProfile([\n \"uid\" => \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/profile/u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0/_enable\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -51409,32 +35440,6 @@ } }, "x-state": "Generally available; Added in 8.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/profile/u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0/_enable\n" - }, - { - "lang": "Python", - "source": "resp = client.security.enable_user_profile(\n uid=\"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.enableUserProfile({\n uid: \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.enable_user_profile(\n uid: \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->enableUserProfile([\n \"uid\" => \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/profile/u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0/_enable\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -51478,32 +35483,6 @@ } }, "x-state": "Generally available; Added in 8.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/enroll/kibana\n" - }, - { - "lang": "Python", - "source": "resp = client.security.enroll_kibana()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.enrollKibana();" - }, - { - "lang": "Ruby", - "source": "response = client.security.enroll_kibana" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->enrollKibana();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/enroll/kibana\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -51633,32 +35612,6 @@ } }, "x-state": "Generally available; Added in 7.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/privilege/_builtin\n" - }, - { - "lang": "Python", - "source": "resp = client.security.get_builtin_privileges()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.getBuiltinPrivileges();" - }, - { - "lang": "Ruby", - "source": "response = client.security.get_builtin_privileges" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->getBuiltinPrivileges();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/privilege/_builtin\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -51679,32 +35632,6 @@ } }, "x-state": "Generally available; Added in 6.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/privilege/myapp/read\n" - }, - { - "lang": "Python", - "source": "resp = client.security.get_privileges(\n application=\"myapp\",\n name=\"read\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.getPrivileges({\n application: \"myapp\",\n name: \"read\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.get_privileges(\n application: \"myapp\",\n name: \"read\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->getPrivileges([\n \"application\" => \"myapp\",\n \"name\" => \"read\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/privilege/myapp/read\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -51731,32 +35658,6 @@ } }, "x-state": "Generally available; Added in 6.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_security/privilege\n{\n \"myapp\": {\n \"read\": {\n \"actions\": [ \n \"data:read/*\" , \n \"action:login\" ],\n \"metadata\": { \n \"description\": \"Read access to myapp\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.put_privileges(\n privileges={\n \"myapp\": {\n \"read\": {\n \"actions\": [\n \"data:read/*\",\n \"action:login\"\n ],\n \"metadata\": {\n \"description\": \"Read access to myapp\"\n }\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.putPrivileges({\n privileges: {\n myapp: {\n read: {\n actions: [\"data:read/*\", \"action:login\"],\n metadata: {\n description: \"Read access to myapp\",\n },\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.put_privileges(\n body: {\n \"myapp\": {\n \"read\": {\n \"actions\": [\n \"data:read/*\",\n \"action:login\"\n ],\n \"metadata\": {\n \"description\": \"Read access to myapp\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->putPrivileges([\n \"body\" => [\n \"myapp\" => [\n \"read\" => [\n \"actions\" => array(\n \"data:read/*\",\n \"action:login\",\n ),\n \"metadata\" => [\n \"description\" => \"Read access to myapp\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"myapp\":{\"read\":{\"actions\":[\"data:read/*\",\"action:login\"],\"metadata\":{\"description\":\"Read access to myapp\"}}}}' \"$ELASTICSEARCH_URL/_security/privilege\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -51783,32 +35684,6 @@ } }, "x-state": "Generally available; Added in 6.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_security/privilege\n{\n \"myapp\": {\n \"read\": {\n \"actions\": [ \n \"data:read/*\" , \n \"action:login\" ],\n \"metadata\": { \n \"description\": \"Read access to myapp\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.put_privileges(\n privileges={\n \"myapp\": {\n \"read\": {\n \"actions\": [\n \"data:read/*\",\n \"action:login\"\n ],\n \"metadata\": {\n \"description\": \"Read access to myapp\"\n }\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.putPrivileges({\n privileges: {\n myapp: {\n read: {\n actions: [\"data:read/*\", \"action:login\"],\n metadata: {\n description: \"Read access to myapp\",\n },\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.put_privileges(\n body: {\n \"myapp\": {\n \"read\": {\n \"actions\": [\n \"data:read/*\",\n \"action:login\"\n ],\n \"metadata\": {\n \"description\": \"Read access to myapp\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->putPrivileges([\n \"body\" => [\n \"myapp\" => [\n \"read\" => [\n \"actions\" => array(\n \"data:read/*\",\n \"action:login\",\n ),\n \"metadata\" => [\n \"description\" => \"Read access to myapp\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"myapp\":{\"read\":{\"actions\":[\"data:read/*\",\"action:login\"],\"metadata\":{\"description\":\"Read access to myapp\"}}}}' \"$ELASTICSEARCH_URL/_security/privilege\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -51834,32 +35709,6 @@ } }, "x-state": "Generally available; Added in 6.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/privilege/myapp/read\n" - }, - { - "lang": "Python", - "source": "resp = client.security.get_privileges(\n application=\"myapp\",\n name=\"read\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.getPrivileges({\n application: \"myapp\",\n name: \"read\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.get_privileges(\n application: \"myapp\",\n name: \"read\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->getPrivileges([\n \"application\" => \"myapp\",\n \"name\" => \"read\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/privilege/myapp/read\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -51880,32 +35729,6 @@ } }, "x-state": "Generally available; Added in 5.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/role_mapping/mapping1\n" - }, - { - "lang": "Python", - "source": "resp = client.security.get_role_mapping(\n name=\"mapping1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.getRoleMapping({\n name: \"mapping1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.get_role_mapping(\n name: \"mapping1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->getRoleMapping([\n \"name\" => \"mapping1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/role_mapping/mapping1\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -51934,32 +35757,6 @@ } }, "x-state": "Generally available; Added in 7.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/service/elastic/fleet-server\n" - }, - { - "lang": "Python", - "source": "resp = client.security.get_service_accounts(\n namespace=\"elastic\",\n service=\"fleet-server\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.getServiceAccounts({\n namespace: \"elastic\",\n service: \"fleet-server\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.get_service_accounts(\n namespace: \"elastic\",\n service: \"fleet-server\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->getServiceAccounts([\n \"namespace\" => \"elastic\",\n \"service\" => \"fleet-server\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/service/elastic/fleet-server\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -51985,32 +35782,6 @@ } }, "x-state": "Generally available; Added in 7.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/service/elastic/fleet-server\n" - }, - { - "lang": "Python", - "source": "resp = client.security.get_service_accounts(\n namespace=\"elastic\",\n service=\"fleet-server\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.getServiceAccounts({\n namespace: \"elastic\",\n service: \"fleet-server\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.get_service_accounts(\n namespace: \"elastic\",\n service: \"fleet-server\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->getServiceAccounts([\n \"namespace\" => \"elastic\",\n \"service\" => \"fleet-server\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/service/elastic/fleet-server\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -52031,32 +35802,6 @@ } }, "x-state": "Generally available; Added in 7.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/service/elastic/fleet-server\n" - }, - { - "lang": "Python", - "source": "resp = client.security.get_service_accounts(\n namespace=\"elastic\",\n service=\"fleet-server\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.getServiceAccounts({\n namespace: \"elastic\",\n service: \"fleet-server\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.get_service_accounts(\n namespace: \"elastic\",\n service: \"fleet-server\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->getServiceAccounts([\n \"namespace\" => \"elastic\",\n \"service\" => \"fleet-server\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/service/elastic/fleet-server\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -52137,32 +35882,6 @@ } }, "x-state": "Generally available; Added in 7.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/service/elastic/fleet-server/credential\n" - }, - { - "lang": "Python", - "source": "resp = client.security.get_service_credentials(\n namespace=\"elastic\",\n service=\"fleet-server\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.getServiceCredentials({\n namespace: \"elastic\",\n service: \"fleet-server\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.get_service_credentials(\n namespace: \"elastic\",\n service: \"fleet-server\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->getServiceCredentials([\n \"namespace\" => \"elastic\",\n \"service\" => \"fleet-server\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/service/elastic/fleet-server/credential\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -52215,32 +35934,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/settings\n" - }, - { - "lang": "Python", - "source": "resp = client.security.get_settings()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.getSettings();" - }, - { - "lang": "Ruby", - "source": "response = client.security.get_settings" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->getSettings();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/settings\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -52320,32 +36013,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_security/settings\n{\n \"security\": {\n \"index.auto_expand_replicas\": \"0-all\"\n },\n \"security-tokens\": {\n \"index.auto_expand_replicas\": \"0-all\"\n },\n \"security-profile\": {\n \"index.auto_expand_replicas\": \"0-all\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.update_settings(\n security={\n \"index.auto_expand_replicas\": \"0-all\"\n },\n security-tokens={\n \"index.auto_expand_replicas\": \"0-all\"\n },\n security-profile={\n \"index.auto_expand_replicas\": \"0-all\"\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.updateSettings({\n security: {\n \"index.auto_expand_replicas\": \"0-all\",\n },\n \"security-tokens\": {\n \"index.auto_expand_replicas\": \"0-all\",\n },\n \"security-profile\": {\n \"index.auto_expand_replicas\": \"0-all\",\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.update_settings(\n body: {\n \"security\": {\n \"index.auto_expand_replicas\": \"0-all\"\n },\n \"security-tokens\": {\n \"index.auto_expand_replicas\": \"0-all\"\n },\n \"security-profile\": {\n \"index.auto_expand_replicas\": \"0-all\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->updateSettings([\n \"body\" => [\n \"security\" => [\n \"index.auto_expand_replicas\" => \"0-all\",\n ],\n \"security-tokens\" => [\n \"index.auto_expand_replicas\" => \"0-all\",\n ],\n \"security-profile\" => [\n \"index.auto_expand_replicas\" => \"0-all\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"security\":{\"index.auto_expand_replicas\":\"0-all\"},\"security-tokens\":{\"index.auto_expand_replicas\":\"0-all\"},\"security-profile\":{\"index.auto_expand_replicas\":\"0-all\"}}' \"$ELASTICSEARCH_URL/_security/settings\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -52459,32 +36126,6 @@ } }, "x-state": "Generally available; Added in 5.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/oauth2/token\n{\n \"grant_type\" : \"client_credentials\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.get_token(\n grant_type=\"client_credentials\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.getToken({\n grant_type: \"client_credentials\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.get_token(\n body: {\n \"grant_type\": \"client_credentials\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->getToken([\n \"body\" => [\n \"grant_type\" => \"client_credentials\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"grant_type\":\"client_credentials\"}' \"$ELASTICSEARCH_URL/_security/oauth2/token\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -52592,32 +36233,6 @@ } }, "x-state": "Generally available; Added in 5.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_security/oauth2/token\n{\n \"token\" : \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.invalidate_token(\n token=\"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.invalidateToken({\n token:\n \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.invalidate_token(\n body: {\n \"token\": \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->invalidateToken([\n \"body\" => [\n \"token\" => \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"token\":\"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\"}' \"$ELASTICSEARCH_URL/_security/oauth2/token\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -52640,32 +36255,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/user/jacknich?with_profile_uid=true\n" - }, - { - "lang": "Python", - "source": "resp = client.security.get_user(\n username=\"jacknich\",\n with_profile_uid=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.getUser({\n username: \"jacknich\",\n with_profile_uid: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.get_user(\n username: \"jacknich\",\n with_profile_uid: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->getUser([\n \"username\" => \"jacknich\",\n \"with_profile_uid\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/user/jacknich?with_profile_uid=true\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -52786,32 +36375,6 @@ } }, "x-state": "Generally available; Added in 6.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/user/_privileges\n" - }, - { - "lang": "Python", - "source": "resp = client.security.get_user_privileges()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.getUserPrivileges();" - }, - { - "lang": "Ruby", - "source": "response = client.security.get_user_privileges" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->getUserPrivileges();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/user/_privileges\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -52911,32 +36474,6 @@ } }, "x-state": "Generally available; Added in 8.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/profile/u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\n" - }, - { - "lang": "Python", - "source": "resp = client.security.get_user_profile(\n uid=\"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.getUserProfile({\n uid: \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.get_user_profile(\n uid: \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->getUserProfile([\n \"uid\" => \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/profile/u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -53031,32 +36568,6 @@ } }, "x-state": "Generally available; Added in 7.9.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/api_key/grant\n{\n \"grant_type\": \"password\",\n \"username\" : \"test_admin\",\n \"password\" : \"x-pack-test-password\",\n \"api_key\" : {\n \"name\": \"my-api-key\",\n \"expiration\": \"1d\",\n \"role_descriptors\": {\n \"role-a\": {\n \"cluster\": [\"all\"],\n \"indices\": [\n {\n \"names\": [\"index-a*\"],\n \"privileges\": [\"read\"]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\"all\"],\n \"indices\": [\n {\n \"names\": [\"index-b*\"],\n \"privileges\": [\"all\"]\n }\n ]\n }\n },\n \"metadata\": {\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\"dev\", \"staging\"]\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.grant_api_key(\n grant_type=\"password\",\n username=\"test_admin\",\n password=\"x-pack-test-password\",\n api_key={\n \"name\": \"my-api-key\",\n \"expiration\": \"1d\",\n \"role_descriptors\": {\n \"role-a\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-a*\"\n ],\n \"privileges\": [\n \"read\"\n ]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-b*\"\n ],\n \"privileges\": [\n \"all\"\n ]\n }\n ]\n }\n },\n \"metadata\": {\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": True,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.grantApiKey({\n grant_type: \"password\",\n username: \"test_admin\",\n password: \"x-pack-test-password\",\n api_key: {\n name: \"my-api-key\",\n expiration: \"1d\",\n role_descriptors: {\n \"role-a\": {\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index-a*\"],\n privileges: [\"read\"],\n },\n ],\n },\n \"role-b\": {\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index-b*\"],\n privileges: [\"all\"],\n },\n ],\n },\n },\n metadata: {\n application: \"my-application\",\n environment: {\n level: 1,\n trusted: true,\n tags: [\"dev\", \"staging\"],\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.grant_api_key(\n body: {\n \"grant_type\": \"password\",\n \"username\": \"test_admin\",\n \"password\": \"x-pack-test-password\",\n \"api_key\": {\n \"name\": \"my-api-key\",\n \"expiration\": \"1d\",\n \"role_descriptors\": {\n \"role-a\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-a*\"\n ],\n \"privileges\": [\n \"read\"\n ]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-b*\"\n ],\n \"privileges\": [\n \"all\"\n ]\n }\n ]\n }\n },\n \"metadata\": {\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->grantApiKey([\n \"body\" => [\n \"grant_type\" => \"password\",\n \"username\" => \"test_admin\",\n \"password\" => \"x-pack-test-password\",\n \"api_key\" => [\n \"name\" => \"my-api-key\",\n \"expiration\" => \"1d\",\n \"role_descriptors\" => [\n \"role-a\" => [\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index-a*\",\n ),\n \"privileges\" => array(\n \"read\",\n ),\n ],\n ),\n ],\n \"role-b\" => [\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index-b*\",\n ),\n \"privileges\" => array(\n \"all\",\n ),\n ],\n ),\n ],\n ],\n \"metadata\" => [\n \"application\" => \"my-application\",\n \"environment\" => [\n \"level\" => 1,\n \"trusted\" => true,\n \"tags\" => array(\n \"dev\",\n \"staging\",\n ),\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"grant_type\":\"password\",\"username\":\"test_admin\",\"password\":\"x-pack-test-password\",\"api_key\":{\"name\":\"my-api-key\",\"expiration\":\"1d\",\"role_descriptors\":{\"role-a\":{\"cluster\":[\"all\"],\"indices\":[{\"names\":[\"index-a*\"],\"privileges\":[\"read\"]}]},\"role-b\":{\"cluster\":[\"all\"],\"indices\":[{\"names\":[\"index-b*\"],\"privileges\":[\"all\"]}]}},\"metadata\":{\"application\":\"my-application\",\"environment\":{\"level\":1,\"trusted\":true,\"tags\":[\"dev\",\"staging\"]}}}}' \"$ELASTICSEARCH_URL/_security/api_key/grant\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -53080,32 +36591,6 @@ } }, "x-state": "Generally available; Added in 6.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/user/_has_privileges\n{\n \"cluster\": [ \"monitor\", \"manage\" ],\n \"index\" : [\n {\n \"names\": [ \"suppliers\", \"products\" ],\n \"privileges\": [ \"read\" ]\n },\n {\n \"names\": [ \"inventory\" ],\n \"privileges\" : [ \"read\", \"write\" ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\" : [ \"read\", \"data:write/inventory\" ],\n \"resources\" : [ \"product/1852563\" ]\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.has_privileges(\n cluster=[\n \"monitor\",\n \"manage\"\n ],\n index=[\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"read\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n application=[\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.hasPrivileges({\n cluster: [\"monitor\", \"manage\"],\n index: [\n {\n names: [\"suppliers\", \"products\"],\n privileges: [\"read\"],\n },\n {\n names: [\"inventory\"],\n privileges: [\"read\", \"write\"],\n },\n ],\n application: [\n {\n application: \"inventory_manager\",\n privileges: [\"read\", \"data:write/inventory\"],\n resources: [\"product/1852563\"],\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.has_privileges(\n body: {\n \"cluster\": [\n \"monitor\",\n \"manage\"\n ],\n \"index\": [\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"read\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->hasPrivileges([\n \"body\" => [\n \"cluster\" => array(\n \"monitor\",\n \"manage\",\n ),\n \"index\" => array(\n [\n \"names\" => array(\n \"suppliers\",\n \"products\",\n ),\n \"privileges\" => array(\n \"read\",\n ),\n ],\n [\n \"names\" => array(\n \"inventory\",\n ),\n \"privileges\" => array(\n \"read\",\n \"write\",\n ),\n ],\n ),\n \"application\" => array(\n [\n \"application\" => \"inventory_manager\",\n \"privileges\" => array(\n \"read\",\n \"data:write/inventory\",\n ),\n \"resources\" => array(\n \"product/1852563\",\n ),\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"cluster\":[\"monitor\",\"manage\"],\"index\":[{\"names\":[\"suppliers\",\"products\"],\"privileges\":[\"read\"]},{\"names\":[\"inventory\"],\"privileges\":[\"read\",\"write\"]}],\"application\":[{\"application\":\"inventory_manager\",\"privileges\":[\"read\",\"data:write/inventory\"],\"resources\":[\"product/1852563\"]}]}' \"$ELASTICSEARCH_URL/_security/user/_has_privileges\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -53127,32 +36612,6 @@ } }, "x-state": "Generally available; Added in 6.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/user/_has_privileges\n{\n \"cluster\": [ \"monitor\", \"manage\" ],\n \"index\" : [\n {\n \"names\": [ \"suppliers\", \"products\" ],\n \"privileges\": [ \"read\" ]\n },\n {\n \"names\": [ \"inventory\" ],\n \"privileges\" : [ \"read\", \"write\" ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\" : [ \"read\", \"data:write/inventory\" ],\n \"resources\" : [ \"product/1852563\" ]\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.has_privileges(\n cluster=[\n \"monitor\",\n \"manage\"\n ],\n index=[\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"read\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n application=[\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.hasPrivileges({\n cluster: [\"monitor\", \"manage\"],\n index: [\n {\n names: [\"suppliers\", \"products\"],\n privileges: [\"read\"],\n },\n {\n names: [\"inventory\"],\n privileges: [\"read\", \"write\"],\n },\n ],\n application: [\n {\n application: \"inventory_manager\",\n privileges: [\"read\", \"data:write/inventory\"],\n resources: [\"product/1852563\"],\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.has_privileges(\n body: {\n \"cluster\": [\n \"monitor\",\n \"manage\"\n ],\n \"index\": [\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"read\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->hasPrivileges([\n \"body\" => [\n \"cluster\" => array(\n \"monitor\",\n \"manage\",\n ),\n \"index\" => array(\n [\n \"names\" => array(\n \"suppliers\",\n \"products\",\n ),\n \"privileges\" => array(\n \"read\",\n ),\n ],\n [\n \"names\" => array(\n \"inventory\",\n ),\n \"privileges\" => array(\n \"read\",\n \"write\",\n ),\n ],\n ),\n \"application\" => array(\n [\n \"application\" => \"inventory_manager\",\n \"privileges\" => array(\n \"read\",\n \"data:write/inventory\",\n ),\n \"resources\" => array(\n \"product/1852563\",\n ),\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"cluster\":[\"monitor\",\"manage\"],\"index\":[{\"names\":[\"suppliers\",\"products\"],\"privileges\":[\"read\"]},{\"names\":[\"inventory\"],\"privileges\":[\"read\",\"write\"]}],\"application\":[{\"application\":\"inventory_manager\",\"privileges\":[\"read\",\"data:write/inventory\"],\"resources\":[\"product/1852563\"]}]}' \"$ELASTICSEARCH_URL/_security/user/_has_privileges\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -53181,32 +36640,6 @@ } }, "x-state": "Generally available; Added in 6.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/user/_has_privileges\n{\n \"cluster\": [ \"monitor\", \"manage\" ],\n \"index\" : [\n {\n \"names\": [ \"suppliers\", \"products\" ],\n \"privileges\": [ \"read\" ]\n },\n {\n \"names\": [ \"inventory\" ],\n \"privileges\" : [ \"read\", \"write\" ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\" : [ \"read\", \"data:write/inventory\" ],\n \"resources\" : [ \"product/1852563\" ]\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.has_privileges(\n cluster=[\n \"monitor\",\n \"manage\"\n ],\n index=[\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"read\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n application=[\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.hasPrivileges({\n cluster: [\"monitor\", \"manage\"],\n index: [\n {\n names: [\"suppliers\", \"products\"],\n privileges: [\"read\"],\n },\n {\n names: [\"inventory\"],\n privileges: [\"read\", \"write\"],\n },\n ],\n application: [\n {\n application: \"inventory_manager\",\n privileges: [\"read\", \"data:write/inventory\"],\n resources: [\"product/1852563\"],\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.has_privileges(\n body: {\n \"cluster\": [\n \"monitor\",\n \"manage\"\n ],\n \"index\": [\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"read\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->hasPrivileges([\n \"body\" => [\n \"cluster\" => array(\n \"monitor\",\n \"manage\",\n ),\n \"index\" => array(\n [\n \"names\" => array(\n \"suppliers\",\n \"products\",\n ),\n \"privileges\" => array(\n \"read\",\n ),\n ],\n [\n \"names\" => array(\n \"inventory\",\n ),\n \"privileges\" => array(\n \"read\",\n \"write\",\n ),\n ],\n ),\n \"application\" => array(\n [\n \"application\" => \"inventory_manager\",\n \"privileges\" => array(\n \"read\",\n \"data:write/inventory\",\n ),\n \"resources\" => array(\n \"product/1852563\",\n ),\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"cluster\":[\"monitor\",\"manage\"],\"index\":[{\"names\":[\"suppliers\",\"products\"],\"privileges\":[\"read\"]},{\"names\":[\"inventory\"],\"privileges\":[\"read\",\"write\"]}],\"application\":[{\"application\":\"inventory_manager\",\"privileges\":[\"read\",\"data:write/inventory\"],\"resources\":[\"product/1852563\"]}]}' \"$ELASTICSEARCH_URL/_security/user/_has_privileges\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -53233,32 +36666,6 @@ } }, "x-state": "Generally available; Added in 6.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/user/_has_privileges\n{\n \"cluster\": [ \"monitor\", \"manage\" ],\n \"index\" : [\n {\n \"names\": [ \"suppliers\", \"products\" ],\n \"privileges\": [ \"read\" ]\n },\n {\n \"names\": [ \"inventory\" ],\n \"privileges\" : [ \"read\", \"write\" ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\" : [ \"read\", \"data:write/inventory\" ],\n \"resources\" : [ \"product/1852563\" ]\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.has_privileges(\n cluster=[\n \"monitor\",\n \"manage\"\n ],\n index=[\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"read\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n application=[\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.hasPrivileges({\n cluster: [\"monitor\", \"manage\"],\n index: [\n {\n names: [\"suppliers\", \"products\"],\n privileges: [\"read\"],\n },\n {\n names: [\"inventory\"],\n privileges: [\"read\", \"write\"],\n },\n ],\n application: [\n {\n application: \"inventory_manager\",\n privileges: [\"read\", \"data:write/inventory\"],\n resources: [\"product/1852563\"],\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.has_privileges(\n body: {\n \"cluster\": [\n \"monitor\",\n \"manage\"\n ],\n \"index\": [\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"read\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->hasPrivileges([\n \"body\" => [\n \"cluster\" => array(\n \"monitor\",\n \"manage\",\n ),\n \"index\" => array(\n [\n \"names\" => array(\n \"suppliers\",\n \"products\",\n ),\n \"privileges\" => array(\n \"read\",\n ),\n ],\n [\n \"names\" => array(\n \"inventory\",\n ),\n \"privileges\" => array(\n \"read\",\n \"write\",\n ),\n ],\n ),\n \"application\" => array(\n [\n \"application\" => \"inventory_manager\",\n \"privileges\" => array(\n \"read\",\n \"data:write/inventory\",\n ),\n \"resources\" => array(\n \"product/1852563\",\n ),\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"cluster\":[\"monitor\",\"manage\"],\"index\":[{\"names\":[\"suppliers\",\"products\"],\"privileges\":[\"read\"]},{\"names\":[\"inventory\"],\"privileges\":[\"read\",\"write\"]}],\"application\":[{\"application\":\"inventory_manager\",\"privileges\":[\"read\",\"data:write/inventory\"],\"resources\":[\"product/1852563\"]}]}' \"$ELASTICSEARCH_URL/_security/user/_has_privileges\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -53282,32 +36689,6 @@ } }, "x-state": "Generally available; Added in 8.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/profile/_has_privileges\n{\n \"uids\": [\n \"u_LQPnxDxEjIH0GOUoFkZr5Y57YUwSkL9Joiq-g4OCbPc_0\",\n \"u_rzRnxDgEHIH0GOUoFkZr5Y27YUwSk19Joiq=g4OCxxB_1\",\n \"u_does-not-exist_0\"\n ],\n \"privileges\": {\n \"cluster\": [ \"monitor\", \"create_snapshot\", \"manage_ml\" ],\n \"index\" : [\n {\n \"names\": [ \"suppliers\", \"products\" ],\n \"privileges\": [ \"create_doc\"]\n },\n {\n \"names\": [ \"inventory\" ],\n \"privileges\" : [ \"read\", \"write\" ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\" : [ \"read\", \"data:write/inventory\" ],\n \"resources\" : [ \"product/1852563\" ]\n }\n ]\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.has_privileges_user_profile(\n uids=[\n \"u_LQPnxDxEjIH0GOUoFkZr5Y57YUwSkL9Joiq-g4OCbPc_0\",\n \"u_rzRnxDgEHIH0GOUoFkZr5Y27YUwSk19Joiq=g4OCxxB_1\",\n \"u_does-not-exist_0\"\n ],\n privileges={\n \"cluster\": [\n \"monitor\",\n \"create_snapshot\",\n \"manage_ml\"\n ],\n \"index\": [\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"create_doc\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ]\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.hasPrivilegesUserProfile({\n uids: [\n \"u_LQPnxDxEjIH0GOUoFkZr5Y57YUwSkL9Joiq-g4OCbPc_0\",\n \"u_rzRnxDgEHIH0GOUoFkZr5Y27YUwSk19Joiq=g4OCxxB_1\",\n \"u_does-not-exist_0\",\n ],\n privileges: {\n cluster: [\"monitor\", \"create_snapshot\", \"manage_ml\"],\n index: [\n {\n names: [\"suppliers\", \"products\"],\n privileges: [\"create_doc\"],\n },\n {\n names: [\"inventory\"],\n privileges: [\"read\", \"write\"],\n },\n ],\n application: [\n {\n application: \"inventory_manager\",\n privileges: [\"read\", \"data:write/inventory\"],\n resources: [\"product/1852563\"],\n },\n ],\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.has_privileges_user_profile(\n body: {\n \"uids\": [\n \"u_LQPnxDxEjIH0GOUoFkZr5Y57YUwSkL9Joiq-g4OCbPc_0\",\n \"u_rzRnxDgEHIH0GOUoFkZr5Y27YUwSk19Joiq=g4OCxxB_1\",\n \"u_does-not-exist_0\"\n ],\n \"privileges\": {\n \"cluster\": [\n \"monitor\",\n \"create_snapshot\",\n \"manage_ml\"\n ],\n \"index\": [\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"create_doc\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ]\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->hasPrivilegesUserProfile([\n \"body\" => [\n \"uids\" => array(\n \"u_LQPnxDxEjIH0GOUoFkZr5Y57YUwSkL9Joiq-g4OCbPc_0\",\n \"u_rzRnxDgEHIH0GOUoFkZr5Y27YUwSk19Joiq=g4OCxxB_1\",\n \"u_does-not-exist_0\",\n ),\n \"privileges\" => [\n \"cluster\" => array(\n \"monitor\",\n \"create_snapshot\",\n \"manage_ml\",\n ),\n \"index\" => array(\n [\n \"names\" => array(\n \"suppliers\",\n \"products\",\n ),\n \"privileges\" => array(\n \"create_doc\",\n ),\n ],\n [\n \"names\" => array(\n \"inventory\",\n ),\n \"privileges\" => array(\n \"read\",\n \"write\",\n ),\n ],\n ),\n \"application\" => array(\n [\n \"application\" => \"inventory_manager\",\n \"privileges\" => array(\n \"read\",\n \"data:write/inventory\",\n ),\n \"resources\" => array(\n \"product/1852563\",\n ),\n ],\n ),\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"uids\":[\"u_LQPnxDxEjIH0GOUoFkZr5Y57YUwSkL9Joiq-g4OCbPc_0\",\"u_rzRnxDgEHIH0GOUoFkZr5Y27YUwSk19Joiq=g4OCxxB_1\",\"u_does-not-exist_0\"],\"privileges\":{\"cluster\":[\"monitor\",\"create_snapshot\",\"manage_ml\"],\"index\":[{\"names\":[\"suppliers\",\"products\"],\"privileges\":[\"create_doc\"]},{\"names\":[\"inventory\"],\"privileges\":[\"read\",\"write\"]}],\"application\":[{\"application\":\"inventory_manager\",\"privileges\":[\"read\",\"data:write/inventory\"],\"resources\":[\"product/1852563\"]}]}}' \"$ELASTICSEARCH_URL/_security/profile/_has_privileges\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -53329,32 +36710,6 @@ } }, "x-state": "Generally available; Added in 8.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/profile/_has_privileges\n{\n \"uids\": [\n \"u_LQPnxDxEjIH0GOUoFkZr5Y57YUwSkL9Joiq-g4OCbPc_0\",\n \"u_rzRnxDgEHIH0GOUoFkZr5Y27YUwSk19Joiq=g4OCxxB_1\",\n \"u_does-not-exist_0\"\n ],\n \"privileges\": {\n \"cluster\": [ \"monitor\", \"create_snapshot\", \"manage_ml\" ],\n \"index\" : [\n {\n \"names\": [ \"suppliers\", \"products\" ],\n \"privileges\": [ \"create_doc\"]\n },\n {\n \"names\": [ \"inventory\" ],\n \"privileges\" : [ \"read\", \"write\" ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\" : [ \"read\", \"data:write/inventory\" ],\n \"resources\" : [ \"product/1852563\" ]\n }\n ]\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.has_privileges_user_profile(\n uids=[\n \"u_LQPnxDxEjIH0GOUoFkZr5Y57YUwSkL9Joiq-g4OCbPc_0\",\n \"u_rzRnxDgEHIH0GOUoFkZr5Y27YUwSk19Joiq=g4OCxxB_1\",\n \"u_does-not-exist_0\"\n ],\n privileges={\n \"cluster\": [\n \"monitor\",\n \"create_snapshot\",\n \"manage_ml\"\n ],\n \"index\": [\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"create_doc\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ]\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.hasPrivilegesUserProfile({\n uids: [\n \"u_LQPnxDxEjIH0GOUoFkZr5Y57YUwSkL9Joiq-g4OCbPc_0\",\n \"u_rzRnxDgEHIH0GOUoFkZr5Y27YUwSk19Joiq=g4OCxxB_1\",\n \"u_does-not-exist_0\",\n ],\n privileges: {\n cluster: [\"monitor\", \"create_snapshot\", \"manage_ml\"],\n index: [\n {\n names: [\"suppliers\", \"products\"],\n privileges: [\"create_doc\"],\n },\n {\n names: [\"inventory\"],\n privileges: [\"read\", \"write\"],\n },\n ],\n application: [\n {\n application: \"inventory_manager\",\n privileges: [\"read\", \"data:write/inventory\"],\n resources: [\"product/1852563\"],\n },\n ],\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.has_privileges_user_profile(\n body: {\n \"uids\": [\n \"u_LQPnxDxEjIH0GOUoFkZr5Y57YUwSkL9Joiq-g4OCbPc_0\",\n \"u_rzRnxDgEHIH0GOUoFkZr5Y27YUwSk19Joiq=g4OCxxB_1\",\n \"u_does-not-exist_0\"\n ],\n \"privileges\": {\n \"cluster\": [\n \"monitor\",\n \"create_snapshot\",\n \"manage_ml\"\n ],\n \"index\": [\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"create_doc\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ]\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->hasPrivilegesUserProfile([\n \"body\" => [\n \"uids\" => array(\n \"u_LQPnxDxEjIH0GOUoFkZr5Y57YUwSkL9Joiq-g4OCbPc_0\",\n \"u_rzRnxDgEHIH0GOUoFkZr5Y27YUwSk19Joiq=g4OCxxB_1\",\n \"u_does-not-exist_0\",\n ),\n \"privileges\" => [\n \"cluster\" => array(\n \"monitor\",\n \"create_snapshot\",\n \"manage_ml\",\n ),\n \"index\" => array(\n [\n \"names\" => array(\n \"suppliers\",\n \"products\",\n ),\n \"privileges\" => array(\n \"create_doc\",\n ),\n ],\n [\n \"names\" => array(\n \"inventory\",\n ),\n \"privileges\" => array(\n \"read\",\n \"write\",\n ),\n ],\n ),\n \"application\" => array(\n [\n \"application\" => \"inventory_manager\",\n \"privileges\" => array(\n \"read\",\n \"data:write/inventory\",\n ),\n \"resources\" => array(\n \"product/1852563\",\n ),\n ],\n ),\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"uids\":[\"u_LQPnxDxEjIH0GOUoFkZr5Y57YUwSkL9Joiq-g4OCbPc_0\",\"u_rzRnxDgEHIH0GOUoFkZr5Y27YUwSk19Joiq=g4OCxxB_1\",\"u_does-not-exist_0\"],\"privileges\":{\"cluster\":[\"monitor\",\"create_snapshot\",\"manage_ml\"],\"index\":[{\"names\":[\"suppliers\",\"products\"],\"privileges\":[\"create_doc\"]},{\"names\":[\"inventory\"],\"privileges\":[\"read\",\"write\"]}],\"application\":[{\"application\":\"inventory_manager\",\"privileges\":[\"read\",\"data:write/inventory\"],\"resources\":[\"product/1852563\"]}]}}' \"$ELASTICSEARCH_URL/_security/profile/_has_privileges\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -53448,32 +36803,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/oidc/authenticate\n{\n \"redirect_uri\" : \"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n \"state\" : \"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n \"nonce\" : \"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM\",\n \"realm\" : \"oidc1\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.oidc_authenticate(\n redirect_uri=\"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n state=\"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n nonce=\"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM\",\n realm=\"oidc1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.oidcAuthenticate({\n redirect_uri:\n \"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n state: \"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n nonce: \"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM\",\n realm: \"oidc1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.oidc_authenticate(\n body: {\n \"redirect_uri\": \"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n \"state\": \"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n \"nonce\": \"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM\",\n \"realm\": \"oidc1\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->oidcAuthenticate([\n \"body\" => [\n \"redirect_uri\" => \"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n \"state\" => \"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\n \"nonce\" => \"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM\",\n \"realm\" => \"oidc1\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"redirect_uri\":\"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\"state\":\"4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I\",\"nonce\":\"WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM\",\"realm\":\"oidc1\"}' \"$ELASTICSEARCH_URL/_security/oidc/authenticate\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -53542,32 +36871,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/oidc/logout\n{\n \"token\" : \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n \"refresh_token\": \"vLBPvmAB6KvwvJZr27cS\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.oidc_logout(\n token=\"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n refresh_token=\"vLBPvmAB6KvwvJZr27cS\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.oidcLogout({\n token:\n \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n refresh_token: \"vLBPvmAB6KvwvJZr27cS\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.oidc_logout(\n body: {\n \"token\": \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n \"refresh_token\": \"vLBPvmAB6KvwvJZr27cS\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->oidcLogout([\n \"body\" => [\n \"token\" => \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n \"refresh_token\" => \"vLBPvmAB6KvwvJZr27cS\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"token\":\"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\"refresh_token\":\"vLBPvmAB6KvwvJZr27cS\"}' \"$ELASTICSEARCH_URL/_security/oidc/logout\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -53668,32 +36971,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/oidc/prepare\n{\n \"realm\" : \"oidc1\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.oidc_prepare_authentication(\n realm=\"oidc1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.oidcPrepareAuthentication({\n realm: \"oidc1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.oidc_prepare_authentication(\n body: {\n \"realm\": \"oidc1\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->oidcPrepareAuthentication([\n \"body\" => [\n \"realm\" => \"oidc1\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"realm\":\"oidc1\"}' \"$ELASTICSEARCH_URL/_security/oidc/prepare\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -53725,32 +37002,6 @@ } }, "x-state": "Generally available; Added in 7.15.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/_query/api_key?with_limited_by=true\n{\n \"query\": {\n \"ids\": {\n \"values\": [\n \"VuaCfGcBCdbkQm-e5aOx\"\n ]\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.query_api_keys(\n with_limited_by=True,\n query={\n \"ids\": {\n \"values\": [\n \"VuaCfGcBCdbkQm-e5aOx\"\n ]\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.queryApiKeys({\n with_limited_by: \"true\",\n query: {\n ids: {\n values: [\"VuaCfGcBCdbkQm-e5aOx\"],\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.query_api_keys(\n with_limited_by: \"true\",\n body: {\n \"query\": {\n \"ids\": {\n \"values\": [\n \"VuaCfGcBCdbkQm-e5aOx\"\n ]\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->queryApiKeys([\n \"with_limited_by\" => \"true\",\n \"body\" => [\n \"query\" => [\n \"ids\" => [\n \"values\" => array(\n \"VuaCfGcBCdbkQm-e5aOx\",\n ),\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"ids\":{\"values\":[\"VuaCfGcBCdbkQm-e5aOx\"]}}}' \"$ELASTICSEARCH_URL/_security/_query/api_key?with_limited_by=true\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -53780,32 +37031,6 @@ } }, "x-state": "Generally available; Added in 7.15.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/_query/api_key?with_limited_by=true\n{\n \"query\": {\n \"ids\": {\n \"values\": [\n \"VuaCfGcBCdbkQm-e5aOx\"\n ]\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.query_api_keys(\n with_limited_by=True,\n query={\n \"ids\": {\n \"values\": [\n \"VuaCfGcBCdbkQm-e5aOx\"\n ]\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.queryApiKeys({\n with_limited_by: \"true\",\n query: {\n ids: {\n values: [\"VuaCfGcBCdbkQm-e5aOx\"],\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.query_api_keys(\n with_limited_by: \"true\",\n body: {\n \"query\": {\n \"ids\": {\n \"values\": [\n \"VuaCfGcBCdbkQm-e5aOx\"\n ]\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->queryApiKeys([\n \"with_limited_by\" => \"true\",\n \"body\" => [\n \"query\" => [\n \"ids\" => [\n \"values\" => array(\n \"VuaCfGcBCdbkQm-e5aOx\",\n ),\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"ids\":{\"values\":[\"VuaCfGcBCdbkQm-e5aOx\"]}}}' \"$ELASTICSEARCH_URL/_security/_query/api_key?with_limited_by=true\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -53826,32 +37051,6 @@ } }, "x-state": "Generally available; Added in 8.15.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/_query/role\n{\n \"sort\": [\"name\"]\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.query_role(\n sort=[\n \"name\"\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.queryRole({\n sort: [\"name\"],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.query_role(\n body: {\n \"sort\": [\n \"name\"\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->queryRole([\n \"body\" => [\n \"sort\" => array(\n \"name\",\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"sort\":[\"name\"]}' \"$ELASTICSEARCH_URL/_security/_query/role\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -53870,32 +37069,6 @@ } }, "x-state": "Generally available; Added in 8.15.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/_query/role\n{\n \"sort\": [\"name\"]\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.query_role(\n sort=[\n \"name\"\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.queryRole({\n sort: [\"name\"],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.query_role(\n body: {\n \"sort\": [\n \"name\"\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->queryRole([\n \"body\" => [\n \"sort\" => array(\n \"name\",\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"sort\":[\"name\"]}' \"$ELASTICSEARCH_URL/_security/_query/role\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -53921,32 +37094,6 @@ } }, "x-state": "Generally available; Added in 8.14.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/_query/user?with_profile_uid=true\n{\n \"query\": {\n \"prefix\": {\n \"roles\": \"other\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.query_user(\n with_profile_uid=True,\n query={\n \"prefix\": {\n \"roles\": \"other\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.queryUser({\n with_profile_uid: \"true\",\n query: {\n prefix: {\n roles: \"other\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.query_user(\n with_profile_uid: \"true\",\n body: {\n \"query\": {\n \"prefix\": {\n \"roles\": \"other\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->queryUser([\n \"with_profile_uid\" => \"true\",\n \"body\" => [\n \"query\" => [\n \"prefix\" => [\n \"roles\" => \"other\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"prefix\":{\"roles\":\"other\"}}}' \"$ELASTICSEARCH_URL/_security/_query/user?with_profile_uid=true\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -53970,32 +37117,6 @@ } }, "x-state": "Generally available; Added in 8.14.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/_query/user?with_profile_uid=true\n{\n \"query\": {\n \"prefix\": {\n \"roles\": \"other\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.query_user(\n with_profile_uid=True,\n query={\n \"prefix\": {\n \"roles\": \"other\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.queryUser({\n with_profile_uid: \"true\",\n query: {\n prefix: {\n roles: \"other\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.query_user(\n with_profile_uid: \"true\",\n body: {\n \"query\": {\n \"prefix\": {\n \"roles\": \"other\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->queryUser([\n \"with_profile_uid\" => \"true\",\n \"body\" => [\n \"query\" => [\n \"prefix\" => [\n \"roles\" => \"other\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"prefix\":{\"roles\":\"other\"}}}' \"$ELASTICSEARCH_URL/_security/_query/user?with_profile_uid=true\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -54091,32 +37212,6 @@ } }, "x-state": "Generally available; Added in 7.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/saml/authenticate\n{\n \"content\" : \"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....\",\n \"ids\" : [\"4fee3b046395c4e751011e97f8900b5273d56685\"]\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.saml_authenticate(\n content=\"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....\",\n ids=[\n \"4fee3b046395c4e751011e97f8900b5273d56685\"\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.samlAuthenticate({\n content:\n \"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....\",\n ids: [\"4fee3b046395c4e751011e97f8900b5273d56685\"],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.saml_authenticate(\n body: {\n \"content\": \"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....\",\n \"ids\": [\n \"4fee3b046395c4e751011e97f8900b5273d56685\"\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->samlAuthenticate([\n \"body\" => [\n \"content\" => \"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....\",\n \"ids\" => array(\n \"4fee3b046395c4e751011e97f8900b5273d56685\",\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"content\":\"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....\",\"ids\":[\"4fee3b046395c4e751011e97f8900b5273d56685\"]}' \"$ELASTICSEARCH_URL/_security/saml/authenticate\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -54183,32 +37278,6 @@ } }, "x-state": "Generally available; Added in 7.14.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/saml/complete_logout\n{\n \"realm\": \"saml1\",\n \"ids\": [ \"_1c368075e0b3...\" ],\n \"query_string\": \"SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK...\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.saml_complete_logout(\n realm=\"saml1\",\n ids=[\n \"_1c368075e0b3...\"\n ],\n query_string=\"SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK...\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.samlCompleteLogout({\n realm: \"saml1\",\n ids: [\"_1c368075e0b3...\"],\n query_string:\n \"SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK...\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.saml_complete_logout(\n body: {\n \"realm\": \"saml1\",\n \"ids\": [\n \"_1c368075e0b3...\"\n ],\n \"query_string\": \"SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK...\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->samlCompleteLogout([\n \"body\" => [\n \"realm\" => \"saml1\",\n \"ids\" => array(\n \"_1c368075e0b3...\",\n ),\n \"query_string\" => \"SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK...\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"realm\":\"saml1\",\"ids\":[\"_1c368075e0b3...\"],\"query_string\":\"SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK...\"}' \"$ELASTICSEARCH_URL/_security/saml/complete_logout\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -54294,32 +37363,6 @@ } }, "x-state": "Generally available; Added in 7.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/saml/invalidate\n{\n \"query_string\" : \"SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D\",\n \"realm\" : \"saml1\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.saml_invalidate(\n query_string=\"SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D\",\n realm=\"saml1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.samlInvalidate({\n query_string:\n \"SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D\",\n realm: \"saml1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.saml_invalidate(\n body: {\n \"query_string\": \"SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D\",\n \"realm\": \"saml1\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->samlInvalidate([\n \"body\" => [\n \"query_string\" => \"SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D\",\n \"realm\" => \"saml1\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query_string\":\"SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D\",\"realm\":\"saml1\"}' \"$ELASTICSEARCH_URL/_security/saml/invalidate\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -54391,32 +37434,6 @@ } }, "x-state": "Generally available; Added in 7.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/saml/logout\n{\n \"token\" : \"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3\",\n \"refresh_token\" : \"mJdXLtmvTUSpoLwMvdBt_w\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.saml_logout(\n token=\"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3\",\n refresh_token=\"mJdXLtmvTUSpoLwMvdBt_w\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.samlLogout({\n token: \"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3\",\n refresh_token: \"mJdXLtmvTUSpoLwMvdBt_w\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.saml_logout(\n body: {\n \"token\": \"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3\",\n \"refresh_token\": \"mJdXLtmvTUSpoLwMvdBt_w\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->samlLogout([\n \"body\" => [\n \"token\" => \"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3\",\n \"refresh_token\" => \"mJdXLtmvTUSpoLwMvdBt_w\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"token\":\"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3\",\"refresh_token\":\"mJdXLtmvTUSpoLwMvdBt_w\"}' \"$ELASTICSEARCH_URL/_security/saml/logout\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -54504,32 +37521,6 @@ } }, "x-state": "Generally available; Added in 7.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/saml/prepare\n{\n \"realm\" : \"saml1\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.saml_prepare_authentication(\n realm=\"saml1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.samlPrepareAuthentication({\n realm: \"saml1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.saml_prepare_authentication(\n body: {\n \"realm\": \"saml1\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->samlPrepareAuthentication([\n \"body\" => [\n \"realm\" => \"saml1\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"realm\":\"saml1\"}' \"$ELASTICSEARCH_URL/_security/saml/prepare\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -54582,32 +37573,6 @@ } }, "x-state": "Generally available; Added in 7.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/profile/u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0/_data\n" - }, - { - "lang": "Python", - "source": "resp = client.security.update_user_profile_data(\n uid=\"u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.updateUserProfileData({\n uid: \"u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.update_user_profile_data(\n uid: \"u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->updateUserProfileData([\n \"uid\" => \"u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/profile/u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0/_data\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -54633,32 +37598,6 @@ } }, "x-state": "Generally available; Added in 8.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/profile/_suggest\n{\n \"name\": \"jack\", \n \"hint\": {\n \"uids\": [ \n \"u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0\",\n \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\"\n ],\n \"labels\": {\n \"direction\": [\"north\", \"east\"] \n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.suggest_user_profiles(\n name=\"jack\",\n hint={\n \"uids\": [\n \"u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0\",\n \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\"\n ],\n \"labels\": {\n \"direction\": [\n \"north\",\n \"east\"\n ]\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.suggestUserProfiles({\n name: \"jack\",\n hint: {\n uids: [\n \"u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0\",\n \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n ],\n labels: {\n direction: [\"north\", \"east\"],\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.suggest_user_profiles(\n body: {\n \"name\": \"jack\",\n \"hint\": {\n \"uids\": [\n \"u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0\",\n \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\"\n ],\n \"labels\": {\n \"direction\": [\n \"north\",\n \"east\"\n ]\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->suggestUserProfiles([\n \"body\" => [\n \"name\" => \"jack\",\n \"hint\" => [\n \"uids\" => array(\n \"u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0\",\n \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n ),\n \"labels\" => [\n \"direction\" => array(\n \"north\",\n \"east\",\n ),\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"name\":\"jack\",\"hint\":{\"uids\":[\"u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0\",\"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\"],\"labels\":{\"direction\":[\"north\",\"east\"]}}}' \"$ELASTICSEARCH_URL/_security/profile/_suggest\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -54682,32 +37621,6 @@ } }, "x-state": "Generally available; Added in 8.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/profile/_suggest\n{\n \"name\": \"jack\", \n \"hint\": {\n \"uids\": [ \n \"u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0\",\n \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\"\n ],\n \"labels\": {\n \"direction\": [\"north\", \"east\"] \n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.suggest_user_profiles(\n name=\"jack\",\n hint={\n \"uids\": [\n \"u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0\",\n \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\"\n ],\n \"labels\": {\n \"direction\": [\n \"north\",\n \"east\"\n ]\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.suggestUserProfiles({\n name: \"jack\",\n hint: {\n uids: [\n \"u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0\",\n \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n ],\n labels: {\n direction: [\"north\", \"east\"],\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.suggest_user_profiles(\n body: {\n \"name\": \"jack\",\n \"hint\": {\n \"uids\": [\n \"u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0\",\n \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\"\n ],\n \"labels\": {\n \"direction\": [\n \"north\",\n \"east\"\n ]\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->suggestUserProfiles([\n \"body\" => [\n \"name\" => \"jack\",\n \"hint\" => [\n \"uids\" => array(\n \"u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0\",\n \"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\",\n ),\n \"labels\" => [\n \"direction\" => array(\n \"north\",\n \"east\",\n ),\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"name\":\"jack\",\"hint\":{\"uids\":[\"u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0\",\"u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0\"],\"labels\":{\"direction\":[\"north\",\"east\"]}}}' \"$ELASTICSEARCH_URL/_security/profile/_suggest\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -54797,32 +37710,6 @@ } }, "x-state": "Generally available; Added in 8.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_security/api_key/VuaCfGcBCdbkQm-e5aOx\n{\n \"role_descriptors\": {\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\"*\"],\n \"privileges\": [\"write\"]\n }\n ]\n }\n },\n \"metadata\": {\n \"environment\": {\n \"level\": 2,\n \"trusted\": true,\n \"tags\": [\"production\"]\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.update_api_key(\n id=\"VuaCfGcBCdbkQm-e5aOx\",\n role_descriptors={\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\n \"*\"\n ],\n \"privileges\": [\n \"write\"\n ]\n }\n ]\n }\n },\n metadata={\n \"environment\": {\n \"level\": 2,\n \"trusted\": True,\n \"tags\": [\n \"production\"\n ]\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.updateApiKey({\n id: \"VuaCfGcBCdbkQm-e5aOx\",\n role_descriptors: {\n \"role-a\": {\n indices: [\n {\n names: [\"*\"],\n privileges: [\"write\"],\n },\n ],\n },\n },\n metadata: {\n environment: {\n level: 2,\n trusted: true,\n tags: [\"production\"],\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.update_api_key(\n id: \"VuaCfGcBCdbkQm-e5aOx\",\n body: {\n \"role_descriptors\": {\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\n \"*\"\n ],\n \"privileges\": [\n \"write\"\n ]\n }\n ]\n }\n },\n \"metadata\": {\n \"environment\": {\n \"level\": 2,\n \"trusted\": true,\n \"tags\": [\n \"production\"\n ]\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->updateApiKey([\n \"id\" => \"VuaCfGcBCdbkQm-e5aOx\",\n \"body\" => [\n \"role_descriptors\" => [\n \"role-a\" => [\n \"indices\" => array(\n [\n \"names\" => array(\n \"*\",\n ),\n \"privileges\" => array(\n \"write\",\n ),\n ],\n ),\n ],\n ],\n \"metadata\" => [\n \"environment\" => [\n \"level\" => 2,\n \"trusted\" => true,\n \"tags\" => array(\n \"production\",\n ),\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"role_descriptors\":{\"role-a\":{\"indices\":[{\"names\":[\"*\"],\"privileges\":[\"write\"]}]}},\"metadata\":{\"environment\":{\"level\":2,\"trusted\":true,\"tags\":[\"production\"]}}}' \"$ELASTICSEARCH_URL/_security/api_key/VuaCfGcBCdbkQm-e5aOx\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -54908,32 +37795,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_security/cross_cluster/api_key/VuaCfGcBCdbkQm-e5aOx\n{\n \"access\": {\n \"replication\": [\n {\n \"names\": [\"archive\"]\n }\n ]\n },\n \"metadata\": {\n \"application\": \"replication\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.update_cross_cluster_api_key(\n id=\"VuaCfGcBCdbkQm-e5aOx\",\n access={\n \"replication\": [\n {\n \"names\": [\n \"archive\"\n ]\n }\n ]\n },\n metadata={\n \"application\": \"replication\"\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.updateCrossClusterApiKey({\n id: \"VuaCfGcBCdbkQm-e5aOx\",\n access: {\n replication: [\n {\n names: [\"archive\"],\n },\n ],\n },\n metadata: {\n application: \"replication\",\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.update_cross_cluster_api_key(\n id: \"VuaCfGcBCdbkQm-e5aOx\",\n body: {\n \"access\": {\n \"replication\": [\n {\n \"names\": [\n \"archive\"\n ]\n }\n ]\n },\n \"metadata\": {\n \"application\": \"replication\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->updateCrossClusterApiKey([\n \"id\" => \"VuaCfGcBCdbkQm-e5aOx\",\n \"body\" => [\n \"access\" => [\n \"replication\" => array(\n [\n \"names\" => array(\n \"archive\",\n ),\n ],\n ),\n ],\n \"metadata\" => [\n \"application\" => \"replication\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"access\":{\"replication\":[{\"names\":[\"archive\"]}]},\"metadata\":{\"application\":\"replication\"}}' \"$ELASTICSEARCH_URL/_security/cross_cluster/api_key/VuaCfGcBCdbkQm-e5aOx\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -54968,32 +37829,6 @@ } }, "x-state": "Generally available; Added in 8.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/profile/u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0/_data\n{\n \"labels\": {\n \"direction\": \"east\"\n },\n \"data\": {\n \"app1\": {\n \"theme\": \"default\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.update_user_profile_data(\n uid=\"u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0\",\n labels={\n \"direction\": \"east\"\n },\n data={\n \"app1\": {\n \"theme\": \"default\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.updateUserProfileData({\n uid: \"u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0\",\n labels: {\n direction: \"east\",\n },\n data: {\n app1: {\n theme: \"default\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.update_user_profile_data(\n uid: \"u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0\",\n body: {\n \"labels\": {\n \"direction\": \"east\"\n },\n \"data\": {\n \"app1\": {\n \"theme\": \"default\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->updateUserProfileData([\n \"uid\" => \"u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0\",\n \"body\" => [\n \"labels\" => [\n \"direction\" => \"east\",\n ],\n \"data\" => [\n \"app1\" => [\n \"theme\" => \"default\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"labels\":{\"direction\":\"east\"},\"data\":{\"app1\":{\"theme\":\"default\"}}}' \"$ELASTICSEARCH_URL/_security/profile/u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0/_data\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -55026,32 +37861,6 @@ } }, "x-state": "Generally available; Added in 8.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/profile/u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0/_data\n{\n \"labels\": {\n \"direction\": \"east\"\n },\n \"data\": {\n \"app1\": {\n \"theme\": \"default\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.update_user_profile_data(\n uid=\"u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0\",\n labels={\n \"direction\": \"east\"\n },\n data={\n \"app1\": {\n \"theme\": \"default\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.updateUserProfileData({\n uid: \"u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0\",\n labels: {\n direction: \"east\",\n },\n data: {\n app1: {\n theme: \"default\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.update_user_profile_data(\n uid: \"u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0\",\n body: {\n \"labels\": {\n \"direction\": \"east\"\n },\n \"data\": {\n \"app1\": {\n \"theme\": \"default\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->updateUserProfileData([\n \"uid\" => \"u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0\",\n \"body\" => [\n \"labels\" => [\n \"direction\" => \"east\",\n ],\n \"data\" => [\n \"app1\" => [\n \"theme\" => \"default\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"labels\":{\"direction\":\"east\"},\"data\":{\"app1\":{\"theme\":\"default\"}}}' \"$ELASTICSEARCH_URL/_security/profile/u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0/_data\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -55077,32 +37886,6 @@ } }, "x-state": "Generally available; Added in 7.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_nodes/USpTGYaBSIKbgSUJR2Z9lg/shutdown\n" - }, - { - "lang": "Python", - "source": "resp = client.shutdown.get_node(\n node_id=\"USpTGYaBSIKbgSUJR2Z9lg\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.shutdown.getNode({\n node_id: \"USpTGYaBSIKbgSUJR2Z9lg\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.shutdown.get_node(\n node_id: \"USpTGYaBSIKbgSUJR2Z9lg\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->shutdown()->getNode([\n \"node_id\" => \"USpTGYaBSIKbgSUJR2Z9lg\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_nodes/USpTGYaBSIKbgSUJR2Z9lg/shutdown\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -55195,32 +37978,6 @@ } }, "x-state": "Generally available; Added in 7.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_nodes/USpTGYaBSIKbgSUJR2Z9lg/shutdown\n{\n \"type\": \"restart\",\n \"reason\": \"Demonstrating how the node shutdown API works\",\n \"allocation_delay\": \"20m\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.shutdown.put_node(\n node_id=\"USpTGYaBSIKbgSUJR2Z9lg\",\n type=\"restart\",\n reason=\"Demonstrating how the node shutdown API works\",\n allocation_delay=\"20m\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.shutdown.putNode({\n node_id: \"USpTGYaBSIKbgSUJR2Z9lg\",\n type: \"restart\",\n reason: \"Demonstrating how the node shutdown API works\",\n allocation_delay: \"20m\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.shutdown.put_node(\n node_id: \"USpTGYaBSIKbgSUJR2Z9lg\",\n body: {\n \"type\": \"restart\",\n \"reason\": \"Demonstrating how the node shutdown API works\",\n \"allocation_delay\": \"20m\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->shutdown()->putNode([\n \"node_id\" => \"USpTGYaBSIKbgSUJR2Z9lg\",\n \"body\" => [\n \"type\" => \"restart\",\n \"reason\" => \"Demonstrating how the node shutdown API works\",\n \"allocation_delay\" => \"20m\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"type\":\"restart\",\"reason\":\"Demonstrating how the node shutdown API works\",\"allocation_delay\":\"20m\"}' \"$ELASTICSEARCH_URL/_nodes/USpTGYaBSIKbgSUJR2Z9lg/shutdown\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -55282,32 +38039,6 @@ } }, "x-state": "Generally available; Added in 7.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_nodes/USpTGYaBSIKbgSUJR2Z9lg/shutdown\n" - }, - { - "lang": "Python", - "source": "resp = client.shutdown.delete_node(\n node_id=\"USpTGYaBSIKbgSUJR2Z9lg\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.shutdown.deleteNode({\n node_id: \"USpTGYaBSIKbgSUJR2Z9lg\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.shutdown.delete_node(\n node_id: \"USpTGYaBSIKbgSUJR2Z9lg\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->shutdown()->deleteNode([\n \"node_id\" => \"USpTGYaBSIKbgSUJR2Z9lg\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_nodes/USpTGYaBSIKbgSUJR2Z9lg/shutdown\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -55330,32 +38061,6 @@ } }, "x-state": "Generally available; Added in 7.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_nodes/USpTGYaBSIKbgSUJR2Z9lg/shutdown\n" - }, - { - "lang": "Python", - "source": "resp = client.shutdown.get_node(\n node_id=\"USpTGYaBSIKbgSUJR2Z9lg\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.shutdown.getNode({\n node_id: \"USpTGYaBSIKbgSUJR2Z9lg\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.shutdown.get_node(\n node_id: \"USpTGYaBSIKbgSUJR2Z9lg\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->shutdown()->getNode([\n \"node_id\" => \"USpTGYaBSIKbgSUJR2Z9lg\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_nodes/USpTGYaBSIKbgSUJR2Z9lg/shutdown\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -55381,32 +38086,6 @@ } }, "x-state": "Technical preview; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_ingest/_simulate\n{\n \"docs\": [\n {\n \"_id\": 123,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_id\": 456,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.simulate.ingest(\n docs=[\n {\n \"_id\": 123,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_id\": 456,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.simulate.ingest({\n docs: [\n {\n _id: 123,\n _index: \"my-index\",\n _source: {\n foo: \"bar\",\n },\n },\n {\n _id: 456,\n _index: \"my-index\",\n _source: {\n foo: \"rab\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.simulate.ingest(\n body: {\n \"docs\": [\n {\n \"_id\": 123,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_id\": 456,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->simulate()->ingest([\n \"body\" => [\n \"docs\" => array(\n [\n \"_id\" => 123,\n \"_index\" => \"my-index\",\n \"_source\" => [\n \"foo\" => \"bar\",\n ],\n ],\n [\n \"_id\" => 456,\n \"_index\" => \"my-index\",\n \"_source\" => [\n \"foo\" => \"rab\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"docs\":[{\"_id\":123,\"_index\":\"my-index\",\"_source\":{\"foo\":\"bar\"}},{\"_id\":456,\"_index\":\"my-index\",\"_source\":{\"foo\":\"rab\"}}]}' \"$ELASTICSEARCH_URL/_ingest/_simulate\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -55430,32 +38109,6 @@ } }, "x-state": "Technical preview; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_ingest/_simulate\n{\n \"docs\": [\n {\n \"_id\": 123,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_id\": 456,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.simulate.ingest(\n docs=[\n {\n \"_id\": 123,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_id\": 456,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.simulate.ingest({\n docs: [\n {\n _id: 123,\n _index: \"my-index\",\n _source: {\n foo: \"bar\",\n },\n },\n {\n _id: 456,\n _index: \"my-index\",\n _source: {\n foo: \"rab\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.simulate.ingest(\n body: {\n \"docs\": [\n {\n \"_id\": 123,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_id\": 456,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->simulate()->ingest([\n \"body\" => [\n \"docs\" => array(\n [\n \"_id\" => 123,\n \"_index\" => \"my-index\",\n \"_source\" => [\n \"foo\" => \"bar\",\n ],\n ],\n [\n \"_id\" => 456,\n \"_index\" => \"my-index\",\n \"_source\" => [\n \"foo\" => \"rab\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"docs\":[{\"_id\":123,\"_index\":\"my-index\",\"_source\":{\"foo\":\"bar\"}},{\"_id\":456,\"_index\":\"my-index\",\"_source\":{\"foo\":\"rab\"}}]}' \"$ELASTICSEARCH_URL/_ingest/_simulate\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -55484,32 +38137,6 @@ } }, "x-state": "Technical preview; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_ingest/_simulate\n{\n \"docs\": [\n {\n \"_id\": 123,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_id\": 456,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.simulate.ingest(\n docs=[\n {\n \"_id\": 123,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_id\": 456,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.simulate.ingest({\n docs: [\n {\n _id: 123,\n _index: \"my-index\",\n _source: {\n foo: \"bar\",\n },\n },\n {\n _id: 456,\n _index: \"my-index\",\n _source: {\n foo: \"rab\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.simulate.ingest(\n body: {\n \"docs\": [\n {\n \"_id\": 123,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_id\": 456,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->simulate()->ingest([\n \"body\" => [\n \"docs\" => array(\n [\n \"_id\" => 123,\n \"_index\" => \"my-index\",\n \"_source\" => [\n \"foo\" => \"bar\",\n ],\n ],\n [\n \"_id\" => 456,\n \"_index\" => \"my-index\",\n \"_source\" => [\n \"foo\" => \"rab\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"docs\":[{\"_id\":123,\"_index\":\"my-index\",\"_source\":{\"foo\":\"bar\"}},{\"_id\":456,\"_index\":\"my-index\",\"_source\":{\"foo\":\"rab\"}}]}' \"$ELASTICSEARCH_URL/_ingest/_simulate\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -55536,32 +38163,6 @@ } }, "x-state": "Technical preview; Added in 8.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_ingest/_simulate\n{\n \"docs\": [\n {\n \"_id\": 123,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_id\": 456,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.simulate.ingest(\n docs=[\n {\n \"_id\": 123,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_id\": 456,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.simulate.ingest({\n docs: [\n {\n _id: 123,\n _index: \"my-index\",\n _source: {\n foo: \"bar\",\n },\n },\n {\n _id: 456,\n _index: \"my-index\",\n _source: {\n foo: \"rab\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.simulate.ingest(\n body: {\n \"docs\": [\n {\n \"_id\": 123,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_id\": 456,\n \"_index\": \"my-index\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->simulate()->ingest([\n \"body\" => [\n \"docs\" => array(\n [\n \"_id\" => 123,\n \"_index\" => \"my-index\",\n \"_source\" => [\n \"foo\" => \"bar\",\n ],\n ],\n [\n \"_id\" => 456,\n \"_index\" => \"my-index\",\n \"_source\" => [\n \"foo\" => \"rab\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"docs\":[{\"_id\":123,\"_index\":\"my-index\",\"_source\":{\"foo\":\"bar\"}},{\"_id\":456,\"_index\":\"my-index\",\"_source\":{\"foo\":\"rab\"}}]}' \"$ELASTICSEARCH_URL/_ingest/_simulate\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -55590,32 +38191,6 @@ } }, "x-state": "Generally available; Added in 7.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _slm/policy/daily-snapshots?human\n" - }, - { - "lang": "Python", - "source": "resp = client.slm.get_lifecycle(\n policy_id=\"daily-snapshots\",\n human=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.slm.getLifecycle({\n policy_id: \"daily-snapshots\",\n human: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.slm.get_lifecycle(\n policy_id: \"daily-snapshots\",\n human: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->slm()->getLifecycle([\n \"policy_id\" => \"daily-snapshots\",\n \"human\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_slm/policy/daily-snapshots?human\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -55710,32 +38285,6 @@ } }, "x-state": "Generally available; Added in 7.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_slm/policy/daily-snapshots\n{\n \"schedule\": \"0 30 1 * * ?\",\n \"name\": \"\",\n \"repository\": \"my_repository\",\n \"config\": {\n \"indices\": [\"data-*\", \"important\"],\n \"ignore_unavailable\": false,\n \"include_global_state\": false\n },\n \"retention\": {\n \"expire_after\": \"30d\",\n \"min_count\": 5,\n \"max_count\": 50\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.slm.put_lifecycle(\n policy_id=\"daily-snapshots\",\n schedule=\"0 30 1 * * ?\",\n name=\"\",\n repository=\"my_repository\",\n config={\n \"indices\": [\n \"data-*\",\n \"important\"\n ],\n \"ignore_unavailable\": False,\n \"include_global_state\": False\n },\n retention={\n \"expire_after\": \"30d\",\n \"min_count\": 5,\n \"max_count\": 50\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.slm.putLifecycle({\n policy_id: \"daily-snapshots\",\n schedule: \"0 30 1 * * ?\",\n name: \"\",\n repository: \"my_repository\",\n config: {\n indices: [\"data-*\", \"important\"],\n ignore_unavailable: false,\n include_global_state: false,\n },\n retention: {\n expire_after: \"30d\",\n min_count: 5,\n max_count: 50,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.slm.put_lifecycle(\n policy_id: \"daily-snapshots\",\n body: {\n \"schedule\": \"0 30 1 * * ?\",\n \"name\": \"\",\n \"repository\": \"my_repository\",\n \"config\": {\n \"indices\": [\n \"data-*\",\n \"important\"\n ],\n \"ignore_unavailable\": false,\n \"include_global_state\": false\n },\n \"retention\": {\n \"expire_after\": \"30d\",\n \"min_count\": 5,\n \"max_count\": 50\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->slm()->putLifecycle([\n \"policy_id\" => \"daily-snapshots\",\n \"body\" => [\n \"schedule\" => \"0 30 1 * * ?\",\n \"name\" => \"\",\n \"repository\" => \"my_repository\",\n \"config\" => [\n \"indices\" => array(\n \"data-*\",\n \"important\",\n ),\n \"ignore_unavailable\" => false,\n \"include_global_state\" => false,\n ],\n \"retention\" => [\n \"expire_after\" => \"30d\",\n \"min_count\" => 5,\n \"max_count\" => 50,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"schedule\":\"0 30 1 * * ?\",\"name\":\"\",\"repository\":\"my_repository\",\"config\":{\"indices\":[\"data-*\",\"important\"],\"ignore_unavailable\":false,\"include_global_state\":false},\"retention\":{\"expire_after\":\"30d\",\"min_count\":5,\"max_count\":50}}' \"$ELASTICSEARCH_URL/_slm/policy/daily-snapshots\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -55791,32 +38340,6 @@ } }, "x-state": "Generally available; Added in 7.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_slm/policy/daily-snapshots\n" - }, - { - "lang": "Python", - "source": "resp = client.slm.delete_lifecycle(\n policy_id=\"daily-snapshots\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.slm.deleteLifecycle({\n policy_id: \"daily-snapshots\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.slm.delete_lifecycle(\n policy_id: \"daily-snapshots\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->slm()->deleteLifecycle([\n \"policy_id\" => \"daily-snapshots\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_slm/policy/daily-snapshots\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -55888,32 +38411,6 @@ } }, "x-state": "Generally available; Added in 7.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_slm/policy/daily-snapshots/_execute\n" - }, - { - "lang": "Python", - "source": "resp = client.slm.execute_lifecycle(\n policy_id=\"daily-snapshots\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.slm.executeLifecycle({\n policy_id: \"daily-snapshots\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.slm.execute_lifecycle(\n policy_id: \"daily-snapshots\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->slm()->executeLifecycle([\n \"policy_id\" => \"daily-snapshots\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_slm/policy/daily-snapshots/_execute\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -55960,32 +38457,6 @@ } }, "x-state": "Generally available; Added in 7.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _slm/_execute_retention\n" - }, - { - "lang": "Python", - "source": "resp = client.slm.execute_retention()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.slm.executeRetention();" - }, - { - "lang": "Ruby", - "source": "response = client.slm.execute_retention" - }, - { - "lang": "PHP", - "source": "$resp = $client->slm()->executeRetention();" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_slm/_execute_retention\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -56011,32 +38482,6 @@ } }, "x-state": "Generally available; Added in 7.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _slm/policy/daily-snapshots?human\n" - }, - { - "lang": "Python", - "source": "resp = client.slm.get_lifecycle(\n policy_id=\"daily-snapshots\",\n human=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.slm.getLifecycle({\n policy_id: \"daily-snapshots\",\n human: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.slm.get_lifecycle(\n policy_id: \"daily-snapshots\",\n human: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->slm()->getLifecycle([\n \"policy_id\" => \"daily-snapshots\",\n \"human\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_slm/policy/daily-snapshots?human\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -56136,32 +38581,6 @@ } }, "x-state": "Generally available; Added in 7.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_slm/stats\n" - }, - { - "lang": "Python", - "source": "resp = client.slm.get_stats()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.slm.getStats();" - }, - { - "lang": "Ruby", - "source": "response = client.slm.get_stats" - }, - { - "lang": "PHP", - "source": "$resp = $client->slm()->getStats();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_slm/stats\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -56222,32 +38641,6 @@ } }, "x-state": "Generally available; Added in 7.6.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _slm/status\n" - }, - { - "lang": "Python", - "source": "resp = client.slm.get_status()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.slm.getStatus();" - }, - { - "lang": "Ruby", - "source": "response = client.slm.get_status" - }, - { - "lang": "PHP", - "source": "$resp = $client->slm()->getStatus();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_slm/status\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -56300,32 +38693,6 @@ } }, "x-state": "Generally available; Added in 7.6.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _slm/start\n" - }, - { - "lang": "Python", - "source": "resp = client.slm.start()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.slm.start();" - }, - { - "lang": "Ruby", - "source": "response = client.slm.start" - }, - { - "lang": "PHP", - "source": "$resp = $client->slm()->start();" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_slm/start\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -56446,32 +38813,6 @@ } }, "x-state": "Generally available; Added in 7.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_snapshot/my_repository/_cleanup\n" - }, - { - "lang": "Python", - "source": "resp = client.snapshot.cleanup_repository(\n name=\"my_repository\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.snapshot.cleanupRepository({\n name: \"my_repository\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.snapshot.cleanup_repository(\n repository: \"my_repository\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->snapshot()->cleanupRepository([\n \"repository\" => \"my_repository\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_snapshot/my_repository/_cleanup\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -56566,32 +38907,6 @@ } }, "x-state": "Generally available; Added in 7.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_snapshot/my_repository/source_snapshot/_clone/target_snapshot\n{\n \"indices\": \"index_a,index_b\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.snapshot.clone(\n repository=\"my_repository\",\n snapshot=\"source_snapshot\",\n target_snapshot=\"target_snapshot\",\n indices=\"index_a,index_b\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.snapshot.clone({\n repository: \"my_repository\",\n snapshot: \"source_snapshot\",\n target_snapshot: \"target_snapshot\",\n indices: \"index_a,index_b\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.snapshot.clone(\n repository: \"my_repository\",\n snapshot: \"source_snapshot\",\n target_snapshot: \"target_snapshot\",\n body: {\n \"indices\": \"index_a,index_b\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->snapshot()->clone([\n \"repository\" => \"my_repository\",\n \"snapshot\" => \"source_snapshot\",\n \"target_snapshot\" => \"target_snapshot\",\n \"body\" => [\n \"indices\" => \"index_a,index_b\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"indices\":\"index_a,index_b\"}' \"$ELASTICSEARCH_URL/_snapshot/my_repository/source_snapshot/_clone/target_snapshot\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -56808,32 +39123,6 @@ } }, "x-state": "Generally available; Added in 0.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_snapshot/my_repository/snapshot_*?sort=start_time&from_sort_value=1577833200000\n" - }, - { - "lang": "Python", - "source": "resp = client.snapshot.get(\n repository=\"my_repository\",\n snapshot=\"snapshot_*\",\n sort=\"start_time\",\n from_sort_value=\"1577833200000\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.snapshot.get({\n repository: \"my_repository\",\n snapshot: \"snapshot_*\",\n sort: \"start_time\",\n from_sort_value: 1577833200000,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.snapshot.get(\n repository: \"my_repository\",\n snapshot: \"snapshot_*\",\n sort: \"start_time\",\n from_sort_value: \"1577833200000\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->snapshot()->get([\n \"repository\" => \"my_repository\",\n \"snapshot\" => \"snapshot_*\",\n \"sort\" => \"start_time\",\n \"from_sort_value\" => \"1577833200000\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_snapshot/my_repository/snapshot_*?sort=start_time&from_sort_value=1577833200000\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -56869,32 +39158,6 @@ } }, "x-state": "Generally available; Added in 0.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_snapshot/my_repository/snapshot_2?wait_for_completion=true\n{\n \"indices\": \"index_1,index_2\",\n \"ignore_unavailable\": true,\n \"include_global_state\": false,\n \"metadata\": {\n \"taken_by\": \"user123\",\n \"taken_because\": \"backup before upgrading\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.snapshot.create(\n repository=\"my_repository\",\n snapshot=\"snapshot_2\",\n wait_for_completion=True,\n indices=\"index_1,index_2\",\n ignore_unavailable=True,\n include_global_state=False,\n metadata={\n \"taken_by\": \"user123\",\n \"taken_because\": \"backup before upgrading\"\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.snapshot.create({\n repository: \"my_repository\",\n snapshot: \"snapshot_2\",\n wait_for_completion: \"true\",\n indices: \"index_1,index_2\",\n ignore_unavailable: true,\n include_global_state: false,\n metadata: {\n taken_by: \"user123\",\n taken_because: \"backup before upgrading\",\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.snapshot.create(\n repository: \"my_repository\",\n snapshot: \"snapshot_2\",\n wait_for_completion: \"true\",\n body: {\n \"indices\": \"index_1,index_2\",\n \"ignore_unavailable\": true,\n \"include_global_state\": false,\n \"metadata\": {\n \"taken_by\": \"user123\",\n \"taken_because\": \"backup before upgrading\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->snapshot()->create([\n \"repository\" => \"my_repository\",\n \"snapshot\" => \"snapshot_2\",\n \"wait_for_completion\" => \"true\",\n \"body\" => [\n \"indices\" => \"index_1,index_2\",\n \"ignore_unavailable\" => true,\n \"include_global_state\" => false,\n \"metadata\" => [\n \"taken_by\" => \"user123\",\n \"taken_because\" => \"backup before upgrading\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"indices\":\"index_1,index_2\",\"ignore_unavailable\":true,\"include_global_state\":false,\"metadata\":{\"taken_by\":\"user123\",\"taken_because\":\"backup before upgrading\"}}' \"$ELASTICSEARCH_URL/_snapshot/my_repository/snapshot_2?wait_for_completion=true\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -56930,32 +39193,6 @@ } }, "x-state": "Generally available; Added in 0.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_snapshot/my_repository/snapshot_2?wait_for_completion=true\n{\n \"indices\": \"index_1,index_2\",\n \"ignore_unavailable\": true,\n \"include_global_state\": false,\n \"metadata\": {\n \"taken_by\": \"user123\",\n \"taken_because\": \"backup before upgrading\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.snapshot.create(\n repository=\"my_repository\",\n snapshot=\"snapshot_2\",\n wait_for_completion=True,\n indices=\"index_1,index_2\",\n ignore_unavailable=True,\n include_global_state=False,\n metadata={\n \"taken_by\": \"user123\",\n \"taken_because\": \"backup before upgrading\"\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.snapshot.create({\n repository: \"my_repository\",\n snapshot: \"snapshot_2\",\n wait_for_completion: \"true\",\n indices: \"index_1,index_2\",\n ignore_unavailable: true,\n include_global_state: false,\n metadata: {\n taken_by: \"user123\",\n taken_because: \"backup before upgrading\",\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.snapshot.create(\n repository: \"my_repository\",\n snapshot: \"snapshot_2\",\n wait_for_completion: \"true\",\n body: {\n \"indices\": \"index_1,index_2\",\n \"ignore_unavailable\": true,\n \"include_global_state\": false,\n \"metadata\": {\n \"taken_by\": \"user123\",\n \"taken_because\": \"backup before upgrading\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->snapshot()->create([\n \"repository\" => \"my_repository\",\n \"snapshot\" => \"snapshot_2\",\n \"wait_for_completion\" => \"true\",\n \"body\" => [\n \"indices\" => \"index_1,index_2\",\n \"ignore_unavailable\" => true,\n \"include_global_state\" => false,\n \"metadata\" => [\n \"taken_by\" => \"user123\",\n \"taken_because\" => \"backup before upgrading\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"indices\":\"index_1,index_2\",\"ignore_unavailable\":true,\"include_global_state\":false,\"metadata\":{\"taken_by\":\"user123\",\"taken_because\":\"backup before upgrading\"}}' \"$ELASTICSEARCH_URL/_snapshot/my_repository/snapshot_2?wait_for_completion=true\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -57018,32 +39255,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_snapshot/my_repository/snapshot_2,snapshot_3\n" - }, - { - "lang": "Python", - "source": "resp = client.snapshot.delete(\n repository=\"my_repository\",\n snapshot=\"snapshot_2,snapshot_3\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.snapshot.delete({\n repository: \"my_repository\",\n snapshot: \"snapshot_2,snapshot_3\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.snapshot.delete(\n repository: \"my_repository\",\n snapshot: \"snapshot_2,snapshot_3\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->snapshot()->delete([\n \"repository\" => \"my_repository\",\n \"snapshot\" => \"snapshot_2,snapshot_3\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_snapshot/my_repository/snapshot_2,snapshot_3\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -57072,32 +39283,6 @@ } }, "x-state": "Generally available; Added in 0.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_snapshot/my_repository\n" - }, - { - "lang": "Python", - "source": "resp = client.snapshot.get_repository(\n name=\"my_repository\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.snapshot.getRepository({\n name: \"my_repository\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.snapshot.get_repository(\n repository: \"my_repository\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->snapshot()->getRepository([\n \"repository\" => \"my_repository\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_snapshot/my_repository\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -57133,32 +39318,6 @@ } }, "x-state": "Generally available; Added in 0.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_snapshot/my_repository\n{\n \"type\": \"fs\",\n \"settings\": {\n \"location\": \"my_backup_location\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.snapshot.create_repository(\n name=\"my_repository\",\n repository={\n \"type\": \"fs\",\n \"settings\": {\n \"location\": \"my_backup_location\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.snapshot.createRepository({\n name: \"my_repository\",\n repository: {\n type: \"fs\",\n settings: {\n location: \"my_backup_location\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.snapshot.create_repository(\n repository: \"my_repository\",\n body: {\n \"type\": \"fs\",\n \"settings\": {\n \"location\": \"my_backup_location\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->snapshot()->createRepository([\n \"repository\" => \"my_repository\",\n \"body\" => [\n \"type\" => \"fs\",\n \"settings\" => [\n \"location\" => \"my_backup_location\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"type\":\"fs\",\"settings\":{\"location\":\"my_backup_location\"}}' \"$ELASTICSEARCH_URL/_snapshot/my_repository\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -57194,32 +39353,6 @@ } }, "x-state": "Generally available; Added in 0.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_snapshot/my_repository\n{\n \"type\": \"fs\",\n \"settings\": {\n \"location\": \"my_backup_location\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.snapshot.create_repository(\n name=\"my_repository\",\n repository={\n \"type\": \"fs\",\n \"settings\": {\n \"location\": \"my_backup_location\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.snapshot.createRepository({\n name: \"my_repository\",\n repository: {\n type: \"fs\",\n settings: {\n location: \"my_backup_location\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.snapshot.create_repository(\n repository: \"my_repository\",\n body: {\n \"type\": \"fs\",\n \"settings\": {\n \"location\": \"my_backup_location\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->snapshot()->createRepository([\n \"repository\" => \"my_repository\",\n \"body\" => [\n \"type\" => \"fs\",\n \"settings\" => [\n \"location\" => \"my_backup_location\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"type\":\"fs\",\"settings\":{\"location\":\"my_backup_location\"}}' \"$ELASTICSEARCH_URL/_snapshot/my_repository\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -57275,32 +39408,6 @@ } }, "x-state": "Generally available; Added in 0.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_snapshot/my_repository\n" - }, - { - "lang": "Python", - "source": "resp = client.snapshot.delete_repository(\n name=\"my_repository\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.snapshot.deleteRepository({\n name: \"my_repository\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.snapshot.delete_repository(\n repository: \"my_repository\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->snapshot()->deleteRepository([\n \"repository\" => \"my_repository\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_snapshot/my_repository\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -57326,32 +39433,6 @@ } }, "x-state": "Generally available; Added in 0.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_snapshot/my_repository\n" - }, - { - "lang": "Python", - "source": "resp = client.snapshot.get_repository(\n name=\"my_repository\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.snapshot.getRepository({\n name: \"my_repository\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.snapshot.get_repository(\n repository: \"my_repository\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->snapshot()->getRepository([\n \"repository\" => \"my_repository\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_snapshot/my_repository\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -57607,32 +39688,6 @@ } }, "x-state": "Generally available; Added in 7.12.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_snapshot/my_repository/_analyze?blob_count=10&max_blob_size=1mb&timeout=120s\n" - }, - { - "lang": "Python", - "source": "resp = client.snapshot.repository_analyze(\n name=\"my_repository\",\n blob_count=\"10\",\n max_blob_size=\"1mb\",\n timeout=\"120s\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.snapshot.repositoryAnalyze({\n name: \"my_repository\",\n blob_count: 10,\n max_blob_size: \"1mb\",\n timeout: \"120s\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.snapshot.repository_analyze(\n repository: \"my_repository\",\n blob_count: \"10\",\n max_blob_size: \"1mb\",\n timeout: \"120s\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->snapshot()->repositoryAnalyze([\n \"repository\" => \"my_repository\",\n \"blob_count\" => \"10\",\n \"max_blob_size\" => \"1mb\",\n \"timeout\" => \"120s\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_snapshot/my_repository/_analyze?blob_count=10&max_blob_size=1mb&timeout=120s\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -57785,32 +39840,6 @@ } }, "x-state": "Generally available; Added in 0.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_snapshot/my_repository/snapshot_2/_restore?wait_for_completion=true\n{\n \"indices\": \"index_1,index_2\",\n \"ignore_unavailable\": true,\n \"include_global_state\": false,\n \"rename_pattern\": \"index_(.+)\",\n \"rename_replacement\": \"restored_index_$1\",\n \"include_aliases\": false\n}" - }, - { - "lang": "Python", - "source": "resp = client.snapshot.restore(\n repository=\"my_repository\",\n snapshot=\"snapshot_2\",\n wait_for_completion=True,\n indices=\"index_1,index_2\",\n ignore_unavailable=True,\n include_global_state=False,\n rename_pattern=\"index_(.+)\",\n rename_replacement=\"restored_index_$1\",\n include_aliases=False,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.snapshot.restore({\n repository: \"my_repository\",\n snapshot: \"snapshot_2\",\n wait_for_completion: \"true\",\n indices: \"index_1,index_2\",\n ignore_unavailable: true,\n include_global_state: false,\n rename_pattern: \"index_(.+)\",\n rename_replacement: \"restored_index_$1\",\n include_aliases: false,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.snapshot.restore(\n repository: \"my_repository\",\n snapshot: \"snapshot_2\",\n wait_for_completion: \"true\",\n body: {\n \"indices\": \"index_1,index_2\",\n \"ignore_unavailable\": true,\n \"include_global_state\": false,\n \"rename_pattern\": \"index_(.+)\",\n \"rename_replacement\": \"restored_index_$1\",\n \"include_aliases\": false\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->snapshot()->restore([\n \"repository\" => \"my_repository\",\n \"snapshot\" => \"snapshot_2\",\n \"wait_for_completion\" => \"true\",\n \"body\" => [\n \"indices\" => \"index_1,index_2\",\n \"ignore_unavailable\" => true,\n \"include_global_state\" => false,\n \"rename_pattern\" => \"index_(.+)\",\n \"rename_replacement\" => \"restored_index_$1\",\n \"include_aliases\" => false,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"indices\":\"index_1,index_2\",\"ignore_unavailable\":true,\"include_global_state\":false,\"rename_pattern\":\"index_(.+)\",\"rename_replacement\":\"restored_index_$1\",\"include_aliases\":false}' \"$ELASTICSEARCH_URL/_snapshot/my_repository/snapshot_2/_restore?wait_for_completion=true\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -57836,32 +39865,6 @@ } }, "x-state": "Generally available; Added in 7.8.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _snapshot/my_repository/snapshot_2/_status\n" - }, - { - "lang": "Python", - "source": "resp = client.snapshot.status(\n repository=\"my_repository\",\n snapshot=\"snapshot_2\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.snapshot.status({\n repository: \"my_repository\",\n snapshot: \"snapshot_2\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.snapshot.status(\n repository: \"my_repository\",\n snapshot: \"snapshot_2\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->snapshot()->status([\n \"repository\" => \"my_repository\",\n \"snapshot\" => \"snapshot_2\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_snapshot/my_repository/snapshot_2/_status\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -57890,32 +39893,6 @@ } }, "x-state": "Generally available; Added in 7.8.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _snapshot/my_repository/snapshot_2/_status\n" - }, - { - "lang": "Python", - "source": "resp = client.snapshot.status(\n repository=\"my_repository\",\n snapshot=\"snapshot_2\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.snapshot.status({\n repository: \"my_repository\",\n snapshot: \"snapshot_2\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.snapshot.status(\n repository: \"my_repository\",\n snapshot: \"snapshot_2\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->snapshot()->status([\n \"repository\" => \"my_repository\",\n \"snapshot\" => \"snapshot_2\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_snapshot/my_repository/snapshot_2/_status\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -57947,32 +39924,6 @@ } }, "x-state": "Generally available; Added in 7.8.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _snapshot/my_repository/snapshot_2/_status\n" - }, - { - "lang": "Python", - "source": "resp = client.snapshot.status(\n repository=\"my_repository\",\n snapshot=\"snapshot_2\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.snapshot.status({\n repository: \"my_repository\",\n snapshot: \"snapshot_2\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.snapshot.status(\n repository: \"my_repository\",\n snapshot: \"snapshot_2\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->snapshot()->status([\n \"repository\" => \"my_repository\",\n \"snapshot\" => \"snapshot_2\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_snapshot/my_repository/snapshot_2/_status\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -58045,32 +39996,6 @@ } }, "x-state": "Generally available; Added in 0.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _snapshot/my_unverified_backup/_verify\n" - }, - { - "lang": "Python", - "source": "resp = client.snapshot.verify_repository(\n name=\"my_unverified_backup\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.snapshot.verifyRepository({\n name: \"my_unverified_backup\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.snapshot.verify_repository(\n repository: \"my_unverified_backup\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->snapshot()->verifyRepository([\n \"repository\" => \"my_unverified_backup\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_snapshot/my_unverified_backup/_verify\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -58127,32 +40052,6 @@ } }, "x-state": "Generally available; Added in 6.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _sql/close\n{\n \"cursor\": \"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.sql.clear_cursor(\n cursor=\"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.sql.clearCursor({\n cursor:\n \"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.sql.clear_cursor(\n body: {\n \"cursor\": \"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->sql()->clearCursor([\n \"body\" => [\n \"cursor\" => \"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"cursor\":\"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\"}' \"$ELASTICSEARCH_URL/_sql/close\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -58190,32 +40089,6 @@ } }, "x-state": "Generally available; Added in 7.15.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _sql/async/delete/FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\n" - }, - { - "lang": "Python", - "source": "resp = client.sql.delete_async(\n id=\"FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.sql.deleteAsync({\n id: \"FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.sql.delete_async(\n id: \"FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->sql()->deleteAsync([\n \"id\" => \"FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_sql/async/delete/FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -58330,32 +40203,6 @@ } }, "x-state": "Generally available; Added in 7.15.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _sql/async/FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=?wait_for_completion_timeout=2s&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.sql.get_async(\n id=\"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\",\n wait_for_completion_timeout=\"2s\",\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.sql.getAsync({\n id: \"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\",\n wait_for_completion_timeout: \"2s\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.sql.get_async(\n id: \"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\",\n wait_for_completion_timeout: \"2s\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->sql()->getAsync([\n \"id\" => \"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\",\n \"wait_for_completion_timeout\" => \"2s\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_sql/async/FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=?wait_for_completion_timeout=2s&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -58423,32 +40270,6 @@ } }, "x-state": "Generally available; Added in 7.15.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _sql/async/status/FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\n" - }, - { - "lang": "Python", - "source": "resp = client.sql.get_async_status(\n id=\"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.sql.getAsyncStatus({\n id: \"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.sql.get_async_status(\n id: \"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->sql()->getAsyncStatus([\n \"id\" => \"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_sql/async/status/FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -58474,32 +40295,6 @@ } }, "x-state": "Generally available; Added in 6.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _sql?format=txt\n{\n \"query\": \"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.sql.query(\n format=\"txt\",\n query=\"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.sql.query({\n format: \"txt\",\n query: \"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.sql.query(\n format: \"txt\",\n body: {\n \"query\": \"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->sql()->query([\n \"format\" => \"txt\",\n \"body\" => [\n \"query\" => \"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":\"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\"}' \"$ELASTICSEARCH_URL/_sql?format=txt\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -58523,32 +40318,6 @@ } }, "x-state": "Generally available; Added in 6.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _sql?format=txt\n{\n \"query\": \"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.sql.query(\n format=\"txt\",\n query=\"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.sql.query({\n format: \"txt\",\n query: \"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.sql.query(\n format: \"txt\",\n body: {\n \"query\": \"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->sql()->query([\n \"format\" => \"txt\",\n \"body\" => [\n \"query\" => \"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":\"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\"}' \"$ELASTICSEARCH_URL/_sql?format=txt\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -58569,32 +40338,6 @@ } }, "x-state": "Generally available; Added in 6.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _sql/translate\n{\n \"query\": \"SELECT * FROM library ORDER BY page_count DESC\",\n \"fetch_size\": 10\n}" - }, - { - "lang": "Python", - "source": "resp = client.sql.translate(\n query=\"SELECT * FROM library ORDER BY page_count DESC\",\n fetch_size=10,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.sql.translate({\n query: \"SELECT * FROM library ORDER BY page_count DESC\",\n fetch_size: 10,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.sql.translate(\n body: {\n \"query\": \"SELECT * FROM library ORDER BY page_count DESC\",\n \"fetch_size\": 10\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->sql()->translate([\n \"body\" => [\n \"query\" => \"SELECT * FROM library ORDER BY page_count DESC\",\n \"fetch_size\" => 10,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":\"SELECT * FROM library ORDER BY page_count DESC\",\"fetch_size\":10}' \"$ELASTICSEARCH_URL/_sql/translate\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -58613,32 +40356,6 @@ } }, "x-state": "Generally available; Added in 6.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _sql/translate\n{\n \"query\": \"SELECT * FROM library ORDER BY page_count DESC\",\n \"fetch_size\": 10\n}" - }, - { - "lang": "Python", - "source": "resp = client.sql.translate(\n query=\"SELECT * FROM library ORDER BY page_count DESC\",\n fetch_size=10,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.sql.translate({\n query: \"SELECT * FROM library ORDER BY page_count DESC\",\n fetch_size: 10,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.sql.translate(\n body: {\n \"query\": \"SELECT * FROM library ORDER BY page_count DESC\",\n \"fetch_size\": 10\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->sql()->translate([\n \"body\" => [\n \"query\" => \"SELECT * FROM library ORDER BY page_count DESC\",\n \"fetch_size\" => 10,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":\"SELECT * FROM library ORDER BY page_count DESC\",\"fetch_size\":10}' \"$ELASTICSEARCH_URL/_sql/translate\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -58675,32 +40392,6 @@ } }, "x-state": "Generally available; Added in 6.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_ssl/certificates\n" - }, - { - "lang": "Python", - "source": "resp = client.ssl.certificates()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ssl.certificates();" - }, - { - "lang": "Ruby", - "source": "response = client.ssl.certificates" - }, - { - "lang": "PHP", - "source": "$resp = $client->ssl()->certificates();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ssl/certificates\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -58781,32 +40472,6 @@ } }, "x-state": "Generally available; Added in 8.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _synonyms/my-synonyms-set\n" - }, - { - "lang": "Python", - "source": "resp = client.synonyms.get_synonym(\n id=\"my-synonyms-set\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.synonyms.getSynonym({\n id: \"my-synonyms-set\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.synonyms.get_synonym(\n id: \"my-synonyms-set\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->synonyms()->getSynonym([\n \"id\" => \"my-synonyms-set\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_synonyms/my-synonyms-set\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -58883,32 +40548,6 @@ } }, "x-state": "Generally available; Added in 8.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _synonyms/my-synonyms-set\n" - }, - { - "lang": "Python", - "source": "resp = client.synonyms.put_synonym(\n id=\"my-synonyms-set\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.synonyms.putSynonym({\n id: \"my-synonyms-set\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.synonyms.put_synonym(\n id: \"my-synonyms-set\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->synonyms()->putSynonym([\n \"id\" => \"my-synonyms-set\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_synonyms/my-synonyms-set\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -58944,32 +40583,6 @@ } }, "x-state": "Generally available; Added in 8.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _synonyms/my-synonyms-set\n" - }, - { - "lang": "Python", - "source": "resp = client.synonyms.delete_synonym(\n id=\"my-synonyms-set\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.synonyms.deleteSynonym({\n id: \"my-synonyms-set\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.synonyms.delete_synonym(\n id: \"my-synonyms-set\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->synonyms()->deleteSynonym([\n \"id\" => \"my-synonyms-set\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_synonyms/my-synonyms-set\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -59024,32 +40637,6 @@ } }, "x-state": "Generally available; Added in 8.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _synonyms/my-synonyms-set/test-1\n" - }, - { - "lang": "Python", - "source": "resp = client.synonyms.get_synonym_rule(\n set_id=\"my-synonyms-set\",\n rule_id=\"test-1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.synonyms.getSynonymRule({\n set_id: \"my-synonyms-set\",\n rule_id: \"test-1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.synonyms.get_synonym_rule(\n set_id: \"my-synonyms-set\",\n rule_id: \"test-1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->synonyms()->getSynonymRule([\n \"set_id\" => \"my-synonyms-set\",\n \"rule_id\" => \"test-1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_synonyms/my-synonyms-set/test-1\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -59127,32 +40714,6 @@ } }, "x-state": "Generally available; Added in 8.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _synonyms/my-synonyms-set/test-1\n{\n \"synonyms\": \"hello, hi, howdy\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.synonyms.put_synonym_rule(\n set_id=\"my-synonyms-set\",\n rule_id=\"test-1\",\n synonyms=\"hello, hi, howdy\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.synonyms.putSynonymRule({\n set_id: \"my-synonyms-set\",\n rule_id: \"test-1\",\n synonyms: \"hello, hi, howdy\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.synonyms.put_synonym_rule(\n set_id: \"my-synonyms-set\",\n rule_id: \"test-1\",\n body: {\n \"synonyms\": \"hello, hi, howdy\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->synonyms()->putSynonymRule([\n \"set_id\" => \"my-synonyms-set\",\n \"rule_id\" => \"test-1\",\n \"body\" => [\n \"synonyms\" => \"hello, hi, howdy\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"synonyms\":\"hello, hi, howdy\"}' \"$ELASTICSEARCH_URL/_synonyms/my-synonyms-set/test-1\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -59205,32 +40766,6 @@ } }, "x-state": "Generally available; Added in 8.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _synonyms/my-synonyms-set/test-1\n" - }, - { - "lang": "Python", - "source": "resp = client.synonyms.delete_synonym_rule(\n set_id=\"my-synonyms-set\",\n rule_id=\"test-1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.synonyms.deleteSynonymRule({\n set_id: \"my-synonyms-set\",\n rule_id: \"test-1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.synonyms.delete_synonym_rule(\n set_id: \"my-synonyms-set\",\n rule_id: \"test-1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->synonyms()->deleteSynonymRule([\n \"set_id\" => \"my-synonyms-set\",\n \"rule_id\" => \"test-1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_synonyms/my-synonyms-set/test-1\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -59300,32 +40835,6 @@ } }, "x-state": "Generally available; Added in 8.10.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _synonyms\n" - }, - { - "lang": "Python", - "source": "resp = client.synonyms.get_synonyms_sets()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.synonyms.getSynonymsSets();" - }, - { - "lang": "Ruby", - "source": "response = client.synonyms.get_synonyms_sets" - }, - { - "lang": "PHP", - "source": "$resp = $client->synonyms()->getSynonymsSets();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_synonyms\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -59357,32 +40866,6 @@ } }, "x-state": "Technical preview; Added in 2.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _tasks//_cancel\n" - }, - { - "lang": "Python", - "source": "resp = client.tasks.cancel(\n task_id=\"\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.tasks.cancel({\n task_id: \"\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.tasks.cancel(\n task_id: \"\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->tasks()->cancel([\n \"task_id\" => \"\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_tasks//_cancel\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -59417,32 +40900,6 @@ } }, "x-state": "Technical preview; Added in 2.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _tasks//_cancel\n" - }, - { - "lang": "Python", - "source": "resp = client.tasks.cancel(\n task_id=\"\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.tasks.cancel({\n task_id: \"\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.tasks.cancel(\n task_id: \"\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->tasks()->cancel([\n \"task_id\" => \"\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_tasks//_cancel\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -59530,32 +40987,6 @@ } }, "x-state": "Technical preview; Added in 5.0.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _tasks?detailed=true&actions=*/delete/byquery\n" - }, - { - "lang": "Python", - "source": "resp = client.tasks.list(\n detailed=True,\n actions=\"*/delete/byquery\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.tasks.list({\n detailed: \"true\",\n actions: \"*/delete/byquery\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.tasks.list(\n detailed: \"true\",\n actions: \"*/delete/byquery\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->tasks()->list([\n \"detailed\" => \"true\",\n \"actions\" => \"*/delete/byquery\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_tasks?detailed=true&actions=*/delete/byquery\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -59668,32 +41099,6 @@ } }, "x-state": "Technical preview; Added in 2.3.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _tasks?actions=*search&detailed\n" - }, - { - "lang": "Python", - "source": "resp = client.tasks.list(\n actions=\"*search\",\n detailed=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.tasks.list({\n actions: \"*search\",\n detailed: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.tasks.list(\n actions: \"*search\",\n detailed: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->tasks()->list([\n \"actions\" => \"*search\",\n \"detailed\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_tasks?actions=*search&detailed\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -59719,32 +41124,6 @@ } }, "x-state": "Generally available; Added in 7.14.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST stackoverflow/_terms_enum\n{\n \"field\" : \"tags\",\n \"string\" : \"kiba\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.terms_enum(\n index=\"stackoverflow\",\n field=\"tags\",\n string=\"kiba\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.termsEnum({\n index: \"stackoverflow\",\n field: \"tags\",\n string: \"kiba\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.terms_enum(\n index: \"stackoverflow\",\n body: {\n \"field\": \"tags\",\n \"string\": \"kiba\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->termsEnum([\n \"index\" => \"stackoverflow\",\n \"body\" => [\n \"field\" => \"tags\",\n \"string\" => \"kiba\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"field\":\"tags\",\"string\":\"kiba\"}' \"$ELASTICSEARCH_URL/stackoverflow/_terms_enum\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -59768,32 +41147,6 @@ } }, "x-state": "Generally available; Added in 7.14.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST stackoverflow/_terms_enum\n{\n \"field\" : \"tags\",\n \"string\" : \"kiba\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.terms_enum(\n index=\"stackoverflow\",\n field=\"tags\",\n string=\"kiba\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.termsEnum({\n index: \"stackoverflow\",\n field: \"tags\",\n string: \"kiba\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.terms_enum(\n index: \"stackoverflow\",\n body: {\n \"field\": \"tags\",\n \"string\": \"kiba\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->termsEnum([\n \"index\" => \"stackoverflow\",\n \"body\" => [\n \"field\" => \"tags\",\n \"string\" => \"kiba\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"field\":\"tags\",\"string\":\"kiba\"}' \"$ELASTICSEARCH_URL/stackoverflow/_terms_enum\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -59858,32 +41211,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_termvectors/1\n{\n \"fields\" : [\"text\"],\n \"offsets\" : true,\n \"payloads\" : true,\n \"positions\" : true,\n \"term_statistics\" : true,\n \"field_statistics\" : true\n}" - }, - { - "lang": "Python", - "source": "resp = client.termvectors(\n index=\"my-index-000001\",\n id=\"1\",\n fields=[\n \"text\"\n ],\n offsets=True,\n payloads=True,\n positions=True,\n term_statistics=True,\n field_statistics=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.termvectors({\n index: \"my-index-000001\",\n id: 1,\n fields: [\"text\"],\n offsets: true,\n payloads: true,\n positions: true,\n term_statistics: true,\n field_statistics: true,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.termvectors(\n index: \"my-index-000001\",\n id: \"1\",\n body: {\n \"fields\": [\n \"text\"\n ],\n \"offsets\": true,\n \"payloads\": true,\n \"positions\": true,\n \"term_statistics\": true,\n \"field_statistics\": true\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->termvectors([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n \"body\" => [\n \"fields\" => array(\n \"text\",\n ),\n \"offsets\" => true,\n \"payloads\" => true,\n \"positions\" => true,\n \"term_statistics\" => true,\n \"field_statistics\" => true,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"fields\":[\"text\"],\"offsets\":true,\"payloads\":true,\"positions\":true,\"term_statistics\":true,\"field_statistics\":true}' \"$ELASTICSEARCH_URL/my-index-000001/_termvectors/1\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -59946,32 +41273,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_termvectors/1\n{\n \"fields\" : [\"text\"],\n \"offsets\" : true,\n \"payloads\" : true,\n \"positions\" : true,\n \"term_statistics\" : true,\n \"field_statistics\" : true\n}" - }, - { - "lang": "Python", - "source": "resp = client.termvectors(\n index=\"my-index-000001\",\n id=\"1\",\n fields=[\n \"text\"\n ],\n offsets=True,\n payloads=True,\n positions=True,\n term_statistics=True,\n field_statistics=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.termvectors({\n index: \"my-index-000001\",\n id: 1,\n fields: [\"text\"],\n offsets: true,\n payloads: true,\n positions: true,\n term_statistics: true,\n field_statistics: true,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.termvectors(\n index: \"my-index-000001\",\n id: \"1\",\n body: {\n \"fields\": [\n \"text\"\n ],\n \"offsets\": true,\n \"payloads\": true,\n \"positions\": true,\n \"term_statistics\": true,\n \"field_statistics\": true\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->termvectors([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n \"body\" => [\n \"fields\" => array(\n \"text\",\n ),\n \"offsets\" => true,\n \"payloads\" => true,\n \"positions\" => true,\n \"term_statistics\" => true,\n \"field_statistics\" => true,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"fields\":[\"text\"],\"offsets\":true,\"payloads\":true,\"positions\":true,\"term_statistics\":true,\"field_statistics\":true}' \"$ELASTICSEARCH_URL/my-index-000001/_termvectors/1\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -60033,32 +41334,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_termvectors/1\n{\n \"fields\" : [\"text\"],\n \"offsets\" : true,\n \"payloads\" : true,\n \"positions\" : true,\n \"term_statistics\" : true,\n \"field_statistics\" : true\n}" - }, - { - "lang": "Python", - "source": "resp = client.termvectors(\n index=\"my-index-000001\",\n id=\"1\",\n fields=[\n \"text\"\n ],\n offsets=True,\n payloads=True,\n positions=True,\n term_statistics=True,\n field_statistics=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.termvectors({\n index: \"my-index-000001\",\n id: 1,\n fields: [\"text\"],\n offsets: true,\n payloads: true,\n positions: true,\n term_statistics: true,\n field_statistics: true,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.termvectors(\n index: \"my-index-000001\",\n id: \"1\",\n body: {\n \"fields\": [\n \"text\"\n ],\n \"offsets\": true,\n \"payloads\": true,\n \"positions\": true,\n \"term_statistics\": true,\n \"field_statistics\": true\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->termvectors([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n \"body\" => [\n \"fields\" => array(\n \"text\",\n ),\n \"offsets\" => true,\n \"payloads\" => true,\n \"positions\" => true,\n \"term_statistics\" => true,\n \"field_statistics\" => true,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"fields\":[\"text\"],\"offsets\":true,\"payloads\":true,\"positions\":true,\"term_statistics\":true,\"field_statistics\":true}' \"$ELASTICSEARCH_URL/my-index-000001/_termvectors/1\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -60118,32 +41393,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_termvectors/1\n{\n \"fields\" : [\"text\"],\n \"offsets\" : true,\n \"payloads\" : true,\n \"positions\" : true,\n \"term_statistics\" : true,\n \"field_statistics\" : true\n}" - }, - { - "lang": "Python", - "source": "resp = client.termvectors(\n index=\"my-index-000001\",\n id=\"1\",\n fields=[\n \"text\"\n ],\n offsets=True,\n payloads=True,\n positions=True,\n term_statistics=True,\n field_statistics=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.termvectors({\n index: \"my-index-000001\",\n id: 1,\n fields: [\"text\"],\n offsets: true,\n payloads: true,\n positions: true,\n term_statistics: true,\n field_statistics: true,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.termvectors(\n index: \"my-index-000001\",\n id: \"1\",\n body: {\n \"fields\": [\n \"text\"\n ],\n \"offsets\": true,\n \"payloads\": true,\n \"positions\": true,\n \"term_statistics\": true,\n \"field_statistics\": true\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->termvectors([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n \"body\" => [\n \"fields\" => array(\n \"text\",\n ),\n \"offsets\" => true,\n \"payloads\" => true,\n \"positions\" => true,\n \"term_statistics\" => true,\n \"field_statistics\" => true,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"fields\":[\"text\"],\"offsets\":true,\"payloads\":true,\"positions\":true,\"term_statistics\":true,\"field_statistics\":true}' \"$ELASTICSEARCH_URL/my-index-000001/_termvectors/1\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -60385,32 +41634,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _text_structure/find_field_structure?index=test-logs&field=message\n" - }, - { - "lang": "Python", - "source": "resp = client.text_structure.find_field_structure(\n index=\"test-logs\",\n field=\"message\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.textStructure.findFieldStructure({\n index: \"test-logs\",\n field: \"message\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.text_structure.find_field_structure(\n index: \"test-logs\",\n field: \"message\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->textStructure()->findFieldStructure([\n \"index\" => \"test-logs\",\n \"field\" => \"message\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_text_structure/find_field_structure?index=test-logs&field=message\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -60466,32 +41689,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _text_structure/find_message_structure\n{\n \"messages\": [\n \"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128\",\n \"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]\",\n \"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]\",\n \"[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]\",\n \"[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled\",\n \"[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled\",\n \"[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled\",\n \"[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]\",\n \"[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]\",\n \"[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized\",\n \"[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...\"\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.text_structure.find_message_structure(\n messages=[\n \"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128\",\n \"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]\",\n \"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]\",\n \"[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]\",\n \"[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled\",\n \"[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled\",\n \"[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled\",\n \"[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]\",\n \"[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]\",\n \"[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized\",\n \"[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...\"\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.textStructure.findMessageStructure({\n messages: [\n \"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128\",\n \"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]\",\n \"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]\",\n \"[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]\",\n \"[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled\",\n \"[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled\",\n \"[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled\",\n \"[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]\",\n \"[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]\",\n \"[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized\",\n \"[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...\",\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.text_structure.find_message_structure(\n body: {\n \"messages\": [\n \"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128\",\n \"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]\",\n \"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]\",\n \"[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]\",\n \"[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled\",\n \"[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled\",\n \"[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled\",\n \"[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]\",\n \"[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]\",\n \"[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized\",\n \"[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...\"\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->textStructure()->findMessageStructure([\n \"body\" => [\n \"messages\" => array(\n \"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128\",\n \"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]\",\n \"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]\",\n \"[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]\",\n \"[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled\",\n \"[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled\",\n \"[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled\",\n \"[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]\",\n \"[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]\",\n \"[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized\",\n \"[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...\",\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"messages\":[\"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128\",\"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]\",\"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]\",\"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]\",\"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]\",\"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]\",\"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]\",\"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]\",\"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]\",\"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]\",\"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]\",\"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]\",\"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]\",\"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]\",\"[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]\",\"[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled\",\"[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled\",\"[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled\",\"[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]\",\"[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]\",\"[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized\",\"[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...\"]}' \"$ELASTICSEARCH_URL/_text_structure/find_message_structure\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -60545,32 +41742,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _text_structure/find_message_structure\n{\n \"messages\": [\n \"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128\",\n \"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]\",\n \"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]\",\n \"[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]\",\n \"[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled\",\n \"[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled\",\n \"[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled\",\n \"[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]\",\n \"[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]\",\n \"[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized\",\n \"[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...\"\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.text_structure.find_message_structure(\n messages=[\n \"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128\",\n \"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]\",\n \"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]\",\n \"[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]\",\n \"[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled\",\n \"[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled\",\n \"[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled\",\n \"[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]\",\n \"[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]\",\n \"[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized\",\n \"[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...\"\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.textStructure.findMessageStructure({\n messages: [\n \"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128\",\n \"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]\",\n \"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]\",\n \"[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]\",\n \"[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled\",\n \"[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled\",\n \"[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled\",\n \"[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]\",\n \"[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]\",\n \"[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized\",\n \"[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...\",\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.text_structure.find_message_structure(\n body: {\n \"messages\": [\n \"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128\",\n \"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]\",\n \"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]\",\n \"[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]\",\n \"[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled\",\n \"[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled\",\n \"[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled\",\n \"[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]\",\n \"[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]\",\n \"[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized\",\n \"[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...\"\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->textStructure()->findMessageStructure([\n \"body\" => [\n \"messages\" => array(\n \"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128\",\n \"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]\",\n \"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]\",\n \"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]\",\n \"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]\",\n \"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]\",\n \"[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]\",\n \"[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled\",\n \"[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled\",\n \"[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled\",\n \"[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]\",\n \"[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]\",\n \"[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized\",\n \"[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...\",\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"messages\":[\"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128\",\"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]\",\"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]\",\"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]\",\"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]\",\"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]\",\"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]\",\"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]\",\"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]\",\"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]\",\"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]\",\"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]\",\"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]\",\"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]\",\"[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]\",\"[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled\",\"[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled\",\"[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled\",\"[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]\",\"[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]\",\"[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized\",\"[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...\"]}' \"$ELASTICSEARCH_URL/_text_structure/find_message_structure\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -60581,6 +41752,9 @@ ], "summary": "Find the structure of a text file", "description": "The text file must contain data that is suitable to be ingested into Elasticsearch.\n\nThis API provides a starting point for ingesting data into Elasticsearch in a format that is suitable for subsequent use with other Elastic Stack functionality.\nUnlike other Elasticsearch endpoints, the data that is posted to this endpoint does not need to be UTF-8 encoded and in JSON format.\nIt must, however, be text; binary text formats are not currently supported.\nThe size is limited to the Elasticsearch HTTP receive buffer size, which defaults to 100 Mb.\n\nThe response from the API contains:\n\n* A couple of messages from the beginning of the text.\n* Statistics that reveal the most common values for all fields detected within the text and basic numeric statistics for numeric fields.\n* Information about the structure of the text, which is useful when you write ingest configurations to index it or similarly formatted text.\n* Appropriate mappings for an Elasticsearch index, which you could use to ingest the text.\n\nAll this information can be calculated by the structure finder with no guidance.\nHowever, you can optionally override some of the decisions about the text structure by specifying one or more query parameters.\n\n## Required authorization\n\n* Cluster privileges: `monitor_text_structure`\n", + "externalDocs": { + "url": "https://www.elastic.co/docs/reference/elasticsearch/rest-apis/find-text-structure-examples" + }, "operationId": "text-structure-find-structure", "parameters": [ { @@ -60878,32 +42052,6 @@ } }, "x-state": "Generally available; Added in 7.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _text_structure/find_structure\n{\"name\": \"Leviathan Wakes\", \"author\": \"James S.A. Corey\", \"release_date\": \"2011-06-02\", \"page_count\": 561}\n{\"name\": \"Hyperion\", \"author\": \"Dan Simmons\", \"release_date\": \"1989-05-26\", \"page_count\": 482}\n{\"name\": \"Dune\", \"author\": \"Frank Herbert\", \"release_date\": \"1965-06-01\", \"page_count\": 604}\n{\"name\": \"Dune Messiah\", \"author\": \"Frank Herbert\", \"release_date\": \"1969-10-15\", \"page_count\": 331}\n{\"name\": \"Children of Dune\", \"author\": \"Frank Herbert\", \"release_date\": \"1976-04-21\", \"page_count\": 408}\n{\"name\": \"God Emperor of Dune\", \"author\": \"Frank Herbert\", \"release_date\": \"1981-05-28\", \"page_count\": 454}\n{\"name\": \"Consider Phlebas\", \"author\": \"Iain M. Banks\", \"release_date\": \"1987-04-23\", \"page_count\": 471}\n{\"name\": \"Pandora's Star\", \"author\": \"Peter F. Hamilton\", \"release_date\": \"2004-03-02\", \"page_count\": 768}\n{\"name\": \"Revelation Space\", \"author\": \"Alastair Reynolds\", \"release_date\": \"2000-03-15\", \"page_count\": 585}\n{\"name\": \"A Fire Upon the Deep\", \"author\": \"Vernor Vinge\", \"release_date\": \"1992-06-01\", \"page_count\": 613}\n{\"name\": \"Ender's Game\", \"author\": \"Orson Scott Card\", \"release_date\": \"1985-06-01\", \"page_count\": 324}\n{\"name\": \"1984\", \"author\": \"George Orwell\", \"release_date\": \"1985-06-01\", \"page_count\": 328}\n{\"name\": \"Fahrenheit 451\", \"author\": \"Ray Bradbury\", \"release_date\": \"1953-10-15\", \"page_count\": 227}\n{\"name\": \"Brave New World\", \"author\": \"Aldous Huxley\", \"release_date\": \"1932-06-01\", \"page_count\": 268}\n{\"name\": \"Foundation\", \"author\": \"Isaac Asimov\", \"release_date\": \"1951-06-01\", \"page_count\": 224}\n{\"name\": \"The Giver\", \"author\": \"Lois Lowry\", \"release_date\": \"1993-04-26\", \"page_count\": 208}\n{\"name\": \"Slaughterhouse-Five\", \"author\": \"Kurt Vonnegut\", \"release_date\": \"1969-06-01\", \"page_count\": 275}\n{\"name\": \"The Hitchhiker's Guide to the Galaxy\", \"author\": \"Douglas Adams\", \"release_date\": \"1979-10-12\", \"page_count\": 180}\n{\"name\": \"Snow Crash\", \"author\": \"Neal Stephenson\", \"release_date\": \"1992-06-01\", \"page_count\": 470}\n{\"name\": \"Neuromancer\", \"author\": \"William Gibson\", \"release_date\": \"1984-07-01\", \"page_count\": 271}\n{\"name\": \"The Handmaid's Tale\", \"author\": \"Margaret Atwood\", \"release_date\": \"1985-06-01\", \"page_count\": 311}\n{\"name\": \"Starship Troopers\", \"author\": \"Robert A. Heinlein\", \"release_date\": \"1959-12-01\", \"page_count\": 335}\n{\"name\": \"The Left Hand of Darkness\", \"author\": \"Ursula K. Le Guin\", \"release_date\": \"1969-06-01\", \"page_count\": 304}\n{\"name\": \"The Moon is a Harsh Mistress\", \"author\": \"Robert A. Heinlein\", \"release_date\": \"1966-04-01\", \"page_count\": 288}" - }, - { - "lang": "Python", - "source": "resp = client.text_structure.find_structure(\n text_files=[\n {\n \"name\": \"Leviathan Wakes\",\n \"author\": \"James S.A. Corey\",\n \"release_date\": \"2011-06-02\",\n \"page_count\": 561\n },\n {\n \"name\": \"Hyperion\",\n \"author\": \"Dan Simmons\",\n \"release_date\": \"1989-05-26\",\n \"page_count\": 482\n },\n {\n \"name\": \"Dune\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1965-06-01\",\n \"page_count\": 604\n },\n {\n \"name\": \"Dune Messiah\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1969-10-15\",\n \"page_count\": 331\n },\n {\n \"name\": \"Children of Dune\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1976-04-21\",\n \"page_count\": 408\n },\n {\n \"name\": \"God Emperor of Dune\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1981-05-28\",\n \"page_count\": 454\n },\n {\n \"name\": \"Consider Phlebas\",\n \"author\": \"Iain M. Banks\",\n \"release_date\": \"1987-04-23\",\n \"page_count\": 471\n },\n {\n \"name\": \"Pandora's Star\",\n \"author\": \"Peter F. Hamilton\",\n \"release_date\": \"2004-03-02\",\n \"page_count\": 768\n },\n {\n \"name\": \"Revelation Space\",\n \"author\": \"Alastair Reynolds\",\n \"release_date\": \"2000-03-15\",\n \"page_count\": 585\n },\n {\n \"name\": \"A Fire Upon the Deep\",\n \"author\": \"Vernor Vinge\",\n \"release_date\": \"1992-06-01\",\n \"page_count\": 613\n },\n {\n \"name\": \"Ender's Game\",\n \"author\": \"Orson Scott Card\",\n \"release_date\": \"1985-06-01\",\n \"page_count\": 324\n },\n {\n \"name\": \"1984\",\n \"author\": \"George Orwell\",\n \"release_date\": \"1985-06-01\",\n \"page_count\": 328\n },\n {\n \"name\": \"Fahrenheit 451\",\n \"author\": \"Ray Bradbury\",\n \"release_date\": \"1953-10-15\",\n \"page_count\": 227\n },\n {\n \"name\": \"Brave New World\",\n \"author\": \"Aldous Huxley\",\n \"release_date\": \"1932-06-01\",\n \"page_count\": 268\n },\n {\n \"name\": \"Foundation\",\n \"author\": \"Isaac Asimov\",\n \"release_date\": \"1951-06-01\",\n \"page_count\": 224\n },\n {\n \"name\": \"The Giver\",\n \"author\": \"Lois Lowry\",\n \"release_date\": \"1993-04-26\",\n \"page_count\": 208\n },\n {\n \"name\": \"Slaughterhouse-Five\",\n \"author\": \"Kurt Vonnegut\",\n \"release_date\": \"1969-06-01\",\n \"page_count\": 275\n },\n {\n \"name\": \"The Hitchhiker's Guide to the Galaxy\",\n \"author\": \"Douglas Adams\",\n \"release_date\": \"1979-10-12\",\n \"page_count\": 180\n },\n {\n \"name\": \"Snow Crash\",\n \"author\": \"Neal Stephenson\",\n \"release_date\": \"1992-06-01\",\n \"page_count\": 470\n },\n {\n \"name\": \"Neuromancer\",\n \"author\": \"William Gibson\",\n \"release_date\": \"1984-07-01\",\n \"page_count\": 271\n },\n {\n \"name\": \"The Handmaid's Tale\",\n \"author\": \"Margaret Atwood\",\n \"release_date\": \"1985-06-01\",\n \"page_count\": 311\n },\n {\n \"name\": \"Starship Troopers\",\n \"author\": \"Robert A. Heinlein\",\n \"release_date\": \"1959-12-01\",\n \"page_count\": 335\n },\n {\n \"name\": \"The Left Hand of Darkness\",\n \"author\": \"Ursula K. Le Guin\",\n \"release_date\": \"1969-06-01\",\n \"page_count\": 304\n },\n {\n \"name\": \"The Moon is a Harsh Mistress\",\n \"author\": \"Robert A. Heinlein\",\n \"release_date\": \"1966-04-01\",\n \"page_count\": 288\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.textStructure.findStructure({\n text_files: [\n {\n name: \"Leviathan Wakes\",\n author: \"James S.A. Corey\",\n release_date: \"2011-06-02\",\n page_count: 561,\n },\n {\n name: \"Hyperion\",\n author: \"Dan Simmons\",\n release_date: \"1989-05-26\",\n page_count: 482,\n },\n {\n name: \"Dune\",\n author: \"Frank Herbert\",\n release_date: \"1965-06-01\",\n page_count: 604,\n },\n {\n name: \"Dune Messiah\",\n author: \"Frank Herbert\",\n release_date: \"1969-10-15\",\n page_count: 331,\n },\n {\n name: \"Children of Dune\",\n author: \"Frank Herbert\",\n release_date: \"1976-04-21\",\n page_count: 408,\n },\n {\n name: \"God Emperor of Dune\",\n author: \"Frank Herbert\",\n release_date: \"1981-05-28\",\n page_count: 454,\n },\n {\n name: \"Consider Phlebas\",\n author: \"Iain M. Banks\",\n release_date: \"1987-04-23\",\n page_count: 471,\n },\n {\n name: \"Pandora's Star\",\n author: \"Peter F. Hamilton\",\n release_date: \"2004-03-02\",\n page_count: 768,\n },\n {\n name: \"Revelation Space\",\n author: \"Alastair Reynolds\",\n release_date: \"2000-03-15\",\n page_count: 585,\n },\n {\n name: \"A Fire Upon the Deep\",\n author: \"Vernor Vinge\",\n release_date: \"1992-06-01\",\n page_count: 613,\n },\n {\n name: \"Ender's Game\",\n author: \"Orson Scott Card\",\n release_date: \"1985-06-01\",\n page_count: 324,\n },\n {\n name: \"1984\",\n author: \"George Orwell\",\n release_date: \"1985-06-01\",\n page_count: 328,\n },\n {\n name: \"Fahrenheit 451\",\n author: \"Ray Bradbury\",\n release_date: \"1953-10-15\",\n page_count: 227,\n },\n {\n name: \"Brave New World\",\n author: \"Aldous Huxley\",\n release_date: \"1932-06-01\",\n page_count: 268,\n },\n {\n name: \"Foundation\",\n author: \"Isaac Asimov\",\n release_date: \"1951-06-01\",\n page_count: 224,\n },\n {\n name: \"The Giver\",\n author: \"Lois Lowry\",\n release_date: \"1993-04-26\",\n page_count: 208,\n },\n {\n name: \"Slaughterhouse-Five\",\n author: \"Kurt Vonnegut\",\n release_date: \"1969-06-01\",\n page_count: 275,\n },\n {\n name: \"The Hitchhiker's Guide to the Galaxy\",\n author: \"Douglas Adams\",\n release_date: \"1979-10-12\",\n page_count: 180,\n },\n {\n name: \"Snow Crash\",\n author: \"Neal Stephenson\",\n release_date: \"1992-06-01\",\n page_count: 470,\n },\n {\n name: \"Neuromancer\",\n author: \"William Gibson\",\n release_date: \"1984-07-01\",\n page_count: 271,\n },\n {\n name: \"The Handmaid's Tale\",\n author: \"Margaret Atwood\",\n release_date: \"1985-06-01\",\n page_count: 311,\n },\n {\n name: \"Starship Troopers\",\n author: \"Robert A. Heinlein\",\n release_date: \"1959-12-01\",\n page_count: 335,\n },\n {\n name: \"The Left Hand of Darkness\",\n author: \"Ursula K. Le Guin\",\n release_date: \"1969-06-01\",\n page_count: 304,\n },\n {\n name: \"The Moon is a Harsh Mistress\",\n author: \"Robert A. Heinlein\",\n release_date: \"1966-04-01\",\n page_count: 288,\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.text_structure.find_structure(\n body: [\n {\n \"name\": \"Leviathan Wakes\",\n \"author\": \"James S.A. Corey\",\n \"release_date\": \"2011-06-02\",\n \"page_count\": 561\n },\n {\n \"name\": \"Hyperion\",\n \"author\": \"Dan Simmons\",\n \"release_date\": \"1989-05-26\",\n \"page_count\": 482\n },\n {\n \"name\": \"Dune\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1965-06-01\",\n \"page_count\": 604\n },\n {\n \"name\": \"Dune Messiah\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1969-10-15\",\n \"page_count\": 331\n },\n {\n \"name\": \"Children of Dune\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1976-04-21\",\n \"page_count\": 408\n },\n {\n \"name\": \"God Emperor of Dune\",\n \"author\": \"Frank Herbert\",\n \"release_date\": \"1981-05-28\",\n \"page_count\": 454\n },\n {\n \"name\": \"Consider Phlebas\",\n \"author\": \"Iain M. Banks\",\n \"release_date\": \"1987-04-23\",\n \"page_count\": 471\n },\n {\n \"name\": \"Pandora's Star\",\n \"author\": \"Peter F. Hamilton\",\n \"release_date\": \"2004-03-02\",\n \"page_count\": 768\n },\n {\n \"name\": \"Revelation Space\",\n \"author\": \"Alastair Reynolds\",\n \"release_date\": \"2000-03-15\",\n \"page_count\": 585\n },\n {\n \"name\": \"A Fire Upon the Deep\",\n \"author\": \"Vernor Vinge\",\n \"release_date\": \"1992-06-01\",\n \"page_count\": 613\n },\n {\n \"name\": \"Ender's Game\",\n \"author\": \"Orson Scott Card\",\n \"release_date\": \"1985-06-01\",\n \"page_count\": 324\n },\n {\n \"name\": \"1984\",\n \"author\": \"George Orwell\",\n \"release_date\": \"1985-06-01\",\n \"page_count\": 328\n },\n {\n \"name\": \"Fahrenheit 451\",\n \"author\": \"Ray Bradbury\",\n \"release_date\": \"1953-10-15\",\n \"page_count\": 227\n },\n {\n \"name\": \"Brave New World\",\n \"author\": \"Aldous Huxley\",\n \"release_date\": \"1932-06-01\",\n \"page_count\": 268\n },\n {\n \"name\": \"Foundation\",\n \"author\": \"Isaac Asimov\",\n \"release_date\": \"1951-06-01\",\n \"page_count\": 224\n },\n {\n \"name\": \"The Giver\",\n \"author\": \"Lois Lowry\",\n \"release_date\": \"1993-04-26\",\n \"page_count\": 208\n },\n {\n \"name\": \"Slaughterhouse-Five\",\n \"author\": \"Kurt Vonnegut\",\n \"release_date\": \"1969-06-01\",\n \"page_count\": 275\n },\n {\n \"name\": \"The Hitchhiker's Guide to the Galaxy\",\n \"author\": \"Douglas Adams\",\n \"release_date\": \"1979-10-12\",\n \"page_count\": 180\n },\n {\n \"name\": \"Snow Crash\",\n \"author\": \"Neal Stephenson\",\n \"release_date\": \"1992-06-01\",\n \"page_count\": 470\n },\n {\n \"name\": \"Neuromancer\",\n \"author\": \"William Gibson\",\n \"release_date\": \"1984-07-01\",\n \"page_count\": 271\n },\n {\n \"name\": \"The Handmaid's Tale\",\n \"author\": \"Margaret Atwood\",\n \"release_date\": \"1985-06-01\",\n \"page_count\": 311\n },\n {\n \"name\": \"Starship Troopers\",\n \"author\": \"Robert A. Heinlein\",\n \"release_date\": \"1959-12-01\",\n \"page_count\": 335\n },\n {\n \"name\": \"The Left Hand of Darkness\",\n \"author\": \"Ursula K. Le Guin\",\n \"release_date\": \"1969-06-01\",\n \"page_count\": 304\n },\n {\n \"name\": \"The Moon is a Harsh Mistress\",\n \"author\": \"Robert A. Heinlein\",\n \"release_date\": \"1966-04-01\",\n \"page_count\": 288\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->textStructure()->findStructure([\n \"body\" => array(\n [\n \"name\" => \"Leviathan Wakes\",\n \"author\" => \"James S.A. Corey\",\n \"release_date\" => \"2011-06-02\",\n \"page_count\" => 561,\n ],\n [\n \"name\" => \"Hyperion\",\n \"author\" => \"Dan Simmons\",\n \"release_date\" => \"1989-05-26\",\n \"page_count\" => 482,\n ],\n [\n \"name\" => \"Dune\",\n \"author\" => \"Frank Herbert\",\n \"release_date\" => \"1965-06-01\",\n \"page_count\" => 604,\n ],\n [\n \"name\" => \"Dune Messiah\",\n \"author\" => \"Frank Herbert\",\n \"release_date\" => \"1969-10-15\",\n \"page_count\" => 331,\n ],\n [\n \"name\" => \"Children of Dune\",\n \"author\" => \"Frank Herbert\",\n \"release_date\" => \"1976-04-21\",\n \"page_count\" => 408,\n ],\n [\n \"name\" => \"God Emperor of Dune\",\n \"author\" => \"Frank Herbert\",\n \"release_date\" => \"1981-05-28\",\n \"page_count\" => 454,\n ],\n [\n \"name\" => \"Consider Phlebas\",\n \"author\" => \"Iain M. Banks\",\n \"release_date\" => \"1987-04-23\",\n \"page_count\" => 471,\n ],\n [\n \"name\" => \"Pandora's Star\",\n \"author\" => \"Peter F. Hamilton\",\n \"release_date\" => \"2004-03-02\",\n \"page_count\" => 768,\n ],\n [\n \"name\" => \"Revelation Space\",\n \"author\" => \"Alastair Reynolds\",\n \"release_date\" => \"2000-03-15\",\n \"page_count\" => 585,\n ],\n [\n \"name\" => \"A Fire Upon the Deep\",\n \"author\" => \"Vernor Vinge\",\n \"release_date\" => \"1992-06-01\",\n \"page_count\" => 613,\n ],\n [\n \"name\" => \"Ender's Game\",\n \"author\" => \"Orson Scott Card\",\n \"release_date\" => \"1985-06-01\",\n \"page_count\" => 324,\n ],\n [\n \"name\" => \"1984\",\n \"author\" => \"George Orwell\",\n \"release_date\" => \"1985-06-01\",\n \"page_count\" => 328,\n ],\n [\n \"name\" => \"Fahrenheit 451\",\n \"author\" => \"Ray Bradbury\",\n \"release_date\" => \"1953-10-15\",\n \"page_count\" => 227,\n ],\n [\n \"name\" => \"Brave New World\",\n \"author\" => \"Aldous Huxley\",\n \"release_date\" => \"1932-06-01\",\n \"page_count\" => 268,\n ],\n [\n \"name\" => \"Foundation\",\n \"author\" => \"Isaac Asimov\",\n \"release_date\" => \"1951-06-01\",\n \"page_count\" => 224,\n ],\n [\n \"name\" => \"The Giver\",\n \"author\" => \"Lois Lowry\",\n \"release_date\" => \"1993-04-26\",\n \"page_count\" => 208,\n ],\n [\n \"name\" => \"Slaughterhouse-Five\",\n \"author\" => \"Kurt Vonnegut\",\n \"release_date\" => \"1969-06-01\",\n \"page_count\" => 275,\n ],\n [\n \"name\" => \"The Hitchhiker's Guide to the Galaxy\",\n \"author\" => \"Douglas Adams\",\n \"release_date\" => \"1979-10-12\",\n \"page_count\" => 180,\n ],\n [\n \"name\" => \"Snow Crash\",\n \"author\" => \"Neal Stephenson\",\n \"release_date\" => \"1992-06-01\",\n \"page_count\" => 470,\n ],\n [\n \"name\" => \"Neuromancer\",\n \"author\" => \"William Gibson\",\n \"release_date\" => \"1984-07-01\",\n \"page_count\" => 271,\n ],\n [\n \"name\" => \"The Handmaid's Tale\",\n \"author\" => \"Margaret Atwood\",\n \"release_date\" => \"1985-06-01\",\n \"page_count\" => 311,\n ],\n [\n \"name\" => \"Starship Troopers\",\n \"author\" => \"Robert A. Heinlein\",\n \"release_date\" => \"1959-12-01\",\n \"page_count\" => 335,\n ],\n [\n \"name\" => \"The Left Hand of Darkness\",\n \"author\" => \"Ursula K. Le Guin\",\n \"release_date\" => \"1969-06-01\",\n \"page_count\" => 304,\n ],\n [\n \"name\" => \"The Moon is a Harsh Mistress\",\n \"author\" => \"Robert A. Heinlein\",\n \"release_date\" => \"1966-04-01\",\n \"page_count\" => 288,\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{\"name\":\"Leviathan Wakes\",\"author\":\"James S.A. Corey\",\"release_date\":\"2011-06-02\",\"page_count\":561},{\"name\":\"Hyperion\",\"author\":\"Dan Simmons\",\"release_date\":\"1989-05-26\",\"page_count\":482},{\"name\":\"Dune\",\"author\":\"Frank Herbert\",\"release_date\":\"1965-06-01\",\"page_count\":604},{\"name\":\"Dune Messiah\",\"author\":\"Frank Herbert\",\"release_date\":\"1969-10-15\",\"page_count\":331},{\"name\":\"Children of Dune\",\"author\":\"Frank Herbert\",\"release_date\":\"1976-04-21\",\"page_count\":408},{\"name\":\"God Emperor of Dune\",\"author\":\"Frank Herbert\",\"release_date\":\"1981-05-28\",\"page_count\":454},{\"name\":\"Consider Phlebas\",\"author\":\"Iain M. Banks\",\"release_date\":\"1987-04-23\",\"page_count\":471},{\"name\":\"Pandora'\"'\"'s Star\",\"author\":\"Peter F. Hamilton\",\"release_date\":\"2004-03-02\",\"page_count\":768},{\"name\":\"Revelation Space\",\"author\":\"Alastair Reynolds\",\"release_date\":\"2000-03-15\",\"page_count\":585},{\"name\":\"A Fire Upon the Deep\",\"author\":\"Vernor Vinge\",\"release_date\":\"1992-06-01\",\"page_count\":613},{\"name\":\"Ender'\"'\"'s Game\",\"author\":\"Orson Scott Card\",\"release_date\":\"1985-06-01\",\"page_count\":324},{\"name\":\"1984\",\"author\":\"George Orwell\",\"release_date\":\"1985-06-01\",\"page_count\":328},{\"name\":\"Fahrenheit 451\",\"author\":\"Ray Bradbury\",\"release_date\":\"1953-10-15\",\"page_count\":227},{\"name\":\"Brave New World\",\"author\":\"Aldous Huxley\",\"release_date\":\"1932-06-01\",\"page_count\":268},{\"name\":\"Foundation\",\"author\":\"Isaac Asimov\",\"release_date\":\"1951-06-01\",\"page_count\":224},{\"name\":\"The Giver\",\"author\":\"Lois Lowry\",\"release_date\":\"1993-04-26\",\"page_count\":208},{\"name\":\"Slaughterhouse-Five\",\"author\":\"Kurt Vonnegut\",\"release_date\":\"1969-06-01\",\"page_count\":275},{\"name\":\"The Hitchhiker'\"'\"'s Guide to the Galaxy\",\"author\":\"Douglas Adams\",\"release_date\":\"1979-10-12\",\"page_count\":180},{\"name\":\"Snow Crash\",\"author\":\"Neal Stephenson\",\"release_date\":\"1992-06-01\",\"page_count\":470},{\"name\":\"Neuromancer\",\"author\":\"William Gibson\",\"release_date\":\"1984-07-01\",\"page_count\":271},{\"name\":\"The Handmaid'\"'\"'s Tale\",\"author\":\"Margaret Atwood\",\"release_date\":\"1985-06-01\",\"page_count\":311},{\"name\":\"Starship Troopers\",\"author\":\"Robert A. Heinlein\",\"release_date\":\"1959-12-01\",\"page_count\":335},{\"name\":\"The Left Hand of Darkness\",\"author\":\"Ursula K. Le Guin\",\"release_date\":\"1969-06-01\",\"page_count\":304},{\"name\":\"The Moon is a Harsh Mistress\",\"author\":\"Robert A. Heinlein\",\"release_date\":\"1966-04-01\",\"page_count\":288}]' \"$ELASTICSEARCH_URL/_text_structure/find_structure\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -60932,32 +42080,6 @@ } }, "x-state": "Generally available; Added in 8.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _text_structure/test_grok_pattern\n{\n \"grok_pattern\": \"Hello %{WORD:first_name} %{WORD:last_name}\",\n \"text\": [\n \"Hello John Doe\",\n \"this does not match\"\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.text_structure.test_grok_pattern(\n grok_pattern=\"Hello %{WORD:first_name} %{WORD:last_name}\",\n text=[\n \"Hello John Doe\",\n \"this does not match\"\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.textStructure.testGrokPattern({\n grok_pattern: \"Hello %{WORD:first_name} %{WORD:last_name}\",\n text: [\"Hello John Doe\", \"this does not match\"],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.text_structure.test_grok_pattern(\n body: {\n \"grok_pattern\": \"Hello %{WORD:first_name} %{WORD:last_name}\",\n \"text\": [\n \"Hello John Doe\",\n \"this does not match\"\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->textStructure()->testGrokPattern([\n \"body\" => [\n \"grok_pattern\" => \"Hello %{WORD:first_name} %{WORD:last_name}\",\n \"text\" => array(\n \"Hello John Doe\",\n \"this does not match\",\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"grok_pattern\":\"Hello %{WORD:first_name} %{WORD:last_name}\",\"text\":[\"Hello John Doe\",\"this does not match\"]}' \"$ELASTICSEARCH_URL/_text_structure/test_grok_pattern\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -60984,32 +42106,6 @@ } }, "x-state": "Generally available; Added in 8.13.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _text_structure/test_grok_pattern\n{\n \"grok_pattern\": \"Hello %{WORD:first_name} %{WORD:last_name}\",\n \"text\": [\n \"Hello John Doe\",\n \"this does not match\"\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.text_structure.test_grok_pattern(\n grok_pattern=\"Hello %{WORD:first_name} %{WORD:last_name}\",\n text=[\n \"Hello John Doe\",\n \"this does not match\"\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.textStructure.testGrokPattern({\n grok_pattern: \"Hello %{WORD:first_name} %{WORD:last_name}\",\n text: [\"Hello John Doe\", \"this does not match\"],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.text_structure.test_grok_pattern(\n body: {\n \"grok_pattern\": \"Hello %{WORD:first_name} %{WORD:last_name}\",\n \"text\": [\n \"Hello John Doe\",\n \"this does not match\"\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->textStructure()->testGrokPattern([\n \"body\" => [\n \"grok_pattern\" => \"Hello %{WORD:first_name} %{WORD:last_name}\",\n \"text\" => array(\n \"Hello John Doe\",\n \"this does not match\",\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"grok_pattern\":\"Hello %{WORD:first_name} %{WORD:last_name}\",\"text\":[\"Hello John Doe\",\"this does not match\"]}' \"$ELASTICSEARCH_URL/_text_structure/test_grok_pattern\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -61044,32 +42140,6 @@ } }, "x-state": "Generally available; Added in 7.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _transform?size=10\n" - }, - { - "lang": "Python", - "source": "resp = client.transform.get_transform(\n size=\"10\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.getTransform({\n size: 10,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.get_transform(\n size: \"10\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->getTransform([\n \"size\" => \"10\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_transform?size=10\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -61190,32 +42260,6 @@ } }, "x-state": "Generally available; Added in 7.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _transform/ecommerce_transform1\n{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n \"retention_policy\": {\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.transform.put_transform(\n transform_id=\"ecommerce_transform1\",\n source={\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n pivot={\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": True\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n description=\"Maximum priced ecommerce data by customer_id in Asia\",\n dest={\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n frequency=\"5m\",\n sync={\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n retention_policy={\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.putTransform({\n transform_id: \"ecommerce_transform1\",\n source: {\n index: \"kibana_sample_data_ecommerce\",\n query: {\n term: {\n \"geoip.continent_name\": {\n value: \"Asia\",\n },\n },\n },\n },\n pivot: {\n group_by: {\n customer_id: {\n terms: {\n field: \"customer_id\",\n missing_bucket: true,\n },\n },\n },\n aggregations: {\n max_price: {\n max: {\n field: \"taxful_total_price\",\n },\n },\n },\n },\n description: \"Maximum priced ecommerce data by customer_id in Asia\",\n dest: {\n index: \"kibana_sample_data_ecommerce_transform1\",\n pipeline: \"add_timestamp_pipeline\",\n },\n frequency: \"5m\",\n sync: {\n time: {\n field: \"order_date\",\n delay: \"60s\",\n },\n },\n retention_policy: {\n time: {\n field: \"order_date\",\n max_age: \"30d\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.put_transform(\n transform_id: \"ecommerce_transform1\",\n body: {\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n \"retention_policy\": {\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->putTransform([\n \"transform_id\" => \"ecommerce_transform1\",\n \"body\" => [\n \"source\" => [\n \"index\" => \"kibana_sample_data_ecommerce\",\n \"query\" => [\n \"term\" => [\n \"geoip.continent_name\" => [\n \"value\" => \"Asia\",\n ],\n ],\n ],\n ],\n \"pivot\" => [\n \"group_by\" => [\n \"customer_id\" => [\n \"terms\" => [\n \"field\" => \"customer_id\",\n \"missing_bucket\" => true,\n ],\n ],\n ],\n \"aggregations\" => [\n \"max_price\" => [\n \"max\" => [\n \"field\" => \"taxful_total_price\",\n ],\n ],\n ],\n ],\n \"description\" => \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\" => [\n \"index\" => \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\" => \"add_timestamp_pipeline\",\n ],\n \"frequency\" => \"5m\",\n \"sync\" => [\n \"time\" => [\n \"field\" => \"order_date\",\n \"delay\" => \"60s\",\n ],\n ],\n \"retention_policy\" => [\n \"time\" => [\n \"field\" => \"order_date\",\n \"max_age\" => \"30d\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"kibana_sample_data_ecommerce\",\"query\":{\"term\":{\"geoip.continent_name\":{\"value\":\"Asia\"}}}},\"pivot\":{\"group_by\":{\"customer_id\":{\"terms\":{\"field\":\"customer_id\",\"missing_bucket\":true}}},\"aggregations\":{\"max_price\":{\"max\":{\"field\":\"taxful_total_price\"}}}},\"description\":\"Maximum priced ecommerce data by customer_id in Asia\",\"dest\":{\"index\":\"kibana_sample_data_ecommerce_transform1\",\"pipeline\":\"add_timestamp_pipeline\"},\"frequency\":\"5m\",\"sync\":{\"time\":{\"field\":\"order_date\",\"delay\":\"60s\"}},\"retention_policy\":{\"time\":{\"field\":\"order_date\",\"max_age\":\"30d\"}}}' \"$ELASTICSEARCH_URL/_transform/ecommerce_transform1\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -61287,32 +42331,6 @@ } }, "x-state": "Generally available; Added in 7.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _transform/ecommerce_transform\n" - }, - { - "lang": "Python", - "source": "resp = client.transform.delete_transform(\n transform_id=\"ecommerce_transform\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.deleteTransform({\n transform_id: \"ecommerce_transform\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.delete_transform(\n transform_id: \"ecommerce_transform\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->deleteTransform([\n \"transform_id\" => \"ecommerce_transform\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_transform/ecommerce_transform\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -61344,32 +42362,6 @@ } }, "x-state": "Generally available; Added in 7.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _transform?size=10\n" - }, - { - "lang": "Python", - "source": "resp = client.transform.get_transform(\n size=\"10\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.getTransform({\n size: 10,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.get_transform(\n size: \"10\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->getTransform([\n \"size\" => \"10\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_transform?size=10\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -61468,32 +42460,6 @@ } }, "x-state": "Generally available; Added in 7.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _transform/ecommerce-customer-transform/_stats\n" - }, - { - "lang": "Python", - "source": "resp = client.transform.get_transform_stats(\n transform_id=\"ecommerce-customer-transform\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.getTransformStats({\n transform_id: \"ecommerce-customer-transform\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.get_transform_stats(\n transform_id: \"ecommerce-customer-transform\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->getTransformStats([\n \"transform_id\" => \"ecommerce-customer-transform\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_transform/ecommerce-customer-transform/_stats\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -61522,32 +42488,6 @@ } }, "x-state": "Generally available; Added in 7.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _transform/_preview\n{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.transform.preview_transform(\n source={\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n pivot={\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": True\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.previewTransform({\n source: {\n index: \"kibana_sample_data_ecommerce\",\n },\n pivot: {\n group_by: {\n customer_id: {\n terms: {\n field: \"customer_id\",\n missing_bucket: true,\n },\n },\n },\n aggregations: {\n max_price: {\n max: {\n field: \"taxful_total_price\",\n },\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.preview_transform(\n body: {\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->previewTransform([\n \"body\" => [\n \"source\" => [\n \"index\" => \"kibana_sample_data_ecommerce\",\n ],\n \"pivot\" => [\n \"group_by\" => [\n \"customer_id\" => [\n \"terms\" => [\n \"field\" => \"customer_id\",\n \"missing_bucket\" => true,\n ],\n ],\n ],\n \"aggregations\" => [\n \"max_price\" => [\n \"max\" => [\n \"field\" => \"taxful_total_price\",\n ],\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"kibana_sample_data_ecommerce\"},\"pivot\":{\"group_by\":{\"customer_id\":{\"terms\":{\"field\":\"customer_id\",\"missing_bucket\":true}}},\"aggregations\":{\"max_price\":{\"max\":{\"field\":\"taxful_total_price\"}}}}}' \"$ELASTICSEARCH_URL/_transform/_preview\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -61574,32 +42514,6 @@ } }, "x-state": "Generally available; Added in 7.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _transform/_preview\n{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.transform.preview_transform(\n source={\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n pivot={\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": True\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.previewTransform({\n source: {\n index: \"kibana_sample_data_ecommerce\",\n },\n pivot: {\n group_by: {\n customer_id: {\n terms: {\n field: \"customer_id\",\n missing_bucket: true,\n },\n },\n },\n aggregations: {\n max_price: {\n max: {\n field: \"taxful_total_price\",\n },\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.preview_transform(\n body: {\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->previewTransform([\n \"body\" => [\n \"source\" => [\n \"index\" => \"kibana_sample_data_ecommerce\",\n ],\n \"pivot\" => [\n \"group_by\" => [\n \"customer_id\" => [\n \"terms\" => [\n \"field\" => \"customer_id\",\n \"missing_bucket\" => true,\n ],\n ],\n ],\n \"aggregations\" => [\n \"max_price\" => [\n \"max\" => [\n \"field\" => \"taxful_total_price\",\n ],\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"kibana_sample_data_ecommerce\"},\"pivot\":{\"group_by\":{\"customer_id\":{\"terms\":{\"field\":\"customer_id\",\"missing_bucket\":true}}},\"aggregations\":{\"max_price\":{\"max\":{\"field\":\"taxful_total_price\"}}}}}' \"$ELASTICSEARCH_URL/_transform/_preview\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -61625,32 +42539,6 @@ } }, "x-state": "Generally available; Added in 7.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _transform/_preview\n{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.transform.preview_transform(\n source={\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n pivot={\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": True\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.previewTransform({\n source: {\n index: \"kibana_sample_data_ecommerce\",\n },\n pivot: {\n group_by: {\n customer_id: {\n terms: {\n field: \"customer_id\",\n missing_bucket: true,\n },\n },\n },\n aggregations: {\n max_price: {\n max: {\n field: \"taxful_total_price\",\n },\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.preview_transform(\n body: {\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->previewTransform([\n \"body\" => [\n \"source\" => [\n \"index\" => \"kibana_sample_data_ecommerce\",\n ],\n \"pivot\" => [\n \"group_by\" => [\n \"customer_id\" => [\n \"terms\" => [\n \"field\" => \"customer_id\",\n \"missing_bucket\" => true,\n ],\n ],\n ],\n \"aggregations\" => [\n \"max_price\" => [\n \"max\" => [\n \"field\" => \"taxful_total_price\",\n ],\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"kibana_sample_data_ecommerce\"},\"pivot\":{\"group_by\":{\"customer_id\":{\"terms\":{\"field\":\"customer_id\",\"missing_bucket\":true}}},\"aggregations\":{\"max_price\":{\"max\":{\"field\":\"taxful_total_price\"}}}}}' \"$ELASTICSEARCH_URL/_transform/_preview\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -61674,32 +42562,6 @@ } }, "x-state": "Generally available; Added in 7.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _transform/_preview\n{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.transform.preview_transform(\n source={\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n pivot={\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": True\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.previewTransform({\n source: {\n index: \"kibana_sample_data_ecommerce\",\n },\n pivot: {\n group_by: {\n customer_id: {\n terms: {\n field: \"customer_id\",\n missing_bucket: true,\n },\n },\n },\n aggregations: {\n max_price: {\n max: {\n field: \"taxful_total_price\",\n },\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.preview_transform(\n body: {\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->previewTransform([\n \"body\" => [\n \"source\" => [\n \"index\" => \"kibana_sample_data_ecommerce\",\n ],\n \"pivot\" => [\n \"group_by\" => [\n \"customer_id\" => [\n \"terms\" => [\n \"field\" => \"customer_id\",\n \"missing_bucket\" => true,\n ],\n ],\n ],\n \"aggregations\" => [\n \"max_price\" => [\n \"max\" => [\n \"field\" => \"taxful_total_price\",\n ],\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"kibana_sample_data_ecommerce\"},\"pivot\":{\"group_by\":{\"customer_id\":{\"terms\":{\"field\":\"customer_id\",\"missing_bucket\":true}}},\"aggregations\":{\"max_price\":{\"max\":{\"field\":\"taxful_total_price\"}}}}}' \"$ELASTICSEARCH_URL/_transform/_preview\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -61763,32 +42625,6 @@ } }, "x-state": "Generally available; Added in 8.1.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _transform/ecommerce_transform/_reset\n" - }, - { - "lang": "Python", - "source": "resp = client.transform.reset_transform(\n transform_id=\"ecommerce_transform\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.resetTransform({\n transform_id: \"ecommerce_transform\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.reset_transform(\n transform_id: \"ecommerce_transform\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->resetTransform([\n \"transform_id\" => \"ecommerce_transform\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_transform/ecommerce_transform/_reset\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -61842,32 +42678,6 @@ } }, "x-state": "Generally available; Added in 8.7.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _transform/ecommerce_transform/_schedule_now\n" - }, - { - "lang": "Python", - "source": "resp = client.transform.schedule_now_transform(\n transform_id=\"ecommerce_transform\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.scheduleNowTransform({\n transform_id: \"ecommerce_transform\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.schedule_now_transform(\n transform_id: \"ecommerce_transform\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->scheduleNowTransform([\n \"transform_id\" => \"ecommerce_transform\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_transform/ecommerce_transform/_schedule_now\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -61931,32 +42741,6 @@ } }, "x-state": "Generally available; Added in 7.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _transform/ecommerce-customer-transform/_start\n" - }, - { - "lang": "Python", - "source": "resp = client.transform.start_transform(\n transform_id=\"ecommerce-customer-transform\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.startTransform({\n transform_id: \"ecommerce-customer-transform\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.start_transform(\n transform_id: \"ecommerce-customer-transform\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->startTransform([\n \"transform_id\" => \"ecommerce-customer-transform\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_transform/ecommerce-customer-transform/_start\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -62050,32 +42834,6 @@ } }, "x-state": "Generally available; Added in 7.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _transform/ecommerce_transform/_stop\n" - }, - { - "lang": "Python", - "source": "resp = client.transform.stop_transform(\n transform_id=\"ecommerce_transform\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.stopTransform({\n transform_id: \"ecommerce_transform\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.stop_transform(\n transform_id: \"ecommerce_transform\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->stopTransform([\n \"transform_id\" => \"ecommerce_transform\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_transform/ecommerce_transform/_stop\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -62244,32 +43002,6 @@ } }, "x-state": "Generally available; Added in 7.2.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _transform/simple-kibana-ecomm-pivot/_update\n{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n \"retention_policy\": {\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.transform.update_transform(\n transform_id=\"simple-kibana-ecomm-pivot\",\n source={\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n pivot={\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": True\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n description=\"Maximum priced ecommerce data by customer_id in Asia\",\n dest={\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n frequency=\"5m\",\n sync={\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n retention_policy={\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.updateTransform({\n transform_id: \"simple-kibana-ecomm-pivot\",\n source: {\n index: \"kibana_sample_data_ecommerce\",\n query: {\n term: {\n \"geoip.continent_name\": {\n value: \"Asia\",\n },\n },\n },\n },\n pivot: {\n group_by: {\n customer_id: {\n terms: {\n field: \"customer_id\",\n missing_bucket: true,\n },\n },\n },\n aggregations: {\n max_price: {\n max: {\n field: \"taxful_total_price\",\n },\n },\n },\n },\n description: \"Maximum priced ecommerce data by customer_id in Asia\",\n dest: {\n index: \"kibana_sample_data_ecommerce_transform1\",\n pipeline: \"add_timestamp_pipeline\",\n },\n frequency: \"5m\",\n sync: {\n time: {\n field: \"order_date\",\n delay: \"60s\",\n },\n },\n retention_policy: {\n time: {\n field: \"order_date\",\n max_age: \"30d\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.update_transform(\n transform_id: \"simple-kibana-ecomm-pivot\",\n body: {\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n \"retention_policy\": {\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->updateTransform([\n \"transform_id\" => \"simple-kibana-ecomm-pivot\",\n \"body\" => [\n \"source\" => [\n \"index\" => \"kibana_sample_data_ecommerce\",\n \"query\" => [\n \"term\" => [\n \"geoip.continent_name\" => [\n \"value\" => \"Asia\",\n ],\n ],\n ],\n ],\n \"pivot\" => [\n \"group_by\" => [\n \"customer_id\" => [\n \"terms\" => [\n \"field\" => \"customer_id\",\n \"missing_bucket\" => true,\n ],\n ],\n ],\n \"aggregations\" => [\n \"max_price\" => [\n \"max\" => [\n \"field\" => \"taxful_total_price\",\n ],\n ],\n ],\n ],\n \"description\" => \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\" => [\n \"index\" => \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\" => \"add_timestamp_pipeline\",\n ],\n \"frequency\" => \"5m\",\n \"sync\" => [\n \"time\" => [\n \"field\" => \"order_date\",\n \"delay\" => \"60s\",\n ],\n ],\n \"retention_policy\" => [\n \"time\" => [\n \"field\" => \"order_date\",\n \"max_age\" => \"30d\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"kibana_sample_data_ecommerce\",\"query\":{\"term\":{\"geoip.continent_name\":{\"value\":\"Asia\"}}}},\"pivot\":{\"group_by\":{\"customer_id\":{\"terms\":{\"field\":\"customer_id\",\"missing_bucket\":true}}},\"aggregations\":{\"max_price\":{\"max\":{\"field\":\"taxful_total_price\"}}}},\"description\":\"Maximum priced ecommerce data by customer_id in Asia\",\"dest\":{\"index\":\"kibana_sample_data_ecommerce_transform1\",\"pipeline\":\"add_timestamp_pipeline\"},\"frequency\":\"5m\",\"sync\":{\"time\":{\"field\":\"order_date\",\"delay\":\"60s\"}},\"retention_policy\":{\"time\":{\"field\":\"order_date\",\"max_age\":\"30d\"}}}' \"$ELASTICSEARCH_URL/_transform/simple-kibana-ecomm-pivot/_update\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -62341,32 +43073,6 @@ } }, "x-state": "Generally available; Added in 7.16.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _transform/_upgrade\n" - }, - { - "lang": "Python", - "source": "resp = client.transform.upgrade_transforms()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.upgradeTransforms();" - }, - { - "lang": "Ruby", - "source": "response = client.transform.upgrade_transforms" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->upgradeTransforms();" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_transform/_upgrade\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -62647,32 +43353,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST test/_update/1\n{\n \"script\" : {\n \"source\": \"ctx._source.counter += params.count\",\n \"lang\": \"painless\",\n \"params\" : {\n \"count\" : 4\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.update(\n index=\"test\",\n id=\"1\",\n script={\n \"source\": \"ctx._source.counter += params.count\",\n \"lang\": \"painless\",\n \"params\": {\n \"count\": 4\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.update({\n index: \"test\",\n id: 1,\n script: {\n source: \"ctx._source.counter += params.count\",\n lang: \"painless\",\n params: {\n count: 4,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.update(\n index: \"test\",\n id: \"1\",\n body: {\n \"script\": {\n \"source\": \"ctx._source.counter += params.count\",\n \"lang\": \"painless\",\n \"params\": {\n \"count\": 4\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->update([\n \"index\" => \"test\",\n \"id\" => \"1\",\n \"body\" => [\n \"script\" => [\n \"source\" => \"ctx._source.counter += params.count\",\n \"lang\" => \"painless\",\n \"params\" => [\n \"count\" => 4,\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"script\":{\"source\":\"ctx._source.counter += params.count\",\"lang\":\"painless\",\"params\":{\"count\":4}}}' \"$ELASTICSEARCH_URL/test/_update/1\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -63137,32 +43817,6 @@ } }, "x-state": "Generally available; Added in 2.4.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST my-index-000001/_update_by_query?conflicts=proceed\n{\n \"query\": { \n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.update_by_query(\n index=\"my-index-000001\",\n conflicts=\"proceed\",\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.updateByQuery({\n index: \"my-index-000001\",\n conflicts: \"proceed\",\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.update_by_query(\n index: \"my-index-000001\",\n conflicts: \"proceed\",\n body: {\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->updateByQuery([\n \"index\" => \"my-index-000001\",\n \"conflicts\" => \"proceed\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}' \"$ELASTICSEARCH_URL/my-index-000001/_update_by_query?conflicts=proceed\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -63221,32 +43875,6 @@ } }, "x-state": "Generally available; Added in 6.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _update_by_query/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1\n" - }, - { - "lang": "Python", - "source": "resp = client.update_by_query_rethrottle(\n task_id=\"r1A2WoRbTwKZ516z6NEs5A:36619\",\n requests_per_second=\"-1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.updateByQueryRethrottle({\n task_id: \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n requests_per_second: \"-1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.update_by_query_rethrottle(\n task_id: \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n requests_per_second: \"-1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->updateByQueryRethrottle([\n \"task_id\" => \"r1A2WoRbTwKZ516z6NEs5A:36619\",\n \"requests_per_second\" => \"-1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_update_by_query/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -63269,32 +43897,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _watcher/watch/my_watch/_ack\n" - }, - { - "lang": "Python", - "source": "resp = client.watcher.ack_watch(\n watch_id=\"my_watch\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.ackWatch({\n watch_id: \"my_watch\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.ack_watch(\n watch_id: \"my_watch\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->ackWatch([\n \"watch_id\" => \"my_watch\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_watcher/watch/my_watch/_ack\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -63315,32 +43917,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _watcher/watch/my_watch/_ack\n" - }, - { - "lang": "Python", - "source": "resp = client.watcher.ack_watch(\n watch_id=\"my_watch\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.ackWatch({\n watch_id: \"my_watch\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.ack_watch(\n watch_id: \"my_watch\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->ackWatch([\n \"watch_id\" => \"my_watch\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_watcher/watch/my_watch/_ack\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -63366,32 +43942,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _watcher/watch/my_watch/_ack\n" - }, - { - "lang": "Python", - "source": "resp = client.watcher.ack_watch(\n watch_id=\"my_watch\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.ackWatch({\n watch_id: \"my_watch\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.ack_watch(\n watch_id: \"my_watch\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->ackWatch([\n \"watch_id\" => \"my_watch\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_watcher/watch/my_watch/_ack\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -63415,32 +43965,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _watcher/watch/my_watch/_ack\n" - }, - { - "lang": "Python", - "source": "resp = client.watcher.ack_watch(\n watch_id=\"my_watch\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.ackWatch({\n watch_id: \"my_watch\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.ack_watch(\n watch_id: \"my_watch\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->ackWatch([\n \"watch_id\" => \"my_watch\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_watcher/watch/my_watch/_ack\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -63466,32 +43990,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _watcher/watch/my_watch/_activate\n" - }, - { - "lang": "Python", - "source": "resp = client.watcher.activate_watch(\n watch_id=\"my_watch\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.activateWatch({\n watch_id: \"my_watch\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.activate_watch(\n watch_id: \"my_watch\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->activateWatch([\n \"watch_id\" => \"my_watch\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_watcher/watch/my_watch/_activate\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -63515,32 +44013,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _watcher/watch/my_watch/_activate\n" - }, - { - "lang": "Python", - "source": "resp = client.watcher.activate_watch(\n watch_id=\"my_watch\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.activateWatch({\n watch_id: \"my_watch\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.activate_watch(\n watch_id: \"my_watch\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->activateWatch([\n \"watch_id\" => \"my_watch\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_watcher/watch/my_watch/_activate\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -63566,32 +44038,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _watcher/watch/my_watch/_deactivate\n" - }, - { - "lang": "Python", - "source": "resp = client.watcher.deactivate_watch(\n watch_id=\"my_watch\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.deactivateWatch({\n watch_id: \"my_watch\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.deactivate_watch(\n watch_id: \"my_watch\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->deactivateWatch([\n \"watch_id\" => \"my_watch\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_watcher/watch/my_watch/_deactivate\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -63615,32 +44061,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _watcher/watch/my_watch/_deactivate\n" - }, - { - "lang": "Python", - "source": "resp = client.watcher.deactivate_watch(\n watch_id=\"my_watch\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.deactivateWatch({\n watch_id: \"my_watch\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.deactivate_watch(\n watch_id: \"my_watch\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->deactivateWatch([\n \"watch_id\" => \"my_watch\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_watcher/watch/my_watch/_deactivate\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -63711,32 +44131,6 @@ } }, "x-state": "Generally available; Added in 5.6.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _watcher/watch/my_watch\n" - }, - { - "lang": "Python", - "source": "resp = client.watcher.get_watch(\n id=\"my_watch\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.getWatch({\n id: \"my_watch\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.get_watch(\n id: \"my_watch\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->getWatch([\n \"id\" => \"my_watch\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_watcher/watch/my_watch\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -63772,32 +44166,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _watcher/watch/my-watch\n{\n \"trigger\" : {\n \"schedule\" : { \"cron\" : \"0 0/1 * * * ?\" }\n },\n \"input\" : {\n \"search\" : {\n \"request\" : {\n \"indices\" : [\n \"logstash*\"\n ],\n \"body\" : {\n \"query\" : {\n \"bool\" : {\n \"must\" : {\n \"match\": {\n \"response\": 404\n }\n },\n \"filter\" : {\n \"range\": {\n \"@timestamp\": {\n \"from\": \"{{ctx.trigger.scheduled_time}}||-5m\",\n \"to\": \"{{ctx.trigger.triggered_time}}\"\n }\n }\n }\n }\n }\n }\n }\n }\n },\n \"condition\" : {\n \"compare\" : { \"ctx.payload.hits.total\" : { \"gt\" : 0 }}\n },\n \"actions\" : {\n \"email_admin\" : {\n \"email\" : {\n \"to\" : \"admin@domain.host.com\",\n \"subject\" : \"404 recently encountered\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.watcher.put_watch(\n id=\"my-watch\",\n trigger={\n \"schedule\": {\n \"cron\": \"0 0/1 * * * ?\"\n }\n },\n input={\n \"search\": {\n \"request\": {\n \"indices\": [\n \"logstash*\"\n ],\n \"body\": {\n \"query\": {\n \"bool\": {\n \"must\": {\n \"match\": {\n \"response\": 404\n }\n },\n \"filter\": {\n \"range\": {\n \"@timestamp\": {\n \"from\": \"{{ctx.trigger.scheduled_time}}||-5m\",\n \"to\": \"{{ctx.trigger.triggered_time}}\"\n }\n }\n }\n }\n }\n }\n }\n }\n },\n condition={\n \"compare\": {\n \"ctx.payload.hits.total\": {\n \"gt\": 0\n }\n }\n },\n actions={\n \"email_admin\": {\n \"email\": {\n \"to\": \"admin@domain.host.com\",\n \"subject\": \"404 recently encountered\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.putWatch({\n id: \"my-watch\",\n trigger: {\n schedule: {\n cron: \"0 0/1 * * * ?\",\n },\n },\n input: {\n search: {\n request: {\n indices: [\"logstash*\"],\n body: {\n query: {\n bool: {\n must: {\n match: {\n response: 404,\n },\n },\n filter: {\n range: {\n \"@timestamp\": {\n from: \"{{ctx.trigger.scheduled_time}}||-5m\",\n to: \"{{ctx.trigger.triggered_time}}\",\n },\n },\n },\n },\n },\n },\n },\n },\n },\n condition: {\n compare: {\n \"ctx.payload.hits.total\": {\n gt: 0,\n },\n },\n },\n actions: {\n email_admin: {\n email: {\n to: \"admin@domain.host.com\",\n subject: \"404 recently encountered\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.put_watch(\n id: \"my-watch\",\n body: {\n \"trigger\": {\n \"schedule\": {\n \"cron\": \"0 0/1 * * * ?\"\n }\n },\n \"input\": {\n \"search\": {\n \"request\": {\n \"indices\": [\n \"logstash*\"\n ],\n \"body\": {\n \"query\": {\n \"bool\": {\n \"must\": {\n \"match\": {\n \"response\": 404\n }\n },\n \"filter\": {\n \"range\": {\n \"@timestamp\": {\n \"from\": \"{{ctx.trigger.scheduled_time}}||-5m\",\n \"to\": \"{{ctx.trigger.triggered_time}}\"\n }\n }\n }\n }\n }\n }\n }\n }\n },\n \"condition\": {\n \"compare\": {\n \"ctx.payload.hits.total\": {\n \"gt\": 0\n }\n }\n },\n \"actions\": {\n \"email_admin\": {\n \"email\": {\n \"to\": \"admin@domain.host.com\",\n \"subject\": \"404 recently encountered\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->putWatch([\n \"id\" => \"my-watch\",\n \"body\" => [\n \"trigger\" => [\n \"schedule\" => [\n \"cron\" => \"0 0/1 * * * ?\",\n ],\n ],\n \"input\" => [\n \"search\" => [\n \"request\" => [\n \"indices\" => array(\n \"logstash*\",\n ),\n \"body\" => [\n \"query\" => [\n \"bool\" => [\n \"must\" => [\n \"match\" => [\n \"response\" => 404,\n ],\n ],\n \"filter\" => [\n \"range\" => [\n \"@timestamp\" => [\n \"from\" => \"{{ctx.trigger.scheduled_time}}||-5m\",\n \"to\" => \"{{ctx.trigger.triggered_time}}\",\n ],\n ],\n ],\n ],\n ],\n ],\n ],\n ],\n ],\n \"condition\" => [\n \"compare\" => [\n \"ctx.payload.hits.total\" => [\n \"gt\" => 0,\n ],\n ],\n ],\n \"actions\" => [\n \"email_admin\" => [\n \"email\" => [\n \"to\" => \"admin@domain.host.com\",\n \"subject\" => \"404 recently encountered\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"trigger\":{\"schedule\":{\"cron\":\"0 0/1 * * * ?\"}},\"input\":{\"search\":{\"request\":{\"indices\":[\"logstash*\"],\"body\":{\"query\":{\"bool\":{\"must\":{\"match\":{\"response\":404}},\"filter\":{\"range\":{\"@timestamp\":{\"from\":\"{{ctx.trigger.scheduled_time}}||-5m\",\"to\":\"{{ctx.trigger.triggered_time}}\"}}}}}}}}},\"condition\":{\"compare\":{\"ctx.payload.hits.total\":{\"gt\":0}}},\"actions\":{\"email_admin\":{\"email\":{\"to\":\"admin@domain.host.com\",\"subject\":\"404 recently encountered\"}}}}' \"$ELASTICSEARCH_URL/_watcher/watch/my-watch\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -63833,32 +44201,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _watcher/watch/my-watch\n{\n \"trigger\" : {\n \"schedule\" : { \"cron\" : \"0 0/1 * * * ?\" }\n },\n \"input\" : {\n \"search\" : {\n \"request\" : {\n \"indices\" : [\n \"logstash*\"\n ],\n \"body\" : {\n \"query\" : {\n \"bool\" : {\n \"must\" : {\n \"match\": {\n \"response\": 404\n }\n },\n \"filter\" : {\n \"range\": {\n \"@timestamp\": {\n \"from\": \"{{ctx.trigger.scheduled_time}}||-5m\",\n \"to\": \"{{ctx.trigger.triggered_time}}\"\n }\n }\n }\n }\n }\n }\n }\n }\n },\n \"condition\" : {\n \"compare\" : { \"ctx.payload.hits.total\" : { \"gt\" : 0 }}\n },\n \"actions\" : {\n \"email_admin\" : {\n \"email\" : {\n \"to\" : \"admin@domain.host.com\",\n \"subject\" : \"404 recently encountered\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.watcher.put_watch(\n id=\"my-watch\",\n trigger={\n \"schedule\": {\n \"cron\": \"0 0/1 * * * ?\"\n }\n },\n input={\n \"search\": {\n \"request\": {\n \"indices\": [\n \"logstash*\"\n ],\n \"body\": {\n \"query\": {\n \"bool\": {\n \"must\": {\n \"match\": {\n \"response\": 404\n }\n },\n \"filter\": {\n \"range\": {\n \"@timestamp\": {\n \"from\": \"{{ctx.trigger.scheduled_time}}||-5m\",\n \"to\": \"{{ctx.trigger.triggered_time}}\"\n }\n }\n }\n }\n }\n }\n }\n }\n },\n condition={\n \"compare\": {\n \"ctx.payload.hits.total\": {\n \"gt\": 0\n }\n }\n },\n actions={\n \"email_admin\": {\n \"email\": {\n \"to\": \"admin@domain.host.com\",\n \"subject\": \"404 recently encountered\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.putWatch({\n id: \"my-watch\",\n trigger: {\n schedule: {\n cron: \"0 0/1 * * * ?\",\n },\n },\n input: {\n search: {\n request: {\n indices: [\"logstash*\"],\n body: {\n query: {\n bool: {\n must: {\n match: {\n response: 404,\n },\n },\n filter: {\n range: {\n \"@timestamp\": {\n from: \"{{ctx.trigger.scheduled_time}}||-5m\",\n to: \"{{ctx.trigger.triggered_time}}\",\n },\n },\n },\n },\n },\n },\n },\n },\n },\n condition: {\n compare: {\n \"ctx.payload.hits.total\": {\n gt: 0,\n },\n },\n },\n actions: {\n email_admin: {\n email: {\n to: \"admin@domain.host.com\",\n subject: \"404 recently encountered\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.put_watch(\n id: \"my-watch\",\n body: {\n \"trigger\": {\n \"schedule\": {\n \"cron\": \"0 0/1 * * * ?\"\n }\n },\n \"input\": {\n \"search\": {\n \"request\": {\n \"indices\": [\n \"logstash*\"\n ],\n \"body\": {\n \"query\": {\n \"bool\": {\n \"must\": {\n \"match\": {\n \"response\": 404\n }\n },\n \"filter\": {\n \"range\": {\n \"@timestamp\": {\n \"from\": \"{{ctx.trigger.scheduled_time}}||-5m\",\n \"to\": \"{{ctx.trigger.triggered_time}}\"\n }\n }\n }\n }\n }\n }\n }\n }\n },\n \"condition\": {\n \"compare\": {\n \"ctx.payload.hits.total\": {\n \"gt\": 0\n }\n }\n },\n \"actions\": {\n \"email_admin\": {\n \"email\": {\n \"to\": \"admin@domain.host.com\",\n \"subject\": \"404 recently encountered\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->putWatch([\n \"id\" => \"my-watch\",\n \"body\" => [\n \"trigger\" => [\n \"schedule\" => [\n \"cron\" => \"0 0/1 * * * ?\",\n ],\n ],\n \"input\" => [\n \"search\" => [\n \"request\" => [\n \"indices\" => array(\n \"logstash*\",\n ),\n \"body\" => [\n \"query\" => [\n \"bool\" => [\n \"must\" => [\n \"match\" => [\n \"response\" => 404,\n ],\n ],\n \"filter\" => [\n \"range\" => [\n \"@timestamp\" => [\n \"from\" => \"{{ctx.trigger.scheduled_time}}||-5m\",\n \"to\" => \"{{ctx.trigger.triggered_time}}\",\n ],\n ],\n ],\n ],\n ],\n ],\n ],\n ],\n ],\n \"condition\" => [\n \"compare\" => [\n \"ctx.payload.hits.total\" => [\n \"gt\" => 0,\n ],\n ],\n ],\n \"actions\" => [\n \"email_admin\" => [\n \"email\" => [\n \"to\" => \"admin@domain.host.com\",\n \"subject\" => \"404 recently encountered\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"trigger\":{\"schedule\":{\"cron\":\"0 0/1 * * * ?\"}},\"input\":{\"search\":{\"request\":{\"indices\":[\"logstash*\"],\"body\":{\"query\":{\"bool\":{\"must\":{\"match\":{\"response\":404}},\"filter\":{\"range\":{\"@timestamp\":{\"from\":\"{{ctx.trigger.scheduled_time}}||-5m\",\"to\":\"{{ctx.trigger.triggered_time}}\"}}}}}}}}},\"condition\":{\"compare\":{\"ctx.payload.hits.total\":{\"gt\":0}}},\"actions\":{\"email_admin\":{\"email\":{\"to\":\"admin@domain.host.com\",\"subject\":\"404 recently encountered\"}}}}' \"$ELASTICSEARCH_URL/_watcher/watch/my-watch\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -63916,32 +44258,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _watcher/watch/my_watch\n" - }, - { - "lang": "Python", - "source": "resp = client.watcher.delete_watch(\n id=\"my_watch\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.deleteWatch({\n id: \"my_watch\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.delete_watch(\n id: \"my_watch\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->deleteWatch([\n \"id\" => \"my_watch\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_watcher/watch/my_watch\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -63970,32 +44286,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _watcher/watch/my_watch/_execute\n{\n \"trigger_data\" : { \n \"triggered_time\" : \"now\",\n \"scheduled_time\" : \"now\"\n },\n \"alternative_input\" : { \n \"foo\" : \"bar\"\n },\n \"ignore_condition\" : true, \n \"action_modes\" : {\n \"my-action\" : \"force_simulate\" \n },\n \"record_execution\" : true \n}" - }, - { - "lang": "Python", - "source": "resp = client.watcher.execute_watch(\n id=\"my_watch\",\n trigger_data={\n \"triggered_time\": \"now\",\n \"scheduled_time\": \"now\"\n },\n alternative_input={\n \"foo\": \"bar\"\n },\n ignore_condition=True,\n action_modes={\n \"my-action\": \"force_simulate\"\n },\n record_execution=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.executeWatch({\n id: \"my_watch\",\n trigger_data: {\n triggered_time: \"now\",\n scheduled_time: \"now\",\n },\n alternative_input: {\n foo: \"bar\",\n },\n ignore_condition: true,\n action_modes: {\n \"my-action\": \"force_simulate\",\n },\n record_execution: true,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.execute_watch(\n id: \"my_watch\",\n body: {\n \"trigger_data\": {\n \"triggered_time\": \"now\",\n \"scheduled_time\": \"now\"\n },\n \"alternative_input\": {\n \"foo\": \"bar\"\n },\n \"ignore_condition\": true,\n \"action_modes\": {\n \"my-action\": \"force_simulate\"\n },\n \"record_execution\": true\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->executeWatch([\n \"id\" => \"my_watch\",\n \"body\" => [\n \"trigger_data\" => [\n \"triggered_time\" => \"now\",\n \"scheduled_time\" => \"now\",\n ],\n \"alternative_input\" => [\n \"foo\" => \"bar\",\n ],\n \"ignore_condition\" => true,\n \"action_modes\" => [\n \"my-action\" => \"force_simulate\",\n ],\n \"record_execution\" => true,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"trigger_data\":{\"triggered_time\":\"now\",\"scheduled_time\":\"now\"},\"alternative_input\":{\"foo\":\"bar\"},\"ignore_condition\":true,\"action_modes\":{\"my-action\":\"force_simulate\"},\"record_execution\":true}' \"$ELASTICSEARCH_URL/_watcher/watch/my_watch/_execute\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -64022,32 +44312,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _watcher/watch/my_watch/_execute\n{\n \"trigger_data\" : { \n \"triggered_time\" : \"now\",\n \"scheduled_time\" : \"now\"\n },\n \"alternative_input\" : { \n \"foo\" : \"bar\"\n },\n \"ignore_condition\" : true, \n \"action_modes\" : {\n \"my-action\" : \"force_simulate\" \n },\n \"record_execution\" : true \n}" - }, - { - "lang": "Python", - "source": "resp = client.watcher.execute_watch(\n id=\"my_watch\",\n trigger_data={\n \"triggered_time\": \"now\",\n \"scheduled_time\": \"now\"\n },\n alternative_input={\n \"foo\": \"bar\"\n },\n ignore_condition=True,\n action_modes={\n \"my-action\": \"force_simulate\"\n },\n record_execution=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.executeWatch({\n id: \"my_watch\",\n trigger_data: {\n triggered_time: \"now\",\n scheduled_time: \"now\",\n },\n alternative_input: {\n foo: \"bar\",\n },\n ignore_condition: true,\n action_modes: {\n \"my-action\": \"force_simulate\",\n },\n record_execution: true,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.execute_watch(\n id: \"my_watch\",\n body: {\n \"trigger_data\": {\n \"triggered_time\": \"now\",\n \"scheduled_time\": \"now\"\n },\n \"alternative_input\": {\n \"foo\": \"bar\"\n },\n \"ignore_condition\": true,\n \"action_modes\": {\n \"my-action\": \"force_simulate\"\n },\n \"record_execution\": true\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->executeWatch([\n \"id\" => \"my_watch\",\n \"body\" => [\n \"trigger_data\" => [\n \"triggered_time\" => \"now\",\n \"scheduled_time\" => \"now\",\n ],\n \"alternative_input\" => [\n \"foo\" => \"bar\",\n ],\n \"ignore_condition\" => true,\n \"action_modes\" => [\n \"my-action\" => \"force_simulate\",\n ],\n \"record_execution\" => true,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"trigger_data\":{\"triggered_time\":\"now\",\"scheduled_time\":\"now\"},\"alternative_input\":{\"foo\":\"bar\"},\"ignore_condition\":true,\"action_modes\":{\"my-action\":\"force_simulate\"},\"record_execution\":true}' \"$ELASTICSEARCH_URL/_watcher/watch/my_watch/_execute\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -64073,32 +44337,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _watcher/watch/my_watch/_execute\n{\n \"trigger_data\" : { \n \"triggered_time\" : \"now\",\n \"scheduled_time\" : \"now\"\n },\n \"alternative_input\" : { \n \"foo\" : \"bar\"\n },\n \"ignore_condition\" : true, \n \"action_modes\" : {\n \"my-action\" : \"force_simulate\" \n },\n \"record_execution\" : true \n}" - }, - { - "lang": "Python", - "source": "resp = client.watcher.execute_watch(\n id=\"my_watch\",\n trigger_data={\n \"triggered_time\": \"now\",\n \"scheduled_time\": \"now\"\n },\n alternative_input={\n \"foo\": \"bar\"\n },\n ignore_condition=True,\n action_modes={\n \"my-action\": \"force_simulate\"\n },\n record_execution=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.executeWatch({\n id: \"my_watch\",\n trigger_data: {\n triggered_time: \"now\",\n scheduled_time: \"now\",\n },\n alternative_input: {\n foo: \"bar\",\n },\n ignore_condition: true,\n action_modes: {\n \"my-action\": \"force_simulate\",\n },\n record_execution: true,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.execute_watch(\n id: \"my_watch\",\n body: {\n \"trigger_data\": {\n \"triggered_time\": \"now\",\n \"scheduled_time\": \"now\"\n },\n \"alternative_input\": {\n \"foo\": \"bar\"\n },\n \"ignore_condition\": true,\n \"action_modes\": {\n \"my-action\": \"force_simulate\"\n },\n \"record_execution\": true\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->executeWatch([\n \"id\" => \"my_watch\",\n \"body\" => [\n \"trigger_data\" => [\n \"triggered_time\" => \"now\",\n \"scheduled_time\" => \"now\",\n ],\n \"alternative_input\" => [\n \"foo\" => \"bar\",\n ],\n \"ignore_condition\" => true,\n \"action_modes\" => [\n \"my-action\" => \"force_simulate\",\n ],\n \"record_execution\" => true,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"trigger_data\":{\"triggered_time\":\"now\",\"scheduled_time\":\"now\"},\"alternative_input\":{\"foo\":\"bar\"},\"ignore_condition\":true,\"action_modes\":{\"my-action\":\"force_simulate\"},\"record_execution\":true}' \"$ELASTICSEARCH_URL/_watcher/watch/my_watch/_execute\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -64122,32 +44360,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _watcher/watch/my_watch/_execute\n{\n \"trigger_data\" : { \n \"triggered_time\" : \"now\",\n \"scheduled_time\" : \"now\"\n },\n \"alternative_input\" : { \n \"foo\" : \"bar\"\n },\n \"ignore_condition\" : true, \n \"action_modes\" : {\n \"my-action\" : \"force_simulate\" \n },\n \"record_execution\" : true \n}" - }, - { - "lang": "Python", - "source": "resp = client.watcher.execute_watch(\n id=\"my_watch\",\n trigger_data={\n \"triggered_time\": \"now\",\n \"scheduled_time\": \"now\"\n },\n alternative_input={\n \"foo\": \"bar\"\n },\n ignore_condition=True,\n action_modes={\n \"my-action\": \"force_simulate\"\n },\n record_execution=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.executeWatch({\n id: \"my_watch\",\n trigger_data: {\n triggered_time: \"now\",\n scheduled_time: \"now\",\n },\n alternative_input: {\n foo: \"bar\",\n },\n ignore_condition: true,\n action_modes: {\n \"my-action\": \"force_simulate\",\n },\n record_execution: true,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.execute_watch(\n id: \"my_watch\",\n body: {\n \"trigger_data\": {\n \"triggered_time\": \"now\",\n \"scheduled_time\": \"now\"\n },\n \"alternative_input\": {\n \"foo\": \"bar\"\n },\n \"ignore_condition\": true,\n \"action_modes\": {\n \"my-action\": \"force_simulate\"\n },\n \"record_execution\": true\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->executeWatch([\n \"id\" => \"my_watch\",\n \"body\" => [\n \"trigger_data\" => [\n \"triggered_time\" => \"now\",\n \"scheduled_time\" => \"now\",\n ],\n \"alternative_input\" => [\n \"foo\" => \"bar\",\n ],\n \"ignore_condition\" => true,\n \"action_modes\" => [\n \"my-action\" => \"force_simulate\",\n ],\n \"record_execution\" => true,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"trigger_data\":{\"triggered_time\":\"now\",\"scheduled_time\":\"now\"},\"alternative_input\":{\"foo\":\"bar\"},\"ignore_condition\":true,\"action_modes\":{\"my-action\":\"force_simulate\"},\"record_execution\":true}' \"$ELASTICSEARCH_URL/_watcher/watch/my_watch/_execute\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -64198,32 +44410,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_watcher/settings\n" - }, - { - "lang": "Python", - "source": "resp = client.watcher.get_settings()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.getSettings();" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.get_settings" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->getSettings();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_watcher/settings\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -64299,32 +44485,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_watcher/settings\n{\n \"index.auto_expand_replicas\": \"0-4\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.watcher.update_settings(\n index.auto_expand_replicas=\"0-4\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.updateSettings({\n \"index.auto_expand_replicas\": \"0-4\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.update_settings(\n body: {\n \"index.auto_expand_replicas\": \"0-4\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->updateSettings([\n \"body\" => [\n \"index.auto_expand_replicas\" => \"0-4\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index.auto_expand_replicas\":\"0-4\"}' \"$ELASTICSEARCH_URL/_watcher/settings\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -64345,32 +44505,6 @@ } }, "x-state": "Generally available; Added in 7.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_watcher/_query/watches\n" - }, - { - "lang": "Python", - "source": "resp = client.watcher.query_watches()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.queryWatches();" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.query_watches" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->queryWatches();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_watcher/_query/watches\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -64389,32 +44523,6 @@ } }, "x-state": "Generally available; Added in 7.11.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_watcher/_query/watches\n" - }, - { - "lang": "Python", - "source": "resp = client.watcher.query_watches()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.queryWatches();" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.query_watches" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->queryWatches();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_watcher/_query/watches\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -64457,32 +44565,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _watcher/_start\n" - }, - { - "lang": "Python", - "source": "resp = client.watcher.start()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.start();" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.start" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->start();" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_watcher/_start\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -64508,32 +44590,6 @@ } }, "x-state": "Generally available; Added in 5.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _watcher/stats\n" - }, - { - "lang": "Python", - "source": "resp = client.watcher.stats()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.stats();" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.stats" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->stats();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_watcher/stats\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -64562,32 +44618,6 @@ } }, "x-state": "Generally available; Added in 5.5.0", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _watcher/stats\n" - }, - { - "lang": "Python", - "source": "resp = client.watcher.stats()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.stats();" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.stats" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->stats();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_watcher/stats\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -64630,32 +44660,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _watcher/_stop\n" - }, - { - "lang": "Python", - "source": "resp = client.watcher.stop()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.watcher.stop();" - }, - { - "lang": "Ruby", - "source": "response = client.watcher.stop" - }, - { - "lang": "PHP", - "source": "$resp = $client->watcher()->stop();" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_watcher/_stop\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -64741,32 +44745,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_xpack\n" - }, - { - "lang": "Python", - "source": "resp = client.xpack.info()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.xpack.info();" - }, - { - "lang": "Ruby", - "source": "response = client.xpack.info" - }, - { - "lang": "PHP", - "source": "$resp = $client->xpack()->info();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_xpack\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -64917,32 +44895,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_xpack/usage\n" - }, - { - "lang": "Python", - "source": "resp = client.xpack.usage()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.xpack.usage();" - }, - { - "lang": "Ruby", - "source": "response = client.xpack.usage" - }, - { - "lang": "PHP", - "source": "$resp = $client->xpack()->usage();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_xpack/usage\"" - } - ], "x-product-feature": "elasticsearch" } } @@ -88921,6 +68873,7 @@ ] }, "_types.NodeRoles": { + "description": "* @doc_id node-roles", "type": "array", "items": { "$ref": "#/components/schemas/_types.NodeRole" diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 639c2c010c..ed74ff7049 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -79,32 +79,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_async_search/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\n" - }, - { - "lang": "Python", - "source": "resp = client.async_search.get(\n id=\"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.asyncSearch.get({\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.async_search.get(\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->asyncSearch()->get([\n \"id\" => \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_async_search/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -140,32 +114,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_async_search/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\n" - }, - { - "lang": "Python", - "source": "resp = client.async_search.delete(\n id=\"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.asyncSearch.delete({\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.async_search.delete(\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->asyncSearch()->delete([\n \"id\" => \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_async_search/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -230,32 +178,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_async_search/status/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\n" - }, - { - "lang": "Python", - "source": "resp = client.async_search.status(\n id=\"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.asyncSearch.status({\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.async_search.status(\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->asyncSearch()->status([\n \"id\" => \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_async_search/status/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -407,32 +329,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /sales*/_async_search?size=0\n{\n \"sort\": [\n { \"date\": { \"order\": \"asc\" } }\n ],\n \"aggs\": {\n \"sale_date\": {\n \"date_histogram\": {\n \"field\": \"date\",\n \"calendar_interval\": \"1d\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.async_search.submit(\n index=\"sales*\",\n size=\"0\",\n sort=[\n {\n \"date\": {\n \"order\": \"asc\"\n }\n }\n ],\n aggs={\n \"sale_date\": {\n \"date_histogram\": {\n \"field\": \"date\",\n \"calendar_interval\": \"1d\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.asyncSearch.submit({\n index: \"sales*\",\n size: 0,\n sort: [\n {\n date: {\n order: \"asc\",\n },\n },\n ],\n aggs: {\n sale_date: {\n date_histogram: {\n field: \"date\",\n calendar_interval: \"1d\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.async_search.submit(\n index: \"sales*\",\n size: \"0\",\n body: {\n \"sort\": [\n {\n \"date\": {\n \"order\": \"asc\"\n }\n }\n ],\n \"aggs\": {\n \"sale_date\": {\n \"date_histogram\": {\n \"field\": \"date\",\n \"calendar_interval\": \"1d\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->asyncSearch()->submit([\n \"index\" => \"sales*\",\n \"size\" => \"0\",\n \"body\" => [\n \"sort\" => array(\n [\n \"date\" => [\n \"order\" => \"asc\",\n ],\n ],\n ),\n \"aggs\" => [\n \"sale_date\" => [\n \"date_histogram\" => [\n \"field\" => \"date\",\n \"calendar_interval\" => \"1d\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"sort\":[{\"date\":{\"order\":\"asc\"}}],\"aggs\":{\"sale_date\":{\"date_histogram\":{\"field\":\"date\",\"calendar_interval\":\"1d\"}}}}' \"$ELASTICSEARCH_URL/sales*/_async_search?size=0\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -587,32 +483,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /sales*/_async_search?size=0\n{\n \"sort\": [\n { \"date\": { \"order\": \"asc\" } }\n ],\n \"aggs\": {\n \"sale_date\": {\n \"date_histogram\": {\n \"field\": \"date\",\n \"calendar_interval\": \"1d\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.async_search.submit(\n index=\"sales*\",\n size=\"0\",\n sort=[\n {\n \"date\": {\n \"order\": \"asc\"\n }\n }\n ],\n aggs={\n \"sale_date\": {\n \"date_histogram\": {\n \"field\": \"date\",\n \"calendar_interval\": \"1d\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.asyncSearch.submit({\n index: \"sales*\",\n size: 0,\n sort: [\n {\n date: {\n order: \"asc\",\n },\n },\n ],\n aggs: {\n sale_date: {\n date_histogram: {\n field: \"date\",\n calendar_interval: \"1d\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.async_search.submit(\n index: \"sales*\",\n size: \"0\",\n body: {\n \"sort\": [\n {\n \"date\": {\n \"order\": \"asc\"\n }\n }\n ],\n \"aggs\": {\n \"sale_date\": {\n \"date_histogram\": {\n \"field\": \"date\",\n \"calendar_interval\": \"1d\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->asyncSearch()->submit([\n \"index\" => \"sales*\",\n \"size\" => \"0\",\n \"body\" => [\n \"sort\" => array(\n [\n \"date\" => [\n \"order\" => \"asc\",\n ],\n ],\n ),\n \"aggs\" => [\n \"sale_date\" => [\n \"date_histogram\" => [\n \"field\" => \"date\",\n \"calendar_interval\" => \"1d\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"sort\":[{\"date\":{\"order\":\"asc\"}}],\"aggs\":{\"sale_date\":{\"date_histogram\":{\"field\":\"date\",\"calendar_interval\":\"1d\"}}}}' \"$ELASTICSEARCH_URL/sales*/_async_search?size=0\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -674,32 +544,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _bulk\n{ \"index\" : { \"_index\" : \"test\", \"_id\" : \"1\" } }\n{ \"field1\" : \"value1\" }\n{ \"delete\" : { \"_index\" : \"test\", \"_id\" : \"2\" } }\n{ \"create\" : { \"_index\" : \"test\", \"_id\" : \"3\" } }\n{ \"field1\" : \"value3\" }\n{ \"update\" : {\"_id\" : \"1\", \"_index\" : \"test\"} }\n{ \"doc\" : {\"field2\" : \"value2\"} }" - }, - { - "lang": "Python", - "source": "resp = client.bulk(\n operations=[\n {\n \"index\": {\n \"_index\": \"test\",\n \"_id\": \"1\"\n }\n },\n {\n \"field1\": \"value1\"\n },\n {\n \"delete\": {\n \"_index\": \"test\",\n \"_id\": \"2\"\n }\n },\n {\n \"create\": {\n \"_index\": \"test\",\n \"_id\": \"3\"\n }\n },\n {\n \"field1\": \"value3\"\n },\n {\n \"update\": {\n \"_id\": \"1\",\n \"_index\": \"test\"\n }\n },\n {\n \"doc\": {\n \"field2\": \"value2\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.bulk({\n operations: [\n {\n index: {\n _index: \"test\",\n _id: \"1\",\n },\n },\n {\n field1: \"value1\",\n },\n {\n delete: {\n _index: \"test\",\n _id: \"2\",\n },\n },\n {\n create: {\n _index: \"test\",\n _id: \"3\",\n },\n },\n {\n field1: \"value3\",\n },\n {\n update: {\n _id: \"1\",\n _index: \"test\",\n },\n },\n {\n doc: {\n field2: \"value2\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.bulk(\n body: [\n {\n \"index\": {\n \"_index\": \"test\",\n \"_id\": \"1\"\n }\n },\n {\n \"field1\": \"value1\"\n },\n {\n \"delete\": {\n \"_index\": \"test\",\n \"_id\": \"2\"\n }\n },\n {\n \"create\": {\n \"_index\": \"test\",\n \"_id\": \"3\"\n }\n },\n {\n \"field1\": \"value3\"\n },\n {\n \"update\": {\n \"_id\": \"1\",\n \"_index\": \"test\"\n }\n },\n {\n \"doc\": {\n \"field2\": \"value2\"\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->bulk([\n \"body\" => array(\n [\n \"index\" => [\n \"_index\" => \"test\",\n \"_id\" => \"1\",\n ],\n ],\n [\n \"field1\" => \"value1\",\n ],\n [\n \"delete\" => [\n \"_index\" => \"test\",\n \"_id\" => \"2\",\n ],\n ],\n [\n \"create\" => [\n \"_index\" => \"test\",\n \"_id\" => \"3\",\n ],\n ],\n [\n \"field1\" => \"value3\",\n ],\n [\n \"update\" => [\n \"_id\" => \"1\",\n \"_index\" => \"test\",\n ],\n ],\n [\n \"doc\" => [\n \"field2\" => \"value2\",\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{\"index\":{\"_index\":\"test\",\"_id\":\"1\"}},{\"field1\":\"value1\"},{\"delete\":{\"_index\":\"test\",\"_id\":\"2\"}},{\"create\":{\"_index\":\"test\",\"_id\":\"3\"}},{\"field1\":\"value3\"},{\"update\":{\"_id\":\"1\",\"_index\":\"test\"}},{\"doc\":{\"field2\":\"value2\"}}]' \"$ELASTICSEARCH_URL/_bulk\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -759,32 +603,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _bulk\n{ \"index\" : { \"_index\" : \"test\", \"_id\" : \"1\" } }\n{ \"field1\" : \"value1\" }\n{ \"delete\" : { \"_index\" : \"test\", \"_id\" : \"2\" } }\n{ \"create\" : { \"_index\" : \"test\", \"_id\" : \"3\" } }\n{ \"field1\" : \"value3\" }\n{ \"update\" : {\"_id\" : \"1\", \"_index\" : \"test\"} }\n{ \"doc\" : {\"field2\" : \"value2\"} }" - }, - { - "lang": "Python", - "source": "resp = client.bulk(\n operations=[\n {\n \"index\": {\n \"_index\": \"test\",\n \"_id\": \"1\"\n }\n },\n {\n \"field1\": \"value1\"\n },\n {\n \"delete\": {\n \"_index\": \"test\",\n \"_id\": \"2\"\n }\n },\n {\n \"create\": {\n \"_index\": \"test\",\n \"_id\": \"3\"\n }\n },\n {\n \"field1\": \"value3\"\n },\n {\n \"update\": {\n \"_id\": \"1\",\n \"_index\": \"test\"\n }\n },\n {\n \"doc\": {\n \"field2\": \"value2\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.bulk({\n operations: [\n {\n index: {\n _index: \"test\",\n _id: \"1\",\n },\n },\n {\n field1: \"value1\",\n },\n {\n delete: {\n _index: \"test\",\n _id: \"2\",\n },\n },\n {\n create: {\n _index: \"test\",\n _id: \"3\",\n },\n },\n {\n field1: \"value3\",\n },\n {\n update: {\n _id: \"1\",\n _index: \"test\",\n },\n },\n {\n doc: {\n field2: \"value2\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.bulk(\n body: [\n {\n \"index\": {\n \"_index\": \"test\",\n \"_id\": \"1\"\n }\n },\n {\n \"field1\": \"value1\"\n },\n {\n \"delete\": {\n \"_index\": \"test\",\n \"_id\": \"2\"\n }\n },\n {\n \"create\": {\n \"_index\": \"test\",\n \"_id\": \"3\"\n }\n },\n {\n \"field1\": \"value3\"\n },\n {\n \"update\": {\n \"_id\": \"1\",\n \"_index\": \"test\"\n }\n },\n {\n \"doc\": {\n \"field2\": \"value2\"\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->bulk([\n \"body\" => array(\n [\n \"index\" => [\n \"_index\" => \"test\",\n \"_id\" => \"1\",\n ],\n ],\n [\n \"field1\" => \"value1\",\n ],\n [\n \"delete\" => [\n \"_index\" => \"test\",\n \"_id\" => \"2\",\n ],\n ],\n [\n \"create\" => [\n \"_index\" => \"test\",\n \"_id\" => \"3\",\n ],\n ],\n [\n \"field1\" => \"value3\",\n ],\n [\n \"update\" => [\n \"_id\" => \"1\",\n \"_index\" => \"test\",\n ],\n ],\n [\n \"doc\" => [\n \"field2\" => \"value2\",\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{\"index\":{\"_index\":\"test\",\"_id\":\"1\"}},{\"field1\":\"value1\"},{\"delete\":{\"_index\":\"test\",\"_id\":\"2\"}},{\"create\":{\"_index\":\"test\",\"_id\":\"3\"}},{\"field1\":\"value3\"},{\"update\":{\"_id\":\"1\",\"_index\":\"test\"}},{\"doc\":{\"field2\":\"value2\"}}]' \"$ELASTICSEARCH_URL/_bulk\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -849,32 +667,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _bulk\n{ \"index\" : { \"_index\" : \"test\", \"_id\" : \"1\" } }\n{ \"field1\" : \"value1\" }\n{ \"delete\" : { \"_index\" : \"test\", \"_id\" : \"2\" } }\n{ \"create\" : { \"_index\" : \"test\", \"_id\" : \"3\" } }\n{ \"field1\" : \"value3\" }\n{ \"update\" : {\"_id\" : \"1\", \"_index\" : \"test\"} }\n{ \"doc\" : {\"field2\" : \"value2\"} }" - }, - { - "lang": "Python", - "source": "resp = client.bulk(\n operations=[\n {\n \"index\": {\n \"_index\": \"test\",\n \"_id\": \"1\"\n }\n },\n {\n \"field1\": \"value1\"\n },\n {\n \"delete\": {\n \"_index\": \"test\",\n \"_id\": \"2\"\n }\n },\n {\n \"create\": {\n \"_index\": \"test\",\n \"_id\": \"3\"\n }\n },\n {\n \"field1\": \"value3\"\n },\n {\n \"update\": {\n \"_id\": \"1\",\n \"_index\": \"test\"\n }\n },\n {\n \"doc\": {\n \"field2\": \"value2\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.bulk({\n operations: [\n {\n index: {\n _index: \"test\",\n _id: \"1\",\n },\n },\n {\n field1: \"value1\",\n },\n {\n delete: {\n _index: \"test\",\n _id: \"2\",\n },\n },\n {\n create: {\n _index: \"test\",\n _id: \"3\",\n },\n },\n {\n field1: \"value3\",\n },\n {\n update: {\n _id: \"1\",\n _index: \"test\",\n },\n },\n {\n doc: {\n field2: \"value2\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.bulk(\n body: [\n {\n \"index\": {\n \"_index\": \"test\",\n \"_id\": \"1\"\n }\n },\n {\n \"field1\": \"value1\"\n },\n {\n \"delete\": {\n \"_index\": \"test\",\n \"_id\": \"2\"\n }\n },\n {\n \"create\": {\n \"_index\": \"test\",\n \"_id\": \"3\"\n }\n },\n {\n \"field1\": \"value3\"\n },\n {\n \"update\": {\n \"_id\": \"1\",\n \"_index\": \"test\"\n }\n },\n {\n \"doc\": {\n \"field2\": \"value2\"\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->bulk([\n \"body\" => array(\n [\n \"index\" => [\n \"_index\" => \"test\",\n \"_id\" => \"1\",\n ],\n ],\n [\n \"field1\" => \"value1\",\n ],\n [\n \"delete\" => [\n \"_index\" => \"test\",\n \"_id\" => \"2\",\n ],\n ],\n [\n \"create\" => [\n \"_index\" => \"test\",\n \"_id\" => \"3\",\n ],\n ],\n [\n \"field1\" => \"value3\",\n ],\n [\n \"update\" => [\n \"_id\" => \"1\",\n \"_index\" => \"test\",\n ],\n ],\n [\n \"doc\" => [\n \"field2\" => \"value2\",\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{\"index\":{\"_index\":\"test\",\"_id\":\"1\"}},{\"field1\":\"value1\"},{\"delete\":{\"_index\":\"test\",\"_id\":\"2\"}},{\"create\":{\"_index\":\"test\",\"_id\":\"3\"}},{\"field1\":\"value3\"},{\"update\":{\"_id\":\"1\",\"_index\":\"test\"}},{\"doc\":{\"field2\":\"value2\"}}]' \"$ELASTICSEARCH_URL/_bulk\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -937,32 +729,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _bulk\n{ \"index\" : { \"_index\" : \"test\", \"_id\" : \"1\" } }\n{ \"field1\" : \"value1\" }\n{ \"delete\" : { \"_index\" : \"test\", \"_id\" : \"2\" } }\n{ \"create\" : { \"_index\" : \"test\", \"_id\" : \"3\" } }\n{ \"field1\" : \"value3\" }\n{ \"update\" : {\"_id\" : \"1\", \"_index\" : \"test\"} }\n{ \"doc\" : {\"field2\" : \"value2\"} }" - }, - { - "lang": "Python", - "source": "resp = client.bulk(\n operations=[\n {\n \"index\": {\n \"_index\": \"test\",\n \"_id\": \"1\"\n }\n },\n {\n \"field1\": \"value1\"\n },\n {\n \"delete\": {\n \"_index\": \"test\",\n \"_id\": \"2\"\n }\n },\n {\n \"create\": {\n \"_index\": \"test\",\n \"_id\": \"3\"\n }\n },\n {\n \"field1\": \"value3\"\n },\n {\n \"update\": {\n \"_id\": \"1\",\n \"_index\": \"test\"\n }\n },\n {\n \"doc\": {\n \"field2\": \"value2\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.bulk({\n operations: [\n {\n index: {\n _index: \"test\",\n _id: \"1\",\n },\n },\n {\n field1: \"value1\",\n },\n {\n delete: {\n _index: \"test\",\n _id: \"2\",\n },\n },\n {\n create: {\n _index: \"test\",\n _id: \"3\",\n },\n },\n {\n field1: \"value3\",\n },\n {\n update: {\n _id: \"1\",\n _index: \"test\",\n },\n },\n {\n doc: {\n field2: \"value2\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.bulk(\n body: [\n {\n \"index\": {\n \"_index\": \"test\",\n \"_id\": \"1\"\n }\n },\n {\n \"field1\": \"value1\"\n },\n {\n \"delete\": {\n \"_index\": \"test\",\n \"_id\": \"2\"\n }\n },\n {\n \"create\": {\n \"_index\": \"test\",\n \"_id\": \"3\"\n }\n },\n {\n \"field1\": \"value3\"\n },\n {\n \"update\": {\n \"_id\": \"1\",\n \"_index\": \"test\"\n }\n },\n {\n \"doc\": {\n \"field2\": \"value2\"\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->bulk([\n \"body\" => array(\n [\n \"index\" => [\n \"_index\" => \"test\",\n \"_id\" => \"1\",\n ],\n ],\n [\n \"field1\" => \"value1\",\n ],\n [\n \"delete\" => [\n \"_index\" => \"test\",\n \"_id\" => \"2\",\n ],\n ],\n [\n \"create\" => [\n \"_index\" => \"test\",\n \"_id\" => \"3\",\n ],\n ],\n [\n \"field1\" => \"value3\",\n ],\n [\n \"update\" => [\n \"_id\" => \"1\",\n \"_index\" => \"test\",\n ],\n ],\n [\n \"doc\" => [\n \"field2\" => \"value2\",\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{\"index\":{\"_index\":\"test\",\"_id\":\"1\"}},{\"field1\":\"value1\"},{\"delete\":{\"_index\":\"test\",\"_id\":\"2\"}},{\"create\":{\"_index\":\"test\",\"_id\":\"3\"}},{\"field1\":\"value3\"},{\"update\":{\"_id\":\"1\",\"_index\":\"test\"}},{\"doc\":{\"field2\":\"value2\"}}]' \"$ELASTICSEARCH_URL/_bulk\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -994,32 +760,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/aliases?format=json&v=true\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.aliases(\n format=\"json\",\n v=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.aliases({\n format: \"json\",\n v: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.aliases(\n format: \"json\",\n v: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->aliases([\n \"format\" => \"json\",\n \"v\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/aliases?format=json&v=true\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1054,32 +794,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/aliases?format=json&v=true\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.aliases(\n format=\"json\",\n v=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.aliases({\n format: \"json\",\n v: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.aliases(\n format: \"json\",\n v: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->aliases([\n \"format\" => \"json\",\n \"v\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/aliases?format=json&v=true\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1111,32 +825,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/component_templates/my-template-*?v=true&s=name&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.component_templates(\n name=\"my-template-*\",\n v=True,\n s=\"name\",\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.componentTemplates({\n name: \"my-template-*\",\n v: \"true\",\n s: \"name\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.component_templates(\n name: \"my-template-*\",\n v: \"true\",\n s: \"name\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->componentTemplates([\n \"name\" => \"my-template-*\",\n \"v\" => \"true\",\n \"s\" => \"name\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/component_templates/my-template-*?v=true&s=name&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1171,32 +859,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/component_templates/my-template-*?v=true&s=name&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.component_templates(\n name=\"my-template-*\",\n v=True,\n s=\"name\",\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.componentTemplates({\n name: \"my-template-*\",\n v: \"true\",\n s: \"name\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.component_templates(\n name: \"my-template-*\",\n v: \"true\",\n s: \"name\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->componentTemplates([\n \"name\" => \"my-template-*\",\n \"v\" => \"true\",\n \"s\" => \"name\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/component_templates/my-template-*?v=true&s=name&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1222,32 +884,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/count/my-index-000001?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.count(\n index=\"my-index-000001\",\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.count({\n index: \"my-index-000001\",\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.count(\n index: \"my-index-000001\",\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->count([\n \"index\" => \"my-index-000001\",\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/count/my-index-000001?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1276,32 +912,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/count/my-index-000001?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.count(\n index=\"my-index-000001\",\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.count({\n index: \"my-index-000001\",\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.count(\n index: \"my-index-000001\",\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->count([\n \"index\" => \"my-index-000001\",\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/count/my-index-000001?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1372,32 +982,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/indices/my-index-*?v=true&s=index&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.indices(\n index=\"my-index-*\",\n v=True,\n s=\"index\",\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.indices({\n index: \"my-index-*\",\n v: \"true\",\n s: \"index\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.indices(\n index: \"my-index-*\",\n v: \"true\",\n s: \"index\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->indices([\n \"index\" => \"my-index-*\",\n \"v\" => \"true\",\n \"s\" => \"index\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/indices/my-index-*?v=true&s=index&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1447,32 +1031,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/indices/my-index-*?v=true&s=index&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.indices(\n index=\"my-index-*\",\n v=True,\n s=\"index\",\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.indices({\n index: \"my-index-*\",\n v: \"true\",\n s: \"index\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.indices(\n index: \"my-index-*\",\n v: \"true\",\n s: \"index\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->indices([\n \"index\" => \"my-index-*\",\n \"v\" => \"true\",\n \"s\" => \"index\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/indices/my-index-*?v=true&s=index&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1507,32 +1065,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/ml/data_frame/analytics?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.ml_data_frame_analytics(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.mlDataFrameAnalytics({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.ml_data_frame_analytics(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->mlDataFrameAnalytics([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/ml/data_frame/analytics?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1570,32 +1102,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/ml/data_frame/analytics?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.ml_data_frame_analytics(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.mlDataFrameAnalytics({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.ml_data_frame_analytics(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->mlDataFrameAnalytics([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/ml/data_frame/analytics?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1627,32 +1133,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/ml/datafeeds?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.ml_datafeeds(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.mlDatafeeds({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.ml_datafeeds(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->mlDatafeeds([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/ml/datafeeds?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1687,32 +1167,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/ml/datafeeds?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.ml_datafeeds(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.mlDatafeeds({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.ml_datafeeds(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->mlDatafeeds([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/ml/datafeeds?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1747,32 +1201,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/ml/anomaly_detectors?h=id,s,dpr,mb&v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.ml_jobs(\n h=\"id,s,dpr,mb\",\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.mlJobs({\n h: \"id,s,dpr,mb\",\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.ml_jobs(\n h: \"id,s,dpr,mb\",\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->mlJobs([\n \"h\" => \"id,s,dpr,mb\",\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/ml/anomaly_detectors?h=id,s,dpr,mb&v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1810,32 +1238,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/ml/anomaly_detectors?h=id,s,dpr,mb&v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.ml_jobs(\n h=\"id,s,dpr,mb\",\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.mlJobs({\n h: \"id,s,dpr,mb\",\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.ml_jobs(\n h: \"id,s,dpr,mb\",\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->mlJobs([\n \"h\" => \"id,s,dpr,mb\",\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/ml/anomaly_detectors?h=id,s,dpr,mb&v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1876,32 +1278,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/ml/trained_models?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.ml_trained_models(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.mlTrainedModels({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.ml_trained_models(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->mlTrainedModels([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/ml/trained_models?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -1945,32 +1321,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _cat/ml/trained_models?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.ml_trained_models(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.mlTrainedModels({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.ml_trained_models(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->mlTrainedModels([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/ml/trained_models?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -2008,32 +1358,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/transforms?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.transforms(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.transforms({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.transforms(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->transforms([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/transforms?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -2074,32 +1398,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_cat/transforms?v=true&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.cat.transforms(\n v=True,\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cat.transforms({\n v: \"true\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cat.transforms(\n v: \"true\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cat()->transforms([\n \"v\" => \"true\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_cat/transforms?v=true&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -2134,32 +1432,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_search/scroll\n{\n \"scroll_id\" : \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.scroll(\n scroll_id=\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.scroll({\n scroll_id: \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.scroll(\n body: {\n \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->scroll([\n \"body\" => [\n \"scroll_id\" => \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"scroll_id\":\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"}' \"$ELASTICSEARCH_URL/_search/scroll\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -2192,32 +1464,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_search/scroll\n{\n \"scroll_id\" : \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.scroll(\n scroll_id=\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.scroll({\n scroll_id: \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.scroll(\n body: {\n \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->scroll([\n \"body\" => [\n \"scroll_id\" => \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"scroll_id\":\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"}' \"$ELASTICSEARCH_URL/_search/scroll\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -2239,32 +1485,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_search/scroll\n{\n \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.clear_scroll(\n scroll_id=\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.clearScroll({\n scroll_id: \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.clear_scroll(\n body: {\n \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->clearScroll([\n \"body\" => [\n \"scroll_id\" => \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"scroll_id\":\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"}' \"$ELASTICSEARCH_URL/_search/scroll\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -2302,32 +1522,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_search/scroll\n{\n \"scroll_id\" : \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.scroll(\n scroll_id=\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.scroll({\n scroll_id: \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.scroll(\n body: {\n \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->scroll([\n \"body\" => [\n \"scroll_id\" => \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"scroll_id\":\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"}' \"$ELASTICSEARCH_URL/_search/scroll\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -2363,32 +1557,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_search/scroll\n{\n \"scroll_id\" : \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.scroll(\n scroll_id=\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.scroll({\n scroll_id: \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.scroll(\n body: {\n \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->scroll([\n \"body\" => [\n \"scroll_id\" => \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"scroll_id\":\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"}' \"$ELASTICSEARCH_URL/_search/scroll\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -2415,32 +1583,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_search/scroll\n{\n \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.clear_scroll(\n scroll_id=\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.clearScroll({\n scroll_id: \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.clear_scroll(\n body: {\n \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->clearScroll([\n \"body\" => [\n \"scroll_id\" => \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"scroll_id\":\"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"}' \"$ELASTICSEARCH_URL/_search/scroll\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -2508,32 +1650,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_pit\n{\n \"id\": \"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.close_point_in_time(\n id=\"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.closePointInTime({\n id: \"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.close_point_in_time(\n body: {\n \"id\": \"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->closePointInTime([\n \"body\" => [\n \"id\" => \"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"id\":\"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\"}' \"$ELASTICSEARCH_URL/_pit\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -2568,32 +1684,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_component_template/template_1\n" - }, - { - "lang": "Python", - "source": "resp = client.cluster.get_component_template(\n name=\"template_1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.getComponentTemplate({\n name: \"template_1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.get_component_template(\n name: \"template_1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->getComponentTemplate([\n \"name\" => \"template_1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_component_template/template_1\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -2623,32 +1713,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _component_template/template_1\n{\n \"template\": null,\n \"settings\": {\n \"number_of_shards\": 1\n },\n \"mappings\": {\n \"_source\": {\n \"enabled\": false\n },\n \"properties\": {\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.cluster.put_component_template(\n name=\"template_1\",\n template=None,\n settings={\n \"number_of_shards\": 1\n },\n mappings={\n \"_source\": {\n \"enabled\": False\n },\n \"properties\": {\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.putComponentTemplate({\n name: \"template_1\",\n template: null,\n settings: {\n number_of_shards: 1,\n },\n mappings: {\n _source: {\n enabled: false,\n },\n properties: {\n host_name: {\n type: \"keyword\",\n },\n created_at: {\n type: \"date\",\n format: \"EEE MMM dd HH:mm:ss Z yyyy\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.put_component_template(\n name: \"template_1\",\n body: {\n \"template\": nil,\n \"settings\": {\n \"number_of_shards\": 1\n },\n \"mappings\": {\n \"_source\": {\n \"enabled\": false\n },\n \"properties\": {\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->putComponentTemplate([\n \"name\" => \"template_1\",\n \"body\" => [\n \"template\" => null,\n \"settings\" => [\n \"number_of_shards\" => 1,\n ],\n \"mappings\" => [\n \"_source\" => [\n \"enabled\" => false,\n ],\n \"properties\" => [\n \"host_name\" => [\n \"type\" => \"keyword\",\n ],\n \"created_at\" => [\n \"type\" => \"date\",\n \"format\" => \"EEE MMM dd HH:mm:ss Z yyyy\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"template\":null,\"settings\":{\"number_of_shards\":1},\"mappings\":{\"_source\":{\"enabled\":false},\"properties\":{\"host_name\":{\"type\":\"keyword\"},\"created_at\":{\"type\":\"date\",\"format\":\"EEE MMM dd HH:mm:ss Z yyyy\"}}}}' \"$ELASTICSEARCH_URL/_component_template/template_1\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -2678,32 +1742,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _component_template/template_1\n{\n \"template\": null,\n \"settings\": {\n \"number_of_shards\": 1\n },\n \"mappings\": {\n \"_source\": {\n \"enabled\": false\n },\n \"properties\": {\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.cluster.put_component_template(\n name=\"template_1\",\n template=None,\n settings={\n \"number_of_shards\": 1\n },\n mappings={\n \"_source\": {\n \"enabled\": False\n },\n \"properties\": {\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.putComponentTemplate({\n name: \"template_1\",\n template: null,\n settings: {\n number_of_shards: 1,\n },\n mappings: {\n _source: {\n enabled: false,\n },\n properties: {\n host_name: {\n type: \"keyword\",\n },\n created_at: {\n type: \"date\",\n format: \"EEE MMM dd HH:mm:ss Z yyyy\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.put_component_template(\n name: \"template_1\",\n body: {\n \"template\": nil,\n \"settings\": {\n \"number_of_shards\": 1\n },\n \"mappings\": {\n \"_source\": {\n \"enabled\": false\n },\n \"properties\": {\n \"host_name\": {\n \"type\": \"keyword\"\n },\n \"created_at\": {\n \"type\": \"date\",\n \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->putComponentTemplate([\n \"name\" => \"template_1\",\n \"body\" => [\n \"template\" => null,\n \"settings\" => [\n \"number_of_shards\" => 1,\n ],\n \"mappings\" => [\n \"_source\" => [\n \"enabled\" => false,\n ],\n \"properties\" => [\n \"host_name\" => [\n \"type\" => \"keyword\",\n ],\n \"created_at\" => [\n \"type\" => \"date\",\n \"format\" => \"EEE MMM dd HH:mm:ss Z yyyy\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"template\":null,\"settings\":{\"number_of_shards\":1},\"mappings\":{\"_source\":{\"enabled\":false},\"properties\":{\"host_name\":{\"type\":\"keyword\"},\"created_at\":{\"type\":\"date\",\"format\":\"EEE MMM dd HH:mm:ss Z yyyy\"}}}}' \"$ELASTICSEARCH_URL/_component_template/template_1\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -2759,32 +1797,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _component_template/template_1\n" - }, - { - "lang": "Python", - "source": "resp = client.cluster.delete_component_template(\n name=\"template_1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.deleteComponentTemplate({\n name: \"template_1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.delete_component_template(\n name: \"template_1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->deleteComponentTemplate([\n \"name\" => \"template_1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_component_template/template_1\"" - } - ], "x-product-feature": "elasticsearch" }, "head": { @@ -2867,32 +1879,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_component_template/template_1\n" - }, - { - "lang": "Python", - "source": "resp = client.cluster.get_component_template(\n name=\"template_1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.getComponentTemplate({\n name: \"template_1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.get_component_template(\n name: \"template_1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->getComponentTemplate([\n \"name\" => \"template_1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_component_template/template_1\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -2953,32 +1939,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_info/_all\n" - }, - { - "lang": "Python", - "source": "resp = client.cluster.info(\n target=\"_all\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.cluster.info({\n target: \"_all\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.cluster.info(\n target: \"_all\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->cluster()->info([\n \"target\" => \"_all\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_info/_all\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -3029,32 +1989,6 @@ } }, "x-state": "Technical preview", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-connector/_check_in\n" - }, - { - "lang": "Python", - "source": "resp = client.connector.check_in(\n connector_id=\"my-connector\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.checkIn({\n connector_id: \"my-connector\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.check_in(\n connector_id: \"my-connector\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->checkIn([\n \"connector_id\" => \"my-connector\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_connector/my-connector/_check_in\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -3102,32 +2036,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _connector/my-connector-id\n" - }, - { - "lang": "Python", - "source": "resp = client.connector.get(\n connector_id=\"my-connector-id\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.get({\n connector_id: \"my-connector-id\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.get(\n connector_id: \"my-connector-id\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->get([\n \"connector_id\" => \"my-connector-id\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_connector/my-connector-id\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -3150,32 +2058,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-connector\n{\n \"index_name\": \"search-google-drive\",\n \"name\": \"My Connector\",\n \"service_type\": \"google_drive\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.put(\n connector_id=\"my-connector\",\n index_name=\"search-google-drive\",\n name=\"My Connector\",\n service_type=\"google_drive\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.put({\n connector_id: \"my-connector\",\n index_name: \"search-google-drive\",\n name: \"My Connector\",\n service_type: \"google_drive\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.put(\n connector_id: \"my-connector\",\n body: {\n \"index_name\": \"search-google-drive\",\n \"name\": \"My Connector\",\n \"service_type\": \"google_drive\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->put([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"index_name\" => \"search-google-drive\",\n \"name\" => \"My Connector\",\n \"service_type\" => \"google_drive\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_name\":\"search-google-drive\",\"name\":\"My Connector\",\"service_type\":\"google_drive\"}' \"$ELASTICSEARCH_URL/_connector/my-connector\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -3236,32 +2118,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _connector/my-connector-id&delete_sync_jobs=true\n" - }, - { - "lang": "Python", - "source": "resp = client.connector.delete(\n connector_id=\"my-connector-id&delete_sync_jobs=true\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.delete({\n connector_id: \"my-connector-id&delete_sync_jobs=true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.delete(\n connector_id: \"my-connector-id&delete_sync_jobs=true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->delete([\n \"connector_id\" => \"my-connector-id&delete_sync_jobs=true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_connector/my-connector-id&delete_sync_jobs=true\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -3373,32 +2229,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _connector\n" - }, - { - "lang": "Python", - "source": "resp = client.connector.list()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.list();" - }, - { - "lang": "Ruby", - "source": "response = client.connector.list" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->list();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_connector\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -3416,32 +2246,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-connector\n{\n \"index_name\": \"search-google-drive\",\n \"name\": \"My Connector\",\n \"service_type\": \"google_drive\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.put(\n connector_id=\"my-connector\",\n index_name=\"search-google-drive\",\n name=\"My Connector\",\n service_type=\"google_drive\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.put({\n connector_id: \"my-connector\",\n index_name: \"search-google-drive\",\n name: \"My Connector\",\n service_type: \"google_drive\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.put(\n connector_id: \"my-connector\",\n body: {\n \"index_name\": \"search-google-drive\",\n \"name\": \"My Connector\",\n \"service_type\": \"google_drive\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->put([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"index_name\" => \"search-google-drive\",\n \"name\" => \"My Connector\",\n \"service_type\" => \"google_drive\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_name\":\"search-google-drive\",\"name\":\"My Connector\",\"service_type\":\"google_drive\"}' \"$ELASTICSEARCH_URL/_connector/my-connector\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -3550,32 +2354,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/_sync_job/my-connector-sync-job-id/_cancel\n" - }, - { - "lang": "Python", - "source": "resp = client.connector.sync_job_cancel(\n connector_sync_job_id=\"my-connector-sync-job-id\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.syncJobCancel({\n connector_sync_job_id: \"my-connector-sync-job-id\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.sync_job_cancel(\n connector_sync_job_id: \"my-connector-sync-job-id\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->syncJobCancel([\n \"connector_sync_job_id\" => \"my-connector-sync-job-id\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job-id/_cancel\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -3612,32 +2390,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _connector/_sync_job/my-connector-sync-job\n" - }, - { - "lang": "Python", - "source": "resp = client.connector.sync_job_get(\n connector_sync_job_id=\"my-connector-sync-job\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.syncJobGet({\n connector_sync_job_id: \"my-connector-sync-job\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.sync_job_get(\n connector_sync_job_id: \"my-connector-sync-job\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->syncJobGet([\n \"connector_sync_job_id\" => \"my-connector-sync-job\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -3678,32 +2430,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _connector/_sync_job/my-connector-sync-job-id\n" - }, - { - "lang": "Python", - "source": "resp = client.connector.sync_job_delete(\n connector_sync_job_id=\"my-connector-sync-job-id\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.syncJobDelete({\n connector_sync_job_id: \"my-connector-sync-job-id\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.sync_job_delete(\n connector_sync_job_id: \"my-connector-sync-job-id\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->syncJobDelete([\n \"connector_sync_job_id\" => \"my-connector-sync-job-id\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job-id\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -3805,32 +2531,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _connector/_sync_job?connector_id=my-connector-id&size=1\n" - }, - { - "lang": "Python", - "source": "resp = client.connector.sync_job_list(\n connector_id=\"my-connector-id\",\n size=\"1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.syncJobList({\n connector_id: \"my-connector-id\",\n size: 1,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.sync_job_list(\n connector_id: \"my-connector-id\",\n size: \"1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->syncJobList([\n \"connector_id\" => \"my-connector-id\",\n \"size\" => \"1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_connector/_sync_job?connector_id=my-connector-id&size=1\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -3890,32 +2590,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _connector/_sync_job\n{\n \"id\": \"connector-id\",\n \"job_type\": \"full\",\n \"trigger_method\": \"on_demand\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.sync_job_post(\n id=\"connector-id\",\n job_type=\"full\",\n trigger_method=\"on_demand\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.syncJobPost({\n id: \"connector-id\",\n job_type: \"full\",\n trigger_method: \"on_demand\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.sync_job_post(\n body: {\n \"id\": \"connector-id\",\n \"job_type\": \"full\",\n \"trigger_method\": \"on_demand\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->syncJobPost([\n \"body\" => [\n \"id\" => \"connector-id\",\n \"job_type\" => \"full\",\n \"trigger_method\" => \"on_demand\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"id\":\"connector-id\",\"job_type\":\"full\",\"trigger_method\":\"on_demand\"}' \"$ELASTICSEARCH_URL/_connector/_sync_job\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -4034,32 +2708,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-connector/_api_key_id\n{\n \"api_key_id\": \"my-api-key-id\",\n \"api_key_secret_id\": \"my-connector-secret-id\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.update_api_key_id(\n connector_id=\"my-connector\",\n api_key_id=\"my-api-key-id\",\n api_key_secret_id=\"my-connector-secret-id\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.updateApiKeyId({\n connector_id: \"my-connector\",\n api_key_id: \"my-api-key-id\",\n api_key_secret_id: \"my-connector-secret-id\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.update_api_key_id(\n connector_id: \"my-connector\",\n body: {\n \"api_key_id\": \"my-api-key-id\",\n \"api_key_secret_id\": \"my-connector-secret-id\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->updateApiKeyId([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"api_key_id\" => \"my-api-key-id\",\n \"api_key_secret_id\" => \"my-connector-secret-id\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"api_key_id\":\"my-api-key-id\",\"api_key_secret_id\":\"my-connector-secret-id\"}' \"$ELASTICSEARCH_URL/_connector/my-connector/_api_key_id\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -4139,32 +2787,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-spo-connector/_configuration\n{\n \"values\": {\n \"tenant_id\": \"my-tenant-id\",\n \"tenant_name\": \"my-sharepoint-site\",\n \"client_id\": \"foo\",\n \"secret_value\": \"bar\",\n \"site_collections\": \"*\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.update_configuration(\n connector_id=\"my-spo-connector\",\n values={\n \"tenant_id\": \"my-tenant-id\",\n \"tenant_name\": \"my-sharepoint-site\",\n \"client_id\": \"foo\",\n \"secret_value\": \"bar\",\n \"site_collections\": \"*\"\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.updateConfiguration({\n connector_id: \"my-spo-connector\",\n values: {\n tenant_id: \"my-tenant-id\",\n tenant_name: \"my-sharepoint-site\",\n client_id: \"foo\",\n secret_value: \"bar\",\n site_collections: \"*\",\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.update_configuration(\n connector_id: \"my-spo-connector\",\n body: {\n \"values\": {\n \"tenant_id\": \"my-tenant-id\",\n \"tenant_name\": \"my-sharepoint-site\",\n \"client_id\": \"foo\",\n \"secret_value\": \"bar\",\n \"site_collections\": \"*\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->updateConfiguration([\n \"connector_id\" => \"my-spo-connector\",\n \"body\" => [\n \"values\" => [\n \"tenant_id\" => \"my-tenant-id\",\n \"tenant_name\" => \"my-sharepoint-site\",\n \"client_id\" => \"foo\",\n \"secret_value\" => \"bar\",\n \"site_collections\" => \"*\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"values\":{\"tenant_id\":\"my-tenant-id\",\"tenant_name\":\"my-sharepoint-site\",\"client_id\":\"foo\",\"secret_value\":\"bar\",\"site_collections\":\"*\"}}' \"$ELASTICSEARCH_URL/_connector/my-spo-connector/_configuration\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -4245,32 +2867,6 @@ } }, "x-state": "Technical preview", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-connector/_error\n{\n \"error\": \"Houston, we have a problem!\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.update_error(\n connector_id=\"my-connector\",\n error=\"Houston, we have a problem!\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.updateError({\n connector_id: \"my-connector\",\n error: \"Houston, we have a problem!\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.update_error(\n connector_id: \"my-connector\",\n body: {\n \"error\": \"Houston, we have a problem!\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->updateError([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"error\" => \"Houston, we have a problem!\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"error\":\"Houston, we have a problem!\"}' \"$ELASTICSEARCH_URL/_connector/my-connector/_error\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -4356,32 +2952,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-g-drive-connector/_filtering\n{\n \"rules\": [\n {\n \"field\": \"file_extension\",\n \"id\": \"exclude-txt-files\",\n \"order\": 0,\n \"policy\": \"exclude\",\n \"rule\": \"equals\",\n \"value\": \"txt\"\n },\n {\n \"field\": \"_\",\n \"id\": \"DEFAULT\",\n \"order\": 1,\n \"policy\": \"include\",\n \"rule\": \"regex\",\n \"value\": \".*\"\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.update_filtering(\n connector_id=\"my-g-drive-connector\",\n rules=[\n {\n \"field\": \"file_extension\",\n \"id\": \"exclude-txt-files\",\n \"order\": 0,\n \"policy\": \"exclude\",\n \"rule\": \"equals\",\n \"value\": \"txt\"\n },\n {\n \"field\": \"_\",\n \"id\": \"DEFAULT\",\n \"order\": 1,\n \"policy\": \"include\",\n \"rule\": \"regex\",\n \"value\": \".*\"\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.updateFiltering({\n connector_id: \"my-g-drive-connector\",\n rules: [\n {\n field: \"file_extension\",\n id: \"exclude-txt-files\",\n order: 0,\n policy: \"exclude\",\n rule: \"equals\",\n value: \"txt\",\n },\n {\n field: \"_\",\n id: \"DEFAULT\",\n order: 1,\n policy: \"include\",\n rule: \"regex\",\n value: \".*\",\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.update_filtering(\n connector_id: \"my-g-drive-connector\",\n body: {\n \"rules\": [\n {\n \"field\": \"file_extension\",\n \"id\": \"exclude-txt-files\",\n \"order\": 0,\n \"policy\": \"exclude\",\n \"rule\": \"equals\",\n \"value\": \"txt\"\n },\n {\n \"field\": \"_\",\n \"id\": \"DEFAULT\",\n \"order\": 1,\n \"policy\": \"include\",\n \"rule\": \"regex\",\n \"value\": \".*\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->updateFiltering([\n \"connector_id\" => \"my-g-drive-connector\",\n \"body\" => [\n \"rules\" => array(\n [\n \"field\" => \"file_extension\",\n \"id\" => \"exclude-txt-files\",\n \"order\" => 0,\n \"policy\" => \"exclude\",\n \"rule\" => \"equals\",\n \"value\" => \"txt\",\n ],\n [\n \"field\" => \"_\",\n \"id\" => \"DEFAULT\",\n \"order\" => 1,\n \"policy\" => \"include\",\n \"rule\" => \"regex\",\n \"value\" => \".*\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"rules\":[{\"field\":\"file_extension\",\"id\":\"exclude-txt-files\",\"order\":0,\"policy\":\"exclude\",\"rule\":\"equals\",\"value\":\"txt\"},{\"field\":\"_\",\"id\":\"DEFAULT\",\"order\":1,\"policy\":\"include\",\"rule\":\"regex\",\"value\":\".*\"}]}' \"$ELASTICSEARCH_URL/_connector/my-g-drive-connector/_filtering\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -4525,32 +3095,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-connector/_index_name\n{\n \"index_name\": \"data-from-my-google-drive\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.update_index_name(\n connector_id=\"my-connector\",\n index_name=\"data-from-my-google-drive\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.updateIndexName({\n connector_id: \"my-connector\",\n index_name: \"data-from-my-google-drive\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.update_index_name(\n connector_id: \"my-connector\",\n body: {\n \"index_name\": \"data-from-my-google-drive\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->updateIndexName([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"index_name\" => \"data-from-my-google-drive\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_name\":\"data-from-my-google-drive\"}' \"$ELASTICSEARCH_URL/_connector/my-connector/_index_name\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -4623,32 +3167,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-connector/_name\n{\n \"name\": \"Custom connector\",\n \"description\": \"This is my customized connector\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.update_name(\n connector_id=\"my-connector\",\n name=\"Custom connector\",\n description=\"This is my customized connector\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.updateName({\n connector_id: \"my-connector\",\n name: \"Custom connector\",\n description: \"This is my customized connector\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.update_name(\n connector_id: \"my-connector\",\n body: {\n \"name\": \"Custom connector\",\n \"description\": \"This is my customized connector\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->updateName([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"name\" => \"Custom connector\",\n \"description\" => \"This is my customized connector\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"name\":\"Custom connector\",\"description\":\"This is my customized connector\"}' \"$ELASTICSEARCH_URL/_connector/my-connector/_name\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -4784,32 +3302,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-connector/_pipeline\n{\n \"pipeline\": {\n \"extract_binary_content\": true,\n \"name\": \"my-connector-pipeline\",\n \"reduce_whitespace\": true,\n \"run_ml_inference\": true\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.update_pipeline(\n connector_id=\"my-connector\",\n pipeline={\n \"extract_binary_content\": True,\n \"name\": \"my-connector-pipeline\",\n \"reduce_whitespace\": True,\n \"run_ml_inference\": True\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.updatePipeline({\n connector_id: \"my-connector\",\n pipeline: {\n extract_binary_content: true,\n name: \"my-connector-pipeline\",\n reduce_whitespace: true,\n run_ml_inference: true,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.update_pipeline(\n connector_id: \"my-connector\",\n body: {\n \"pipeline\": {\n \"extract_binary_content\": true,\n \"name\": \"my-connector-pipeline\",\n \"reduce_whitespace\": true,\n \"run_ml_inference\": true\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->updatePipeline([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"pipeline\" => [\n \"extract_binary_content\" => true,\n \"name\" => \"my-connector-pipeline\",\n \"reduce_whitespace\" => true,\n \"run_ml_inference\" => true,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"pipeline\":{\"extract_binary_content\":true,\"name\":\"my-connector-pipeline\",\"reduce_whitespace\":true,\"run_ml_inference\":true}}' \"$ELASTICSEARCH_URL/_connector/my-connector/_pipeline\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -4885,32 +3377,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-connector/_scheduling\n{\n \"scheduling\": {\n \"access_control\": {\n \"enabled\": true,\n \"interval\": \"0 10 0 * * ?\"\n },\n \"full\": {\n \"enabled\": true,\n \"interval\": \"0 20 0 * * ?\"\n },\n \"incremental\": {\n \"enabled\": false,\n \"interval\": \"0 30 0 * * ?\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.update_scheduling(\n connector_id=\"my-connector\",\n scheduling={\n \"access_control\": {\n \"enabled\": True,\n \"interval\": \"0 10 0 * * ?\"\n },\n \"full\": {\n \"enabled\": True,\n \"interval\": \"0 20 0 * * ?\"\n },\n \"incremental\": {\n \"enabled\": False,\n \"interval\": \"0 30 0 * * ?\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.updateScheduling({\n connector_id: \"my-connector\",\n scheduling: {\n access_control: {\n enabled: true,\n interval: \"0 10 0 * * ?\",\n },\n full: {\n enabled: true,\n interval: \"0 20 0 * * ?\",\n },\n incremental: {\n enabled: false,\n interval: \"0 30 0 * * ?\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.update_scheduling(\n connector_id: \"my-connector\",\n body: {\n \"scheduling\": {\n \"access_control\": {\n \"enabled\": true,\n \"interval\": \"0 10 0 * * ?\"\n },\n \"full\": {\n \"enabled\": true,\n \"interval\": \"0 20 0 * * ?\"\n },\n \"incremental\": {\n \"enabled\": false,\n \"interval\": \"0 30 0 * * ?\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->updateScheduling([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"scheduling\" => [\n \"access_control\" => [\n \"enabled\" => true,\n \"interval\" => \"0 10 0 * * ?\",\n ],\n \"full\" => [\n \"enabled\" => true,\n \"interval\" => \"0 20 0 * * ?\",\n ],\n \"incremental\" => [\n \"enabled\" => false,\n \"interval\" => \"0 30 0 * * ?\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"scheduling\":{\"access_control\":{\"enabled\":true,\"interval\":\"0 10 0 * * ?\"},\"full\":{\"enabled\":true,\"interval\":\"0 20 0 * * ?\"},\"incremental\":{\"enabled\":false,\"interval\":\"0 30 0 * * ?\"}}}' \"$ELASTICSEARCH_URL/_connector/my-connector/_scheduling\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -4983,32 +3449,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-connector/_service_type\n{\n \"service_type\": \"sharepoint_online\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.update_service_type(\n connector_id=\"my-connector\",\n service_type=\"sharepoint_online\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.updateServiceType({\n connector_id: \"my-connector\",\n service_type: \"sharepoint_online\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.update_service_type(\n connector_id: \"my-connector\",\n body: {\n \"service_type\": \"sharepoint_online\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->updateServiceType([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"service_type\" => \"sharepoint_online\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service_type\":\"sharepoint_online\"}' \"$ELASTICSEARCH_URL/_connector/my-connector/_service_type\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -5081,32 +3521,6 @@ } }, "x-state": "Technical preview", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _connector/my-connector/_status\n{\n \"status\": \"needs_configuration\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.connector.update_status(\n connector_id=\"my-connector\",\n status=\"needs_configuration\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.connector.updateStatus({\n connector_id: \"my-connector\",\n status: \"needs_configuration\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.connector.update_status(\n connector_id: \"my-connector\",\n body: {\n \"status\": \"needs_configuration\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->connector()->updateStatus([\n \"connector_id\" => \"my-connector\",\n \"body\" => [\n \"status\" => \"needs_configuration\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"status\":\"needs_configuration\"}' \"$ELASTICSEARCH_URL/_connector/my-connector/_status\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -5171,32 +3585,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_count\n{\n \"query\" : {\n \"term\" : { \"user.id\" : \"kimchy\" }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.count(\n index=\"my-index-000001\",\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.count({\n index: \"my-index-000001\",\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.count(\n index: \"my-index-000001\",\n body: {\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->count([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}' \"$ELASTICSEARCH_URL/my-index-000001/_count\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -5259,32 +3647,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_count\n{\n \"query\" : {\n \"term\" : { \"user.id\" : \"kimchy\" }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.count(\n index=\"my-index-000001\",\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.count({\n index: \"my-index-000001\",\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.count(\n index: \"my-index-000001\",\n body: {\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->count([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}' \"$ELASTICSEARCH_URL/my-index-000001/_count\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -5352,32 +3714,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_count\n{\n \"query\" : {\n \"term\" : { \"user.id\" : \"kimchy\" }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.count(\n index=\"my-index-000001\",\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.count({\n index: \"my-index-000001\",\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.count(\n index: \"my-index-000001\",\n body: {\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->count([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}' \"$ELASTICSEARCH_URL/my-index-000001/_count\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -5443,32 +3779,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_count\n{\n \"query\" : {\n \"term\" : { \"user.id\" : \"kimchy\" }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.count(\n index=\"my-index-000001\",\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.count({\n index: \"my-index-000001\",\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.count(\n index: \"my-index-000001\",\n body: {\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->count([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}' \"$ELASTICSEARCH_URL/my-index-000001/_count\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -5539,32 +3849,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT my-index-000001/_create/1\n{\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.create(\n index=\"my-index-000001\",\n id=\"1\",\n document={\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.create({\n index: \"my-index-000001\",\n id: 1,\n document: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n message: \"GET /search HTTP/1.1 200 1070000\",\n user: {\n id: \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.create(\n index: \"my-index-000001\",\n id: \"1\",\n body: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->create([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n \"body\" => [\n \"@timestamp\" => \"2099-11-15T13:12:00\",\n \"message\" => \"GET /search HTTP/1.1 200 1070000\",\n \"user\" => [\n \"id\" => \"kimchy\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"@timestamp\":\"2099-11-15T13:12:00\",\"message\":\"GET /search HTTP/1.1 200 1070000\",\"user\":{\"id\":\"kimchy\"}}' \"$ELASTICSEARCH_URL/my-index-000001/_create/1\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -5633,32 +3917,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT my-index-000001/_create/1\n{\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.create(\n index=\"my-index-000001\",\n id=\"1\",\n document={\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.create({\n index: \"my-index-000001\",\n id: 1,\n document: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n message: \"GET /search HTTP/1.1 200 1070000\",\n user: {\n id: \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.create(\n index: \"my-index-000001\",\n id: \"1\",\n body: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->create([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n \"body\" => [\n \"@timestamp\" => \"2099-11-15T13:12:00\",\n \"message\" => \"GET /search HTTP/1.1 200 1070000\",\n \"user\" => [\n \"id\" => \"kimchy\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"@timestamp\":\"2099-11-15T13:12:00\",\"message\":\"GET /search HTTP/1.1 200 1070000\",\"user\":{\"id\":\"kimchy\"}}' \"$ELASTICSEARCH_URL/my-index-000001/_create/1\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -5824,32 +4082,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index-000001/_doc/1?stored_fields=tags,counter\n" - }, - { - "lang": "Python", - "source": "resp = client.get(\n index=\"my-index-000001\",\n id=\"1\",\n stored_fields=\"tags,counter\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.get({\n index: \"my-index-000001\",\n id: 1,\n stored_fields: \"tags,counter\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.get(\n index: \"my-index-000001\",\n id: \"1\",\n stored_fields: \"tags,counter\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->get([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n \"stored_fields\" => \"tags,counter\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_doc/1?stored_fields=tags,counter\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -5915,32 +4147,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST my-index-000001/_doc/\n{\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.index(\n index=\"my-index-000001\",\n document={\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.index({\n index: \"my-index-000001\",\n document: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n message: \"GET /search HTTP/1.1 200 1070000\",\n user: {\n id: \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.index(\n index: \"my-index-000001\",\n body: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->index([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"@timestamp\" => \"2099-11-15T13:12:00\",\n \"message\" => \"GET /search HTTP/1.1 200 1070000\",\n \"user\" => [\n \"id\" => \"kimchy\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"@timestamp\":\"2099-11-15T13:12:00\",\"message\":\"GET /search HTTP/1.1 200 1070000\",\"user\":{\"id\":\"kimchy\"}}' \"$ELASTICSEARCH_URL/my-index-000001/_doc/\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -6006,32 +4212,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST my-index-000001/_doc/\n{\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.index(\n index=\"my-index-000001\",\n document={\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.index({\n index: \"my-index-000001\",\n document: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n message: \"GET /search HTTP/1.1 200 1070000\",\n user: {\n id: \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.index(\n index: \"my-index-000001\",\n body: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->index([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"@timestamp\" => \"2099-11-15T13:12:00\",\n \"message\" => \"GET /search HTTP/1.1 200 1070000\",\n \"user\" => [\n \"id\" => \"kimchy\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"@timestamp\":\"2099-11-15T13:12:00\",\"message\":\"GET /search HTTP/1.1 200 1070000\",\"user\":{\"id\":\"kimchy\"}}' \"$ELASTICSEARCH_URL/my-index-000001/_doc/\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -6164,32 +4344,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /my-index-000001/_doc/1\n" - }, - { - "lang": "Python", - "source": "resp = client.delete(\n index=\"my-index-000001\",\n id=\"1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.delete({\n index: \"my-index-000001\",\n id: 1,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.delete(\n index: \"my-index-000001\",\n id: \"1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->delete([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_doc/1\"" - } - ], "x-product-feature": "elasticsearch" }, "head": { @@ -6332,32 +4486,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "HEAD my-index-000001/_doc/0\n" - }, - { - "lang": "Python", - "source": "resp = client.exists(\n index=\"my-index-000001\",\n id=\"0\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.exists({\n index: \"my-index-000001\",\n id: 0,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.exists(\n index: \"my-index-000001\",\n id: \"0\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->exists([\n \"index\" => \"my-index-000001\",\n \"id\" => \"0\",\n]);" - }, - { - "lang": "curl", - "source": "curl --head -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_doc/0\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -6802,32 +4930,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-index-000001,my-index-000002/_delete_by_query\n{\n \"query\": {\n \"match_all\": {}\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.delete_by_query(\n index=\"my-index-000001,my-index-000002\",\n query={\n \"match_all\": {}\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.deleteByQuery({\n index: \"my-index-000001,my-index-000002\",\n query: {\n match_all: {},\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.delete_by_query(\n index: \"my-index-000001,my-index-000002\",\n body: {\n \"query\": {\n \"match_all\": {}\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->deleteByQuery([\n \"index\" => \"my-index-000001,my-index-000002\",\n \"body\" => [\n \"query\" => [\n \"match_all\" => new ArrayObject([]),\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"match_all\":{}}}' \"$ELASTICSEARCH_URL/my-index-000001,my-index-000002/_delete_by_query\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -6890,32 +4992,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _scripts/my-search-template\n" - }, - { - "lang": "Python", - "source": "resp = client.get_script(\n id=\"my-search-template\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.getScript({\n id: \"my-search-template\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.get_script(\n id: \"my-search-template\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->getScript([\n \"id\" => \"my-search-template\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_scripts/my-search-template\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -6951,32 +5027,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _scripts/my-search-template\n{\n \"script\": {\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.put_script(\n id=\"my-search-template\",\n script={\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.putScript({\n id: \"my-search-template\",\n script: {\n lang: \"mustache\",\n source: {\n query: {\n match: {\n message: \"{{query_string}}\",\n },\n },\n from: \"{{from}}\",\n size: \"{{size}}\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.put_script(\n id: \"my-search-template\",\n body: {\n \"script\": {\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->putScript([\n \"id\" => \"my-search-template\",\n \"body\" => [\n \"script\" => [\n \"lang\" => \"mustache\",\n \"source\" => [\n \"query\" => [\n \"match\" => [\n \"message\" => \"{{query_string}}\",\n ],\n ],\n \"from\" => \"{{from}}\",\n \"size\" => \"{{size}}\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"script\":{\"lang\":\"mustache\",\"source\":{\"query\":{\"match\":{\"message\":\"{{query_string}}\"}},\"from\":\"{{from}}\",\"size\":\"{{size}}\"}}}' \"$ELASTICSEARCH_URL/_scripts/my-search-template\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -7012,32 +5062,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _scripts/my-search-template\n{\n \"script\": {\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.put_script(\n id=\"my-search-template\",\n script={\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.putScript({\n id: \"my-search-template\",\n script: {\n lang: \"mustache\",\n source: {\n query: {\n match: {\n message: \"{{query_string}}\",\n },\n },\n from: \"{{from}}\",\n size: \"{{size}}\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.put_script(\n id: \"my-search-template\",\n body: {\n \"script\": {\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->putScript([\n \"id\" => \"my-search-template\",\n \"body\" => [\n \"script\" => [\n \"lang\" => \"mustache\",\n \"source\" => [\n \"query\" => [\n \"match\" => [\n \"message\" => \"{{query_string}}\",\n ],\n ],\n \"from\" => \"{{from}}\",\n \"size\" => \"{{size}}\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"script\":{\"lang\":\"mustache\",\"source\":{\"query\":{\"match\":{\"message\":\"{{query_string}}\"}},\"from\":\"{{from}}\",\"size\":\"{{size}}\"}}}' \"$ELASTICSEARCH_URL/_scripts/my-search-template\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -7093,32 +5117,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _scripts/my-search-template\n" - }, - { - "lang": "Python", - "source": "resp = client.delete_script(\n id=\"my-search-template\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.deleteScript({\n id: \"my-search-template\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.delete_script(\n id: \"my-search-template\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->deleteScript([\n \"id\" => \"my-search-template\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_scripts/my-search-template\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -7144,32 +5142,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_enrich/policy/my-policy\n" - }, - { - "lang": "Python", - "source": "resp = client.enrich.get_policy(\n name=\"my-policy\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.enrich.getPolicy({\n name: \"my-policy\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.enrich.get_policy(\n name: \"my-policy\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->enrich()->getPolicy([\n \"name\" => \"my-policy\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_enrich/policy/my-policy\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -7242,42 +5214,16 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_enrich/policy/postal_policy\n{\n \"geo_match\": {\n \"indices\": \"postal_codes\",\n \"match_field\": \"location\",\n \"enrich_fields\": [ \"location\", \"postal_code\" ]\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.enrich.put_policy(\n name=\"postal_policy\",\n geo_match={\n \"indices\": \"postal_codes\",\n \"match_field\": \"location\",\n \"enrich_fields\": [\n \"location\",\n \"postal_code\"\n ]\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.enrich.putPolicy({\n name: \"postal_policy\",\n geo_match: {\n indices: \"postal_codes\",\n match_field: \"location\",\n enrich_fields: [\"location\", \"postal_code\"],\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.enrich.put_policy(\n name: \"postal_policy\",\n body: {\n \"geo_match\": {\n \"indices\": \"postal_codes\",\n \"match_field\": \"location\",\n \"enrich_fields\": [\n \"location\",\n \"postal_code\"\n ]\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->enrich()->putPolicy([\n \"name\" => \"postal_policy\",\n \"body\" => [\n \"geo_match\" => [\n \"indices\" => \"postal_codes\",\n \"match_field\" => \"location\",\n \"enrich_fields\" => array(\n \"location\",\n \"postal_code\",\n ),\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"geo_match\":{\"indices\":\"postal_codes\",\"match_field\":\"location\",\"enrich_fields\":[\"location\",\"postal_code\"]}}' \"$ELASTICSEARCH_URL/_enrich/policy/postal_policy\"" - } - ], - "x-product-feature": "elasticsearch" - }, - "delete": { - "tags": [ - "enrich" - ], - "summary": "Delete an enrich policy", - "description": "Deletes an existing enrich policy and its enrich index.", - "operationId": "enrich-delete-policy", - "parameters": [ + "x-product-feature": "elasticsearch" + }, + "delete": { + "tags": [ + "enrich" + ], + "summary": "Delete an enrich policy", + "description": "Deletes an existing enrich policy and its enrich index.", + "operationId": "enrich-delete-policy", + "parameters": [ { "in": "path", "name": "name", @@ -7313,32 +5259,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_enrich/policy/my-policy\n" - }, - { - "lang": "Python", - "source": "resp = client.enrich.delete_policy(\n name=\"my-policy\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.enrich.deletePolicy({\n name: \"my-policy\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.enrich.delete_policy(\n name: \"my-policy\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->enrich()->deletePolicy([\n \"name\" => \"my-policy\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_enrich/policy/my-policy\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -7404,32 +5324,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_enrich/policy/my-policy/_execute?wait_for_completion=false\n" - }, - { - "lang": "Python", - "source": "resp = client.enrich.execute_policy(\n name=\"my-policy\",\n wait_for_completion=False,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.enrich.executePolicy({\n name: \"my-policy\",\n wait_for_completion: \"false\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.enrich.execute_policy(\n name: \"my-policy\",\n wait_for_completion: \"false\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->enrich()->executePolicy([\n \"name\" => \"my-policy\",\n \"wait_for_completion\" => \"false\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_enrich/policy/my-policy/_execute?wait_for_completion=false\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -7452,32 +5346,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_enrich/policy/my-policy\n" - }, - { - "lang": "Python", - "source": "resp = client.enrich.get_policy(\n name=\"my-policy\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.enrich.getPolicy({\n name: \"my-policy\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.enrich.get_policy(\n name: \"my-policy\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->enrich()->getPolicy([\n \"name\" => \"my-policy\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_enrich/policy/my-policy\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -7535,32 +5403,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_eql/search/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=?wait_for_completion_timeout=2s\n" - }, - { - "lang": "Python", - "source": "resp = client.eql.get(\n id=\"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n wait_for_completion_timeout=\"2s\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.eql.get({\n id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n wait_for_completion_timeout: \"2s\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.eql.get(\n id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n wait_for_completion_timeout: \"2s\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->eql()->get([\n \"id\" => \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n \"wait_for_completion_timeout\" => \"2s\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_eql/search/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=?wait_for_completion_timeout=2s\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -7596,32 +5438,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_eql/search/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\n" - }, - { - "lang": "Python", - "source": "resp = client.eql.delete(\n id=\"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.eql.delete({\n id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.eql.delete(\n id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->eql()->delete([\n \"id\" => \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_eql/search/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -7693,32 +5509,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_eql/search/status/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\n" - }, - { - "lang": "Python", - "source": "resp = client.eql.get_status(\n id=\"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.eql.getStatus({\n id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.eql.get_status(\n id: \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->eql()->getStatus([\n \"id\" => \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_eql/search/status/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -7771,32 +5561,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-data-stream/_eql/search\n{\n \"query\": \"\"\"\n process where (process.name == \"cmd.exe\" and process.pid != 2013)\n \"\"\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.eql.search(\n index=\"my-data-stream\",\n query=\"\\n process where (process.name == \\\"cmd.exe\\\" and process.pid != 2013)\\n \",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.eql.search({\n index: \"my-data-stream\",\n query:\n '\\n process where (process.name == \"cmd.exe\" and process.pid != 2013)\\n ',\n});" - }, - { - "lang": "Ruby", - "source": "response = client.eql.search(\n index: \"my-data-stream\",\n body: {\n \"query\": \"\\n process where (process.name == \\\"cmd.exe\\\" and process.pid != 2013)\\n \"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->eql()->search([\n \"index\" => \"my-data-stream\",\n \"body\" => [\n \"query\" => \"\\n process where (process.name == \\\"cmd.exe\\\" and process.pid != 2013)\\n \",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":\"\\n process where (process.name == \\\"cmd.exe\\\" and process.pid != 2013)\\n \"}' \"$ELASTICSEARCH_URL/my-data-stream/_eql/search\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -7847,32 +5611,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-data-stream/_eql/search\n{\n \"query\": \"\"\"\n process where (process.name == \"cmd.exe\" and process.pid != 2013)\n \"\"\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.eql.search(\n index=\"my-data-stream\",\n query=\"\\n process where (process.name == \\\"cmd.exe\\\" and process.pid != 2013)\\n \",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.eql.search({\n index: \"my-data-stream\",\n query:\n '\\n process where (process.name == \"cmd.exe\" and process.pid != 2013)\\n ',\n});" - }, - { - "lang": "Ruby", - "source": "response = client.eql.search(\n index: \"my-data-stream\",\n body: {\n \"query\": \"\\n process where (process.name == \\\"cmd.exe\\\" and process.pid != 2013)\\n \"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->eql()->search([\n \"index\" => \"my-data-stream\",\n \"body\" => [\n \"query\" => \"\\n process where (process.name == \\\"cmd.exe\\\" and process.pid != 2013)\\n \",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":\"\\n process where (process.name == \\\"cmd.exe\\\" and process.pid != 2013)\\n \"}' \"$ELASTICSEARCH_URL/my-data-stream/_eql/search\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -7992,32 +5730,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_query\n{\n \"query\": \"\"\"\n FROM library,remote-*:library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n \"\"\",\n \"include_ccs_metadata\": true\n}" - }, - { - "lang": "Python", - "source": "resp = client.esql.query(\n query=\"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n include_ccs_metadata=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.esql.query({\n query:\n \"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n include_ccs_metadata: true,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.esql.query(\n body: {\n \"query\": \"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n \"include_ccs_metadata\": true\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->esql()->query([\n \"body\" => [\n \"query\" => \"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\n \"include_ccs_metadata\" => true,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":\"\\n FROM library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n | SORT year\\n | LIMIT 5\\n \",\"include_ccs_metadata\":true}' \"$ELASTICSEARCH_URL/_query\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -8169,32 +5881,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index-000001/_source/1\n" - }, - { - "lang": "Python", - "source": "resp = client.get_source(\n index=\"my-index-000001\",\n id=\"1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.getSource({\n index: \"my-index-000001\",\n id: 1,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.get_source(\n index: \"my-index-000001\",\n id: \"1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->getSource([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_source/1\"" - } - ], "x-product-feature": "elasticsearch" }, "head": { @@ -8330,32 +6016,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "HEAD my-index-000001/_source/1\n" - }, - { - "lang": "Python", - "source": "resp = client.exists_source(\n index=\"my-index-000001\",\n id=\"1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.existsSource({\n index: \"my-index-000001\",\n id: 1,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.exists_source(\n index: \"my-index-000001\",\n id: \"1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->existsSource([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n]);" - }, - { - "lang": "curl", - "source": "curl --head -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_source/1\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -8420,32 +6080,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_explain/0\n{\n \"query\" : {\n \"match\" : { \"message\" : \"elasticsearch\" }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.explain(\n index=\"my-index-000001\",\n id=\"0\",\n query={\n \"match\": {\n \"message\": \"elasticsearch\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.explain({\n index: \"my-index-000001\",\n id: 0,\n query: {\n match: {\n message: \"elasticsearch\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.explain(\n index: \"my-index-000001\",\n id: \"0\",\n body: {\n \"query\": {\n \"match\": {\n \"message\": \"elasticsearch\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->explain([\n \"index\" => \"my-index-000001\",\n \"id\" => \"0\",\n \"body\" => [\n \"query\" => [\n \"match\" => [\n \"message\" => \"elasticsearch\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"match\":{\"message\":\"elasticsearch\"}}}' \"$ELASTICSEARCH_URL/my-index-000001/_explain/0\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -8508,32 +6142,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_explain/0\n{\n \"query\" : {\n \"match\" : { \"message\" : \"elasticsearch\" }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.explain(\n index=\"my-index-000001\",\n id=\"0\",\n query={\n \"match\": {\n \"message\": \"elasticsearch\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.explain({\n index: \"my-index-000001\",\n id: 0,\n query: {\n match: {\n message: \"elasticsearch\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.explain(\n index: \"my-index-000001\",\n id: \"0\",\n body: {\n \"query\": {\n \"match\": {\n \"message\": \"elasticsearch\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->explain([\n \"index\" => \"my-index-000001\",\n \"id\" => \"0\",\n \"body\" => [\n \"query\" => [\n \"match\" => [\n \"message\" => \"elasticsearch\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"match\":{\"message\":\"elasticsearch\"}}}' \"$ELASTICSEARCH_URL/my-index-000001/_explain/0\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -8580,32 +6188,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST my-index-*/_field_caps?fields=rating\n{\n \"index_filter\": {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.field_caps(\n index=\"my-index-*\",\n fields=\"rating\",\n index_filter={\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.fieldCaps({\n index: \"my-index-*\",\n fields: \"rating\",\n index_filter: {\n range: {\n \"@timestamp\": {\n gte: \"2018\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.field_caps(\n index: \"my-index-*\",\n fields: \"rating\",\n body: {\n \"index_filter\": {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->fieldCaps([\n \"index\" => \"my-index-*\",\n \"fields\" => \"rating\",\n \"body\" => [\n \"index_filter\" => [\n \"range\" => [\n \"@timestamp\" => [\n \"gte\" => \"2018\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_filter\":{\"range\":{\"@timestamp\":{\"gte\":\"2018\"}}}}' \"$ELASTICSEARCH_URL/my-index-*/_field_caps?fields=rating\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -8650,32 +6232,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST my-index-*/_field_caps?fields=rating\n{\n \"index_filter\": {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.field_caps(\n index=\"my-index-*\",\n fields=\"rating\",\n index_filter={\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.fieldCaps({\n index: \"my-index-*\",\n fields: \"rating\",\n index_filter: {\n range: {\n \"@timestamp\": {\n gte: \"2018\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.field_caps(\n index: \"my-index-*\",\n fields: \"rating\",\n body: {\n \"index_filter\": {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->fieldCaps([\n \"index\" => \"my-index-*\",\n \"fields\" => \"rating\",\n \"body\" => [\n \"index_filter\" => [\n \"range\" => [\n \"@timestamp\" => [\n \"gte\" => \"2018\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_filter\":{\"range\":{\"@timestamp\":{\"gte\":\"2018\"}}}}' \"$ELASTICSEARCH_URL/my-index-*/_field_caps?fields=rating\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -8725,32 +6281,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST my-index-*/_field_caps?fields=rating\n{\n \"index_filter\": {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.field_caps(\n index=\"my-index-*\",\n fields=\"rating\",\n index_filter={\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.fieldCaps({\n index: \"my-index-*\",\n fields: \"rating\",\n index_filter: {\n range: {\n \"@timestamp\": {\n gte: \"2018\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.field_caps(\n index: \"my-index-*\",\n fields: \"rating\",\n body: {\n \"index_filter\": {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->fieldCaps([\n \"index\" => \"my-index-*\",\n \"fields\" => \"rating\",\n \"body\" => [\n \"index_filter\" => [\n \"range\" => [\n \"@timestamp\" => [\n \"gte\" => \"2018\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_filter\":{\"range\":{\"@timestamp\":{\"gte\":\"2018\"}}}}' \"$ELASTICSEARCH_URL/my-index-*/_field_caps?fields=rating\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -8798,32 +6328,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST my-index-*/_field_caps?fields=rating\n{\n \"index_filter\": {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.field_caps(\n index=\"my-index-*\",\n fields=\"rating\",\n index_filter={\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.fieldCaps({\n index: \"my-index-*\",\n fields: \"rating\",\n index_filter: {\n range: {\n \"@timestamp\": {\n gte: \"2018\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.field_caps(\n index: \"my-index-*\",\n fields: \"rating\",\n body: {\n \"index_filter\": {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"2018\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->fieldCaps([\n \"index\" => \"my-index-*\",\n \"fields\" => \"rating\",\n \"body\" => [\n \"index_filter\" => [\n \"range\" => [\n \"@timestamp\" => [\n \"gte\" => \"2018\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_filter\":{\"range\":{\"@timestamp\":{\"gte\":\"2018\"}}}}' \"$ELASTICSEARCH_URL/my-index-*/_field_caps?fields=rating\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -8858,32 +6362,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST clicklogs/_graph/explore\n{\n \"query\": {\n \"match\": {\n \"query.raw\": \"midi\"\n }\n },\n \"vertices\": [\n {\n \"field\": \"product\"\n }\n ],\n \"connections\": {\n \"vertices\": [\n {\n \"field\": \"query.raw\"\n }\n ]\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.graph.explore(\n index=\"clicklogs\",\n query={\n \"match\": {\n \"query.raw\": \"midi\"\n }\n },\n vertices=[\n {\n \"field\": \"product\"\n }\n ],\n connections={\n \"vertices\": [\n {\n \"field\": \"query.raw\"\n }\n ]\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.graph.explore({\n index: \"clicklogs\",\n query: {\n match: {\n \"query.raw\": \"midi\",\n },\n },\n vertices: [\n {\n field: \"product\",\n },\n ],\n connections: {\n vertices: [\n {\n field: \"query.raw\",\n },\n ],\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.graph.explore(\n index: \"clicklogs\",\n body: {\n \"query\": {\n \"match\": {\n \"query.raw\": \"midi\"\n }\n },\n \"vertices\": [\n {\n \"field\": \"product\"\n }\n ],\n \"connections\": {\n \"vertices\": [\n {\n \"field\": \"query.raw\"\n }\n ]\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->graph()->explore([\n \"index\" => \"clicklogs\",\n \"body\" => [\n \"query\" => [\n \"match\" => [\n \"query.raw\" => \"midi\",\n ],\n ],\n \"vertices\" => array(\n [\n \"field\" => \"product\",\n ],\n ),\n \"connections\" => [\n \"vertices\" => array(\n [\n \"field\" => \"query.raw\",\n ],\n ),\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"match\":{\"query.raw\":\"midi\"}},\"vertices\":[{\"field\":\"product\"}],\"connections\":{\"vertices\":[{\"field\":\"query.raw\"}]}}' \"$ELASTICSEARCH_URL/clicklogs/_graph/explore\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -8916,32 +6394,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST clicklogs/_graph/explore\n{\n \"query\": {\n \"match\": {\n \"query.raw\": \"midi\"\n }\n },\n \"vertices\": [\n {\n \"field\": \"product\"\n }\n ],\n \"connections\": {\n \"vertices\": [\n {\n \"field\": \"query.raw\"\n }\n ]\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.graph.explore(\n index=\"clicklogs\",\n query={\n \"match\": {\n \"query.raw\": \"midi\"\n }\n },\n vertices=[\n {\n \"field\": \"product\"\n }\n ],\n connections={\n \"vertices\": [\n {\n \"field\": \"query.raw\"\n }\n ]\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.graph.explore({\n index: \"clicklogs\",\n query: {\n match: {\n \"query.raw\": \"midi\",\n },\n },\n vertices: [\n {\n field: \"product\",\n },\n ],\n connections: {\n vertices: [\n {\n field: \"query.raw\",\n },\n ],\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.graph.explore(\n index: \"clicklogs\",\n body: {\n \"query\": {\n \"match\": {\n \"query.raw\": \"midi\"\n }\n },\n \"vertices\": [\n {\n \"field\": \"product\"\n }\n ],\n \"connections\": {\n \"vertices\": [\n {\n \"field\": \"query.raw\"\n }\n ]\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->graph()->explore([\n \"index\" => \"clicklogs\",\n \"body\" => [\n \"query\" => [\n \"match\" => [\n \"query.raw\" => \"midi\",\n ],\n ],\n \"vertices\" => array(\n [\n \"field\" => \"product\",\n ],\n ),\n \"connections\" => [\n \"vertices\" => array(\n [\n \"field\" => \"query.raw\",\n ],\n ),\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"match\":{\"query.raw\":\"midi\"}},\"vertices\":[{\"field\":\"product\"}],\"connections\":{\"vertices\":[{\"field\":\"query.raw\"}]}}' \"$ELASTICSEARCH_URL/clicklogs/_graph/explore\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -9006,32 +6458,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST my-index-000001/_doc/\n{\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.index(\n index=\"my-index-000001\",\n document={\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.index({\n index: \"my-index-000001\",\n document: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n message: \"GET /search HTTP/1.1 200 1070000\",\n user: {\n id: \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.index(\n index: \"my-index-000001\",\n body: {\n \"@timestamp\": \"2099-11-15T13:12:00\",\n \"message\": \"GET /search HTTP/1.1 200 1070000\",\n \"user\": {\n \"id\": \"kimchy\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->index([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"@timestamp\" => \"2099-11-15T13:12:00\",\n \"message\" => \"GET /search HTTP/1.1 200 1070000\",\n \"user\" => [\n \"id\" => \"kimchy\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"@timestamp\":\"2099-11-15T13:12:00\",\"message\":\"GET /search HTTP/1.1 200 1070000\",\"user\":{\"id\":\"kimchy\"}}' \"$ELASTICSEARCH_URL/my-index-000001/_doc/\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -9155,32 +6581,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /my-index-000001/_block/write\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.add_block(\n index=\"my-index-000001\",\n block=\"write\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.addBlock({\n index: \"my-index-000001\",\n block: \"write\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.add_block(\n index: \"my-index-000001\",\n block: \"write\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->addBlock([\n \"index\" => \"my-index-000001\",\n \"block\" => \"write\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_block/write\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -9209,32 +6609,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_analyze\n{\n \"analyzer\": \"standard\",\n \"text\": \"this is a test\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.analyze(\n analyzer=\"standard\",\n text=\"this is a test\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.analyze({\n analyzer: \"standard\",\n text: \"this is a test\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.analyze(\n body: {\n \"analyzer\": \"standard\",\n \"text\": \"this is a test\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->analyze([\n \"body\" => [\n \"analyzer\" => \"standard\",\n \"text\" => \"this is a test\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"analyzer\":\"standard\",\"text\":\"this is a test\"}' \"$ELASTICSEARCH_URL/_analyze\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -9261,32 +6635,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_analyze\n{\n \"analyzer\": \"standard\",\n \"text\": \"this is a test\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.analyze(\n analyzer=\"standard\",\n text=\"this is a test\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.analyze({\n analyzer: \"standard\",\n text: \"this is a test\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.analyze(\n body: {\n \"analyzer\": \"standard\",\n \"text\": \"this is a test\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->analyze([\n \"body\" => [\n \"analyzer\" => \"standard\",\n \"text\" => \"this is a test\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"analyzer\":\"standard\",\"text\":\"this is a test\"}' \"$ELASTICSEARCH_URL/_analyze\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -9318,32 +6666,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_analyze\n{\n \"analyzer\": \"standard\",\n \"text\": \"this is a test\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.analyze(\n analyzer=\"standard\",\n text=\"this is a test\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.analyze({\n analyzer: \"standard\",\n text: \"this is a test\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.analyze(\n body: {\n \"analyzer\": \"standard\",\n \"text\": \"this is a test\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->analyze([\n \"body\" => [\n \"analyzer\" => \"standard\",\n \"text\" => \"this is a test\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"analyzer\":\"standard\",\"text\":\"this is a test\"}' \"$ELASTICSEARCH_URL/_analyze\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -9373,32 +6695,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_analyze\n{\n \"analyzer\": \"standard\",\n \"text\": \"this is a test\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.analyze(\n analyzer=\"standard\",\n text=\"this is a test\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.analyze({\n analyzer: \"standard\",\n text: \"this is a test\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.analyze(\n body: {\n \"analyzer\": \"standard\",\n \"text\": \"this is a test\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->analyze([\n \"body\" => [\n \"analyzer\" => \"standard\",\n \"text\" => \"this is a test\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"analyzer\":\"standard\",\"text\":\"this is a test\"}' \"$ELASTICSEARCH_URL/_analyze\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -9519,32 +6815,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get(\n index=\"my-index-000001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.get({\n index: \"my-index-000001\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get(\n index: \"my-index-000001\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->get([\n \"index\" => \"my-index-000001\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -9667,32 +6937,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /my-index-000001\n{\n \"settings\": {\n \"number_of_shards\": 3,\n \"number_of_replicas\": 2\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.create(\n index=\"my-index-000001\",\n settings={\n \"number_of_shards\": 3,\n \"number_of_replicas\": 2\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.create({\n index: \"my-index-000001\",\n settings: {\n number_of_shards: 3,\n number_of_replicas: 2,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.create(\n index: \"my-index-000001\",\n body: {\n \"settings\": {\n \"number_of_shards\": 3,\n \"number_of_replicas\": 2\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->create([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"settings\" => [\n \"number_of_shards\" => 3,\n \"number_of_replicas\" => 2,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"settings\":{\"number_of_shards\":3,\"number_of_replicas\":2}}' \"$ELASTICSEARCH_URL/my-index-000001\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -9778,32 +7022,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /books\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.delete(\n index=\"books\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.delete({\n index: \"books\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.delete(\n index: \"books\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->delete([\n \"index\" => \"books\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/books\"" - } - ], "x-product-feature": "elasticsearch" }, "head": { @@ -9895,32 +7113,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "HEAD my-data-stream\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.exists(\n index=\"my-data-stream\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.exists({\n index: \"my-data-stream\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.exists(\n index: \"my-data-stream\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->exists([\n \"index\" => \"my-data-stream\",\n]);" - }, - { - "lang": "curl", - "source": "curl --head -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-data-stream\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -9955,32 +7147,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _data_stream/my-data-stream\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_data_stream(\n name=\"my-data-stream\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getDataStream({\n name: \"my-data-stream\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_data_stream(\n name: \"my-data-stream\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getDataStream([\n \"name\" => \"my-data-stream\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_data_stream/my-data-stream\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -10036,32 +7202,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _data_stream/logs-foo-bar\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.create_data_stream(\n name=\"logs-foo-bar\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.createDataStream({\n name: \"logs-foo-bar\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.create_data_stream(\n name: \"logs-foo-bar\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->createDataStream([\n \"name\" => \"logs-foo-bar\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_data_stream/logs-foo-bar\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -10117,32 +7257,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _data_stream/my-data-stream\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.delete_data_stream(\n name=\"my-data-stream\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.deleteDataStream({\n name: \"my-data-stream\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.delete_data_stream(\n name: \"my-data-stream\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->deleteDataStream([\n \"name\" => \"my-data-stream\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_data_stream/my-data-stream\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -10180,32 +7294,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _alias\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_alias()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getAlias();" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_alias" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getAlias();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_alias\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -10238,32 +7326,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _aliases\n{\n \"actions\": [\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.update_aliases(\n actions=[\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.updateAliases({\n actions: [\n {\n add: {\n index: \"my-data-stream\",\n alias: \"my-alias\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.update_aliases(\n body: {\n \"actions\": [\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->updateAliases([\n \"body\" => [\n \"actions\" => array(\n [\n \"add\" => [\n \"index\" => \"my-data-stream\",\n \"alias\" => \"my-alias\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"actions\":[{\"add\":{\"index\":\"my-data-stream\",\"alias\":\"my-alias\"}}]}' \"$ELASTICSEARCH_URL/_aliases\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -10296,32 +7358,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _aliases\n{\n \"actions\": [\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.update_aliases(\n actions=[\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.updateAliases({\n actions: [\n {\n add: {\n index: \"my-data-stream\",\n alias: \"my-alias\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.update_aliases(\n body: {\n \"actions\": [\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->updateAliases([\n \"body\" => [\n \"actions\" => array(\n [\n \"add\" => [\n \"index\" => \"my-data-stream\",\n \"alias\" => \"my-alias\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"actions\":[{\"add\":{\"index\":\"my-data-stream\",\"alias\":\"my-alias\"}}]}' \"$ELASTICSEARCH_URL/_aliases\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -10351,32 +7387,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE my-data-stream/_alias/my-alias\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.delete_alias(\n index=\"my-data-stream\",\n name=\"my-alias\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.deleteAlias({\n index: \"my-data-stream\",\n name: \"my-alias\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.delete_alias(\n index: \"my-data-stream\",\n name: \"my-alias\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->deleteAlias([\n \"index\" => \"my-data-stream\",\n \"name\" => \"my-alias\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-data-stream/_alias/my-alias\"" - } - ], "x-product-feature": "elasticsearch" }, "head": { @@ -10412,32 +7422,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "HEAD _alias/my-alias\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.exists_alias(\n name=\"my-alias\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.existsAlias({\n name: \"my-alias\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.exists_alias(\n name: \"my-alias\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->existsAlias([\n \"name\" => \"my-alias\",\n]);" - }, - { - "lang": "curl", - "source": "curl --head -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_alias/my-alias\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -10472,32 +7456,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _aliases\n{\n \"actions\": [\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.update_aliases(\n actions=[\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.updateAliases({\n actions: [\n {\n add: {\n index: \"my-data-stream\",\n alias: \"my-alias\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.update_aliases(\n body: {\n \"actions\": [\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->updateAliases([\n \"body\" => [\n \"actions\" => array(\n [\n \"add\" => [\n \"index\" => \"my-data-stream\",\n \"alias\" => \"my-alias\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"actions\":[{\"add\":{\"index\":\"my-data-stream\",\"alias\":\"my-alias\"}}]}' \"$ELASTICSEARCH_URL/_aliases\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -10530,32 +7488,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _aliases\n{\n \"actions\": [\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.update_aliases(\n actions=[\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.updateAliases({\n actions: [\n {\n add: {\n index: \"my-data-stream\",\n alias: \"my-alias\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.update_aliases(\n body: {\n \"actions\": [\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->updateAliases([\n \"body\" => [\n \"actions\" => array(\n [\n \"add\" => [\n \"index\" => \"my-data-stream\",\n \"alias\" => \"my-alias\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"actions\":[{\"add\":{\"index\":\"my-data-stream\",\"alias\":\"my-alias\"}}]}' \"$ELASTICSEARCH_URL/_aliases\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -10585,32 +7517,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE my-data-stream/_alias/my-alias\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.delete_alias(\n index=\"my-data-stream\",\n name=\"my-alias\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.deleteAlias({\n index: \"my-data-stream\",\n name: \"my-alias\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.delete_alias(\n index: \"my-data-stream\",\n name: \"my-alias\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->deleteAlias([\n \"index\" => \"my-data-stream\",\n \"name\" => \"my-alias\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-data-stream/_alias/my-alias\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -10645,32 +7551,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _index_template/*?filter_path=index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_index_template(\n name=\"*\",\n filter_path=\"index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getIndexTemplate({\n name: \"*\",\n filter_path:\n \"index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_index_template(\n name: \"*\",\n filter_path: \"index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getIndexTemplate([\n \"name\" => \"*\",\n \"filter_path\" => \"index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_index_template/*?filter_path=index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -10703,32 +7583,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_index_template/template_1\n{\n \"index_patterns\" : [\"template*\"],\n \"priority\" : 1,\n \"template\": {\n \"settings\" : {\n \"number_of_shards\" : 2\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.put_index_template(\n name=\"template_1\",\n index_patterns=[\n \"template*\"\n ],\n priority=1,\n template={\n \"settings\": {\n \"number_of_shards\": 2\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.putIndexTemplate({\n name: \"template_1\",\n index_patterns: [\"template*\"],\n priority: 1,\n template: {\n settings: {\n number_of_shards: 2,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.put_index_template(\n name: \"template_1\",\n body: {\n \"index_patterns\": [\n \"template*\"\n ],\n \"priority\": 1,\n \"template\": {\n \"settings\": {\n \"number_of_shards\": 2\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->putIndexTemplate([\n \"name\" => \"template_1\",\n \"body\" => [\n \"index_patterns\" => array(\n \"template*\",\n ),\n \"priority\" => 1,\n \"template\" => [\n \"settings\" => [\n \"number_of_shards\" => 2,\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_patterns\":[\"template*\"],\"priority\":1,\"template\":{\"settings\":{\"number_of_shards\":2}}}' \"$ELASTICSEARCH_URL/_index_template/template_1\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -10761,32 +7615,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_index_template/template_1\n{\n \"index_patterns\" : [\"template*\"],\n \"priority\" : 1,\n \"template\": {\n \"settings\" : {\n \"number_of_shards\" : 2\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.put_index_template(\n name=\"template_1\",\n index_patterns=[\n \"template*\"\n ],\n priority=1,\n template={\n \"settings\": {\n \"number_of_shards\": 2\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.putIndexTemplate({\n name: \"template_1\",\n index_patterns: [\"template*\"],\n priority: 1,\n template: {\n settings: {\n number_of_shards: 2,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.put_index_template(\n name: \"template_1\",\n body: {\n \"index_patterns\": [\n \"template*\"\n ],\n \"priority\": 1,\n \"template\": {\n \"settings\": {\n \"number_of_shards\": 2\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->putIndexTemplate([\n \"name\" => \"template_1\",\n \"body\" => [\n \"index_patterns\" => array(\n \"template*\",\n ),\n \"priority\" => 1,\n \"template\" => [\n \"settings\" => [\n \"number_of_shards\" => 2,\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_patterns\":[\"template*\"],\"priority\":1,\"template\":{\"settings\":{\"number_of_shards\":2}}}' \"$ELASTICSEARCH_URL/_index_template/template_1\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -10842,32 +7670,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_index_template/my-index-template\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.delete_index_template(\n name=\"my-index-template\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.deleteIndexTemplate({\n name: \"my-index-template\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.delete_index_template(\n name: \"my-index-template\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->deleteIndexTemplate([\n \"name\" => \"my-index-template\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_index_template/my-index-template\"" - } - ], "x-product-feature": "elasticsearch" }, "head": { @@ -10963,32 +7765,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _alias\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_alias()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getAlias();" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_alias" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getAlias();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_alias\"" - } - ], "x-product-feature": "elasticsearch" }, "head": { @@ -11021,32 +7797,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "HEAD _alias/my-alias\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.exists_alias(\n name=\"my-alias\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.existsAlias({\n name: \"my-alias\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.exists_alias(\n name: \"my-alias\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->existsAlias([\n \"name\" => \"my-alias\",\n]);" - }, - { - "lang": "curl", - "source": "curl --head -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_alias/my-alias\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -11127,32 +7877,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET .ds-metrics-2023.03.22-000001/_lifecycle/explain\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.explain_data_lifecycle(\n index=\".ds-metrics-2023.03.22-000001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.explainDataLifecycle({\n index: \".ds-metrics-2023.03.22-000001\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.explain_data_lifecycle(\n index: \".ds-metrics-2023.03.22-000001\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->explainDataLifecycle([\n \"index\" => \".ds-metrics-2023.03.22-000001\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/.ds-metrics-2023.03.22-000001/_lifecycle/explain\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -11184,32 +7908,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _alias\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_alias()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getAlias();" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_alias" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getAlias();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_alias\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -11244,32 +7942,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _alias\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_alias()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getAlias();" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_alias" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getAlias();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_alias\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -11354,32 +8026,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_data_stream/{name}/_lifecycle?human&pretty\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_data_lifecycle(\n name=\"{name}\",\n human=True,\n pretty=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getDataLifecycle({\n name: \"{name}\",\n human: \"true\",\n pretty: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_data_lifecycle(\n name: \"{name}\",\n human: \"true\",\n pretty: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getDataLifecycle([\n \"name\" => \"{name}\",\n \"human\" => \"true\",\n \"pretty\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_data_stream/%7Bname%7D/_lifecycle?human&pretty\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -11483,32 +8129,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _data_stream/my-data-stream/_lifecycle\n{\n \"data_retention\": \"7d\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.put_data_lifecycle(\n name=\"my-data-stream\",\n data_retention=\"7d\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.putDataLifecycle({\n name: \"my-data-stream\",\n data_retention: \"7d\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.put_data_lifecycle(\n name: \"my-data-stream\",\n body: {\n \"data_retention\": \"7d\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->putDataLifecycle([\n \"name\" => \"my-data-stream\",\n \"body\" => [\n \"data_retention\" => \"7d\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"data_retention\":\"7d\"}' \"$ELASTICSEARCH_URL/_data_stream/my-data-stream/_lifecycle\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -11540,32 +8160,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _data_stream/my-data-stream\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_data_stream(\n name=\"my-data-stream\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getDataStream({\n name: \"my-data-stream\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_data_stream(\n name: \"my-data-stream\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getDataStream([\n \"name\" => \"my-data-stream\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_data_stream/my-data-stream\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -11597,32 +8191,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _index_template/*?filter_path=index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_index_template(\n name=\"*\",\n filter_path=\"index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getIndexTemplate({\n name: \"*\",\n filter_path:\n \"index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_index_template(\n name: \"*\",\n filter_path: \"index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getIndexTemplate([\n \"name\" => \"*\",\n \"filter_path\" => \"index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_index_template/*?filter_path=index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -11657,32 +8225,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /books/_mapping\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_mapping(\n index=\"books\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getMapping({\n index: \"books\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_mapping(\n index: \"books\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getMapping([\n \"index\" => \"books\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/books/_mapping\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -11720,32 +8262,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /books/_mapping\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_mapping(\n index=\"books\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getMapping({\n index: \"books\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_mapping(\n index: \"books\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getMapping([\n \"index\" => \"books\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/books/_mapping\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -11790,32 +8306,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /my-index-000001/_mapping\n{\n \"properties\": {\n \"user\": {\n \"properties\": {\n \"name\": {\n \"type\": \"keyword\"\n }\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.put_mapping(\n index=\"my-index-000001\",\n properties={\n \"user\": {\n \"properties\": {\n \"name\": {\n \"type\": \"keyword\"\n }\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.putMapping({\n index: \"my-index-000001\",\n properties: {\n user: {\n properties: {\n name: {\n type: \"keyword\",\n },\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.put_mapping(\n index: \"my-index-000001\",\n body: {\n \"properties\": {\n \"user\": {\n \"properties\": {\n \"name\": {\n \"type\": \"keyword\"\n }\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->putMapping([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"properties\" => [\n \"user\" => [\n \"properties\" => [\n \"name\" => [\n \"type\" => \"keyword\",\n ],\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"properties\":{\"user\":{\"properties\":{\"name\":{\"type\":\"keyword\"}}}}}' \"$ELASTICSEARCH_URL/my-index-000001/_mapping\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -11860,32 +8350,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /my-index-000001/_mapping\n{\n \"properties\": {\n \"user\": {\n \"properties\": {\n \"name\": {\n \"type\": \"keyword\"\n }\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.put_mapping(\n index=\"my-index-000001\",\n properties={\n \"user\": {\n \"properties\": {\n \"name\": {\n \"type\": \"keyword\"\n }\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.putMapping({\n index: \"my-index-000001\",\n properties: {\n user: {\n properties: {\n name: {\n type: \"keyword\",\n },\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.put_mapping(\n index: \"my-index-000001\",\n body: {\n \"properties\": {\n \"user\": {\n \"properties\": {\n \"name\": {\n \"type\": \"keyword\"\n }\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->putMapping([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"properties\" => [\n \"user\" => [\n \"properties\" => [\n \"name\" => [\n \"type\" => \"keyword\",\n ],\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"properties\":{\"user\":{\"properties\":{\"name\":{\"type\":\"keyword\"}}}}}' \"$ELASTICSEARCH_URL/my-index-000001/_mapping\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -11926,32 +8390,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _all/_settings?expand_wildcards=all&filter_path=*.settings.index.*.slowlog\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_settings(\n index=\"_all\",\n expand_wildcards=\"all\",\n filter_path=\"*.settings.index.*.slowlog\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getSettings({\n index: \"_all\",\n expand_wildcards: \"all\",\n filter_path: \"*.settings.index.*.slowlog\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_settings(\n index: \"_all\",\n expand_wildcards: \"all\",\n filter_path: \"*.settings.index.*.slowlog\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getSettings([\n \"index\" => \"_all\",\n \"expand_wildcards\" => \"all\",\n \"filter_path\" => \"*.settings.index.*.slowlog\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_all/_settings?expand_wildcards=all&filter_path=*.settings.index.*.slowlog\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -11999,32 +8437,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /my-index-000001/_settings\n{\n \"index\" : {\n \"number_of_replicas\" : 2\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.put_settings(\n index=\"my-index-000001\",\n settings={\n \"index\": {\n \"number_of_replicas\": 2\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.putSettings({\n index: \"my-index-000001\",\n settings: {\n index: {\n number_of_replicas: 2,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.put_settings(\n index: \"my-index-000001\",\n body: {\n \"index\": {\n \"number_of_replicas\": 2\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->putSettings([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"index\" => [\n \"number_of_replicas\" => 2,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index\":{\"number_of_replicas\":2}}' \"$ELASTICSEARCH_URL/my-index-000001/_settings\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -12068,32 +8480,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _all/_settings?expand_wildcards=all&filter_path=*.settings.index.*.slowlog\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_settings(\n index=\"_all\",\n expand_wildcards=\"all\",\n filter_path=\"*.settings.index.*.slowlog\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getSettings({\n index: \"_all\",\n expand_wildcards: \"all\",\n filter_path: \"*.settings.index.*.slowlog\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_settings(\n index: \"_all\",\n expand_wildcards: \"all\",\n filter_path: \"*.settings.index.*.slowlog\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getSettings([\n \"index\" => \"_all\",\n \"expand_wildcards\" => \"all\",\n \"filter_path\" => \"*.settings.index.*.slowlog\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_all/_settings?expand_wildcards=all&filter_path=*.settings.index.*.slowlog\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -12144,32 +8530,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /my-index-000001/_settings\n{\n \"index\" : {\n \"number_of_replicas\" : 2\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.put_settings(\n index=\"my-index-000001\",\n settings={\n \"index\": {\n \"number_of_replicas\": 2\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.putSettings({\n index: \"my-index-000001\",\n settings: {\n index: {\n number_of_replicas: 2,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.put_settings(\n index: \"my-index-000001\",\n body: {\n \"index\": {\n \"number_of_replicas\": 2\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->putSettings([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"index\" => [\n \"number_of_replicas\" => 2,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index\":{\"number_of_replicas\":2}}' \"$ELASTICSEARCH_URL/my-index-000001/_settings\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -12216,32 +8576,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _all/_settings?expand_wildcards=all&filter_path=*.settings.index.*.slowlog\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_settings(\n index=\"_all\",\n expand_wildcards=\"all\",\n filter_path=\"*.settings.index.*.slowlog\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getSettings({\n index: \"_all\",\n expand_wildcards: \"all\",\n filter_path: \"*.settings.index.*.slowlog\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_settings(\n index: \"_all\",\n expand_wildcards: \"all\",\n filter_path: \"*.settings.index.*.slowlog\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getSettings([\n \"index\" => \"_all\",\n \"expand_wildcards\" => \"all\",\n \"filter_path\" => \"*.settings.index.*.slowlog\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_all/_settings?expand_wildcards=all&filter_path=*.settings.index.*.slowlog\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -12285,32 +8619,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _all/_settings?expand_wildcards=all&filter_path=*.settings.index.*.slowlog\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.get_settings(\n index=\"_all\",\n expand_wildcards=\"all\",\n filter_path=\"*.settings.index.*.slowlog\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.getSettings({\n index: \"_all\",\n expand_wildcards: \"all\",\n filter_path: \"*.settings.index.*.slowlog\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.get_settings(\n index: \"_all\",\n expand_wildcards: \"all\",\n filter_path: \"*.settings.index.*.slowlog\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->getSettings([\n \"index\" => \"_all\",\n \"expand_wildcards\" => \"all\",\n \"filter_path\" => \"*.settings.index.*.slowlog\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_all/_settings?expand_wildcards=all&filter_path=*.settings.index.*.slowlog\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -12368,32 +8676,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _data_stream/_migrate/my-time-series-data\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.migrate_to_data_stream(\n name=\"my-time-series-data\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.migrateToDataStream({\n name: \"my-time-series-data\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.migrate_to_data_stream(\n name: \"my-time-series-data\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->migrateToDataStream([\n \"name\" => \"my-time-series-data\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_data_stream/_migrate/my-time-series-data\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -12446,32 +8728,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _data_stream/_modify\n{\n \"actions\": [\n {\n \"remove_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001\"\n }\n },\n {\n \"add_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001-downsample\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.modify_data_stream(\n actions=[\n {\n \"remove_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001\"\n }\n },\n {\n \"add_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001-downsample\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.modifyDataStream({\n actions: [\n {\n remove_backing_index: {\n data_stream: \"my-data-stream\",\n index: \".ds-my-data-stream-2023.07.26-000001\",\n },\n },\n {\n add_backing_index: {\n data_stream: \"my-data-stream\",\n index: \".ds-my-data-stream-2023.07.26-000001-downsample\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.modify_data_stream(\n body: {\n \"actions\": [\n {\n \"remove_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001\"\n }\n },\n {\n \"add_backing_index\": {\n \"data_stream\": \"my-data-stream\",\n \"index\": \".ds-my-data-stream-2023.07.26-000001-downsample\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->modifyDataStream([\n \"body\" => [\n \"actions\" => array(\n [\n \"remove_backing_index\" => [\n \"data_stream\" => \"my-data-stream\",\n \"index\" => \".ds-my-data-stream-2023.07.26-000001\",\n ],\n ],\n [\n \"add_backing_index\" => [\n \"data_stream\" => \"my-data-stream\",\n \"index\" => \".ds-my-data-stream-2023.07.26-000001-downsample\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"actions\":[{\"remove_backing_index\":{\"data_stream\":\"my-data-stream\",\"index\":\".ds-my-data-stream-2023.07.26-000001\"}},{\"add_backing_index\":{\"data_stream\":\"my-data-stream\",\"index\":\".ds-my-data-stream-2023.07.26-000001-downsample\"}}]}' \"$ELASTICSEARCH_URL/_data_stream/_modify\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -12500,32 +8756,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _refresh\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.refresh()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.refresh();" - }, - { - "lang": "Ruby", - "source": "response = client.indices.refresh" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->refresh();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_refresh\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -12552,32 +8782,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _refresh\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.refresh()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.refresh();" - }, - { - "lang": "Ruby", - "source": "response = client.indices.refresh" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->refresh();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_refresh\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -12609,32 +8813,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _refresh\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.refresh()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.refresh();" - }, - { - "lang": "Ruby", - "source": "response = client.indices.refresh" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->refresh();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_refresh\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -12664,32 +8842,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _refresh\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.refresh()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.refresh();" - }, - { - "lang": "Ruby", - "source": "response = client.indices.refresh" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->refresh();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_refresh\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -12788,32 +8940,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_resolve/index/f*,remoteCluster1:bar*?expand_wildcards=all\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.resolve_index(\n name=\"f*,remoteCluster1:bar*\",\n expand_wildcards=\"all\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.resolveIndex({\n name: \"f*,remoteCluster1:bar*\",\n expand_wildcards: \"all\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.resolve_index(\n name: \"f*,remoteCluster1:bar*\",\n expand_wildcards: \"all\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->resolveIndex([\n \"name\" => \"f*,remoteCluster1:bar*\",\n \"expand_wildcards\" => \"all\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_resolve/index/f*,remoteCluster1:bar*?expand_wildcards=all\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -12854,32 +8980,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST my-data-stream/_rollover\n{\n \"conditions\": {\n \"max_age\": \"7d\",\n \"max_docs\": 1000,\n \"max_primary_shard_size\": \"50gb\",\n \"max_primary_shard_docs\": \"2000\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.rollover(\n alias=\"my-data-stream\",\n conditions={\n \"max_age\": \"7d\",\n \"max_docs\": 1000,\n \"max_primary_shard_size\": \"50gb\",\n \"max_primary_shard_docs\": \"2000\"\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.rollover({\n alias: \"my-data-stream\",\n conditions: {\n max_age: \"7d\",\n max_docs: 1000,\n max_primary_shard_size: \"50gb\",\n max_primary_shard_docs: \"2000\",\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.rollover(\n alias: \"my-data-stream\",\n body: {\n \"conditions\": {\n \"max_age\": \"7d\",\n \"max_docs\": 1000,\n \"max_primary_shard_size\": \"50gb\",\n \"max_primary_shard_docs\": \"2000\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->rollover([\n \"alias\" => \"my-data-stream\",\n \"body\" => [\n \"conditions\" => [\n \"max_age\" => \"7d\",\n \"max_docs\" => 1000,\n \"max_primary_shard_size\" => \"50gb\",\n \"max_primary_shard_docs\" => \"2000\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"conditions\":{\"max_age\":\"7d\",\"max_docs\":1000,\"max_primary_shard_size\":\"50gb\",\"max_primary_shard_docs\":\"2000\"}}' \"$ELASTICSEARCH_URL/my-data-stream/_rollover\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -12923,32 +9023,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST my-data-stream/_rollover\n{\n \"conditions\": {\n \"max_age\": \"7d\",\n \"max_docs\": 1000,\n \"max_primary_shard_size\": \"50gb\",\n \"max_primary_shard_docs\": \"2000\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.rollover(\n alias=\"my-data-stream\",\n conditions={\n \"max_age\": \"7d\",\n \"max_docs\": 1000,\n \"max_primary_shard_size\": \"50gb\",\n \"max_primary_shard_docs\": \"2000\"\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.rollover({\n alias: \"my-data-stream\",\n conditions: {\n max_age: \"7d\",\n max_docs: 1000,\n max_primary_shard_size: \"50gb\",\n max_primary_shard_docs: \"2000\",\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.rollover(\n alias: \"my-data-stream\",\n body: {\n \"conditions\": {\n \"max_age\": \"7d\",\n \"max_docs\": 1000,\n \"max_primary_shard_size\": \"50gb\",\n \"max_primary_shard_docs\": \"2000\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->rollover([\n \"alias\" => \"my-data-stream\",\n \"body\" => [\n \"conditions\" => [\n \"max_age\" => \"7d\",\n \"max_docs\" => 1000,\n \"max_primary_shard_size\" => \"50gb\",\n \"max_primary_shard_docs\" => \"2000\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"conditions\":{\"max_age\":\"7d\",\"max_docs\":1000,\"max_primary_shard_size\":\"50gb\",\"max_primary_shard_docs\":\"2000\"}}' \"$ELASTICSEARCH_URL/my-data-stream/_rollover\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -13046,32 +9120,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_index_template/_simulate_index/my-index-000001\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.simulate_index_template(\n name=\"my-index-000001\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.simulateIndexTemplate({\n name: \"my-index-000001\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.simulate_index_template(\n name: \"my-index-000001\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->simulateIndexTemplate([\n \"name\" => \"my-index-000001\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_index_template/_simulate_index/my-index-000001\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -13106,32 +9154,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_index_template/_simulate\n{\n \"index_patterns\": [\"my-index-*\"],\n \"composed_of\": [\"ct2\"],\n \"priority\": 10,\n \"template\": {\n \"settings\": {\n \"index.number_of_replicas\": 1\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.simulate_template(\n index_patterns=[\n \"my-index-*\"\n ],\n composed_of=[\n \"ct2\"\n ],\n priority=10,\n template={\n \"settings\": {\n \"index.number_of_replicas\": 1\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.simulateTemplate({\n index_patterns: [\"my-index-*\"],\n composed_of: [\"ct2\"],\n priority: 10,\n template: {\n settings: {\n \"index.number_of_replicas\": 1,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.simulate_template(\n body: {\n \"index_patterns\": [\n \"my-index-*\"\n ],\n \"composed_of\": [\n \"ct2\"\n ],\n \"priority\": 10,\n \"template\": {\n \"settings\": {\n \"index.number_of_replicas\": 1\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->simulateTemplate([\n \"body\" => [\n \"index_patterns\" => array(\n \"my-index-*\",\n ),\n \"composed_of\" => array(\n \"ct2\",\n ),\n \"priority\" => 10,\n \"template\" => [\n \"settings\" => [\n \"index.number_of_replicas\" => 1,\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_patterns\":[\"my-index-*\"],\"composed_of\":[\"ct2\"],\"priority\":10,\"template\":{\"settings\":{\"index.number_of_replicas\":1}}}' \"$ELASTICSEARCH_URL/_index_template/_simulate\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -13169,32 +9191,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_index_template/_simulate\n{\n \"index_patterns\": [\"my-index-*\"],\n \"composed_of\": [\"ct2\"],\n \"priority\": 10,\n \"template\": {\n \"settings\": {\n \"index.number_of_replicas\": 1\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.simulate_template(\n index_patterns=[\n \"my-index-*\"\n ],\n composed_of=[\n \"ct2\"\n ],\n priority=10,\n template={\n \"settings\": {\n \"index.number_of_replicas\": 1\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.simulateTemplate({\n index_patterns: [\"my-index-*\"],\n composed_of: [\"ct2\"],\n priority: 10,\n template: {\n settings: {\n \"index.number_of_replicas\": 1,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.simulate_template(\n body: {\n \"index_patterns\": [\n \"my-index-*\"\n ],\n \"composed_of\": [\n \"ct2\"\n ],\n \"priority\": 10,\n \"template\": {\n \"settings\": {\n \"index.number_of_replicas\": 1\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->simulateTemplate([\n \"body\" => [\n \"index_patterns\" => array(\n \"my-index-*\",\n ),\n \"composed_of\" => array(\n \"ct2\",\n ),\n \"priority\" => 10,\n \"template\" => [\n \"settings\" => [\n \"index.number_of_replicas\" => 1,\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index_patterns\":[\"my-index-*\"],\"composed_of\":[\"ct2\"],\"priority\":10,\"template\":{\"settings\":{\"index.number_of_replicas\":1}}}' \"$ELASTICSEARCH_URL/_index_template/_simulate\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -13266,32 +9262,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _aliases\n{\n \"actions\": [\n {\n \"add\": {\n \"index\": \"logs-nginx.access-prod\",\n \"alias\": \"logs\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.indices.update_aliases(\n actions=[\n {\n \"add\": {\n \"index\": \"logs-nginx.access-prod\",\n \"alias\": \"logs\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.updateAliases({\n actions: [\n {\n add: {\n index: \"logs-nginx.access-prod\",\n alias: \"logs\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.update_aliases(\n body: {\n \"actions\": [\n {\n \"add\": {\n \"index\": \"logs-nginx.access-prod\",\n \"alias\": \"logs\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->updateAliases([\n \"body\" => [\n \"actions\" => array(\n [\n \"add\" => [\n \"index\" => \"logs-nginx.access-prod\",\n \"alias\" => \"logs\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"actions\":[{\"add\":{\"index\":\"logs-nginx.access-prod\",\"alias\":\"logs\"}}]}' \"$ELASTICSEARCH_URL/_aliases\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -13350,32 +9320,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index-000001/_validate/query?q=user.id:kimchy\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.validate_query(\n index=\"my-index-000001\",\n q=\"user.id:kimchy\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.validateQuery({\n index: \"my-index-000001\",\n q: \"user.id:kimchy\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.validate_query(\n index: \"my-index-000001\",\n q: \"user.id:kimchy\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->validateQuery([\n \"index\" => \"my-index-000001\",\n \"q\" => \"user.id:kimchy\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_validate/query?q=user.id:kimchy\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -13432,32 +9376,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index-000001/_validate/query?q=user.id:kimchy\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.validate_query(\n index=\"my-index-000001\",\n q=\"user.id:kimchy\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.validateQuery({\n index: \"my-index-000001\",\n q: \"user.id:kimchy\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.validate_query(\n index: \"my-index-000001\",\n q: \"user.id:kimchy\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->validateQuery([\n \"index\" => \"my-index-000001\",\n \"q\" => \"user.id:kimchy\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_validate/query?q=user.id:kimchy\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -13519,32 +9437,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index-000001/_validate/query?q=user.id:kimchy\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.validate_query(\n index=\"my-index-000001\",\n q=\"user.id:kimchy\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.validateQuery({\n index: \"my-index-000001\",\n q: \"user.id:kimchy\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.validate_query(\n index: \"my-index-000001\",\n q: \"user.id:kimchy\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->validateQuery([\n \"index\" => \"my-index-000001\",\n \"q\" => \"user.id:kimchy\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_validate/query?q=user.id:kimchy\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -13604,32 +9496,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index-000001/_validate/query?q=user.id:kimchy\n" - }, - { - "lang": "Python", - "source": "resp = client.indices.validate_query(\n index=\"my-index-000001\",\n q=\"user.id:kimchy\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.indices.validateQuery({\n index: \"my-index-000001\",\n q: \"user.id:kimchy\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.indices.validate_query(\n index: \"my-index-000001\",\n q: \"user.id:kimchy\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->indices()->validateQuery([\n \"index\" => \"my-index-000001\",\n \"q\" => \"user.id:kimchy\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_validate/query?q=user.id:kimchy\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -13710,32 +9576,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _inference/chat_completion/openai-completion/_stream\n{\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.chat_completion_unified(\n inference_id=\"openai-completion\",\n chat_completion_request={\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.chatCompletionUnified({\n inference_id: \"openai-completion\",\n chat_completion_request: {\n model: \"gpt-4o\",\n messages: [\n {\n role: \"user\",\n content: \"What is Elastic?\",\n },\n ],\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.chat_completion_unified(\n inference_id: \"openai-completion\",\n body: {\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->chatCompletionUnified([\n \"inference_id\" => \"openai-completion\",\n \"body\" => [\n \"model\" => \"gpt-4o\",\n \"messages\" => array(\n [\n \"role\" => \"user\",\n \"content\" => \"What is Elastic?\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"model\":\"gpt-4o\",\"messages\":[{\"role\":\"user\",\"content\":\"What is Elastic?\"}]}' \"$ELASTICSEARCH_URL/_inference/chat_completion/openai-completion/_stream\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -13827,32 +9667,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _inference/completion/openai_chat_completions\n{\n \"input\": \"What is Elastic?\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.completion(\n inference_id=\"openai_chat_completions\",\n input=\"What is Elastic?\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.completion({\n inference_id: \"openai_chat_completions\",\n input: \"What is Elastic?\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.completion(\n inference_id: \"openai_chat_completions\",\n body: {\n \"input\": \"What is Elastic?\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->completion([\n \"inference_id\" => \"openai_chat_completions\",\n \"body\" => [\n \"input\" => \"What is Elastic?\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"input\":\"What is Elastic?\"}' \"$ELASTICSEARCH_URL/_inference/completion/openai_chat_completions\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -13874,32 +9688,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _inference/sparse_embedding/my-elser-model\n" - }, - { - "lang": "Python", - "source": "resp = client.inference.get(\n task_type=\"sparse_embedding\",\n inference_id=\"my-elser-model\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.get({\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.get(\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->get([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"my-elser-model\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "put": { @@ -13923,32 +9711,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/rerank/my-rerank-model\n{\n \"service\": \"cohere\",\n \"service_settings\": {\n \"model_id\": \"rerank-english-v3.0\",\n \"api_key\": \"{{COHERE_API_KEY}}\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"my-rerank-model\",\n inference_config={\n \"service\": \"cohere\",\n \"service_settings\": {\n \"model_id\": \"rerank-english-v3.0\",\n \"api_key\": \"{{COHERE_API_KEY}}\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"my-rerank-model\",\n inference_config: {\n service: \"cohere\",\n service_settings: {\n model_id: \"rerank-english-v3.0\",\n api_key: \"{{COHERE_API_KEY}}\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"my-rerank-model\",\n body: {\n \"service\": \"cohere\",\n \"service_settings\": {\n \"model_id\": \"rerank-english-v3.0\",\n \"api_key\": \"{{COHERE_API_KEY}}\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"my-rerank-model\",\n \"body\" => [\n \"service\" => \"cohere\",\n \"service_settings\" => [\n \"model_id\" => \"rerank-english-v3.0\",\n \"api_key\" => \"{{COHERE_API_KEY}}\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"cohere\",\"service_settings\":{\"model_id\":\"rerank-english-v3.0\",\"api_key\":\"{{COHERE_API_KEY}}\"}}' \"$ELASTICSEARCH_URL/_inference/rerank/my-rerank-model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -14000,32 +9762,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_inference/sparse_embedding/my-elser-model\n" - }, - { - "lang": "Python", - "source": "resp = client.inference.delete(\n task_type=\"sparse_embedding\",\n inference_id=\"my-elser-model\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.delete({\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.delete(\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->delete([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"my-elser-model\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -14050,32 +9786,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _inference/sparse_embedding/my-elser-model\n" - }, - { - "lang": "Python", - "source": "resp = client.inference.get(\n task_type=\"sparse_embedding\",\n inference_id=\"my-elser-model\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.get({\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.get(\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->get([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"my-elser-model\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "put": { @@ -14102,32 +9812,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/rerank/my-rerank-model\n{\n \"service\": \"cohere\",\n \"service_settings\": {\n \"model_id\": \"rerank-english-v3.0\",\n \"api_key\": \"{{COHERE_API_KEY}}\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"my-rerank-model\",\n inference_config={\n \"service\": \"cohere\",\n \"service_settings\": {\n \"model_id\": \"rerank-english-v3.0\",\n \"api_key\": \"{{COHERE_API_KEY}}\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"my-rerank-model\",\n inference_config: {\n service: \"cohere\",\n service_settings: {\n model_id: \"rerank-english-v3.0\",\n api_key: \"{{COHERE_API_KEY}}\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"my-rerank-model\",\n body: {\n \"service\": \"cohere\",\n \"service_settings\": {\n \"model_id\": \"rerank-english-v3.0\",\n \"api_key\": \"{{COHERE_API_KEY}}\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"my-rerank-model\",\n \"body\" => [\n \"service\" => \"cohere\",\n \"service_settings\" => [\n \"model_id\" => \"rerank-english-v3.0\",\n \"api_key\" => \"{{COHERE_API_KEY}}\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"cohere\",\"service_settings\":{\"model_id\":\"rerank-english-v3.0\",\"api_key\":\"{{COHERE_API_KEY}}\"}}' \"$ELASTICSEARCH_URL/_inference/rerank/my-rerank-model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -14185,32 +9869,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_inference/sparse_embedding/my-elser-model\n" - }, - { - "lang": "Python", - "source": "resp = client.inference.delete(\n task_type=\"sparse_embedding\",\n inference_id=\"my-elser-model\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.delete({\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.delete(\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->delete([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"my-elser-model\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -14227,32 +9885,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _inference/sparse_embedding/my-elser-model\n" - }, - { - "lang": "Python", - "source": "resp = client.inference.get(\n task_type=\"sparse_embedding\",\n inference_id=\"my-elser-model\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.get({\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.get(\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->get([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"my-elser-model\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -14350,32 +9982,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/completion/alibabacloud_ai_search_completion\n{\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"host\" : \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-qwen-turbo\",\n \"workspace\" : \"default\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"alibabacloud_ai_search_completion\",\n inference_config={\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-qwen-turbo\",\n \"workspace\": \"default\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"alibabacloud_ai_search_completion\",\n inference_config: {\n service: \"alibabacloud-ai-search\",\n service_settings: {\n host: \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n api_key: \"AlibabaCloud-API-Key\",\n service_id: \"ops-qwen-turbo\",\n workspace: \"default\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"alibabacloud_ai_search_completion\",\n body: {\n \"service\": \"alibabacloud-ai-search\",\n \"service_settings\": {\n \"host\": \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"api_key\": \"AlibabaCloud-API-Key\",\n \"service_id\": \"ops-qwen-turbo\",\n \"workspace\": \"default\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"alibabacloud_ai_search_completion\",\n \"body\" => [\n \"service\" => \"alibabacloud-ai-search\",\n \"service_settings\" => [\n \"host\" => \"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\n \"api_key\" => \"AlibabaCloud-API-Key\",\n \"service_id\" => \"ops-qwen-turbo\",\n \"workspace\" => \"default\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"alibabacloud-ai-search\",\"service_settings\":{\"host\":\"default-j01.platform-cn-shanghai.opensearch.aliyuncs.com\",\"api_key\":\"AlibabaCloud-API-Key\",\"service_id\":\"ops-qwen-turbo\",\"workspace\":\"default\"}}' \"$ELASTICSEARCH_URL/_inference/completion/alibabacloud_ai_search_completion\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -14463,32 +10069,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/text_embedding/amazon_bedrock_embeddings\n{\n \"service\": \"amazonbedrock\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-embed-text-v2:0\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"amazon_bedrock_embeddings\",\n inference_config={\n \"service\": \"amazonbedrock\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-embed-text-v2:0\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"amazon_bedrock_embeddings\",\n inference_config: {\n service: \"amazonbedrock\",\n service_settings: {\n access_key: \"AWS-access-key\",\n secret_key: \"AWS-secret-key\",\n region: \"us-east-1\",\n provider: \"amazontitan\",\n model: \"amazon.titan-embed-text-v2:0\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"amazon_bedrock_embeddings\",\n body: {\n \"service\": \"amazonbedrock\",\n \"service_settings\": {\n \"access_key\": \"AWS-access-key\",\n \"secret_key\": \"AWS-secret-key\",\n \"region\": \"us-east-1\",\n \"provider\": \"amazontitan\",\n \"model\": \"amazon.titan-embed-text-v2:0\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"amazon_bedrock_embeddings\",\n \"body\" => [\n \"service\" => \"amazonbedrock\",\n \"service_settings\" => [\n \"access_key\" => \"AWS-access-key\",\n \"secret_key\" => \"AWS-secret-key\",\n \"region\" => \"us-east-1\",\n \"provider\" => \"amazontitan\",\n \"model\" => \"amazon.titan-embed-text-v2:0\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"amazonbedrock\",\"service_settings\":{\"access_key\":\"AWS-access-key\",\"secret_key\":\"AWS-secret-key\",\"region\":\"us-east-1\",\"provider\":\"amazontitan\",\"model\":\"amazon.titan-embed-text-v2:0\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/amazon_bedrock_embeddings\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -14570,32 +10150,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/completion/anthropic_completion\n{\n \"service\": \"anthropic\",\n \"service_settings\": {\n \"api_key\": \"Anthropic-Api-Key\",\n \"model_id\": \"Model-ID\"\n },\n \"task_settings\": {\n \"max_tokens\": 1024\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"anthropic_completion\",\n inference_config={\n \"service\": \"anthropic\",\n \"service_settings\": {\n \"api_key\": \"Anthropic-Api-Key\",\n \"model_id\": \"Model-ID\"\n },\n \"task_settings\": {\n \"max_tokens\": 1024\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"anthropic_completion\",\n inference_config: {\n service: \"anthropic\",\n service_settings: {\n api_key: \"Anthropic-Api-Key\",\n model_id: \"Model-ID\",\n },\n task_settings: {\n max_tokens: 1024,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"anthropic_completion\",\n body: {\n \"service\": \"anthropic\",\n \"service_settings\": {\n \"api_key\": \"Anthropic-Api-Key\",\n \"model_id\": \"Model-ID\"\n },\n \"task_settings\": {\n \"max_tokens\": 1024\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"anthropic_completion\",\n \"body\" => [\n \"service\" => \"anthropic\",\n \"service_settings\" => [\n \"api_key\" => \"Anthropic-Api-Key\",\n \"model_id\" => \"Model-ID\",\n ],\n \"task_settings\" => [\n \"max_tokens\" => 1024,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"anthropic\",\"service_settings\":{\"api_key\":\"Anthropic-Api-Key\",\"model_id\":\"Model-ID\"},\"task_settings\":{\"max_tokens\":1024}}' \"$ELASTICSEARCH_URL/_inference/completion/anthropic_completion\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -14683,32 +10237,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/text_embedding/azure_ai_studio_embeddings\n{\n \"service\": \"azureaistudio\",\n \"service_settings\": {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-Uri\",\n \"provider\": \"openai\",\n \"endpoint_type\": \"token\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"azure_ai_studio_embeddings\",\n inference_config={\n \"service\": \"azureaistudio\",\n \"service_settings\": {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-Uri\",\n \"provider\": \"openai\",\n \"endpoint_type\": \"token\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"azure_ai_studio_embeddings\",\n inference_config: {\n service: \"azureaistudio\",\n service_settings: {\n api_key: \"Azure-AI-Studio-API-key\",\n target: \"Target-Uri\",\n provider: \"openai\",\n endpoint_type: \"token\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"azure_ai_studio_embeddings\",\n body: {\n \"service\": \"azureaistudio\",\n \"service_settings\": {\n \"api_key\": \"Azure-AI-Studio-API-key\",\n \"target\": \"Target-Uri\",\n \"provider\": \"openai\",\n \"endpoint_type\": \"token\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"azure_ai_studio_embeddings\",\n \"body\" => [\n \"service\" => \"azureaistudio\",\n \"service_settings\" => [\n \"api_key\" => \"Azure-AI-Studio-API-key\",\n \"target\" => \"Target-Uri\",\n \"provider\" => \"openai\",\n \"endpoint_type\" => \"token\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"azureaistudio\",\"service_settings\":{\"api_key\":\"Azure-AI-Studio-API-key\",\"target\":\"Target-Uri\",\"provider\":\"openai\",\"endpoint_type\":\"token\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/azure_ai_studio_embeddings\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -14796,32 +10324,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/text_embedding/azure_openai_embeddings\n{\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"azure_openai_embeddings\",\n inference_config={\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"azure_openai_embeddings\",\n inference_config: {\n service: \"azureopenai\",\n service_settings: {\n api_key: \"Api-Key\",\n resource_name: \"Resource-name\",\n deployment_id: \"Deployment-id\",\n api_version: \"2024-02-01\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"azure_openai_embeddings\",\n body: {\n \"service\": \"azureopenai\",\n \"service_settings\": {\n \"api_key\": \"Api-Key\",\n \"resource_name\": \"Resource-name\",\n \"deployment_id\": \"Deployment-id\",\n \"api_version\": \"2024-02-01\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"azure_openai_embeddings\",\n \"body\" => [\n \"service\" => \"azureopenai\",\n \"service_settings\" => [\n \"api_key\" => \"Api-Key\",\n \"resource_name\" => \"Resource-name\",\n \"deployment_id\" => \"Deployment-id\",\n \"api_version\" => \"2024-02-01\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"azureopenai\",\"service_settings\":{\"api_key\":\"Api-Key\",\"resource_name\":\"Resource-name\",\"deployment_id\":\"Deployment-id\",\"api_version\":\"2024-02-01\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/azure_openai_embeddings\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -14909,32 +10411,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/text_embedding/cohere-embeddings\n{\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-Api-key\",\n \"model_id\": \"embed-english-light-v3.0\",\n \"embedding_type\": \"byte\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"cohere-embeddings\",\n inference_config={\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-Api-key\",\n \"model_id\": \"embed-english-light-v3.0\",\n \"embedding_type\": \"byte\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"cohere-embeddings\",\n inference_config: {\n service: \"cohere\",\n service_settings: {\n api_key: \"Cohere-Api-key\",\n model_id: \"embed-english-light-v3.0\",\n embedding_type: \"byte\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"cohere-embeddings\",\n body: {\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-Api-key\",\n \"model_id\": \"embed-english-light-v3.0\",\n \"embedding_type\": \"byte\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"cohere-embeddings\",\n \"body\" => [\n \"service\" => \"cohere\",\n \"service_settings\" => [\n \"api_key\" => \"Cohere-Api-key\",\n \"model_id\" => \"embed-english-light-v3.0\",\n \"embedding_type\" => \"byte\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"cohere\",\"service_settings\":{\"api_key\":\"Cohere-Api-key\",\"model_id\":\"embed-english-light-v3.0\",\"embedding_type\":\"byte\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/cohere-embeddings\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -15048,32 +10524,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/sparse_embedding/my-elser-model\n{\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"adaptive_allocations\": { \n \"enabled\": true,\n \"min_number_of_allocations\": 1,\n \"max_number_of_allocations\": 4\n },\n \"num_threads\": 1,\n \"model_id\": \".elser_model_2\" \n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"sparse_embedding\",\n inference_id=\"my-elser-model\",\n inference_config={\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"adaptive_allocations\": {\n \"enabled\": True,\n \"min_number_of_allocations\": 1,\n \"max_number_of_allocations\": 4\n },\n \"num_threads\": 1,\n \"model_id\": \".elser_model_2\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n inference_config: {\n service: \"elasticsearch\",\n service_settings: {\n adaptive_allocations: {\n enabled: true,\n min_number_of_allocations: 1,\n max_number_of_allocations: 4,\n },\n num_threads: 1,\n model_id: \".elser_model_2\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n body: {\n \"service\": \"elasticsearch\",\n \"service_settings\": {\n \"adaptive_allocations\": {\n \"enabled\": true,\n \"min_number_of_allocations\": 1,\n \"max_number_of_allocations\": 4\n },\n \"num_threads\": 1,\n \"model_id\": \".elser_model_2\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"my-elser-model\",\n \"body\" => [\n \"service\" => \"elasticsearch\",\n \"service_settings\" => [\n \"adaptive_allocations\" => [\n \"enabled\" => true,\n \"min_number_of_allocations\" => 1,\n \"max_number_of_allocations\" => 4,\n ],\n \"num_threads\" => 1,\n \"model_id\" => \".elser_model_2\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"elasticsearch\",\"service_settings\":{\"adaptive_allocations\":{\"enabled\":true,\"min_number_of_allocations\":1,\"max_number_of_allocations\":4},\"num_threads\":1,\"model_id\":\".elser_model_2\"}}' \"$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -15165,32 +10615,6 @@ }, "deprecated": true, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/sparse_embedding/my-elser-model\n{\n \"service\": \"elser\",\n \"service_settings\": {\n \"num_allocations\": 1,\n \"num_threads\": 1\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"sparse_embedding\",\n inference_id=\"my-elser-model\",\n inference_config={\n \"service\": \"elser\",\n \"service_settings\": {\n \"num_allocations\": 1,\n \"num_threads\": 1\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n inference_config: {\n service: \"elser\",\n service_settings: {\n num_allocations: 1,\n num_threads: 1,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"sparse_embedding\",\n inference_id: \"my-elser-model\",\n body: {\n \"service\": \"elser\",\n \"service_settings\": {\n \"num_allocations\": 1,\n \"num_threads\": 1\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"sparse_embedding\",\n \"inference_id\" => \"my-elser-model\",\n \"body\" => [\n \"service\" => \"elser\",\n \"service_settings\" => [\n \"num_allocations\" => 1,\n \"num_threads\" => 1,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"elser\",\"service_settings\":{\"num_allocations\":1,\"num_threads\":1}}' \"$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -15270,32 +10694,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/completion/google_ai_studio_completion\n{\n \"service\": \"googleaistudio\",\n \"service_settings\": {\n \"api_key\": \"api-key\",\n \"model_id\": \"model-id\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"google_ai_studio_completion\",\n inference_config={\n \"service\": \"googleaistudio\",\n \"service_settings\": {\n \"api_key\": \"api-key\",\n \"model_id\": \"model-id\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"google_ai_studio_completion\",\n inference_config: {\n service: \"googleaistudio\",\n service_settings: {\n api_key: \"api-key\",\n model_id: \"model-id\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"google_ai_studio_completion\",\n body: {\n \"service\": \"googleaistudio\",\n \"service_settings\": {\n \"api_key\": \"api-key\",\n \"model_id\": \"model-id\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"google_ai_studio_completion\",\n \"body\" => [\n \"service\" => \"googleaistudio\",\n \"service_settings\" => [\n \"api_key\" => \"api-key\",\n \"model_id\" => \"model-id\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"googleaistudio\",\"service_settings\":{\"api_key\":\"api-key\",\"model_id\":\"model-id\"}}' \"$ELASTICSEARCH_URL/_inference/completion/google_ai_studio_completion\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -15383,32 +10781,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/text_embedding/google_vertex_ai_embeddingss\n{\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"service_account_json\": \"service-account-json\",\n \"model_id\": \"model-id\",\n \"location\": \"location\",\n \"project_id\": \"project-id\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"google_vertex_ai_embeddingss\",\n inference_config={\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"service_account_json\": \"service-account-json\",\n \"model_id\": \"model-id\",\n \"location\": \"location\",\n \"project_id\": \"project-id\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"google_vertex_ai_embeddingss\",\n inference_config: {\n service: \"googlevertexai\",\n service_settings: {\n service_account_json: \"service-account-json\",\n model_id: \"model-id\",\n location: \"location\",\n project_id: \"project-id\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"google_vertex_ai_embeddingss\",\n body: {\n \"service\": \"googlevertexai\",\n \"service_settings\": {\n \"service_account_json\": \"service-account-json\",\n \"model_id\": \"model-id\",\n \"location\": \"location\",\n \"project_id\": \"project-id\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"google_vertex_ai_embeddingss\",\n \"body\" => [\n \"service\" => \"googlevertexai\",\n \"service_settings\" => [\n \"service_account_json\" => \"service-account-json\",\n \"model_id\" => \"model-id\",\n \"location\" => \"location\",\n \"project_id\" => \"project-id\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"googlevertexai\",\"service_settings\":{\"service_account_json\":\"service-account-json\",\"model_id\":\"model-id\",\"location\":\"location\",\"project_id\":\"project-id\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/google_vertex_ai_embeddingss\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -15488,32 +10860,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/text_embedding/hugging-face-embeddings\n{\n \"service\": \"hugging_face\",\n \"service_settings\": {\n \"api_key\": \"hugging-face-access-token\", \n \"url\": \"url-endpoint\" \n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"hugging-face-embeddings\",\n inference_config={\n \"service\": \"hugging_face\",\n \"service_settings\": {\n \"api_key\": \"hugging-face-access-token\",\n \"url\": \"url-endpoint\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"hugging-face-embeddings\",\n inference_config: {\n service: \"hugging_face\",\n service_settings: {\n api_key: \"hugging-face-access-token\",\n url: \"url-endpoint\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"hugging-face-embeddings\",\n body: {\n \"service\": \"hugging_face\",\n \"service_settings\": {\n \"api_key\": \"hugging-face-access-token\",\n \"url\": \"url-endpoint\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"hugging-face-embeddings\",\n \"body\" => [\n \"service\" => \"hugging_face\",\n \"service_settings\" => [\n \"api_key\" => \"hugging-face-access-token\",\n \"url\" => \"url-endpoint\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"hugging_face\",\"service_settings\":{\"api_key\":\"hugging-face-access-token\",\"url\":\"url-endpoint\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/hugging-face-embeddings\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -15601,32 +10947,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/text_embedding/jinaai-embeddings\n{\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v3\",\n \"api_key\": \"JinaAi-Api-key\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"jinaai-embeddings\",\n inference_config={\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v3\",\n \"api_key\": \"JinaAi-Api-key\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"jinaai-embeddings\",\n inference_config: {\n service: \"jinaai\",\n service_settings: {\n model_id: \"jina-embeddings-v3\",\n api_key: \"JinaAi-Api-key\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"jinaai-embeddings\",\n body: {\n \"service\": \"jinaai\",\n \"service_settings\": {\n \"model_id\": \"jina-embeddings-v3\",\n \"api_key\": \"JinaAi-Api-key\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"jinaai-embeddings\",\n \"body\" => [\n \"service\" => \"jinaai\",\n \"service_settings\" => [\n \"model_id\" => \"jina-embeddings-v3\",\n \"api_key\" => \"JinaAi-Api-key\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"jinaai\",\"service_settings\":{\"model_id\":\"jina-embeddings-v3\",\"api_key\":\"JinaAi-Api-key\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/jinaai-embeddings\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -15705,32 +11025,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/text_embedding/mistral-embeddings-test\n{\n \"service\": \"mistral\",\n \"service_settings\": {\n \"api_key\": \"Mistral-API-Key\",\n \"model\": \"mistral-embed\" \n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"mistral-embeddings-test\",\n inference_config={\n \"service\": \"mistral\",\n \"service_settings\": {\n \"api_key\": \"Mistral-API-Key\",\n \"model\": \"mistral-embed\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"mistral-embeddings-test\",\n inference_config: {\n service: \"mistral\",\n service_settings: {\n api_key: \"Mistral-API-Key\",\n model: \"mistral-embed\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"mistral-embeddings-test\",\n body: {\n \"service\": \"mistral\",\n \"service_settings\": {\n \"api_key\": \"Mistral-API-Key\",\n \"model\": \"mistral-embed\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"mistral-embeddings-test\",\n \"body\" => [\n \"service\" => \"mistral\",\n \"service_settings\" => [\n \"api_key\" => \"Mistral-API-Key\",\n \"model\" => \"mistral-embed\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"mistral\",\"service_settings\":{\"api_key\":\"Mistral-API-Key\",\"model\":\"mistral-embed\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/mistral-embeddings-test\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -15818,32 +11112,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/text_embedding/openai-embeddings\n{\n \"service\": \"openai\",\n \"service_settings\": {\n \"api_key\": \"OpenAI-API-Key\",\n \"model_id\": \"text-embedding-3-small\",\n \"dimensions\": 128\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"openai-embeddings\",\n inference_config={\n \"service\": \"openai\",\n \"service_settings\": {\n \"api_key\": \"OpenAI-API-Key\",\n \"model_id\": \"text-embedding-3-small\",\n \"dimensions\": 128\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"openai-embeddings\",\n inference_config: {\n service: \"openai\",\n service_settings: {\n api_key: \"OpenAI-API-Key\",\n model_id: \"text-embedding-3-small\",\n dimensions: 128,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"openai-embeddings\",\n body: {\n \"service\": \"openai\",\n \"service_settings\": {\n \"api_key\": \"OpenAI-API-Key\",\n \"model_id\": \"text-embedding-3-small\",\n \"dimensions\": 128\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"openai-embeddings\",\n \"body\" => [\n \"service\" => \"openai\",\n \"service_settings\" => [\n \"api_key\" => \"OpenAI-API-Key\",\n \"model_id\" => \"text-embedding-3-small\",\n \"dimensions\" => 128,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"openai\",\"service_settings\":{\"api_key\":\"OpenAI-API-Key\",\"model_id\":\"text-embedding-3-small\",\"dimensions\":128}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/openai-embeddings\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -15931,32 +11199,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/text_embedding/openai-embeddings\n{\n \"service\": \"voyageai\",\n \"service_settings\": {\n \"model_id\": \"voyage-3-large\",\n \"dimensions\": 512\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"openai-embeddings\",\n inference_config={\n \"service\": \"voyageai\",\n \"service_settings\": {\n \"model_id\": \"voyage-3-large\",\n \"dimensions\": 512\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"openai-embeddings\",\n inference_config: {\n service: \"voyageai\",\n service_settings: {\n model_id: \"voyage-3-large\",\n dimensions: 512,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"openai-embeddings\",\n body: {\n \"service\": \"voyageai\",\n \"service_settings\": {\n \"model_id\": \"voyage-3-large\",\n \"dimensions\": 512\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"openai-embeddings\",\n \"body\" => [\n \"service\" => \"voyageai\",\n \"service_settings\" => [\n \"model_id\" => \"voyage-3-large\",\n \"dimensions\" => 512,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"voyageai\",\"service_settings\":{\"model_id\":\"voyage-3-large\",\"dimensions\":512}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/openai-embeddings\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -16032,32 +11274,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _inference/text_embedding/watsonx-embeddings\n{\n \"service\": \"watsonxai\",\n \"service_settings\": {\n \"api_key\": \"Watsonx-API-Key\", \n \"url\": \"Wastonx-URL\", \n \"model_id\": \"ibm/slate-30m-english-rtrvr\",\n \"project_id\": \"IBM-Cloud-ID\", \n \"api_version\": \"2024-03-14\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.put(\n task_type=\"text_embedding\",\n inference_id=\"watsonx-embeddings\",\n inference_config={\n \"service\": \"watsonxai\",\n \"service_settings\": {\n \"api_key\": \"Watsonx-API-Key\",\n \"url\": \"Wastonx-URL\",\n \"model_id\": \"ibm/slate-30m-english-rtrvr\",\n \"project_id\": \"IBM-Cloud-ID\",\n \"api_version\": \"2024-03-14\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.put({\n task_type: \"text_embedding\",\n inference_id: \"watsonx-embeddings\",\n inference_config: {\n service: \"watsonxai\",\n service_settings: {\n api_key: \"Watsonx-API-Key\",\n url: \"Wastonx-URL\",\n model_id: \"ibm/slate-30m-english-rtrvr\",\n project_id: \"IBM-Cloud-ID\",\n api_version: \"2024-03-14\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.put(\n task_type: \"text_embedding\",\n inference_id: \"watsonx-embeddings\",\n body: {\n \"service\": \"watsonxai\",\n \"service_settings\": {\n \"api_key\": \"Watsonx-API-Key\",\n \"url\": \"Wastonx-URL\",\n \"model_id\": \"ibm/slate-30m-english-rtrvr\",\n \"project_id\": \"IBM-Cloud-ID\",\n \"api_version\": \"2024-03-14\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->put([\n \"task_type\" => \"text_embedding\",\n \"inference_id\" => \"watsonx-embeddings\",\n \"body\" => [\n \"service\" => \"watsonxai\",\n \"service_settings\" => [\n \"api_key\" => \"Watsonx-API-Key\",\n \"url\" => \"Wastonx-URL\",\n \"model_id\" => \"ibm/slate-30m-english-rtrvr\",\n \"project_id\" => \"IBM-Cloud-ID\",\n \"api_version\" => \"2024-03-14\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"watsonxai\",\"service_settings\":{\"api_key\":\"Watsonx-API-Key\",\"url\":\"Wastonx-URL\",\"model_id\":\"ibm/slate-30m-english-rtrvr\",\"project_id\":\"IBM-Cloud-ID\",\"api_version\":\"2024-03-14\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/watsonx-embeddings\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -16155,32 +11371,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _inference/rerank/cohere_rerank\n{\n \"input\": [\"luke\", \"like\", \"leia\", \"chewy\",\"r2d2\", \"star\", \"wars\"],\n \"query\": \"star wars main character\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.rerank(\n inference_id=\"cohere_rerank\",\n input=[\n \"luke\",\n \"like\",\n \"leia\",\n \"chewy\",\n \"r2d2\",\n \"star\",\n \"wars\"\n ],\n query=\"star wars main character\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.rerank({\n inference_id: \"cohere_rerank\",\n input: [\"luke\", \"like\", \"leia\", \"chewy\", \"r2d2\", \"star\", \"wars\"],\n query: \"star wars main character\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.rerank(\n inference_id: \"cohere_rerank\",\n body: {\n \"input\": [\n \"luke\",\n \"like\",\n \"leia\",\n \"chewy\",\n \"r2d2\",\n \"star\",\n \"wars\"\n ],\n \"query\": \"star wars main character\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->rerank([\n \"inference_id\" => \"cohere_rerank\",\n \"body\" => [\n \"input\" => array(\n \"luke\",\n \"like\",\n \"leia\",\n \"chewy\",\n \"r2d2\",\n \"star\",\n \"wars\",\n ),\n \"query\" => \"star wars main character\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"input\":[\"luke\",\"like\",\"leia\",\"chewy\",\"r2d2\",\"star\",\"wars\"],\"query\":\"star wars main character\"}' \"$ELASTICSEARCH_URL/_inference/rerank/cohere_rerank\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -16272,32 +11462,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _inference/sparse_embedding/my-elser-model\n{\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.sparse_embedding(\n inference_id=\"my-elser-model\",\n input=\"The sky above the port was the color of television tuned to a dead channel.\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.sparseEmbedding({\n inference_id: \"my-elser-model\",\n input:\n \"The sky above the port was the color of television tuned to a dead channel.\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.sparse_embedding(\n inference_id: \"my-elser-model\",\n body: {\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->sparseEmbedding([\n \"inference_id\" => \"my-elser-model\",\n \"body\" => [\n \"input\" => \"The sky above the port was the color of television tuned to a dead channel.\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"input\":\"The sky above the port was the color of television tuned to a dead channel.\"}' \"$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -16389,32 +11553,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _inference/text_embedding/my-cohere-endpoint\n{\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\",\n \"task_settings\": {\n \"input_type\": \"ingest\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.inference.text_embedding(\n inference_id=\"my-cohere-endpoint\",\n input=\"The sky above the port was the color of television tuned to a dead channel.\",\n task_settings={\n \"input_type\": \"ingest\"\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.inference.textEmbedding({\n inference_id: \"my-cohere-endpoint\",\n input:\n \"The sky above the port was the color of television tuned to a dead channel.\",\n task_settings: {\n input_type: \"ingest\",\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.inference.text_embedding(\n inference_id: \"my-cohere-endpoint\",\n body: {\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\",\n \"task_settings\": {\n \"input_type\": \"ingest\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->inference()->textEmbedding([\n \"inference_id\" => \"my-cohere-endpoint\",\n \"body\" => [\n \"input\" => \"The sky above the port was the color of television tuned to a dead channel.\",\n \"task_settings\" => [\n \"input_type\" => \"ingest\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"input\":\"The sky above the port was the color of television tuned to a dead channel.\",\"task_settings\":{\"input_type\":\"ingest\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/my-cohere-endpoint\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -16469,32 +11607,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /\n" - }, - { - "lang": "Python", - "source": "resp = client.info()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.info();" - }, - { - "lang": "Ruby", - "source": "response = client.info" - }, - { - "lang": "PHP", - "source": "$resp = $client->info();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/\"" - } - ], "x-product-feature": "elasticsearch" }, "head": { @@ -16544,32 +11656,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_ingest/pipeline/my-pipeline-id\n" - }, - { - "lang": "Python", - "source": "resp = client.ingest.get_pipeline(\n id=\"my-pipeline-id\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ingest.getPipeline({\n id: \"my-pipeline-id\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ingest.get_pipeline(\n id: \"my-pipeline-id\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ingest()->getPipeline([\n \"id\" => \"my-pipeline-id\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ingest/pipeline/my-pipeline-id\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -16689,32 +11775,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _ingest/pipeline/my-pipeline-id\n{\n \"description\" : \"My optional pipeline description\",\n \"processors\" : [\n {\n \"set\" : {\n \"description\" : \"My optional processor description\",\n \"field\": \"my-keyword-field\",\n \"value\": \"foo\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.ingest.put_pipeline(\n id=\"my-pipeline-id\",\n description=\"My optional pipeline description\",\n processors=[\n {\n \"set\": {\n \"description\": \"My optional processor description\",\n \"field\": \"my-keyword-field\",\n \"value\": \"foo\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ingest.putPipeline({\n id: \"my-pipeline-id\",\n description: \"My optional pipeline description\",\n processors: [\n {\n set: {\n description: \"My optional processor description\",\n field: \"my-keyword-field\",\n value: \"foo\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ingest.put_pipeline(\n id: \"my-pipeline-id\",\n body: {\n \"description\": \"My optional pipeline description\",\n \"processors\": [\n {\n \"set\": {\n \"description\": \"My optional processor description\",\n \"field\": \"my-keyword-field\",\n \"value\": \"foo\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ingest()->putPipeline([\n \"id\" => \"my-pipeline-id\",\n \"body\" => [\n \"description\" => \"My optional pipeline description\",\n \"processors\" => array(\n [\n \"set\" => [\n \"description\" => \"My optional processor description\",\n \"field\" => \"my-keyword-field\",\n \"value\" => \"foo\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"description\":\"My optional pipeline description\",\"processors\":[{\"set\":{\"description\":\"My optional processor description\",\"field\":\"my-keyword-field\",\"value\":\"foo\"}}]}' \"$ELASTICSEARCH_URL/_ingest/pipeline/my-pipeline-id\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -16773,32 +11833,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_ingest/pipeline/my-pipeline-id\n" - }, - { - "lang": "Python", - "source": "resp = client.ingest.delete_pipeline(\n id=\"my-pipeline-id\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ingest.deletePipeline({\n id: \"my-pipeline-id\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ingest.delete_pipeline(\n id: \"my-pipeline-id\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ingest()->deletePipeline([\n \"id\" => \"my-pipeline-id\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ingest/pipeline/my-pipeline-id\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -16827,32 +11861,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_ingest/pipeline/my-pipeline-id\n" - }, - { - "lang": "Python", - "source": "resp = client.ingest.get_pipeline(\n id=\"my-pipeline-id\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ingest.getPipeline({\n id: \"my-pipeline-id\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ingest.get_pipeline(\n id: \"my-pipeline-id\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ingest()->getPipeline([\n \"id\" => \"my-pipeline-id\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ingest/pipeline/my-pipeline-id\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -16891,32 +11899,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ingest/processor/grok\n" - }, - { - "lang": "Python", - "source": "resp = client.ingest.processor_grok()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ingest.processorGrok();" - }, - { - "lang": "Ruby", - "source": "response = client.ingest.processor_grok" - }, - { - "lang": "PHP", - "source": "$resp = $client->ingest()->processorGrok();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ingest/processor/grok\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -16942,32 +11924,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_ingest/pipeline/_simulate\n{\n \"pipeline\" :\n {\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\" : {\n \"field\" : \"field2\",\n \"value\" : \"_value\"\n }\n }\n ]\n },\n \"docs\": [\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.ingest.simulate(\n pipeline={\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\": {\n \"field\": \"field2\",\n \"value\": \"_value\"\n }\n }\n ]\n },\n docs=[\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ingest.simulate({\n pipeline: {\n description: \"_description\",\n processors: [\n {\n set: {\n field: \"field2\",\n value: \"_value\",\n },\n },\n ],\n },\n docs: [\n {\n _index: \"index\",\n _id: \"id\",\n _source: {\n foo: \"bar\",\n },\n },\n {\n _index: \"index\",\n _id: \"id\",\n _source: {\n foo: \"rab\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ingest.simulate(\n body: {\n \"pipeline\": {\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\": {\n \"field\": \"field2\",\n \"value\": \"_value\"\n }\n }\n ]\n },\n \"docs\": [\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ingest()->simulate([\n \"body\" => [\n \"pipeline\" => [\n \"description\" => \"_description\",\n \"processors\" => array(\n [\n \"set\" => [\n \"field\" => \"field2\",\n \"value\" => \"_value\",\n ],\n ],\n ),\n ],\n \"docs\" => array(\n [\n \"_index\" => \"index\",\n \"_id\" => \"id\",\n \"_source\" => [\n \"foo\" => \"bar\",\n ],\n ],\n [\n \"_index\" => \"index\",\n \"_id\" => \"id\",\n \"_source\" => [\n \"foo\" => \"rab\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"pipeline\":{\"description\":\"_description\",\"processors\":[{\"set\":{\"field\":\"field2\",\"value\":\"_value\"}}]},\"docs\":[{\"_index\":\"index\",\"_id\":\"id\",\"_source\":{\"foo\":\"bar\"}},{\"_index\":\"index\",\"_id\":\"id\",\"_source\":{\"foo\":\"rab\"}}]}' \"$ELASTICSEARCH_URL/_ingest/pipeline/_simulate\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -16991,32 +11947,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_ingest/pipeline/_simulate\n{\n \"pipeline\" :\n {\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\" : {\n \"field\" : \"field2\",\n \"value\" : \"_value\"\n }\n }\n ]\n },\n \"docs\": [\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.ingest.simulate(\n pipeline={\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\": {\n \"field\": \"field2\",\n \"value\": \"_value\"\n }\n }\n ]\n },\n docs=[\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ingest.simulate({\n pipeline: {\n description: \"_description\",\n processors: [\n {\n set: {\n field: \"field2\",\n value: \"_value\",\n },\n },\n ],\n },\n docs: [\n {\n _index: \"index\",\n _id: \"id\",\n _source: {\n foo: \"bar\",\n },\n },\n {\n _index: \"index\",\n _id: \"id\",\n _source: {\n foo: \"rab\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ingest.simulate(\n body: {\n \"pipeline\": {\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\": {\n \"field\": \"field2\",\n \"value\": \"_value\"\n }\n }\n ]\n },\n \"docs\": [\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ingest()->simulate([\n \"body\" => [\n \"pipeline\" => [\n \"description\" => \"_description\",\n \"processors\" => array(\n [\n \"set\" => [\n \"field\" => \"field2\",\n \"value\" => \"_value\",\n ],\n ],\n ),\n ],\n \"docs\" => array(\n [\n \"_index\" => \"index\",\n \"_id\" => \"id\",\n \"_source\" => [\n \"foo\" => \"bar\",\n ],\n ],\n [\n \"_index\" => \"index\",\n \"_id\" => \"id\",\n \"_source\" => [\n \"foo\" => \"rab\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"pipeline\":{\"description\":\"_description\",\"processors\":[{\"set\":{\"field\":\"field2\",\"value\":\"_value\"}}]},\"docs\":[{\"_index\":\"index\",\"_id\":\"id\",\"_source\":{\"foo\":\"bar\"}},{\"_index\":\"index\",\"_id\":\"id\",\"_source\":{\"foo\":\"rab\"}}]}' \"$ELASTICSEARCH_URL/_ingest/pipeline/_simulate\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -17045,32 +11975,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_ingest/pipeline/_simulate\n{\n \"pipeline\" :\n {\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\" : {\n \"field\" : \"field2\",\n \"value\" : \"_value\"\n }\n }\n ]\n },\n \"docs\": [\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.ingest.simulate(\n pipeline={\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\": {\n \"field\": \"field2\",\n \"value\": \"_value\"\n }\n }\n ]\n },\n docs=[\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ingest.simulate({\n pipeline: {\n description: \"_description\",\n processors: [\n {\n set: {\n field: \"field2\",\n value: \"_value\",\n },\n },\n ],\n },\n docs: [\n {\n _index: \"index\",\n _id: \"id\",\n _source: {\n foo: \"bar\",\n },\n },\n {\n _index: \"index\",\n _id: \"id\",\n _source: {\n foo: \"rab\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ingest.simulate(\n body: {\n \"pipeline\": {\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\": {\n \"field\": \"field2\",\n \"value\": \"_value\"\n }\n }\n ]\n },\n \"docs\": [\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ingest()->simulate([\n \"body\" => [\n \"pipeline\" => [\n \"description\" => \"_description\",\n \"processors\" => array(\n [\n \"set\" => [\n \"field\" => \"field2\",\n \"value\" => \"_value\",\n ],\n ],\n ),\n ],\n \"docs\" => array(\n [\n \"_index\" => \"index\",\n \"_id\" => \"id\",\n \"_source\" => [\n \"foo\" => \"bar\",\n ],\n ],\n [\n \"_index\" => \"index\",\n \"_id\" => \"id\",\n \"_source\" => [\n \"foo\" => \"rab\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"pipeline\":{\"description\":\"_description\",\"processors\":[{\"set\":{\"field\":\"field2\",\"value\":\"_value\"}}]},\"docs\":[{\"_index\":\"index\",\"_id\":\"id\",\"_source\":{\"foo\":\"bar\"}},{\"_index\":\"index\",\"_id\":\"id\",\"_source\":{\"foo\":\"rab\"}}]}' \"$ELASTICSEARCH_URL/_ingest/pipeline/_simulate\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -17097,32 +12001,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_ingest/pipeline/_simulate\n{\n \"pipeline\" :\n {\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\" : {\n \"field\" : \"field2\",\n \"value\" : \"_value\"\n }\n }\n ]\n },\n \"docs\": [\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.ingest.simulate(\n pipeline={\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\": {\n \"field\": \"field2\",\n \"value\": \"_value\"\n }\n }\n ]\n },\n docs=[\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ingest.simulate({\n pipeline: {\n description: \"_description\",\n processors: [\n {\n set: {\n field: \"field2\",\n value: \"_value\",\n },\n },\n ],\n },\n docs: [\n {\n _index: \"index\",\n _id: \"id\",\n _source: {\n foo: \"bar\",\n },\n },\n {\n _index: \"index\",\n _id: \"id\",\n _source: {\n foo: \"rab\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ingest.simulate(\n body: {\n \"pipeline\": {\n \"description\": \"_description\",\n \"processors\": [\n {\n \"set\": {\n \"field\": \"field2\",\n \"value\": \"_value\"\n }\n }\n ]\n },\n \"docs\": [\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ingest()->simulate([\n \"body\" => [\n \"pipeline\" => [\n \"description\" => \"_description\",\n \"processors\" => array(\n [\n \"set\" => [\n \"field\" => \"field2\",\n \"value\" => \"_value\",\n ],\n ],\n ),\n ],\n \"docs\" => array(\n [\n \"_index\" => \"index\",\n \"_id\" => \"id\",\n \"_source\" => [\n \"foo\" => \"bar\",\n ],\n ],\n [\n \"_index\" => \"index\",\n \"_id\" => \"id\",\n \"_source\" => [\n \"foo\" => \"rab\",\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"pipeline\":{\"description\":\"_description\",\"processors\":[{\"set\":{\"field\":\"field2\",\"value\":\"_value\"}}]},\"docs\":[{\"_index\":\"index\",\"_id\":\"id\",\"_source\":{\"foo\":\"bar\"}},{\"_index\":\"index\",\"_id\":\"id\",\"_source\":{\"foo\":\"rab\"}}]}' \"$ELASTICSEARCH_URL/_ingest/pipeline/_simulate\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -17183,32 +12061,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_license\n" - }, - { - "lang": "Python", - "source": "resp = client.license.get()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.license.get();" - }, - { - "lang": "Ruby", - "source": "response = client.license.get" - }, - { - "lang": "PHP", - "source": "$resp = $client->license()->get();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_license\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -17234,32 +12086,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _logstash/pipeline/my_pipeline\n" - }, - { - "lang": "Python", - "source": "resp = client.logstash.get_pipeline(\n id=\"my_pipeline\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.logstash.getPipeline({\n id: \"my_pipeline\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.logstash.get_pipeline(\n id: \"my_pipeline\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->logstash()->getPipeline([\n \"id\" => \"my_pipeline\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_logstash/pipeline/my_pipeline\"" - } - ], "x-product-feature": "elasticsearch, logstash" }, "put": { @@ -17311,32 +12137,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _logstash/pipeline/my_pipeline\n{\n \"description\": \"Sample pipeline for illustration purposes\",\n \"last_modified\": \"2021-01-02T02:50:51.250Z\",\n \"pipeline_metadata\": {\n \"type\": \"logstash_pipeline\",\n \"version\": 1\n },\n \"username\": \"elastic\",\n \"pipeline\": \"input {}\\\\n filter { grok {} }\\\\n output {}\",\n \"pipeline_settings\": {\n \"pipeline.workers\": 1,\n \"pipeline.batch.size\": 125,\n \"pipeline.batch.delay\": 50,\n \"queue.type\": \"memory\",\n \"queue.max_bytes\": \"1gb\",\n \"queue.checkpoint.writes\": 1024\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.logstash.put_pipeline(\n id=\"my_pipeline\",\n pipeline={\n \"description\": \"Sample pipeline for illustration purposes\",\n \"last_modified\": \"2021-01-02T02:50:51.250Z\",\n \"pipeline_metadata\": {\n \"type\": \"logstash_pipeline\",\n \"version\": 1\n },\n \"username\": \"elastic\",\n \"pipeline\": \"input {}\\\\n filter { grok {} }\\\\n output {}\",\n \"pipeline_settings\": {\n \"pipeline.workers\": 1,\n \"pipeline.batch.size\": 125,\n \"pipeline.batch.delay\": 50,\n \"queue.type\": \"memory\",\n \"queue.max_bytes\": \"1gb\",\n \"queue.checkpoint.writes\": 1024\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.logstash.putPipeline({\n id: \"my_pipeline\",\n pipeline: {\n description: \"Sample pipeline for illustration purposes\",\n last_modified: \"2021-01-02T02:50:51.250Z\",\n pipeline_metadata: {\n type: \"logstash_pipeline\",\n version: 1,\n },\n username: \"elastic\",\n pipeline: \"input {}\\\\n filter { grok {} }\\\\n output {}\",\n pipeline_settings: {\n \"pipeline.workers\": 1,\n \"pipeline.batch.size\": 125,\n \"pipeline.batch.delay\": 50,\n \"queue.type\": \"memory\",\n \"queue.max_bytes\": \"1gb\",\n \"queue.checkpoint.writes\": 1024,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.logstash.put_pipeline(\n id: \"my_pipeline\",\n body: {\n \"description\": \"Sample pipeline for illustration purposes\",\n \"last_modified\": \"2021-01-02T02:50:51.250Z\",\n \"pipeline_metadata\": {\n \"type\": \"logstash_pipeline\",\n \"version\": 1\n },\n \"username\": \"elastic\",\n \"pipeline\": \"input {}\\\\n filter { grok {} }\\\\n output {}\",\n \"pipeline_settings\": {\n \"pipeline.workers\": 1,\n \"pipeline.batch.size\": 125,\n \"pipeline.batch.delay\": 50,\n \"queue.type\": \"memory\",\n \"queue.max_bytes\": \"1gb\",\n \"queue.checkpoint.writes\": 1024\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->logstash()->putPipeline([\n \"id\" => \"my_pipeline\",\n \"body\" => [\n \"description\" => \"Sample pipeline for illustration purposes\",\n \"last_modified\" => \"2021-01-02T02:50:51.250Z\",\n \"pipeline_metadata\" => [\n \"type\" => \"logstash_pipeline\",\n \"version\" => 1,\n ],\n \"username\" => \"elastic\",\n \"pipeline\" => \"input {}\\\\n filter { grok {} }\\\\n output {}\",\n \"pipeline_settings\" => [\n \"pipeline.workers\" => 1,\n \"pipeline.batch.size\" => 125,\n \"pipeline.batch.delay\" => 50,\n \"queue.type\" => \"memory\",\n \"queue.max_bytes\" => \"1gb\",\n \"queue.checkpoint.writes\" => 1024,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"description\":\"Sample pipeline for illustration purposes\",\"last_modified\":\"2021-01-02T02:50:51.250Z\",\"pipeline_metadata\":{\"type\":\"logstash_pipeline\",\"version\":1},\"username\":\"elastic\",\"pipeline\":\"input {}\\\\n filter { grok {} }\\\\n output {}\",\"pipeline_settings\":{\"pipeline.workers\":1,\"pipeline.batch.size\":125,\"pipeline.batch.delay\":50,\"queue.type\":\"memory\",\"queue.max_bytes\":\"1gb\",\"queue.checkpoint.writes\":1024}}' \"$ELASTICSEARCH_URL/_logstash/pipeline/my_pipeline\"" - } - ], "x-product-feature": "elasticsearch, logstash" }, "delete": { @@ -17371,32 +12171,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _logstash/pipeline/my_pipeline\n" - }, - { - "lang": "Python", - "source": "resp = client.logstash.delete_pipeline(\n id=\"my_pipeline\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.logstash.deletePipeline({\n id: \"my_pipeline\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.logstash.delete_pipeline(\n id: \"my_pipeline\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->logstash()->deletePipeline([\n \"id\" => \"my_pipeline\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_logstash/pipeline/my_pipeline\"" - } - ], "x-product-feature": "elasticsearch, logstash" } }, @@ -17417,32 +12191,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _logstash/pipeline/my_pipeline\n" - }, - { - "lang": "Python", - "source": "resp = client.logstash.get_pipeline(\n id=\"my_pipeline\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.logstash.getPipeline({\n id: \"my_pipeline\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.logstash.get_pipeline(\n id: \"my_pipeline\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->logstash()->getPipeline([\n \"id\" => \"my_pipeline\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_logstash/pipeline/my_pipeline\"" - } - ], "x-product-feature": "elasticsearch, logstash" } }, @@ -17489,32 +12237,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_mget\n{\n \"docs\": [\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.mget(\n index=\"my-index-000001\",\n docs=[\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.mget({\n index: \"my-index-000001\",\n docs: [\n {\n _id: \"1\",\n },\n {\n _id: \"2\",\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.mget(\n index: \"my-index-000001\",\n body: {\n \"docs\": [\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->mget([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"docs\" => array(\n [\n \"_id\" => \"1\",\n ],\n [\n \"_id\" => \"2\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"docs\":[{\"_id\":\"1\"},{\"_id\":\"2\"}]}' \"$ELASTICSEARCH_URL/my-index-000001/_mget\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -17559,32 +12281,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_mget\n{\n \"docs\": [\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.mget(\n index=\"my-index-000001\",\n docs=[\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.mget({\n index: \"my-index-000001\",\n docs: [\n {\n _id: \"1\",\n },\n {\n _id: \"2\",\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.mget(\n index: \"my-index-000001\",\n body: {\n \"docs\": [\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->mget([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"docs\" => array(\n [\n \"_id\" => \"1\",\n ],\n [\n \"_id\" => \"2\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"docs\":[{\"_id\":\"1\"},{\"_id\":\"2\"}]}' \"$ELASTICSEARCH_URL/my-index-000001/_mget\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -17634,32 +12330,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_mget\n{\n \"docs\": [\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.mget(\n index=\"my-index-000001\",\n docs=[\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.mget({\n index: \"my-index-000001\",\n docs: [\n {\n _id: \"1\",\n },\n {\n _id: \"2\",\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.mget(\n index: \"my-index-000001\",\n body: {\n \"docs\": [\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->mget([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"docs\" => array(\n [\n \"_id\" => \"1\",\n ],\n [\n \"_id\" => \"2\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"docs\":[{\"_id\":\"1\"},{\"_id\":\"2\"}]}' \"$ELASTICSEARCH_URL/my-index-000001/_mget\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -17707,32 +12377,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_mget\n{\n \"docs\": [\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.mget(\n index=\"my-index-000001\",\n docs=[\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.mget({\n index: \"my-index-000001\",\n docs: [\n {\n _id: \"1\",\n },\n {\n _id: \"2\",\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.mget(\n index: \"my-index-000001\",\n body: {\n \"docs\": [\n {\n \"_id\": \"1\"\n },\n {\n \"_id\": \"2\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->mget([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"docs\" => array(\n [\n \"_id\" => \"1\",\n ],\n [\n \"_id\" => \"2\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"docs\":[{\"_id\":\"1\"},{\"_id\":\"2\"}]}' \"$ELASTICSEARCH_URL/my-index-000001/_mget\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -17836,32 +12480,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/anomaly_detectors/low_request_rate/_close\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.close_job(\n job_id=\"low_request_rate\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.closeJob({\n job_id: \"low_request_rate\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.close_job(\n job_id: \"low_request_rate\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->closeJob([\n \"job_id\" => \"low_request_rate\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/_close\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -17893,32 +12511,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/calendars/planned-outages\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_calendars(\n calendar_id=\"planned-outages\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getCalendars({\n calendar_id: \"planned-outages\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_calendars(\n calendar_id: \"planned-outages\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getCalendars([\n \"calendar_id\" => \"planned-outages\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/calendars/planned-outages\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "put": { @@ -17992,32 +12584,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _ml/calendars/planned-outages\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.put_calendar(\n calendar_id=\"planned-outages\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.putCalendar({\n calendar_id: \"planned-outages\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.put_calendar(\n calendar_id: \"planned-outages\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->putCalendar([\n \"calendar_id\" => \"planned-outages\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/calendars/planned-outages\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -18047,32 +12613,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/calendars/planned-outages\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_calendars(\n calendar_id=\"planned-outages\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getCalendars({\n calendar_id: \"planned-outages\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_calendars(\n calendar_id: \"planned-outages\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getCalendars([\n \"calendar_id\" => \"planned-outages\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/calendars/planned-outages\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "delete": { @@ -18114,32 +12654,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ml/calendars/planned-outages\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.delete_calendar(\n calendar_id=\"planned-outages\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.deleteCalendar({\n calendar_id: \"planned-outages\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.delete_calendar(\n calendar_id: \"planned-outages\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->deleteCalendar([\n \"calendar_id\" => \"planned-outages\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/calendars/planned-outages\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -18193,32 +12707,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ml/calendars/planned-outages/events/LS8LJGEBMTCMA-qz49st\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.delete_calendar_event(\n calendar_id=\"planned-outages\",\n event_id=\"LS8LJGEBMTCMA-qz49st\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.deleteCalendarEvent({\n calendar_id: \"planned-outages\",\n event_id: \"LS8LJGEBMTCMA-qz49st\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.delete_calendar_event(\n calendar_id: \"planned-outages\",\n event_id: \"LS8LJGEBMTCMA-qz49st\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->deleteCalendarEvent([\n \"calendar_id\" => \"planned-outages\",\n \"event_id\" => \"LS8LJGEBMTCMA-qz49st\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/calendars/planned-outages/events/LS8LJGEBMTCMA-qz49st\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -18283,32 +12771,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _ml/calendars/planned-outages/jobs/total-requests\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.put_calendar_job(\n calendar_id=\"planned-outages\",\n job_id=\"total-requests\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.putCalendarJob({\n calendar_id: \"planned-outages\",\n job_id: \"total-requests\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.put_calendar_job(\n calendar_id: \"planned-outages\",\n job_id: \"total-requests\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->putCalendarJob([\n \"calendar_id\" => \"planned-outages\",\n \"job_id\" => \"total-requests\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/calendars/planned-outages/jobs/total-requests\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "delete": { @@ -18377,32 +12839,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ml/calendars/planned-outages/jobs/total-requests\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.delete_calendar_job(\n calendar_id=\"planned-outages\",\n job_id=\"total-requests\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.deleteCalendarJob({\n calendar_id: \"planned-outages\",\n job_id: \"total-requests\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.delete_calendar_job(\n calendar_id: \"planned-outages\",\n job_id: \"total-requests\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->deleteCalendarJob([\n \"calendar_id\" => \"planned-outages\",\n \"job_id\" => \"total-requests\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/calendars/planned-outages/jobs/total-requests\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -18437,32 +12873,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/data_frame/analytics/loganalytics\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_data_frame_analytics(\n id=\"loganalytics\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getDataFrameAnalytics({\n id: \"loganalytics\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_data_frame_analytics(\n id: \"loganalytics\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getDataFrameAnalytics([\n \"id\" => \"loganalytics\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "put": { @@ -18610,32 +13020,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _ml/data_frame/analytics/model-flight-delays-pre\n{\n \"source\": {\n \"index\": [\n \"kibana_sample_data_flights\"\n ],\n \"query\": {\n \"range\": {\n \"DistanceKilometers\": {\n \"gt\": 0\n }\n }\n },\n \"_source\": {\n \"includes\": [],\n \"excludes\": [\n \"FlightDelay\",\n \"FlightDelayType\"\n ]\n }\n },\n \"dest\": {\n \"index\": \"df-flight-delays\",\n \"results_field\": \"ml-results\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"FlightDelayMin\",\n \"training_percent\": 90\n }\n },\n \"analyzed_fields\": {\n \"includes\": [],\n \"excludes\": [\n \"FlightNum\"\n ]\n },\n \"model_memory_limit\": \"100mb\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.put_data_frame_analytics(\n id=\"model-flight-delays-pre\",\n source={\n \"index\": [\n \"kibana_sample_data_flights\"\n ],\n \"query\": {\n \"range\": {\n \"DistanceKilometers\": {\n \"gt\": 0\n }\n }\n },\n \"_source\": {\n \"includes\": [],\n \"excludes\": [\n \"FlightDelay\",\n \"FlightDelayType\"\n ]\n }\n },\n dest={\n \"index\": \"df-flight-delays\",\n \"results_field\": \"ml-results\"\n },\n analysis={\n \"regression\": {\n \"dependent_variable\": \"FlightDelayMin\",\n \"training_percent\": 90\n }\n },\n analyzed_fields={\n \"includes\": [],\n \"excludes\": [\n \"FlightNum\"\n ]\n },\n model_memory_limit=\"100mb\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.putDataFrameAnalytics({\n id: \"model-flight-delays-pre\",\n source: {\n index: [\"kibana_sample_data_flights\"],\n query: {\n range: {\n DistanceKilometers: {\n gt: 0,\n },\n },\n },\n _source: {\n includes: [],\n excludes: [\"FlightDelay\", \"FlightDelayType\"],\n },\n },\n dest: {\n index: \"df-flight-delays\",\n results_field: \"ml-results\",\n },\n analysis: {\n regression: {\n dependent_variable: \"FlightDelayMin\",\n training_percent: 90,\n },\n },\n analyzed_fields: {\n includes: [],\n excludes: [\"FlightNum\"],\n },\n model_memory_limit: \"100mb\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.put_data_frame_analytics(\n id: \"model-flight-delays-pre\",\n body: {\n \"source\": {\n \"index\": [\n \"kibana_sample_data_flights\"\n ],\n \"query\": {\n \"range\": {\n \"DistanceKilometers\": {\n \"gt\": 0\n }\n }\n },\n \"_source\": {\n \"includes\": [],\n \"excludes\": [\n \"FlightDelay\",\n \"FlightDelayType\"\n ]\n }\n },\n \"dest\": {\n \"index\": \"df-flight-delays\",\n \"results_field\": \"ml-results\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"FlightDelayMin\",\n \"training_percent\": 90\n }\n },\n \"analyzed_fields\": {\n \"includes\": [],\n \"excludes\": [\n \"FlightNum\"\n ]\n },\n \"model_memory_limit\": \"100mb\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->putDataFrameAnalytics([\n \"id\" => \"model-flight-delays-pre\",\n \"body\" => [\n \"source\" => [\n \"index\" => array(\n \"kibana_sample_data_flights\",\n ),\n \"query\" => [\n \"range\" => [\n \"DistanceKilometers\" => [\n \"gt\" => 0,\n ],\n ],\n ],\n \"_source\" => [\n \"includes\" => array(\n ),\n \"excludes\" => array(\n \"FlightDelay\",\n \"FlightDelayType\",\n ),\n ],\n ],\n \"dest\" => [\n \"index\" => \"df-flight-delays\",\n \"results_field\" => \"ml-results\",\n ],\n \"analysis\" => [\n \"regression\" => [\n \"dependent_variable\" => \"FlightDelayMin\",\n \"training_percent\" => 90,\n ],\n ],\n \"analyzed_fields\" => [\n \"includes\" => array(\n ),\n \"excludes\" => array(\n \"FlightNum\",\n ),\n ],\n \"model_memory_limit\" => \"100mb\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":[\"kibana_sample_data_flights\"],\"query\":{\"range\":{\"DistanceKilometers\":{\"gt\":0}}},\"_source\":{\"includes\":[],\"excludes\":[\"FlightDelay\",\"FlightDelayType\"]}},\"dest\":{\"index\":\"df-flight-delays\",\"results_field\":\"ml-results\"},\"analysis\":{\"regression\":{\"dependent_variable\":\"FlightDelayMin\",\"training_percent\":90}},\"analyzed_fields\":{\"includes\":[],\"excludes\":[\"FlightNum\"]},\"model_memory_limit\":\"100mb\"}' \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/model-flight-delays-pre\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "delete": { @@ -18697,32 +13081,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ml/data_frame/analytics/loganalytics\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.delete_data_frame_analytics(\n id=\"loganalytics\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.deleteDataFrameAnalytics({\n id: \"loganalytics\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.delete_data_frame_analytics(\n id: \"loganalytics\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->deleteDataFrameAnalytics([\n \"id\" => \"loganalytics\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -18751,32 +13109,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/datafeeds/datafeed-high_sum_total_sales\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_datafeeds(\n datafeed_id=\"datafeed-high_sum_total_sales\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getDatafeeds({\n datafeed_id: \"datafeed-high_sum_total_sales\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_datafeeds(\n datafeed_id: \"datafeed-high_sum_total_sales\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getDatafeeds([\n \"datafeed_id\" => \"datafeed-high_sum_total_sales\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-high_sum_total_sales\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "put": { @@ -18987,32 +13319,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _ml/datafeeds/datafeed-test-job?pretty\n{\n \"indices\": [\n \"kibana_sample_data_logs\"\n ],\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n \"job_id\": \"test-job\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.put_datafeed(\n datafeed_id=\"datafeed-test-job\",\n pretty=True,\n indices=[\n \"kibana_sample_data_logs\"\n ],\n query={\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n job_id=\"test-job\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.putDatafeed({\n datafeed_id: \"datafeed-test-job\",\n pretty: \"true\",\n indices: [\"kibana_sample_data_logs\"],\n query: {\n bool: {\n must: [\n {\n match_all: {},\n },\n ],\n },\n },\n job_id: \"test-job\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.put_datafeed(\n datafeed_id: \"datafeed-test-job\",\n pretty: \"true\",\n body: {\n \"indices\": [\n \"kibana_sample_data_logs\"\n ],\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n \"job_id\": \"test-job\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->putDatafeed([\n \"datafeed_id\" => \"datafeed-test-job\",\n \"pretty\" => \"true\",\n \"body\" => [\n \"indices\" => array(\n \"kibana_sample_data_logs\",\n ),\n \"query\" => [\n \"bool\" => [\n \"must\" => array(\n [\n \"match_all\" => new ArrayObject([]),\n ],\n ),\n ],\n ],\n \"job_id\" => \"test-job\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"indices\":[\"kibana_sample_data_logs\"],\"query\":{\"bool\":{\"must\":[{\"match_all\":{}}]}},\"job_id\":\"test-job\"}' \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-test-job?pretty\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "delete": { @@ -19064,32 +13370,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ml/datafeeds/datafeed-total-requests\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.delete_datafeed(\n datafeed_id=\"datafeed-total-requests\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.deleteDatafeed({\n datafeed_id: \"datafeed-total-requests\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.delete_datafeed(\n datafeed_id: \"datafeed-total-requests\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->deleteDatafeed([\n \"datafeed_id\" => \"datafeed-total-requests\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-total-requests\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -19118,32 +13398,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/filters/safe_domains\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_filters(\n filter_id=\"safe_domains\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getFilters({\n filter_id: \"safe_domains\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_filters(\n filter_id: \"safe_domains\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getFilters([\n \"filter_id\" => \"safe_domains\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/filters/safe_domains\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "put": { @@ -19227,32 +13481,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _ml/filters/safe_domains\n{\n \"description\": \"A list of safe domains\",\n \"items\": [\"*.google.com\", \"wikipedia.org\"]\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.put_filter(\n filter_id=\"safe_domains\",\n description=\"A list of safe domains\",\n items=[\n \"*.google.com\",\n \"wikipedia.org\"\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.putFilter({\n filter_id: \"safe_domains\",\n description: \"A list of safe domains\",\n items: [\"*.google.com\", \"wikipedia.org\"],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.put_filter(\n filter_id: \"safe_domains\",\n body: {\n \"description\": \"A list of safe domains\",\n \"items\": [\n \"*.google.com\",\n \"wikipedia.org\"\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->putFilter([\n \"filter_id\" => \"safe_domains\",\n \"body\" => [\n \"description\" => \"A list of safe domains\",\n \"items\" => array(\n \"*.google.com\",\n \"wikipedia.org\",\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"description\":\"A list of safe domains\",\"items\":[\"*.google.com\",\"wikipedia.org\"]}' \"$ELASTICSEARCH_URL/_ml/filters/safe_domains\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "delete": { @@ -19294,32 +13522,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ml/filters/safe_domains\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.delete_filter(\n filter_id=\"safe_domains\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.deleteFilter({\n filter_id: \"safe_domains\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.delete_filter(\n filter_id: \"safe_domains\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->deleteFilter([\n \"filter_id\" => \"safe_domains\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/filters/safe_domains\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -19348,32 +13550,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/high_sum_total_sales\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_jobs(\n job_id=\"high_sum_total_sales\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getJobs({\n job_id: \"high_sum_total_sales\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_jobs(\n job_id: \"high_sum_total_sales\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getJobs([\n \"job_id\" => \"high_sum_total_sales\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/high_sum_total_sales\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "put": { @@ -19613,32 +13789,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_ml/anomaly_detectors/job-01\n{\n \"analysis_config\": {\n \"bucket_span\": \"15m\",\n \"detectors\": [\n {\n \"detector_description\": \"Sum of bytes\",\n \"function\": \"sum\",\n \"field_name\": \"bytes\"\n }\n ]\n },\n \"data_description\": {\n \"time_field\": \"timestamp\",\n \"time_format\": \"epoch_ms\"\n },\n \"analysis_limits\": {\n \"model_memory_limit\": \"11MB\"\n },\n \"model_plot_config\": {\n \"enabled\": true,\n \"annotations_enabled\": true\n },\n \"results_index_name\": \"test-job1\",\n \"datafeed_config\": {\n \"indices\": [\n \"kibana_sample_data_logs\"\n ],\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n \"runtime_mappings\": {\n \"hour_of_day\": {\n \"type\": \"long\",\n \"script\": {\n \"source\": \"emit(doc['timestamp'].value.getHour());\"\n }\n }\n },\n \"datafeed_id\": \"datafeed-test-job1\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.put_job(\n job_id=\"job-01\",\n analysis_config={\n \"bucket_span\": \"15m\",\n \"detectors\": [\n {\n \"detector_description\": \"Sum of bytes\",\n \"function\": \"sum\",\n \"field_name\": \"bytes\"\n }\n ]\n },\n data_description={\n \"time_field\": \"timestamp\",\n \"time_format\": \"epoch_ms\"\n },\n analysis_limits={\n \"model_memory_limit\": \"11MB\"\n },\n model_plot_config={\n \"enabled\": True,\n \"annotations_enabled\": True\n },\n results_index_name=\"test-job1\",\n datafeed_config={\n \"indices\": [\n \"kibana_sample_data_logs\"\n ],\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n \"runtime_mappings\": {\n \"hour_of_day\": {\n \"type\": \"long\",\n \"script\": {\n \"source\": \"emit(doc['timestamp'].value.getHour());\"\n }\n }\n },\n \"datafeed_id\": \"datafeed-test-job1\"\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.putJob({\n job_id: \"job-01\",\n analysis_config: {\n bucket_span: \"15m\",\n detectors: [\n {\n detector_description: \"Sum of bytes\",\n function: \"sum\",\n field_name: \"bytes\",\n },\n ],\n },\n data_description: {\n time_field: \"timestamp\",\n time_format: \"epoch_ms\",\n },\n analysis_limits: {\n model_memory_limit: \"11MB\",\n },\n model_plot_config: {\n enabled: true,\n annotations_enabled: true,\n },\n results_index_name: \"test-job1\",\n datafeed_config: {\n indices: [\"kibana_sample_data_logs\"],\n query: {\n bool: {\n must: [\n {\n match_all: {},\n },\n ],\n },\n },\n runtime_mappings: {\n hour_of_day: {\n type: \"long\",\n script: {\n source: \"emit(doc['timestamp'].value.getHour());\",\n },\n },\n },\n datafeed_id: \"datafeed-test-job1\",\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.put_job(\n job_id: \"job-01\",\n body: {\n \"analysis_config\": {\n \"bucket_span\": \"15m\",\n \"detectors\": [\n {\n \"detector_description\": \"Sum of bytes\",\n \"function\": \"sum\",\n \"field_name\": \"bytes\"\n }\n ]\n },\n \"data_description\": {\n \"time_field\": \"timestamp\",\n \"time_format\": \"epoch_ms\"\n },\n \"analysis_limits\": {\n \"model_memory_limit\": \"11MB\"\n },\n \"model_plot_config\": {\n \"enabled\": true,\n \"annotations_enabled\": true\n },\n \"results_index_name\": \"test-job1\",\n \"datafeed_config\": {\n \"indices\": [\n \"kibana_sample_data_logs\"\n ],\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match_all\": {}\n }\n ]\n }\n },\n \"runtime_mappings\": {\n \"hour_of_day\": {\n \"type\": \"long\",\n \"script\": {\n \"source\": \"emit(doc['timestamp'].value.getHour());\"\n }\n }\n },\n \"datafeed_id\": \"datafeed-test-job1\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->putJob([\n \"job_id\" => \"job-01\",\n \"body\" => [\n \"analysis_config\" => [\n \"bucket_span\" => \"15m\",\n \"detectors\" => array(\n [\n \"detector_description\" => \"Sum of bytes\",\n \"function\" => \"sum\",\n \"field_name\" => \"bytes\",\n ],\n ),\n ],\n \"data_description\" => [\n \"time_field\" => \"timestamp\",\n \"time_format\" => \"epoch_ms\",\n ],\n \"analysis_limits\" => [\n \"model_memory_limit\" => \"11MB\",\n ],\n \"model_plot_config\" => [\n \"enabled\" => true,\n \"annotations_enabled\" => true,\n ],\n \"results_index_name\" => \"test-job1\",\n \"datafeed_config\" => [\n \"indices\" => array(\n \"kibana_sample_data_logs\",\n ),\n \"query\" => [\n \"bool\" => [\n \"must\" => array(\n [\n \"match_all\" => new ArrayObject([]),\n ],\n ),\n ],\n ],\n \"runtime_mappings\" => [\n \"hour_of_day\" => [\n \"type\" => \"long\",\n \"script\" => [\n \"source\" => \"emit(doc['timestamp'].value.getHour());\",\n ],\n ],\n ],\n \"datafeed_id\" => \"datafeed-test-job1\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"analysis_config\":{\"bucket_span\":\"15m\",\"detectors\":[{\"detector_description\":\"Sum of bytes\",\"function\":\"sum\",\"field_name\":\"bytes\"}]},\"data_description\":{\"time_field\":\"timestamp\",\"time_format\":\"epoch_ms\"},\"analysis_limits\":{\"model_memory_limit\":\"11MB\"},\"model_plot_config\":{\"enabled\":true,\"annotations_enabled\":true},\"results_index_name\":\"test-job1\",\"datafeed_config\":{\"indices\":[\"kibana_sample_data_logs\"],\"query\":{\"bool\":{\"must\":[{\"match_all\":{}}]}},\"runtime_mappings\":{\"hour_of_day\":{\"type\":\"long\",\"script\":{\"source\":\"emit(doc['\"'\"'timestamp'\"'\"'].value.getHour());\"}}},\"datafeed_id\":\"datafeed-test-job1\"}}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/job-01\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "delete": { @@ -19716,32 +13866,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ml/anomaly_detectors/total-requests\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.delete_job(\n job_id=\"total-requests\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.deleteJob({\n job_id: \"total-requests\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.delete_job(\n job_id: \"total-requests\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->deleteJob([\n \"job_id\" => \"total-requests\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/total-requests\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -19785,32 +13909,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/trained_models/\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_trained_models()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getTrainedModels();" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_trained_models" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getTrainedModels();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/trained_models/\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "put": { @@ -19981,32 +14079,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ml/trained_models/regression-job-one-1574775307356\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.delete_trained_model(\n model_id=\"regression-job-one-1574775307356\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.deleteTrainedModel({\n model_id: \"regression-job-one-1574775307356\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.delete_trained_model(\n model_id: \"regression-job-one-1574775307356\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->deleteTrainedModel([\n \"model_id\" => \"regression-job-one-1574775307356\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/trained_models/regression-job-one-1574775307356\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -20065,32 +14137,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _ml/trained_models/flight-delay-prediction-1574775339910/model_aliases/flight_delay_model\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.put_trained_model_alias(\n model_id=\"flight-delay-prediction-1574775339910\",\n model_alias=\"flight_delay_model\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.putTrainedModelAlias({\n model_id: \"flight-delay-prediction-1574775339910\",\n model_alias: \"flight_delay_model\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.put_trained_model_alias(\n model_id: \"flight-delay-prediction-1574775339910\",\n model_alias: \"flight_delay_model\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->putTrainedModelAlias([\n \"model_id\" => \"flight-delay-prediction-1574775339910\",\n \"model_alias\" => \"flight_delay_model\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/trained_models/flight-delay-prediction-1574775339910/model_aliases/flight_delay_model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "delete": { @@ -20143,32 +14189,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _ml/trained_models/flight-delay-prediction-1574775339910/model_aliases/flight_delay_model\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.delete_trained_model_alias(\n model_id=\"flight-delay-prediction-1574775339910\",\n model_alias=\"flight_delay_model\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.deleteTrainedModelAlias({\n model_id: \"flight-delay-prediction-1574775339910\",\n model_alias: \"flight_delay_model\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.delete_trained_model_alias(\n model_id: \"flight-delay-prediction-1574775339910\",\n model_alias: \"flight_delay_model\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->deleteTrainedModelAlias([\n \"model_id\" => \"flight-delay-prediction-1574775339910\",\n \"model_alias\" => \"flight_delay_model\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/trained_models/flight-delay-prediction-1574775339910/model_aliases/flight_delay_model\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -20242,32 +14262,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/anomaly_detectors/_estimate_model_memory\n{\n \"analysis_config\": {\n \"bucket_span\": \"5m\",\n \"detectors\": [\n {\n \"function\": \"sum\",\n \"field_name\": \"bytes\",\n \"by_field_name\": \"status\",\n \"partition_field_name\": \"app\"\n }\n ],\n \"influencers\": [\n \"source_ip\",\n \"dest_ip\"\n ]\n },\n \"overall_cardinality\": {\n \"status\": 10,\n \"app\": 50\n },\n \"max_bucket_cardinality\": {\n \"source_ip\": 300,\n \"dest_ip\": 30\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.estimate_model_memory(\n analysis_config={\n \"bucket_span\": \"5m\",\n \"detectors\": [\n {\n \"function\": \"sum\",\n \"field_name\": \"bytes\",\n \"by_field_name\": \"status\",\n \"partition_field_name\": \"app\"\n }\n ],\n \"influencers\": [\n \"source_ip\",\n \"dest_ip\"\n ]\n },\n overall_cardinality={\n \"status\": 10,\n \"app\": 50\n },\n max_bucket_cardinality={\n \"source_ip\": 300,\n \"dest_ip\": 30\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.estimateModelMemory({\n analysis_config: {\n bucket_span: \"5m\",\n detectors: [\n {\n function: \"sum\",\n field_name: \"bytes\",\n by_field_name: \"status\",\n partition_field_name: \"app\",\n },\n ],\n influencers: [\"source_ip\", \"dest_ip\"],\n },\n overall_cardinality: {\n status: 10,\n app: 50,\n },\n max_bucket_cardinality: {\n source_ip: 300,\n dest_ip: 30,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.estimate_model_memory(\n body: {\n \"analysis_config\": {\n \"bucket_span\": \"5m\",\n \"detectors\": [\n {\n \"function\": \"sum\",\n \"field_name\": \"bytes\",\n \"by_field_name\": \"status\",\n \"partition_field_name\": \"app\"\n }\n ],\n \"influencers\": [\n \"source_ip\",\n \"dest_ip\"\n ]\n },\n \"overall_cardinality\": {\n \"status\": 10,\n \"app\": 50\n },\n \"max_bucket_cardinality\": {\n \"source_ip\": 300,\n \"dest_ip\": 30\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->estimateModelMemory([\n \"body\" => [\n \"analysis_config\" => [\n \"bucket_span\" => \"5m\",\n \"detectors\" => array(\n [\n \"function\" => \"sum\",\n \"field_name\" => \"bytes\",\n \"by_field_name\" => \"status\",\n \"partition_field_name\" => \"app\",\n ],\n ),\n \"influencers\" => array(\n \"source_ip\",\n \"dest_ip\",\n ),\n ],\n \"overall_cardinality\" => [\n \"status\" => 10,\n \"app\" => 50,\n ],\n \"max_bucket_cardinality\" => [\n \"source_ip\" => 300,\n \"dest_ip\" => 30,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"analysis_config\":{\"bucket_span\":\"5m\",\"detectors\":[{\"function\":\"sum\",\"field_name\":\"bytes\",\"by_field_name\":\"status\",\"partition_field_name\":\"app\"}],\"influencers\":[\"source_ip\",\"dest_ip\"]},\"overall_cardinality\":{\"status\":10,\"app\":50},\"max_bucket_cardinality\":{\"source_ip\":300,\"dest_ip\":30}}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/_estimate_model_memory\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -20372,32 +14366,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/data_frame/_evaluate\n{\n \"index\": \"animal_classification\",\n \"evaluation\": {\n \"classification\": {\n \"actual_field\": \"animal_class\",\n \"predicted_field\": \"ml.animal_class_prediction\",\n \"metrics\": {\n \"multiclass_confusion_matrix\": {}\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.evaluate_data_frame(\n index=\"animal_classification\",\n evaluation={\n \"classification\": {\n \"actual_field\": \"animal_class\",\n \"predicted_field\": \"ml.animal_class_prediction\",\n \"metrics\": {\n \"multiclass_confusion_matrix\": {}\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.evaluateDataFrame({\n index: \"animal_classification\",\n evaluation: {\n classification: {\n actual_field: \"animal_class\",\n predicted_field: \"ml.animal_class_prediction\",\n metrics: {\n multiclass_confusion_matrix: {},\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.evaluate_data_frame(\n body: {\n \"index\": \"animal_classification\",\n \"evaluation\": {\n \"classification\": {\n \"actual_field\": \"animal_class\",\n \"predicted_field\": \"ml.animal_class_prediction\",\n \"metrics\": {\n \"multiclass_confusion_matrix\": {}\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->evaluateDataFrame([\n \"body\" => [\n \"index\" => \"animal_classification\",\n \"evaluation\" => [\n \"classification\" => [\n \"actual_field\" => \"animal_class\",\n \"predicted_field\" => \"ml.animal_class_prediction\",\n \"metrics\" => [\n \"multiclass_confusion_matrix\" => new ArrayObject([]),\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"index\":\"animal_classification\",\"evaluation\":{\"classification\":{\"actual_field\":\"animal_class\",\"predicted_field\":\"ml.animal_class_prediction\",\"metrics\":{\"multiclass_confusion_matrix\":{}}}}}' \"$ELASTICSEARCH_URL/_ml/data_frame/_evaluate\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -20530,32 +14498,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/anomaly_detectors/low_request_rate/_flush\n{\n \"calc_interim\": true\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.flush_job(\n job_id=\"low_request_rate\",\n calc_interim=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.flushJob({\n job_id: \"low_request_rate\",\n calc_interim: true,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.flush_job(\n job_id: \"low_request_rate\",\n body: {\n \"calc_interim\": true\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->flushJob([\n \"job_id\" => \"low_request_rate\",\n \"body\" => [\n \"calc_interim\" => true,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"calc_interim\":true}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/_flush\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -20658,32 +14600,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/calendars/planned-outages/events\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_calendar_events(\n calendar_id=\"planned-outages\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getCalendarEvents({\n calendar_id: \"planned-outages\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_calendar_events(\n calendar_id: \"planned-outages\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getCalendarEvents([\n \"calendar_id\" => \"planned-outages\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/calendars/planned-outages/events\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -20758,32 +14674,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/calendars/planned-outages/events\n{\n \"events\" : [\n {\"description\": \"event 1\", \"start_time\": 1513641600000, \"end_time\": 1513728000000},\n {\"description\": \"event 2\", \"start_time\": 1513814400000, \"end_time\": 1513900800000},\n {\"description\": \"event 3\", \"start_time\": 1514160000000, \"end_time\": 1514246400000}\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.post_calendar_events(\n calendar_id=\"planned-outages\",\n events=[\n {\n \"description\": \"event 1\",\n \"start_time\": 1513641600000,\n \"end_time\": 1513728000000\n },\n {\n \"description\": \"event 2\",\n \"start_time\": 1513814400000,\n \"end_time\": 1513900800000\n },\n {\n \"description\": \"event 3\",\n \"start_time\": 1514160000000,\n \"end_time\": 1514246400000\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.postCalendarEvents({\n calendar_id: \"planned-outages\",\n events: [\n {\n description: \"event 1\",\n start_time: 1513641600000,\n end_time: 1513728000000,\n },\n {\n description: \"event 2\",\n start_time: 1513814400000,\n end_time: 1513900800000,\n },\n {\n description: \"event 3\",\n start_time: 1514160000000,\n end_time: 1514246400000,\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.post_calendar_events(\n calendar_id: \"planned-outages\",\n body: {\n \"events\": [\n {\n \"description\": \"event 1\",\n \"start_time\": 1513641600000,\n \"end_time\": 1513728000000\n },\n {\n \"description\": \"event 2\",\n \"start_time\": 1513814400000,\n \"end_time\": 1513900800000\n },\n {\n \"description\": \"event 3\",\n \"start_time\": 1514160000000,\n \"end_time\": 1514246400000\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->postCalendarEvents([\n \"calendar_id\" => \"planned-outages\",\n \"body\" => [\n \"events\" => array(\n [\n \"description\" => \"event 1\",\n \"start_time\" => 1513641600000,\n \"end_time\" => 1513728000000,\n ],\n [\n \"description\" => \"event 2\",\n \"start_time\" => 1513814400000,\n \"end_time\" => 1513900800000,\n ],\n [\n \"description\" => \"event 3\",\n \"start_time\" => 1514160000000,\n \"end_time\" => 1514246400000,\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"events\":[{\"description\":\"event 1\",\"start_time\":1513641600000,\"end_time\":1513728000000},{\"description\":\"event 2\",\"start_time\":1513814400000,\"end_time\":1513900800000},{\"description\":\"event 3\",\"start_time\":1514160000000,\"end_time\":1514246400000}]}' \"$ELASTICSEARCH_URL/_ml/calendars/planned-outages/events\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -20812,32 +14702,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/calendars/planned-outages\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_calendars(\n calendar_id=\"planned-outages\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getCalendars({\n calendar_id: \"planned-outages\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_calendars(\n calendar_id: \"planned-outages\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getCalendars([\n \"calendar_id\" => \"planned-outages\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/calendars/planned-outages\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -20864,32 +14728,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/calendars/planned-outages\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_calendars(\n calendar_id=\"planned-outages\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getCalendars({\n calendar_id: \"planned-outages\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_calendars(\n calendar_id: \"planned-outages\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getCalendars([\n \"calendar_id\" => \"planned-outages\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/calendars/planned-outages\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -20921,32 +14759,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/data_frame/analytics/loganalytics\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_data_frame_analytics(\n id=\"loganalytics\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getDataFrameAnalytics({\n id: \"loganalytics\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_data_frame_analytics(\n id: \"loganalytics\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getDataFrameAnalytics([\n \"id\" => \"loganalytics\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -20978,32 +14790,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/data_frame/analytics/weblog-outliers/_stats\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_data_frame_analytics_stats(\n id=\"weblog-outliers\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getDataFrameAnalyticsStats({\n id: \"weblog-outliers\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_data_frame_analytics_stats(\n id: \"weblog-outliers\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getDataFrameAnalyticsStats([\n \"id\" => \"weblog-outliers\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/weblog-outliers/_stats\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -21038,32 +14824,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/data_frame/analytics/weblog-outliers/_stats\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_data_frame_analytics_stats(\n id=\"weblog-outliers\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getDataFrameAnalyticsStats({\n id: \"weblog-outliers\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_data_frame_analytics_stats(\n id: \"weblog-outliers\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getDataFrameAnalyticsStats([\n \"id\" => \"weblog-outliers\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/weblog-outliers/_stats\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -21089,32 +14849,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/datafeeds/datafeed-high_sum_total_sales/_stats\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_datafeed_stats(\n datafeed_id=\"datafeed-high_sum_total_sales\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getDatafeedStats({\n datafeed_id: \"datafeed-high_sum_total_sales\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_datafeed_stats(\n datafeed_id: \"datafeed-high_sum_total_sales\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getDatafeedStats([\n \"datafeed_id\" => \"datafeed-high_sum_total_sales\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-high_sum_total_sales/_stats\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -21137,32 +14871,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/datafeeds/datafeed-high_sum_total_sales/_stats\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_datafeed_stats(\n datafeed_id=\"datafeed-high_sum_total_sales\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getDatafeedStats({\n datafeed_id: \"datafeed-high_sum_total_sales\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_datafeed_stats(\n datafeed_id: \"datafeed-high_sum_total_sales\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getDatafeedStats([\n \"datafeed_id\" => \"datafeed-high_sum_total_sales\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-high_sum_total_sales/_stats\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -21188,32 +14896,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/datafeeds/datafeed-high_sum_total_sales\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_datafeeds(\n datafeed_id=\"datafeed-high_sum_total_sales\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getDatafeeds({\n datafeed_id: \"datafeed-high_sum_total_sales\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_datafeeds(\n datafeed_id: \"datafeed-high_sum_total_sales\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getDatafeeds([\n \"datafeed_id\" => \"datafeed-high_sum_total_sales\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-high_sum_total_sales\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -21239,32 +14921,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/filters/safe_domains\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_filters(\n filter_id=\"safe_domains\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getFilters({\n filter_id: \"safe_domains\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_filters(\n filter_id: \"safe_domains\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getFilters([\n \"filter_id\" => \"safe_domains\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/filters/safe_domains\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -21287,32 +14943,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/low_request_rate/_stats\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_job_stats(\n job_id=\"low_request_rate\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getJobStats({\n job_id: \"low_request_rate\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_job_stats(\n job_id: \"low_request_rate\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getJobStats([\n \"job_id\" => \"low_request_rate\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/_stats\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -21338,32 +14968,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/low_request_rate/_stats\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_job_stats(\n job_id=\"low_request_rate\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getJobStats({\n job_id: \"low_request_rate\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_job_stats(\n job_id: \"low_request_rate\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getJobStats([\n \"job_id\" => \"low_request_rate\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/_stats\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -21389,32 +14993,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/high_sum_total_sales\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_jobs(\n job_id=\"high_sum_total_sales\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getJobs({\n job_id: \"high_sum_total_sales\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_jobs(\n job_id: \"high_sum_total_sales\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getJobs([\n \"job_id\" => \"high_sum_total_sales\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/high_sum_total_sales\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -21461,32 +15039,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/job-*/results/overall_buckets\n{\n \"overall_score\": 80,\n \"start\": \"1403532000000\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_overall_buckets(\n job_id=\"job-*\",\n overall_score=80,\n start=\"1403532000000\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getOverallBuckets({\n job_id: \"job-*\",\n overall_score: 80,\n start: 1403532000000,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_overall_buckets(\n job_id: \"job-*\",\n body: {\n \"overall_score\": 80,\n \"start\": \"1403532000000\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getOverallBuckets([\n \"job_id\" => \"job-*\",\n \"body\" => [\n \"overall_score\" => 80,\n \"start\" => \"1403532000000\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"overall_score\":80,\"start\":\"1403532000000\"}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/job-*/results/overall_buckets\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -21531,32 +15083,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/anomaly_detectors/job-*/results/overall_buckets\n{\n \"overall_score\": 80,\n \"start\": \"1403532000000\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_overall_buckets(\n job_id=\"job-*\",\n overall_score=80,\n start=\"1403532000000\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getOverallBuckets({\n job_id: \"job-*\",\n overall_score: 80,\n start: 1403532000000,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_overall_buckets(\n job_id: \"job-*\",\n body: {\n \"overall_score\": 80,\n \"start\": \"1403532000000\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getOverallBuckets([\n \"job_id\" => \"job-*\",\n \"body\" => [\n \"overall_score\" => 80,\n \"start\" => \"1403532000000\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"overall_score\":80,\"start\":\"1403532000000\"}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/job-*/results/overall_buckets\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -21597,32 +15123,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/trained_models/\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_trained_models()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getTrainedModels();" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_trained_models" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getTrainedModels();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/trained_models/\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -21654,32 +15154,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/trained_models/_stats\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_trained_models_stats()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getTrainedModelsStats();" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_trained_models_stats" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getTrainedModelsStats();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/trained_models/_stats\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -21708,32 +15182,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/trained_models/_stats\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.get_trained_models_stats()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.getTrainedModelsStats();" - }, - { - "lang": "Ruby", - "source": "response = client.ml.get_trained_models_stats" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->getTrainedModelsStats();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/trained_models/_stats\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -21825,32 +15273,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/trained_models/lang_ident_model_1/_infer\n{\n \"docs\":[{\"text\": \"The fool doth think he is wise, but the wise man knows himself to be a fool.\"}]\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.infer_trained_model(\n model_id=\"lang_ident_model_1\",\n docs=[\n {\n \"text\": \"The fool doth think he is wise, but the wise man knows himself to be a fool.\"\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.inferTrainedModel({\n model_id: \"lang_ident_model_1\",\n docs: [\n {\n text: \"The fool doth think he is wise, but the wise man knows himself to be a fool.\",\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.infer_trained_model(\n model_id: \"lang_ident_model_1\",\n body: {\n \"docs\": [\n {\n \"text\": \"The fool doth think he is wise, but the wise man knows himself to be a fool.\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->inferTrainedModel([\n \"model_id\" => \"lang_ident_model_1\",\n \"body\" => [\n \"docs\" => array(\n [\n \"text\" => \"The fool doth think he is wise, but the wise man knows himself to be a fool.\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"docs\":[{\"text\":\"The fool doth think he is wise, but the wise man knows himself to be a fool.\"}]}' \"$ELASTICSEARCH_URL/_ml/trained_models/lang_ident_model_1/_infer\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -21936,32 +15358,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_ml/anomaly_detectors/job-01/_open\n{\n \"timeout\": \"35m\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.open_job(\n job_id=\"job-01\",\n timeout=\"35m\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.openJob({\n job_id: \"job-01\",\n timeout: \"35m\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.open_job(\n job_id: \"job-01\",\n body: {\n \"timeout\": \"35m\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->openJob([\n \"job_id\" => \"job-01\",\n \"body\" => [\n \"timeout\" => \"35m\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"timeout\":\"35m\"}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/job-01/_open\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -21982,32 +15378,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/data_frame/analytics/_preview\n{\n \"config\": {\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.preview_data_frame_analytics(\n config={\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.previewDataFrameAnalytics({\n config: {\n source: {\n index: \"houses_sold_last_10_yrs\",\n },\n analysis: {\n regression: {\n dependent_variable: \"price\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.preview_data_frame_analytics(\n body: {\n \"config\": {\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->previewDataFrameAnalytics([\n \"body\" => [\n \"config\" => [\n \"source\" => [\n \"index\" => \"houses_sold_last_10_yrs\",\n ],\n \"analysis\" => [\n \"regression\" => [\n \"dependent_variable\" => \"price\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"config\":{\"source\":{\"index\":\"houses_sold_last_10_yrs\"},\"analysis\":{\"regression\":{\"dependent_variable\":\"price\"}}}}' \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/_preview\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -22021,37 +15391,11 @@ "$ref": "#/components/requestBodies/ml.preview_data_frame_analytics" }, "responses": { - "200": { - "$ref": "#/components/responses/ml.preview_data_frame_analytics-200" - } - }, - "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/data_frame/analytics/_preview\n{\n \"config\": {\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.preview_data_frame_analytics(\n config={\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.previewDataFrameAnalytics({\n config: {\n source: {\n index: \"houses_sold_last_10_yrs\",\n },\n analysis: {\n regression: {\n dependent_variable: \"price\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.preview_data_frame_analytics(\n body: {\n \"config\": {\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->previewDataFrameAnalytics([\n \"body\" => [\n \"config\" => [\n \"source\" => [\n \"index\" => \"houses_sold_last_10_yrs\",\n ],\n \"analysis\" => [\n \"regression\" => [\n \"dependent_variable\" => \"price\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"config\":{\"source\":{\"index\":\"houses_sold_last_10_yrs\"},\"analysis\":{\"regression\":{\"dependent_variable\":\"price\"}}}}' \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/_preview\"" + "200": { + "$ref": "#/components/responses/ml.preview_data_frame_analytics-200" } - ], + }, + "x-state": "Generally available", "x-product-feature": "elasticsearch, machine-learning" } }, @@ -22077,32 +15421,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/data_frame/analytics/_preview\n{\n \"config\": {\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.preview_data_frame_analytics(\n config={\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.previewDataFrameAnalytics({\n config: {\n source: {\n index: \"houses_sold_last_10_yrs\",\n },\n analysis: {\n regression: {\n dependent_variable: \"price\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.preview_data_frame_analytics(\n body: {\n \"config\": {\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->previewDataFrameAnalytics([\n \"body\" => [\n \"config\" => [\n \"source\" => [\n \"index\" => \"houses_sold_last_10_yrs\",\n ],\n \"analysis\" => [\n \"regression\" => [\n \"dependent_variable\" => \"price\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"config\":{\"source\":{\"index\":\"houses_sold_last_10_yrs\"},\"analysis\":{\"regression\":{\"dependent_variable\":\"price\"}}}}' \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/_preview\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -22126,32 +15444,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/data_frame/analytics/_preview\n{\n \"config\": {\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.preview_data_frame_analytics(\n config={\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.previewDataFrameAnalytics({\n config: {\n source: {\n index: \"houses_sold_last_10_yrs\",\n },\n analysis: {\n regression: {\n dependent_variable: \"price\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.preview_data_frame_analytics(\n body: {\n \"config\": {\n \"source\": {\n \"index\": \"houses_sold_last_10_yrs\"\n },\n \"analysis\": {\n \"regression\": {\n \"dependent_variable\": \"price\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->previewDataFrameAnalytics([\n \"body\" => [\n \"config\" => [\n \"source\" => [\n \"index\" => \"houses_sold_last_10_yrs\",\n ],\n \"analysis\" => [\n \"regression\" => [\n \"dependent_variable\" => \"price\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"config\":{\"source\":{\"index\":\"houses_sold_last_10_yrs\"},\"analysis\":{\"regression\":{\"dependent_variable\":\"price\"}}}}' \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/_preview\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -22183,32 +15475,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/datafeeds/datafeed-high_sum_total_sales/_preview\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.preview_datafeed(\n datafeed_id=\"datafeed-high_sum_total_sales\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.previewDatafeed({\n datafeed_id: \"datafeed-high_sum_total_sales\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.preview_datafeed(\n datafeed_id: \"datafeed-high_sum_total_sales\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->previewDatafeed([\n \"datafeed_id\" => \"datafeed-high_sum_total_sales\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-high_sum_total_sales/_preview\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -22238,32 +15504,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/datafeeds/datafeed-high_sum_total_sales/_preview\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.preview_datafeed(\n datafeed_id=\"datafeed-high_sum_total_sales\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.previewDatafeed({\n datafeed_id: \"datafeed-high_sum_total_sales\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.preview_datafeed(\n datafeed_id: \"datafeed-high_sum_total_sales\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->previewDatafeed([\n \"datafeed_id\" => \"datafeed-high_sum_total_sales\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-high_sum_total_sales/_preview\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -22292,32 +15532,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/datafeeds/datafeed-high_sum_total_sales/_preview\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.preview_datafeed(\n datafeed_id=\"datafeed-high_sum_total_sales\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.previewDatafeed({\n datafeed_id: \"datafeed-high_sum_total_sales\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.preview_datafeed(\n datafeed_id: \"datafeed-high_sum_total_sales\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->previewDatafeed([\n \"datafeed_id\" => \"datafeed-high_sum_total_sales\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-high_sum_total_sales/_preview\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" }, "post": { @@ -22344,32 +15558,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _ml/datafeeds/datafeed-high_sum_total_sales/_preview\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.preview_datafeed(\n datafeed_id=\"datafeed-high_sum_total_sales\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.previewDatafeed({\n datafeed_id: \"datafeed-high_sum_total_sales\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.preview_datafeed(\n datafeed_id: \"datafeed-high_sum_total_sales\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->previewDatafeed([\n \"datafeed_id\" => \"datafeed-high_sum_total_sales\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-high_sum_total_sales/_preview\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -22453,32 +15641,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/definition/0\n{\n \"definition\": \"...\",\n \"total_definition_length\": 265632637,\n \"total_parts\": 64\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.put_trained_model_definition_part(\n model_id=\"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n part=\"0\",\n definition=\"...\",\n total_definition_length=265632637,\n total_parts=64,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.putTrainedModelDefinitionPart({\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n part: 0,\n definition: \"...\",\n total_definition_length: 265632637,\n total_parts: 64,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.put_trained_model_definition_part(\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n part: \"0\",\n body: {\n \"definition\": \"...\",\n \"total_definition_length\": 265632637,\n \"total_parts\": 64\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->putTrainedModelDefinitionPart([\n \"model_id\" => \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n \"part\" => \"0\",\n \"body\" => [\n \"definition\" => \"...\",\n \"total_definition_length\" => 265632637,\n \"total_parts\" => 64,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"definition\":\"...\",\"total_definition_length\":265632637,\"total_parts\":64}' \"$ELASTICSEARCH_URL/_ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/definition/0\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -22560,32 +15722,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/vocabulary\n{\n \"vocabulary\": [\n \"[PAD]\",\n \"[unused0]\",\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.put_trained_model_vocabulary(\n model_id=\"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n vocabulary=[\n \"[PAD]\",\n \"[unused0]\"\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.putTrainedModelVocabulary({\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n vocabulary: [\"[PAD]\", \"[unused0]\"],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.put_trained_model_vocabulary(\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n body: {\n \"vocabulary\": [\n \"[PAD]\",\n \"[unused0]\"\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->putTrainedModelVocabulary([\n \"model_id\" => \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n \"body\" => [\n \"vocabulary\" => array(\n \"[PAD]\",\n \"[unused0]\",\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"vocabulary\":[\"[PAD]\",\"[unused0]\"]}' \"$ELASTICSEARCH_URL/_ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/vocabulary\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -22643,32 +15779,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/anomaly_detectors/total-requests/_reset\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.reset_job(\n job_id=\"total-requests\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.resetJob({\n job_id: \"total-requests\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.reset_job(\n job_id: \"total-requests\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->resetJob([\n \"job_id\" => \"total-requests\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/total-requests/_reset\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -22728,32 +15838,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/data_frame/analytics/loganalytics/_start\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.start_data_frame_analytics(\n id=\"loganalytics\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.startDataFrameAnalytics({\n id: \"loganalytics\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.start_data_frame_analytics(\n id: \"loganalytics\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->startDataFrameAnalytics([\n \"id\" => \"loganalytics\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics/_start\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -22860,32 +15944,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/datafeeds/datafeed-low_request_rate/_start\n{\n \"start\": \"2019-04-07T18:22:16Z\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.start_datafeed(\n datafeed_id=\"datafeed-low_request_rate\",\n start=\"2019-04-07T18:22:16Z\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.startDatafeed({\n datafeed_id: \"datafeed-low_request_rate\",\n start: \"2019-04-07T18:22:16Z\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.start_datafeed(\n datafeed_id: \"datafeed-low_request_rate\",\n body: {\n \"start\": \"2019-04-07T18:22:16Z\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->startDatafeed([\n \"datafeed_id\" => \"datafeed-low_request_rate\",\n \"body\" => [\n \"start\" => \"2019-04-07T18:22:16Z\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"start\":\"2019-04-07T18:22:16Z\"}' \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-low_request_rate/_start\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -23015,32 +16073,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/_start?wait_for=started&timeout=1m\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.start_trained_model_deployment(\n model_id=\"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n wait_for=\"started\",\n timeout=\"1m\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.startTrainedModelDeployment({\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n wait_for: \"started\",\n timeout: \"1m\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.start_trained_model_deployment(\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n wait_for: \"started\",\n timeout: \"1m\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->startTrainedModelDeployment([\n \"model_id\" => \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n \"wait_for\" => \"started\",\n \"timeout\" => \"1m\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/_start?wait_for=started&timeout=1m\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -23116,32 +16148,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/data_frame/analytics/loganalytics/_stop\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.stop_data_frame_analytics(\n id=\"loganalytics\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.stopDataFrameAnalytics({\n id: \"loganalytics\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.stop_data_frame_analytics(\n id: \"loganalytics\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->stopDataFrameAnalytics([\n \"id\" => \"loganalytics\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics/_stop\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -23245,32 +16251,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/datafeeds/datafeed-low_request_rate/_stop\n{\n \"timeout\": \"30s\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.stop_datafeed(\n datafeed_id=\"datafeed-low_request_rate\",\n timeout=\"30s\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.stopDatafeed({\n datafeed_id: \"datafeed-low_request_rate\",\n timeout: \"30s\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.stop_datafeed(\n datafeed_id: \"datafeed-low_request_rate\",\n body: {\n \"timeout\": \"30s\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->stopDatafeed([\n \"datafeed_id\" => \"datafeed-low_request_rate\",\n \"body\" => [\n \"timeout\" => \"30s\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"timeout\":\"30s\"}' \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-low_request_rate/_stop\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -23336,32 +16316,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/trained_models/my_model_for_search/deployment/_stop\n" - }, - { - "lang": "Python", - "source": "resp = client.ml.stop_trained_model_deployment(\n model_id=\"my_model_for_search\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.stopTrainedModelDeployment({\n model_id: \"my_model_for_search\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.stop_trained_model_deployment(\n model_id: \"my_model_for_search\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->stopTrainedModelDeployment([\n \"model_id\" => \"my_model_for_search\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_ml/trained_models/my_model_for_search/deployment/_stop\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -23482,32 +16436,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/data_frame/analytics/loganalytics/_update\n{\n \"model_memory_limit\": \"200mb\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.update_data_frame_analytics(\n id=\"loganalytics\",\n model_memory_limit=\"200mb\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.updateDataFrameAnalytics({\n id: \"loganalytics\",\n model_memory_limit: \"200mb\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.update_data_frame_analytics(\n id: \"loganalytics\",\n body: {\n \"model_memory_limit\": \"200mb\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->updateDataFrameAnalytics([\n \"id\" => \"loganalytics\",\n \"body\" => [\n \"model_memory_limit\" => \"200mb\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"model_memory_limit\":\"200mb\"}' \"$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics/_update\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -23721,32 +16649,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/datafeeds/datafeed-test-job/_update\n{\n \"query\": {\n \"term\": {\n \"geo.src\": \"US\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.update_datafeed(\n datafeed_id=\"datafeed-test-job\",\n query={\n \"term\": {\n \"geo.src\": \"US\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.updateDatafeed({\n datafeed_id: \"datafeed-test-job\",\n query: {\n term: {\n \"geo.src\": \"US\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.update_datafeed(\n datafeed_id: \"datafeed-test-job\",\n body: {\n \"query\": {\n \"term\": {\n \"geo.src\": \"US\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->updateDatafeed([\n \"datafeed_id\" => \"datafeed-test-job\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"geo.src\" => \"US\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"geo.src\":\"US\"}}}' \"$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-test-job/_update\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -23839,32 +16741,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/filters/safe_domains/_update\n{\n \"description\": \"Updated list of domains\",\n \"add_items\": [\"*.myorg.com\"],\n \"remove_items\": [\"wikipedia.org\"]\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.update_filter(\n filter_id=\"safe_domains\",\n description=\"Updated list of domains\",\n add_items=[\n \"*.myorg.com\"\n ],\n remove_items=[\n \"wikipedia.org\"\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.updateFilter({\n filter_id: \"safe_domains\",\n description: \"Updated list of domains\",\n add_items: [\"*.myorg.com\"],\n remove_items: [\"wikipedia.org\"],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.update_filter(\n filter_id: \"safe_domains\",\n body: {\n \"description\": \"Updated list of domains\",\n \"add_items\": [\n \"*.myorg.com\"\n ],\n \"remove_items\": [\n \"wikipedia.org\"\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->updateFilter([\n \"filter_id\" => \"safe_domains\",\n \"body\" => [\n \"description\" => \"Updated list of domains\",\n \"add_items\" => array(\n \"*.myorg.com\",\n ),\n \"remove_items\" => array(\n \"wikipedia.org\",\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"description\":\"Updated list of domains\",\"add_items\":[\"*.myorg.com\"],\"remove_items\":[\"wikipedia.org\"]}' \"$ELASTICSEARCH_URL/_ml/filters/safe_domains/_update\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -24064,38 +16940,12 @@ "model_snapshot_retention_days", "results_index_name" ] - } - } - } - } - }, - "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/anomaly_detectors/low_request_rate/_update\n{\n \"description\":\"An updated job\",\n \"detectors\": {\n \"detector_index\": 0,\n \"description\": \"An updated detector description\"\n },\n \"groups\": [\"kibana_sample_data\",\"kibana_sample_web_logs\"],\n \"model_plot_config\": {\n \"enabled\": true\n },\n \"renormalization_window_days\": 30,\n \"background_persist_interval\": \"2h\",\n \"model_snapshot_retention_days\": 7,\n \"results_retention_days\": 60\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.update_job(\n job_id=\"low_request_rate\",\n description=\"An updated job\",\n detectors={\n \"detector_index\": 0,\n \"description\": \"An updated detector description\"\n },\n groups=[\n \"kibana_sample_data\",\n \"kibana_sample_web_logs\"\n ],\n model_plot_config={\n \"enabled\": True\n },\n renormalization_window_days=30,\n background_persist_interval=\"2h\",\n model_snapshot_retention_days=7,\n results_retention_days=60,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.updateJob({\n job_id: \"low_request_rate\",\n description: \"An updated job\",\n detectors: {\n detector_index: 0,\n description: \"An updated detector description\",\n },\n groups: [\"kibana_sample_data\", \"kibana_sample_web_logs\"],\n model_plot_config: {\n enabled: true,\n },\n renormalization_window_days: 30,\n background_persist_interval: \"2h\",\n model_snapshot_retention_days: 7,\n results_retention_days: 60,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.update_job(\n job_id: \"low_request_rate\",\n body: {\n \"description\": \"An updated job\",\n \"detectors\": {\n \"detector_index\": 0,\n \"description\": \"An updated detector description\"\n },\n \"groups\": [\n \"kibana_sample_data\",\n \"kibana_sample_web_logs\"\n ],\n \"model_plot_config\": {\n \"enabled\": true\n },\n \"renormalization_window_days\": 30,\n \"background_persist_interval\": \"2h\",\n \"model_snapshot_retention_days\": 7,\n \"results_retention_days\": 60\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->updateJob([\n \"job_id\" => \"low_request_rate\",\n \"body\" => [\n \"description\" => \"An updated job\",\n \"detectors\" => [\n \"detector_index\" => 0,\n \"description\" => \"An updated detector description\",\n ],\n \"groups\" => array(\n \"kibana_sample_data\",\n \"kibana_sample_web_logs\",\n ),\n \"model_plot_config\" => [\n \"enabled\" => true,\n ],\n \"renormalization_window_days\" => 30,\n \"background_persist_interval\" => \"2h\",\n \"model_snapshot_retention_days\" => 7,\n \"results_retention_days\" => 60,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"description\":\"An updated job\",\"detectors\":{\"detector_index\":0,\"description\":\"An updated detector description\"},\"groups\":[\"kibana_sample_data\",\"kibana_sample_web_logs\"],\"model_plot_config\":{\"enabled\":true},\"renormalization_window_days\":30,\"background_persist_interval\":\"2h\",\"model_snapshot_retention_days\":7,\"results_retention_days\":60}' \"$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/_update\"" + } + } + } } - ], + }, + "x-state": "Generally available", "x-product-feature": "elasticsearch, machine-learning" } }, @@ -24175,32 +17025,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/_update\n{\n \"number_of_allocations\": 4\n}" - }, - { - "lang": "Python", - "source": "resp = client.ml.update_trained_model_deployment(\n model_id=\"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n number_of_allocations=4,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.ml.updateTrainedModelDeployment({\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n number_of_allocations: 4,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.ml.update_trained_model_deployment(\n model_id: \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n body: {\n \"number_of_allocations\": 4\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->ml()->updateTrainedModelDeployment([\n \"model_id\" => \"elastic__distilbert-base-uncased-finetuned-conll03-english\",\n \"body\" => [\n \"number_of_allocations\" => 4,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"number_of_allocations\":4}' \"$ELASTICSEARCH_URL/_ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/_update\"" - } - ], "x-product-feature": "elasticsearch, machine-learning" } }, @@ -24262,32 +17086,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index-000001/_msearch\n{ }\n{\"query\" : {\"match\" : { \"message\": \"this is a test\"}}}\n{\"index\": \"my-index-000002\"}\n{\"query\" : {\"match_all\" : {}}}" - }, - { - "lang": "Python", - "source": "resp = client.msearch(\n index=\"my-index-000001\",\n searches=[\n {},\n {\n \"query\": {\n \"match\": {\n \"message\": \"this is a test\"\n }\n }\n },\n {\n \"index\": \"my-index-000002\"\n },\n {\n \"query\": {\n \"match_all\": {}\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.msearch({\n index: \"my-index-000001\",\n searches: [\n {},\n {\n query: {\n match: {\n message: \"this is a test\",\n },\n },\n },\n {\n index: \"my-index-000002\",\n },\n {\n query: {\n match_all: {},\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.msearch(\n index: \"my-index-000001\",\n body: [\n {},\n {\n \"query\": {\n \"match\": {\n \"message\": \"this is a test\"\n }\n }\n },\n {\n \"index\": \"my-index-000002\"\n },\n {\n \"query\": {\n \"match_all\": {}\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->msearch([\n \"index\" => \"my-index-000001\",\n \"body\" => array(\n new ArrayObject([]),\n [\n \"query\" => [\n \"match\" => [\n \"message\" => \"this is a test\",\n ],\n ],\n ],\n [\n \"index\" => \"my-index-000002\",\n ],\n [\n \"query\" => [\n \"match_all\" => new ArrayObject([]),\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{},{\"query\":{\"match\":{\"message\":\"this is a test\"}}},{\"index\":\"my-index-000002\"},{\"query\":{\"match_all\":{}}}]' \"$ELASTICSEARCH_URL/my-index-000001/_msearch\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -24347,32 +17145,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index-000001/_msearch\n{ }\n{\"query\" : {\"match\" : { \"message\": \"this is a test\"}}}\n{\"index\": \"my-index-000002\"}\n{\"query\" : {\"match_all\" : {}}}" - }, - { - "lang": "Python", - "source": "resp = client.msearch(\n index=\"my-index-000001\",\n searches=[\n {},\n {\n \"query\": {\n \"match\": {\n \"message\": \"this is a test\"\n }\n }\n },\n {\n \"index\": \"my-index-000002\"\n },\n {\n \"query\": {\n \"match_all\": {}\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.msearch({\n index: \"my-index-000001\",\n searches: [\n {},\n {\n query: {\n match: {\n message: \"this is a test\",\n },\n },\n },\n {\n index: \"my-index-000002\",\n },\n {\n query: {\n match_all: {},\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.msearch(\n index: \"my-index-000001\",\n body: [\n {},\n {\n \"query\": {\n \"match\": {\n \"message\": \"this is a test\"\n }\n }\n },\n {\n \"index\": \"my-index-000002\"\n },\n {\n \"query\": {\n \"match_all\": {}\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->msearch([\n \"index\" => \"my-index-000001\",\n \"body\" => array(\n new ArrayObject([]),\n [\n \"query\" => [\n \"match\" => [\n \"message\" => \"this is a test\",\n ],\n ],\n ],\n [\n \"index\" => \"my-index-000002\",\n ],\n [\n \"query\" => [\n \"match_all\" => new ArrayObject([]),\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{},{\"query\":{\"match\":{\"message\":\"this is a test\"}}},{\"index\":\"my-index-000002\"},{\"query\":{\"match_all\":{}}}]' \"$ELASTICSEARCH_URL/my-index-000001/_msearch\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -24437,32 +17209,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index-000001/_msearch\n{ }\n{\"query\" : {\"match\" : { \"message\": \"this is a test\"}}}\n{\"index\": \"my-index-000002\"}\n{\"query\" : {\"match_all\" : {}}}" - }, - { - "lang": "Python", - "source": "resp = client.msearch(\n index=\"my-index-000001\",\n searches=[\n {},\n {\n \"query\": {\n \"match\": {\n \"message\": \"this is a test\"\n }\n }\n },\n {\n \"index\": \"my-index-000002\"\n },\n {\n \"query\": {\n \"match_all\": {}\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.msearch({\n index: \"my-index-000001\",\n searches: [\n {},\n {\n query: {\n match: {\n message: \"this is a test\",\n },\n },\n },\n {\n index: \"my-index-000002\",\n },\n {\n query: {\n match_all: {},\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.msearch(\n index: \"my-index-000001\",\n body: [\n {},\n {\n \"query\": {\n \"match\": {\n \"message\": \"this is a test\"\n }\n }\n },\n {\n \"index\": \"my-index-000002\"\n },\n {\n \"query\": {\n \"match_all\": {}\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->msearch([\n \"index\" => \"my-index-000001\",\n \"body\" => array(\n new ArrayObject([]),\n [\n \"query\" => [\n \"match\" => [\n \"message\" => \"this is a test\",\n ],\n ],\n ],\n [\n \"index\" => \"my-index-000002\",\n ],\n [\n \"query\" => [\n \"match_all\" => new ArrayObject([]),\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{},{\"query\":{\"match\":{\"message\":\"this is a test\"}}},{\"index\":\"my-index-000002\"},{\"query\":{\"match_all\":{}}}]' \"$ELASTICSEARCH_URL/my-index-000001/_msearch\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -24525,32 +17271,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index-000001/_msearch\n{ }\n{\"query\" : {\"match\" : { \"message\": \"this is a test\"}}}\n{\"index\": \"my-index-000002\"}\n{\"query\" : {\"match_all\" : {}}}" - }, - { - "lang": "Python", - "source": "resp = client.msearch(\n index=\"my-index-000001\",\n searches=[\n {},\n {\n \"query\": {\n \"match\": {\n \"message\": \"this is a test\"\n }\n }\n },\n {\n \"index\": \"my-index-000002\"\n },\n {\n \"query\": {\n \"match_all\": {}\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.msearch({\n index: \"my-index-000001\",\n searches: [\n {},\n {\n query: {\n match: {\n message: \"this is a test\",\n },\n },\n },\n {\n index: \"my-index-000002\",\n },\n {\n query: {\n match_all: {},\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.msearch(\n index: \"my-index-000001\",\n body: [\n {},\n {\n \"query\": {\n \"match\": {\n \"message\": \"this is a test\"\n }\n }\n },\n {\n \"index\": \"my-index-000002\"\n },\n {\n \"query\": {\n \"match_all\": {}\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->msearch([\n \"index\" => \"my-index-000001\",\n \"body\" => array(\n new ArrayObject([]),\n [\n \"query\" => [\n \"match\" => [\n \"message\" => \"this is a test\",\n ],\n ],\n ],\n [\n \"index\" => \"my-index-000002\",\n ],\n [\n \"query\" => [\n \"match_all\" => new ArrayObject([]),\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{},{\"query\":{\"match\":{\"message\":\"this is a test\"}}},{\"index\":\"my-index-000002\"},{\"query\":{\"match_all\":{}}}]' \"$ELASTICSEARCH_URL/my-index-000001/_msearch\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -24591,32 +17311,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index/_msearch/template\n{ }\n{ \"id\": \"my-search-template\", \"params\": { \"query_string\": \"hello world\", \"from\": 0, \"size\": 10 }}\n{ }\n{ \"id\": \"my-other-search-template\", \"params\": { \"query_type\": \"match_all\" }}" - }, - { - "lang": "Python", - "source": "resp = client.msearch_template(\n index=\"my-index\",\n search_templates=[\n {},\n {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n },\n {},\n {\n \"id\": \"my-other-search-template\",\n \"params\": {\n \"query_type\": \"match_all\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.msearchTemplate({\n index: \"my-index\",\n search_templates: [\n {},\n {\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 0,\n size: 10,\n },\n },\n {},\n {\n id: \"my-other-search-template\",\n params: {\n query_type: \"match_all\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.msearch_template(\n index: \"my-index\",\n body: [\n {},\n {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n },\n {},\n {\n \"id\": \"my-other-search-template\",\n \"params\": {\n \"query_type\": \"match_all\"\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->msearchTemplate([\n \"index\" => \"my-index\",\n \"body\" => array(\n new ArrayObject([]),\n [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 0,\n \"size\" => 10,\n ],\n ],\n new ArrayObject([]),\n [\n \"id\" => \"my-other-search-template\",\n \"params\" => [\n \"query_type\" => \"match_all\",\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{},{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":0,\"size\":10}},{},{\"id\":\"my-other-search-template\",\"params\":{\"query_type\":\"match_all\"}}]' \"$ELASTICSEARCH_URL/my-index/_msearch/template\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -24655,32 +17349,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index/_msearch/template\n{ }\n{ \"id\": \"my-search-template\", \"params\": { \"query_string\": \"hello world\", \"from\": 0, \"size\": 10 }}\n{ }\n{ \"id\": \"my-other-search-template\", \"params\": { \"query_type\": \"match_all\" }}" - }, - { - "lang": "Python", - "source": "resp = client.msearch_template(\n index=\"my-index\",\n search_templates=[\n {},\n {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n },\n {},\n {\n \"id\": \"my-other-search-template\",\n \"params\": {\n \"query_type\": \"match_all\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.msearchTemplate({\n index: \"my-index\",\n search_templates: [\n {},\n {\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 0,\n size: 10,\n },\n },\n {},\n {\n id: \"my-other-search-template\",\n params: {\n query_type: \"match_all\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.msearch_template(\n index: \"my-index\",\n body: [\n {},\n {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n },\n {},\n {\n \"id\": \"my-other-search-template\",\n \"params\": {\n \"query_type\": \"match_all\"\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->msearchTemplate([\n \"index\" => \"my-index\",\n \"body\" => array(\n new ArrayObject([]),\n [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 0,\n \"size\" => 10,\n ],\n ],\n new ArrayObject([]),\n [\n \"id\" => \"my-other-search-template\",\n \"params\" => [\n \"query_type\" => \"match_all\",\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{},{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":0,\"size\":10}},{},{\"id\":\"my-other-search-template\",\"params\":{\"query_type\":\"match_all\"}}]' \"$ELASTICSEARCH_URL/my-index/_msearch/template\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -24724,32 +17392,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index/_msearch/template\n{ }\n{ \"id\": \"my-search-template\", \"params\": { \"query_string\": \"hello world\", \"from\": 0, \"size\": 10 }}\n{ }\n{ \"id\": \"my-other-search-template\", \"params\": { \"query_type\": \"match_all\" }}" - }, - { - "lang": "Python", - "source": "resp = client.msearch_template(\n index=\"my-index\",\n search_templates=[\n {},\n {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n },\n {},\n {\n \"id\": \"my-other-search-template\",\n \"params\": {\n \"query_type\": \"match_all\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.msearchTemplate({\n index: \"my-index\",\n search_templates: [\n {},\n {\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 0,\n size: 10,\n },\n },\n {},\n {\n id: \"my-other-search-template\",\n params: {\n query_type: \"match_all\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.msearch_template(\n index: \"my-index\",\n body: [\n {},\n {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n },\n {},\n {\n \"id\": \"my-other-search-template\",\n \"params\": {\n \"query_type\": \"match_all\"\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->msearchTemplate([\n \"index\" => \"my-index\",\n \"body\" => array(\n new ArrayObject([]),\n [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 0,\n \"size\" => 10,\n ],\n ],\n new ArrayObject([]),\n [\n \"id\" => \"my-other-search-template\",\n \"params\" => [\n \"query_type\" => \"match_all\",\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{},{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":0,\"size\":10}},{},{\"id\":\"my-other-search-template\",\"params\":{\"query_type\":\"match_all\"}}]' \"$ELASTICSEARCH_URL/my-index/_msearch/template\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -24791,32 +17433,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index/_msearch/template\n{ }\n{ \"id\": \"my-search-template\", \"params\": { \"query_string\": \"hello world\", \"from\": 0, \"size\": 10 }}\n{ }\n{ \"id\": \"my-other-search-template\", \"params\": { \"query_type\": \"match_all\" }}" - }, - { - "lang": "Python", - "source": "resp = client.msearch_template(\n index=\"my-index\",\n search_templates=[\n {},\n {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n },\n {},\n {\n \"id\": \"my-other-search-template\",\n \"params\": {\n \"query_type\": \"match_all\"\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.msearchTemplate({\n index: \"my-index\",\n search_templates: [\n {},\n {\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 0,\n size: 10,\n },\n },\n {},\n {\n id: \"my-other-search-template\",\n params: {\n query_type: \"match_all\",\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.msearch_template(\n index: \"my-index\",\n body: [\n {},\n {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n },\n {},\n {\n \"id\": \"my-other-search-template\",\n \"params\": {\n \"query_type\": \"match_all\"\n }\n }\n ]\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->msearchTemplate([\n \"index\" => \"my-index\",\n \"body\" => array(\n new ArrayObject([]),\n [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 0,\n \"size\" => 10,\n ],\n ],\n new ArrayObject([]),\n [\n \"id\" => \"my-other-search-template\",\n \"params\" => [\n \"query_type\" => \"match_all\",\n ],\n ],\n ),\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '[{},{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":0,\"size\":10}},{},{\"id\":\"my-other-search-template\",\"params\":{\"query_type\":\"match_all\"}}]' \"$ELASTICSEARCH_URL/my-index/_msearch/template\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -24875,32 +17491,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-index-000001/_mtermvectors\n{\n \"docs\": [\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": true\n },\n {\n \"_id\": \"1\"\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.mtermvectors(\n index=\"my-index-000001\",\n docs=[\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": True\n },\n {\n \"_id\": \"1\"\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.mtermvectors({\n index: \"my-index-000001\",\n docs: [\n {\n _id: \"2\",\n fields: [\"message\"],\n term_statistics: true,\n },\n {\n _id: \"1\",\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.mtermvectors(\n index: \"my-index-000001\",\n body: {\n \"docs\": [\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": true\n },\n {\n \"_id\": \"1\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->mtermvectors([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"docs\" => array(\n [\n \"_id\" => \"2\",\n \"fields\" => array(\n \"message\",\n ),\n \"term_statistics\" => true,\n ],\n [\n \"_id\" => \"1\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"docs\":[{\"_id\":\"2\",\"fields\":[\"message\"],\"term_statistics\":true},{\"_id\":\"1\"}]}' \"$ELASTICSEARCH_URL/my-index-000001/_mtermvectors\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -24957,32 +17547,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-index-000001/_mtermvectors\n{\n \"docs\": [\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": true\n },\n {\n \"_id\": \"1\"\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.mtermvectors(\n index=\"my-index-000001\",\n docs=[\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": True\n },\n {\n \"_id\": \"1\"\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.mtermvectors({\n index: \"my-index-000001\",\n docs: [\n {\n _id: \"2\",\n fields: [\"message\"],\n term_statistics: true,\n },\n {\n _id: \"1\",\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.mtermvectors(\n index: \"my-index-000001\",\n body: {\n \"docs\": [\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": true\n },\n {\n \"_id\": \"1\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->mtermvectors([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"docs\" => array(\n [\n \"_id\" => \"2\",\n \"fields\" => array(\n \"message\",\n ),\n \"term_statistics\" => true,\n ],\n [\n \"_id\" => \"1\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"docs\":[{\"_id\":\"2\",\"fields\":[\"message\"],\"term_statistics\":true},{\"_id\":\"1\"}]}' \"$ELASTICSEARCH_URL/my-index-000001/_mtermvectors\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -25044,32 +17608,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-index-000001/_mtermvectors\n{\n \"docs\": [\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": true\n },\n {\n \"_id\": \"1\"\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.mtermvectors(\n index=\"my-index-000001\",\n docs=[\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": True\n },\n {\n \"_id\": \"1\"\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.mtermvectors({\n index: \"my-index-000001\",\n docs: [\n {\n _id: \"2\",\n fields: [\"message\"],\n term_statistics: true,\n },\n {\n _id: \"1\",\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.mtermvectors(\n index: \"my-index-000001\",\n body: {\n \"docs\": [\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": true\n },\n {\n \"_id\": \"1\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->mtermvectors([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"docs\" => array(\n [\n \"_id\" => \"2\",\n \"fields\" => array(\n \"message\",\n ),\n \"term_statistics\" => true,\n ],\n [\n \"_id\" => \"1\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"docs\":[{\"_id\":\"2\",\"fields\":[\"message\"],\"term_statistics\":true},{\"_id\":\"1\"}]}' \"$ELASTICSEARCH_URL/my-index-000001/_mtermvectors\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -25129,32 +17667,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-index-000001/_mtermvectors\n{\n \"docs\": [\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": true\n },\n {\n \"_id\": \"1\"\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.mtermvectors(\n index=\"my-index-000001\",\n docs=[\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": True\n },\n {\n \"_id\": \"1\"\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.mtermvectors({\n index: \"my-index-000001\",\n docs: [\n {\n _id: \"2\",\n fields: [\"message\"],\n term_statistics: true,\n },\n {\n _id: \"1\",\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.mtermvectors(\n index: \"my-index-000001\",\n body: {\n \"docs\": [\n {\n \"_id\": \"2\",\n \"fields\": [\n \"message\"\n ],\n \"term_statistics\": true\n },\n {\n \"_id\": \"1\"\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->mtermvectors([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"docs\" => array(\n [\n \"_id\" => \"2\",\n \"fields\" => array(\n \"message\",\n ),\n \"term_statistics\" => true,\n ],\n [\n \"_id\" => \"1\",\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"docs\":[{\"_id\":\"2\",\"fields\":[\"message\"],\"term_statistics\":true},{\"_id\":\"1\"}]}' \"$ELASTICSEARCH_URL/my-index-000001/_mtermvectors\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -25295,32 +17807,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /my-index-000001/_pit?keep_alive=1m&allow_partial_search_results=true\n" - }, - { - "lang": "Python", - "source": "resp = client.open_point_in_time(\n index=\"my-index-000001\",\n keep_alive=\"1m\",\n allow_partial_search_results=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.openPointInTime({\n index: \"my-index-000001\",\n keep_alive: \"1m\",\n allow_partial_search_results: \"true\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.open_point_in_time(\n index: \"my-index-000001\",\n keep_alive: \"1m\",\n allow_partial_search_results: \"true\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->openPointInTime([\n \"index\" => \"my-index-000001\",\n \"keep_alive\" => \"1m\",\n \"allow_partial_search_results\" => \"true\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_pit?keep_alive=1m&allow_partial_search_results=true\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -25361,32 +17847,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _scripts/my-search-template\n{\n \"script\": {\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.put_script(\n id=\"my-search-template\",\n script={\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.putScript({\n id: \"my-search-template\",\n script: {\n lang: \"mustache\",\n source: {\n query: {\n match: {\n message: \"{{query_string}}\",\n },\n },\n from: \"{{from}}\",\n size: \"{{size}}\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.put_script(\n id: \"my-search-template\",\n body: {\n \"script\": {\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->putScript([\n \"id\" => \"my-search-template\",\n \"body\" => [\n \"script\" => [\n \"lang\" => \"mustache\",\n \"source\" => [\n \"query\" => [\n \"match\" => [\n \"message\" => \"{{query_string}}\",\n ],\n ],\n \"from\" => \"{{from}}\",\n \"size\" => \"{{size}}\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"script\":{\"lang\":\"mustache\",\"source\":{\"query\":{\"match\":{\"message\":\"{{query_string}}\"}},\"from\":\"{{from}}\",\"size\":\"{{size}}\"}}}' \"$ELASTICSEARCH_URL/_scripts/my-search-template\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -25425,32 +17885,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _scripts/my-search-template\n{\n \"script\": {\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.put_script(\n id=\"my-search-template\",\n script={\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.putScript({\n id: \"my-search-template\",\n script: {\n lang: \"mustache\",\n source: {\n query: {\n match: {\n message: \"{{query_string}}\",\n },\n },\n from: \"{{from}}\",\n size: \"{{size}}\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.put_script(\n id: \"my-search-template\",\n body: {\n \"script\": {\n \"lang\": \"mustache\",\n \"source\": {\n \"query\": {\n \"match\": {\n \"message\": \"{{query_string}}\"\n }\n },\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->putScript([\n \"id\" => \"my-search-template\",\n \"body\" => [\n \"script\" => [\n \"lang\" => \"mustache\",\n \"source\" => [\n \"query\" => [\n \"match\" => [\n \"message\" => \"{{query_string}}\",\n ],\n ],\n \"from\" => \"{{from}}\",\n \"size\" => \"{{size}}\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"script\":{\"lang\":\"mustache\",\"source\":{\"query\":{\"match\":{\"message\":\"{{query_string}}\"}},\"from\":\"{{from}}\",\"size\":\"{{size}}\"}}}' \"$ELASTICSEARCH_URL/_scripts/my-search-template\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -25508,32 +17942,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _query_rules/my-ruleset/_rule/my-rule1\n" - }, - { - "lang": "Python", - "source": "resp = client.query_rules.get_rule(\n ruleset_id=\"my-ruleset\",\n rule_id=\"my-rule1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.queryRules.getRule({\n ruleset_id: \"my-ruleset\",\n rule_id: \"my-rule1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.query_rules.get_rule(\n ruleset_id: \"my-ruleset\",\n rule_id: \"my-rule1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->queryRules()->getRule([\n \"ruleset_id\" => \"my-ruleset\",\n \"rule_id\" => \"my-rule1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_query_rules/my-ruleset/_rule/my-rule1\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -25634,32 +18042,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _query_rules/my-ruleset/_test\n{\n \"match_criteria\": {\n \"query_string\": \"puggles\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.query_rules.test(\n ruleset_id=\"my-ruleset\",\n match_criteria={\n \"query_string\": \"puggles\"\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.queryRules.test({\n ruleset_id: \"my-ruleset\",\n match_criteria: {\n query_string: \"puggles\",\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.query_rules.test(\n ruleset_id: \"my-ruleset\",\n body: {\n \"match_criteria\": {\n \"query_string\": \"puggles\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->queryRules()->test([\n \"ruleset_id\" => \"my-ruleset\",\n \"body\" => [\n \"match_criteria\" => [\n \"query_string\" => \"puggles\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"match_criteria\":{\"query_string\":\"puggles\"}}' \"$ELASTICSEARCH_URL/_query_rules/my-ruleset/_test\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -25701,37 +18083,11 @@ "schema": { "$ref": "#/components/schemas/_types.AcknowledgedResponseBase" } - } - } - } - }, - "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _query_rules/my-ruleset/_rule/my-rule1\n" - }, - { - "lang": "Python", - "source": "resp = client.query_rules.delete_rule(\n ruleset_id=\"my-ruleset\",\n rule_id=\"my-rule1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.queryRules.deleteRule({\n ruleset_id: \"my-ruleset\",\n rule_id: \"my-rule1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.query_rules.delete_rule(\n ruleset_id: \"my-ruleset\",\n rule_id: \"my-rule1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->queryRules()->deleteRule([\n \"ruleset_id\" => \"my-ruleset\",\n \"rule_id\" => \"my-rule1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_query_rules/my-ruleset/_rule/my-rule1\"" + } + } } - ], + }, + "x-state": "Generally available", "x-product-feature": "elasticsearch" } }, @@ -25775,32 +18131,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _query_rules/my-ruleset/\n" - }, - { - "lang": "Python", - "source": "resp = client.query_rules.get_ruleset(\n ruleset_id=\"my-ruleset\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.queryRules.getRuleset({\n ruleset_id: \"my-ruleset\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.query_rules.get_ruleset(\n ruleset_id: \"my-ruleset\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->queryRules()->getRuleset([\n \"ruleset_id\" => \"my-ruleset\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_query_rules/my-ruleset/\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -25881,32 +18211,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _query_rules/my-ruleset\n{\n \"rules\": [\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [ \"pugs\", \"puggles\" ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [ \"us\" ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [ \"rescue dogs\" ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.query_rules.put_ruleset(\n ruleset_id=\"my-ruleset\",\n rules=[\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"pugs\",\n \"puggles\"\n ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [\n \"us\"\n ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"rescue dogs\"\n ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.queryRules.putRuleset({\n ruleset_id: \"my-ruleset\",\n rules: [\n {\n rule_id: \"my-rule1\",\n type: \"pinned\",\n criteria: [\n {\n type: \"contains\",\n metadata: \"user_query\",\n values: [\"pugs\", \"puggles\"],\n },\n {\n type: \"exact\",\n metadata: \"user_country\",\n values: [\"us\"],\n },\n ],\n actions: {\n ids: [\"id1\", \"id2\"],\n },\n },\n {\n rule_id: \"my-rule2\",\n type: \"pinned\",\n criteria: [\n {\n type: \"fuzzy\",\n metadata: \"user_query\",\n values: [\"rescue dogs\"],\n },\n ],\n actions: {\n docs: [\n {\n _index: \"index1\",\n _id: \"id3\",\n },\n {\n _index: \"index2\",\n _id: \"id4\",\n },\n ],\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.query_rules.put_ruleset(\n ruleset_id: \"my-ruleset\",\n body: {\n \"rules\": [\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"pugs\",\n \"puggles\"\n ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [\n \"us\"\n ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"rescue dogs\"\n ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->queryRules()->putRuleset([\n \"ruleset_id\" => \"my-ruleset\",\n \"body\" => [\n \"rules\" => array(\n [\n \"rule_id\" => \"my-rule1\",\n \"type\" => \"pinned\",\n \"criteria\" => array(\n [\n \"type\" => \"contains\",\n \"metadata\" => \"user_query\",\n \"values\" => array(\n \"pugs\",\n \"puggles\",\n ),\n ],\n [\n \"type\" => \"exact\",\n \"metadata\" => \"user_country\",\n \"values\" => array(\n \"us\",\n ),\n ],\n ),\n \"actions\" => [\n \"ids\" => array(\n \"id1\",\n \"id2\",\n ),\n ],\n ],\n [\n \"rule_id\" => \"my-rule2\",\n \"type\" => \"pinned\",\n \"criteria\" => array(\n [\n \"type\" => \"fuzzy\",\n \"metadata\" => \"user_query\",\n \"values\" => array(\n \"rescue dogs\",\n ),\n ],\n ),\n \"actions\" => [\n \"docs\" => array(\n [\n \"_index\" => \"index1\",\n \"_id\" => \"id3\",\n ],\n [\n \"_index\" => \"index2\",\n \"_id\" => \"id4\",\n ],\n ),\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"rules\":[{\"rule_id\":\"my-rule1\",\"type\":\"pinned\",\"criteria\":[{\"type\":\"contains\",\"metadata\":\"user_query\",\"values\":[\"pugs\",\"puggles\"]},{\"type\":\"exact\",\"metadata\":\"user_country\",\"values\":[\"us\"]}],\"actions\":{\"ids\":[\"id1\",\"id2\"]}},{\"rule_id\":\"my-rule2\",\"type\":\"pinned\",\"criteria\":[{\"type\":\"fuzzy\",\"metadata\":\"user_query\",\"values\":[\"rescue dogs\"]}],\"actions\":{\"docs\":[{\"_index\":\"index1\",\"_id\":\"id3\"},{\"_index\":\"index2\",\"_id\":\"id4\"}]}}]}' \"$ELASTICSEARCH_URL/_query_rules/my-ruleset\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -25942,32 +18246,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _query_rules/my-ruleset/\n" - }, - { - "lang": "Python", - "source": "resp = client.query_rules.delete_ruleset(\n ruleset_id=\"my-ruleset\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.queryRules.deleteRuleset({\n ruleset_id: \"my-ruleset\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.query_rules.delete_ruleset(\n ruleset_id: \"my-ruleset\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->queryRules()->deleteRuleset([\n \"ruleset_id\" => \"my-ruleset\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_query_rules/my-ruleset/\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -26035,32 +18313,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _query_rules/?from=0&size=3\n" - }, - { - "lang": "Python", - "source": "resp = client.query_rules.list_rulesets(\n from=\"0\",\n size=\"3\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.queryRules.listRulesets({\n from: 0,\n size: 3,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.query_rules.list_rulesets(\n from: \"0\",\n size: \"3\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->queryRules()->listRulesets([\n \"from\" => \"0\",\n \"size\" => \"3\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_query_rules/?from=0&size=3\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -26147,32 +18399,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _query_rules/my-ruleset\n{\n \"rules\": [\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [ \"pugs\", \"puggles\" ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [ \"us\" ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [ \"rescue dogs\" ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.query_rules.put_ruleset(\n ruleset_id=\"my-ruleset\",\n rules=[\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"pugs\",\n \"puggles\"\n ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [\n \"us\"\n ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"rescue dogs\"\n ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.queryRules.putRuleset({\n ruleset_id: \"my-ruleset\",\n rules: [\n {\n rule_id: \"my-rule1\",\n type: \"pinned\",\n criteria: [\n {\n type: \"contains\",\n metadata: \"user_query\",\n values: [\"pugs\", \"puggles\"],\n },\n {\n type: \"exact\",\n metadata: \"user_country\",\n values: [\"us\"],\n },\n ],\n actions: {\n ids: [\"id1\", \"id2\"],\n },\n },\n {\n rule_id: \"my-rule2\",\n type: \"pinned\",\n criteria: [\n {\n type: \"fuzzy\",\n metadata: \"user_query\",\n values: [\"rescue dogs\"],\n },\n ],\n actions: {\n docs: [\n {\n _index: \"index1\",\n _id: \"id3\",\n },\n {\n _index: \"index2\",\n _id: \"id4\",\n },\n ],\n },\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.query_rules.put_ruleset(\n ruleset_id: \"my-ruleset\",\n body: {\n \"rules\": [\n {\n \"rule_id\": \"my-rule1\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"contains\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"pugs\",\n \"puggles\"\n ]\n },\n {\n \"type\": \"exact\",\n \"metadata\": \"user_country\",\n \"values\": [\n \"us\"\n ]\n }\n ],\n \"actions\": {\n \"ids\": [\n \"id1\",\n \"id2\"\n ]\n }\n },\n {\n \"rule_id\": \"my-rule2\",\n \"type\": \"pinned\",\n \"criteria\": [\n {\n \"type\": \"fuzzy\",\n \"metadata\": \"user_query\",\n \"values\": [\n \"rescue dogs\"\n ]\n }\n ],\n \"actions\": {\n \"docs\": [\n {\n \"_index\": \"index1\",\n \"_id\": \"id3\"\n },\n {\n \"_index\": \"index2\",\n \"_id\": \"id4\"\n }\n ]\n }\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->queryRules()->putRuleset([\n \"ruleset_id\" => \"my-ruleset\",\n \"body\" => [\n \"rules\" => array(\n [\n \"rule_id\" => \"my-rule1\",\n \"type\" => \"pinned\",\n \"criteria\" => array(\n [\n \"type\" => \"contains\",\n \"metadata\" => \"user_query\",\n \"values\" => array(\n \"pugs\",\n \"puggles\",\n ),\n ],\n [\n \"type\" => \"exact\",\n \"metadata\" => \"user_country\",\n \"values\" => array(\n \"us\",\n ),\n ],\n ),\n \"actions\" => [\n \"ids\" => array(\n \"id1\",\n \"id2\",\n ),\n ],\n ],\n [\n \"rule_id\" => \"my-rule2\",\n \"type\" => \"pinned\",\n \"criteria\" => array(\n [\n \"type\" => \"fuzzy\",\n \"metadata\" => \"user_query\",\n \"values\" => array(\n \"rescue dogs\",\n ),\n ],\n ),\n \"actions\" => [\n \"docs\" => array(\n [\n \"_index\" => \"index1\",\n \"_id\" => \"id3\",\n ],\n [\n \"_index\" => \"index2\",\n \"_id\" => \"id4\",\n ],\n ),\n ],\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"rules\":[{\"rule_id\":\"my-rule1\",\"type\":\"pinned\",\"criteria\":[{\"type\":\"contains\",\"metadata\":\"user_query\",\"values\":[\"pugs\",\"puggles\"]},{\"type\":\"exact\",\"metadata\":\"user_country\",\"values\":[\"us\"]}],\"actions\":{\"ids\":[\"id1\",\"id2\"]}},{\"rule_id\":\"my-rule2\",\"type\":\"pinned\",\"criteria\":[{\"type\":\"fuzzy\",\"metadata\":\"user_query\",\"values\":[\"rescue dogs\"]}],\"actions\":{\"docs\":[{\"_index\":\"index1\",\"_id\":\"id3\"},{\"_index\":\"index2\",\"_id\":\"id4\"}]}}]}' \"$ELASTICSEARCH_URL/_query_rules/my-ruleset\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -26207,32 +18433,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_rank_eval\n{\n \"requests\": [\n {\n \"id\": \"JFK query\",\n \"request\": { \"query\": { \"match_all\": {} } },\n \"ratings\": []\n } ],\n \"metric\": {\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": false\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.rank_eval(\n index=\"my-index-000001\",\n requests=[\n {\n \"id\": \"JFK query\",\n \"request\": {\n \"query\": {\n \"match_all\": {}\n }\n },\n \"ratings\": []\n }\n ],\n metric={\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": False\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.rankEval({\n index: \"my-index-000001\",\n requests: [\n {\n id: \"JFK query\",\n request: {\n query: {\n match_all: {},\n },\n },\n ratings: [],\n },\n ],\n metric: {\n precision: {\n k: 20,\n relevant_rating_threshold: 1,\n ignore_unlabeled: false,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.rank_eval(\n index: \"my-index-000001\",\n body: {\n \"requests\": [\n {\n \"id\": \"JFK query\",\n \"request\": {\n \"query\": {\n \"match_all\": {}\n }\n },\n \"ratings\": []\n }\n ],\n \"metric\": {\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": false\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->rankEval([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"requests\" => array(\n [\n \"id\" => \"JFK query\",\n \"request\" => [\n \"query\" => [\n \"match_all\" => new ArrayObject([]),\n ],\n ],\n \"ratings\" => array(\n ),\n ],\n ),\n \"metric\" => [\n \"precision\" => [\n \"k\" => 20,\n \"relevant_rating_threshold\" => 1,\n \"ignore_unlabeled\" => false,\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"requests\":[{\"id\":\"JFK query\",\"request\":{\"query\":{\"match_all\":{}}},\"ratings\":[]}],\"metric\":{\"precision\":{\"k\":20,\"relevant_rating_threshold\":1,\"ignore_unlabeled\":false}}}' \"$ELASTICSEARCH_URL/my-index-000001/_rank_eval\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -26265,32 +18465,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_rank_eval\n{\n \"requests\": [\n {\n \"id\": \"JFK query\",\n \"request\": { \"query\": { \"match_all\": {} } },\n \"ratings\": []\n } ],\n \"metric\": {\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": false\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.rank_eval(\n index=\"my-index-000001\",\n requests=[\n {\n \"id\": \"JFK query\",\n \"request\": {\n \"query\": {\n \"match_all\": {}\n }\n },\n \"ratings\": []\n }\n ],\n metric={\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": False\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.rankEval({\n index: \"my-index-000001\",\n requests: [\n {\n id: \"JFK query\",\n request: {\n query: {\n match_all: {},\n },\n },\n ratings: [],\n },\n ],\n metric: {\n precision: {\n k: 20,\n relevant_rating_threshold: 1,\n ignore_unlabeled: false,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.rank_eval(\n index: \"my-index-000001\",\n body: {\n \"requests\": [\n {\n \"id\": \"JFK query\",\n \"request\": {\n \"query\": {\n \"match_all\": {}\n }\n },\n \"ratings\": []\n }\n ],\n \"metric\": {\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": false\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->rankEval([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"requests\" => array(\n [\n \"id\" => \"JFK query\",\n \"request\" => [\n \"query\" => [\n \"match_all\" => new ArrayObject([]),\n ],\n ],\n \"ratings\" => array(\n ),\n ],\n ),\n \"metric\" => [\n \"precision\" => [\n \"k\" => 20,\n \"relevant_rating_threshold\" => 1,\n \"ignore_unlabeled\" => false,\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"requests\":[{\"id\":\"JFK query\",\"request\":{\"query\":{\"match_all\":{}}},\"ratings\":[]}],\"metric\":{\"precision\":{\"k\":20,\"relevant_rating_threshold\":1,\"ignore_unlabeled\":false}}}' \"$ELASTICSEARCH_URL/my-index-000001/_rank_eval\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -26328,32 +18502,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_rank_eval\n{\n \"requests\": [\n {\n \"id\": \"JFK query\",\n \"request\": { \"query\": { \"match_all\": {} } },\n \"ratings\": []\n } ],\n \"metric\": {\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": false\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.rank_eval(\n index=\"my-index-000001\",\n requests=[\n {\n \"id\": \"JFK query\",\n \"request\": {\n \"query\": {\n \"match_all\": {}\n }\n },\n \"ratings\": []\n }\n ],\n metric={\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": False\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.rankEval({\n index: \"my-index-000001\",\n requests: [\n {\n id: \"JFK query\",\n request: {\n query: {\n match_all: {},\n },\n },\n ratings: [],\n },\n ],\n metric: {\n precision: {\n k: 20,\n relevant_rating_threshold: 1,\n ignore_unlabeled: false,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.rank_eval(\n index: \"my-index-000001\",\n body: {\n \"requests\": [\n {\n \"id\": \"JFK query\",\n \"request\": {\n \"query\": {\n \"match_all\": {}\n }\n },\n \"ratings\": []\n }\n ],\n \"metric\": {\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": false\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->rankEval([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"requests\" => array(\n [\n \"id\" => \"JFK query\",\n \"request\" => [\n \"query\" => [\n \"match_all\" => new ArrayObject([]),\n ],\n ],\n \"ratings\" => array(\n ),\n ],\n ),\n \"metric\" => [\n \"precision\" => [\n \"k\" => 20,\n \"relevant_rating_threshold\" => 1,\n \"ignore_unlabeled\" => false,\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"requests\":[{\"id\":\"JFK query\",\"request\":{\"query\":{\"match_all\":{}}},\"ratings\":[]}],\"metric\":{\"precision\":{\"k\":20,\"relevant_rating_threshold\":1,\"ignore_unlabeled\":false}}}' \"$ELASTICSEARCH_URL/my-index-000001/_rank_eval\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -26389,32 +18537,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_rank_eval\n{\n \"requests\": [\n {\n \"id\": \"JFK query\",\n \"request\": { \"query\": { \"match_all\": {} } },\n \"ratings\": []\n } ],\n \"metric\": {\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": false\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.rank_eval(\n index=\"my-index-000001\",\n requests=[\n {\n \"id\": \"JFK query\",\n \"request\": {\n \"query\": {\n \"match_all\": {}\n }\n },\n \"ratings\": []\n }\n ],\n metric={\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": False\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.rankEval({\n index: \"my-index-000001\",\n requests: [\n {\n id: \"JFK query\",\n request: {\n query: {\n match_all: {},\n },\n },\n ratings: [],\n },\n ],\n metric: {\n precision: {\n k: 20,\n relevant_rating_threshold: 1,\n ignore_unlabeled: false,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.rank_eval(\n index: \"my-index-000001\",\n body: {\n \"requests\": [\n {\n \"id\": \"JFK query\",\n \"request\": {\n \"query\": {\n \"match_all\": {}\n }\n },\n \"ratings\": []\n }\n ],\n \"metric\": {\n \"precision\": {\n \"k\": 20,\n \"relevant_rating_threshold\": 1,\n \"ignore_unlabeled\": false\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->rankEval([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"requests\" => array(\n [\n \"id\" => \"JFK query\",\n \"request\" => [\n \"query\" => [\n \"match_all\" => new ArrayObject([]),\n ],\n ],\n \"ratings\" => array(\n ),\n ],\n ),\n \"metric\" => [\n \"precision\" => [\n \"k\" => 20,\n \"relevant_rating_threshold\" => 1,\n \"ignore_unlabeled\" => false,\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"requests\":[{\"id\":\"JFK query\",\"request\":{\"query\":{\"match_all\":{}}},\"ratings\":[]}],\"metric\":{\"precision\":{\"k\":20,\"relevant_rating_threshold\":1,\"ignore_unlabeled\":false}}}' \"$ELASTICSEARCH_URL/my-index-000001/_rank_eval\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -26424,7 +18546,10 @@ "document" ], "summary": "Reindex documents", - "description": "Copy documents from a source to a destination.\nYou can copy all documents to the destination index or reindex a subset of the documents.\nThe source can be any existing index, alias, or data stream.\nThe destination must differ from the source.\nFor example, you cannot reindex a data stream into itself.\n\nIMPORTANT: Reindex requires `_source` to be enabled for all documents in the source.\nThe destination should be configured as wanted before calling the reindex API.\nReindex does not copy the settings from the source or its associated template.\nMappings, shard counts, and replicas, for example, must be configured ahead of time.\n\nIf the Elasticsearch security features are enabled, you must have the following security privileges:\n\n* The `read` index privilege for the source data stream, index, or alias.\n* The `write` index privilege for the destination data stream, index, or index alias.\n* To automatically create a data stream or index with a reindex API request, you must have the `auto_configure`, `create_index`, or `manage` index privilege for the destination data stream, index, or alias.\n* If reindexing from a remote cluster, the `source.remote.user` must have the `monitor` cluster privilege and the `read` index privilege for the source data stream, index, or alias.\n\nIf reindexing from a remote cluster, you must explicitly allow the remote host in the `reindex.remote.whitelist` setting.\nAutomatic data stream creation requires a matching index template with data stream enabled.\n\nThe `dest` element can be configured like the index API to control optimistic concurrency control.\nOmitting `version_type` or setting it to `internal` causes Elasticsearch to blindly dump documents into the destination, overwriting any that happen to have the same ID.\n\nSetting `version_type` to `external` causes Elasticsearch to preserve the `version` from the source, create any documents that are missing, and update any documents that have an older version in the destination than they do in the source.\n\nSetting `op_type` to `create` causes the reindex API to create only missing documents in the destination.\nAll existing documents will cause a version conflict.\n\nIMPORTANT: Because data streams are append-only, any reindex request to a destination data stream must have an `op_type` of `create`.\nA reindex can only add new documents to a destination data stream.\nIt cannot update existing documents in a destination data stream.\n\nBy default, version conflicts abort the reindex process.\nTo continue reindexing if there are conflicts, set the `conflicts` request body property to `proceed`.\nIn this case, the response includes a count of the version conflicts that were encountered.\nNote that the handling of other error types is unaffected by the `conflicts` property.\nAdditionally, if you opt to count version conflicts, the operation could attempt to reindex more documents from the source than `max_docs` until it has successfully indexed `max_docs` documents into the target or it has gone through every document in the source query.\n\nNOTE: The reindex API makes no effort to handle ID collisions.\nThe last document written will \"win\" but the order isn't usually predictable so it is not a good idea to rely on this behavior.\nInstead, make sure that IDs are unique by using a script.\n\n**Running reindex asynchronously**\n\nIf the request contains `wait_for_completion=false`, Elasticsearch performs some preflight checks, launches the request, and returns a task you can use to cancel or get the status of the task.\nElasticsearch creates a record of this task as a document at `_tasks/`.\n\n**Reindex from multiple sources**\n\nIf you have many sources to reindex it is generally better to reindex them one at a time rather than using a glob pattern to pick up multiple sources.\nThat way you can resume the process if there are any errors by removing the partially completed source and starting over.\nIt also makes parallelizing the process fairly simple: split the list of sources to reindex and run each list in parallel.\n\nFor example, you can use a bash script like this:\n\n```\nfor index in i1 i2 i3 i4 i5; do\n curl -HContent-Type:application/json -XPOST localhost:9200/_reindex?pretty -d'{\n \"source\": {\n \"index\": \"'$index'\"\n },\n \"dest\": {\n \"index\": \"'$index'-reindexed\"\n }\n }'\ndone\n```\n\n**Throttling**\n\nSet `requests_per_second` to any positive decimal number (`1.4`, `6`, `1000`, for example) to throttle the rate at which reindex issues batches of index operations.\nRequests are throttled by padding each batch with a wait time.\nTo turn off throttling, set `requests_per_second` to `-1`.\n\nThe throttling is done by waiting between batches so that the scroll that reindex uses internally can be given a timeout that takes into account the padding.\nThe padding time is the difference between the batch size divided by the `requests_per_second` and the time spent writing.\nBy default the batch size is `1000`, so if `requests_per_second` is set to `500`:\n\n```\ntarget_time = 1000 / 500 per second = 2 seconds\nwait_time = target_time - write_time = 2 seconds - .5 seconds = 1.5 seconds\n```\n\nSince the batch is issued as a single bulk request, large batch sizes cause Elasticsearch to create many requests and then wait for a while before starting the next set.\nThis is \"bursty\" instead of \"smooth\".\n\n**Slicing**\n\nReindex supports sliced scroll to parallelize the reindexing process.\nThis parallelization can improve efficiency and provide a convenient way to break the request down into smaller parts.\n\nNOTE: Reindexing from remote clusters does not support manual or automatic slicing.\n\nYou can slice a reindex request manually by providing a slice ID and total number of slices to each request.\nYou can also let reindex automatically parallelize by using sliced scroll to slice on `_id`.\nThe `slices` parameter specifies the number of slices to use.\n\nAdding `slices` to the reindex request just automates the manual process, creating sub-requests which means it has some quirks:\n\n* You can see these requests in the tasks API. These sub-requests are \"child\" tasks of the task for the request with slices.\n* Fetching the status of the task for the request with `slices` only contains the status of completed slices.\n* These sub-requests are individually addressable for things like cancellation and rethrottling.\n* Rethrottling the request with `slices` will rethrottle the unfinished sub-request proportionally.\n* Canceling the request with `slices` will cancel each sub-request.\n* Due to the nature of `slices`, each sub-request won't get a perfectly even portion of the documents. All documents will be addressed, but some slices may be larger than others. Expect larger slices to have a more even distribution.\n* Parameters like `requests_per_second` and `max_docs` on a request with `slices` are distributed proportionally to each sub-request. Combine that with the previous point about distribution being uneven and you should conclude that using `max_docs` with `slices` might not result in exactly `max_docs` documents being reindexed.\n* Each sub-request gets a slightly different snapshot of the source, though these are all taken at approximately the same time.\n\nIf slicing automatically, setting `slices` to `auto` will choose a reasonable number for most indices.\nIf slicing manually or otherwise tuning automatic slicing, use the following guidelines.\n\nQuery performance is most efficient when the number of slices is equal to the number of shards in the index.\nIf that number is large (for example, `500`), choose a lower number as too many slices will hurt performance.\nSetting slices higher than the number of shards generally does not improve efficiency and adds overhead.\n\nIndexing performance scales linearly across available resources with the number of slices.\n\nWhether query or indexing performance dominates the runtime depends on the documents being reindexed and cluster resources.\n\n**Modify documents during reindexing**\n\nLike `_update_by_query`, reindex operations support a script that modifies the document.\nUnlike `_update_by_query`, the script is allowed to modify the document's metadata.\n\nJust as in `_update_by_query`, you can set `ctx.op` to change the operation that is run on the destination.\nFor example, set `ctx.op` to `noop` if your script decides that the document doesn’t have to be indexed in the destination. This \"no operation\" will be reported in the `noop` counter in the response body.\nSet `ctx.op` to `delete` if your script decides that the document must be deleted from the destination.\nThe deletion will be reported in the `deleted` counter in the response body.\nSetting `ctx.op` to anything else will return an error, as will setting any other field in `ctx`.\n\nThink of the possibilities! Just be careful; you are able to change:\n\n* `_id`\n* `_index`\n* `_version`\n* `_routing`\n\nSetting `_version` to `null` or clearing it from the `ctx` map is just like not sending the version in an indexing request.\nIt will cause the document to be overwritten in the destination regardless of the version on the target or the version type you use in the reindex API.\n\n**Reindex from remote**\n\nReindex supports reindexing from a remote Elasticsearch cluster.\nThe `host` parameter must contain a scheme, host, port, and optional path.\nThe `username` and `password` parameters are optional and when they are present the reindex operation will connect to the remote Elasticsearch node using basic authentication.\nBe sure to use HTTPS when using basic authentication or the password will be sent in plain text.\nThere are a range of settings available to configure the behavior of the HTTPS connection.\n\nWhen using Elastic Cloud, it is also possible to authenticate against the remote cluster through the use of a valid API key.\nRemote hosts must be explicitly allowed with the `reindex.remote.whitelist` setting.\nIt can be set to a comma delimited list of allowed remote host and port combinations.\nScheme is ignored; only the host and port are used.\nFor example:\n\n```\nreindex.remote.whitelist: [otherhost:9200, another:9200, 127.0.10.*:9200, localhost:*\"]\n```\n\nThe list of allowed hosts must be configured on any nodes that will coordinate the reindex.\nThis feature should work with remote clusters of any version of Elasticsearch.\nThis should enable you to upgrade from any version of Elasticsearch to the current version by reindexing from a cluster of the old version.\n\nWARNING: Elasticsearch does not support forward compatibility across major versions.\nFor example, you cannot reindex from a 7.x cluster into a 6.x cluster.\n\nTo enable queries sent to older versions of Elasticsearch, the `query` parameter is sent directly to the remote host without validation or modification.\n\nNOTE: Reindexing from remote clusters does not support manual or automatic slicing.\n\nReindexing from a remote server uses an on-heap buffer that defaults to a maximum size of 100mb.\nIf the remote index includes very large documents you'll need to use a smaller batch size.\nIt is also possible to set the socket read timeout on the remote connection with the `socket_timeout` field and the connection timeout with the `connect_timeout` field.\nBoth default to 30 seconds.\n\n**Configuring SSL parameters**\n\nReindex from remote supports configurable SSL settings.\nThese must be specified in the `elasticsearch.yml` file, with the exception of the secure settings, which you add in the Elasticsearch keystore.\nIt is not possible to configure SSL in the body of the reindex request.\n\n## Required authorization\n\n* Index privileges: `read`,`write`\n", + "description": "Copy documents from a source to a destination.\nYou can copy all documents to the destination index or reindex a subset of the documents.\nThe source can be any existing index, alias, or data stream.\nThe destination must differ from the source.\nFor example, you cannot reindex a data stream into itself.\n\nIMPORTANT: Reindex requires `_source` to be enabled for all documents in the source.\nThe destination should be configured as wanted before calling the reindex API.\nReindex does not copy the settings from the source or its associated template.\nMappings, shard counts, and replicas, for example, must be configured ahead of time.\n\nIf the Elasticsearch security features are enabled, you must have the following security privileges:\n\n* The `read` index privilege for the source data stream, index, or alias.\n* The `write` index privilege for the destination data stream, index, or index alias.\n* To automatically create a data stream or index with a reindex API request, you must have the `auto_configure`, `create_index`, or `manage` index privilege for the destination data stream, index, or alias.\n* If reindexing from a remote cluster, the `source.remote.user` must have the `monitor` cluster privilege and the `read` index privilege for the source data stream, index, or alias.\n\nIf reindexing from a remote cluster, you must explicitly allow the remote host in the `reindex.remote.whitelist` setting.\nAutomatic data stream creation requires a matching index template with data stream enabled.\n\nThe `dest` element can be configured like the index API to control optimistic concurrency control.\nOmitting `version_type` or setting it to `internal` causes Elasticsearch to blindly dump documents into the destination, overwriting any that happen to have the same ID.\n\nSetting `version_type` to `external` causes Elasticsearch to preserve the `version` from the source, create any documents that are missing, and update any documents that have an older version in the destination than they do in the source.\n\nSetting `op_type` to `create` causes the reindex API to create only missing documents in the destination.\nAll existing documents will cause a version conflict.\n\nIMPORTANT: Because data streams are append-only, any reindex request to a destination data stream must have an `op_type` of `create`.\nA reindex can only add new documents to a destination data stream.\nIt cannot update existing documents in a destination data stream.\n\nBy default, version conflicts abort the reindex process.\nTo continue reindexing if there are conflicts, set the `conflicts` request body property to `proceed`.\nIn this case, the response includes a count of the version conflicts that were encountered.\nNote that the handling of other error types is unaffected by the `conflicts` property.\nAdditionally, if you opt to count version conflicts, the operation could attempt to reindex more documents from the source than `max_docs` until it has successfully indexed `max_docs` documents into the target or it has gone through every document in the source query.\n\nRefer to the linked documentation for examples of how to reindex documents.\n\n## Required authorization\n\n* Index privileges: `read`,`write`\n", + "externalDocs": { + "url": "https://www.elastic.co/docs/reference/elasticsearch/rest-apis/reindex-indices" + }, "operationId": "reindex", "parameters": [ { @@ -26544,66 +18669,6 @@ "summary": "Reindex multiple sources", "description": "Run `POST _reindex` to reindex from multiple sources. The `index` attribute in source can be a list, which enables you to copy from lots of sources in one request. This example copies documents from the `my-index-000001` and `my-index-000002` indices.\n", "value": "{\n \"source\": {\n \"index\": [\"my-index-000001\", \"my-index-000002\"]\n },\n \"dest\": {\n \"index\": \"my-new-index-000002\"\n }\n}" - }, - "ReindexRequestExample10": { - "summary": "Reindex with Painless", - "description": "You can use Painless to reindex daily indices to apply a new template to the existing documents. The script extracts the date from the index name and creates a new index with `-1` appended. For example, all data from `metricbeat-2016.05.31` will be reindexed into `metricbeat-2016.05.31-1`.\n", - "value": "{\n \"source\": {\n \"index\": \"metricbeat-*\"\n },\n \"dest\": {\n \"index\": \"metricbeat\"\n },\n \"script\": {\n \"lang\": \"painless\",\n \"source\": \"ctx._index = 'metricbeat-' + (ctx._index.substring('metricbeat-'.length(), ctx._index.length())) + '-1'\"\n }\n}" - }, - "ReindexRequestExample11": { - "summary": "Reindex a random subset", - "description": "Run `POST _reindex` to extract a random subset of the source for testing. You might need to adjust the `min_score` value depending on the relative amount of data extracted from source.\n", - "value": "{\n \"max_docs\": 10,\n \"source\": {\n \"index\": \"my-index-000001\",\n \"query\": {\n \"function_score\" : {\n \"random_score\" : {},\n \"min_score\" : 0.9\n }\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - }, - "ReindexRequestExample12": { - "summary": "Reindex modified documents", - "description": "Run `POST _reindex` to modify documents during reindexing. This example bumps the version of the source document.\n", - "value": "{\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\",\n \"version_type\": \"external\"\n },\n \"script\": {\n \"source\": \"if (ctx._source.foo == 'bar') {ctx._version++; ctx._source.remove('foo')}\",\n \"lang\": \"painless\"\n }\n}" - }, - "ReindexRequestExample13": { - "summary": "Reindex from remote on Elastic Cloud", - "description": "When using Elastic Cloud, you can run `POST _reindex` and authenticate against a remote cluster with an API key.\n", - "value": "{\n \"source\": {\n \"remote\": {\n \"host\": \"http://otherhost:9200\",\n \"username\": \"user\",\n \"password\": \"pass\"\n },\n \"index\": \"my-index-000001\",\n \"query\": {\n \"match\": {\n \"test\": \"data\"\n }\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - }, - "ReindexRequestExample2": { - "summary": "Manual slicing", - "description": "Run `POST _reindex` to slice a reindex request manually. Provide a slice ID and total number of slices to each request.\n", - "value": "{\n \"source\": {\n \"index\": \"my-index-000001\",\n \"slice\": {\n \"id\": 0,\n \"max\": 2\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - }, - "ReindexRequestExample3": { - "summary": "Automatic slicing", - "description": "Run `POST _reindex?slices=5&refresh` to automatically parallelize using sliced scroll to slice on `_id`. The `slices` parameter specifies the number of slices to use.\n", - "value": "{\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - }, - "ReindexRequestExample4": { - "summary": "Routing", - "description": "By default if reindex sees a document with routing then the routing is preserved unless it's changed by the script. You can set `routing` on the `dest` request to change this behavior. In this example, run `POST _reindex` to copy all documents from the `source` with the company name `cat` into the `dest` with routing set to `cat`.\n", - "value": "{\n \"source\": {\n \"index\": \"source\",\n \"query\": {\n \"match\": {\n \"company\": \"cat\"\n }\n }\n },\n \"dest\": {\n \"index\": \"dest\",\n \"routing\": \"=cat\"\n }\n}" - }, - "ReindexRequestExample5": { - "summary": "Ingest pipelines", - "description": "Run `POST _reindex` and use the ingest pipelines feature.", - "value": "{\n \"source\": {\n \"index\": \"source\"\n },\n \"dest\": {\n \"index\": \"dest\",\n \"pipeline\": \"some_ingest_pipeline\"\n }\n}" - }, - "ReindexRequestExample6": { - "summary": "Reindex with a query", - "description": "Run `POST _reindex` and add a query to the `source` to limit the documents to reindex. For example, this request copies documents into `my-new-index-000001` only if they have a `user.id` of `kimchy`.\n", - "value": "{\n \"source\": {\n \"index\": \"my-index-000001\",\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - }, - "ReindexRequestExample7": { - "summary": "Reindex with max_docs", - "description": "You can limit the number of processed documents by setting `max_docs`. For example, run `POST _reindex` to copy a single document from `my-index-000001` to `my-new-index-000001`.\n", - "value": "{\n \"max_docs\": 1,\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - }, - "ReindexRequestExample8": { - "summary": "Reindex selected fields", - "description": "You can use source filtering to reindex a subset of the fields in the original documents. For example, run `POST _reindex` the reindex only the `user.id` and `_doc` fields of each document.\n", - "value": "{\n \"source\": {\n \"index\": \"my-index-000001\",\n \"_source\": [\"user.id\", \"_doc\"]\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - }, - "ReindexRequestExample9": { - "summary": "Reindex new field names", - "description": "A reindex operation can build a copy of an index with renamed fields. If your index has documents with `text` and `flag` fields, you can change the latter field name to `tag` during the reindex.\n", - "value": "{\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n },\n \"script\": {\n \"source\": \"ctx._source.tag = ctx._source.remove(\\\"flag\\\")\"\n }\n}" } } } @@ -26686,32 +18751,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _reindex\n{\n \"source\": {\n \"index\": [\"my-index-000001\", \"my-index-000002\"]\n },\n \"dest\": {\n \"index\": \"my-new-index-000002\"\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.reindex(\n source={\n \"index\": [\n \"my-index-000001\",\n \"my-index-000002\"\n ]\n },\n dest={\n \"index\": \"my-new-index-000002\"\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.reindex({\n source: {\n index: [\"my-index-000001\", \"my-index-000002\"],\n },\n dest: {\n index: \"my-new-index-000002\",\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.reindex(\n body: {\n \"source\": {\n \"index\": [\n \"my-index-000001\",\n \"my-index-000002\"\n ]\n },\n \"dest\": {\n \"index\": \"my-new-index-000002\"\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->reindex([\n \"body\" => [\n \"source\" => [\n \"index\" => array(\n \"my-index-000001\",\n \"my-index-000002\",\n ),\n ],\n \"dest\" => [\n \"index\" => \"my-new-index-000002\",\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":[\"my-index-000001\",\"my-index-000002\"]},\"dest\":{\"index\":\"my-new-index-000002\"}}' \"$ELASTICSEARCH_URL/_reindex\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -26732,32 +18771,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _render/template\n{\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.render_search_template(\n id=\"my-search-template\",\n params={\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.renderSearchTemplate({\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 20,\n size: 10,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.render_search_template(\n body: {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->renderSearchTemplate([\n \"body\" => [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 20,\n \"size\" => 10,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":20,\"size\":10}}' \"$ELASTICSEARCH_URL/_render/template\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -26776,32 +18789,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _render/template\n{\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.render_search_template(\n id=\"my-search-template\",\n params={\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.renderSearchTemplate({\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 20,\n size: 10,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.render_search_template(\n body: {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->renderSearchTemplate([\n \"body\" => [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 20,\n \"size\" => 10,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":20,\"size\":10}}' \"$ELASTICSEARCH_URL/_render/template\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -26827,32 +18814,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _render/template\n{\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.render_search_template(\n id=\"my-search-template\",\n params={\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.renderSearchTemplate({\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 20,\n size: 10,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.render_search_template(\n body: {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->renderSearchTemplate([\n \"body\" => [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 20,\n \"size\" => 10,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":20,\"size\":10}}' \"$ELASTICSEARCH_URL/_render/template\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -26876,32 +18837,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _render/template\n{\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.render_search_template(\n id=\"my-search-template\",\n params={\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.renderSearchTemplate({\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 20,\n size: 10,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.render_search_template(\n body: {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->renderSearchTemplate([\n \"body\" => [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 20,\n \"size\" => 10,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":20,\"size\":10}}' \"$ELASTICSEARCH_URL/_render/template\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -26922,32 +18857,6 @@ } }, "x-state": "Technical preview", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_scripts/painless/_execute\n{\n \"script\": {\n \"source\": \"params.count / params.total\",\n \"params\": {\n \"count\": 100.0,\n \"total\": 1000.0\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.scripts_painless_execute(\n script={\n \"source\": \"params.count / params.total\",\n \"params\": {\n \"count\": 100,\n \"total\": 1000\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.scriptsPainlessExecute({\n script: {\n source: \"params.count / params.total\",\n params: {\n count: 100,\n total: 1000,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.scripts_painless_execute(\n body: {\n \"script\": {\n \"source\": \"params.count / params.total\",\n \"params\": {\n \"count\": 100,\n \"total\": 1000\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->scriptsPainlessExecute([\n \"body\" => [\n \"script\" => [\n \"source\" => \"params.count / params.total\",\n \"params\" => [\n \"count\" => 100,\n \"total\" => 1000,\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"script\":{\"source\":\"params.count / params.total\",\"params\":{\"count\":100,\"total\":1000}}}' \"$ELASTICSEARCH_URL/_scripts/painless/_execute\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -26966,32 +18875,6 @@ } }, "x-state": "Technical preview", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_scripts/painless/_execute\n{\n \"script\": {\n \"source\": \"params.count / params.total\",\n \"params\": {\n \"count\": 100.0,\n \"total\": 1000.0\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.scripts_painless_execute(\n script={\n \"source\": \"params.count / params.total\",\n \"params\": {\n \"count\": 100,\n \"total\": 1000\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.scriptsPainlessExecute({\n script: {\n source: \"params.count / params.total\",\n params: {\n count: 100,\n total: 1000,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.scripts_painless_execute(\n body: {\n \"script\": {\n \"source\": \"params.count / params.total\",\n \"params\": {\n \"count\": 100,\n \"total\": 1000\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->scriptsPainlessExecute([\n \"body\" => [\n \"script\" => [\n \"source\" => \"params.count / params.total\",\n \"params\" => [\n \"count\" => 100,\n \"total\" => 1000,\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"script\":{\"source\":\"params.count / params.total\",\"params\":{\"count\":100,\"total\":1000}}}' \"$ELASTICSEARCH_URL/_scripts/painless/_execute\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -27146,32 +19029,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_search?from=40&size=20\n{\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search(\n index=\"my-index-000001\",\n from=\"40\",\n size=\"20\",\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.search({\n index: \"my-index-000001\",\n from: 40,\n size: 20,\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search(\n index: \"my-index-000001\",\n from: \"40\",\n size: \"20\",\n body: {\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->search([\n \"index\" => \"my-index-000001\",\n \"from\" => \"40\",\n \"size\" => \"20\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}' \"$ELASTICSEARCH_URL/my-index-000001/_search?from=40&size=20\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -27322,34 +19179,8 @@ "200": { "$ref": "#/components/responses/search-200" } - }, - "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_search?from=40&size=20\n{\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search(\n index=\"my-index-000001\",\n from=\"40\",\n size=\"20\",\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.search({\n index: \"my-index-000001\",\n from: 40,\n size: 20,\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search(\n index: \"my-index-000001\",\n from: \"40\",\n size: \"20\",\n body: {\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->search([\n \"index\" => \"my-index-000001\",\n \"from\" => \"40\",\n \"size\" => \"20\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}' \"$ELASTICSEARCH_URL/my-index-000001/_search?from=40&size=20\"" - } - ], + }, + "x-state": "Generally available", "x-product-feature": "elasticsearch" } }, @@ -27507,32 +19338,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_search?from=40&size=20\n{\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search(\n index=\"my-index-000001\",\n from=\"40\",\n size=\"20\",\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.search({\n index: \"my-index-000001\",\n from: 40,\n size: 20,\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search(\n index: \"my-index-000001\",\n from: \"40\",\n size: \"20\",\n body: {\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->search([\n \"index\" => \"my-index-000001\",\n \"from\" => \"40\",\n \"size\" => \"20\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}' \"$ELASTICSEARCH_URL/my-index-000001/_search?from=40&size=20\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -27688,32 +19493,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_search?from=40&size=20\n{\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search(\n index=\"my-index-000001\",\n from=\"40\",\n size=\"20\",\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.search({\n index: \"my-index-000001\",\n from: 40,\n size: 20,\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search(\n index: \"my-index-000001\",\n from: \"40\",\n size: \"20\",\n body: {\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->search([\n \"index\" => \"my-index-000001\",\n \"from\" => \"40\",\n \"size\" => \"20\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}' \"$ELASTICSEARCH_URL/my-index-000001/_search?from=40&size=20\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -27757,32 +19536,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _application/search_application/my-app/\n" - }, - { - "lang": "Python", - "source": "resp = client.search_application.get(\n name=\"my-app\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchApplication.get({\n name: \"my-app\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_application.get(\n name: \"my-app\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchApplication()->get([\n \"name\" => \"my-app\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_application/search_application/my-app/\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -27852,32 +19605,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _application/search_application/my-app\n{\n \"indices\": [ \"index1\", \"index2\" ],\n \"template\": {\n \"script\": {\n \"source\": {\n \"query\": {\n \"query_string\": {\n \"query\": \"{{query_string}}\",\n \"default_field\": \"{{default_field}}\"\n }\n }\n },\n \"params\": {\n \"query_string\": \"*\",\n \"default_field\": \"*\"\n }\n },\n \"dictionary\": {\n \"properties\": {\n \"query_string\": {\n \"type\": \"string\"\n },\n \"default_field\": {\n \"type\": \"string\",\n \"enum\": [\n \"title\",\n \"description\"\n ]\n },\n \"additionalProperties\": false\n },\n \"required\": [\n \"query_string\"\n ]\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search_application.put(\n name=\"my-app\",\n search_application={\n \"indices\": [\n \"index1\",\n \"index2\"\n ],\n \"template\": {\n \"script\": {\n \"source\": {\n \"query\": {\n \"query_string\": {\n \"query\": \"{{query_string}}\",\n \"default_field\": \"{{default_field}}\"\n }\n }\n },\n \"params\": {\n \"query_string\": \"*\",\n \"default_field\": \"*\"\n }\n },\n \"dictionary\": {\n \"properties\": {\n \"query_string\": {\n \"type\": \"string\"\n },\n \"default_field\": {\n \"type\": \"string\",\n \"enum\": [\n \"title\",\n \"description\"\n ]\n },\n \"additionalProperties\": False\n },\n \"required\": [\n \"query_string\"\n ]\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchApplication.put({\n name: \"my-app\",\n search_application: {\n indices: [\"index1\", \"index2\"],\n template: {\n script: {\n source: {\n query: {\n query_string: {\n query: \"{{query_string}}\",\n default_field: \"{{default_field}}\",\n },\n },\n },\n params: {\n query_string: \"*\",\n default_field: \"*\",\n },\n },\n dictionary: {\n properties: {\n query_string: {\n type: \"string\",\n },\n default_field: {\n type: \"string\",\n enum: [\"title\", \"description\"],\n },\n additionalProperties: false,\n },\n required: [\"query_string\"],\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_application.put(\n name: \"my-app\",\n body: {\n \"indices\": [\n \"index1\",\n \"index2\"\n ],\n \"template\": {\n \"script\": {\n \"source\": {\n \"query\": {\n \"query_string\": {\n \"query\": \"{{query_string}}\",\n \"default_field\": \"{{default_field}}\"\n }\n }\n },\n \"params\": {\n \"query_string\": \"*\",\n \"default_field\": \"*\"\n }\n },\n \"dictionary\": {\n \"properties\": {\n \"query_string\": {\n \"type\": \"string\"\n },\n \"default_field\": {\n \"type\": \"string\",\n \"enum\": [\n \"title\",\n \"description\"\n ]\n },\n \"additionalProperties\": false\n },\n \"required\": [\n \"query_string\"\n ]\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchApplication()->put([\n \"name\" => \"my-app\",\n \"body\" => [\n \"indices\" => array(\n \"index1\",\n \"index2\",\n ),\n \"template\" => [\n \"script\" => [\n \"source\" => [\n \"query\" => [\n \"query_string\" => [\n \"query\" => \"{{query_string}}\",\n \"default_field\" => \"{{default_field}}\",\n ],\n ],\n ],\n \"params\" => [\n \"query_string\" => \"*\",\n \"default_field\" => \"*\",\n ],\n ],\n \"dictionary\" => [\n \"properties\" => [\n \"query_string\" => [\n \"type\" => \"string\",\n ],\n \"default_field\" => [\n \"type\" => \"string\",\n \"enum\" => array(\n \"title\",\n \"description\",\n ),\n ],\n \"additionalProperties\" => false,\n ],\n \"required\" => array(\n \"query_string\",\n ),\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"indices\":[\"index1\",\"index2\"],\"template\":{\"script\":{\"source\":{\"query\":{\"query_string\":{\"query\":\"{{query_string}}\",\"default_field\":\"{{default_field}}\"}}},\"params\":{\"query_string\":\"*\",\"default_field\":\"*\"}},\"dictionary\":{\"properties\":{\"query_string\":{\"type\":\"string\"},\"default_field\":{\"type\":\"string\",\"enum\":[\"title\",\"description\"]},\"additionalProperties\":false},\"required\":[\"query_string\"]}}}' \"$ELASTICSEARCH_URL/_application/search_application/my-app\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -27913,32 +19640,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _application/search_application/my-app/\n" - }, - { - "lang": "Python", - "source": "resp = client.search_application.delete(\n name=\"my-app\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchApplication.delete({\n name: \"my-app\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_application.delete(\n name: \"my-app\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchApplication()->delete([\n \"name\" => \"my-app\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_application/search_application/my-app/\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -27961,32 +19662,6 @@ }, "deprecated": true, "x-state": "Technical preview", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _application/analytics/my*\n" - }, - { - "lang": "Python", - "source": "resp = client.search_application.get_behavioral_analytics(\n name=\"my*\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchApplication.getBehavioralAnalytics({\n name: \"my*\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_application.get_behavioral_analytics(\n name: \"my*\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchApplication()->getBehavioralAnalytics([\n \"name\" => \"my*\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_application/analytics/my*\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -28022,32 +19697,6 @@ }, "deprecated": true, "x-state": "Technical preview", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _application/analytics/my_analytics_collection\n" - }, - { - "lang": "Python", - "source": "resp = client.search_application.put_behavioral_analytics(\n name=\"my_analytics_collection\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchApplication.putBehavioralAnalytics({\n name: \"my_analytics_collection\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_application.put_behavioral_analytics(\n name: \"my_analytics_collection\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchApplication()->putBehavioralAnalytics([\n \"name\" => \"my_analytics_collection\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_application/analytics/my_analytics_collection\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -28084,32 +19733,6 @@ }, "deprecated": true, "x-state": "Technical preview", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _application/analytics/my_analytics_collection/\n" - }, - { - "lang": "Python", - "source": "resp = client.search_application.delete_behavioral_analytics(\n name=\"my_analytics_collection\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchApplication.deleteBehavioralAnalytics({\n name: \"my_analytics_collection\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_application.delete_behavioral_analytics(\n name: \"my_analytics_collection\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchApplication()->deleteBehavioralAnalytics([\n \"name\" => \"my_analytics_collection\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_application/analytics/my_analytics_collection/\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -28127,32 +19750,6 @@ }, "deprecated": true, "x-state": "Technical preview", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _application/analytics/my*\n" - }, - { - "lang": "Python", - "source": "resp = client.search_application.get_behavioral_analytics(\n name=\"my*\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchApplication.getBehavioralAnalytics({\n name: \"my*\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_application.get_behavioral_analytics(\n name: \"my*\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchApplication()->getBehavioralAnalytics([\n \"name\" => \"my*\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_application/analytics/my*\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -28230,32 +19827,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _application/search_application?from=0&size=3&q=app*\n" - }, - { - "lang": "Python", - "source": "resp = client.search_application.list(\n from=\"0\",\n size=\"3\",\n q=\"app*\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchApplication.list({\n from: 0,\n size: 3,\n q: \"app*\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_application.list(\n from: \"0\",\n size: \"3\",\n q: \"app*\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchApplication()->list([\n \"from\" => \"0\",\n \"size\" => \"3\",\n \"q\" => \"app*\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_application/search_application?from=0&size=3&q=app*\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -28284,32 +19855,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _application/search_application/my-app/_search\n{\n \"params\": {\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\"name\": \"title\", \"boost\": 5},\n {\"name\": \"description\", \"boost\": 1}\n ]\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search_application.search(\n name=\"my-app\",\n params={\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchApplication.search({\n name: \"my-app\",\n params: {\n query_string: \"my first query\",\n text_fields: [\n {\n name: \"title\",\n boost: 5,\n },\n {\n name: \"description\",\n boost: 1,\n },\n ],\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_application.search(\n name: \"my-app\",\n body: {\n \"params\": {\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchApplication()->search([\n \"name\" => \"my-app\",\n \"body\" => [\n \"params\" => [\n \"query_string\" => \"my first query\",\n \"text_fields\" => array(\n [\n \"name\" => \"title\",\n \"boost\" => 5,\n ],\n [\n \"name\" => \"description\",\n \"boost\" => 1,\n ],\n ),\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"params\":{\"query_string\":\"my first query\",\"text_fields\":[{\"name\":\"title\",\"boost\":5},{\"name\":\"description\",\"boost\":1}]}}' \"$ELASTICSEARCH_URL/_application/search_application/my-app/_search\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -28336,32 +19881,6 @@ } }, "x-state": "Beta", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _application/search_application/my-app/_search\n{\n \"params\": {\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\"name\": \"title\", \"boost\": 5},\n {\"name\": \"description\", \"boost\": 1}\n ]\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search_application.search(\n name=\"my-app\",\n params={\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchApplication.search({\n name: \"my-app\",\n params: {\n query_string: \"my first query\",\n text_fields: [\n {\n name: \"title\",\n boost: 5,\n },\n {\n name: \"description\",\n boost: 1,\n },\n ],\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_application.search(\n name: \"my-app\",\n body: {\n \"params\": {\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchApplication()->search([\n \"name\" => \"my-app\",\n \"body\" => [\n \"params\" => [\n \"query_string\" => \"my first query\",\n \"text_fields\" => array(\n [\n \"name\" => \"title\",\n \"boost\" => 5,\n ],\n [\n \"name\" => \"description\",\n \"boost\" => 1,\n ],\n ),\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"params\":{\"query_string\":\"my first query\",\"text_fields\":[{\"name\":\"title\",\"boost\":5},{\"name\":\"description\",\"boost\":1}]}}' \"$ELASTICSEARCH_URL/_application/search_application/my-app/_search\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -28423,32 +19942,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET museums/_mvt/location/13/4207/2692\n{\n \"grid_agg\": \"geotile\",\n \"grid_precision\": 2,\n \"fields\": [\n \"name\",\n \"price\"\n ],\n \"query\": {\n \"term\": {\n \"included\": true\n }\n },\n \"aggs\": {\n \"min_price\": {\n \"min\": {\n \"field\": \"price\"\n }\n },\n \"max_price\": {\n \"max\": {\n \"field\": \"price\"\n }\n },\n \"avg_price\": {\n \"avg\": {\n \"field\": \"price\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search_mvt(\n index=\"museums\",\n field=\"location\",\n zoom=\"13\",\n x=\"4207\",\n y=\"2692\",\n grid_agg=\"geotile\",\n grid_precision=2,\n fields=[\n \"name\",\n \"price\"\n ],\n query={\n \"term\": {\n \"included\": True\n }\n },\n aggs={\n \"min_price\": {\n \"min\": {\n \"field\": \"price\"\n }\n },\n \"max_price\": {\n \"max\": {\n \"field\": \"price\"\n }\n },\n \"avg_price\": {\n \"avg\": {\n \"field\": \"price\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchMvt({\n index: \"museums\",\n field: \"location\",\n zoom: 13,\n x: 4207,\n y: 2692,\n grid_agg: \"geotile\",\n grid_precision: 2,\n fields: [\"name\", \"price\"],\n query: {\n term: {\n included: true,\n },\n },\n aggs: {\n min_price: {\n min: {\n field: \"price\",\n },\n },\n max_price: {\n max: {\n field: \"price\",\n },\n },\n avg_price: {\n avg: {\n field: \"price\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_mvt(\n index: \"museums\",\n field: \"location\",\n zoom: \"13\",\n x: \"4207\",\n y: \"2692\",\n body: {\n \"grid_agg\": \"geotile\",\n \"grid_precision\": 2,\n \"fields\": [\n \"name\",\n \"price\"\n ],\n \"query\": {\n \"term\": {\n \"included\": true\n }\n },\n \"aggs\": {\n \"min_price\": {\n \"min\": {\n \"field\": \"price\"\n }\n },\n \"max_price\": {\n \"max\": {\n \"field\": \"price\"\n }\n },\n \"avg_price\": {\n \"avg\": {\n \"field\": \"price\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchMvt([\n \"index\" => \"museums\",\n \"field\" => \"location\",\n \"zoom\" => \"13\",\n \"x\" => \"4207\",\n \"y\" => \"2692\",\n \"body\" => [\n \"grid_agg\" => \"geotile\",\n \"grid_precision\" => 2,\n \"fields\" => array(\n \"name\",\n \"price\",\n ),\n \"query\" => [\n \"term\" => [\n \"included\" => true,\n ],\n ],\n \"aggs\" => [\n \"min_price\" => [\n \"min\" => [\n \"field\" => \"price\",\n ],\n ],\n \"max_price\" => [\n \"max\" => [\n \"field\" => \"price\",\n ],\n ],\n \"avg_price\" => [\n \"avg\" => [\n \"field\" => \"price\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"grid_agg\":\"geotile\",\"grid_precision\":2,\"fields\":[\"name\",\"price\"],\"query\":{\"term\":{\"included\":true}},\"aggs\":{\"min_price\":{\"min\":{\"field\":\"price\"}},\"max_price\":{\"max\":{\"field\":\"price\"}},\"avg_price\":{\"avg\":{\"field\":\"price\"}}}}' \"$ELASTICSEARCH_URL/museums/_mvt/location/13/4207/2692\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -28508,32 +20001,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET museums/_mvt/location/13/4207/2692\n{\n \"grid_agg\": \"geotile\",\n \"grid_precision\": 2,\n \"fields\": [\n \"name\",\n \"price\"\n ],\n \"query\": {\n \"term\": {\n \"included\": true\n }\n },\n \"aggs\": {\n \"min_price\": {\n \"min\": {\n \"field\": \"price\"\n }\n },\n \"max_price\": {\n \"max\": {\n \"field\": \"price\"\n }\n },\n \"avg_price\": {\n \"avg\": {\n \"field\": \"price\"\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search_mvt(\n index=\"museums\",\n field=\"location\",\n zoom=\"13\",\n x=\"4207\",\n y=\"2692\",\n grid_agg=\"geotile\",\n grid_precision=2,\n fields=[\n \"name\",\n \"price\"\n ],\n query={\n \"term\": {\n \"included\": True\n }\n },\n aggs={\n \"min_price\": {\n \"min\": {\n \"field\": \"price\"\n }\n },\n \"max_price\": {\n \"max\": {\n \"field\": \"price\"\n }\n },\n \"avg_price\": {\n \"avg\": {\n \"field\": \"price\"\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchMvt({\n index: \"museums\",\n field: \"location\",\n zoom: 13,\n x: 4207,\n y: 2692,\n grid_agg: \"geotile\",\n grid_precision: 2,\n fields: [\"name\", \"price\"],\n query: {\n term: {\n included: true,\n },\n },\n aggs: {\n min_price: {\n min: {\n field: \"price\",\n },\n },\n max_price: {\n max: {\n field: \"price\",\n },\n },\n avg_price: {\n avg: {\n field: \"price\",\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_mvt(\n index: \"museums\",\n field: \"location\",\n zoom: \"13\",\n x: \"4207\",\n y: \"2692\",\n body: {\n \"grid_agg\": \"geotile\",\n \"grid_precision\": 2,\n \"fields\": [\n \"name\",\n \"price\"\n ],\n \"query\": {\n \"term\": {\n \"included\": true\n }\n },\n \"aggs\": {\n \"min_price\": {\n \"min\": {\n \"field\": \"price\"\n }\n },\n \"max_price\": {\n \"max\": {\n \"field\": \"price\"\n }\n },\n \"avg_price\": {\n \"avg\": {\n \"field\": \"price\"\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchMvt([\n \"index\" => \"museums\",\n \"field\" => \"location\",\n \"zoom\" => \"13\",\n \"x\" => \"4207\",\n \"y\" => \"2692\",\n \"body\" => [\n \"grid_agg\" => \"geotile\",\n \"grid_precision\" => 2,\n \"fields\" => array(\n \"name\",\n \"price\",\n ),\n \"query\" => [\n \"term\" => [\n \"included\" => true,\n ],\n ],\n \"aggs\" => [\n \"min_price\" => [\n \"min\" => [\n \"field\" => \"price\",\n ],\n ],\n \"max_price\" => [\n \"max\" => [\n \"field\" => \"price\",\n ],\n ],\n \"avg_price\" => [\n \"avg\" => [\n \"field\" => \"price\",\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"grid_agg\":\"geotile\",\"grid_precision\":2,\"fields\":[\"name\",\"price\"],\"query\":{\"term\":{\"included\":true}},\"aggs\":{\"min_price\":{\"min\":{\"field\":\"price\"}},\"max_price\":{\"max\":{\"field\":\"price\"}},\"avg_price\":{\"avg\":{\"field\":\"price\"}}}}' \"$ELASTICSEARCH_URL/museums/_mvt/location/13/4207/2692\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -28598,32 +20065,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index/_search/template\n{\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search_template(\n index=\"my-index\",\n id=\"my-search-template\",\n params={\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchTemplate({\n index: \"my-index\",\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 0,\n size: 10,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_template(\n index: \"my-index\",\n body: {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchTemplate([\n \"index\" => \"my-index\",\n \"body\" => [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 0,\n \"size\" => 10,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":0,\"size\":10}}' \"$ELASTICSEARCH_URL/my-index/_search/template\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -28686,32 +20127,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index/_search/template\n{\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search_template(\n index=\"my-index\",\n id=\"my-search-template\",\n params={\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchTemplate({\n index: \"my-index\",\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 0,\n size: 10,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_template(\n index: \"my-index\",\n body: {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchTemplate([\n \"index\" => \"my-index\",\n \"body\" => [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 0,\n \"size\" => 10,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":0,\"size\":10}}' \"$ELASTICSEARCH_URL/my-index/_search/template\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -28779,32 +20194,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index/_search/template\n{\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search_template(\n index=\"my-index\",\n id=\"my-search-template\",\n params={\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchTemplate({\n index: \"my-index\",\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 0,\n size: 10,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_template(\n index: \"my-index\",\n body: {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchTemplate([\n \"index\" => \"my-index\",\n \"body\" => [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 0,\n \"size\" => 10,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":0,\"size\":10}}' \"$ELASTICSEARCH_URL/my-index/_search/template\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -28870,32 +20259,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET my-index/_search/template\n{\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.search_template(\n index=\"my-index\",\n id=\"my-search-template\",\n params={\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.searchTemplate({\n index: \"my-index\",\n id: \"my-search-template\",\n params: {\n query_string: \"hello world\",\n from: 0,\n size: 10,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.search_template(\n index: \"my-index\",\n body: {\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 0,\n \"size\": 10\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->searchTemplate([\n \"index\" => \"my-index\",\n \"body\" => [\n \"id\" => \"my-search-template\",\n \"params\" => [\n \"query_string\" => \"hello world\",\n \"from\" => 0,\n \"size\" => 10,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"id\":\"my-search-template\",\"params\":{\"query_string\":\"hello world\",\"from\":0,\"size\":10}}' \"$ELASTICSEARCH_URL/my-index/_search/template\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -28980,41 +20343,15 @@ }, "examples": { "SecurityAuthenticateResponseExample1": { - "description": "A successful response from `GET /_security/_authenticate`.", - "value": "{\n \"username\": \"rdeniro\",\n \"roles\": [\n \"admin\"\n ],\n \"full_name\": null,\n \"email\": null,\n \"metadata\": { },\n \"enabled\": true,\n \"authentication_realm\": {\n \"name\" : \"file\",\n \"type\" : \"file\"\n },\n \"lookup_realm\": {\n \"name\" : \"file\",\n \"type\" : \"file\"\n },\n \"authentication_type\": \"realm\"\n}" - } - } - } - } - } - }, - "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/_authenticate\n" - }, - { - "lang": "Python", - "source": "resp = client.security.authenticate()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.authenticate();" - }, - { - "lang": "Ruby", - "source": "response = client.security.authenticate" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->authenticate();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/_authenticate\"" + "description": "A successful response from `GET /_security/_authenticate`.", + "value": "{\n \"username\": \"rdeniro\",\n \"roles\": [\n \"admin\"\n ],\n \"full_name\": null,\n \"email\": null,\n \"metadata\": { },\n \"enabled\": true,\n \"authentication_realm\": {\n \"name\" : \"file\",\n \"type\" : \"file\"\n },\n \"lookup_realm\": {\n \"name\" : \"file\",\n \"type\" : \"file\"\n },\n \"authentication_type\": \"realm\"\n}" + } + } + } + } } - ], + }, + "x-state": "Generally available", "x-product-feature": "elasticsearch" } }, @@ -29144,32 +20481,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/api_key?username=myuser&realm_name=native1\n" - }, - { - "lang": "Python", - "source": "resp = client.security.get_api_key(\n username=\"myuser\",\n realm_name=\"native1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.getApiKey({\n username: \"myuser\",\n realm_name: \"native1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.get_api_key(\n username: \"myuser\",\n realm_name: \"native1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->getApiKey([\n \"username\" => \"myuser\",\n \"realm_name\" => \"native1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/api_key?username=myuser&realm_name=native1\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -29196,32 +20507,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/api_key\n{\n \"name\": \"my-api-key\",\n \"expiration\": \"1d\", \n \"role_descriptors\": { \n \"role-a\": {\n \"cluster\": [\"all\"],\n \"indices\": [\n {\n \"names\": [\"index-a*\"],\n \"privileges\": [\"read\"]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\"all\"],\n \"indices\": [\n {\n \"names\": [\"index-b*\"],\n \"privileges\": [\"all\"]\n }\n ]\n }\n },\n \"metadata\": {\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\"dev\", \"staging\"]\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.create_api_key(\n name=\"my-api-key\",\n expiration=\"1d\",\n role_descriptors={\n \"role-a\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-a*\"\n ],\n \"privileges\": [\n \"read\"\n ]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-b*\"\n ],\n \"privileges\": [\n \"all\"\n ]\n }\n ]\n }\n },\n metadata={\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": True,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.createApiKey({\n name: \"my-api-key\",\n expiration: \"1d\",\n role_descriptors: {\n \"role-a\": {\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index-a*\"],\n privileges: [\"read\"],\n },\n ],\n },\n \"role-b\": {\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index-b*\"],\n privileges: [\"all\"],\n },\n ],\n },\n },\n metadata: {\n application: \"my-application\",\n environment: {\n level: 1,\n trusted: true,\n tags: [\"dev\", \"staging\"],\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.create_api_key(\n body: {\n \"name\": \"my-api-key\",\n \"expiration\": \"1d\",\n \"role_descriptors\": {\n \"role-a\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-a*\"\n ],\n \"privileges\": [\n \"read\"\n ]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-b*\"\n ],\n \"privileges\": [\n \"all\"\n ]\n }\n ]\n }\n },\n \"metadata\": {\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->createApiKey([\n \"body\" => [\n \"name\" => \"my-api-key\",\n \"expiration\" => \"1d\",\n \"role_descriptors\" => [\n \"role-a\" => [\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index-a*\",\n ),\n \"privileges\" => array(\n \"read\",\n ),\n ],\n ),\n ],\n \"role-b\" => [\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index-b*\",\n ),\n \"privileges\" => array(\n \"all\",\n ),\n ],\n ),\n ],\n ],\n \"metadata\" => [\n \"application\" => \"my-application\",\n \"environment\" => [\n \"level\" => 1,\n \"trusted\" => true,\n \"tags\" => array(\n \"dev\",\n \"staging\",\n ),\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"name\":\"my-api-key\",\"expiration\":\"1d\",\"role_descriptors\":{\"role-a\":{\"cluster\":[\"all\"],\"indices\":[{\"names\":[\"index-a*\"],\"privileges\":[\"read\"]}]},\"role-b\":{\"cluster\":[\"all\"],\"indices\":[{\"names\":[\"index-b*\"],\"privileges\":[\"all\"]}]}},\"metadata\":{\"application\":\"my-application\",\"environment\":{\"level\":1,\"trusted\":true,\"tags\":[\"dev\",\"staging\"]}}}' \"$ELASTICSEARCH_URL/_security/api_key\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -29248,32 +20533,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/api_key\n{\n \"name\": \"my-api-key\",\n \"expiration\": \"1d\", \n \"role_descriptors\": { \n \"role-a\": {\n \"cluster\": [\"all\"],\n \"indices\": [\n {\n \"names\": [\"index-a*\"],\n \"privileges\": [\"read\"]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\"all\"],\n \"indices\": [\n {\n \"names\": [\"index-b*\"],\n \"privileges\": [\"all\"]\n }\n ]\n }\n },\n \"metadata\": {\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\"dev\", \"staging\"]\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.create_api_key(\n name=\"my-api-key\",\n expiration=\"1d\",\n role_descriptors={\n \"role-a\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-a*\"\n ],\n \"privileges\": [\n \"read\"\n ]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-b*\"\n ],\n \"privileges\": [\n \"all\"\n ]\n }\n ]\n }\n },\n metadata={\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": True,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.createApiKey({\n name: \"my-api-key\",\n expiration: \"1d\",\n role_descriptors: {\n \"role-a\": {\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index-a*\"],\n privileges: [\"read\"],\n },\n ],\n },\n \"role-b\": {\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index-b*\"],\n privileges: [\"all\"],\n },\n ],\n },\n },\n metadata: {\n application: \"my-application\",\n environment: {\n level: 1,\n trusted: true,\n tags: [\"dev\", \"staging\"],\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.create_api_key(\n body: {\n \"name\": \"my-api-key\",\n \"expiration\": \"1d\",\n \"role_descriptors\": {\n \"role-a\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-a*\"\n ],\n \"privileges\": [\n \"read\"\n ]\n }\n ]\n },\n \"role-b\": {\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index-b*\"\n ],\n \"privileges\": [\n \"all\"\n ]\n }\n ]\n }\n },\n \"metadata\": {\n \"application\": \"my-application\",\n \"environment\": {\n \"level\": 1,\n \"trusted\": true,\n \"tags\": [\n \"dev\",\n \"staging\"\n ]\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->createApiKey([\n \"body\" => [\n \"name\" => \"my-api-key\",\n \"expiration\" => \"1d\",\n \"role_descriptors\" => [\n \"role-a\" => [\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index-a*\",\n ),\n \"privileges\" => array(\n \"read\",\n ),\n ],\n ),\n ],\n \"role-b\" => [\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index-b*\",\n ),\n \"privileges\" => array(\n \"all\",\n ),\n ],\n ),\n ],\n ],\n \"metadata\" => [\n \"application\" => \"my-application\",\n \"environment\" => [\n \"level\" => 1,\n \"trusted\" => true,\n \"tags\" => array(\n \"dev\",\n \"staging\",\n ),\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"name\":\"my-api-key\",\"expiration\":\"1d\",\"role_descriptors\":{\"role-a\":{\"cluster\":[\"all\"],\"indices\":[{\"names\":[\"index-a*\"],\"privileges\":[\"read\"]}]},\"role-b\":{\"cluster\":[\"all\"],\"indices\":[{\"names\":[\"index-b*\"],\"privileges\":[\"all\"]}]}},\"metadata\":{\"application\":\"my-application\",\"environment\":{\"level\":1,\"trusted\":true,\"tags\":[\"dev\",\"staging\"]}}}' \"$ELASTICSEARCH_URL/_security/api_key\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -29402,32 +20661,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_security/api_key\n{\n \"ids\" : [ \"VuaCfGcBCdbkQm-e5aOx\" ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.invalidate_api_key(\n ids=[\n \"VuaCfGcBCdbkQm-e5aOx\"\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.invalidateApiKey({\n ids: [\"VuaCfGcBCdbkQm-e5aOx\"],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.invalidate_api_key(\n body: {\n \"ids\": [\n \"VuaCfGcBCdbkQm-e5aOx\"\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->invalidateApiKey([\n \"body\" => [\n \"ids\" => array(\n \"VuaCfGcBCdbkQm-e5aOx\",\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"ids\":[\"VuaCfGcBCdbkQm-e5aOx\"]}' \"$ELASTICSEARCH_URL/_security/api_key\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -29450,32 +20683,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/role/my_admin_role\n" - }, - { - "lang": "Python", - "source": "resp = client.security.get_role(\n name=\"my_admin_role\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.getRole({\n name: \"my_admin_role\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.get_role(\n name: \"my_admin_role\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->getRole([\n \"name\" => \"my_admin_role\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/role/my_admin_role\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -29505,32 +20712,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/role/my_admin_role\n{\n \"description\": \"Grants full access to all management features within the cluster.\",\n \"cluster\": [\"all\"],\n \"indices\": [\n {\n \"names\": [ \"index1\", \"index2\" ],\n \"privileges\": [\"all\"],\n \"field_security\" : { // optional\n \"grant\" : [ \"title\", \"body\" ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\" // optional\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [ \"admin\", \"read\" ],\n \"resources\": [ \"*\" ]\n }\n ],\n \"run_as\": [ \"other_user\" ], // optional\n \"metadata\" : { // optional\n \"version\" : 1\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.put_role(\n name=\"my_admin_role\",\n description=\"Grants full access to all management features within the cluster.\",\n cluster=[\n \"all\"\n ],\n indices=[\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\n \"all\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n applications=[\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n run_as=[\n \"other_user\"\n ],\n metadata={\n \"version\": 1\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.putRole({\n name: \"my_admin_role\",\n description:\n \"Grants full access to all management features within the cluster.\",\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index1\", \"index2\"],\n privileges: [\"all\"],\n field_security: {\n grant: [\"title\", \"body\"],\n },\n query: '{\"match\": {\"title\": \"foo\"}}',\n },\n ],\n applications: [\n {\n application: \"myapp\",\n privileges: [\"admin\", \"read\"],\n resources: [\"*\"],\n },\n ],\n run_as: [\"other_user\"],\n metadata: {\n version: 1,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.put_role(\n name: \"my_admin_role\",\n body: {\n \"description\": \"Grants full access to all management features within the cluster.\",\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\n \"all\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->putRole([\n \"name\" => \"my_admin_role\",\n \"body\" => [\n \"description\" => \"Grants full access to all management features within the cluster.\",\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index1\",\n \"index2\",\n ),\n \"privileges\" => array(\n \"all\",\n ),\n \"field_security\" => [\n \"grant\" => array(\n \"title\",\n \"body\",\n ),\n ],\n \"query\" => \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\",\n ],\n ),\n \"applications\" => array(\n [\n \"application\" => \"myapp\",\n \"privileges\" => array(\n \"admin\",\n \"read\",\n ),\n \"resources\" => array(\n \"*\",\n ),\n ],\n ),\n \"run_as\" => array(\n \"other_user\",\n ),\n \"metadata\" => [\n \"version\" => 1,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"description\":\"Grants full access to all management features within the cluster.\",\"cluster\":[\"all\"],\"indices\":[{\"names\":[\"index1\",\"index2\"],\"privileges\":[\"all\"],\"field_security\":{\"grant\":[\"title\",\"body\"]},\"query\":\"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"}],\"applications\":[{\"application\":\"myapp\",\"privileges\":[\"admin\",\"read\"],\"resources\":[\"*\"]}],\"run_as\":[\"other_user\"],\"metadata\":{\"version\":1}}' \"$ELASTICSEARCH_URL/_security/role/my_admin_role\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -29560,32 +20741,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/role/my_admin_role\n{\n \"description\": \"Grants full access to all management features within the cluster.\",\n \"cluster\": [\"all\"],\n \"indices\": [\n {\n \"names\": [ \"index1\", \"index2\" ],\n \"privileges\": [\"all\"],\n \"field_security\" : { // optional\n \"grant\" : [ \"title\", \"body\" ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\" // optional\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [ \"admin\", \"read\" ],\n \"resources\": [ \"*\" ]\n }\n ],\n \"run_as\": [ \"other_user\" ], // optional\n \"metadata\" : { // optional\n \"version\" : 1\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.put_role(\n name=\"my_admin_role\",\n description=\"Grants full access to all management features within the cluster.\",\n cluster=[\n \"all\"\n ],\n indices=[\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\n \"all\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n applications=[\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n run_as=[\n \"other_user\"\n ],\n metadata={\n \"version\": 1\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.putRole({\n name: \"my_admin_role\",\n description:\n \"Grants full access to all management features within the cluster.\",\n cluster: [\"all\"],\n indices: [\n {\n names: [\"index1\", \"index2\"],\n privileges: [\"all\"],\n field_security: {\n grant: [\"title\", \"body\"],\n },\n query: '{\"match\": {\"title\": \"foo\"}}',\n },\n ],\n applications: [\n {\n application: \"myapp\",\n privileges: [\"admin\", \"read\"],\n resources: [\"*\"],\n },\n ],\n run_as: [\"other_user\"],\n metadata: {\n version: 1,\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.put_role(\n name: \"my_admin_role\",\n body: {\n \"description\": \"Grants full access to all management features within the cluster.\",\n \"cluster\": [\n \"all\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"index1\",\n \"index2\"\n ],\n \"privileges\": [\n \"all\"\n ],\n \"field_security\": {\n \"grant\": [\n \"title\",\n \"body\"\n ]\n },\n \"query\": \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"\n }\n ],\n \"applications\": [\n {\n \"application\": \"myapp\",\n \"privileges\": [\n \"admin\",\n \"read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [\n \"other_user\"\n ],\n \"metadata\": {\n \"version\": 1\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->putRole([\n \"name\" => \"my_admin_role\",\n \"body\" => [\n \"description\" => \"Grants full access to all management features within the cluster.\",\n \"cluster\" => array(\n \"all\",\n ),\n \"indices\" => array(\n [\n \"names\" => array(\n \"index1\",\n \"index2\",\n ),\n \"privileges\" => array(\n \"all\",\n ),\n \"field_security\" => [\n \"grant\" => array(\n \"title\",\n \"body\",\n ),\n ],\n \"query\" => \"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\",\n ],\n ),\n \"applications\" => array(\n [\n \"application\" => \"myapp\",\n \"privileges\" => array(\n \"admin\",\n \"read\",\n ),\n \"resources\" => array(\n \"*\",\n ),\n ],\n ),\n \"run_as\" => array(\n \"other_user\",\n ),\n \"metadata\" => [\n \"version\" => 1,\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"description\":\"Grants full access to all management features within the cluster.\",\"cluster\":[\"all\"],\"indices\":[{\"names\":[\"index1\",\"index2\"],\"privileges\":[\"all\"],\"field_security\":{\"grant\":[\"title\",\"body\"]},\"query\":\"{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}\"}],\"applications\":[{\"application\":\"myapp\",\"privileges\":[\"admin\",\"read\"],\"resources\":[\"*\"]}],\"run_as\":[\"other_user\"],\"metadata\":{\"version\":1}}' \"$ELASTICSEARCH_URL/_security/role/my_admin_role\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -29646,32 +20801,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE /_security/role/my_admin_role\n" - }, - { - "lang": "Python", - "source": "resp = client.security.delete_role(\n name=\"my_admin_role\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.deleteRole({\n name: \"my_admin_role\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.delete_role(\n name: \"my_admin_role\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->deleteRole([\n \"name\" => \"my_admin_role\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/role/my_admin_role\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -29725,32 +20854,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/privilege/_builtin\n" - }, - { - "lang": "Python", - "source": "resp = client.security.get_builtin_privileges()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.getBuiltinPrivileges();" - }, - { - "lang": "Ruby", - "source": "response = client.security.get_builtin_privileges" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->getBuiltinPrivileges();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/privilege/_builtin\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -29768,32 +20871,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/role/my_admin_role\n" - }, - { - "lang": "Python", - "source": "resp = client.security.get_role(\n name=\"my_admin_role\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.getRole({\n name: \"my_admin_role\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.get_role(\n name: \"my_admin_role\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->getRole([\n \"name\" => \"my_admin_role\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_security/role/my_admin_role\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -29817,32 +20894,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/user/_has_privileges\n{\n \"cluster\": [ \"monitor\", \"manage\" ],\n \"index\" : [\n {\n \"names\": [ \"suppliers\", \"products\" ],\n \"privileges\": [ \"read\" ]\n },\n {\n \"names\": [ \"inventory\" ],\n \"privileges\" : [ \"read\", \"write\" ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\" : [ \"read\", \"data:write/inventory\" ],\n \"resources\" : [ \"product/1852563\" ]\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.has_privileges(\n cluster=[\n \"monitor\",\n \"manage\"\n ],\n index=[\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"read\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n application=[\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.hasPrivileges({\n cluster: [\"monitor\", \"manage\"],\n index: [\n {\n names: [\"suppliers\", \"products\"],\n privileges: [\"read\"],\n },\n {\n names: [\"inventory\"],\n privileges: [\"read\", \"write\"],\n },\n ],\n application: [\n {\n application: \"inventory_manager\",\n privileges: [\"read\", \"data:write/inventory\"],\n resources: [\"product/1852563\"],\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.has_privileges(\n body: {\n \"cluster\": [\n \"monitor\",\n \"manage\"\n ],\n \"index\": [\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"read\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->hasPrivileges([\n \"body\" => [\n \"cluster\" => array(\n \"monitor\",\n \"manage\",\n ),\n \"index\" => array(\n [\n \"names\" => array(\n \"suppliers\",\n \"products\",\n ),\n \"privileges\" => array(\n \"read\",\n ),\n ],\n [\n \"names\" => array(\n \"inventory\",\n ),\n \"privileges\" => array(\n \"read\",\n \"write\",\n ),\n ],\n ),\n \"application\" => array(\n [\n \"application\" => \"inventory_manager\",\n \"privileges\" => array(\n \"read\",\n \"data:write/inventory\",\n ),\n \"resources\" => array(\n \"product/1852563\",\n ),\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"cluster\":[\"monitor\",\"manage\"],\"index\":[{\"names\":[\"suppliers\",\"products\"],\"privileges\":[\"read\"]},{\"names\":[\"inventory\"],\"privileges\":[\"read\",\"write\"]}],\"application\":[{\"application\":\"inventory_manager\",\"privileges\":[\"read\",\"data:write/inventory\"],\"resources\":[\"product/1852563\"]}]}' \"$ELASTICSEARCH_URL/_security/user/_has_privileges\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -29864,32 +20915,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/user/_has_privileges\n{\n \"cluster\": [ \"monitor\", \"manage\" ],\n \"index\" : [\n {\n \"names\": [ \"suppliers\", \"products\" ],\n \"privileges\": [ \"read\" ]\n },\n {\n \"names\": [ \"inventory\" ],\n \"privileges\" : [ \"read\", \"write\" ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\" : [ \"read\", \"data:write/inventory\" ],\n \"resources\" : [ \"product/1852563\" ]\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.has_privileges(\n cluster=[\n \"monitor\",\n \"manage\"\n ],\n index=[\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"read\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n application=[\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.hasPrivileges({\n cluster: [\"monitor\", \"manage\"],\n index: [\n {\n names: [\"suppliers\", \"products\"],\n privileges: [\"read\"],\n },\n {\n names: [\"inventory\"],\n privileges: [\"read\", \"write\"],\n },\n ],\n application: [\n {\n application: \"inventory_manager\",\n privileges: [\"read\", \"data:write/inventory\"],\n resources: [\"product/1852563\"],\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.has_privileges(\n body: {\n \"cluster\": [\n \"monitor\",\n \"manage\"\n ],\n \"index\": [\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"read\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->hasPrivileges([\n \"body\" => [\n \"cluster\" => array(\n \"monitor\",\n \"manage\",\n ),\n \"index\" => array(\n [\n \"names\" => array(\n \"suppliers\",\n \"products\",\n ),\n \"privileges\" => array(\n \"read\",\n ),\n ],\n [\n \"names\" => array(\n \"inventory\",\n ),\n \"privileges\" => array(\n \"read\",\n \"write\",\n ),\n ],\n ),\n \"application\" => array(\n [\n \"application\" => \"inventory_manager\",\n \"privileges\" => array(\n \"read\",\n \"data:write/inventory\",\n ),\n \"resources\" => array(\n \"product/1852563\",\n ),\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"cluster\":[\"monitor\",\"manage\"],\"index\":[{\"names\":[\"suppliers\",\"products\"],\"privileges\":[\"read\"]},{\"names\":[\"inventory\"],\"privileges\":[\"read\",\"write\"]}],\"application\":[{\"application\":\"inventory_manager\",\"privileges\":[\"read\",\"data:write/inventory\"],\"resources\":[\"product/1852563\"]}]}' \"$ELASTICSEARCH_URL/_security/user/_has_privileges\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -29918,32 +20943,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/user/_has_privileges\n{\n \"cluster\": [ \"monitor\", \"manage\" ],\n \"index\" : [\n {\n \"names\": [ \"suppliers\", \"products\" ],\n \"privileges\": [ \"read\" ]\n },\n {\n \"names\": [ \"inventory\" ],\n \"privileges\" : [ \"read\", \"write\" ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\" : [ \"read\", \"data:write/inventory\" ],\n \"resources\" : [ \"product/1852563\" ]\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.has_privileges(\n cluster=[\n \"monitor\",\n \"manage\"\n ],\n index=[\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"read\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n application=[\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.hasPrivileges({\n cluster: [\"monitor\", \"manage\"],\n index: [\n {\n names: [\"suppliers\", \"products\"],\n privileges: [\"read\"],\n },\n {\n names: [\"inventory\"],\n privileges: [\"read\", \"write\"],\n },\n ],\n application: [\n {\n application: \"inventory_manager\",\n privileges: [\"read\", \"data:write/inventory\"],\n resources: [\"product/1852563\"],\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.has_privileges(\n body: {\n \"cluster\": [\n \"monitor\",\n \"manage\"\n ],\n \"index\": [\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"read\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->hasPrivileges([\n \"body\" => [\n \"cluster\" => array(\n \"monitor\",\n \"manage\",\n ),\n \"index\" => array(\n [\n \"names\" => array(\n \"suppliers\",\n \"products\",\n ),\n \"privileges\" => array(\n \"read\",\n ),\n ],\n [\n \"names\" => array(\n \"inventory\",\n ),\n \"privileges\" => array(\n \"read\",\n \"write\",\n ),\n ],\n ),\n \"application\" => array(\n [\n \"application\" => \"inventory_manager\",\n \"privileges\" => array(\n \"read\",\n \"data:write/inventory\",\n ),\n \"resources\" => array(\n \"product/1852563\",\n ),\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"cluster\":[\"monitor\",\"manage\"],\"index\":[{\"names\":[\"suppliers\",\"products\"],\"privileges\":[\"read\"]},{\"names\":[\"inventory\"],\"privileges\":[\"read\",\"write\"]}],\"application\":[{\"application\":\"inventory_manager\",\"privileges\":[\"read\",\"data:write/inventory\"],\"resources\":[\"product/1852563\"]}]}' \"$ELASTICSEARCH_URL/_security/user/_has_privileges\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -29970,32 +20969,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/user/_has_privileges\n{\n \"cluster\": [ \"monitor\", \"manage\" ],\n \"index\" : [\n {\n \"names\": [ \"suppliers\", \"products\" ],\n \"privileges\": [ \"read\" ]\n },\n {\n \"names\": [ \"inventory\" ],\n \"privileges\" : [ \"read\", \"write\" ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\" : [ \"read\", \"data:write/inventory\" ],\n \"resources\" : [ \"product/1852563\" ]\n }\n ]\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.has_privileges(\n cluster=[\n \"monitor\",\n \"manage\"\n ],\n index=[\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"read\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n application=[\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.hasPrivileges({\n cluster: [\"monitor\", \"manage\"],\n index: [\n {\n names: [\"suppliers\", \"products\"],\n privileges: [\"read\"],\n },\n {\n names: [\"inventory\"],\n privileges: [\"read\", \"write\"],\n },\n ],\n application: [\n {\n application: \"inventory_manager\",\n privileges: [\"read\", \"data:write/inventory\"],\n resources: [\"product/1852563\"],\n },\n ],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.has_privileges(\n body: {\n \"cluster\": [\n \"monitor\",\n \"manage\"\n ],\n \"index\": [\n {\n \"names\": [\n \"suppliers\",\n \"products\"\n ],\n \"privileges\": [\n \"read\"\n ]\n },\n {\n \"names\": [\n \"inventory\"\n ],\n \"privileges\": [\n \"read\",\n \"write\"\n ]\n }\n ],\n \"application\": [\n {\n \"application\": \"inventory_manager\",\n \"privileges\": [\n \"read\",\n \"data:write/inventory\"\n ],\n \"resources\": [\n \"product/1852563\"\n ]\n }\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->hasPrivileges([\n \"body\" => [\n \"cluster\" => array(\n \"monitor\",\n \"manage\",\n ),\n \"index\" => array(\n [\n \"names\" => array(\n \"suppliers\",\n \"products\",\n ),\n \"privileges\" => array(\n \"read\",\n ),\n ],\n [\n \"names\" => array(\n \"inventory\",\n ),\n \"privileges\" => array(\n \"read\",\n \"write\",\n ),\n ],\n ),\n \"application\" => array(\n [\n \"application\" => \"inventory_manager\",\n \"privileges\" => array(\n \"read\",\n \"data:write/inventory\",\n ),\n \"resources\" => array(\n \"product/1852563\",\n ),\n ],\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"cluster\":[\"monitor\",\"manage\"],\"index\":[{\"names\":[\"suppliers\",\"products\"],\"privileges\":[\"read\"]},{\"names\":[\"inventory\"],\"privileges\":[\"read\",\"write\"]}],\"application\":[{\"application\":\"inventory_manager\",\"privileges\":[\"read\",\"data:write/inventory\"],\"resources\":[\"product/1852563\"]}]}' \"$ELASTICSEARCH_URL/_security/user/_has_privileges\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -30027,32 +21000,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/_query/api_key?with_limited_by=true\n{\n \"query\": {\n \"ids\": {\n \"values\": [\n \"VuaCfGcBCdbkQm-e5aOx\"\n ]\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.query_api_keys(\n with_limited_by=True,\n query={\n \"ids\": {\n \"values\": [\n \"VuaCfGcBCdbkQm-e5aOx\"\n ]\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.queryApiKeys({\n with_limited_by: \"true\",\n query: {\n ids: {\n values: [\"VuaCfGcBCdbkQm-e5aOx\"],\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.query_api_keys(\n with_limited_by: \"true\",\n body: {\n \"query\": {\n \"ids\": {\n \"values\": [\n \"VuaCfGcBCdbkQm-e5aOx\"\n ]\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->queryApiKeys([\n \"with_limited_by\" => \"true\",\n \"body\" => [\n \"query\" => [\n \"ids\" => [\n \"values\" => array(\n \"VuaCfGcBCdbkQm-e5aOx\",\n ),\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"ids\":{\"values\":[\"VuaCfGcBCdbkQm-e5aOx\"]}}}' \"$ELASTICSEARCH_URL/_security/_query/api_key?with_limited_by=true\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -30082,32 +21029,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /_security/_query/api_key?with_limited_by=true\n{\n \"query\": {\n \"ids\": {\n \"values\": [\n \"VuaCfGcBCdbkQm-e5aOx\"\n ]\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.query_api_keys(\n with_limited_by=True,\n query={\n \"ids\": {\n \"values\": [\n \"VuaCfGcBCdbkQm-e5aOx\"\n ]\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.queryApiKeys({\n with_limited_by: \"true\",\n query: {\n ids: {\n values: [\"VuaCfGcBCdbkQm-e5aOx\"],\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.query_api_keys(\n with_limited_by: \"true\",\n body: {\n \"query\": {\n \"ids\": {\n \"values\": [\n \"VuaCfGcBCdbkQm-e5aOx\"\n ]\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->queryApiKeys([\n \"with_limited_by\" => \"true\",\n \"body\" => [\n \"query\" => [\n \"ids\" => [\n \"values\" => array(\n \"VuaCfGcBCdbkQm-e5aOx\",\n ),\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"ids\":{\"values\":[\"VuaCfGcBCdbkQm-e5aOx\"]}}}' \"$ELASTICSEARCH_URL/_security/_query/api_key?with_limited_by=true\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -30128,32 +21049,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/_query/role\n{\n \"sort\": [\"name\"]\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.query_role(\n sort=[\n \"name\"\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.queryRole({\n sort: [\"name\"],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.query_role(\n body: {\n \"sort\": [\n \"name\"\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->queryRole([\n \"body\" => [\n \"sort\" => array(\n \"name\",\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"sort\":[\"name\"]}' \"$ELASTICSEARCH_URL/_security/_query/role\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -30172,32 +21067,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST /_security/_query/role\n{\n \"sort\": [\"name\"]\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.query_role(\n sort=[\n \"name\"\n ],\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.queryRole({\n sort: [\"name\"],\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.query_role(\n body: {\n \"sort\": [\n \"name\"\n ]\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->queryRole([\n \"body\" => [\n \"sort\" => array(\n \"name\",\n ),\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"sort\":[\"name\"]}' \"$ELASTICSEARCH_URL/_security/_query/role\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -30287,32 +21156,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT /_security/api_key/VuaCfGcBCdbkQm-e5aOx\n{\n \"role_descriptors\": {\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\"*\"],\n \"privileges\": [\"write\"]\n }\n ]\n }\n },\n \"metadata\": {\n \"environment\": {\n \"level\": 2,\n \"trusted\": true,\n \"tags\": [\"production\"]\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.security.update_api_key(\n id=\"VuaCfGcBCdbkQm-e5aOx\",\n role_descriptors={\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\n \"*\"\n ],\n \"privileges\": [\n \"write\"\n ]\n }\n ]\n }\n },\n metadata={\n \"environment\": {\n \"level\": 2,\n \"trusted\": True,\n \"tags\": [\n \"production\"\n ]\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.security.updateApiKey({\n id: \"VuaCfGcBCdbkQm-e5aOx\",\n role_descriptors: {\n \"role-a\": {\n indices: [\n {\n names: [\"*\"],\n privileges: [\"write\"],\n },\n ],\n },\n },\n metadata: {\n environment: {\n level: 2,\n trusted: true,\n tags: [\"production\"],\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.security.update_api_key(\n id: \"VuaCfGcBCdbkQm-e5aOx\",\n body: {\n \"role_descriptors\": {\n \"role-a\": {\n \"indices\": [\n {\n \"names\": [\n \"*\"\n ],\n \"privileges\": [\n \"write\"\n ]\n }\n ]\n }\n },\n \"metadata\": {\n \"environment\": {\n \"level\": 2,\n \"trusted\": true,\n \"tags\": [\n \"production\"\n ]\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->security()->updateApiKey([\n \"id\" => \"VuaCfGcBCdbkQm-e5aOx\",\n \"body\" => [\n \"role_descriptors\" => [\n \"role-a\" => [\n \"indices\" => array(\n [\n \"names\" => array(\n \"*\",\n ),\n \"privileges\" => array(\n \"write\",\n ),\n ],\n ),\n ],\n ],\n \"metadata\" => [\n \"environment\" => [\n \"level\" => 2,\n \"trusted\" => true,\n \"tags\" => array(\n \"production\",\n ),\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"role_descriptors\":{\"role-a\":{\"indices\":[{\"names\":[\"*\"],\"privileges\":[\"write\"]}]}},\"metadata\":{\"environment\":{\"level\":2,\"trusted\":true,\"tags\":[\"production\"]}}}' \"$ELASTICSEARCH_URL/_security/api_key/VuaCfGcBCdbkQm-e5aOx\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -30369,32 +21212,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _sql/close\n{\n \"cursor\": \"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.sql.clear_cursor(\n cursor=\"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.sql.clearCursor({\n cursor:\n \"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.sql.clear_cursor(\n body: {\n \"cursor\": \"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->sql()->clearCursor([\n \"body\" => [\n \"cursor\" => \"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"cursor\":\"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\"}' \"$ELASTICSEARCH_URL/_sql/close\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -30432,32 +21249,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _sql/async/delete/FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\n" - }, - { - "lang": "Python", - "source": "resp = client.sql.delete_async(\n id=\"FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.sql.deleteAsync({\n id: \"FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.sql.delete_async(\n id: \"FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->sql()->deleteAsync([\n \"id\" => \"FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_sql/async/delete/FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -30572,32 +21363,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _sql/async/FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=?wait_for_completion_timeout=2s&format=json\n" - }, - { - "lang": "Python", - "source": "resp = client.sql.get_async(\n id=\"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\",\n wait_for_completion_timeout=\"2s\",\n format=\"json\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.sql.getAsync({\n id: \"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\",\n wait_for_completion_timeout: \"2s\",\n format: \"json\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.sql.get_async(\n id: \"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\",\n wait_for_completion_timeout: \"2s\",\n format: \"json\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->sql()->getAsync([\n \"id\" => \"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\",\n \"wait_for_completion_timeout\" => \"2s\",\n \"format\" => \"json\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_sql/async/FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=?wait_for_completion_timeout=2s&format=json\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -30665,32 +21430,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _sql/async/status/FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\n" - }, - { - "lang": "Python", - "source": "resp = client.sql.get_async_status(\n id=\"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.sql.getAsyncStatus({\n id: \"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.sql.get_async_status(\n id: \"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->sql()->getAsyncStatus([\n \"id\" => \"FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_sql/async/status/FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -30716,32 +21455,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _sql?format=txt\n{\n \"query\": \"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.sql.query(\n format=\"txt\",\n query=\"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.sql.query({\n format: \"txt\",\n query: \"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.sql.query(\n format: \"txt\",\n body: {\n \"query\": \"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->sql()->query([\n \"format\" => \"txt\",\n \"body\" => [\n \"query\" => \"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":\"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\"}' \"$ELASTICSEARCH_URL/_sql?format=txt\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -30765,32 +21478,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _sql?format=txt\n{\n \"query\": \"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.sql.query(\n format=\"txt\",\n query=\"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.sql.query({\n format: \"txt\",\n query: \"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.sql.query(\n format: \"txt\",\n body: {\n \"query\": \"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->sql()->query([\n \"format\" => \"txt\",\n \"body\" => [\n \"query\" => \"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":\"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\"}' \"$ELASTICSEARCH_URL/_sql?format=txt\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -30811,32 +21498,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _sql/translate\n{\n \"query\": \"SELECT * FROM library ORDER BY page_count DESC\",\n \"fetch_size\": 10\n}" - }, - { - "lang": "Python", - "source": "resp = client.sql.translate(\n query=\"SELECT * FROM library ORDER BY page_count DESC\",\n fetch_size=10,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.sql.translate({\n query: \"SELECT * FROM library ORDER BY page_count DESC\",\n fetch_size: 10,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.sql.translate(\n body: {\n \"query\": \"SELECT * FROM library ORDER BY page_count DESC\",\n \"fetch_size\": 10\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->sql()->translate([\n \"body\" => [\n \"query\" => \"SELECT * FROM library ORDER BY page_count DESC\",\n \"fetch_size\" => 10,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":\"SELECT * FROM library ORDER BY page_count DESC\",\"fetch_size\":10}' \"$ELASTICSEARCH_URL/_sql/translate\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -30855,32 +21516,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _sql/translate\n{\n \"query\": \"SELECT * FROM library ORDER BY page_count DESC\",\n \"fetch_size\": 10\n}" - }, - { - "lang": "Python", - "source": "resp = client.sql.translate(\n query=\"SELECT * FROM library ORDER BY page_count DESC\",\n fetch_size=10,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.sql.translate({\n query: \"SELECT * FROM library ORDER BY page_count DESC\",\n fetch_size: 10,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.sql.translate(\n body: {\n \"query\": \"SELECT * FROM library ORDER BY page_count DESC\",\n \"fetch_size\": 10\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->sql()->translate([\n \"body\" => [\n \"query\" => \"SELECT * FROM library ORDER BY page_count DESC\",\n \"fetch_size\" => 10,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":\"SELECT * FROM library ORDER BY page_count DESC\",\"fetch_size\":10}' \"$ELASTICSEARCH_URL/_sql/translate\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -30961,32 +21596,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _synonyms/my-synonyms-set\n" - }, - { - "lang": "Python", - "source": "resp = client.synonyms.get_synonym(\n id=\"my-synonyms-set\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.synonyms.getSynonym({\n id: \"my-synonyms-set\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.synonyms.get_synonym(\n id: \"my-synonyms-set\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->synonyms()->getSynonym([\n \"id\" => \"my-synonyms-set\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_synonyms/my-synonyms-set\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -31063,32 +21672,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _synonyms/my-synonyms-set\n" - }, - { - "lang": "Python", - "source": "resp = client.synonyms.put_synonym(\n id=\"my-synonyms-set\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.synonyms.putSynonym({\n id: \"my-synonyms-set\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.synonyms.put_synonym(\n id: \"my-synonyms-set\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->synonyms()->putSynonym([\n \"id\" => \"my-synonyms-set\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_synonyms/my-synonyms-set\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -31124,32 +21707,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _synonyms/my-synonyms-set\n" - }, - { - "lang": "Python", - "source": "resp = client.synonyms.delete_synonym(\n id=\"my-synonyms-set\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.synonyms.deleteSynonym({\n id: \"my-synonyms-set\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.synonyms.delete_synonym(\n id: \"my-synonyms-set\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->synonyms()->deleteSynonym([\n \"id\" => \"my-synonyms-set\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_synonyms/my-synonyms-set\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -31204,32 +21761,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _synonyms/my-synonyms-set/test-1\n" - }, - { - "lang": "Python", - "source": "resp = client.synonyms.get_synonym_rule(\n set_id=\"my-synonyms-set\",\n rule_id=\"test-1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.synonyms.getSynonymRule({\n set_id: \"my-synonyms-set\",\n rule_id: \"test-1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.synonyms.get_synonym_rule(\n set_id: \"my-synonyms-set\",\n rule_id: \"test-1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->synonyms()->getSynonymRule([\n \"set_id\" => \"my-synonyms-set\",\n \"rule_id\" => \"test-1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_synonyms/my-synonyms-set/test-1\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -31307,32 +21838,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _synonyms/my-synonyms-set/test-1\n{\n \"synonyms\": \"hello, hi, howdy\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.synonyms.put_synonym_rule(\n set_id=\"my-synonyms-set\",\n rule_id=\"test-1\",\n synonyms=\"hello, hi, howdy\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.synonyms.putSynonymRule({\n set_id: \"my-synonyms-set\",\n rule_id: \"test-1\",\n synonyms: \"hello, hi, howdy\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.synonyms.put_synonym_rule(\n set_id: \"my-synonyms-set\",\n rule_id: \"test-1\",\n body: {\n \"synonyms\": \"hello, hi, howdy\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->synonyms()->putSynonymRule([\n \"set_id\" => \"my-synonyms-set\",\n \"rule_id\" => \"test-1\",\n \"body\" => [\n \"synonyms\" => \"hello, hi, howdy\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"synonyms\":\"hello, hi, howdy\"}' \"$ELASTICSEARCH_URL/_synonyms/my-synonyms-set/test-1\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -31385,32 +21890,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _synonyms/my-synonyms-set/test-1\n" - }, - { - "lang": "Python", - "source": "resp = client.synonyms.delete_synonym_rule(\n set_id=\"my-synonyms-set\",\n rule_id=\"test-1\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.synonyms.deleteSynonymRule({\n set_id: \"my-synonyms-set\",\n rule_id: \"test-1\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.synonyms.delete_synonym_rule(\n set_id: \"my-synonyms-set\",\n rule_id: \"test-1\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->synonyms()->deleteSynonymRule([\n \"set_id\" => \"my-synonyms-set\",\n \"rule_id\" => \"test-1\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_synonyms/my-synonyms-set/test-1\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -31480,32 +21959,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _synonyms\n" - }, - { - "lang": "Python", - "source": "resp = client.synonyms.get_synonyms_sets()" - }, - { - "lang": "JavaScript", - "source": "const response = await client.synonyms.getSynonymsSets();" - }, - { - "lang": "Ruby", - "source": "response = client.synonyms.get_synonyms_sets" - }, - { - "lang": "PHP", - "source": "$resp = $client->synonyms()->getSynonymsSets();" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_synonyms\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -31593,32 +22046,6 @@ } }, "x-state": "Technical preview", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _tasks?detailed=true&actions=*/delete/byquery\n" - }, - { - "lang": "Python", - "source": "resp = client.tasks.list(\n detailed=True,\n actions=\"*/delete/byquery\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.tasks.list({\n detailed: \"true\",\n actions: \"*/delete/byquery\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.tasks.list(\n detailed: \"true\",\n actions: \"*/delete/byquery\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->tasks()->list([\n \"detailed\" => \"true\",\n \"actions\" => \"*/delete/byquery\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_tasks?detailed=true&actions=*/delete/byquery\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -31644,32 +22071,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST stackoverflow/_terms_enum\n{\n \"field\" : \"tags\",\n \"string\" : \"kiba\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.terms_enum(\n index=\"stackoverflow\",\n field=\"tags\",\n string=\"kiba\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.termsEnum({\n index: \"stackoverflow\",\n field: \"tags\",\n string: \"kiba\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.terms_enum(\n index: \"stackoverflow\",\n body: {\n \"field\": \"tags\",\n \"string\": \"kiba\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->termsEnum([\n \"index\" => \"stackoverflow\",\n \"body\" => [\n \"field\" => \"tags\",\n \"string\" => \"kiba\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"field\":\"tags\",\"string\":\"kiba\"}' \"$ELASTICSEARCH_URL/stackoverflow/_terms_enum\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -31693,32 +22094,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST stackoverflow/_terms_enum\n{\n \"field\" : \"tags\",\n \"string\" : \"kiba\"\n}" - }, - { - "lang": "Python", - "source": "resp = client.terms_enum(\n index=\"stackoverflow\",\n field=\"tags\",\n string=\"kiba\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.termsEnum({\n index: \"stackoverflow\",\n field: \"tags\",\n string: \"kiba\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.terms_enum(\n index: \"stackoverflow\",\n body: {\n \"field\": \"tags\",\n \"string\": \"kiba\"\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->termsEnum([\n \"index\" => \"stackoverflow\",\n \"body\" => [\n \"field\" => \"tags\",\n \"string\" => \"kiba\",\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"field\":\"tags\",\"string\":\"kiba\"}' \"$ELASTICSEARCH_URL/stackoverflow/_terms_enum\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -31774,41 +22149,15 @@ "$ref": "#/components/parameters/termvectors-version_type" } ], - "requestBody": { - "$ref": "#/components/requestBodies/termvectors" - }, - "responses": { - "200": { - "$ref": "#/components/responses/termvectors-200" - } - }, - "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_termvectors/1\n{\n \"fields\" : [\"text\"],\n \"offsets\" : true,\n \"payloads\" : true,\n \"positions\" : true,\n \"term_statistics\" : true,\n \"field_statistics\" : true\n}" - }, - { - "lang": "Python", - "source": "resp = client.termvectors(\n index=\"my-index-000001\",\n id=\"1\",\n fields=[\n \"text\"\n ],\n offsets=True,\n payloads=True,\n positions=True,\n term_statistics=True,\n field_statistics=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.termvectors({\n index: \"my-index-000001\",\n id: 1,\n fields: [\"text\"],\n offsets: true,\n payloads: true,\n positions: true,\n term_statistics: true,\n field_statistics: true,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.termvectors(\n index: \"my-index-000001\",\n id: \"1\",\n body: {\n \"fields\": [\n \"text\"\n ],\n \"offsets\": true,\n \"payloads\": true,\n \"positions\": true,\n \"term_statistics\": true,\n \"field_statistics\": true\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->termvectors([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n \"body\" => [\n \"fields\" => array(\n \"text\",\n ),\n \"offsets\" => true,\n \"payloads\" => true,\n \"positions\" => true,\n \"term_statistics\" => true,\n \"field_statistics\" => true,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"fields\":[\"text\"],\"offsets\":true,\"payloads\":true,\"positions\":true,\"term_statistics\":true,\"field_statistics\":true}' \"$ELASTICSEARCH_URL/my-index-000001/_termvectors/1\"" - } - ], + "requestBody": { + "$ref": "#/components/requestBodies/termvectors" + }, + "responses": { + "200": { + "$ref": "#/components/responses/termvectors-200" + } + }, + "x-state": "Generally available", "x-product-feature": "elasticsearch" }, "post": { @@ -31871,32 +22220,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_termvectors/1\n{\n \"fields\" : [\"text\"],\n \"offsets\" : true,\n \"payloads\" : true,\n \"positions\" : true,\n \"term_statistics\" : true,\n \"field_statistics\" : true\n}" - }, - { - "lang": "Python", - "source": "resp = client.termvectors(\n index=\"my-index-000001\",\n id=\"1\",\n fields=[\n \"text\"\n ],\n offsets=True,\n payloads=True,\n positions=True,\n term_statistics=True,\n field_statistics=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.termvectors({\n index: \"my-index-000001\",\n id: 1,\n fields: [\"text\"],\n offsets: true,\n payloads: true,\n positions: true,\n term_statistics: true,\n field_statistics: true,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.termvectors(\n index: \"my-index-000001\",\n id: \"1\",\n body: {\n \"fields\": [\n \"text\"\n ],\n \"offsets\": true,\n \"payloads\": true,\n \"positions\": true,\n \"term_statistics\": true,\n \"field_statistics\": true\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->termvectors([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n \"body\" => [\n \"fields\" => array(\n \"text\",\n ),\n \"offsets\" => true,\n \"payloads\" => true,\n \"positions\" => true,\n \"term_statistics\" => true,\n \"field_statistics\" => true,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"fields\":[\"text\"],\"offsets\":true,\"payloads\":true,\"positions\":true,\"term_statistics\":true,\"field_statistics\":true}' \"$ELASTICSEARCH_URL/my-index-000001/_termvectors/1\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -31958,32 +22281,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_termvectors/1\n{\n \"fields\" : [\"text\"],\n \"offsets\" : true,\n \"payloads\" : true,\n \"positions\" : true,\n \"term_statistics\" : true,\n \"field_statistics\" : true\n}" - }, - { - "lang": "Python", - "source": "resp = client.termvectors(\n index=\"my-index-000001\",\n id=\"1\",\n fields=[\n \"text\"\n ],\n offsets=True,\n payloads=True,\n positions=True,\n term_statistics=True,\n field_statistics=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.termvectors({\n index: \"my-index-000001\",\n id: 1,\n fields: [\"text\"],\n offsets: true,\n payloads: true,\n positions: true,\n term_statistics: true,\n field_statistics: true,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.termvectors(\n index: \"my-index-000001\",\n id: \"1\",\n body: {\n \"fields\": [\n \"text\"\n ],\n \"offsets\": true,\n \"payloads\": true,\n \"positions\": true,\n \"term_statistics\": true,\n \"field_statistics\": true\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->termvectors([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n \"body\" => [\n \"fields\" => array(\n \"text\",\n ),\n \"offsets\" => true,\n \"payloads\" => true,\n \"positions\" => true,\n \"term_statistics\" => true,\n \"field_statistics\" => true,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"fields\":[\"text\"],\"offsets\":true,\"payloads\":true,\"positions\":true,\"term_statistics\":true,\"field_statistics\":true}' \"$ELASTICSEARCH_URL/my-index-000001/_termvectors/1\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -32043,32 +22340,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET /my-index-000001/_termvectors/1\n{\n \"fields\" : [\"text\"],\n \"offsets\" : true,\n \"payloads\" : true,\n \"positions\" : true,\n \"term_statistics\" : true,\n \"field_statistics\" : true\n}" - }, - { - "lang": "Python", - "source": "resp = client.termvectors(\n index=\"my-index-000001\",\n id=\"1\",\n fields=[\n \"text\"\n ],\n offsets=True,\n payloads=True,\n positions=True,\n term_statistics=True,\n field_statistics=True,\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.termvectors({\n index: \"my-index-000001\",\n id: 1,\n fields: [\"text\"],\n offsets: true,\n payloads: true,\n positions: true,\n term_statistics: true,\n field_statistics: true,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.termvectors(\n index: \"my-index-000001\",\n id: \"1\",\n body: {\n \"fields\": [\n \"text\"\n ],\n \"offsets\": true,\n \"payloads\": true,\n \"positions\": true,\n \"term_statistics\": true,\n \"field_statistics\": true\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->termvectors([\n \"index\" => \"my-index-000001\",\n \"id\" => \"1\",\n \"body\" => [\n \"fields\" => array(\n \"text\",\n ),\n \"offsets\" => true,\n \"payloads\" => true,\n \"positions\" => true,\n \"term_statistics\" => true,\n \"field_statistics\" => true,\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"fields\":[\"text\"],\"offsets\":true,\"payloads\":true,\"positions\":true,\"term_statistics\":true,\"field_statistics\":true}' \"$ELASTICSEARCH_URL/my-index-000001/_termvectors/1\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -32103,32 +22374,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _transform?size=10\n" - }, - { - "lang": "Python", - "source": "resp = client.transform.get_transform(\n size=\"10\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.getTransform({\n size: 10,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.get_transform(\n size: \"10\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->getTransform([\n \"size\" => \"10\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_transform?size=10\"" - } - ], "x-product-feature": "elasticsearch" }, "put": { @@ -32249,32 +22494,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "PUT _transform/ecommerce_transform1\n{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n \"retention_policy\": {\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.transform.put_transform(\n transform_id=\"ecommerce_transform1\",\n source={\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n pivot={\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": True\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n description=\"Maximum priced ecommerce data by customer_id in Asia\",\n dest={\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n frequency=\"5m\",\n sync={\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n retention_policy={\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.putTransform({\n transform_id: \"ecommerce_transform1\",\n source: {\n index: \"kibana_sample_data_ecommerce\",\n query: {\n term: {\n \"geoip.continent_name\": {\n value: \"Asia\",\n },\n },\n },\n },\n pivot: {\n group_by: {\n customer_id: {\n terms: {\n field: \"customer_id\",\n missing_bucket: true,\n },\n },\n },\n aggregations: {\n max_price: {\n max: {\n field: \"taxful_total_price\",\n },\n },\n },\n },\n description: \"Maximum priced ecommerce data by customer_id in Asia\",\n dest: {\n index: \"kibana_sample_data_ecommerce_transform1\",\n pipeline: \"add_timestamp_pipeline\",\n },\n frequency: \"5m\",\n sync: {\n time: {\n field: \"order_date\",\n delay: \"60s\",\n },\n },\n retention_policy: {\n time: {\n field: \"order_date\",\n max_age: \"30d\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.put_transform(\n transform_id: \"ecommerce_transform1\",\n body: {\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n \"retention_policy\": {\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->putTransform([\n \"transform_id\" => \"ecommerce_transform1\",\n \"body\" => [\n \"source\" => [\n \"index\" => \"kibana_sample_data_ecommerce\",\n \"query\" => [\n \"term\" => [\n \"geoip.continent_name\" => [\n \"value\" => \"Asia\",\n ],\n ],\n ],\n ],\n \"pivot\" => [\n \"group_by\" => [\n \"customer_id\" => [\n \"terms\" => [\n \"field\" => \"customer_id\",\n \"missing_bucket\" => true,\n ],\n ],\n ],\n \"aggregations\" => [\n \"max_price\" => [\n \"max\" => [\n \"field\" => \"taxful_total_price\",\n ],\n ],\n ],\n ],\n \"description\" => \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\" => [\n \"index\" => \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\" => \"add_timestamp_pipeline\",\n ],\n \"frequency\" => \"5m\",\n \"sync\" => [\n \"time\" => [\n \"field\" => \"order_date\",\n \"delay\" => \"60s\",\n ],\n ],\n \"retention_policy\" => [\n \"time\" => [\n \"field\" => \"order_date\",\n \"max_age\" => \"30d\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"kibana_sample_data_ecommerce\",\"query\":{\"term\":{\"geoip.continent_name\":{\"value\":\"Asia\"}}}},\"pivot\":{\"group_by\":{\"customer_id\":{\"terms\":{\"field\":\"customer_id\",\"missing_bucket\":true}}},\"aggregations\":{\"max_price\":{\"max\":{\"field\":\"taxful_total_price\"}}}},\"description\":\"Maximum priced ecommerce data by customer_id in Asia\",\"dest\":{\"index\":\"kibana_sample_data_ecommerce_transform1\",\"pipeline\":\"add_timestamp_pipeline\"},\"frequency\":\"5m\",\"sync\":{\"time\":{\"field\":\"order_date\",\"delay\":\"60s\"}},\"retention_policy\":{\"time\":{\"field\":\"order_date\",\"max_age\":\"30d\"}}}' \"$ELASTICSEARCH_URL/_transform/ecommerce_transform1\"" - } - ], "x-product-feature": "elasticsearch" }, "delete": { @@ -32346,32 +22565,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "DELETE _transform/ecommerce_transform\n" - }, - { - "lang": "Python", - "source": "resp = client.transform.delete_transform(\n transform_id=\"ecommerce_transform\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.deleteTransform({\n transform_id: \"ecommerce_transform\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.delete_transform(\n transform_id: \"ecommerce_transform\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->deleteTransform([\n \"transform_id\" => \"ecommerce_transform\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_transform/ecommerce_transform\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -32403,32 +22596,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _transform?size=10\n" - }, - { - "lang": "Python", - "source": "resp = client.transform.get_transform(\n size=\"10\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.getTransform({\n size: 10,\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.get_transform(\n size: \"10\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->getTransform([\n \"size\" => \"10\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_transform?size=10\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -32527,32 +22694,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "GET _transform/ecommerce-customer-transform/_stats\n" - }, - { - "lang": "Python", - "source": "resp = client.transform.get_transform_stats(\n transform_id=\"ecommerce-customer-transform\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.getTransformStats({\n transform_id: \"ecommerce-customer-transform\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.get_transform_stats(\n transform_id: \"ecommerce-customer-transform\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->getTransformStats([\n \"transform_id\" => \"ecommerce-customer-transform\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_transform/ecommerce-customer-transform/_stats\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -32581,32 +22722,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _transform/_preview\n{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.transform.preview_transform(\n source={\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n pivot={\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": True\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.previewTransform({\n source: {\n index: \"kibana_sample_data_ecommerce\",\n },\n pivot: {\n group_by: {\n customer_id: {\n terms: {\n field: \"customer_id\",\n missing_bucket: true,\n },\n },\n },\n aggregations: {\n max_price: {\n max: {\n field: \"taxful_total_price\",\n },\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.preview_transform(\n body: {\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->previewTransform([\n \"body\" => [\n \"source\" => [\n \"index\" => \"kibana_sample_data_ecommerce\",\n ],\n \"pivot\" => [\n \"group_by\" => [\n \"customer_id\" => [\n \"terms\" => [\n \"field\" => \"customer_id\",\n \"missing_bucket\" => true,\n ],\n ],\n ],\n \"aggregations\" => [\n \"max_price\" => [\n \"max\" => [\n \"field\" => \"taxful_total_price\",\n ],\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"kibana_sample_data_ecommerce\"},\"pivot\":{\"group_by\":{\"customer_id\":{\"terms\":{\"field\":\"customer_id\",\"missing_bucket\":true}}},\"aggregations\":{\"max_price\":{\"max\":{\"field\":\"taxful_total_price\"}}}}}' \"$ELASTICSEARCH_URL/_transform/_preview\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -32633,32 +22748,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _transform/_preview\n{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.transform.preview_transform(\n source={\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n pivot={\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": True\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.previewTransform({\n source: {\n index: \"kibana_sample_data_ecommerce\",\n },\n pivot: {\n group_by: {\n customer_id: {\n terms: {\n field: \"customer_id\",\n missing_bucket: true,\n },\n },\n },\n aggregations: {\n max_price: {\n max: {\n field: \"taxful_total_price\",\n },\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.preview_transform(\n body: {\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->previewTransform([\n \"body\" => [\n \"source\" => [\n \"index\" => \"kibana_sample_data_ecommerce\",\n ],\n \"pivot\" => [\n \"group_by\" => [\n \"customer_id\" => [\n \"terms\" => [\n \"field\" => \"customer_id\",\n \"missing_bucket\" => true,\n ],\n ],\n ],\n \"aggregations\" => [\n \"max_price\" => [\n \"max\" => [\n \"field\" => \"taxful_total_price\",\n ],\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"kibana_sample_data_ecommerce\"},\"pivot\":{\"group_by\":{\"customer_id\":{\"terms\":{\"field\":\"customer_id\",\"missing_bucket\":true}}},\"aggregations\":{\"max_price\":{\"max\":{\"field\":\"taxful_total_price\"}}}}}' \"$ELASTICSEARCH_URL/_transform/_preview\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -32684,32 +22773,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _transform/_preview\n{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.transform.preview_transform(\n source={\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n pivot={\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": True\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.previewTransform({\n source: {\n index: \"kibana_sample_data_ecommerce\",\n },\n pivot: {\n group_by: {\n customer_id: {\n terms: {\n field: \"customer_id\",\n missing_bucket: true,\n },\n },\n },\n aggregations: {\n max_price: {\n max: {\n field: \"taxful_total_price\",\n },\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.preview_transform(\n body: {\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->previewTransform([\n \"body\" => [\n \"source\" => [\n \"index\" => \"kibana_sample_data_ecommerce\",\n ],\n \"pivot\" => [\n \"group_by\" => [\n \"customer_id\" => [\n \"terms\" => [\n \"field\" => \"customer_id\",\n \"missing_bucket\" => true,\n ],\n ],\n ],\n \"aggregations\" => [\n \"max_price\" => [\n \"max\" => [\n \"field\" => \"taxful_total_price\",\n ],\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"kibana_sample_data_ecommerce\"},\"pivot\":{\"group_by\":{\"customer_id\":{\"terms\":{\"field\":\"customer_id\",\"missing_bucket\":true}}},\"aggregations\":{\"max_price\":{\"max\":{\"field\":\"taxful_total_price\"}}}}}' \"$ELASTICSEARCH_URL/_transform/_preview\"" - } - ], "x-product-feature": "elasticsearch" }, "post": { @@ -32733,32 +22796,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _transform/_preview\n{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.transform.preview_transform(\n source={\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n pivot={\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": True\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.previewTransform({\n source: {\n index: \"kibana_sample_data_ecommerce\",\n },\n pivot: {\n group_by: {\n customer_id: {\n terms: {\n field: \"customer_id\",\n missing_bucket: true,\n },\n },\n },\n aggregations: {\n max_price: {\n max: {\n field: \"taxful_total_price\",\n },\n },\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.preview_transform(\n body: {\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\"\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->previewTransform([\n \"body\" => [\n \"source\" => [\n \"index\" => \"kibana_sample_data_ecommerce\",\n ],\n \"pivot\" => [\n \"group_by\" => [\n \"customer_id\" => [\n \"terms\" => [\n \"field\" => \"customer_id\",\n \"missing_bucket\" => true,\n ],\n ],\n ],\n \"aggregations\" => [\n \"max_price\" => [\n \"max\" => [\n \"field\" => \"taxful_total_price\",\n ],\n ],\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"kibana_sample_data_ecommerce\"},\"pivot\":{\"group_by\":{\"customer_id\":{\"terms\":{\"field\":\"customer_id\",\"missing_bucket\":true}}},\"aggregations\":{\"max_price\":{\"max\":{\"field\":\"taxful_total_price\"}}}}}' \"$ELASTICSEARCH_URL/_transform/_preview\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -32822,32 +22859,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _transform/ecommerce_transform/_reset\n" - }, - { - "lang": "Python", - "source": "resp = client.transform.reset_transform(\n transform_id=\"ecommerce_transform\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.resetTransform({\n transform_id: \"ecommerce_transform\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.reset_transform(\n transform_id: \"ecommerce_transform\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->resetTransform([\n \"transform_id\" => \"ecommerce_transform\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_transform/ecommerce_transform/_reset\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -32901,32 +22912,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _transform/ecommerce_transform/_schedule_now\n" - }, - { - "lang": "Python", - "source": "resp = client.transform.schedule_now_transform(\n transform_id=\"ecommerce_transform\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.scheduleNowTransform({\n transform_id: \"ecommerce_transform\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.schedule_now_transform(\n transform_id: \"ecommerce_transform\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->scheduleNowTransform([\n \"transform_id\" => \"ecommerce_transform\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_transform/ecommerce_transform/_schedule_now\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -32990,32 +22975,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _transform/ecommerce-customer-transform/_start\n" - }, - { - "lang": "Python", - "source": "resp = client.transform.start_transform(\n transform_id=\"ecommerce-customer-transform\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.startTransform({\n transform_id: \"ecommerce-customer-transform\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.start_transform(\n transform_id: \"ecommerce-customer-transform\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->startTransform([\n \"transform_id\" => \"ecommerce-customer-transform\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_transform/ecommerce-customer-transform/_start\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -33109,32 +23068,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _transform/ecommerce_transform/_stop\n" - }, - { - "lang": "Python", - "source": "resp = client.transform.stop_transform(\n transform_id=\"ecommerce_transform\",\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.stopTransform({\n transform_id: \"ecommerce_transform\",\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.stop_transform(\n transform_id: \"ecommerce_transform\"\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->stopTransform([\n \"transform_id\" => \"ecommerce_transform\",\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_transform/ecommerce_transform/_stop\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -33303,32 +23236,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST _transform/simple-kibana-ecomm-pivot/_update\n{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n \"retention_policy\": {\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.transform.update_transform(\n transform_id=\"simple-kibana-ecomm-pivot\",\n source={\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n pivot={\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": True\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n description=\"Maximum priced ecommerce data by customer_id in Asia\",\n dest={\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n frequency=\"5m\",\n sync={\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n retention_policy={\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.transform.updateTransform({\n transform_id: \"simple-kibana-ecomm-pivot\",\n source: {\n index: \"kibana_sample_data_ecommerce\",\n query: {\n term: {\n \"geoip.continent_name\": {\n value: \"Asia\",\n },\n },\n },\n },\n pivot: {\n group_by: {\n customer_id: {\n terms: {\n field: \"customer_id\",\n missing_bucket: true,\n },\n },\n },\n aggregations: {\n max_price: {\n max: {\n field: \"taxful_total_price\",\n },\n },\n },\n },\n description: \"Maximum priced ecommerce data by customer_id in Asia\",\n dest: {\n index: \"kibana_sample_data_ecommerce_transform1\",\n pipeline: \"add_timestamp_pipeline\",\n },\n frequency: \"5m\",\n sync: {\n time: {\n field: \"order_date\",\n delay: \"60s\",\n },\n },\n retention_policy: {\n time: {\n field: \"order_date\",\n max_age: \"30d\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.transform.update_transform(\n transform_id: \"simple-kibana-ecomm-pivot\",\n body: {\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n \"retention_policy\": {\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->transform()->updateTransform([\n \"transform_id\" => \"simple-kibana-ecomm-pivot\",\n \"body\" => [\n \"source\" => [\n \"index\" => \"kibana_sample_data_ecommerce\",\n \"query\" => [\n \"term\" => [\n \"geoip.continent_name\" => [\n \"value\" => \"Asia\",\n ],\n ],\n ],\n ],\n \"pivot\" => [\n \"group_by\" => [\n \"customer_id\" => [\n \"terms\" => [\n \"field\" => \"customer_id\",\n \"missing_bucket\" => true,\n ],\n ],\n ],\n \"aggregations\" => [\n \"max_price\" => [\n \"max\" => [\n \"field\" => \"taxful_total_price\",\n ],\n ],\n ],\n ],\n \"description\" => \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\" => [\n \"index\" => \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\" => \"add_timestamp_pipeline\",\n ],\n \"frequency\" => \"5m\",\n \"sync\" => [\n \"time\" => [\n \"field\" => \"order_date\",\n \"delay\" => \"60s\",\n ],\n ],\n \"retention_policy\" => [\n \"time\" => [\n \"field\" => \"order_date\",\n \"max_age\" => \"30d\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"kibana_sample_data_ecommerce\",\"query\":{\"term\":{\"geoip.continent_name\":{\"value\":\"Asia\"}}}},\"pivot\":{\"group_by\":{\"customer_id\":{\"terms\":{\"field\":\"customer_id\",\"missing_bucket\":true}}},\"aggregations\":{\"max_price\":{\"max\":{\"field\":\"taxful_total_price\"}}}},\"description\":\"Maximum priced ecommerce data by customer_id in Asia\",\"dest\":{\"index\":\"kibana_sample_data_ecommerce_transform1\",\"pipeline\":\"add_timestamp_pipeline\"},\"frequency\":\"5m\",\"sync\":{\"time\":{\"field\":\"order_date\",\"delay\":\"60s\"}},\"retention_policy\":{\"time\":{\"field\":\"order_date\",\"max_age\":\"30d\"}}}' \"$ELASTICSEARCH_URL/_transform/simple-kibana-ecomm-pivot/_update\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -33609,32 +23516,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST test/_update/1\n{\n \"script\" : {\n \"source\": \"ctx._source.counter += params.count\",\n \"lang\": \"painless\",\n \"params\" : {\n \"count\" : 4\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.update(\n index=\"test\",\n id=\"1\",\n script={\n \"source\": \"ctx._source.counter += params.count\",\n \"lang\": \"painless\",\n \"params\": {\n \"count\": 4\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.update({\n index: \"test\",\n id: 1,\n script: {\n source: \"ctx._source.counter += params.count\",\n lang: \"painless\",\n params: {\n count: 4,\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.update(\n index: \"test\",\n id: \"1\",\n body: {\n \"script\": {\n \"source\": \"ctx._source.counter += params.count\",\n \"lang\": \"painless\",\n \"params\": {\n \"count\": 4\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->update([\n \"index\" => \"test\",\n \"id\" => \"1\",\n \"body\" => [\n \"script\" => [\n \"source\" => \"ctx._source.counter += params.count\",\n \"lang\" => \"painless\",\n \"params\" => [\n \"count\" => 4,\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"script\":{\"source\":\"ctx._source.counter += params.count\",\"lang\":\"painless\",\"params\":{\"count\":4}}}' \"$ELASTICSEARCH_URL/test/_update/1\"" - } - ], "x-product-feature": "elasticsearch" } }, @@ -34099,32 +23980,6 @@ } }, "x-state": "Generally available", - "x-codeSamples": [ - { - "lang": "Console", - "source": "POST my-index-000001/_update_by_query?conflicts=proceed\n{\n \"query\": { \n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n}" - }, - { - "lang": "Python", - "source": "resp = client.update_by_query(\n index=\"my-index-000001\",\n conflicts=\"proceed\",\n query={\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n },\n)" - }, - { - "lang": "JavaScript", - "source": "const response = await client.updateByQuery({\n index: \"my-index-000001\",\n conflicts: \"proceed\",\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n});" - }, - { - "lang": "Ruby", - "source": "response = client.update_by_query(\n index: \"my-index-000001\",\n conflicts: \"proceed\",\n body: {\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n }\n)" - }, - { - "lang": "PHP", - "source": "$resp = $client->updateByQuery([\n \"index\" => \"my-index-000001\",\n \"conflicts\" => \"proceed\",\n \"body\" => [\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n]);" - }, - { - "lang": "curl", - "source": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}' \"$ELASTICSEARCH_URL/my-index-000001/_update_by_query?conflicts=proceed\"" - } - ], "x-product-feature": "elasticsearch" } } diff --git a/output/schema/schema.json b/output/schema/schema.json index 891deb3c4f..628ece3b0b 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -15970,10 +15970,12 @@ "stability": "stable" } }, - "description": "Reindex documents.\n\nCopy documents from a source to a destination.\nYou can copy all documents to the destination index or reindex a subset of the documents.\nThe source can be any existing index, alias, or data stream.\nThe destination must differ from the source.\nFor example, you cannot reindex a data stream into itself.\n\nIMPORTANT: Reindex requires `_source` to be enabled for all documents in the source.\nThe destination should be configured as wanted before calling the reindex API.\nReindex does not copy the settings from the source or its associated template.\nMappings, shard counts, and replicas, for example, must be configured ahead of time.\n\nIf the Elasticsearch security features are enabled, you must have the following security privileges:\n\n* The `read` index privilege for the source data stream, index, or alias.\n* The `write` index privilege for the destination data stream, index, or index alias.\n* To automatically create a data stream or index with a reindex API request, you must have the `auto_configure`, `create_index`, or `manage` index privilege for the destination data stream, index, or alias.\n* If reindexing from a remote cluster, the `source.remote.user` must have the `monitor` cluster privilege and the `read` index privilege for the source data stream, index, or alias.\n\nIf reindexing from a remote cluster, you must explicitly allow the remote host in the `reindex.remote.whitelist` setting.\nAutomatic data stream creation requires a matching index template with data stream enabled.\n\nThe `dest` element can be configured like the index API to control optimistic concurrency control.\nOmitting `version_type` or setting it to `internal` causes Elasticsearch to blindly dump documents into the destination, overwriting any that happen to have the same ID.\n\nSetting `version_type` to `external` causes Elasticsearch to preserve the `version` from the source, create any documents that are missing, and update any documents that have an older version in the destination than they do in the source.\n\nSetting `op_type` to `create` causes the reindex API to create only missing documents in the destination.\nAll existing documents will cause a version conflict.\n\nIMPORTANT: Because data streams are append-only, any reindex request to a destination data stream must have an `op_type` of `create`.\nA reindex can only add new documents to a destination data stream.\nIt cannot update existing documents in a destination data stream.\n\nBy default, version conflicts abort the reindex process.\nTo continue reindexing if there are conflicts, set the `conflicts` request body property to `proceed`.\nIn this case, the response includes a count of the version conflicts that were encountered.\nNote that the handling of other error types is unaffected by the `conflicts` property.\nAdditionally, if you opt to count version conflicts, the operation could attempt to reindex more documents from the source than `max_docs` until it has successfully indexed `max_docs` documents into the target or it has gone through every document in the source query.\n\nNOTE: The reindex API makes no effort to handle ID collisions.\nThe last document written will \"win\" but the order isn't usually predictable so it is not a good idea to rely on this behavior.\nInstead, make sure that IDs are unique by using a script.\n\n**Running reindex asynchronously**\n\nIf the request contains `wait_for_completion=false`, Elasticsearch performs some preflight checks, launches the request, and returns a task you can use to cancel or get the status of the task.\nElasticsearch creates a record of this task as a document at `_tasks/`.\n\n**Reindex from multiple sources**\n\nIf you have many sources to reindex it is generally better to reindex them one at a time rather than using a glob pattern to pick up multiple sources.\nThat way you can resume the process if there are any errors by removing the partially completed source and starting over.\nIt also makes parallelizing the process fairly simple: split the list of sources to reindex and run each list in parallel.\n\nFor example, you can use a bash script like this:\n\n```\nfor index in i1 i2 i3 i4 i5; do\n curl -HContent-Type:application/json -XPOST localhost:9200/_reindex?pretty -d'{\n \"source\": {\n \"index\": \"'$index'\"\n },\n \"dest\": {\n \"index\": \"'$index'-reindexed\"\n }\n }'\ndone\n```\n\n**Throttling**\n\nSet `requests_per_second` to any positive decimal number (`1.4`, `6`, `1000`, for example) to throttle the rate at which reindex issues batches of index operations.\nRequests are throttled by padding each batch with a wait time.\nTo turn off throttling, set `requests_per_second` to `-1`.\n\nThe throttling is done by waiting between batches so that the scroll that reindex uses internally can be given a timeout that takes into account the padding.\nThe padding time is the difference between the batch size divided by the `requests_per_second` and the time spent writing.\nBy default the batch size is `1000`, so if `requests_per_second` is set to `500`:\n\n```\ntarget_time = 1000 / 500 per second = 2 seconds\nwait_time = target_time - write_time = 2 seconds - .5 seconds = 1.5 seconds\n```\n\nSince the batch is issued as a single bulk request, large batch sizes cause Elasticsearch to create many requests and then wait for a while before starting the next set.\nThis is \"bursty\" instead of \"smooth\".\n\n**Slicing**\n\nReindex supports sliced scroll to parallelize the reindexing process.\nThis parallelization can improve efficiency and provide a convenient way to break the request down into smaller parts.\n\nNOTE: Reindexing from remote clusters does not support manual or automatic slicing.\n\nYou can slice a reindex request manually by providing a slice ID and total number of slices to each request.\nYou can also let reindex automatically parallelize by using sliced scroll to slice on `_id`.\nThe `slices` parameter specifies the number of slices to use.\n\nAdding `slices` to the reindex request just automates the manual process, creating sub-requests which means it has some quirks:\n\n* You can see these requests in the tasks API. These sub-requests are \"child\" tasks of the task for the request with slices.\n* Fetching the status of the task for the request with `slices` only contains the status of completed slices.\n* These sub-requests are individually addressable for things like cancellation and rethrottling.\n* Rethrottling the request with `slices` will rethrottle the unfinished sub-request proportionally.\n* Canceling the request with `slices` will cancel each sub-request.\n* Due to the nature of `slices`, each sub-request won't get a perfectly even portion of the documents. All documents will be addressed, but some slices may be larger than others. Expect larger slices to have a more even distribution.\n* Parameters like `requests_per_second` and `max_docs` on a request with `slices` are distributed proportionally to each sub-request. Combine that with the previous point about distribution being uneven and you should conclude that using `max_docs` with `slices` might not result in exactly `max_docs` documents being reindexed.\n* Each sub-request gets a slightly different snapshot of the source, though these are all taken at approximately the same time.\n\nIf slicing automatically, setting `slices` to `auto` will choose a reasonable number for most indices.\nIf slicing manually or otherwise tuning automatic slicing, use the following guidelines.\n\nQuery performance is most efficient when the number of slices is equal to the number of shards in the index.\nIf that number is large (for example, `500`), choose a lower number as too many slices will hurt performance.\nSetting slices higher than the number of shards generally does not improve efficiency and adds overhead.\n\nIndexing performance scales linearly across available resources with the number of slices.\n\nWhether query or indexing performance dominates the runtime depends on the documents being reindexed and cluster resources.\n\n**Modify documents during reindexing**\n\nLike `_update_by_query`, reindex operations support a script that modifies the document.\nUnlike `_update_by_query`, the script is allowed to modify the document's metadata.\n\nJust as in `_update_by_query`, you can set `ctx.op` to change the operation that is run on the destination.\nFor example, set `ctx.op` to `noop` if your script decides that the document doesn’t have to be indexed in the destination. This \"no operation\" will be reported in the `noop` counter in the response body.\nSet `ctx.op` to `delete` if your script decides that the document must be deleted from the destination.\nThe deletion will be reported in the `deleted` counter in the response body.\nSetting `ctx.op` to anything else will return an error, as will setting any other field in `ctx`.\n\nThink of the possibilities! Just be careful; you are able to change:\n\n* `_id`\n* `_index`\n* `_version`\n* `_routing`\n\nSetting `_version` to `null` or clearing it from the `ctx` map is just like not sending the version in an indexing request.\nIt will cause the document to be overwritten in the destination regardless of the version on the target or the version type you use in the reindex API.\n\n**Reindex from remote**\n\nReindex supports reindexing from a remote Elasticsearch cluster.\nThe `host` parameter must contain a scheme, host, port, and optional path.\nThe `username` and `password` parameters are optional and when they are present the reindex operation will connect to the remote Elasticsearch node using basic authentication.\nBe sure to use HTTPS when using basic authentication or the password will be sent in plain text.\nThere are a range of settings available to configure the behavior of the HTTPS connection.\n\nWhen using Elastic Cloud, it is also possible to authenticate against the remote cluster through the use of a valid API key.\nRemote hosts must be explicitly allowed with the `reindex.remote.whitelist` setting.\nIt can be set to a comma delimited list of allowed remote host and port combinations.\nScheme is ignored; only the host and port are used.\nFor example:\n\n```\nreindex.remote.whitelist: [otherhost:9200, another:9200, 127.0.10.*:9200, localhost:*\"]\n```\n\nThe list of allowed hosts must be configured on any nodes that will coordinate the reindex.\nThis feature should work with remote clusters of any version of Elasticsearch.\nThis should enable you to upgrade from any version of Elasticsearch to the current version by reindexing from a cluster of the old version.\n\nWARNING: Elasticsearch does not support forward compatibility across major versions.\nFor example, you cannot reindex from a 7.x cluster into a 6.x cluster.\n\nTo enable queries sent to older versions of Elasticsearch, the `query` parameter is sent directly to the remote host without validation or modification.\n\nNOTE: Reindexing from remote clusters does not support manual or automatic slicing.\n\nReindexing from a remote server uses an on-heap buffer that defaults to a maximum size of 100mb.\nIf the remote index includes very large documents you'll need to use a smaller batch size.\nIt is also possible to set the socket read timeout on the remote connection with the `socket_timeout` field and the connection timeout with the `connect_timeout` field.\nBoth default to 30 seconds.\n\n**Configuring SSL parameters**\n\nReindex from remote supports configurable SSL settings.\nThese must be specified in the `elasticsearch.yml` file, with the exception of the secure settings, which you add in the Elasticsearch keystore.\nIt is not possible to configure SSL in the body of the reindex request.", + "description": "Reindex documents.\n\nCopy documents from a source to a destination.\nYou can copy all documents to the destination index or reindex a subset of the documents.\nThe source can be any existing index, alias, or data stream.\nThe destination must differ from the source.\nFor example, you cannot reindex a data stream into itself.\n\nIMPORTANT: Reindex requires `_source` to be enabled for all documents in the source.\nThe destination should be configured as wanted before calling the reindex API.\nReindex does not copy the settings from the source or its associated template.\nMappings, shard counts, and replicas, for example, must be configured ahead of time.\n\nIf the Elasticsearch security features are enabled, you must have the following security privileges:\n\n* The `read` index privilege for the source data stream, index, or alias.\n* The `write` index privilege for the destination data stream, index, or index alias.\n* To automatically create a data stream or index with a reindex API request, you must have the `auto_configure`, `create_index`, or `manage` index privilege for the destination data stream, index, or alias.\n* If reindexing from a remote cluster, the `source.remote.user` must have the `monitor` cluster privilege and the `read` index privilege for the source data stream, index, or alias.\n\nIf reindexing from a remote cluster, you must explicitly allow the remote host in the `reindex.remote.whitelist` setting.\nAutomatic data stream creation requires a matching index template with data stream enabled.\n\nThe `dest` element can be configured like the index API to control optimistic concurrency control.\nOmitting `version_type` or setting it to `internal` causes Elasticsearch to blindly dump documents into the destination, overwriting any that happen to have the same ID.\n\nSetting `version_type` to `external` causes Elasticsearch to preserve the `version` from the source, create any documents that are missing, and update any documents that have an older version in the destination than they do in the source.\n\nSetting `op_type` to `create` causes the reindex API to create only missing documents in the destination.\nAll existing documents will cause a version conflict.\n\nIMPORTANT: Because data streams are append-only, any reindex request to a destination data stream must have an `op_type` of `create`.\nA reindex can only add new documents to a destination data stream.\nIt cannot update existing documents in a destination data stream.\n\nBy default, version conflicts abort the reindex process.\nTo continue reindexing if there are conflicts, set the `conflicts` request body property to `proceed`.\nIn this case, the response includes a count of the version conflicts that were encountered.\nNote that the handling of other error types is unaffected by the `conflicts` property.\nAdditionally, if you opt to count version conflicts, the operation could attempt to reindex more documents from the source than `max_docs` until it has successfully indexed `max_docs` documents into the target or it has gone through every document in the source query.\n\nRefer to the linked documentation for examples of how to reindex documents.", "docId": "docs-reindex", "docTag": "document", "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-reindex", + "extDocId": "reindex-indices", + "extDocUrl": "https://www.elastic.co/docs/reference/elasticsearch/rest-apis/reindex-indices", "name": "reindex", "privileges": { "index": [ @@ -22068,6 +22070,8 @@ "description": "Find the structure of a text file.\nThe text file must contain data that is suitable to be ingested into Elasticsearch.\n\nThis API provides a starting point for ingesting data into Elasticsearch in a format that is suitable for subsequent use with other Elastic Stack functionality.\nUnlike other Elasticsearch endpoints, the data that is posted to this endpoint does not need to be UTF-8 encoded and in JSON format.\nIt must, however, be text; binary text formats are not currently supported.\nThe size is limited to the Elasticsearch HTTP receive buffer size, which defaults to 100 Mb.\n\nThe response from the API contains:\n\n* A couple of messages from the beginning of the text.\n* Statistics that reveal the most common values for all fields detected within the text and basic numeric statistics for numeric fields.\n* Information about the structure of the text, which is useful when you write ingest configurations to index it or similarly formatted text.\n* Appropriate mappings for an Elasticsearch index, which you could use to ingest the text.\n\nAll this information can be calculated by the structure finder with no guidance.\nHowever, you can optionally override some of the decisions about the text structure by specifying one or more query parameters.", "docId": "find-structure", "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-text-structure-find-structure", + "extDocId": "find-text-structure-examples", + "extDocUrl": "https://www.elastic.co/docs/reference/elasticsearch/rest-apis/find-text-structure-examples", "name": "text_structure.find_structure", "privileges": { "cluster": [ @@ -34516,7 +34520,7 @@ } ] }, - "description": "Reindex documents.\n\nCopy documents from a source to a destination.\nYou can copy all documents to the destination index or reindex a subset of the documents.\nThe source can be any existing index, alias, or data stream.\nThe destination must differ from the source.\nFor example, you cannot reindex a data stream into itself.\n\nIMPORTANT: Reindex requires `_source` to be enabled for all documents in the source.\nThe destination should be configured as wanted before calling the reindex API.\nReindex does not copy the settings from the source or its associated template.\nMappings, shard counts, and replicas, for example, must be configured ahead of time.\n\nIf the Elasticsearch security features are enabled, you must have the following security privileges:\n\n* The `read` index privilege for the source data stream, index, or alias.\n* The `write` index privilege for the destination data stream, index, or index alias.\n* To automatically create a data stream or index with a reindex API request, you must have the `auto_configure`, `create_index`, or `manage` index privilege for the destination data stream, index, or alias.\n* If reindexing from a remote cluster, the `source.remote.user` must have the `monitor` cluster privilege and the `read` index privilege for the source data stream, index, or alias.\n\nIf reindexing from a remote cluster, you must explicitly allow the remote host in the `reindex.remote.whitelist` setting.\nAutomatic data stream creation requires a matching index template with data stream enabled.\n\nThe `dest` element can be configured like the index API to control optimistic concurrency control.\nOmitting `version_type` or setting it to `internal` causes Elasticsearch to blindly dump documents into the destination, overwriting any that happen to have the same ID.\n\nSetting `version_type` to `external` causes Elasticsearch to preserve the `version` from the source, create any documents that are missing, and update any documents that have an older version in the destination than they do in the source.\n\nSetting `op_type` to `create` causes the reindex API to create only missing documents in the destination.\nAll existing documents will cause a version conflict.\n\nIMPORTANT: Because data streams are append-only, any reindex request to a destination data stream must have an `op_type` of `create`.\nA reindex can only add new documents to a destination data stream.\nIt cannot update existing documents in a destination data stream.\n\nBy default, version conflicts abort the reindex process.\nTo continue reindexing if there are conflicts, set the `conflicts` request body property to `proceed`.\nIn this case, the response includes a count of the version conflicts that were encountered.\nNote that the handling of other error types is unaffected by the `conflicts` property.\nAdditionally, if you opt to count version conflicts, the operation could attempt to reindex more documents from the source than `max_docs` until it has successfully indexed `max_docs` documents into the target or it has gone through every document in the source query.\n\nNOTE: The reindex API makes no effort to handle ID collisions.\nThe last document written will \"win\" but the order isn't usually predictable so it is not a good idea to rely on this behavior.\nInstead, make sure that IDs are unique by using a script.\n\n**Running reindex asynchronously**\n\nIf the request contains `wait_for_completion=false`, Elasticsearch performs some preflight checks, launches the request, and returns a task you can use to cancel or get the status of the task.\nElasticsearch creates a record of this task as a document at `_tasks/`.\n\n**Reindex from multiple sources**\n\nIf you have many sources to reindex it is generally better to reindex them one at a time rather than using a glob pattern to pick up multiple sources.\nThat way you can resume the process if there are any errors by removing the partially completed source and starting over.\nIt also makes parallelizing the process fairly simple: split the list of sources to reindex and run each list in parallel.\n\nFor example, you can use a bash script like this:\n\n```\nfor index in i1 i2 i3 i4 i5; do\n curl -HContent-Type:application/json -XPOST localhost:9200/_reindex?pretty -d'{\n \"source\": {\n \"index\": \"'$index'\"\n },\n \"dest\": {\n \"index\": \"'$index'-reindexed\"\n }\n }'\ndone\n```\n\n**Throttling**\n\nSet `requests_per_second` to any positive decimal number (`1.4`, `6`, `1000`, for example) to throttle the rate at which reindex issues batches of index operations.\nRequests are throttled by padding each batch with a wait time.\nTo turn off throttling, set `requests_per_second` to `-1`.\n\nThe throttling is done by waiting between batches so that the scroll that reindex uses internally can be given a timeout that takes into account the padding.\nThe padding time is the difference between the batch size divided by the `requests_per_second` and the time spent writing.\nBy default the batch size is `1000`, so if `requests_per_second` is set to `500`:\n\n```\ntarget_time = 1000 / 500 per second = 2 seconds\nwait_time = target_time - write_time = 2 seconds - .5 seconds = 1.5 seconds\n```\n\nSince the batch is issued as a single bulk request, large batch sizes cause Elasticsearch to create many requests and then wait for a while before starting the next set.\nThis is \"bursty\" instead of \"smooth\".\n\n**Slicing**\n\nReindex supports sliced scroll to parallelize the reindexing process.\nThis parallelization can improve efficiency and provide a convenient way to break the request down into smaller parts.\n\nNOTE: Reindexing from remote clusters does not support manual or automatic slicing.\n\nYou can slice a reindex request manually by providing a slice ID and total number of slices to each request.\nYou can also let reindex automatically parallelize by using sliced scroll to slice on `_id`.\nThe `slices` parameter specifies the number of slices to use.\n\nAdding `slices` to the reindex request just automates the manual process, creating sub-requests which means it has some quirks:\n\n* You can see these requests in the tasks API. These sub-requests are \"child\" tasks of the task for the request with slices.\n* Fetching the status of the task for the request with `slices` only contains the status of completed slices.\n* These sub-requests are individually addressable for things like cancellation and rethrottling.\n* Rethrottling the request with `slices` will rethrottle the unfinished sub-request proportionally.\n* Canceling the request with `slices` will cancel each sub-request.\n* Due to the nature of `slices`, each sub-request won't get a perfectly even portion of the documents. All documents will be addressed, but some slices may be larger than others. Expect larger slices to have a more even distribution.\n* Parameters like `requests_per_second` and `max_docs` on a request with `slices` are distributed proportionally to each sub-request. Combine that with the previous point about distribution being uneven and you should conclude that using `max_docs` with `slices` might not result in exactly `max_docs` documents being reindexed.\n* Each sub-request gets a slightly different snapshot of the source, though these are all taken at approximately the same time.\n\nIf slicing automatically, setting `slices` to `auto` will choose a reasonable number for most indices.\nIf slicing manually or otherwise tuning automatic slicing, use the following guidelines.\n\nQuery performance is most efficient when the number of slices is equal to the number of shards in the index.\nIf that number is large (for example, `500`), choose a lower number as too many slices will hurt performance.\nSetting slices higher than the number of shards generally does not improve efficiency and adds overhead.\n\nIndexing performance scales linearly across available resources with the number of slices.\n\nWhether query or indexing performance dominates the runtime depends on the documents being reindexed and cluster resources.\n\n**Modify documents during reindexing**\n\nLike `_update_by_query`, reindex operations support a script that modifies the document.\nUnlike `_update_by_query`, the script is allowed to modify the document's metadata.\n\nJust as in `_update_by_query`, you can set `ctx.op` to change the operation that is run on the destination.\nFor example, set `ctx.op` to `noop` if your script decides that the document doesn’t have to be indexed in the destination. This \"no operation\" will be reported in the `noop` counter in the response body.\nSet `ctx.op` to `delete` if your script decides that the document must be deleted from the destination.\nThe deletion will be reported in the `deleted` counter in the response body.\nSetting `ctx.op` to anything else will return an error, as will setting any other field in `ctx`.\n\nThink of the possibilities! Just be careful; you are able to change:\n\n* `_id`\n* `_index`\n* `_version`\n* `_routing`\n\nSetting `_version` to `null` or clearing it from the `ctx` map is just like not sending the version in an indexing request.\nIt will cause the document to be overwritten in the destination regardless of the version on the target or the version type you use in the reindex API.\n\n**Reindex from remote**\n\nReindex supports reindexing from a remote Elasticsearch cluster.\nThe `host` parameter must contain a scheme, host, port, and optional path.\nThe `username` and `password` parameters are optional and when they are present the reindex operation will connect to the remote Elasticsearch node using basic authentication.\nBe sure to use HTTPS when using basic authentication or the password will be sent in plain text.\nThere are a range of settings available to configure the behavior of the HTTPS connection.\n\nWhen using Elastic Cloud, it is also possible to authenticate against the remote cluster through the use of a valid API key.\nRemote hosts must be explicitly allowed with the `reindex.remote.whitelist` setting.\nIt can be set to a comma delimited list of allowed remote host and port combinations.\nScheme is ignored; only the host and port are used.\nFor example:\n\n```\nreindex.remote.whitelist: [otherhost:9200, another:9200, 127.0.10.*:9200, localhost:*\"]\n```\n\nThe list of allowed hosts must be configured on any nodes that will coordinate the reindex.\nThis feature should work with remote clusters of any version of Elasticsearch.\nThis should enable you to upgrade from any version of Elasticsearch to the current version by reindexing from a cluster of the old version.\n\nWARNING: Elasticsearch does not support forward compatibility across major versions.\nFor example, you cannot reindex from a 7.x cluster into a 6.x cluster.\n\nTo enable queries sent to older versions of Elasticsearch, the `query` parameter is sent directly to the remote host without validation or modification.\n\nNOTE: Reindexing from remote clusters does not support manual or automatic slicing.\n\nReindexing from a remote server uses an on-heap buffer that defaults to a maximum size of 100mb.\nIf the remote index includes very large documents you'll need to use a smaller batch size.\nIt is also possible to set the socket read timeout on the remote connection with the `socket_timeout` field and the connection timeout with the `connect_timeout` field.\nBoth default to 30 seconds.\n\n**Configuring SSL parameters**\n\nReindex from remote supports configurable SSL settings.\nThese must be specified in the `elasticsearch.yml` file, with the exception of the secure settings, which you add in the Elasticsearch keystore.\nIt is not possible to configure SSL in the body of the reindex request.", + "description": "Reindex documents.\n\nCopy documents from a source to a destination.\nYou can copy all documents to the destination index or reindex a subset of the documents.\nThe source can be any existing index, alias, or data stream.\nThe destination must differ from the source.\nFor example, you cannot reindex a data stream into itself.\n\nIMPORTANT: Reindex requires `_source` to be enabled for all documents in the source.\nThe destination should be configured as wanted before calling the reindex API.\nReindex does not copy the settings from the source or its associated template.\nMappings, shard counts, and replicas, for example, must be configured ahead of time.\n\nIf the Elasticsearch security features are enabled, you must have the following security privileges:\n\n* The `read` index privilege for the source data stream, index, or alias.\n* The `write` index privilege for the destination data stream, index, or index alias.\n* To automatically create a data stream or index with a reindex API request, you must have the `auto_configure`, `create_index`, or `manage` index privilege for the destination data stream, index, or alias.\n* If reindexing from a remote cluster, the `source.remote.user` must have the `monitor` cluster privilege and the `read` index privilege for the source data stream, index, or alias.\n\nIf reindexing from a remote cluster, you must explicitly allow the remote host in the `reindex.remote.whitelist` setting.\nAutomatic data stream creation requires a matching index template with data stream enabled.\n\nThe `dest` element can be configured like the index API to control optimistic concurrency control.\nOmitting `version_type` or setting it to `internal` causes Elasticsearch to blindly dump documents into the destination, overwriting any that happen to have the same ID.\n\nSetting `version_type` to `external` causes Elasticsearch to preserve the `version` from the source, create any documents that are missing, and update any documents that have an older version in the destination than they do in the source.\n\nSetting `op_type` to `create` causes the reindex API to create only missing documents in the destination.\nAll existing documents will cause a version conflict.\n\nIMPORTANT: Because data streams are append-only, any reindex request to a destination data stream must have an `op_type` of `create`.\nA reindex can only add new documents to a destination data stream.\nIt cannot update existing documents in a destination data stream.\n\nBy default, version conflicts abort the reindex process.\nTo continue reindexing if there are conflicts, set the `conflicts` request body property to `proceed`.\nIn this case, the response includes a count of the version conflicts that were encountered.\nNote that the handling of other error types is unaffected by the `conflicts` property.\nAdditionally, if you opt to count version conflicts, the operation could attempt to reindex more documents from the source than `max_docs` until it has successfully indexed `max_docs` documents into the target or it has gone through every document in the source query.\n\nRefer to the linked documentation for examples of how to reindex documents.", "examples": { "ReindexRequestExample1": { "alternatives": [ @@ -34545,342 +34549,6 @@ "method_request": "POST _reindex", "summary": "Reindex multiple sources", "value": "{\n \"source\": {\n \"index\": [\"my-index-000001\", \"my-index-000002\"]\n },\n \"dest\": {\n \"index\": \"my-new-index-000002\"\n }\n}" - }, - "ReindexRequestExample10": { - "alternatives": [ - { - "code": "resp = client.reindex(\n source={\n \"index\": \"metricbeat-*\"\n },\n dest={\n \"index\": \"metricbeat\"\n },\n script={\n \"lang\": \"painless\",\n \"source\": \"ctx._index = 'metricbeat-' + (ctx._index.substring('metricbeat-'.length(), ctx._index.length())) + '-1'\"\n },\n)", - "language": "Python" - }, - { - "code": "const response = await client.reindex({\n source: {\n index: \"metricbeat-*\",\n },\n dest: {\n index: \"metricbeat\",\n },\n script: {\n lang: \"painless\",\n source:\n \"ctx._index = 'metricbeat-' + (ctx._index.substring('metricbeat-'.length(), ctx._index.length())) + '-1'\",\n },\n});", - "language": "JavaScript" - }, - { - "code": "response = client.reindex(\n body: {\n \"source\": {\n \"index\": \"metricbeat-*\"\n },\n \"dest\": {\n \"index\": \"metricbeat\"\n },\n \"script\": {\n \"lang\": \"painless\",\n \"source\": \"ctx._index = 'metricbeat-' + (ctx._index.substring('metricbeat-'.length(), ctx._index.length())) + '-1'\"\n }\n }\n)", - "language": "Ruby" - }, - { - "code": "$resp = $client->reindex([\n \"body\" => [\n \"source\" => [\n \"index\" => \"metricbeat-*\",\n ],\n \"dest\" => [\n \"index\" => \"metricbeat\",\n ],\n \"script\" => [\n \"lang\" => \"painless\",\n \"source\" => \"ctx._index = 'metricbeat-' + (ctx._index.substring('metricbeat-'.length(), ctx._index.length())) + '-1'\",\n ],\n ],\n]);", - "language": "PHP" - }, - { - "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"metricbeat-*\"},\"dest\":{\"index\":\"metricbeat\"},\"script\":{\"lang\":\"painless\",\"source\":\"ctx._index = '\"'\"'metricbeat-'\"'\"' + (ctx._index.substring('\"'\"'metricbeat-'\"'\"'.length(), ctx._index.length())) + '\"'\"'-1'\"'\"'\"}}' \"$ELASTICSEARCH_URL/_reindex\"", - "language": "curl" - } - ], - "description": "You can use Painless to reindex daily indices to apply a new template to the existing documents. The script extracts the date from the index name and creates a new index with `-1` appended. For example, all data from `metricbeat-2016.05.31` will be reindexed into `metricbeat-2016.05.31-1`.\n", - "method_request": "POST _reindex", - "summary": "Reindex with Painless", - "value": "{\n \"source\": {\n \"index\": \"metricbeat-*\"\n },\n \"dest\": {\n \"index\": \"metricbeat\"\n },\n \"script\": {\n \"lang\": \"painless\",\n \"source\": \"ctx._index = 'metricbeat-' + (ctx._index.substring('metricbeat-'.length(), ctx._index.length())) + '-1'\"\n }\n}" - }, - "ReindexRequestExample11": { - "alternatives": [ - { - "code": "resp = client.reindex(\n max_docs=10,\n source={\n \"index\": \"my-index-000001\",\n \"query\": {\n \"function_score\": {\n \"random_score\": {},\n \"min_score\": 0.9\n }\n }\n },\n dest={\n \"index\": \"my-new-index-000001\"\n },\n)", - "language": "Python" - }, - { - "code": "const response = await client.reindex({\n max_docs: 10,\n source: {\n index: \"my-index-000001\",\n query: {\n function_score: {\n random_score: {},\n min_score: 0.9,\n },\n },\n },\n dest: {\n index: \"my-new-index-000001\",\n },\n});", - "language": "JavaScript" - }, - { - "code": "response = client.reindex(\n body: {\n \"max_docs\": 10,\n \"source\": {\n \"index\": \"my-index-000001\",\n \"query\": {\n \"function_score\": {\n \"random_score\": {},\n \"min_score\": 0.9\n }\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n }\n)", - "language": "Ruby" - }, - { - "code": "$resp = $client->reindex([\n \"body\" => [\n \"max_docs\" => 10,\n \"source\" => [\n \"index\" => \"my-index-000001\",\n \"query\" => [\n \"function_score\" => [\n \"random_score\" => new ArrayObject([]),\n \"min_score\" => 0.9,\n ],\n ],\n ],\n \"dest\" => [\n \"index\" => \"my-new-index-000001\",\n ],\n ],\n]);", - "language": "PHP" - }, - { - "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"max_docs\":10,\"source\":{\"index\":\"my-index-000001\",\"query\":{\"function_score\":{\"random_score\":{},\"min_score\":0.9}}},\"dest\":{\"index\":\"my-new-index-000001\"}}' \"$ELASTICSEARCH_URL/_reindex\"", - "language": "curl" - } - ], - "description": "Run `POST _reindex` to extract a random subset of the source for testing. You might need to adjust the `min_score` value depending on the relative amount of data extracted from source.\n", - "method_request": "POST _reindex", - "summary": "Reindex a random subset", - "value": "{\n \"max_docs\": 10,\n \"source\": {\n \"index\": \"my-index-000001\",\n \"query\": {\n \"function_score\" : {\n \"random_score\" : {},\n \"min_score\" : 0.9\n }\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - }, - "ReindexRequestExample12": { - "alternatives": [ - { - "code": "resp = client.reindex(\n source={\n \"index\": \"my-index-000001\"\n },\n dest={\n \"index\": \"my-new-index-000001\",\n \"version_type\": \"external\"\n },\n script={\n \"source\": \"if (ctx._source.foo == 'bar') {ctx._version++; ctx._source.remove('foo')}\",\n \"lang\": \"painless\"\n },\n)", - "language": "Python" - }, - { - "code": "const response = await client.reindex({\n source: {\n index: \"my-index-000001\",\n },\n dest: {\n index: \"my-new-index-000001\",\n version_type: \"external\",\n },\n script: {\n source:\n \"if (ctx._source.foo == 'bar') {ctx._version++; ctx._source.remove('foo')}\",\n lang: \"painless\",\n },\n});", - "language": "JavaScript" - }, - { - "code": "response = client.reindex(\n body: {\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\",\n \"version_type\": \"external\"\n },\n \"script\": {\n \"source\": \"if (ctx._source.foo == 'bar') {ctx._version++; ctx._source.remove('foo')}\",\n \"lang\": \"painless\"\n }\n }\n)", - "language": "Ruby" - }, - { - "code": "$resp = $client->reindex([\n \"body\" => [\n \"source\" => [\n \"index\" => \"my-index-000001\",\n ],\n \"dest\" => [\n \"index\" => \"my-new-index-000001\",\n \"version_type\" => \"external\",\n ],\n \"script\" => [\n \"source\" => \"if (ctx._source.foo == 'bar') {ctx._version++; ctx._source.remove('foo')}\",\n \"lang\" => \"painless\",\n ],\n ],\n]);", - "language": "PHP" - }, - { - "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"my-index-000001\"},\"dest\":{\"index\":\"my-new-index-000001\",\"version_type\":\"external\"},\"script\":{\"source\":\"if (ctx._source.foo == '\"'\"'bar'\"'\"') {ctx._version++; ctx._source.remove('\"'\"'foo'\"'\"')}\",\"lang\":\"painless\"}}' \"$ELASTICSEARCH_URL/_reindex\"", - "language": "curl" - } - ], - "description": "Run `POST _reindex` to modify documents during reindexing. This example bumps the version of the source document.\n", - "method_request": "POST _reindex", - "summary": "Reindex modified documents", - "value": "{\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\",\n \"version_type\": \"external\"\n },\n \"script\": {\n \"source\": \"if (ctx._source.foo == 'bar') {ctx._version++; ctx._source.remove('foo')}\",\n \"lang\": \"painless\"\n }\n}" - }, - "ReindexRequestExample13": { - "alternatives": [ - { - "code": "resp = client.reindex(\n source={\n \"remote\": {\n \"host\": \"http://otherhost:9200\",\n \"username\": \"user\",\n \"password\": \"pass\"\n },\n \"index\": \"my-index-000001\",\n \"query\": {\n \"match\": {\n \"test\": \"data\"\n }\n }\n },\n dest={\n \"index\": \"my-new-index-000001\"\n },\n)", - "language": "Python" - }, - { - "code": "const response = await client.reindex({\n source: {\n remote: {\n host: \"http://otherhost:9200\",\n username: \"user\",\n password: \"pass\",\n },\n index: \"my-index-000001\",\n query: {\n match: {\n test: \"data\",\n },\n },\n },\n dest: {\n index: \"my-new-index-000001\",\n },\n});", - "language": "JavaScript" - }, - { - "code": "response = client.reindex(\n body: {\n \"source\": {\n \"remote\": {\n \"host\": \"http://otherhost:9200\",\n \"username\": \"user\",\n \"password\": \"pass\"\n },\n \"index\": \"my-index-000001\",\n \"query\": {\n \"match\": {\n \"test\": \"data\"\n }\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n }\n)", - "language": "Ruby" - }, - { - "code": "$resp = $client->reindex([\n \"body\" => [\n \"source\" => [\n \"remote\" => [\n \"host\" => \"http://otherhost:9200\",\n \"username\" => \"user\",\n \"password\" => \"pass\",\n ],\n \"index\" => \"my-index-000001\",\n \"query\" => [\n \"match\" => [\n \"test\" => \"data\",\n ],\n ],\n ],\n \"dest\" => [\n \"index\" => \"my-new-index-000001\",\n ],\n ],\n]);", - "language": "PHP" - }, - { - "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"remote\":{\"host\":\"http://otherhost:9200\",\"username\":\"user\",\"password\":\"pass\"},\"index\":\"my-index-000001\",\"query\":{\"match\":{\"test\":\"data\"}}},\"dest\":{\"index\":\"my-new-index-000001\"}}' \"$ELASTICSEARCH_URL/_reindex\"", - "language": "curl" - } - ], - "description": "When using Elastic Cloud, you can run `POST _reindex` and authenticate against a remote cluster with an API key.\n", - "method_request": "POST _reindex", - "summary": "Reindex from remote on Elastic Cloud", - "value": "{\n \"source\": {\n \"remote\": {\n \"host\": \"http://otherhost:9200\",\n \"username\": \"user\",\n \"password\": \"pass\"\n },\n \"index\": \"my-index-000001\",\n \"query\": {\n \"match\": {\n \"test\": \"data\"\n }\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - }, - "ReindexRequestExample2": { - "alternatives": [ - { - "code": "resp = client.reindex(\n source={\n \"index\": \"my-index-000001\",\n \"slice\": {\n \"id\": 0,\n \"max\": 2\n }\n },\n dest={\n \"index\": \"my-new-index-000001\"\n },\n)", - "language": "Python" - }, - { - "code": "const response = await client.reindex({\n source: {\n index: \"my-index-000001\",\n slice: {\n id: 0,\n max: 2,\n },\n },\n dest: {\n index: \"my-new-index-000001\",\n },\n});", - "language": "JavaScript" - }, - { - "code": "response = client.reindex(\n body: {\n \"source\": {\n \"index\": \"my-index-000001\",\n \"slice\": {\n \"id\": 0,\n \"max\": 2\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n }\n)", - "language": "Ruby" - }, - { - "code": "$resp = $client->reindex([\n \"body\" => [\n \"source\" => [\n \"index\" => \"my-index-000001\",\n \"slice\" => [\n \"id\" => 0,\n \"max\" => 2,\n ],\n ],\n \"dest\" => [\n \"index\" => \"my-new-index-000001\",\n ],\n ],\n]);", - "language": "PHP" - }, - { - "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"my-index-000001\",\"slice\":{\"id\":0,\"max\":2}},\"dest\":{\"index\":\"my-new-index-000001\"}}' \"$ELASTICSEARCH_URL/_reindex\"", - "language": "curl" - } - ], - "description": "Run `POST _reindex` to slice a reindex request manually. Provide a slice ID and total number of slices to each request.\n", - "method_request": "POST _reindex", - "summary": "Manual slicing", - "value": "{\n \"source\": {\n \"index\": \"my-index-000001\",\n \"slice\": {\n \"id\": 0,\n \"max\": 2\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - }, - "ReindexRequestExample3": { - "alternatives": [ - { - "code": "resp = client.reindex(\n slices=\"5\",\n refresh=True,\n source={\n \"index\": \"my-index-000001\"\n },\n dest={\n \"index\": \"my-new-index-000001\"\n },\n)", - "language": "Python" - }, - { - "code": "const response = await client.reindex({\n slices: 5,\n refresh: \"true\",\n source: {\n index: \"my-index-000001\",\n },\n dest: {\n index: \"my-new-index-000001\",\n },\n});", - "language": "JavaScript" - }, - { - "code": "response = client.reindex(\n slices: \"5\",\n refresh: \"true\",\n body: {\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n }\n)", - "language": "Ruby" - }, - { - "code": "$resp = $client->reindex([\n \"slices\" => \"5\",\n \"refresh\" => \"true\",\n \"body\" => [\n \"source\" => [\n \"index\" => \"my-index-000001\",\n ],\n \"dest\" => [\n \"index\" => \"my-new-index-000001\",\n ],\n ],\n]);", - "language": "PHP" - }, - { - "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"my-index-000001\"},\"dest\":{\"index\":\"my-new-index-000001\"}}' \"$ELASTICSEARCH_URL/_reindex?slices=5&refresh\"", - "language": "curl" - } - ], - "description": "Run `POST _reindex?slices=5&refresh` to automatically parallelize using sliced scroll to slice on `_id`. The `slices` parameter specifies the number of slices to use.\n", - "method_request": "POST _reindex?slices=5&refresh", - "summary": "Automatic slicing", - "value": "{\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - }, - "ReindexRequestExample4": { - "alternatives": [ - { - "code": "resp = client.reindex(\n source={\n \"index\": \"source\",\n \"query\": {\n \"match\": {\n \"company\": \"cat\"\n }\n }\n },\n dest={\n \"index\": \"dest\",\n \"routing\": \"=cat\"\n },\n)", - "language": "Python" - }, - { - "code": "const response = await client.reindex({\n source: {\n index: \"source\",\n query: {\n match: {\n company: \"cat\",\n },\n },\n },\n dest: {\n index: \"dest\",\n routing: \"=cat\",\n },\n});", - "language": "JavaScript" - }, - { - "code": "response = client.reindex(\n body: {\n \"source\": {\n \"index\": \"source\",\n \"query\": {\n \"match\": {\n \"company\": \"cat\"\n }\n }\n },\n \"dest\": {\n \"index\": \"dest\",\n \"routing\": \"=cat\"\n }\n }\n)", - "language": "Ruby" - }, - { - "code": "$resp = $client->reindex([\n \"body\" => [\n \"source\" => [\n \"index\" => \"source\",\n \"query\" => [\n \"match\" => [\n \"company\" => \"cat\",\n ],\n ],\n ],\n \"dest\" => [\n \"index\" => \"dest\",\n \"routing\" => \"=cat\",\n ],\n ],\n]);", - "language": "PHP" - }, - { - "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"source\",\"query\":{\"match\":{\"company\":\"cat\"}}},\"dest\":{\"index\":\"dest\",\"routing\":\"=cat\"}}' \"$ELASTICSEARCH_URL/_reindex\"", - "language": "curl" - } - ], - "description": "By default if reindex sees a document with routing then the routing is preserved unless it's changed by the script. You can set `routing` on the `dest` request to change this behavior. In this example, run `POST _reindex` to copy all documents from the `source` with the company name `cat` into the `dest` with routing set to `cat`.\n", - "method_request": "POST _reindex", - "summary": "Routing", - "value": "{\n \"source\": {\n \"index\": \"source\",\n \"query\": {\n \"match\": {\n \"company\": \"cat\"\n }\n }\n },\n \"dest\": {\n \"index\": \"dest\",\n \"routing\": \"=cat\"\n }\n}" - }, - "ReindexRequestExample5": { - "alternatives": [ - { - "code": "resp = client.reindex(\n source={\n \"index\": \"source\"\n },\n dest={\n \"index\": \"dest\",\n \"pipeline\": \"some_ingest_pipeline\"\n },\n)", - "language": "Python" - }, - { - "code": "const response = await client.reindex({\n source: {\n index: \"source\",\n },\n dest: {\n index: \"dest\",\n pipeline: \"some_ingest_pipeline\",\n },\n});", - "language": "JavaScript" - }, - { - "code": "response = client.reindex(\n body: {\n \"source\": {\n \"index\": \"source\"\n },\n \"dest\": {\n \"index\": \"dest\",\n \"pipeline\": \"some_ingest_pipeline\"\n }\n }\n)", - "language": "Ruby" - }, - { - "code": "$resp = $client->reindex([\n \"body\" => [\n \"source\" => [\n \"index\" => \"source\",\n ],\n \"dest\" => [\n \"index\" => \"dest\",\n \"pipeline\" => \"some_ingest_pipeline\",\n ],\n ],\n]);", - "language": "PHP" - }, - { - "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"source\"},\"dest\":{\"index\":\"dest\",\"pipeline\":\"some_ingest_pipeline\"}}' \"$ELASTICSEARCH_URL/_reindex\"", - "language": "curl" - } - ], - "description": "Run `POST _reindex` and use the ingest pipelines feature.", - "method_request": "POST _reindex", - "summary": "Ingest pipelines", - "value": "{\n \"source\": {\n \"index\": \"source\"\n },\n \"dest\": {\n \"index\": \"dest\",\n \"pipeline\": \"some_ingest_pipeline\"\n }\n}" - }, - "ReindexRequestExample6": { - "alternatives": [ - { - "code": "resp = client.reindex(\n source={\n \"index\": \"my-index-000001\",\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n },\n dest={\n \"index\": \"my-new-index-000001\"\n },\n)", - "language": "Python" - }, - { - "code": "const response = await client.reindex({\n source: {\n index: \"my-index-000001\",\n query: {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n },\n dest: {\n index: \"my-new-index-000001\",\n },\n});", - "language": "JavaScript" - }, - { - "code": "response = client.reindex(\n body: {\n \"source\": {\n \"index\": \"my-index-000001\",\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n }\n)", - "language": "Ruby" - }, - { - "code": "$resp = $client->reindex([\n \"body\" => [\n \"source\" => [\n \"index\" => \"my-index-000001\",\n \"query\" => [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ],\n \"dest\" => [\n \"index\" => \"my-new-index-000001\",\n ],\n ],\n]);", - "language": "PHP" - }, - { - "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"my-index-000001\",\"query\":{\"term\":{\"user.id\":\"kimchy\"}}},\"dest\":{\"index\":\"my-new-index-000001\"}}' \"$ELASTICSEARCH_URL/_reindex\"", - "language": "curl" - } - ], - "description": "Run `POST _reindex` and add a query to the `source` to limit the documents to reindex. For example, this request copies documents into `my-new-index-000001` only if they have a `user.id` of `kimchy`.\n", - "method_request": "POST _reindex", - "summary": "Reindex with a query", - "value": "{\n \"source\": {\n \"index\": \"my-index-000001\",\n \"query\": {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - }, - "ReindexRequestExample7": { - "alternatives": [ - { - "code": "resp = client.reindex(\n max_docs=1,\n source={\n \"index\": \"my-index-000001\"\n },\n dest={\n \"index\": \"my-new-index-000001\"\n },\n)", - "language": "Python" - }, - { - "code": "const response = await client.reindex({\n max_docs: 1,\n source: {\n index: \"my-index-000001\",\n },\n dest: {\n index: \"my-new-index-000001\",\n },\n});", - "language": "JavaScript" - }, - { - "code": "response = client.reindex(\n body: {\n \"max_docs\": 1,\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n }\n)", - "language": "Ruby" - }, - { - "code": "$resp = $client->reindex([\n \"body\" => [\n \"max_docs\" => 1,\n \"source\" => [\n \"index\" => \"my-index-000001\",\n ],\n \"dest\" => [\n \"index\" => \"my-new-index-000001\",\n ],\n ],\n]);", - "language": "PHP" - }, - { - "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"max_docs\":1,\"source\":{\"index\":\"my-index-000001\"},\"dest\":{\"index\":\"my-new-index-000001\"}}' \"$ELASTICSEARCH_URL/_reindex\"", - "language": "curl" - } - ], - "description": "You can limit the number of processed documents by setting `max_docs`. For example, run `POST _reindex` to copy a single document from `my-index-000001` to `my-new-index-000001`.\n", - "method_request": "POST _reindex", - "summary": "Reindex with max_docs", - "value": "{\n \"max_docs\": 1,\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - }, - "ReindexRequestExample8": { - "alternatives": [ - { - "code": "resp = client.reindex(\n source={\n \"index\": \"my-index-000001\",\n \"_source\": [\n \"user.id\",\n \"_doc\"\n ]\n },\n dest={\n \"index\": \"my-new-index-000001\"\n },\n)", - "language": "Python" - }, - { - "code": "const response = await client.reindex({\n source: {\n index: \"my-index-000001\",\n _source: [\"user.id\", \"_doc\"],\n },\n dest: {\n index: \"my-new-index-000001\",\n },\n});", - "language": "JavaScript" - }, - { - "code": "response = client.reindex(\n body: {\n \"source\": {\n \"index\": \"my-index-000001\",\n \"_source\": [\n \"user.id\",\n \"_doc\"\n ]\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n }\n)", - "language": "Ruby" - }, - { - "code": "$resp = $client->reindex([\n \"body\" => [\n \"source\" => [\n \"index\" => \"my-index-000001\",\n \"_source\" => array(\n \"user.id\",\n \"_doc\",\n ),\n ],\n \"dest\" => [\n \"index\" => \"my-new-index-000001\",\n ],\n ],\n]);", - "language": "PHP" - }, - { - "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"my-index-000001\",\"_source\":[\"user.id\",\"_doc\"]},\"dest\":{\"index\":\"my-new-index-000001\"}}' \"$ELASTICSEARCH_URL/_reindex\"", - "language": "curl" - } - ], - "description": "You can use source filtering to reindex a subset of the fields in the original documents. For example, run `POST _reindex` the reindex only the `user.id` and `_doc` fields of each document.\n", - "method_request": "POST _reindex", - "summary": "Reindex selected fields", - "value": "{\n \"source\": {\n \"index\": \"my-index-000001\",\n \"_source\": [\"user.id\", \"_doc\"]\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n }\n}" - }, - "ReindexRequestExample9": { - "alternatives": [ - { - "code": "resp = client.reindex(\n source={\n \"index\": \"my-index-000001\"\n },\n dest={\n \"index\": \"my-new-index-000001\"\n },\n script={\n \"source\": \"ctx._source.tag = ctx._source.remove(\\\"flag\\\")\"\n },\n)", - "language": "Python" - }, - { - "code": "const response = await client.reindex({\n source: {\n index: \"my-index-000001\",\n },\n dest: {\n index: \"my-new-index-000001\",\n },\n script: {\n source: 'ctx._source.tag = ctx._source.remove(\"flag\")',\n },\n});", - "language": "JavaScript" - }, - { - "code": "response = client.reindex(\n body: {\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n },\n \"script\": {\n \"source\": \"ctx._source.tag = ctx._source.remove(\\\"flag\\\")\"\n }\n }\n)", - "language": "Ruby" - }, - { - "code": "$resp = $client->reindex([\n \"body\" => [\n \"source\" => [\n \"index\" => \"my-index-000001\",\n ],\n \"dest\" => [\n \"index\" => \"my-new-index-000001\",\n ],\n \"script\" => [\n \"source\" => \"ctx._source.tag = ctx._source.remove(\\\"flag\\\")\",\n ],\n ],\n]);", - "language": "PHP" - }, - { - "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"my-index-000001\"},\"dest\":{\"index\":\"my-new-index-000001\"},\"script\":{\"source\":\"ctx._source.tag = ctx._source.remove(\\\"flag\\\")\"}}' \"$ELASTICSEARCH_URL/_reindex\"", - "language": "curl" - } - ], - "description": "A reindex operation can build a copy of an index with renamed fields. If your index has documents with `text` and `flag` fields, you can change the latter field name to `tag` during the reindex.\n", - "method_request": "POST _reindex", - "summary": "Reindex new field names", - "value": "{\n \"source\": {\n \"index\": \"my-index-000001\"\n },\n \"dest\": {\n \"index\": \"my-new-index-000001\"\n },\n \"script\": {\n \"source\": \"ctx._source.tag = ctx._source.remove(\\\"flag\\\")\"\n }\n}" } }, "inherits": { @@ -35001,7 +34669,7 @@ } } ], - "specLocation": "_global/reindex/ReindexRequest.ts#L27-L309" + "specLocation": "_global/reindex/ReindexRequest.ts#L27-L170" }, { "kind": "response", @@ -52985,8 +52653,7 @@ }, { "kind": "type_alias", - "docId": "node-roles", - "docUrl": "https://www.elastic.co/docs/reference/elasticsearch/configuration-reference/node-settings#node-roles", + "description": "* @doc_id node-roles", "name": { "name": "NodeRoles", "namespace": "_types" @@ -248895,7 +248562,7 @@ } } ], - "specLocation": "text_structure/find_structure/FindStructureRequest.ts#L24-L207" + "specLocation": "text_structure/find_structure/FindStructureRequest.ts#L24-L208" }, { "kind": "response",