CRDBs requests
Active-Active database requests
| Redis Software |
|---|
| Method | Path | Description |
|---|---|---|
| GET | /v1/crdbs |
Get all Active-Active databases |
| GET | /v1/crdbs/{crdb_guid} |
Get a specific Active-Active database |
| PATCH | /v1/crdbs/{crdb_guid} |
Update an Active-Active database |
| POST | /v1/crdbs |
Create a new Active-Active database |
| DELETE | /v1/crdbs/{crdb_guid} |
Delete an Active-Active database |
Get all Active-Active databases
GET /v1/crdbs
Get a list of all Active-Active databases on the cluster.
Request
Example HTTP request
GET /v1/crdbs
Headers
| Key | Value | Description |
|---|---|---|
| X-Task-ID | string | Specified task ID |
| X-Result-TTL | integer | Time (in seconds) to keep task result |
Response
Returns a JSON array of CRDB objects.
Status codes
| Code | Description |
|---|---|
| 200 OK | A list of Active-Active database. |
| 401 Unauthorized | Unauthorized request. Invalid credentials |
Get an Active-Active database
GET /v1/crdbs/{crdb_guid}
Get a specific Active-Active database.
Request
Example HTTP request
GET /v1/crdbs/552bbccb-99f3-4142-bd17-93d245f0bc79
Headers
| Key | Value | Description |
|---|---|---|
| X-Task-ID | string | Specified task ID |
| X-Result-TTL | integer | Time (in seconds) to keep task result |
URL parameters
| Field | Type | Description |
|---|---|---|
| crdb_guid | string | Globally unique Active-Active database ID (GUID) |
Query parameters
| Field | Type | Description |
|---|---|---|
| instance_id | integer | Instance from which to get the Active-Active database information |
Response
Returns a CRDB object.
Status codes
| Code | Description |
|---|---|
| 200 OK | Active-Active database information is returned. |
| 401 Unauthorized | Unauthorized request. Invalid credentials |
| 404 Not Found | Database or configuration does not exist. |
Update an Active-Active database
PATCH /v1/crdbs/{crdb_guid}
Update an Active-Active database's configuration.
Updating default_db_config affects both existing and new instances.
When you update db_config, it changes the configuration of the specified database instance. This field overrides any corresponding fields in default_db_config.
For a list of which settings must be identical across all instances and which to set per instance, see the CRDB database config object reference.
To add or remove instances, use POST crdbs/{crdb_guid}/updates
Request
Example HTTP request
PATCH /v1/crdbs/552bbccb-99f3-4142-bd17-93d245f0bc79
Headers
| Key | Value | Description |
|---|---|---|
| X-Task-ID | string | Specified task ID |
| X-Result-TTL | integer | Time (in seconds) to keep task result |
URL parameters
| Field | Type | Description |
|---|---|---|
| crdb_guid | string | Globally unique Active-Active database ID (GUID) |
Request body
Include a CRDB object with updated fields in the request body.
Response
Returns a CRDB task object.
Status codes
| Code | Description |
|---|---|
| 200 OK | The request has been accepted. |
| 400 Bad Request | The posted Active-Active database contains invalid parameters. |
| 401 Unauthorized | Unauthorized request. Invalid credentials |
| 404 Not Found | Configuration or Active-Active database not found. |
| 406 Not Acceptable | The posted Active-Active database cannot be accepted. |
Create an Active-Active database
POST /v1/crdbs
Create a new Active-Active database.
For a list of which settings must be identical across all instances and which to set per instance, see the CRDB database config object reference.
Request
Example HTTP request
POST /v1/crdbs
Headers
| Key | Value | Description |
|---|---|---|
| X-Task-ID | string | Specified task ID |
| X-Result-TTL | integer | Time (in seconds) to keep task result |
Query parameters
| Field | Type | Description |
|---|---|---|
| dry_run | boolean | Validate the request without creating the database (optional) |
Request body
Include a CRDB object, which defines the Active-Active database, in the request body.
Example body
{
"default_db_config":
{
"name": "sample-crdb",
"memory_size": 214748365
},
"instances":
[
{
"cluster":
{
"url": "http://<cluster1_FQDN>:9443",
"credentials":
{
"username": "<username>",
"password": "<password>"
},
"name": "cluster-1"
},
"compression": 6
},
{
"cluster":
{
"url": "http://<cluster2_FQDN>:9443",
"credentials":
{
"username": "<username>",
"password": "<password>"
},
"name": "cluster-2"
},
"compression": 6
}
],
"name": "sample-crdb"
}
This JSON body creates an Active-Active database without TLS and with two participating clusters.
Response
Returns a CRDB task object.
Status codes
| Code | Description |
|---|---|
| 200 OK | The request has been accepted. |
| 400 Bad Request | The request is invalid or malformed. |
| 401 Unauthorized | Unauthorized request. Invalid credentials |
| 406 Not Acceptable | The posted Active-Active database cannot be accepted. |
Delete an Active-Active database
DELETE /v1/crdbs/{crdb_guid}
Delete an Active-Active database.
Request
Example HTTP request
DELETE /v1/crdbs/552bbccb-99f3-4142-bd17-93d245f0bc79
Headers
| Key | Value | Description |
|---|---|---|
| X-Task-ID | string | Specified task ID |
| X-Result-TTL | integer | Time (in seconds) to keep task result |
URL parameters
| Field | Type | Description |
|---|---|---|
| crdb_guid | string | Globally unique Active-Active database ID (GUID) |
Response
Returns a CRDB task object.
Status codes
| Code | Description |
|---|---|
| 200 OK | Action was successful. |
| 401 Unauthorized | Unauthorized request. Invalid credentials |
| 404 Not Found | Configuration or Active-Active database not found. |
| 406 Not Acceptable | The Active-Active GUID is invalid or the Active-Active database was already deleted. |