Skip to content

Commit 993548d

Browse files
committed
DOC-4656 Add Essentials endpoints to create and manage subscriptions
1 parent f1a711e commit 993548d

File tree

1 file changed

+97
-20
lines changed

1 file changed

+97
-20
lines changed

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

Lines changed: 97 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,93 @@ 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` to create an Essentials subscription.
19+
20+
```sh
21+
POST "https://[host]/v1/fixed/subscriptions"
22+
{
23+
"name": "My new subscription",
24+
"planId": <plan_id>,
25+
"paymentMethodId": <payment_id>
26+
}
27+
```
28+
29+
Modify the following parameters in the sample JSON document to create a subscription on your own account:
30+
31+
- **`paymentMethodId`** - Specify a payment method connected to your account.
32+
33+
Use `GET /v1/payment-methods` to find a payment method ID.
34+
35+
You don't need to pass this field in your API request if you subscribed to Redis Cloud through a marketplace integration.
36+
37+
- **`planId`** - Specify an essentials plan to create.
38+
39+
Use `GET /v1/fixed/plans` to get a list of plan IDs.
40+
41+
After you create an Essentials subscription, you must use the `POST /v1/fixed/subscriptions/{subscriptionId}/databases` endpoint to create the database.
42+
43+
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.
44+
45+
{{< note >}}
46+
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.
47+
{{< /note >}}
48+
49+
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.
50+
51+
### Update an Essentials subscription
52+
53+
Use `PUT /v1/fixed/subscriptions/{subscriptionId}` 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` 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` 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}` to track the task's status.
80+
81+
### Delete an Essentials subscription
82+
83+
Use `DELETE /v1/subscriptions/<subscriptionId>` 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>` to track the task's status.
89+
90+
## Redis Cloud Pro
91+
92+
### Create a Pro subscription
93+
94+
Use `POST /v1/subscriptions` to create a Pro subscription.
1895

1996
```sh
2097
POST "https://[host]/v1/subscriptions"
@@ -47,15 +124,15 @@ Modify the following parameters in the sample JSON document to create a subscrip
47124

48125
- **`paymentMethodId`** - Specify a payment method connected to your account.
49126

50-
Use `GET /payment-methods` to find a payment method ID.
127+
Use `GET /v1/payment-methods` to find a payment method ID.
51128

52-
You don't need to pass this field in your API request if you subscribed to Redis Cloud through Google Cloud Marketplace.
129+
You don't need to pass this field in your API request if you subscribed to Redis Cloud through a marketplace integration.
53130

54131
- **`cloudAccountId`** - Set a cloud account ID connected to your account.
55132

56-
To list cloud account IDs, use `GET /cloud-accounts`. To use internal resources, set it to `"cloudAccountId": 1`.
57-
58-
If you subscribed to Redis Cloud through Google Cloud Marketplace, use `1` for this field.
133+
To list cloud account IDs, use `GET /v1/cloud-accounts`.
134+
135+
You don't need to pass this field in your API request if you want to use internal resources.
59136

60137
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.
61138

@@ -65,14 +142,14 @@ You can include the contents of the JSON document in the `POST /subscriptions` o
65142
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.
66143
{{< /note >}}
67144

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.
145+
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.
69146

70-
## Update a subscription
147+
### Update a Pro subscription
71148

72-
Use `PUT /v1/subscriptions/<subscriptionId>` to update a subscription.
149+
Use `PUT /v1/subscriptions/{subscriptionId}` to update a Pro subscription.
73150

74151
```sh
75-
PUT "https://[host]/v1/subscriptions/<subscriptionId>"
152+
PUT "https://[host]/v1/subscriptions/{subscriptionId}"
76153
{
77154
"name": "new-subscription-name",
78155
"paymentMethodId": <payment_id>
@@ -84,15 +161,15 @@ You can only change the following settings with this endpoint:
84161

85162
- **`paymentMethodId`** - Specify a different payment method connected to your account.
86163

87-
Use `GET /payment-methods` to find a payment method ID.
164+
Use `GET /v1/payment-methods` to find a payment method ID.
88165

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.
166+
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.
90167

91-
## Delete a subscription
168+
### Delete a Pro subscription
92169

93-
Use `DELETE /v1/subscriptions/<subscriptionId>` to delete a subscription.
170+
Use `DELETE /v1/subscriptions/{subscriptionId}` to delete a subscription.
94171

95172
```sh
96-
DELETE "https://[host]/v1/subscriptions/<subscriptionId>"
173+
DELETE "https://[host]/v1/subscriptions/{subscriptionId}"
97174
```
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.
175+
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.

0 commit comments

Comments
 (0)