@scaleway/sdk 3.0.0-alpha.0 → 3.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/dist/index.gen.d.ts +362 -0
- package/dist/index.gen.js +323 -0
- package/package.json +71 -25
- package/README.md +0 -46
- package/dist/api/account/index.js +0 -4
- package/dist/api/account/v2/api.gen.js +0 -147
- package/dist/api/account/v2/index.gen.js +0 -4
- package/dist/api/account/v2/marshalling.gen.js +0 -39
- package/dist/api/account/v3/api.gen.js +0 -129
- package/dist/api/account/v3/index.gen.js +0 -6
- package/dist/api/account/v3/marshalling.gen.js +0 -39
- package/dist/api/account/v3/validation-rules.gen.js +0 -39
- package/dist/api/applesilicon/index.js +0 -2
- package/dist/api/applesilicon/v1alpha1/api.gen.js +0 -220
- package/dist/api/applesilicon/v1alpha1/content.gen.js +0 -7
- package/dist/api/applesilicon/v1alpha1/index.gen.js +0 -5
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +0 -113
- package/dist/api/baremetal/index.js +0 -2
- package/dist/api/baremetal/v1/api.gen.js +0 -523
- package/dist/api/baremetal/v1/api.utils.js +0 -27
- package/dist/api/baremetal/v1/content.gen.js +0 -13
- package/dist/api/baremetal/v1/index.js +0 -5
- package/dist/api/baremetal/v1/marshalling.gen.js +0 -395
- package/dist/api/baremetal/v1/validation-rules.gen.js +0 -109
- package/dist/api/billing/index.js +0 -2
- package/dist/api/billing/v2alpha1/api.gen.js +0 -80
- package/dist/api/billing/v2alpha1/index.gen.js +0 -4
- package/dist/api/billing/v2alpha1/marshalling.gen.js +0 -53
- package/dist/api/block/index.js +0 -2
- package/dist/api/block/v1alpha1/api.gen.js +0 -245
- package/dist/api/block/v1alpha1/content.gen.js +0 -13
- package/dist/api/block/v1alpha1/index.gen.js +0 -7
- package/dist/api/block/v1alpha1/marshalling.gen.js +0 -175
- package/dist/api/block/v1alpha1/validation-rules.gen.js +0 -42
- package/dist/api/cockpit/index.js +0 -2
- package/dist/api/cockpit/v1beta1/api.gen.js +0 -448
- package/dist/api/cockpit/v1beta1/content.gen.js +0 -7
- package/dist/api/cockpit/v1beta1/index.gen.js +0 -5
- package/dist/api/cockpit/v1beta1/marshalling.gen.js +0 -220
- package/dist/api/container/index.js +0 -2
- package/dist/api/container/v1beta1/api.gen.js +0 -549
- package/dist/api/container/v1beta1/content.gen.js +0 -22
- package/dist/api/container/v1beta1/index.gen.js +0 -5
- package/dist/api/container/v1beta1/marshalling.gen.js +0 -330
- package/dist/api/document_db/index.js +0 -2
- package/dist/api/document_db/v1beta1/api.gen.js +0 -830
- package/dist/api/document_db/v1beta1/content.gen.js +0 -19
- package/dist/api/document_db/v1beta1/index.gen.js +0 -7
- package/dist/api/document_db/v1beta1/marshalling.gen.js +0 -580
- package/dist/api/document_db/v1beta1/validation-rules.gen.js +0 -10
- package/dist/api/domain/index.js +0 -2
- package/dist/api/domain/v2beta1/api.gen.js +0 -875
- package/dist/api/domain/v2beta1/content.gen.js +0 -28
- package/dist/api/domain/v2beta1/index.gen.js +0 -7
- package/dist/api/domain/v2beta1/marshalling.gen.js +0 -958
- package/dist/api/flexibleip/index.js +0 -2
- package/dist/api/flexibleip/v1alpha1/api.gen.js +0 -203
- package/dist/api/flexibleip/v1alpha1/content.gen.js +0 -10
- package/dist/api/flexibleip/v1alpha1/index.gen.js +0 -7
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +0 -97
- package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +0 -14
- package/dist/api/function/index.js +0 -2
- package/dist/api/function/v1beta1/api.gen.js +0 -560
- package/dist/api/function/v1beta1/content.gen.js +0 -22
- package/dist/api/function/v1beta1/index.gen.js +0 -5
- package/dist/api/function/v1beta1/marshalling.gen.js +0 -368
- package/dist/api/iam/index.js +0 -2
- package/dist/api/iam/v1alpha1/api.gen.js +0 -799
- package/dist/api/iam/v1alpha1/index.gen.js +0 -6
- package/dist/api/iam/v1alpha1/marshalling.gen.js +0 -373
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +0 -207
- package/dist/api/instance/index.js +0 -2
- package/dist/api/instance/v1/api.gen.js +0 -1003
- package/dist/api/instance/v1/api.utils.js +0 -369
- package/dist/api/instance/v1/content.gen.js +0 -31
- package/dist/api/instance/v1/index.js +0 -2
- package/dist/api/instance/v1/marshalling.gen.js +0 -1206
- package/dist/api/instance/v1/marshalling.utils.js +0 -63
- package/dist/api/iot/index.js +0 -2
- package/dist/api/iot/v1/api.gen.js +0 -581
- package/dist/api/iot/v1/content.gen.js +0 -7
- package/dist/api/iot/v1/index.gen.js +0 -5
- package/dist/api/iot/v1/marshalling.gen.js +0 -388
- package/dist/api/ipfs/index.js +0 -2
- package/dist/api/ipfs/v1alpha1/api.gen.js +0 -197
- package/dist/api/ipfs/v1alpha1/content.gen.js +0 -7
- package/dist/api/ipfs/v1alpha1/index.gen.js +0 -5
- package/dist/api/ipfs/v1alpha1/marshalling.gen.js +0 -121
- package/dist/api/k8s/index.js +0 -2
- package/dist/api/k8s/v1/api.gen.js +0 -454
- package/dist/api/k8s/v1/api.utils.js +0 -13
- package/dist/api/k8s/v1/content.gen.js +0 -13
- package/dist/api/k8s/v1/index.js +0 -4
- package/dist/api/k8s/v1/marshalling.gen.js +0 -333
- package/dist/api/k8s/v1/validation-rules.gen.js +0 -101
- package/dist/api/lb/index.js +0 -2
- package/dist/api/lb/v1/api.gen.js +0 -1669
- package/dist/api/lb/v1/api.utils.js +0 -81
- package/dist/api/lb/v1/content.gen.js +0 -16
- package/dist/api/lb/v1/index.js +0 -2
- package/dist/api/lb/v1/marshalling.gen.js +0 -923
- package/dist/api/marketplace/index.js +0 -4
- package/dist/api/marketplace/v1/api.gen.js +0 -60
- package/dist/api/marketplace/v1/index.gen.js +0 -4
- package/dist/api/marketplace/v1/marshalling.gen.js +0 -92
- package/dist/api/marketplace/v2/api.gen.js +0 -162
- package/dist/api/marketplace/v2/index.gen.js +0 -4
- package/dist/api/marketplace/v2/marshalling.gen.js +0 -94
- package/dist/api/mnq/index.js +0 -2
- package/dist/api/mnq/v1alpha1/api.gen.js +0 -205
- package/dist/api/mnq/v1alpha1/index.gen.js +0 -4
- package/dist/api/mnq/v1alpha1/marshalling.gen.js +0 -121
- package/dist/api/rdb/index.js +0 -2
- package/dist/api/rdb/v1/api.gen.js +0 -972
- package/dist/api/rdb/v1/content.gen.js +0 -22
- package/dist/api/rdb/v1/index.gen.js +0 -7
- package/dist/api/rdb/v1/marshalling.gen.js +0 -636
- package/dist/api/rdb/v1/validation-rules.gen.js +0 -10
- package/dist/api/redis/index.js +0 -2
- package/dist/api/redis/v1/api.gen.js +0 -389
- package/dist/api/redis/v1/content.gen.js +0 -7
- package/dist/api/redis/v1/index.gen.js +0 -5
- package/dist/api/redis/v1/marshalling.gen.js +0 -259
- package/dist/api/registry/index.js +0 -2
- package/dist/api/registry/v1/api.gen.js +0 -252
- package/dist/api/registry/v1/content.gen.js +0 -13
- package/dist/api/registry/v1/index.gen.js +0 -5
- package/dist/api/registry/v1/marshalling.gen.js +0 -106
- package/dist/api/secret/index.js +0 -2
- package/dist/api/secret/v1alpha1/api.gen.js +0 -415
- package/dist/api/secret/v1alpha1/index.gen.js +0 -4
- package/dist/api/secret/v1alpha1/marshalling.gen.js +0 -143
- package/dist/api/tem/index.js +0 -2
- package/dist/api/tem/v1alpha1/api.gen.js +0 -229
- package/dist/api/tem/v1alpha1/content.gen.js +0 -10
- package/dist/api/tem/v1alpha1/index.gen.js +0 -5
- package/dist/api/tem/v1alpha1/marshalling.gen.js +0 -159
- package/dist/api/test/index.js +0 -2
- package/dist/api/test/v1/api.gen.js +0 -152
- package/dist/api/test/v1/content.gen.js +0 -7
- package/dist/api/test/v1/index.gen.js +0 -5
- package/dist/api/test/v1/marshalling.gen.js +0 -79
- package/dist/api/vpc/index.js +0 -4
- package/dist/api/vpc/v1/api.gen.js +0 -110
- package/dist/api/vpc/v1/index.gen.js +0 -4
- package/dist/api/vpc/v1/marshalling.gen.js +0 -44
- package/dist/api/vpc/v2/api.gen.js +0 -276
- package/dist/api/vpc/v2/index.gen.js +0 -4
- package/dist/api/vpc/v2/marshalling.gen.js +0 -135
- package/dist/api/vpcgw/index.js +0 -2
- package/dist/api/vpcgw/v1/api.gen.js +0 -669
- package/dist/api/vpcgw/v1/content.gen.js +0 -10
- package/dist/api/vpcgw/v1/index.gen.js +0 -5
- package/dist/api/vpcgw/v1/marshalling.gen.js +0 -336
- package/dist/api/webhosting/index.js +0 -2
- package/dist/api/webhosting/v1alpha1/api.gen.js +0 -210
- package/dist/api/webhosting/v1alpha1/content.gen.js +0 -7
- package/dist/api/webhosting/v1alpha1/index.gen.js +0 -7
- package/dist/api/webhosting/v1alpha1/marshalling.gen.js +0 -173
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +0 -23
- package/dist/helpers/is-browser.js +0 -5
- package/dist/helpers/is-response.js +0 -10
- package/dist/helpers/json.js +0 -11
- package/dist/helpers/marshalling.js +0 -130
- package/dist/index.cjs +0 -24364
- package/dist/index.d.ts +0 -27584
- package/dist/index.js +0 -69
- package/dist/internal/async/interval-retrier.js +0 -105
- package/dist/internal/async/sleep.js +0 -13
- package/dist/internal/interceptors/composer.js +0 -46
- package/dist/internal/interceptors/helpers.js +0 -32
- package/dist/internal/logger/console-logger.js +0 -38
- package/dist/internal/logger/index.js +0 -41
- package/dist/internal/logger/level-resolver.js +0 -13
- package/dist/internal/validations/string-validation.js +0 -38
- package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js +0 -13
- package/dist/scw/api.js +0 -12
- package/dist/scw/auth.js +0 -68
- package/dist/scw/client-ini-factory.js +0 -174
- package/dist/scw/client-ini-profile.js +0 -54
- package/dist/scw/client-settings.js +0 -78
- package/dist/scw/client.js +0 -98
- package/dist/scw/constants.js +0 -4
- package/dist/scw/custom-marshalling.js +0 -131
- package/dist/scw/errors/error-parser.js +0 -107
- package/dist/scw/errors/non-standard/invalid-request-mapper.js +0 -36
- package/dist/scw/errors/non-standard/unknown-resource-mapper.js +0 -27
- package/dist/scw/errors/scw-error.js +0 -66
- package/dist/scw/errors/standard/already-exists-error.js +0 -26
- package/dist/scw/errors/standard/denied-authentication-error.js +0 -52
- package/dist/scw/errors/standard/index.js +0 -13
- package/dist/scw/errors/standard/invalid-arguments-error.js +0 -67
- package/dist/scw/errors/standard/out-of-stock-error.js +0 -22
- package/dist/scw/errors/standard/permissions-denied-error.js +0 -48
- package/dist/scw/errors/standard/precondition-failed-error.js +0 -42
- package/dist/scw/errors/standard/quotas-exceeded-error.js +0 -68
- package/dist/scw/errors/standard/resource-expired-error.js +0 -26
- package/dist/scw/errors/standard/resource-locked-error.js +0 -25
- package/dist/scw/errors/standard/resource-not-found-error.js +0 -25
- package/dist/scw/errors/standard/too-many-requests-error.js +0 -70
- package/dist/scw/errors/standard/transient-state-error.js +0 -26
- package/dist/scw/errors/types.js +0 -23
- package/dist/scw/fetch/build-fetcher.js +0 -72
- package/dist/scw/fetch/http-dumper.js +0 -54
- package/dist/scw/fetch/http-interceptors.js +0 -99
- package/dist/scw/fetch/resource-paginator.js +0 -84
- package/dist/scw/fetch/response-parser.js +0 -72
- package/node_modules/@scaleway/random-name/.npmignore +0 -4
- package/node_modules/@scaleway/random-name/CHANGELOG.md +0 -129
- package/node_modules/@scaleway/random-name/LICENSE.md +0 -21
- package/node_modules/@scaleway/random-name/README.md +0 -26
- package/node_modules/@scaleway/random-name/dist/index.d.ts +0 -3
- package/node_modules/@scaleway/random-name/dist/index.js +0 -13
- package/node_modules/@scaleway/random-name/package.json +0 -23
|
@@ -1,389 +0,0 @@
|
|
|
1
|
-
import { waitForResource } from '../../../internal/async/interval-retrier.js';
|
|
2
|
-
import { API as API$1 } from '../../../scw/api.js';
|
|
3
|
-
import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
|
|
4
|
-
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
5
|
-
import { CLUSTER_TRANSIENT_STATUSES } from './content.gen.js';
|
|
6
|
-
import { marshalCreateClusterRequest, unmarshalCluster, marshalUpdateClusterRequest, unmarshalListClustersResponse, marshalMigrateClusterRequest, unmarshalClusterMetricsResponse, unmarshalListNodeTypesResponse, unmarshalListClusterVersionsResponse, marshalAddClusterSettingsRequest, unmarshalClusterSettingsResponse, marshalSetClusterSettingsRequest, marshalSetAclRulesRequest, unmarshalSetAclRulesResponse, marshalAddAclRulesRequest, unmarshalAddAclRulesResponse, unmarshalACLRule, marshalSetEndpointsRequest, unmarshalSetEndpointsResponse, marshalAddEndpointsRequest, unmarshalAddEndpointsResponse, unmarshalEndpoint, marshalUpdateEndpointRequest } from './marshalling.gen.js';
|
|
7
|
-
|
|
8
|
-
// This file was automatically generated. DO NOT EDIT.
|
|
9
|
-
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
10
|
-
const jsonContentHeaders = {
|
|
11
|
-
'Content-Type': 'application/json; charset=utf-8'
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/** Managed Database for Redis™ API. */
|
|
15
|
-
class API extends API$1 {
|
|
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) {
|
|
76
|
-
if (request === void 0) {
|
|
77
|
-
request = {};
|
|
78
|
-
}
|
|
79
|
-
return _this.client.fetch({
|
|
80
|
-
method: 'GET',
|
|
81
|
-
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/clusters`,
|
|
82
|
-
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy], ['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])
|
|
83
|
-
}, unmarshalListClustersResponse);
|
|
84
|
-
};
|
|
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) {
|
|
101
|
-
if (request === void 0) {
|
|
102
|
-
request = {};
|
|
103
|
-
}
|
|
104
|
-
return enrichForPagination('clusters', _this2.pageOfListClusters, request);
|
|
105
|
-
};
|
|
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);
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
export { API };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// This file was automatically generated. DO NOT EDIT.
|
|
2
|
-
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
3
|
-
|
|
4
|
-
/** Lists transient statutes of the enum {@link ClusterStatus}. */
|
|
5
|
-
const CLUSTER_TRANSIENT_STATUSES = ['provisioning', 'configuring', 'deleting', 'autohealing', 'initializing'];
|
|
6
|
-
|
|
7
|
-
export { CLUSTER_TRANSIENT_STATUSES };
|
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js';
|
|
2
|
-
import { isJSONObject } from '../../../helpers/json.js';
|
|
3
|
-
import { unmarshalTimeSeries } from '../../../scw/custom-marshalling.js';
|
|
4
|
-
import { unmarshalArrayOfObject, unmarshalDate, resolveOneOf } from '../../../helpers/marshalling.js';
|
|
5
|
-
|
|
6
|
-
// This file was automatically generated. DO NOT EDIT.
|
|
7
|
-
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
8
|
-
const unmarshalACLRule = data => {
|
|
9
|
-
if (!isJSONObject(data)) {
|
|
10
|
-
throw new TypeError(`Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`);
|
|
11
|
-
}
|
|
12
|
-
return {
|
|
13
|
-
description: data.description ? data.description : undefined,
|
|
14
|
-
id: data.id,
|
|
15
|
-
ipCidr: data.ip_cidr ? data.ip_cidr : undefined
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
const unmarshalPublicNetwork = data => {
|
|
19
|
-
if (!isJSONObject(data)) {
|
|
20
|
-
throw new TypeError(`Unmarshalling the type 'PublicNetwork' failed as data isn't a dictionary.`);
|
|
21
|
-
}
|
|
22
|
-
return {};
|
|
23
|
-
};
|
|
24
|
-
const unmarshalPrivateNetwork = data => {
|
|
25
|
-
if (!isJSONObject(data)) {
|
|
26
|
-
throw new TypeError(`Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`);
|
|
27
|
-
}
|
|
28
|
-
return {
|
|
29
|
-
id: data.id,
|
|
30
|
-
provisioningMode: data.provisioning_mode,
|
|
31
|
-
serviceIps: data.service_ips,
|
|
32
|
-
zone: data.zone
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
const unmarshalEndpoint = data => {
|
|
36
|
-
if (!isJSONObject(data)) {
|
|
37
|
-
throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`);
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
id: data.id,
|
|
41
|
-
ips: data.ips,
|
|
42
|
-
port: data.port,
|
|
43
|
-
privateNetwork: data.private_network ? unmarshalPrivateNetwork(data.private_network) : undefined,
|
|
44
|
-
publicNetwork: data.public_network ? unmarshalPublicNetwork(data.public_network) : undefined
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
const unmarshalClusterSetting = data => {
|
|
48
|
-
if (!isJSONObject(data)) {
|
|
49
|
-
throw new TypeError(`Unmarshalling the type 'ClusterSetting' failed as data isn't a dictionary.`);
|
|
50
|
-
}
|
|
51
|
-
return {
|
|
52
|
-
name: data.name,
|
|
53
|
-
value: data.value
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
const unmarshalCluster = data => {
|
|
57
|
-
if (!isJSONObject(data)) {
|
|
58
|
-
throw new TypeError(`Unmarshalling the type 'Cluster' failed as data isn't a dictionary.`);
|
|
59
|
-
}
|
|
60
|
-
return {
|
|
61
|
-
aclRules: unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule),
|
|
62
|
-
clusterSettings: unmarshalArrayOfObject(data.cluster_settings, unmarshalClusterSetting),
|
|
63
|
-
clusterSize: data.cluster_size,
|
|
64
|
-
createdAt: unmarshalDate(data.created_at),
|
|
65
|
-
endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
|
|
66
|
-
id: data.id,
|
|
67
|
-
name: data.name,
|
|
68
|
-
nodeType: data.node_type,
|
|
69
|
-
projectId: data.project_id,
|
|
70
|
-
status: data.status,
|
|
71
|
-
tags: data.tags,
|
|
72
|
-
tlsEnabled: data.tls_enabled,
|
|
73
|
-
updatedAt: unmarshalDate(data.updated_at),
|
|
74
|
-
upgradableVersions: data.upgradable_versions,
|
|
75
|
-
userName: data.user_name,
|
|
76
|
-
version: data.version,
|
|
77
|
-
zone: data.zone
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
const unmarshalAddAclRulesResponse = data => {
|
|
81
|
-
if (!isJSONObject(data)) {
|
|
82
|
-
throw new TypeError(`Unmarshalling the type 'AddAclRulesResponse' failed as data isn't a dictionary.`);
|
|
83
|
-
}
|
|
84
|
-
return {
|
|
85
|
-
aclRules: unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule),
|
|
86
|
-
totalCount: data.total_count
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
const unmarshalAddEndpointsResponse = data => {
|
|
90
|
-
if (!isJSONObject(data)) {
|
|
91
|
-
throw new TypeError(`Unmarshalling the type 'AddEndpointsResponse' failed as data isn't a dictionary.`);
|
|
92
|
-
}
|
|
93
|
-
return {
|
|
94
|
-
endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
|
|
95
|
-
totalCount: data.total_count
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
const unmarshalClusterMetricsResponse = data => {
|
|
99
|
-
if (!isJSONObject(data)) {
|
|
100
|
-
throw new TypeError(`Unmarshalling the type 'ClusterMetricsResponse' failed as data isn't a dictionary.`);
|
|
101
|
-
}
|
|
102
|
-
return {
|
|
103
|
-
timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries)
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
const unmarshalClusterSettingsResponse = data => {
|
|
107
|
-
if (!isJSONObject(data)) {
|
|
108
|
-
throw new TypeError(`Unmarshalling the type 'ClusterSettingsResponse' failed as data isn't a dictionary.`);
|
|
109
|
-
}
|
|
110
|
-
return {
|
|
111
|
-
settings: unmarshalArrayOfObject(data.settings, unmarshalClusterSetting)
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
const unmarshalAvailableClusterSetting = data => {
|
|
115
|
-
if (!isJSONObject(data)) {
|
|
116
|
-
throw new TypeError(`Unmarshalling the type 'AvailableClusterSetting' failed as data isn't a dictionary.`);
|
|
117
|
-
}
|
|
118
|
-
return {
|
|
119
|
-
defaultValue: data.default_value ? data.default_value : undefined,
|
|
120
|
-
deprecated: data.deprecated,
|
|
121
|
-
description: data.description,
|
|
122
|
-
maxValue: data.max_value ? data.max_value : undefined,
|
|
123
|
-
minValue: data.min_value ? data.min_value : undefined,
|
|
124
|
-
name: data.name,
|
|
125
|
-
regex: data.regex ? data.regex : undefined,
|
|
126
|
-
type: data.type
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
|
-
const unmarshalClusterVersion = data => {
|
|
130
|
-
if (!isJSONObject(data)) {
|
|
131
|
-
throw new TypeError(`Unmarshalling the type 'ClusterVersion' failed as data isn't a dictionary.`);
|
|
132
|
-
}
|
|
133
|
-
return {
|
|
134
|
-
availableSettings: unmarshalArrayOfObject(data.available_settings, unmarshalAvailableClusterSetting),
|
|
135
|
-
endOfLifeAt: unmarshalDate(data.end_of_life_at),
|
|
136
|
-
logoUrl: data.logo_url,
|
|
137
|
-
version: data.version,
|
|
138
|
-
zone: data.zone
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
const unmarshalListClusterVersionsResponse = data => {
|
|
142
|
-
if (!isJSONObject(data)) {
|
|
143
|
-
throw new TypeError(`Unmarshalling the type 'ListClusterVersionsResponse' failed as data isn't a dictionary.`);
|
|
144
|
-
}
|
|
145
|
-
return {
|
|
146
|
-
totalCount: data.total_count,
|
|
147
|
-
versions: unmarshalArrayOfObject(data.versions, unmarshalClusterVersion)
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
const unmarshalListClustersResponse = data => {
|
|
151
|
-
if (!isJSONObject(data)) {
|
|
152
|
-
throw new TypeError(`Unmarshalling the type 'ListClustersResponse' failed as data isn't a dictionary.`);
|
|
153
|
-
}
|
|
154
|
-
return {
|
|
155
|
-
clusters: unmarshalArrayOfObject(data.clusters, unmarshalCluster),
|
|
156
|
-
totalCount: data.total_count
|
|
157
|
-
};
|
|
158
|
-
};
|
|
159
|
-
const unmarshalNodeType = data => {
|
|
160
|
-
if (!isJSONObject(data)) {
|
|
161
|
-
throw new TypeError(`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`);
|
|
162
|
-
}
|
|
163
|
-
return {
|
|
164
|
-
beta: data.beta,
|
|
165
|
-
description: data.description,
|
|
166
|
-
disabled: data.disabled,
|
|
167
|
-
memory: data.memory,
|
|
168
|
-
name: data.name,
|
|
169
|
-
stockStatus: data.stock_status,
|
|
170
|
-
vcpus: data.vcpus,
|
|
171
|
-
zone: data.zone
|
|
172
|
-
};
|
|
173
|
-
};
|
|
174
|
-
const unmarshalListNodeTypesResponse = data => {
|
|
175
|
-
if (!isJSONObject(data)) {
|
|
176
|
-
throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`);
|
|
177
|
-
}
|
|
178
|
-
return {
|
|
179
|
-
nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
|
|
180
|
-
totalCount: data.total_count
|
|
181
|
-
};
|
|
182
|
-
};
|
|
183
|
-
const unmarshalSetAclRulesResponse = data => {
|
|
184
|
-
if (!isJSONObject(data)) {
|
|
185
|
-
throw new TypeError(`Unmarshalling the type 'SetAclRulesResponse' failed as data isn't a dictionary.`);
|
|
186
|
-
}
|
|
187
|
-
return {
|
|
188
|
-
aclRules: unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule)
|
|
189
|
-
};
|
|
190
|
-
};
|
|
191
|
-
const unmarshalSetEndpointsResponse = data => {
|
|
192
|
-
if (!isJSONObject(data)) {
|
|
193
|
-
throw new TypeError(`Unmarshalling the type 'SetEndpointsResponse' failed as data isn't a dictionary.`);
|
|
194
|
-
}
|
|
195
|
-
return {
|
|
196
|
-
endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint)
|
|
197
|
-
};
|
|
198
|
-
};
|
|
199
|
-
const marshalAddAclRulesRequest = (request, defaults) => ({
|
|
200
|
-
acl_rules: request.aclRules
|
|
201
|
-
});
|
|
202
|
-
const marshalAddClusterSettingsRequest = (request, defaults) => ({
|
|
203
|
-
settings: request.settings
|
|
204
|
-
});
|
|
205
|
-
const marshalAddEndpointsRequest = (request, defaults) => ({
|
|
206
|
-
endpoints: request.endpoints
|
|
207
|
-
});
|
|
208
|
-
const marshalCreateClusterRequest = (request, defaults) => ({
|
|
209
|
-
acl_rules: request.aclRules,
|
|
210
|
-
cluster_settings: request.clusterSettings,
|
|
211
|
-
cluster_size: request.clusterSize,
|
|
212
|
-
endpoints: request.endpoints,
|
|
213
|
-
name: request.name || randomName('ins'),
|
|
214
|
-
node_type: request.nodeType,
|
|
215
|
-
password: request.password,
|
|
216
|
-
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
217
|
-
tags: request.tags,
|
|
218
|
-
tls_enabled: request.tlsEnabled,
|
|
219
|
-
user_name: request.userName,
|
|
220
|
-
version: request.version
|
|
221
|
-
});
|
|
222
|
-
const marshalMigrateClusterRequest = (request, defaults) => ({
|
|
223
|
-
...resolveOneOf([{
|
|
224
|
-
param: 'cluster_size',
|
|
225
|
-
value: request.clusterSize
|
|
226
|
-
}, {
|
|
227
|
-
param: 'node_type',
|
|
228
|
-
value: request.nodeType
|
|
229
|
-
}, {
|
|
230
|
-
param: 'version',
|
|
231
|
-
value: request.version
|
|
232
|
-
}])
|
|
233
|
-
});
|
|
234
|
-
const marshalSetAclRulesRequest = (request, defaults) => ({
|
|
235
|
-
acl_rules: request.aclRules
|
|
236
|
-
});
|
|
237
|
-
const marshalSetClusterSettingsRequest = (request, defaults) => ({
|
|
238
|
-
settings: request.settings
|
|
239
|
-
});
|
|
240
|
-
const marshalSetEndpointsRequest = (request, defaults) => ({
|
|
241
|
-
endpoints: request.endpoints
|
|
242
|
-
});
|
|
243
|
-
const marshalUpdateClusterRequest = (request, defaults) => ({
|
|
244
|
-
name: request.name,
|
|
245
|
-
password: request.password,
|
|
246
|
-
tags: request.tags,
|
|
247
|
-
user_name: request.userName
|
|
248
|
-
});
|
|
249
|
-
const marshalUpdateEndpointRequest = (request, defaults) => ({
|
|
250
|
-
...resolveOneOf([{
|
|
251
|
-
param: 'private_network',
|
|
252
|
-
value: request.privateNetwork
|
|
253
|
-
}, {
|
|
254
|
-
param: 'public_network',
|
|
255
|
-
value: request.publicNetwork
|
|
256
|
-
}])
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
export { marshalAddAclRulesRequest, marshalAddClusterSettingsRequest, marshalAddEndpointsRequest, marshalCreateClusterRequest, marshalMigrateClusterRequest, marshalSetAclRulesRequest, marshalSetClusterSettingsRequest, marshalSetEndpointsRequest, marshalUpdateClusterRequest, marshalUpdateEndpointRequest, unmarshalACLRule, unmarshalAddAclRulesResponse, unmarshalAddEndpointsResponse, unmarshalCluster, unmarshalClusterMetricsResponse, unmarshalClusterSettingsResponse, unmarshalEndpoint, unmarshalListClusterVersionsResponse, unmarshalListClustersResponse, unmarshalListNodeTypesResponse, unmarshalSetAclRulesResponse, unmarshalSetEndpointsResponse };
|