You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/operate/rc/api/examples/create-database.md
+56-22Lines changed: 56 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -5,45 +5,79 @@ categories:
5
5
- docs
6
6
- operate
7
7
- rc
8
-
description: This article describes how to create and manage a database using `cURL`
9
-
commands.
10
-
linkTitle: Create databases
8
+
description: This article describes how to create and manage a database using the Redis Cloud API.
9
+
linkTitle: Create and manage databases
11
10
weight: 20
12
11
---
13
12
14
-
You can use the Redis Cloud REST API to create databases.
13
+
You can use the Redis Cloud REST API to create and manage databases.
15
14
16
-
These examples use the [`cURL` utility]({{< relref "/operate/rc/api/get-started/use-rest-api#use-the-curl-http-client" >}}). You can use any REST client to work with the Redis Cloud REST API. The examples in this article refer to Redis Cloud Pro databases.
15
+
## Redis Cloud Essentials
17
16
18
-
## Create a database
17
+
###Create an Essentials database
19
18
20
-
To create a database, use `POST /subscriptions/{subscription-id}/databases`
19
+
To create a Redis Cloud Essentials database, use [`POST /fixed/subscriptions/{subscriptionId}/databases`]({{< relref "/operate/rc/api/api-reference#tag/Databases-Essentials/operation/createFixedDatabase" >}}).
21
20
22
-
The database is created in an existing or a newly created subscription.
21
+
This call creates a database in the specified subscription. Use [`GET /fixed/subscriptions`]({{< relref "/operate/rc/api/api-reference#tag/Subscriptions-Essentials/operation/getAllSubscriptions_1" >}}) to get a list of Essentials subscriptions and their IDs.
23
22
24
-
When a subscription is created, it is created with at least one database.
23
+
```shell
24
+
POST "https://[host]/v1/fixed/subscriptions/{subscriptionId}/databases"
25
+
{
26
+
"name": "Basic-essentials-database-example"
27
+
}
28
+
```
29
+
30
+
This example JSON body contains only the most basic, required parameters to create a database:
31
+
32
+
-`name`: The database name. A unique name per subscription that can contain only alphanumeric characters and hyphens
33
+
34
+
There are other additional parameters and settings that can be defined on database creation. Review the database parameters and options in the [full API reference]({{< relref "/operate/rc/api/api-reference#tag/Databases-Essentials/operation/createFixedDatabase" >}}).
35
+
36
+
Some options may not be compatible with your selected plan. Use [`GET /fixed/subscriptions/{subscriptionId}`]({{< relref "/operate/rc/api/api-reference#tag/Subscriptions-Essentials/operation/getFixedSubscriptionsPlansBySubscriptionId" >}}) to view the plan you have selected and what options it supports.
37
+
38
+
The response body contains the `taskId` for the task that creates the database. You can use [`GET /v1/tasks/{taskId}`]({{< relref "/operate/rc/api/api-reference#tag/Tasks/operation/getTaskById" >}}) to track the task's status.
39
+
40
+
### Update an Essentials database
25
41
26
-
You can add databases to the subscription; you can also update or delete existing databases.
42
+
To update a Redis Cloud Essentials database, use [`PUT /fixed/subscriptions/{subscriptionId}/databases/{databaseId}`]({{< relref "/operate/rc/api/api-reference#tag/Databases-Essentials/operation/deleteFixedDatabaseByID" >}}).
27
43
28
-
Creating a database is an [asynchronous operation]({{< relref "/operate/rc/api/get-started/process-lifecycle" >}}).
44
+
The primary component of a database update request is the JSON request body that contains the details of the requested database changes. You can see the full set of changes you can make in the [full API reference]({{< relref "/operate/rc/api/api-reference#tag/Databases-Essentials/operation/deleteFixedDatabaseByID" >}}).
29
45
30
-
The following API call creates a database.
46
+
Some options may not be compatible with your selected plan. Use [`GET /fixed/subscriptions/{subscriptionId}`]({{< relref "/operate/rc/api/api-reference#tag/Subscriptions-Essentials/operation/getFixedSubscriptionsPlansBySubscriptionId" >}}) to view the plan you have selected and what options it supports.
47
+
48
+
The response body contains the `taskId` for the task that updates the database. You can use [`GET /v1/tasks/{taskId}`]({{< relref "/operate/rc/api/api-reference#tag/Tasks/operation/getTaskById" >}}) to track the task's status.
49
+
50
+
## Redis Cloud Pro
51
+
52
+
### Create a Pro database
53
+
54
+
If you want to create a Pro database in a new subscription, see [Create a Pro subscription]({{< relref "/operate/rc/api/examples/manage-subscriptions#create-a-pro-subscription" >}}).
55
+
56
+
To create a Redis Cloud Pro database in an existing subscription, use [`POST /subscriptions/{subscriptionId}/databases`]({{< relref "/operate/rc/api/api-reference#tag/Databases-Pro/operation/createDatabase" >}}).
57
+
58
+
This call creates a database in the specified subscription. Use [`GET /subscriptions`]({{< relref "/operate/rc/api/api-reference#tag/Subscriptions-Pro/operation/getAllSubscriptions" >}}) to get a list of subscriptions and their IDs.
31
59
32
60
```shell
33
-
POST "https://[host]/v1/subscriptions/$SUBSCRIPTION_ID/databases"
61
+
POST "https://[host]/v1/subscriptions/{subscriptionId}/databases"
34
62
{
35
-
"name": "Database-example-basic",
36
-
"memoryLimitInGb": 10,
37
-
"password": "P@ssw0rd"
63
+
"name": "Basic-database-example",
64
+
"datasetSizeInGb": 1
38
65
}
39
66
```
40
67
41
-
The JSON body contains only the most basic, required parameters in order to create a database:
68
+
This example JSON body contains only the most basic, required parameters to create a database:
69
+
70
+
-`name`: The database name. A unique name per subscription that can contain only alphanumeric characters and hyphens
71
+
-`datasetSizeInGb`: Maximum dataset size in GB
72
+
73
+
There are many additional parameters and settings that can be defined on database creation. Review the database parameters and options in the [full API reference]({{< relref "/operate/rc/api/api-reference#tag/Databases-Pro/operation/createDatabase" >}}).
74
+
75
+
The response body contains the `taskId` for the task that creates the database. You can use [`GET /v1/tasks/{taskId}`]({{< relref "/operate/rc/api/api-reference#tag/Tasks/operation/getTaskById" >}}) to track the task's status.
76
+
77
+
### Update a Redis Cloud Pro database
42
78
43
-
- Database name - A unique name per subscription that can contain only alphanumeric characters and hyphens
44
-
- Maximum database size in GB
45
-
- Database password
79
+
To update a Redis Cloud Pro database, use [`PUT /subscriptions/{subscriptionId}/databases/{databaseId}`]({{< relref "/operate/rc/api/api-reference#tag/Databases-Pro/operation/updateDatabase" >}}).
46
80
47
-
### Additional database parameters
81
+
The primary component of a database update request is the JSON request body that contains the details of the requested database changes. You can see the full set of changes you can make in the [full API reference]({{< relref "/operate/rc/api/api-reference#tag/Databases-Pro/operation/updateDatabase" >}}).
48
82
49
-
There are many additional parameters and settings that can be defined on database creation. Review the database parameters and options in the [Full API documentation]({{< relref "/operate/rc/api/api-reference#tag/Databases-Pro/operation/createDatabase" >}}).
83
+
The response body contains the `taskId` for the task that updates the database. You can use [`GET /v1/tasks/{taskId}`]({{< relref "/operate/rc/api/api-reference#tag/Tasks/operation/getTaskById" >}}) to track the task's status.
Copy file name to clipboardExpand all lines: content/operate/rc/api/examples/manage-subscriptions.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ Modify the following parameters in the sample JSON document to create a subscrip
38
38
39
39
Use [`GET /v1/fixed/plans`]({{< relref "/operate/rc/api/api-reference#tag/Subscriptions-Essentials/operation/getAllFixedSubscriptionsPlans" >}}) to get a list of plan IDs.
40
40
41
-
After you create an Essentials subscription, you must use the [`POST /v1/fixed/subscriptions/{subscriptionId}/databases`]({{< relref "/operate/rc/api/api-reference#tag/Databases-Essentials/operation/createFixedDatabase" >}}) endpoint to create the database.
41
+
After you create an Essentials subscription, you must use the [`POST /v1/fixed/subscriptions/{subscriptionId}/databases`]({{< relref "/operate/rc/api/api-reference#tag/Databases-Essentials/operation/createFixedDatabase" >}}) endpoint to [create the database]({{< relref "/operate/rc/api/examples/create-database#redis-cloud-essentials" >}}).
42
42
43
43
You can include the contents of the JSON document in the `POST /v1/fixed/subscriptions` operation in the [Swagger UI](https://api.redislabs.com/v1/swagger-ui.html). See [Swagger user interface]({{< relref "/operate/rc/api/get-started/use-rest-api#swagger-user-interface" >}}) for more details.
0 commit comments