Skip to content

Commit

Permalink
Auto-generated code for 8.x (#2529)
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Dec 11, 2024
1 parent 8d868df commit f02c66c
Show file tree
Hide file tree
Showing 135 changed files with 1,233 additions and 1,000 deletions.
8 changes: 6 additions & 2 deletions docs/doc_examples/0bee07a581c5776e068f6f4efad5a399.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@

[source, js]
----
const response = await client.esql.asyncQuery({
format: "json",
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 ",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const response = await client.ingest.putPipeline({
{
attachment: {
field: "data",
remove_binary: false,
remove_binary: true,
},
},
],
Expand Down
5 changes: 3 additions & 2 deletions docs/doc_examples/0dfde6a9d953822fd4b3aa0121ddd8fb.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

[source, js]
----
const response = await client.searchApplication.renderQuery({
name: "my-app",
const response = await client.transport.request({
method: "POST",
path: "/_application/search_application/my-app/_render_query",
body: {
params: {
query_string: "my first query",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const response = await client.searchApplication.put({
script: {
lang: "mustache",
source:
'\n {\n "query": {\n "bool": {\n "must": [\n {{#query}}\n \n {{/query}}\n ],\n "filter": {{#toJson}}_es_filters{{/toJson}}\n }\n },\n "_source": {\n "includes": ["title", "plot"]\n },\n "highlight": {\n "fields": {\n "title": { "fragment_size": 0 },\n "plot": { "fragment_size": 200 }\n }\n },\n "aggs": {{#toJson}}_es_aggs{{/toJson}},\n "from": {{from}},\n "size": {{size}},\n "sort": {{#toJson}}_es_sort_fields{{/toJson}}\n }\n ',
'\n {\n "query": {\n "bool": {\n "must": [\n {{#query}}\n {{/query}}\n ],\n "filter": {{#toJson}}_es_filters{{/toJson}}\n }\n },\n "_source": {\n "includes": ["title", "plot"]\n },\n "highlight": {\n "fields": {\n "title": { "fragment_size": 0 },\n "plot": { "fragment_size": 200 }\n }\n },\n "aggs": {{#toJson}}_es_aggs{{/toJson}},\n "from": {{from}},\n "size": {{size}},\n "sort": {{#toJson}}_es_sort_fields{{/toJson}}\n }\n ',
params: {
query: "",
_es_filters: {},
Expand Down
4 changes: 3 additions & 1 deletion docs/doc_examples/19c00c6b29bc7dbc5e92b3668da2da93.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

[source, js]
----
const response = await client.simulate.ingest({
const response = await client.transport.request({
method: "POST",
path: "/_ingest/_simulate",
body: {
docs: [
{
Expand Down
4 changes: 3 additions & 1 deletion docs/doc_examples/2a1eece9a59ac1773edcf0a932c26de0.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

[source, js]
----
const response = await client.security.oidcLogout({
const response = await client.transport.request({
method: "POST",
path: "/_security/oidc/logout",
body: {
token:
"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==",
Expand Down
35 changes: 35 additions & 0 deletions docs/doc_examples/2a67608dadbf220a2f040f3a79d3677d.asciidoc
Original file line number Diff line number Diff line change
@@ -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.ingest.putPipeline({
id: "attachment",
description: "Extract attachment information including original binary",
processors: [
{
attachment: {
field: "data",
remove_binary: false,
},
},
],
});
console.log(response);
const response1 = await client.index({
index: "my-index-000001",
id: "my_id",
pipeline: "attachment",
document: {
data: "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0=",
},
});
console.log(response1);
const response2 = await client.get({
index: "my-index-000001",
id: "my_id",
});
console.log(response2);
----
10 changes: 6 additions & 4 deletions docs/doc_examples/2afdf0d83724953aa2875b5fb37d60cc.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@

[source, js]
----
const response = await client.esql.asyncQueryGet({
id: "FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=",
wait_for_completion_timeout: "30s",
body: null,
const response = await client.transport.request({
method: "GET",
path: "/_query/async/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=",
querystring: {
wait_for_completion_timeout: "30s",
},
});
console.log(response);
----
4 changes: 3 additions & 1 deletion docs/doc_examples/3f1fe5f5f99b98d0891f38003e10b636.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

[source, js]
----
const response = await client.esql.asyncQuery({
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 ",
Expand Down
6 changes: 3 additions & 3 deletions docs/doc_examples/405511f7c1f12cc0a227b4563fe7b2e2.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

[source, js]
----
const response = await client.esql.asyncQueryGet({
id: "FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=",
body: null,
const response = await client.transport.request({
method: "GET",
path: "/_query/async/FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=",
});
console.log(response);
----
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const response = await client.inference.put({
service: "openai",
service_settings: {
api_key: "<api_key>",
model_id: "text-embedding-ada-002",
model_id: "text-embedding-3-small",
dimensions: 128,
},
},
});
Expand Down
17 changes: 0 additions & 17 deletions docs/doc_examples/49b31e23f8b9667b6a7b2734d55fb6ed.asciidoc

This file was deleted.

6 changes: 3 additions & 3 deletions docs/doc_examples/4b91ad7c9b44e07db4a4e81390f19ad3.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

[source, js]
----
const response = await client.inference.streamInference({
task_type: "completion",
inference_id: "openai-completion",
const response = await client.transport.request({
method: "POST",
path: "/_inference/completion/openai-completion/_stream",
body: {
input: "What is Elastic?",
},
Expand Down
18 changes: 18 additions & 0 deletions docs/doc_examples/53d9d2ec9cb8d211772d764e76fe6890.asciidoc
Original file line number Diff line number Diff line change
@@ -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.ingest.simulate({
id: "query_helper_pipeline",
docs: [
{
_source: {
content:
"artificial intelligence in medicine articles published in the last 12 months",
},
},
],
});
console.log(response);
----
4 changes: 3 additions & 1 deletion docs/doc_examples/57dc15e5ad663c342fd5c1d86fcd1b29.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

[source, js]
----
const response = await client.security.oidcPrepareAuthentication({
const response = await client.transport.request({
method: "POST",
path: "/_security/oidc/prepare",
body: {
realm: "oidc1",
state: "lGYK0EcSLjqH6pkT5EVZjC6eIW5YCGgywj2sxROO",
Expand Down
22 changes: 0 additions & 22 deletions docs/doc_examples/5a70db31f587b7ffed5e9bc1445430cb.asciidoc

This file was deleted.

8 changes: 6 additions & 2 deletions docs/doc_examples/5bba213a7f543190139d1a69ab2ed076.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@

[source, js]
----
const response = await client.esql.asyncQuery({
format: "json",
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 ",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const response = await client.searchApplication.put({
script: {
lang: "mustache",
source:
'\n {\n "query": {\n "bool": {\n "must": [\n {{#query}}\n \n {{/query}}\n ],\n "filter": {{#toJson}}_es_filters{{/toJson}}\n }\n },\n "_source": {\n "includes": ["title", "plot"]\n },\n "aggs": {{#toJson}}_es_aggs{{/toJson}},\n "from": {{from}},\n "size": {{size}},\n "sort": {{#toJson}}_es_sort_fields{{/toJson}}\n }\n ',
'\n {\n "query": {\n "bool": {\n "must": [\n {{#query}}\n {{/query}}\n ],\n "filter": {{#toJson}}_es_filters{{/toJson}}\n }\n },\n "_source": {\n "includes": ["title", "plot"]\n },\n "aggs": {{#toJson}}_es_aggs{{/toJson}},\n "from": {{from}},\n "size": {{size}},\n "sort": {{#toJson}}_es_sort_fields{{/toJson}}\n }\n ',
params: {
query: "",
_es_filters: {},
Expand Down
4 changes: 3 additions & 1 deletion docs/doc_examples/6f3b723bf6179b96c3413597ed7f49e1.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

[source, js]
----
const response = await client.security.bulkUpdateApiKeys({
const response = await client.transport.request({
method: "POST",
path: "/_security/api_key/_bulk_update",
body: {
ids: ["VuaCfGcBCdbkQm-e5aOx", "H3_AhoIBA9hmeQJdg7ij"],
},
Expand Down
4 changes: 3 additions & 1 deletion docs/doc_examples/77518e8c6198acfe77c0934fd2fe65cb.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

[source, js]
----
const response = await client.textStructure.findMessageStructure({
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",
Expand Down
11 changes: 11 additions & 0 deletions docs/doc_examples/7ba29f0be2297b54a640b0a17d7ef5ca.asciidoc
Original file line number Diff line number Diff line change
@@ -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.transport.request({
method: "DELETE",
path: "/_ingest/ip_location/database/my-database-id",
});
console.log(response);
----
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const response = await client.ingest.putPipeline({
field: "data",
indexed_chars: 11,
indexed_chars_field: "max_size",
remove_binary: false,
remove_binary: true,
},
},
],
Expand Down
4 changes: 3 additions & 1 deletion docs/doc_examples/80dd7f5882c59b9c1c90e8351937441f.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

[source, js]
----
const response = await client.security.bulkUpdateApiKeys({
const response = await client.transport.request({
method: "POST",
path: "/_security/api_key/_bulk_update",
body: {
ids: ["VuaCfGcBCdbkQm-e5aOx", "H3_AhoIBA9hmeQJdg7ij"],
role_descriptors: {
Expand Down
22 changes: 0 additions & 22 deletions docs/doc_examples/8cad5d95a0e7c103f08be53d0b172558.asciidoc

This file was deleted.

17 changes: 17 additions & 0 deletions docs/doc_examples/91e106a2affbc8df32cd940684a779ed.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// 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: "PUT",
path: "/_ingest/ip_location/database/my-database-1",
body: {
name: "GeoIP2-Domain",
maxmind: {
account_id: "1234567",
},
},
});
console.log(response);
----
32 changes: 32 additions & 0 deletions docs/doc_examples/931817b168e055ecf738785c721125dd.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// 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.ingest.putPipeline({
id: "query_helper_pipeline",
processors: [
{
script: {
source:
"ctx.prompt = 'Please generate an elasticsearch search query on index `articles_index` for the following natural language query. Dates are in the field `@timestamp`, document types are in the field `type` (options are `news`, `publication`), categories in the field `category` and can be multiple (options are `medicine`, `pharmaceuticals`, `technology`), and document names are in the field `title` which should use a fuzzy match. Ignore fields which cannot be determined from the natural language query context: ' + ctx.content",
},
},
{
inference: {
model_id: "openai_chat_completions",
input_output: {
input_field: "prompt",
output_field: "query",
},
},
},
{
remove: {
field: "prompt",
},
},
],
});
console.log(response);
----
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const response = await client.indices.create({
properties: {
infer_field: {
type: "semantic_text",
inference_id: "my-elser-endpoint",
inference_id: ".elser-2-elasticsearch",
},
source_field: {
type: "text",
Expand Down
Loading

0 comments on commit f02c66c

Please sign in to comment.