Skip to content

Commit 057a2e9

Browse files
committed
DOC-4307 Add DB availability API examples
1 parent 00a5a0a commit 057a2e9

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

content/operate/rs/databases/durability-ha/db-availability.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,32 @@ weight: 30
1414

1515
You can use the [database availability API]({{<relref "/operate/rs/references/rest-api/requests/bdbs/availability">}}) to verify whether a Redis Software database is available to perform read and write operations and can respond to queries from client applications. Load balancers and automated monitoring tools can use this API to monitor database availability.
1616

17+
## Check database availability
18+
19+
To check the availability status of a database:
20+
21+
```sh
22+
GET /v1/bdbs/<database_id>/availability
23+
```
24+
25+
If the OSS Cluster API is enabled, this request verifies all endpoints for this database are available. Otherwise, it verifies the database has at least one available endpoint.
26+
27+
Returns the status code 200 OK if the database is available.
28+
29+
If the database is unavailable, returns an error status code and a JSON object that contains [`error_code` and `description` fields]({{<relref "/operate/rs/references/rest-api/requests/bdbs/availability#get-db-error-codes">}}).
30+
31+
## Check local database endpoint availability
32+
33+
To check the availability of a local database endpoint:
34+
35+
```sh
36+
GET /v1/local/bdbs/<database_id>/endpoint/availability
37+
```
38+
39+
Returns the status code 200 OK if the local database endpoint is available.
40+
41+
If the local database endpoint is unavailable, returns an error status code and a JSON object that contains [`error_code` and `description` fields]({{<relref "/operate/rs/references/rest-api/requests/bdbs/availability#get-endpoint-error-codes">}}).
42+
1743
## Availability by database status
1844

1945
| Database status | Availability |

0 commit comments

Comments
 (0)