diff --git a/src/main/kotlin/org/opensearch/commons/alerting/model/ClusterMetricsInput.kt b/src/main/kotlin/org/opensearch/commons/alerting/model/ClusterMetricsInput.kt index bb658df3..ed522ef7 100644 --- a/src/main/kotlin/org/opensearch/commons/alerting/model/ClusterMetricsInput.kt +++ b/src/main/kotlin/org/opensearch/commons/alerting/model/ClusterMetricsInput.kt @@ -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", @@ -273,6 +280,13 @@ data class ClusterMetricsInput( true, false ), + CAT_SHARDS( + "/_cat/shards", + "/_cat/shards", + "", + true, + false + ), CAT_SNAPSHOTS( "/_cat/snapshots", "/_cat/snapshots", diff --git a/src/test/kotlin/org/opensearch/commons/alerting/TestHelpers.kt b/src/test/kotlin/org/opensearch/commons/alerting/TestHelpers.kt index 49792cb2..c4a68d44 100644 --- a/src/test/kotlin/org/opensearch/commons/alerting/TestHelpers.kt +++ b/src/test/kotlin/org/opensearch/commons/alerting/TestHelpers.kt @@ -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 {