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 4c6364de..65ed29fd 100644 --- a/src/main/kotlin/org/opensearch/commons/alerting/model/ClusterMetricsInput.kt +++ b/src/main/kotlin/org/opensearch/commons/alerting/model/ClusterMetricsInput.kt @@ -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", @@ -275,6 +282,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 501ca85f..a0d32843 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 {