Skip to content

Commit

Permalink
Auto-generated API code
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed Aug 19, 2024
1 parent 78332da commit 180f1b9
Show file tree
Hide file tree
Showing 58 changed files with 813 additions and 158 deletions.
15 changes: 15 additions & 0 deletions docs/doc_examples/0dfde6a9d953822fd4b3aa0121ddd8fb.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
----
const response = await client.searchApplication.renderQuery({
name: "my-app",
body: {
params: {
query_string: "my first query",
text_fields: [
{
name: "title",
boost: 5,
},
{
name: "description",
boost: 1,
},
],
},
},
});
console.log(response);
----
20 changes: 20 additions & 0 deletions docs/doc_examples/0fbca60a487f5f22a4d51d73b2434cc4.asciidoc
Original file line number Diff line number Diff line change
@@ -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.indices.create({
index: "elser-embeddings",
mappings: {
properties: {
content_embedding: {
type: "sparse_vector",
},
content: {
type: "text",
},
},
},
});
console.log(response);
----
5 changes: 5 additions & 0 deletions docs/doc_examples/10a16abe990288253ea25a1b1712fe3d.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
----
const response = await client.security.queryUser({
with_profile_uid: "true",
query: {
prefix: {
roles: "other",
},
},
});
console.log(response);
----
21 changes: 20 additions & 1 deletion docs/doc_examples/19c00c6b29bc7dbc5e92b3668da2da93.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@

[source, js]
----
const response = await client.simulate.ingest({});
const response = await client.simulate.ingest({
body: {
docs: [
{
_index: "my-index",
_id: "123",
_source: {
foo: "bar",
},
},
{
_index: "my-index",
_id: "456",
_source: {
foo: "rab",
},
},
],
},
});
console.log(response);
----
11 changes: 11 additions & 0 deletions docs/doc_examples/19d60e4890cc57151d596326484d9076.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.ingest.deleteGeoipDatabase({
id: "my-database-id",
body: null,
});
console.log(response);
----
21 changes: 21 additions & 0 deletions docs/doc_examples/1b60ad542abb511cbd926ac8c55b609c.asciidoc
Original file line number Diff line number Diff line change
@@ -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.transport.request({
method: "PUT",
path: "/_inference/sparse_embedding/my-elser-model",
body: {
service: "elser",
service_settings: {
adaptive_allocations: {
enabled: true,
min_number_of_allocations: 3,
max_number_of_allocations: 10,
},
},
},
});
console.log(response);
----
8 changes: 7 additions & 1 deletion docs/doc_examples/2a1eece9a59ac1773edcf0a932c26de0.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

[source, js]
----
const response = await client.security.oidcLogout({});
const response = await client.security.oidcLogout({
body: {
token:
"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==",
refresh_token: "vLBPvmAB6KvwvJZr27cS",
},
});
console.log(response);
----
10 changes: 10 additions & 0 deletions docs/doc_examples/2acf75803494fef29f9ca70671aa6be1.asciidoc
Original file line number Diff line number Diff line change
@@ -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.security.bulkDeleteRole({
names: ["my_admin_role", "superuser"],
});
console.log(response);
----
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
const response = await client.esql.asyncQueryGet({
id: "FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=",
wait_for_completion_timeout: "30s",
body: null,
});
console.log(response);
----
25 changes: 25 additions & 0 deletions docs/doc_examples/30fa37c9575fe81a0ea7c12cfc08e277.asciidoc
Original file line number Diff line number Diff line change
@@ -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: "bad_example_index",
mappings: {
properties: {
field_1: {
type: "text",
copy_to: "field_2",
},
field_2: {
type: "text",
copy_to: "field_3",
},
field_3: {
type: "text",
},
},
},
});
console.log(response);
----
21 changes: 21 additions & 0 deletions docs/doc_examples/398389933901b572a06a752bc780af7c.asciidoc
Original file line number Diff line number Diff line change
@@ -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.transport.request({
method: "PUT",
path: "/_inference/completion/anthropic_completion",
body: {
service: "anthropic",
service_settings: {
api_key: "<api_key>",
model_id: "<model_id>",
},
task_settings: {
max_tokens: 1024,
},
},
});
console.log(response);
----
11 changes: 11 additions & 0 deletions docs/doc_examples/3b6718257421b5419bf4cd6a7303c57e.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.ingest.getGeoipDatabase({
id: "my-database-id",
body: null,
});
console.log(response);
----
8 changes: 7 additions & 1 deletion docs/doc_examples/3f1fe5f5f99b98d0891f38003e10b636.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

[source, js]
----
const response = await client.esql.asyncQuery({});
const response = await client.esql.asyncQuery({
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",
},
});
console.log(response);
----
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
----
const response = await client.esql.asyncQueryGet({
id: "FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=",
body: null,
});
console.log(response);
----
10 changes: 10 additions & 0 deletions docs/doc_examples/44385b61342e20ea05f254015b2b04d7.asciidoc
Original file line number Diff line number Diff line change
@@ -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.security.bulkDeleteRole({
names: ["my_admin_role", "my_user_role"],
});
console.log(response);
----
11 changes: 11 additions & 0 deletions docs/doc_examples/4982c547be1ad9455ae836990aea92c5.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.ml.startTrainedModelDeployment({
model_id: "my_model",
deployment_id: "my_model_for_search",
});
console.log(response);
----
21 changes: 21 additions & 0 deletions docs/doc_examples/517d291044c3e4448b8804322616ab4a.asciidoc
Original file line number Diff line number Diff line change
@@ -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.ingest.putPipeline({
id: "elser_embeddings",
processors: [
{
inference: {
model_id: "elser_embeddings",
input_output: {
input_field: "content",
output_field: "content_embedding",
},
},
},
],
});
console.log(response);
----
11 changes: 11 additions & 0 deletions docs/doc_examples/533087d787b48878a0bf3fa8d0851b64.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.ingest.deleteGeoipDatabase({
id: "example-database-id",
body: null,
});
console.log(response);
----
8 changes: 7 additions & 1 deletion docs/doc_examples/57dc15e5ad663c342fd5c1d86fcd1b29.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

[source, js]
----
const response = await client.security.oidcPrepareAuthentication({});
const response = await client.security.oidcPrepareAuthentication({
body: {
realm: "oidc1",
state: "lGYK0EcSLjqH6pkT5EVZjC6eIW5YCGgywj2sxROO",
nonce: "zOBXLJGUooRrbLbQk5YCcyC8AXw3iloynvluYhZ5",
},
});
console.log(response);
----
28 changes: 28 additions & 0 deletions docs/doc_examples/5d3ee81bcf6ad57f39052c9065963cc3.asciidoc
Original file line number Diff line number Diff line change
@@ -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: "test_index",
mappings: {
dynamic: "strict",
properties: {
description: {
properties: {
notes: {
type: "text",
copy_to: ["description.notes_raw"],
analyzer: "standard",
search_analyzer: "standard",
},
notes_raw: {
type: "keyword",
},
},
},
},
},
});
console.log(response);
----
10 changes: 10 additions & 0 deletions docs/doc_examples/5deeed427f35cbaee4b8ddc45002a9d7.asciidoc
Original file line number Diff line number Diff line change
@@ -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.security.bulkDeleteRole({
names: ["my_admin_role", "not_an_existing_role"],
});
console.log(response);
----
47 changes: 0 additions & 47 deletions docs/doc_examples/5f79c42b0f74fdf71359cef82843fad3.asciidoc

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const response = await client.transport.request({
},
{
rule_id: "rule2",
type: "pinned",
type: "exclude",
criteria: [
{
type: "contains",
Expand Down
Loading

0 comments on commit 180f1b9

Please sign in to comment.