Skip to content

Commit 3a61d30

Browse files
committed
Merge branch 'DOC-4656' into DOC-4657
2 parents 6447235 + 2236f17 commit 3a61d30

File tree

4 files changed

+118
-47
lines changed

4 files changed

+118
-47
lines changed

content/operate/rc/api/_index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ You can use the API to:
3535
1. Database examples
3636
- [Create and manage databases]({{< relref "/operate/rc/api/examples/create-database" >}})
3737
- [Back up and import data]({{< relref "/operate/rc/api/examples/back-up-and-import-data.md" >}})
38-
1. [Manage cloud accounts]({{< relref "/operate/rc/api/examples/manage-cloud-accounts.md" >}})
3938
1. [Estimate costs]({{< relref "/operate/rc/api/examples/dryrun-cost-estimates.md" >}})
40-
1. [View account info]({{< relref "/operate/rc/api/examples/view-account-information.md" >}})
4139

4240
## More info
4341

content/operate/rc/api/examples/manage-cloud-accounts.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ description: Cloud accounts specify which account to use when creating and modif
99
infrastructure resources.
1010
linkTitle: Manage cloud accounts
1111
weight: 80
12+
draft: true
1213
---
14+
<!-- This article is removed since it was duplicated with the REST API reference. I decided to keep it as a draft just in case. -->
15+
1316
You can use the Redis Cloud REST API to create and manage cloud accounts.
1417

1518
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.

content/operate/rc/api/examples/manage-subscriptions.md

Lines changed: 113 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,74 +5,142 @@ categories:
55
- docs
66
- operate
77
- rc
8-
description: This article describes how to create and manage a subscription using
9-
`cURL` commands.
8+
description: Describes how to create and manage a subscription using the Redis Cloud API.
109
weight: 10
1110
---
1211

13-
The Redis Cloud REST API lets you create and manage all kinds of subscriptions. The examples in this article refer to Redis Cloud Pro subscriptions.
12+
The Redis Cloud REST API lets you create and manage all kinds of subscriptions.
1413

15-
## Create a subscription
14+
## Redis Cloud Essentials
1615

17-
Use `POST /v1/subscriptions` to create a subscription.
16+
### Create an Essentials subscription
17+
18+
Use [`POST /v1/fixed/subscriptions`]({{< relref "/operate/rc/api/api-reference#tag/Subscriptions-Essentials/operation/createSubscription_1" >}}) to create an Essentials subscription.
1819

1920
```sh
20-
POST "https://[host]/v1/subscriptions"
21+
POST "https://[host]/v1/fixed/subscriptions"
2122
{
22-
"name": "Basic subscription example",
23-
"paymentMethodId": <payment_id>,
24-
"cloudProviders": [
25-
{
26-
"cloudAccountId": <account_id>,
27-
"regions": [
28-
{
29-
"region": "us-east-1",
30-
"networking": {
31-
"deploymentCIDR": "10.0.0.0/24"
32-
}
33-
}
34-
]
35-
}
36-
],
37-
"databases": [
38-
{
39-
"name": "Redis-database-example",
40-
"memoryLimitInGb": 1.1
41-
}
42-
]
23+
"name": "My new subscription",
24+
"planId": <plan_id>,
25+
"paymentMethodId": <payment_id>
4326
}
4427
```
4528

4629
Modify the following parameters in the sample JSON document to create a subscription on your own account:
4730

4831
- **`paymentMethodId`** - Specify a payment method connected to your account.
4932

50-
Use `GET /payment-methods` to find a payment method ID.
51-
52-
You don't need to pass this field in your API request if you subscribed to Redis Cloud through Google Cloud Marketplace.
33+
Use [`GET /v1/payment-methods`]({{< relref "/operate/rc/api/api-reference#tag/Account/operation/getAccountPaymentMethods" >}}) to find a payment method ID.
5334

54-
- **`cloudAccountId`** - Set a cloud account ID connected to your account.
35+
You don't need to pass this field in your API request if you subscribed to Redis Cloud through a marketplace integration.
5536

56-
To list cloud account IDs, use `GET /cloud-accounts`. To use internal resources, set it to `"cloudAccountId": 1`.
37+
- **`planId`** - Specify an essentials plan to create.
5738

58-
If you subscribed to Redis Cloud through Google Cloud Marketplace, use `1` for this field.
39+
Use [`GET /v1/fixed/plans`]({{< relref "/operate/rc/api/api-reference#tag/Subscriptions-Essentials/operation/getAllFixedSubscriptionsPlans" >}}) to get a list of plan IDs.
5940

60-
The request JSON body contains two primary segments: subscription specification and databases specification. When you create a subscription, you must specify one or more databases in the "`databases`" array.
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.
6142

62-
You can include the contents of the JSON document in the `POST /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.
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.
6344

6445
{{< note >}}
6546
The Swagger UI generates default JSON examples for `POST` and `PUT` operations. You can reference these examples and modify them to fit your specific needs and account settings. The examples will fail if used as-is.
6647
{{< /note >}}
6748

68-
The response body contains the `taskId` for the task that creates the subscription. You can use `GET /v1/tasks/<taskId>` to track the task's status.
49+
The response body contains the `taskId` for the task that creates the subscription. You can use [`GET /v1/tasks/{taskId}`]({{< relref "/operate/rc/api/api-reference#tag/Tasks/operation/getTaskById" >}}) to track the task's status.
50+
51+
### Update an Essentials subscription
52+
53+
Use [`PUT /v1/fixed/subscriptions/{subscriptionId}`]({{< relref "/operate/rc/api/api-reference#tag/Subscriptions-Essentials/operation/updateSubscription_1" >}}) to update an Essentials subscription.
54+
55+
```sh
56+
PUT "https://[host]/v1/fixed/subscriptions/{subscriptionId}"
57+
{
58+
"name": "new-subscription-name",
59+
"planId": <plan_id>,
60+
"paymentMethodId": <payment_id>
61+
}
62+
```
63+
64+
You can only change the following settings with this endpoint:
65+
- **`name`** - Specify a new name for your subscription.
66+
67+
- **`planId`** - Specify a new Essentials plan to change to.
68+
69+
Use [`GET /v1/fixed/plans`]({{< relref "/operate/rc/api/api-reference#tag/Subscriptions-Essentials/operation/getAllFixedSubscriptionsPlans" >}}) to get a list of plan IDs.
70+
71+
You can only change to a plan that:
72+
- Is in the same cloud provider and region of your current plan.
73+
- Has a compatible [High-availability option]({{< relref "/operate/rc/databases/configuration/high-availability" >}}) to your current plan. For example, if your current plan has single-zone replication, you cannot switch to a plan with multi-zone replication, but you can switch to a plan with no replication. If your current plan has multi-zone replication, you must switch to a plan with multi-zone replication.
74+
75+
- **`paymentMethodId`** - Specify a different payment method connected to your account.
76+
77+
Use [`GET /v1/payment-methods`]({{< relref "/operate/rc/api/api-reference#tag/Account/operation/getAccountPaymentMethods" >}}) to find a payment method ID.
78+
79+
The response body contains the `taskId` for the task that updates the subscription. You can use [`GET /v1/tasks/{taskId}`]({{< relref "/operate/rc/api/api-reference#tag/Tasks/operation/getTaskById" >}}) to track the task's status.
80+
81+
### Delete an Essentials subscription
82+
83+
Use [`DELETE /v1/fixed/subscriptions/{subscriptionId}`]({{< relref "/operate/rc/api/api-reference#tag/Subscriptions-Essentials/operation/deleteSubscriptionById_1" >}}) to delete a subscription.
84+
85+
```sh
86+
DELETE "https://[host]/v1/fixed/subscriptions/{subscriptionId}"
87+
```
88+
The response body contains the `taskId` for the task that deletes the subscription. You can use [`GET /v1/tasks/{taskId}`]({{< relref "/operate/rc/api/api-reference#tag/Tasks/operation/getTaskById" >}}) to track the task's status.
89+
90+
## Redis Cloud Pro
91+
92+
### Create a Pro subscription
93+
94+
Use [`POST /v1/subscriptions`]({{< relref "/operate/rc/api/api-reference#tag/Subscriptions-Pro/operation/createSubscription" >}}) to create a Pro subscription.
95+
96+
```sh
97+
POST "https://[host]/v1/subscriptions"
98+
{
99+
"name": "Basic Subscription Example",
100+
"paymentMethodId": <payment_id>,
101+
"cloudProviders": [
102+
{
103+
"provider": "AWS",
104+
"regions": [
105+
{
106+
"region": "us-east-1",
107+
"networking": {
108+
"deploymentCIDR": "10.0.1.0/24"
109+
}
110+
}
111+
]
112+
}
113+
],
114+
"databases": [
115+
{
116+
"name": "Redis-database-example",
117+
"protocol": "redis",
118+
"datasetSizeInGb": 1
119+
}
120+
]
121+
}
122+
```
123+
124+
Modify the following parameters in the sample JSON document to create a subscription on your own account:
125+
126+
- **`paymentMethodId`** - Specify a payment method connected to your account.
127+
128+
Use [`GET /v1/payment-methods`]({{< relref "/operate/rc/api/api-reference#tag/Account/operation/getAccountPaymentMethods" >}}) to find a payment method ID.
129+
130+
You don't need to pass this field in your API request if you subscribed to Redis Cloud through a marketplace integration.
131+
132+
The request JSON body contains two primary segments: subscription specification and databases specification. When you create a subscription, you must specify one or more databases in the "`databases`" array.
133+
134+
There are many additional parameters and settings that can be defined on subscription and database creation. Review the subscription parameters and options in the [Full API documentation]({{< relref "/operate/rc/api/api-reference#tag/Subscriptions-Pro/operation/createSubscription" >}}).
135+
136+
The response body contains the `taskId` for the task that creates the subscription. You can use [`GET /v1/tasks/{taskId}`]({{< relref "/operate/rc/api/api-reference#tag/Tasks/operation/getTaskById" >}}) to track the task's status.
69137

70-
## Update a subscription
138+
### Update a Pro subscription
71139

72-
Use `PUT /v1/subscriptions/<subscriptionId>` to update a subscription.
140+
Use [`PUT /v1/subscriptions/{subscriptionId}`]({{< relref "/operate/rc/api/api-reference#tag/Subscriptions-Pro/operation/updateSubscription" >}}) to update a Pro subscription.
73141

74142
```sh
75-
PUT "https://[host]/v1/subscriptions/<subscriptionId>"
143+
PUT "https://[host]/v1/subscriptions/{subscriptionId}"
76144
{
77145
"name": "new-subscription-name",
78146
"paymentMethodId": <payment_id>
@@ -84,15 +152,15 @@ You can only change the following settings with this endpoint:
84152

85153
- **`paymentMethodId`** - Specify a different payment method connected to your account.
86154

87-
Use `GET /payment-methods` to find a payment method ID.
155+
Use [`GET /v1/payment-methods`]({{< relref "/operate/rc/api/api-reference#tag/Account/operation/getAccountPaymentMethods" >}}) to find a payment method ID.
88156

89-
The response body contains the `taskId` for the task that updates the subscription. You can use `GET /v1/tasks/<taskId>` to track the task's status.
157+
The response body contains the `taskId` for the task that updates the subscription. You can use [`GET /v1/tasks/{taskId}`]({{< relref "/operate/rc/api/api-reference#tag/Tasks/operation/getTaskById" >}}) to track the task's status.
90158

91-
## Delete a subscription
159+
### Delete a Pro subscription
92160

93-
Use `DELETE /v1/subscriptions/<subscriptionId>` to delete a subscription.
161+
Use [`DELETE /v1/subscriptions/{subscriptionId}`]({{< relref "/operate/rc/api/api-reference#tag/Subscriptions-Pro/operation/deleteSubscriptionById" >}}) to delete a subscription.
94162

95163
```sh
96-
DELETE "https://[host]/v1/subscriptions/<subscriptionId>"
164+
DELETE "https://[host]/v1/subscriptions/{subscriptionId}"
97165
```
98-
The response body contains the `taskId` for the task that deletes the subscription. You can use `GET /v1/tasks/<taskId>` to track the task's status.
166+
The response body contains the `taskId` for the task that deletes the subscription. You can use [`GET /v1/tasks/{taskId}`]({{< relref "/operate/rc/api/api-reference#tag/Tasks/operation/getTaskById" >}}) to track the task's status.

content/operate/rc/api/examples/view-account-information.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ categories:
77
- rc
88
description: Get initial information on account parameters
99
weight: 70
10+
draft: true
1011
---
12+
<!-- This article is removed since it was duplicated with the REST API reference. I decided to keep it as a draft just in case. -->
1113

1214
The root API operation returns information about the current account, user, and API Key (as identified by the set of API Keys provided in the API request).
1315

0 commit comments

Comments
 (0)