Skip to content

Commit b4eb8e5

Browse files
[Backport 8.15] Added/updated snippets for docs (#2319)
(cherry picked from commit f737290) Co-authored-by: Josh Mock <joshua.mock@elastic.co>
1 parent ccf9fcb commit b4eb8e5

File tree

3,430 files changed

+68577
-7485
lines changed

Some content is hidden

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

3,430 files changed

+68577
-7485
lines changed
Lines changed: 10 additions & 0 deletions
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.security.clearCachedRealms({
7+
realms: "default_file,ldap1",
8+
});
9+
console.log(response);
10+
----
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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.forcemerge({
7+
index: ".ds-my-data-stream-2099.03.07-000001",
8+
max_num_segments: 1,
9+
});
10+
console.log(response);
11+
----
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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.search({
7+
query: {
8+
pinned: {
9+
ids: ["1", "4", "100"],
10+
organic: {
11+
match: {
12+
description: "iphone",
13+
},
14+
},
15+
},
16+
},
17+
});
18+
console.log(response);
19+
----
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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: "my-index-000001",
8+
settings: {
9+
analysis: {
10+
analyzer: {
11+
my_analyzer: {
12+
tokenizer: "whitespace",
13+
filter: ["stemmer"],
14+
},
15+
},
16+
},
17+
},
18+
});
19+
console.log(response);
20+
----
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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.watcher.putWatch({
7+
id: "cluster_health_watch",
8+
trigger: {
9+
schedule: {
10+
interval: "10s",
11+
},
12+
},
13+
input: {
14+
http: {
15+
request: {
16+
host: "localhost",
17+
port: 9200,
18+
path: "/_cluster/health",
19+
},
20+
},
21+
},
22+
condition: {
23+
compare: {
24+
"ctx.payload.status": {
25+
eq: "red",
26+
},
27+
},
28+
},
29+
actions: {
30+
send_email: {
31+
email: {
32+
to: "username@example.org",
33+
subject: "Cluster Status Warning",
34+
body: "Cluster status is RED",
35+
},
36+
},
37+
},
38+
});
39+
console.log(response);
40+
----
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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.migration.postFeatureUpgrade();
7+
console.log(response);
8+
----
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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.search({
7+
index: "my-index",
8+
query: {
9+
match: {
10+
"http.clientip": "40.135.0.0",
11+
},
12+
},
13+
fields: ["http.clientip"],
14+
});
15+
console.log(response);
16+
----
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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.shardStores();
7+
console.log(response);
8+
----
Lines changed: 15 additions & 0 deletions
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.renderSearchTemplate({
7+
source: '{ "query": {{#toJson}}my_query{{/toJson}} }',
8+
params: {
9+
my_query: {
10+
match_all: {},
11+
},
12+
},
13+
});
14+
console.log(response);
15+
----
Lines changed: 12 additions & 0 deletions
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.indices.analyze({
7+
tokenizer: "standard",
8+
filter: ["asciifolding"],
9+
text: "açaí à la carte",
10+
});
11+
console.log(response);
12+
----

0 commit comments

Comments
 (0)