Auto-generated code for 8.15 (#2385)

This commit is contained in:
Elastic Machine
2024-10-21 17:59:54 +02:00
committed by GitHub
parent c6544c2979
commit 4afa601051
46 changed files with 595 additions and 90 deletions

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
kwd: {
type: "keyword",

View File

@ -3,8 +3,6 @@
[source, js]
----
const response = await client.cluster.reroute({
metric: "none",
});
const response = await client.cluster.reroute();
console.log(response);
----

View File

@ -8,6 +8,7 @@ const response = await client.esql.asyncQuery({
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,
},
});
console.log(response);

View File

@ -9,7 +9,7 @@ const response = await client.connector.put({
name: "My Connector",
description: "My Connector to sync data to Elastic index from Google Drive",
service_type: "google_drive",
language: "english",
language: "en",
});
console.log(response);
----

View File

@ -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.index({
index: "mv",
refresh: "true",
document: {
a: [2, null, 1],
},
});
console.log(response);
const response1 = await client.esql.query({
query: "FROM mv | LIMIT 1",
});
console.log(response1);
----

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
card: {
type: "wildcard",

View File

@ -52,6 +52,12 @@ const response = await client.simulate.ingest({
},
},
},
index_template_substitutions: {
"my-index-template": {
index_patterns: ["my-index-*"],
composed_of: ["component_template_1", "component_template_2"],
},
},
},
});
console.log(response);

View File

@ -0,0 +1,77 @@
// 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-000001",
mappings: {
properties: {
attributes: {
type: "passthrough",
priority: 10,
properties: {
id: {
type: "keyword",
},
},
},
},
},
});
console.log(response);
const response1 = await client.index({
index: "my-index-000001",
id: 1,
document: {
attributes: {
id: "foo",
zone: 10,
},
},
});
console.log(response1);
const response2 = await client.search({
index: "my-index-000001",
query: {
bool: {
must: [
{
match: {
id: "foo",
},
},
{
match: {
zone: 10,
},
},
],
},
},
});
console.log(response2);
const response3 = await client.search({
index: "my-index-000001",
query: {
bool: {
must: [
{
match: {
"attributes.id": "foo",
},
},
{
match: {
"attributes.zone": 10,
},
},
],
},
},
});
console.log(response3);
----

View File

@ -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.indices.create({
index: "my-index-000002",
mappings: {
properties: {
attributes: {
type: "passthrough",
priority: 10,
properties: {
id: {
type: "keyword",
},
},
},
"resource.attributes": {
type: "passthrough",
priority: 20,
properties: {
id: {
type: "keyword",
},
},
},
},
},
});
console.log(response);
----

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
agg_metric: {
type: "aggregate_metric_double",

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
my_range: {
type: "long_range",

View File

@ -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.create({
index: "semantic-embeddings",
mappings: {
properties: {
semantic_text: {
type: "semantic_text",
inference_id: "my-elser-endpoint",
},
content: {
type: "text",
copy_to: "semantic_text",
},
},
},
});
console.log(response);
----

View File

@ -8,6 +8,7 @@ const response = await client.esql.asyncQuery({
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,
},
});
console.log(response);

View File

@ -5,9 +5,13 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
});

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
flattened: {
type: "flattened",

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
text: {
type: "text",

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
versions: {
type: "version",

View File

@ -4,7 +4,6 @@
[source, js]
----
const response = await client.cluster.reroute({
metric: "none",
commands: [
{
allocate_empty_primary: {

View File

@ -0,0 +1,49 @@
// 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.putIndexTemplate({
name: "my-metrics",
index_patterns: ["metrics-mymetrics-*"],
priority: 200,
data_stream: {},
template: {
settings: {
"index.mode": "time_series",
},
mappings: {
properties: {
attributes: {
type: "passthrough",
priority: 10,
time_series_dimension: true,
properties: {
"host.name": {
type: "keyword",
},
},
},
cpu: {
type: "integer",
time_series_metric: "counter",
},
},
},
},
});
console.log(response);
const response1 = await client.index({
index: "metrics-mymetrics-test",
document: {
"@timestamp": "2020-01-01T00:00:00.000Z",
attributes: {
"host.name": "foo",
zone: "bar",
},
cpu: 10,
},
});
console.log(response1);
----

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
flattened: {
type: "flattened",

View File

@ -3,9 +3,8 @@
[source, js]
----
const response = await client.snapshot.create({
repository: "my_repository",
snapshot: "_verify_integrity",
const response = await client.snapshot.repositoryVerifyIntegrity({
name: "my_repository",
});
console.log(response);
----

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx_keep",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
path: {
type: "object",

View File

@ -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.search({
index: "semantic-embeddings",
retriever: {
rrf: {
retrievers: [
{
standard: {
query: {
match: {
content: "How to avoid muscle soreness while running?",
},
},
},
},
{
standard: {
query: {
semantic: {
field: "semantic_text",
query: "How to avoid muscle soreness while running?",
},
},
},
},
],
},
},
});
console.log(response);
----

View File

@ -4,7 +4,6 @@
[source, js]
----
const response = await client.cluster.reroute({
metric: "none",
commands: [
{
move: {

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
flattened: {
type: "flattened",

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
my_range: {
type: "long_range",

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
date: {
type: "date_nanos",

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
bool: {
type: "boolean",

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
my_range: {
type: "integer_range",

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
f: {
type: "scaled_float",

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
my_range: {
type: "date_range",

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
point: {
type: "geo_point",

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
long: {
type: "long",

View File

@ -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.index({
index: "my-index-000001",
id: 1,
document: {
attributes: {
id: "foo",
},
id: "bar",
},
});
console.log(response);
----

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
date: {
type: "date",

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
kwd: {
type: "keyword",

View File

@ -0,0 +1,37 @@
// 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",
size: 10,
knn: {
query_vector: [0.04283529, 0.85670587, -0.51402352, 0],
field: "my_int4_vector",
k: 20,
num_candidates: 50,
},
rescore: {
window_size: 20,
query: {
rescore_query: {
script_score: {
query: {
match_all: {},
},
script: {
source: "(dotProduct(params.queryVector, 'my_int4_vector') + 1.0)",
params: {
queryVector: [0.04283529, 0.85670587, -0.51402352, 0],
},
},
},
},
query_weight: 0,
rescore_query_weight: 1,
},
},
});
console.log(response);
----

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
ip: {
type: "ip",

View File

@ -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.search({
index: "my-index",
size: 10,
query: {
script_score: {
query: {
knn: {
query_vector: [0.04283529, 0.85670587, -0.51402352, 0],
field: "my_int4_vector",
num_candidates: 20,
},
},
script: {
source: "(dotProduct(params.queryVector, 'my_int4_vector') + 1.0)",
params: {
queryVector: [0.04283529, 0.85670587, -0.51402352, 0],
},
},
},
},
});
console.log(response);
----

View File

@ -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.inference.inference({
task_type: "my-inference-endpoint",
inference_id: "_update",
service_settings: {
api_key: "<API_KEY>",
},
});
console.log(response);
----

View File

@ -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.create({
index: "my-byte-quantized-index",
mappings: {
properties: {
my_vector: {
type: "dense_vector",
dims: 64,
index: true,
index_options: {
type: "bbq_hnsw",
},
},
},
},
});
console.log(response);
----

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
text: {
type: "text",

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
kwd: {
type: "keyword",

View File

@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
my_range: {
type: "ip_range",

View File

@ -9328,7 +9328,7 @@ export interface ConnectorFeatureEnabled {
export interface ConnectorFilteringAdvancedSnippet {
created_at?: DateTime
updated_at?: DateTime
value: Record<string, any>
value: any
}
export interface ConnectorFilteringConfig {
@ -16216,7 +16216,7 @@ export interface NodesInfoNodeInfoXpackLicenseType {
}
export interface NodesInfoNodeInfoXpackSecurity {
http: NodesInfoNodeInfoXpackSecuritySsl
http?: NodesInfoNodeInfoXpackSecuritySsl
enabled: string
transport?: NodesInfoNodeInfoXpackSecuritySsl
authc?: NodesInfoNodeInfoXpackSecurityAuthc
@ -18323,7 +18323,8 @@ export interface SnapshotRestoreRequest extends RequestBase {
}
export interface SnapshotRestoreResponse {
snapshot: SnapshotRestoreSnapshotRestore
accepted?: boolean
snapshot?: SnapshotRestoreSnapshotRestore
}
export interface SnapshotRestoreSnapshotRestore {

View File

@ -9429,7 +9429,7 @@ export interface ConnectorFeatureEnabled {
export interface ConnectorFilteringAdvancedSnippet {
created_at?: DateTime
updated_at?: DateTime
value: Record<string, any>
value: any
}
export interface ConnectorFilteringConfig {
@ -16568,7 +16568,7 @@ export interface NodesInfoNodeInfoXpackLicenseType {
}
export interface NodesInfoNodeInfoXpackSecurity {
http: NodesInfoNodeInfoXpackSecuritySsl
http?: NodesInfoNodeInfoXpackSecuritySsl
enabled: string
transport?: NodesInfoNodeInfoXpackSecuritySsl
authc?: NodesInfoNodeInfoXpackSecurityAuthc
@ -18790,7 +18790,8 @@ export interface SnapshotRestoreRequest extends RequestBase {
}
export interface SnapshotRestoreResponse {
snapshot: SnapshotRestoreSnapshotRestore
accepted?: boolean
snapshot?: SnapshotRestoreSnapshotRestore
}
export interface SnapshotRestoreSnapshotRestore {