@scaleway/sdk-redis 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,193 @@
1
+ import { API as ParentAPI } from '@scaleway/sdk-client';
2
+ import type { Zone as ScwZone, WaitForOptions } from '@scaleway/sdk-client';
3
+ import type { ACLRule, AddAclRulesRequest, AddAclRulesResponse, AddClusterSettingsRequest, AddEndpointsRequest, AddEndpointsResponse, Cluster, ClusterMetricsResponse, ClusterSettingsResponse, CreateClusterRequest, DeleteAclRuleRequest, DeleteClusterRequest, DeleteClusterSettingRequest, DeleteEndpointRequest, Endpoint, GetAclRuleRequest, GetClusterCertificateRequest, GetClusterMetricsRequest, GetClusterRequest, GetEndpointRequest, ListClusterVersionsRequest, ListClusterVersionsResponse, ListClustersRequest, ListClustersResponse, ListNodeTypesRequest, ListNodeTypesResponse, MigrateClusterRequest, RenewClusterCertificateRequest, SetAclRulesRequest, SetAclRulesResponse, SetClusterSettingsRequest, SetEndpointsRequest, SetEndpointsResponse, UpdateClusterRequest, UpdateEndpointRequest } from './types.gen';
4
+ /**
5
+ * Managed Database for Redis™ API.
6
+
7
+ This API allows you to manage your Managed Databases for Redis™.
8
+ */
9
+ export declare class API extends ParentAPI {
10
+ /** Lists the available zones of the API. */
11
+ static readonly LOCALITIES: ScwZone[];
12
+ /**
13
+ * Create a Redis™ Database Instance. Create a new Redis™ Database Instance (Redis™ cluster). You must set the `zone`, `project_id`, `version`, `node_type`, `user_name` and `password` parameters. Optionally you can define `acl_rules`, `endpoints`, `tls_enabled` and `cluster_settings`.
14
+ *
15
+ * @param request - The request {@link CreateClusterRequest}
16
+ * @returns A Promise of Cluster
17
+ */
18
+ createCluster: (request: Readonly<CreateClusterRequest>) => Promise<Cluster>;
19
+ /**
20
+ * Update a Redis™ Database Instance. Update the parameters of a Redis™ Database Instance (Redis™ cluster), including `name`, `tags`, `user_name` and `password`.
21
+ *
22
+ * @param request - The request {@link UpdateClusterRequest}
23
+ * @returns A Promise of Cluster
24
+ */
25
+ updateCluster: (request: Readonly<UpdateClusterRequest>) => Promise<Cluster>;
26
+ /**
27
+ * Get a Redis™ Database Instance. Retrieve information about a Redis™ Database Instance (Redis™ cluster). Specify the `cluster_id` and `region` in your request to get information such as `id`, `status`, `version`, `tls_enabled`, `cluster_settings`, `upgradable_versions` and `endpoints` about your cluster in the response.
28
+ *
29
+ * @param request - The request {@link GetClusterRequest}
30
+ * @returns A Promise of Cluster
31
+ */
32
+ getCluster: (request: Readonly<GetClusterRequest>) => Promise<Cluster>;
33
+ /**
34
+ * Waits for {@link Cluster} to be in a final state.
35
+ *
36
+ * @param request - The request {@link GetClusterRequest}
37
+ * @param options - The waiting options
38
+ * @returns A Promise of Cluster
39
+ */
40
+ waitForCluster: (request: Readonly<GetClusterRequest>, options?: Readonly<WaitForOptions<Cluster>>) => Promise<Cluster>;
41
+ protected pageOfListClusters: (request?: Readonly<ListClustersRequest>) => Promise<ListClustersResponse>;
42
+ /**
43
+ * List Redis™ Database Instances. List all Redis™ Database Instances (Redis™ cluster) in the specified zone. By default, the Database Instances returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as `tags`, `name`, `organization_id` and `version`.
44
+ *
45
+ * @param request - The request {@link ListClustersRequest}
46
+ * @returns A Promise of ListClustersResponse
47
+ */
48
+ listClusters: (request?: Readonly<ListClustersRequest>) => Promise<ListClustersResponse> & {
49
+ all: () => Promise<Cluster[]>;
50
+ [Symbol.asyncIterator]: () => AsyncGenerator<Cluster[], void, void>;
51
+ };
52
+ /**
53
+ * Scale up a Redis™ Database Instance. Upgrade your Redis™ Database Instance, either by upgrading to a bigger node type (vertical scaling) or by adding more nodes to your Database Instance to increase your number of endpoints and distribute cache (horizontal scaling, available for clusters only). Note that scaling horizontally your Redis™ Database Instance will not renew its TLS certificate. In order to refresh the TLS certificate, you must use the Renew TLS certificate endpoint.
54
+ *
55
+ * @param request - The request {@link MigrateClusterRequest}
56
+ * @returns A Promise of Cluster
57
+ */
58
+ migrateCluster: (request: Readonly<MigrateClusterRequest>) => Promise<Cluster>;
59
+ /**
60
+ * Delete a Redis™ Database Instance. Delete a Redis™ Database Instance (Redis™ cluster), specified by the `region` and `cluster_id` parameters. Deleting a Database Instance is permanent, and cannot be undone. Note that upon deletion all your data will be lost.
61
+ *
62
+ * @param request - The request {@link DeleteClusterRequest}
63
+ * @returns A Promise of Cluster
64
+ */
65
+ deleteCluster: (request: Readonly<DeleteClusterRequest>) => Promise<Cluster>;
66
+ /**
67
+ * Get metrics of a Redis™ Database Instance. Retrieve the metrics of a Redis™ Database Instance (Redis™ cluster). You can define the period from which to retrieve metrics by specifying the `start_date` and `end_date`.
68
+ *
69
+ * @param request - The request {@link GetClusterMetricsRequest}
70
+ * @returns A Promise of ClusterMetricsResponse
71
+ */
72
+ getClusterMetrics: (request: Readonly<GetClusterMetricsRequest>) => Promise<ClusterMetricsResponse>;
73
+ protected pageOfListNodeTypes: (request: Readonly<ListNodeTypesRequest>) => Promise<ListNodeTypesResponse>;
74
+ /**
75
+ * List available node types. List all available node types. By default, the node types returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
76
+ *
77
+ * @param request - The request {@link ListNodeTypesRequest}
78
+ * @returns A Promise of ListNodeTypesResponse
79
+ */
80
+ listNodeTypes: (request: Readonly<ListNodeTypesRequest>) => Promise<ListNodeTypesResponse> & {
81
+ all: () => Promise<import("./types.gen").NodeType[]>;
82
+ [Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen").NodeType[], void, void>;
83
+ };
84
+ protected pageOfListClusterVersions: (request: Readonly<ListClusterVersionsRequest>) => Promise<ListClusterVersionsResponse>;
85
+ /**
86
+ * List available Redis™ versions. List the Redis™ database engine versions available. You can define additional parameters for your query, such as `include_disabled`, `include_beta`, `include_deprecated` and `version`.
87
+ *
88
+ * @param request - The request {@link ListClusterVersionsRequest}
89
+ * @returns A Promise of ListClusterVersionsResponse
90
+ */
91
+ listClusterVersions: (request: Readonly<ListClusterVersionsRequest>) => Promise<ListClusterVersionsResponse> & {
92
+ all: () => Promise<import("./types.gen").ClusterVersion[]>;
93
+ [Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen").ClusterVersion[], void, void>;
94
+ };
95
+ /**
96
+ * Get the TLS certificate of a cluster. Retrieve information about the TLS certificate of a Redis™ Database Instance (Redis™ cluster). Details like name and content are returned in the response.
97
+ *
98
+ * @param request - The request {@link GetClusterCertificateRequest}
99
+ * @returns A Promise of Blob
100
+ */
101
+ getClusterCertificate: (request: Readonly<GetClusterCertificateRequest>) => Promise<Blob>;
102
+ /**
103
+ * Renew the TLS certificate of a cluster. Renew a TLS certificate for a Redis™ Database Instance (Redis™ cluster). Renewing a certificate means that you will not be able to connect to your Database Instance using the previous certificate. You will also need to download and update the new certificate for all database clients.
104
+ *
105
+ * @param request - The request {@link RenewClusterCertificateRequest}
106
+ * @returns A Promise of Cluster
107
+ */
108
+ renewClusterCertificate: (request: Readonly<RenewClusterCertificateRequest>) => Promise<Cluster>;
109
+ /**
110
+ * Add advanced settings. Add an advanced setting to a Redis™ Database Instance (Redis™ cluster). You must set the `name` and the `value` of each setting.
111
+ *
112
+ * @param request - The request {@link AddClusterSettingsRequest}
113
+ * @returns A Promise of ClusterSettingsResponse
114
+ */
115
+ addClusterSettings: (request: Readonly<AddClusterSettingsRequest>) => Promise<ClusterSettingsResponse>;
116
+ /**
117
+ * Delete advanced setting. Delete an advanced setting in a Redis™ Database Instance (Redis™ cluster). You must specify the names of the settings you want to delete in the request body.
118
+ *
119
+ * @param request - The request {@link DeleteClusterSettingRequest}
120
+ * @returns A Promise of Cluster
121
+ */
122
+ deleteClusterSetting: (request: Readonly<DeleteClusterSettingRequest>) => Promise<Cluster>;
123
+ /**
124
+ * Set advanced settings. Update an advanced setting for a Redis™ Database Instance (Redis™ cluster). Settings added upon database engine initialization can only be defined once, and cannot, therefore, be updated.
125
+ *
126
+ * @param request - The request {@link SetClusterSettingsRequest}
127
+ * @returns A Promise of ClusterSettingsResponse
128
+ */
129
+ setClusterSettings: (request: Readonly<SetClusterSettingsRequest>) => Promise<ClusterSettingsResponse>;
130
+ /**
131
+ * Set ACL rules for a cluster. Replace all the ACL rules of a Redis™ Database Instance (Redis™ cluster).
132
+ *
133
+ * @param request - The request {@link SetAclRulesRequest}
134
+ * @returns A Promise of SetAclRulesResponse
135
+ */
136
+ setAclRules: (request: Readonly<SetAclRulesRequest>) => Promise<SetAclRulesResponse>;
137
+ /**
138
+ * Add ACL rules for a cluster. Add an additional ACL rule to a Redis™ Database Instance (Redis™ cluster).
139
+ *
140
+ * @param request - The request {@link AddAclRulesRequest}
141
+ * @returns A Promise of AddAclRulesResponse
142
+ */
143
+ addAclRules: (request: Readonly<AddAclRulesRequest>) => Promise<AddAclRulesResponse>;
144
+ /**
145
+ * Delete an ACL rule for a cluster. Delete an ACL rule of a Redis™ Database Instance (Redis™ cluster). You must specify the `acl_id` of the rule you want to delete in your request.
146
+ *
147
+ * @param request - The request {@link DeleteAclRuleRequest}
148
+ * @returns A Promise of Cluster
149
+ */
150
+ deleteAclRule: (request: Readonly<DeleteAclRuleRequest>) => Promise<Cluster>;
151
+ /**
152
+ * Get an ACL rule. Retrieve information about an ACL rule of a Redis™ Database Instance (Redis™ cluster). You must specify the `acl_id` of the rule in your request.
153
+ *
154
+ * @param request - The request {@link GetAclRuleRequest}
155
+ * @returns A Promise of ACLRule
156
+ */
157
+ getAclRule: (request: Readonly<GetAclRuleRequest>) => Promise<ACLRule>;
158
+ /**
159
+ * Set endpoints for a cluster. Update an endpoint for a Redis™ Database Instance (Redis™ cluster). You must specify the `cluster_id` and the `endpoints` parameters in your request.
160
+ *
161
+ * @param request - The request {@link SetEndpointsRequest}
162
+ * @returns A Promise of SetEndpointsResponse
163
+ */
164
+ setEndpoints: (request: Readonly<SetEndpointsRequest>) => Promise<SetEndpointsResponse>;
165
+ /**
166
+ * Add endpoints for a cluster. Add a new endpoint for a Redis™ Database Instance (Redis™ cluster). You can add `private_network` or `public_network` specifications to the body of the request.
167
+ *
168
+ * @param request - The request {@link AddEndpointsRequest}
169
+ * @returns A Promise of AddEndpointsResponse
170
+ */
171
+ addEndpoints: (request: Readonly<AddEndpointsRequest>) => Promise<AddEndpointsResponse>;
172
+ /**
173
+ * Delete an endpoint for a cluster. Delete the endpoint of a Redis™ Database Instance (Redis™ cluster). You must specify the `region` and `endpoint_id` parameters of the endpoint you want to delete. Note that might need to update any environment configurations that point to the deleted endpoint.
174
+ *
175
+ * @param request - The request {@link DeleteEndpointRequest}
176
+ * @returns A Promise of Cluster
177
+ */
178
+ deleteEndpoint: (request: Readonly<DeleteEndpointRequest>) => Promise<Cluster>;
179
+ /**
180
+ * Get an endpoint. Retrieve information about a Redis™ Database Instance (Redis™ cluster) endpoint. Full details about the endpoint, like `ips`, `port`, `private_network` and `public_network` specifications are returned in the response.
181
+ *
182
+ * @param request - The request {@link GetEndpointRequest}
183
+ * @returns A Promise of Endpoint
184
+ */
185
+ getEndpoint: (request: Readonly<GetEndpointRequest>) => Promise<Endpoint>;
186
+ /**
187
+ * Update an endpoint. Update information about a Redis™ Database Instance (Redis™ cluster) endpoint. Full details about the endpoint, like `ips`, `port`, `private_network` and `public_network` specifications are returned in the response.
188
+ *
189
+ * @param request - The request {@link UpdateEndpointRequest}
190
+ * @returns A Promise of Endpoint
191
+ */
192
+ updateEndpoint: (request: Readonly<UpdateEndpointRequest>) => Promise<Endpoint>;
193
+ }
@@ -0,0 +1,415 @@
1
+ import { API as API$1, validatePathParam, waitForResource, urlParams, enrichForPagination } from "@scaleway/sdk-client";
2
+ import { CLUSTER_TRANSIENT_STATUSES } from "./content.gen.js";
3
+ import { marshalCreateClusterRequest, unmarshalCluster, marshalUpdateClusterRequest, unmarshalListClustersResponse, marshalMigrateClusterRequest, unmarshalClusterMetricsResponse, unmarshalListNodeTypesResponse, unmarshalListClusterVersionsResponse, marshalAddClusterSettingsRequest, unmarshalClusterSettingsResponse, marshalSetClusterSettingsRequest, marshalSetAclRulesRequest, unmarshalSetAclRulesResponse, marshalAddAclRulesRequest, unmarshalAddAclRulesResponse, unmarshalACLRule, marshalSetEndpointsRequest, unmarshalSetEndpointsResponse, marshalAddEndpointsRequest, unmarshalAddEndpointsResponse, unmarshalEndpoint, marshalUpdateEndpointRequest } from "./marshalling.gen.js";
4
+ const jsonContentHeaders = {
5
+ "Content-Type": "application/json; charset=utf-8"
6
+ };
7
+ class API extends API$1 {
8
+ /** Lists the available zones of the API. */
9
+ static LOCALITIES = [
10
+ "fr-par-1",
11
+ "fr-par-2",
12
+ "nl-ams-1",
13
+ "nl-ams-2",
14
+ "pl-waw-1",
15
+ "pl-waw-2"
16
+ ];
17
+ /**
18
+ * Create a Redis™ Database Instance. Create a new Redis™ Database Instance (Redis™ cluster). You must set the `zone`, `project_id`, `version`, `node_type`, `user_name` and `password` parameters. Optionally you can define `acl_rules`, `endpoints`, `tls_enabled` and `cluster_settings`.
19
+ *
20
+ * @param request - The request {@link CreateClusterRequest}
21
+ * @returns A Promise of Cluster
22
+ */
23
+ createCluster = (request) => this.client.fetch(
24
+ {
25
+ body: JSON.stringify(
26
+ marshalCreateClusterRequest(request, this.client.settings)
27
+ ),
28
+ headers: jsonContentHeaders,
29
+ method: "POST",
30
+ path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters`
31
+ },
32
+ unmarshalCluster
33
+ );
34
+ /**
35
+ * Update a Redis™ Database Instance. Update the parameters of a Redis™ Database Instance (Redis™ cluster), including `name`, `tags`, `user_name` and `password`.
36
+ *
37
+ * @param request - The request {@link UpdateClusterRequest}
38
+ * @returns A Promise of Cluster
39
+ */
40
+ updateCluster = (request) => this.client.fetch(
41
+ {
42
+ body: JSON.stringify(
43
+ marshalUpdateClusterRequest(request, this.client.settings)
44
+ ),
45
+ headers: jsonContentHeaders,
46
+ method: "PATCH",
47
+ path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam("clusterId", request.clusterId)}`
48
+ },
49
+ unmarshalCluster
50
+ );
51
+ /**
52
+ * Get a Redis™ Database Instance. Retrieve information about a Redis™ Database Instance (Redis™ cluster). Specify the `cluster_id` and `region` in your request to get information such as `id`, `status`, `version`, `tls_enabled`, `cluster_settings`, `upgradable_versions` and `endpoints` about your cluster in the response.
53
+ *
54
+ * @param request - The request {@link GetClusterRequest}
55
+ * @returns A Promise of Cluster
56
+ */
57
+ getCluster = (request) => this.client.fetch(
58
+ {
59
+ method: "GET",
60
+ path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam("clusterId", request.clusterId)}`
61
+ },
62
+ unmarshalCluster
63
+ );
64
+ /**
65
+ * Waits for {@link Cluster} to be in a final state.
66
+ *
67
+ * @param request - The request {@link GetClusterRequest}
68
+ * @param options - The waiting options
69
+ * @returns A Promise of Cluster
70
+ */
71
+ waitForCluster = (request, options) => waitForResource(
72
+ options?.stop ?? ((res) => Promise.resolve(
73
+ !CLUSTER_TRANSIENT_STATUSES.includes(res.status)
74
+ )),
75
+ this.getCluster,
76
+ request,
77
+ options
78
+ );
79
+ pageOfListClusters = (request = {}) => this.client.fetch(
80
+ {
81
+ method: "GET",
82
+ path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters`,
83
+ urlParams: urlParams(
84
+ ["name", request.name],
85
+ ["order_by", request.orderBy],
86
+ ["organization_id", request.organizationId],
87
+ ["page", request.page],
88
+ [
89
+ "page_size",
90
+ request.pageSize ?? this.client.settings.defaultPageSize
91
+ ],
92
+ ["project_id", request.projectId],
93
+ ["tags", request.tags],
94
+ ["version", request.version]
95
+ )
96
+ },
97
+ unmarshalListClustersResponse
98
+ );
99
+ /**
100
+ * List Redis™ Database Instances. List all Redis™ Database Instances (Redis™ cluster) in the specified zone. By default, the Database Instances returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as `tags`, `name`, `organization_id` and `version`.
101
+ *
102
+ * @param request - The request {@link ListClustersRequest}
103
+ * @returns A Promise of ListClustersResponse
104
+ */
105
+ listClusters = (request = {}) => enrichForPagination("clusters", this.pageOfListClusters, request);
106
+ /**
107
+ * Scale up a Redis™ Database Instance. Upgrade your Redis™ Database Instance, either by upgrading to a bigger node type (vertical scaling) or by adding more nodes to your Database Instance to increase your number of endpoints and distribute cache (horizontal scaling, available for clusters only). Note that scaling horizontally your Redis™ Database Instance will not renew its TLS certificate. In order to refresh the TLS certificate, you must use the Renew TLS certificate endpoint.
108
+ *
109
+ * @param request - The request {@link MigrateClusterRequest}
110
+ * @returns A Promise of Cluster
111
+ */
112
+ migrateCluster = (request) => this.client.fetch(
113
+ {
114
+ body: JSON.stringify(
115
+ marshalMigrateClusterRequest(request, this.client.settings)
116
+ ),
117
+ headers: jsonContentHeaders,
118
+ method: "POST",
119
+ path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam("clusterId", request.clusterId)}/migrate`
120
+ },
121
+ unmarshalCluster
122
+ );
123
+ /**
124
+ * Delete a Redis™ Database Instance. Delete a Redis™ Database Instance (Redis™ cluster), specified by the `region` and `cluster_id` parameters. Deleting a Database Instance is permanent, and cannot be undone. Note that upon deletion all your data will be lost.
125
+ *
126
+ * @param request - The request {@link DeleteClusterRequest}
127
+ * @returns A Promise of Cluster
128
+ */
129
+ deleteCluster = (request) => this.client.fetch(
130
+ {
131
+ method: "DELETE",
132
+ path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam("clusterId", request.clusterId)}`
133
+ },
134
+ unmarshalCluster
135
+ );
136
+ /**
137
+ * Get metrics of a Redis™ Database Instance. Retrieve the metrics of a Redis™ Database Instance (Redis™ cluster). You can define the period from which to retrieve metrics by specifying the `start_date` and `end_date`.
138
+ *
139
+ * @param request - The request {@link GetClusterMetricsRequest}
140
+ * @returns A Promise of ClusterMetricsResponse
141
+ */
142
+ getClusterMetrics = (request) => this.client.fetch(
143
+ {
144
+ method: "GET",
145
+ path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam("clusterId", request.clusterId)}/metrics`,
146
+ urlParams: urlParams(
147
+ ["end_at", request.endAt],
148
+ ["metric_name", request.metricName],
149
+ ["start_at", request.startAt]
150
+ )
151
+ },
152
+ unmarshalClusterMetricsResponse
153
+ );
154
+ pageOfListNodeTypes = (request) => this.client.fetch(
155
+ {
156
+ method: "GET",
157
+ path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/node-types`,
158
+ urlParams: urlParams(
159
+ ["include_disabled_types", request.includeDisabledTypes],
160
+ ["page", request.page],
161
+ [
162
+ "page_size",
163
+ request.pageSize ?? this.client.settings.defaultPageSize
164
+ ]
165
+ )
166
+ },
167
+ unmarshalListNodeTypesResponse
168
+ );
169
+ /**
170
+ * List available node types. List all available node types. By default, the node types returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
171
+ *
172
+ * @param request - The request {@link ListNodeTypesRequest}
173
+ * @returns A Promise of ListNodeTypesResponse
174
+ */
175
+ listNodeTypes = (request) => enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request);
176
+ pageOfListClusterVersions = (request) => this.client.fetch(
177
+ {
178
+ method: "GET",
179
+ path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/cluster-versions`,
180
+ urlParams: urlParams(
181
+ ["include_beta", request.includeBeta],
182
+ ["include_deprecated", request.includeDeprecated],
183
+ ["include_disabled", request.includeDisabled],
184
+ ["page", request.page],
185
+ [
186
+ "page_size",
187
+ request.pageSize ?? this.client.settings.defaultPageSize
188
+ ],
189
+ ["version", request.version]
190
+ )
191
+ },
192
+ unmarshalListClusterVersionsResponse
193
+ );
194
+ /**
195
+ * List available Redis™ versions. List the Redis™ database engine versions available. You can define additional parameters for your query, such as `include_disabled`, `include_beta`, `include_deprecated` and `version`.
196
+ *
197
+ * @param request - The request {@link ListClusterVersionsRequest}
198
+ * @returns A Promise of ListClusterVersionsResponse
199
+ */
200
+ listClusterVersions = (request) => enrichForPagination("versions", this.pageOfListClusterVersions, request);
201
+ /**
202
+ * Get the TLS certificate of a cluster. Retrieve information about the TLS certificate of a Redis™ Database Instance (Redis™ cluster). Details like name and content are returned in the response.
203
+ *
204
+ * @param request - The request {@link GetClusterCertificateRequest}
205
+ * @returns A Promise of Blob
206
+ */
207
+ getClusterCertificate = (request) => this.client.fetch({
208
+ method: "GET",
209
+ path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam("clusterId", request.clusterId)}/certificate`,
210
+ urlParams: urlParams(["dl", 1]),
211
+ responseType: "blob"
212
+ });
213
+ /**
214
+ * Renew the TLS certificate of a cluster. Renew a TLS certificate for a Redis™ Database Instance (Redis™ cluster). Renewing a certificate means that you will not be able to connect to your Database Instance using the previous certificate. You will also need to download and update the new certificate for all database clients.
215
+ *
216
+ * @param request - The request {@link RenewClusterCertificateRequest}
217
+ * @returns A Promise of Cluster
218
+ */
219
+ renewClusterCertificate = (request) => this.client.fetch(
220
+ {
221
+ body: "{}",
222
+ headers: jsonContentHeaders,
223
+ method: "POST",
224
+ path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam("clusterId", request.clusterId)}/renew-certificate`
225
+ },
226
+ unmarshalCluster
227
+ );
228
+ /**
229
+ * Add advanced settings. Add an advanced setting to a Redis™ Database Instance (Redis™ cluster). You must set the `name` and the `value` of each setting.
230
+ *
231
+ * @param request - The request {@link AddClusterSettingsRequest}
232
+ * @returns A Promise of ClusterSettingsResponse
233
+ */
234
+ addClusterSettings = (request) => this.client.fetch(
235
+ {
236
+ body: JSON.stringify(
237
+ marshalAddClusterSettingsRequest(request, this.client.settings)
238
+ ),
239
+ headers: jsonContentHeaders,
240
+ method: "POST",
241
+ path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam("clusterId", request.clusterId)}/settings`
242
+ },
243
+ unmarshalClusterSettingsResponse
244
+ );
245
+ /**
246
+ * Delete advanced setting. Delete an advanced setting in a Redis™ Database Instance (Redis™ cluster). You must specify the names of the settings you want to delete in the request body.
247
+ *
248
+ * @param request - The request {@link DeleteClusterSettingRequest}
249
+ * @returns A Promise of Cluster
250
+ */
251
+ deleteClusterSetting = (request) => this.client.fetch(
252
+ {
253
+ method: "DELETE",
254
+ path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam("clusterId", request.clusterId)}/settings/${validatePathParam("settingName", request.settingName)}`
255
+ },
256
+ unmarshalCluster
257
+ );
258
+ /**
259
+ * Set advanced settings. Update an advanced setting for a Redis™ Database Instance (Redis™ cluster). Settings added upon database engine initialization can only be defined once, and cannot, therefore, be updated.
260
+ *
261
+ * @param request - The request {@link SetClusterSettingsRequest}
262
+ * @returns A Promise of ClusterSettingsResponse
263
+ */
264
+ setClusterSettings = (request) => this.client.fetch(
265
+ {
266
+ body: JSON.stringify(
267
+ marshalSetClusterSettingsRequest(request, this.client.settings)
268
+ ),
269
+ headers: jsonContentHeaders,
270
+ method: "PUT",
271
+ path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam("clusterId", request.clusterId)}/settings`
272
+ },
273
+ unmarshalClusterSettingsResponse
274
+ );
275
+ /**
276
+ * Set ACL rules for a cluster. Replace all the ACL rules of a Redis™ Database Instance (Redis™ cluster).
277
+ *
278
+ * @param request - The request {@link SetAclRulesRequest}
279
+ * @returns A Promise of SetAclRulesResponse
280
+ */
281
+ setAclRules = (request) => this.client.fetch(
282
+ {
283
+ body: JSON.stringify(
284
+ marshalSetAclRulesRequest(request, this.client.settings)
285
+ ),
286
+ headers: jsonContentHeaders,
287
+ method: "PUT",
288
+ path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam("clusterId", request.clusterId)}/acls`
289
+ },
290
+ unmarshalSetAclRulesResponse
291
+ );
292
+ /**
293
+ * Add ACL rules for a cluster. Add an additional ACL rule to a Redis™ Database Instance (Redis™ cluster).
294
+ *
295
+ * @param request - The request {@link AddAclRulesRequest}
296
+ * @returns A Promise of AddAclRulesResponse
297
+ */
298
+ addAclRules = (request) => this.client.fetch(
299
+ {
300
+ body: JSON.stringify(
301
+ marshalAddAclRulesRequest(request, this.client.settings)
302
+ ),
303
+ headers: jsonContentHeaders,
304
+ method: "POST",
305
+ path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam("clusterId", request.clusterId)}/acls`
306
+ },
307
+ unmarshalAddAclRulesResponse
308
+ );
309
+ /**
310
+ * Delete an ACL rule for a cluster. Delete an ACL rule of a Redis™ Database Instance (Redis™ cluster). You must specify the `acl_id` of the rule you want to delete in your request.
311
+ *
312
+ * @param request - The request {@link DeleteAclRuleRequest}
313
+ * @returns A Promise of Cluster
314
+ */
315
+ deleteAclRule = (request) => this.client.fetch(
316
+ {
317
+ method: "DELETE",
318
+ path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam("aclId", request.aclId)}`
319
+ },
320
+ unmarshalCluster
321
+ );
322
+ /**
323
+ * Get an ACL rule. Retrieve information about an ACL rule of a Redis™ Database Instance (Redis™ cluster). You must specify the `acl_id` of the rule in your request.
324
+ *
325
+ * @param request - The request {@link GetAclRuleRequest}
326
+ * @returns A Promise of ACLRule
327
+ */
328
+ getAclRule = (request) => this.client.fetch(
329
+ {
330
+ method: "GET",
331
+ path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam("aclId", request.aclId)}`
332
+ },
333
+ unmarshalACLRule
334
+ );
335
+ /**
336
+ * Set endpoints for a cluster. Update an endpoint for a Redis™ Database Instance (Redis™ cluster). You must specify the `cluster_id` and the `endpoints` parameters in your request.
337
+ *
338
+ * @param request - The request {@link SetEndpointsRequest}
339
+ * @returns A Promise of SetEndpointsResponse
340
+ */
341
+ setEndpoints = (request) => this.client.fetch(
342
+ {
343
+ body: JSON.stringify(
344
+ marshalSetEndpointsRequest(request, this.client.settings)
345
+ ),
346
+ headers: jsonContentHeaders,
347
+ method: "PUT",
348
+ path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam("clusterId", request.clusterId)}/endpoints`
349
+ },
350
+ unmarshalSetEndpointsResponse
351
+ );
352
+ /**
353
+ * Add endpoints for a cluster. Add a new endpoint for a Redis™ Database Instance (Redis™ cluster). You can add `private_network` or `public_network` specifications to the body of the request.
354
+ *
355
+ * @param request - The request {@link AddEndpointsRequest}
356
+ * @returns A Promise of AddEndpointsResponse
357
+ */
358
+ addEndpoints = (request) => this.client.fetch(
359
+ {
360
+ body: JSON.stringify(
361
+ marshalAddEndpointsRequest(request, this.client.settings)
362
+ ),
363
+ headers: jsonContentHeaders,
364
+ method: "POST",
365
+ path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam("clusterId", request.clusterId)}/endpoints`
366
+ },
367
+ unmarshalAddEndpointsResponse
368
+ );
369
+ /**
370
+ * Delete an endpoint for a cluster. Delete the endpoint of a Redis™ Database Instance (Redis™ cluster). You must specify the `region` and `endpoint_id` parameters of the endpoint you want to delete. Note that might need to update any environment configurations that point to the deleted endpoint.
371
+ *
372
+ * @param request - The request {@link DeleteEndpointRequest}
373
+ * @returns A Promise of Cluster
374
+ */
375
+ deleteEndpoint = (request) => this.client.fetch(
376
+ {
377
+ method: "DELETE",
378
+ path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
379
+ },
380
+ unmarshalCluster
381
+ );
382
+ /**
383
+ * Get an endpoint. Retrieve information about a Redis™ Database Instance (Redis™ cluster) endpoint. Full details about the endpoint, like `ips`, `port`, `private_network` and `public_network` specifications are returned in the response.
384
+ *
385
+ * @param request - The request {@link GetEndpointRequest}
386
+ * @returns A Promise of Endpoint
387
+ */
388
+ getEndpoint = (request) => this.client.fetch(
389
+ {
390
+ method: "GET",
391
+ path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
392
+ },
393
+ unmarshalEndpoint
394
+ );
395
+ /**
396
+ * Update an endpoint. Update information about a Redis™ Database Instance (Redis™ cluster) endpoint. Full details about the endpoint, like `ips`, `port`, `private_network` and `public_network` specifications are returned in the response.
397
+ *
398
+ * @param request - The request {@link UpdateEndpointRequest}
399
+ * @returns A Promise of Endpoint
400
+ */
401
+ updateEndpoint = (request) => this.client.fetch(
402
+ {
403
+ body: JSON.stringify(
404
+ marshalUpdateEndpointRequest(request, this.client.settings)
405
+ ),
406
+ headers: jsonContentHeaders,
407
+ method: "PATCH",
408
+ path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
409
+ },
410
+ unmarshalEndpoint
411
+ );
412
+ }
413
+ export {
414
+ API
415
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const CLUSTER_TRANSIENT_STATUSES = [
4
+ "provisioning",
5
+ "configuring",
6
+ "deleting",
7
+ "autohealing",
8
+ "initializing"
9
+ ];
10
+ exports.CLUSTER_TRANSIENT_STATUSES = CLUSTER_TRANSIENT_STATUSES;
@@ -0,0 +1,3 @@
1
+ import type { ClusterStatus } from './types.gen';
2
+ /** Lists transient statutes of the enum {@link ClusterStatus}. */
3
+ export declare const CLUSTER_TRANSIENT_STATUSES: ClusterStatus[];
@@ -0,0 +1,10 @@
1
+ const CLUSTER_TRANSIENT_STATUSES = [
2
+ "provisioning",
3
+ "configuring",
4
+ "deleting",
5
+ "autohealing",
6
+ "initializing"
7
+ ];
8
+ export {
9
+ CLUSTER_TRANSIENT_STATUSES
10
+ };
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const api_gen = require("./api.gen.cjs");
4
+ const content_gen = require("./content.gen.cjs");
5
+ const marshalling_gen = require("./marshalling.gen.cjs");
6
+ exports.API = api_gen.API;
7
+ exports.CLUSTER_TRANSIENT_STATUSES = content_gen.CLUSTER_TRANSIENT_STATUSES;
8
+ exports.marshalAddAclRulesRequest = marshalling_gen.marshalAddAclRulesRequest;
9
+ exports.marshalAddClusterSettingsRequest = marshalling_gen.marshalAddClusterSettingsRequest;
10
+ exports.marshalAddEndpointsRequest = marshalling_gen.marshalAddEndpointsRequest;
11
+ exports.marshalCreateClusterRequest = marshalling_gen.marshalCreateClusterRequest;
12
+ exports.marshalMigrateClusterRequest = marshalling_gen.marshalMigrateClusterRequest;
13
+ exports.marshalSetAclRulesRequest = marshalling_gen.marshalSetAclRulesRequest;
14
+ exports.marshalSetClusterSettingsRequest = marshalling_gen.marshalSetClusterSettingsRequest;
15
+ exports.marshalSetEndpointsRequest = marshalling_gen.marshalSetEndpointsRequest;
16
+ exports.marshalUpdateClusterRequest = marshalling_gen.marshalUpdateClusterRequest;
17
+ exports.marshalUpdateEndpointRequest = marshalling_gen.marshalUpdateEndpointRequest;
18
+ exports.unmarshalACLRule = marshalling_gen.unmarshalACLRule;
19
+ exports.unmarshalAddAclRulesResponse = marshalling_gen.unmarshalAddAclRulesResponse;
20
+ exports.unmarshalAddEndpointsResponse = marshalling_gen.unmarshalAddEndpointsResponse;
21
+ exports.unmarshalCluster = marshalling_gen.unmarshalCluster;
22
+ exports.unmarshalClusterMetricsResponse = marshalling_gen.unmarshalClusterMetricsResponse;
23
+ exports.unmarshalClusterSettingsResponse = marshalling_gen.unmarshalClusterSettingsResponse;
24
+ exports.unmarshalEndpoint = marshalling_gen.unmarshalEndpoint;
25
+ exports.unmarshalListClusterVersionsResponse = marshalling_gen.unmarshalListClusterVersionsResponse;
26
+ exports.unmarshalListClustersResponse = marshalling_gen.unmarshalListClustersResponse;
27
+ exports.unmarshalListNodeTypesResponse = marshalling_gen.unmarshalListNodeTypesResponse;
28
+ exports.unmarshalSetAclRulesResponse = marshalling_gen.unmarshalSetAclRulesResponse;
29
+ exports.unmarshalSetEndpointsResponse = marshalling_gen.unmarshalSetEndpointsResponse;