@scaleway/sdk 2.6.0 → 2.7.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/dist/api/account/v2/api.gen.js +26 -74
- package/dist/api/account/v3/api.gen.js +20 -60
- package/dist/api/applesilicon/v1alpha1/api.gen.js +16 -56
- package/dist/api/baremetal/v1/api.gen.js +36 -132
- package/dist/api/billing/v2alpha1/api.gen.js +17 -57
- package/dist/api/block/v1alpha1/api.gen.js +19 -67
- package/dist/api/block/v1alpha1/marshalling.gen.js +1 -0
- package/dist/api/cockpit/v1beta1/api.gen.js +95 -279
- package/dist/api/container/v1beta1/api.gen.js +51 -123
- package/dist/api/document_db/v1beta1/api.gen.js +18 -66
- package/dist/api/document_db/v1beta1/marshalling.gen.js +20 -1
- package/dist/api/domain/v2beta1/api.gen.js +36 -124
- package/dist/api/flexibleip/v1alpha1/api.gen.js +6 -22
- package/dist/api/function/v1beta1/api.gen.js +55 -135
- package/dist/api/iam/v1alpha1/api.gen.js +66 -226
- package/dist/api/instance/v1/api.gen.js +102 -310
- package/dist/api/instance/v1/marshalling.gen.js +32 -56
- package/dist/api/iot/v1/api.gen.js +24 -88
- package/dist/api/ipam/v1/api.gen.js +12 -28
- package/dist/api/ipfs/v1alpha1/api.gen.js +12 -44
- package/dist/api/jobs/v1alpha1/api.gen.js +12 -44
- package/dist/api/jobs/v1alpha1/marshalling.gen.js +2 -0
- package/dist/api/k8s/v1/api.gen.js +16 -56
- package/dist/api/lb/v1/api.gen.js +72 -248
- package/dist/api/marketplace/v1/api.gen.js +7 -31
- package/dist/api/marketplace/v1/marshalling.gen.js +1 -18
- package/dist/api/marketplace/v2/api.gen.js +21 -53
- package/dist/api/mnq/v1beta1/api.gen.js +76 -212
- package/dist/api/rdb/v1/api.gen.js +24 -88
- package/dist/api/rdb/v1/marshalling.gen.js +11 -1
- package/dist/api/redis/v1/api.gen.js +6 -22
- package/dist/api/registry/v1/api.gen.js +12 -44
- package/dist/api/secret/v1alpha1/api.gen.js +18 -66
- package/dist/api/serverless_sqldb/index.js +2 -0
- package/dist/api/serverless_sqldb/v1alpha1/api.gen.js +162 -0
- package/dist/api/serverless_sqldb/v1alpha1/content.gen.js +7 -0
- package/dist/api/serverless_sqldb/v1alpha1/index.gen.js +7 -0
- package/dist/api/serverless_sqldb/v1alpha1/marshalling.gen.js +77 -0
- package/dist/api/serverless_sqldb/v1alpha1/validation-rules.gen.js +60 -0
- package/dist/api/tem/v1alpha1/api.gen.js +17 -57
- package/dist/api/test/v1/api.gen.js +6 -22
- package/dist/api/vpc/v1/api.gen.js +12 -36
- package/dist/api/vpc/v2/api.gen.js +30 -86
- package/dist/api/vpcgw/v1/api.gen.js +46 -158
- package/dist/api/webhosting/v1alpha1/api.gen.js +12 -44
- package/dist/helpers/marshalling.js +8 -23
- package/dist/index.cjs +927 -603
- package/dist/index.d.ts +2047 -1646
- package/dist/index.js +12 -10
- package/dist/internal/async/interval-retrier.js +8 -16
- package/dist/internal/interceptors/helpers.js +3 -4
- package/dist/internal/logger/console-logger.js +1 -7
- package/dist/internal/logger/index.js +1 -9
- package/dist/scw/auth.js +1 -2
- package/dist/scw/client.js +2 -10
- package/dist/scw/constants.js +1 -1
- package/dist/scw/errors/non-standard/invalid-request-mapper.js +5 -8
- package/dist/scw/errors/scw-error.js +2 -8
- package/dist/scw/errors/standard/permissions-denied-error.js +4 -7
- package/dist/scw/fetch/build-fetcher.js +1 -4
- package/dist/scw/fetch/http-dumper.js +1 -4
- package/dist/scw/fetch/http-interceptors.js +18 -31
- package/dist/scw/fetch/resource-paginator.js +3 -17
- package/package.json +2 -2
|
@@ -15,19 +15,11 @@ const jsonContentHeaders = {
|
|
|
15
15
|
class API extends API$1 {
|
|
16
16
|
/** Lists the available regions of the API. */
|
|
17
17
|
static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
|
|
18
|
-
pageOfListDatabaseEngines = (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
return _this.client.fetch({
|
|
25
|
-
method: 'GET',
|
|
26
|
-
path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/database-engines`,
|
|
27
|
-
urlParams: urlParams(['name', request.name], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['version', request.version])
|
|
28
|
-
}, unmarshalListDatabaseEnginesResponse);
|
|
29
|
-
};
|
|
30
|
-
})();
|
|
18
|
+
pageOfListDatabaseEngines = (request = {}) => this.client.fetch({
|
|
19
|
+
method: 'GET',
|
|
20
|
+
path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/database-engines`,
|
|
21
|
+
urlParams: urlParams(['name', request.name], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['version', request.version])
|
|
22
|
+
}, unmarshalListDatabaseEnginesResponse);
|
|
31
23
|
|
|
32
24
|
/**
|
|
33
25
|
* List available database engines. List the PostgreSQL and MySQL database
|
|
@@ -36,15 +28,7 @@ class API extends API$1 {
|
|
|
36
28
|
* @param request - The request {@link ListDatabaseEnginesRequest}
|
|
37
29
|
* @returns A Promise of ListDatabaseEnginesResponse
|
|
38
30
|
*/
|
|
39
|
-
listDatabaseEngines = (
|
|
40
|
-
var _this2 = this;
|
|
41
|
-
return function (request) {
|
|
42
|
-
if (request === void 0) {
|
|
43
|
-
request = {};
|
|
44
|
-
}
|
|
45
|
-
return enrichForPagination('engines', _this2.pageOfListDatabaseEngines, request);
|
|
46
|
-
};
|
|
47
|
-
})();
|
|
31
|
+
listDatabaseEngines = (request = {}) => enrichForPagination('engines', this.pageOfListDatabaseEngines, request);
|
|
48
32
|
pageOfListNodeTypes = request => this.client.fetch({
|
|
49
33
|
method: 'GET',
|
|
50
34
|
path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/node-types`,
|
|
@@ -60,19 +44,11 @@ class API extends API$1 {
|
|
|
60
44
|
* @returns A Promise of ListNodeTypesResponse
|
|
61
45
|
*/
|
|
62
46
|
listNodeTypes = request => enrichForPagination('nodeTypes', this.pageOfListNodeTypes, request);
|
|
63
|
-
pageOfListDatabaseBackups = (
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
return _this3.client.fetch({
|
|
70
|
-
method: 'GET',
|
|
71
|
-
path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/backups`,
|
|
72
|
-
urlParams: urlParams(['instance_id', request.instanceId], ['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['project_id', request.projectId])
|
|
73
|
-
}, unmarshalListDatabaseBackupsResponse);
|
|
74
|
-
};
|
|
75
|
-
})();
|
|
47
|
+
pageOfListDatabaseBackups = (request = {}) => this.client.fetch({
|
|
48
|
+
method: 'GET',
|
|
49
|
+
path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backups`,
|
|
50
|
+
urlParams: urlParams(['instance_id', request.instanceId], ['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])
|
|
51
|
+
}, unmarshalListDatabaseBackupsResponse);
|
|
76
52
|
|
|
77
53
|
/**
|
|
78
54
|
* List database backups. List all backups in a specified region, for a given
|
|
@@ -83,15 +59,7 @@ class API extends API$1 {
|
|
|
83
59
|
* @param request - The request {@link ListDatabaseBackupsRequest}
|
|
84
60
|
* @returns A Promise of ListDatabaseBackupsResponse
|
|
85
61
|
*/
|
|
86
|
-
listDatabaseBackups = (
|
|
87
|
-
var _this4 = this;
|
|
88
|
-
return function (request) {
|
|
89
|
-
if (request === void 0) {
|
|
90
|
-
request = {};
|
|
91
|
-
}
|
|
92
|
-
return enrichForPagination('databaseBackups', _this4.pageOfListDatabaseBackups, request);
|
|
93
|
-
};
|
|
94
|
-
})();
|
|
62
|
+
listDatabaseBackups = (request = {}) => enrichForPagination('databaseBackups', this.pageOfListDatabaseBackups, request);
|
|
95
63
|
|
|
96
64
|
/**
|
|
97
65
|
* Create a database backup. Create a new backup. You must set the
|
|
@@ -201,19 +169,11 @@ class API extends API$1 {
|
|
|
201
169
|
method: 'POST',
|
|
202
170
|
path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/upgrade`
|
|
203
171
|
}, unmarshalInstance);
|
|
204
|
-
pageOfListInstances = (
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}
|
|
210
|
-
return _this5.client.fetch({
|
|
211
|
-
method: 'GET',
|
|
212
|
-
path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? _this5.client.settings.defaultRegion)}/instances`,
|
|
213
|
-
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this5.client.settings.defaultPageSize], ['project_id', request.projectId], ['tags', request.tags])
|
|
214
|
-
}, unmarshalListInstancesResponse);
|
|
215
|
-
};
|
|
216
|
-
})();
|
|
172
|
+
pageOfListInstances = (request = {}) => this.client.fetch({
|
|
173
|
+
method: 'GET',
|
|
174
|
+
path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances`,
|
|
175
|
+
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])
|
|
176
|
+
}, unmarshalListInstancesResponse);
|
|
217
177
|
|
|
218
178
|
/**
|
|
219
179
|
* List Database Instances. List all Database Instances in the specified
|
|
@@ -228,15 +188,7 @@ class API extends API$1 {
|
|
|
228
188
|
* @param request - The request {@link ListInstancesRequest}
|
|
229
189
|
* @returns A Promise of ListInstancesResponse
|
|
230
190
|
*/
|
|
231
|
-
listInstances = (
|
|
232
|
-
var _this6 = this;
|
|
233
|
-
return function (request) {
|
|
234
|
-
if (request === void 0) {
|
|
235
|
-
request = {};
|
|
236
|
-
}
|
|
237
|
-
return enrichForPagination('instances', _this6.pageOfListInstances, request);
|
|
238
|
-
};
|
|
239
|
-
})();
|
|
191
|
+
listInstances = (request = {}) => enrichForPagination('instances', this.pageOfListInstances, request);
|
|
240
192
|
|
|
241
193
|
/**
|
|
242
194
|
* Get a Database Instance. Retrieve information about a given Database
|
|
@@ -795,19 +747,11 @@ class API extends API$1 {
|
|
|
795
747
|
method: 'PUT',
|
|
796
748
|
path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/privileges`
|
|
797
749
|
}, unmarshalPrivilege);
|
|
798
|
-
pageOfListSnapshots = (
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
}
|
|
804
|
-
return _this7.client.fetch({
|
|
805
|
-
method: 'GET',
|
|
806
|
-
path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? _this7.client.settings.defaultRegion)}/snapshots`,
|
|
807
|
-
urlParams: urlParams(['instance_id', request.instanceId], ['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this7.client.settings.defaultPageSize], ['project_id', request.projectId])
|
|
808
|
-
}, unmarshalListSnapshotsResponse);
|
|
809
|
-
};
|
|
810
|
-
})();
|
|
750
|
+
pageOfListSnapshots = (request = {}) => this.client.fetch({
|
|
751
|
+
method: 'GET',
|
|
752
|
+
path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/snapshots`,
|
|
753
|
+
urlParams: urlParams(['instance_id', request.instanceId], ['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])
|
|
754
|
+
}, unmarshalListSnapshotsResponse);
|
|
811
755
|
|
|
812
756
|
/**
|
|
813
757
|
* List snapshots. List snapshots. You can include the `instance_id` or
|
|
@@ -819,15 +763,7 @@ class API extends API$1 {
|
|
|
819
763
|
* @param request - The request {@link ListSnapshotsRequest}
|
|
820
764
|
* @returns A Promise of ListSnapshotsResponse
|
|
821
765
|
*/
|
|
822
|
-
listSnapshots = (
|
|
823
|
-
var _this8 = this;
|
|
824
|
-
return function (request) {
|
|
825
|
-
if (request === void 0) {
|
|
826
|
-
request = {};
|
|
827
|
-
}
|
|
828
|
-
return enrichForPagination('snapshots', _this8.pageOfListSnapshots, request);
|
|
829
|
-
};
|
|
830
|
-
})();
|
|
766
|
+
listSnapshots = (request = {}) => enrichForPagination('snapshots', this.pageOfListSnapshots, request);
|
|
831
767
|
|
|
832
768
|
/**
|
|
833
769
|
* Get a Database Instance snapshot. Retrieve information about a given
|
|
@@ -201,6 +201,15 @@ const unmarshalPrivilege = data => {
|
|
|
201
201
|
userName: data.user_name
|
|
202
202
|
};
|
|
203
203
|
};
|
|
204
|
+
const unmarshalSnapshotVolumeType = data => {
|
|
205
|
+
if (!isJSONObject(data)) {
|
|
206
|
+
throw new TypeError(`Unmarshalling the type 'SnapshotVolumeType' failed as data isn't a dictionary.`);
|
|
207
|
+
}
|
|
208
|
+
return {
|
|
209
|
+
class: data.class,
|
|
210
|
+
type: data.type
|
|
211
|
+
};
|
|
212
|
+
};
|
|
204
213
|
const unmarshalSnapshot = data => {
|
|
205
214
|
if (!isJSONObject(data)) {
|
|
206
215
|
throw new TypeError(`Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`);
|
|
@@ -216,7 +225,8 @@ const unmarshalSnapshot = data => {
|
|
|
216
225
|
region: data.region,
|
|
217
226
|
size: data.size,
|
|
218
227
|
status: data.status,
|
|
219
|
-
updatedAt: unmarshalDate(data.updated_at)
|
|
228
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
229
|
+
volumeType: data.volume_type ? unmarshalSnapshotVolumeType(data.volume_type) : undefined
|
|
220
230
|
};
|
|
221
231
|
};
|
|
222
232
|
const unmarshalUser = data => {
|
|
@@ -70,19 +70,11 @@ class API extends API$1 {
|
|
|
70
70
|
* @returns A Promise of Cluster
|
|
71
71
|
*/
|
|
72
72
|
waitForCluster = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CLUSTER_TRANSIENT_STATUSES.includes(res.status))), this.getCluster, request, options);
|
|
73
|
-
pageOfListClusters = (
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
})();
|
|
73
|
+
pageOfListClusters = (request = {}) => this.client.fetch({
|
|
74
|
+
method: 'GET',
|
|
75
|
+
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters`,
|
|
76
|
+
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])
|
|
77
|
+
}, unmarshalListClustersResponse);
|
|
86
78
|
|
|
87
79
|
/**
|
|
88
80
|
* List Redis™ Database Instances. List all Redis™ Database Instances (Redis™
|
|
@@ -95,15 +87,7 @@ class API extends API$1 {
|
|
|
95
87
|
* @param request - The request {@link ListClustersRequest}
|
|
96
88
|
* @returns A Promise of ListClustersResponse
|
|
97
89
|
*/
|
|
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
|
-
})();
|
|
90
|
+
listClusters = (request = {}) => enrichForPagination('clusters', this.pageOfListClusters, request);
|
|
107
91
|
|
|
108
92
|
/**
|
|
109
93
|
* Scale up a Redis™ Database Instance. Upgrade your standalone Redis™
|
|
@@ -15,19 +15,11 @@ const jsonContentHeaders = {
|
|
|
15
15
|
class API extends API$1 {
|
|
16
16
|
/** Lists the available regions of the API. */
|
|
17
17
|
static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
|
|
18
|
-
pageOfListNamespaces = (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
return _this.client.fetch({
|
|
25
|
-
method: 'GET',
|
|
26
|
-
path: `/registry/v1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/namespaces`,
|
|
27
|
-
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])
|
|
28
|
-
}, unmarshalListNamespacesResponse);
|
|
29
|
-
};
|
|
30
|
-
})();
|
|
18
|
+
pageOfListNamespaces = (request = {}) => this.client.fetch({
|
|
19
|
+
method: 'GET',
|
|
20
|
+
path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces`,
|
|
21
|
+
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])
|
|
22
|
+
}, unmarshalListNamespacesResponse);
|
|
31
23
|
|
|
32
24
|
/**
|
|
33
25
|
* List namespaces. List all namespaces in a specified region. By default, the
|
|
@@ -39,15 +31,7 @@ class API extends API$1 {
|
|
|
39
31
|
* @param request - The request {@link ListNamespacesRequest}
|
|
40
32
|
* @returns A Promise of ListNamespacesResponse
|
|
41
33
|
*/
|
|
42
|
-
listNamespaces = (
|
|
43
|
-
var _this2 = this;
|
|
44
|
-
return function (request) {
|
|
45
|
-
if (request === void 0) {
|
|
46
|
-
request = {};
|
|
47
|
-
}
|
|
48
|
-
return enrichForPagination('namespaces', _this2.pageOfListNamespaces, request);
|
|
49
|
-
};
|
|
50
|
-
})();
|
|
34
|
+
listNamespaces = (request = {}) => enrichForPagination('namespaces', this.pageOfListNamespaces, request);
|
|
51
35
|
|
|
52
36
|
/**
|
|
53
37
|
* Get a namespace. Retrieve information about a given namespace, specified by
|
|
@@ -115,19 +99,11 @@ class API extends API$1 {
|
|
|
115
99
|
method: 'DELETE',
|
|
116
100
|
path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`
|
|
117
101
|
}, unmarshalNamespace);
|
|
118
|
-
pageOfListImages = (
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
return _this3.client.fetch({
|
|
125
|
-
method: 'GET',
|
|
126
|
-
path: `/registry/v1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/images`,
|
|
127
|
-
urlParams: urlParams(['name', request.name], ['namespace_id', request.namespaceId], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['project_id', request.projectId])
|
|
128
|
-
}, unmarshalListImagesResponse);
|
|
129
|
-
};
|
|
130
|
-
})();
|
|
102
|
+
pageOfListImages = (request = {}) => this.client.fetch({
|
|
103
|
+
method: 'GET',
|
|
104
|
+
path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/images`,
|
|
105
|
+
urlParams: urlParams(['name', request.name], ['namespace_id', request.namespaceId], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
|
|
106
|
+
}, unmarshalListImagesResponse);
|
|
131
107
|
|
|
132
108
|
/**
|
|
133
109
|
* List images. List all images in a specified region. By default, the images
|
|
@@ -138,15 +114,7 @@ class API extends API$1 {
|
|
|
138
114
|
* @param request - The request {@link ListImagesRequest}
|
|
139
115
|
* @returns A Promise of ListImagesResponse
|
|
140
116
|
*/
|
|
141
|
-
listImages = (
|
|
142
|
-
var _this4 = this;
|
|
143
|
-
return function (request) {
|
|
144
|
-
if (request === void 0) {
|
|
145
|
-
request = {};
|
|
146
|
-
}
|
|
147
|
-
return enrichForPagination('images', _this4.pageOfListImages, request);
|
|
148
|
-
};
|
|
149
|
-
})();
|
|
117
|
+
listImages = (request = {}) => enrichForPagination('images', this.pageOfListImages, request);
|
|
150
118
|
|
|
151
119
|
/**
|
|
152
120
|
* Get an image. Retrieve information about a given container image, specified
|
|
@@ -90,19 +90,11 @@ class API extends API$1 {
|
|
|
90
90
|
method: 'PATCH',
|
|
91
91
|
path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}`
|
|
92
92
|
}, unmarshalSecret);
|
|
93
|
-
pageOfListSecrets = (
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
return _this.client.fetch({
|
|
100
|
-
method: 'GET',
|
|
101
|
-
path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/secrets`,
|
|
102
|
-
urlParams: urlParams(['is_ephemeral', request.isEphemeral], ['is_managed', request.isManaged], ['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['path', request.path], ['project_id', request.projectId], ['tags', request.tags])
|
|
103
|
-
}, unmarshalListSecretsResponse);
|
|
104
|
-
};
|
|
105
|
-
})();
|
|
93
|
+
pageOfListSecrets = (request = {}) => this.client.fetch({
|
|
94
|
+
method: 'GET',
|
|
95
|
+
path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets`,
|
|
96
|
+
urlParams: urlParams(['is_ephemeral', request.isEphemeral], ['is_managed', request.isManaged], ['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['path', request.path], ['project_id', request.projectId], ['tags', request.tags])
|
|
97
|
+
}, unmarshalListSecretsResponse);
|
|
106
98
|
|
|
107
99
|
/**
|
|
108
100
|
* List secrets. Retrieve the list of secrets created within an Organization
|
|
@@ -112,28 +104,12 @@ class API extends API$1 {
|
|
|
112
104
|
* @param request - The request {@link ListSecretsRequest}
|
|
113
105
|
* @returns A Promise of ListSecretsResponse
|
|
114
106
|
*/
|
|
115
|
-
listSecrets = (
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return enrichForPagination('secrets', _this2.pageOfListSecrets, request);
|
|
122
|
-
};
|
|
123
|
-
})();
|
|
124
|
-
pageOfListFolders = (() => {
|
|
125
|
-
var _this3 = this;
|
|
126
|
-
return function (request) {
|
|
127
|
-
if (request === void 0) {
|
|
128
|
-
request = {};
|
|
129
|
-
}
|
|
130
|
-
return _this3.client.fetch({
|
|
131
|
-
method: 'GET',
|
|
132
|
-
path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/folders`,
|
|
133
|
-
urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['path', request.path], ['project_id', request.projectId])
|
|
134
|
-
}, unmarshalListFoldersResponse);
|
|
135
|
-
};
|
|
136
|
-
})();
|
|
107
|
+
listSecrets = (request = {}) => enrichForPagination('secrets', this.pageOfListSecrets, request);
|
|
108
|
+
pageOfListFolders = (request = {}) => this.client.fetch({
|
|
109
|
+
method: 'GET',
|
|
110
|
+
path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/folders`,
|
|
111
|
+
urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['path', request.path], ['project_id', request.projectId])
|
|
112
|
+
}, unmarshalListFoldersResponse);
|
|
137
113
|
|
|
138
114
|
/**
|
|
139
115
|
* List folders. Retrieve the list of folders created within a Project.
|
|
@@ -141,15 +117,7 @@ class API extends API$1 {
|
|
|
141
117
|
* @param request - The request {@link ListFoldersRequest}
|
|
142
118
|
* @returns A Promise of ListFoldersResponse
|
|
143
119
|
*/
|
|
144
|
-
listFolders = (
|
|
145
|
-
var _this4 = this;
|
|
146
|
-
return function (request) {
|
|
147
|
-
if (request === void 0) {
|
|
148
|
-
request = {};
|
|
149
|
-
}
|
|
150
|
-
return enrichForPagination('folders', _this4.pageOfListFolders, request);
|
|
151
|
-
};
|
|
152
|
-
})();
|
|
120
|
+
listFolders = (request = {}) => enrichForPagination('folders', this.pageOfListFolders, request);
|
|
153
121
|
|
|
154
122
|
/**
|
|
155
123
|
* Delete a secret. Delete a given secret specified by the `region` and
|
|
@@ -402,19 +370,11 @@ class API extends API$1 {
|
|
|
402
370
|
method: 'POST',
|
|
403
371
|
path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/destroy`
|
|
404
372
|
}, unmarshalSecretVersion);
|
|
405
|
-
pageOfListTags = (
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
}
|
|
411
|
-
return _this5.client.fetch({
|
|
412
|
-
method: 'GET',
|
|
413
|
-
path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? _this5.client.settings.defaultRegion)}/tags`,
|
|
414
|
-
urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this5.client.settings.defaultPageSize], ['project_id', request.projectId])
|
|
415
|
-
}, unmarshalListTagsResponse);
|
|
416
|
-
};
|
|
417
|
-
})();
|
|
373
|
+
pageOfListTags = (request = {}) => this.client.fetch({
|
|
374
|
+
method: 'GET',
|
|
375
|
+
path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tags`,
|
|
376
|
+
urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
|
|
377
|
+
}, unmarshalListTagsResponse);
|
|
418
378
|
|
|
419
379
|
/**
|
|
420
380
|
* List tags. List all tags associated with secrets within a given Project.
|
|
@@ -422,15 +382,7 @@ class API extends API$1 {
|
|
|
422
382
|
* @param request - The request {@link ListTagsRequest}
|
|
423
383
|
* @returns A Promise of ListTagsResponse
|
|
424
384
|
*/
|
|
425
|
-
listTags = (
|
|
426
|
-
var _this6 = this;
|
|
427
|
-
return function (request) {
|
|
428
|
-
if (request === void 0) {
|
|
429
|
-
request = {};
|
|
430
|
-
}
|
|
431
|
-
return enrichForPagination('tags', _this6.pageOfListTags, request);
|
|
432
|
-
};
|
|
433
|
-
})();
|
|
385
|
+
listTags = (request = {}) => enrichForPagination('tags', this.pageOfListTags, request);
|
|
434
386
|
}
|
|
435
387
|
|
|
436
388
|
export { API };
|
|
@@ -0,0 +1,162 @@
|
|
|
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 { DATABASE_TRANSIENT_STATUSES } from './content.gen.js';
|
|
6
|
+
import { marshalCreateDatabaseRequest, unmarshalDatabase, unmarshalListDatabasesResponse, marshalUpdateDatabaseRequest, marshalRestoreDatabaseFromBackupRequest, unmarshalDatabaseBackup, unmarshalListDatabaseBackupsResponse } 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
|
+
/**
|
|
15
|
+
* Serverless SQL Databases API.
|
|
16
|
+
*
|
|
17
|
+
* This API allows you to manage your Serverless SQL DB databases.
|
|
18
|
+
*/
|
|
19
|
+
class API extends API$1 {
|
|
20
|
+
/** Lists the available regions of the API. */
|
|
21
|
+
static LOCALITIES = ['fr-par'];
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Create a new Serverless SQL Database. You must provide the following
|
|
25
|
+
* parameters: `organization_id`, `project_id`, `name`, `cpu_min`, `cpu_max`.
|
|
26
|
+
* You can also provide `from_backup_id` to create a database from a backup.
|
|
27
|
+
*
|
|
28
|
+
* @param request - The request {@link CreateDatabaseRequest}
|
|
29
|
+
* @returns A Promise of Database
|
|
30
|
+
*/
|
|
31
|
+
createDatabase = request => this.client.fetch({
|
|
32
|
+
body: JSON.stringify(marshalCreateDatabaseRequest(request, this.client.settings)),
|
|
33
|
+
headers: jsonContentHeaders,
|
|
34
|
+
method: 'POST',
|
|
35
|
+
path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/databases`
|
|
36
|
+
}, unmarshalDatabase);
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Get a database information. Retrieve information about your Serverless SQL
|
|
40
|
+
* Database. You must provide the `database_id` parameter.
|
|
41
|
+
*
|
|
42
|
+
* @param request - The request {@link GetDatabaseRequest}
|
|
43
|
+
* @returns A Promise of Database
|
|
44
|
+
*/
|
|
45
|
+
getDatabase = request => this.client.fetch({
|
|
46
|
+
method: 'GET',
|
|
47
|
+
path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/databases/${validatePathParam('databaseId', request.databaseId)}`
|
|
48
|
+
}, unmarshalDatabase);
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Waits for {@link Database} to be in a final state.
|
|
52
|
+
*
|
|
53
|
+
* @param request - The request {@link GetDatabaseRequest}
|
|
54
|
+
* @param options - The waiting options
|
|
55
|
+
* @returns A Promise of Database
|
|
56
|
+
*/
|
|
57
|
+
waitForDatabase = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!DATABASE_TRANSIENT_STATUSES.includes(res.status))), this.getDatabase, request, options);
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Delete a database. Deletes a database. You must provide the `database_id`
|
|
61
|
+
* parameter. All data stored in the database will be permanently deleted.
|
|
62
|
+
*
|
|
63
|
+
* @param request - The request {@link DeleteDatabaseRequest}
|
|
64
|
+
* @returns A Promise of Database
|
|
65
|
+
*/
|
|
66
|
+
deleteDatabase = request => this.client.fetch({
|
|
67
|
+
method: 'DELETE',
|
|
68
|
+
path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/databases/${validatePathParam('databaseId', request.databaseId)}`
|
|
69
|
+
}, unmarshalDatabase);
|
|
70
|
+
pageOfListDatabases = (request = {}) => this.client.fetch({
|
|
71
|
+
method: 'GET',
|
|
72
|
+
path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/databases`,
|
|
73
|
+
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId])
|
|
74
|
+
}, unmarshalListDatabasesResponse);
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* List your Serverless SQL Databases. List all Serverless SQL Databases for a
|
|
78
|
+
* given Scaleway Organization or Scaleway Project. By default, the databases
|
|
79
|
+
* returned in the list are ordered by creation date in ascending order,
|
|
80
|
+
* though this can be modified via the order_by field. For the `name`
|
|
81
|
+
* parameter, the value you include will be checked against the whole name
|
|
82
|
+
* string to see if it includes the string you put in the parameter.
|
|
83
|
+
*
|
|
84
|
+
* @param request - The request {@link ListDatabasesRequest}
|
|
85
|
+
* @returns A Promise of ListDatabasesResponse
|
|
86
|
+
*/
|
|
87
|
+
listDatabases = (request = {}) => enrichForPagination('databases', this.pageOfListDatabases, request);
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Update database information. Update CPU limits of your Serverless SQL
|
|
91
|
+
* Database. You must provide the `database_id` parameter.
|
|
92
|
+
*
|
|
93
|
+
* @param request - The request {@link UpdateDatabaseRequest}
|
|
94
|
+
* @returns A Promise of Database
|
|
95
|
+
*/
|
|
96
|
+
updateDatabase = request => this.client.fetch({
|
|
97
|
+
body: JSON.stringify(marshalUpdateDatabaseRequest(request, this.client.settings)),
|
|
98
|
+
headers: jsonContentHeaders,
|
|
99
|
+
method: 'PATCH',
|
|
100
|
+
path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/databases/${validatePathParam('databaseId', request.databaseId)}`
|
|
101
|
+
}, unmarshalDatabase);
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Restore a database from a backup. Restore a database from a backup. You
|
|
105
|
+
* must provide the `backup_id` parameter.
|
|
106
|
+
*
|
|
107
|
+
* @param request - The request {@link RestoreDatabaseFromBackupRequest}
|
|
108
|
+
* @returns A Promise of Database
|
|
109
|
+
*/
|
|
110
|
+
restoreDatabaseFromBackup = request => this.client.fetch({
|
|
111
|
+
body: JSON.stringify(marshalRestoreDatabaseFromBackupRequest(request, this.client.settings)),
|
|
112
|
+
headers: jsonContentHeaders,
|
|
113
|
+
method: 'POST',
|
|
114
|
+
path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/databases/${validatePathParam('databaseId', request.databaseId)}/restore`
|
|
115
|
+
}, unmarshalDatabase);
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Get a database backup information. Retrieve information about your
|
|
119
|
+
* Serverless SQL Database backup. You must provide the `backup_id`
|
|
120
|
+
* parameter.
|
|
121
|
+
*
|
|
122
|
+
* @param request - The request {@link GetDatabaseBackupRequest}
|
|
123
|
+
* @returns A Promise of DatabaseBackup
|
|
124
|
+
*/
|
|
125
|
+
getDatabaseBackup = request => this.client.fetch({
|
|
126
|
+
method: 'GET',
|
|
127
|
+
path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backups/${validatePathParam('backupId', request.backupId)}`
|
|
128
|
+
}, unmarshalDatabaseBackup);
|
|
129
|
+
pageOfListDatabaseBackups = request => this.client.fetch({
|
|
130
|
+
method: 'GET',
|
|
131
|
+
path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backups`,
|
|
132
|
+
urlParams: urlParams(['database_id', request.databaseId], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize])
|
|
133
|
+
}, unmarshalListDatabaseBackupsResponse);
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* List your Serverless SQL Database backups. List all Serverless SQL Database
|
|
137
|
+
* backups for a given Scaleway Project or Database. By default, the backups
|
|
138
|
+
* returned in the list are ordered by creation date in ascending order,
|
|
139
|
+
* though this can be modified via the order_by field.
|
|
140
|
+
*
|
|
141
|
+
* @param request - The request {@link ListDatabaseBackupsRequest}
|
|
142
|
+
* @returns A Promise of ListDatabaseBackupsResponse
|
|
143
|
+
*/
|
|
144
|
+
listDatabaseBackups = request => enrichForPagination('backups', this.pageOfListDatabaseBackups, request);
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Export a database backup. Export a database backup providing a download
|
|
148
|
+
* link once the export process is completed. You must provide the `backup_id`
|
|
149
|
+
* parameter.
|
|
150
|
+
*
|
|
151
|
+
* @param request - The request {@link ExportDatabaseBackupRequest}
|
|
152
|
+
* @returns A Promise of DatabaseBackup
|
|
153
|
+
*/
|
|
154
|
+
exportDatabaseBackup = request => this.client.fetch({
|
|
155
|
+
body: '{}',
|
|
156
|
+
headers: jsonContentHeaders,
|
|
157
|
+
method: 'POST',
|
|
158
|
+
path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backups/${validatePathParam('backupId', request.backupId)}/export`
|
|
159
|
+
}, unmarshalDatabaseBackup);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export { API };
|
|
@@ -0,0 +1,7 @@
|
|
|
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 DatabaseStatus}. */
|
|
5
|
+
const DATABASE_TRANSIENT_STATUSES = ['creating', 'deleting', 'restoring'];
|
|
6
|
+
|
|
7
|
+
export { DATABASE_TRANSIENT_STATUSES };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { API } from './api.gen.js';
|
|
2
|
+
export { DATABASE_TRANSIENT_STATUSES } from './content.gen.js';
|
|
3
|
+
import * as validationRules_gen from './validation-rules.gen.js';
|
|
4
|
+
export { validationRules_gen as ValidationRules };
|
|
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.
|