@scaleway/sdk-baremetal 2.2.1 → 2.3.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/_virtual/_rolldown/runtime.js +11 -0
- package/dist/index.gen.js +3 -6
- package/dist/v1/api.gen.js +400 -569
- package/dist/v1/content.gen.js +13 -20
- package/dist/v1/index.gen.js +43 -41
- package/dist/v1/marshalling.gen.js +428 -653
- package/dist/v1/validation-rules.gen.js +58 -96
- package/dist/v3/api.gen.js +65 -92
- package/dist/v3/content.gen.js +3 -7
- package/dist/v3/index.gen.js +12 -10
- package/dist/v3/marshalling.gen.js +24 -46
- package/package.json +4 -4
|
@@ -1,709 +1,484 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
device: data.device,
|
|
48
|
-
format: data.format,
|
|
49
|
-
mountpoint: data.mountpoint
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
const unmarshalSchemaRAID = (data) => {
|
|
53
|
-
if (!isJSONObject(data)) {
|
|
54
|
-
throw new TypeError(
|
|
55
|
-
`Unmarshalling the type 'SchemaRAID' failed as data isn't a dictionary.`
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
return {
|
|
59
|
-
devices: data.devices,
|
|
60
|
-
level: data.level,
|
|
61
|
-
name: data.name
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
const unmarshalSchemaZFS = (data) => {
|
|
65
|
-
if (!isJSONObject(data)) {
|
|
66
|
-
throw new TypeError(
|
|
67
|
-
`Unmarshalling the type 'SchemaZFS' failed as data isn't a dictionary.`
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
return {
|
|
71
|
-
pools: unmarshalArrayOfObject(data.pools, unmarshalSchemaPool)
|
|
72
|
-
};
|
|
1
|
+
import { isJSONObject, marshalBlobToScwFile, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalMoney, unmarshalTimeSeries } from "@scaleway/sdk-client";
|
|
2
|
+
var unmarshalSchemaPartition = (data) => {
|
|
3
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SchemaPartition' failed as data isn't a dictionary.`);
|
|
4
|
+
return {
|
|
5
|
+
label: data.label,
|
|
6
|
+
number: data.number,
|
|
7
|
+
size: data.size,
|
|
8
|
+
useAllAvailableSpace: data.use_all_available_space
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
var unmarshalSchemaPool = (data) => {
|
|
12
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SchemaPool' failed as data isn't a dictionary.`);
|
|
13
|
+
return {
|
|
14
|
+
devices: data.devices,
|
|
15
|
+
filesystemOptions: data.filesystem_options,
|
|
16
|
+
name: data.name,
|
|
17
|
+
options: data.options,
|
|
18
|
+
type: data.type
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
var unmarshalSchemaDisk = (data) => {
|
|
22
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SchemaDisk' failed as data isn't a dictionary.`);
|
|
23
|
+
return {
|
|
24
|
+
device: data.device,
|
|
25
|
+
partitions: unmarshalArrayOfObject(data.partitions, unmarshalSchemaPartition)
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
var unmarshalSchemaFilesystem = (data) => {
|
|
29
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SchemaFilesystem' failed as data isn't a dictionary.`);
|
|
30
|
+
return {
|
|
31
|
+
device: data.device,
|
|
32
|
+
format: data.format,
|
|
33
|
+
mountpoint: data.mountpoint
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
var unmarshalSchemaRAID = (data) => {
|
|
37
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SchemaRAID' failed as data isn't a dictionary.`);
|
|
38
|
+
return {
|
|
39
|
+
devices: data.devices,
|
|
40
|
+
level: data.level,
|
|
41
|
+
name: data.name
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
var unmarshalSchemaZFS = (data) => {
|
|
45
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SchemaZFS' failed as data isn't a dictionary.`);
|
|
46
|
+
return { pools: unmarshalArrayOfObject(data.pools, unmarshalSchemaPool) };
|
|
73
47
|
};
|
|
74
48
|
const unmarshalSchema = (data) => {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
filesystems: unmarshalArrayOfObject(data.filesystems, unmarshalSchemaFilesystem),
|
|
83
|
-
raids: unmarshalArrayOfObject(data.raids, unmarshalSchemaRAID),
|
|
84
|
-
zfs: data.zfs ? unmarshalSchemaZFS(data.zfs) : void 0
|
|
85
|
-
};
|
|
49
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Schema' failed as data isn't a dictionary.`);
|
|
50
|
+
return {
|
|
51
|
+
disks: unmarshalArrayOfObject(data.disks, unmarshalSchemaDisk),
|
|
52
|
+
filesystems: unmarshalArrayOfObject(data.filesystems, unmarshalSchemaFilesystem),
|
|
53
|
+
raids: unmarshalArrayOfObject(data.raids, unmarshalSchemaRAID),
|
|
54
|
+
zfs: data.zfs ? unmarshalSchemaZFS(data.zfs) : void 0
|
|
55
|
+
};
|
|
86
56
|
};
|
|
87
57
|
const unmarshalIP = (data) => {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
return {
|
|
155
|
-
hostname: data.hostname,
|
|
156
|
-
osId: data.os_id,
|
|
157
|
-
partitioningSchema: data.partitioning_schema ? unmarshalSchema(data.partitioning_schema) : void 0,
|
|
158
|
-
serviceUrl: data.service_url,
|
|
159
|
-
serviceUser: data.service_user,
|
|
160
|
-
sshKeyIds: data.ssh_key_ids,
|
|
161
|
-
status: data.status,
|
|
162
|
-
user: data.user
|
|
163
|
-
};
|
|
164
|
-
};
|
|
165
|
-
const unmarshalServerOption = (data) => {
|
|
166
|
-
if (!isJSONObject(data)) {
|
|
167
|
-
throw new TypeError(
|
|
168
|
-
`Unmarshalling the type 'ServerOption' failed as data isn't a dictionary.`
|
|
169
|
-
);
|
|
170
|
-
}
|
|
171
|
-
return {
|
|
172
|
-
certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0,
|
|
173
|
-
expiresAt: unmarshalDate(data.expires_at),
|
|
174
|
-
id: data.id,
|
|
175
|
-
license: data.license ? unmarshalLicenseOption(data.license) : void 0,
|
|
176
|
-
manageable: data.manageable,
|
|
177
|
-
name: data.name,
|
|
178
|
-
privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0,
|
|
179
|
-
publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0,
|
|
180
|
-
remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0,
|
|
181
|
-
status: data.status
|
|
182
|
-
};
|
|
183
|
-
};
|
|
184
|
-
const unmarshalServerRescueServer = (data) => {
|
|
185
|
-
if (!isJSONObject(data)) {
|
|
186
|
-
throw new TypeError(
|
|
187
|
-
`Unmarshalling the type 'ServerRescueServer' failed as data isn't a dictionary.`
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
return {
|
|
191
|
-
password: data.password,
|
|
192
|
-
user: data.user
|
|
193
|
-
};
|
|
58
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'IP' failed as data isn't a dictionary.`);
|
|
59
|
+
return {
|
|
60
|
+
address: data.address,
|
|
61
|
+
id: data.id,
|
|
62
|
+
reverse: data.reverse,
|
|
63
|
+
reverseStatus: data.reverse_status,
|
|
64
|
+
reverseStatusMessage: data.reverse_status_message,
|
|
65
|
+
version: data.version
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
var unmarshalCertificationOption = (data) => {
|
|
69
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CertificationOption' failed as data isn't a dictionary.`);
|
|
70
|
+
return {};
|
|
71
|
+
};
|
|
72
|
+
var unmarshalLicenseOption = (data) => {
|
|
73
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'LicenseOption' failed as data isn't a dictionary.`);
|
|
74
|
+
return { osId: data.os_id };
|
|
75
|
+
};
|
|
76
|
+
var unmarshalPrivateNetworkOption = (data) => {
|
|
77
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PrivateNetworkOption' failed as data isn't a dictionary.`);
|
|
78
|
+
return { bandwidthInBps: data.bandwidth_in_bps };
|
|
79
|
+
};
|
|
80
|
+
var unmarshalPublicBandwidthOption = (data) => {
|
|
81
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PublicBandwidthOption' failed as data isn't a dictionary.`);
|
|
82
|
+
return { bandwidthInBps: data.bandwidth_in_bps };
|
|
83
|
+
};
|
|
84
|
+
var unmarshalRemoteAccessOption = (data) => {
|
|
85
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'RemoteAccessOption' failed as data isn't a dictionary.`);
|
|
86
|
+
return {};
|
|
87
|
+
};
|
|
88
|
+
var unmarshalServerInstall = (data) => {
|
|
89
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerInstall' failed as data isn't a dictionary.`);
|
|
90
|
+
return {
|
|
91
|
+
hostname: data.hostname,
|
|
92
|
+
osId: data.os_id,
|
|
93
|
+
partitioningSchema: data.partitioning_schema ? unmarshalSchema(data.partitioning_schema) : void 0,
|
|
94
|
+
serviceUrl: data.service_url,
|
|
95
|
+
serviceUser: data.service_user,
|
|
96
|
+
sshKeyIds: data.ssh_key_ids,
|
|
97
|
+
status: data.status,
|
|
98
|
+
user: data.user
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
var unmarshalServerOption = (data) => {
|
|
102
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerOption' failed as data isn't a dictionary.`);
|
|
103
|
+
return {
|
|
104
|
+
certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0,
|
|
105
|
+
expiresAt: unmarshalDate(data.expires_at),
|
|
106
|
+
id: data.id,
|
|
107
|
+
license: data.license ? unmarshalLicenseOption(data.license) : void 0,
|
|
108
|
+
manageable: data.manageable,
|
|
109
|
+
name: data.name,
|
|
110
|
+
privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0,
|
|
111
|
+
publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0,
|
|
112
|
+
remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0,
|
|
113
|
+
status: data.status
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
var unmarshalServerRescueServer = (data) => {
|
|
117
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerRescueServer' failed as data isn't a dictionary.`);
|
|
118
|
+
return {
|
|
119
|
+
password: data.password,
|
|
120
|
+
user: data.user
|
|
121
|
+
};
|
|
194
122
|
};
|
|
195
123
|
const unmarshalServer = (data) => {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
`Unmarshalling the type 'OSOSField' failed as data isn't a dictionary.`
|
|
229
|
-
);
|
|
230
|
-
}
|
|
231
|
-
return {
|
|
232
|
-
defaultValue: data.default_value,
|
|
233
|
-
editable: data.editable,
|
|
234
|
-
required: data.required
|
|
235
|
-
};
|
|
124
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Server' failed as data isn't a dictionary.`);
|
|
125
|
+
return {
|
|
126
|
+
bootType: data.boot_type,
|
|
127
|
+
createdAt: unmarshalDate(data.created_at),
|
|
128
|
+
description: data.description,
|
|
129
|
+
domain: data.domain,
|
|
130
|
+
id: data.id,
|
|
131
|
+
install: data.install ? unmarshalServerInstall(data.install) : void 0,
|
|
132
|
+
ips: unmarshalArrayOfObject(data.ips, unmarshalIP),
|
|
133
|
+
name: data.name,
|
|
134
|
+
offerId: data.offer_id,
|
|
135
|
+
offerName: data.offer_name,
|
|
136
|
+
options: unmarshalArrayOfObject(data.options, unmarshalServerOption),
|
|
137
|
+
organizationId: data.organization_id,
|
|
138
|
+
pingStatus: data.ping_status,
|
|
139
|
+
projectId: data.project_id,
|
|
140
|
+
protected: data.protected,
|
|
141
|
+
rescueServer: data.rescue_server ? unmarshalServerRescueServer(data.rescue_server) : void 0,
|
|
142
|
+
status: data.status,
|
|
143
|
+
tags: data.tags,
|
|
144
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
145
|
+
userData: data.user_data,
|
|
146
|
+
zone: data.zone
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
var unmarshalOSOSField = (data) => {
|
|
150
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'OSOSField' failed as data isn't a dictionary.`);
|
|
151
|
+
return {
|
|
152
|
+
defaultValue: data.default_value,
|
|
153
|
+
editable: data.editable,
|
|
154
|
+
required: data.required
|
|
155
|
+
};
|
|
236
156
|
};
|
|
237
157
|
const unmarshalOS = (data) => {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
manageable: data.manageable,
|
|
323
|
-
name: data.name,
|
|
324
|
-
osId: data.os_id,
|
|
325
|
-
price: data.price ? unmarshalMoney(data.price) : void 0,
|
|
326
|
-
privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0,
|
|
327
|
-
publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0,
|
|
328
|
-
remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0,
|
|
329
|
-
subscriptionPeriod: data.subscription_period
|
|
330
|
-
};
|
|
331
|
-
};
|
|
332
|
-
const unmarshalPersistentMemory = (data) => {
|
|
333
|
-
if (!isJSONObject(data)) {
|
|
334
|
-
throw new TypeError(
|
|
335
|
-
`Unmarshalling the type 'PersistentMemory' failed as data isn't a dictionary.`
|
|
336
|
-
);
|
|
337
|
-
}
|
|
338
|
-
return {
|
|
339
|
-
capacity: data.capacity,
|
|
340
|
-
frequency: data.frequency,
|
|
341
|
-
type: data.type
|
|
342
|
-
};
|
|
343
|
-
};
|
|
344
|
-
const unmarshalRaidController = (data) => {
|
|
345
|
-
if (!isJSONObject(data)) {
|
|
346
|
-
throw new TypeError(
|
|
347
|
-
`Unmarshalling the type 'RaidController' failed as data isn't a dictionary.`
|
|
348
|
-
);
|
|
349
|
-
}
|
|
350
|
-
return {
|
|
351
|
-
model: data.model,
|
|
352
|
-
raidLevel: data.raid_level
|
|
353
|
-
};
|
|
158
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'OS' failed as data isn't a dictionary.`);
|
|
159
|
+
return {
|
|
160
|
+
allowed: data.allowed,
|
|
161
|
+
cloudInitSupported: data.cloud_init_supported,
|
|
162
|
+
cloudInitVersion: data.cloud_init_version,
|
|
163
|
+
customPartitioningSupported: data.custom_partitioning_supported,
|
|
164
|
+
enabled: data.enabled,
|
|
165
|
+
id: data.id,
|
|
166
|
+
licenseRequired: data.license_required,
|
|
167
|
+
logoUrl: data.logo_url,
|
|
168
|
+
name: data.name,
|
|
169
|
+
password: data.password ? unmarshalOSOSField(data.password) : void 0,
|
|
170
|
+
servicePassword: data.service_password ? unmarshalOSOSField(data.service_password) : void 0,
|
|
171
|
+
serviceUser: data.service_user ? unmarshalOSOSField(data.service_user) : void 0,
|
|
172
|
+
ssh: data.ssh ? unmarshalOSOSField(data.ssh) : void 0,
|
|
173
|
+
user: data.user ? unmarshalOSOSField(data.user) : void 0,
|
|
174
|
+
version: data.version,
|
|
175
|
+
zone: data.zone
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
var unmarshalCPU = (data) => {
|
|
179
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CPU' failed as data isn't a dictionary.`);
|
|
180
|
+
return {
|
|
181
|
+
benchmark: data.benchmark,
|
|
182
|
+
coreCount: data.core_count,
|
|
183
|
+
frequency: data.frequency,
|
|
184
|
+
name: data.name,
|
|
185
|
+
threadCount: data.thread_count
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
var unmarshalDisk = (data) => {
|
|
189
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Disk' failed as data isn't a dictionary.`);
|
|
190
|
+
return {
|
|
191
|
+
capacity: data.capacity,
|
|
192
|
+
type: data.type
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
var unmarshalGPU = (data) => {
|
|
196
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GPU' failed as data isn't a dictionary.`);
|
|
197
|
+
return {
|
|
198
|
+
name: data.name,
|
|
199
|
+
vram: data.vram
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
var unmarshalMemory = (data) => {
|
|
203
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Memory' failed as data isn't a dictionary.`);
|
|
204
|
+
return {
|
|
205
|
+
capacity: data.capacity,
|
|
206
|
+
frequency: data.frequency,
|
|
207
|
+
isEcc: data.is_ecc,
|
|
208
|
+
type: data.type
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
var unmarshalOfferOptionOffer = (data) => {
|
|
212
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'OfferOptionOffer' failed as data isn't a dictionary.`);
|
|
213
|
+
return {
|
|
214
|
+
certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0,
|
|
215
|
+
enabled: data.enabled,
|
|
216
|
+
id: data.id,
|
|
217
|
+
license: data.license ? unmarshalLicenseOption(data.license) : void 0,
|
|
218
|
+
manageable: data.manageable,
|
|
219
|
+
name: data.name,
|
|
220
|
+
osId: data.os_id,
|
|
221
|
+
price: data.price ? unmarshalMoney(data.price) : void 0,
|
|
222
|
+
privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0,
|
|
223
|
+
publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0,
|
|
224
|
+
remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0,
|
|
225
|
+
subscriptionPeriod: data.subscription_period
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
var unmarshalPersistentMemory = (data) => {
|
|
229
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PersistentMemory' failed as data isn't a dictionary.`);
|
|
230
|
+
return {
|
|
231
|
+
capacity: data.capacity,
|
|
232
|
+
frequency: data.frequency,
|
|
233
|
+
type: data.type
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
var unmarshalRaidController = (data) => {
|
|
237
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'RaidController' failed as data isn't a dictionary.`);
|
|
238
|
+
return {
|
|
239
|
+
model: data.model,
|
|
240
|
+
raidLevel: data.raid_level
|
|
241
|
+
};
|
|
354
242
|
};
|
|
355
243
|
const unmarshalOffer = (data) => {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
subscriptionPeriod: data.subscription_period,
|
|
386
|
-
tags: data.tags,
|
|
387
|
-
zone: data.zone
|
|
388
|
-
};
|
|
244
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Offer' failed as data isn't a dictionary.`);
|
|
245
|
+
return {
|
|
246
|
+
bandwidth: data.bandwidth,
|
|
247
|
+
commercialRange: data.commercial_range,
|
|
248
|
+
cpus: unmarshalArrayOfObject(data.cpus, unmarshalCPU),
|
|
249
|
+
disks: unmarshalArrayOfObject(data.disks, unmarshalDisk),
|
|
250
|
+
enable: data.enable,
|
|
251
|
+
fee: data.fee ? unmarshalMoney(data.fee) : void 0,
|
|
252
|
+
gpus: unmarshalArrayOfObject(data.gpus, unmarshalGPU),
|
|
253
|
+
id: data.id,
|
|
254
|
+
incompatibleOsIds: data.incompatible_os_ids,
|
|
255
|
+
maxBandwidth: data.max_bandwidth,
|
|
256
|
+
memories: unmarshalArrayOfObject(data.memories, unmarshalMemory),
|
|
257
|
+
monthlyOfferId: data.monthly_offer_id,
|
|
258
|
+
name: data.name,
|
|
259
|
+
operationPath: data.operation_path,
|
|
260
|
+
options: unmarshalArrayOfObject(data.options, unmarshalOfferOptionOffer),
|
|
261
|
+
persistentMemories: unmarshalArrayOfObject(data.persistent_memories, unmarshalPersistentMemory),
|
|
262
|
+
pricePerHour: data.price_per_hour ? unmarshalMoney(data.price_per_hour) : void 0,
|
|
263
|
+
pricePerMonth: data.price_per_month ? unmarshalMoney(data.price_per_month) : void 0,
|
|
264
|
+
privateBandwidth: data.private_bandwidth,
|
|
265
|
+
quotaName: data.quota_name,
|
|
266
|
+
raidControllers: unmarshalArrayOfObject(data.raid_controllers, unmarshalRaidController),
|
|
267
|
+
sharedBandwidth: data.shared_bandwidth,
|
|
268
|
+
stock: data.stock,
|
|
269
|
+
subscriptionPeriod: data.subscription_period,
|
|
270
|
+
tags: data.tags,
|
|
271
|
+
zone: data.zone
|
|
272
|
+
};
|
|
389
273
|
};
|
|
390
274
|
const unmarshalOption = (data) => {
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0,
|
|
403
|
-
publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0,
|
|
404
|
-
remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0
|
|
405
|
-
};
|
|
275
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Option' failed as data isn't a dictionary.`);
|
|
276
|
+
return {
|
|
277
|
+
certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0,
|
|
278
|
+
id: data.id,
|
|
279
|
+
license: data.license ? unmarshalLicenseOption(data.license) : void 0,
|
|
280
|
+
manageable: data.manageable,
|
|
281
|
+
name: data.name,
|
|
282
|
+
privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0,
|
|
283
|
+
publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0,
|
|
284
|
+
remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0
|
|
285
|
+
};
|
|
406
286
|
};
|
|
407
287
|
const unmarshalServerPrivateNetwork = (data) => {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
status: data.status,
|
|
420
|
-
updatedAt: unmarshalDate(data.updated_at),
|
|
421
|
-
vlan: data.vlan
|
|
422
|
-
};
|
|
288
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerPrivateNetwork' failed as data isn't a dictionary.`);
|
|
289
|
+
return {
|
|
290
|
+
createdAt: unmarshalDate(data.created_at),
|
|
291
|
+
id: data.id,
|
|
292
|
+
privateNetworkId: data.private_network_id,
|
|
293
|
+
projectId: data.project_id,
|
|
294
|
+
serverId: data.server_id,
|
|
295
|
+
status: data.status,
|
|
296
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
297
|
+
vlan: data.vlan
|
|
298
|
+
};
|
|
423
299
|
};
|
|
424
300
|
const unmarshalSetting = (data) => {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
id: data.id,
|
|
433
|
-
projectId: data.project_id,
|
|
434
|
-
type: data.type
|
|
435
|
-
};
|
|
301
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Setting' failed as data isn't a dictionary.`);
|
|
302
|
+
return {
|
|
303
|
+
enabled: data.enabled,
|
|
304
|
+
id: data.id,
|
|
305
|
+
projectId: data.project_id,
|
|
306
|
+
type: data.type
|
|
307
|
+
};
|
|
436
308
|
};
|
|
437
309
|
const unmarshalBMCAccess = (data) => {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
login: data.login,
|
|
446
|
-
password: data.password,
|
|
447
|
-
url: data.url
|
|
448
|
-
};
|
|
310
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'BMCAccess' failed as data isn't a dictionary.`);
|
|
311
|
+
return {
|
|
312
|
+
expiresAt: unmarshalDate(data.expires_at),
|
|
313
|
+
login: data.login,
|
|
314
|
+
password: data.password,
|
|
315
|
+
url: data.url
|
|
316
|
+
};
|
|
449
317
|
};
|
|
450
318
|
const unmarshalGetServerMetricsResponse = (data) => {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
`Unmarshalling the type 'GetServerMetricsResponse' failed as data isn't a dictionary.`
|
|
454
|
-
);
|
|
455
|
-
}
|
|
456
|
-
return {
|
|
457
|
-
pings: data.pings ? unmarshalTimeSeries(data.pings) : void 0
|
|
458
|
-
};
|
|
319
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetServerMetricsResponse' failed as data isn't a dictionary.`);
|
|
320
|
+
return { pings: data.pings ? unmarshalTimeSeries(data.pings) : void 0 };
|
|
459
321
|
};
|
|
460
322
|
const unmarshalListOSResponse = (data) => {
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
return {
|
|
467
|
-
os: unmarshalArrayOfObject(data.os, unmarshalOS),
|
|
468
|
-
totalCount: data.total_count
|
|
469
|
-
};
|
|
323
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary.`);
|
|
324
|
+
return {
|
|
325
|
+
os: unmarshalArrayOfObject(data.os, unmarshalOS),
|
|
326
|
+
totalCount: data.total_count
|
|
327
|
+
};
|
|
470
328
|
};
|
|
471
329
|
const unmarshalListOffersResponse = (data) => {
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
return {
|
|
478
|
-
offers: unmarshalArrayOfObject(data.offers, unmarshalOffer),
|
|
479
|
-
totalCount: data.total_count
|
|
480
|
-
};
|
|
330
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`);
|
|
331
|
+
return {
|
|
332
|
+
offers: unmarshalArrayOfObject(data.offers, unmarshalOffer),
|
|
333
|
+
totalCount: data.total_count
|
|
334
|
+
};
|
|
481
335
|
};
|
|
482
336
|
const unmarshalListOptionsResponse = (data) => {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
);
|
|
498
|
-
}
|
|
499
|
-
return {
|
|
500
|
-
action: data.action,
|
|
501
|
-
createdAt: unmarshalDate(data.created_at),
|
|
502
|
-
id: data.id,
|
|
503
|
-
updatedAt: unmarshalDate(data.updated_at)
|
|
504
|
-
};
|
|
337
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListOptionsResponse' failed as data isn't a dictionary.`);
|
|
338
|
+
return {
|
|
339
|
+
options: unmarshalArrayOfObject(data.options, unmarshalOption),
|
|
340
|
+
totalCount: data.total_count
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
var unmarshalServerEvent = (data) => {
|
|
344
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerEvent' failed as data isn't a dictionary.`);
|
|
345
|
+
return {
|
|
346
|
+
action: data.action,
|
|
347
|
+
createdAt: unmarshalDate(data.created_at),
|
|
348
|
+
id: data.id,
|
|
349
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
350
|
+
};
|
|
505
351
|
};
|
|
506
352
|
const unmarshalListServerEventsResponse = (data) => {
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
return {
|
|
513
|
-
events: unmarshalArrayOfObject(data.events, unmarshalServerEvent),
|
|
514
|
-
totalCount: data.total_count
|
|
515
|
-
};
|
|
353
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListServerEventsResponse' failed as data isn't a dictionary.`);
|
|
354
|
+
return {
|
|
355
|
+
events: unmarshalArrayOfObject(data.events, unmarshalServerEvent),
|
|
356
|
+
totalCount: data.total_count
|
|
357
|
+
};
|
|
516
358
|
};
|
|
517
359
|
const unmarshalListServerPrivateNetworksResponse = (data) => {
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
return {
|
|
524
|
-
serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork),
|
|
525
|
-
totalCount: data.total_count
|
|
526
|
-
};
|
|
360
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListServerPrivateNetworksResponse' failed as data isn't a dictionary.`);
|
|
361
|
+
return {
|
|
362
|
+
serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork),
|
|
363
|
+
totalCount: data.total_count
|
|
364
|
+
};
|
|
527
365
|
};
|
|
528
366
|
const unmarshalListServersResponse = (data) => {
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
return {
|
|
535
|
-
servers: unmarshalArrayOfObject(data.servers, unmarshalServer),
|
|
536
|
-
totalCount: data.total_count
|
|
537
|
-
};
|
|
367
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`);
|
|
368
|
+
return {
|
|
369
|
+
servers: unmarshalArrayOfObject(data.servers, unmarshalServer),
|
|
370
|
+
totalCount: data.total_count
|
|
371
|
+
};
|
|
538
372
|
};
|
|
539
373
|
const unmarshalListSettingsResponse = (data) => {
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
return {
|
|
546
|
-
settings: unmarshalArrayOfObject(data.settings, unmarshalSetting),
|
|
547
|
-
totalCount: data.total_count
|
|
548
|
-
};
|
|
374
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSettingsResponse' failed as data isn't a dictionary.`);
|
|
375
|
+
return {
|
|
376
|
+
settings: unmarshalArrayOfObject(data.settings, unmarshalSetting),
|
|
377
|
+
totalCount: data.total_count
|
|
378
|
+
};
|
|
549
379
|
};
|
|
550
380
|
const unmarshalSetServerPrivateNetworksResponse = (data) => {
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
};
|
|
560
|
-
const marshalSchemaPartition = (request, defaults) => ({
|
|
561
|
-
label: request.label,
|
|
562
|
-
number: request.number,
|
|
563
|
-
size: request.size,
|
|
564
|
-
use_all_available_space: request.useAllAvailableSpace
|
|
381
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetServerPrivateNetworksResponse' failed as data isn't a dictionary.`);
|
|
382
|
+
return { serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork) };
|
|
383
|
+
};
|
|
384
|
+
var marshalSchemaPartition = (request, defaults) => ({
|
|
385
|
+
label: request.label,
|
|
386
|
+
number: request.number,
|
|
387
|
+
size: request.size,
|
|
388
|
+
use_all_available_space: request.useAllAvailableSpace
|
|
565
389
|
});
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
390
|
+
var marshalSchemaPool = (request, defaults) => ({
|
|
391
|
+
devices: request.devices,
|
|
392
|
+
filesystem_options: request.filesystemOptions,
|
|
393
|
+
name: request.name,
|
|
394
|
+
options: request.options,
|
|
395
|
+
type: request.type
|
|
572
396
|
});
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
397
|
+
var marshalSchemaDisk = (request, defaults) => ({
|
|
398
|
+
device: request.device,
|
|
399
|
+
partitions: request.partitions.map((elt) => marshalSchemaPartition(elt, defaults))
|
|
576
400
|
});
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
401
|
+
var marshalSchemaFilesystem = (request, defaults) => ({
|
|
402
|
+
device: request.device,
|
|
403
|
+
format: request.format,
|
|
404
|
+
mountpoint: request.mountpoint
|
|
581
405
|
});
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
});
|
|
587
|
-
const marshalSchemaZFS = (request, defaults) => ({
|
|
588
|
-
pools: request.pools.map((elt) => marshalSchemaPool(elt))
|
|
406
|
+
var marshalSchemaRAID = (request, defaults) => ({
|
|
407
|
+
devices: request.devices,
|
|
408
|
+
level: request.level,
|
|
409
|
+
name: request.name
|
|
589
410
|
});
|
|
411
|
+
var marshalSchemaZFS = (request, defaults) => ({ pools: request.pools.map((elt) => marshalSchemaPool(elt, defaults)) });
|
|
590
412
|
const marshalSchema = (request, defaults) => ({
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
413
|
+
disks: request.disks.map((elt) => marshalSchemaDisk(elt, defaults)),
|
|
414
|
+
filesystems: request.filesystems.map((elt) => marshalSchemaFilesystem(elt, defaults)),
|
|
415
|
+
raids: request.raids.map((elt) => marshalSchemaRAID(elt, defaults)),
|
|
416
|
+
zfs: request.zfs !== void 0 ? marshalSchemaZFS(request.zfs, defaults) : void 0
|
|
595
417
|
});
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
418
|
+
var marshalCreateServerRequestInstall = (request, defaults) => ({
|
|
419
|
+
hostname: request.hostname,
|
|
420
|
+
os_id: request.osId,
|
|
421
|
+
partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema, defaults) : void 0,
|
|
422
|
+
password: request.password,
|
|
423
|
+
service_password: request.servicePassword,
|
|
424
|
+
service_user: request.serviceUser,
|
|
425
|
+
ssh_key_ids: request.sshKeyIds,
|
|
426
|
+
user: request.user
|
|
605
427
|
});
|
|
606
428
|
const marshalCreateServerRequest = (request, defaults) => ({
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
value: request.organizationId
|
|
625
|
-
}
|
|
626
|
-
])
|
|
627
|
-
});
|
|
628
|
-
const marshalAddOptionServerRequest = (request, defaults) => ({
|
|
629
|
-
expires_at: request.expiresAt
|
|
429
|
+
description: request.description,
|
|
430
|
+
install: request.install !== void 0 ? marshalCreateServerRequestInstall(request.install, defaults) : void 0,
|
|
431
|
+
name: request.name,
|
|
432
|
+
offer_id: request.offerId,
|
|
433
|
+
option_ids: request.optionIds,
|
|
434
|
+
protected: request.protected,
|
|
435
|
+
tags: request.tags,
|
|
436
|
+
user_data: request.userData,
|
|
437
|
+
...resolveOneOf([{
|
|
438
|
+
default: defaults.defaultProjectId,
|
|
439
|
+
param: "project_id",
|
|
440
|
+
value: request.projectId
|
|
441
|
+
}, {
|
|
442
|
+
default: defaults.defaultOrganizationId,
|
|
443
|
+
param: "organization_id",
|
|
444
|
+
value: request.organizationId
|
|
445
|
+
}])
|
|
630
446
|
});
|
|
447
|
+
const marshalAddOptionServerRequest = (request, defaults) => ({ expires_at: request.expiresAt });
|
|
631
448
|
const marshalInstallServerRequest = async (request, defaults) => ({
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
});
|
|
642
|
-
const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({
|
|
643
|
-
private_network_id: request.privateNetworkId
|
|
644
|
-
});
|
|
645
|
-
const marshalPrivateNetworkApiSetServerPrivateNetworksRequest = (request, defaults) => ({
|
|
646
|
-
private_network_ids: request.privateNetworkIds
|
|
449
|
+
hostname: request.hostname,
|
|
450
|
+
os_id: request.osId,
|
|
451
|
+
partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema, defaults) : void 0,
|
|
452
|
+
password: request.password,
|
|
453
|
+
service_password: request.servicePassword,
|
|
454
|
+
service_user: request.serviceUser,
|
|
455
|
+
ssh_key_ids: request.sshKeyIds,
|
|
456
|
+
user: request.user,
|
|
457
|
+
user_data: request.userData !== void 0 ? await marshalBlobToScwFile(request.userData) : void 0
|
|
647
458
|
});
|
|
459
|
+
const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({ private_network_id: request.privateNetworkId });
|
|
460
|
+
const marshalPrivateNetworkApiSetServerPrivateNetworksRequest = (request, defaults) => ({ private_network_ids: request.privateNetworkIds });
|
|
648
461
|
const marshalRebootServerRequest = (request, defaults) => ({
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
});
|
|
652
|
-
const marshalStartBMCAccessRequest = (request, defaults) => ({
|
|
653
|
-
ip: request.ip
|
|
462
|
+
boot_type: request.bootType,
|
|
463
|
+
ssh_key_ids: request.sshKeyIds
|
|
654
464
|
});
|
|
465
|
+
const marshalStartBMCAccessRequest = (request, defaults) => ({ ip: request.ip });
|
|
655
466
|
const marshalStartServerRequest = (request, defaults) => ({
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
});
|
|
659
|
-
const marshalUpdateIPRequest = (request, defaults) => ({
|
|
660
|
-
reverse: request.reverse
|
|
467
|
+
boot_type: request.bootType,
|
|
468
|
+
ssh_key_ids: request.sshKeyIds
|
|
661
469
|
});
|
|
470
|
+
const marshalUpdateIPRequest = (request, defaults) => ({ reverse: request.reverse });
|
|
662
471
|
const marshalUpdateServerRequest = (request, defaults) => ({
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
});
|
|
669
|
-
const marshalUpdateSettingRequest = (request, defaults) => ({
|
|
670
|
-
enabled: request.enabled
|
|
472
|
+
description: request.description,
|
|
473
|
+
name: request.name,
|
|
474
|
+
protected: request.protected,
|
|
475
|
+
tags: request.tags,
|
|
476
|
+
user_data: request.userData
|
|
671
477
|
});
|
|
478
|
+
const marshalUpdateSettingRequest = (request, defaults) => ({ enabled: request.enabled });
|
|
672
479
|
const marshalValidatePartitioningSchemaRequest = (request, defaults) => ({
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
480
|
+
offer_id: request.offerId,
|
|
481
|
+
os_id: request.osId,
|
|
482
|
+
partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema, defaults) : void 0
|
|
676
483
|
});
|
|
677
|
-
export {
|
|
678
|
-
marshalAddOptionServerRequest,
|
|
679
|
-
marshalCreateServerRequest,
|
|
680
|
-
marshalInstallServerRequest,
|
|
681
|
-
marshalPrivateNetworkApiAddServerPrivateNetworkRequest,
|
|
682
|
-
marshalPrivateNetworkApiSetServerPrivateNetworksRequest,
|
|
683
|
-
marshalRebootServerRequest,
|
|
684
|
-
marshalSchema,
|
|
685
|
-
marshalStartBMCAccessRequest,
|
|
686
|
-
marshalStartServerRequest,
|
|
687
|
-
marshalUpdateIPRequest,
|
|
688
|
-
marshalUpdateServerRequest,
|
|
689
|
-
marshalUpdateSettingRequest,
|
|
690
|
-
marshalValidatePartitioningSchemaRequest,
|
|
691
|
-
unmarshalBMCAccess,
|
|
692
|
-
unmarshalGetServerMetricsResponse,
|
|
693
|
-
unmarshalIP,
|
|
694
|
-
unmarshalListOSResponse,
|
|
695
|
-
unmarshalListOffersResponse,
|
|
696
|
-
unmarshalListOptionsResponse,
|
|
697
|
-
unmarshalListServerEventsResponse,
|
|
698
|
-
unmarshalListServerPrivateNetworksResponse,
|
|
699
|
-
unmarshalListServersResponse,
|
|
700
|
-
unmarshalListSettingsResponse,
|
|
701
|
-
unmarshalOS,
|
|
702
|
-
unmarshalOffer,
|
|
703
|
-
unmarshalOption,
|
|
704
|
-
unmarshalSchema,
|
|
705
|
-
unmarshalServer,
|
|
706
|
-
unmarshalServerPrivateNetwork,
|
|
707
|
-
unmarshalSetServerPrivateNetworksResponse,
|
|
708
|
-
unmarshalSetting
|
|
709
|
-
};
|
|
484
|
+
export { marshalAddOptionServerRequest, marshalCreateServerRequest, marshalInstallServerRequest, marshalPrivateNetworkApiAddServerPrivateNetworkRequest, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, marshalRebootServerRequest, marshalSchema, marshalStartBMCAccessRequest, marshalStartServerRequest, marshalUpdateIPRequest, marshalUpdateServerRequest, marshalUpdateSettingRequest, marshalValidatePartitioningSchemaRequest, unmarshalBMCAccess, unmarshalGetServerMetricsResponse, unmarshalIP, unmarshalListOSResponse, unmarshalListOffersResponse, unmarshalListOptionsResponse, unmarshalListServerEventsResponse, unmarshalListServerPrivateNetworksResponse, unmarshalListServersResponse, unmarshalListSettingsResponse, unmarshalOS, unmarshalOffer, unmarshalOption, unmarshalSchema, unmarshalServer, unmarshalServerPrivateNetwork, unmarshalSetServerPrivateNetworksResponse, unmarshalSetting };
|