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/manage-subscriptions.md
+97-20Lines changed: 97 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -5,16 +5,93 @@ categories:
5
5
- docs
6
6
- operate
7
7
- 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.
10
9
weight: 10
11
10
---
12
11
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.
14
13
15
-
## Create a subscription
14
+
## Redis Cloud Essentials
16
15
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.
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.
18
95
19
96
```sh
20
97
POST "https://[host]/v1/subscriptions"
@@ -47,15 +124,15 @@ Modify the following parameters in the sample JSON document to create a subscrip
47
124
48
125
-**`paymentMethodId`** - Specify a payment method connected to your account.
49
126
50
-
Use `GET /payment-methods` to find a payment method ID.
127
+
Use `GET /v1/payment-methods` to find a payment method ID.
51
128
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.
53
130
54
131
-**`cloudAccountId`** - Set a cloud account ID connected to your account.
55
132
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.
59
136
60
137
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.
61
138
@@ -65,14 +142,14 @@ You can include the contents of the JSON document in the `POST /subscriptions` o
65
142
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.
66
143
{{< /note >}}
67
144
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.
69
146
70
-
## Update a subscription
147
+
###Update a Pro subscription
71
148
72
-
Use `PUT /v1/subscriptions/<subscriptionId>` to update a subscription.
149
+
Use `PUT /v1/subscriptions/{subscriptionId}` to update a Pro subscription.
73
150
74
151
```sh
75
-
PUT "https://[host]/v1/subscriptions/<subscriptionId>"
152
+
PUT "https://[host]/v1/subscriptions/{subscriptionId}"
76
153
{
77
154
"name": "new-subscription-name",
78
155
"paymentMethodId": <payment_id>
@@ -84,15 +161,15 @@ You can only change the following settings with this endpoint:
84
161
85
162
-**`paymentMethodId`** - Specify a different payment method connected to your account.
86
163
87
-
Use `GET /payment-methods` to find a payment method ID.
164
+
Use `GET /v1/payment-methods` to find a payment method ID.
88
165
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.
90
167
91
-
## Delete a subscription
168
+
###Delete a Pro subscription
92
169
93
-
Use `DELETE /v1/subscriptions/<subscriptionId>` to delete a subscription.
170
+
Use `DELETE /v1/subscriptions/{subscriptionId}` to delete a subscription.
0 commit comments