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. (opensearch-project#479)

Signed-off-by: AWSHurneyt <[email protected]>
  • Loading branch information
AWSHurneyt authored Jul 11, 2023
1 parent b2e9ddc commit f062232
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 @@ -261,6 +261,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 @@ -275,6 +282,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 f062232

Please sign in to comment.