Skip to main content
GET
/
alert-rules
/
{alertRuleId}
Get alert rule
curl --request GET \
  --url https://api.qovery.com/alert-rules/{alertRuleId} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.qovery.com/alert-rules/{alertRuleId}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.qovery.com/alert-rules/{alertRuleId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.qovery.com/alert-rules/{alertRuleId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.qovery.com/alert-rules/{alertRuleId}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.qovery.com/alert-rules/{alertRuleId}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.qovery.com/alert-rules/{alertRuleId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created_at": "2023-11-07T05:31:56Z",
  "name": "<string>",
  "organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "description": "<string>",
  "tag": "<string>",
  "condition": {
    "promql": "<string>",
    "threshold": 123
  },
  "for_duration": "<string>",
  "enabled": true,
  "alert_receiver_ids": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "presentation": {
    "summary": "<string>",
    "runbook_url": "<string>"
  },
  "target": {
    "target_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "service": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>",
      "description": "<string>",
      "icon_uri": "<string>",
      "project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "project_name": "<string>",
      "environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "environment_name": "<string>",
      "cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    }
  },
  "is_up_to_date": true,
  "updated_at": "2023-11-07T05:31:56Z",
  "starts_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

JWT tokens should be used with OIDC account (human to machine). JWT tokens used by the Qovery console to communicate with the API have a TTL. Curl Example ' curl https://console.qovery.com/organization -H "Authorization: Bearer $qovery_token" '

Path Parameters

alertRuleId
string<uuid>
required

Alert Rule ID

Response

OK

Base schema for alert rule responses with discriminator

id
string<uuid>
required
read-only
created_at
string<date-time>
required
read-only
source
enum<string>
required

Source of the alert rule:

  • MANAGED: Alert rule created and managed through the Qovery API
  • GHOST: Alert rule that exists in Prometheus but has been deleted from the database
Available options:
MANAGED,
GHOST
name
string
required

Name of the alert rule

state
enum<string>
required
Available options:
UNDEPLOYED,
OK,
TRIGGERED,
PENDING_NOTIFICATION,
NOTIFIED,
SUPPRESSED,
UNROUTED
organization_id
string<uuid>
required

Organization identifier

cluster_id
string<uuid>
required

Cluster identifier

description
string
required

Description of what the alert monitors

tag
string
required
condition
AlertRuleCondition · object
required
for_duration
string<duration>
required

Duration the condition must be true before firing (ISO-8601 duration format)

severity
enum<string>
required

Alert severity level: - LOW: Minor issues or informational alerts that don't require immediate attention. Can be addressed during normal business hours. - MEDIUM: Moderate issues that should be investigated soon but don't impact critical services. May cause degraded performance or minor service disruption. - HIGH: Serious issues affecting service quality or availability. Requires prompt attention and resolution within hours. - CRITICAL: Critical issue requiring immediate action. Service outage, data loss risk, or severe performance degradation affecting users.

Available options:
LOW,
MEDIUM,
HIGH,
CRITICAL
enabled
boolean
required

Whether the alert rule is enabled

alert_receiver_ids
string<uuid>[]
required

List of alert receiver IDs to send notifications to

presentation
AlertPresentationResponse · object
required
target
AlertTarget · object
required
is_up_to_date
boolean
required

Indicates whether the current version of the alert has been synced with the alerting system. If false, an outdated version is currently deployed.

updated_at
string<date-time>
read-only
starts_at
string<date-time>

when the alert starts firing