diff --git a/compiler-rs/clients_schema_to_openapi/src/paths.rs b/compiler-rs/clients_schema_to_openapi/src/paths.rs index 22cf4f7a4d..18ad346bff 100644 --- a/compiler-rs/clients_schema_to_openapi/src/paths.rs +++ b/compiler-rs/clients_schema_to_openapi/src/paths.rs @@ -168,7 +168,7 @@ pub fn add_endpoint( let media = MediaType { schema: Some(schema), example: None, - examples: request_examples, + examples: request_examples.clone(), encoding: Default::default(), extensions: Default::default(), }; @@ -198,7 +198,7 @@ pub fn add_endpoint( // If this endpoint response has examples in schema.json, convert them to the // OpenAPI format and add them to the endpoint response in the OpenAPI document. let response_examples = if let Some(examples) = &response_def.examples { - get_openapi_examples(examples) + get_openapi_examples(examples) } else { IndexMap::new() }; @@ -251,6 +251,43 @@ pub fn add_endpoint( let sum_desc = split_summary_desc(&endpoint.description); + // add the x-state extension for availability + let mut extensions = crate::availability_as_extensions(&endpoint.availability); + + // add the x-codeSamples extension + if !request_examples.is_empty() { + let mut code_samples = vec![]; + if let Some((_, first_example)) = request_examples.clone().first() { + if let Some(example) = first_example.as_item() { + if let Some(description) = example.description.clone() { + let mut request: Option = Option::None; + for r in description.split('`') { + if r.starts_with("GET ") + || r.starts_with("POST ") + || r.starts_with("PUT ") + || r.starts_with("DELETE ") + || r.starts_with("HEAD ") + { + request = Some(String::from(r)); + break; + } + } + if let Some(first_line) = request { + if let Some(code) = example.value.clone() { + code_samples.push(serde_json::json!({ + "lang": "Console", + "source": first_line + "\n" + code.as_str().unwrap_or(""), + })); + } + } + } + } + } + if code_samples.len() > 0 { + extensions.insert("x-codeSamples".to_string(), serde_json::json!(code_samples)); + } + } + // Create the operation, it will be repeated if we have several methods let operation = openapiv3::Operation { tags: if let Some(doc_tag) = &endpoint.doc_tag { @@ -274,7 +311,7 @@ pub fn add_endpoint( deprecated: endpoint.deprecation.is_some(), security: None, servers: vec![], - extensions: crate::availability_as_extensions(&endpoint.availability), + extensions, }; 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 898e7ef0dd..e268be1364 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/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index ddb1d7bbb7..092b5d54f1 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -325,7 +325,13 @@ "$ref": "#/components/responses/async_search.submit-200" } }, - "x-state": "Added in 7.7.0" + "x-state": "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}" + } + ] } }, "/{index}/_async_search": { @@ -478,7 +484,13 @@ "$ref": "#/components/responses/async_search.submit-200" } }, - "x-state": "Added in 7.7.0" + "x-state": "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}" + } + ] } }, "/_autoscaling/policy/{name}": { @@ -794,7 +806,13 @@ "200": { "$ref": "#/components/responses/bulk-200" } - } + }, + "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\"} }" + } + ] }, "post": { "tags": [ @@ -848,7 +866,13 @@ "200": { "$ref": "#/components/responses/bulk-200" } - } + }, + "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\"} }" + } + ] } }, "/{index}/_bulk": { @@ -907,7 +931,13 @@ "200": { "$ref": "#/components/responses/bulk-200" } - } + }, + "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\"} }" + } + ] }, "post": { "tags": [ @@ -964,7 +994,13 @@ "200": { "$ref": "#/components/responses/bulk-200" } - } + }, + "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\"} }" + } + ] } }, "/_cat/aliases": { @@ -3014,7 +3050,13 @@ } } }, - "x-state": "Added in 6.5.0" + "x-state": "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}" + } + ] }, "delete": { "tags": [ @@ -3216,7 +3258,13 @@ } } }, - "x-state": "Added in 6.5.0" + "x-state": "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}" + } + ] } }, "/{index}/_ccr/info": { @@ -3448,7 +3496,13 @@ } } }, - "x-state": "Added in 6.7.0" + "x-state": "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}" + } + ] } }, "/_ccr/auto_follow": { @@ -3736,7 +3790,13 @@ } } }, - "x-state": "Added in 6.5.0" + "x-state": "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}" + } + ] } }, "/_ccr/stats": { @@ -3886,7 +3946,13 @@ "200": { "$ref": "#/components/responses/scroll-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "GET /_search/scroll\n{\n \"scroll_id\" : \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" + } + ] }, "post": { "tags": [ @@ -3916,7 +3982,13 @@ "200": { "$ref": "#/components/responses/scroll-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "GET /_search/scroll\n{\n \"scroll_id\" : \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" + } + ] }, "delete": { "tags": [ @@ -3935,7 +4007,13 @@ "200": { "$ref": "#/components/responses/clear_scroll-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "DELETE /_search/scroll\n{\n \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" + } + ] } }, "/_search/scroll/{scroll_id}": { @@ -3970,7 +4048,13 @@ "200": { "$ref": "#/components/responses/scroll-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "GET /_search/scroll\n{\n \"scroll_id\" : \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" + } + ] }, "post": { "tags": [ @@ -4003,7 +4087,13 @@ "200": { "$ref": "#/components/responses/scroll-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "GET /_search/scroll\n{\n \"scroll_id\" : \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" + } + ] }, "delete": { "tags": [ @@ -4027,7 +4117,13 @@ "200": { "$ref": "#/components/responses/clear_scroll-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "DELETE /_search/scroll\n{\n \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" + } + ] } }, "/_pit": { @@ -4093,7 +4189,13 @@ } } }, - "x-state": "Added in 7.10.0" + "x-state": "Added in 7.10.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "DELETE /_pit\n{\n \"id\": \"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\"\n}" + } + ] } }, "/_cluster/allocation/explain": { @@ -4123,7 +4225,13 @@ "$ref": "#/components/responses/cluster.allocation_explain-200" } }, - "x-state": "Added in 5.0.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -4151,7 +4259,13 @@ "$ref": "#/components/responses/cluster.allocation_explain-200" } }, - "x-state": "Added in 5.0.0" + "x-state": "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}" + } + ] } }, "/_component_template/{name}": { @@ -5053,7 +5167,13 @@ } } }, - "x-state": "Added in 5.0.0" + "x-state": "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}" + } + ] } }, "/_cluster/state": { @@ -7163,7 +7283,13 @@ "200": { "$ref": "#/components/responses/count-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "GET /my-index-000001/_count?q=user:kimchy\n{\n \"query\" : {\n \"term\" : { \"user.id\" : \"kimchy\" }\n }\n}" + } + ] }, "post": { "tags": [ @@ -7223,7 +7349,13 @@ "200": { "$ref": "#/components/responses/count-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "GET /my-index-000001/_count?q=user:kimchy\n{\n \"query\" : {\n \"term\" : { \"user.id\" : \"kimchy\" }\n }\n}" + } + ] } }, "/{index}/_count": { @@ -7288,7 +7420,13 @@ "200": { "$ref": "#/components/responses/count-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "GET /my-index-000001/_count?q=user:kimchy\n{\n \"query\" : {\n \"term\" : { \"user.id\" : \"kimchy\" }\n }\n}" + } + ] }, "post": { "tags": [ @@ -7351,7 +7489,13 @@ "200": { "$ref": "#/components/responses/count-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "GET /my-index-000001/_count?q=user:kimchy\n{\n \"query\" : {\n \"term\" : { \"user.id\" : \"kimchy\" }\n }\n}" + } + ] } }, "/{index}/_create/{id}": { @@ -7420,7 +7564,13 @@ "$ref": "#/components/responses/create-200" } }, - "x-state": "Added in 5.0.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -7487,7 +7637,13 @@ "$ref": "#/components/responses/create-200" } }, - "x-state": "Added in 5.0.0" + "x-state": "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}" + } + ] } }, "/_dangling/{index_uuid}": { @@ -7890,7 +8046,13 @@ "200": { "$ref": "#/components/responses/index-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -7953,7 +8115,13 @@ "200": { "$ref": "#/components/responses/index-200" } - } + }, + "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}" + } + ] }, "delete": { "tags": [ @@ -8666,7 +8834,13 @@ } } }, - "x-state": "Added in 5.0.0" + "x-state": "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}" + } + ] } }, "/_delete_by_query/{task_id}/_rethrottle": { @@ -8805,7 +8979,13 @@ "200": { "$ref": "#/components/responses/put_script-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -8838,7 +9018,13 @@ "200": { "$ref": "#/components/responses/put_script-200" } - } + }, + "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}" + } + ] }, "delete": { "tags": [ @@ -9382,7 +9568,13 @@ "$ref": "#/components/responses/eql.search-200" } }, - "x-state": "Added in 7.9.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -9431,7 +9623,13 @@ "$ref": "#/components/responses/eql.search-200" } }, - "x-state": "Added in 7.9.0" + "x-state": "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}" + } + ] } }, "/_query/async": { @@ -9978,7 +10176,13 @@ } } } - } + }, + "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}" + } + ] } }, "/{index}/_source/{id}": { @@ -10323,7 +10527,13 @@ "200": { "$ref": "#/components/responses/explain-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "GET /my-index-000001/_explain/0\n{\n \"query\" : {\n \"match\" : { \"message\" : \"elasticsearch\" }\n }\n}" + } + ] }, "post": { "tags": [ @@ -10383,7 +10593,13 @@ "200": { "$ref": "#/components/responses/explain-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "GET /my-index-000001/_explain/0\n{\n \"query\" : {\n \"match\" : { \"message\" : \"elasticsearch\" }\n }\n}" + } + ] } }, "/_features": { @@ -10535,7 +10751,13 @@ "$ref": "#/components/responses/field_caps-200" } }, - "x-state": "Added in 5.4.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -10578,7 +10800,13 @@ "$ref": "#/components/responses/field_caps-200" } }, - "x-state": "Added in 5.4.0" + "x-state": "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}" + } + ] } }, "/{index}/_field_caps": { @@ -10626,7 +10854,13 @@ "$ref": "#/components/responses/field_caps-200" } }, - "x-state": "Added in 5.4.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -10672,7 +10906,13 @@ "$ref": "#/components/responses/field_caps-200" } }, - "x-state": "Added in 5.4.0" + "x-state": "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}" + } + ] } }, "/{index}/_fleet/global_checkpoints": { @@ -11424,7 +11664,13 @@ "200": { "$ref": "#/components/responses/graph.explore-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -11454,7 +11700,13 @@ "200": { "$ref": "#/components/responses/graph.explore-200" } - } + }, + "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}" + } + ] } }, "/_health_report": { @@ -11620,7 +11872,13 @@ } } }, - "x-state": "Added in 6.6.0" + "x-state": "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}" + } + ] }, "delete": { "tags": [ @@ -11949,7 +12207,13 @@ } } }, - "x-state": "Added in 7.14.0" + "x-state": "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}" + } + ] } }, "/_ilm/move/{index}": { @@ -12024,7 +12288,13 @@ } } }, - "x-state": "Added in 6.6.0" + "x-state": "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}" + } + ] } }, "/{index}/_ilm/remove": { @@ -12281,7 +12551,13 @@ "200": { "$ref": "#/components/responses/index-200" } - } + }, + "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}" + } + ] } }, "/{index}/_block/{block}": { @@ -12666,7 +12942,13 @@ "$ref": "#/components/responses/indices.clone-200" } }, - "x-state": "Added in 7.4.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -12700,7 +12982,13 @@ "$ref": "#/components/responses/indices.clone-200" } }, - "x-state": "Added in 7.4.0" + "x-state": "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}" + } + ] } }, "/{index}/_close": { @@ -15330,7 +15618,13 @@ "200": { "$ref": "#/components/responses/indices.put_mapping-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "PUT /my-index-000001,my-index-000002/_mapping\n{\n \"properties\": {\n \"user\": {\n \"properties\": {\n \"name\": {\n \"type\": \"keyword\"\n }\n }\n }\n }\n}" + } + ] }, "post": { "tags": [ @@ -15372,7 +15666,13 @@ "200": { "$ref": "#/components/responses/indices.put_mapping-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "PUT /my-index-000001,my-index-000002/_mapping\n{\n \"properties\": {\n \"user\": {\n \"properties\": {\n \"name\": {\n \"type\": \"keyword\"\n }\n }\n }\n }\n}" + } + ] } }, "/_migration/reindex/{index}/_status": { @@ -17491,7 +17791,13 @@ } } }, - "x-state": "Added in 8.18.0" + "x-state": "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}" + } + ] } }, "/_inference/completion/{inference_id}": { @@ -17581,7 +17887,13 @@ } } }, - "x-state": "Added in 8.11.0" + "x-state": "Added in 8.11.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST _inference/completion/openai_chat_completions\n{\n \"input\": \"What is Elastic?\"\n}" + } + ] } }, "/_inference/{inference_id}": { @@ -17886,7 +18198,13 @@ } } }, - "x-state": "Added in 8.16.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{amazonbedrock_inference_id}": { @@ -17972,7 +18290,13 @@ } } }, - "x-state": "Added in 8.12.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{anthropic_inference_id}": { @@ -18052,7 +18376,13 @@ } } }, - "x-state": "Added in 8.16.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{azureaistudio_inference_id}": { @@ -18138,7 +18468,13 @@ } } }, - "x-state": "Added in 8.14.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{azureopenai_inference_id}": { @@ -18224,7 +18560,13 @@ } } }, - "x-state": "Added in 8.14.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{cohere_inference_id}": { @@ -18310,7 +18652,13 @@ } } }, - "x-state": "Added in 8.13.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{elasticsearch_inference_id}": { @@ -18422,7 +18770,13 @@ } } }, - "x-state": "Added in 8.13.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{elser_inference_id}": { @@ -18512,7 +18866,13 @@ } }, "deprecated": true, - "x-state": "Added in 8.11.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{googleaistudio_inference_id}": { @@ -18590,7 +18950,13 @@ } } }, - "x-state": "Added in 8.15.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{googlevertexai_inference_id}": { @@ -18676,7 +19042,13 @@ } } }, - "x-state": "Added in 8.15.0" + "x-state": "Added in 8.15.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "PUT _inference/text_embedding/google_vertex_ai_embeddings\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}" + } + ] } }, "/_inference/{task_type}/{huggingface_inference_id}": { @@ -18754,7 +19126,13 @@ } } }, - "x-state": "Added in 8.12.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{jinaai_inference_id}": { @@ -18840,7 +19218,13 @@ } } }, - "x-state": "Added in 8.18.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{mistral_inference_id}": { @@ -18917,7 +19301,13 @@ } } }, - "x-state": "Added in 8.15.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{openai_inference_id}": { @@ -19003,7 +19393,13 @@ } } }, - "x-state": "Added in 8.12.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{voyageai_inference_id}": { @@ -19089,7 +19485,13 @@ } } }, - "x-state": "Added in 8.19.0" + "x-state": "Added in 8.19.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "PUT _inference/text_embedding/voyageai-embeddings\n{\n \"service\": \"voyageai\",\n \"service_settings\": {\n \"model_id\": \"voyage-3-large\",\n \"dimensions\": 512\n }\n}" + } + ] } }, "/_inference/{task_type}/{watsonx_inference_id}": { @@ -19163,7 +19565,13 @@ } } }, - "x-state": "Added in 8.16.0" + "x-state": "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}" + } + ] } }, "/_inference/rerank/{inference_id}": { @@ -19258,7 +19666,13 @@ } } }, - "x-state": "Added in 8.11.0" + "x-state": "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}" + } + ] } }, "/_inference/sparse_embedding/{inference_id}": { @@ -19348,7 +19762,13 @@ } } }, - "x-state": "Added in 8.11.0" + "x-state": "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}" + } + ] } }, "/_inference/completion/{inference_id}/_stream": { @@ -19422,7 +19842,13 @@ } } }, - "x-state": "Added in 8.16.0" + "x-state": "Added in 8.16.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST _inference/completion/openai-completion/_stream\n{\n \"input\": \"What is Elastic?\"\n}" + } + ] } }, "/_inference/text_embedding/{inference_id}": { @@ -19512,7 +19938,13 @@ } } }, - "x-state": "Added in 8.11.0" + "x-state": "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}" + } + ] } }, "/_inference/{inference_id}/_update": { @@ -20451,7 +20883,13 @@ "200": { "$ref": "#/components/responses/license.post-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -20478,7 +20916,13 @@ "200": { "$ref": "#/components/responses/license.post-200" } - } + }, + "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}" + } + ] }, "delete": { "tags": [ @@ -20842,7 +21286,13 @@ } } }, - "x-state": "Added in 7.12.0" + "x-state": "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}" + } + ] }, "delete": { "tags": [ @@ -20939,7 +21389,13 @@ "$ref": "#/components/responses/mget-200" } }, - "x-state": "Added in 1.3.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -20982,7 +21438,13 @@ "$ref": "#/components/responses/mget-200" } }, - "x-state": "Added in 1.3.0" + "x-state": "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}" + } + ] } }, "/{index}/_mget": { @@ -21030,7 +21492,13 @@ "$ref": "#/components/responses/mget-200" } }, - "x-state": "Added in 1.3.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -21076,7 +21544,13 @@ "$ref": "#/components/responses/mget-200" } }, - "x-state": "Added in 1.3.0" + "x-state": "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}" + } + ] } }, "/_migration/deprecations": { @@ -23432,7 +23906,13 @@ } } }, - "x-state": "Added in 7.7.0" + "x-state": "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}" + } + ] } }, "/_ml/data_frame/_evaluate": { @@ -23535,7 +24015,13 @@ } } }, - "x-state": "Added in 7.3.0" + "x-state": "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}" + } + ] } }, "/_ml/data_frame/analytics/_explain": { @@ -23554,7 +24040,13 @@ "$ref": "#/components/responses/ml.explain_data_frame_analytics-200" } }, - "x-state": "Added in 7.3.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -23571,7 +24063,13 @@ "$ref": "#/components/responses/ml.explain_data_frame_analytics-200" } }, - "x-state": "Added in 7.3.0" + "x-state": "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}" + } + ] } }, "/_ml/data_frame/analytics/{id}/_explain": { @@ -23595,7 +24093,13 @@ "$ref": "#/components/responses/ml.explain_data_frame_analytics-200" } }, - "x-state": "Added in 7.3.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -23617,7 +24121,13 @@ "$ref": "#/components/responses/ml.explain_data_frame_analytics-200" } }, - "x-state": "Added in 7.3.0" + "x-state": "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}" + } + ] } }, "/_ml/anomaly_detectors/{job_id}/_flush": { @@ -27631,7 +28141,13 @@ "$ref": "#/components/responses/msearch_template-200" } }, - "x-state": "Added in 5.0.0" + "x-state": "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\" }}" + } + ] }, "post": { "tags": [ @@ -27668,7 +28184,13 @@ "$ref": "#/components/responses/msearch_template-200" } }, - "x-state": "Added in 5.0.0" + "x-state": "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\" }}" + } + ] } }, "/{index}/_msearch/template": { @@ -27710,7 +28232,13 @@ "$ref": "#/components/responses/msearch_template-200" } }, - "x-state": "Added in 5.0.0" + "x-state": "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\" }}" + } + ] }, "post": { "tags": [ @@ -27750,7 +28278,13 @@ "$ref": "#/components/responses/msearch_template-200" } }, - "x-state": "Added in 5.0.0" + "x-state": "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\" }}" + } + ] } }, "/_mtermvectors": { @@ -27806,7 +28340,13 @@ "200": { "$ref": "#/components/responses/mtermvectors-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -27860,7 +28400,13 @@ "200": { "$ref": "#/components/responses/mtermvectors-200" } - } + }, + "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}" + } + ] } }, "/{index}/_mtermvectors": { @@ -27919,7 +28465,13 @@ "200": { "$ref": "#/components/responses/mtermvectors-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -27976,7 +28528,13 @@ "200": { "$ref": "#/components/responses/mtermvectors-200" } - } + }, + "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}" + } + ] } }, "/_nodes/{node_id}/_repositories_metering/{max_archive_version}": { @@ -28270,7 +28828,13 @@ "$ref": "#/components/responses/nodes.reload_secure_settings-200" } }, - "x-state": "Added in 6.5.0" + "x-state": "Added in 6.5.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST _nodes/reload_secure_settings\n{\n \"secure_settings_password\": \"keystore-password\"\n}" + } + ] } }, "/_nodes/{node_id}/reload_secure_settings": { @@ -28297,7 +28861,13 @@ "$ref": "#/components/responses/nodes.reload_secure_settings-200" } }, - "x-state": "Added in 6.5.0" + "x-state": "Added in 6.5.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST _nodes/reload_secure_settings\n{\n \"secure_settings_password\": \"keystore-password\"\n}" + } + ] } }, "/_nodes/stats": { @@ -28857,7 +29427,13 @@ "200": { "$ref": "#/components/responses/put_script-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -28893,7 +29469,13 @@ "200": { "$ref": "#/components/responses/put_script-200" } - } + }, + "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}" + } + ] } }, "/_query_rules/{ruleset_id}/_rule/{rule_id}": { @@ -29048,7 +29630,13 @@ } } }, - "x-state": "Added in 8.15.0" + "x-state": "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}" + } + ] }, "delete": { "tags": [ @@ -29214,7 +29802,13 @@ } } }, - "x-state": "Added in 8.10.0" + "x-state": "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}" + } + ] }, "delete": { "tags": [ @@ -29399,7 +29993,13 @@ } } }, - "x-state": "Added in 8.10.0" + "x-state": "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}" + } + ] } }, "/_rank_eval": { @@ -29803,7 +30403,13 @@ } } }, - "x-state": "Added in 2.3.0" + "x-state": "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}" + } + ] } }, "/_reindex/{task_id}/_rethrottle": { @@ -29878,7 +30484,13 @@ "200": { "$ref": "#/components/responses/render_search_template-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -29894,7 +30506,13 @@ "200": { "$ref": "#/components/responses/render_search_template-200" } - } + }, + "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}" + } + ] } }, "/_render/template/{id}": { @@ -29917,7 +30535,13 @@ "200": { "$ref": "#/components/responses/render_search_template-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -29938,7 +30562,13 @@ "200": { "$ref": "#/components/responses/render_search_template-200" } - } + }, + "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}" + } + ] } }, "/_rollup/job/{id}": { @@ -30056,7 +30686,13 @@ } }, "deprecated": true, - "x-state": "Technical preview" + "x-state": "Technical preview", + "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}" + } + ] }, "delete": { "tags": [ @@ -30244,7 +30880,13 @@ } }, "deprecated": true, - "x-state": "Technical preview" + "x-state": "Technical preview", + "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}" + } + ] }, "post": { "tags": [ @@ -30273,7 +30915,13 @@ } }, "deprecated": true, - "x-state": "Technical preview" + "x-state": "Technical preview", + "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}" + } + ] } }, "/_rollup/job/{id}/_start": { @@ -30408,7 +31056,13 @@ "$ref": "#/components/responses/scripts_painless_execute-200" } }, - "x-state": "Technical preview" + "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}" + } + ] }, "post": { "tags": [ @@ -30425,7 +31079,13 @@ "$ref": "#/components/responses/scripts_painless_execute-200" } }, - "x-state": "Technical preview" + "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}" + } + ] } }, "/_search": { @@ -30577,7 +31237,13 @@ "200": { "$ref": "#/components/responses/search-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -30727,7 +31393,13 @@ "200": { "$ref": "#/components/responses/search-200" } - } + }, + "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}" + } + ] } }, "/{index}/_search": { @@ -30882,7 +31554,13 @@ "200": { "$ref": "#/components/responses/search-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -31035,7 +31713,13 @@ "200": { "$ref": "#/components/responses/search-200" } - } + }, + "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}" + } + ] } }, "/_application/search_application/{name}": { @@ -31143,7 +31827,13 @@ } } }, - "x-beta": true + "x-beta": true, + "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}" + } + ] }, "delete": { "tags": [ @@ -31446,7 +32136,13 @@ } }, "deprecated": true, - "x-state": "Technical preview" + "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}" + } + ] } }, "/_application/search_application/{name}/_render_query": { @@ -31511,7 +32207,13 @@ } } }, - "x-state": "Technical preview" + "x-state": "Technical preview", + "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}" + } + ] } }, "/_application/search_application/{name}/_search": { @@ -31538,7 +32240,13 @@ "$ref": "#/components/responses/search_application.search-200" } }, - "x-beta": true + "x-beta": true, + "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}" + } + ] }, "post": { "tags": [ @@ -31563,7 +32271,13 @@ "$ref": "#/components/responses/search_application.search-200" } }, - "x-beta": true + "x-beta": true, + "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}" + } + ] } }, "/{index}/_mvt/{field}/{zoom}/{x}/{y}": { @@ -31623,7 +32337,13 @@ "$ref": "#/components/responses/search_mvt-200" } }, - "x-state": "Added in 7.15.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -31681,7 +32401,13 @@ "$ref": "#/components/responses/search_mvt-200" } }, - "x-state": "Added in 7.15.0" + "x-state": "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}" + } + ] } }, "/_search_shards": { @@ -31897,7 +32623,13 @@ "$ref": "#/components/responses/search_template-200" } }, - "x-state": "Added in 2.0.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -31957,7 +32689,13 @@ "$ref": "#/components/responses/search_template-200" } }, - "x-state": "Added in 2.0.0" + "x-state": "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}" + } + ] } }, "/{index}/_search/template": { @@ -32022,7 +32760,13 @@ "$ref": "#/components/responses/search_template-200" } }, - "x-state": "Added in 2.0.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -32085,7 +32829,13 @@ "$ref": "#/components/responses/search_template-200" } }, - "x-state": "Added in 2.0.0" + "x-state": "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}" + } + ] } }, "/_searchable_snapshots/cache/stats": { @@ -32325,7 +33075,13 @@ } } }, - "x-state": "Added in 7.10.0" + "x-state": "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}" + } + ] } }, "/_searchable_snapshots/stats": { @@ -32433,7 +33189,13 @@ } } }, - "x-state": "Added in 8.2.0" + "x-state": "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}" + } + ] } }, "/_security/_authenticate": { @@ -32650,7 +33412,13 @@ } } }, - "x-state": "Added in 8.15.0" + "x-state": "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}" + } + ] }, "delete": { "tags": [ @@ -32876,7 +33644,13 @@ "200": { "$ref": "#/components/responses/security.change_password-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST /_security/user/jacknich/_password\n{\n \"password\" : \"new-test-password\"\n}" + } + ] }, "post": { "tags": [ @@ -32900,7 +33674,13 @@ "200": { "$ref": "#/components/responses/security.change_password-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST /_security/user/jacknich/_password\n{\n \"password\" : \"new-test-password\"\n}" + } + ] } }, "/_security/user/_password": { @@ -32923,7 +33703,13 @@ "200": { "$ref": "#/components/responses/security.change_password-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST /_security/user/jacknich/_password\n{\n \"password\" : \"new-test-password\"\n}" + } + ] }, "post": { "tags": [ @@ -32944,7 +33730,13 @@ "200": { "$ref": "#/components/responses/security.change_password-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST /_security/user/jacknich/_password\n{\n \"password\" : \"new-test-password\"\n}" + } + ] } }, "/_security/api_key/{ids}/_clear_cache": { @@ -33410,7 +34202,13 @@ "$ref": "#/components/responses/security.create_api_key-200" } }, - "x-state": "Added in 6.7.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -33435,7 +34233,13 @@ "$ref": "#/components/responses/security.create_api_key-200" } }, - "x-state": "Added in 6.7.0" + "x-state": "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}" + } + ] }, "delete": { "tags": [ @@ -33562,7 +34366,13 @@ } } }, - "x-state": "Added in 6.7.0" + "x-state": "Added in 6.7.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "DELETE /_security/api_key\n{\n \"ids\" : [ \"VuaCfGcBCdbkQm-e5aOx\" ]\n}" + } + ] } }, "/_security/cross_cluster/api_key": { @@ -33652,7 +34462,13 @@ } } } - } + }, + "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}" + } + ] } }, "/_security/service/{namespace}/{service}/credential/token/{name}": { @@ -34053,7 +34869,13 @@ "200": { "$ref": "#/components/responses/security.put_role-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -34080,7 +34902,13 @@ "200": { "$ref": "#/components/responses/security.put_role-200" } - } + }, + "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}" + } + ] }, "delete": { "tags": [ @@ -34190,7 +35018,13 @@ "$ref": "#/components/responses/security.put_role_mapping-200" } }, - "x-state": "Added in 5.5.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -34218,7 +35052,13 @@ "$ref": "#/components/responses/security.put_role_mapping-200" } }, - "x-state": "Added in 5.5.0" + "x-state": "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}" + } + ] }, "delete": { "tags": [ @@ -34327,7 +35167,13 @@ "200": { "$ref": "#/components/responses/security.put_user-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -34351,7 +35197,13 @@ "200": { "$ref": "#/components/responses/security.put_user-200" } - } + }, + "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}" + } + ] }, "delete": { "tags": [ @@ -34801,7 +35653,13 @@ "$ref": "#/components/responses/security.put_privileges-200" } }, - "x-state": "Added in 6.4.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -34826,7 +35684,13 @@ "$ref": "#/components/responses/security.put_privileges-200" } }, - "x-state": "Added in 6.4.0" + "x-state": "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}" + } + ] } }, "/_security/privilege/{application}": { @@ -35145,7 +36009,13 @@ } } } - } + }, + "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}" + } + ] } }, "/_security/oauth2/token": { @@ -35257,7 +36127,13 @@ } } }, - "x-state": "Added in 5.5.0" + "x-state": "Added in 5.5.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST /_security/oauth2/token\n{\n \"grant_type\" : \"client_credentials\"\n}" + } + ] }, "delete": { "tags": [ @@ -35363,7 +36239,13 @@ } } }, - "x-state": "Added in 5.5.0" + "x-state": "Added in 5.5.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "DELETE /_security/oauth2/token\n{\n \"token\" : \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\"\n}" + } + ] } }, "/_security/user": { @@ -35693,7 +36575,13 @@ } } }, - "x-state": "Added in 7.9.0" + "x-state": "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}" + } + ] } }, "/_security/user/_has_privileges": { @@ -35715,7 +36603,13 @@ "$ref": "#/components/responses/security.has_privileges-200" } }, - "x-state": "Added in 6.4.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -35735,7 +36629,13 @@ "$ref": "#/components/responses/security.has_privileges-200" } }, - "x-state": "Added in 6.4.0" + "x-state": "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}" + } + ] } }, "/_security/user/{user}/_has_privileges": { @@ -35762,7 +36662,13 @@ "$ref": "#/components/responses/security.has_privileges-200" } }, - "x-state": "Added in 6.4.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -35787,7 +36693,13 @@ "$ref": "#/components/responses/security.has_privileges-200" } }, - "x-state": "Added in 6.4.0" + "x-state": "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}" + } + ] } }, "/_security/profile/_has_privileges": { @@ -35809,7 +36721,13 @@ "$ref": "#/components/responses/security.has_privileges_user_profile-200" } }, - "x-state": "Added in 8.3.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -35829,7 +36747,13 @@ "$ref": "#/components/responses/security.has_privileges_user_profile-200" } }, - "x-state": "Added in 8.3.0" + "x-state": "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}" + } + ] } }, "/_security/oidc/authenticate": { @@ -35920,7 +36844,13 @@ } } } - } + }, + "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}" + } + ] } }, "/_security/oidc/logout": { @@ -35986,7 +36916,13 @@ } } } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST /_security/oidc/logout\n{\n \"token\" : \"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==\",\n \"refresh_token\": \"vLBPvmAB6KvwvJZr27cS\"\n}" + } + ] } }, "/_security/oidc/prepare": { @@ -36084,7 +37020,13 @@ } } } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST /_security/oidc/prepare\n{\n \"realm\" : \"oidc1\"\n}" + } + ] } }, "/_security/_query/api_key": { @@ -36114,7 +37056,13 @@ "$ref": "#/components/responses/security.query_api_keys-200" } }, - "x-state": "Added in 7.15.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -36142,7 +37090,13 @@ "$ref": "#/components/responses/security.query_api_keys-200" } }, - "x-state": "Added in 7.15.0" + "x-state": "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}" + } + ] } }, "/_security/_query/role": { @@ -36161,7 +37115,13 @@ "$ref": "#/components/responses/security.query_role-200" } }, - "x-state": "Added in 8.15.0" + "x-state": "Added in 8.15.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST /_security/_query/role\n{\n \"sort\": [\"name\"]\n}" + } + ] }, "post": { "tags": [ @@ -36178,7 +37138,13 @@ "$ref": "#/components/responses/security.query_role-200" } }, - "x-state": "Added in 8.15.0" + "x-state": "Added in 8.15.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST /_security/_query/role\n{\n \"sort\": [\"name\"]\n}" + } + ] } }, "/_security/_query/user": { @@ -36202,7 +37168,13 @@ "$ref": "#/components/responses/security.query_user-200" } }, - "x-state": "Added in 8.14.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -36224,7 +37196,13 @@ "$ref": "#/components/responses/security.query_user-200" } }, - "x-state": "Added in 8.14.0" + "x-state": "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}" + } + ] } }, "/_security/saml/authenticate": { @@ -36318,7 +37296,13 @@ } } }, - "x-state": "Added in 7.5.0" + "x-state": "Added in 7.5.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST /_security/saml/authenticate\n{\n \"content\" : \"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....\",\n \"ids\" : [\"4fee3b046395c4e751011e97f8900b5273d56685\"]\n}" + } + ] } }, "/_security/saml/complete_logout": { @@ -36383,7 +37367,13 @@ } } }, - "x-state": "Added in 7.14.0" + "x-state": "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}" + } + ] } }, "/_security/saml/invalidate": { @@ -36467,7 +37457,13 @@ } } }, - "x-state": "Added in 7.5.0" + "x-state": "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}" + } + ] } }, "/_security/saml/logout": { @@ -36537,7 +37533,13 @@ } } }, - "x-state": "Added in 7.5.0" + "x-state": "Added in 7.5.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST /_security/saml/logout\n{\n \"token\" : \"46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3\",\n \"refresh_token\" : \"mJdXLtmvTUSpoLwMvdBt_w\"\n}" + } + ] } }, "/_security/saml/prepare": { @@ -36623,7 +37625,13 @@ } } }, - "x-state": "Added in 7.5.0" + "x-state": "Added in 7.5.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST /_security/saml/prepare\n{\n \"realm\" : \"saml1\"\n}" + } + ] } }, "/_security/saml/metadata/{realm_name}": { @@ -36698,7 +37706,13 @@ "$ref": "#/components/responses/security.suggest_user_profiles-200" } }, - "x-state": "Added in 8.2.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -36720,7 +37734,13 @@ "$ref": "#/components/responses/security.suggest_user_profiles-200" } }, - "x-state": "Added in 8.2.0" + "x-state": "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}" + } + ] } }, "/_security/api_key/{id}": { @@ -36808,7 +37828,13 @@ } } }, - "x-state": "Added in 8.4.0" + "x-state": "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}" + } + ] } }, "/_security/cross_cluster/api_key/{id}": { @@ -36891,7 +37917,13 @@ } } } - } + }, + "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}" + } + ] } }, "/_security/profile/{uid}/_data": { @@ -36924,7 +37956,13 @@ "$ref": "#/components/responses/security.update_user_profile_data-200" } }, - "x-state": "Added in 8.2.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -36955,7 +37993,13 @@ "$ref": "#/components/responses/security.update_user_profile_data-200" } }, - "x-state": "Added in 8.2.0" + "x-state": "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}" + } + ] } }, "/_nodes/{node_id}/shutdown": { @@ -37070,7 +38114,13 @@ } } }, - "x-state": "Added in 7.13.0" + "x-state": "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}" + } + ] }, "delete": { "tags": [ @@ -37369,7 +38419,13 @@ } } }, - "x-state": "Added in 7.4.0" + "x-state": "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}" + } + ] }, "delete": { "tags": [ @@ -37980,7 +39036,13 @@ } } }, - "x-state": "Added in 7.10.0" + "x-state": "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}" + } + ] } }, "/_snapshot/{repository}/{snapshot}": { @@ -38227,7 +39289,13 @@ "$ref": "#/components/responses/snapshot.create-200" } }, - "x-state": "Added in 0.0.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -38261,7 +39329,13 @@ "$ref": "#/components/responses/snapshot.create-200" } }, - "x-state": "Added in 0.0.0" + "x-state": "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}" + } + ] }, "delete": { "tags": [ @@ -38380,7 +39454,13 @@ "$ref": "#/components/responses/snapshot.create_repository-200" } }, - "x-state": "Added in 0.0.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -38414,7 +39494,13 @@ "$ref": "#/components/responses/snapshot.create_repository-200" } }, - "x-state": "Added in 0.0.0" + "x-state": "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}" + } + ] }, "delete": { "tags": [ @@ -38896,7 +39982,13 @@ } } }, - "x-state": "Added in 0.0.0" + "x-state": "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}" + } + ] } }, "/_snapshot/_status": { @@ -39103,7 +40195,13 @@ } } }, - "x-state": "Added in 6.3.0" + "x-state": "Added in 6.3.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST _sql/close\n{\n \"cursor\": \"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\"\n}" + } + ] } }, "/_sql/async/delete/{id}": { @@ -39342,7 +40440,13 @@ "$ref": "#/components/responses/sql.query-200" } }, - "x-state": "Added in 6.3.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -39364,7 +40468,13 @@ "$ref": "#/components/responses/sql.query-200" } }, - "x-state": "Added in 6.3.0" + "x-state": "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}" + } + ] } }, "/_sql/translate": { @@ -40183,7 +41293,13 @@ "$ref": "#/components/responses/terms_enum-200" } }, - "x-state": "Added in 7.14.0" + "x-state": "Added in 7.14.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST stackoverflow/_terms_enum\n{\n \"field\" : \"tags\",\n \"string\" : \"kiba\"\n}" + } + ] }, "post": { "tags": [ @@ -40205,7 +41321,13 @@ "$ref": "#/components/responses/terms_enum-200" } }, - "x-state": "Added in 7.14.0" + "x-state": "Added in 7.14.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST stackoverflow/_terms_enum\n{\n \"field\" : \"tags\",\n \"string\" : \"kiba\"\n}" + } + ] } }, "/{index}/_termvectors/{id}": { @@ -40264,7 +41386,13 @@ "200": { "$ref": "#/components/responses/termvectors-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -40321,7 +41449,13 @@ "200": { "$ref": "#/components/responses/termvectors-200" } - } + }, + "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}" + } + ] } }, "/{index}/_termvectors": { @@ -40377,7 +41511,13 @@ "200": { "$ref": "#/components/responses/termvectors-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -40431,7 +41571,13 @@ "200": { "$ref": "#/components/responses/termvectors-200" } - } + }, + "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}" + } + ] } }, "/_text_structure/find_field_structure": { @@ -40723,7 +41869,13 @@ "200": { "$ref": "#/components/responses/text_structure.find_message_structure-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -40774,7 +41926,13 @@ "200": { "$ref": "#/components/responses/text_structure.find_message_structure-200" } - } + }, + "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}" + } + ] } }, "/_text_structure/find_structure": { @@ -41080,7 +42238,13 @@ } } }, - "x-state": "Added in 7.13.0" + "x-state": "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}" + } + ] } }, "/_text_structure/test_grok_pattern": { @@ -41107,7 +42271,13 @@ "$ref": "#/components/responses/text_structure.test_grok_pattern-200" } }, - "x-state": "Added in 8.13.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -41132,7 +42302,13 @@ "$ref": "#/components/responses/text_structure.test_grok_pattern-200" } }, - "x-state": "Added in 8.13.0" + "x-state": "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}" + } + ] } }, "/_transform/{transform_id}": { @@ -41284,7 +42460,13 @@ } } }, - "x-state": "Added in 7.2.0" + "x-state": "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}" + } + ] }, "delete": { "tags": [ @@ -41507,7 +42689,13 @@ "$ref": "#/components/responses/transform.preview_transform-200" } }, - "x-state": "Added in 7.2.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -41532,7 +42720,13 @@ "$ref": "#/components/responses/transform.preview_transform-200" } }, - "x-state": "Added in 7.2.0" + "x-state": "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}" + } + ] } }, "/_transform/_preview": { @@ -41556,7 +42750,13 @@ "$ref": "#/components/responses/transform.preview_transform-200" } }, - "x-state": "Added in 7.2.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -41578,7 +42778,13 @@ "$ref": "#/components/responses/transform.preview_transform-200" } }, - "x-state": "Added in 7.2.0" + "x-state": "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}" + } + ] } }, "/_transform/{transform_id}/_reset": { @@ -42013,7 +43219,13 @@ } } }, - "x-state": "Added in 7.2.0" + "x-state": "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}" + } + ] } }, "/_transform/_upgrade": { @@ -42361,7 +43573,13 @@ } } } - } + }, + "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}" + } + ] } }, "/{index}/_update_by_query": { @@ -42824,7 +44042,13 @@ } } }, - "x-state": "Added in 2.4.0" + "x-state": "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}" + } + ] } }, "/_update_by_query/{task_id}/_rethrottle": { @@ -43152,7 +44376,13 @@ "200": { "$ref": "#/components/responses/watcher.put_watch-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -43185,7 +44415,13 @@ "200": { "$ref": "#/components/responses/watcher.put_watch-200" } - } + }, + "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}" + } + ] }, "delete": { "tags": [ @@ -43266,7 +44502,13 @@ "200": { "$ref": "#/components/responses/watcher.execute_watch-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -43290,7 +44532,13 @@ "200": { "$ref": "#/components/responses/watcher.execute_watch-200" } - } + }, + "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}" + } + ] } }, "/_watcher/watch/_execute": { @@ -43313,7 +44561,13 @@ "200": { "$ref": "#/components/responses/watcher.execute_watch-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -43334,7 +44588,13 @@ "200": { "$ref": "#/components/responses/watcher.execute_watch-200" } - } + }, + "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}" + } + ] } }, "/_watcher/settings": { diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 68fb89e0a5..0a393cdd7a 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -325,7 +325,13 @@ "$ref": "#/components/responses/async_search.submit-200" } }, - "x-state": "Added in 7.7.0" + "x-state": "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}" + } + ] } }, "/{index}/_async_search": { @@ -478,7 +484,13 @@ "$ref": "#/components/responses/async_search.submit-200" } }, - "x-state": "Added in 7.7.0" + "x-state": "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}" + } + ] } }, "/_bulk": { @@ -534,7 +546,13 @@ "200": { "$ref": "#/components/responses/bulk-200" } - } + }, + "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\"} }" + } + ] }, "post": { "tags": [ @@ -588,7 +606,13 @@ "200": { "$ref": "#/components/responses/bulk-200" } - } + }, + "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\"} }" + } + ] } }, "/{index}/_bulk": { @@ -647,7 +671,13 @@ "200": { "$ref": "#/components/responses/bulk-200" } - } + }, + "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\"} }" + } + ] }, "post": { "tags": [ @@ -704,7 +734,13 @@ "200": { "$ref": "#/components/responses/bulk-200" } - } + }, + "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\"} }" + } + ] } }, "/_cat/aliases": { @@ -1379,7 +1415,13 @@ "200": { "$ref": "#/components/responses/scroll-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "GET /_search/scroll\n{\n \"scroll_id\" : \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" + } + ] }, "post": { "tags": [ @@ -1409,7 +1451,13 @@ "200": { "$ref": "#/components/responses/scroll-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "GET /_search/scroll\n{\n \"scroll_id\" : \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" + } + ] }, "delete": { "tags": [ @@ -1428,7 +1476,13 @@ "200": { "$ref": "#/components/responses/clear_scroll-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "DELETE /_search/scroll\n{\n \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" + } + ] } }, "/_search/scroll/{scroll_id}": { @@ -1463,7 +1517,13 @@ "200": { "$ref": "#/components/responses/scroll-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "GET /_search/scroll\n{\n \"scroll_id\" : \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" + } + ] }, "post": { "tags": [ @@ -1496,7 +1556,13 @@ "200": { "$ref": "#/components/responses/scroll-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "GET /_search/scroll\n{\n \"scroll_id\" : \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" + } + ] }, "delete": { "tags": [ @@ -1520,7 +1586,13 @@ "200": { "$ref": "#/components/responses/clear_scroll-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "DELETE /_search/scroll\n{\n \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==\"\n}" + } + ] } }, "/_pit": { @@ -1586,7 +1658,13 @@ } } }, - "x-state": "Added in 7.10.0" + "x-state": "Added in 7.10.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "DELETE /_pit\n{\n \"id\": \"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\"\n}" + } + ] } }, "/_component_template/{name}": { @@ -3487,7 +3565,13 @@ "200": { "$ref": "#/components/responses/count-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "GET /my-index-000001/_count?q=user:kimchy\n{\n \"query\" : {\n \"term\" : { \"user.id\" : \"kimchy\" }\n }\n}" + } + ] }, "post": { "tags": [ @@ -3547,7 +3631,13 @@ "200": { "$ref": "#/components/responses/count-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "GET /my-index-000001/_count?q=user:kimchy\n{\n \"query\" : {\n \"term\" : { \"user.id\" : \"kimchy\" }\n }\n}" + } + ] } }, "/{index}/_count": { @@ -3612,7 +3702,13 @@ "200": { "$ref": "#/components/responses/count-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "GET /my-index-000001/_count?q=user:kimchy\n{\n \"query\" : {\n \"term\" : { \"user.id\" : \"kimchy\" }\n }\n}" + } + ] }, "post": { "tags": [ @@ -3675,7 +3771,13 @@ "200": { "$ref": "#/components/responses/count-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "GET /my-index-000001/_count?q=user:kimchy\n{\n \"query\" : {\n \"term\" : { \"user.id\" : \"kimchy\" }\n }\n}" + } + ] } }, "/{index}/_create/{id}": { @@ -3744,7 +3846,13 @@ "$ref": "#/components/responses/create-200" } }, - "x-state": "Added in 5.0.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -3811,7 +3919,13 @@ "$ref": "#/components/responses/create-200" } }, - "x-state": "Added in 5.0.0" + "x-state": "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}" + } + ] } }, "/{index}/_doc/{id}": { @@ -4037,7 +4151,13 @@ "200": { "$ref": "#/components/responses/index-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -4100,7 +4220,13 @@ "200": { "$ref": "#/components/responses/index-200" } - } + }, + "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}" + } + ] }, "delete": { "tags": [ @@ -4813,7 +4939,13 @@ } } }, - "x-state": "Added in 5.0.0" + "x-state": "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}" + } + ] } }, "/_scripts/{id}": { @@ -4906,7 +5038,13 @@ "200": { "$ref": "#/components/responses/put_script-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -4939,7 +5077,13 @@ "200": { "$ref": "#/components/responses/put_script-200" } - } + }, + "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}" + } + ] }, "delete": { "tags": [ @@ -5421,7 +5565,13 @@ "$ref": "#/components/responses/eql.search-200" } }, - "x-state": "Added in 7.9.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -5470,7 +5620,13 @@ "$ref": "#/components/responses/eql.search-200" } }, - "x-state": "Added in 7.9.0" + "x-state": "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}" + } + ] } }, "/_query/queries/{id}": { @@ -5702,7 +5858,13 @@ } } } - } + }, + "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}" + } + ] } }, "/{index}/_source/{id}": { @@ -6047,7 +6209,13 @@ "200": { "$ref": "#/components/responses/explain-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "GET /my-index-000001/_explain/0\n{\n \"query\" : {\n \"match\" : { \"message\" : \"elasticsearch\" }\n }\n}" + } + ] }, "post": { "tags": [ @@ -6107,7 +6275,13 @@ "200": { "$ref": "#/components/responses/explain-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "GET /my-index-000001/_explain/0\n{\n \"query\" : {\n \"match\" : { \"message\" : \"elasticsearch\" }\n }\n}" + } + ] } }, "/_field_caps": { @@ -6152,7 +6326,13 @@ "$ref": "#/components/responses/field_caps-200" } }, - "x-state": "Added in 5.4.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -6195,7 +6375,13 @@ "$ref": "#/components/responses/field_caps-200" } }, - "x-state": "Added in 5.4.0" + "x-state": "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}" + } + ] } }, "/{index}/_field_caps": { @@ -6243,7 +6429,13 @@ "$ref": "#/components/responses/field_caps-200" } }, - "x-state": "Added in 5.4.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -6289,7 +6481,13 @@ "$ref": "#/components/responses/field_caps-200" } }, - "x-state": "Added in 5.4.0" + "x-state": "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}" + } + ] } }, "/{index}/_graph/explore": { @@ -6321,7 +6519,13 @@ "200": { "$ref": "#/components/responses/graph.explore-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -6351,7 +6555,13 @@ "200": { "$ref": "#/components/responses/graph.explore-200" } - } + }, + "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}" + } + ] } }, "/{index}/_doc": { @@ -6413,7 +6623,13 @@ "200": { "$ref": "#/components/responses/index-200" } - } + }, + "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}" + } + ] } }, "/{index}/_block/{block}": { @@ -8200,7 +8416,13 @@ "200": { "$ref": "#/components/responses/indices.put_mapping-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "PUT /my-index-000001,my-index-000002/_mapping\n{\n \"properties\": {\n \"user\": {\n \"properties\": {\n \"name\": {\n \"type\": \"keyword\"\n }\n }\n }\n }\n}" + } + ] }, "post": { "tags": [ @@ -8242,7 +8464,13 @@ "200": { "$ref": "#/components/responses/indices.put_mapping-200" } - } + }, + "x-codeSamples": [ + { + "lang": "Console", + "source": "PUT /my-index-000001,my-index-000002/_mapping\n{\n \"properties\": {\n \"user\": {\n \"properties\": {\n \"name\": {\n \"type\": \"keyword\"\n }\n }\n }\n }\n}" + } + ] } }, "/_settings": { @@ -9420,7 +9648,13 @@ } } }, - "x-state": "Added in 8.18.0" + "x-state": "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}" + } + ] } }, "/_inference/completion/{inference_id}": { @@ -9510,7 +9744,13 @@ } } }, - "x-state": "Added in 8.11.0" + "x-state": "Added in 8.11.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST _inference/completion/openai_chat_completions\n{\n \"input\": \"What is Elastic?\"\n}" + } + ] } }, "/_inference/{inference_id}": { @@ -9815,7 +10055,13 @@ } } }, - "x-state": "Added in 8.16.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{amazonbedrock_inference_id}": { @@ -9901,7 +10147,13 @@ } } }, - "x-state": "Added in 8.12.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{anthropic_inference_id}": { @@ -9981,7 +10233,13 @@ } } }, - "x-state": "Added in 8.16.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{azureaistudio_inference_id}": { @@ -10067,7 +10325,13 @@ } } }, - "x-state": "Added in 8.14.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{azureopenai_inference_id}": { @@ -10153,7 +10417,13 @@ } } }, - "x-state": "Added in 8.14.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{cohere_inference_id}": { @@ -10239,7 +10509,13 @@ } } }, - "x-state": "Added in 8.13.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{elasticsearch_inference_id}": { @@ -10351,7 +10627,13 @@ } } }, - "x-state": "Added in 8.13.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{elser_inference_id}": { @@ -10441,7 +10723,13 @@ } }, "deprecated": true, - "x-state": "Added in 8.11.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{googleaistudio_inference_id}": { @@ -10519,7 +10807,13 @@ } } }, - "x-state": "Added in 8.15.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{googlevertexai_inference_id}": { @@ -10605,7 +10899,13 @@ } } }, - "x-state": "Added in 8.15.0" + "x-state": "Added in 8.15.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "PUT _inference/text_embedding/google_vertex_ai_embeddings\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}" + } + ] } }, "/_inference/{task_type}/{huggingface_inference_id}": { @@ -10683,7 +10983,13 @@ } } }, - "x-state": "Added in 8.12.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{jinaai_inference_id}": { @@ -10769,7 +11075,13 @@ } } }, - "x-state": "Added in 8.18.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{mistral_inference_id}": { @@ -10846,7 +11158,13 @@ } } }, - "x-state": "Added in 8.15.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{openai_inference_id}": { @@ -10932,7 +11250,13 @@ } } }, - "x-state": "Added in 8.12.0" + "x-state": "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}" + } + ] } }, "/_inference/{task_type}/{voyageai_inference_id}": { @@ -11018,7 +11342,13 @@ } } }, - "x-state": "Added in 8.19.0" + "x-state": "Added in 8.19.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "PUT _inference/text_embedding/voyageai-embeddings\n{\n \"service\": \"voyageai\",\n \"service_settings\": {\n \"model_id\": \"voyage-3-large\",\n \"dimensions\": 512\n }\n}" + } + ] } }, "/_inference/{task_type}/{watsonx_inference_id}": { @@ -11092,7 +11422,13 @@ } } }, - "x-state": "Added in 8.16.0" + "x-state": "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}" + } + ] } }, "/_inference/rerank/{inference_id}": { @@ -11187,7 +11523,13 @@ } } }, - "x-state": "Added in 8.11.0" + "x-state": "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}" + } + ] } }, "/_inference/sparse_embedding/{inference_id}": { @@ -11277,7 +11619,13 @@ } } }, - "x-state": "Added in 8.11.0" + "x-state": "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}" + } + ] } }, "/_inference/text_embedding/{inference_id}": { @@ -11367,7 +11715,13 @@ } } }, - "x-state": "Added in 8.11.0" + "x-state": "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}" + } + ] } }, "/": { @@ -11934,7 +12288,13 @@ } } }, - "x-state": "Added in 7.12.0" + "x-state": "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}" + } + ] }, "delete": { "tags": [ @@ -12031,9 +12391,15 @@ "$ref": "#/components/responses/mget-200" } }, - "x-state": "Added in 1.3.0" - }, - "post": { + "x-state": "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}" + } + ] + }, + "post": { "tags": [ "document" ], @@ -12074,7 +12440,13 @@ "$ref": "#/components/responses/mget-200" } }, - "x-state": "Added in 1.3.0" + "x-state": "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}" + } + ] } }, "/{index}/_mget": { @@ -12122,7 +12494,13 @@ "$ref": "#/components/responses/mget-200" } }, - "x-state": "Added in 1.3.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -12168,7 +12546,13 @@ "$ref": "#/components/responses/mget-200" } }, - "x-state": "Added in 1.3.0" + "x-state": "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}" + } + ] } }, "/_ml/anomaly_detectors/{job_id}/_close": { @@ -14001,7 +14385,13 @@ } } }, - "x-state": "Added in 7.7.0" + "x-state": "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}" + } + ] } }, "/_ml/data_frame/_evaluate": { @@ -14104,7 +14494,13 @@ } } }, - "x-state": "Added in 7.3.0" + "x-state": "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}" + } + ] } }, "/_ml/anomaly_detectors/{job_id}/_flush": { @@ -16915,7 +17311,13 @@ "$ref": "#/components/responses/msearch_template-200" } }, - "x-state": "Added in 5.0.0" + "x-state": "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\" }}" + } + ] }, "post": { "tags": [ @@ -16952,7 +17354,13 @@ "$ref": "#/components/responses/msearch_template-200" } }, - "x-state": "Added in 5.0.0" + "x-state": "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\" }}" + } + ] } }, "/{index}/_msearch/template": { @@ -16994,7 +17402,13 @@ "$ref": "#/components/responses/msearch_template-200" } }, - "x-state": "Added in 5.0.0" + "x-state": "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\" }}" + } + ] }, "post": { "tags": [ @@ -17034,7 +17448,13 @@ "$ref": "#/components/responses/msearch_template-200" } }, - "x-state": "Added in 5.0.0" + "x-state": "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\" }}" + } + ] } }, "/_mtermvectors": { @@ -17090,7 +17510,13 @@ "200": { "$ref": "#/components/responses/mtermvectors-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -17144,7 +17570,13 @@ "200": { "$ref": "#/components/responses/mtermvectors-200" } - } + }, + "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}" + } + ] } }, "/{index}/_mtermvectors": { @@ -17203,7 +17635,13 @@ "200": { "$ref": "#/components/responses/mtermvectors-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -17260,7 +17698,13 @@ "200": { "$ref": "#/components/responses/mtermvectors-200" } - } + }, + "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}" + } + ] } }, "/{index}/_pit": { @@ -17437,7 +17881,13 @@ "200": { "$ref": "#/components/responses/put_script-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -17473,7 +17923,13 @@ "200": { "$ref": "#/components/responses/put_script-200" } - } + }, + "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}" + } + ] } }, "/_query_rules/{ruleset_id}/_rule/{rule_id}": { @@ -17628,7 +18084,13 @@ } } }, - "x-state": "Added in 8.15.0" + "x-state": "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}" + } + ] }, "delete": { "tags": [ @@ -17794,7 +18256,13 @@ } } }, - "x-state": "Added in 8.10.0" + "x-state": "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}" + } + ] }, "delete": { "tags": [ @@ -17979,7 +18447,13 @@ } } }, - "x-state": "Added in 8.10.0" + "x-state": "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}" + } + ] } }, "/_rank_eval": { @@ -18383,7 +18857,13 @@ } } }, - "x-state": "Added in 2.3.0" + "x-state": "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}" + } + ] } }, "/_render/template": { @@ -18401,7 +18881,13 @@ "200": { "$ref": "#/components/responses/render_search_template-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -18417,7 +18903,13 @@ "200": { "$ref": "#/components/responses/render_search_template-200" } - } + }, + "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}" + } + ] } }, "/_render/template/{id}": { @@ -18440,7 +18932,13 @@ "200": { "$ref": "#/components/responses/render_search_template-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -18461,7 +18959,13 @@ "200": { "$ref": "#/components/responses/render_search_template-200" } - } + }, + "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}" + } + ] } }, "/_scripts/painless/_execute": { @@ -18480,7 +18984,13 @@ "$ref": "#/components/responses/scripts_painless_execute-200" } }, - "x-state": "Technical preview" + "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}" + } + ] }, "post": { "tags": [ @@ -18497,7 +19007,13 @@ "$ref": "#/components/responses/scripts_painless_execute-200" } }, - "x-state": "Technical preview" + "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}" + } + ] } }, "/_search": { @@ -18649,7 +19165,13 @@ "200": { "$ref": "#/components/responses/search-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -18799,7 +19321,13 @@ "200": { "$ref": "#/components/responses/search-200" } - } + }, + "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}" + } + ] } }, "/{index}/_search": { @@ -18954,7 +19482,13 @@ "200": { "$ref": "#/components/responses/search-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -19107,7 +19641,13 @@ "200": { "$ref": "#/components/responses/search-200" } - } + }, + "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}" + } + ] } }, "/_application/search_application/{name}": { @@ -19215,7 +19755,13 @@ } } }, - "x-beta": true + "x-beta": true, + "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}" + } + ] }, "delete": { "tags": [ @@ -19458,7 +20004,13 @@ "$ref": "#/components/responses/search_application.search-200" } }, - "x-beta": true + "x-beta": true, + "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}" + } + ] }, "post": { "tags": [ @@ -19483,7 +20035,13 @@ "$ref": "#/components/responses/search_application.search-200" } }, - "x-beta": true + "x-beta": true, + "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}" + } + ] } }, "/{index}/_mvt/{field}/{zoom}/{x}/{y}": { @@ -19543,7 +20101,13 @@ "$ref": "#/components/responses/search_mvt-200" } }, - "x-state": "Added in 7.15.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -19601,7 +20165,13 @@ "$ref": "#/components/responses/search_mvt-200" } }, - "x-state": "Added in 7.15.0" + "x-state": "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}" + } + ] } }, "/_search/template": { @@ -19663,7 +20233,13 @@ "$ref": "#/components/responses/search_template-200" } }, - "x-state": "Added in 2.0.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -19723,7 +20299,13 @@ "$ref": "#/components/responses/search_template-200" } }, - "x-state": "Added in 2.0.0" + "x-state": "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}" + } + ] } }, "/{index}/_search/template": { @@ -19788,7 +20370,13 @@ "$ref": "#/components/responses/search_template-200" } }, - "x-state": "Added in 2.0.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -19851,7 +20439,13 @@ "$ref": "#/components/responses/search_template-200" } }, - "x-state": "Added in 2.0.0" + "x-state": "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}" + } + ] } }, "/_security/_authenticate": { @@ -20096,7 +20690,13 @@ "$ref": "#/components/responses/security.create_api_key-200" } }, - "x-state": "Added in 6.7.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -20121,7 +20721,13 @@ "$ref": "#/components/responses/security.create_api_key-200" } }, - "x-state": "Added in 6.7.0" + "x-state": "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}" + } + ] }, "delete": { "tags": [ @@ -20248,7 +20854,13 @@ } } }, - "x-state": "Added in 6.7.0" + "x-state": "Added in 6.7.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "DELETE /_security/api_key\n{\n \"ids\" : [ \"VuaCfGcBCdbkQm-e5aOx\" ]\n}" + } + ] } }, "/_security/role/{name}": { @@ -20295,7 +20907,13 @@ "200": { "$ref": "#/components/responses/security.put_role-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -20322,7 +20940,13 @@ "200": { "$ref": "#/components/responses/security.put_role-200" } - } + }, + "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}" + } + ] }, "delete": { "tags": [ @@ -20469,7 +21093,13 @@ "$ref": "#/components/responses/security.has_privileges-200" } }, - "x-state": "Added in 6.4.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -20489,7 +21119,13 @@ "$ref": "#/components/responses/security.has_privileges-200" } }, - "x-state": "Added in 6.4.0" + "x-state": "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}" + } + ] } }, "/_security/user/{user}/_has_privileges": { @@ -20516,7 +21152,13 @@ "$ref": "#/components/responses/security.has_privileges-200" } }, - "x-state": "Added in 6.4.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -20541,7 +21183,13 @@ "$ref": "#/components/responses/security.has_privileges-200" } }, - "x-state": "Added in 6.4.0" + "x-state": "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}" + } + ] } }, "/_security/_query/api_key": { @@ -20571,7 +21219,13 @@ "$ref": "#/components/responses/security.query_api_keys-200" } }, - "x-state": "Added in 7.15.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -20599,7 +21253,13 @@ "$ref": "#/components/responses/security.query_api_keys-200" } }, - "x-state": "Added in 7.15.0" + "x-state": "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}" + } + ] } }, "/_security/_query/role": { @@ -20618,7 +21278,13 @@ "$ref": "#/components/responses/security.query_role-200" } }, - "x-state": "Added in 8.15.0" + "x-state": "Added in 8.15.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST /_security/_query/role\n{\n \"sort\": [\"name\"]\n}" + } + ] }, "post": { "tags": [ @@ -20635,7 +21301,13 @@ "$ref": "#/components/responses/security.query_role-200" } }, - "x-state": "Added in 8.15.0" + "x-state": "Added in 8.15.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST /_security/_query/role\n{\n \"sort\": [\"name\"]\n}" + } + ] } }, "/_security/api_key/{id}": { @@ -20723,7 +21395,13 @@ } } }, - "x-state": "Added in 8.4.0" + "x-state": "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}" + } + ] } }, "/_sql/close": { @@ -20778,7 +21456,13 @@ } } }, - "x-state": "Added in 6.3.0" + "x-state": "Added in 6.3.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST _sql/close\n{\n \"cursor\": \"sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=\"\n}" + } + ] } }, "/_sql/async/delete/{id}": { @@ -21017,7 +21701,13 @@ "$ref": "#/components/responses/sql.query-200" } }, - "x-state": "Added in 6.3.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -21039,7 +21729,13 @@ "$ref": "#/components/responses/sql.query-200" } }, - "x-state": "Added in 6.3.0" + "x-state": "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}" + } + ] } }, "/_sql/translate": { @@ -21619,7 +22315,13 @@ "$ref": "#/components/responses/terms_enum-200" } }, - "x-state": "Added in 7.14.0" + "x-state": "Added in 7.14.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST stackoverflow/_terms_enum\n{\n \"field\" : \"tags\",\n \"string\" : \"kiba\"\n}" + } + ] }, "post": { "tags": [ @@ -21641,7 +22343,13 @@ "$ref": "#/components/responses/terms_enum-200" } }, - "x-state": "Added in 7.14.0" + "x-state": "Added in 7.14.0", + "x-codeSamples": [ + { + "lang": "Console", + "source": "POST stackoverflow/_terms_enum\n{\n \"field\" : \"tags\",\n \"string\" : \"kiba\"\n}" + } + ] } }, "/{index}/_termvectors/{id}": { @@ -21700,7 +22408,13 @@ "200": { "$ref": "#/components/responses/termvectors-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -21757,7 +22471,13 @@ "200": { "$ref": "#/components/responses/termvectors-200" } - } + }, + "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}" + } + ] } }, "/{index}/_termvectors": { @@ -21813,7 +22533,13 @@ "200": { "$ref": "#/components/responses/termvectors-200" } - } + }, + "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}" + } + ] }, "post": { "tags": [ @@ -21867,7 +22593,13 @@ "200": { "$ref": "#/components/responses/termvectors-200" } - } + }, + "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}" + } + ] } }, "/_transform/{transform_id}": { @@ -22019,7 +22751,13 @@ } } }, - "x-state": "Added in 7.2.0" + "x-state": "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}" + } + ] }, "delete": { "tags": [ @@ -22242,7 +22980,13 @@ "$ref": "#/components/responses/transform.preview_transform-200" } }, - "x-state": "Added in 7.2.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -22267,7 +23011,13 @@ "$ref": "#/components/responses/transform.preview_transform-200" } }, - "x-state": "Added in 7.2.0" + "x-state": "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}" + } + ] } }, "/_transform/_preview": { @@ -22291,7 +23041,13 @@ "$ref": "#/components/responses/transform.preview_transform-200" } }, - "x-state": "Added in 7.2.0" + "x-state": "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}" + } + ] }, "post": { "tags": [ @@ -22313,7 +23069,13 @@ "$ref": "#/components/responses/transform.preview_transform-200" } }, - "x-state": "Added in 7.2.0" + "x-state": "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}" + } + ] } }, "/_transform/{transform_id}/_reset": { @@ -22748,7 +23510,13 @@ } } }, - "x-state": "Added in 7.2.0" + "x-state": "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}" + } + ] } }, "/{index}/_update/{id}": { @@ -23026,7 +23794,13 @@ } } } - } + }, + "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}" + } + ] } }, "/{index}/_update_by_query": { @@ -23489,7 +24263,13 @@ } } }, - "x-state": "Added in 2.4.0" + "x-state": "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}" + } + ] } } },