Skip to main content
Alerting & Response/Alert Rules
POSTAlertingSince 1.0SynchronousAuth Required

DryRunAlertRuleUpdate

Dry-run an update to preview changes without persisting them

Execution Availability

Try It Out

Submit a mock request using the current auth context and example-driven inputs.

Path Parameters

Request Inputs

Path Parameters

  • ruleIdStringRequired

    UUID of the rule to dry-run update against

Body Fields

  • inputObjectRequired

    New rule input to validate against current state

    • nameString

      Rule name to validate

      Example: High CPU Usage

    • promqlString

      PromQL expression for the rule

      Example: avg(cpu_usage_percent) > 90

    • thresholdLong

      Threshold value for the rule

      Example: 90

    • forString

      Duration string for the for clause

      Example: 5m

Responses

200 OK

On success, this API returns the following response structure.

  • wouldSucceedBoolean

    Whether the update would succeed if applied

    Example: true

  • changedFieldsList

    Fields that would be changed by the update

    Example: (nested array)

    • fieldString

      Name of the field that changed

      Example: threshold

    • oldValueString

      Previous value of the field

      Example: 90

    • newValueString

      New value of the field

      Example: 85

  • validationErrorsList

    Validation errors that would prevent the update

    Example: item1,item2

  • warningsList

    Non-blocking warnings about the update

    Example: item1,item2

Endpoint

POST/api/v1/alerting/rules/{ruleId}/dry-run

/api/v1/alerting/rules/{ruleId}/dry-run

Operation ID

DryRunAlertRuleUpdate

Permalink

Request Example

curl -X POST '{host}/api/v1/alerting/rules/{ruleId}/dry-run' -H 'Authorization: Bearer {token}' -H 'Content-Type: application/json' -d '{"input":{"name":"High CPU Usage","promql":"avg(cpu_usage_percent) > 90","threshold":90.0,"for":"5m"}}'

Response Example

200
{
  "wouldSucceed": true,
  "changedFields": [
    {}
  ],
  "validationErrors": [],
  "warnings": []
}

Change History

This API has no change history records yet.

View all change history