@scaleway/sdk 2.0.0-alpha.9 → 2.1.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/applesilicon/v1alpha1/marshalling.gen.js +12 -12
- package/dist/api/baremetal/v1/marshalling.gen.js +63 -52
- package/dist/api/billing/v2alpha1/api.gen.js +32 -1
- package/dist/api/billing/v2alpha1/marshalling.gen.js +46 -1
- package/dist/api/block/v1alpha1/api.gen.js +23 -19
- package/dist/api/block/v1alpha1/marshalling.gen.js +47 -40
- package/dist/api/block/v1alpha1/validation-rules.gen.js +11 -1
- package/dist/api/cockpit/v1beta1/api.gen.js +143 -48
- package/dist/api/cockpit/v1beta1/marshalling.gen.js +89 -36
- package/dist/api/container/v1beta1/index.gen.js +2 -0
- package/dist/api/container/v1beta1/marshalling.gen.js +63 -35
- package/dist/api/container/v1beta1/validation-rules.gen.js +44 -0
- package/dist/api/document_db/v1beta1/marshalling.gen.js +117 -61
- package/dist/api/domain/v2beta1/api.gen.js +29 -37
- package/dist/api/domain/v2beta1/index.gen.js +0 -2
- package/dist/api/domain/v2beta1/marshalling.gen.js +408 -194
- package/dist/api/flexibleip/v1alpha1/api.gen.js +6 -14
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +2 -2
- package/dist/api/function/v1beta1/api.gen.js +36 -0
- package/dist/api/function/v1beta1/index.gen.js +2 -0
- package/dist/api/function/v1beta1/marshalling.gen.js +64 -36
- package/dist/api/function/v1beta1/validation-rules.gen.js +44 -0
- package/dist/api/iam/v1alpha1/api.gen.js +54 -44
- package/dist/api/iam/v1alpha1/marshalling.gen.js +69 -34
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +10 -1
- package/dist/api/instance/v1/api.gen.js +1 -1
- package/dist/api/instance/v1/content.gen.js +4 -1
- package/dist/api/instance/v1/index.js +1 -1
- package/dist/api/instance/v1/marshalling.gen.js +414 -205
- package/dist/api/iot/v1/api.gen.js +24 -32
- package/dist/api/iot/v1/marshalling.gen.js +87 -36
- package/dist/api/ipam/index.js +2 -0
- package/dist/api/ipam/v1/api.gen.js +113 -0
- package/dist/api/ipam/v1/index.gen.js +6 -0
- package/dist/api/ipam/v1/marshalling.gen.js +77 -0
- package/dist/api/ipam/v1/validation-rules.gen.js +11 -0
- package/dist/api/ipfs/v1alpha1/api.gen.js +120 -3
- package/dist/api/ipfs/v1alpha1/content.gen.js +4 -1
- package/dist/api/ipfs/v1alpha1/index.gen.js +2 -2
- package/dist/api/ipfs/v1alpha1/marshalling.gen.js +71 -19
- package/dist/api/jobs/index.js +2 -0
- package/dist/api/jobs/v1alpha1/api.gen.js +111 -0
- package/dist/api/jobs/v1alpha1/content.gen.js +7 -0
- package/dist/api/jobs/v1alpha1/index.gen.js +7 -0
- package/dist/api/jobs/v1alpha1/marshalling.gen.js +84 -0
- package/dist/api/jobs/v1alpha1/validation-rules.gen.js +45 -0
- package/dist/api/k8s/v1/marshalling.gen.js +128 -40
- package/dist/api/lb/v1/api.gen.js +1 -1
- package/dist/api/lb/v1/marshalling.gen.js +268 -152
- package/dist/api/marketplace/v1/marshalling.gen.js +11 -11
- package/dist/api/marketplace/v2/api.gen.js +3 -3
- package/dist/api/mnq/index.js +2 -0
- package/dist/api/mnq/v1alpha1/api.gen.js +12 -20
- package/dist/api/mnq/v1alpha1/marshalling.gen.js +19 -14
- package/dist/api/mnq/v1beta1/api.gen.js +529 -0
- package/dist/api/mnq/v1beta1/index.gen.js +6 -0
- package/dist/api/mnq/v1beta1/marshalling.gen.js +212 -0
- package/dist/api/mnq/v1beta1/validation-rules.gen.js +77 -0
- package/dist/api/rdb/v1/marshalling.gen.js +131 -66
- package/dist/api/redis/v1/marshalling.gen.js +51 -27
- package/dist/api/registry/v1/marshalling.gen.js +6 -4
- package/dist/api/secret/v1alpha1/api.gen.js +2 -2
- package/dist/api/secret/v1alpha1/marshalling.gen.js +17 -5
- package/dist/api/std/index.gen.js +1 -0
- package/dist/api/tem/v1alpha1/api.gen.js +8 -2
- package/dist/api/tem/v1alpha1/marshalling.gen.js +35 -13
- package/dist/api/test/v1/marshalling.gen.js +5 -3
- package/dist/api/vpc/v2/marshalling.gen.js +2 -0
- package/dist/api/vpcgw/v1/marshalling.gen.js +53 -24
- package/dist/api/webhosting/v1alpha1/api.gen.js +2 -54
- package/dist/api/webhosting/v1alpha1/index.gen.js +1 -1
- package/dist/api/webhosting/v1alpha1/marshalling.gen.js +14 -41
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +1 -10
- package/dist/index.cjs +4351 -1833
- package/dist/index.d.ts +6783 -2543
- package/dist/index.js +34 -28
- package/dist/scw/constants.js +1 -1
- package/package.json +2 -2
|
@@ -16,13 +16,13 @@ const unmarshalOS = data => {
|
|
|
16
16
|
name: data.name
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
-
const
|
|
19
|
+
const unmarshalServerTypeCPU = data => {
|
|
20
20
|
if (!isJSONObject(data)) {
|
|
21
|
-
throw new TypeError(`Unmarshalling the type '
|
|
21
|
+
throw new TypeError(`Unmarshalling the type 'ServerTypeCPU' failed as data isn't a dictionary.`);
|
|
22
22
|
}
|
|
23
23
|
return {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
coreCount: data.core_count,
|
|
25
|
+
name: data.name
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
28
|
const unmarshalServerTypeDisk = data => {
|
|
@@ -34,13 +34,13 @@ const unmarshalServerTypeDisk = data => {
|
|
|
34
34
|
type: data.type
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
|
-
const
|
|
37
|
+
const unmarshalServerTypeMemory = data => {
|
|
38
38
|
if (!isJSONObject(data)) {
|
|
39
|
-
throw new TypeError(`Unmarshalling the type '
|
|
39
|
+
throw new TypeError(`Unmarshalling the type 'ServerTypeMemory' failed as data isn't a dictionary.`);
|
|
40
40
|
}
|
|
41
41
|
return {
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
capacity: data.capacity,
|
|
43
|
+
type: data.type
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
46
|
const unmarshalServerType = data => {
|
|
@@ -48,10 +48,10 @@ const unmarshalServerType = data => {
|
|
|
48
48
|
throw new TypeError(`Unmarshalling the type 'ServerType' failed as data isn't a dictionary.`);
|
|
49
49
|
}
|
|
50
50
|
return {
|
|
51
|
-
cpu: unmarshalServerTypeCPU(data.cpu),
|
|
52
|
-
disk: unmarshalServerTypeDisk(data.disk),
|
|
53
|
-
memory: unmarshalServerTypeMemory(data.memory),
|
|
54
|
-
minimumLeaseDuration: data.minimum_lease_duration
|
|
51
|
+
cpu: data.cpu ? unmarshalServerTypeCPU(data.cpu) : undefined,
|
|
52
|
+
disk: data.disk ? unmarshalServerTypeDisk(data.disk) : undefined,
|
|
53
|
+
memory: data.memory ? unmarshalServerTypeMemory(data.memory) : undefined,
|
|
54
|
+
minimumLeaseDuration: data.minimum_lease_duration,
|
|
55
55
|
name: data.name,
|
|
56
56
|
stock: data.stock
|
|
57
57
|
};
|
|
@@ -22,7 +22,7 @@ const unmarshalOSOSField = data => {
|
|
|
22
22
|
throw new TypeError(`Unmarshalling the type 'OSOSField' failed as data isn't a dictionary.`);
|
|
23
23
|
}
|
|
24
24
|
return {
|
|
25
|
-
defaultValue: data.default_value
|
|
25
|
+
defaultValue: data.default_value,
|
|
26
26
|
editable: data.editable,
|
|
27
27
|
required: data.required
|
|
28
28
|
};
|
|
@@ -38,44 +38,32 @@ const unmarshalOS = data => {
|
|
|
38
38
|
licenseRequired: data.license_required,
|
|
39
39
|
logoUrl: data.logo_url,
|
|
40
40
|
name: data.name,
|
|
41
|
-
password: unmarshalOSOSField(data.password),
|
|
42
|
-
servicePassword: unmarshalOSOSField(data.service_password),
|
|
43
|
-
serviceUser: unmarshalOSOSField(data.service_user),
|
|
44
|
-
ssh: unmarshalOSOSField(data.ssh),
|
|
45
|
-
user: unmarshalOSOSField(data.user),
|
|
41
|
+
password: data.password ? unmarshalOSOSField(data.password) : undefined,
|
|
42
|
+
servicePassword: data.service_password ? unmarshalOSOSField(data.service_password) : undefined,
|
|
43
|
+
serviceUser: data.service_user ? unmarshalOSOSField(data.service_user) : undefined,
|
|
44
|
+
ssh: data.ssh ? unmarshalOSOSField(data.ssh) : undefined,
|
|
45
|
+
user: data.user ? unmarshalOSOSField(data.user) : undefined,
|
|
46
46
|
version: data.version
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
|
-
const
|
|
49
|
+
const unmarshalCPU = data => {
|
|
50
50
|
if (!isJSONObject(data)) {
|
|
51
|
-
throw new TypeError(`Unmarshalling the type '
|
|
51
|
+
throw new TypeError(`Unmarshalling the type 'CPU' failed as data isn't a dictionary.`);
|
|
52
52
|
}
|
|
53
53
|
return {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
benchmark: data.benchmark,
|
|
55
|
+
coreCount: data.core_count,
|
|
56
|
+
frequency: data.frequency,
|
|
57
57
|
name: data.name,
|
|
58
|
-
|
|
59
|
-
price: data.price ? unmarshalMoney(data.price) : undefined,
|
|
60
|
-
subscriptionPeriod: data.subscription_period
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
const unmarshalRaidController = data => {
|
|
64
|
-
if (!isJSONObject(data)) {
|
|
65
|
-
throw new TypeError(`Unmarshalling the type 'RaidController' failed as data isn't a dictionary.`);
|
|
66
|
-
}
|
|
67
|
-
return {
|
|
68
|
-
model: data.model,
|
|
69
|
-
raidLevel: data.raid_level
|
|
58
|
+
threadCount: data.thread_count
|
|
70
59
|
};
|
|
71
60
|
};
|
|
72
|
-
const
|
|
61
|
+
const unmarshalDisk = data => {
|
|
73
62
|
if (!isJSONObject(data)) {
|
|
74
|
-
throw new TypeError(`Unmarshalling the type '
|
|
63
|
+
throw new TypeError(`Unmarshalling the type 'Disk' failed as data isn't a dictionary.`);
|
|
75
64
|
}
|
|
76
65
|
return {
|
|
77
66
|
capacity: data.capacity,
|
|
78
|
-
frequency: data.frequency,
|
|
79
67
|
type: data.type
|
|
80
68
|
};
|
|
81
69
|
};
|
|
@@ -90,27 +78,39 @@ const unmarshalMemory = data => {
|
|
|
90
78
|
type: data.type
|
|
91
79
|
};
|
|
92
80
|
};
|
|
93
|
-
const
|
|
81
|
+
const unmarshalOfferOptionOffer = data => {
|
|
94
82
|
if (!isJSONObject(data)) {
|
|
95
|
-
throw new TypeError(`Unmarshalling the type '
|
|
83
|
+
throw new TypeError(`Unmarshalling the type 'OfferOptionOffer' failed as data isn't a dictionary.`);
|
|
96
84
|
}
|
|
97
85
|
return {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
86
|
+
enabled: data.enabled,
|
|
87
|
+
id: data.id,
|
|
88
|
+
manageable: data.manageable,
|
|
101
89
|
name: data.name,
|
|
102
|
-
|
|
90
|
+
osId: data.os_id,
|
|
91
|
+
price: data.price ? unmarshalMoney(data.price) : undefined,
|
|
92
|
+
subscriptionPeriod: data.subscription_period
|
|
103
93
|
};
|
|
104
94
|
};
|
|
105
|
-
const
|
|
95
|
+
const unmarshalPersistentMemory = data => {
|
|
106
96
|
if (!isJSONObject(data)) {
|
|
107
|
-
throw new TypeError(`Unmarshalling the type '
|
|
97
|
+
throw new TypeError(`Unmarshalling the type 'PersistentMemory' failed as data isn't a dictionary.`);
|
|
108
98
|
}
|
|
109
99
|
return {
|
|
110
100
|
capacity: data.capacity,
|
|
101
|
+
frequency: data.frequency,
|
|
111
102
|
type: data.type
|
|
112
103
|
};
|
|
113
104
|
};
|
|
105
|
+
const unmarshalRaidController = data => {
|
|
106
|
+
if (!isJSONObject(data)) {
|
|
107
|
+
throw new TypeError(`Unmarshalling the type 'RaidController' failed as data isn't a dictionary.`);
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
model: data.model,
|
|
111
|
+
raidLevel: data.raid_level
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
114
|
const unmarshalOffer = data => {
|
|
115
115
|
if (!isJSONObject(data)) {
|
|
116
116
|
throw new TypeError(`Unmarshalling the type 'Offer' failed as data isn't a dictionary.`);
|
|
@@ -162,15 +162,20 @@ const unmarshalServerPrivateNetwork = data => {
|
|
|
162
162
|
serverId: data.server_id,
|
|
163
163
|
status: data.status,
|
|
164
164
|
updatedAt: unmarshalDate(data.updated_at),
|
|
165
|
-
vlan: data.vlan
|
|
165
|
+
vlan: data.vlan
|
|
166
166
|
};
|
|
167
167
|
};
|
|
168
|
-
const
|
|
168
|
+
const unmarshalServerInstall = data => {
|
|
169
169
|
if (!isJSONObject(data)) {
|
|
170
|
-
throw new TypeError(`Unmarshalling the type '
|
|
170
|
+
throw new TypeError(`Unmarshalling the type 'ServerInstall' failed as data isn't a dictionary.`);
|
|
171
171
|
}
|
|
172
172
|
return {
|
|
173
|
-
|
|
173
|
+
hostname: data.hostname,
|
|
174
|
+
osId: data.os_id,
|
|
175
|
+
serviceUrl: data.service_url,
|
|
176
|
+
serviceUser: data.service_user,
|
|
177
|
+
sshKeyIds: data.ssh_key_ids,
|
|
178
|
+
status: data.status,
|
|
174
179
|
user: data.user
|
|
175
180
|
};
|
|
176
181
|
};
|
|
@@ -186,17 +191,12 @@ const unmarshalServerOption = data => {
|
|
|
186
191
|
status: data.status
|
|
187
192
|
};
|
|
188
193
|
};
|
|
189
|
-
const
|
|
194
|
+
const unmarshalServerRescueServer = data => {
|
|
190
195
|
if (!isJSONObject(data)) {
|
|
191
|
-
throw new TypeError(`Unmarshalling the type '
|
|
196
|
+
throw new TypeError(`Unmarshalling the type 'ServerRescueServer' failed as data isn't a dictionary.`);
|
|
192
197
|
}
|
|
193
198
|
return {
|
|
194
|
-
|
|
195
|
-
osId: data.os_id,
|
|
196
|
-
serviceUrl: data.service_url,
|
|
197
|
-
serviceUser: data.service_user,
|
|
198
|
-
sshKeyIds: data.ssh_key_ids,
|
|
199
|
-
status: data.status,
|
|
199
|
+
password: data.password,
|
|
200
200
|
user: data.user
|
|
201
201
|
};
|
|
202
202
|
};
|
|
@@ -210,7 +210,7 @@ const unmarshalServer = data => {
|
|
|
210
210
|
description: data.description,
|
|
211
211
|
domain: data.domain,
|
|
212
212
|
id: data.id,
|
|
213
|
-
install: unmarshalServerInstall(data.install),
|
|
213
|
+
install: data.install ? unmarshalServerInstall(data.install) : undefined,
|
|
214
214
|
ips: unmarshalArrayOfObject(data.ips, unmarshalIP),
|
|
215
215
|
name: data.name,
|
|
216
216
|
offerId: data.offer_id,
|
|
@@ -219,7 +219,7 @@ const unmarshalServer = data => {
|
|
|
219
219
|
organizationId: data.organization_id,
|
|
220
220
|
pingStatus: data.ping_status,
|
|
221
221
|
projectId: data.project_id,
|
|
222
|
-
rescueServer: unmarshalServerRescueServer(data.rescue_server),
|
|
222
|
+
rescueServer: data.rescue_server ? unmarshalServerRescueServer(data.rescue_server) : undefined,
|
|
223
223
|
status: data.status,
|
|
224
224
|
tags: data.tags,
|
|
225
225
|
updatedAt: unmarshalDate(data.updated_at),
|
|
@@ -341,19 +341,30 @@ const unmarshalSetServerPrivateNetworksResponse = data => {
|
|
|
341
341
|
const marshalAddOptionServerRequest = (request, defaults) => ({
|
|
342
342
|
expires_at: request.expiresAt
|
|
343
343
|
});
|
|
344
|
+
const marshalCreateServerRequestInstall = (request, defaults) => ({
|
|
345
|
+
hostname: request.hostname,
|
|
346
|
+
os_id: request.osId,
|
|
347
|
+
password: request.password,
|
|
348
|
+
service_password: request.servicePassword,
|
|
349
|
+
service_user: request.serviceUser,
|
|
350
|
+
ssh_key_ids: request.sshKeyIds,
|
|
351
|
+
user: request.user
|
|
352
|
+
});
|
|
344
353
|
const marshalCreateServerRequest = (request, defaults) => ({
|
|
345
354
|
description: request.description,
|
|
346
|
-
install: request.install,
|
|
355
|
+
install: request.install !== undefined ? marshalCreateServerRequestInstall(request.install) : undefined,
|
|
347
356
|
name: request.name,
|
|
348
357
|
offer_id: request.offerId,
|
|
349
358
|
option_ids: request.optionIds,
|
|
350
359
|
tags: request.tags,
|
|
351
360
|
...resolveOneOf([{
|
|
352
|
-
|
|
353
|
-
value: request.organizationId
|
|
354
|
-
}, {
|
|
361
|
+
default: defaults.defaultProjectId,
|
|
355
362
|
param: 'project_id',
|
|
356
363
|
value: request.projectId
|
|
364
|
+
}, {
|
|
365
|
+
default: defaults.defaultOrganizationId,
|
|
366
|
+
param: 'organization_id',
|
|
367
|
+
value: request.organizationId
|
|
357
368
|
}])
|
|
358
369
|
});
|
|
359
370
|
const marshalInstallServerRequest = (request, defaults) => ({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { API as API$1 } from '../../../scw/api.js';
|
|
2
2
|
import { urlParams, validatePathParam } from '../../../helpers/marshalling.js';
|
|
3
3
|
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
4
|
-
import { unmarshalGetConsumptionResponse, unmarshalListInvoicesResponse } from './marshalling.gen.js';
|
|
4
|
+
import { unmarshalGetConsumptionResponse, unmarshalListInvoicesResponse, unmarshalListDiscountsResponse } from './marshalling.gen.js';
|
|
5
5
|
|
|
6
6
|
// This file was automatically generated. DO NOT EDIT.
|
|
7
7
|
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
@@ -75,6 +75,37 @@ class API extends API$1 {
|
|
|
75
75
|
urlParams: urlParams(['dl', 1], ['file_type', request.fileType]),
|
|
76
76
|
responseType: 'blob'
|
|
77
77
|
});
|
|
78
|
+
pageOfListDiscounts = (() => {
|
|
79
|
+
var _this4 = this;
|
|
80
|
+
return function (request) {
|
|
81
|
+
if (request === void 0) {
|
|
82
|
+
request = {};
|
|
83
|
+
}
|
|
84
|
+
return _this4.client.fetch({
|
|
85
|
+
method: 'GET',
|
|
86
|
+
path: `/billing/v2alpha1/discounts`,
|
|
87
|
+
urlParams: urlParams(['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this4.client.settings.defaultPageSize])
|
|
88
|
+
}, unmarshalListDiscountsResponse);
|
|
89
|
+
};
|
|
90
|
+
})();
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* List all user's discounts. List all discounts for an organization and
|
|
94
|
+
* usable categories/products/offers/references/regions/zones where the
|
|
95
|
+
* discount can be applied.
|
|
96
|
+
*
|
|
97
|
+
* @param request - The request {@link ListDiscountsRequest}
|
|
98
|
+
* @returns A Promise of ListDiscountsResponse
|
|
99
|
+
*/
|
|
100
|
+
listDiscounts = (() => {
|
|
101
|
+
var _this5 = this;
|
|
102
|
+
return function (request) {
|
|
103
|
+
if (request === void 0) {
|
|
104
|
+
request = {};
|
|
105
|
+
}
|
|
106
|
+
return enrichForPagination('discounts', _this5.pageOfListDiscounts, request);
|
|
107
|
+
};
|
|
108
|
+
})();
|
|
78
109
|
}
|
|
79
110
|
|
|
80
111
|
export { API };
|
|
@@ -25,6 +25,51 @@ const unmarshalGetConsumptionResponse = data => {
|
|
|
25
25
|
updatedAt: unmarshalDate(data.updated_at)
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
+
const unmarshalDiscountCoupon = data => {
|
|
29
|
+
if (!isJSONObject(data)) {
|
|
30
|
+
throw new TypeError(`Unmarshalling the type 'DiscountCoupon' failed as data isn't a dictionary.`);
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
description: data.description
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
const unmarshalDiscountFilter = data => {
|
|
37
|
+
if (!isJSONObject(data)) {
|
|
38
|
+
throw new TypeError(`Unmarshalling the type 'DiscountFilter' failed as data isn't a dictionary.`);
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
type: data.type,
|
|
42
|
+
value: data.value
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
const unmarshalDiscount = data => {
|
|
46
|
+
if (!isJSONObject(data)) {
|
|
47
|
+
throw new TypeError(`Unmarshalling the type 'Discount' failed as data isn't a dictionary.`);
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
coupon: data.coupon ? unmarshalDiscountCoupon(data.coupon) : undefined,
|
|
51
|
+
creationDate: unmarshalDate(data.creation_date),
|
|
52
|
+
description: data.description,
|
|
53
|
+
filters: unmarshalArrayOfObject(data.filters, unmarshalDiscountFilter),
|
|
54
|
+
id: data.id,
|
|
55
|
+
mode: data.mode,
|
|
56
|
+
organizationId: data.organization_id,
|
|
57
|
+
startDate: unmarshalDate(data.start_date),
|
|
58
|
+
stopDate: unmarshalDate(data.stop_date),
|
|
59
|
+
value: data.value,
|
|
60
|
+
valueRemaining: data.value_remaining,
|
|
61
|
+
valueUsed: data.value_used
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
const unmarshalListDiscountsResponse = data => {
|
|
65
|
+
if (!isJSONObject(data)) {
|
|
66
|
+
throw new TypeError(`Unmarshalling the type 'ListDiscountsResponse' failed as data isn't a dictionary.`);
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
discounts: unmarshalArrayOfObject(data.discounts, unmarshalDiscount),
|
|
70
|
+
totalCount: data.total_count
|
|
71
|
+
};
|
|
72
|
+
};
|
|
28
73
|
const unmarshalInvoice = data => {
|
|
29
74
|
if (!isJSONObject(data)) {
|
|
30
75
|
throw new TypeError(`Unmarshalling the type 'Invoice' failed as data isn't a dictionary.`);
|
|
@@ -50,4 +95,4 @@ const unmarshalListInvoicesResponse = data => {
|
|
|
50
95
|
};
|
|
51
96
|
};
|
|
52
97
|
|
|
53
|
-
export { unmarshalGetConsumptionResponse, unmarshalListInvoicesResponse };
|
|
98
|
+
export { unmarshalGetConsumptionResponse, unmarshalListDiscountsResponse, unmarshalListInvoicesResponse };
|
|
@@ -3,7 +3,7 @@ import { API as API$1 } from '../../../scw/api.js';
|
|
|
3
3
|
import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
|
|
4
4
|
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
5
5
|
import { VOLUME_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES } from './content.gen.js';
|
|
6
|
-
import { unmarshalListVolumeTypesResponse, unmarshalListVolumesResponse, marshalCreateVolumeRequest, unmarshalVolume, marshalUpdateVolumeRequest, unmarshalListSnapshotsResponse, unmarshalSnapshot, marshalCreateSnapshotRequest, marshalUpdateSnapshotRequest } from './marshalling.gen.js';
|
|
6
|
+
import { unmarshalListVolumeTypesResponse, unmarshalListVolumesResponse, marshalCreateVolumeRequest, unmarshalVolume, marshalUpdateVolumeRequest, unmarshalListSnapshotsResponse, unmarshalSnapshot, marshalCreateSnapshotRequest, marshalImportSnapshotFromS3Request, marshalUpdateSnapshotRequest } from './marshalling.gen.js';
|
|
7
7
|
|
|
8
8
|
// This file was automatically generated. DO NOT EDIT.
|
|
9
9
|
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
@@ -12,10 +12,9 @@ const jsonContentHeaders = {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* Scaleway Block Storage
|
|
15
|
+
* Scaleway Block Storage API.
|
|
16
16
|
*
|
|
17
|
-
* This API allows you to use and manage your Block Storage volumes.
|
|
18
|
-
* Block Storage (SBS) API.
|
|
17
|
+
* This API allows you to use and manage your Block Storage volumes.
|
|
19
18
|
*/
|
|
20
19
|
class API extends API$1 {
|
|
21
20
|
/** Lists the available zones of the API. */
|
|
@@ -59,15 +58,15 @@ class API extends API$1 {
|
|
|
59
58
|
return _this3.client.fetch({
|
|
60
59
|
method: 'GET',
|
|
61
60
|
path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this3.client.settings.defaultZone)}/volumes`,
|
|
62
|
-
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy
|
|
61
|
+
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['product_resource_id', request.productResourceId], ['project_id', request.projectId])
|
|
63
62
|
}, unmarshalListVolumesResponse);
|
|
64
63
|
};
|
|
65
64
|
})();
|
|
66
65
|
|
|
67
66
|
/**
|
|
68
67
|
* List volumes. List all existing volumes in a specified zone. By default,
|
|
69
|
-
* the
|
|
70
|
-
* be modified via the `order_by` field.
|
|
68
|
+
* the volumes listed are ordered by creation date in ascending order. This
|
|
69
|
+
* can be modified via the `order_by` field.
|
|
71
70
|
*
|
|
72
71
|
* @param request - The request {@link ListVolumesRequest}
|
|
73
72
|
* @returns A Promise of ListVolumesResponse
|
|
@@ -83,13 +82,12 @@ class API extends API$1 {
|
|
|
83
82
|
})();
|
|
84
83
|
|
|
85
84
|
/**
|
|
86
|
-
* Create a
|
|
87
|
-
*
|
|
85
|
+
* Create a volume. To create a new volume from scratch, you must specify
|
|
86
|
+
* `from_empty` and the `size`. To create a volume from an existing snapshot,
|
|
87
|
+
* specify `from_snapshot` and the `snapshot_id` in the request payload
|
|
88
88
|
* instead, size is optional and can be specified if you need to extend the
|
|
89
|
-
* original size.
|
|
90
|
-
*
|
|
91
|
-
* can specify the desired performance of the volume by setting `requirements`
|
|
92
|
-
* accordingly.
|
|
89
|
+
* original size. The volume will take on the same volume class and underlying
|
|
90
|
+
* IOPS limitations as the original snapshot.
|
|
93
91
|
*
|
|
94
92
|
* @param request - The request {@link CreateVolumeRequest}
|
|
95
93
|
* @returns A Promise of Volume
|
|
@@ -134,10 +132,10 @@ class API extends API$1 {
|
|
|
134
132
|
});
|
|
135
133
|
|
|
136
134
|
/**
|
|
137
|
-
* Update a volume. Update technical details
|
|
138
|
-
* tags, or its new size and `volume_type` (within the same Block
|
|
139
|
-
* class). You can only resize a volume to a larger size. It is
|
|
140
|
-
*
|
|
135
|
+
* Update a volume. Update the technical details of a volume, such as its
|
|
136
|
+
* name, tags, or its new size and `volume_type` (within the same Block
|
|
137
|
+
* Storage class). You can only resize a volume to a larger size. It is
|
|
138
|
+
* currently not possible to change your Block Storage Class.
|
|
141
139
|
*
|
|
142
140
|
* @param request - The request {@link UpdateVolumeRequest}
|
|
143
141
|
* @returns A Promise of Volume
|
|
@@ -157,7 +155,7 @@ class API extends API$1 {
|
|
|
157
155
|
return _this5.client.fetch({
|
|
158
156
|
method: 'GET',
|
|
159
157
|
path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this5.client.settings.defaultZone)}/snapshots`,
|
|
160
|
-
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy
|
|
158
|
+
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this5.client.settings.defaultPageSize], ['project_id', request.projectId], ['volume_id', request.volumeId])
|
|
161
159
|
}, unmarshalListSnapshotsResponse);
|
|
162
160
|
};
|
|
163
161
|
})();
|
|
@@ -216,6 +214,12 @@ class API extends API$1 {
|
|
|
216
214
|
method: 'POST',
|
|
217
215
|
path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots`
|
|
218
216
|
}, unmarshalSnapshot);
|
|
217
|
+
importSnapshotFromS3 = request => this.client.fetch({
|
|
218
|
+
body: JSON.stringify(marshalImportSnapshotFromS3Request(request, this.client.settings)),
|
|
219
|
+
headers: jsonContentHeaders,
|
|
220
|
+
method: 'POST',
|
|
221
|
+
path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/import-from-s3`
|
|
222
|
+
}, unmarshalSnapshot);
|
|
219
223
|
|
|
220
224
|
/**
|
|
221
225
|
* Delete a snapshot. You must specify the `snapshot_id` of the snapshot you
|
|
@@ -229,7 +233,7 @@ class API extends API$1 {
|
|
|
229
233
|
});
|
|
230
234
|
|
|
231
235
|
/**
|
|
232
|
-
* Update a snapshot. Update name or tags of the snapshot.
|
|
236
|
+
* Update a snapshot. Update the name or tags of the snapshot.
|
|
233
237
|
*
|
|
234
238
|
* @param request - The request {@link UpdateSnapshotRequest}
|
|
235
239
|
* @returns A Promise of Snapshot
|
|
@@ -17,17 +17,6 @@ const unmarshalReference = data => {
|
|
|
17
17
|
type: data.type
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
const unmarshalSnapshotParentVolume = data => {
|
|
21
|
-
if (!isJSONObject(data)) {
|
|
22
|
-
throw new TypeError(`Unmarshalling the type 'SnapshotParentVolume' failed as data isn't a dictionary.`);
|
|
23
|
-
}
|
|
24
|
-
return {
|
|
25
|
-
id: data.id,
|
|
26
|
-
name: data.name,
|
|
27
|
-
status: data.status,
|
|
28
|
-
type: data.type
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
20
|
const unmarshalVolumeSpecifications = data => {
|
|
32
21
|
if (!isJSONObject(data)) {
|
|
33
22
|
throw new TypeError(`Unmarshalling the type 'VolumeSpecifications' failed as data isn't a dictionary.`);
|
|
@@ -37,44 +26,64 @@ const unmarshalVolumeSpecifications = data => {
|
|
|
37
26
|
perfIops: data.perf_iops
|
|
38
27
|
};
|
|
39
28
|
};
|
|
40
|
-
const
|
|
29
|
+
const unmarshalVolume = data => {
|
|
41
30
|
if (!isJSONObject(data)) {
|
|
42
|
-
throw new TypeError(`Unmarshalling the type '
|
|
31
|
+
throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);
|
|
43
32
|
}
|
|
44
33
|
return {
|
|
45
|
-
class: data.class,
|
|
46
34
|
createdAt: unmarshalDate(data.created_at),
|
|
47
35
|
id: data.id,
|
|
48
36
|
name: data.name,
|
|
49
|
-
|
|
37
|
+
parentSnapshotId: data.parent_snapshot_id,
|
|
50
38
|
projectId: data.project_id,
|
|
39
|
+
references: unmarshalArrayOfObject(data.references, unmarshalReference),
|
|
51
40
|
size: data.size,
|
|
41
|
+
specs: data.specs ? unmarshalVolumeSpecifications(data.specs) : undefined,
|
|
52
42
|
status: data.status,
|
|
53
43
|
tags: data.tags,
|
|
44
|
+
type: data.type,
|
|
54
45
|
updatedAt: unmarshalDate(data.updated_at),
|
|
55
46
|
zone: data.zone
|
|
56
47
|
};
|
|
57
48
|
};
|
|
58
|
-
const
|
|
49
|
+
const unmarshalSnapshotParentVolume = data => {
|
|
59
50
|
if (!isJSONObject(data)) {
|
|
60
|
-
throw new TypeError(`Unmarshalling the type '
|
|
51
|
+
throw new TypeError(`Unmarshalling the type 'SnapshotParentVolume' failed as data isn't a dictionary.`);
|
|
61
52
|
}
|
|
62
53
|
return {
|
|
54
|
+
id: data.id,
|
|
55
|
+
name: data.name,
|
|
56
|
+
status: data.status,
|
|
57
|
+
type: data.type
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
const unmarshalSnapshotSummary = data => {
|
|
61
|
+
if (!isJSONObject(data)) {
|
|
62
|
+
throw new TypeError(`Unmarshalling the type 'SnapshotSummary' failed as data isn't a dictionary.`);
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
class: data.class,
|
|
63
66
|
createdAt: unmarshalDate(data.created_at),
|
|
64
67
|
id: data.id,
|
|
65
68
|
name: data.name,
|
|
66
|
-
|
|
69
|
+
parentVolume: data.parent_volume ? unmarshalSnapshotParentVolume(data.parent_volume) : undefined,
|
|
67
70
|
projectId: data.project_id,
|
|
68
|
-
references: unmarshalArrayOfObject(data.references, unmarshalReference),
|
|
69
71
|
size: data.size,
|
|
70
|
-
specs: data.specs ? unmarshalVolumeSpecifications(data.specs) : undefined,
|
|
71
72
|
status: data.status,
|
|
72
73
|
tags: data.tags,
|
|
73
|
-
type: data.type,
|
|
74
74
|
updatedAt: unmarshalDate(data.updated_at),
|
|
75
75
|
zone: data.zone
|
|
76
76
|
};
|
|
77
77
|
};
|
|
78
|
+
const unmarshalListSnapshotsResponse = data => {
|
|
79
|
+
if (!isJSONObject(data)) {
|
|
80
|
+
throw new TypeError(`Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`);
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshotSummary),
|
|
84
|
+
totalCount: data.total_count
|
|
85
|
+
};
|
|
86
|
+
};
|
|
78
87
|
const unmarshalVolumeType = data => {
|
|
79
88
|
if (!isJSONObject(data)) {
|
|
80
89
|
throw new TypeError(`Unmarshalling the type 'VolumeType' failed as data isn't a dictionary.`);
|
|
@@ -86,15 +95,6 @@ const unmarshalVolumeType = data => {
|
|
|
86
95
|
type: data.type
|
|
87
96
|
};
|
|
88
97
|
};
|
|
89
|
-
const unmarshalListSnapshotsResponse = data => {
|
|
90
|
-
if (!isJSONObject(data)) {
|
|
91
|
-
throw new TypeError(`Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`);
|
|
92
|
-
}
|
|
93
|
-
return {
|
|
94
|
-
snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshotSummary),
|
|
95
|
-
totalCount: data.total_count
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
98
|
const unmarshalListVolumeTypesResponse = data => {
|
|
99
99
|
if (!isJSONObject(data)) {
|
|
100
100
|
throw new TypeError(`Unmarshalling the type 'ListVolumeTypesResponse' failed as data isn't a dictionary.`);
|
|
@@ -132,6 +132,12 @@ const unmarshalSnapshot = data => {
|
|
|
132
132
|
zone: data.zone
|
|
133
133
|
};
|
|
134
134
|
};
|
|
135
|
+
const marshalCreateSnapshotRequest = (request, defaults) => ({
|
|
136
|
+
name: request.name,
|
|
137
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
138
|
+
tags: request.tags,
|
|
139
|
+
volume_id: request.volumeId
|
|
140
|
+
});
|
|
135
141
|
const marshalCreateVolumeRequestFromEmpty = (request, defaults) => ({
|
|
136
142
|
size: request.size
|
|
137
143
|
});
|
|
@@ -139,27 +145,28 @@ const marshalCreateVolumeRequestFromSnapshot = (request, defaults) => ({
|
|
|
139
145
|
size: request.size,
|
|
140
146
|
snapshot_id: request.snapshotId
|
|
141
147
|
});
|
|
142
|
-
const marshalCreateSnapshotRequest = (request, defaults) => ({
|
|
143
|
-
name: request.name,
|
|
144
|
-
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
145
|
-
tags: request.tags,
|
|
146
|
-
volume_id: request.volumeId
|
|
147
|
-
});
|
|
148
148
|
const marshalCreateVolumeRequest = (request, defaults) => ({
|
|
149
149
|
name: request.name,
|
|
150
150
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
151
151
|
tags: request.tags,
|
|
152
152
|
...resolveOneOf([{
|
|
153
153
|
param: 'from_empty',
|
|
154
|
-
value: request.fromEmpty ? marshalCreateVolumeRequestFromEmpty(request.fromEmpty) : undefined
|
|
154
|
+
value: request.fromEmpty !== undefined ? marshalCreateVolumeRequestFromEmpty(request.fromEmpty) : undefined
|
|
155
155
|
}, {
|
|
156
156
|
param: 'from_snapshot',
|
|
157
|
-
value: request.fromSnapshot ? marshalCreateVolumeRequestFromSnapshot(request.fromSnapshot) : undefined
|
|
157
|
+
value: request.fromSnapshot !== undefined ? marshalCreateVolumeRequestFromSnapshot(request.fromSnapshot) : undefined
|
|
158
158
|
}]),
|
|
159
159
|
...resolveOneOf([{
|
|
160
160
|
param: 'perf_iops',
|
|
161
161
|
value: request.perfIops
|
|
162
|
-
}]
|
|
162
|
+
}])
|
|
163
|
+
});
|
|
164
|
+
const marshalImportSnapshotFromS3Request = (request, defaults) => ({
|
|
165
|
+
bucket: request.bucket,
|
|
166
|
+
key: request.key,
|
|
167
|
+
name: request.name,
|
|
168
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
169
|
+
tags: request.tags
|
|
163
170
|
});
|
|
164
171
|
const marshalUpdateSnapshotRequest = (request, defaults) => ({
|
|
165
172
|
name: request.name,
|
|
@@ -172,4 +179,4 @@ const marshalUpdateVolumeRequest = (request, defaults) => ({
|
|
|
172
179
|
tags: request.tags
|
|
173
180
|
});
|
|
174
181
|
|
|
175
|
-
export { marshalCreateSnapshotRequest, marshalCreateVolumeRequest, marshalUpdateSnapshotRequest, marshalUpdateVolumeRequest, unmarshalListSnapshotsResponse, unmarshalListVolumeTypesResponse, unmarshalListVolumesResponse, unmarshalSnapshot, unmarshalVolume };
|
|
182
|
+
export { marshalCreateSnapshotRequest, marshalCreateVolumeRequest, marshalImportSnapshotFromS3Request, marshalUpdateSnapshotRequest, marshalUpdateVolumeRequest, unmarshalListSnapshotsResponse, unmarshalListVolumeTypesResponse, unmarshalListVolumesResponse, unmarshalReference, unmarshalSnapshot, unmarshalVolume };
|
|
@@ -11,6 +11,11 @@ const CreateVolumeRequest = {
|
|
|
11
11
|
minLength: 1
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
|
+
const ImportSnapshotFromS3Request = {
|
|
15
|
+
name: {
|
|
16
|
+
minLength: 1
|
|
17
|
+
}
|
|
18
|
+
};
|
|
14
19
|
const ListSnapshotsRequest = {
|
|
15
20
|
page: {
|
|
16
21
|
greaterThan: 0
|
|
@@ -38,5 +43,10 @@ const ListVolumesRequest = {
|
|
|
38
43
|
lessThanOrEqual: 100
|
|
39
44
|
}
|
|
40
45
|
};
|
|
46
|
+
const Reference = {
|
|
47
|
+
productResourceType: {
|
|
48
|
+
minLength: 1
|
|
49
|
+
}
|
|
50
|
+
};
|
|
41
51
|
|
|
42
|
-
export { CreateSnapshotRequest, CreateVolumeRequest, ListSnapshotsRequest, ListVolumeTypesRequest, ListVolumesRequest };
|
|
52
|
+
export { CreateSnapshotRequest, CreateVolumeRequest, ImportSnapshotFromS3Request, ListSnapshotsRequest, ListVolumeTypesRequest, ListVolumesRequest, Reference };
|