@scaleway/sdk-redis 1.1.0 β 2.1.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.
- package/README.md +96 -0
- package/dist/v1/api.gen.d.ts +2 -2
- package/dist/v1/api.gen.js +14 -21
- package/dist/v1/index.gen.d.ts +2 -2
- package/dist/v1/marshalling.gen.d.ts +1 -1
- package/dist/v1/marshalling.gen.js +19 -26
- package/package.json +6 -9
- package/dist/index.gen.cjs +0 -4
- package/dist/v1/api.gen.cjs +0 -420
- package/dist/v1/content.gen.cjs +0 -10
- package/dist/v1/index.gen.cjs +0 -29
- package/dist/v1/marshalling.gen.cjs +0 -353
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @scaleway/sdk-redis
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-redis)
|
|
4
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-redis)
|
|
5
|
+
[](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE)
|
|
6
|
+
|
|
7
|
+
Scaleway SDK for Redis API.
|
|
8
|
+
|
|
9
|
+
> **Note**
|
|
10
|
+
> This is an automatically generated package that is part of the [Scaleway SDK for JavaScript](https://github.com/scaleway/scaleway-sdk-js).
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @scaleway/sdk-redis @scaleway/sdk-client
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
or with pnpm:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm add @scaleway/sdk-redis @scaleway/sdk-client
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
or with yarn:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
yarn add @scaleway/sdk-redis @scaleway/sdk-client
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Getting Started
|
|
31
|
+
|
|
32
|
+
You'll need a pair of access and secret keys to connect to Scaleway API. Please check the [documentation](https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/) on how to retrieve them.
|
|
33
|
+
|
|
34
|
+
### Basic Usage
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { createClient } from '@scaleway/sdk-client'
|
|
38
|
+
import { Redis } from '@scaleway/sdk-redis'
|
|
39
|
+
|
|
40
|
+
const client = createClient({
|
|
41
|
+
accessKey: 'SCWXXXXXXXXXXXXXXXXX',
|
|
42
|
+
secretKey: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
43
|
+
defaultProjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
44
|
+
defaultRegion: 'fr-par',
|
|
45
|
+
defaultZone: 'fr-par-1',
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
const api = new Redis.v1.API(client)
|
|
49
|
+
|
|
50
|
+
// Use the API
|
|
51
|
+
// Example: await api.listServers()
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Using Configuration Loader
|
|
55
|
+
|
|
56
|
+
For a simpler setup, you can load credentials from the configuration file or environment variables:
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { createClient } from '@scaleway/sdk-client'
|
|
60
|
+
import { loadProfileFromConfigurationFile } from '@scaleway/configuration-loader'
|
|
61
|
+
import { Redis } from '@scaleway/sdk-redis'
|
|
62
|
+
|
|
63
|
+
const profile = loadProfileFromConfigurationFile()
|
|
64
|
+
const client = createClient(profile)
|
|
65
|
+
const api = new Redis.v1.API(client)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Documentation
|
|
69
|
+
|
|
70
|
+
- π [Scaleway SDK Reference Documentation](https://scaleway.github.io/scaleway-sdk-js)
|
|
71
|
+
- π [Scaleway Redis API Documentation](https://www.scaleway.com/en/developers/api/redis/)
|
|
72
|
+
- π [Main Repository](https://github.com/scaleway/scaleway-sdk-js)
|
|
73
|
+
- π‘ [Example Projects](https://github.com/scaleway/scaleway-sdk-js/tree/master/examples)
|
|
74
|
+
|
|
75
|
+
## Features
|
|
76
|
+
|
|
77
|
+
- β
Full TypeScript support with complete type definitions
|
|
78
|
+
- β
Promise-based API
|
|
79
|
+
- β
Automatic pagination helpers
|
|
80
|
+
- β
Built-in error handling
|
|
81
|
+
- β
Compatible with Node.js β₯ 20
|
|
82
|
+
|
|
83
|
+
## Support
|
|
84
|
+
|
|
85
|
+
We love feedback! Feel free to reach us on:
|
|
86
|
+
- [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
|
|
87
|
+
- [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
|
|
88
|
+
|
|
89
|
+
## Contributing
|
|
90
|
+
|
|
91
|
+
This repository is at its early stage and is still in active development. If you are looking for a way to contribute, please read [CONTRIBUTING.md](https://github.com/scaleway/scaleway-sdk-js/blob/master/CONTRIBUTING.md).
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.
|
|
96
|
+
|
package/dist/v1/api.gen.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
2
1
|
import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client';
|
|
3
|
-
import
|
|
2
|
+
import { API as ParentAPI } 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, ListClustersRequest, ListClustersResponse, ListClusterVersionsRequest, ListClusterVersionsResponse, ListNodeTypesRequest, ListNodeTypesResponse, MigrateClusterRequest, RenewClusterCertificateRequest, SetAclRulesRequest, SetAclRulesResponse, SetClusterSettingsRequest, SetEndpointsRequest, SetEndpointsResponse, UpdateClusterRequest, UpdateEndpointRequest } from './types.gen.js';
|
|
4
4
|
/**
|
|
5
5
|
* Managed Database for Redisβ’ API.
|
|
6
6
|
|
package/dist/v1/api.gen.js
CHANGED
|
@@ -74,9 +74,7 @@ class API extends API$1 {
|
|
|
74
74
|
* @returns A Promise of Cluster
|
|
75
75
|
*/
|
|
76
76
|
waitForCluster = (request, options) => waitForResource(
|
|
77
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
78
|
-
!CLUSTER_TRANSIENT_STATUSES.includes(res.status)
|
|
79
|
-
)),
|
|
77
|
+
options?.stop ?? ((res) => Promise.resolve(!CLUSTER_TRANSIENT_STATUSES.includes(res.status))),
|
|
80
78
|
this.getCluster,
|
|
81
79
|
request,
|
|
82
80
|
options
|
|
@@ -90,10 +88,7 @@ class API extends API$1 {
|
|
|
90
88
|
["order_by", request.orderBy],
|
|
91
89
|
["organization_id", request.organizationId],
|
|
92
90
|
["page", request.page],
|
|
93
|
-
[
|
|
94
|
-
"page_size",
|
|
95
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
96
|
-
],
|
|
91
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
97
92
|
["project_id", request.projectId],
|
|
98
93
|
["tags", request.tags],
|
|
99
94
|
["version", request.version]
|
|
@@ -163,10 +158,7 @@ class API extends API$1 {
|
|
|
163
158
|
urlParams: urlParams(
|
|
164
159
|
["include_disabled_types", request.includeDisabledTypes],
|
|
165
160
|
["page", request.page],
|
|
166
|
-
[
|
|
167
|
-
"page_size",
|
|
168
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
169
|
-
]
|
|
161
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
|
|
170
162
|
)
|
|
171
163
|
},
|
|
172
164
|
unmarshalListNodeTypesResponse
|
|
@@ -187,10 +179,7 @@ class API extends API$1 {
|
|
|
187
179
|
["include_deprecated", request.includeDeprecated],
|
|
188
180
|
["include_disabled", request.includeDisabled],
|
|
189
181
|
["page", request.page],
|
|
190
|
-
[
|
|
191
|
-
"page_size",
|
|
192
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
193
|
-
],
|
|
182
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
194
183
|
["version", request.version]
|
|
195
184
|
)
|
|
196
185
|
},
|
|
@@ -209,12 +198,16 @@ class API extends API$1 {
|
|
|
209
198
|
* @param request - The request {@link GetClusterCertificateRequest}
|
|
210
199
|
* @returns A Promise of Blob
|
|
211
200
|
*/
|
|
212
|
-
getClusterCertificate = (request) => this.client.fetch(
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
201
|
+
getClusterCertificate = (request) => this.client.fetch(
|
|
202
|
+
{
|
|
203
|
+
method: "GET",
|
|
204
|
+
path: `/redis/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam("clusterId", request.clusterId)}/certificate`,
|
|
205
|
+
urlParams: urlParams(
|
|
206
|
+
["dl", 1]
|
|
207
|
+
),
|
|
208
|
+
responseType: "blob"
|
|
209
|
+
}
|
|
210
|
+
);
|
|
218
211
|
/**
|
|
219
212
|
* 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.
|
|
220
213
|
*
|
package/dist/v1/index.gen.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { API } from './api.gen.js';
|
|
1
|
+
export { API, } from './api.gen.js';
|
|
2
2
|
export * from './content.gen.js';
|
|
3
3
|
export * from './marshalling.gen.js';
|
|
4
|
-
export type { ACLRule, ACLRuleSpec, AddAclRulesRequest, AddAclRulesResponse, AddClusterSettingsRequest, AddEndpointsRequest, AddEndpointsResponse, AvailableClusterSetting, AvailableClusterSettingPropertyType, Cluster, ClusterMetricsResponse, ClusterSetting, ClusterSettingsResponse, ClusterStatus, ClusterVersion, CreateClusterRequest, DeleteAclRuleRequest, DeleteClusterRequest, DeleteClusterSettingRequest, DeleteEndpointRequest, Endpoint, EndpointSpec, EndpointSpecPrivateNetworkSpec, EndpointSpecPrivateNetworkSpecIpamConfig, EndpointSpecPublicNetworkSpec, GetAclRuleRequest, GetClusterCertificateRequest, GetClusterMetricsRequest, GetClusterRequest, GetEndpointRequest,
|
|
4
|
+
export type { ACLRule, ACLRuleSpec, AddAclRulesRequest, AddAclRulesResponse, AddClusterSettingsRequest, AddEndpointsRequest, AddEndpointsResponse, AvailableClusterSetting, AvailableClusterSettingPropertyType, Cluster, ClusterMetricsResponse, ClusterSetting, ClusterSettingsResponse, ClusterStatus, ClusterVersion, CreateClusterRequest, DeleteAclRuleRequest, DeleteClusterRequest, DeleteClusterSettingRequest, DeleteEndpointRequest, Endpoint, EndpointSpec, EndpointSpecPrivateNetworkSpec, EndpointSpecPrivateNetworkSpecIpamConfig, EndpointSpecPublicNetworkSpec, GetAclRuleRequest, GetClusterCertificateRequest, GetClusterMetricsRequest, GetClusterRequest, GetEndpointRequest, ListClustersRequest, ListClustersRequestOrderBy, ListClustersResponse, ListClusterVersionsRequest, ListClusterVersionsResponse, ListNodeTypesRequest, ListNodeTypesResponse, MigrateClusterRequest, NodeType, NodeTypeStock, PrivateNetwork, PrivateNetworkProvisioningMode, PublicNetwork, RenewClusterCertificateRequest, SetAclRulesRequest, SetAclRulesResponse, SetClusterSettingsRequest, SetEndpointsRequest, SetEndpointsResponse, UpdateClusterRequest, UpdateEndpointRequest, } from './types.gen.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DefaultValues } from '@scaleway/sdk-client';
|
|
2
|
-
import type { ACLRule, AddAclRulesRequest, AddAclRulesResponse, AddClusterSettingsRequest, AddEndpointsRequest, AddEndpointsResponse, Cluster, ClusterMetricsResponse, ClusterSettingsResponse, CreateClusterRequest, Endpoint,
|
|
2
|
+
import type { ACLRule, AddAclRulesRequest, AddAclRulesResponse, AddClusterSettingsRequest, AddEndpointsRequest, AddEndpointsResponse, Cluster, ClusterMetricsResponse, ClusterSettingsResponse, CreateClusterRequest, Endpoint, ListClustersResponse, ListClusterVersionsResponse, ListNodeTypesResponse, MigrateClusterRequest, SetAclRulesRequest, SetAclRulesResponse, SetClusterSettingsRequest, SetEndpointsRequest, SetEndpointsResponse, UpdateClusterRequest, UpdateEndpointRequest } from './types.gen.js';
|
|
3
3
|
export declare const unmarshalACLRule: (data: unknown) => ACLRule;
|
|
4
4
|
export declare const unmarshalEndpoint: (data: unknown) => Endpoint;
|
|
5
5
|
export declare const unmarshalCluster: (data: unknown) => Cluster;
|
|
@@ -66,10 +66,7 @@ const unmarshalCluster = (data) => {
|
|
|
66
66
|
}
|
|
67
67
|
return {
|
|
68
68
|
aclRules: unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule),
|
|
69
|
-
clusterSettings: unmarshalArrayOfObject(
|
|
70
|
-
data.cluster_settings,
|
|
71
|
-
unmarshalClusterSetting
|
|
72
|
-
),
|
|
69
|
+
clusterSettings: unmarshalArrayOfObject(data.cluster_settings, unmarshalClusterSetting),
|
|
73
70
|
clusterSize: data.cluster_size,
|
|
74
71
|
createdAt: unmarshalDate(data.created_at),
|
|
75
72
|
endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
|
|
@@ -153,10 +150,7 @@ const unmarshalClusterVersion = (data) => {
|
|
|
153
150
|
);
|
|
154
151
|
}
|
|
155
152
|
return {
|
|
156
|
-
availableSettings: unmarshalArrayOfObject(
|
|
157
|
-
data.available_settings,
|
|
158
|
-
unmarshalAvailableClusterSetting
|
|
159
|
-
),
|
|
153
|
+
availableSettings: unmarshalArrayOfObject(data.available_settings, unmarshalAvailableClusterSetting),
|
|
160
154
|
endOfLifeAt: unmarshalDate(data.end_of_life_at),
|
|
161
155
|
logoUrl: data.logo_url,
|
|
162
156
|
version: data.version,
|
|
@@ -250,9 +244,7 @@ const marshalAddClusterSettingsRequest = (request, defaults) => ({
|
|
|
250
244
|
const marshalEndpointSpecPrivateNetworkSpecIpamConfig = (request, defaults) => ({});
|
|
251
245
|
const marshalEndpointSpecPrivateNetworkSpec = (request, defaults) => ({
|
|
252
246
|
id: request.id,
|
|
253
|
-
ipam_config: request.ipamConfig !== void 0 ? marshalEndpointSpecPrivateNetworkSpecIpamConfig(
|
|
254
|
-
request.ipamConfig
|
|
255
|
-
) : void 0,
|
|
247
|
+
ipam_config: request.ipamConfig !== void 0 ? marshalEndpointSpecPrivateNetworkSpecIpamConfig(request.ipamConfig) : void 0,
|
|
256
248
|
service_ips: request.serviceIps
|
|
257
249
|
});
|
|
258
250
|
const marshalEndpointSpecPublicNetworkSpec = (request, defaults) => ({});
|
|
@@ -260,15 +252,11 @@ const marshalEndpointSpec = (request, defaults) => ({
|
|
|
260
252
|
...resolveOneOf([
|
|
261
253
|
{
|
|
262
254
|
param: "private_network",
|
|
263
|
-
value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkSpec(
|
|
264
|
-
request.privateNetwork
|
|
265
|
-
) : void 0
|
|
255
|
+
value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkSpec(request.privateNetwork) : void 0
|
|
266
256
|
},
|
|
267
257
|
{
|
|
268
258
|
param: "public_network",
|
|
269
|
-
value: request.publicNetwork !== void 0 ? marshalEndpointSpecPublicNetworkSpec(
|
|
270
|
-
request.publicNetwork
|
|
271
|
-
) : void 0
|
|
259
|
+
value: request.publicNetwork !== void 0 ? marshalEndpointSpecPublicNetworkSpec(request.publicNetwork) : void 0
|
|
272
260
|
}
|
|
273
261
|
])
|
|
274
262
|
});
|
|
@@ -291,9 +279,18 @@ const marshalCreateClusterRequest = (request, defaults) => ({
|
|
|
291
279
|
});
|
|
292
280
|
const marshalMigrateClusterRequest = (request, defaults) => ({
|
|
293
281
|
...resolveOneOf([
|
|
294
|
-
{
|
|
295
|
-
|
|
296
|
-
|
|
282
|
+
{
|
|
283
|
+
param: "version",
|
|
284
|
+
value: request.version
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
param: "node_type",
|
|
288
|
+
value: request.nodeType
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
param: "cluster_size",
|
|
292
|
+
value: request.clusterSize
|
|
293
|
+
}
|
|
297
294
|
])
|
|
298
295
|
});
|
|
299
296
|
const marshalSetAclRulesRequest = (request, defaults) => ({
|
|
@@ -315,15 +312,11 @@ const marshalUpdateEndpointRequest = (request, defaults) => ({
|
|
|
315
312
|
...resolveOneOf([
|
|
316
313
|
{
|
|
317
314
|
param: "private_network",
|
|
318
|
-
value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkSpec(
|
|
319
|
-
request.privateNetwork
|
|
320
|
-
) : void 0
|
|
315
|
+
value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkSpec(request.privateNetwork) : void 0
|
|
321
316
|
},
|
|
322
317
|
{
|
|
323
318
|
param: "public_network",
|
|
324
|
-
value: request.publicNetwork !== void 0 ? marshalEndpointSpecPublicNetworkSpec(
|
|
325
|
-
request.publicNetwork
|
|
326
|
-
) : void 0
|
|
319
|
+
value: request.publicNetwork !== void 0 ? marshalEndpointSpecPublicNetworkSpec(request.publicNetwork) : void 0
|
|
327
320
|
}
|
|
328
321
|
])
|
|
329
322
|
});
|
package/package.json
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk-redis",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Scaleway SDK redis",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"files": [
|
|
7
|
+
"README.md",
|
|
7
8
|
"dist"
|
|
8
9
|
],
|
|
9
10
|
"type": "module",
|
|
10
11
|
"exports": {
|
|
11
12
|
".": {
|
|
12
13
|
"types": "./dist/index.gen.d.ts",
|
|
13
|
-
"import": "./dist/index.gen.js",
|
|
14
|
-
"require": "./dist/index.gen.cjs",
|
|
15
14
|
"default": "./dist/index.gen.js"
|
|
16
15
|
},
|
|
17
16
|
"./*": {
|
|
18
17
|
"types": "./dist/*/index.gen.d.ts",
|
|
19
|
-
"import": "./dist/*/index.gen.js",
|
|
20
|
-
"require": "./dist/*/index.gen.cjs",
|
|
21
18
|
"default": "./dist/*/index.gen.js"
|
|
22
19
|
}
|
|
23
20
|
},
|
|
@@ -26,17 +23,17 @@
|
|
|
26
23
|
"directory": "packages_generated/redis"
|
|
27
24
|
},
|
|
28
25
|
"engines": {
|
|
29
|
-
"node": ">=20.19.
|
|
26
|
+
"node": ">=20.19.6"
|
|
30
27
|
},
|
|
31
28
|
"dependencies": {
|
|
32
29
|
"@scaleway/random-name": "5.1.2",
|
|
33
|
-
"@scaleway/sdk-std": "
|
|
30
|
+
"@scaleway/sdk-std": "2.1.0"
|
|
34
31
|
},
|
|
35
32
|
"peerDependencies": {
|
|
36
|
-
"@scaleway/sdk-client": "^1.
|
|
33
|
+
"@scaleway/sdk-client": "^2.1.0"
|
|
37
34
|
},
|
|
38
35
|
"devDependencies": {
|
|
39
|
-
"@scaleway/sdk-client": "^1.
|
|
36
|
+
"@scaleway/sdk-client": "^2.1.0"
|
|
40
37
|
},
|
|
41
38
|
"scripts": {
|
|
42
39
|
"package:check": "pnpm publint",
|
package/dist/index.gen.cjs
DELETED
package/dist/v1/api.gen.cjs
DELETED
|
@@ -1,420 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const sdkClient = require("@scaleway/sdk-client");
|
|
4
|
-
const content_gen = require("./content.gen.cjs");
|
|
5
|
-
const marshalling_gen = require("./marshalling.gen.cjs");
|
|
6
|
-
const jsonContentHeaders = {
|
|
7
|
-
"Content-Type": "application/json; charset=utf-8"
|
|
8
|
-
};
|
|
9
|
-
class API extends sdkClient.API {
|
|
10
|
-
/**
|
|
11
|
-
* Locality of this API.
|
|
12
|
-
* type β {'zone','region','global','unspecified'}
|
|
13
|
-
*/
|
|
14
|
-
static LOCALITY = sdkClient.toApiLocality({
|
|
15
|
-
zones: [
|
|
16
|
-
"fr-par-1",
|
|
17
|
-
"fr-par-2",
|
|
18
|
-
"nl-ams-1",
|
|
19
|
-
"nl-ams-2",
|
|
20
|
-
"pl-waw-1",
|
|
21
|
-
"pl-waw-2"
|
|
22
|
-
]
|
|
23
|
-
});
|
|
24
|
-
/**
|
|
25
|
-
* 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`.
|
|
26
|
-
*
|
|
27
|
-
* @param request - The request {@link CreateClusterRequest}
|
|
28
|
-
* @returns A Promise of Cluster
|
|
29
|
-
*/
|
|
30
|
-
createCluster = (request) => this.client.fetch(
|
|
31
|
-
{
|
|
32
|
-
body: JSON.stringify(
|
|
33
|
-
marshalling_gen.marshalCreateClusterRequest(request, this.client.settings)
|
|
34
|
-
),
|
|
35
|
-
headers: jsonContentHeaders,
|
|
36
|
-
method: "POST",
|
|
37
|
-
path: `/redis/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters`
|
|
38
|
-
},
|
|
39
|
-
marshalling_gen.unmarshalCluster
|
|
40
|
-
);
|
|
41
|
-
/**
|
|
42
|
-
* Update a Redisβ’ Database Instance. Update the parameters of a Redisβ’ Database Instance (Redisβ’ cluster), including `name`, `tags`, `user_name` and `password`.
|
|
43
|
-
*
|
|
44
|
-
* @param request - The request {@link UpdateClusterRequest}
|
|
45
|
-
* @returns A Promise of Cluster
|
|
46
|
-
*/
|
|
47
|
-
updateCluster = (request) => this.client.fetch(
|
|
48
|
-
{
|
|
49
|
-
body: JSON.stringify(
|
|
50
|
-
marshalling_gen.marshalUpdateClusterRequest(request, this.client.settings)
|
|
51
|
-
),
|
|
52
|
-
headers: jsonContentHeaders,
|
|
53
|
-
method: "PATCH",
|
|
54
|
-
path: `/redis/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}`
|
|
55
|
-
},
|
|
56
|
-
marshalling_gen.unmarshalCluster
|
|
57
|
-
);
|
|
58
|
-
/**
|
|
59
|
-
* 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.
|
|
60
|
-
*
|
|
61
|
-
* @param request - The request {@link GetClusterRequest}
|
|
62
|
-
* @returns A Promise of Cluster
|
|
63
|
-
*/
|
|
64
|
-
getCluster = (request) => this.client.fetch(
|
|
65
|
-
{
|
|
66
|
-
method: "GET",
|
|
67
|
-
path: `/redis/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}`
|
|
68
|
-
},
|
|
69
|
-
marshalling_gen.unmarshalCluster
|
|
70
|
-
);
|
|
71
|
-
/**
|
|
72
|
-
* Waits for {@link Cluster} to be in a final state.
|
|
73
|
-
*
|
|
74
|
-
* @param request - The request {@link GetClusterRequest}
|
|
75
|
-
* @param options - The waiting options
|
|
76
|
-
* @returns A Promise of Cluster
|
|
77
|
-
*/
|
|
78
|
-
waitForCluster = (request, options) => sdkClient.waitForResource(
|
|
79
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
80
|
-
!content_gen.CLUSTER_TRANSIENT_STATUSES.includes(res.status)
|
|
81
|
-
)),
|
|
82
|
-
this.getCluster,
|
|
83
|
-
request,
|
|
84
|
-
options
|
|
85
|
-
);
|
|
86
|
-
pageOfListClusters = (request = {}) => this.client.fetch(
|
|
87
|
-
{
|
|
88
|
-
method: "GET",
|
|
89
|
-
path: `/redis/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters`,
|
|
90
|
-
urlParams: sdkClient.urlParams(
|
|
91
|
-
["name", request.name],
|
|
92
|
-
["order_by", request.orderBy],
|
|
93
|
-
["organization_id", request.organizationId],
|
|
94
|
-
["page", request.page],
|
|
95
|
-
[
|
|
96
|
-
"page_size",
|
|
97
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
98
|
-
],
|
|
99
|
-
["project_id", request.projectId],
|
|
100
|
-
["tags", request.tags],
|
|
101
|
-
["version", request.version]
|
|
102
|
-
)
|
|
103
|
-
},
|
|
104
|
-
marshalling_gen.unmarshalListClustersResponse
|
|
105
|
-
);
|
|
106
|
-
/**
|
|
107
|
-
* 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`.
|
|
108
|
-
*
|
|
109
|
-
* @param request - The request {@link ListClustersRequest}
|
|
110
|
-
* @returns A Promise of ListClustersResponse
|
|
111
|
-
*/
|
|
112
|
-
listClusters = (request = {}) => sdkClient.enrichForPagination("clusters", this.pageOfListClusters, request);
|
|
113
|
-
/**
|
|
114
|
-
* 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.
|
|
115
|
-
*
|
|
116
|
-
* @param request - The request {@link MigrateClusterRequest}
|
|
117
|
-
* @returns A Promise of Cluster
|
|
118
|
-
*/
|
|
119
|
-
migrateCluster = (request) => this.client.fetch(
|
|
120
|
-
{
|
|
121
|
-
body: JSON.stringify(
|
|
122
|
-
marshalling_gen.marshalMigrateClusterRequest(request, this.client.settings)
|
|
123
|
-
),
|
|
124
|
-
headers: jsonContentHeaders,
|
|
125
|
-
method: "POST",
|
|
126
|
-
path: `/redis/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}/migrate`
|
|
127
|
-
},
|
|
128
|
-
marshalling_gen.unmarshalCluster
|
|
129
|
-
);
|
|
130
|
-
/**
|
|
131
|
-
* 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.
|
|
132
|
-
*
|
|
133
|
-
* @param request - The request {@link DeleteClusterRequest}
|
|
134
|
-
* @returns A Promise of Cluster
|
|
135
|
-
*/
|
|
136
|
-
deleteCluster = (request) => this.client.fetch(
|
|
137
|
-
{
|
|
138
|
-
method: "DELETE",
|
|
139
|
-
path: `/redis/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}`
|
|
140
|
-
},
|
|
141
|
-
marshalling_gen.unmarshalCluster
|
|
142
|
-
);
|
|
143
|
-
/**
|
|
144
|
-
* 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`.
|
|
145
|
-
*
|
|
146
|
-
* @param request - The request {@link GetClusterMetricsRequest}
|
|
147
|
-
* @returns A Promise of ClusterMetricsResponse
|
|
148
|
-
*/
|
|
149
|
-
getClusterMetrics = (request) => this.client.fetch(
|
|
150
|
-
{
|
|
151
|
-
method: "GET",
|
|
152
|
-
path: `/redis/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}/metrics`,
|
|
153
|
-
urlParams: sdkClient.urlParams(
|
|
154
|
-
["end_at", request.endAt],
|
|
155
|
-
["metric_name", request.metricName],
|
|
156
|
-
["start_at", request.startAt]
|
|
157
|
-
)
|
|
158
|
-
},
|
|
159
|
-
marshalling_gen.unmarshalClusterMetricsResponse
|
|
160
|
-
);
|
|
161
|
-
pageOfListNodeTypes = (request) => this.client.fetch(
|
|
162
|
-
{
|
|
163
|
-
method: "GET",
|
|
164
|
-
path: `/redis/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/node-types`,
|
|
165
|
-
urlParams: sdkClient.urlParams(
|
|
166
|
-
["include_disabled_types", request.includeDisabledTypes],
|
|
167
|
-
["page", request.page],
|
|
168
|
-
[
|
|
169
|
-
"page_size",
|
|
170
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
171
|
-
]
|
|
172
|
-
)
|
|
173
|
-
},
|
|
174
|
-
marshalling_gen.unmarshalListNodeTypesResponse
|
|
175
|
-
);
|
|
176
|
-
/**
|
|
177
|
-
* 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.
|
|
178
|
-
*
|
|
179
|
-
* @param request - The request {@link ListNodeTypesRequest}
|
|
180
|
-
* @returns A Promise of ListNodeTypesResponse
|
|
181
|
-
*/
|
|
182
|
-
listNodeTypes = (request) => sdkClient.enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request);
|
|
183
|
-
pageOfListClusterVersions = (request) => this.client.fetch(
|
|
184
|
-
{
|
|
185
|
-
method: "GET",
|
|
186
|
-
path: `/redis/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/cluster-versions`,
|
|
187
|
-
urlParams: sdkClient.urlParams(
|
|
188
|
-
["include_beta", request.includeBeta],
|
|
189
|
-
["include_deprecated", request.includeDeprecated],
|
|
190
|
-
["include_disabled", request.includeDisabled],
|
|
191
|
-
["page", request.page],
|
|
192
|
-
[
|
|
193
|
-
"page_size",
|
|
194
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
195
|
-
],
|
|
196
|
-
["version", request.version]
|
|
197
|
-
)
|
|
198
|
-
},
|
|
199
|
-
marshalling_gen.unmarshalListClusterVersionsResponse
|
|
200
|
-
);
|
|
201
|
-
/**
|
|
202
|
-
* 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`.
|
|
203
|
-
*
|
|
204
|
-
* @param request - The request {@link ListClusterVersionsRequest}
|
|
205
|
-
* @returns A Promise of ListClusterVersionsResponse
|
|
206
|
-
*/
|
|
207
|
-
listClusterVersions = (request) => sdkClient.enrichForPagination("versions", this.pageOfListClusterVersions, request);
|
|
208
|
-
/**
|
|
209
|
-
* 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.
|
|
210
|
-
*
|
|
211
|
-
* @param request - The request {@link GetClusterCertificateRequest}
|
|
212
|
-
* @returns A Promise of Blob
|
|
213
|
-
*/
|
|
214
|
-
getClusterCertificate = (request) => this.client.fetch({
|
|
215
|
-
method: "GET",
|
|
216
|
-
path: `/redis/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}/certificate`,
|
|
217
|
-
urlParams: sdkClient.urlParams(["dl", 1]),
|
|
218
|
-
responseType: "blob"
|
|
219
|
-
});
|
|
220
|
-
/**
|
|
221
|
-
* 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.
|
|
222
|
-
*
|
|
223
|
-
* @param request - The request {@link RenewClusterCertificateRequest}
|
|
224
|
-
* @returns A Promise of Cluster
|
|
225
|
-
*/
|
|
226
|
-
renewClusterCertificate = (request) => this.client.fetch(
|
|
227
|
-
{
|
|
228
|
-
body: "{}",
|
|
229
|
-
headers: jsonContentHeaders,
|
|
230
|
-
method: "POST",
|
|
231
|
-
path: `/redis/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}/renew-certificate`
|
|
232
|
-
},
|
|
233
|
-
marshalling_gen.unmarshalCluster
|
|
234
|
-
);
|
|
235
|
-
/**
|
|
236
|
-
* 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.
|
|
237
|
-
*
|
|
238
|
-
* @param request - The request {@link AddClusterSettingsRequest}
|
|
239
|
-
* @returns A Promise of ClusterSettingsResponse
|
|
240
|
-
*/
|
|
241
|
-
addClusterSettings = (request) => this.client.fetch(
|
|
242
|
-
{
|
|
243
|
-
body: JSON.stringify(
|
|
244
|
-
marshalling_gen.marshalAddClusterSettingsRequest(request, this.client.settings)
|
|
245
|
-
),
|
|
246
|
-
headers: jsonContentHeaders,
|
|
247
|
-
method: "POST",
|
|
248
|
-
path: `/redis/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}/settings`
|
|
249
|
-
},
|
|
250
|
-
marshalling_gen.unmarshalClusterSettingsResponse
|
|
251
|
-
);
|
|
252
|
-
/**
|
|
253
|
-
* 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.
|
|
254
|
-
*
|
|
255
|
-
* @param request - The request {@link DeleteClusterSettingRequest}
|
|
256
|
-
* @returns A Promise of Cluster
|
|
257
|
-
*/
|
|
258
|
-
deleteClusterSetting = (request) => this.client.fetch(
|
|
259
|
-
{
|
|
260
|
-
method: "DELETE",
|
|
261
|
-
path: `/redis/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}/settings/${sdkClient.validatePathParam("settingName", request.settingName)}`
|
|
262
|
-
},
|
|
263
|
-
marshalling_gen.unmarshalCluster
|
|
264
|
-
);
|
|
265
|
-
/**
|
|
266
|
-
* 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.
|
|
267
|
-
*
|
|
268
|
-
* @param request - The request {@link SetClusterSettingsRequest}
|
|
269
|
-
* @returns A Promise of ClusterSettingsResponse
|
|
270
|
-
*/
|
|
271
|
-
setClusterSettings = (request) => this.client.fetch(
|
|
272
|
-
{
|
|
273
|
-
body: JSON.stringify(
|
|
274
|
-
marshalling_gen.marshalSetClusterSettingsRequest(request, this.client.settings)
|
|
275
|
-
),
|
|
276
|
-
headers: jsonContentHeaders,
|
|
277
|
-
method: "PUT",
|
|
278
|
-
path: `/redis/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}/settings`
|
|
279
|
-
},
|
|
280
|
-
marshalling_gen.unmarshalClusterSettingsResponse
|
|
281
|
-
);
|
|
282
|
-
/**
|
|
283
|
-
* Set ACL rules for a cluster. Replace all the ACL rules of a Redisβ’ Database Instance (Redisβ’ cluster).
|
|
284
|
-
*
|
|
285
|
-
* @param request - The request {@link SetAclRulesRequest}
|
|
286
|
-
* @returns A Promise of SetAclRulesResponse
|
|
287
|
-
*/
|
|
288
|
-
setAclRules = (request) => this.client.fetch(
|
|
289
|
-
{
|
|
290
|
-
body: JSON.stringify(
|
|
291
|
-
marshalling_gen.marshalSetAclRulesRequest(request, this.client.settings)
|
|
292
|
-
),
|
|
293
|
-
headers: jsonContentHeaders,
|
|
294
|
-
method: "PUT",
|
|
295
|
-
path: `/redis/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}/acls`
|
|
296
|
-
},
|
|
297
|
-
marshalling_gen.unmarshalSetAclRulesResponse
|
|
298
|
-
);
|
|
299
|
-
/**
|
|
300
|
-
* Add ACL rules for a cluster. Add an additional ACL rule to a Redisβ’ Database Instance (Redisβ’ cluster).
|
|
301
|
-
*
|
|
302
|
-
* @param request - The request {@link AddAclRulesRequest}
|
|
303
|
-
* @returns A Promise of AddAclRulesResponse
|
|
304
|
-
*/
|
|
305
|
-
addAclRules = (request) => this.client.fetch(
|
|
306
|
-
{
|
|
307
|
-
body: JSON.stringify(
|
|
308
|
-
marshalling_gen.marshalAddAclRulesRequest(request, this.client.settings)
|
|
309
|
-
),
|
|
310
|
-
headers: jsonContentHeaders,
|
|
311
|
-
method: "POST",
|
|
312
|
-
path: `/redis/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}/acls`
|
|
313
|
-
},
|
|
314
|
-
marshalling_gen.unmarshalAddAclRulesResponse
|
|
315
|
-
);
|
|
316
|
-
/**
|
|
317
|
-
* 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.
|
|
318
|
-
*
|
|
319
|
-
* @param request - The request {@link DeleteAclRuleRequest}
|
|
320
|
-
* @returns A Promise of Cluster
|
|
321
|
-
*/
|
|
322
|
-
deleteAclRule = (request) => this.client.fetch(
|
|
323
|
-
{
|
|
324
|
-
method: "DELETE",
|
|
325
|
-
path: `/redis/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/acls/${sdkClient.validatePathParam("aclId", request.aclId)}`
|
|
326
|
-
},
|
|
327
|
-
marshalling_gen.unmarshalCluster
|
|
328
|
-
);
|
|
329
|
-
/**
|
|
330
|
-
* 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.
|
|
331
|
-
*
|
|
332
|
-
* @param request - The request {@link GetAclRuleRequest}
|
|
333
|
-
* @returns A Promise of ACLRule
|
|
334
|
-
*/
|
|
335
|
-
getAclRule = (request) => this.client.fetch(
|
|
336
|
-
{
|
|
337
|
-
method: "GET",
|
|
338
|
-
path: `/redis/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/acls/${sdkClient.validatePathParam("aclId", request.aclId)}`
|
|
339
|
-
},
|
|
340
|
-
marshalling_gen.unmarshalACLRule
|
|
341
|
-
);
|
|
342
|
-
/**
|
|
343
|
-
* 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.
|
|
344
|
-
*
|
|
345
|
-
* @param request - The request {@link SetEndpointsRequest}
|
|
346
|
-
* @returns A Promise of SetEndpointsResponse
|
|
347
|
-
*/
|
|
348
|
-
setEndpoints = (request) => this.client.fetch(
|
|
349
|
-
{
|
|
350
|
-
body: JSON.stringify(
|
|
351
|
-
marshalling_gen.marshalSetEndpointsRequest(request, this.client.settings)
|
|
352
|
-
),
|
|
353
|
-
headers: jsonContentHeaders,
|
|
354
|
-
method: "PUT",
|
|
355
|
-
path: `/redis/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}/endpoints`
|
|
356
|
-
},
|
|
357
|
-
marshalling_gen.unmarshalSetEndpointsResponse
|
|
358
|
-
);
|
|
359
|
-
/**
|
|
360
|
-
* 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.
|
|
361
|
-
*
|
|
362
|
-
* @param request - The request {@link AddEndpointsRequest}
|
|
363
|
-
* @returns A Promise of AddEndpointsResponse
|
|
364
|
-
*/
|
|
365
|
-
addEndpoints = (request) => this.client.fetch(
|
|
366
|
-
{
|
|
367
|
-
body: JSON.stringify(
|
|
368
|
-
marshalling_gen.marshalAddEndpointsRequest(request, this.client.settings)
|
|
369
|
-
),
|
|
370
|
-
headers: jsonContentHeaders,
|
|
371
|
-
method: "POST",
|
|
372
|
-
path: `/redis/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}/endpoints`
|
|
373
|
-
},
|
|
374
|
-
marshalling_gen.unmarshalAddEndpointsResponse
|
|
375
|
-
);
|
|
376
|
-
/**
|
|
377
|
-
* 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.
|
|
378
|
-
*
|
|
379
|
-
* @param request - The request {@link DeleteEndpointRequest}
|
|
380
|
-
* @returns A Promise of Cluster
|
|
381
|
-
*/
|
|
382
|
-
deleteEndpoint = (request) => this.client.fetch(
|
|
383
|
-
{
|
|
384
|
-
method: "DELETE",
|
|
385
|
-
path: `/redis/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/endpoints/${sdkClient.validatePathParam("endpointId", request.endpointId)}`
|
|
386
|
-
},
|
|
387
|
-
marshalling_gen.unmarshalCluster
|
|
388
|
-
);
|
|
389
|
-
/**
|
|
390
|
-
* 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.
|
|
391
|
-
*
|
|
392
|
-
* @param request - The request {@link GetEndpointRequest}
|
|
393
|
-
* @returns A Promise of Endpoint
|
|
394
|
-
*/
|
|
395
|
-
getEndpoint = (request) => this.client.fetch(
|
|
396
|
-
{
|
|
397
|
-
method: "GET",
|
|
398
|
-
path: `/redis/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/endpoints/${sdkClient.validatePathParam("endpointId", request.endpointId)}`
|
|
399
|
-
},
|
|
400
|
-
marshalling_gen.unmarshalEndpoint
|
|
401
|
-
);
|
|
402
|
-
/**
|
|
403
|
-
* 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.
|
|
404
|
-
*
|
|
405
|
-
* @param request - The request {@link UpdateEndpointRequest}
|
|
406
|
-
* @returns A Promise of Endpoint
|
|
407
|
-
*/
|
|
408
|
-
updateEndpoint = (request) => this.client.fetch(
|
|
409
|
-
{
|
|
410
|
-
body: JSON.stringify(
|
|
411
|
-
marshalling_gen.marshalUpdateEndpointRequest(request, this.client.settings)
|
|
412
|
-
),
|
|
413
|
-
headers: jsonContentHeaders,
|
|
414
|
-
method: "PATCH",
|
|
415
|
-
path: `/redis/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/endpoints/${sdkClient.validatePathParam("endpointId", request.endpointId)}`
|
|
416
|
-
},
|
|
417
|
-
marshalling_gen.unmarshalEndpoint
|
|
418
|
-
);
|
|
419
|
-
}
|
|
420
|
-
exports.API = API;
|
package/dist/v1/content.gen.cjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
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;
|
package/dist/v1/index.gen.cjs
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
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;
|
|
@@ -1,353 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const randomName = require("@scaleway/random-name");
|
|
4
|
-
const sdkClient = require("@scaleway/sdk-client");
|
|
5
|
-
const unmarshalACLRule = (data) => {
|
|
6
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
7
|
-
throw new TypeError(
|
|
8
|
-
`Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`
|
|
9
|
-
);
|
|
10
|
-
}
|
|
11
|
-
return {
|
|
12
|
-
description: data.description,
|
|
13
|
-
id: data.id,
|
|
14
|
-
ipCidr: data.ip_cidr
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
const unmarshalPrivateNetwork = (data) => {
|
|
18
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
19
|
-
throw new TypeError(
|
|
20
|
-
`Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
return {
|
|
24
|
-
id: data.id,
|
|
25
|
-
provisioningMode: data.provisioning_mode,
|
|
26
|
-
serviceIps: data.service_ips,
|
|
27
|
-
zone: data.zone
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
const unmarshalPublicNetwork = (data) => {
|
|
31
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
32
|
-
throw new TypeError(
|
|
33
|
-
`Unmarshalling the type 'PublicNetwork' failed as data isn't a dictionary.`
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
return {};
|
|
37
|
-
};
|
|
38
|
-
const unmarshalEndpoint = (data) => {
|
|
39
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
40
|
-
throw new TypeError(
|
|
41
|
-
`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
return {
|
|
45
|
-
id: data.id,
|
|
46
|
-
ips: data.ips,
|
|
47
|
-
port: data.port,
|
|
48
|
-
privateNetwork: data.private_network ? unmarshalPrivateNetwork(data.private_network) : void 0,
|
|
49
|
-
publicNetwork: data.public_network ? unmarshalPublicNetwork(data.public_network) : void 0
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
const unmarshalClusterSetting = (data) => {
|
|
53
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
54
|
-
throw new TypeError(
|
|
55
|
-
`Unmarshalling the type 'ClusterSetting' failed as data isn't a dictionary.`
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
return {
|
|
59
|
-
name: data.name,
|
|
60
|
-
value: data.value
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
const unmarshalCluster = (data) => {
|
|
64
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
65
|
-
throw new TypeError(
|
|
66
|
-
`Unmarshalling the type 'Cluster' failed as data isn't a dictionary.`
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
return {
|
|
70
|
-
aclRules: sdkClient.unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule),
|
|
71
|
-
clusterSettings: sdkClient.unmarshalArrayOfObject(
|
|
72
|
-
data.cluster_settings,
|
|
73
|
-
unmarshalClusterSetting
|
|
74
|
-
),
|
|
75
|
-
clusterSize: data.cluster_size,
|
|
76
|
-
createdAt: sdkClient.unmarshalDate(data.created_at),
|
|
77
|
-
endpoints: sdkClient.unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
|
|
78
|
-
id: data.id,
|
|
79
|
-
name: data.name,
|
|
80
|
-
nodeType: data.node_type,
|
|
81
|
-
projectId: data.project_id,
|
|
82
|
-
status: data.status,
|
|
83
|
-
tags: data.tags,
|
|
84
|
-
tlsEnabled: data.tls_enabled,
|
|
85
|
-
updatedAt: sdkClient.unmarshalDate(data.updated_at),
|
|
86
|
-
upgradableVersions: data.upgradable_versions,
|
|
87
|
-
userName: data.user_name,
|
|
88
|
-
version: data.version,
|
|
89
|
-
zone: data.zone
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
const unmarshalAddAclRulesResponse = (data) => {
|
|
93
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
94
|
-
throw new TypeError(
|
|
95
|
-
`Unmarshalling the type 'AddAclRulesResponse' failed as data isn't a dictionary.`
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
return {
|
|
99
|
-
aclRules: sdkClient.unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule),
|
|
100
|
-
totalCount: data.total_count
|
|
101
|
-
};
|
|
102
|
-
};
|
|
103
|
-
const unmarshalAddEndpointsResponse = (data) => {
|
|
104
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
105
|
-
throw new TypeError(
|
|
106
|
-
`Unmarshalling the type 'AddEndpointsResponse' failed as data isn't a dictionary.`
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
return {
|
|
110
|
-
endpoints: sdkClient.unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
|
|
111
|
-
totalCount: data.total_count
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
const unmarshalClusterMetricsResponse = (data) => {
|
|
115
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
116
|
-
throw new TypeError(
|
|
117
|
-
`Unmarshalling the type 'ClusterMetricsResponse' failed as data isn't a dictionary.`
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
return {
|
|
121
|
-
timeseries: sdkClient.unmarshalArrayOfObject(data.timeseries, sdkClient.unmarshalTimeSeries)
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
const unmarshalClusterSettingsResponse = (data) => {
|
|
125
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
126
|
-
throw new TypeError(
|
|
127
|
-
`Unmarshalling the type 'ClusterSettingsResponse' failed as data isn't a dictionary.`
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
return {
|
|
131
|
-
settings: sdkClient.unmarshalArrayOfObject(data.settings, unmarshalClusterSetting)
|
|
132
|
-
};
|
|
133
|
-
};
|
|
134
|
-
const unmarshalAvailableClusterSetting = (data) => {
|
|
135
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
136
|
-
throw new TypeError(
|
|
137
|
-
`Unmarshalling the type 'AvailableClusterSetting' failed as data isn't a dictionary.`
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
return {
|
|
141
|
-
defaultValue: data.default_value,
|
|
142
|
-
deprecated: data.deprecated,
|
|
143
|
-
description: data.description,
|
|
144
|
-
maxValue: data.max_value,
|
|
145
|
-
minValue: data.min_value,
|
|
146
|
-
name: data.name,
|
|
147
|
-
regex: data.regex,
|
|
148
|
-
type: data.type
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
|
-
const unmarshalClusterVersion = (data) => {
|
|
152
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
153
|
-
throw new TypeError(
|
|
154
|
-
`Unmarshalling the type 'ClusterVersion' failed as data isn't a dictionary.`
|
|
155
|
-
);
|
|
156
|
-
}
|
|
157
|
-
return {
|
|
158
|
-
availableSettings: sdkClient.unmarshalArrayOfObject(
|
|
159
|
-
data.available_settings,
|
|
160
|
-
unmarshalAvailableClusterSetting
|
|
161
|
-
),
|
|
162
|
-
endOfLifeAt: sdkClient.unmarshalDate(data.end_of_life_at),
|
|
163
|
-
logoUrl: data.logo_url,
|
|
164
|
-
version: data.version,
|
|
165
|
-
zone: data.zone
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
const unmarshalListClusterVersionsResponse = (data) => {
|
|
169
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
170
|
-
throw new TypeError(
|
|
171
|
-
`Unmarshalling the type 'ListClusterVersionsResponse' failed as data isn't a dictionary.`
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
return {
|
|
175
|
-
totalCount: data.total_count,
|
|
176
|
-
versions: sdkClient.unmarshalArrayOfObject(data.versions, unmarshalClusterVersion)
|
|
177
|
-
};
|
|
178
|
-
};
|
|
179
|
-
const unmarshalListClustersResponse = (data) => {
|
|
180
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
181
|
-
throw new TypeError(
|
|
182
|
-
`Unmarshalling the type 'ListClustersResponse' failed as data isn't a dictionary.`
|
|
183
|
-
);
|
|
184
|
-
}
|
|
185
|
-
return {
|
|
186
|
-
clusters: sdkClient.unmarshalArrayOfObject(data.clusters, unmarshalCluster),
|
|
187
|
-
totalCount: data.total_count
|
|
188
|
-
};
|
|
189
|
-
};
|
|
190
|
-
const unmarshalNodeType = (data) => {
|
|
191
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
192
|
-
throw new TypeError(
|
|
193
|
-
`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`
|
|
194
|
-
);
|
|
195
|
-
}
|
|
196
|
-
return {
|
|
197
|
-
beta: data.beta,
|
|
198
|
-
description: data.description,
|
|
199
|
-
disabled: data.disabled,
|
|
200
|
-
memory: data.memory,
|
|
201
|
-
name: data.name,
|
|
202
|
-
stockStatus: data.stock_status,
|
|
203
|
-
vcpus: data.vcpus,
|
|
204
|
-
zone: data.zone
|
|
205
|
-
};
|
|
206
|
-
};
|
|
207
|
-
const unmarshalListNodeTypesResponse = (data) => {
|
|
208
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
209
|
-
throw new TypeError(
|
|
210
|
-
`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`
|
|
211
|
-
);
|
|
212
|
-
}
|
|
213
|
-
return {
|
|
214
|
-
nodeTypes: sdkClient.unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
|
|
215
|
-
totalCount: data.total_count
|
|
216
|
-
};
|
|
217
|
-
};
|
|
218
|
-
const unmarshalSetAclRulesResponse = (data) => {
|
|
219
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
220
|
-
throw new TypeError(
|
|
221
|
-
`Unmarshalling the type 'SetAclRulesResponse' failed as data isn't a dictionary.`
|
|
222
|
-
);
|
|
223
|
-
}
|
|
224
|
-
return {
|
|
225
|
-
aclRules: sdkClient.unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule)
|
|
226
|
-
};
|
|
227
|
-
};
|
|
228
|
-
const unmarshalSetEndpointsResponse = (data) => {
|
|
229
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
230
|
-
throw new TypeError(
|
|
231
|
-
`Unmarshalling the type 'SetEndpointsResponse' failed as data isn't a dictionary.`
|
|
232
|
-
);
|
|
233
|
-
}
|
|
234
|
-
return {
|
|
235
|
-
endpoints: sdkClient.unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint)
|
|
236
|
-
};
|
|
237
|
-
};
|
|
238
|
-
const marshalACLRuleSpec = (request, defaults) => ({
|
|
239
|
-
description: request.description,
|
|
240
|
-
ip_cidr: request.ipCidr
|
|
241
|
-
});
|
|
242
|
-
const marshalAddAclRulesRequest = (request, defaults) => ({
|
|
243
|
-
acl_rules: request.aclRules.map((elt) => marshalACLRuleSpec(elt))
|
|
244
|
-
});
|
|
245
|
-
const marshalClusterSetting = (request, defaults) => ({
|
|
246
|
-
name: request.name,
|
|
247
|
-
value: request.value
|
|
248
|
-
});
|
|
249
|
-
const marshalAddClusterSettingsRequest = (request, defaults) => ({
|
|
250
|
-
settings: request.settings.map((elt) => marshalClusterSetting(elt))
|
|
251
|
-
});
|
|
252
|
-
const marshalEndpointSpecPrivateNetworkSpecIpamConfig = (request, defaults) => ({});
|
|
253
|
-
const marshalEndpointSpecPrivateNetworkSpec = (request, defaults) => ({
|
|
254
|
-
id: request.id,
|
|
255
|
-
ipam_config: request.ipamConfig !== void 0 ? marshalEndpointSpecPrivateNetworkSpecIpamConfig(
|
|
256
|
-
request.ipamConfig
|
|
257
|
-
) : void 0,
|
|
258
|
-
service_ips: request.serviceIps
|
|
259
|
-
});
|
|
260
|
-
const marshalEndpointSpecPublicNetworkSpec = (request, defaults) => ({});
|
|
261
|
-
const marshalEndpointSpec = (request, defaults) => ({
|
|
262
|
-
...sdkClient.resolveOneOf([
|
|
263
|
-
{
|
|
264
|
-
param: "private_network",
|
|
265
|
-
value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkSpec(
|
|
266
|
-
request.privateNetwork
|
|
267
|
-
) : void 0
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
param: "public_network",
|
|
271
|
-
value: request.publicNetwork !== void 0 ? marshalEndpointSpecPublicNetworkSpec(
|
|
272
|
-
request.publicNetwork
|
|
273
|
-
) : void 0
|
|
274
|
-
}
|
|
275
|
-
])
|
|
276
|
-
});
|
|
277
|
-
const marshalAddEndpointsRequest = (request, defaults) => ({
|
|
278
|
-
endpoints: request.endpoints.map((elt) => marshalEndpointSpec(elt))
|
|
279
|
-
});
|
|
280
|
-
const marshalCreateClusterRequest = (request, defaults) => ({
|
|
281
|
-
acl_rules: request.aclRules !== void 0 ? request.aclRules.map((elt) => marshalACLRuleSpec(elt)) : void 0,
|
|
282
|
-
cluster_settings: request.clusterSettings !== void 0 ? request.clusterSettings.map((elt) => marshalClusterSetting(elt)) : void 0,
|
|
283
|
-
cluster_size: request.clusterSize,
|
|
284
|
-
endpoints: request.endpoints !== void 0 ? request.endpoints.map((elt) => marshalEndpointSpec(elt)) : void 0,
|
|
285
|
-
name: request.name || randomName("ins"),
|
|
286
|
-
node_type: request.nodeType,
|
|
287
|
-
password: request.password,
|
|
288
|
-
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
289
|
-
tags: request.tags,
|
|
290
|
-
tls_enabled: request.tlsEnabled,
|
|
291
|
-
user_name: request.userName,
|
|
292
|
-
version: request.version
|
|
293
|
-
});
|
|
294
|
-
const marshalMigrateClusterRequest = (request, defaults) => ({
|
|
295
|
-
...sdkClient.resolveOneOf([
|
|
296
|
-
{ param: "version", value: request.version },
|
|
297
|
-
{ param: "node_type", value: request.nodeType },
|
|
298
|
-
{ param: "cluster_size", value: request.clusterSize }
|
|
299
|
-
])
|
|
300
|
-
});
|
|
301
|
-
const marshalSetAclRulesRequest = (request, defaults) => ({
|
|
302
|
-
acl_rules: request.aclRules.map((elt) => marshalACLRuleSpec(elt))
|
|
303
|
-
});
|
|
304
|
-
const marshalSetClusterSettingsRequest = (request, defaults) => ({
|
|
305
|
-
settings: request.settings.map((elt) => marshalClusterSetting(elt))
|
|
306
|
-
});
|
|
307
|
-
const marshalSetEndpointsRequest = (request, defaults) => ({
|
|
308
|
-
endpoints: request.endpoints.map((elt) => marshalEndpointSpec(elt))
|
|
309
|
-
});
|
|
310
|
-
const marshalUpdateClusterRequest = (request, defaults) => ({
|
|
311
|
-
name: request.name,
|
|
312
|
-
password: request.password,
|
|
313
|
-
tags: request.tags,
|
|
314
|
-
user_name: request.userName
|
|
315
|
-
});
|
|
316
|
-
const marshalUpdateEndpointRequest = (request, defaults) => ({
|
|
317
|
-
...sdkClient.resolveOneOf([
|
|
318
|
-
{
|
|
319
|
-
param: "private_network",
|
|
320
|
-
value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkSpec(
|
|
321
|
-
request.privateNetwork
|
|
322
|
-
) : void 0
|
|
323
|
-
},
|
|
324
|
-
{
|
|
325
|
-
param: "public_network",
|
|
326
|
-
value: request.publicNetwork !== void 0 ? marshalEndpointSpecPublicNetworkSpec(
|
|
327
|
-
request.publicNetwork
|
|
328
|
-
) : void 0
|
|
329
|
-
}
|
|
330
|
-
])
|
|
331
|
-
});
|
|
332
|
-
exports.marshalAddAclRulesRequest = marshalAddAclRulesRequest;
|
|
333
|
-
exports.marshalAddClusterSettingsRequest = marshalAddClusterSettingsRequest;
|
|
334
|
-
exports.marshalAddEndpointsRequest = marshalAddEndpointsRequest;
|
|
335
|
-
exports.marshalCreateClusterRequest = marshalCreateClusterRequest;
|
|
336
|
-
exports.marshalMigrateClusterRequest = marshalMigrateClusterRequest;
|
|
337
|
-
exports.marshalSetAclRulesRequest = marshalSetAclRulesRequest;
|
|
338
|
-
exports.marshalSetClusterSettingsRequest = marshalSetClusterSettingsRequest;
|
|
339
|
-
exports.marshalSetEndpointsRequest = marshalSetEndpointsRequest;
|
|
340
|
-
exports.marshalUpdateClusterRequest = marshalUpdateClusterRequest;
|
|
341
|
-
exports.marshalUpdateEndpointRequest = marshalUpdateEndpointRequest;
|
|
342
|
-
exports.unmarshalACLRule = unmarshalACLRule;
|
|
343
|
-
exports.unmarshalAddAclRulesResponse = unmarshalAddAclRulesResponse;
|
|
344
|
-
exports.unmarshalAddEndpointsResponse = unmarshalAddEndpointsResponse;
|
|
345
|
-
exports.unmarshalCluster = unmarshalCluster;
|
|
346
|
-
exports.unmarshalClusterMetricsResponse = unmarshalClusterMetricsResponse;
|
|
347
|
-
exports.unmarshalClusterSettingsResponse = unmarshalClusterSettingsResponse;
|
|
348
|
-
exports.unmarshalEndpoint = unmarshalEndpoint;
|
|
349
|
-
exports.unmarshalListClusterVersionsResponse = unmarshalListClusterVersionsResponse;
|
|
350
|
-
exports.unmarshalListClustersResponse = unmarshalListClustersResponse;
|
|
351
|
-
exports.unmarshalListNodeTypesResponse = unmarshalListNodeTypesResponse;
|
|
352
|
-
exports.unmarshalSetAclRulesResponse = unmarshalSetAclRulesResponse;
|
|
353
|
-
exports.unmarshalSetEndpointsResponse = unmarshalSetEndpointsResponse;
|