From 0a5c00255b2512d9891321727fc90fdef6f6caa3 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Mon, 3 Mar 2025 06:03:53 +0000 Subject: [PATCH] Auto-generated API code --- .../0bee07a581c5776e068f6f4efad5a399.asciidoc | 16 +-- .../0dfde6a9d953822fd4b3aa0121ddd8fb.asciidoc | 31 +++--- .../120fcf9f55128d6a81d5e87a9c235bbd.asciidoc | 22 ++-- .../13d91782399ba1f291e103c18b5338cc.asciidoc | 25 +++++ .../141ef0ebaa3b0772892b79b9bb85efb0.asciidoc | 5 +- .../15ac33d641b376d9494075eb1f0d4066.asciidoc | 10 ++ .../174b93c323aa8e9cc8ee2a3df5736810.asciidoc | 12 +++ .../19c00c6b29bc7dbc5e92b3668da2da93.asciidoc | 34 +++--- .../29aeabacb1fdf5b083d5f091b6d1bd44.asciidoc | 15 +++ .../2a1eece9a59ac1773edcf0a932c26de0.asciidoc | 12 +-- .../2afdf0d83724953aa2875b5fb37d60cc.asciidoc | 9 +- .../2f9ee29fe49f7d206a41212aa5945296.asciidoc | 22 ++++ .../3649194a97d265a3bc758f8b38f7561e.asciidoc | 21 ++++ .../3f1fe5f5f99b98d0891f38003e10b636.asciidoc | 12 +-- .../405511f7c1f12cc0a227b4563fe7b2e2.asciidoc | 5 +- .../45954b8aaedfed57012be8b6538b0a24.asciidoc | 62 ++++++----- .../46b771a9932c3fa6057a7b2679c72ef0.asciidoc | 10 ++ .../4982c547be1ad9455ae836990aea92c5.asciidoc | 5 + .../4b91ad7c9b44e07db4a4e81390f19ad3.asciidoc | 10 +- .../57dc15e5ad663c342fd5c1d86fcd1b29.asciidoc | 12 +-- .../5bba213a7f543190139d1a69ab2ed076.asciidoc | 16 +-- .../615dc36f0978c676624fb7d1144b4899.asciidoc | 11 ++ .../66915e95b723ee2f6e5164a94b8f98c1.asciidoc | 12 +++ .../67b71a95b6fe6c83faae51ea038a1bf1.asciidoc | 10 ++ .../6f3b723bf6179b96c3413597ed7f49e1.asciidoc | 8 +- .../77518e8c6198acfe77c0934fd2fe65cb.asciidoc | 54 +++++----- .../7ba29f0be2297b54a640b0a17d7ef5ca.asciidoc | 5 +- .../80dd7f5882c59b9c1c90e8351937441f.asciidoc | 38 +++---- .../82bb6c61dab959f4446dc5ecab7ecbdf.asciidoc | 48 ++++----- .../91e106a2affbc8df32cd940684a779ed.asciidoc | 7 +- .../947efe87db7f8813c0878f8affc3e2d1.asciidoc | 8 ++ .../99fb82d49ac477e6a9dfdd71f9465374.asciidoc | 5 +- .../9afa0844883b7471883aa378a8dd10b4.asciidoc | 8 +- .../9c01db07c9ac395b6370e3b33965c21f.asciidoc | 16 ++- .../a162eb50853331c80596f5994e9d1c38.asciidoc | 11 +- .../a60aaed30d7d26eaacbb2c0ed4ddc66d.asciidoc | 10 ++ .../adced6e22ef03c2ae3b14aa5bdd24fd9.asciidoc | 10 ++ .../b0bddf2ffaa83049b195829c06b875cd.asciidoc | 5 +- .../b1e81b70b874a1f0cf75a0ec6e430ddc.asciidoc | 10 ++ .../b62eaa20c4e0e48134a6d1d1b3c30b26.asciidoc | 10 +- .../bcdfaa4487747249699a86a0dcd22f5e.asciidoc | 50 ++++----- .../c580990a70028bb49cca8a6bde86bbf6.asciidoc | 10 +- .../ccc613951c61f0b17e1ed8a2d3ae54a2.asciidoc | 100 +++++++++--------- .../d35c8cf7a98b3f112e1de8797ec6689d.asciidoc | 10 +- .../d4df39f72d3a3b80cd4042f6a21c3f19.asciidoc | 7 +- .../d8c053ee26c1533ce936ec81101d8e1b.asciidoc | 5 +- .../dd71b0c9f9197684ff29c61062c55660.asciidoc | 5 +- .../dde92fdf3469349ffe2c81764333543a.asciidoc | 14 +++ .../e3019fd5f23458ae49ad9854c97d321c.asciidoc | 8 +- .../e4b38973c74037335378d8480f1ce894.asciidoc | 56 +++++----- .../ec135f0cc0d3f526df68000b2a95c65b.asciidoc | 12 +++ src/api/types.ts | 1 - src/api/typesWithBodyKey.ts | 1 - 53 files changed, 523 insertions(+), 408 deletions(-) create mode 100644 docs/doc_examples/13d91782399ba1f291e103c18b5338cc.asciidoc create mode 100644 docs/doc_examples/15ac33d641b376d9494075eb1f0d4066.asciidoc create mode 100644 docs/doc_examples/174b93c323aa8e9cc8ee2a3df5736810.asciidoc create mode 100644 docs/doc_examples/29aeabacb1fdf5b083d5f091b6d1bd44.asciidoc create mode 100644 docs/doc_examples/2f9ee29fe49f7d206a41212aa5945296.asciidoc create mode 100644 docs/doc_examples/3649194a97d265a3bc758f8b38f7561e.asciidoc create mode 100644 docs/doc_examples/46b771a9932c3fa6057a7b2679c72ef0.asciidoc create mode 100644 docs/doc_examples/615dc36f0978c676624fb7d1144b4899.asciidoc create mode 100644 docs/doc_examples/66915e95b723ee2f6e5164a94b8f98c1.asciidoc create mode 100644 docs/doc_examples/67b71a95b6fe6c83faae51ea038a1bf1.asciidoc create mode 100644 docs/doc_examples/947efe87db7f8813c0878f8affc3e2d1.asciidoc create mode 100644 docs/doc_examples/a60aaed30d7d26eaacbb2c0ed4ddc66d.asciidoc create mode 100644 docs/doc_examples/adced6e22ef03c2ae3b14aa5bdd24fd9.asciidoc create mode 100644 docs/doc_examples/b1e81b70b874a1f0cf75a0ec6e430ddc.asciidoc create mode 100644 docs/doc_examples/dde92fdf3469349ffe2c81764333543a.asciidoc create mode 100644 docs/doc_examples/ec135f0cc0d3f526df68000b2a95c65b.asciidoc diff --git a/docs/doc_examples/0bee07a581c5776e068f6f4efad5a399.asciidoc b/docs/doc_examples/0bee07a581c5776e068f6f4efad5a399.asciidoc index 506e4ff5b..486847ab6 100644 --- a/docs/doc_examples/0bee07a581c5776e068f6f4efad5a399.asciidoc +++ b/docs/doc_examples/0bee07a581c5776e068f6f4efad5a399.asciidoc @@ -3,17 +3,11 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_query/async", - querystring: { - 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 ", - include_ccs_metadata: true, - }, +const response = await client.esql.asyncQuery({ + format: "json", + 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 ", + include_ccs_metadata: true, }); console.log(response); ---- diff --git a/docs/doc_examples/0dfde6a9d953822fd4b3aa0121ddd8fb.asciidoc b/docs/doc_examples/0dfde6a9d953822fd4b3aa0121ddd8fb.asciidoc index 045036fa2..5627427c4 100644 --- a/docs/doc_examples/0dfde6a9d953822fd4b3aa0121ddd8fb.asciidoc +++ b/docs/doc_examples/0dfde6a9d953822fd4b3aa0121ddd8fb.asciidoc @@ -3,23 +3,20 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_application/search_application/my-app/_render_query", - body: { - params: { - query_string: "my first query", - text_fields: [ - { - name: "title", - boost: 5, - }, - { - name: "description", - boost: 1, - }, - ], - }, +const response = await client.searchApplication.renderQuery({ + name: "my-app", + params: { + query_string: "my first query", + text_fields: [ + { + name: "title", + boost: 5, + }, + { + name: "description", + boost: 1, + }, + ], }, }); console.log(response); diff --git a/docs/doc_examples/120fcf9f55128d6a81d5e87a9c235bbd.asciidoc b/docs/doc_examples/120fcf9f55128d6a81d5e87a9c235bbd.asciidoc index f6c1cb881..fbfd1cfc5 100644 --- a/docs/doc_examples/120fcf9f55128d6a81d5e87a9c235bbd.asciidoc +++ b/docs/doc_examples/120fcf9f55128d6a81d5e87a9c235bbd.asciidoc @@ -3,18 +3,16 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_inference/chat_completion/openai-completion/_stream", - body: { - model: "gpt-4o", - messages: [ - { - role: "user", - content: "What is Elastic?", - }, - ], - }, +const response = await client.inference.streamInference({ + task_type: "chat_completion", + inference_id: "openai-completion", + model: "gpt-4o", + messages: [ + { + role: "user", + content: "What is Elastic?", + }, + ], }); console.log(response); ---- diff --git a/docs/doc_examples/13d91782399ba1f291e103c18b5338cc.asciidoc b/docs/doc_examples/13d91782399ba1f291e103c18b5338cc.asciidoc new file mode 100644 index 000000000..c8f218cc1 --- /dev/null +++ b/docs/doc_examples/13d91782399ba1f291e103c18b5338cc.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.createFrom({ + source: "my-index", + dest: "my-new-index", + create_from: { + settings_override: { + index: { + number_of_shards: 5, + }, + }, + mappings_override: { + properties: { + field2: { + type: "boolean", + }, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/141ef0ebaa3b0772892b79b9bb85efb0.asciidoc b/docs/doc_examples/141ef0ebaa3b0772892b79b9bb85efb0.asciidoc index 7d7aeab98..5387dbba3 100644 --- a/docs/doc_examples/141ef0ebaa3b0772892b79b9bb85efb0.asciidoc +++ b/docs/doc_examples/141ef0ebaa3b0772892b79b9bb85efb0.asciidoc @@ -3,9 +3,8 @@ [source, js] ---- -const response = await client.inference.put({ - task_type: "my-inference-endpoint", - inference_id: "_update", +const response = await client.inference.update({ + inference_id: "my-inference-endpoint", inference_config: { service_settings: { api_key: "", diff --git a/docs/doc_examples/15ac33d641b376d9494075eb1f0d4066.asciidoc b/docs/doc_examples/15ac33d641b376d9494075eb1f0d4066.asciidoc new file mode 100644 index 000000000..73da91b2d --- /dev/null +++ b/docs/doc_examples/15ac33d641b376d9494075eb1f0d4066.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.cancelMigrateReindex({ + index: "my-data-stream", +}); +console.log(response); +---- diff --git a/docs/doc_examples/174b93c323aa8e9cc8ee2a3df5736810.asciidoc b/docs/doc_examples/174b93c323aa8e9cc8ee2a3df5736810.asciidoc new file mode 100644 index 000000000..99a0f8861 --- /dev/null +++ b/docs/doc_examples/174b93c323aa8e9cc8ee2a3df5736810.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.security.delegatePki({ + x509_certificate_chain: [ + "MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==", + ], +}); +console.log(response); +---- diff --git a/docs/doc_examples/19c00c6b29bc7dbc5e92b3668da2da93.asciidoc b/docs/doc_examples/19c00c6b29bc7dbc5e92b3668da2da93.asciidoc index 724b30762..ab8b0fd13 100644 --- a/docs/doc_examples/19c00c6b29bc7dbc5e92b3668da2da93.asciidoc +++ b/docs/doc_examples/19c00c6b29bc7dbc5e92b3668da2da93.asciidoc @@ -3,27 +3,23 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_ingest/_simulate", - body: { - docs: [ - { - _index: "my-index", - _id: "123", - _source: { - foo: "bar", - }, +const response = await client.simulate.ingest({ + docs: [ + { + _index: "my-index", + _id: "123", + _source: { + foo: "bar", }, - { - _index: "my-index", - _id: "456", - _source: { - foo: "rab", - }, + }, + { + _index: "my-index", + _id: "456", + _source: { + foo: "rab", }, - ], - }, + }, + ], }); console.log(response); ---- diff --git a/docs/doc_examples/29aeabacb1fdf5b083d5f091b6d1bd44.asciidoc b/docs/doc_examples/29aeabacb1fdf5b083d5f091b6d1bd44.asciidoc new file mode 100644 index 000000000..b98cfe9a8 --- /dev/null +++ b/docs/doc_examples/29aeabacb1fdf5b083d5f091b6d1bd44.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.migrateReindex({ + reindex: { + source: { + index: "my-data-stream", + }, + mode: "upgrade", + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/2a1eece9a59ac1773edcf0a932c26de0.asciidoc b/docs/doc_examples/2a1eece9a59ac1773edcf0a932c26de0.asciidoc index b3545c105..b3ca912d0 100644 --- a/docs/doc_examples/2a1eece9a59ac1773edcf0a932c26de0.asciidoc +++ b/docs/doc_examples/2a1eece9a59ac1773edcf0a932c26de0.asciidoc @@ -3,14 +3,10 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_security/oidc/logout", - body: { - token: - "dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==", - refresh_token: "vLBPvmAB6KvwvJZr27cS", - }, +const response = await client.security.oidcLogout({ + token: + "dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==", + refresh_token: "vLBPvmAB6KvwvJZr27cS", }); console.log(response); ---- diff --git a/docs/doc_examples/2afdf0d83724953aa2875b5fb37d60cc.asciidoc b/docs/doc_examples/2afdf0d83724953aa2875b5fb37d60cc.asciidoc index e05299751..32a8ae35c 100644 --- a/docs/doc_examples/2afdf0d83724953aa2875b5fb37d60cc.asciidoc +++ b/docs/doc_examples/2afdf0d83724953aa2875b5fb37d60cc.asciidoc @@ -3,12 +3,9 @@ [source, js] ---- -const response = await client.transport.request({ - method: "GET", - path: "/_query/async/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=", - querystring: { - wait_for_completion_timeout: "30s", - }, +const response = await client.esql.asyncQueryGet({ + id: "FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=", + wait_for_completion_timeout: "30s", }); console.log(response); ---- diff --git a/docs/doc_examples/2f9ee29fe49f7d206a41212aa5945296.asciidoc b/docs/doc_examples/2f9ee29fe49f7d206a41212aa5945296.asciidoc new file mode 100644 index 000000000..8f98c98a9 --- /dev/null +++ b/docs/doc_examples/2f9ee29fe49f7d206a41212aa5945296.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.indices.createFrom({ + source: "my-index", + dest: "my-new-index", + create_from: { + settings_override: { + index: { + "blocks.write": null, + "blocks.read": null, + "blocks.read_only": null, + "blocks.read_only_allow_delete": null, + "blocks.metadata": null, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/3649194a97d265a3bc758f8b38f7561e.asciidoc b/docs/doc_examples/3649194a97d265a3bc758f8b38f7561e.asciidoc new file mode 100644 index 000000000..e465377fb --- /dev/null +++ b/docs/doc_examples/3649194a97d265a3bc758f8b38f7561e.asciidoc @@ -0,0 +1,21 @@ +// 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: "semantic-embeddings", + mappings: { + properties: { + semantic_text: { + type: "semantic_text", + }, + content: { + type: "text", + copy_to: "semantic_text", + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/3f1fe5f5f99b98d0891f38003e10b636.asciidoc b/docs/doc_examples/3f1fe5f5f99b98d0891f38003e10b636.asciidoc index 221e42b58..be6f3596c 100644 --- a/docs/doc_examples/3f1fe5f5f99b98d0891f38003e10b636.asciidoc +++ b/docs/doc_examples/3f1fe5f5f99b98d0891f38003e10b636.asciidoc @@ -3,14 +3,10 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_query/async", - body: { - query: - "\n FROM library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n ", - wait_for_completion_timeout: "2s", - }, +const response = await client.esql.asyncQuery({ + query: + "\n FROM library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n ", + wait_for_completion_timeout: "2s", }); console.log(response); ---- diff --git a/docs/doc_examples/405511f7c1f12cc0a227b4563fe7b2e2.asciidoc b/docs/doc_examples/405511f7c1f12cc0a227b4563fe7b2e2.asciidoc index 40d330c9d..c63439d9c 100644 --- a/docs/doc_examples/405511f7c1f12cc0a227b4563fe7b2e2.asciidoc +++ b/docs/doc_examples/405511f7c1f12cc0a227b4563fe7b2e2.asciidoc @@ -3,9 +3,8 @@ [source, js] ---- -const response = await client.transport.request({ - method: "GET", - path: "/_query/async/FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=", +const response = await client.esql.asyncQueryGet({ + id: "FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=", }); console.log(response); ---- diff --git a/docs/doc_examples/45954b8aaedfed57012be8b6538b0a24.asciidoc b/docs/doc_examples/45954b8aaedfed57012be8b6538b0a24.asciidoc index a2ff623e6..4d6846969 100644 --- a/docs/doc_examples/45954b8aaedfed57012be8b6538b0a24.asciidoc +++ b/docs/doc_examples/45954b8aaedfed57012be8b6538b0a24.asciidoc @@ -3,44 +3,42 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_inference/chat_completion/openai-completion/_stream", - body: { - messages: [ - { - role: "user", - content: [ - { - type: "text", - text: "What's the price of a scarf?", - }, - ], - }, - ], - tools: [ - { - type: "function", - function: { - name: "get_current_price", - description: "Get the current price of a item", - parameters: { - type: "object", - properties: { - item: { - id: "123", - }, - }, - }, +const response = await client.inference.streamInference({ + task_type: "chat_completion", + inference_id: "openai-completion", + messages: [ + { + role: "user", + content: [ + { + type: "text", + text: "What's the price of a scarf?", }, - }, - ], - tool_choice: { + ], + }, + ], + tools: [ + { type: "function", function: { name: "get_current_price", + description: "Get the current price of a item", + parameters: { + type: "object", + properties: { + item: { + id: "123", + }, + }, + }, }, }, + ], + tool_choice: { + type: "function", + function: { + name: "get_current_price", + }, }, }); console.log(response); diff --git a/docs/doc_examples/46b771a9932c3fa6057a7b2679c72ef0.asciidoc b/docs/doc_examples/46b771a9932c3fa6057a7b2679c72ef0.asciidoc new file mode 100644 index 000000000..b7d64b4c8 --- /dev/null +++ b/docs/doc_examples/46b771a9932c3fa6057a7b2679c72ef0.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.getMigrateReindexStatus({ + index: "my-data-stream", +}); +console.log(response); +---- diff --git a/docs/doc_examples/4982c547be1ad9455ae836990aea92c5.asciidoc b/docs/doc_examples/4982c547be1ad9455ae836990aea92c5.asciidoc index b5d5d91f8..c6c3e829d 100644 --- a/docs/doc_examples/4982c547be1ad9455ae836990aea92c5.asciidoc +++ b/docs/doc_examples/4982c547be1ad9455ae836990aea92c5.asciidoc @@ -6,6 +6,11 @@ const response = await client.ml.startTrainedModelDeployment({ model_id: "my_model", deployment_id: "my_model_for_search", + adaptive_allocations: { + enabled: true, + min_number_of_allocations: 3, + max_number_of_allocations: 10, + }, }); console.log(response); ---- diff --git a/docs/doc_examples/4b91ad7c9b44e07db4a4e81390f19ad3.asciidoc b/docs/doc_examples/4b91ad7c9b44e07db4a4e81390f19ad3.asciidoc index 823515f74..9ae0176bc 100644 --- a/docs/doc_examples/4b91ad7c9b44e07db4a4e81390f19ad3.asciidoc +++ b/docs/doc_examples/4b91ad7c9b44e07db4a4e81390f19ad3.asciidoc @@ -3,12 +3,10 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_inference/completion/openai-completion/_stream", - body: { - input: "What is Elastic?", - }, +const response = await client.inference.streamInference({ + task_type: "completion", + inference_id: "openai-completion", + input: "What is Elastic?", }); console.log(response); ---- diff --git a/docs/doc_examples/57dc15e5ad663c342fd5c1d86fcd1b29.asciidoc b/docs/doc_examples/57dc15e5ad663c342fd5c1d86fcd1b29.asciidoc index 2598c7bce..2e5e87c54 100644 --- a/docs/doc_examples/57dc15e5ad663c342fd5c1d86fcd1b29.asciidoc +++ b/docs/doc_examples/57dc15e5ad663c342fd5c1d86fcd1b29.asciidoc @@ -3,14 +3,10 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_security/oidc/prepare", - body: { - realm: "oidc1", - state: "lGYK0EcSLjqH6pkT5EVZjC6eIW5YCGgywj2sxROO", - nonce: "zOBXLJGUooRrbLbQk5YCcyC8AXw3iloynvluYhZ5", - }, +const response = await client.security.oidcPrepareAuthentication({ + realm: "oidc1", + state: "lGYK0EcSLjqH6pkT5EVZjC6eIW5YCGgywj2sxROO", + nonce: "zOBXLJGUooRrbLbQk5YCcyC8AXw3iloynvluYhZ5", }); console.log(response); ---- diff --git a/docs/doc_examples/5bba213a7f543190139d1a69ab2ed076.asciidoc b/docs/doc_examples/5bba213a7f543190139d1a69ab2ed076.asciidoc index 46cd0a13e..91478f094 100644 --- a/docs/doc_examples/5bba213a7f543190139d1a69ab2ed076.asciidoc +++ b/docs/doc_examples/5bba213a7f543190139d1a69ab2ed076.asciidoc @@ -3,17 +3,11 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_query/async", - querystring: { - 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 ", - include_ccs_metadata: true, - }, +const response = await client.esql.asyncQuery({ + format: "json", + query: + "\n FROM cluster_one:my-index*,cluster_two:logs*\n | STATS COUNT(http.response.status_code) BY user.id\n | LIMIT 2\n ", + include_ccs_metadata: true, }); console.log(response); ---- diff --git a/docs/doc_examples/615dc36f0978c676624fb7d1144b4899.asciidoc b/docs/doc_examples/615dc36f0978c676624fb7d1144b4899.asciidoc new file mode 100644 index 000000000..a1c564297 --- /dev/null +++ b/docs/doc_examples/615dc36f0978c676624fb7d1144b4899.asciidoc @@ -0,0 +1,11 @@ +// 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.getDataLifecycleStats({ + human: "true", + pretty: "true", +}); +console.log(response); +---- diff --git a/docs/doc_examples/66915e95b723ee2f6e5164a94b8f98c1.asciidoc b/docs/doc_examples/66915e95b723ee2f6e5164a94b8f98c1.asciidoc new file mode 100644 index 000000000..c541fd004 --- /dev/null +++ b/docs/doc_examples/66915e95b723ee2f6e5164a94b8f98c1.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.indices.createFrom({ + source: "my-index", + dest: "my-new-index", + create_from: null, +}); +console.log(response); +---- diff --git a/docs/doc_examples/67b71a95b6fe6c83faae51ea038a1bf1.asciidoc b/docs/doc_examples/67b71a95b6fe6c83faae51ea038a1bf1.asciidoc new file mode 100644 index 000000000..09b647d22 --- /dev/null +++ b/docs/doc_examples/67b71a95b6fe6c83faae51ea038a1bf1.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.esql.asyncQueryDelete({ + id: "FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=", +}); +console.log(response); +---- diff --git a/docs/doc_examples/6f3b723bf6179b96c3413597ed7f49e1.asciidoc b/docs/doc_examples/6f3b723bf6179b96c3413597ed7f49e1.asciidoc index f5995e6b6..47b3cfd86 100644 --- a/docs/doc_examples/6f3b723bf6179b96c3413597ed7f49e1.asciidoc +++ b/docs/doc_examples/6f3b723bf6179b96c3413597ed7f49e1.asciidoc @@ -3,12 +3,8 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_security/api_key/_bulk_update", - body: { - ids: ["VuaCfGcBCdbkQm-e5aOx", "H3_AhoIBA9hmeQJdg7ij"], - }, +const response = await client.security.bulkUpdateApiKeys({ + ids: ["VuaCfGcBCdbkQm-e5aOx", "H3_AhoIBA9hmeQJdg7ij"], }); console.log(response); ---- diff --git a/docs/doc_examples/77518e8c6198acfe77c0934fd2fe65cb.asciidoc b/docs/doc_examples/77518e8c6198acfe77c0934fd2fe65cb.asciidoc index ebe4fce86..4a8d900b8 100644 --- a/docs/doc_examples/77518e8c6198acfe77c0934fd2fe65cb.asciidoc +++ b/docs/doc_examples/77518e8c6198acfe77c0934fd2fe65cb.asciidoc @@ -3,35 +3,31 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_text_structure/find_message_structure", - body: { - messages: [ - "[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128", - "[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]", - "[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]", - "[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]", - "[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]", - "[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]", - "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]", - "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]", - "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]", - "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]", - "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]", - "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]", - "[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]", - "[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]", - "[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]", - "[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled", - "[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled", - "[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled", - "[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]", - "[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]", - "[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized", - "[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...", - ], - }, +const response = await client.textStructure.findMessageStructure({ + messages: [ + "[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128", + "[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]", + "[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]", + "[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]", + "[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]", + "[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]", + "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]", + "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]", + "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]", + "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]", + "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]", + "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]", + "[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]", + "[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]", + "[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]", + "[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled", + "[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled", + "[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled", + "[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]", + "[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]", + "[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized", + "[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...", + ], }); console.log(response); ---- diff --git a/docs/doc_examples/7ba29f0be2297b54a640b0a17d7ef5ca.asciidoc b/docs/doc_examples/7ba29f0be2297b54a640b0a17d7ef5ca.asciidoc index d1fcf443c..422e88d26 100644 --- a/docs/doc_examples/7ba29f0be2297b54a640b0a17d7ef5ca.asciidoc +++ b/docs/doc_examples/7ba29f0be2297b54a640b0a17d7ef5ca.asciidoc @@ -3,9 +3,8 @@ [source, js] ---- -const response = await client.transport.request({ - method: "DELETE", - path: "/_ingest/ip_location/database/my-database-id", +const response = await client.ingest.deleteIpLocationDatabase({ + id: "my-database-id", }); console.log(response); ---- diff --git a/docs/doc_examples/80dd7f5882c59b9c1c90e8351937441f.asciidoc b/docs/doc_examples/80dd7f5882c59b9c1c90e8351937441f.asciidoc index 28fdff4a5..3e12f095c 100644 --- a/docs/doc_examples/80dd7f5882c59b9c1c90e8351937441f.asciidoc +++ b/docs/doc_examples/80dd7f5882c59b9c1c90e8351937441f.asciidoc @@ -3,30 +3,26 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_security/api_key/_bulk_update", - body: { - ids: ["VuaCfGcBCdbkQm-e5aOx", "H3_AhoIBA9hmeQJdg7ij"], - role_descriptors: { - "role-a": { - indices: [ - { - names: ["*"], - privileges: ["write"], - }, - ], - }, +const response = await client.security.bulkUpdateApiKeys({ + ids: ["VuaCfGcBCdbkQm-e5aOx", "H3_AhoIBA9hmeQJdg7ij"], + role_descriptors: { + "role-a": { + indices: [ + { + names: ["*"], + privileges: ["write"], + }, + ], }, - metadata: { - environment: { - level: 2, - trusted: true, - tags: ["production"], - }, + }, + metadata: { + environment: { + level: 2, + trusted: true, + tags: ["production"], }, - expiration: "30d", }, + expiration: "30d", }); console.log(response); ---- diff --git a/docs/doc_examples/82bb6c61dab959f4446dc5ecab7ecbdf.asciidoc b/docs/doc_examples/82bb6c61dab959f4446dc5ecab7ecbdf.asciidoc index 7c7a7cba1..6958737be 100644 --- a/docs/doc_examples/82bb6c61dab959f4446dc5ecab7ecbdf.asciidoc +++ b/docs/doc_examples/82bb6c61dab959f4446dc5ecab7ecbdf.asciidoc @@ -3,32 +3,30 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_inference/chat_completion/openai-completion/_stream", - body: { - messages: [ - { - role: "assistant", - content: "Let's find out what the weather is", - tool_calls: [ - { - id: "call_KcAjWtAww20AihPHphUh46Gd", - type: "function", - function: { - name: "get_current_weather", - arguments: '{"location":"Boston, MA"}', - }, +const response = await client.inference.streamInference({ + task_type: "chat_completion", + inference_id: "openai-completion", + messages: [ + { + role: "assistant", + content: "Let's find out what the weather is", + tool_calls: [ + { + id: "call_KcAjWtAww20AihPHphUh46Gd", + type: "function", + function: { + name: "get_current_weather", + arguments: '{"location":"Boston, MA"}', }, - ], - }, - { - role: "tool", - content: "The weather is cold", - tool_call_id: "call_KcAjWtAww20AihPHphUh46Gd", - }, - ], - }, + }, + ], + }, + { + role: "tool", + content: "The weather is cold", + tool_call_id: "call_KcAjWtAww20AihPHphUh46Gd", + }, + ], }); console.log(response); ---- diff --git a/docs/doc_examples/91e106a2affbc8df32cd940684a779ed.asciidoc b/docs/doc_examples/91e106a2affbc8df32cd940684a779ed.asciidoc index 8d9b9da8b..8d425841b 100644 --- a/docs/doc_examples/91e106a2affbc8df32cd940684a779ed.asciidoc +++ b/docs/doc_examples/91e106a2affbc8df32cd940684a779ed.asciidoc @@ -3,10 +3,9 @@ [source, js] ---- -const response = await client.transport.request({ - method: "PUT", - path: "/_ingest/ip_location/database/my-database-1", - body: { +const response = await client.ingest.putIpLocationDatabase({ + id: "my-database-1", + configuration: { name: "GeoIP2-Domain", maxmind: { account_id: "1234567", diff --git a/docs/doc_examples/947efe87db7f8813c0878f8affc3e2d1.asciidoc b/docs/doc_examples/947efe87db7f8813c0878f8affc3e2d1.asciidoc new file mode 100644 index 000000000..1e8f4bd3e --- /dev/null +++ b/docs/doc_examples/947efe87db7f8813c0878f8affc3e2d1.asciidoc @@ -0,0 +1,8 @@ +// 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.resolveCluster(); +console.log(response); +---- diff --git a/docs/doc_examples/99fb82d49ac477e6a9dfdd71f9465374.asciidoc b/docs/doc_examples/99fb82d49ac477e6a9dfdd71f9465374.asciidoc index 3f2ffdf6b..e5bfa5787 100644 --- a/docs/doc_examples/99fb82d49ac477e6a9dfdd71f9465374.asciidoc +++ b/docs/doc_examples/99fb82d49ac477e6a9dfdd71f9465374.asciidoc @@ -3,9 +3,8 @@ [source, js] ---- -const response = await client.transport.request({ - method: "DELETE", - path: "/_ingest/ip_location/database/example-database-id", +const response = await client.ingest.deleteIpLocationDatabase({ + id: "example-database-id", }); console.log(response); ---- diff --git a/docs/doc_examples/9afa0844883b7471883aa378a8dd10b4.asciidoc b/docs/doc_examples/9afa0844883b7471883aa378a8dd10b4.asciidoc index 0cf3aea4d..e890718c7 100644 --- a/docs/doc_examples/9afa0844883b7471883aa378a8dd10b4.asciidoc +++ b/docs/doc_examples/9afa0844883b7471883aa378a8dd10b4.asciidoc @@ -3,10 +3,10 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_application/analytics/my_analytics_collection/event/search_click", - body: { +const response = await client.searchApplication.postBehavioralAnalyticsEvent({ + collection_name: "my_analytics_collection", + event_type: "search_click", + payload: { session: { id: "1797ca95-91c9-4e2e-b1bd-9c38e6f386a9", }, diff --git a/docs/doc_examples/9c01db07c9ac395b6370e3b33965c21f.asciidoc b/docs/doc_examples/9c01db07c9ac395b6370e3b33965c21f.asciidoc index 8e19908d0..9000232a8 100644 --- a/docs/doc_examples/9c01db07c9ac395b6370e3b33965c21f.asciidoc +++ b/docs/doc_examples/9c01db07c9ac395b6370e3b33965c21f.asciidoc @@ -3,16 +3,12 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_security/oidc/authenticate", - body: { - redirect_uri: - "https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I", - state: "4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I", - nonce: "WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM", - realm: "oidc1", - }, +const response = await client.security.oidcAuthenticate({ + redirect_uri: + "https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I", + state: "4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I", + nonce: "WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM", + realm: "oidc1", }); console.log(response); ---- diff --git a/docs/doc_examples/a162eb50853331c80596f5994e9d1c38.asciidoc b/docs/doc_examples/a162eb50853331c80596f5994e9d1c38.asciidoc index afaf9d7dc..2979e9a90 100644 --- a/docs/doc_examples/a162eb50853331c80596f5994e9d1c38.asciidoc +++ b/docs/doc_examples/a162eb50853331c80596f5994e9d1c38.asciidoc @@ -3,13 +3,10 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_application/search_application/my_search_application/_render_query", - body: { - params: { - query_string: "rock climbing", - }, +const response = await client.searchApplication.renderQuery({ + name: "my_search_application", + params: { + query_string: "rock climbing", }, }); console.log(response); diff --git a/docs/doc_examples/a60aaed30d7d26eaacbb2c0ed4ddc66d.asciidoc b/docs/doc_examples/a60aaed30d7d26eaacbb2c0ed4ddc66d.asciidoc new file mode 100644 index 000000000..73da91b2d --- /dev/null +++ b/docs/doc_examples/a60aaed30d7d26eaacbb2c0ed4ddc66d.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.cancelMigrateReindex({ + index: "my-data-stream", +}); +console.log(response); +---- diff --git a/docs/doc_examples/adced6e22ef03c2ae3b14aa5bdd24fd9.asciidoc b/docs/doc_examples/adced6e22ef03c2ae3b14aa5bdd24fd9.asciidoc new file mode 100644 index 000000000..b7d64b4c8 --- /dev/null +++ b/docs/doc_examples/adced6e22ef03c2ae3b14aa5bdd24fd9.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.getMigrateReindexStatus({ + index: "my-data-stream", +}); +console.log(response); +---- diff --git a/docs/doc_examples/b0bddf2ffaa83049b195829c06b875cd.asciidoc b/docs/doc_examples/b0bddf2ffaa83049b195829c06b875cd.asciidoc index 5186df2ae..82a81bced 100644 --- a/docs/doc_examples/b0bddf2ffaa83049b195829c06b875cd.asciidoc +++ b/docs/doc_examples/b0bddf2ffaa83049b195829c06b875cd.asciidoc @@ -3,9 +3,8 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_application/search_application/my_search_application/_render_query", +const response = await client.searchApplication.renderQuery({ + name: "my_search_application", }); console.log(response); ---- diff --git a/docs/doc_examples/b1e81b70b874a1f0cf75a0ec6e430ddc.asciidoc b/docs/doc_examples/b1e81b70b874a1f0cf75a0ec6e430ddc.asciidoc new file mode 100644 index 000000000..9c3d8a489 --- /dev/null +++ b/docs/doc_examples/b1e81b70b874a1f0cf75a0ec6e430ddc.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.esql.asyncQueryStop({ + id: "FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=", +}); +console.log(response); +---- diff --git a/docs/doc_examples/b62eaa20c4e0e48134a6d1d1b3c30b26.asciidoc b/docs/doc_examples/b62eaa20c4e0e48134a6d1d1b3c30b26.asciidoc index 57b7fb69d..7ffe922db 100644 --- a/docs/doc_examples/b62eaa20c4e0e48134a6d1d1b3c30b26.asciidoc +++ b/docs/doc_examples/b62eaa20c4e0e48134a6d1d1b3c30b26.asciidoc @@ -208,13 +208,9 @@ const response = await client.bulk({ }); console.log(response); -const response1 = await client.transport.request({ - method: "GET", - path: "/_text_structure/find_field_structure", - querystring: { - index: "test-logs", - field: "message", - }, +const response1 = await client.textStructure.findFieldStructure({ + index: "test-logs", + field: "message", }); console.log(response1); ---- diff --git a/docs/doc_examples/bcdfaa4487747249699a86a0dcd22f5e.asciidoc b/docs/doc_examples/bcdfaa4487747249699a86a0dcd22f5e.asciidoc index 80d974285..01a784b51 100644 --- a/docs/doc_examples/bcdfaa4487747249699a86a0dcd22f5e.asciidoc +++ b/docs/doc_examples/bcdfaa4487747249699a86a0dcd22f5e.asciidoc @@ -3,36 +3,32 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_ingest/_simulate", - body: { - docs: [ - { - _index: "my-index", - _id: "123", - _source: { - foo: "bar", - }, +const response = await client.simulate.ingest({ + docs: [ + { + _index: "my-index", + _id: "123", + _source: { + foo: "bar", }, - { - _index: "my-index", - _id: "456", - _source: { - foo: "rab", - }, + }, + { + _index: "my-index", + _id: "456", + _source: { + foo: "rab", }, - ], - pipeline_substitutions: { - "my-pipeline": { - processors: [ - { - uppercase: { - field: "foo", - }, + }, + ], + pipeline_substitutions: { + "my-pipeline": { + processors: [ + { + uppercase: { + field: "foo", }, - ], - }, + }, + ], }, }, }); diff --git a/docs/doc_examples/c580990a70028bb49cca8a6bde86bbf6.asciidoc b/docs/doc_examples/c580990a70028bb49cca8a6bde86bbf6.asciidoc index abc332dd4..9de280733 100644 --- a/docs/doc_examples/c580990a70028bb49cca8a6bde86bbf6.asciidoc +++ b/docs/doc_examples/c580990a70028bb49cca8a6bde86bbf6.asciidoc @@ -3,13 +3,9 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_security/api_key/_bulk_update", - body: { - ids: ["VuaCfGcBCdbkQm-e5aOx", "H3_AhoIBA9hmeQJdg7ij"], - role_descriptors: {}, - }, +const response = await client.security.bulkUpdateApiKeys({ + ids: ["VuaCfGcBCdbkQm-e5aOx", "H3_AhoIBA9hmeQJdg7ij"], + role_descriptors: {}, }); console.log(response); ---- diff --git a/docs/doc_examples/ccc613951c61f0b17e1ed8a2d3ae54a2.asciidoc b/docs/doc_examples/ccc613951c61f0b17e1ed8a2d3ae54a2.asciidoc index d44a7b669..e1e69507e 100644 --- a/docs/doc_examples/ccc613951c61f0b17e1ed8a2d3ae54a2.asciidoc +++ b/docs/doc_examples/ccc613951c61f0b17e1ed8a2d3ae54a2.asciidoc @@ -3,69 +3,65 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_ingest/_simulate", - body: { - docs: [ - { - _index: "my-index", - _id: "id", - _source: { - foo: "bar", - }, +const response = await client.simulate.ingest({ + docs: [ + { + _index: "my-index", + _id: "id", + _source: { + foo: "bar", }, - { - _index: "my-index", - _id: "id", - _source: { - foo: "rab", - }, + }, + { + _index: "my-index", + _id: "id", + _source: { + foo: "rab", }, - ], - pipeline_substitutions: { - "my-pipeline": { - processors: [ - { - set: { - field: "field3", - value: "value3", - }, + }, + ], + pipeline_substitutions: { + "my-pipeline": { + processors: [ + { + set: { + field: "field3", + value: "value3", }, - ], - }, + }, + ], }, - component_template_substitutions: { - "my-component-template": { - template: { - mappings: { - dynamic: "true", - properties: { - field3: { - type: "keyword", - }, + }, + component_template_substitutions: { + "my-component-template": { + template: { + mappings: { + dynamic: "true", + properties: { + field3: { + type: "keyword", }, }, - settings: { - index: { - default_pipeline: "my-pipeline", - }, + }, + settings: { + index: { + default_pipeline: "my-pipeline", }, }, }, }, - index_template_substitutions: { - "my-index-template": { - index_patterns: ["my-index-*"], - composed_of: ["component_template_1", "component_template_2"], - }, + }, + index_template_substitutions: { + "my-index-template": { + index_patterns: ["my-index-*"], + composed_of: ["component_template_1", "component_template_2"], }, - mapping_addition: { - dynamic: "strict", - properties: { - foo: { - type: "keyword", - }, + }, + mapping_addition: { + dynamic: "strict", + properties: { + foo: { + type: "keyword", }, }, }, diff --git a/docs/doc_examples/d35c8cf7a98b3f112e1de8797ec6689d.asciidoc b/docs/doc_examples/d35c8cf7a98b3f112e1de8797ec6689d.asciidoc index 21bcc10b8..644390ba0 100644 --- a/docs/doc_examples/d35c8cf7a98b3f112e1de8797ec6689d.asciidoc +++ b/docs/doc_examples/d35c8cf7a98b3f112e1de8797ec6689d.asciidoc @@ -3,13 +3,9 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_security/oidc/prepare", - body: { - iss: "http://127.0.0.1:8080", - login_hint: "this_is_an_opaque_string", - }, +const response = await client.security.oidcPrepareAuthentication({ + iss: "http://127.0.0.1:8080", + login_hint: "this_is_an_opaque_string", }); console.log(response); ---- diff --git a/docs/doc_examples/d4df39f72d3a3b80cd4042f6a21c3f19.asciidoc b/docs/doc_examples/d4df39f72d3a3b80cd4042f6a21c3f19.asciidoc index 592744a30..aa1a436a0 100644 --- a/docs/doc_examples/d4df39f72d3a3b80cd4042f6a21c3f19.asciidoc +++ b/docs/doc_examples/d4df39f72d3a3b80cd4042f6a21c3f19.asciidoc @@ -3,10 +3,9 @@ [source, js] ---- -const response = await client.transport.request({ - method: "PUT", - path: "/_ingest/ip_location/database/my-database-2", - body: { +const response = await client.ingest.putIpLocationDatabase({ + id: "my-database-2", + configuration: { name: "standard_location", ipinfo: {}, }, diff --git a/docs/doc_examples/d8c053ee26c1533ce936ec81101d8e1b.asciidoc b/docs/doc_examples/d8c053ee26c1533ce936ec81101d8e1b.asciidoc index e80e90ffd..3875298ba 100644 --- a/docs/doc_examples/d8c053ee26c1533ce936ec81101d8e1b.asciidoc +++ b/docs/doc_examples/d8c053ee26c1533ce936ec81101d8e1b.asciidoc @@ -3,9 +3,8 @@ [source, js] ---- -const response = await client.transport.request({ - method: "GET", - path: "/_ingest/ip_location/database/my-database-id", +const response = await client.ingest.getIpLocationDatabase({ + id: "my-database-id", }); console.log(response); ---- diff --git a/docs/doc_examples/dd71b0c9f9197684ff29c61062c55660.asciidoc b/docs/doc_examples/dd71b0c9f9197684ff29c61062c55660.asciidoc index 1fe5e6b4c..ff630da8a 100644 --- a/docs/doc_examples/dd71b0c9f9197684ff29c61062c55660.asciidoc +++ b/docs/doc_examples/dd71b0c9f9197684ff29c61062c55660.asciidoc @@ -3,9 +3,6 @@ [source, js] ---- -const response = await client.transport.request({ - method: "GET", - path: "/_security/settings", -}); +const response = await client.security.getSettings(); console.log(response); ---- diff --git a/docs/doc_examples/dde92fdf3469349ffe2c81764333543a.asciidoc b/docs/doc_examples/dde92fdf3469349ffe2c81764333543a.asciidoc new file mode 100644 index 000000000..d4834c92a --- /dev/null +++ b/docs/doc_examples/dde92fdf3469349ffe2c81764333543a.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.indices.createFrom({ + source: "my-index", + dest: "my-new-index", + create_from: { + remove_index_blocks: false, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/e3019fd5f23458ae49ad9854c97d321c.asciidoc b/docs/doc_examples/e3019fd5f23458ae49ad9854c97d321c.asciidoc index febdc3354..327abd471 100644 --- a/docs/doc_examples/e3019fd5f23458ae49ad9854c97d321c.asciidoc +++ b/docs/doc_examples/e3019fd5f23458ae49ad9854c97d321c.asciidoc @@ -3,12 +3,8 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_security/oidc/prepare", - body: { - realm: "oidc1", - }, +const response = await client.security.oidcPrepareAuthentication({ + realm: "oidc1", }); console.log(response); ---- diff --git a/docs/doc_examples/e4b38973c74037335378d8480f1ce894.asciidoc b/docs/doc_examples/e4b38973c74037335378d8480f1ce894.asciidoc index ba52d081d..42726dbd2 100644 --- a/docs/doc_examples/e4b38973c74037335378d8480f1ce894.asciidoc +++ b/docs/doc_examples/e4b38973c74037335378d8480f1ce894.asciidoc @@ -3,38 +3,34 @@ [source, js] ---- -const response = await client.transport.request({ - method: "POST", - path: "/_ingest/_simulate", - body: { - docs: [ - { - _index: "my-index", - _id: "123", - _source: { - foo: "foo", - }, +const response = await client.simulate.ingest({ + docs: [ + { + _index: "my-index", + _id: "123", + _source: { + foo: "foo", }, - { - _index: "my-index", - _id: "456", - _source: { - bar: "rab", - }, + }, + { + _index: "my-index", + _id: "456", + _source: { + bar: "rab", }, - ], - component_template_substitutions: { - "my-mappings_template": { - template: { - mappings: { - dynamic: "strict", - properties: { - foo: { - type: "keyword", - }, - bar: { - type: "keyword", - }, + }, + ], + component_template_substitutions: { + "my-mappings_template": { + template: { + mappings: { + dynamic: "strict", + properties: { + foo: { + type: "keyword", + }, + bar: { + type: "keyword", }, }, }, diff --git a/docs/doc_examples/ec135f0cc0d3f526df68000b2a95c65b.asciidoc b/docs/doc_examples/ec135f0cc0d3f526df68000b2a95c65b.asciidoc new file mode 100644 index 000000000..d130ff537 --- /dev/null +++ b/docs/doc_examples/ec135f0cc0d3f526df68000b2a95c65b.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.indices.createFrom({ + source: ".ml-anomalies-custom-example", + dest: ".reindexed-v9-ml-anomalies-custom-example", + create_from: null, +}); +console.log(response); +---- diff --git a/src/api/types.ts b/src/api/types.ts index 6a7a3000e..a26a26c45 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -2108,7 +2108,6 @@ export interface BulkIndexByScrollFailure { id: Id index: IndexName status: integer - type: string } export interface BulkStats { diff --git a/src/api/typesWithBodyKey.ts b/src/api/typesWithBodyKey.ts index 041805412..9d19e5051 100644 --- a/src/api/typesWithBodyKey.ts +++ b/src/api/typesWithBodyKey.ts @@ -2184,7 +2184,6 @@ export interface BulkIndexByScrollFailure { id: Id index: IndexName status: integer - type: string } export interface BulkStats {