Skip to content

Commit

Permalink
Implemented support for configuring a cluster metrics monitor to call…
Browse files Browse the repository at this point in the history
… cat/indices, and cat/shards. (#479) (#481)

Signed-off-by: AWSHurneyt <[email protected]>
(cherry picked from commit f062232)

Co-authored-by: AWSHurneyt <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and AWSHurneyt authored Jul 12, 2023
1 parent 4ac75ba commit 1866ca6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,13 @@ data class ClusterMetricsInput(
val requiresPathParams: Boolean
) {
BLANK("", "", "", false, false),
CAT_INDICES(
"/_cat/indices",
"/_cat/indices",
"",
true,
false
),
CAT_PENDING_TASKS(
"/_cat/pending_tasks",
"/_cat/pending_tasks",
Expand All @@ -273,6 +280,13 @@ data class ClusterMetricsInput(
true,
false
),
CAT_SHARDS(
"/_cat/shards",
"/_cat/shards",
"",
true,
false
),
CAT_SNAPSHOTS(
"/_cat/snapshots",
"/_cat/snapshots",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,10 @@ fun randomDocLevelMonitorInput(
}

fun randomClusterMetricsInput(
path: String = ClusterMetricsInput.ClusterMetricType.CLUSTER_HEALTH.defaultPath,
path: String = ClusterMetricsInput.ClusterMetricType.values()
.filter { it.defaultPath.isNotBlank() && !it.requiresPathParams }
.random()
.defaultPath,
pathParams: String = "",
url: String = ""
): ClusterMetricsInput {
Expand Down

0 comments on commit 1866ca6

Please sign in to comment.