@scaleway/sdk 0.1.0-beta.8 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/api/account/index.js +2 -2
- package/dist/api/account/v2/api.gen.js +5 -18
- package/dist/api/account/v2/index.gen.js +3 -0
- package/dist/api/account/v2/marshalling.gen.js +0 -2
- package/dist/api/account/v2alpha1/api.gen.js +3 -13
- package/dist/api/account/v2alpha1/marshalling.gen.js +0 -5
- package/dist/api/applesilicon/index.js +2 -2
- package/dist/api/applesilicon/v1alpha1/api.gen.js +7 -27
- package/dist/api/applesilicon/v1alpha1/index.gen.js +4 -0
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +1 -14
- package/dist/api/baremetal/v1/api.gen.js +47 -49
- package/dist/api/baremetal/v1/api.utils.js +2 -10
- package/dist/api/baremetal/v1/content.gen.js +6 -3
- package/dist/api/baremetal/v1/index.js +4 -1
- package/dist/api/baremetal/v1/marshalling.gen.js +44 -45
- package/dist/api/baremetal/v1/validation-rules.gen.js +109 -0
- package/dist/api/container/index.js +2 -2
- package/dist/api/container/v1beta1/api.gen.js +5 -51
- package/dist/api/container/v1beta1/content.gen.js +4 -4
- package/dist/api/container/v1beta1/{index.js → index.gen.js} +3 -1
- package/dist/api/container/v1beta1/marshalling.gen.js +12 -26
- package/dist/api/domain/index.js +2 -2
- package/dist/api/domain/v2beta1/api.gen.js +55 -85
- package/dist/api/domain/v2beta1/content.gen.js +22 -1
- package/dist/api/domain/v2beta1/index.gen.js +4 -0
- package/dist/api/domain/v2beta1/marshalling.gen.js +47 -165
- package/dist/api/flexibleip/index.js +2 -2
- package/dist/api/flexibleip/v1alpha1/api.gen.js +5 -22
- package/dist/api/flexibleip/v1alpha1/content.gen.js +1 -1
- package/dist/api/flexibleip/v1alpha1/index.gen.js +6 -0
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +0 -7
- package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +14 -0
- package/dist/api/function/index.js +2 -2
- package/dist/api/function/v1beta1/api.gen.js +54 -57
- package/dist/api/function/v1beta1/content.gen.js +8 -5
- package/dist/api/function/v1beta1/index.gen.js +4 -0
- package/dist/api/function/v1beta1/marshalling.gen.js +125 -33
- package/dist/api/iam/index.js +2 -2
- package/dist/api/iam/v1alpha1/api.gen.js +15 -62
- package/dist/api/iam/v1alpha1/index.gen.js +5 -0
- package/dist/api/iam/v1alpha1/marshalling.gen.js +7 -29
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +184 -0
- package/dist/api/instance/v1/api.gen.js +38 -118
- package/dist/api/instance/v1/api.utils.js +59 -51
- package/dist/api/instance/v1/content.gen.js +7 -7
- package/dist/api/instance/v1/marshalling.gen.js +46 -168
- package/dist/api/instance/v1/marshalling.utils.js +63 -0
- package/dist/api/iot/index.js +2 -2
- package/dist/api/iot/v1/api.gen.js +5 -56
- package/dist/api/iot/v1/index.gen.js +4 -0
- package/dist/api/iot/v1/marshalling.gen.js +2 -51
- package/dist/api/k8s/index.js +2 -2
- package/dist/api/k8s/v1/api.gen.js +17 -43
- package/dist/api/k8s/v1/content.gen.js +2 -2
- package/dist/api/k8s/v1/index.gen.js +6 -0
- package/dist/api/k8s/v1/marshalling.gen.js +18 -36
- package/dist/api/k8s/v1/validation-rules.gen.js +92 -0
- package/dist/api/lb/v1/api.gen.js +8 -163
- package/dist/api/lb/v1/api.utils.js +3 -9
- package/dist/api/lb/v1/content.gen.js +3 -3
- package/dist/api/lb/v1/marshalling.gen.js +74 -101
- package/dist/api/marketplace/index.js +4 -2
- package/dist/api/marketplace/v1/api.gen.js +3 -13
- package/dist/api/marketplace/v1/index.gen.js +3 -0
- package/dist/api/marketplace/v1/marshalling.gen.js +0 -13
- package/dist/api/marketplace/v2/api.gen.js +85 -0
- package/dist/api/marketplace/v2/index.gen.js +3 -0
- package/dist/api/marketplace/v2/marshalling.gen.js +92 -0
- package/dist/api/mnq/index.js +2 -2
- package/dist/api/mnq/v1alpha1/api.gen.js +7 -25
- package/dist/api/mnq/v1alpha1/index.gen.js +3 -0
- package/dist/api/mnq/v1alpha1/marshalling.gen.js +7 -46
- package/dist/api/rdb/index.js +2 -2
- package/dist/api/rdb/v1/api.gen.js +15 -89
- package/dist/api/rdb/v1/content.gen.js +10 -4
- package/dist/api/rdb/v1/index.gen.js +4 -0
- package/dist/api/rdb/v1/marshalling.gen.js +25 -81
- package/dist/api/redis/index.js +2 -2
- package/dist/api/redis/{v1alpha1 → v1}/api.gen.js +45 -77
- package/dist/api/redis/{v1alpha1 → v1}/content.gen.js +1 -1
- package/dist/api/redis/v1/index.gen.js +4 -0
- package/dist/api/redis/{v1alpha1 → v1}/marshalling.gen.js +42 -59
- package/dist/api/registry/index.js +2 -2
- package/dist/api/registry/v1/api.gen.js +5 -29
- package/dist/api/registry/v1/content.gen.js +2 -2
- package/dist/api/registry/v1/{index.js → index.gen.js} +3 -1
- package/dist/api/registry/v1/marshalling.gen.js +2 -8
- package/dist/api/secret/index.js +2 -0
- package/dist/api/secret/v1alpha1/api.gen.js +135 -0
- package/dist/api/secret/v1alpha1/index.gen.js +3 -0
- package/dist/api/secret/v1alpha1/marshalling.gen.js +82 -0
- package/dist/api/tem/index.js +2 -0
- package/dist/api/tem/v1alpha1/api.gen.js +109 -0
- package/dist/api/tem/v1alpha1/content.gen.js +10 -0
- package/dist/api/tem/v1alpha1/index.gen.js +4 -0
- package/dist/api/tem/v1alpha1/marshalling.gen.js +132 -0
- package/dist/api/test/index.js +2 -2
- package/dist/api/test/v1/api.gen.js +6 -20
- package/dist/api/test/v1/index.gen.js +4 -0
- package/dist/api/test/v1/marshalling.gen.js +2 -5
- package/dist/api/vpc/index.js +2 -2
- package/dist/api/vpc/v1/api.gen.js +6 -17
- package/dist/api/vpc/v1/index.gen.js +3 -0
- package/dist/api/vpc/v1/marshalling.gen.js +1 -3
- package/dist/api/vpcgw/index.js +2 -2
- package/dist/api/vpcgw/v1/api.gen.js +5 -64
- package/dist/api/vpcgw/v1/content.gen.js +2 -2
- package/dist/api/vpcgw/v1/{index.js → index.gen.js} +3 -1
- package/dist/api/vpcgw/v1/marshalling.gen.js +3 -24
- package/dist/helpers/json.js +1 -2
- package/dist/helpers/marshalling.js +7 -20
- package/dist/index.cjs +3870 -2948
- package/dist/index.d.ts +7218 -4335
- package/dist/index.js +10 -6
- package/dist/internal/async/interval-retrier.js +10 -16
- package/dist/internal/interceptors/interceptor.js +3 -1
- package/dist/internal/interceptors/request.js +1 -3
- package/dist/internal/logger/console-logger.js +3 -5
- package/dist/internal/logger/index.js +3 -5
- package/dist/internal/logger/level-resolver.js +0 -3
- package/dist/internal/validations/string-validation.js +8 -10
- package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js +13 -0
- package/dist/scw/api.js +3 -4
- package/dist/scw/auth.js +3 -5
- package/dist/scw/client-ini-factory.js +32 -15
- package/dist/scw/client-ini-profile.js +10 -4
- package/dist/scw/client-settings.js +32 -15
- package/dist/scw/client.js +5 -6
- package/dist/scw/constants.js +1 -1
- package/dist/scw/custom-marshalling.js +8 -14
- package/dist/scw/errors/error-parser.js +2 -21
- package/dist/scw/errors/non-standard/invalid-request-mapper.js +17 -15
- package/dist/scw/errors/non-standard/unknown-resource-mapper.js +7 -6
- package/dist/scw/errors/scw-error.js +20 -20
- package/dist/scw/errors/standard/already-exists-error.js +3 -4
- package/dist/scw/errors/standard/denied-authentication-error.js +4 -11
- package/dist/scw/errors/standard/invalid-arguments-error.js +1 -10
- package/dist/scw/errors/standard/out-of-stock-error.js +0 -3
- package/dist/scw/errors/standard/permissions-denied-error.js +1 -4
- package/dist/scw/errors/standard/precondition-failed-error.js +4 -8
- package/dist/scw/errors/standard/quotas-exceeded-error.js +14 -14
- package/dist/scw/errors/standard/resource-expired-error.js +3 -4
- package/dist/scw/errors/standard/resource-locked-error.js +3 -4
- package/dist/scw/errors/standard/resource-not-found-error.js +3 -4
- package/dist/scw/errors/standard/too-many-requests-error.js +3 -16
- package/dist/scw/errors/standard/transient-state-error.js +3 -4
- package/dist/scw/errors/types.js +0 -3
- package/dist/scw/fetch/build-fetcher.js +1 -9
- package/dist/scw/fetch/http-dumper.js +4 -7
- package/dist/scw/fetch/http-interceptors.js +9 -12
- package/dist/scw/fetch/resource-paginator.js +18 -16
- package/dist/scw/fetch/response-parser.js +17 -23
- package/node_modules/@scaleway/random-name/CHANGELOG.md +42 -63
- package/node_modules/@scaleway/random-name/dist/index.js +5 -246
- package/node_modules/@scaleway/random-name/package.json +6 -5
- package/package.json +4 -5
- package/dist/api/account/v2/index.js +0 -1
- package/dist/api/applesilicon/v1alpha1/index.js +0 -2
- package/dist/api/domain/v2beta1/index.js +0 -2
- package/dist/api/flexibleip/v1alpha1/index.js +0 -2
- package/dist/api/function/v1beta1/index.js +0 -2
- package/dist/api/iam/v1alpha1/index.js +0 -1
- package/dist/api/iot/v1/index.js +0 -2
- package/dist/api/k8s/v1/index.js +0 -2
- package/dist/api/marketplace/v1/index.js +0 -1
- package/dist/api/mnq/v1alpha1/index.js +0 -1
- package/dist/api/rdb/v1/index.js +0 -2
- package/dist/api/redis/v1alpha1/index.js +0 -2
- package/dist/api/test/v1/index.js +0 -1
- package/dist/api/vpc/v1/index.js +0 -1
- package/dist/node_modules/.pnpm/@scaleway_random-name@3.0.2/node_modules/@scaleway/random-name/dist/index.js +0 -254
- package/node_modules/@scaleway/random-name/dist/index.browser.js +0 -256
|
@@ -1,189 +1,157 @@
|
|
|
1
1
|
import { waitForResource } from '../../../internal/async/interval-retrier.js';
|
|
2
|
-
import { API } from '../../../scw/api.js';
|
|
3
|
-
import { unmarshalScwFile } from '../../../scw/custom-marshalling.js';
|
|
4
|
-
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
2
|
+
import { API as API$1 } from '../../../scw/api.js';
|
|
5
3
|
import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
|
|
4
|
+
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
6
5
|
import { CLUSTER_TRANSIENT_STATUSES } from './content.gen.js';
|
|
7
|
-
import { marshalCreateClusterRequest, unmarshalCluster, marshalUpdateClusterRequest, unmarshalListClustersResponse, marshalMigrateClusterRequest, unmarshalClusterMetricsResponse, unmarshalListNodeTypesResponse,
|
|
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';
|
|
8
7
|
|
|
9
8
|
// This file was automatically generated. DO NOT EDIT.
|
|
10
9
|
const jsonContentHeaders = {
|
|
11
10
|
'Content-Type': 'application/json; charset=utf-8'
|
|
12
11
|
};
|
|
13
|
-
/** Managed Database for Redis™ API. */
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
/** Managed Database for Redis™ API. */
|
|
14
|
+
class API extends API$1 {
|
|
16
15
|
constructor() {
|
|
17
16
|
var _this;
|
|
18
|
-
|
|
19
17
|
super(...arguments);
|
|
20
18
|
_this = this;
|
|
21
|
-
|
|
22
19
|
this.createCluster = request => this.client.fetch({
|
|
23
20
|
body: JSON.stringify(marshalCreateClusterRequest(request, this.client.settings)),
|
|
24
21
|
headers: jsonContentHeaders,
|
|
25
22
|
method: 'POST',
|
|
26
|
-
path: `/redis/
|
|
23
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters`
|
|
27
24
|
}, unmarshalCluster);
|
|
28
|
-
|
|
29
25
|
this.updateCluster = request => this.client.fetch({
|
|
30
26
|
body: JSON.stringify(marshalUpdateClusterRequest(request, this.client.settings)),
|
|
31
27
|
headers: jsonContentHeaders,
|
|
32
28
|
method: 'PATCH',
|
|
33
|
-
path: `/redis/
|
|
29
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}`
|
|
34
30
|
}, unmarshalCluster);
|
|
35
|
-
|
|
36
31
|
this.getCluster = request => this.client.fetch({
|
|
37
32
|
method: 'GET',
|
|
38
|
-
path: `/redis/
|
|
33
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}`
|
|
39
34
|
}, unmarshalCluster);
|
|
40
|
-
|
|
41
35
|
this.waitForCluster = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!CLUSTER_TRANSIENT_STATUSES.includes(res.status))), this.getCluster, request, options);
|
|
42
|
-
|
|
43
36
|
this.pageOfListClusters = function (request) {
|
|
44
37
|
if (request === void 0) {
|
|
45
38
|
request = {};
|
|
46
39
|
}
|
|
47
|
-
|
|
48
40
|
return _this.client.fetch({
|
|
49
41
|
method: 'GET',
|
|
50
|
-
path: `/redis/
|
|
51
|
-
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId], ['tags', request.tags])
|
|
42
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/clusters`,
|
|
43
|
+
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId], ['tags', request.tags], ['version', request.version])
|
|
52
44
|
}, unmarshalListClustersResponse);
|
|
53
45
|
};
|
|
54
|
-
|
|
55
46
|
this.listClusters = function (request) {
|
|
56
47
|
if (request === void 0) {
|
|
57
48
|
request = {};
|
|
58
49
|
}
|
|
59
|
-
|
|
60
50
|
return enrichForPagination('clusters', _this.pageOfListClusters, request);
|
|
61
51
|
};
|
|
62
|
-
|
|
63
52
|
this.migrateCluster = request => this.client.fetch({
|
|
64
53
|
body: JSON.stringify(marshalMigrateClusterRequest(request, this.client.settings)),
|
|
65
54
|
headers: jsonContentHeaders,
|
|
66
55
|
method: 'POST',
|
|
67
|
-
path: `/redis/
|
|
56
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/migrate`
|
|
68
57
|
}, unmarshalCluster);
|
|
69
|
-
|
|
70
58
|
this.deleteCluster = request => this.client.fetch({
|
|
71
59
|
method: 'DELETE',
|
|
72
|
-
path: `/redis/
|
|
60
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}`
|
|
73
61
|
}, unmarshalCluster);
|
|
74
|
-
|
|
75
62
|
this.getClusterMetrics = request => this.client.fetch({
|
|
76
63
|
method: 'GET',
|
|
77
|
-
path: `/redis/
|
|
78
|
-
urlParams: urlParams(['
|
|
64
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/metrics`,
|
|
65
|
+
urlParams: urlParams(['end_at', request.endAt], ['metric_name', request.metricName], ['start_at', request.startAt])
|
|
79
66
|
}, unmarshalClusterMetricsResponse);
|
|
80
|
-
|
|
81
67
|
this.pageOfListNodeTypes = request => this.client.fetch({
|
|
82
68
|
method: 'GET',
|
|
83
|
-
path: `/redis/
|
|
69
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/node-types`,
|
|
84
70
|
urlParams: urlParams(['include_disabled_types', request.includeDisabledTypes], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
|
|
85
71
|
}, unmarshalListNodeTypesResponse);
|
|
86
|
-
|
|
87
72
|
this.listNodeTypes = request => enrichForPagination('nodeTypes', this.pageOfListNodeTypes, request);
|
|
88
|
-
|
|
89
|
-
this.pageOfListVersions = request => this.client.fetch({
|
|
73
|
+
this.pageOfListClusterVersions = request => this.client.fetch({
|
|
90
74
|
method: 'GET',
|
|
91
|
-
path: `/redis/
|
|
92
|
-
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], ['
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
this.listVersions = request => enrichForPagination('versions', this.pageOfListVersions, request);
|
|
96
|
-
|
|
75
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/cluster-versions`,
|
|
76
|
+
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])
|
|
77
|
+
}, unmarshalListClusterVersionsResponse);
|
|
78
|
+
this.listClusterVersions = request => enrichForPagination('versions', this.pageOfListClusterVersions, request);
|
|
97
79
|
this.getClusterCertificate = request => this.client.fetch({
|
|
98
80
|
method: 'GET',
|
|
99
|
-
path: `/redis/
|
|
100
|
-
|
|
101
|
-
|
|
81
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/certificate`,
|
|
82
|
+
urlParams: urlParams(['dl', 1]),
|
|
83
|
+
responseType: 'blob'
|
|
84
|
+
});
|
|
102
85
|
this.renewClusterCertificate = request => this.client.fetch({
|
|
103
86
|
body: '{}',
|
|
104
87
|
headers: jsonContentHeaders,
|
|
105
88
|
method: 'POST',
|
|
106
|
-
path: `/redis/
|
|
107
|
-
});
|
|
108
|
-
|
|
89
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/renew-certificate`
|
|
90
|
+
}, unmarshalCluster);
|
|
109
91
|
this.addClusterSettings = request => this.client.fetch({
|
|
110
92
|
body: JSON.stringify(marshalAddClusterSettingsRequest(request, this.client.settings)),
|
|
111
93
|
headers: jsonContentHeaders,
|
|
112
94
|
method: 'POST',
|
|
113
|
-
path: `/redis/
|
|
95
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/settings`
|
|
114
96
|
}, unmarshalClusterSettingsResponse);
|
|
115
|
-
|
|
116
97
|
this.deleteClusterSetting = request => this.client.fetch({
|
|
117
|
-
body: JSON.stringify(marshalDeleteClusterSettingRequest(request, this.client.settings)),
|
|
118
|
-
headers: jsonContentHeaders,
|
|
119
98
|
method: 'DELETE',
|
|
120
|
-
path: `/redis/
|
|
121
|
-
});
|
|
122
|
-
|
|
99
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/settings/${validatePathParam('settingName', request.settingName)}`
|
|
100
|
+
}, unmarshalCluster);
|
|
123
101
|
this.setClusterSettings = request => this.client.fetch({
|
|
124
102
|
body: JSON.stringify(marshalSetClusterSettingsRequest(request, this.client.settings)),
|
|
125
103
|
headers: jsonContentHeaders,
|
|
126
104
|
method: 'PUT',
|
|
127
|
-
path: `/redis/
|
|
105
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/settings`
|
|
128
106
|
}, unmarshalClusterSettingsResponse);
|
|
129
|
-
|
|
130
107
|
this.setAclRules = request => this.client.fetch({
|
|
131
108
|
body: JSON.stringify(marshalSetAclRulesRequest(request, this.client.settings)),
|
|
132
109
|
headers: jsonContentHeaders,
|
|
133
110
|
method: 'PUT',
|
|
134
|
-
path: `/redis/
|
|
135
|
-
},
|
|
136
|
-
|
|
111
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/acls`
|
|
112
|
+
}, unmarshalSetAclRulesResponse);
|
|
137
113
|
this.addAclRules = request => this.client.fetch({
|
|
138
114
|
body: JSON.stringify(marshalAddAclRulesRequest(request, this.client.settings)),
|
|
139
115
|
headers: jsonContentHeaders,
|
|
140
116
|
method: 'POST',
|
|
141
|
-
path: `/redis/
|
|
142
|
-
},
|
|
143
|
-
|
|
117
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/acls`
|
|
118
|
+
}, unmarshalAddAclRulesResponse);
|
|
144
119
|
this.deleteAclRule = request => this.client.fetch({
|
|
145
120
|
method: 'DELETE',
|
|
146
|
-
path: `/redis/
|
|
147
|
-
});
|
|
148
|
-
|
|
121
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam('aclId', request.aclId)}`
|
|
122
|
+
}, unmarshalCluster);
|
|
149
123
|
this.getAclRule = request => this.client.fetch({
|
|
150
124
|
method: 'GET',
|
|
151
|
-
path: `/redis/
|
|
125
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam('aclId', request.aclId)}`
|
|
152
126
|
}, unmarshalACLRule);
|
|
153
|
-
|
|
154
127
|
this.setEndpoints = request => this.client.fetch({
|
|
155
128
|
body: JSON.stringify(marshalSetEndpointsRequest(request, this.client.settings)),
|
|
156
129
|
headers: jsonContentHeaders,
|
|
157
130
|
method: 'PUT',
|
|
158
|
-
path: `/redis/
|
|
131
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/endpoints`
|
|
159
132
|
}, unmarshalSetEndpointsResponse);
|
|
160
|
-
|
|
161
133
|
this.addEndpoints = request => this.client.fetch({
|
|
162
134
|
body: JSON.stringify(marshalAddEndpointsRequest(request, this.client.settings)),
|
|
163
135
|
headers: jsonContentHeaders,
|
|
164
136
|
method: 'POST',
|
|
165
|
-
path: `/redis/
|
|
137
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/endpoints`
|
|
166
138
|
}, unmarshalAddEndpointsResponse);
|
|
167
|
-
|
|
168
139
|
this.deleteEndpoint = request => this.client.fetch({
|
|
169
140
|
method: 'DELETE',
|
|
170
|
-
path: `/redis/
|
|
171
|
-
});
|
|
172
|
-
|
|
141
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`
|
|
142
|
+
}, unmarshalCluster);
|
|
173
143
|
this.getEndpoint = request => this.client.fetch({
|
|
174
144
|
method: 'GET',
|
|
175
|
-
path: `/redis/
|
|
145
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`
|
|
176
146
|
}, unmarshalEndpoint);
|
|
177
|
-
|
|
178
147
|
this.updateEndpoint = request => this.client.fetch({
|
|
179
148
|
body: JSON.stringify(marshalUpdateEndpointRequest(request, this.client.settings)),
|
|
180
149
|
headers: jsonContentHeaders,
|
|
181
150
|
method: 'PATCH',
|
|
182
|
-
path: `/redis/
|
|
151
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`
|
|
183
152
|
}, unmarshalEndpoint);
|
|
184
153
|
}
|
|
185
|
-
|
|
186
154
|
}
|
|
187
|
-
|
|
155
|
+
API.LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1', 'nl-ams-2', 'pl-waw-1', 'pl-waw-2'];
|
|
188
156
|
|
|
189
|
-
export {
|
|
157
|
+
export { API };
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
3
3
|
|
|
4
4
|
/** Lists transient statutes of the enum {@link ClusterStatus}. */
|
|
5
|
-
const CLUSTER_TRANSIENT_STATUSES = ['provisioning', 'configuring', '
|
|
5
|
+
const CLUSTER_TRANSIENT_STATUSES = ['provisioning', 'configuring', 'deleting', 'autohealing', 'initializing'];
|
|
6
6
|
|
|
7
7
|
export { CLUSTER_TRANSIENT_STATUSES };
|
|
@@ -1,47 +1,39 @@
|
|
|
1
|
-
import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@
|
|
1
|
+
import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js';
|
|
2
2
|
import { isJSONObject } from '../../../helpers/json.js';
|
|
3
3
|
import { unmarshalTimeSeries } from '../../../scw/custom-marshalling.js';
|
|
4
4
|
import { unmarshalArrayOfObject, unmarshalDate, resolveOneOf } from '../../../helpers/marshalling.js';
|
|
5
5
|
|
|
6
6
|
// This file was automatically generated. DO NOT EDIT.
|
|
7
|
-
|
|
8
|
-
const unmarshalEndpointPublicNetwork = data => {
|
|
9
|
-
if (!isJSONObject(data)) {
|
|
10
|
-
throw new TypeError(`Unmarshalling the type 'EndpointPublicNetwork' failed as data isn't a dictionary.`);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return {};
|
|
14
|
-
};
|
|
15
|
-
|
|
16
7
|
const unmarshalPrivateNetwork = data => {
|
|
17
8
|
if (!isJSONObject(data)) {
|
|
18
9
|
throw new TypeError(`Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`);
|
|
19
10
|
}
|
|
20
|
-
|
|
21
11
|
return {
|
|
22
12
|
id: data.id,
|
|
23
13
|
serviceIps: data.service_ips,
|
|
24
14
|
zone: data.zone
|
|
25
15
|
};
|
|
26
16
|
};
|
|
27
|
-
|
|
17
|
+
const unmarshalPublicNetwork = data => {
|
|
18
|
+
if (!isJSONObject(data)) {
|
|
19
|
+
throw new TypeError(`Unmarshalling the type 'PublicNetwork' failed as data isn't a dictionary.`);
|
|
20
|
+
}
|
|
21
|
+
return {};
|
|
22
|
+
};
|
|
28
23
|
const unmarshalACLRule = data => {
|
|
29
24
|
if (!isJSONObject(data)) {
|
|
30
25
|
throw new TypeError(`Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`);
|
|
31
26
|
}
|
|
32
|
-
|
|
33
27
|
return {
|
|
34
28
|
description: data.description,
|
|
35
29
|
id: data.id,
|
|
36
|
-
|
|
30
|
+
ipCidr: data.ip_cidr
|
|
37
31
|
};
|
|
38
32
|
};
|
|
39
|
-
|
|
40
33
|
const unmarshalAvailableClusterSetting = data => {
|
|
41
34
|
if (!isJSONObject(data)) {
|
|
42
35
|
throw new TypeError(`Unmarshalling the type 'AvailableClusterSetting' failed as data isn't a dictionary.`);
|
|
43
36
|
}
|
|
44
|
-
|
|
45
37
|
return {
|
|
46
38
|
defaultValue: data.default_value,
|
|
47
39
|
deprecated: data.deprecated,
|
|
@@ -53,36 +45,31 @@ const unmarshalAvailableClusterSetting = data => {
|
|
|
53
45
|
type: data.type
|
|
54
46
|
};
|
|
55
47
|
};
|
|
56
|
-
|
|
57
48
|
const unmarshalClusterSetting = data => {
|
|
58
49
|
if (!isJSONObject(data)) {
|
|
59
50
|
throw new TypeError(`Unmarshalling the type 'ClusterSetting' failed as data isn't a dictionary.`);
|
|
60
51
|
}
|
|
61
|
-
|
|
62
52
|
return {
|
|
63
53
|
name: data.name,
|
|
64
54
|
value: data.value
|
|
65
55
|
};
|
|
66
56
|
};
|
|
67
|
-
|
|
68
57
|
const unmarshalEndpoint = data => {
|
|
69
58
|
if (!isJSONObject(data)) {
|
|
70
59
|
throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`);
|
|
71
60
|
}
|
|
72
|
-
|
|
73
61
|
return {
|
|
74
62
|
id: data.id,
|
|
75
63
|
ips: data.ips,
|
|
76
64
|
port: data.port,
|
|
77
65
|
privateNetwork: data.private_network ? unmarshalPrivateNetwork(data.private_network) : undefined,
|
|
78
|
-
publicNetwork: data.public_network ?
|
|
66
|
+
publicNetwork: data.public_network ? unmarshalPublicNetwork(data.public_network) : undefined
|
|
79
67
|
};
|
|
80
68
|
};
|
|
81
69
|
const unmarshalCluster = data => {
|
|
82
70
|
if (!isJSONObject(data)) {
|
|
83
71
|
throw new TypeError(`Unmarshalling the type 'Cluster' failed as data isn't a dictionary.`);
|
|
84
72
|
}
|
|
85
|
-
|
|
86
73
|
return {
|
|
87
74
|
aclRules: unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule),
|
|
88
75
|
clusterSettings: unmarshalArrayOfObject(data.cluster_settings, unmarshalClusterSetting),
|
|
@@ -97,30 +84,28 @@ const unmarshalCluster = data => {
|
|
|
97
84
|
tags: data.tags,
|
|
98
85
|
tlsEnabled: data.tls_enabled,
|
|
99
86
|
updatedAt: unmarshalDate(data.updated_at),
|
|
87
|
+
upgradableVersions: data.upgradable_versions,
|
|
88
|
+
userName: data.user_name,
|
|
100
89
|
version: data.version,
|
|
101
90
|
zone: data.zone
|
|
102
91
|
};
|
|
103
92
|
};
|
|
104
|
-
|
|
105
93
|
const unmarshalClusterVersion = data => {
|
|
106
94
|
if (!isJSONObject(data)) {
|
|
107
95
|
throw new TypeError(`Unmarshalling the type 'ClusterVersion' failed as data isn't a dictionary.`);
|
|
108
96
|
}
|
|
109
|
-
|
|
110
97
|
return {
|
|
111
98
|
availableSettings: unmarshalArrayOfObject(data.available_settings, unmarshalAvailableClusterSetting),
|
|
112
|
-
|
|
99
|
+
endOfLifeAt: unmarshalDate(data.end_of_life_at),
|
|
113
100
|
logoUrl: data.logo_url,
|
|
114
101
|
version: data.version,
|
|
115
102
|
zone: data.zone
|
|
116
103
|
};
|
|
117
104
|
};
|
|
118
|
-
|
|
119
105
|
const unmarshalNodeType = data => {
|
|
120
106
|
if (!isJSONObject(data)) {
|
|
121
107
|
throw new TypeError(`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`);
|
|
122
108
|
}
|
|
123
|
-
|
|
124
109
|
return {
|
|
125
110
|
beta: data.beta,
|
|
126
111
|
description: data.description,
|
|
@@ -132,21 +117,19 @@ const unmarshalNodeType = data => {
|
|
|
132
117
|
zone: data.zone
|
|
133
118
|
};
|
|
134
119
|
};
|
|
135
|
-
|
|
136
|
-
const unmarshalAclRulesResponse = data => {
|
|
120
|
+
const unmarshalAddAclRulesResponse = data => {
|
|
137
121
|
if (!isJSONObject(data)) {
|
|
138
|
-
throw new TypeError(`Unmarshalling the type '
|
|
122
|
+
throw new TypeError(`Unmarshalling the type 'AddAclRulesResponse' failed as data isn't a dictionary.`);
|
|
139
123
|
}
|
|
140
|
-
|
|
141
124
|
return {
|
|
142
|
-
aclRules: unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule)
|
|
125
|
+
aclRules: unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule),
|
|
126
|
+
totalCount: data.total_count
|
|
143
127
|
};
|
|
144
128
|
};
|
|
145
129
|
const unmarshalAddEndpointsResponse = data => {
|
|
146
130
|
if (!isJSONObject(data)) {
|
|
147
131
|
throw new TypeError(`Unmarshalling the type 'AddEndpointsResponse' failed as data isn't a dictionary.`);
|
|
148
132
|
}
|
|
149
|
-
|
|
150
133
|
return {
|
|
151
134
|
endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
|
|
152
135
|
totalCount: data.total_count
|
|
@@ -156,7 +139,6 @@ const unmarshalClusterMetricsResponse = data => {
|
|
|
156
139
|
if (!isJSONObject(data)) {
|
|
157
140
|
throw new TypeError(`Unmarshalling the type 'ClusterMetricsResponse' failed as data isn't a dictionary.`);
|
|
158
141
|
}
|
|
159
|
-
|
|
160
142
|
return {
|
|
161
143
|
timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries)
|
|
162
144
|
};
|
|
@@ -165,16 +147,23 @@ const unmarshalClusterSettingsResponse = data => {
|
|
|
165
147
|
if (!isJSONObject(data)) {
|
|
166
148
|
throw new TypeError(`Unmarshalling the type 'ClusterSettingsResponse' failed as data isn't a dictionary.`);
|
|
167
149
|
}
|
|
168
|
-
|
|
169
150
|
return {
|
|
170
151
|
settings: unmarshalArrayOfObject(data.settings, unmarshalClusterSetting)
|
|
171
152
|
};
|
|
172
153
|
};
|
|
154
|
+
const unmarshalListClusterVersionsResponse = data => {
|
|
155
|
+
if (!isJSONObject(data)) {
|
|
156
|
+
throw new TypeError(`Unmarshalling the type 'ListClusterVersionsResponse' failed as data isn't a dictionary.`);
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
totalCount: data.total_count,
|
|
160
|
+
versions: unmarshalArrayOfObject(data.versions, unmarshalClusterVersion)
|
|
161
|
+
};
|
|
162
|
+
};
|
|
173
163
|
const unmarshalListClustersResponse = data => {
|
|
174
164
|
if (!isJSONObject(data)) {
|
|
175
165
|
throw new TypeError(`Unmarshalling the type 'ListClustersResponse' failed as data isn't a dictionary.`);
|
|
176
166
|
}
|
|
177
|
-
|
|
178
167
|
return {
|
|
179
168
|
clusters: unmarshalArrayOfObject(data.clusters, unmarshalCluster),
|
|
180
169
|
totalCount: data.total_count
|
|
@@ -184,51 +173,42 @@ const unmarshalListNodeTypesResponse = data => {
|
|
|
184
173
|
if (!isJSONObject(data)) {
|
|
185
174
|
throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`);
|
|
186
175
|
}
|
|
187
|
-
|
|
188
176
|
return {
|
|
189
177
|
nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
|
|
190
178
|
totalCount: data.total_count
|
|
191
179
|
};
|
|
192
180
|
};
|
|
193
|
-
const
|
|
181
|
+
const unmarshalSetAclRulesResponse = data => {
|
|
194
182
|
if (!isJSONObject(data)) {
|
|
195
|
-
throw new TypeError(`Unmarshalling the type '
|
|
183
|
+
throw new TypeError(`Unmarshalling the type 'SetAclRulesResponse' failed as data isn't a dictionary.`);
|
|
196
184
|
}
|
|
197
|
-
|
|
198
185
|
return {
|
|
199
|
-
|
|
200
|
-
versions: unmarshalArrayOfObject(data.versions, unmarshalClusterVersion)
|
|
186
|
+
aclRules: unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule)
|
|
201
187
|
};
|
|
202
188
|
};
|
|
203
189
|
const unmarshalSetEndpointsResponse = data => {
|
|
204
190
|
if (!isJSONObject(data)) {
|
|
205
191
|
throw new TypeError(`Unmarshalling the type 'SetEndpointsResponse' failed as data isn't a dictionary.`);
|
|
206
192
|
}
|
|
207
|
-
|
|
208
193
|
return {
|
|
209
|
-
endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint)
|
|
210
|
-
totalCount: data.total_count
|
|
194
|
+
endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint)
|
|
211
195
|
};
|
|
212
196
|
};
|
|
213
|
-
|
|
214
197
|
const marshalEndpointSpecPrivateNetworkSpec = (request, defaults) => ({
|
|
215
198
|
id: request.id,
|
|
216
199
|
service_ips: request.serviceIps
|
|
217
200
|
});
|
|
218
|
-
|
|
219
201
|
const marshalEndpointSpecPublicNetworkSpec = (request, defaults) => ({});
|
|
220
|
-
|
|
221
202
|
const marshalACLRuleSpec = (request, defaults) => ({
|
|
222
203
|
description: request.description,
|
|
223
|
-
|
|
204
|
+
ip_cidr: request.ipCidr
|
|
224
205
|
});
|
|
225
|
-
|
|
226
206
|
const marshalClusterSetting = (request, defaults) => ({
|
|
227
207
|
name: request.name,
|
|
228
208
|
value: request.value
|
|
229
209
|
});
|
|
230
|
-
|
|
231
|
-
|
|
210
|
+
const marshalEndpointSpec = (request, defaults) => ({
|
|
211
|
+
...resolveOneOf([{
|
|
232
212
|
param: 'private_network',
|
|
233
213
|
value: request.privateNetwork ? marshalEndpointSpecPrivateNetworkSpec(request.privateNetwork) : undefined
|
|
234
214
|
}, {
|
|
@@ -236,7 +216,6 @@ const marshalEndpointSpec = (request, defaults) => ({ ...resolveOneOf([{
|
|
|
236
216
|
value: request.publicNetwork ? marshalEndpointSpecPublicNetworkSpec(request.publicNetwork) : undefined
|
|
237
217
|
}])
|
|
238
218
|
});
|
|
239
|
-
|
|
240
219
|
const marshalAddAclRulesRequest = (request, defaults) => ({
|
|
241
220
|
acl_rules: request.aclRules.map(elt => marshalACLRuleSpec(elt))
|
|
242
221
|
});
|
|
@@ -260,10 +239,8 @@ const marshalCreateClusterRequest = (request, defaults) => ({
|
|
|
260
239
|
user_name: request.userName,
|
|
261
240
|
version: request.version
|
|
262
241
|
});
|
|
263
|
-
const
|
|
264
|
-
|
|
265
|
-
});
|
|
266
|
-
const marshalMigrateClusterRequest = (request, defaults) => ({ ...resolveOneOf([{
|
|
242
|
+
const marshalMigrateClusterRequest = (request, defaults) => ({
|
|
243
|
+
...resolveOneOf([{
|
|
267
244
|
param: 'version',
|
|
268
245
|
value: request.version
|
|
269
246
|
}, {
|
|
@@ -290,7 +267,13 @@ const marshalUpdateClusterRequest = (request, defaults) => ({
|
|
|
290
267
|
user_name: request.userName
|
|
291
268
|
});
|
|
292
269
|
const marshalUpdateEndpointRequest = (request, defaults) => ({
|
|
293
|
-
|
|
270
|
+
...resolveOneOf([{
|
|
271
|
+
param: 'private_network',
|
|
272
|
+
value: request.privateNetwork ? marshalEndpointSpecPrivateNetworkSpec(request.privateNetwork) : undefined
|
|
273
|
+
}, {
|
|
274
|
+
param: 'public_network',
|
|
275
|
+
value: request.publicNetwork ? marshalEndpointSpecPublicNetworkSpec(request.publicNetwork) : undefined
|
|
276
|
+
}])
|
|
294
277
|
});
|
|
295
278
|
|
|
296
|
-
export { marshalAddAclRulesRequest, marshalAddClusterSettingsRequest, marshalAddEndpointsRequest, marshalCreateClusterRequest,
|
|
279
|
+
export { marshalAddAclRulesRequest, marshalAddClusterSettingsRequest, marshalAddEndpointsRequest, marshalCreateClusterRequest, marshalMigrateClusterRequest, marshalSetAclRulesRequest, marshalSetClusterSettingsRequest, marshalSetEndpointsRequest, marshalUpdateClusterRequest, marshalUpdateEndpointRequest, unmarshalACLRule, unmarshalAddAclRulesResponse, unmarshalAddEndpointsResponse, unmarshalCluster, unmarshalClusterMetricsResponse, unmarshalClusterSettingsResponse, unmarshalEndpoint, unmarshalListClusterVersionsResponse, unmarshalListClustersResponse, unmarshalListNodeTypesResponse, unmarshalSetAclRulesResponse, unmarshalSetEndpointsResponse };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
export {
|
|
1
|
+
import * as index_gen from './v1/index.gen.js';
|
|
2
|
+
export { index_gen as v1 };
|