content/operate/rs/7.8/references/rest-api/requests/bdbs/availability.md
| Method | Path | Description |
|---|---|---|
| GET | /v1/local/bdbs/{uid}/endpoint/availability | Verifies local database endpoint availability |
| GET | /v1/bdbs/{uid}/availability | Verifies database availability |
GET /v1/local/bdbs/{uid}/endpoint/availability
Verifies the local database endpoint is available. This request does not redirect to the primary node.
| Permission name | Roles |
|---|---|
| [view_bdb_info]({{< relref "/operate/rs/7.8/references/rest-api/permissions#view_bdb_info" >}}) | admin |
| cluster_member | |
| cluster_viewer | |
| db_member | |
| db_viewer | |
| user_manager |
GET /v1/local/bdbs/1/endpoint/availability
| Key | Value | Description |
|---|---|---|
| Host | cnm.cluster.fqdn | Domain name |
| Accept | application/json | Accepted media type |
| Field | Type | Description |
|---|---|---|
| uid | integer | The unique ID of the database. |
Returns the status code 200 OK if the local database endpoint is available.
If the local database endpoint is unavailable, returns an error status code and a JSON object that contains error_code and description fields.
When errors are reported, the server may return a JSON object with
error_code and description fields that provide additional information.
The following are possible error_code values:
| Code | Description |
|---|---|
| no_quorum | Master healthcheck failed (no quorum in the cluster) |
| db_not_found | Database does not exist in the cluster |
| bdb_endpoint_unavailable | Local database endpoint is not available |
| Code | Description |
|---|---|
| 200 OK | Database endpoint is available. |
| 503 Service Unavailable | Database endpoint is unavailable. |
GET /v1/bdbs/{uid}/availability
Gets the availability status of a database.
If the OSS Cluster API is enabled, verifies all endpoints for this database are available.
Otherwise, verifies the database has at least one available endpoint.
| Permission name | Roles |
|---|---|
| [view_bdb_info]({{< relref "/operate/rs/7.8/references/rest-api/permissions#view_bdb_info" >}}) | admin |
| cluster_member | |
| cluster_viewer | |
| db_member | |
| db_viewer | |
| user_manager |
GET /v1/bdbs/1/availability
| Key | Value | Description |
|---|---|---|
| Host | cnm.cluster.fqdn | Domain name |
| Accept | application/json | Accepted media type |
| Field | Type | Description |
|---|---|---|
| uid | integer | The unique ID of the database. |
Returns the status code 200 OK if the database is available.
If the database is unavailable, returns an error status code and a JSON object that contains error_code and description fields.
When errors are reported, the server may return a JSON object with
error_code and description fields that provide additional information.
The following are possible error_code values:
| Code | Description |
|---|---|
| no_quorum | Master healthcheck failed (no quorum in the cluster) |
| db_not_found | Database does not exist in the cluster |
| bdb_unavailable | Database is not available |
| Code | Description |
|---|---|
| 200 OK | Database is available. |
| 503 Service Unavailable | Database is unavailable or doesn't have quorum. |