@scaleway/sdk 1.14.0 → 1.16.0

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