{
  "schema_version": 2,
  "id": "operate/rs/references/rest-api/requests/bdbs/alerts",
  "title": "Database alerts requests",
  "url": "https://redis.io/docs/latest/operate/rs/references/rest-api/requests/bdbs/alerts/",
  "summary": "Database alert requests",
  "tags": [
    "docs",
    "operate",
    "rs"
  ],
  "last_updated": "2025-03-10T13:08:54-04:00",
  "page_type": "content",
  "content_hash": "ff2ec03dea9c9c7a460579e3107f9585131df53cf42d184641266525a7ba6875",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "| Method | Path | Description |\n|--------|------|-------------|\n| [GET](#get-all-bdbs-alerts) | `/v1/bdbs/alerts` | Get all alert states for all databases |\n| [GET](#get-bdbs-alerts) | `/v1/bdbs/alerts/{uid}` | Get all alert states for a specific database |\n| [GET](#get-bdbs-alert) | `/v1/bdbs/alerts/{uid}/{alert}` | Get a specific database alert state |\n| [POST](#post-bdbs-alerts) | `/v1/bdbs/alerts/{uid}` | Update a database’s alerts configuration |"
    },
    {
      "id": "get-all-bdbs-alerts",
      "title": "Get all database alerts",
      "role": "content",
      "text": "GET /v1/bdbs/alerts\n\nGet all alert states for all databases.\n\n#### Required permissions\n\n| Permission name |\n|-----------------|\n| [view_all_bdbs_alerts](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#view_all_bdbs_alerts) |"
    },
    {
      "id": "get-all-request",
      "title": "Request",
      "role": "content",
      "text": "#### Example HTTP request\n\n\tGET /v1/bdbs/alerts \n\n#### Request headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |"
    },
    {
      "id": "get-all-response",
      "title": "Response",
      "role": "returns",
      "text": "Returns a hash of alert UIDs and the [alerts](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/alert) states for each database.\n\n#### Example JSON body\n\n[code example]"
    },
    {
      "id": "get-all-status-codes",
      "title": "Status codes",
      "role": "content",
      "text": "| Code | Description |\n|------|-------------|\n| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | No error |"
    },
    {
      "id": "get-bdbs-alerts",
      "title": "Get database alerts",
      "role": "content",
      "text": "GET /v1/bdbs/alerts/{int: uid}\n\nGet all alert states for a database.\n\n#### Required permissions\n\n| Permission name |\n|-----------------|\n| [view_bdb_alerts](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#view_bdb_alerts) |"
    },
    {
      "id": "get-request-alerts",
      "title": "Request",
      "role": "content",
      "text": "#### Example HTTP request\n\n\tGET /v1/bdbs/alerts/1 \n\n#### Request headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |"
    },
    {
      "id": "get-response-alerts",
      "title": "Response",
      "role": "returns",
      "text": "Returns a hash of [alert objects](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/alert) and their states.\n\n#### Example JSON body\n\n[code example]"
    },
    {
      "id": "get-status-codes-alerts",
      "title": "Status codes",
      "role": "content",
      "text": "| Code | Description |\n|------|-------------|\n| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | No error |\n| [404 Not Found](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5) | Specified bdb does not exist |"
    },
    {
      "id": "get-bdbs-alert",
      "title": "Get database alert",
      "role": "content",
      "text": "GET /v1/bdbs/alerts/{int: uid}/{alert}\n\nGet a database alert state.\n\n#### Required permissions\n\n| Permission name |\n|-----------------|\n| [view_bdb_alerts](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#view_bdb_alerts) |"
    },
    {
      "id": "get-request",
      "title": "Request",
      "role": "content",
      "text": "#### Example HTTP request\n\n\tGET /v1/bdbs/alerts/1/bdb_size \n\n\n#### Request headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |\n\n\n#### URL parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| uid | integer | The unique ID of the database |\n| alert | string | The alert name |"
    },
    {
      "id": "get-response",
      "title": "Response",
      "role": "returns",
      "text": "Returns an [alert object](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/alert).\n\n#### Example JSON body\n\n[code example]"
    },
    {
      "id": "get-status-codes",
      "title": "Status codes",
      "role": "content",
      "text": "| Code | Description |\n|------|-------------|\n| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | No error |\n| [400 Bad Request](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1) | Bad request |\n| [404 Not Found](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5) | Specified alert or bdb does not exist |"
    },
    {
      "id": "post-bdbs-alerts",
      "title": "Update database alert",
      "role": "content",
      "text": "POST /v1/bdbs/alerts/{int: uid}\n\nUpdates a database's alerts configuration.\n\n#### Required permissions\n\n| Permission name |\n|-----------------|\n| [update_bdb_alerts](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#update_bdb_alerts) |"
    },
    {
      "id": "post-request",
      "title": "Request",
      "role": "content",
      "text": "If passed with the dry_run URL query string, the function will validate the alert thresholds, but not commit them.\n\n#### Example HTTP request\n\n\tPOST /v1/bdbs/alerts/1 \n\n#### Example JSON body\n\n[code example]\n\n#### Request headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |\n\n\n#### URL parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| uid | integer | Database ID |\n| dry_run | string | Validate the alert thresholds but do not apply them |\n\n#### Request body\n\nThe request must contain a single JSON object with one or many database [alert objects](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/alert)."
    },
    {
      "id": "post-response",
      "title": "Response",
      "role": "returns",
      "text": "The response includes the updated database [alerts](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/alert)."
    },
    {
      "id": "post-status-codes",
      "title": "Status codes",
      "role": "content",
      "text": "| Code | Description |\n|------|-------------|\n| [404 Not Found](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5) | Specified database was not found. |\n| [406 Not Acceptable](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7) | Invalid configuration parameters provided. |\n| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | Success, database alerts updated. |"
    }
  ],
  "examples": [
    {
      "id": "get-all-response-ex0",
      "language": "json",
      "code": "{\n    \"1\": {\n        \"bdb_size\": {\n            \"enabled\": true,\n            \"state\": true,\n            \"threshold\": \"80\",\n            \"change_time\": \"2014-08-29T11:19:49Z\",\n            \"severity\": \"WARNING\",\n            \"change_value\": {\n                \"state\": true,\n                \"threshold\": \"80\",\n                \"memory_util\": 81.2\n            }\n        },\n        \"...\"\n    },\n    \"...\"\n}",
      "section_id": "get-all-response"
    },
    {
      "id": "get-response-alerts-ex0",
      "language": "json",
      "code": "{\n    \"bdb_size\": {\n        \"enabled\": true,\n        \"state\": true,\n        \"threshold\": \"80\",\n        \"severity\": \"WARNING\",\n        \"change_time\": \"2014-08-29T11:19:49Z\",\n        \"change_value\": {\n            \"state\": true,\n            \"threshold\": \"80\",\n            \"memory_util\": 81.2\n        }\n    },\n    \"...\"\n}",
      "section_id": "get-response-alerts"
    },
    {
      "id": "get-response-ex0",
      "language": "json",
      "code": "{\n    \"enabled\": true,\n    \"state\": true,\n    \"threshold\": \"80\",\n    \"severity\": \"WARNING\",\n    \"change_time\": \"2014-08-29T11:19:49Z\",\n    \"change_value\": {\n        \"state\": true,\n        \"threshold\": \"80\",\n        \"memory_util\": 81.2\n    }\n}",
      "section_id": "get-response"
    },
    {
      "id": "post-request-ex0",
      "language": "json",
      "code": "{\n     \"bdb_size\":{\n         \"threshold\":\"80\",\n         \"enabled\":true\n     },\n     \"bdb_high_syncer_lag\":{\n         \"threshold\":\"\",\n         \"enabled\":false\n     },\n     \"bdb_low_throughput\":{\n         \"threshold\":\"1\",\n         \"enabled\":true\n     },\n     \"bdb_high_latency\":{\n         \"threshold\":\"3000\",\n         \"enabled\":true\n     },\n     \"bdb_high_throughput\":{\n         \"threshold\":\"1\",\n         \"enabled\":true\n     },\n     \"bdb_backup_delayed\":{\n         \"threshold\":\"1800\",\n         \"enabled\":true\n     }\n}",
      "section_id": "post-request"
    }
  ]
}
