diff --git a/docs/doc_examples/11be807bdeaeecc8174dec88e0851ea7.asciidoc b/docs/doc_examples/11be807bdeaeecc8174dec88e0851ea7.asciidoc new file mode 100644 index 000000000..9e732ae71 --- /dev/null +++ b/docs/doc_examples/11be807bdeaeecc8174dec88e0851ea7.asciidoc @@ -0,0 +1,15 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.transport.request({ + method: "GET", + path: "/_connector/_sync_job", + querystring: { + connector_id: "my-connector-id", + size: "1", + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/12e9e758f7f18a6cbf27e9d0aea57a19.asciidoc b/docs/doc_examples/12e9e758f7f18a6cbf27e9d0aea57a19.asciidoc new file mode 100644 index 000000000..ba95e73e9 --- /dev/null +++ b/docs/doc_examples/12e9e758f7f18a6cbf27e9d0aea57a19.asciidoc @@ -0,0 +1,18 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.update({ + index: ".elastic-connectors", + id: "connector_id", + doc: { + features: { + native_connector_api_keys: { + enabled: true, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/13fd7a99c5cf53279409ecc679084f87.asciidoc b/docs/doc_examples/13fd7a99c5cf53279409ecc679084f87.asciidoc new file mode 100644 index 000000000..5ce2b993b --- /dev/null +++ b/docs/doc_examples/13fd7a99c5cf53279409ecc679084f87.asciidoc @@ -0,0 +1,25 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.create({ + index: "idx_keep", + mappings: { + _source: { + mode: "synthetic", + }, + properties: { + path: { + type: "object", + synthetic_source_keep: "all", + }, + ids: { + type: "integer", + synthetic_source_keep: "arrays", + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/1522a9297151d7046e6345b9b27539ca.asciidoc b/docs/doc_examples/1522a9297151d7046e6345b9b27539ca.asciidoc new file mode 100644 index 000000000..2dab45f96 --- /dev/null +++ b/docs/doc_examples/1522a9297151d7046e6345b9b27539ca.asciidoc @@ -0,0 +1,19 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.connector.updateConfiguration({ + connector_id: "my-connector-id", + values: { + host: "127.0.0.1", + port: 5432, + username: "myuser", + password: "mypassword", + database: "chinook", + schema: "public", + tables: "album,artist", + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/16a7ce08b4a6b3af269f27eecc71d664.asciidoc b/docs/doc_examples/16a7ce08b4a6b3af269f27eecc71d664.asciidoc new file mode 100644 index 000000000..72589cd8f --- /dev/null +++ b/docs/doc_examples/16a7ce08b4a6b3af269f27eecc71d664.asciidoc @@ -0,0 +1,15 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.delete({ + index: "books", +}); +console.log(response); + +const response1 = await client.indices.delete({ + index: "my-explicit-mappings-books", +}); +console.log(response1); +---- diff --git a/docs/doc_examples/17316a81c9dbdd120b7754116bf0461c.asciidoc b/docs/doc_examples/17316a81c9dbdd120b7754116bf0461c.asciidoc new file mode 100644 index 000000000..13415ca5b --- /dev/null +++ b/docs/doc_examples/17316a81c9dbdd120b7754116bf0461c.asciidoc @@ -0,0 +1,26 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.security.createApiKey({ + name: "my-connector-api-key", + role_descriptors: { + "my-connector-connector-role": { + cluster: ["monitor", "manage_connector"], + indices: [ + { + names: [ + "my-index_name", + ".search-acl-filter-my-index_name", + ".elastic-connectors*", + ], + privileges: ["all"], + allow_restricted_indices: false, + }, + ], + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/193704020a19714dec390452a4e75e8d.asciidoc b/docs/doc_examples/193704020a19714dec390452a4e75e8d.asciidoc new file mode 100644 index 000000000..1fcacfbd1 --- /dev/null +++ b/docs/doc_examples/193704020a19714dec390452a4e75e8d.asciidoc @@ -0,0 +1,10 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.create({ + index: "books", +}); +console.log(response); +---- diff --git a/docs/doc_examples/0393ca5a2942e1f00ed87546d0d50732.asciidoc b/docs/doc_examples/1aa96eeaf63fc967e166d1a2fcdccccc.asciidoc similarity index 92% rename from docs/doc_examples/0393ca5a2942e1f00ed87546d0d50732.asciidoc rename to docs/doc_examples/1aa96eeaf63fc967e166d1a2fcdccccc.asciidoc index 4709c48bb..84fdefbae 100644 --- a/docs/doc_examples/0393ca5a2942e1f00ed87546d0d50732.asciidoc +++ b/docs/doc_examples/1aa96eeaf63fc967e166d1a2fcdccccc.asciidoc @@ -4,7 +4,7 @@ [source, js] ---- const response = await client.indices.create({ - index: "my-index-000003", + index: "my-index-000002", mappings: { properties: { metrics: { @@ -29,7 +29,7 @@ const response = await client.indices.create({ console.log(response); const response1 = await client.indices.getMapping({ - index: "my-index-000003", + index: "my-index-000002", }); console.log(response1); ---- diff --git a/docs/doc_examples/1c9dac4183a3532c91dbd1a46907729b.asciidoc b/docs/doc_examples/1c9dac4183a3532c91dbd1a46907729b.asciidoc new file mode 100644 index 000000000..b563e314b --- /dev/null +++ b/docs/doc_examples/1c9dac4183a3532c91dbd1a46907729b.asciidoc @@ -0,0 +1,10 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.delete({ + index: "music", +}); +console.log(response); +---- diff --git a/docs/doc_examples/1fb2c77c0988bc6545040b20e3afa7e9.asciidoc b/docs/doc_examples/1fb2c77c0988bc6545040b20e3afa7e9.asciidoc new file mode 100644 index 000000000..aced9c9d6 --- /dev/null +++ b/docs/doc_examples/1fb2c77c0988bc6545040b20e3afa7e9.asciidoc @@ -0,0 +1,33 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.security.createApiKey({ + name: "john-api-key", + expiration: "1d", + role_descriptors: { + "sharepoint-online-role": { + index: [ + { + names: ["sharepoint-search-application"], + privileges: ["read"], + query: { + template: { + params: { + access_control: ["john@example.co", "Engineering Members"], + }, + source: + '\n {\n "bool": {\n "should": [\n {\n "bool": {\n "must_not": {\n "exists": {\n "field": "_allow_access_control"\n }\n }\n }\n },\n {\n "terms": {\n "_allow_access_control.enum": {{#toJson}}access_control{{/toJson}}\n }\n }\n ]\n }\n }\n ', + }, + }, + }, + ], + restriction: { + workflows: ["search_application_query"], + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/2c86840a46242a38cf82024a9321be46.asciidoc b/docs/doc_examples/2c86840a46242a38cf82024a9321be46.asciidoc new file mode 100644 index 000000000..3bda37c4b --- /dev/null +++ b/docs/doc_examples/2c86840a46242a38cf82024a9321be46.asciidoc @@ -0,0 +1,28 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.create({ + index: "my-explicit-mappings-books", + mappings: { + dynamic: false, + properties: { + name: { + type: "text", + }, + author: { + type: "text", + }, + release_date: { + type: "date", + format: "yyyy-MM-dd", + }, + page_count: { + type: "integer", + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/2d0244c020075595acb625aa5ba8f455.asciidoc b/docs/doc_examples/2d0244c020075595acb625aa5ba8f455.asciidoc new file mode 100644 index 000000000..e7a2117c4 --- /dev/null +++ b/docs/doc_examples/2d0244c020075595acb625aa5ba8f455.asciidoc @@ -0,0 +1,25 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.index({ + index: "idx_keep", + id: 1, + document: { + path: { + to: [ + { + foo: [3, 2, 1], + }, + { + foo: [30, 20, 10], + }, + ], + bar: "baz", + }, + ids: [200, 100, 300, 100], + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/4da0cb8693e9ceceee2ba3b558014bbf.asciidoc b/docs/doc_examples/4da0cb8693e9ceceee2ba3b558014bbf.asciidoc new file mode 100644 index 000000000..effb6d63d --- /dev/null +++ b/docs/doc_examples/4da0cb8693e9ceceee2ba3b558014bbf.asciidoc @@ -0,0 +1,38 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.updateByQuery({ + index: "INDEX_NAME", + conflicts: "proceed", + query: { + bool: { + filter: [ + { + match: { + object_type: "drive_item", + }, + }, + { + exists: { + field: "file", + }, + }, + { + range: { + lastModifiedDateTime: { + lte: "now-180d", + }, + }, + }, + ], + }, + }, + script: { + source: "ctx._source.body = ''", + lang: "painless", + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/529671ffaf7cc75fe83a81d729788be4.asciidoc b/docs/doc_examples/529671ffaf7cc75fe83a81d729788be4.asciidoc new file mode 100644 index 000000000..c493ead5a --- /dev/null +++ b/docs/doc_examples/529671ffaf7cc75fe83a81d729788be4.asciidoc @@ -0,0 +1,31 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.update({ + index: ".elastic-connectors", + id: "connector_id", + doc: { + configuration: { + field_a: { + type: "str", + value: "", + }, + field_b: { + type: "bool", + value: false, + }, + field_c: { + type: "int", + value: 1, + }, + field_d: { + type: "list", + value: "a,b", + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/54a47b5d07e7bfbea75c77f35eaae18d.asciidoc b/docs/doc_examples/54a47b5d07e7bfbea75c77f35eaae18d.asciidoc new file mode 100644 index 000000000..3cd177602 --- /dev/null +++ b/docs/doc_examples/54a47b5d07e7bfbea75c77f35eaae18d.asciidoc @@ -0,0 +1,15 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.putMapping({ + index: ".elastic-connectors-sync-jobs-v1", + properties: { + job_type: { + type: "keyword", + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/6329fb2840a4373ff6d342f2653247cb.asciidoc b/docs/doc_examples/6329fb2840a4373ff6d342f2653247cb.asciidoc new file mode 100644 index 000000000..cbb113a2e --- /dev/null +++ b/docs/doc_examples/6329fb2840a4373ff6d342f2653247cb.asciidoc @@ -0,0 +1,10 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.getMapping({ + index: "books", +}); +console.log(response); +---- diff --git a/docs/doc_examples/63a53fcb0717ae9033a679cbfc932851.asciidoc b/docs/doc_examples/63a53fcb0717ae9033a679cbfc932851.asciidoc new file mode 100644 index 000000000..742fed240 --- /dev/null +++ b/docs/doc_examples/63a53fcb0717ae9033a679cbfc932851.asciidoc @@ -0,0 +1,20 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.inference.put({ + task_type: "completion", + inference_id: "alibabacloud_ai_search_completion", + inference_config: { + service: "alibabacloud-ai-search", + service_settings: { + host: "default-j01.platform-cn-shanghai.opensearch.aliyuncs.com", + api_key: "{{API_KEY}}", + service_id: "ops-qwen-turbo", + workspace: "default", + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/640dbeecb736bd25f6f2b392b76a7531.asciidoc b/docs/doc_examples/640dbeecb736bd25f6f2b392b76a7531.asciidoc new file mode 100644 index 000000000..54d88b41e --- /dev/null +++ b/docs/doc_examples/640dbeecb736bd25f6f2b392b76a7531.asciidoc @@ -0,0 +1,10 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.cluster.stats({ + include_remotes: "true", +}); +console.log(response); +---- diff --git a/docs/doc_examples/6f8bdca97e43aac75e32de655aa4314a.asciidoc b/docs/doc_examples/6f8bdca97e43aac75e32de655aa4314a.asciidoc new file mode 100644 index 000000000..b1295fe7d --- /dev/null +++ b/docs/doc_examples/6f8bdca97e43aac75e32de655aa4314a.asciidoc @@ -0,0 +1,10 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.connector.delete({ + connector_id: "my-connector-id&delete_sync_jobs=true", +}); +console.log(response); +---- diff --git a/docs/doc_examples/8d750dfc067b1184c32a2423c60e4d06.asciidoc b/docs/doc_examples/7163346755400594d1dd7e445aa19ff0.asciidoc similarity index 59% rename from docs/doc_examples/8d750dfc067b1184c32a2423c60e4d06.asciidoc rename to docs/doc_examples/7163346755400594d1dd7e445aa19ff0.asciidoc index 1e0682cbf..cbb6b62da 100644 --- a/docs/doc_examples/8d750dfc067b1184c32a2423c60e4d06.asciidoc +++ b/docs/doc_examples/7163346755400594d1dd7e445aa19ff0.asciidoc @@ -4,14 +4,7 @@ [source, js] ---- const response = await client.search({ - index: "my-index", - query: { - semantic: { - field: "inference_field", - query: "mountain lake", - inner_hits: {}, - }, - }, + index: "music", }); console.log(response); ---- diff --git a/docs/doc_examples/7a27336a61284d079f3cc3994cf927d1.asciidoc b/docs/doc_examples/7a27336a61284d079f3cc3994cf927d1.asciidoc new file mode 100644 index 000000000..a289078cb --- /dev/null +++ b/docs/doc_examples/7a27336a61284d079f3cc3994cf927d1.asciidoc @@ -0,0 +1,50 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.security.createApiKey({ + name: "my-api-key", + role_descriptors: { + "role-source1": { + indices: [ + { + names: ["source1"], + privileges: ["read"], + query: { + template: { + params: { + access_control: [ + "example.user@example.com", + "source1-user-group", + ], + }, + }, + source: "...", + }, + }, + ], + }, + "role-source2": { + indices: [ + { + names: ["source2"], + privileges: ["read"], + query: { + template: { + params: { + access_control: [ + "example.user@example.com", + "source2-user-group", + ], + }, + }, + source: "...", + }, + }, + ], + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/7af1f62b0cf496cbf593d83d30b472cc.asciidoc b/docs/doc_examples/7af1f62b0cf496cbf593d83d30b472cc.asciidoc new file mode 100644 index 000000000..838cdbbbd --- /dev/null +++ b/docs/doc_examples/7af1f62b0cf496cbf593d83d30b472cc.asciidoc @@ -0,0 +1,22 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.security.createApiKey({ + name: "music-connector", + role_descriptors: { + "music-connector-role": { + cluster: ["monitor", "manage_connector"], + indices: [ + { + names: ["music", ".search-acl-filter-music", ".elastic-connectors*"], + privileges: ["all"], + allow_restricted_indices: false, + }, + ], + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/7b1b947bddd7e78f77da265f7e645a61.asciidoc b/docs/doc_examples/7b1b947bddd7e78f77da265f7e645a61.asciidoc deleted file mode 100644 index 56a48d68d..000000000 --- a/docs/doc_examples/7b1b947bddd7e78f77da265f7e645a61.asciidoc +++ /dev/null @@ -1,51 +0,0 @@ -// This file is autogenerated, DO NOT EDIT -// Use `node scripts/generate-docs-examples.js` to generate the docs examples - -[source, js] ----- -const response = await client.indices.create({ - index: "my-index-000004", - mappings: { - properties: { - metrics: { - subobjects: "auto", - properties: { - time: { - type: "object", - properties: { - min: { - type: "long", - }, - }, - }, - to: { - type: "object", - properties: { - inner_metrics: { - type: "object", - subobjects: "auto", - properties: { - time: { - type: "object", - properties: { - max: { - type: "long", - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, -}); -console.log(response); - -const response1 = await client.indices.getMapping({ - index: "my-index-000004", -}); -console.log(response1); ----- diff --git a/docs/doc_examples/8477e77e4fad19af66f03f81b8f2592b.asciidoc b/docs/doc_examples/8477e77e4fad19af66f03f81b8f2592b.asciidoc deleted file mode 100644 index 246988f49..000000000 --- a/docs/doc_examples/8477e77e4fad19af66f03f81b8f2592b.asciidoc +++ /dev/null @@ -1,20 +0,0 @@ -// This file is autogenerated, DO NOT EDIT -// Use `node scripts/generate-docs-examples.js` to generate the docs examples - -[source, js] ----- -const response = await client.search({ - index: "my-index", - query: { - semantic: { - field: "inference_field", - query: "mountain lake", - inner_hits: { - from: 1, - size: 1, - }, - }, - }, -}); -console.log(response); ----- diff --git a/docs/doc_examples/998c8479c8704bca0e121d5969859517.asciidoc b/docs/doc_examples/998c8479c8704bca0e121d5969859517.asciidoc new file mode 100644 index 000000000..130ceb562 --- /dev/null +++ b/docs/doc_examples/998c8479c8704bca0e121d5969859517.asciidoc @@ -0,0 +1,10 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.count({ + index: "music", +}); +console.log(response); +---- diff --git a/docs/doc_examples/9bd5a470ee6d2b4a1f5280adc39675d2.asciidoc b/docs/doc_examples/9bd5a470ee6d2b4a1f5280adc39675d2.asciidoc new file mode 100644 index 000000000..2a2b518d4 --- /dev/null +++ b/docs/doc_examples/9bd5a470ee6d2b4a1f5280adc39675d2.asciidoc @@ -0,0 +1,35 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.update({ + index: ".elastic-connectors", + id: "connector_id", + doc: { + configuration: { + tables: { + type: "list", + value: "*", + }, + ssl_enabled: { + type: "bool", + value: false, + }, + ssl_ca: { + type: "str", + value: "", + }, + fetch_size: { + type: "int", + value: 50, + }, + retry_count: { + type: "int", + value: 3, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/b8400dbe39215705060500f0e569f452.asciidoc b/docs/doc_examples/b8400dbe39215705060500f0e569f452.asciidoc new file mode 100644 index 000000000..efd531967 --- /dev/null +++ b/docs/doc_examples/b8400dbe39215705060500f0e569f452.asciidoc @@ -0,0 +1,10 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.connector.get({ + connector_id: "my-connector-id", +}); +console.log(response); +---- diff --git a/docs/doc_examples/8575c966b004fb124c7afd6bb5827b50.asciidoc b/docs/doc_examples/c26b185952ddf9842e18493aca2de147.asciidoc similarity index 100% rename from docs/doc_examples/8575c966b004fb124c7afd6bb5827b50.asciidoc rename to docs/doc_examples/c26b185952ddf9842e18493aca2de147.asciidoc diff --git a/docs/doc_examples/c4654a4ca2f4600606dcc5bf37186c0b.asciidoc b/docs/doc_examples/c4654a4ca2f4600606dcc5bf37186c0b.asciidoc new file mode 100644 index 000000000..674854196 --- /dev/null +++ b/docs/doc_examples/c4654a4ca2f4600606dcc5bf37186c0b.asciidoc @@ -0,0 +1,14 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.esql.asyncQuery({ + format: "json", + body: { + query: + "\n FROM cluster_one:my-index*,cluster_two:logs*\n | STATS COUNT(http.response.status_code) BY user.id\n | LIMIT 2\n ", + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/d1ea13e1e8372cbf1480a414723ff55a.asciidoc b/docs/doc_examples/d1ea13e1e8372cbf1480a414723ff55a.asciidoc new file mode 100644 index 000000000..8f098647f --- /dev/null +++ b/docs/doc_examples/d1ea13e1e8372cbf1480a414723ff55a.asciidoc @@ -0,0 +1,26 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.security.createApiKey({ + name: "connector_name-connector-api-key", + role_descriptors: { + "connector_name-connector-role": { + cluster: ["monitor", "manage_connector"], + indices: [ + { + names: [ + "index_name", + ".search-acl-filter-index_name", + ".elastic-connectors*", + ], + privileges: ["all"], + allow_restricted_indices: false, + }, + ], + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/dbb8fa2b8af6db66cf75ca4b83c0fb21.asciidoc b/docs/doc_examples/dbb8fa2b8af6db66cf75ca4b83c0fb21.asciidoc deleted file mode 100644 index db6a26798..000000000 --- a/docs/doc_examples/dbb8fa2b8af6db66cf75ca4b83c0fb21.asciidoc +++ /dev/null @@ -1,68 +0,0 @@ -// This file is autogenerated, DO NOT EDIT -// Use `node scripts/generate-docs-examples.js` to generate the docs examples - -[source, js] ----- -const response = await client.indices.create({ - index: "my-index-000002", - mappings: { - properties: { - metrics: { - type: "object", - subobjects: "auto", - properties: { - inner: { - type: "object", - enabled: false, - }, - nested: { - type: "nested", - }, - }, - }, - }, - }, -}); -console.log(response); - -const response1 = await client.index({ - index: "my-index-000002", - id: "metric_1", - document: { - "metrics.time": 100, - "metrics.time.min": 10, - "metrics.time.max": 900, - }, -}); -console.log(response1); - -const response2 = await client.index({ - index: "my-index-000002", - id: "metric_2", - document: { - metrics: { - time: 100, - "time.min": 10, - "time.max": 900, - inner: { - foo: "bar", - "path.to.some.field": "baz", - }, - nested: [ - { - id: 10, - }, - { - id: 1, - }, - ], - }, - }, -}); -console.log(response2); - -const response3 = await client.indices.getMapping({ - index: "my-index-000002", -}); -console.log(response3); ----- diff --git a/docs/doc_examples/3ff634a50e2e4556bad7ea8553576992.asciidoc b/docs/doc_examples/dd3ee00ab2af607b32532180d60a41d4.asciidoc similarity index 94% rename from docs/doc_examples/3ff634a50e2e4556bad7ea8553576992.asciidoc rename to docs/doc_examples/dd3ee00ab2af607b32532180d60a41d4.asciidoc index 48e3ffcda..ad777029c 100644 --- a/docs/doc_examples/3ff634a50e2e4556bad7ea8553576992.asciidoc +++ b/docs/doc_examples/dd3ee00ab2af607b32532180d60a41d4.asciidoc @@ -16,7 +16,7 @@ const response = await client.indices.create({ filter: { my_snow: { type: "snowball", - language: "Lovins", + language: "English", }, }, }, diff --git a/docs/doc_examples/eed968e0d9fa2a4545c36a4e5f47b64b.asciidoc b/docs/doc_examples/eed968e0d9fa2a4545c36a4e5f47b64b.asciidoc new file mode 100644 index 000000000..68ca702c1 --- /dev/null +++ b/docs/doc_examples/eed968e0d9fa2a4545c36a4e5f47b64b.asciidoc @@ -0,0 +1,14 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.esql.asyncQuery({ + format: "json", + body: { + query: + "\n FROM my-index-000001,cluster_one:my-index-000001,cluster_two:my-index*\n | STATS COUNT(http.response.status_code) BY user.id\n | LIMIT 2\n ", + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/9dfe3b02bd15409b4b8b36e9756e8f94.asciidoc b/docs/doc_examples/ef643bab44e7de6ddddde23a2eece5c7.asciidoc similarity index 53% rename from docs/doc_examples/9dfe3b02bd15409b4b8b36e9756e8f94.asciidoc rename to docs/doc_examples/ef643bab44e7de6ddddde23a2eece5c7.asciidoc index c55dc60ae..3f692157d 100644 --- a/docs/doc_examples/9dfe3b02bd15409b4b8b36e9756e8f94.asciidoc +++ b/docs/doc_examples/ef643bab44e7de6ddddde23a2eece5c7.asciidoc @@ -4,13 +4,13 @@ [source, js] ---- const response = await client.index({ - index: "my-index", - id: "lake_tahoe", + index: "books", document: { - inference_field: [ - "Lake Tahoe is the largest alpine lake in North America", - "When hiking in the area, please be on alert for bears", - ], + name: "The Great Gatsby", + author: "F. Scott Fitzgerald", + release_date: "1925-04-10", + page_count: 180, + language: "EN", }, }); console.log(response); diff --git a/docs/doc_examples/f321d4e92aa83d573ecf52bf56b0b774.asciidoc b/docs/doc_examples/f321d4e92aa83d573ecf52bf56b0b774.asciidoc new file mode 100644 index 000000000..8e0dd2359 --- /dev/null +++ b/docs/doc_examples/f321d4e92aa83d573ecf52bf56b0b774.asciidoc @@ -0,0 +1,15 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.transport.request({ + method: "POST", + path: "/_connector/_sync_job", + body: { + id: "my-connector-id", + job_type: "full", + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/f625fdbbe78c4198d9e40b35f3f008b3.asciidoc b/docs/doc_examples/f625fdbbe78c4198d9e40b35f3f008b3.asciidoc new file mode 100644 index 000000000..c506a9e44 --- /dev/null +++ b/docs/doc_examples/f625fdbbe78c4198d9e40b35f3f008b3.asciidoc @@ -0,0 +1,14 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.update({ + index: ".elastic-connectors", + id: "connector-id", + doc: { + custom_scheduling: {}, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/f679e414de48b8fe25e458844be05618.asciidoc b/docs/doc_examples/f679e414de48b8fe25e458844be05618.asciidoc new file mode 100644 index 000000000..1c0fa96c5 --- /dev/null +++ b/docs/doc_examples/f679e414de48b8fe25e458844be05618.asciidoc @@ -0,0 +1,13 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.connector.put({ + connector_id: "my-connector-id", + name: "Music catalog", + index_name: "music", + service_type: "postgresql", +}); +console.log(response); +---- diff --git a/docs/doc_examples/f6f647eb644a2d236637ff05f833cb73.asciidoc b/docs/doc_examples/f6f647eb644a2d236637ff05f833cb73.asciidoc new file mode 100644 index 000000000..81783cf66 --- /dev/null +++ b/docs/doc_examples/f6f647eb644a2d236637ff05f833cb73.asciidoc @@ -0,0 +1,12 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.connector.secretPost({ + body: { + value: "encoded_api_key", + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/fb56c2ac77d4c308d7702b6b33698382.asciidoc b/docs/doc_examples/fb56c2ac77d4c308d7702b6b33698382.asciidoc new file mode 100644 index 000000000..1405a070d --- /dev/null +++ b/docs/doc_examples/fb56c2ac77d4c308d7702b6b33698382.asciidoc @@ -0,0 +1,12 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.connector.updateApiKeyId({ + connector_id: "my_connector_id>", + api_key_id: "API key_id", + api_key_secret_id: "secret_id", +}); +console.log(response); +---- diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 8036726c6..51cb7d989 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -925,7 +925,7 @@ client.search({ ... }) ** *`index` (Optional, string | string[])*: List of data streams, indices, and aliases to search. Supports wildcards (`*`). To search all data streams and indices, omit this parameter or use `*` or `_all`. -** *`aggregations` (Optional, Record)*: Defines the aggregations that are run as part of the search request. +** *`aggregations` (Optional, Record)*: Defines the aggregations that are run as part of the search request. ** *`collapse` (Optional, { field, inner_hits, max_concurrent_group_searches, collapse })*: Collapses search results the values of the specified field. ** *`explain` (Optional, boolean)*: If true, returns detailed information about score computation as part of a hit. ** *`ext` (Optional, Record)*: Configuration of search extensions defined by Elasticsearch plugins. @@ -1082,7 +1082,7 @@ client.searchMvt({ index, field, zoom, x, y }) ** *`zoom` (number)*: Zoom level for the vector tile to search ** *`x` (number)*: X coordinate for the vector tile to search ** *`y` (number)*: Y coordinate for the vector tile to search -** *`aggs` (Optional, Record)*: Sub-aggregations for the geotile_grid. +** *`aggs` (Optional, Record)*: Sub-aggregations for the geotile_grid. Supports the following aggregation types: - avg @@ -1458,7 +1458,7 @@ client.asyncSearch.submit({ ... }) * *Request (object):* ** *`index` (Optional, string | string[])*: A list of index names to search; use `_all` or empty string to perform the operation on all indices -** *`aggregations` (Optional, Record)* +** *`aggregations` (Optional, Record)* ** *`collapse` (Optional, { field, inner_hits, max_concurrent_group_searches, collapse })* ** *`explain` (Optional, boolean)*: If true, returns detailed information about score computation as part of a hit. ** *`ext` (Optional, Record)*: Configuration of search extensions defined by Elasticsearch plugins. @@ -3611,7 +3611,7 @@ client.fleet.search({ index }) * *Request (object):* ** *`index` (string | string)*: A single target to search. If the target is an index alias, it must resolve to a single index. -** *`aggregations` (Optional, Record)* +** *`aggregations` (Optional, Record)* ** *`collapse` (Optional, { field, inner_hits, max_concurrent_group_searches, collapse })* ** *`explain` (Optional, boolean)*: If true, returns detailed information about score computation as part of a hit. ** *`ext` (Optional, Record)*: Configuration of search extensions defined by Elasticsearch plugins. @@ -3824,7 +3824,7 @@ Manually moves an index into the specified step and executes that step. {ref}/ilm-move-to-step.html[Endpoint documentation] [source,ts] ---- -client.ilm.moveToStep({ index }) +client.ilm.moveToStep({ index, current_step, next_step }) ---- [discrete] @@ -3832,8 +3832,8 @@ client.ilm.moveToStep({ index }) * *Request (object):* ** *`index` (string)*: The name of the index whose lifecycle step is to change -** *`current_step` (Optional, { action, name, phase })* -** *`next_step` (Optional, { action, name, phase })* +** *`current_step` ({ action, name, phase })* +** *`next_step` ({ action, name, phase })* [discrete] ==== put_lifecycle @@ -4914,7 +4914,7 @@ client.indices.putIndexTemplate({ name }) Component templates are merged in the order specified, meaning that the last component template specified has the highest precedence. ** *`template` (Optional, { aliases, mappings, settings, lifecycle })*: Template to be applied. It may optionally include an `aliases`, `mappings`, or `settings` configuration. -** *`data_stream` (Optional, { hidden })*: If this object is included, the template is used to create data streams and their backing indices. +** *`data_stream` (Optional, { hidden, allow_custom_routing })*: If this object is included, the template is used to create data streams and their backing indices. Supports an empty object. Data streams require a matching index template with a `data_stream` object. ** *`priority` (Optional, number)*: Priority to determine index template precedence when a new data stream or index is created. @@ -5335,7 +5335,7 @@ If set to `false`, then indices or data streams matching the template must alway Component templates are merged in the order specified, meaning that the last component template specified has the highest precedence. ** *`template` (Optional, { aliases, mappings, settings, lifecycle })*: Template to be applied. It may optionally include an `aliases`, `mappings`, or `settings` configuration. -** *`data_stream` (Optional, { hidden })*: If this object is included, the template is used to create data streams and their backing indices. +** *`data_stream` (Optional, { hidden, allow_custom_routing })*: If this object is included, the template is used to create data streams and their backing indices. Supports an empty object. Data streams require a matching index template with a `data_stream` object. ** *`priority` (Optional, number)*: Priority to determine index template precedence when a new data stream or index is created. @@ -7267,7 +7267,7 @@ client.ml.putDatafeed({ datafeed_id }) ** *`datafeed_id` (string)*: A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters. -** *`aggregations` (Optional, Record)*: If set, the datafeed performs aggregation searches. +** *`aggregations` (Optional, Record)*: If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only with low cardinality data. ** *`chunking_config` (Optional, { mode, time_span })*: Datafeeds might be required to search over long time periods, for several months or years. This search is split into time chunks in order to ensure the load on Elasticsearch is managed. @@ -7798,7 +7798,7 @@ client.ml.updateDatafeed({ datafeed_id }) ** *`datafeed_id` (string)*: A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters. -** *`aggregations` (Optional, Record)*: If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only +** *`aggregations` (Optional, Record)*: If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only with low cardinality data. ** *`chunking_config` (Optional, { mode, time_span })*: Datafeeds might search over long time periods, for several months or years. This search is split into time chunks in order to ensure the load on Elasticsearch is managed. Chunking configuration controls how the size of @@ -8431,7 +8431,7 @@ client.rollup.rollupSearch({ index }) * *Request (object):* ** *`index` (string | string[])*: Enables searching rolled-up data using the standard Query DSL. -** *`aggregations` (Optional, Record)*: Specifies aggregations. +** *`aggregations` (Optional, Record)*: Specifies aggregations. ** *`query` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Specifies a DSL query. ** *`size` (Optional, number)*: Must be zero if set, as rollups work on pre-aggregated data. ** *`rest_total_hits_as_int` (Optional, boolean)*: Indicates whether hits.total should be rendered as an integer or an object in the rest search response diff --git a/src/api/types.ts b/src/api/types.ts index 7211d8512..e1e5f0b9e 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -2742,7 +2742,7 @@ export interface ShardStatistics { } export interface ShardsOperationResponseBase { - _shards: ShardStatistics + _shards?: ShardStatistics } export interface SlicedScroll { @@ -3002,6 +3002,7 @@ export interface AggregationsAggregationContainer { rare_terms?: AggregationsRareTermsAggregation rate?: AggregationsRateAggregation reverse_nested?: AggregationsReverseNestedAggregation + random_sampler?: AggregationsRandomSamplerAggregation sampler?: AggregationsSamplerAggregation scripted_metric?: AggregationsScriptedMetricAggregation serial_diff?: AggregationsSerialDifferencingAggregation @@ -3889,6 +3890,12 @@ export interface AggregationsPipelineAggregationBase extends AggregationsBucketP gap_policy?: AggregationsGapPolicy } +export interface AggregationsRandomSamplerAggregation extends AggregationsBucketAggregationBase { + probability: double + seed?: integer + shard_seed?: integer +} + export interface AggregationsRangeAggregate extends AggregationsMultiBucketAggregateBase { } @@ -10284,15 +10291,15 @@ export interface IlmMigrateToDataTiersResponse { export interface IlmMoveToStepRequest extends RequestBase { index: IndexName - current_step?: IlmMoveToStepStepKey - next_step?: IlmMoveToStepStepKey + current_step: IlmMoveToStepStepKey + next_step: IlmMoveToStepStepKey } export type IlmMoveToStepResponse = AcknowledgedResponseBase export interface IlmMoveToStepStepKey { - action: string - name: string + action?: string + name?: string phase: string } @@ -10416,6 +10423,7 @@ export interface IndicesDataStreamTimestampField { export interface IndicesDataStreamVisibility { hidden?: boolean + allow_custom_routing?: boolean } export interface IndicesDownsampleConfig { diff --git a/src/api/typesWithBodyKey.ts b/src/api/typesWithBodyKey.ts index 30b7994c2..d83114a16 100644 --- a/src/api/typesWithBodyKey.ts +++ b/src/api/typesWithBodyKey.ts @@ -2815,7 +2815,7 @@ export interface ShardStatistics { } export interface ShardsOperationResponseBase { - _shards: ShardStatistics + _shards?: ShardStatistics } export interface SlicedScroll { @@ -3075,6 +3075,7 @@ export interface AggregationsAggregationContainer { rare_terms?: AggregationsRareTermsAggregation rate?: AggregationsRateAggregation reverse_nested?: AggregationsReverseNestedAggregation + random_sampler?: AggregationsRandomSamplerAggregation sampler?: AggregationsSamplerAggregation scripted_metric?: AggregationsScriptedMetricAggregation serial_diff?: AggregationsSerialDifferencingAggregation @@ -3962,6 +3963,12 @@ export interface AggregationsPipelineAggregationBase extends AggregationsBucketP gap_policy?: AggregationsGapPolicy } +export interface AggregationsRandomSamplerAggregation extends AggregationsBucketAggregationBase { + probability: double + seed?: integer + shard_seed?: integer +} + export interface AggregationsRangeAggregate extends AggregationsMultiBucketAggregateBase { } @@ -10454,16 +10461,16 @@ export interface IlmMoveToStepRequest extends RequestBase { index: IndexName /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ body?: { - current_step?: IlmMoveToStepStepKey - next_step?: IlmMoveToStepStepKey + current_step: IlmMoveToStepStepKey + next_step: IlmMoveToStepStepKey } } export type IlmMoveToStepResponse = AcknowledgedResponseBase export interface IlmMoveToStepStepKey { - action: string - name: string + action?: string + name?: string phase: string } @@ -10590,6 +10597,7 @@ export interface IndicesDataStreamTimestampField { export interface IndicesDataStreamVisibility { hidden?: boolean + allow_custom_routing?: boolean } export interface IndicesDownsampleConfig {