Auto-generated code for 8.x (#2500)
This commit is contained in:
53
docs/doc_examples/68d7f7d4d268ee98caead5aef19933d6.asciidoc
Normal file
53
docs/doc_examples/68d7f7d4d268ee98caead5aef19933d6.asciidoc
Normal file
@ -0,0 +1,53 @@
|
||||
// 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.cluster.putComponentTemplate({
|
||||
name: "destination_template",
|
||||
template: {
|
||||
settings: {
|
||||
index: {
|
||||
number_of_replicas: 0,
|
||||
number_of_shards: 4,
|
||||
mode: "time_series",
|
||||
routing_path: ["metricset"],
|
||||
time_series: {
|
||||
end_time: "2023-09-01T14:00:00.000Z",
|
||||
start_time: "2023-09-01T06:00:00.000Z",
|
||||
},
|
||||
},
|
||||
},
|
||||
mappings: {
|
||||
properties: {
|
||||
"@timestamp": {
|
||||
type: "date",
|
||||
},
|
||||
metricset: {
|
||||
type: "keyword",
|
||||
time_series_dimension: true,
|
||||
},
|
||||
k8s: {
|
||||
properties: {
|
||||
tx: {
|
||||
type: "long",
|
||||
},
|
||||
rx: {
|
||||
type: "long",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
const response1 = await client.indices.putIndexTemplate({
|
||||
name: 2,
|
||||
index_patterns: ["k9s*"],
|
||||
composed_of: ["destination_template"],
|
||||
data_stream: {},
|
||||
});
|
||||
console.log(response1);
|
||||
----
|
||||
Reference in New Issue
Block a user