Skip to content

Commit 821d1a6

Browse files
Auto-generated API code
1 parent 85396dd commit 821d1a6

File tree

139 files changed

+28944
-1891
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+28944
-1891
lines changed

docs/doc_examples/0bee07a581c5776e068f6f4efad5a399.asciidoc

+5-11
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,11 @@
33

44
[source, js]
55
----
6-
const response = await client.transport.request({
7-
method: "POST",
8-
path: "/_query/async",
9-
querystring: {
10-
format: "json",
11-
},
12-
body: {
13-
query:
14-
"\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 ",
15-
include_ccs_metadata: true,
16-
},
6+
const response = await client.esql.asyncQuery({
7+
format: "json",
8+
query:
9+
"\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 ",
10+
include_ccs_metadata: true,
1711
});
1812
console.log(response);
1913
----

docs/doc_examples/0dfde6a9d953822fd4b3aa0121ddd8fb.asciidoc

+14-17
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,20 @@
33

44
[source, js]
55
----
6-
const response = await client.transport.request({
7-
method: "POST",
8-
path: "/_application/search_application/my-app/_render_query",
9-
body: {
10-
params: {
11-
query_string: "my first query",
12-
text_fields: [
13-
{
14-
name: "title",
15-
boost: 5,
16-
},
17-
{
18-
name: "description",
19-
boost: 1,
20-
},
21-
],
22-
},
6+
const response = await client.searchApplication.renderQuery({
7+
name: "my-app",
8+
params: {
9+
query_string: "my first query",
10+
text_fields: [
11+
{
12+
name: "title",
13+
boost: 5,
14+
},
15+
{
16+
name: "description",
17+
boost: 1,
18+
},
19+
],
2320
},
2421
});
2522
console.log(response);

docs/doc_examples/120fcf9f55128d6a81d5e87a9c235bbd.asciidoc

+10-12
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,16 @@
33

44
[source, js]
55
----
6-
const response = await client.transport.request({
7-
method: "POST",
8-
path: "/_inference/chat_completion/openai-completion/_stream",
9-
body: {
10-
model: "gpt-4o",
11-
messages: [
12-
{
13-
role: "user",
14-
content: "What is Elastic?",
15-
},
16-
],
17-
},
6+
const response = await client.inference.streamInference({
7+
task_type: "chat_completion",
8+
inference_id: "openai-completion",
9+
model: "gpt-4o",
10+
messages: [
11+
{
12+
role: "user",
13+
content: "What is Elastic?",
14+
},
15+
],
1816
});
1917
console.log(response);
2018
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.indices.createFrom({
7+
source: "my-index",
8+
dest: "my-new-index",
9+
create_from: {
10+
settings_override: {
11+
index: {
12+
number_of_shards: 5,
13+
},
14+
},
15+
mappings_override: {
16+
properties: {
17+
field2: {
18+
type: "boolean",
19+
},
20+
},
21+
},
22+
},
23+
});
24+
console.log(response);
25+
----

docs/doc_examples/141ef0ebaa3b0772892b79b9bb85efb0.asciidoc

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33

44
[source, js]
55
----
6-
const response = await client.inference.put({
7-
task_type: "my-inference-endpoint",
8-
inference_id: "_update",
6+
const response = await client.inference.update({
7+
inference_id: "my-inference-endpoint",
98
inference_config: {
109
service_settings: {
1110
api_key: "<API_KEY>",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.indices.cancelMigrateReindex({
7+
index: "my-data-stream",
8+
});
9+
console.log(response);
10+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.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3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==",
9+
],
10+
});
11+
console.log(response);
12+
----

docs/doc_examples/19c00c6b29bc7dbc5e92b3668da2da93.asciidoc

+15-19
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,23 @@
33

44
[source, js]
55
----
6-
const response = await client.transport.request({
7-
method: "POST",
8-
path: "/_ingest/_simulate",
9-
body: {
10-
docs: [
11-
{
12-
_index: "my-index",
13-
_id: "123",
14-
_source: {
15-
foo: "bar",
16-
},
6+
const response = await client.simulate.ingest({
7+
docs: [
8+
{
9+
_index: "my-index",
10+
_id: "123",
11+
_source: {
12+
foo: "bar",
1713
},
18-
{
19-
_index: "my-index",
20-
_id: "456",
21-
_source: {
22-
foo: "rab",
23-
},
14+
},
15+
{
16+
_index: "my-index",
17+
_id: "456",
18+
_source: {
19+
foo: "rab",
2420
},
25-
],
26-
},
21+
},
22+
],
2723
});
2824
console.log(response);
2925
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.indices.migrateReindex({
7+
reindex: {
8+
source: {
9+
index: "my-data-stream",
10+
},
11+
mode: "upgrade",
12+
},
13+
});
14+
console.log(response);
15+
----

docs/doc_examples/2a1eece9a59ac1773edcf0a932c26de0.asciidoc

+4-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@
33

44
[source, js]
55
----
6-
const response = await client.transport.request({
7-
method: "POST",
8-
path: "/_security/oidc/logout",
9-
body: {
10-
token:
11-
"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==",
12-
refresh_token: "vLBPvmAB6KvwvJZr27cS",
13-
},
6+
const response = await client.security.oidcLogout({
7+
token:
8+
"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==",
9+
refresh_token: "vLBPvmAB6KvwvJZr27cS",
1410
});
1511
console.log(response);
1612
----

docs/doc_examples/2afdf0d83724953aa2875b5fb37d60cc.asciidoc

+3-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@
33

44
[source, js]
55
----
6-
const response = await client.transport.request({
7-
method: "GET",
8-
path: "/_query/async/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE&#x3D;",
9-
querystring: {
10-
wait_for_completion_timeout: "30s",
11-
},
6+
const response = await client.esql.asyncQueryGet({
7+
id: "FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=",
8+
wait_for_completion_timeout: "30s",
129
});
1310
console.log(response);
1411
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.indices.createFrom({
7+
source: "my-index",
8+
dest: "my-new-index",
9+
create_from: {
10+
settings_override: {
11+
index: {
12+
"blocks.write": null,
13+
"blocks.read": null,
14+
"blocks.read_only": null,
15+
"blocks.read_only_allow_delete": null,
16+
"blocks.metadata": null,
17+
},
18+
},
19+
},
20+
});
21+
console.log(response);
22+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.indices.create({
7+
index: "semantic-embeddings",
8+
mappings: {
9+
properties: {
10+
semantic_text: {
11+
type: "semantic_text",
12+
},
13+
content: {
14+
type: "text",
15+
copy_to: "semantic_text",
16+
},
17+
},
18+
},
19+
});
20+
console.log(response);
21+
----

docs/doc_examples/3f1fe5f5f99b98d0891f38003e10b636.asciidoc

+4-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@
33

44
[source, js]
55
----
6-
const response = await client.transport.request({
7-
method: "POST",
8-
path: "/_query/async",
9-
body: {
10-
query:
11-
"\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 ",
12-
wait_for_completion_timeout: "2s",
13-
},
6+
const response = await client.esql.asyncQuery({
7+
query:
8+
"\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 ",
9+
wait_for_completion_timeout: "2s",
1410
});
1511
console.log(response);
1612
----

docs/doc_examples/405511f7c1f12cc0a227b4563fe7b2e2.asciidoc

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33

44
[source, js]
55
----
6-
const response = await client.transport.request({
7-
method: "GET",
8-
path: "/_query/async/FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM&#x3D;",
6+
const response = await client.esql.asyncQueryGet({
7+
id: "FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=",
98
});
109
console.log(response);
1110
----

docs/doc_examples/45954b8aaedfed57012be8b6538b0a24.asciidoc

+30-32
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,42 @@
33

44
[source, js]
55
----
6-
const response = await client.transport.request({
7-
method: "POST",
8-
path: "/_inference/chat_completion/openai-completion/_stream",
9-
body: {
10-
messages: [
11-
{
12-
role: "user",
13-
content: [
14-
{
15-
type: "text",
16-
text: "What's the price of a scarf?",
17-
},
18-
],
19-
},
20-
],
21-
tools: [
22-
{
23-
type: "function",
24-
function: {
25-
name: "get_current_price",
26-
description: "Get the current price of a item",
27-
parameters: {
28-
type: "object",
29-
properties: {
30-
item: {
31-
id: "123",
32-
},
33-
},
34-
},
6+
const response = await client.inference.streamInference({
7+
task_type: "chat_completion",
8+
inference_id: "openai-completion",
9+
messages: [
10+
{
11+
role: "user",
12+
content: [
13+
{
14+
type: "text",
15+
text: "What's the price of a scarf?",
3516
},
36-
},
37-
],
38-
tool_choice: {
17+
],
18+
},
19+
],
20+
tools: [
21+
{
3922
type: "function",
4023
function: {
4124
name: "get_current_price",
25+
description: "Get the current price of a item",
26+
parameters: {
27+
type: "object",
28+
properties: {
29+
item: {
30+
id: "123",
31+
},
32+
},
33+
},
4234
},
4335
},
36+
],
37+
tool_choice: {
38+
type: "function",
39+
function: {
40+
name: "get_current_price",
41+
},
4442
},
4543
});
4644
console.log(response);

0 commit comments

Comments
 (0)