Skip to content

Commit 31e8569

Browse files
fuluielvis kahoro
andauthored
feat(elasticsearch): add Elasticsearch workflows (#154)
* feat(elasticsearch): add Elasticsearch workflows Add a few simple Elasticsearch workflows, such as * check connection to ES * show cluster health * list indices * count documents in index * docs(elasticsearch): add source urls to commands Since it looks like the source url is important in other pull requests, I have added links to the documentation for the commands that offer extra arguments. Also added author url, if that might also be required. * fix(elasticsearch): remove connection check workflow, as curl workflow can be used --------- Co-authored-by: elvis kahoro <elvis@warp.dev>
1 parent 4274456 commit 31e8569

3 files changed

Lines changed: 146 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
# The name of the workflow.
3+
name: Show the Elasticsearch cluster health
4+
# The corresponding command for the workflow. Any arguments should be surrounded with two curly braces. E.g `command {{arg}}`.
5+
command: |-
6+
curl -XGET '{{schema}}://{{host}}:{{port}}/_cat/health?v={{verbose}}'
7+
# Any tags that the workflow should be categorized with.
8+
tags:
9+
- elasticsearch
10+
- curl
11+
# A description of the workflow.
12+
description: Inspect the Elasticsearch cluster health
13+
# List of arguments within the command.
14+
arguments:
15+
# Name of the argument within the command. This must exactly match the name of the argument
16+
# within the command (without the curly braces).
17+
- name: schema
18+
# The description of the argument.
19+
description: The url schema
20+
# The default value for the argument.
21+
default_value: http
22+
# within the command (without the curly braces).
23+
- name: host
24+
# The description of the argument.
25+
description: The url hostname
26+
# The default value for the argument.
27+
default_value: localhost
28+
# within the command (without the curly braces).
29+
- name: port
30+
# The description of the argument.
31+
description: The url port
32+
# The default value for the argument.
33+
default_value: 9200
34+
# within the command (without the curly braces).
35+
- name: verbose
36+
# The description of the argument.
37+
description: Should the output be verbose
38+
# The default value for the argument.
39+
default_value: true
40+
# The source URL for where the workflow was generated from, if any.
41+
source_url: "https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-health.html"
42+
# The author of the workflow.
43+
author: Olaf Klejnstrup-Jensen
44+
# The URL of original author of the Workflow. For example, if this workflow was generated from StackOverflow, the `author_url` would be the StackOverflow author's profile page.
45+
author_url: "https://github.com/fului"
46+
# The valid shells where this workflow should be active. If valid for all shells, this can be left empty.
47+
# See FORMAT.md for the full list of accepted values.
48+
shells: []
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
# The name of the workflow.
3+
name: Count documents in an index in Elasticsearch
4+
# The corresponding command for the workflow. Any arguments should be surrounded with two curly braces. E.g `command {{arg}}`.
5+
command: |-
6+
curl -XGET '{{schema}}://{{host}}:{{port}}/_cat/count/{{index_name}}?v={{verbose}}'
7+
# Any tags that the workflow should be categorized with.
8+
tags:
9+
- elasticsearch
10+
- curl
11+
# A description of the workflow.
12+
description: Show the document count for an index in Elasticsearch
13+
# List of arguments within the command.
14+
arguments:
15+
# Name of the argument within the command. This must exactly match the name of the argument
16+
# within the command (without the curly braces).
17+
- name: schema
18+
# The description of the argument.
19+
description: The url schema
20+
# The default value for the argument.
21+
default_value: http
22+
# within the command (without the curly braces).
23+
- name: host
24+
# The description of the argument.
25+
description: The url hostname
26+
# The default value for the argument.
27+
default_value: localhost
28+
# within the command (without the curly braces).
29+
- name: port
30+
# The description of the argument.
31+
description: The url port
32+
# The default value for the argument.
33+
default_value: 9200
34+
# within the command (without the curly braces).
35+
- name: index_name
36+
# The description of the argument.
37+
description: The name of the index you want the count for
38+
- name: verbose
39+
# The description of the argument.
40+
description: Should the output be verbose
41+
# The default value for the argument.
42+
default_value: true
43+
# The source URL for where the workflow was generated from, if any.
44+
source_url: "https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-count.html"
45+
# The author of the workflow.
46+
author: Olaf Klejnstrup-Jensen
47+
# The URL of original author of the Workflow. For example, if this workflow was generated from StackOverflow, the `author_url` would be the StackOverflow author's profile page.
48+
author_url: "https://github.com/fului"
49+
# The valid shells where this workflow should be active. If valid for all shells, this can be left empty.
50+
# See FORMAT.md for the full list of accepted values.
51+
shells: []
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
# The name of the workflow.
3+
name: List indices in Elasticsearch
4+
# The corresponding command for the workflow. Any arguments should be surrounded with two curly braces. E.g `command {{arg}}`.
5+
command: |-
6+
curl -XGET '{{schema}}://{{host}}:{{port}}/_cat/indices?v={{verbose}}&s=index'
7+
# Any tags that the workflow should be categorized with.
8+
tags:
9+
- elasticsearch
10+
- curl
11+
# A description of the workflow.
12+
description: This lists indices in Elasticsearch
13+
# List of arguments within the command.
14+
arguments:
15+
# Name of the argument within the command. This must exactly match the name of the argument
16+
# within the command (without the curly braces).
17+
- name: schema
18+
# The description of the argument.
19+
description: The url schema
20+
# The default value for the argument.
21+
default_value: http
22+
# within the command (without the curly braces).
23+
- name: host
24+
# The description of the argument.
25+
description: The url hostname
26+
# The default value for the argument.
27+
default_value: localhost
28+
# within the command (without the curly braces).
29+
- name: port
30+
# The description of the argument.
31+
description: The url port
32+
# The default value for the argument.
33+
default_value: 9200
34+
- name: verbose
35+
# The description of the argument.
36+
description: Should the output be verbose
37+
# The default value for the argument.
38+
default_value: true
39+
# The source URL for where the workflow was generated from, if any.
40+
source_url: "https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html"
41+
# The author of the workflow.
42+
author: Olaf Klejnstrup-Jensen
43+
# The URL of original author of the Workflow. For example, if this workflow was generated from StackOverflow, the `author_url` would be the StackOverflow author's profile page.
44+
author_url: "https://github.com/fului"
45+
# The valid shells where this workflow should be active. If valid for all shells, this can be left empty.
46+
# See FORMAT.md for the full list of accepted values.
47+
shells: []

0 commit comments

Comments
 (0)