Skip to main content
Previous sectionNext section

PUT /api/sam/admin/alertrule/{clusterid}/

Replace alert rules for specific cluster

Description

This method replaces the current alert settings for this cluster with the contents of the JSON array in the request body. The JSON request packet mirrors the JSON response packet for the GET /alertrule/:cluster/ endpoint.

To use this endpoint, you must log in as a user with access to the %SAM.Admin resource.

Request Example

PUT /api/sam/admin/alertrule/{clusterid}/

Parameters
clusterid Required path variable. The id of the cluster.

Example Prometheus alert rule object:

[
    {
        "alert":"iris_cpu_usage",
        "expr":"iris_cpu_usage{cluster="local"} > 0",
        "labels": {
            "severity":"critical"
        },
        "annotations": {
            "description":"iris_cpu_usage Critical: iris_cpu_usage = {{ $value }} (Critical value is 0)."
        }
    }
]
Copy code to clipboard

Response Example

A successful request returns a status 200 OK.